1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:smithsonian-sentry":true});var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ab25dea-4936-451a-8dcf-48b4971a17f0",e._sentryDebugIdIdentifier="sentry-dbid-7ab25dea-4936-451a-8dcf-48b4971a17f0");}catch(e){}}(); 2var BUILD_ID; 3/******/ (() => { // webpackBootstrap 4/******/ var __webpack_modules__ = ({ 5 6/***/ "./smithsonian/frontend/src/js/ads/freestar/views/AdView.js" 7/*!******************************************************************!*\ 8 !*** ./smithsonian/frontend/src/js/ads/freestar/views/AdView.js ***! 9 \******************************************************************/ 10(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 11 12"use strict"; 13__webpack_require__.r(__webpack_exports__); 14/* harmony export */ __webpack_require__.d(__webpack_exports__, { 15/* harmony export */ AdView: () => (/* binding */ AdView) 16/* harmony export */ }); 17/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js"); 18/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_0__); 19/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 20/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__); 21/* harmony import */ var _freestartag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../freestartag */ "./smithsonian/frontend/src/js/ads/freestartag.js"); 22/* harmony import */ var _freestartag__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_freestartag__WEBPACK_IMPORTED_MODULE_2__); 23/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! loglevel */ "./node_modules/loglevel/lib/loglevel.js"); 24/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_3__); 25 26 27 28 29var AdView = backbone__WEBPACK_IMPORTED_MODULE_0___default().View.extend({ 30 initialize: function initialize(options) { 31 /* 32 * Ad View: 33 * Instantiates the Ad with selected options 34 */ 35 // slot configuration 36 if (options.outOfPage) { 37 this.slot = googletag.defineOutOfPageSlot(GPT.path, options.id); 38 } else { 39 this.slot = freestar.newAdSlots([{ 40 placementName: options.placementName, 41 slotId: this.id, 42 targeting: { 43 pos: options.pos 44 } 45 }]); 46 } 47 48 // set this.el to element 49 this.el = document.getElementById(options.id); 50 this.$el = jquery__WEBPACK_IMPORTED_MODULE_1___default()(this.el); 51 // set data-ad-setup attribute to determine which was have been 52 // lazy loaded already 53 this.$el.attr('data-ad-setup', 'true'); 54 // pub tags 55 var pubads = googletag.pubads(); 56 if (this.$el.attr('data-ad-endEvent')) { 57 pubads.addEventListener('slotRenderEnded', function (event) { 58 if (event.slot === this.slot) { 59 loglevel__WEBPACK_IMPORTED_MODULE_3__.info('Slot has been rendered:', this.id, 'empty: ' + event.isEmpty); 60 } 61 if (event.slot === this.slot && !event.isEmpty) { 62 // slot has been loaded, trigger global loaded event for this slot's id 63 loglevel__WEBPACK_IMPORTED_MODULE_3__.info('ads.rendered-' + this.id); 64 jquery__WEBPACK_IMPORTED_MODULE_1___default()(document).trigger('ads.rendered-' + this.id); 65 } 66 }.bind(this)); 67 } 68 // // this.slot.addService(pubads); 69 // if (options.collapseEmpty) { 70 // // https://support.google.com/dfp_premium/answer/3072674?hl=en 71 // this.slot.setCollapseEmptyDiv(true, true); 72 // } 73 // this.refresh = options.refresh === false ? false : true; 74 // if (GPT.SFP && options.platform === 'mobile') { 75 // this.slot.setTargeting('strnativekey', GPT.SFP); 76 // } 77 // this.slot.setTargeting('pos', options.pos); 78 // if (window.xp1_auds && window.xp1_auds.Nodes) { 79 // this.slot.setTargeting('demographics', window.xp1_auds.Nodes.join(',')); 80 // } else if (window.GPT.demographics) { 81 // this.slot.setTargeting('demographics', window.GPT.demographics); 82 // } 83 // if (GPT.SITE) { 84 // this.slot.setTargeting('site', GPT.SITE); 85 // } 86 // if (GPT.category) { 87 // this.slot.setTargeting('category', GPT.category); 88 // } 89 // if (GPT.tag) { 90 // this.slot.setTargeting('tag', GPT.tag); 91 // } 92 // if (GPT.type) { 93 // this.slot.setTargeting('type', GPT.type); 94 // } 95 // if (GPT.specials) { 96 // this.slot.setTargeting('special', GPT.specials); 97 // } 98 // if (GPT.url) { 99 // this.slot.setTargeting('url', GPT.url); 100 // } 101 // if (GPT.pagetype) { 102 // this.slot.setTargeting('pagetype', GPT.pagetype); 103 // } 104 // if (GPT.segment) { 105 // this.slot.setTargeting('segment', GPT.segment); 106 // } 107 // if (GPT.camera) { 108 // this.slot.setTargeting('camera', GPT.camera); 109 // } 110 // if (GPT.post) { 111 // this.slot.setTargeting('post', GPT.post); 112 // } 113 // if (GPT.referrer) { 114 // this.slot.setTargeting('referrer', GPT.referrer); 115 // } 116 // // if (options.loading === 'lazy') { 117 // // this.slot.setTargeting('lazyload') 118 // // } 119 // this.slot.setTargeting('initialSessionPage', GPT.initialSessionPage); 120 return this; 121 } 122}); 123 124/***/ }, 125 126/***/ "./smithsonian/frontend/src/js/ads/freestar/views/AdsAppView.js" 127/*!**********************************************************************!*\ 128 !*** ./smithsonian/frontend/src/js/ads/freestar/views/AdsAppView.js ***! 129 \**********************************************************************/ 130(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 131 132"use strict"; 133__webpack_require__.r(__webpack_exports__); 134/* harmony export */ __webpack_require__.d(__webpack_exports__, { 135/* harmony export */ FreeStarAdsAppView: () => (/* binding */ FreeStarAdsAppView) 136/* harmony export */ }); 137/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js"); 138/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_0__); 139/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 140/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); 141/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 142/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__); 143/* harmony import */ var _freestartag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../freestartag */ "./smithsonian/frontend/src/js/ads/freestartag.js"); 144/* harmony import */ var _freestartag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_freestartag__WEBPACK_IMPORTED_MODULE_3__); 145/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! loglevel */ "./node_modules/loglevel/lib/loglevel.js"); 146/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_4__); 147/* harmony import */ var _smithsonian_js_ads_freestar_views_AdView__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @smithsonian/js/ads/freestar/views/AdView */ "./smithsonian/frontend/src/js/ads/freestar/views/AdView.js"); 148 149 150 151 152 153 154var FreeStarAdsAppView = backbone__WEBPACK_IMPORTED_MODULE_0___default().View.extend({ 155 /* 156 * Ads App View: 157 * Manages which type of ads show be displayed (desktop or mobile) 158 * and when they should be refreshed 159 */ 160 161 video: false, 162 activeAds: [], 163 /* 164 * when a number of user actions occur, the ads should refresh 165 * this actionCount serves as placeholder for this. 166 */ 167 actionCount: 0, 168 settings: [{ 169 name: 'desktopMain', 170 // id: 'div-gpt-ad-chuckweasley-1', 171 placementName: 'smithsonianmag_rail_right_1_new' 172 }, { 173 name: 'desktopOneByOne', 174 placementName: 'smithsonianmag_rail_right_1_new' 175 }, { 176 name: 'desktopSecondary', 177 // id: 'div-gpt-ad-chuckweasley-secondary', 178 placementName: 'smithsonianmag_rail_right_1_new' 179 }, { 180 name: 'desktopSideTop', 181 placementName: 'smithsonianmag_rail_right_1_new' 182 }, { 183 name: 'desktopSideHouseTop', 184 // id: 'div-gpt-ad-chuckweasley-house-top', 185 placementName: 'smithsonianmag_rail_right_2_new' 186 }, { 187 name: 'desktopSideHouseBottom', 188 //id: 'div-gpt-ad-chuckweasley-house-bottom', 189 placementName: 'smithsonianmag_rail_right_1_new' 190 }, { 191 name: 'desktopSideBottom', 192 placementName: 'smithsonianmag_rail_right_2_new' 193 }, { 194 name: 'desktopSideLongform', 195 placementName: 'smithsonianmag_longform_right_rail_1_new' 196 }, { 197 name: 'desktopInArticle', 198 // ad overrides should be named as desktopInArticle-0 (starting with 0 for the first positioplacementName:"smithsonianmag_rail_right_1_new", 199 placementName: 'smithsonianmag_article_incontent_new', 200 pos: ['inarticle'] 201 }, { 202 name: 'desktopInArticle-0', 203 placementName: 'smithsonianmag_article_incontent_top_new', 204 pos: ['inarticle-0'] 205 }, { 206 name: 'mobileMain', 207 // id: 'div-gpt-ad-chuckweasley-mobile-1', 208 placementName: 'smithsonianmag_article_incontent_new' 209 }, { 210 name: 'mobileMainSecondary', 211 // id: 'div-gpt-ad-chuckweasley-mobile-secondary', 212 placementName: 'smithsonianmag_article_incontent_new' 213 }, { 214 name: 'mobileBottom', 215 // id: 'div-gpt-ad-chuckweasley-mobile-2', 216 placementName: 'smithsonianmag_rail_right_1_new' 217 }, { 218 name: 'mobileInArticle', 219 // ad overrides should be named as mobileInArticle-0 (starting with 0 for the first position) 220 placementName: 'smithsonianmag_rail_right_1_new', 221 pos: ['mobile-inarticle'] 222 }, { 223 name: 'mobileInArticle-0', 224 placementName: 'smithsonianmag_rail_right_1_new', 225 pos: ['mobile-inarticle-0'] 226 }, { 227 name: 'smithsonianmag_1x1_bouncex', 228 // 1x1 bouncex 229 placementName: 'smithsonianmag_1x1_bouncex' 230 }], 231 initialize: function initialize(options) { 232 lodash__WEBPACK_IMPORTED_MODULE_1___default().bindAll(this, 'adsViewportRefresh', 'adSetup', 'adSlotSetup', 'getSettings', 'onDOMContentLoaded'); 233 options = options ? options : {}; 234 this.video = options.video ? true : false;
235 236 // list of ads to disable. (ads are all enabled by default) 237 this.disableAd = options.disableAd ? options.disableAd : null; 238 lodash__WEBPACK_IMPORTED_MODULE_1___default().each(options.ads, function (obj, key) { 239 var settings = this.getSettings(obj.name); 240 if (settings) { 241 lodash__WEBPACK_IMPORTED_MODULE_1___default().extend(settings, obj.attrs); 242 } 243 }, this); 244 this.setup(); 245 if (options.mobileInArticleAds) { 246 this.mobileInArticleAds = options.mobileInArticleAds; 247 } else if (typeof window !== 'undefined' && window.GPT && typeof window.GPT.mobile_order === 'string' && window.GPT.mobile_order.trim() !== '') { 248 this.mobileInArticleAds = window.GPT.mobile_order.replace(/\s/g, '').split(',').map(function (pos) { 249 return parseInt(pos, 10); 250 }); 251 } else { 252 this.mobileInArticleAds = [2, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49]; 253 } 254 if (options.desktopInArticleAds) { 255 this.desktopInArticleAds = options.desktopInArticleAds; 256 } else if (typeof window !== 'undefined' && window.GPT && typeof window.GPT.desktop_order === 'string' && window.GPT.desktop_order.trim() !== '') { 257 this.desktopInArticleAds = window.GPT.desktop_order.replace(/\s/g, '').split(',').map(function (pos) { 258 return parseInt(pos, 10); 259 }); 260 } else { 261 this.desktopInArticleAds = [2, 6, 11, 15, 19, 24, 29, 34, 39, 44, 49]; 262 } 263 264 // refresh ads on slideshow change 265 jquery__WEBPACK_IMPORTED_MODULE_2___default()(document).on('slideshow:change', this.adsViewportRefresh); 266 // refresh on essay change 267 jquery__WEBPACK_IMPORTED_MODULE_2___default()(document).on('essay:change', this.adsViewportRefresh); 268 269 // insert ad placeholders to the DOM 270 document.addEventListener('DOMContentLoaded', this.onDOMContentLoaded, { 271 once: true 272 }); 273 // bind photocontest ajax response, and re-setup AdsAppView with new ads 274 document.addEventListener('photocontest:pagination', function (evt) { 275 // refresh ads 276 this.paginate(evt.detail); 277 }.bind(this)); 278 document.addEventListener('photocontest:open-lightbox', function (evt) { 279 if (document.getElementById('div-gpt-ad-chuckweasley-photocontest-top')) { 280 var photoContestSlot = this.getSlots().find(function (s) { 281 return s.getSlotId().getDomId() === 'div-gpt-ad-chuckweasley-photocontest-top'; 282 }); 283 if (photoContestSlot) { 284 // refresh existing ad slot 285 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('photocontest-ad.refresh'); 286 googletag.pubads().refresh([photoContestSlot]); 287 } else { 288 // setup new ad slot 289 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('photocontest-ad.setup'); 290 this.adSlotSetup(null, jquery__WEBPACK_IMPORTED_MODULE_2___default()('#div-gpt-ad-chuckweasley-photocontest-top')); 291 } 292 } 293 }.bind(this)); 294 }, 295 setup: function setup() { 296 /* 297 * Setup and instantiate ads 298 * We need to reference 'this' (AdsAppView instance) 299 * to get the ad settings, but we can't override 'this' within 300 * the googletag. 301 */ 302 var that = this; 303 freestar.queue.push(function () { 304 googletag.pubads().set('page_url', GPT.DOMAIN); 305 }); 306 freestar.queue.push(function () { 307 // video ads 308 if (that.video) { 309 googletag.companionAds().setRefreshUnfilledSlots(true); 310 } 311 // set targeting site 312 googletag.pubads().setTargeting('Site', [window.GPT.SITE]); 313 314 // // lazy loading settings 315 // googletag.pubads().enableLazyLoad({ 316 // // Fetch slots within 5 viewports. 317 // fetchMarginPercent: 200, // Render slots within 2 viewports. 318 // renderMarginPercent: 100, // Double the above values on mobile, where viewports are smaller 319 // // and users tend to scroll faster. 320 // mobileScaling: 2.0, 321 // }); 322 323 // googletag 324 // .pubads() 325 // .addEventListener('impressionViewable', function (event) { 326 // // refresh ad 20s after an impression has occurred 327 // const $adSlot = $('#' + event.slot.getSlotElementId()); 328 // if ($adSlot) { 329 // let addSettings = $adSlot.data('ad-settings'); 330 // const settings = that.getSettings(addSettings); 331 // if (settings.refresh) { 332 // setTimeout(function () { 333 // console.log('ad refresh:', addSettings, event.slot.getSlotElementId()); 334 // googletag.pubads().refresh([event.slot]); 335 // }, 20000); 336 // } 337 // } 338 // }) 339 // .addEventListener('slotOnload', function (event) { 340 // var slot = event.slot; 341 // var slotId = slot.getSlotId().getDomId(); 342 // var $adSlot; 343 // var $sidebarAdSlot; 344 // // initial position for ad slot 345 // if (slotId.match('desktopInArticle-[0-9]{0,}-sidebar')) { 346 // $adSlot = $('#' + slotId.replace('-sidebar', '')).parents('.ad-wrapper'); 347 // $sidebarAdSlot = $('#' + slotId); 348 // $sidebarAdSlot 349 // .parent() 350 // .css('top', $adSlot.offset().top + 340); 351 // } 352 // }); 353 354 // googletag.enableServices(); 355 }); 356 }, 357 isMobile: function isMobile() { 358 return window.innerWidth < 1000; 359 }, 360 getSettings: function getSettings(settingsName) { 361 return lodash__WEBPACK_IMPORTED_MODULE_1___default().find(this.settings, function (item) { 362 return settingsName === item.name; 363 }); 364 }, 365 onDOMContentLoaded: function onDOMContentLoaded() { 366 var that = this; 367 var $articleBody = jquery__WEBPACK_IMPORTED_MODULE_2___default()('[data-article-body]'); 368 var $articleBodyPg = $articleBody.children('p, figure, blockquote'); 369 var $articleSidebar = jquery__WEBPACK_IMPORTED_MODULE_2___default()('.article .articleRight'); 370 var $longformSidebar = jquery__WEBPACK_IMPORTED_MODULE_2___default()('.article .article-fullwidth-right-column'); 371 var adNamePrefix = 'desktopInArticle-'; 372 var baseAdSettings = 'desktopInArticle'; 373 // let articleAds = this.desktopInArticleAds; 374 // let adNamePrefix = this.isMobile() 375 // ? 'mobileInArticle-' 376 // : 'desktopInArticle-'; 377 // let baseAdSettings = this.isMobile() 378 // ? 'mobileInArticle' 379 // : 'desktopInArticle'; 380 var articleAds = this.isMobile() ? this.mobileInArticleAds : this.desktopInArticleAds; 381 var $mostPopular = jquery__WEBPACK_IMPORTED_MODULE_2___default()('#id_most_popular'); 382 var FULL_WIDTH_AD_HEIGHT = 380; 383 var FULL_WIDTH_AD_MARGIN = 24; 384 var FULL_WIDTH_AD_TOTAL_HEIGHT = FULL_WIDTH_AD_HEIGHT + 2 * FULL_WIDTH_AD_MARGIN; 385 if (!lodash__WEBPACK_IMPORTED_MODULE_1___default().isArray(articleAds)) { 386 articleAds = lodash__WEBPACK_IMPORTED_MODULE_1___default().range(articleAds, $articleBodyPg.length, articleAds); 387 } 388 389 // in-article ads 390 // these ads are dynamically inserted into the DOM 391 // mobile vs desktop breakpoint @ 1068px 392 var bottoms = []; 393 if ($articleBody.length) { 394 lodash__WEBPACK_IMPORTED_MODULE_1___default().each(articleAds, function (adPosition, key) {
395 var adSettings = baseAdSettings; 396 var $adNode; 397 var $sidebarAdNode; 398 var $sidebarLongformAdNode; 399 var adId = adNamePrefix + key; 400 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('in-article adSettings', adSettings, key); 401 if (this.getSettings(adId)) { 402 adSettings = adId; 403 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('in-article adSettings-X override', adSettings); 404 } 405 // loop should finish if there are there are no more paragraphs where to render ads 406 if (adPosition >= $articleBodyPg.length) { 407 return; 408 } 409 if (window.GPT && adPosition === window.GPT.desktop_video_player_ad_position && adSettings === 'desktopInArticle-0' || adPosition === 2 && adSettings === 'desktopInArticle-0') { 410 // incontent-top placement (replaces former video player position) 411 $adNode = jquery__WEBPACK_IMPORTED_MODULE_2___default()('<div id="' + adId + '" class="ad-slot ad-slot-video" data-ad-settings="' + adSettings + '"></div>'); 412 } else if (window.GPT && adPosition === window.GPT.mobile_video_player_ad_position && this.isMobile() || adPosition === 2 && this.isMobile()) { 413 // incontent-top placement (replaces former video player position) 414 $adNode = jquery__WEBPACK_IMPORTED_MODULE_2___default()('<div id="' + adId + '" class="ad-slot ad-slot-video" data-ad-settings="' + adSettings + '"></div>'); 415 } else if (this.isMobile()) { 416 // render just the ad, no full width 417 $adNode = jquery__WEBPACK_IMPORTED_MODULE_2___default()('<div id="' + adId + '" class="ad-slot article-slot-centered hidden-desktop" data-ad-settings="' + adSettings + '"></div>'); 418 } else { 419 $adNode = jquery__WEBPACK_IMPORTED_MODULE_2___default()('<div class="ad-wrapper calc-full-width"><div class="ad-container"><div id="' + adId + '" class="ad-slot ad-article-slot" data-ad-settings="' + adSettings + '"></div></div></div>'); 420 /* 421 if (!this.isMobile()) { 422 // sidebar ad below full width ad 423 $sidebarAdNode = $( 424 '<div class="ad-sidebar-wrapper"><div id="' + 425 adId + 426 '-sidebar" class="ad-slot" data-ad-settings="desktopSideBottom" data-article-ad="' + 427 adId + 428 '"></div>' 429 ); 430 $sidebarLongformAdNode = $( 431 '<div class="ad-sidebar-wrapper"><div id="' + 432 adId + 433 '-sidebar" class="ad-slot" data-ad-settings="desktopSideLongform" data-article-ad="' + 434 adId + 435 '"></div>' 436 ); 437 $articleSidebar.append($sidebarAdNode); 438 $longformSidebar.append($sidebarLongformAdNode); 439 } 440 */ 441 } 442 if (this.isMobile()) { 443 $adNode.addClass('article-slot-centered hidden-desktop'); 444 } 445 if ($articleSidebar.length === 0) { 446 jquery__WEBPACK_IMPORTED_MODULE_2___default()('.article .article-columns').addClass('single-column'); 447 } 448 if ($longformSidebar.length === 0) { 449 jquery__WEBPACK_IMPORTED_MODULE_2___default()('.article .article-fullwidth-right-column').addClass('single-column'); 450 } 451 jquery__WEBPACK_IMPORTED_MODULE_2___default()($articleBodyPg[adPosition]).before($adNode); 452 453 /* TODO: 978 remove 454 function calcCurrentAdBottom() { 455 const bottom = $adNode.offset().top; 456 bottoms[key - 1] = bottom; 457 return bottom; 458 } 459 function calcCurrentAdHeight(topFunc, bottomFunc) { 460 const currentAdTop = topFunc(); 461 const bottom = bottomFunc(); 462 let adHeight; 463 if (key == 1) { 464 adHeight = 465 bottom - currentAdTop - FULL_WIDTH_AD_MARGIN; 466 } else { 467 adHeight = bottom - currentAdTop; 468 } 469 return adHeight; 470 } 471 if ( 472 $articleSidebar.length && 473 $sidebarAdNode !== undefined 474 ) { 475 function calcSidebarCurrentAdTop() { 476 let top; 477 if (key === 1) { 478 if ($mostPopular) { 479 top = 480 $mostPopular.offset().top + 481 $mostPopular.height(); 482 } else { 483 top = $sidebarAdNode.offset().top; 484 } 485 } else { 486 top = 487 bottoms[key - 2] + 488 FULL_WIDTH_AD_TOTAL_HEIGHT; 489 } 490 return top; 491 } 492 if (key !== 1) { 493 $sidebarAdNode.css( 494 'top', 495 (key - 1) * FULL_WIDTH_AD_TOTAL_HEIGHT + 'px' 496 ); 497 } 498 function setAdHeight() { 499 // Calculate height to align position for sidebar ad slot 500 const adHeight = calcCurrentAdHeight( 501 calcSidebarCurrentAdTop, 502 calcCurrentAdBottom 503 ); 504 $sidebarAdNode.css('height', adHeight); 505 } 506 const intervalId = setInterval(setAdHeight, 500); 507 setTimeout(function () { 508 clearInterval(intervalId); 509 }, 50000); 510 // fire something at the end of a resize event 511 function resizedw() { 512 setAdHeight(); 513 } 514 var doit; 515 window.onresize = function () { 516 clearTimeout(doit); 517 doit = setTimeout(resizedw, 250); 518 }; 519 } 520 if ( 521 $longformSidebar.length && 522 $sidebarLongformAdNode !== undefined 523 ) { 524 // align position for sidebar ad slots 525 $sidebarLongformAdNode.css( 526 'top', 527 (key - 1) * FULL_WIDTH_AD_TOTAL_HEIGHT + 'px' 528 ); 529 function calcSidebarLongformCurrentAdTop() { 530 let top; 531 if (key === 1) { 532 top = $longformSidebar.offset().top; 533 } else { 534 top = 535 bottoms[key - 2] + 536 FULL_WIDTH_AD_TOTAL_HEIGHT; 537 } 538 return top; 539 } 540 function setLongformAdHeight() { 541 // Calculate height to align position for sidebar ad slots 542 const adHeight = calcCurrentAdHeight( 543 calcSidebarLongformCurrentAdTop, 544 calcCurrentAdBottom 545 ); 546 $sidebarLongformAdNode.css('height', adHeight); 547 } 548 const intervalId = setInterval( 549 setLongformAdHeight, 550 500 551 ); 552 setTimeout(function () { 553 clearInterval(intervalId); 554 }, 50000); 555 // fire something at the end of a resize event 556 function resizedw() { 557 setLongformAdHeight(); 558 } 559 var doit; 560 window.onresize = function () { 561 clearTimeout(doit); 562 doit = setTimeout(resizedw, 250); 563 }; 564 } 565 // add padding at the bottom of the article when the ad is longer than the article 566 var $lastAd = $('.articleLeft .ad-wrapper'); 567 if ($lastAd.length) { 568 var lastAdHeight = 569 $lastAd.offset().top + $lastAd.height() + 700; 570 var articleHeight = 571 $articleBody.offset().top + $articleBody.height(); 572 if (lastAdHeight > articleHeight) { 573 $articleBody.css( 574 'padding-bottom', 575 lastAdHeight - articleHeight 576 ); 577 } 578 } 579 */ 580 }.bind(this), this); 581 } 582 583 // Add sidebar ads 584 var $sidebar = $articleSidebar.add($longformSidebar); 585 if (!this.isMobile() && $sidebar.length) { 586 var updateSidebarAds = function updateSidebarAds() { 587 var childHeight = 0; 588 $sidebarChildren.each(function (_, child) { 589 childHeight += jquery__WEBPACK_IMPORTED_MODULE_2___default()(child).outerHeight(true); 590 }); 591 // Round down so we have a gap at the bottom of the sidebar rather than article 592 var numSlots = Math.floor((articleWrap.clientHeight - childHeight) / slotHeight); 593 var diff = numSlots - sidebarAds.length; 594 595 // Add slots 596 var _loop = function _loop() { 597 // id=i+2 - 1-indexed, one already present 598 var adId = "smithsonianmag_rail_right_2_new_".concat(i + 2); 599 var $adNode = jquery__WEBPACK_IMPORTED_MODULE_2___default()("<div align=\"center\" data-freestar-ad=\"__300x600\" id=\"".concat(adId, "\" name=\"smithsonianmag_rail_right_2_new\" class=\"ad-sidebar-new placer-right\">\n <script data-cfasync=\"false\" type=\"text/javascript\">\n freestar.config.enabled_slots.push({ placementName: \"smithsonianmag_rail_right_2_new\", slotId: \"").concat(adId, "\" });\n </script>\n </div>")); 600 var $adWrap = jquery__WEBPACK_IMPORTED_MODULE_2___default()("<div class=\"ad-sidebar-new-wrapper\"></div>").append($adNode); 601 $sidebar.append($adWrap); 602 sidebarAds.push($adWrap); 603 604 // Register with freestar 605 freestar.queue.push(function () { 606 return that.adSlotSetup($adNode); 607 }); 608 }; 609 for (var i = sidebarAds.length; i < numSlots; i++) { 610 _loop(); 611 } 612 613 // Remove extra slots 614 if (diff < 0) { 615 var removing = sidebarAds.splice(diff, -diff); 616 removing.forEach(function ($adWrap) { 617 return $adWrap.remove(); 618 }); 619 } 620 }; 621 var slotHeight = parseInt(getComputedStyle(document.body).getPropertyValue('--sidebar-slot-height'), 10); 622 var articleWrap = document.querySelector('.articleLeft > .articleWrap'); 623 var $sidebarChildren = $sidebar.children(); 624 var sidebarAds = []; 625 updateSidebarAds(); 626 627 // Watch for height changes 628 var adSpaceObserver = new ResizeObserver(function (entries) { 629 updateSidebarAds(); 630 }); 631 adSpaceObserver.observe(articleWrap); 632 $sidebarChildren.each(function (_, child) { 633 adSpaceObserver.observe(child); 634 }); 635 } 636 /* TODO: 978 remove 637 // add a trailling sidebar ad 638 if ( 639 !this.isMobile() && 640 ($articleSidebar.children().length > 1 || 641 $longformSidebar.children().length > 1) 642 ) { 643 // sidebar ad below the last full width ad and above the `div.footerLogo` 644 let adCnt; 645 let $traillingAdNode; 646 if ($articleSidebar.length) { 647 adCnt = $articleSidebar.children().length; 648 const adId = adNamePrefix + (adCnt + 1); 649 $traillingAdNode = $( 650 '<div class="ad-sidebar-wrapper"><div id="' + 651 adId +
652 '-sidebar" class="ad-slot last" data-ad-settings="desktopSideBottom" data-article-ad="' + 653 adId + 654 '"></div>' 655 ); 656 $articleSidebar.append($traillingAdNode); 657 } else if ($longformSidebar.length) { 658 adCnt = $longformSidebar.children().length; 659 const adId = adNamePrefix + (adCnt + 1); 660 $traillingAdNode = $( 661 '<div class="ad-sidebar-wrapper"><div id="' + 662 adId + 663 '-sidebar" class="ad-slot last" data-ad-settings="desktopSideLongform" data-article-ad="' + 664 adId + 665 '"></div>' 666 ); 667 $longformSidebar.append($traillingAdNode); 668 } 669 if ($traillingAdNode !== undefined) { 670 function setSidebarAdNodeTopHeight() { 671 let $footer = $('footer'); 672 const fullWidthAdCnt = bottoms.length; 673 const previousBottom = bottoms[fullWidthAdCnt - 1]; 674 const height = 675 $footer.offset().top - 676 previousBottom - 677 FULL_WIDTH_AD_TOTAL_HEIGHT; 678 if (previousBottom > 0) { 679 $traillingAdNode.css( 680 'top', 681 fullWidthAdCnt * FULL_WIDTH_AD_TOTAL_HEIGHT + 'px' 682 ); 683 $traillingAdNode.css('height', height + 'px'); 684 } 685 } 686 const intervalId = setInterval(setSidebarAdNodeTopHeight, 500); 687 setTimeout(function () { 688 clearInterval(intervalId); 689 }, 50000); 690 // fire something at the end of a resize event 691 function resizedw() { 692 setSidebarAdNodeTopHeight(); 693 } 694 var doit; 695 window.onresize = function () { 696 clearTimeout(doit); 697 doit = setTimeout(resizedw, 250); 698 }; 699 } 700 } 701 */ 702 this.adSetup(); 703 }, 704 adSetup: function adSetup() { 705 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('adSetup'); 706 // check for ad spots that need to be activated based on the scroll location 707 // run every time the user scrolls 708 // filters ads based on rules and determines if it should be setup or not 709 var that = this; 710 var $ads = jquery__WEBPACK_IMPORTED_MODULE_2___default()('.ad-slot'); 711 var $filteredAds = $ads.filter(function (key, node) { 712 // filter ads to check if there's any ad that will be setup 713 // filtered ads will be a list of the ads that will be setup 714 // 715 // get the node 716 var $node = jquery__WEBPACK_IMPORTED_MODULE_2___default()(node); 717 // info for slot setup 718 var slotId = $node.attr('id'); 719 var adSettings = $node.data('ad-settings'); 720 721 // AD CONFIGURATION VALIDATION 722 // check if slot is configured to use ad settings 723 if (!adSettings || that.disableAd && that.disableAd.indexOf(adSettings) !== -1) { 724 return false; 725 } 726 727 // AD SETTINGS 728 var settings = lodash__WEBPACK_IMPORTED_MODULE_1___default().extend({ 729 id: slotId 730 }, that.getSettings(adSettings)); 731 732 // AD PLATFORM 733 if (settings.platform === 'mobile' && !this.isMobile()) { 734 // if platform mobile, but window width is desktop 735 // do nothing 736 loglevel__WEBPACK_IMPORTED_MODULE_4__.warn('Ad mobile only, but desktop window:', slotId); 737 return false; 738 } else if (settings.platform === 'desktop' && this.isMobile()) { 739 // if platform desktop, but window width is mobile 740 // do nothing 741 loglevel__WEBPACK_IMPORTED_MODULE_4__.warn('Ad desktop only, but mobile window:', slotId); 742 return false; 743 } 744 return true; 745 }.bind(this)); 746 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('Ads.scrollSetup', $filteredAds.length); 747 freestar.queue.push(function () { 748 $filteredAds.each(that.adSlotSetup); 749 }); 750 }, 751 adSlotSetup: function adSlotSetup(key, node) { 752 // setups up a whole ad slot 753 var $node = jquery__WEBPACK_IMPORTED_MODULE_2___default()(node); 754 // info for slot setup
755 var slotId = $node.attr('id'); 756 var adSettings = $node.data('ad-settings'); 757 758 // AD CONFIGURATION VALIDATION 759 // check if slot is configured to use ad settings 760 if (!adSettings) { 761 return false; 762 } 763 764 // AD SETTINGS 765 var settings = lodash__WEBPACK_IMPORTED_MODULE_1___default().extend({ 766 id: slotId 767 }, this.getSettings(adSettings)); 768 769 // AD INITIALIZATION 770 // use id from the DOM node id 771 // extend with settings defined in data-ad-settings 772 // instantiate ad with these settings 773 var ad = new _smithsonian_js_ads_freestar_views_AdView__WEBPACK_IMPORTED_MODULE_5__.AdView(settings); 774 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('Ad successful setup: ', ad.id); 775 // push ad to list of active ads 776 this.activeAds.push(ad); 777 778 // call googletag.display to display the ad slot 779 // freestar.display(ad.id); 780 781 // refresh the slot and show the ad 782 //log.info('ad slot refresh', ad.id); 783 //googletag.pubads().refresh([ad.slot]); 784 785 // Trigger an event stating that the ad was finished setting up. 786 // This is used on TweenTribune to determine if there is an 787 // interstitial to show. 788 jquery__WEBPACK_IMPORTED_MODULE_2___default()(document).trigger('ads.setup-' + ad.id, ad); 789 }, 790 getVisibilityState: function getVisibilityState() { 791 // get visibility state for all implementations (including prefixed browsers) 792 return document.visibilityState || document.webkitVisibilityState || document.mozVisibilityState || document.msVisibilityState; 793 }, 794 getSlots: function getSlots(ads) { 795 // return the list of slots (for refreshing purposes) 796 // from a list of ads 797 var slots = []; 798 // if an ads list is passed, use that 799 // else use all ads in this.activeAds 800 lodash__WEBPACK_IMPORTED_MODULE_1___default().each(ads ? ads : this.activeAds, function (obj, key) { 801 // if slot can be refreshed 802 if (obj.refresh) { 803 slots.push(obj.slot); 804 } 805 }, this); 806 return slots; 807 }, 808 inViewport: function inViewport(elem) { 809 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('inViewport', elem); 810 // check if an element is in the viewport 811 var $elem = jquery__WEBPACK_IMPORTED_MODULE_2___default()(elem); 812 var offset = $elem.offset(); 813 var pos = { 814 offsetTop: offset ? offset.top : 0, 815 height: $elem.height() 816 }; 817 var scrollY = jquery__WEBPACK_IMPORTED_MODULE_2___default()(window).scrollTop(); 818 // check if a little over 50% of the ad is within the viewport 819 var isInViewport = pos.offsetTop >= scrollY - pos.height / 2.25 && pos.offsetTop < scrollY + window.innerHeight - pos.height / 2.25; 820 return isInViewport; 821 }, 822 adsViewportRefresh: function adsViewportRefresh() { 823 var self = this; 824 // Refresh all ads between: 825 // start: window.scrollY 826 // end: window.scrollY + window.innerHeight 827 var ads = lodash__WEBPACK_IMPORTED_MODULE_1___default().filter(this.activeAds, function (obj, key) { 828 return self.inViewport(obj.el) && obj.refresh; 829 }); 830 loglevel__WEBPACK_IMPORTED_MODULE_4__.info('adsViewportRefresh', ads); 831 832 // get the slot list from the ad list 833 var slots = this.getSlots(ads); 834 // trigger ads refresh 835 if (googletag.pubads && slots.length) { 836 googletag.pubads().refresh(slots); 837 } 838 } 839}); 840 841/***/ }, 842 843/***/ "./smithsonian/frontend/src/js/ads/freestartag.js" 844/*!********************************************************!*\ 845 !*** ./smithsonian/frontend/src/js/ads/freestartag.js ***! 846 \********************************************************/ 847() { 848 849window.freestar = window.freestar || {}; 850freestar.queue = freestar.queue || []; 851freestar.config = freestar.config || {}; 852freestar.config.enabled_slots = freestar.config.enabled_slots || []; 853freestar.events = freestar.events || []; 854freestar.debug = false; 855 856/***/ }, 857 858/***/ "./node_modules/backbone/backbone.js" 859/*!*******************************************!*\ 860 !*** ./node_modules/backbone/backbone.js ***! 861 \*******************************************/ 862(module, exports, __webpack_require__) { 863 864var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.6.1 865 866// (c) 2010-2024 Jeremy Ashkenas and DocumentCloud 867// Backbone may be freely distributed under the MIT license. 868// For all details and documentation: 869// http://backbonejs.org 870 871(function(factory) { 872 873 // Establish the root object, `window` (`self`) in the browser, or `global` on the server. 874 // We use `self` instead of `window` for `WebWorker` support. 875 var root = typeof self == 'object' && self.self === self && self || 876 typeof __webpack_require__.g == 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g; 877 878 // Set up Backbone appropriately for the environment. Start with AMD. 879 if (true) { 880 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! underscore */ "./node_modules/underscore/modules/index-all.js"), __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports
880) { 881 // Export global even in AMD case in case this script is loaded with 882 // others that may still expect a global Backbone. 883 root.Backbone = factory(root, exports, _, $); 884 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 885 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 886 887 // Next for Node.js or CommonJS. jQuery may not be needed as a module. 888 } else // removed by dead control flow 889{ var _, $; } 890 891})(function(root, Backbone, _, $) { 892 893 // Initial Setup 894 // ------------- 895 896 // Save the previous value of the `Backbone` variable, so that it can be 897 // restored later on, if `noConflict` is used. 898 var previousBackbone = root.Backbone; 899 900 // Create a local reference to a common array method we'll want to use later. 901 var slice = Array.prototype.slice; 902 903 // Current version of the library. Keep in sync with `package.json`. 904 Backbone.VERSION = '1.6.1'; 905 906 // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns 907 // the `$` variable. 908 Backbone.$ = $; 909 910 // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable 911 // to its previous owner. Returns a reference to this Backbone object. 912 Backbone.noConflict = function() { 913 root.Backbone = previousBackbone; 914 return this; 915 }; 916 917 // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option 918 // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and 919 // set a `X-Http-Method-Override` header. 920 Backbone.emulateHTTP = false;
921 922 // Turn on `emulateJSON` to support legacy servers that can't deal with direct 923 // `application/json` requests ... this will encode the body as 924 // `application/x-www-form-urlencoded` instead and will send the model in a 925 // form param named `model`. 926 Backbone.emulateJSON = false; 927 928 // Backbone.Events 929 // --------------- 930 931 // A module that can be mixed in to *any object* in order to provide it with 932 // a custom event channel. You may bind a callback to an event with `on` or 933 // remove with `off`; `trigger`-ing an event fires all callbacks in 934 // succession. 935 // 936 // var object = {}; 937 // _.extend(object, Backbone.Events); 938 // object.on('expand', function(){ alert('expanded'); }); 939 // object.trigger('expand'); 940 // 941 var Events = Backbone.Events = {}; 942 943 // Regular expression used to split event strings. 944 var eventSplitter = /\s+/; 945 946 // A private global variable to share between listeners and listenees. 947 var _listening; 948 949 // Iterates over the standard `event, callback` (as well as the fancy multiple 950 // space-separated events `"change blur", callback` and jQuery-style event 951 // maps `{event: callback}`). 952 var eventsApi = function(iteratee, events, name, callback, opts) { 953 var i = 0, names; 954 if (name && typeof name === 'object') { 955 // Handle event maps. 956 if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback; 957 for (names = _.keys(name); i < names.length ; i++) { 958 events = eventsApi(iteratee, events, names[i], name[names[i]], opts); 959 } 960 } else if (name && eventSplitter.test(name)) { 961 // Handle space-separated event names by delegating them individually. 962 for (names = name.split(eventSplitter); i < names.length; i++) { 963 events = iteratee(events, names[i], callback, opts); 964 } 965 } else { 966 // Finally, standard events. 967 events = iteratee(events, name, callback, opts); 968 } 969 return events; 970 }; 971 972 // Bind an event to a `callback` function. Passing `"all"` will bind 973 // the callback to all events fired. 974 Events.on = function(name, callback, context) { 975 this._events = eventsApi(onApi, this._events || {}, name, callback, { 976 context: context, 977 ctx: this, 978 listening: _listening 979 }); 980 981 if (_listening) { 982 var listeners = this._listeners || (this._listeners = {}); 983 listeners[_listening.id] = _listening; 984 // Allow the listening to use a counter, instead of tracking 985 // callbacks for library interop 986 _listening.interop = false; 987 } 988 989 return this; 990 }; 991 992 // Inversion-of-control versions of `on`. Tell *this* object to listen to 993 // an event in another object... keeping track of what it's listening to 994 // for easier unbinding later. 995 Events.listenTo = function(obj, name, callback) { 996 if (!obj) return this; 997 var id = obj._listenId || (obj._listenId = _.uniqueId('l')); 998 var listeningTo = this._listeningTo || (this._listeningTo = {}); 999 var listening = _listening = listeningTo[id]; 1000 1001 // This object is not listening to any other events on `obj` yet. 1002 // Setup the necessary references to track the listening callbacks. 1003 if (!listening) { 1004 this._listenId || (this._listenId = _.uniqueId('l')); 1005 listening = _listening = listeningTo[id] = new Listening(this, obj); 1006 } 1007 1008 // Bind callbacks on obj. 1009 var error = tryCatchOn(obj, name, callback, this); 1010 _listening = void 0; 1011 1012 if (error) throw error; 1013 // If the target obj is not Backbone.Events, track events manually. 1014 if (listening.interop) listening.on(name, callback); 1015 1016 return this; 1017 }; 1018 1019 // The reducing API that adds a callback to the `events` object. 1020 var onApi = function(events, name, callback, options) { 1021 if (callback) { 1022 var handlers = events[name] || (events[name] = []); 1023 var context = options.context, ctx = options.ctx, listening = options.listening; 1024 if (listening) listening.count++; 1025 1026 handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening}); 1027 } 1028 return events; 1029 }; 1030 1031 // An try-catch guarded #on function, to prevent poisoning the global 1032 // `_listening` variable. 1033 var tryCatchOn = function(obj, name, callback, context) { 1034 try { 1035 obj.on(name, callback, context); 1036 } catch (e) { 1037 return e; 1038 } 1039 }; 1040 1041 // Remove one or many callbacks. If `context` is null, removes all 1042 // callbacks with that function. If `callback` is null, removes all 1043 // callbacks for the event. If `name` is null, removes all bound 1044 // callbacks for all events. 1045 Events.off = function(name, callback, context) { 1046 if (!this._events) return this; 1047 this._events = eventsApi(offApi, this._events, name, callback, { 1048 context: context, 1049 listeners: this._listeners 1050 }); 1051 1052 return this; 1053 }; 1054 1055 // Tell this object to stop listening to either specific events ... or 1056 // to every object it's currently listening to. 1057 Events.stopListening = function(obj, name, callback) { 1058 var listeningTo = this._listeningTo; 1059 if (!listeningTo) return this; 1060 1061 var ids = obj ? [obj._listenId] : _.keys(listeningTo); 1062 for (var i = 0; i < ids.length; i++) { 1063 var listening = listeningTo[ids[i]]; 1064 1065 // If listening doesn't exist, this object is not currently 1066 // listening to obj. Break out early. 1067 if (!listening) break; 1068 1069 listening.obj.off(name, callback, this); 1070 if (listening.interop) listening.off(name, callback); 1071 } 1072 if (_.isEmpty(listeningTo)) this._listeningTo = void 0; 1073 1074 return this; 1075 }; 1076 1077 // The reducing API that removes a callback from the `events` object. 1078 var offApi = function(events, name, callback, options) { 1079 if (!events) return; 1080 1081 var context = options.context, listeners = options.listeners; 1082 var i = 0, names; 1083 1084 // Delete all event listeners and "drop" events. 1085 if (!name && !context && !callback) { 1086 for (names = _.keys(listeners); i < names.length; i++) { 1087 listeners[names[i]].cleanup(); 1088 } 1089 return; 1090 } 1091 1092 names = name ? [name] : _.keys(events); 1093 for (; i < names.length; i++) { 1094 name = names[i]; 1095 var handlers = events[name]; 1096 1097 // Bail out if there are no events stored. 1098 if (!handlers) break; 1099 1100 // Find any remaining events. 1101 var remaining = []; 1102 for (var j = 0; j < handlers.length; j++) { 1103 var handler = handlers[j]; 1104 if ( 1105 callback && callback !== handler.callback && 1106 callback !== handler.callback._callback || 1107 context && context !== handler.context 1108 ) { 1109 remaining.push(handler); 1110 } else { 1111 var listening = handler.listening; 1112 if (listening) listening.off(name, callback); 1113 } 1114 } 1115 1116 // Replace events if there are any remaining. Otherwise, clean up. 1117 if (remaining.length) { 1118 events[name] = remaining; 1119 } else { 1120 delete events[name]; 1121 } 1122 } 1123 1124 return events; 1125 }; 1126 1127 // Bind an event to only be triggered a single time. After the first time 1128 // the callback is invoked, its listener will be removed. If multiple events 1129 // are passed in using the space-separated syntax, the handler will fire 1130 // once for each event, not once for a combination of all events. 1131 Events.once = function(name, callback, context) { 1132 // Map the event into a `{event: once}` object. 1133 var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this)); 1134 if (typeof name === 'string' && context == null) callback = void 0; 1135 return this.on(events, callback, context); 1136 }; 1137 1138 // Inversion-of-control versions of `once`. 1139 Events.listenToOnce = function(obj, name, callback) { 1140 // Map the event into a `{event: once}` object. 1141 var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj)); 1142 return this.listenTo(obj, events); 1143 }; 1144 1145 // Reduces the event callbacks into a map of `{event: onceWrapper}`. 1146 // `offer` unbinds the `onceWrapper` after it has been called. 1147 var onceMap = function(map, name, callback, offer) { 1148 if (callback) { 1149 var once = map[name] = _.once(function() { 1150 offer(name, once); 1151 callback.apply(this, arguments); 1152 }); 1153 once._callback = callback; 1154 } 1155 return map; 1156 }; 1157 1158 // Trigger one or many events, firing all bound callbacks. Callbacks are 1159 // passed the same arguments as `trigger` is, apart from the event name 1160 // (unless you're listening on `"all"`, which will cause your callback to 1161 // receive the true name of the event as the first argument). 1162 Events.trigger = function(name) { 1163 if (!this._events) return this; 1164 1165 var length = Math.max(0, arguments.length - 1); 1166 var args = Array(length); 1167 for (var i = 0; i < length; i++) args[i] = arguments[i + 1]; 1168 1169 eventsApi(triggerApi, this._events, name, void 0, args); 1170 return this; 1171 }; 1172 1173 // Handles triggering the appropriate event callbacks. 1174 var triggerApi = function(objEvents, name, callback, args) { 1175 if (objEvents) { 1176 var events = objEvents[name]; 1177 var allEvents = objEvents.all; 1178 if (events && allEvents) allEvents = allEvents.slice(); 1179 if (events) triggerEvents(events, args);
1180 if (allEvents) triggerEvents(allEvents, [name].concat(args)); 1181 } 1182 return objEvents; 1183 }; 1184 1185 // A difficult-to-believe, but optimized internal dispatch function for 1186 // triggering events. Tries to keep the usual cases speedy (most internal 1187 // Backbone events have 3 arguments). 1188 var triggerEvents = function(events, args) { 1189 var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; 1190 switch (args.length) { 1191 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 1192 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 1193 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 1194 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 1195 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; 1196 } 1197 }; 1198 1199 // A listening class that tracks and cleans up memory bindings 1200 // when all callbacks have been offed. 1201 var Listening = function(listener, obj) { 1202 this.id = listener._listenId; 1203 this.listener = listener; 1204 this.obj = obj; 1205 this.interop = true; 1206 this.count = 0; 1207 this._events = void 0; 1208 }; 1209 1210 Listening.prototype.on = Events.on; 1211 1212 // Offs a callback (or several). 1213 // Uses an optimized counter if the listenee uses Backbone.Events. 1214 // Otherwise, falls back to manual tracking to support events 1215 // library interop. 1216 Listening.prototype.off = function(name, callback) { 1217 var cleanup; 1218 if (this.interop) { 1219 this._events = eventsApi(offApi, this._events, name, callback, { 1220 context: void 0, 1221 listeners: void 0 1222 }); 1223 cleanup = !this._events; 1224 } else { 1225 this.count--; 1226 cleanup = this.count === 0; 1227 } 1228 if (cleanup) this.cleanup(); 1229 }; 1230 1231 // Cleans up memory bindings between the listener and the listenee. 1232 Listening.prototype.cleanup = function() { 1233 delete this.listener._listeningTo[this.obj._listenId]; 1234 if (!this.interop) delete this.obj._listeners[this.id]; 1235 }; 1236 1237 // Aliases for backwards compatibility. 1238 Events.bind = Events.on; 1239 Events.unbind = Events.off; 1240 1241 // Allow the `Backbone` object to serve as a global event bus, for folks who 1242 // want global "pubsub" in a convenient place. 1243 _.extend(Backbone, Events); 1244 1245 // Backbone.Model 1246 // -------------- 1247 1248 // Backbone **Models** are the basic data object in the framework -- 1249 // frequently representing a row in a table in a database on your server. 1250 // A discrete chunk of data and a bunch of useful, related methods for 1251 // performing computations and transformations on that data. 1252 1253 // Create a new model with the specified attributes. A client id (`cid`) 1254 // is automatically generated and assigned for you. 1255 var Model = Backbone.Model = function(attributes, options) { 1256 var attrs = attributes || {}; 1257 options || (options = {}); 1258 this.preinitialize.apply(this, arguments); 1259 this.cid = _.uniqueId(this.cidPrefix); 1260 this.attributes = {}; 1261 if (options.collection) this.collection = options.collection; 1262 if (options.parse) attrs = this.parse(attrs, options) || {}; 1263 var defaults = _.result(this, 'defaults'); 1264 1265 // Just _.defaults would work fine, but the additional _.extends 1266 // is in there for historical reasons. See #3843. 1267 attrs = _.defaults(_.extend({}, defaults, attrs), defaults); 1268 1269 this.set(attrs, options); 1270 this.changed = {}; 1271 this.initialize.apply(this, arguments); 1272 }; 1273 1274 // Attach all inheritable methods to the Model prototype. 1275 _.extend(Model.prototype, Events, { 1276 1277 // A hash of attributes whose current and previous value differ. 1278 changed: null, 1279 1280 // The value returned during the last failed validation. 1281 validationError: null, 1282 1283 // The default name for the JSON `id` attribute is `"id"`. MongoDB and 1284 // CouchDB users may want to set this to `"_id"`. 1285 idAttribute: 'id', 1286 1287 // The prefix is used to create the client id which is used to identify models locally. 1288 // You may want to override this if you're experiencing name clashes with model ids. 1289 cidPrefix: 'c', 1290 1291 // preinitialize is an empty function by default. You can override it with a function 1292 // or object. preinitialize will run before any instantiation logic is run in the Model. 1293 preinitialize: function(){}, 1294 1295 // Initialize is an empty function by default. Override it with your own 1296 // initialization logic. 1297 initialize: function(){}, 1298 1299 // Return a copy of the model's `attributes` object. 1300 toJSON: function(options) { 1301 return _.clone(this.attributes); 1302 }, 1303 1304 // Proxy `Backbone.sync` by default -- but override this if you need 1305 // custom syncing semantics for *this* particular model. 1306 sync: function() { 1307 return Backbone.sync.apply(this, arguments); 1308 }, 1309 1310 // Get the value of an attribute. 1311 get: function(attr) { 1312 return this.attributes[attr]; 1313 }, 1314 1315 // Get the HTML-escaped value of an attribute. 1316 escape: function(attr) { 1317 return _.escape(this.get(attr)); 1318 }, 1319 1320 // Returns `true` if the attribute contains a value that is not null 1321 // or undefined. 1322 has: function(attr) { 1323 return this.get(attr) != null; 1324 }, 1325 1326 // Special-cased proxy to underscore's `_.matches` method. 1327 matches: function(attrs) { 1328 return !!_.iteratee(attrs, this)(this.attributes); 1329 }, 1330 1331 // Set a hash of model attributes on the object, firing `"change"`. This is 1332 // the core primitive operation of a model, updating the data and notifying 1333 // anyone who needs to know about the change in state. The heart of the beast. 1334 set: function(key, val, options) { 1335 if (key == null) return this; 1336 1337 // Handle both `"key", value` and `{key: value}` -style arguments. 1338 var attrs; 1339 if (typeof key === 'object') { 1340 attrs = key; 1341 options = val; 1342 } else { 1343 (attrs = {})[key] = val; 1344 } 1345
1346 options || (options = {}); 1347 1348 // Run validation. 1349 if (!this._validate(attrs, options)) return false; 1350 1351 // Extract attributes and options. 1352 var unset = options.unset; 1353 var silent = options.silent; 1354 var changes = []; 1355 var changing = this._changing; 1356 this._changing = true; 1357 1358 if (!changing) { 1359 this._previousAttributes = _.clone(this.attributes); 1360 this.changed = {}; 1361 } 1362 1363 var current = this.attributes; 1364 var changed = this.changed; 1365 var prev = this._previousAttributes; 1366 1367 // For each `set` attribute, update or delete the current value. 1368 for (var attr in attrs) { 1369 val = attrs[attr]; 1370 if (!_.isEqual(current[attr], val)) changes.push(attr); 1371 if (!_.isEqual(prev[attr], val)) { 1372 changed[attr] = val; 1373 } else { 1374 delete changed[attr]; 1375 } 1376 unset ? delete current[attr] : current[attr] = val; 1377 } 1378 1379 // Update the `id`. 1380 if (this.idAttribute in attrs) { 1381 var prevId = this.id; 1382 this.id = this.get(this.idAttribute); 1383 if (this.id !== prevId) { 1384 this.trigger('changeId', this, prevId, options); 1385 } 1386 } 1387 1388 // Trigger all relevant attribute changes. 1389 if (!silent) { 1390 if (changes.length) this._pending = options; 1391 for (var i = 0; i < changes.length; i++) { 1392 this.trigger('change:' + changes[i], this, current[changes[i]], options); 1393 } 1394 } 1395 1396 // You might be wondering why there's a `while` loop here. Changes can 1397 // be recursively nested within `"change"` events. 1398 if (changing) return this; 1399 if (!silent) { 1400 while (this._pending) { 1401 options = this._pending; 1402 this._pending = false; 1403 this.trigger('change', this, options); 1404 } 1405 } 1406 this._pending = false; 1407 this._changing = false; 1408 return this; 1409 }, 1410 1411 // Remove an attribute from the model, firing `"change"`. `unset` is a noop 1412 // if the attribute doesn't exist. 1413 unset: function(attr, options) { 1414 return this.set(attr, void 0, _.extend({}, options, {unset: true})); 1415 }, 1416 1417 // Clear all attributes on the model, firing `"change"`. 1418 clear: function(options) { 1419 var attrs = {}; 1420 for (var key in this.attributes) attrs[key] = void 0; 1421 return this.set(attrs, _.extend({}, options, {unset: true})); 1422 }, 1423 1424 // Determine if the model has changed since the last `"change"` event. 1425 // If you specify an attribute name, determine if that attribute has changed. 1426 hasChanged: function(attr) { 1427 if (attr == null) return !_.isEmpty(this.changed); 1428 return _.has(this.changed, attr); 1429 }, 1430
1431 // Return an object containing all the attributes that have changed, or 1432 // false if there are no changed attributes. Useful for determining what 1433 // parts of a view need to be updated and/or what attributes need to be 1434 // persisted to the server. Unset attributes will be set to undefined. 1435 // You can also pass an attributes object to diff against the model, 1436 // determining if there *would be* a change. 1437 changedAttributes: function(diff) { 1438 if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; 1439 var old = this._changing ? this._previousAttributes : this.attributes; 1440 var changed = {}; 1441 var hasChanged; 1442 for (var attr in diff) { 1443 var val = diff[attr]; 1444 if (_.isEqual(old[attr], val)) continue; 1445 changed[attr] = val; 1446 hasChanged = true; 1447 } 1448 return hasChanged ? changed : false; 1449 }, 1450 1451 // Get the previous value of an attribute, recorded at the time the last 1452 // `"change"` event was fired. 1453 previous: function(attr) { 1454 if (attr == null || !this._previousAttributes) return null; 1455 return this._previousAttributes[attr]; 1456 }, 1457 1458 // Get all of the attributes of the model at the time of the previous 1459 // `"change"` event. 1460 previousAttributes: function() { 1461 return _.clone(this._previousAttributes); 1462 }, 1463 1464 // Fetch the model from the server, merging the response with the model's 1465 // local attributes. Any changed attributes will trigger a "change" event. 1466 fetch: function(options) { 1467 options = _.extend({parse: true}, options); 1468 var model = this; 1469 var success = options.success; 1470 options.success = function(resp) { 1471 var serverAttrs = options.parse ? model.parse(resp, options) : resp; 1472 if (!model.set(serverAttrs, options)) return false; 1473 if (success) success.call(options.context, model, resp, options); 1474 model.trigger('sync', model, resp, options); 1475 }; 1476 wrapError(this, options); 1477 return this.sync('read', this, options); 1478 }, 1479 1480 // Set a hash of model attributes, and sync the model to the server. 1481 // If the server returns an attributes hash that differs, the model's 1482 // state will be `set` again. 1483 save: function(key, val, options) { 1484 // Handle both `"key", value` and `{key: value}` -style arguments. 1485 var attrs; 1486 if (key == null || typeof key === 'object') { 1487 attrs = key; 1488 options = val; 1489 } else { 1490 (attrs = {})[key] = val; 1491 } 1492 1493 options = _.extend({validate: true, parse: true}, options); 1494 var wait = options.wait; 1495 1496 // If we're not waiting and attributes exist, save acts as 1497 // `set(attr).save(null, opts)` with validation. Otherwise, check if 1498 // the model will be valid when the attributes, if any, are set. 1499 if (attrs && !wait) { 1500 if (!this.set(attrs, options)) return false; 1501 } else if (!this._validate(attrs, options)) { 1502 return false; 1503 } 1504 1505 // After a successful server-side save, the client is (optionally) 1506 // updated with the server-side state. 1507 var model = this; 1508 var success = options.success; 1509 var attributes = this.attributes; 1510 options.success = function(resp) { 1511 // Ensure attributes are restored during synchronous saves. 1512 model.attributes = attributes; 1513 var serverAttrs = options.parse ? model.parse(resp, options) : resp; 1514 if (wait) serverAttrs = _.extend({}, attrs, serverAttrs); 1515 if (serverAttrs && !model.set(serverAttrs, options)) return false; 1516 if (success) success.call(options.context, model, resp, options); 1517 model.trigger('sync', model, resp, options); 1518 }; 1519 wrapError(this, options); 1520 1521 // Set temporary attributes if `{wait: true}` to properly find new ids. 1522 if (attrs && wait) this.attributes = _.extend({}, attributes, attrs); 1523 1524 var method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update'; 1525 if (method === 'patch' && !options.attrs) options.attrs = attrs; 1526 var xhr = this.sync(method, this, options); 1527 1528 // Restore attributes. 1529 this.attributes = attributes; 1530 1531 return xhr; 1532 }, 1533 1534 // Destroy this model on the server if it was already persisted. 1535 // Optimistically removes the model from its collection, if it has one. 1536 // If `wait: true` is passed, waits for the server to respond before removal. 1537 destroy: function(options) { 1538 options = options ? _.clone(options) : {}; 1539 var model = this; 1540 var success = options.success; 1541 var wait = options.wait; 1542 1543 var destroy = function() { 1544 model.stopListening(); 1545 model.trigger('destroy', model, model.collection, options); 1546 }; 1547 1548 options.success = function(resp) { 1549 if (wait) destroy(); 1550 if (success) success.call(options.context, model, resp, options); 1551 if (!model.isNew()) model.trigger('sync', model, resp, options); 1552 }; 1553 1554 var xhr = false;
1555 if (this.isNew()) { 1556 _.defer(options.success); 1557 } else { 1558 wrapError(this, options); 1559 xhr = this.sync('delete', this, options); 1560 } 1561 if (!wait) destroy(); 1562 return xhr; 1563 }, 1564 1565 // Default URL for the model's representation on the server -- if you're 1566 // using Backbone's restful methods, override this to change the endpoint 1567 // that will be called. 1568 url: function() { 1569 var base = 1570 _.result(this, 'urlRoot') || 1571 _.result(this.collection, 'url') || 1572 urlError(); 1573 if (this.isNew()) return base; 1574 var id = this.get(this.idAttribute); 1575 return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id); 1576 }, 1577 1578 // **parse** converts a response into the hash of attributes to be `set` on 1579 // the model. The default implementation is just to pass the response along. 1580 parse: function(resp, options) { 1581 return resp; 1582 }, 1583 1584 // Create a new model with identical attributes to this one. 1585 clone: function() { 1586 return new this.constructor(this.attributes); 1587 }, 1588 1589 // A model is new if it has never been saved to the server, and lacks an id. 1590 isNew: function() { 1591 return !this.has(this.idAttribute); 1592 }, 1593 1594 // Check if the model is currently in a valid state. 1595 isValid: function(options) { 1596 return this._validate({}, _.extend({}, options, {validate: true})); 1597 }, 1598 1599 // Run validation against the next complete set of model attributes, 1600 // returning `true` if all is well. Otherwise, fire an `"invalid"` event. 1601 _validate: function(attrs, options) { 1602 if (!options.validate || !this.validate) return true; 1603 attrs = _.extend({}, this.attributes, attrs); 1604 var error = this.validationError = this.validate(attrs, options) || null; 1605 if (!error) return true; 1606 this.trigger('invalid', this, error, _.extend(options, {validationError: error})); 1607 return false; 1608 } 1609 1610 }); 1611 1612 // Backbone.Collection 1613 // ------------------- 1614 1615 // If models tend to represent a single row of data, a Backbone Collection is 1616 // more analogous to a table full of data ... or a small slice or page of that 1617 // table, or a collection of rows that belong together for a particular reason 1618 // -- all of the messages in this particular folder, all of the documents
1619 // belonging to this particular author, and so on. Collections maintain 1620 // indexes of their models, both in order, and for lookup by `id`. 1621 1622 // Create a new **Collection**, perhaps to contain a specific type of `model`. 1623 // If a `comparator` is specified, the Collection will maintain 1624 // its models in sort order, as they're added and removed. 1625 var Collection = Backbone.Collection = function(models, options) { 1626 options || (options = {}); 1627 this.preinitialize.apply(this, arguments); 1628 if (options.model) this.model = options.model; 1629 if (options.comparator !== void 0) this.comparator = options.comparator; 1630 this._reset(); 1631 this.initialize.apply(this, arguments); 1632 if (models) this.reset(models, _.extend({silent: true}, options)); 1633 }; 1634 1635 // Default options for `Collection#set`. 1636 var setOptions = {add: true, remove: true, merge: true}; 1637 var addOptions = {add: true, remove: false}; 1638 1639 // Splices `insert` into `array` at index `at`. 1640 var splice = function(array, insert, at) { 1641 at = Math.min(Math.max(at, 0), array.length); 1642 var tail = Array(array.length - at); 1643 var length = insert.length; 1644 var i; 1645 for (i = 0; i < tail.length; i++) tail[i] = array[i + at]; 1646 for (i = 0; i < length; i++) array[i + at] = insert[i]; 1647 for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i]; 1648 }; 1649 1650 // Define the Collection's inheritable methods. 1651 _.extend(Collection.prototype, Events, { 1652 1653 // The default model for a collection is just a **Backbone.Model**. 1654 // This should be overridden in most cases. 1655 model: Model, 1656 1657 1658 // preinitialize is an empty function by default. You can override it with a function 1659 // or object. preinitialize will run before any instantiation logic is run in the Collection. 1660 preinitialize: function(){}, 1661 1662 // Initialize is an empty function by default. Override it with your own 1663 // initialization logic. 1664 initialize: function(){}, 1665 1666 // The JSON representation of a Collection is an array of the 1667 // models' attributes. 1668 toJSON: function(options) { 1669 return this.map(function(model) { return model.toJSON(options); }); 1670 }, 1671 1672 // Proxy `Backbone.sync` by default. 1673 sync: function() { 1674 return Backbone.sync.apply(this, arguments); 1675 }, 1676 1677 // Add a model, or list of models to the set. `models` may be Backbone 1678 // Models or raw JavaScript objects to be converted to Models, or any 1679 // combination of the two. 1680 add: function(models, options) { 1681 return this.set(models, _.extend({merge: false}, options, addOptions)); 1682 }, 1683 1684 // Remove a model, or a list of models from the set. 1685 remove: function(models, options) { 1686 options = _.extend({}, options); 1687 var singular = !_.isArray(models); 1688 models = singular ? [models] : models.slice(); 1689 var removed = this._removeModels(models, options); 1690 if (!options.silent && removed.length) { 1691 options.changes = {added: [], merged: [], removed: removed}; 1692 this.trigger('update', this, options); 1693 } 1694 return singular ? removed[0] : removed; 1695 }, 1696 1697 // Update a collection by `set`-ing a new list of models, adding new ones, 1698 // removing models that are no longer present, and merging models that 1699 // already exist in the collection, as necessary. Similar to **Model#set**, 1700 // the core operation for updating the data contained by the collection. 1701 set: function(models, options) { 1702 if (models == null) return; 1703 1704 options = _.extend({}, setOptions, options); 1705 if (options.parse && !this._isModel(models)) { 1706 models = this.parse(models, options) || []; 1707 } 1708 1709 var singular = !_.isArray(models); 1710 models = singular ? [models] : models.slice(); 1711 1712 var at = options.at; 1713 if (at != null) at = +at; 1714 if (at > this.length) at = this.length; 1715 if (at < 0) at += this.length + 1; 1716 1717 var set = []; 1718 var toAdd = []; 1719 var toMerge = []; 1720 var toRemove = []; 1721 var modelMap = {}; 1722 1723 var add = options.add; 1724 var merge = options.merge; 1725 var remove = options.remove; 1726 1727 var sort = false;
1728 var sortable = this.comparator && at == null && options.sort !== false; 1729 var sortAttr = _.isString(this.comparator) ? this.comparator : null; 1730 1731 // Turn bare objects into model references, and prevent invalid models 1732 // from being added. 1733 var model, i; 1734 for (i = 0; i < models.length; i++) { 1735 model = models[i]; 1736 1737 // If a duplicate is found, prevent it from being added and 1738 // optionally merge it into the existing model. 1739 var existing = this.get(model); 1740 if (existing) { 1741 if (merge && model !== existing) { 1742 var attrs = this._isModel(model) ? model.attributes : model; 1743 if (options.parse) attrs = existing.parse(attrs, options); 1744 existing.set(attrs, options); 1745 toMerge.push(existing); 1746 if (sortable && !sort) sort = existing.hasChanged(sortAttr); 1747 } 1748 if (!modelMap[existing.cid]) { 1749 modelMap[existing.cid] = true; 1750 set.push(existing); 1751 } 1752 models[i] = existing; 1753 1754 // If this is a new, valid model, push it to the `toAdd` list. 1755 } else if (add) { 1756 model = models[i] = this._prepareModel(model, options); 1757 if (model) { 1758 toAdd.push(model); 1759 this._addReference(model, options); 1760 modelMap[model.cid] = true; 1761 set.push(model); 1762 } 1763 } 1764 } 1765 1766 // Remove stale models. 1767 if (remove) { 1768 for (i = 0; i < this.length; i++) { 1769 model = this.models[i]; 1770 if (!modelMap[model.cid]) toRemove.push(model); 1771 } 1772 if (toRemove.length) this._removeModels(toRemove, options); 1773 } 1774 1775 // See if sorting is needed, update `length` and splice in new models. 1776 var orderChanged = false; 1777 var replace = !sortable && add && remove; 1778 if (set.length && replace) { 1779 orderChanged = this.length !== set.length || _.some(this.models, function(m, index) { 1780 return m !== set[index]; 1781 }); 1782 this.models.length = 0; 1783 splice(this.models, set, 0); 1784 this.length = this.models.length; 1785 } else if (toAdd.length) { 1786 if (sortable) sort = true; 1787 splice(this.models, toAdd, at == null ? this.length : at); 1788 this.length = this.models.length; 1789 } 1790 1791 // Silently sort the collection if appropriate. 1792 if (sort) this.sort({silent: true}); 1793 1794 // Unless silenced, it's time to fire all appropriate add/sort/update events. 1795 if (!options.silent) { 1796 for (i = 0; i < toAdd.length; i++) { 1797 if (at != null) options.index = at + i; 1798 model = toAdd[i]; 1799 model.trigger('add', model, this, options); 1800 } 1801 if (sort || orderChanged) this.trigger('sort', this, options); 1802 if (toAdd.length || toRemove.length || toMerge.length) { 1803 options.changes = { 1804 added: toAdd, 1805 removed: toRemove, 1806 merged: toMerge 1807 }; 1808 this.trigger('update', this, options); 1809 } 1810 } 1811 1812 // Return the added (or merged) model (or models). 1813 return singular ? models[0] : models; 1814 }, 1815 1816 // When you have more items than you want to add or remove individually, 1817 // you can reset the entire set with a new list of models, without firing 1818 // any granular `add` or `remove` events. Fires `reset` when finished. 1819 // Useful for bulk operations and optimizations. 1820 reset: function(models, options) { 1821 options = options ? _.clone(options) : {}; 1822 for (var i = 0; i < this.models.length; i++) { 1823 this._removeReference(this.models[i], options); 1824 } 1825 options.previousModels = this.models; 1826 this._reset(); 1827 models = this.add(models, _.extend({silent: true}, options)); 1828 if (!options.silent) this.trigger('reset', this, options); 1829 return models; 1830 }, 1831 1832 // Add a model to the end of the collection. 1833 push: function(model, options) { 1834 return this.add(model, _.extend({at: this.length}, options)); 1835 }, 1836 1837 // Remove a model from the end of the collection. 1838 pop: function(options) { 1839 var model = this.at(this.length - 1); 1840 return this.remove(model, options); 1841 }, 1842 1843 // Add a model to the beginning of the collection. 1844 unshift: function(model, options) { 1845 return this.add(model, _.extend({at: 0}, options)); 1846 }, 1847 1848 // Remove a model from the beginning of the collection. 1849 shift: function(options) { 1850 var model = this.at(0); 1851 return this.remove(model, options); 1852 }, 1853 1854 // Slice out a sub-array of models from the collection. 1855 slice: function() { 1856 return slice.apply(this.models, arguments); 1857 }, 1858 1859 // Get a model from the set by id, cid, model object with id or cid 1860 // properties, or an attributes object that is transformed through modelId. 1861 get: function(obj) { 1862 if (obj == null) return void 0; 1863 return this._byId[obj] || 1864 this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] || 1865 obj.cid && this._byId[obj.cid]; 1866 }, 1867 1868 // Returns `true` if the model is in the collection. 1869 has: function(obj) { 1870 return this.get(obj) != null; 1871 }, 1872 1873 // Get the model at the given index. 1874 at: function(index) { 1875 if (index < 0) index += this.length; 1876 return this.models[index]; 1877 }, 1878 1879 // Return models with matching attributes. Useful for simple cases of 1880 // `filter`. 1881 where: function(attrs, first) { 1882 return this[first ? 'find' : 'filter'](attrs); 1883 }, 1884 1885 // Return the first model with matching attributes. Useful for simple cases 1886 // of `find`. 1887 findWhere: function(attrs) { 1888 return this.where(attrs, true); 1889 }, 1890 1891 // Force the collection to re-sort itself. You don't need to call this under 1892 // normal circumstances, as the set will maintain sort order as each item 1893 // is added. 1894 sort: function(options) { 1895 var comparator = this.comparator; 1896 if (!comparator) throw new Error('Cannot sort a set without a comparator');
1897 options || (options = {}); 1898 1899 var length = comparator.length; 1900 if (_.isFunction(comparator)) comparator = comparator.bind(this); 1901 1902 // Run sort based on type of `comparator`. 1903 if (length === 1 || _.isString(comparator)) { 1904 this.models = this.sortBy(comparator); 1905 } else { 1906 this.models.sort(comparator); 1907 } 1908 if (!options.silent) this.trigger('sort', this, options); 1909 return this; 1910 }, 1911 1912 // Pluck an attribute from each model in the collection. 1913 pluck: function(attr) { 1914 return this.map(attr + ''); 1915 }, 1916 1917 // Fetch the default set of models for this collection, resetting the 1918 // collection when they arrive. If `reset: true` is passed, the response 1919 // data will be passed through the `reset` method instead of `set`. 1920 fetch: function(options) { 1921 options = _.extend({parse: true}, options); 1922 var success = options.success; 1923 var collection = this; 1924 options.success = function(resp) { 1925 var method = options.reset ? 'reset' : 'set'; 1926 collection[method](resp, options); 1927 if (success) success.call(options.context, collection, resp, options); 1928 collection.trigger('sync', collection, resp, options); 1929 }; 1930 wrapError(this, options); 1931 return this.sync('read', this, options); 1932 }, 1933 1934 // Create a new instance of a model in this collection. Add the model to the 1935 // collection immediately, unless `wait: true` is passed, in which case we 1936 // wait for the server to agree. 1937 create: function(model, options) { 1938 options = options ? _.clone(options) : {}; 1939 var wait = options.wait; 1940 model = this._prepareModel(model, options); 1941 if (!model) return false; 1942 if (!wait) this.add(model, options); 1943 var collection = this; 1944 var success = options.success;
1945 options.success = function(m, resp, callbackOpts) { 1946 if (wait) { 1947 m.off('error', collection._forwardPristineError, collection); 1948 collection.add(m, callbackOpts); 1949 } 1950 if (success) success.call(callbackOpts.context, m, resp, callbackOpts); 1951 }; 1952 // In case of wait:true, our collection is not listening to any 1953 // of the model's events yet, so it will not forward the error 1954 // event. In this special case, we need to listen for it 1955 // separately and handle the event just once. 1956 // (The reason we don't need to do this for the sync event is 1957 // in the success handler above: we add the model first, which 1958 // causes the collection to listen, and then invoke the callback 1959 // that triggers the event.) 1960 if (wait) { 1961 model.once('error', this._forwardPristineError, this); 1962 } 1963 model.save(null, options); 1964 return model; 1965 }, 1966 1967 // **parse** converts a response into a list of models to be added to the 1968 // collection. The default implementation is just to pass it through. 1969 parse: function(resp, options) { 1970 return resp; 1971 }, 1972 1973 // Create a new collection with an identical list of models as this one. 1974 clone: function() { 1975 return new this.constructor(this.models, { 1976 model: this.model, 1977 comparator: this.comparator 1978 }); 1979 }, 1980 1981 // Define how to uniquely identify models in the collection. 1982 modelId: function(attrs, idAttribute) { 1983 return attrs[idAttribute || this.model.prototype.idAttribute || 'id']; 1984 }, 1985 1986 // Get an iterator of all models in this collection. 1987 values: function() { 1988 return new CollectionIterator(this, ITERATOR_VALUES); 1989 }, 1990 1991 // Get an iterator of all model IDs in this collection. 1992 keys: function() { 1993 return new CollectionIterator(this, ITERATOR_KEYS); 1994 }, 1995 1996 // Get an iterator of all [ID, model] tuples in this collection. 1997 entries: function() { 1998 return new CollectionIterator(this, ITERATOR_KEYSVALUES); 1999 }, 2000 2001 // Private method to reset all internal state. Called when the collection 2002 // is first initialized or reset. 2003 _reset: function() { 2004 this.length = 0; 2005 this.models = []; 2006 this._byId = {}; 2007 }, 2008 2009 // Prepare a hash of attributes (or other model) to be added to this 2010 // collection. 2011 _prepareModel: function(attrs, options) { 2012 if (this._isModel(attrs)) { 2013 if (!attrs.collection) attrs.collection = this; 2014 return attrs; 2015 } 2016 options = options ? _.clone(options) : {}; 2017 options.collection = this; 2018 2019 var model; 2020 if (this.model.prototype) { 2021 model = new this.model(attrs, options); 2022 } else { 2023 // ES class methods didn't have prototype 2024 model = this.model(attrs, options); 2025 } 2026 2027 if (!model.validationError) return model; 2028 this.trigger('invalid', this, model.validationError, options); 2029 return false; 2030 }, 2031 2032 // Internal method called by both remove and set. 2033 _removeModels: function(models, options) { 2034 var removed = []; 2035 for (var i = 0; i < models.length; i++) { 2036 var model = this.get(models[i]); 2037 if (!model) continue; 2038 2039 var index = this.indexOf(model); 2040 this.models.splice(index, 1); 2041 this.length--; 2042 2043 // Remove references before triggering 'remove' event to prevent an 2044 // infinite loop. #3693 2045 delete this._byId[model.cid]; 2046 var id = this.modelId(model.attributes, model.idAttribute); 2047 if (id != null) delete this._byId[id]; 2048 2049 if (!options.silent) { 2050 options.index = index; 2051 model.trigger('remove', model, this, options); 2052 } 2053 2054 removed.push(model); 2055 this._removeReference(model, options); 2056 } 2057 if (models.length > 0 && !options.silent) delete options.index; 2058 return removed; 2059 }, 2060 2061 // Method for checking whether an object should be considered a model for 2062 // the purposes of adding to the collection. 2063 _isModel: function(model) { 2064 return model instanceof Model; 2065 }, 2066 2067 // Internal method to create a model's ties to a collection. 2068 _addReference: function(model, options) { 2069 this._byId[model.cid] = model; 2070 var id = this.modelId(model.attributes, model.idAttribute); 2071 if (id != null) this._byId[id] = model; 2072 model.on('all', this._onModelEvent, this); 2073 }, 2074 2075 // Internal method to sever a model's ties to a collection. 2076 _removeReference: function(model, options) { 2077 delete this._byId[model.cid]; 2078 var id = this.modelId(model.attributes, model.idAttribute); 2079 if (id != null) delete this._byId[id]; 2080 if (this === model.collection) delete model.collection; 2081 model.off('all', this._onModelEvent, this); 2082 }, 2083 2084 // Internal method called every time a model in the set fires an event. 2085 // Sets need to update their indexes when models change ids. All other 2086 // events simply proxy through. "add" and "remove" events that originate 2087 // in other collections are ignored. 2088 _onModelEvent: function(event, model, collection, options) { 2089 if (model) { 2090 if ((event === 'add' || event === 'remove') && collection !== this) return; 2091 if (event === 'destroy') this.remove(model, options); 2092 if (event === 'changeId') { 2093 var prevId = this.modelId(model.previousAttributes(), model.idAttribute); 2094 var id = this.modelId(model.attributes, model.idAttribute); 2095 if (prevId != null) delete this._byId[prevId]; 2096 if (id != null) this._byId[id] = model; 2097 } 2098 } 2099 this.trigger.apply(this, arguments); 2100 }, 2101
2102 // Internal callback method used in `create`. It serves as a 2103 // stand-in for the `_onModelEvent` method, which is not yet bound 2104 // during the `wait` period of the `create` call. We still want to 2105 // forward any `'error'` event at the end of the `wait` period, 2106 // hence a customized callback. 2107 _forwardPristineError: function(model, collection, options) { 2108 // Prevent double forward if the model was already in the 2109 // collection before the call to `create`. 2110 if (this.has(model)) return; 2111 this._onModelEvent('error', model, collection, options); 2112 } 2113 }); 2114 2115 // Defining an @@iterator method implements JavaScript's Iterable protocol. 2116 // In modern ES2015 browsers, this value is found at Symbol.iterator. 2117 /* global Symbol */ 2118 var $$iterator = typeof Symbol === 'function' && Symbol.iterator; 2119 if ($$iterator) { 2120 Collection.prototype[$$iterator] = Collection.prototype.values; 2121 } 2122 2123 // CollectionIterator 2124 // ------------------ 2125 2126 // A CollectionIterator implements JavaScript's Iterator protocol, allowing the 2127 // use of `for of` loops in modern browsers and interoperation between 2128 // Backbone.Collection and other JavaScript functions and third-party libraries 2129 // which can operate on Iterables. 2130 var CollectionIterator = function(collection, kind) { 2131 this._collection = collection; 2132 this._kind = kind; 2133 this._index = 0; 2134 }; 2135 2136 // This "enum" defines the three possible kinds of values which can be emitted 2137 // by a CollectionIterator that correspond to the values(), keys() and entries() 2138 // methods on Collection, respectively. 2139 var ITERATOR_VALUES = 1; 2140 var ITERATOR_KEYS = 2; 2141 var ITERATOR_KEYSVALUES = 3; 2142 2143 // All Iterators should themselves be Iterable. 2144 if ($$iterator) { 2145 CollectionIterator.prototype[$$iterator] = function() { 2146 return this; 2147 }; 2148 } 2149 2150 CollectionIterator.prototype.next = function() { 2151 if (this._collection) { 2152 2153 // Only continue iterating if the iterated collection is long enough. 2154 if (this._index < this._collection.length) { 2155 var model = this._collection.at(this._index); 2156 this._index++; 2157 2158 // Construct a value depending on what kind of values should be iterated. 2159 var value; 2160 if (this._kind === ITERATOR_VALUES) { 2161 value = model; 2162 } else { 2163 var id = this._collection.modelId(model.attributes, model.idAttribute); 2164 if (this._kind === ITERATOR_KEYS) { 2165 value = id; 2166 } else { // ITERATOR_KEYSVALUES 2167 value = [id, model]; 2168 } 2169 } 2170 return {value: value, done: false}; 2171 } 2172 2173 // Once exhausted, remove the reference to the collection so future 2174 // calls to the next method always return done. 2175 this._collection = void 0; 2176 } 2177 2178 return {value: void 0, done: true}; 2179 }; 2180 2181 // Backbone.View 2182 // ------------- 2183 2184 // Backbone Views are almost more convention than they are actual code. A View 2185 // is simply a JavaScript object that represents a logical chunk of UI in the 2186 // DOM. This might be a single item, an entire list, a sidebar or panel, or 2187 // even the surrounding frame which wraps your whole app. Defining a chunk of 2188 // UI as a **View** allows you to define your DOM events declaratively, without 2189 // having to worry about render order ... and makes it easy for the view to 2190 // react to specific changes in the state of your models. 2191 2192 // Creating a Backbone.View creates its initial element outside of the DOM, 2193 // if an existing element is not provided... 2194 var View = Backbone.View = function(options) { 2195 this.cid = _.uniqueId('view'); 2196 this.preinitialize.apply(this, arguments); 2197 _.extend(this, _.pick(options, viewOptions)); 2198 this._ensureElement(); 2199 this.initialize.apply(this, arguments); 2200 }; 2201 2202 // Cached regex to split keys for `delegate`. 2203 var delegateEventSplitter = /^(\S+)\s*(.*)$/; 2204 2205 // List of view options to be set as properties. 2206 var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; 2207 2208 // Set up all inheritable **Backbone.View** properties and methods. 2209 _.extend(View.prototype, Events, { 2210 2211 // The default `tagName` of a View's element is `"div"`. 2212 tagName: 'div', 2213 2214 // jQuery delegate for element lookup, scoped to DOM elements within the 2215 // current view. This should be preferred to global lookups where possible. 2216 $: function(selector) { 2217 return this.$el.find(selector); 2218 }, 2219 2220 // preinitialize is an empty function by default. You can override it with a function 2221 // or object. preinitialize will run before any instantiation logic is run in the View 2222 preinitialize: function(){}, 2223 2224 // Initialize is an empty function by default. Override it with your own 2225 // initialization logic. 2226 initialize: function(){}, 2227 2228 // **render** is the core function that your view should override, in order 2229 // to populate its element (`this.el`), with the appropriate HTML. The 2230 // convention is for **render** to always return `this`. 2231 render: function() { 2232 return this; 2233 }, 2234 2235 // Remove this view by taking the element out of the DOM, and removing any 2236 // applicable Backbone.Events listeners. 2237 remove: function() { 2238 this._removeElement(); 2239 this.stopListening(); 2240 return this; 2241 }, 2242 2243 // Remove this view's element from the document and all event listeners 2244 // attached to it. Exposed for subclasses using an alternative DOM 2245 // manipulation API. 2246 _removeElement: function() { 2247 this.$el.remove(); 2248 }, 2249 2250 // Change the view's element (`this.el` property) and re-delegate the 2251 // view's events on the new element. 2252 setElement: function(element) { 2253 this.undelegateEvents(); 2254 this._setElement(element); 2255 this.delegateEvents(); 2256 return this; 2257 }, 2258 2259 // Creates the `this.el` and `this.$el` references for this view using the 2260 // given `el`. `el` can be a CSS selector or an HTML string, a jQuery 2261 // context or an element. Subclasses can override this to utilize an 2262 // alternative DOM manipulation API and are only required to set the 2263 // `this.el` property. 2264 _setElement: function(el) { 2265 this.$el = el instanceof Backbone.$ ? el : Backbone.$(el); 2266 this.el = this.$el[0]; 2267 }, 2268 2269 // Set callbacks, where `this.events` is a hash of 2270 // 2271 // *{"event selector": "callback"}* 2272 // 2273 // { 2274 // 'mousedown .title': 'edit', 2275 // 'click .button': 'save', 2276 // 'click .open': function(e) { ... } 2277 // } 2278 // 2279 // pairs. Callbacks will be bound to the view, with `this` set properly. 2280 // Uses event delegation for efficiency. 2281 // Omitting the selector binds the event to `this.el`. 2282 delegateEvents: function(events) { 2283 events || (events = _.result(this, 'events')); 2284 if (!events) return this; 2285 this.undelegateEvents(); 2286 for (var key in events) { 2287 var method = events[key]; 2288 if (!_.isFunction(method)) method = this[method];
2289 if (!method) continue; 2290 var match = key.match(delegateEventSplitter); 2291 this.delegate(match[1], match[2], method.bind(this)); 2292 } 2293 return this; 2294 }, 2295 2296 // Add a single event listener to the view's element (or a child element 2297 // using `selector`). This only works for delegate-able events: not `focus`, 2298 // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer. 2299 delegate: function(eventName, selector, listener) { 2300 this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener); 2301 return this; 2302 }, 2303 2304 // Clears all callbacks previously bound to the view by `delegateEvents`. 2305 // You usually don't need to use this, but may wish to if you have multiple 2306 // Backbone views attached to the same DOM element. 2307 undelegateEvents: function() { 2308 if (this.$el) this.$el.off('.delegateEvents' + this.cid); 2309 return this; 2310 }, 2311 2312 // A finer-grained `undelegateEvents` for removing a single delegated event. 2313 // `selector` and `listener` are both optional. 2314 undelegate: function(eventName, selector, listener) { 2315 this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener); 2316 return this; 2317 }, 2318 2319 // Produces a DOM element to be assigned to your view. Exposed for 2320 // subclasses using an alternative DOM manipulation API. 2321 _createElement: function(tagName) { 2322 return document.createElement(tagName); 2323 }, 2324 2325 // Ensure that the View has a DOM element to render into. 2326 // If `this.el` is a string, pass it through `$()`, take the first 2327 // matching element, and re-assign it to `el`. Otherwise, create 2328 // an element from the `id`, `className` and `tagName` properties. 2329 _ensureElement: function() { 2330 if (!this.el) { 2331 var attrs = _.extend({}, _.result(this, 'attributes')); 2332 if (this.id) attrs.id = _.result(this, 'id'); 2333 if (this.className) attrs['class'] = _.result(this, 'className'); 2334 this.setElement(this._createElement(_.result(this, 'tagName'))); 2335 this._setAttributes(attrs); 2336 } else { 2337 this.setElement(_.result(this, 'el')); 2338 } 2339 }, 2340 2341 // Set attributes from a hash on this view's element. Exposed for 2342 // subclasses using an alternative DOM manipulation API. 2343 _setAttributes: function(attributes) { 2344 this.$el.attr(attributes); 2345 } 2346 2347 }); 2348 2349 // Proxy Backbone class methods to Underscore functions, wrapping the model's 2350 // `attributes` object or collection's `models` array behind the scenes. 2351 // 2352 // collection.filter(function(model) { return model.get('age') > 10 }); 2353 // collection.each(this.addView); 2354 // 2355 // `Function#apply` can be slow so we use the method's arg count, if we know it. 2356 var addMethod = function(base, length, method, attribute) { 2357 switch (length) { 2358 case 1: return function() { 2359 return base[method](this[attribute]); 2360 }; 2361 case 2: return function(value) { 2362 return base[method](this[attribute], value); 2363 }; 2364 case 3: return function(iteratee, context) { 2365 return base[method](this[attribute], cb(iteratee, this), context); 2366 }; 2367 case 4: return function(iteratee, defaultVal, context) { 2368 return base[method](this[attribute], cb(iteratee, this), defaultVal, context); 2369 }; 2370 default: return function() { 2371 var args = slice.call(arguments); 2372 args.unshift(this[attribute]); 2373 return base[method].apply(base, args); 2374 }; 2375 } 2376 }; 2377 2378 var addUnderscoreMethods = function(Class, base, methods, attribute) { 2379 _.each(methods, function(length, method) { 2380 if (base[method]) Class.prototype[method] = addMethod(base, length, method, attribute); 2381 }); 2382 }; 2383 2384 // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`. 2385 var cb = function(iteratee, instance) { 2386 if (_.isFunction(iteratee)) return iteratee; 2387 if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee); 2388 if (_.isString(iteratee)) return function(model) { return model.get(iteratee); }; 2389 return iteratee; 2390 }; 2391 var modelMatcher = function(attrs) { 2392 var matcher = _.matches(attrs); 2393 return function(model) { 2394 return matcher(model.attributes); 2395 }; 2396 }; 2397 2398 // Underscore methods that we want to implement on the Collection. 2399 // 90% of the core usefulness of Backbone Collections is actually implemented 2400 // right here:
2401 var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, 2402 foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, 2403 select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, 2404 contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, 2405 head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, 2406 without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, 2407 isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, 2408 sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3}; 2409 2410 2411 // Underscore methods that we want to implement on the Model, mapped to the 2412 // number of arguments they take. 2413 var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, 2414 omit: 0, chain: 1, isEmpty: 1}; 2415 2416 // Mix in each Underscore method as a proxy to `Collection#models`. 2417 2418 _.each([ 2419 [Collection, collectionMethods, 'models'], 2420 [Model, modelMethods, 'attributes'] 2421 ], function(config) { 2422 var Base = config[0], 2423 methods = config[1], 2424 attribute = config[2]; 2425 2426 Base.mixin = function(obj) { 2427 var mappings = _.reduce(_.functions(obj), function(memo, name) { 2428 memo[name] = 0; 2429 return memo; 2430 }, {}); 2431 addUnderscoreMethods(Base, obj, mappings, attribute); 2432 }; 2433 2434 addUnderscoreMethods(Base, _, methods, attribute); 2435 }); 2436 2437 // Backbone.sync 2438 // ------------- 2439 2440 // Override this function to change the manner in which Backbone persists 2441 // models to the server. You will be passed the type of request, and the 2442 // model in question. By default, makes a RESTful Ajax request 2443 // to the model's `url()`. Some possible customizations could be: 2444 // 2445 // * Use `setTimeout` to batch rapid-fire updates into a single request. 2446 // * Send up the models as XML instead of JSON. 2447 // * Persist models via WebSockets instead of Ajax. 2448 // 2449 // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests 2450 // as `POST`, with a `_method` parameter containing the true HTTP method, 2451 // as well as all requests with the body as `application/x-www-form-urlencoded` 2452 // instead of `application/json` with the model in a param named `model`. 2453 // Useful when interfacing with server-side languages like **PHP** that make 2454 // it difficult to read the body of `PUT` requests. 2455 Backbone.sync = function(method, model, options) { 2456 var type = methodMap[method]; 2457 2458 // Default options, unless specified. 2459 _.defaults(options || (options = {}), { 2460 emulateHTTP: Backbone.emulateHTTP, 2461 emulateJSON: Backbone.emulateJSON 2462 }); 2463 2464 // Default JSON-request options. 2465 var params = {type: type, dataType: 'json'}; 2466 2467 // Ensure that we have a URL. 2468 if (!options.url) { 2469 params.url = _.result(model, 'url') || urlError(); 2470 } 2471 2472 // Ensure that we have the appropriate request data. 2473 if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { 2474 params.contentType = 'application/json'; 2475 params.data = JSON.stringify(options.attrs || model.toJSON(options)); 2476 } 2477 2478 // For older servers, emulate JSON by encoding the request into an HTML-form. 2479 if (options.emulateJSON) { 2480 params.contentType = 'application/x-www-form-urlencoded'; 2481 params.data = params.data ? {model: params.data} : {}; 2482 } 2483 2484 // For older servers, emulate HTTP by mimicking the HTTP method with `_method` 2485 // And an `X-HTTP-Method-Override` header. 2486 if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { 2487 params.type = 'POST'; 2488 if (options.emulateJSON) params.data._method = type; 2489 var beforeSend = options.beforeSend; 2490 options.beforeSend = function(xhr) { 2491 xhr.setRequestHeader('X-HTTP-Method-Override', type); 2492 if (beforeSend) return beforeSend.apply(this, arguments); 2493 }; 2494 } 2495 2496 // Don't process data on a non-GET request. 2497 if (params.type !== 'GET' && !options.emulateJSON) { 2498 params.processData = false; 2499 } 2500 2501 // Pass along `textStatus` and `errorThrown` from jQuery. 2502 var error = options.error; 2503 options.error = function(xhr, textStatus, errorThrown) { 2504 options.textStatus = textStatus; 2505 options.errorThrown = errorThrown; 2506 if (error) error.call(options.context, xhr, textStatus, errorThrown); 2507 }; 2508 2509 // Make the request, allowing the user to override any Ajax options. 2510 var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); 2511 model.trigger('request', model, xhr, options); 2512 return xhr; 2513 }; 2514 2515 // Map from CRUD to HTTP for our default `Backbone.sync` implementation. 2516 var methodMap = { 2517 'create': 'POST', 2518 'update': 'PUT', 2519 'patch': 'PATCH', 2520 'delete': 'DELETE', 2521 'read': 'GET' 2522 }; 2523 2524 // Set the default implementation of `Backbone.ajax` to proxy through to `$`. 2525 // Override this if you'd like to use a different library. 2526 Backbone.ajax = function() { 2527 return Backbone.$.ajax.apply(Backbone.$, arguments); 2528 }; 2529 2530 // Backbone.Router 2531 // --------------- 2532 2533 // Routers map faux-URLs to actions, and fire events when routes are 2534 // matched. Creating a new one sets its `routes` hash, if not set statically. 2535 var Router = Backbone.Router = function(options) {
2536 options || (options = {}); 2537 this.preinitialize.apply(this, arguments); 2538 if (options.routes) this.routes = options.routes; 2539 this._bindRoutes(); 2540 this.initialize.apply(this, arguments); 2541 }; 2542 2543 // Cached regular expressions for matching named param parts and splatted 2544 // parts of route strings. 2545 var optionalParam = /\((.*?)\)/g; 2546 var namedParam = /(\(\?)?:\w+/g; 2547 var splatParam = /\*\w+/g; 2548 var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 2549 2550 // Set up all inheritable **Backbone.Router** properties and methods. 2551 _.extend(Router.prototype, Events, { 2552 2553 // preinitialize is an empty function by default. You can override it with a function 2554 // or object. preinitialize will run before any instantiation logic is run in the Router. 2555 preinitialize: function(){}, 2556 2557 // Initialize is an empty function by default. Override it with your own 2558 // initialization logic. 2559 initialize: function(){}, 2560 2561 // Manually bind a single named route to a callback. For example: 2562 // 2563 // this.route('search/:query/p:num', 'search', function(query, num) { 2564 // ... 2565 // }); 2566 // 2567 route: function(route, name, callback) { 2568 if (!_.isRegExp(route)) route = this._routeToRegExp(route); 2569 if (_.isFunction(name)) { 2570 callback = name; 2571 name = ''; 2572 } 2573 if (!callback) callback = this[name]; 2574 var router = this; 2575 Backbone.history.route(route, function(fragment) { 2576 var args = router._extractParameters(route, fragment); 2577 if (router.execute(callback, args, name) !== false) { 2578 router.trigger.apply(router, ['route:' + name].concat(args)); 2579 router.trigger('route', name, args); 2580 Backbone.history.trigger('route', router, name, args); 2581 } 2582 }); 2583 return this; 2584 }, 2585 2586 // Execute a route handler with the provided parameters. This is an 2587 // excellent place to do pre-route setup or post-route cleanup. 2588 execute: function(callback, args, name) { 2589 if (callback) callback.apply(this, args); 2590 }, 2591 2592 // Simple proxy to `Backbone.history` to save a fragment into the history. 2593 navigate: function(fragment, options) { 2594 Backbone.history.navigate(fragment, options); 2595 return this; 2596 }, 2597 2598 // Bind all defined routes to `Backbone.history`. We have to reverse the 2599 // order of the routes here to support behavior where the most general 2600 // routes can be defined at the bottom of the route map. 2601 _bindRoutes: function() { 2602 if (!this.routes) return; 2603 this.routes = _.result(this, 'routes'); 2604 var route, routes = _.keys(this.routes); 2605 while ((route = routes.pop()) != null) { 2606 this.route(route, this.routes[route]); 2607 } 2608 }, 2609 2610 // Convert a route string into a regular expression, suitable for matching 2611 // against the current location hash. 2612 _routeToRegExp: function(route) { 2613 route = route.replace(escapeRegExp, '\\$&') 2614 .replace(optionalParam, '(?:$1)?') 2615 .replace(namedParam, function(match, optional) { 2616 return optional ? match : '([^/?]+)'; 2617 }) 2618 .replace(splatParam, '([^?]*?)'); 2619 return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); 2620 }, 2621 2622 // Given a route, and a URL fragment that it matches, return the array of 2623 // extracted decoded parameters. Empty or unmatched parameters will be 2624 // treated as `null` to normalize cross-browser behavior. 2625 _extractParameters: function(route, fragment) { 2626 var params = route.exec(fragment).slice(1); 2627 return _.map(params, function(param, i) { 2628 // Don't decode the search params. 2629 if (i === params.length - 1) return param || null; 2630 return param ? decodeURIComponent(param) : null; 2631 }); 2632 } 2633 2634 }); 2635 2636 // Backbone.History 2637 // ---------------- 2638 2639 // Handles cross-browser history management, based on either 2640 // [pushState](http://diveintohtml5.info/history.html) and real URLs, or 2641 // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) 2642 // and URL fragments. If the browser supports neither (old IE, natch), 2643 // falls back to polling. 2644 var History = Backbone.History = function() { 2645 this.handlers = []; 2646 this.checkUrl = this.checkUrl.bind(this); 2647 2648 // Ensure that `History` can be used outside of the browser. 2649 if (typeof window !== 'undefined') { 2650 this.location = window.location; 2651 this.history = window.history; 2652 } 2653 }; 2654 2655 // Cached regex for stripping a leading hash/slash and trailing space. 2656 var routeStripper = /^[#\/]|\s+$/g; 2657 2658 // Cached regex for stripping leading and trailing slashes. 2659 var rootStripper = /^\/+|\/+$/g; 2660 2661 // Cached regex for stripping urls of hash. 2662 var pathStripper = /#.*$/; 2663 2664 // Has the history handling already been started? 2665 History.started = false;
2666 2667 // Set up all inheritable **Backbone.History** properties and methods. 2668 _.extend(History.prototype, Events, { 2669 2670 // The default interval to poll for hash changes, if necessary, is 2671 // twenty times a second. 2672 interval: 50, 2673 2674 // Are we at the app root? 2675 atRoot: function() { 2676 var path = this.location.pathname.replace(/[^\/]$/, '$&/'); 2677 return path === this.root && !this.getSearch(); 2678 }, 2679 2680 // Does the pathname match the root? 2681 matchRoot: function() { 2682 var path = this.decodeFragment(this.location.pathname); 2683 var rootPath = path.slice(0, this.root.length - 1) + '/'; 2684 return rootPath === this.root; 2685 }, 2686 2687 // Unicode characters in `location.pathname` are percent encoded so they're 2688 // decoded for comparison. `%25` should not be decoded since it may be part 2689 // of an encoded parameter. 2690 decodeFragment: function(fragment) { 2691 return decodeURI(fragment.replace(/%25/g, '%2525')); 2692 }, 2693 2694 // In IE6, the hash fragment and search params are incorrect if the 2695 // fragment contains `?`. 2696 getSearch: function() { 2697 var match = this.location.href.replace(/#.*/, '').match(/\?.+/); 2698 return match ? match[0] : ''; 2699 }, 2700 2701 // Gets the true hash value. Cannot use location.hash directly due to bug 2702 // in Firefox where location.hash will always be decoded. 2703 getHash: function(window) { 2704 var match = (window || this).location.href.match(/#(.*)$/); 2705 return match ? match[1] : ''; 2706 }, 2707 2708 // Get the pathname and search params, without the root. 2709 getPath: function() { 2710 var path = this.decodeFragment( 2711 this.location.pathname + this.getSearch() 2712 ).slice(this.root.length - 1); 2713 return path.charAt(0) === '/' ? path.slice(1) : path; 2714 }, 2715 2716 // Get the cross-browser normalized URL fragment from the path or hash. 2717 getFragment: function(fragment) { 2718 if (fragment == null) { 2719 if (this._usePushState || !this._wantsHashChange) { 2720 fragment = this.getPath(); 2721 } else { 2722 fragment = this.getHash(); 2723 } 2724 } 2725 return fragment.replace(routeStripper, ''); 2726 }, 2727 2728 // Start the hash change handling, returning `true` if the current URL matches 2729 // an existing route, and `false` otherwise. 2730 start: function(options) { 2731 if (History.started) throw new Error('Backbone.history has already been started'); 2732 History.started = true; 2733 2734 // Figure out the initial configuration. Do we need an iframe? 2735 // Is pushState desired ... is it available? 2736 this.options = _.extend({root: '/'}, this.options, options); 2737 this.root = this.options.root; 2738 this._trailingSlash = this.options.trailingSlash; 2739 this._wantsHashChange = this.options.hashChange !== false; 2740 this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7); 2741 this._useHashChange = this._wantsHashChange && this._hasHashChange; 2742 this._wantsPushState = !!this.options.pushState; 2743 this._hasPushState = !!(this.history && this.history.pushState); 2744 this._usePushState = this._wantsPushState && this._hasPushState; 2745 this.fragment = this.getFragment(); 2746 2747 // Normalize root to always include a leading and trailing slash. 2748 this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 2749 2750 // Transition from hashChange to pushState or vice versa if both are 2751 // requested. 2752 if (this._wantsHashChange && this._wantsPushState) { 2753 2754 // If we've started off with a route from a `pushState`-enabled 2755 // browser, but we're currently in a browser that doesn't support it... 2756 if (!this._hasPushState && !this.atRoot()) { 2757 var rootPath = this.root.slice(0, -1) || '/'; 2758 this.location.replace(rootPath + '#' + this.getPath()); 2759 // Return immediately as browser will do redirect to new url 2760 return true; 2761 2762 // Or if we've started out with a hash-based route, but we're currently 2763 // in a browser where it could be `pushState`-based instead... 2764 } else if (this._hasPushState && this.atRoot()) { 2765 this.navigate(this.getHash(), {replace: true}); 2766 } 2767 2768 } 2769 2770 // Proxy an iframe to handle location events if the browser doesn't 2771 // support the `hashchange` event, HTML5 history, or the user wants 2772 // `hashChange` but not `pushState`. 2773 if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) { 2774 this.iframe = document.createElement('iframe'); 2775 this.iframe.src = 'javascript:0'; 2776 this.iframe.style.display = 'none'; 2777 this.iframe.tabIndex = -1; 2778 var body = document.body; 2779 // Using `appendChild` will throw on IE < 9 if the document is not ready. 2780 var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow; 2781 iWindow.document.open(); 2782 iWindow.document.close(); 2783 iWindow.location.hash = '#' + this.fragment; 2784 } 2785 2786 // Add a cross-platform `addEventListener` shim for older browsers. 2787 var addEventListener = window.addEventListener || function(eventName, listener) { 2788 return attachEvent('on' + eventName, listener); 2789 }; 2790 2791 // Depending on whether we're using pushState or hashes, and whether 2792 // 'onhashchange' is supported, determine how we check the URL state. 2793 if (this._usePushState) { 2794 addEventListener('popstate', this.checkUrl, false); 2795 } else if (this._useHashChange && !this.iframe) { 2796 addEventListener('hashchange', this.checkUrl, false); 2797 } else if (this._wantsHashChange) { 2798 this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 2799 } 2800 2801 if (!this.options.silent) return this.loadUrl(); 2802 }, 2803 2804 // Disable Backbone.history, perhaps temporarily. Not useful in a real app, 2805 // but possibly useful for unit testing Routers. 2806 stop: function() { 2807 // Add a cross-platform `removeEventListener` shim for older browsers. 2808 var removeEventListener = window.removeEventListener || function(eventName, listener) { 2809 return detachEvent('on' + eventName, listener); 2810 }; 2811 2812 // Remove window listeners. 2813 if (this._usePushState) { 2814 removeEventListener('popstate', this.checkUrl, false); 2815 } else if (this._useHashChange && !this.iframe) { 2816 removeEventListener('hashchange', this.checkUrl, false); 2817 } 2818 2819 // Clean up the iframe if necessary. 2820 if (this.iframe) { 2821 document.body.removeChild(this.iframe); 2822 this.iframe = null; 2823 } 2824 2825 // Some environments will throw when clearing an undefined interval. 2826 if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); 2827 History.started = false;
2828 }, 2829 2830 // Add a route to be tested when the fragment changes. Routes added later 2831 // may override previous routes. 2832 route: function(route, callback) { 2833 this.handlers.unshift({route: route, callback: callback}); 2834 }, 2835 2836 // Checks the current URL to see if it has changed, and if it has, 2837 // calls `loadUrl`, normalizing across the hidden iframe. 2838 checkUrl: function(e) { 2839 var current = this.getFragment(); 2840 2841 // If the user pressed the back button, the iframe's hash will have 2842 // changed and we should use that for comparison. 2843 if (current === this.fragment && this.iframe) { 2844 current = this.getHash(this.iframe.contentWindow); 2845 } 2846 2847 if (current === this.fragment) { 2848 if (!this.matchRoot()) return this.notfound(); 2849 return false; 2850 } 2851 if (this.iframe) this.navigate(current); 2852 this.loadUrl(); 2853 }, 2854 2855 // Attempt to load the current URL fragment. If a route succeeds with a 2856 // match, returns `true`. If no defined routes matches the fragment, 2857 // returns `false`. 2858 loadUrl: function(fragment) { 2859 // If the root doesn't match, no routes can match either. 2860 if (!this.matchRoot()) return this.notfound(); 2861 fragment = this.fragment = this.getFragment(fragment); 2862 return _.some(this.handlers, function(handler) { 2863 if (handler.route.test(fragment)) { 2864 handler.callback(fragment); 2865 return true; 2866 } 2867 }) || this.notfound(); 2868 }, 2869 2870 // When no route could be matched, this method is called internally to 2871 // trigger the `'notfound'` event. It returns `false` so that it can be used 2872 // in tail position. 2873 notfound: function() { 2874 this.trigger('notfound'); 2875 return false; 2876 }, 2877 2878 // Save a fragment into the hash history, or replace the URL state if the 2879 // 'replace' option is passed. You are responsible for properly URL-encoding 2880 // the fragment in advance. 2881 // 2882 // The options object can contain `trigger: true` if you wish to have the 2883 // route callback be fired (not usually desirable), or `replace: true`, if 2884 // you wish to modify the current URL without adding an entry to the history. 2885 navigate: function(fragment, options) { 2886 if (!History.started) return false; 2887 if (!options || options === true) options = {trigger: !!options}; 2888 2889 // Normalize the fragment. 2890 fragment = this.getFragment(fragment || ''); 2891 2892 // Strip trailing slash on the root unless _trailingSlash is true 2893 var rootPath = this.root; 2894 if (!this._trailingSlash && (fragment === '' || fragment.charAt(0) === '?')) { 2895 rootPath = rootPath.slice(0, -1) || '/'; 2896 } 2897 var url = rootPath + fragment; 2898 2899 // Strip the fragment of the query and hash for matching. 2900 fragment = fragment.replace(pathStripper, ''); 2901 2902 // Decode for matching. 2903 var decodedFragment = this.decodeFragment(fragment); 2904 2905 if (this.fragment === decodedFragment) return; 2906 this.fragment = decodedFragment; 2907 2908 // If pushState is available, we use it to set the fragment as a real URL. 2909 if (this._usePushState) { 2910 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 2911 2912 // If hash changes haven't been explicitly disabled, update the hash 2913 // fragment to store history. 2914 } else if (this._wantsHashChange) { 2915 this._updateHash(this.location, fragment, options.replace); 2916 if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) { 2917 var iWindow = this.iframe.contentWindow; 2918 2919 // Opening and closing the iframe tricks IE7 and earlier to push a 2920 // history entry on hash-tag change. When replace is true, we don't 2921 // want this. 2922 if (!options.replace) { 2923 iWindow.document.open(); 2924 iWindow.document.close(); 2925 } 2926 2927 this._updateHash(iWindow.location, fragment, options.replace); 2928 } 2929 2930 // If you've told us that you explicitly don't want fallback hashchange- 2931 // based history, then `navigate` becomes a page refresh. 2932 } else { 2933 return this.location.assign(url); 2934 } 2935 if (options.trigger) return this.loadUrl(fragment); 2936 }, 2937 2938 // Update the hash location, either replacing the current entry, or adding 2939 // a new one to the browser history. 2940 _updateHash: function(location, fragment, replace) { 2941 if (replace) { 2942 var href = location.href.replace(/(javascript:|#).*$/, ''); 2943 location.replace(href + '#' + fragment); 2944 } else { 2945 // Some browsers require that `hash` contains a leading #. 2946 location.hash = '#' + fragment; 2947 } 2948 } 2949 2950 }); 2951 2952 // Create the default Backbone.history. 2953 Backbone.history = new History; 2954 2955 // Helpers 2956 // ------- 2957 2958 // Helper function to correctly set up the prototype chain for subclasses. 2959 // Similar to `goog.inherits`, but uses a hash of prototype properties and 2960 // class properties to be extended. 2961 var extend = function(protoProps, staticProps) { 2962 var parent = this; 2963 var child; 2964 2965 // The constructor function for the new subclass is either defined by you 2966 // (the "constructor" property in your `extend` definition), or defaulted 2967 // by us to simply call the parent constructor. 2968 if (protoProps && _.has(protoProps, 'constructor')) { 2969 child = protoProps.constructor; 2970 } else { 2971 child = function(){ return parent.apply(this, arguments); }; 2972 } 2973 2974 // Add static properties to the constructor function, if supplied.
2975 _.extend(child, parent, staticProps); 2976 2977 // Set the prototype chain to inherit from `parent`, without calling 2978 // `parent`'s constructor function and add the prototype properties. 2979 child.prototype = _.create(parent.prototype, protoProps); 2980 child.prototype.constructor = child; 2981 2982 // Set a convenience property in case the parent's prototype is needed 2983 // later. 2984 child.__super__ = parent.prototype; 2985 2986 return child; 2987 }; 2988 2989 // Set up inheritance for the model, collection, router, view and history. 2990 Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend; 2991 2992 // Throw an error when a URL is needed, and none is supplied. 2993 var urlError = function() { 2994 throw new Error('A "url" property or function must be specified'); 2995 }; 2996 2997 // Wrap an optional error callback with a fallback error event. 2998 var wrapError = function(model, options) { 2999 var error = options.error; 3000 options.error = function(resp) { 3001 if (error) error.call(options.context, model, resp, options); 3002 model.trigger('error', model, resp, options); 3003 }; 3004 }; 3005 3006 // Provide useful information when things go wrong. This method is not meant 3007 // to be used directly; it merely provides the necessary introspection for the 3008 // external `debugInfo` function. 3009 Backbone._debug = function() { 3010 return {root: root, _: _}; 3011 }; 3012 3013 return Backbone; 3014}); 3015 3016 3017/***/ }, 3018 3019/***/ "./node_modules/jquery/dist/jquery.js" 3020/*!********************************************!*\ 3021 !*** ./node_modules/jquery/dist/jquery.js ***! 3022 \********************************************/ 3023(module, exports) { 3024 3025var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 3026 * jQuery JavaScript Library v3.7.1 3027 * https://jquery.com/ 3028 * 3029 * Copyright OpenJS Foundation and other contributors 3030 * Released under the MIT license 3031 * https://jquery.org/license 3032 * 3033 * Date: 2023-08-28T13:37Z 3034 */ 3035( function( global, factory ) { 3036 3037 "use strict"; 3038 3039 if ( true
vendor: 284,319 bytes, lines 3039-13700
3039 && typeof module.exports === "object" ) { 3040 3041 // For CommonJS and CommonJS-like environments where a proper `window` 3042 // is present, execute the factory and get jQuery. 3043 // For environments that do not have a `window` with a `document` 3044 // (such as Node.js), expose a factory as module.exports. 3045 // This accentuates the need for the creation of a real `window`. 3046 // e.g. var jQuery = require("jquery")(window); 3047 // See ticket trac-14549 for more info. 3048 module.exports = global.document ? 3049 factory( global, true ) : 3050 function( w ) { 3051 if ( !w.document ) { 3052 throw new Error( "jQuery requires a window with a document" ); 3053 } 3054 return factory( w ); 3055 }; 3056 } else { 3057 factory( global ); 3058 } 3059 3060// Pass this if window is not defined yet 3061} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 3062 3063// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 3064// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 3065// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 3066// enough that all such attempts are guarded in a try block. 3067"use strict"; 3068 3069var arr = []; 3070 3071var getProto = Object.getPrototypeOf; 3072 3073var slice = arr.slice; 3074 3075var flat = arr.flat ? function( array ) { 3076 return arr.flat.call( array ); 3077} : function( array ) { 3078 return arr.concat.apply( [], array ); 3079}; 3080 3081 3082var push = arr.push; 3083 3084var indexOf = arr.indexOf; 3085 3086var class2type = {}; 3087 3088var toString = class2type.toString; 3089 3090var hasOwn = class2type.hasOwnProperty; 3091 3092var fnToString = hasOwn.toString; 3093 3094var ObjectFunctionString = fnToString.call( Object ); 3095 3096var support = {}; 3097 3098var isFunction = function isFunction( obj ) { 3099 3100 // Support: Chrome <=57, Firefox <=52 3101 // In some browsers, typeof returns "function" for HTML <object> elements 3102 // (i.e., `typeof document.createElement( "object" ) === "function"`). 3103 // We don't want to classify *any* DOM node as a function. 3104 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 3105 // Plus for old WebKit, typeof returns "function" for HTML collections 3106 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 3107 return typeof obj === "function" && typeof obj.nodeType !== "number" && 3108 typeof obj.item !== "function"; 3109 }; 3110 3111 3112var isWindow = function isWindow( obj ) { 3113 return obj != null && obj === obj.window; 3114 }; 3115 3116 3117var document = window.document; 3118 3119 3120 3121 var preservedScriptAttributes = { 3122 type: true, 3123 src: true, 3124 nonce: true, 3125 noModule: true 3126 }; 3127 3128 function DOMEval( code, node, doc ) { 3129 doc = doc || document; 3130 3131 var i, val, 3132 script = doc.createElement( "script" ); 3133 3134 script.text = code; 3135 if ( node ) { 3136 for ( i in preservedScriptAttributes ) { 3137 3138 // Support: Firefox 64+, Edge 18+ 3139 // Some browsers don't support the "nonce" property on scripts. 3140 // On the other hand, just using `getAttribute` is not enough as 3141 // the `nonce` attribute is reset to an empty string whenever it 3142 // becomes browsing-context connected. 3143 // See https://github.com/whatwg/html/issues/2369 3144 // See https://html.spec.whatwg.org/#nonce-attributes 3145 // The `node.getAttribute` check was added for the sake of 3146 // `jQuery.globalEval` so that it can fake a nonce-containing node 3147 // via an object. 3148 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 3149 if ( val ) { 3150 script.setAttribute( i, val ); 3151 } 3152 } 3153 } 3154 doc.head.appendChild( script ).parentNode.removeChild( script ); 3155 } 3156 3157 3158function toType( obj ) { 3159 if ( obj == null ) { 3160 return obj + ""; 3161 } 3162 3163 // Support: Android <=2.3 only (functionish RegExp) 3164 return typeof obj === "object" || typeof obj === "function" ? 3165 class2type[ toString.call( obj ) ] || "object" : 3166 typeof obj; 3167} 3168/* global Symbol */ 3169// Defining this global in .eslintrc.json would create a danger of using the global 3170// unguarded in another place, it seems safer to define global only for this module 3171 3172 3173 3174var version = "3.7.1", 3175 3176 rhtmlSuffix = /HTML$/i, 3177 3178 // Define a local copy of jQuery 3179 jQuery = function( selector, context ) { 3180 3181 // The jQuery object is actually just the init constructor 'enhanced' 3182 // Need init if jQuery is called (just allow error to be thrown if not included) 3183 return new jQuery.fn.init( selector, context ); 3184 }; 3185 3186jQuery.fn = jQuery.prototype = { 3187 3188 // The current version of jQuery being used 3189 jquery: version, 3190 3191 constructor: jQuery, 3192 3193 // The default length of a jQuery object is 0 3194 length: 0, 3195 3196 toArray: function() { 3197 return slice.call( this ); 3198 }, 3199 3200 // Get the Nth element in the matched element set OR 3201 // Get the whole matched element set as a clean array 3202 get: function( num ) { 3203 3204 // Return all the elements in a clean array 3205 if ( num == null ) { 3206 return slice.call( this ); 3207 } 3208 3209 // Return just the one element from the set 3210 return num < 0 ? this[ num + this.length ] : this[ num ]; 3211 }, 3212 3213 // Take an array of elements and push it onto the stack 3214 // (returning the new matched element set) 3215 pushStack: function( elems ) { 3216 3217 // Build a new jQuery matched element set 3218 var ret = jQuery.merge( this.constructor(), elems ); 3219 3220 // Add the old object onto the stack (as a reference) 3221 ret.prevObject = this; 3222 3223 // Return the newly-formed element set 3224 return ret; 3225 }, 3226 3227 // Execute a callback for every element in the matched set. 3228 each: function( callback ) { 3229 return jQuery.each( this, callback ); 3230 }, 3231 3232 map: function( callback ) { 3233 return this.pushStack( jQuery.map( this, function( elem, i ) { 3234 return callback.call( elem, i, elem ); 3235 } ) ); 3236 }, 3237 3238 slice: function() { 3239 return this.pushStack( slice.apply( this, arguments ) ); 3240 }, 3241 3242 first: function() { 3243 return this.eq( 0 ); 3244 }, 3245 3246 last: function() { 3247 return this.eq( -1 ); 3248 }, 3249 3250 even: function() { 3251 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 3252 return ( i + 1 ) % 2; 3253 } ) ); 3254 }, 3255 3256 odd: function() { 3257 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 3258 return i % 2; 3259 } ) ); 3260 }, 3261 3262 eq: function( i ) { 3263 var len = this.length, 3264 j = +i + ( i < 0 ? len : 0 ); 3265 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 3266 }, 3267 3268 end: function() { 3269 return this.prevObject || this.constructor(); 3270 }, 3271 3272 // For internal use only. 3273 // Behaves like an Array's method, not like a jQuery method. 3274 push: push, 3275 sort: arr.sort, 3276 splice: arr.splice 3277}; 3278 3279jQuery.extend = jQuery.fn.extend = function() { 3280 var options, name, src, copy, copyIsArray, clone, 3281 target = arguments[ 0 ] || {}, 3282 i = 1, 3283 length = arguments.length, 3284 deep = false; 3285 3286 // Handle a deep copy situation 3287 if ( typeof target === "boolean" ) { 3288 deep = target; 3289 3290 // Skip the boolean and the target 3291 target = arguments[ i ] || {}; 3292 i++; 3293 } 3294 3295 // Handle case when target is a string or something (possible in deep copy) 3296 if ( typeof target !== "object" && !isFunction( target ) ) { 3297 target = {}; 3298 } 3299 3300 // Extend jQuery itself if only one argument is passed 3301 if ( i === length ) { 3302 target = this; 3303 i--; 3304 } 3305 3306 for ( ; i < length; i++ ) { 3307 3308 // Only deal with non-null/undefined values 3309 if ( ( options = arguments[ i ] ) != null ) { 3310 3311 // Extend the base object 3312 for ( name in options ) { 3313 copy = options[ name ]; 3314 3315 // Prevent Object.prototype pollution 3316 // Prevent never-ending loop 3317 if ( name === "__proto__" || target === copy ) { 3318 continue; 3319 } 3320 3321 // Recurse if we're merging plain objects or arrays 3322 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 3323 ( copyIsArray = Array.isArray( copy ) ) ) ) { 3324 src = target[ name ]; 3325 3326 // Ensure proper type for the source value 3327 if ( copyIsArray && !Array.isArray( src ) ) { 3328 clone = []; 3329 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 3330 clone = {}; 3331 } else { 3332 clone = src; 3333 } 3334 copyIsArray = false; 3335 3336 // Never move original objects, clone them 3337 target[ name ] = jQuery.extend( deep, clone, copy ); 3338 3339 // Don't bring in undefined values 3340 } else if ( copy !== undefined ) { 3341 target[ name ] = copy; 3342 } 3343 } 3344 } 3345 } 3346 3347 // Return the modified object 3348 return target; 3349}; 3350 3351jQuery.extend( { 3352 3353 // Unique for each copy of jQuery on the page 3354 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 3355 3356 // Assume jQuery is ready without the ready module 3357 isReady: true, 3358 3359 error: function( msg ) { 3360 throw new Error( msg ); 3361 }, 3362 3363 noop: function() {}, 3364 3365 isPlainObject: function( obj ) { 3366 var proto, Ctor; 3367 3368 // Detect obvious negatives 3369 // Use toString instead of jQuery.type to catch host objects 3370 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 3371 return false; 3372 } 3373 3374 proto = getProto( obj ); 3375 3376 // Objects with no prototype (e.g., `Object.create( null )`) are plain 3377 if ( !proto ) { 3378 return true; 3379 } 3380 3381 // Objects with prototype are plain iff they were constructed by a global Object function 3382 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 3383 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 3384 }, 3385 3386 isEmptyObject: function( obj ) { 3387 var name; 3388 3389 for ( name in obj ) { 3390 return false; 3391 } 3392 return true; 3393 }, 3394 3395 // Evaluates a script in a provided context; falls back to the global one 3396 // if not specified. 3397 globalEval: function( code, options, doc ) { 3398 DOMEval( code, { nonce: options && options.nonce }, doc ); 3399 }, 3400 3401 each: function( obj, callback ) { 3402 var length, i = 0; 3403 3404 if ( isArrayLike( obj ) ) { 3405 length = obj.length; 3406 for ( ; i < length; i++ ) { 3407 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 3408 break; 3409 } 3410 } 3411 } else { 3412 for ( i in obj ) { 3413 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 3414 break; 3415 } 3416 } 3417 } 3418 3419 return obj; 3420 }, 3421 3422 3423 // Retrieve the text value of an array of DOM nodes 3424 text: function( elem ) { 3425 var node, 3426 ret = "", 3427 i = 0, 3428 nodeType = elem.nodeType; 3429 3430 if ( !nodeType ) { 3431 3432 // If no nodeType, this is expected to be an array 3433 while ( ( node = elem[ i++ ] ) ) { 3434 3435 // Do not traverse comment nodes 3436 ret += jQuery.text( node ); 3437 } 3438 } 3439 if ( nodeType === 1 || nodeType === 11 ) { 3440 return elem.textContent; 3441 } 3442 if ( nodeType === 9 ) { 3443 return elem.documentElement.textContent; 3444 } 3445 if ( nodeType === 3 || nodeType === 4 ) { 3446 return elem.nodeValue; 3447 } 3448 3449 // Do not include comment or processing instruction nodes 3450 3451 return ret; 3452 }, 3453 3454 // results is for internal usage only 3455 makeArray: function( arr, results ) { 3456 var ret = results || []; 3457 3458 if ( arr != null ) { 3459 if ( isArrayLike( Object( arr ) ) ) { 3460 jQuery.merge( ret, 3461 typeof arr === "string" ? 3462 [ arr ] : arr 3463 ); 3464 } else { 3465 push.call( ret, arr ); 3466 } 3467 } 3468 3469 return ret; 3470 }, 3471 3472 inArray: function( elem, arr, i ) { 3473 return arr == null ? -1 : indexOf.call( arr, elem, i ); 3474 }, 3475 3476 isXMLDoc: function( elem ) { 3477 var namespace = elem && elem.namespaceURI, 3478 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 3479 3480 // Assume HTML when documentElement doesn't yet exist, such as inside 3481 // document fragments. 3482 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 3483 }, 3484 3485 // Support: Android <=4.0 only, PhantomJS 1 only 3486 // push.apply(_, arraylike) throws on ancient WebKit 3487 merge: function( first, second ) { 3488 var len = +second.length, 3489 j = 0, 3490 i = first.length; 3491 3492 for ( ; j < len; j++ ) { 3493 first[ i++ ] = second[ j ]; 3494 } 3495 3496 first.length = i; 3497 3498 return first; 3499 }, 3500 3501 grep: function( elems, callback, invert ) { 3502 var callbackInverse, 3503 matches = [], 3504 i = 0, 3505 length = elems.length, 3506 callbackExpect = !invert; 3507 3508 // Go through the array, only saving the items 3509 // that pass the validator function 3510 for ( ; i < length; i++ ) { 3511 callbackInverse = !callback( elems[ i ], i ); 3512 if ( callbackInverse !== callbackExpect ) { 3513 matches.push( elems[ i ] ); 3514 } 3515 } 3516 3517 return matches; 3518 }, 3519 3520 // arg is for internal usage only 3521 map: function( elems, callback, arg ) { 3522 var length, value, 3523 i = 0, 3524 ret = []; 3525 3526 // Go through the array, translating each of the items to their new values 3527 if ( isArrayLike( elems ) ) { 3528 length = elems.length; 3529 for ( ; i < length; i++ ) { 3530 value = callback( elems[ i ], i, arg ); 3531 3532 if ( value != null ) { 3533 ret.push( value ); 3534 } 3535 } 3536 3537 // Go through every key on the object, 3538 } else { 3539 for ( i in elems ) { 3540 value = callback( elems[ i ], i, arg ); 3541 3542 if ( value != null ) { 3543 ret.push( value ); 3544 } 3545 } 3546 } 3547 3548 // Flatten any nested arrays 3549 return flat( ret ); 3550 }, 3551 3552 // A global GUID counter for objects 3553 guid: 1, 3554 3555 // jQuery.support is not used in Core but other projects attach their 3556 // properties to it so it needs to exist. 3557 support: support 3558} ); 3559 3560if ( typeof Symbol === "function" ) { 3561 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 3562} 3563 3564// Populate the class2type map 3565jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 3566 function( _i, name ) { 3567 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 3568 } ); 3569 3570function isArrayLike( obj ) { 3571 3572 // Support: real iOS 8.2 only (not reproducible in simulator) 3573 // `in` check used to prevent JIT error (gh-2145) 3574 // hasOwn isn't used here due to false negatives 3575 // regarding Nodelist length in IE 3576 var length = !!obj && "length" in obj && obj.length, 3577 type = toType( obj ); 3578 3579 if ( isFunction( obj ) || isWindow( obj ) ) { 3580 return false; 3581 } 3582 3583 return type === "array" || length === 0 || 3584 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 3585} 3586 3587 3588function nodeName( elem, name ) { 3589 3590 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 3591 3592} 3593var pop = arr.pop; 3594 3595 3596var sort = arr.sort; 3597 3598 3599var splice = arr.splice; 3600 3601 3602var whitespace = "[\\x20\\t\\r\\n\\f]"; 3603 3604 3605var rtrimCSS = new RegExp( 3606 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 3607 "g" 3608); 3609 3610 3611 3612 3613// Note: an element does not contain itself 3614jQuery.contains = function( a, b ) { 3615 var bup = b && b.parentNode; 3616 3617 return a === bup || !!( bup && bup.nodeType === 1 && ( 3618 3619 // Support: IE 9 - 11+ 3620 // IE doesn't have `contains` on SVG. 3621 a.contains ? 3622 a.contains( bup ) : 3623 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 3624 ) ); 3625}; 3626 3627 3628 3629 3630// CSS string/identifier serialization 3631// https://drafts.csswg.org/cssom/#common-serializing-idioms 3632var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 3633 3634function fcssescape( ch, asCodePoint ) { 3635 if ( asCodePoint ) { 3636 3637 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 3638 if ( ch === "\0" ) { 3639 return "\uFFFD"; 3640 } 3641 3642 // Control characters and (dependent upon position) numbers get escaped as code points 3643 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 3644 } 3645 3646 // Other potentially-special ASCII characters get backslash-escaped 3647 return "\\" + ch; 3648} 3649 3650jQuery.escapeSelector = function( sel ) { 3651 return ( sel + "" ).replace( rcssescape, fcssescape ); 3652}; 3653 3654 3655 3656 3657var preferredDoc = document, 3658 pushNative = push; 3659 3660( function() { 3661 3662var i, 3663 Expr, 3664 outermostContext, 3665 sortInput, 3666 hasDuplicate, 3667 push = pushNative, 3668 3669 // Local document vars 3670 document, 3671 documentElement, 3672 documentIsHTML, 3673 rbuggyQSA, 3674 matches, 3675 3676 // Instance-specific data 3677 expando = jQuery.expando, 3678 dirruns = 0, 3679 done = 0, 3680 classCache = createCache(), 3681 tokenCache = createCache(), 3682 compilerCache = createCache(), 3683 nonnativeSelectorCache = createCache(), 3684 sortOrder = function( a, b ) { 3685 if ( a === b ) { 3686 hasDuplicate = true; 3687 } 3688 return 0; 3689 }, 3690 3691 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 3692 "loop|multiple|open|readonly|required|scoped", 3693 3694 // Regular expressions 3695 3696 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 3697 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 3698 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 3699 3700 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 3701 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 3702 3703 // Operator (capture 2) 3704 "*([*^$|!~]?=)" + whitespace + 3705 3706 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 3707 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 3708 whitespace + "*\\]", 3709 3710 pseudos = ":(" + identifier + ")(?:\\((" + 3711 3712 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 3713 // 1. quoted (capture 3; capture 4 or capture 5) 3714 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 3715 3716 // 2. simple (capture 6) 3717 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 3718 3719 // 3. anything else (capture 2) 3720 ".*" + 3721 ")\\)|)", 3722 3723 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 3724 rwhitespace = new RegExp( whitespace + "+", "g" ), 3725 3726 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 3727 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 3728 whitespace + "*" ), 3729 rdescend = new RegExp( whitespace + "|>" ), 3730 3731 rpseudo = new RegExp( pseudos ), 3732 ridentifier = new RegExp( "^" + identifier + "$" ), 3733 3734 matchExpr = { 3735 ID: new RegExp( "^#(" + identifier + ")" ), 3736 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 3737 TAG: new RegExp( "^(" + identifier + "|[*])" ), 3738 ATTR: new RegExp( "^" + attributes ), 3739 PSEUDO: new RegExp( "^" + pseudos ), 3740 CHILD: new RegExp( 3741 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 3742 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 3743 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 3744 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 3745 3746 // For use in libraries implementing .is() 3747 // We use this for POS matching in `select` 3748 needsContext: new RegExp( "^" + whitespace + 3749 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 3750 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 3751 }, 3752 3753 rinputs = /^(?:input|select|textarea|button)$/i, 3754 rheader = /^h\d$/i, 3755 3756 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3757 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3758 3759 rsibling = /[+~]/, 3760 3761 // CSS escapes 3762 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 3763 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 3764 "?|\\\\([^\\r\\n\\f])", "g" ), 3765 funescape = function( escape, nonHex ) { 3766 var high = "0x" + escape.slice( 1 ) - 0x10000; 3767 3768 if ( nonHex ) { 3769 3770 // Strip the backslash prefix from a non-hex escape sequence 3771 return nonHex; 3772 } 3773 3774 // Replace a hexadecimal escape sequence with the encoded Unicode code point 3775 // Support: IE <=11+ 3776 // For values outside the Basic Multilingual Plane (BMP), manually construct a 3777 // surrogate pair 3778 return high < 0 ? 3779 String.fromCharCode( high + 0x10000 ) : 3780 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 3781 }, 3782 3783 // Used for iframes; see `setDocument`. 3784 // Support: IE 9 - 11+, Edge 12 - 18+ 3785 // Removing the function wrapper causes a "Permission Denied" 3786 // error in IE/Edge. 3787 unloadHandler = function() { 3788 setDocument(); 3789 }, 3790 3791 inDisabledFieldset = addCombinator( 3792 function( elem ) { 3793 return elem.disabled === true && nodeName( elem, "fieldset" ); 3794 }, 3795 { dir: "parentNode", next: "legend" } 3796 ); 3797 3798// Support: IE <=9 only 3799// Accessing document.activeElement can throw unexpectedly 3800// https://bugs.jquery.com/ticket/13393 3801function safeActiveElement() { 3802 try { 3803 return document.activeElement; 3804 } catch ( err ) { } 3805} 3806 3807// Optimize for push.apply( _, NodeList ) 3808try { 3809 push.apply( 3810 ( arr = slice.call( preferredDoc.childNodes ) ), 3811 preferredDoc.childNodes 3812 ); 3813 3814 // Support: Android <=4.0 3815 // Detect silently failing push.apply 3816 // eslint-disable-next-line no-unused-expressions 3817 arr[ preferredDoc.childNodes.length ].nodeType; 3818} catch ( e ) { 3819 push = { 3820 apply: function( target, els ) { 3821 pushNative.apply( target, slice.call( els ) ); 3822 }, 3823 call: function( target ) { 3824 pushNative.apply( target, slice.call( arguments, 1 ) ); 3825 } 3826 }; 3827} 3828 3829function find( selector, context, results, seed ) { 3830 var m, i, elem, nid, match, groups, newSelector, 3831 newContext = context && context.ownerDocument, 3832 3833 // nodeType defaults to 9, since context defaults to document 3834 nodeType = context ? context.nodeType : 9; 3835 3836 results = results || []; 3837 3838 // Return early from calls with invalid selector or context 3839 if ( typeof selector !== "string" || !selector || 3840 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 3841 3842 return results; 3843 } 3844 3845 // Try to shortcut find operations (as opposed to filters) in HTML documents 3846 if ( !seed ) { 3847 setDocument( context ); 3848 context = context || document; 3849 3850 if ( documentIsHTML ) { 3851 3852 // If the selector is sufficiently simple, try using a "get*By*" DOM method 3853 // (excepting DocumentFragment context, where the methods don't exist) 3854 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 3855 3856 // ID selector 3857 if ( ( m = match[ 1 ] ) ) { 3858 3859 // Document context 3860 if ( nodeType === 9 ) { 3861 if ( ( elem = context.getElementById( m ) ) ) { 3862 3863 // Support: IE 9 only 3864 // getElementById can match elements by name instead of ID 3865 if ( elem.id === m ) { 3866 push.call( results, elem ); 3867 return results; 3868 } 3869 } else { 3870 return results; 3871 } 3872 3873 // Element context 3874 } else { 3875 3876 // Support: IE 9 only 3877 // getElementById can match elements by name instead of ID 3878 if ( newContext && ( elem = newContext.getElementById( m ) ) && 3879 find.contains( context, elem ) && 3880 elem.id === m ) { 3881 3882 push.call( results, elem ); 3883 return results; 3884 } 3885 } 3886 3887 // Type selector 3888 } else if ( match[ 2 ] ) { 3889 push.apply( results, context.getElementsByTagName( selector ) ); 3890 return results; 3891 3892 // Class selector 3893 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 3894 push.apply( results, context.getElementsByClassName( m ) ); 3895 return results; 3896 } 3897 } 3898 3899 // Take advantage of querySelectorAll 3900 if ( !nonnativeSelectorCache[ selector + " " ] && 3901 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 3902 3903 newSelector = selector; 3904 newContext = context; 3905 3906 // qSA considers elements outside a scoping root when evaluating child or 3907 // descendant combinators, which is not what we want. 3908 // In such cases, we work around the behavior by prefixing every selector in the 3909 // list with an ID selector referencing the scope context. 3910 // The technique has to be used as well when a leading combinator is used 3911 // as such selectors are not recognized by querySelectorAll. 3912 // Thanks to Andrew Dupont for this technique. 3913 if ( nodeType === 1 && 3914 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 3915 3916 // Expand context for sibling selectors 3917 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 3918 context; 3919 3920 // We can use :scope instead of the ID hack if the browser 3921 // supports it & if we're not changing the context. 3922 // Support: IE 11+, Edge 17 - 18+ 3923 // IE/Edge sometimes throw a "Permission denied" error when 3924 // strict-comparing two documents; shallow comparisons work. 3925 // eslint-disable-next-line eqeqeq 3926 if ( newContext != context || !support.scope ) { 3927 3928 // Capture the context ID, setting it first if necessary 3929 if ( ( nid = context.getAttribute( "id" ) ) ) { 3930 nid = jQuery.escapeSelector( nid ); 3931 } else { 3932 context.setAttribute( "id", ( nid = expando ) ); 3933 } 3934 } 3935 3936 // Prefix every selector in the list 3937 groups = tokenize( selector ); 3938 i = groups.length; 3939 while ( i-- ) { 3940 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 3941 toSelector( groups[ i ] ); 3942 } 3943 newSelector = groups.join( "," ); 3944 } 3945 3946 try { 3947 push.apply( results, 3948 newContext.querySelectorAll( newSelector ) 3949 ); 3950 return results; 3951 } catch ( qsaError ) { 3952 nonnativeSelectorCache( selector, true ); 3953 } finally { 3954 if ( nid === expando ) { 3955 context.removeAttribute( "id" ); 3956 } 3957 } 3958 } 3959 } 3960 } 3961 3962 // All others 3963 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 3964} 3965 3966/** 3967 * Create key-value caches of limited size 3968 * @returns {function(string, object)} Returns the Object data after storing it on itself with 3969 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 3970 * deleting the oldest entry 3971 */ 3972function createCache() { 3973 var keys = []; 3974 3975 function cache( key, value ) { 3976 3977 // Use (key + " ") to avoid collision with native prototype properties 3978 // (see https://github.com/jquery/sizzle/issues/157) 3979 if ( keys.push( key + " " ) > Expr.cacheLength ) { 3980 3981 // Only keep the most recent entries 3982 delete cache[ keys.shift() ]; 3983 } 3984 return ( cache[ key + " " ] = value ); 3985 } 3986 return cache; 3987} 3988 3989/** 3990 * Mark a function for special use by jQuery selector module 3991 * @param {Function} fn The function to mark 3992 */ 3993function markFunction( fn ) { 3994 fn[ expando ] = true; 3995 return fn; 3996} 3997 3998/** 3999 * Support testing using an element 4000 * @param {Function} fn Passed the created element and returns a boolean result 4001 */ 4002function assert( fn ) { 4003 var el = document.createElement( "fieldset" ); 4004 4005 try { 4006 return !!fn( el ); 4007 } catch ( e ) { 4008 return false; 4009 } finally { 4010 4011 // Remove from its parent by default 4012 if ( el.parentNode ) { 4013 el.parentNode.removeChild( el ); 4014 } 4015 4016 // release memory in IE 4017 el = null; 4018 } 4019} 4020 4021/** 4022 * Returns a function to use in pseudos for input types 4023 * @param {String} type 4024 */ 4025function createInputPseudo( type ) { 4026 return function( elem ) { 4027 return nodeName( elem, "input" ) && elem.type === type; 4028 }; 4029} 4030 4031/** 4032 * Returns a function to use in pseudos for buttons 4033 * @param {String} type 4034 */ 4035function createButtonPseudo( type ) { 4036 return function( elem ) { 4037 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 4038 elem.type === type; 4039 }; 4040} 4041 4042/** 4043 * Returns a function to use in pseudos for :enabled/:disabled 4044 * @param {Boolean} disabled true for :disabled; false for :enabled 4045 */ 4046function createDisabledPseudo( disabled ) { 4047 4048 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 4049 return function( elem ) { 4050 4051 // Only certain elements can match :enabled or :disabled 4052 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 4053 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 4054 if ( "form" in elem ) { 4055 4056 // Check for inherited disabledness on relevant non-disabled elements: 4057 // * listed form-associated elements in a disabled fieldset 4058 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 4059 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 4060 // * option elements in a disabled optgroup 4061 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 4062 // All such elements have a "form" property. 4063 if ( elem.parentNode && elem.disabled === false ) { 4064 4065 // Option elements defer to a parent optgroup if present 4066 if ( "label" in elem ) { 4067 if ( "label" in elem.parentNode ) { 4068 return elem.parentNode.disabled === disabled; 4069 } else { 4070 return elem.disabled === disabled; 4071 } 4072 } 4073 4074 // Support: IE 6 - 11+ 4075 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 4076 return elem.isDisabled === disabled || 4077 4078 // Where there is no isDisabled, check manually 4079 elem.isDisabled !== !disabled && 4080 inDisabledFieldset( elem ) === disabled; 4081 } 4082 4083 return elem.disabled === disabled; 4084 4085 // Try to winnow out elements that can't be disabled before trusting the disabled property. 4086 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 4087 // even exist on them, let alone have a boolean value. 4088 } else if ( "label" in elem ) { 4089 return elem.disabled === disabled; 4090 } 4091 4092 // Remaining elements are neither :enabled nor :disabled 4093 return false; 4094 }; 4095} 4096 4097/** 4098 * Returns a function to use in pseudos for positionals 4099 * @param {Function} fn 4100 */ 4101function createPositionalPseudo( fn ) { 4102 return markFunction( function( argument ) { 4103 argument = +argument; 4104 return markFunction( function( seed, matches ) { 4105 var j, 4106 matchIndexes = fn( [], seed.length, argument ), 4107 i = matchIndexes.length; 4108 4109 // Match elements found at the specified indexes 4110 while ( i-- ) { 4111 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 4112 seed[ j ] = !( matches[ j ] = seed[ j ] ); 4113 } 4114 } 4115 } ); 4116 } ); 4117} 4118 4119/** 4120 * Checks a node for validity as a jQuery selector context 4121 * @param {Element|Object=} context 4122 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 4123 */ 4124function testContext( context ) { 4125 return context && typeof context.getElementsByTagName !== "undefined" && context; 4126} 4127 4128/** 4129 * Sets document-related variables once based on the current document 4130 * @param {Element|Object} [node] An element or document object to use to set the document 4131 * @returns {Object} Returns the current document 4132 */ 4133function setDocument( node ) { 4134 var subWindow, 4135 doc = node ? node.ownerDocument || node : preferredDoc; 4136 4137 // Return early if doc is invalid or already selected 4138 // Support: IE 11+, Edge 17 - 18+ 4139 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4140 // two documents; shallow comparisons work. 4141 // eslint-disable-next-line eqeqeq 4142 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 4143 return document; 4144 } 4145 4146 // Update global variables 4147 document = doc; 4148 documentElement = document.documentElement; 4149 documentIsHTML = !jQuery.isXMLDoc( document ); 4150 4151 // Support: iOS 7 only, IE 9 - 11+ 4152 // Older browsers didn't support unprefixed `matches`. 4153 matches = documentElement.matches || 4154 documentElement.webkitMatchesSelector || 4155 documentElement.msMatchesSelector; 4156 4157 // Support: IE 9 - 11+, Edge 12 - 18+ 4158 // Accessing iframe documents after unload throws "permission denied" errors 4159 // (see trac-13936). 4160 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 4161 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 4162 if ( documentElement.msMatchesSelector && 4163 4164 // Support: IE 11+, Edge 17 - 18+ 4165 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4166 // two documents; shallow comparisons work. 4167 // eslint-disable-next-line eqeqeq 4168 preferredDoc != document && 4169 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 4170 4171 // Support: IE 9 - 11+, Edge 12 - 18+ 4172 subWindow.addEventListener( "unload", unloadHandler ); 4173 } 4174 4175 // Support: IE <10 4176 // Check if getElementById returns elements by name 4177 // The broken getElementById methods don't pick up programmatically-set names, 4178 // so use a roundabout getElementsByName test 4179 support.getById = assert( function( el ) { 4180 documentElement.appendChild( el ).id = jQuery.expando; 4181 return !document.getElementsByName || 4182 !document.getElementsByName( jQuery.expando ).length; 4183 } ); 4184 4185 // Support: IE 9 only 4186 // Check to see if it's possible to do matchesSelector 4187 // on a disconnected node. 4188 support.disconnectedMatch = assert( function( el ) { 4189 return matches.call( el, "*" ); 4190 } ); 4191 4192 // Support: IE 9 - 11+, Edge 12 - 18+ 4193 // IE/Edge don't support the :scope pseudo-class. 4194 support.scope = assert( function() { 4195 return document.querySelectorAll( ":scope" ); 4196 } ); 4197 4198 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 4199 // Make sure the `:has()` argument is parsed unforgivingly. 4200 // We include `*` in the test to detect buggy implementations that are 4201 // _selectively_ forgiving (specifically when the list includes at least 4202 // one valid selector). 4203 // Note that we treat complete lack of support for `:has()` as if it were 4204 // spec-compliant support, which is fine because use of `:has()` in such 4205 // environments will fail in the qSA path and fall back to jQuery traversal 4206 // anyway. 4207 support.cssHas = assert( function() { 4208 try { 4209 document.querySelector( ":has(*,:jqfake)" ); 4210 return false; 4211 } catch ( e ) { 4212 return true; 4213 } 4214 } ); 4215 4216 // ID filter and find 4217 if ( support.getById ) { 4218 Expr.filter.ID = function( id ) { 4219 var attrId = id.replace( runescape, funescape ); 4220 return function( elem ) { 4221 return elem.getAttribute( "id" ) === attrId; 4222 }; 4223 }; 4224 Expr.find.ID = function( id, context ) { 4225 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 4226 var elem = context.getElementById( id ); 4227 return elem ? [ elem ] : []; 4228 } 4229 }; 4230 } else { 4231 Expr.filter.ID = function( id ) { 4232 var attrId = id.replace( runescape, funescape ); 4233 return function( elem ) { 4234 var node = typeof elem.getAttributeNode !== "undefined" && 4235 elem.getAttributeNode( "id" ); 4236 return node && node.value === attrId; 4237 }; 4238 }; 4239 4240 // Support: IE 6 - 7 only 4241 // getElementById is not reliable as a find shortcut 4242 Expr.find.ID = function( id, context ) { 4243 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 4244 var node, i, elems, 4245 elem = context.getElementById( id ); 4246 4247 if ( elem ) { 4248 4249 // Verify the id attribute 4250 node = elem.getAttributeNode( "id" ); 4251 if ( node && node.value === id ) { 4252 return [ elem ]; 4253 } 4254 4255 // Fall back on getElementsByName 4256 elems = context.getElementsByName( id ); 4257 i = 0; 4258 while ( ( elem = elems[ i++ ] ) ) { 4259 node = elem.getAttributeNode( "id" ); 4260 if ( node && node.value === id ) { 4261 return [ elem ]; 4262 } 4263 } 4264 } 4265 4266 return []; 4267 } 4268 }; 4269 } 4270 4271 // Tag 4272 Expr.find.TAG = function( tag, context ) { 4273 if ( typeof context.getElementsByTagName !== "undefined" ) { 4274 return context.getElementsByTagName( tag ); 4275 4276 // DocumentFragment nodes don't have gEBTN 4277 } else { 4278 return context.querySelectorAll( tag ); 4279 } 4280 }; 4281 4282 // Class 4283 Expr.find.CLASS = function( className, context ) { 4284 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 4285 return context.getElementsByClassName( className ); 4286 } 4287 }; 4288 4289 /* QSA/matchesSelector 4290 ---------------------------------------------------------------------- */ 4291 4292 // QSA and matchesSelector support 4293 4294 rbuggyQSA = []; 4295 4296 // Build QSA regex 4297 // Regex strategy adopted from Diego Perini 4298 assert( function( el ) { 4299 4300 var input; 4301 4302 documentElement.appendChild( el ).innerHTML = 4303 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 4304 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 4305 "<option selected=''></option></select>"; 4306 4307 // Support: iOS <=7 - 8 only 4308 // Boolean attributes and "value" are not treated correctly in some XML documents 4309 if ( !el.querySelectorAll( "[selected]" ).length ) { 4310 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 4311 } 4312 4313 // Support: iOS <=7 - 8 only 4314 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 4315 rbuggyQSA.push( "~=" ); 4316 } 4317 4318 // Support: iOS 8 only 4319 // https://bugs.webkit.org/show_bug.cgi?id=136851 4320 // In-page `selector#id sibling-combinator selector` fails 4321 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 4322 rbuggyQSA.push( ".#.+[+~]" ); 4323 } 4324 4325 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 4326 // In some of the document kinds, these selectors wouldn't work natively. 4327 // This is probably OK but for backwards compatibility we want to maintain 4328 // handling them through jQuery traversal in jQuery 3.x. 4329 if ( !el.querySelectorAll( ":checked" ).length ) { 4330 rbuggyQSA.push( ":checked" ); 4331 } 4332 4333 // Support: Windows 8 Native Apps 4334 // The type and name attributes are restricted during .innerHTML assignment 4335 input = document.createElement( "input" ); 4336 input.setAttribute( "type", "hidden" ); 4337 el.appendChild( input ).setAttribute( "name", "D" ); 4338 4339 // Support: IE 9 - 11+ 4340 // IE's :disabled selector does not pick up the children of disabled fieldsets 4341 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 4342 // In some of the document kinds, these selectors wouldn't work natively. 4343 // This is probably OK but for backwards compatibility we want to maintain 4344 // handling them through jQuery traversal in jQuery 3.x. 4345 documentElement.appendChild( el ).disabled = true; 4346 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 4347 rbuggyQSA.push( ":enabled", ":disabled" ); 4348 } 4349 4350 // Support: IE 11+, Edge 15 - 18+ 4351 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 4352 // Adding a temporary attribute to the document before the selection works 4353 // around the issue. 4354 // Interestingly, IE 10 & older don't seem to have the issue. 4355 input = document.createElement( "input" ); 4356 input.setAttribute( "name", "" ); 4357 el.appendChild( input ); 4358 if ( !el.querySelectorAll( "[name='']" ).length ) { 4359 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 4360 whitespace + "*(?:''|\"\")" ); 4361 } 4362 } ); 4363 4364 if ( !support.cssHas ) { 4365 4366 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 4367 // Our regular `try-catch` mechanism fails to detect natively-unsupported 4368 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 4369 // in browsers that parse the `:has()` argument as a forgiving selector list. 4370 // https://drafts.csswg.org/selectors/#relational now requires the argument 4371 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 4372 rbuggyQSA.push( ":has" ); 4373 } 4374 4375 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 4376 4377 /* Sorting 4378 ---------------------------------------------------------------------- */ 4379 4380 // Document order sorting 4381 sortOrder = function( a, b ) { 4382 4383 // Flag for duplicate removal 4384 if ( a === b ) { 4385 hasDuplicate = true; 4386 return 0; 4387 } 4388 4389 // Sort on method existence if only one input has compareDocumentPosition 4390 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 4391 if ( compare ) { 4392 return compare; 4393 } 4394 4395 // Calculate position if both inputs belong to the same document 4396 // Support: IE 11+, Edge 17 - 18+ 4397 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4398 // two documents; shallow comparisons work. 4399 // eslint-disable-next-line eqeqeq 4400 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 4401 a.compareDocumentPosition( b ) : 4402 4403 // Otherwise we know they are disconnected 4404 1; 4405 4406 // Disconnected nodes 4407 if ( compare & 1 || 4408 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 4409 4410 // Choose the first element that is related to our preferred document 4411 // Support: IE 11+, Edge 17 - 18+ 4412 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4413 // two documents; shallow comparisons work. 4414 // eslint-disable-next-line eqeqeq 4415 if ( a === document || a.ownerDocument == preferredDoc && 4416 find.contains( preferredDoc, a ) ) { 4417 return -1; 4418 } 4419 4420 // Support: IE 11+, Edge 17 - 18+ 4421 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4422 // two documents; shallow comparisons work. 4423 // eslint-disable-next-line eqeqeq 4424 if ( b === document || b.ownerDocument == preferredDoc && 4425 find.contains( preferredDoc, b ) ) { 4426 return 1; 4427 } 4428 4429 // Maintain original order 4430 return sortInput ? 4431 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 4432 0; 4433 } 4434 4435 return compare & 4 ? -1 : 1; 4436 }; 4437 4438 return document; 4439} 4440 4441find.matches = function( expr, elements ) { 4442 return find( expr, null, null, elements ); 4443}; 4444 4445find.matchesSelector = function( elem, expr ) { 4446 setDocument( elem ); 4447 4448 if ( documentIsHTML && 4449 !nonnativeSelectorCache[ expr + " " ] && 4450 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 4451 4452 try { 4453 var ret = matches.call( elem, expr ); 4454 4455 // IE 9's matchesSelector returns false on disconnected nodes 4456 if ( ret || support.disconnectedMatch || 4457 4458 // As well, disconnected nodes are said to be in a document 4459 // fragment in IE 9 4460 elem.document && elem.document.nodeType !== 11 ) { 4461 return ret; 4462 } 4463 } catch ( e ) { 4464 nonnativeSelectorCache( expr, true ); 4465 } 4466 } 4467 4468 return find( expr, document, null, [ elem ] ).length > 0; 4469}; 4470 4471find.contains = function( context, elem ) { 4472 4473 // Set document vars if needed 4474 // Support: IE 11+, Edge 17 - 18+ 4475 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4476 // two documents; shallow comparisons work. 4477 // eslint-disable-next-line eqeqeq 4478 if ( ( context.ownerDocument || context ) != document ) { 4479 setDocument( context ); 4480 } 4481 return jQuery.contains( context, elem ); 4482}; 4483 4484 4485find.attr = function( elem, name ) { 4486 4487 // Set document vars if needed 4488 // Support: IE 11+, Edge 17 - 18+ 4489 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4490 // two documents; shallow comparisons work. 4491 // eslint-disable-next-line eqeqeq 4492 if ( ( elem.ownerDocument || elem ) != document ) { 4493 setDocument( elem ); 4494 } 4495 4496 var fn = Expr.attrHandle[ name.toLowerCase() ], 4497 4498 // Don't get fooled by Object.prototype properties (see trac-13807) 4499 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 4500 fn( elem, name, !documentIsHTML ) : 4501 undefined; 4502 4503 if ( val !== undefined ) { 4504 return val; 4505 } 4506 4507 return elem.getAttribute( name ); 4508}; 4509 4510find.error = function( msg ) { 4511 throw new Error( "Syntax error, unrecognized expression: " + msg ); 4512}; 4513 4514/** 4515 * Document sorting and removing duplicates 4516 * @param {ArrayLike} results 4517 */ 4518jQuery.uniqueSort = function( results ) { 4519 var elem, 4520 duplicates = [], 4521 j = 0, 4522 i = 0; 4523 4524 // Unless we *know* we can detect duplicates, assume their presence 4525 // 4526 // Support: Android <=4.0+ 4527 // Testing for detecting duplicates is unpredictable so instead assume we can't 4528 // depend on duplicate detection in all browsers without a stable sort. 4529 hasDuplicate = !support.sortStable; 4530 sortInput = !support.sortStable && slice.call( results, 0 ); 4531 sort.call( results, sortOrder ); 4532 4533 if ( hasDuplicate ) { 4534 while ( ( elem = results[ i++ ] ) ) { 4535 if ( elem === results[ i ] ) { 4536 j = duplicates.push( i ); 4537 } 4538 } 4539 while ( j-- ) { 4540 splice.call( results, duplicates[ j ], 1 ); 4541 } 4542 } 4543 4544 // Clear input after sorting to release objects 4545 // See https://github.com/jquery/sizzle/pull/225 4546 sortInput = null; 4547 4548 return results; 4549}; 4550 4551jQuery.fn.uniqueSort = function() { 4552 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 4553}; 4554 4555Expr = jQuery.expr = { 4556 4557 // Can be adjusted by the user 4558 cacheLength: 50, 4559 4560 createPseudo: markFunction, 4561 4562 match: matchExpr, 4563 4564 attrHandle: {}, 4565 4566 find: {}, 4567 4568 relative: { 4569 ">": { dir: "parentNode", first: true }, 4570 " ": { dir: "parentNode" }, 4571 "+": { dir: "previousSibling", first: true }, 4572 "~": { dir: "previousSibling" } 4573 }, 4574 4575 preFilter: { 4576 ATTR: function( match ) { 4577 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 4578 4579 // Move the given value to match[3] whether quoted or unquoted 4580 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 4581 .replace( runescape, funescape ); 4582 4583 if ( match[ 2 ] === "~=" ) { 4584 match[ 3 ] = " " + match[ 3 ] + " "; 4585 } 4586 4587 return match.slice( 0, 4 ); 4588 }, 4589 4590 CHILD: function( match ) { 4591 4592 /* matches from matchExpr["CHILD"] 4593 1 type (only|nth|...) 4594 2 what (child|of-type) 4595 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4596 4 xn-component of xn+y argument ([+-]?\d*n|) 4597 5 sign of xn-component 4598 6 x of xn-component 4599 7 sign of y-component 4600 8 y of y-component 4601 */ 4602 match[ 1 ] = match[ 1 ].toLowerCase(); 4603 4604 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 4605 4606 // nth-* requires argument 4607 if ( !match[ 3 ] ) { 4608 find.error( match[ 0 ] ); 4609 } 4610 4611 // numeric x and y parameters for Expr.filter.CHILD 4612 // remember that false/true cast respectively to 0/1 4613 match[ 4 ] = +( match[ 4 ] ? 4614 match[ 5 ] + ( match[ 6 ] || 1 ) : 4615 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 4616 ); 4617 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 4618 4619 // other types prohibit arguments 4620 } else if ( match[ 3 ] ) { 4621 find.error( match[ 0 ] ); 4622 } 4623 4624 return match; 4625 }, 4626 4627 PSEUDO: function( match ) { 4628 var excess, 4629 unquoted = !match[ 6 ] && match[ 2 ]; 4630 4631 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 4632 return null; 4633 } 4634 4635 // Accept quoted arguments as-is 4636 if ( match[ 3 ] ) { 4637 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 4638 4639 // Strip excess characters from unquoted arguments 4640 } else if ( unquoted && rpseudo.test( unquoted ) && 4641 4642 // Get excess from tokenize (recursively) 4643 ( excess = tokenize( unquoted, true ) ) && 4644 4645 // advance to the next closing parenthesis 4646 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 4647 4648 // excess is a negative index 4649 match[ 0 ] = match[ 0 ].slice( 0, excess ); 4650 match[ 2 ] = unquoted.slice( 0, excess ); 4651 } 4652 4653 // Return only captures needed by the pseudo filter method (type and argument) 4654 return match.slice( 0, 3 ); 4655 } 4656 }, 4657 4658 filter: { 4659 4660 TAG: function( nodeNameSelector ) { 4661 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 4662 return nodeNameSelector === "*" ? 4663 function() { 4664 return true; 4665 } : 4666 function( elem ) { 4667 return nodeName( elem, expectedNodeName ); 4668 }; 4669 }, 4670 4671 CLASS: function( className ) { 4672 var pattern = classCache[ className + " " ]; 4673 4674 return pattern || 4675 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 4676 "(" + whitespace + "|$)" ) ) && 4677 classCache( className, function( elem ) { 4678 return pattern.test( 4679 typeof elem.className === "string" && elem.className || 4680 typeof elem.getAttribute !== "undefined" && 4681 elem.getAttribute( "class" ) || 4682 "" 4683 ); 4684 } ); 4685 }, 4686 4687 ATTR: function( name, operator, check ) { 4688 return function( elem ) { 4689 var result = find.attr( elem, name ); 4690 4691 if ( result == null ) { 4692 return operator === "!="; 4693 } 4694 if ( !operator ) { 4695 return true; 4696 } 4697 4698 result += ""; 4699 4700 if ( operator === "=" ) { 4701 return result === check; 4702 } 4703 if ( operator === "!=" ) { 4704 return result !== check; 4705 } 4706 if ( operator === "^=" ) { 4707 return check && result.indexOf( check ) === 0; 4708 } 4709 if ( operator === "*=" ) { 4710 return check && result.indexOf( check ) > -1; 4711 } 4712 if ( operator === "$=" ) { 4713 return check && result.slice( -check.length ) === check; 4714 } 4715 if ( operator === "~=" ) { 4716 return ( " " + result.replace( rwhitespace, " " ) + " " ) 4717 .indexOf( check ) > -1; 4718 } 4719 if ( operator === "|=" ) { 4720 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 4721 } 4722 4723 return false; 4724 }; 4725 }, 4726 4727 CHILD: function( type, what, _argument, first, last ) { 4728 var simple = type.slice( 0, 3 ) !== "nth", 4729 forward = type.slice( -4 ) !== "last", 4730 ofType = what === "of-type"; 4731 4732 return first === 1 && last === 0 ? 4733 4734 // Shortcut for :nth-*(n) 4735 function( elem ) { 4736 return !!elem.parentNode; 4737 } : 4738 4739 function( elem, _context, xml ) { 4740 var cache, outerCache, node, nodeIndex, start, 4741 dir = simple !== forward ? "nextSibling" : "previousSibling", 4742 parent = elem.parentNode, 4743 name = ofType && elem.nodeName.toLowerCase(), 4744 useCache = !xml && !ofType, 4745 diff = false; 4746 4747 if ( parent ) { 4748 4749 // :(first|last|only)-(child|of-type) 4750 if ( simple ) { 4751 while ( dir ) { 4752 node = elem; 4753 while ( ( node = node[ dir ] ) ) { 4754 if ( ofType ? 4755 nodeName( node, name ) : 4756 node.nodeType === 1 ) { 4757 4758 return false; 4759 } 4760 } 4761 4762 // Reverse direction for :only-* (if we haven't yet done so) 4763 start = dir = type === "only" && !start && "nextSibling"; 4764 } 4765 return true; 4766 } 4767 4768 start = [ forward ? parent.firstChild : parent.lastChild ]; 4769 4770 // non-xml :nth-child(...) stores cache data on `parent` 4771 if ( forward && useCache ) { 4772 4773 // Seek `elem` from a previously-cached index 4774 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 4775 cache = outerCache[ type ] || []; 4776 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 4777 diff = nodeIndex && cache[ 2 ]; 4778 node = nodeIndex && parent.childNodes[ nodeIndex ]; 4779 4780 while ( ( node = ++nodeIndex && node && node[ dir ] || 4781 4782 // Fallback to seeking `elem` from the start 4783 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 4784 4785 // When found, cache indexes on `parent` and break 4786 if ( node.nodeType === 1 && ++diff && node === elem ) { 4787 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 4788 break; 4789 } 4790 } 4791 4792 } else { 4793 4794 // Use previously-cached element index if available 4795 if ( useCache ) { 4796 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 4797 cache = outerCache[ type ] || []; 4798 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 4799 diff = nodeIndex; 4800 } 4801 4802 // xml :nth-child(...) 4803 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 4804 if ( diff === false ) { 4805 4806 // Use the same loop as above to seek `elem` from the start 4807 while ( ( node = ++nodeIndex && node && node[ dir ] || 4808 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 4809 4810 if ( ( ofType ? 4811 nodeName( node, name ) : 4812 node.nodeType === 1 ) && 4813 ++diff ) { 4814 4815 // Cache the index of each encountered element 4816 if ( useCache ) { 4817 outerCache = node[ expando ] || 4818 ( node[ expando ] = {} ); 4819 outerCache[ type ] = [ dirruns, diff ]; 4820 } 4821 4822 if ( node === elem ) { 4823 break; 4824 } 4825 } 4826 } 4827 } 4828 } 4829 4830 // Incorporate the offset, then check against cycle size 4831 diff -= last; 4832 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 4833 } 4834 }; 4835 }, 4836 4837 PSEUDO: function( pseudo, argument ) { 4838 4839 // pseudo-class names are case-insensitive 4840 // https://www.w3.org/TR/selectors/#pseudo-classes 4841 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 4842 // Remember that setFilters inherits from pseudos 4843 var args, 4844 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 4845 find.error( "unsupported pseudo: " + pseudo ); 4846 4847 // The user may use createPseudo to indicate that 4848 // arguments are needed to create the filter function 4849 // just as jQuery does 4850 if ( fn[ expando ] ) { 4851 return fn( argument ); 4852 } 4853 4854 // But maintain support for old signatures 4855 if ( fn.length > 1 ) { 4856 args = [ pseudo, pseudo, "", argument ]; 4857 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 4858 markFunction( function( seed, matches ) { 4859 var idx, 4860 matched = fn( seed, argument ), 4861 i = matched.length; 4862 while ( i-- ) { 4863 idx = indexOf.call( seed, matched[ i ] ); 4864 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 4865 } 4866 } ) : 4867 function( elem ) { 4868 return fn( elem, 0, args ); 4869 }; 4870 } 4871 4872 return fn; 4873 } 4874 }, 4875 4876 pseudos: { 4877 4878 // Potentially complex pseudos 4879 not: markFunction( function( selector ) { 4880 4881 // Trim the selector passed to compile 4882 // to avoid treating leading and trailing 4883 // spaces as combinators 4884 var input = [], 4885 results = [], 4886 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 4887 4888 return matcher[ expando ] ? 4889 markFunction( function( seed, matches, _context, xml ) { 4890 var elem, 4891 unmatched = matcher( seed, null, xml, [] ), 4892 i = seed.length; 4893 4894 // Match elements unmatched by `matcher` 4895 while ( i-- ) { 4896 if ( ( elem = unmatched[ i ] ) ) { 4897 seed[ i ] = !( matches[ i ] = elem ); 4898 } 4899 } 4900 } ) : 4901 function( elem, _context, xml ) { 4902 input[ 0 ] = elem; 4903 matcher( input, null, xml, results ); 4904 4905 // Don't keep the element 4906 // (see https://github.com/jquery/sizzle/issues/299) 4907 input[ 0 ] = null; 4908 return !results.pop(); 4909 }; 4910 } ), 4911 4912 has: markFunction( function( selector ) { 4913 return function( elem ) { 4914 return find( selector, elem ).length > 0; 4915 }; 4916 } ), 4917 4918 contains: markFunction( function( text ) { 4919 text = text.replace( runescape, funescape ); 4920 return function( elem ) { 4921 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 4922 }; 4923 } ), 4924 4925 // "Whether an element is represented by a :lang() selector 4926 // is based solely on the element's language value 4927 // being equal to the identifier C, 4928 // or beginning with the identifier C immediately followed by "-". 4929 // The matching of C against the element's language value is performed case-insensitively. 4930 // The identifier C does not have to be a valid language name." 4931 // https://www.w3.org/TR/selectors/#lang-pseudo 4932 lang: markFunction( function( lang ) { 4933 4934 // lang value must be a valid identifier 4935 if ( !ridentifier.test( lang || "" ) ) { 4936 find.error( "unsupported lang: " + lang ); 4937 } 4938 lang = lang.replace( runescape, funescape ).toLowerCase(); 4939 return function( elem ) { 4940 var elemLang; 4941 do { 4942 if ( ( elemLang = documentIsHTML ? 4943 elem.lang : 4944 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 4945 4946 elemLang = elemLang.toLowerCase(); 4947 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 4948 } 4949 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 4950 return false; 4951 }; 4952 } ), 4953 4954 // Miscellaneous 4955 target: function( elem ) { 4956 var hash = window.location && window.location.hash; 4957 return hash && hash.slice( 1 ) === elem.id; 4958 }, 4959 4960 root: function( elem ) { 4961 return elem === documentElement; 4962 }, 4963 4964 focus: function( elem ) { 4965 return elem === safeActiveElement() && 4966 document.hasFocus() && 4967 !!( elem.type || elem.href || ~elem.tabIndex ); 4968 }, 4969 4970 // Boolean properties 4971 enabled: createDisabledPseudo( false ), 4972 disabled: createDisabledPseudo( true ), 4973 4974 checked: function( elem ) { 4975 4976 // In CSS3, :checked should return both checked and selected elements 4977 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 4978 return ( nodeName( elem, "input" ) && !!elem.checked ) || 4979 ( nodeName( elem, "option" ) && !!elem.selected ); 4980 }, 4981 4982 selected: function( elem ) { 4983 4984 // Support: IE <=11+ 4985 // Accessing the selectedIndex property 4986 // forces the browser to treat the default option as 4987 // selected when in an optgroup. 4988 if ( elem.parentNode ) { 4989 // eslint-disable-next-line no-unused-expressions 4990 elem.parentNode.selectedIndex; 4991 } 4992 4993 return elem.selected === true; 4994 }, 4995 4996 // Contents 4997 empty: function( elem ) { 4998 4999 // https://www.w3.org/TR/selectors/#empty-pseudo 5000 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 5001 // but not by others (comment: 8; processing instruction: 7; etc.) 5002 // nodeType < 6 works because attributes (2) do not appear as children 5003 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 5004 if ( elem.nodeType < 6 ) { 5005 return false; 5006 } 5007 } 5008 return true; 5009 }, 5010 5011 parent: function( elem ) { 5012 return !Expr.pseudos.empty( elem ); 5013 }, 5014 5015 // Element/input types 5016 header: function( elem ) { 5017 return rheader.test( elem.nodeName ); 5018 }, 5019 5020 input: function( elem ) { 5021 return rinputs.test( elem.nodeName ); 5022 }, 5023 5024 button: function( elem ) { 5025 return nodeName( elem, "input" ) && elem.type === "button" || 5026 nodeName( elem, "button" ); 5027 }, 5028 5029 text: function( elem ) { 5030 var attr; 5031 return nodeName( elem, "input" ) && elem.type === "text" && 5032 5033 // Support: IE <10 only 5034 // New HTML5 attribute values (e.g., "search") appear 5035 // with elem.type === "text" 5036 ( ( attr = elem.getAttribute( "type" ) ) == null || 5037 attr.toLowerCase() === "text" ); 5038 }, 5039 5040 // Position-in-collection 5041 first: createPositionalPseudo( function() { 5042 return [ 0 ]; 5043 } ), 5044 5045 last: createPositionalPseudo( function( _matchIndexes, length ) { 5046 return [ length - 1 ]; 5047 } ), 5048 5049 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 5050 return [ argument < 0 ? argument + length : argument ]; 5051 } ), 5052 5053 even: createPositionalPseudo( function( matchIndexes, length ) { 5054 var i = 0; 5055 for ( ; i < length; i += 2 ) { 5056 matchIndexes.push( i ); 5057 } 5058 return matchIndexes; 5059 } ), 5060 5061 odd: createPositionalPseudo( function( matchIndexes, length ) { 5062 var i = 1; 5063 for ( ; i < length; i += 2 ) { 5064 matchIndexes.push( i ); 5065 } 5066 return matchIndexes; 5067 } ), 5068 5069 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 5070 var i; 5071 5072 if ( argument < 0 ) { 5073 i = argument + length; 5074 } else if ( argument > length ) { 5075 i = length; 5076 } else { 5077 i = argument; 5078 } 5079 5080 for ( ; --i >= 0; ) { 5081 matchIndexes.push( i ); 5082 } 5083 return matchIndexes; 5084 } ), 5085 5086 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 5087 var i = argument < 0 ? argument + length : argument; 5088 for ( ; ++i < length; ) { 5089 matchIndexes.push( i ); 5090 } 5091 return matchIndexes; 5092 } ) 5093 } 5094}; 5095 5096Expr.pseudos.nth = Expr.pseudos.eq; 5097 5098// Add button/input type pseudos 5099for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 5100 Expr.pseudos[ i ] = createInputPseudo( i ); 5101} 5102for ( i in { submit: true, reset: true } ) { 5103 Expr.pseudos[ i ] = createButtonPseudo( i ); 5104} 5105 5106// Easy API for creating new setFilters 5107function setFilters() {} 5108setFilters.prototype = Expr.filters = Expr.pseudos; 5109Expr.setFilters = new setFilters(); 5110 5111function tokenize( selector, parseOnly ) { 5112 var matched, match, tokens, type, 5113 soFar, groups, preFilters, 5114 cached = tokenCache[ selector + " " ]; 5115 5116 if ( cached ) { 5117 return parseOnly ? 0 : cached.slice( 0 ); 5118 } 5119 5120 soFar = selector; 5121 groups = []; 5122 preFilters = Expr.preFilter; 5123 5124 while ( soFar ) { 5125 5126 // Comma and first run 5127 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 5128 if ( match ) { 5129 5130 // Don't consume trailing commas as valid 5131 soFar = soFar.slice( match[ 0 ].length ) || soFar; 5132 } 5133 groups.push( ( tokens = [] ) ); 5134 } 5135 5136 matched = false; 5137 5138 // Combinators 5139 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 5140 matched = match.shift(); 5141 tokens.push( { 5142 value: matched, 5143 5144 // Cast descendant combinators to space 5145 type: match[ 0 ].replace( rtrimCSS, " " ) 5146 } ); 5147 soFar = soFar.slice( matched.length ); 5148 } 5149 5150 // Filters 5151 for ( type in Expr.filter ) { 5152 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 5153 ( match = preFilters[ type ]( match ) ) ) ) { 5154 matched = match.shift(); 5155 tokens.push( { 5156 value: matched, 5157 type: type, 5158 matches: match 5159 } ); 5160 soFar = soFar.slice( matched.length ); 5161 } 5162 } 5163 5164 if ( !matched ) { 5165 break; 5166 } 5167 } 5168 5169 // Return the length of the invalid excess 5170 // if we're just parsing 5171 // Otherwise, throw an error or return tokens 5172 if ( parseOnly ) { 5173 return soFar.length; 5174 } 5175 5176 return soFar ? 5177 find.error( selector ) : 5178 5179 // Cache the tokens 5180 tokenCache( selector, groups ).slice( 0 ); 5181} 5182 5183function toSelector( tokens ) { 5184 var i = 0, 5185 len = tokens.length, 5186 selector = ""; 5187 for ( ; i < len; i++ ) { 5188 selector += tokens[ i ].value; 5189 } 5190 return selector; 5191} 5192 5193function addCombinator( matcher, combinator, base ) { 5194 var dir = combinator.dir, 5195 skip = combinator.next, 5196 key = skip || dir, 5197 checkNonElements = base && key === "parentNode", 5198 doneName = done++; 5199 5200 return combinator.first ? 5201 5202 // Check against closest ancestor/preceding element 5203 function( elem, context, xml ) { 5204 while ( ( elem = elem[ dir ] ) ) { 5205 if ( elem.nodeType === 1 || checkNonElements ) { 5206 return matcher( elem, context, xml ); 5207 } 5208 } 5209 return false; 5210 } : 5211 5212 // Check against all ancestor/preceding elements 5213 function( elem, context, xml ) { 5214 var oldCache, outerCache, 5215 newCache = [ dirruns, doneName ]; 5216 5217 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 5218 if ( xml ) { 5219 while ( ( elem = elem[ dir ] ) ) { 5220 if ( elem.nodeType === 1 || checkNonElements ) { 5221 if ( matcher( elem, context, xml ) ) { 5222 return true; 5223 } 5224 } 5225 } 5226 } else { 5227 while ( ( elem = elem[ dir ] ) ) { 5228 if ( elem.nodeType === 1 || checkNonElements ) { 5229 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 5230 5231 if ( skip && nodeName( elem, skip ) ) { 5232 elem = elem[ dir ] || elem; 5233 } else if ( ( oldCache = outerCache[ key ] ) && 5234 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 5235 5236 // Assign to newCache so results back-propagate to previous elements 5237 return ( newCache[ 2 ] = oldCache[ 2 ] ); 5238 } else { 5239 5240 // Reuse newcache so results back-propagate to previous elements 5241 outerCache[ key ] = newCache; 5242 5243 // A match means we're done; a fail means we have to keep checking 5244 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 5245 return true; 5246 } 5247 } 5248 } 5249 } 5250 } 5251 return false; 5252 }; 5253} 5254 5255function elementMatcher( matchers ) { 5256 return matchers.length > 1 ? 5257 function( elem, context, xml ) { 5258 var i = matchers.length; 5259 while ( i-- ) { 5260 if ( !matchers[ i ]( elem, context, xml ) ) { 5261 return false; 5262 } 5263 } 5264 return true; 5265 } : 5266 matchers[ 0 ]; 5267} 5268 5269function multipleContexts( selector, contexts, results ) { 5270 var i = 0, 5271 len = contexts.length; 5272 for ( ; i < len; i++ ) { 5273 find( selector, contexts[ i ], results ); 5274 } 5275 return results; 5276} 5277 5278function condense( unmatched, map, filter, context, xml ) { 5279 var elem, 5280 newUnmatched = [], 5281 i = 0, 5282 len = unmatched.length, 5283 mapped = map != null; 5284 5285 for ( ; i < len; i++ ) { 5286 if ( ( elem = unmatched[ i ] ) ) { 5287 if ( !filter || filter( elem, context, xml ) ) { 5288 newUnmatched.push( elem ); 5289 if ( mapped ) { 5290 map.push( i ); 5291 } 5292 } 5293 } 5294 } 5295 5296 return newUnmatched; 5297} 5298 5299function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 5300 if ( postFilter && !postFilter[ expando ] ) { 5301 postFilter = setMatcher( postFilter ); 5302 } 5303 if ( postFinder && !postFinder[ expando ] ) { 5304 postFinder = setMatcher( postFinder, postSelector ); 5305 } 5306 return markFunction( function( seed, results, context, xml ) { 5307 var temp, i, elem, matcherOut, 5308 preMap = [], 5309 postMap = [], 5310 preexisting = results.length, 5311 5312 // Get initial elements from seed or context 5313 elems = seed || 5314 multipleContexts( selector || "*", 5315 context.nodeType ? [ context ] : context, [] ), 5316 5317 // Prefilter to get matcher input, preserving a map for seed-results synchronization 5318 matcherIn = preFilter && ( seed || !selector ) ? 5319 condense( elems, preMap, preFilter, context, xml ) : 5320 elems; 5321 5322 if ( matcher ) { 5323 5324 // If we have a postFinder, or filtered seed, or non-seed postFilter 5325 // or preexisting results, 5326 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 5327 5328 // ...intermediate processing is necessary 5329 [] : 5330 5331 // ...otherwise use results directly 5332 results; 5333 5334 // Find primary matches 5335 matcher( matcherIn, matcherOut, context, xml ); 5336 } else { 5337 matcherOut = matcherIn; 5338 } 5339 5340 // Apply postFilter 5341 if ( postFilter ) { 5342 temp = condense( matcherOut, postMap ); 5343 postFilter( temp, [], context, xml ); 5344 5345 // Un-match failing elements by moving them back to matcherIn 5346 i = temp.length; 5347 while ( i-- ) { 5348 if ( ( elem = temp[ i ] ) ) { 5349 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 5350 } 5351 } 5352 } 5353 5354 if ( seed ) { 5355 if ( postFinder || preFilter ) { 5356 if ( postFinder ) { 5357 5358 // Get the final matcherOut by condensing this intermediate into postFinder contexts 5359 temp = []; 5360 i = matcherOut.length; 5361 while ( i-- ) { 5362 if ( ( elem = matcherOut[ i ] ) ) { 5363 5364 // Restore matcherIn since elem is not yet a final match 5365 temp.push( ( matcherIn[ i ] = elem ) ); 5366 } 5367 } 5368 postFinder( null, ( matcherOut = [] ), temp, xml ); 5369 } 5370 5371 // Move matched elements from seed to results to keep them synchronized 5372 i = matcherOut.length; 5373 while ( i-- ) { 5374 if ( ( elem = matcherOut[ i ] ) && 5375 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 5376 5377 seed[ temp ] = !( results[ temp ] = elem ); 5378 } 5379 } 5380 } 5381 5382 // Add elements to results, through postFinder if defined 5383 } else { 5384 matcherOut = condense( 5385 matcherOut === results ? 5386 matcherOut.splice( preexisting, matcherOut.length ) : 5387 matcherOut 5388 ); 5389 if ( postFinder ) { 5390 postFinder( null, results, matcherOut, xml ); 5391 } else { 5392 push.apply( results, matcherOut ); 5393 } 5394 } 5395 } ); 5396} 5397 5398function matcherFromTokens( tokens ) { 5399 var checkContext, matcher, j, 5400 len = tokens.length, 5401 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 5402 implicitRelative = leadingRelative || Expr.relative[ " " ], 5403 i = leadingRelative ? 1 : 0, 5404 5405 // The foundational matcher ensures that elements are reachable from top-level context(s) 5406 matchContext = addCombinator( function( elem ) { 5407 return elem === checkContext; 5408 }, implicitRelative, true ), 5409 matchAnyContext = addCombinator( function( elem ) { 5410 return indexOf.call( checkContext, elem ) > -1; 5411 }, implicitRelative, true ), 5412 matchers = [ function( elem, context, xml ) { 5413 5414 // Support: IE 11+, Edge 17 - 18+ 5415 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5416 // two documents; shallow comparisons work. 5417 // eslint-disable-next-line eqeqeq 5418 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 5419 ( checkContext = context ).nodeType ? 5420 matchContext( elem, context, xml ) : 5421 matchAnyContext( elem, context, xml ) ); 5422 5423 // Avoid hanging onto element 5424 // (see https://github.com/jquery/sizzle/issues/299) 5425 checkContext = null; 5426 return ret; 5427 } ]; 5428 5429 for ( ; i < len; i++ ) { 5430 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 5431 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 5432 } else { 5433 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 5434 5435 // Return special upon seeing a positional matcher 5436 if ( matcher[ expando ] ) { 5437 5438 // Find the next relative operator (if any) for proper handling 5439 j = ++i; 5440 for ( ; j < len; j++ ) { 5441 if ( Expr.relative[ tokens[ j ].type ] ) { 5442 break; 5443 } 5444 } 5445 return setMatcher( 5446 i > 1 && elementMatcher( matchers ), 5447 i > 1 && toSelector( 5448 5449 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 5450 tokens.slice( 0, i - 1 ) 5451 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 5452 ).replace( rtrimCSS, "$1" ), 5453 matcher, 5454 i < j && matcherFromTokens( tokens.slice( i, j ) ), 5455 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 5456 j < len && toSelector( tokens ) 5457 ); 5458 } 5459 matchers.push( matcher ); 5460 } 5461 } 5462 5463 return elementMatcher( matchers ); 5464} 5465 5466function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 5467 var bySet = setMatchers.length > 0, 5468 byElement = elementMatchers.length > 0, 5469 superMatcher = function( seed, context, xml, results, outermost ) { 5470 var elem, j, matcher, 5471 matchedCount = 0, 5472 i = "0", 5473 unmatched = seed && [], 5474 setMatched = [], 5475 contextBackup = outermostContext, 5476 5477 // We must always have either seed elements or outermost context 5478 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 5479 5480 // Use integer dirruns iff this is the outermost matcher 5481 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 5482 len = elems.length; 5483 5484 if ( outermost ) { 5485 5486 // Support: IE 11+, Edge 17 - 18+ 5487 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5488 // two documents; shallow comparisons work. 5489 // eslint-disable-next-line eqeqeq 5490 outermostContext = context == document || context || outermost; 5491 } 5492 5493 // Add elements passing elementMatchers directly to results 5494 // Support: iOS <=7 - 9 only 5495 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 5496 // elements by id. (see trac-14142) 5497 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 5498 if ( byElement && elem ) { 5499 j = 0; 5500 5501 // Support: IE 11+, Edge 17 - 18+ 5502 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5503 // two documents; shallow comparisons work. 5504 // eslint-disable-next-line eqeqeq 5505 if ( !context && elem.ownerDocument != document ) { 5506 setDocument( elem ); 5507 xml = !documentIsHTML; 5508 } 5509 while ( ( matcher = elementMatchers[ j++ ] ) ) { 5510 if ( matcher( elem, context || document, xml ) ) { 5511 push.call( results, elem ); 5512 break; 5513 } 5514 } 5515 if ( outermost ) { 5516 dirruns = dirrunsUnique; 5517 } 5518 } 5519 5520 // Track unmatched elements for set filters 5521 if ( bySet ) { 5522 5523 // They will have gone through all possible matchers 5524 if ( ( elem = !matcher && elem ) ) { 5525 matchedCount--; 5526 } 5527 5528 // Lengthen the array for every element, matched or not 5529 if ( seed ) { 5530 unmatched.push( elem ); 5531 } 5532 } 5533 } 5534 5535 // `i` is now the count of elements visited above, and adding it to `matchedCount` 5536 // makes the latter nonnegative. 5537 matchedCount += i; 5538 5539 // Apply set filters to unmatched elements 5540 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 5541 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 5542 // no element matchers and no seed. 5543 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 5544 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 5545 // numerically zero. 5546 if ( bySet && i !== matchedCount ) { 5547 j = 0; 5548 while ( ( matcher = setMatchers[ j++ ] ) ) { 5549 matcher( unmatched, setMatched, context, xml ); 5550 } 5551 5552 if ( seed ) { 5553 5554 // Reintegrate element matches to eliminate the need for sorting 5555 if ( matchedCount > 0 ) { 5556 while ( i-- ) { 5557 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 5558 setMatched[ i ] = pop.call( results ); 5559 } 5560 } 5561 } 5562 5563 // Discard index placeholder values to get only actual matches 5564 setMatched = condense( setMatched ); 5565 } 5566 5567 // Add matches to results 5568 push.apply( results, setMatched ); 5569 5570 // Seedless set matches succeeding multiple successful matchers stipulate sorting 5571 if ( outermost && !seed && setMatched.length > 0 && 5572 ( matchedCount + setMatchers.length ) > 1 ) { 5573 5574 jQuery.uniqueSort( results ); 5575 } 5576 } 5577 5578 // Override manipulation of globals by nested matchers 5579 if ( outermost ) { 5580 dirruns = dirrunsUnique; 5581 outermostContext = contextBackup; 5582 } 5583 5584 return unmatched; 5585 }; 5586 5587 return bySet ? 5588 markFunction( superMatcher ) : 5589 superMatcher; 5590} 5591 5592function compile( selector, match /* Internal Use Only */ ) { 5593 var i, 5594 setMatchers = [], 5595 elementMatchers = [], 5596 cached = compilerCache[ selector + " " ]; 5597 5598 if ( !cached ) { 5599 5600 // Generate a function of recursive functions that can be used to check each element 5601 if ( !match ) { 5602 match = tokenize( selector ); 5603 } 5604 i = match.length; 5605 while ( i-- ) { 5606 cached = matcherFromTokens( match[ i ] ); 5607 if ( cached[ expando ] ) { 5608 setMatchers.push( cached ); 5609 } else { 5610 elementMatchers.push( cached ); 5611 } 5612 } 5613 5614 // Cache the compiled function 5615 cached = compilerCache( selector, 5616 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 5617 5618 // Save selector and tokenization 5619 cached.selector = selector; 5620 } 5621 return cached; 5622} 5623 5624/** 5625 * A low-level selection function that works with jQuery's compiled 5626 * selector functions 5627 * @param {String|Function} selector A selector or a pre-compiled 5628 * selector function built with jQuery selector compile 5629 * @param {Element} context 5630 * @param {Array} [results] 5631 * @param {Array} [seed] A set of elements to match against 5632 */ 5633function select( selector, context, results, seed ) { 5634 var i, tokens, token, type, find, 5635 compiled = typeof selector === "function" && selector, 5636 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 5637 5638 results = results || []; 5639 5640 // Try to minimize operations if there is only one selector in the list and no seed 5641 // (the latter of which guarantees us context) 5642 if ( match.length === 1 ) { 5643 5644 // Reduce context if the leading compound selector is an ID 5645 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 5646 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 5647 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 5648 5649 context = ( Expr.find.ID( 5650 token.matches[ 0 ].replace( runescape, funescape ), 5651 context 5652 ) || [] )[ 0 ]; 5653 if ( !context ) { 5654 return results; 5655 5656 // Precompiled matchers will still verify ancestry, so step up a level 5657 } else if ( compiled ) { 5658 context = context.parentNode; 5659 } 5660 5661 selector = selector.slice( tokens.shift().value.length ); 5662 } 5663 5664 // Fetch a seed set for right-to-left matching 5665 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 5666 while ( i-- ) { 5667 token = tokens[ i ]; 5668 5669 // Abort if we hit a combinator 5670 if ( Expr.relative[ ( type = token.type ) ] ) { 5671 break; 5672 } 5673 if ( ( find = Expr.find[ type ] ) ) { 5674 5675 // Search, expanding context for leading sibling combinators 5676 if ( ( seed = find( 5677 token.matches[ 0 ].replace( runescape, funescape ), 5678 rsibling.test( tokens[ 0 ].type ) && 5679 testContext( context.parentNode ) || context 5680 ) ) ) { 5681 5682 // If seed is empty or no tokens remain, we can return early 5683 tokens.splice( i, 1 ); 5684 selector = seed.length && toSelector( tokens ); 5685 if ( !selector ) { 5686 push.apply( results, seed ); 5687 return results; 5688 } 5689 5690 break; 5691 } 5692 } 5693 } 5694 } 5695 5696 // Compile and execute a filtering function if one is not provided 5697 // Provide `match` to avoid retokenization if we modified the selector above 5698 ( compiled || compile( selector, match ) )( 5699 seed, 5700 context, 5701 !documentIsHTML, 5702 results, 5703 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 5704 ); 5705 return results; 5706} 5707 5708// One-time assignments 5709 5710// Support: Android <=4.0 - 4.1+ 5711// Sort stability 5712support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 5713 5714// Initialize against the default document 5715setDocument(); 5716 5717// Support: Android <=4.0 - 4.1+ 5718// Detached nodes confoundingly follow *each other* 5719support.sortDetached = assert( function( el ) { 5720 5721 // Should return 1, but returns 4 (following) 5722 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 5723} ); 5724 5725jQuery.find = find; 5726 5727// Deprecated 5728jQuery.expr[ ":" ] = jQuery.expr.pseudos; 5729jQuery.unique = jQuery.uniqueSort; 5730 5731// These have always been private, but they used to be documented as part of 5732// Sizzle so let's maintain them for now for backwards compatibility purposes. 5733find.compile = compile; 5734find.select = select; 5735find.setDocument = setDocument; 5736find.tokenize = tokenize; 5737 5738find.escape = jQuery.escapeSelector; 5739find.getText = jQuery.text; 5740find.isXML = jQuery.isXMLDoc; 5741find.selectors = jQuery.expr; 5742find.support = jQuery.support; 5743find.uniqueSort = jQuery.uniqueSort; 5744 5745 /* eslint-enable */ 5746 5747} )(); 5748 5749 5750var dir = function( elem, dir, until ) { 5751 var matched = [], 5752 truncate = until !== undefined; 5753 5754 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 5755 if ( elem.nodeType === 1 ) { 5756 if ( truncate && jQuery( elem ).is( until ) ) { 5757 break; 5758 } 5759 matched.push( elem ); 5760 } 5761 } 5762 return matched; 5763}; 5764 5765 5766var siblings = function( n, elem ) { 5767 var matched = []; 5768 5769 for ( ; n; n = n.nextSibling ) { 5770 if ( n.nodeType === 1 && n !== elem ) { 5771 matched.push( n ); 5772 } 5773 } 5774 5775 return matched; 5776}; 5777 5778 5779var rneedsContext = jQuery.expr.match.needsContext; 5780 5781var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 5782 5783 5784 5785// Implement the identical functionality for filter and not 5786function winnow( elements, qualifier, not ) { 5787 if ( isFunction( qualifier ) ) { 5788 return jQuery.grep( elements, function( elem, i ) { 5789 return !!qualifier.call( elem, i, elem ) !== not; 5790 } ); 5791 } 5792 5793 // Single element 5794 if ( qualifier.nodeType ) { 5795 return jQuery.grep( elements, function( elem ) { 5796 return ( elem === qualifier ) !== not; 5797 } ); 5798 } 5799 5800 // Arraylike of elements (jQuery, arguments, Array) 5801 if ( typeof qualifier !== "string" ) { 5802 return jQuery.grep( elements, function( elem ) { 5803 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 5804 } ); 5805 } 5806 5807 // Filtered directly for both simple and complex selectors 5808 return jQuery.filter( qualifier, elements, not ); 5809} 5810 5811jQuery.filter = function( expr, elems, not ) { 5812 var elem = elems[ 0 ]; 5813 5814 if ( not ) { 5815 expr = ":not(" + expr + ")"; 5816 } 5817 5818 if ( elems.length === 1 && elem.nodeType === 1 ) { 5819 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 5820 } 5821 5822 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 5823 return elem.nodeType === 1; 5824 } ) ); 5825}; 5826 5827jQuery.fn.extend( { 5828 find: function( selector ) { 5829 var i, ret, 5830 len = this.length, 5831 self = this; 5832 5833 if ( typeof selector !== "string" ) { 5834 return this.pushStack( jQuery( selector ).filter( function() { 5835 for ( i = 0; i < len; i++ ) { 5836 if ( jQuery.contains( self[ i ], this ) ) { 5837 return true; 5838 } 5839 } 5840 } ) ); 5841 } 5842 5843 ret = this.pushStack( [] ); 5844 5845 for ( i = 0; i < len; i++ ) { 5846 jQuery.find( selector, self[ i ], ret ); 5847 } 5848 5849 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 5850 }, 5851 filter: function( selector ) { 5852 return this.pushStack( winnow( this, selector || [], false ) ); 5853 }, 5854 not: function( selector ) { 5855 return this.pushStack( winnow( this, selector || [], true ) ); 5856 }, 5857 is: function( selector ) { 5858 return !!winnow( 5859 this, 5860 5861 // If this is a positional/relative selector, check membership in the returned set 5862 // so $("p:first").is("p:last") won't return true for a doc with two "p". 5863 typeof selector === "string" && rneedsContext.test( selector ) ? 5864 jQuery( selector ) : 5865 selector || [], 5866 false 5867 ).length; 5868 } 5869} ); 5870 5871 5872// Initialize a jQuery object 5873 5874 5875// A central reference to the root jQuery(document) 5876var rootjQuery, 5877 5878 // A simple way to check for HTML strings 5879 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 5880 // Strict HTML recognition (trac-11290: must start with <) 5881 // Shortcut simple #id case for speed 5882 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 5883 5884 init = jQuery.fn.init = function( selector, context, root ) { 5885 var match, elem; 5886 5887 // HANDLE: $(""), $(null), $(undefined), $(false) 5888 if ( !selector ) { 5889 return this; 5890 } 5891 5892 // Method init() accepts an alternate rootjQuery 5893 // so migrate can support jQuery.sub (gh-2101) 5894 root = root || rootjQuery; 5895 5896 // Handle HTML strings 5897 if ( typeof selector === "string" ) { 5898 if ( selector[ 0 ] === "<" && 5899 selector[ selector.length - 1 ] === ">" && 5900 selector.length >= 3 ) { 5901 5902 // Assume that strings that start and end with <> are HTML and skip the regex check 5903 match = [ null, selector, null ]; 5904 5905 } else { 5906 match = rquickExpr.exec( selector ); 5907 } 5908 5909 // Match html or make sure no context is specified for #id 5910 if ( match && ( match[ 1 ] || !context ) ) { 5911 5912 // HANDLE: $(html) -> $(array) 5913 if ( match[ 1 ] ) { 5914 context = context instanceof jQuery ? context[ 0 ] : context; 5915 5916 // Option to run scripts is true for back-compat 5917 // Intentionally let the error be thrown if parseHTML is not present 5918 jQuery.merge( this, jQuery.parseHTML( 5919 match[ 1 ], 5920 context && context.nodeType ? context.ownerDocument || context : document, 5921 true 5922 ) ); 5923 5924 // HANDLE: $(html, props) 5925 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 5926 for ( match in context ) { 5927 5928 // Properties of context are called as methods if possible 5929 if ( isFunction( this[ match ] ) ) { 5930 this[ match ]( context[ match ] ); 5931 5932 // ...and otherwise set as attributes 5933 } else { 5934 this.attr( match, context[ match ] ); 5935 } 5936 } 5937 } 5938 5939 return this; 5940 5941 // HANDLE: $(#id) 5942 } else { 5943 elem = document.getElementById( match[ 2 ] ); 5944 5945 if ( elem ) { 5946 5947 // Inject the element directly into the jQuery object 5948 this[ 0 ] = elem; 5949 this.length = 1; 5950 } 5951 return this; 5952 } 5953 5954 // HANDLE: $(expr, $(...)) 5955 } else if ( !context || context.jquery ) { 5956 return ( context || root ).find( selector ); 5957 5958 // HANDLE: $(expr, context) 5959 // (which is just equivalent to: $(context).find(expr) 5960 } else { 5961 return this.constructor( context ).find( selector ); 5962 } 5963 5964 // HANDLE: $(DOMElement) 5965 } else if ( selector.nodeType ) { 5966 this[ 0 ] = selector; 5967 this.length = 1; 5968 return this; 5969 5970 // HANDLE: $(function) 5971 // Shortcut for document ready 5972 } else if ( isFunction( selector ) ) { 5973 return root.ready !== undefined ? 5974 root.ready( selector ) : 5975 5976 // Execute immediately if ready is not present 5977 selector( jQuery ); 5978 } 5979 5980 return jQuery.makeArray( selector, this ); 5981 }; 5982 5983// Give the init function the jQuery prototype for later instantiation 5984init.prototype = jQuery.fn; 5985 5986// Initialize central reference 5987rootjQuery = jQuery( document ); 5988 5989 5990var rparentsprev = /^(?:parents|prev(?:Until|All))/, 5991 5992 // Methods guaranteed to produce a unique set when starting from a unique set 5993 guaranteedUnique = { 5994 children: true, 5995 contents: true, 5996 next: true, 5997 prev: true 5998 }; 5999 6000jQuery.fn.extend( { 6001 has: function( target ) { 6002 var targets = jQuery( target, this ), 6003 l = targets.length; 6004 6005 return this.filter( function() { 6006 var i = 0; 6007 for ( ; i < l; i++ ) { 6008 if ( jQuery.contains( this, targets[ i ] ) ) { 6009 return true; 6010 } 6011 } 6012 } ); 6013 }, 6014 6015 closest: function( selectors, context ) { 6016 var cur, 6017 i = 0, 6018 l = this.length, 6019 matched = [], 6020 targets = typeof selectors !== "string" && jQuery( selectors ); 6021 6022 // Positional selectors never match, since there's no _selection_ context 6023 if ( !rneedsContext.test( selectors ) ) { 6024 for ( ; i < l; i++ ) { 6025 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 6026 6027 // Always skip document fragments 6028 if ( cur.nodeType < 11 && ( targets ? 6029 targets.index( cur ) > -1 : 6030 6031 // Don't pass non-elements to jQuery#find 6032 cur.nodeType === 1 && 6033 jQuery.find.matchesSelector( cur, selectors ) ) ) { 6034 6035 matched.push( cur ); 6036 break; 6037 } 6038 } 6039 } 6040 } 6041 6042 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 6043 }, 6044 6045 // Determine the position of an element within the set 6046 index: function( elem ) { 6047 6048 // No argument, return index in parent 6049 if ( !elem ) { 6050 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 6051 } 6052 6053 // Index in selector 6054 if ( typeof elem === "string" ) { 6055 return indexOf.call( jQuery( elem ), this[ 0 ] ); 6056 } 6057 6058 // Locate the position of the desired element 6059 return indexOf.call( this, 6060 6061 // If it receives a jQuery object, the first element is used 6062 elem.jquery ? elem[ 0 ] : elem 6063 ); 6064 }, 6065 6066 add: function( selector, context ) { 6067 return this.pushStack( 6068 jQuery.uniqueSort( 6069 jQuery.merge( this.get(), jQuery( selector, context ) ) 6070 ) 6071 ); 6072 }, 6073 6074 addBack: function( selector ) { 6075 return this.add( selector == null ? 6076 this.prevObject : this.prevObject.filter( selector ) 6077 ); 6078 } 6079} ); 6080 6081function sibling( cur, dir ) { 6082 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 6083 return cur; 6084} 6085 6086jQuery.each( { 6087 parent: function( elem ) { 6088 var parent = elem.parentNode; 6089 return parent && parent.nodeType !== 11 ? parent : null; 6090 }, 6091 parents: function( elem ) { 6092 return dir( elem, "parentNode" ); 6093 }, 6094 parentsUntil: function( elem, _i, until ) { 6095 return dir( elem, "parentNode", until ); 6096 }, 6097 next: function( elem ) { 6098 return sibling( elem, "nextSibling" ); 6099 }, 6100 prev: function( elem ) { 6101 return sibling( elem, "previousSibling" ); 6102 }, 6103 nextAll: function( elem ) { 6104 return dir( elem, "nextSibling" ); 6105 }, 6106 prevAll: function( elem ) { 6107 return dir( elem, "previousSibling" ); 6108 }, 6109 nextUntil: function( elem, _i, until ) { 6110 return dir( elem, "nextSibling", until ); 6111 }, 6112 prevUntil: function( elem, _i, until ) { 6113 return dir( elem, "previousSibling", until ); 6114 }, 6115 siblings: function( elem ) { 6116 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 6117 }, 6118 children: function( elem ) { 6119 return siblings( elem.firstChild ); 6120 }, 6121 contents: function( elem ) { 6122 if ( elem.contentDocument != null && 6123 6124 // Support: IE 11+ 6125 // <object> elements with no `data` attribute has an object 6126 // `contentDocument` with a `null` prototype. 6127 getProto( elem.contentDocument ) ) { 6128 6129 return elem.contentDocument; 6130 } 6131 6132 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 6133 // Treat the template element as a regular one in browsers that 6134 // don't support it. 6135 if ( nodeName( elem, "template" ) ) { 6136 elem = elem.content || elem; 6137 } 6138 6139 return jQuery.merge( [], elem.childNodes ); 6140 } 6141}, function( name, fn ) { 6142 jQuery.fn[ name ] = function( until, selector ) { 6143 var matched = jQuery.map( this, fn, until ); 6144 6145 if ( name.slice( -5 ) !== "Until" ) { 6146 selector = until; 6147 } 6148 6149 if ( selector && typeof selector === "string" ) { 6150 matched = jQuery.filter( selector, matched ); 6151 } 6152 6153 if ( this.length > 1 ) { 6154 6155 // Remove duplicates 6156 if ( !guaranteedUnique[ name ] ) { 6157 jQuery.uniqueSort( matched ); 6158 } 6159 6160 // Reverse order for parents* and prev-derivatives 6161 if ( rparentsprev.test( name ) ) { 6162 matched.reverse(); 6163 } 6164 } 6165 6166 return this.pushStack( matched ); 6167 }; 6168} ); 6169var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 6170 6171 6172 6173// Convert String-formatted options into Object-formatted ones 6174function createOptions( options ) { 6175 var object = {}; 6176 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 6177 object[ flag ] = true; 6178 } ); 6179 return object; 6180} 6181 6182/* 6183 * Create a callback list using the following parameters: 6184 * 6185 * options: an optional list of space-separated options that will change how 6186 * the callback list behaves or a more traditional option object 6187 * 6188 * By default a callback list will act like an event callback list and can be 6189 * "fired" multiple times. 6190 * 6191 * Possible options: 6192 * 6193 * once: will ensure the callback list can only be fired once (like a Deferred) 6194 * 6195 * memory: will keep track of previous values and will call any callback added 6196 * after the list has been fired right away with the latest "memorized" 6197 * values (like a Deferred) 6198 * 6199 * unique: will ensure a callback can only be added once (no duplicate in the list) 6200 * 6201 * stopOnFalse: interrupt callings when a callback returns false 6202 * 6203 */ 6204jQuery.Callbacks = function( options ) { 6205 6206 // Convert options from String-formatted to Object-formatted if needed 6207 // (we check in cache first) 6208 options = typeof options === "string" ? 6209 createOptions( options ) : 6210 jQuery.extend( {}, options ); 6211 6212 var // Flag to know if list is currently firing 6213 firing, 6214 6215 // Last fire value for non-forgettable lists 6216 memory, 6217 6218 // Flag to know if list was already fired 6219 fired, 6220 6221 // Flag to prevent firing 6222 locked, 6223 6224 // Actual callback list 6225 list = [], 6226 6227 // Queue of execution data for repeatable lists 6228 queue = [], 6229 6230 // Index of currently firing callback (modified by add/remove as needed) 6231 firingIndex = -1, 6232 6233 // Fire callbacks 6234 fire = function() { 6235 6236 // Enforce single-firing 6237 locked = locked || options.once; 6238 6239 // Execute callbacks for all pending executions, 6240 // respecting firingIndex overrides and runtime changes 6241 fired = firing = true; 6242 for ( ; queue.length; firingIndex = -1 ) { 6243 memory = queue.shift(); 6244 while ( ++firingIndex < list.length ) { 6245 6246 // Run callback and check for early termination 6247 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 6248 options.stopOnFalse ) { 6249 6250 // Jump to end and forget the data so .add doesn't re-fire 6251 firingIndex = list.length; 6252 memory = false; 6253 } 6254 } 6255 } 6256 6257 // Forget the data if we're done with it 6258 if ( !options.memory ) { 6259 memory = false; 6260 } 6261 6262 firing = false; 6263 6264 // Clean up if we're done firing for good 6265 if ( locked ) { 6266 6267 // Keep an empty list if we have data for future add calls 6268 if ( memory ) { 6269 list = []; 6270 6271 // Otherwise, this object is spent 6272 } else { 6273 list = ""; 6274 } 6275 } 6276 }, 6277 6278 // Actual Callbacks object 6279 self = { 6280 6281 // Add a callback or a collection of callbacks to the list 6282 add: function() { 6283 if ( list ) { 6284 6285 // If we have memory from a past run, we should fire after adding 6286 if ( memory && !firing ) { 6287 firingIndex = list.length - 1; 6288 queue.push( memory ); 6289 } 6290 6291 ( function add( args ) { 6292 jQuery.each( args, function( _, arg ) { 6293 if ( isFunction( arg ) ) { 6294 if ( !options.unique || !self.has( arg ) ) { 6295 list.push( arg ); 6296 } 6297 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 6298 6299 // Inspect recursively 6300 add( arg ); 6301 } 6302 } ); 6303 } )( arguments ); 6304 6305 if ( memory && !firing ) { 6306 fire(); 6307 } 6308 } 6309 return this; 6310 }, 6311 6312 // Remove a callback from the list 6313 remove: function() { 6314 jQuery.each( arguments, function( _, arg ) { 6315 var index; 6316 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 6317 list.splice( index, 1 ); 6318 6319 // Handle firing indexes 6320 if ( index <= firingIndex ) { 6321 firingIndex--; 6322 } 6323 } 6324 } ); 6325 return this; 6326 }, 6327 6328 // Check if a given callback is in the list. 6329 // If no argument is given, return whether or not list has callbacks attached. 6330 has: function( fn ) { 6331 return fn ? 6332 jQuery.inArray( fn, list ) > -1 : 6333 list.length > 0; 6334 }, 6335 6336 // Remove all callbacks from the list 6337 empty: function() { 6338 if ( list ) { 6339 list = []; 6340 } 6341 return this; 6342 }, 6343 6344 // Disable .fire and .add 6345 // Abort any current/pending executions 6346 // Clear all callbacks and values 6347 disable: function() { 6348 locked = queue = []; 6349 list = memory = ""; 6350 return this; 6351 }, 6352 disabled: function() { 6353 return !list; 6354 }, 6355 6356 // Disable .fire 6357 // Also disable .add unless we have memory (since it would have no effect) 6358 // Abort any pending executions 6359 lock: function() { 6360 locked = queue = []; 6361 if ( !memory && !firing ) { 6362 list = memory = ""; 6363 } 6364 return this; 6365 }, 6366 locked: function() { 6367 return !!locked; 6368 }, 6369 6370 // Call all callbacks with the given context and arguments 6371 fireWith: function( context, args ) { 6372 if ( !locked ) { 6373 args = args || []; 6374 args = [ context, args.slice ? args.slice() : args ]; 6375 queue.push( args ); 6376 if ( !firing ) { 6377 fire(); 6378 } 6379 } 6380 return this; 6381 }, 6382 6383 // Call all the callbacks with the given arguments 6384 fire: function() { 6385 self.fireWith( this, arguments ); 6386 return this; 6387 }, 6388 6389 // To know if the callbacks have already been called at least once 6390 fired: function() { 6391 return !!fired; 6392 } 6393 }; 6394 6395 return self; 6396}; 6397 6398 6399function Identity( v ) { 6400 return v; 6401} 6402function Thrower( ex ) { 6403 throw ex; 6404} 6405 6406function adoptValue( value, resolve, reject, noValue ) { 6407 var method; 6408 6409 try { 6410 6411 // Check for promise aspect first to privilege synchronous behavior 6412 if ( value && isFunction( ( method = value.promise ) ) ) { 6413 method.call( value ).done( resolve ).fail( reject ); 6414 6415 // Other thenables 6416 } else if ( value && isFunction( ( method = value.then ) ) ) { 6417 method.call( value, resolve, reject ); 6418 6419 // Other non-thenables 6420 } else { 6421 6422 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 6423 // * false: [ value ].slice( 0 ) => resolve( value ) 6424 // * true: [ value ].slice( 1 ) => resolve() 6425 resolve.apply( undefined, [ value ].slice( noValue ) ); 6426 } 6427 6428 // For Promises/A+, convert exceptions into rejections 6429 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 6430 // Deferred#then to conditionally suppress rejection. 6431 } catch ( value ) { 6432 6433 // Support: Android 4.0 only 6434 // Strict mode functions invoked without .call/.apply get global-object context 6435 reject.apply( undefined, [ value ] ); 6436 } 6437} 6438 6439jQuery.extend( { 6440 6441 Deferred: function( func ) { 6442 var tuples = [ 6443 6444 // action, add listener, callbacks, 6445 // ... .then handlers, argument index, [final state] 6446 [ "notify", "progress", jQuery.Callbacks( "memory" ), 6447 jQuery.Callbacks( "memory" ), 2 ], 6448 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 6449 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 6450 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 6451 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 6452 ], 6453 state = "pending", 6454 promise = { 6455 state: function() { 6456 return state; 6457 }, 6458 always: function() { 6459 deferred.done( arguments ).fail( arguments ); 6460 return this; 6461 }, 6462 "catch": function( fn ) { 6463 return promise.then( null, fn ); 6464 }, 6465 6466 // Keep pipe for back-compat 6467 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 6468 var fns = arguments; 6469 6470 return jQuery.Deferred( function( newDefer ) { 6471 jQuery.each( tuples, function( _i, tuple ) { 6472 6473 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 6474 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 6475 6476 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 6477 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 6478 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 6479 deferred[ tuple[ 1 ] ]( function() { 6480 var returned = fn && fn.apply( this, arguments ); 6481 if ( returned && isFunction( returned.promise ) ) { 6482 returned.promise() 6483 .progress( newDefer.notify ) 6484 .done( newDefer.resolve ) 6485 .fail( newDefer.reject ); 6486 } else { 6487 newDefer[ tuple[ 0 ] + "With" ]( 6488 this, 6489 fn ? [ returned ] : arguments 6490 ); 6491 } 6492 } ); 6493 } ); 6494 fns = null; 6495 } ).promise(); 6496 }, 6497 then: function( onFulfilled, onRejected, onProgress ) { 6498 var maxDepth = 0; 6499 function resolve( depth, deferred, handler, special ) { 6500 return function() { 6501 var that = this, 6502 args = arguments, 6503 mightThrow = function() { 6504 var returned, then; 6505 6506 // Support: Promises/A+ section 2.3.3.3.3 6507 // https://promisesaplus.com/#point-59 6508 // Ignore double-resolution attempts 6509 if ( depth < maxDepth ) { 6510 return; 6511 } 6512 6513 returned = handler.apply( that, args ); 6514 6515 // Support: Promises/A+ section 2.3.1 6516 // https://promisesaplus.com/#point-48 6517 if ( returned === deferred.promise() ) { 6518 throw new TypeError( "Thenable self-resolution" ); 6519 } 6520 6521 // Support: Promises/A+ sections 2.3.3.1, 3.5 6522 // https://promisesaplus.com/#point-54 6523 // https://promisesaplus.com/#point-75 6524 // Retrieve `then` only once 6525 then = returned && 6526 6527 // Support: Promises/A+ section 2.3.4 6528 // https://promisesaplus.com/#point-64 6529 // Only check objects and functions for thenability 6530 ( typeof returned === "object" || 6531 typeof returned === "function" ) && 6532 returned.then; 6533 6534 // Handle a returned thenable 6535 if ( isFunction( then ) ) { 6536 6537 // Special processors (notify) just wait for resolution 6538 if ( special ) { 6539 then.call( 6540 returned, 6541 resolve( maxDepth, deferred, Identity, special ), 6542 resolve( maxDepth, deferred, Thrower, special ) 6543 ); 6544 6545 // Normal processors (resolve) also hook into progress 6546 } else { 6547 6548 // ...and disregard older resolution values 6549 maxDepth++; 6550 6551 then.call( 6552 returned, 6553 resolve( maxDepth, deferred, Identity, special ), 6554 resolve( maxDepth, deferred, Thrower, special ), 6555 resolve( maxDepth, deferred, Identity, 6556 deferred.notifyWith ) 6557 ); 6558 } 6559 6560 // Handle all other returned values 6561 } else { 6562 6563 // Only substitute handlers pass on context 6564 // and multiple values (non-spec behavior) 6565 if ( handler !== Identity ) { 6566 that = undefined; 6567 args = [ returned ]; 6568 } 6569 6570 // Process the value(s) 6571 // Default process is resolve 6572 ( special || deferred.resolveWith )( that, args ); 6573 } 6574 }, 6575 6576 // Only normal processors (resolve) catch and reject exceptions 6577 process = special ? 6578 mightThrow : 6579 function() { 6580 try { 6581 mightThrow(); 6582 } catch ( e ) { 6583 6584 if ( jQuery.Deferred.exceptionHook ) { 6585 jQuery.Deferred.exceptionHook( e, 6586 process.error ); 6587 } 6588 6589 // Support: Promises/A+ section 2.3.3.3.4.1 6590 // https://promisesaplus.com/#point-61 6591 // Ignore post-resolution exceptions 6592 if ( depth + 1 >= maxDepth ) { 6593 6594 // Only substitute handlers pass on context 6595 // and multiple values (non-spec behavior) 6596 if ( handler !== Thrower ) { 6597 that = undefined; 6598 args = [ e ]; 6599 } 6600 6601 deferred.rejectWith( that, args ); 6602 } 6603 } 6604 }; 6605 6606 // Support: Promises/A+ section 2.3.3.3.1 6607 // https://promisesaplus.com/#point-57 6608 // Re-resolve promises immediately to dodge false rejection from 6609 // subsequent errors 6610 if ( depth ) { 6611 process(); 6612 } else { 6613 6614 // Call an optional hook to record the error, in case of exception 6615 // since it's otherwise lost when execution goes async 6616 if ( jQuery.Deferred.getErrorHook ) { 6617 process.error = jQuery.Deferred.getErrorHook(); 6618 6619 // The deprecated alias of the above. While the name suggests 6620 // returning the stack, not an error instance, jQuery just passes 6621 // it directly to `console.warn` so both will work; an instance 6622 // just better cooperates with source maps. 6623 } else if ( jQuery.Deferred.getStackHook ) { 6624 process.error = jQuery.Deferred.getStackHook(); 6625 } 6626 window.setTimeout( process ); 6627 } 6628 }; 6629 } 6630 6631 return jQuery.Deferred( function( newDefer ) { 6632 6633 // progress_handlers.add( ... ) 6634 tuples[ 0 ][ 3 ].add( 6635 resolve( 6636 0, 6637 newDefer, 6638 isFunction( onProgress ) ? 6639 onProgress : 6640 Identity, 6641 newDefer.notifyWith 6642 ) 6643 ); 6644 6645 // fulfilled_handlers.add( ... ) 6646 tuples[ 1 ][ 3 ].add( 6647 resolve( 6648 0, 6649 newDefer, 6650 isFunction( onFulfilled ) ? 6651 onFulfilled : 6652 Identity 6653 ) 6654 ); 6655 6656 // rejected_handlers.add( ... ) 6657 tuples[ 2 ][ 3 ].add( 6658 resolve( 6659 0, 6660 newDefer, 6661 isFunction( onRejected ) ? 6662 onRejected : 6663 Thrower 6664 ) 6665 ); 6666 } ).promise(); 6667 }, 6668 6669 // Get a promise for this deferred 6670 // If obj is provided, the promise aspect is added to the object 6671 promise: function( obj ) { 6672 return obj != null ? jQuery.extend( obj, promise ) : promise; 6673 } 6674 }, 6675 deferred = {}; 6676 6677 // Add list-specific methods 6678 jQuery.each( tuples, function( i, tuple ) { 6679 var list = tuple[ 2 ], 6680 stateString = tuple[ 5 ]; 6681 6682 // promise.progress = list.add 6683 // promise.done = list.add 6684 // promise.fail = list.add 6685 promise[ tuple[ 1 ] ] = list.add; 6686 6687 // Handle state 6688 if ( stateString ) { 6689 list.add( 6690 function() { 6691 6692 // state = "resolved" (i.e., fulfilled) 6693 // state = "rejected" 6694 state = stateString; 6695 }, 6696 6697 // rejected_callbacks.disable 6698 // fulfilled_callbacks.disable 6699 tuples[ 3 - i ][ 2 ].disable, 6700 6701 // rejected_handlers.disable 6702 // fulfilled_handlers.disable 6703 tuples[ 3 - i ][ 3 ].disable, 6704 6705 // progress_callbacks.lock 6706 tuples[ 0 ][ 2 ].lock, 6707 6708 // progress_handlers.lock 6709 tuples[ 0 ][ 3 ].lock 6710 ); 6711 } 6712 6713 // progress_handlers.fire 6714 // fulfilled_handlers.fire 6715 // rejected_handlers.fire 6716 list.add( tuple[ 3 ].fire ); 6717 6718 // deferred.notify = function() { deferred.notifyWith(...) } 6719 // deferred.resolve = function() { deferred.resolveWith(...) } 6720 // deferred.reject = function() { deferred.rejectWith(...) } 6721 deferred[ tuple[ 0 ] ] = function() { 6722 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 6723 return this; 6724 }; 6725 6726 // deferred.notifyWith = list.fireWith 6727 // deferred.resolveWith = list.fireWith 6728 // deferred.rejectWith = list.fireWith 6729 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 6730 } ); 6731 6732 // Make the deferred a promise 6733 promise.promise( deferred ); 6734 6735 // Call given func if any 6736 if ( func ) { 6737 func.call( deferred, deferred ); 6738 } 6739 6740 // All done! 6741 return deferred; 6742 }, 6743 6744 // Deferred helper 6745 when: function( singleValue ) { 6746 var 6747 6748 // count of uncompleted subordinates 6749 remaining = arguments.length, 6750 6751 // count of unprocessed arguments 6752 i = remaining, 6753 6754 // subordinate fulfillment data 6755 resolveContexts = Array( i ), 6756 resolveValues = slice.call( arguments ), 6757 6758 // the primary Deferred 6759 primary = jQuery.Deferred(), 6760 6761 // subordinate callback factory 6762 updateFunc = function( i ) { 6763 return function( value ) { 6764 resolveContexts[ i ] = this; 6765 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 6766 if ( !( --remaining ) ) { 6767 primary.resolveWith( resolveContexts, resolveValues ); 6768 } 6769 }; 6770 }; 6771 6772 // Single- and empty arguments are adopted like Promise.resolve 6773 if ( remaining <= 1 ) { 6774 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 6775 !remaining ); 6776 6777 // Use .then() to unwrap secondary thenables (cf. gh-3000) 6778 if ( primary.state() === "pending" || 6779 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 6780 6781 return primary.then(); 6782 } 6783 } 6784 6785 // Multiple arguments are aggregated like Promise.all array elements 6786 while ( i-- ) { 6787 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 6788 } 6789 6790 return primary.promise(); 6791 } 6792} ); 6793 6794 6795// These usually indicate a programmer mistake during development, 6796// warn about them ASAP rather than swallowing them by default. 6797var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 6798 6799// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 6800// captured before the async barrier to get the original error cause 6801// which may otherwise be hidden. 6802jQuery.Deferred.exceptionHook = function( error, asyncError ) { 6803 6804 // Support: IE 8 - 9 only 6805 // Console exists when dev tools are open, which can happen at any time 6806 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 6807 window.console.warn( "jQuery.Deferred exception: " + error.message, 6808 error.stack, asyncError ); 6809 } 6810}; 6811 6812 6813 6814 6815jQuery.readyException = function( error ) { 6816 window.setTimeout( function() { 6817 throw error; 6818 } ); 6819}; 6820 6821 6822 6823 6824// The deferred used on DOM ready 6825var readyList = jQuery.Deferred(); 6826 6827jQuery.fn.ready = function( fn ) { 6828 6829 readyList 6830 .then( fn ) 6831 6832 // Wrap jQuery.readyException in a function so that the lookup 6833 // happens at the time of error handling instead of callback 6834 // registration. 6835 .catch( function( error ) { 6836 jQuery.readyException( error ); 6837 } ); 6838 6839 return this; 6840}; 6841 6842jQuery.extend( { 6843 6844 // Is the DOM ready to be used? Set to true once it occurs. 6845 isReady: false, 6846 6847 // A counter to track how many items to wait for before 6848 // the ready event fires. See trac-6781 6849 readyWait: 1, 6850 6851 // Handle when the DOM is ready 6852 ready: function( wait ) { 6853 6854 // Abort if there are pending holds or we're already ready 6855 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 6856 return; 6857 } 6858 6859 // Remember that the DOM is ready 6860 jQuery.isReady = true; 6861 6862 // If a normal DOM Ready event fired, decrement, and wait if need be 6863 if ( wait !== true && --jQuery.readyWait > 0 ) { 6864 return; 6865 } 6866 6867 // If there are functions bound, to execute 6868 readyList.resolveWith( document, [ jQuery ] ); 6869 } 6870} ); 6871 6872jQuery.ready.then = readyList.then; 6873 6874// The ready event handler and self cleanup method 6875function completed() { 6876 document.removeEventListener( "DOMContentLoaded", completed ); 6877 window.removeEventListener( "load", completed ); 6878 jQuery.ready(); 6879} 6880 6881// Catch cases where $(document).ready() is called 6882// after the browser event has already occurred. 6883// Support: IE <=9 - 10 only 6884// Older IE sometimes signals "interactive" too soon 6885if ( document.readyState === "complete" || 6886 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 6887 6888 // Handle it asynchronously to allow scripts the opportunity to delay ready 6889 window.setTimeout( jQuery.ready ); 6890 6891} else { 6892 6893 // Use the handy event callback 6894 document.addEventListener( "DOMContentLoaded", completed ); 6895 6896 // A fallback to window.onload, that will always work 6897 window.addEventListener( "load", completed ); 6898} 6899 6900 6901 6902 6903// Multifunctional method to get and set values of a collection 6904// The value/s can optionally be executed if it's a function 6905var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 6906 var i = 0, 6907 len = elems.length, 6908 bulk = key == null; 6909 6910 // Sets many values 6911 if ( toType( key ) === "object" ) { 6912 chainable = true; 6913 for ( i in key ) { 6914 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 6915 } 6916 6917 // Sets one value 6918 } else if ( value !== undefined ) { 6919 chainable = true; 6920 6921 if ( !isFunction( value ) ) { 6922 raw = true; 6923 } 6924 6925 if ( bulk ) { 6926 6927 // Bulk operations run against the entire set 6928 if ( raw ) { 6929 fn.call( elems, value ); 6930 fn = null; 6931 6932 // ...except when executing function values 6933 } else { 6934 bulk = fn; 6935 fn = function( elem, _key, value ) { 6936 return bulk.call( jQuery( elem ), value ); 6937 }; 6938 } 6939 } 6940 6941 if ( fn ) { 6942 for ( ; i < len; i++ ) { 6943 fn( 6944 elems[ i ], key, raw ? 6945 value : 6946 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 6947 ); 6948 } 6949 } 6950 } 6951 6952 if ( chainable ) { 6953 return elems; 6954 } 6955 6956 // Gets 6957 if ( bulk ) { 6958 return fn.call( elems ); 6959 } 6960 6961 return len ? fn( elems[ 0 ], key ) : emptyGet; 6962}; 6963 6964 6965// Matches dashed string for camelizing 6966var rmsPrefix = /^-ms-/, 6967 rdashAlpha = /-([a-z])/g; 6968 6969// Used by camelCase as callback to replace() 6970function fcamelCase( _all, letter ) { 6971 return letter.toUpperCase(); 6972} 6973 6974// Convert dashed to camelCase; used by the css and data modules 6975// Support: IE <=9 - 11, Edge 12 - 15 6976// Microsoft forgot to hump their vendor prefix (trac-9572) 6977function camelCase( string ) { 6978 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 6979} 6980var acceptData = function( owner ) { 6981 6982 // Accepts only: 6983 // - Node 6984 // - Node.ELEMENT_NODE 6985 // - Node.DOCUMENT_NODE 6986 // - Object 6987 // - Any 6988 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 6989}; 6990 6991 6992 6993 6994function Data() { 6995 this.expando = jQuery.expando + Data.uid++; 6996} 6997 6998Data.uid = 1; 6999 7000Data.prototype = { 7001 7002 cache: function( owner ) { 7003 7004 // Check if the owner object already has a cache 7005 var value = owner[ this.expando ]; 7006 7007 // If not, create one 7008 if ( !value ) { 7009 value = {}; 7010 7011 // We can accept data for non-element nodes in modern browsers, 7012 // but we should not, see trac-8335. 7013 // Always return an empty object. 7014 if ( acceptData( owner ) ) { 7015 7016 // If it is a node unlikely to be stringify-ed or looped over 7017 // use plain assignment 7018 if ( owner.nodeType ) { 7019 owner[ this.expando ] = value; 7020 7021 // Otherwise secure it in a non-enumerable property 7022 // configurable must be true to allow the property to be 7023 // deleted when data is removed 7024 } else { 7025 Object.defineProperty( owner, this.expando, { 7026 value: value, 7027 configurable: true 7028 } ); 7029 } 7030 } 7031 } 7032 7033 return value; 7034 }, 7035 set: function( owner, data, value ) { 7036 var prop, 7037 cache = this.cache( owner ); 7038 7039 // Handle: [ owner, key, value ] args 7040 // Always use camelCase key (gh-2257) 7041 if ( typeof data === "string" ) { 7042 cache[ camelCase( data ) ] = value; 7043 7044 // Handle: [ owner, { properties } ] args 7045 } else { 7046 7047 // Copy the properties one-by-one to the cache object 7048 for ( prop in data ) { 7049 cache[ camelCase( prop ) ] = data[ prop ]; 7050 } 7051 } 7052 return cache; 7053 }, 7054 get: function( owner, key ) { 7055 return key === undefined ? 7056 this.cache( owner ) : 7057 7058 // Always use camelCase key (gh-2257) 7059 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 7060 }, 7061 access: function( owner, key, value ) { 7062 7063 // In cases where either: 7064 // 7065 // 1. No key was specified 7066 // 2. A string key was specified, but no value provided 7067 // 7068 // Take the "read" path and allow the get method to determine 7069 // which value to return, respectively either: 7070 // 7071 // 1. The entire cache object 7072 // 2. The data stored at the key 7073 // 7074 if ( key === undefined || 7075 ( ( key && typeof key === "string" ) && value === undefined ) ) { 7076 7077 return this.get( owner, key ); 7078 } 7079 7080 // When the key is not a string, or both a key and value 7081 // are specified, set or extend (existing objects) with either: 7082 // 7083 // 1. An object of properties 7084 // 2. A key and value 7085 // 7086 this.set( owner, key, value ); 7087 7088 // Since the "set" path can have two possible entry points 7089 // return the expected data based on which path was taken[*] 7090 return value !== undefined ? value : key; 7091 }, 7092 remove: function( owner, key ) { 7093 var i, 7094 cache = owner[ this.expando ]; 7095 7096 if ( cache === undefined ) { 7097 return; 7098 } 7099 7100 if ( key !== undefined ) { 7101 7102 // Support array or space separated string of keys 7103 if ( Array.isArray( key ) ) { 7104 7105 // If key is an array of keys... 7106 // We always set camelCase keys, so remove that. 7107 key = key.map( camelCase ); 7108 } else { 7109 key = camelCase( key ); 7110 7111 // If a key with the spaces exists, use it. 7112 // Otherwise, create an array by matching non-whitespace 7113 key = key in cache ? 7114 [ key ] : 7115 ( key.match( rnothtmlwhite ) || [] ); 7116 } 7117 7118 i = key.length; 7119 7120 while ( i-- ) { 7121 delete cache[ key[ i ] ]; 7122 } 7123 } 7124 7125 // Remove the expando if there's no more data 7126 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 7127 7128 // Support: Chrome <=35 - 45 7129 // Webkit & Blink performance suffers when deleting properties 7130 // from DOM nodes, so set to undefined instead 7131 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 7132 if ( owner.nodeType ) { 7133 owner[ this.expando ] = undefined; 7134 } else { 7135 delete owner[ this.expando ]; 7136 } 7137 } 7138 }, 7139 hasData: function( owner ) { 7140 var cache = owner[ this.expando ]; 7141 return cache !== undefined && !jQuery.isEmptyObject( cache ); 7142 } 7143}; 7144var dataPriv = new Data(); 7145 7146var dataUser = new Data(); 7147 7148 7149 7150// Implementation Summary 7151// 7152// 1. Enforce API surface and semantic compatibility with 1.9.x branch 7153// 2. Improve the module's maintainability by reducing the storage 7154// paths to a single mechanism. 7155// 3. Use the same single mechanism to support "private" and "user" data. 7156// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 7157// 5. Avoid exposing implementation details on user objects (eg. expando properties) 7158// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 7159 7160var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 7161 rmultiDash = /[A-Z]/g; 7162 7163function getData( data ) { 7164 if ( data === "true" ) { 7165 return true; 7166 } 7167 7168 if ( data === "false" ) { 7169 return false; 7170 } 7171 7172 if ( data === "null" ) { 7173 return null; 7174 } 7175 7176 // Only convert to a number if it doesn't change the string 7177 if ( data === +data + "" ) { 7178 return +data; 7179 } 7180 7181 if ( rbrace.test( data ) ) { 7182 return JSON.parse( data ); 7183 } 7184 7185 return data; 7186} 7187 7188function dataAttr( elem, key, data ) { 7189 var name; 7190 7191 // If nothing was found internally, try to fetch any 7192 // data from the HTML5 data-* attribute 7193 if ( data === undefined && elem.nodeType === 1 ) { 7194 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 7195 data = elem.getAttribute( name ); 7196 7197 if ( typeof data === "string" ) { 7198 try { 7199 data = getData( data ); 7200 } catch ( e ) {} 7201 7202 // Make sure we set the data so it isn't changed later 7203 dataUser.set( elem, key, data ); 7204 } else { 7205 data = undefined; 7206 } 7207 } 7208 return data; 7209} 7210 7211jQuery.extend( { 7212 hasData: function( elem ) { 7213 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 7214 }, 7215 7216 data: function( elem, name, data ) { 7217 return dataUser.access( elem, name, data ); 7218 }, 7219 7220 removeData: function( elem, name ) { 7221 dataUser.remove( elem, name ); 7222 }, 7223 7224 // TODO: Now that all calls to _data and _removeData have been replaced 7225 // with direct calls to dataPriv methods, these can be deprecated. 7226 _data: function( elem, name, data ) { 7227 return dataPriv.access( elem, name, data ); 7228 }, 7229 7230 _removeData: function( elem, name ) { 7231 dataPriv.remove( elem, name ); 7232 } 7233} ); 7234 7235jQuery.fn.extend( { 7236 data: function( key, value ) { 7237 var i, name, data, 7238 elem = this[ 0 ], 7239 attrs = elem && elem.attributes; 7240 7241 // Gets all values 7242 if ( key === undefined ) { 7243 if ( this.length ) { 7244 data = dataUser.get( elem ); 7245 7246 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 7247 i = attrs.length; 7248 while ( i-- ) { 7249 7250 // Support: IE 11 only 7251 // The attrs elements can be null (trac-14894) 7252 if ( attrs[ i ] ) { 7253 name = attrs[ i ].name; 7254 if ( name.indexOf( "data-" ) === 0 ) { 7255 name = camelCase( name.slice( 5 ) ); 7256 dataAttr( elem, name, data[ name ] ); 7257 } 7258 } 7259 } 7260 dataPriv.set( elem, "hasDataAttrs", true ); 7261 } 7262 } 7263 7264 return data; 7265 } 7266 7267 // Sets multiple values 7268 if ( typeof key === "object" ) { 7269 return this.each( function() { 7270 dataUser.set( this, key ); 7271 } ); 7272 } 7273 7274 return access( this, function( value ) { 7275 var data; 7276 7277 // The calling jQuery object (element matches) is not empty 7278 // (and therefore has an element appears at this[ 0 ]) and the 7279 // `value` parameter was not undefined. An empty jQuery object 7280 // will result in `undefined` for elem = this[ 0 ] which will 7281 // throw an exception if an attempt to read a data cache is made. 7282 if ( elem && value === undefined ) { 7283 7284 // Attempt to get data from the cache 7285 // The key will always be camelCased in Data 7286 data = dataUser.get( elem, key ); 7287 if ( data !== undefined ) { 7288 return data; 7289 } 7290 7291 // Attempt to "discover" the data in 7292 // HTML5 custom data-* attrs 7293 data = dataAttr( elem, key ); 7294 if ( data !== undefined ) { 7295 return data; 7296 } 7297 7298 // We tried really hard, but the data doesn't exist. 7299 return; 7300 } 7301 7302 // Set the data... 7303 this.each( function() { 7304 7305 // We always store the camelCased key 7306 dataUser.set( this, key, value ); 7307 } ); 7308 }, null, value, arguments.length > 1, null, true ); 7309 }, 7310 7311 removeData: function( key ) { 7312 return this.each( function() { 7313 dataUser.remove( this, key ); 7314 } ); 7315 } 7316} ); 7317 7318 7319jQuery.extend( { 7320 queue: function( elem, type, data ) { 7321 var queue; 7322 7323 if ( elem ) { 7324 type = ( type || "fx" ) + "queue"; 7325 queue = dataPriv.get( elem, type ); 7326 7327 // Speed up dequeue by getting out quickly if this is just a lookup 7328 if ( data ) { 7329 if ( !queue || Array.isArray( data ) ) { 7330 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 7331 } else { 7332 queue.push( data ); 7333 } 7334 } 7335 return queue || []; 7336 } 7337 }, 7338 7339 dequeue: function( elem, type ) { 7340 type = type || "fx"; 7341 7342 var queue = jQuery.queue( elem, type ), 7343 startLength = queue.length, 7344 fn = queue.shift(), 7345 hooks = jQuery._queueHooks( elem, type ), 7346 next = function() { 7347 jQuery.dequeue( elem, type ); 7348 }; 7349 7350 // If the fx queue is dequeued, always remove the progress sentinel 7351 if ( fn === "inprogress" ) { 7352 fn = queue.shift(); 7353 startLength--; 7354 } 7355 7356 if ( fn ) { 7357 7358 // Add a progress sentinel to prevent the fx queue from being 7359 // automatically dequeued 7360 if ( type === "fx" ) { 7361 queue.unshift( "inprogress" ); 7362 } 7363 7364 // Clear up the last queue stop function 7365 delete hooks.stop; 7366 fn.call( elem, next, hooks ); 7367 } 7368 7369 if ( !startLength && hooks ) { 7370 hooks.empty.fire(); 7371 } 7372 }, 7373 7374 // Not public - generate a queueHooks object, or return the current one 7375 _queueHooks: function( elem, type ) { 7376 var key = type + "queueHooks"; 7377 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 7378 empty: jQuery.Callbacks( "once memory" ).add( function() { 7379 dataPriv.remove( elem, [ type + "queue", key ] ); 7380 } ) 7381 } ); 7382 } 7383} ); 7384 7385jQuery.fn.extend( { 7386 queue: function( type, data ) { 7387 var setter = 2; 7388 7389 if ( typeof type !== "string" ) { 7390 data = type; 7391 type = "fx"; 7392 setter--; 7393 } 7394 7395 if ( arguments.length < setter ) { 7396 return jQuery.queue( this[ 0 ], type ); 7397 } 7398 7399 return data === undefined ? 7400 this : 7401 this.each( function() { 7402 var queue = jQuery.queue( this, type, data ); 7403 7404 // Ensure a hooks for this queue 7405 jQuery._queueHooks( this, type ); 7406 7407 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 7408 jQuery.dequeue( this, type ); 7409 } 7410 } ); 7411 }, 7412 dequeue: function( type ) { 7413 return this.each( function() { 7414 jQuery.dequeue( this, type ); 7415 } ); 7416 }, 7417 clearQueue: function( type ) { 7418 return this.queue( type || "fx", [] ); 7419 }, 7420 7421 // Get a promise resolved when queues of a certain type 7422 // are emptied (fx is the type by default) 7423 promise: function( type, obj ) { 7424 var tmp, 7425 count = 1, 7426 defer = jQuery.Deferred(), 7427 elements = this, 7428 i = this.length, 7429 resolve = function() { 7430 if ( !( --count ) ) { 7431 defer.resolveWith( elements, [ elements ] ); 7432 } 7433 }; 7434 7435 if ( typeof type !== "string" ) { 7436 obj = type; 7437 type = undefined; 7438 } 7439 type = type || "fx"; 7440 7441 while ( i-- ) { 7442 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 7443 if ( tmp && tmp.empty ) { 7444 count++; 7445 tmp.empty.add( resolve ); 7446 } 7447 } 7448 resolve(); 7449 return defer.promise( obj ); 7450 } 7451} ); 7452var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 7453 7454var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 7455 7456 7457var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 7458 7459var documentElement = document.documentElement; 7460 7461 7462 7463 var isAttached = function( elem ) { 7464 return jQuery.contains( elem.ownerDocument, elem ); 7465 }, 7466 composed = { composed: true }; 7467 7468 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 7469 // Check attachment across shadow DOM boundaries when possible (gh-3504) 7470 // Support: iOS 10.0-10.2 only 7471 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 7472 // leading to errors. We need to check for `getRootNode`. 7473 if ( documentElement.getRootNode ) { 7474 isAttached = function( elem ) { 7475 return jQuery.contains( elem.ownerDocument, elem ) || 7476 elem.getRootNode( composed ) === elem.ownerDocument; 7477 }; 7478 } 7479var isHiddenWithinTree = function( elem, el ) { 7480 7481 // isHiddenWithinTree might be called from jQuery#filter function; 7482 // in that case, element will be second argument 7483 elem = el || elem; 7484 7485 // Inline style trumps all 7486 return elem.style.display === "none" || 7487 elem.style.display === "" && 7488 7489 // Otherwise, check computed style 7490 // Support: Firefox <=43 - 45 7491 // Disconnected elements can have computed display: none, so first confirm that elem is 7492 // in the document. 7493 isAttached( elem ) && 7494 7495 jQuery.css( elem, "display" ) === "none"; 7496 }; 7497 7498 7499 7500function adjustCSS( elem, prop, valueParts, tween ) { 7501 var adjusted, scale, 7502 maxIterations = 20, 7503 currentValue = tween ? 7504 function() { 7505 return tween.cur(); 7506 } : 7507 function() { 7508 return jQuery.css( elem, prop, "" ); 7509 }, 7510 initial = currentValue(), 7511 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 7512 7513 // Starting value computation is required for potential unit mismatches 7514 initialInUnit = elem.nodeType && 7515 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 7516 rcssNum.exec( jQuery.css( elem, prop ) ); 7517 7518 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 7519 7520 // Support: Firefox <=54 7521 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 7522 initial = initial / 2; 7523 7524 // Trust units reported by jQuery.css 7525 unit = unit || initialInUnit[ 3 ]; 7526 7527 // Iteratively approximate from a nonzero starting point 7528 initialInUnit = +initial || 1; 7529 7530 while ( maxIterations-- ) { 7531 7532 // Evaluate and update our best guess (doubling guesses that zero out). 7533 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 7534 jQuery.style( elem, prop, initialInUnit + unit ); 7535 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 7536 maxIterations = 0; 7537 } 7538 initialInUnit = initialInUnit / scale; 7539 7540 } 7541 7542 initialInUnit = initialInUnit * 2; 7543 jQuery.style( elem, prop, initialInUnit + unit ); 7544 7545 // Make sure we update the tween properties later on 7546 valueParts = valueParts || []; 7547 } 7548 7549 if ( valueParts ) { 7550 initialInUnit = +initialInUnit || +initial || 0; 7551 7552 // Apply relative offset (+=/-=) if specified 7553 adjusted = valueParts[ 1 ] ? 7554 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 7555 +valueParts[ 2 ]; 7556 if ( tween ) { 7557 tween.unit = unit; 7558 tween.start = initialInUnit; 7559 tween.end = adjusted; 7560 } 7561 } 7562 return adjusted; 7563} 7564 7565 7566var defaultDisplayMap = {}; 7567 7568function getDefaultDisplay( elem ) { 7569 var temp, 7570 doc = elem.ownerDocument, 7571 nodeName = elem.nodeName, 7572 display = defaultDisplayMap[ nodeName ]; 7573 7574 if ( display ) { 7575 return display; 7576 } 7577 7578 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 7579 display = jQuery.css( temp, "display" ); 7580 7581 temp.parentNode.removeChild( temp ); 7582 7583 if ( display === "none" ) { 7584 display = "block"; 7585 } 7586 defaultDisplayMap[ nodeName ] = display; 7587 7588 return display; 7589} 7590 7591function showHide( elements, show ) { 7592 var display, elem, 7593 values = [], 7594 index = 0, 7595 length = elements.length; 7596 7597 // Determine new display value for elements that need to change 7598 for ( ; index < length; index++ ) { 7599 elem = elements[ index ]; 7600 if ( !elem.style ) { 7601 continue; 7602 } 7603 7604 display = elem.style.display; 7605 if ( show ) { 7606 7607 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 7608 // check is required in this first loop unless we have a nonempty display value (either 7609 // inline or about-to-be-restored) 7610 if ( display === "none" ) { 7611 values[ index ] = dataPriv.get( elem, "display" ) || null; 7612 if ( !values[ index ] ) { 7613 elem.style.display = ""; 7614 } 7615 } 7616 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 7617 values[ index ] = getDefaultDisplay( elem ); 7618 } 7619 } else { 7620 if ( display !== "none" ) { 7621 values[ index ] = "none"; 7622 7623 // Remember what we're overwriting 7624 dataPriv.set( elem, "display", display ); 7625 } 7626 } 7627 } 7628 7629 // Set the display of the elements in a second loop to avoid constant reflow 7630 for ( index = 0; index < length; index++ ) { 7631 if ( values[ index ] != null ) { 7632 elements[ index ].style.display = values[ index ]; 7633 } 7634 } 7635 7636 return elements; 7637} 7638 7639jQuery.fn.extend( { 7640 show: function() { 7641 return showHide( this, true ); 7642 }, 7643 hide: function() { 7644 return showHide( this ); 7645 }, 7646 toggle: function( state ) { 7647 if ( typeof state === "boolean" ) { 7648 return state ? this.show() : this.hide(); 7649 } 7650 7651 return this.each( function() { 7652 if ( isHiddenWithinTree( this ) ) { 7653 jQuery( this ).show(); 7654 } else { 7655 jQuery( this ).hide(); 7656 } 7657 } ); 7658 } 7659} ); 7660var rcheckableType = ( /^(?:checkbox|radio)$/i ); 7661 7662var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 7663 7664var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 7665 7666 7667 7668( function() { 7669 var fragment = document.createDocumentFragment(), 7670 div = fragment.appendChild( document.createElement( "div" ) ), 7671 input = document.createElement( "input" ); 7672 7673 // Support: Android 4.0 - 4.3 only 7674 // Check state lost if the name is set (trac-11217) 7675 // Support: Windows Web Apps (WWA) 7676 // `name` and `type` must use .setAttribute for WWA (trac-14901) 7677 input.setAttribute( "type", "radio" ); 7678 input.setAttribute( "checked", "checked" ); 7679 input.setAttribute( "name", "t" ); 7680 7681 div.appendChild( input ); 7682 7683 // Support: Android <=4.1 only 7684 // Older WebKit doesn't clone checked state correctly in fragments 7685 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 7686 7687 // Support: IE <=11 only 7688 // Make sure textarea (and checkbox) defaultValue is properly cloned 7689 div.innerHTML = "<textarea>x</textarea>"; 7690 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 7691 7692 // Support: IE <=9 only 7693 // IE <=9 replaces <option> tags with their contents when inserted outside of 7694 // the select element. 7695 div.innerHTML = "<option></option>"; 7696 support.option = !!div.lastChild; 7697} )(); 7698 7699 7700// We have to close these tags to support XHTML (trac-13200) 7701var wrapMap = { 7702 7703 // XHTML parsers do not magically insert elements in the 7704 // same way that tag soup parsers do. So we cannot shorten 7705 // this by omitting <tbody> or other required elements. 7706 thead: [ 1, "<table>", "</table>" ], 7707 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 7708 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 7709 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 7710 7711 _default: [ 0, "", "" ] 7712}; 7713 7714wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 7715wrapMap.th = wrapMap.td; 7716 7717// Support: IE <=9 only 7718if ( !support.option ) { 7719 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 7720} 7721 7722 7723function getAll( context, tag ) { 7724 7725 // Support: IE <=9 - 11 only 7726 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 7727 var ret; 7728 7729 if ( typeof context.getElementsByTagName !== "undefined" ) { 7730 ret = context.getElementsByTagName( tag || "*" ); 7731 7732 } else if ( typeof context.querySelectorAll !== "undefined" ) { 7733 ret = context.querySelectorAll( tag || "*" ); 7734 7735 } else { 7736 ret = []; 7737 } 7738 7739 if ( tag === undefined || tag && nodeName( context, tag ) ) { 7740 return jQuery.merge( [ context ], ret ); 7741 } 7742 7743 return ret; 7744} 7745 7746 7747// Mark scripts as having already been evaluated 7748function setGlobalEval( elems, refElements ) { 7749 var i = 0, 7750 l = elems.length; 7751 7752 for ( ; i < l; i++ ) { 7753 dataPriv.set( 7754 elems[ i ], 7755 "globalEval", 7756 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 7757 ); 7758 } 7759} 7760 7761 7762var rhtml = /<|&#?\w+;/; 7763 7764function buildFragment( elems, context, scripts, selection, ignored ) { 7765 var elem, tmp, tag, wrap, attached, j, 7766 fragment = context.createDocumentFragment(), 7767 nodes = [], 7768 i = 0, 7769 l = elems.length; 7770 7771 for ( ; i < l; i++ ) { 7772 elem = elems[ i ]; 7773 7774 if ( elem || elem === 0 ) { 7775 7776 // Add nodes directly 7777 if ( toType( elem ) === "object" ) { 7778 7779 // Support: Android <=4.0 only, PhantomJS 1 only 7780 // push.apply(_, arraylike) throws on ancient WebKit 7781 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 7782 7783 // Convert non-html into a text node 7784 } else if ( !rhtml.test( elem ) ) { 7785 nodes.push( context.createTextNode( elem ) ); 7786 7787 // Convert html into DOM nodes 7788 } else { 7789 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 7790 7791 // Deserialize a standard representation 7792 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 7793 wrap = wrapMap[ tag ] || wrapMap._default; 7794 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 7795 7796 // Descend through wrappers to the right content 7797 j = wrap[ 0 ]; 7798 while ( j-- ) { 7799 tmp = tmp.lastChild; 7800 } 7801 7802 // Support: Android <=4.0 only, PhantomJS 1 only 7803 // push.apply(_, arraylike) throws on ancient WebKit 7804 jQuery.merge( nodes, tmp.childNodes ); 7805 7806 // Remember the top-level container 7807 tmp = fragment.firstChild; 7808 7809 // Ensure the created nodes are orphaned (trac-12392) 7810 tmp.textContent = ""; 7811 } 7812 } 7813 } 7814 7815 // Remove wrapper from fragment 7816 fragment.textContent = ""; 7817 7818 i = 0; 7819 while ( ( elem = nodes[ i++ ] ) ) { 7820 7821 // Skip elements already in the context collection (trac-4087) 7822 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 7823 if ( ignored ) { 7824 ignored.push( elem ); 7825 } 7826 continue; 7827 } 7828 7829 attached = isAttached( elem ); 7830 7831 // Append to fragment 7832 tmp = getAll( fragment.appendChild( elem ), "script" ); 7833 7834 // Preserve script evaluation history 7835 if ( attached ) { 7836 setGlobalEval( tmp ); 7837 } 7838 7839 // Capture executables 7840 if ( scripts ) { 7841 j = 0; 7842 while ( ( elem = tmp[ j++ ] ) ) { 7843 if ( rscriptType.test( elem.type || "" ) ) { 7844 scripts.push( elem ); 7845 } 7846 } 7847 } 7848 } 7849 7850 return fragment; 7851} 7852 7853 7854var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 7855 7856function returnTrue() { 7857 return true; 7858} 7859 7860function returnFalse() { 7861 return false; 7862} 7863 7864function on( elem, types, selector, data, fn, one ) { 7865 var origFn, type; 7866 7867 // Types can be a map of types/handlers 7868 if ( typeof types === "object" ) { 7869 7870 // ( types-Object, selector, data ) 7871 if ( typeof selector !== "string" ) { 7872 7873 // ( types-Object, data ) 7874 data = data || selector; 7875 selector = undefined; 7876 } 7877 for ( type in types ) { 7878 on( elem, type, selector, data, types[ type ], one ); 7879 } 7880 return elem; 7881 } 7882 7883 if ( data == null && fn == null ) { 7884 7885 // ( types, fn ) 7886 fn = selector; 7887 data = selector = undefined; 7888 } else if ( fn == null ) { 7889 if ( typeof selector === "string" ) { 7890 7891 // ( types, selector, fn ) 7892 fn = data; 7893 data = undefined; 7894 } else { 7895 7896 // ( types, data, fn ) 7897 fn = data; 7898 data = selector; 7899 selector = undefined; 7900 } 7901 } 7902 if ( fn === false ) { 7903 fn = returnFalse; 7904 } else if ( !fn ) { 7905 return elem; 7906 } 7907 7908 if ( one === 1 ) { 7909 origFn = fn; 7910 fn = function( event ) { 7911 7912 // Can use an empty set, since event contains the info 7913 jQuery().off( event ); 7914 return origFn.apply( this, arguments ); 7915 }; 7916 7917 // Use same guid so caller can remove using origFn 7918 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 7919 } 7920 return elem.each( function() { 7921 jQuery.event.add( this, types, fn, data, selector ); 7922 } ); 7923} 7924 7925/* 7926 * Helper functions for managing events -- not part of the public interface. 7927 * Props to Dean Edwards' addEvent library for many of the ideas. 7928 */ 7929jQuery.event = { 7930 7931 global: {}, 7932 7933 add: function( elem, types, handler, data, selector ) { 7934 7935 var handleObjIn, eventHandle, tmp, 7936 events, t, handleObj, 7937 special, handlers, type, namespaces, origType, 7938 elemData = dataPriv.get( elem ); 7939 7940 // Only attach events to objects that accept data 7941 if ( !acceptData( elem ) ) { 7942 return; 7943 } 7944 7945 // Caller can pass in an object of custom data in lieu of the handler 7946 if ( handler.handler ) { 7947 handleObjIn = handler; 7948 handler = handleObjIn.handler; 7949 selector = handleObjIn.selector; 7950 } 7951 7952 // Ensure that invalid selectors throw exceptions at attach time 7953 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 7954 if ( selector ) { 7955 jQuery.find.matchesSelector( documentElement, selector ); 7956 } 7957 7958 // Make sure that the handler has a unique ID, used to find/remove it later 7959 if ( !handler.guid ) { 7960 handler.guid = jQuery.guid++; 7961 } 7962 7963 // Init the element's event structure and main handler, if this is the first 7964 if ( !( events = elemData.events ) ) { 7965 events = elemData.events = Object.create( null ); 7966 } 7967 if ( !( eventHandle = elemData.handle ) ) { 7968 eventHandle = elemData.handle = function( e ) { 7969 7970 // Discard the second event of a jQuery.event.trigger() and 7971 // when an event is called after a page has unloaded 7972 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 7973 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 7974 }; 7975 } 7976 7977 // Handle multiple events separated by a space 7978 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 7979 t = types.length; 7980 while ( t-- ) { 7981 tmp = rtypenamespace.exec( types[ t ] ) || []; 7982 type = origType = tmp[ 1 ]; 7983 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 7984 7985 // There *must* be a type, no attaching namespace-only handlers 7986 if ( !type ) { 7987 continue; 7988 } 7989 7990 // If event changes its type, use the special event handlers for the changed type 7991 special = jQuery.event.special[ type ] || {}; 7992 7993 // If selector defined, determine special event api type, otherwise given type 7994 type = ( selector ? special.delegateType : special.bindType ) || type; 7995 7996 // Update special based on newly reset type 7997 special = jQuery.event.special[ type ] || {}; 7998 7999 // handleObj is passed to all event handlers 8000 handleObj = jQuery.extend( { 8001 type: type, 8002 origType: origType, 8003 data: data, 8004 handler: handler, 8005 guid: handler.guid, 8006 selector: selector, 8007 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 8008 namespace: namespaces.join( "." ) 8009 }, handleObjIn ); 8010 8011 // Init the event handler queue if we're the first 8012 if ( !( handlers = events[ type ] ) ) { 8013 handlers = events[ type ] = []; 8014 handlers.delegateCount = 0; 8015 8016 // Only use addEventListener if the special events handler returns false 8017 if ( !special.setup || 8018 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 8019 8020 if ( elem.addEventListener ) { 8021 elem.addEventListener( type, eventHandle ); 8022 } 8023 } 8024 } 8025 8026 if ( special.add ) { 8027 special.add.call( elem, handleObj ); 8028 8029 if ( !handleObj.handler.guid ) { 8030 handleObj.handler.guid = handler.guid; 8031 } 8032 } 8033 8034 // Add to the element's handler list, delegates in front 8035 if ( selector ) { 8036 handlers.splice( handlers.delegateCount++, 0, handleObj ); 8037 } else { 8038 handlers.push( handleObj ); 8039 } 8040 8041 // Keep track of which events have ever been used, for event optimization 8042 jQuery.event.global[ type ] = true; 8043 } 8044 8045 }, 8046 8047 // Detach an event or set of events from an element 8048 remove: function( elem, types, handler, selector, mappedTypes ) { 8049 8050 var j, origCount, tmp, 8051 events, t, handleObj, 8052 special, handlers, type, namespaces, origType, 8053 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 8054 8055 if ( !elemData || !( events = elemData.events ) ) { 8056 return; 8057 } 8058 8059 // Once for each type.namespace in types; type may be omitted 8060 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 8061 t = types.length; 8062 while ( t-- ) { 8063 tmp = rtypenamespace.exec( types[ t ] ) || []; 8064 type = origType = tmp[ 1 ]; 8065 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 8066 8067 // Unbind all events (on this namespace, if provided) for the element 8068 if ( !type ) { 8069 for ( type in events ) { 8070 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 8071 } 8072 continue; 8073 } 8074 8075 special = jQuery.event.special[ type ] || {}; 8076 type = ( selector ? special.delegateType : special.bindType ) || type; 8077 handlers = events[ type ] || []; 8078 tmp = tmp[ 2 ] && 8079 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 8080 8081 // Remove matching events 8082 origCount = j = handlers.length; 8083 while ( j-- ) { 8084 handleObj = handlers[ j ]; 8085 8086 if ( ( mappedTypes || origType === handleObj.origType ) && 8087 ( !handler || handler.guid === handleObj.guid ) && 8088 ( !tmp || tmp.test( handleObj.namespace ) ) && 8089 ( !selector || selector === handleObj.selector || 8090 selector === "**" && handleObj.selector ) ) { 8091 handlers.splice( j, 1 ); 8092 8093 if ( handleObj.selector ) { 8094 handlers.delegateCount--; 8095 } 8096 if ( special.remove ) { 8097 special.remove.call( elem, handleObj ); 8098 } 8099 } 8100 } 8101 8102 // Remove generic event handler if we removed something and no more handlers exist 8103 // (avoids potential for endless recursion during removal of special event handlers) 8104 if ( origCount && !handlers.length ) { 8105 if ( !special.teardown || 8106 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 8107 8108 jQuery.removeEvent( elem, type, elemData.handle ); 8109 } 8110 8111 delete events[ type ]; 8112 } 8113 } 8114 8115 // Remove data and the expando if it's no longer used 8116 if ( jQuery.isEmptyObject( events ) ) { 8117 dataPriv.remove( elem, "handle events" ); 8118 } 8119 }, 8120 8121 dispatch: function( nativeEvent ) { 8122 8123 var i, j, ret, matched, handleObj, handlerQueue, 8124 args = new Array( arguments.length ), 8125 8126 // Make a writable jQuery.Event from the native event object 8127 event = jQuery.event.fix( nativeEvent ), 8128 8129 handlers = ( 8130 dataPriv.get( this, "events" ) || Object.create( null ) 8131 )[ event.type ] || [], 8132 special = jQuery.event.special[ event.type ] || {}; 8133 8134 // Use the fix-ed jQuery.Event rather than the (read-only) native event 8135 args[ 0 ] = event; 8136 8137 for ( i = 1; i < arguments.length; i++ ) { 8138 args[ i ] = arguments[ i ]; 8139 } 8140 8141 event.delegateTarget = this; 8142 8143 // Call the preDispatch hook for the mapped type, and let it bail if desired 8144 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 8145 return; 8146 } 8147 8148 // Determine handlers 8149 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 8150 8151 // Run delegates first; they may want to stop propagation beneath us 8152 i = 0; 8153 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 8154 event.currentTarget = matched.elem; 8155 8156 j = 0; 8157 while ( ( handleObj = matched.handlers[ j++ ] ) && 8158 !event.isImmediatePropagationStopped() ) { 8159 8160 // If the event is namespaced, then each handler is only invoked if it is 8161 // specially universal or its namespaces are a superset of the event's. 8162 if ( !event.rnamespace || handleObj.namespace === false || 8163 event.rnamespace.test( handleObj.namespace ) ) { 8164 8165 event.handleObj = handleObj; 8166 event.data = handleObj.data; 8167 8168 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 8169 handleObj.handler ).apply( matched.elem, args ); 8170 8171 if ( ret !== undefined ) { 8172 if ( ( event.result = ret ) === false ) { 8173 event.preventDefault(); 8174 event.stopPropagation(); 8175 } 8176 } 8177 } 8178 } 8179 } 8180 8181 // Call the postDispatch hook for the mapped type 8182 if ( special.postDispatch ) { 8183 special.postDispatch.call( this, event ); 8184 } 8185 8186 return event.result; 8187 }, 8188 8189 handlers: function( event, handlers ) { 8190 var i, handleObj, sel, matchedHandlers, matchedSelectors, 8191 handlerQueue = [], 8192 delegateCount = handlers.delegateCount, 8193 cur = event.target; 8194 8195 // Find delegate handlers 8196 if ( delegateCount && 8197 8198 // Support: IE <=9 8199 // Black-hole SVG <use> instance trees (trac-13180) 8200 cur.nodeType && 8201 8202 // Support: Firefox <=42 8203 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 8204 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 8205 // Support: IE 11 only 8206 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 8207 !( event.type === "click" && event.button >= 1 ) ) { 8208 8209 for ( ; cur !== this; cur = cur.parentNode || this ) { 8210 8211 // Don't check non-elements (trac-13208) 8212 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 8213 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 8214 matchedHandlers = []; 8215 matchedSelectors = {}; 8216 for ( i = 0; i < delegateCount; i++ ) { 8217 handleObj = handlers[ i ]; 8218 8219 // Don't conflict with Object.prototype properties (trac-13203) 8220 sel = handleObj.selector + " "; 8221 8222 if ( matchedSelectors[ sel ] === undefined ) { 8223 matchedSelectors[ sel ] = handleObj.needsContext ? 8224 jQuery( sel, this ).index( cur ) > -1 : 8225 jQuery.find( sel, this, null, [ cur ] ).length; 8226 } 8227 if ( matchedSelectors[ sel ] ) { 8228 matchedHandlers.push( handleObj ); 8229 } 8230 } 8231 if ( matchedHandlers.length ) { 8232 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 8233 } 8234 } 8235 } 8236 } 8237 8238 // Add the remaining (directly-bound) handlers 8239 cur = this; 8240 if ( delegateCount < handlers.length ) { 8241 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 8242 } 8243 8244 return handlerQueue; 8245 }, 8246 8247 addProp: function( name, hook ) { 8248 Object.defineProperty( jQuery.Event.prototype, name, { 8249 enumerable: true, 8250 configurable: true, 8251 8252 get: isFunction( hook ) ? 8253 function() { 8254 if ( this.originalEvent ) { 8255 return hook( this.originalEvent ); 8256 } 8257 } : 8258 function() { 8259 if ( this.originalEvent ) { 8260 return this.originalEvent[ name ]; 8261 } 8262 }, 8263 8264 set: function( value ) { 8265 Object.defineProperty( this, name, { 8266 enumerable: true, 8267 configurable: true, 8268 writable: true, 8269 value: value 8270 } ); 8271 } 8272 } ); 8273 }, 8274 8275 fix: function( originalEvent ) { 8276 return originalEvent[ jQuery.expando ] ? 8277 originalEvent : 8278 new jQuery.Event( originalEvent ); 8279 }, 8280 8281 special: { 8282 load: { 8283 8284 // Prevent triggered image.load events from bubbling to window.load 8285 noBubble: true 8286 }, 8287 click: { 8288 8289 // Utilize native event to ensure correct state for checkable inputs 8290 setup: function( data ) { 8291 8292 // For mutual compressibility with _default, replace `this` access with a local var. 8293 // `|| data` is dead code meant only to preserve the variable through minification. 8294 var el = this || data; 8295 8296 // Claim the first handler 8297 if ( rcheckableType.test( el.type ) && 8298 el.click && nodeName( el, "input" ) ) { 8299 8300 // dataPriv.set( el, "click", ... ) 8301 leverageNative( el, "click", true ); 8302 } 8303 8304 // Return false to allow normal processing in the caller 8305 return false; 8306 }, 8307 trigger: function( data ) { 8308 8309 // For mutual compressibility with _default, replace `this` access with a local var. 8310 // `|| data` is dead code meant only to preserve the variable through minification. 8311 var el = this || data; 8312 8313 // Force setup before triggering a click 8314 if ( rcheckableType.test( el.type ) && 8315 el.click && nodeName( el, "input" ) ) { 8316 8317 leverageNative( el, "click" ); 8318 } 8319 8320 // Return non-false to allow normal event-path propagation 8321 return true; 8322 }, 8323 8324 // For cross-browser consistency, suppress native .click() on links 8325 // Also prevent it if we're currently inside a leveraged native-event stack 8326 _default: function( event ) { 8327 var target = event.target; 8328 return rcheckableType.test( target.type ) && 8329 target.click && nodeName( target, "input" ) && 8330 dataPriv.get( target, "click" ) || 8331 nodeName( target, "a" ); 8332 } 8333 }, 8334 8335 beforeunload: { 8336 postDispatch: function( event ) { 8337 8338 // Support: Firefox 20+ 8339 // Firefox doesn't alert if the returnValue field is not set. 8340 if ( event.result !== undefined && event.originalEvent ) { 8341 event.originalEvent.returnValue = event.result; 8342 } 8343 } 8344 } 8345 } 8346}; 8347 8348// Ensure the presence of an event listener that handles manually-triggered 8349// synthetic events by interrupting progress until reinvoked in response to 8350// *native* events that it fires directly, ensuring that state changes have 8351// already occurred before other listeners are invoked. 8352function leverageNative( el, type, isSetup ) { 8353 8354 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 8355 if ( !isSetup ) { 8356 if ( dataPriv.get( el, type ) === undefined ) { 8357 jQuery.event.add( el, type, returnTrue ); 8358 } 8359 return; 8360 } 8361 8362 // Register the controller as a special universal handler for all event namespaces 8363 dataPriv.set( el, type, false ); 8364 jQuery.event.add( el, type, { 8365 namespace: false, 8366 handler: function( event ) { 8367 var result, 8368 saved = dataPriv.get( this, type ); 8369 8370 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 8371 8372 // Interrupt processing of the outer synthetic .trigger()ed event 8373 if ( !saved ) { 8374 8375 // Store arguments for use when handling the inner native event 8376 // There will always be at least one argument (an event object), so this array 8377 // will not be confused with a leftover capture object. 8378 saved = slice.call( arguments ); 8379 dataPriv.set( this, type, saved ); 8380 8381 // Trigger the native event and capture its result 8382 this[ type ](); 8383 result = dataPriv.get( this, type ); 8384 dataPriv.set( this, type, false ); 8385 8386 if ( saved !== result ) { 8387 8388 // Cancel the outer synthetic event 8389 event.stopImmediatePropagation(); 8390 event.preventDefault(); 8391 8392 return result; 8393 } 8394 8395 // If this is an inner synthetic event for an event with a bubbling surrogate 8396 // (focus or blur), assume that the surrogate already propagated from triggering 8397 // the native event and prevent that from happening again here. 8398 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 8399 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 8400 // less bad than duplication. 8401 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 8402 event.stopPropagation(); 8403 } 8404 8405 // If this is a native event triggered above, everything is now in order 8406 // Fire an inner synthetic event with the original arguments 8407 } else if ( saved ) { 8408 8409 // ...and capture the result 8410 dataPriv.set( this, type, jQuery.event.trigger( 8411 saved[ 0 ], 8412 saved.slice( 1 ), 8413 this 8414 ) ); 8415 8416 // Abort handling of the native event by all jQuery handlers while allowing 8417 // native handlers on the same element to run. On target, this is achieved 8418 // by stopping immediate propagation just on the jQuery event. However, 8419 // the native event is re-wrapped by a jQuery one on each level of the 8420 // propagation so the only way to stop it for jQuery is to stop it for 8421 // everyone via native `stopPropagation()`. This is not a problem for 8422 // focus/blur which don't bubble, but it does also stop click on checkboxes 8423 // and radios. We accept this limitation. 8424 event.stopPropagation(); 8425 event.isImmediatePropagationStopped = returnTrue; 8426 } 8427 } 8428 } ); 8429} 8430 8431jQuery.removeEvent = function( elem, type, handle ) { 8432 8433 // This "if" is needed for plain objects 8434 if ( elem.removeEventListener ) { 8435 elem.removeEventListener( type, handle ); 8436 } 8437}; 8438 8439jQuery.Event = function( src, props ) { 8440 8441 // Allow instantiation without the 'new' keyword 8442 if ( !( this instanceof jQuery.Event ) ) { 8443 return new jQuery.Event( src, props ); 8444 } 8445 8446 // Event object 8447 if ( src && src.type ) { 8448 this.originalEvent = src; 8449 this.type = src.type; 8450 8451 // Events bubbling up the document may have been marked as prevented 8452 // by a handler lower down the tree; reflect the correct value. 8453 this.isDefaultPrevented = src.defaultPrevented || 8454 src.defaultPrevented === undefined && 8455 8456 // Support: Android <=2.3 only 8457 src.returnValue === false ? 8458 returnTrue : 8459 returnFalse; 8460 8461 // Create target properties 8462 // Support: Safari <=6 - 7 only 8463 // Target should not be a text node (trac-504, trac-13143) 8464 this.target = ( src.target && src.target.nodeType === 3 ) ? 8465 src.target.parentNode : 8466 src.target; 8467 8468 this.currentTarget = src.currentTarget; 8469 this.relatedTarget = src.relatedTarget; 8470 8471 // Event type 8472 } else { 8473 this.type = src; 8474 } 8475 8476 // Put explicitly provided properties onto the event object 8477 if ( props ) { 8478 jQuery.extend( this, props ); 8479 } 8480 8481 // Create a timestamp if incoming event doesn't have one 8482 this.timeStamp = src && src.timeStamp || Date.now(); 8483 8484 // Mark it as fixed 8485 this[ jQuery.expando ] = true; 8486}; 8487 8488// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 8489// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 8490jQuery.Event.prototype = { 8491 constructor: jQuery.Event, 8492 isDefaultPrevented: returnFalse, 8493 isPropagationStopped: returnFalse, 8494 isImmediatePropagationStopped: returnFalse, 8495 isSimulated: false, 8496 8497 preventDefault: function() { 8498 var e = this.originalEvent; 8499 8500 this.isDefaultPrevented = returnTrue; 8501 8502 if ( e && !this.isSimulated ) { 8503 e.preventDefault(); 8504 } 8505 }, 8506 stopPropagation: function() { 8507 var e = this.originalEvent; 8508 8509 this.isPropagationStopped = returnTrue; 8510 8511 if ( e && !this.isSimulated ) { 8512 e.stopPropagation(); 8513 } 8514 }, 8515 stopImmediatePropagation: function() { 8516 var e = this.originalEvent; 8517 8518 this.isImmediatePropagationStopped = returnTrue; 8519 8520 if ( e && !this.isSimulated ) { 8521 e.stopImmediatePropagation(); 8522 } 8523 8524 this.stopPropagation(); 8525 } 8526}; 8527 8528// Includes all common event props including KeyEvent and MouseEvent specific props 8529jQuery.each( { 8530 altKey: true, 8531 bubbles: true, 8532 cancelable: true, 8533 changedTouches: true, 8534 ctrlKey: true, 8535 detail: true, 8536 eventPhase: true, 8537 metaKey: true, 8538 pageX: true, 8539 pageY: true, 8540 shiftKey: true, 8541 view: true, 8542 "char": true, 8543 code: true, 8544 charCode: true, 8545 key: true, 8546 keyCode: true, 8547 button: true, 8548 buttons: true, 8549 clientX: true, 8550 clientY: true, 8551 offsetX: true, 8552 offsetY: true, 8553 pointerId: true, 8554 pointerType: true, 8555 screenX: true, 8556 screenY: true, 8557 targetTouches: true, 8558 toElement: true, 8559 touches: true, 8560 which: true 8561}, jQuery.event.addProp ); 8562 8563jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 8564 8565 function focusMappedHandler( nativeEvent ) { 8566 if ( document.documentMode ) { 8567 8568 // Support: IE 11+ 8569 // Attach a single focusin/focusout handler on the document while someone wants 8570 // focus/blur. This is because the former are synchronous in IE while the latter 8571 // are async. In other browsers, all those handlers are invoked synchronously. 8572 8573 // `handle` from private data would already wrap the event, but we need 8574 // to change the `type` here. 8575 var handle = dataPriv.get( this, "handle" ), 8576 event = jQuery.event.fix( nativeEvent ); 8577 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 8578 event.isSimulated = true; 8579 8580 // First, handle focusin/focusout 8581 handle( nativeEvent ); 8582 8583 // ...then, handle focus/blur 8584 // 8585 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 8586 // invoking the handler at the lower level. 8587 if ( event.target === event.currentTarget ) { 8588 8589 // The setup part calls `leverageNative`, which, in turn, calls 8590 // `jQuery.event.add`, so event handle will already have been set 8591 // by this point. 8592 handle( event ); 8593 } 8594 } else { 8595 8596 // For non-IE browsers, attach a single capturing handler on the document 8597 // while someone wants focusin/focusout. 8598 jQuery.event.simulate( delegateType, nativeEvent.target, 8599 jQuery.event.fix( nativeEvent ) ); 8600 } 8601 } 8602 8603 jQuery.event.special[ type ] = { 8604 8605 // Utilize native event if possible so blur/focus sequence is correct 8606 setup: function() { 8607 8608 var attaches; 8609 8610 // Claim the first handler 8611 // dataPriv.set( this, "focus", ... ) 8612 // dataPriv.set( this, "blur", ... ) 8613 leverageNative( this, type, true ); 8614 8615 if ( document.documentMode ) { 8616 8617 // Support: IE 9 - 11+ 8618 // We use the same native handler for focusin & focus (and focusout & blur) 8619 // so we need to coordinate setup & teardown parts between those events. 8620 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 8621 attaches = dataPriv.get( this, delegateType ); 8622 if ( !attaches ) { 8623 this.addEventListener( delegateType, focusMappedHandler ); 8624 } 8625 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 8626 } else { 8627 8628 // Return false to allow normal processing in the caller 8629 return false; 8630 } 8631 }, 8632 trigger: function() { 8633 8634 // Force setup before trigger 8635 leverageNative( this, type ); 8636 8637 // Return non-false to allow normal event-path propagation 8638 return true; 8639 }, 8640 8641 teardown: function() { 8642 var attaches; 8643 8644 if ( document.documentMode ) { 8645 attaches = dataPriv.get( this, delegateType ) - 1; 8646 if ( !attaches ) { 8647 this.removeEventListener( delegateType, focusMappedHandler ); 8648 dataPriv.remove( this, delegateType ); 8649 } else { 8650 dataPriv.set( this, delegateType, attaches ); 8651 } 8652 } else { 8653 8654 // Return false to indicate standard teardown should be applied 8655 return false; 8656 } 8657 }, 8658 8659 // Suppress native focus or blur if we're currently inside 8660 // a leveraged native-event stack 8661 _default: function( event ) { 8662 return dataPriv.get( event.target, type ); 8663 }, 8664 8665 delegateType: delegateType 8666 }; 8667 8668 // Support: Firefox <=44 8669 // Firefox doesn't have focus(in | out) events 8670 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 8671 // 8672 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 8673 // focus(in | out) events fire after focus & blur events, 8674 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 8675 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 8676 // 8677 // Support: IE 9 - 11+ 8678 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 8679 // attach a single handler for both events in IE. 8680 jQuery.event.special[ delegateType ] = { 8681 setup: function() { 8682 8683 // Handle: regular nodes (via `this.ownerDocument`), window 8684 // (via `this.document`) & document (via `this`). 8685 var doc = this.ownerDocument || this.document || this, 8686 dataHolder = document.documentMode ? this : doc, 8687 attaches = dataPriv.get( dataHolder, delegateType ); 8688 8689 // Support: IE 9 - 11+ 8690 // We use the same native handler for focusin & focus (and focusout & blur) 8691 // so we need to coordinate setup & teardown parts between those events. 8692 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 8693 if ( !attaches ) { 8694 if ( document.documentMode ) { 8695 this.addEventListener( delegateType, focusMappedHandler ); 8696 } else { 8697 doc.addEventListener( type, focusMappedHandler, true ); 8698 } 8699 } 8700 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 8701 }, 8702 teardown: function() { 8703 var doc = this.ownerDocument || this.document || this, 8704 dataHolder = document.documentMode ? this : doc, 8705 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 8706 8707 if ( !attaches ) { 8708 if ( document.documentMode ) { 8709 this.removeEventListener( delegateType, focusMappedHandler ); 8710 } else { 8711 doc.removeEventListener( type, focusMappedHandler, true ); 8712 } 8713 dataPriv.remove( dataHolder, delegateType ); 8714 } else { 8715 dataPriv.set( dataHolder, delegateType, attaches ); 8716 } 8717 } 8718 }; 8719} ); 8720 8721// Create mouseenter/leave events using mouseover/out and event-time checks 8722// so that event delegation works in jQuery. 8723// Do the same for pointerenter/pointerleave and pointerover/pointerout 8724// 8725// Support: Safari 7 only 8726// Safari sends mouseenter too often; see: 8727// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 8728// for the description of the bug (it existed in older Chrome versions as well). 8729jQuery.each( { 8730 mouseenter: "mouseover", 8731 mouseleave: "mouseout", 8732 pointerenter: "pointerover", 8733 pointerleave: "pointerout" 8734}, function( orig, fix ) { 8735 jQuery.event.special[ orig ] = { 8736 delegateType: fix, 8737 bindType: fix, 8738 8739 handle: function( event ) { 8740 var ret, 8741 target = this, 8742 related = event.relatedTarget, 8743 handleObj = event.handleObj; 8744 8745 // For mouseenter/leave call the handler if related is outside the target. 8746 // NB: No relatedTarget if the mouse left/entered the browser window 8747 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 8748 event.type = handleObj.origType; 8749 ret = handleObj.handler.apply( this, arguments ); 8750 event.type = fix; 8751 } 8752 return ret; 8753 } 8754 }; 8755} ); 8756 8757jQuery.fn.extend( { 8758 8759 on: function( types, selector, data, fn ) { 8760 return on( this, types, selector, data, fn ); 8761 }, 8762 one: function( types, selector, data, fn ) { 8763 return on( this, types, selector, data, fn, 1 ); 8764 }, 8765 off: function( types, selector, fn ) { 8766 var handleObj, type; 8767 if ( types && types.preventDefault && types.handleObj ) { 8768 8769 // ( event ) dispatched jQuery.Event 8770 handleObj = types.handleObj; 8771 jQuery( types.delegateTarget ).off( 8772 handleObj.namespace ? 8773 handleObj.origType + "." + handleObj.namespace : 8774 handleObj.origType, 8775 handleObj.selector, 8776 handleObj.handler 8777 ); 8778 return this; 8779 } 8780 if ( typeof types === "object" ) { 8781 8782 // ( types-object [, selector] ) 8783 for ( type in types ) { 8784 this.off( type, selector, types[ type ] ); 8785 } 8786 return this; 8787 } 8788 if ( selector === false || typeof selector === "function" ) { 8789 8790 // ( types [, fn] ) 8791 fn = selector; 8792 selector = undefined; 8793 } 8794 if ( fn === false ) { 8795 fn = returnFalse; 8796 } 8797 return this.each( function() { 8798 jQuery.event.remove( this, types, fn, selector ); 8799 } ); 8800 } 8801} ); 8802 8803 8804var 8805 8806 // Support: IE <=10 - 11, Edge 12 - 13 only 8807 // In IE/Edge using regex groups here causes severe slowdowns. 8808 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 8809 rnoInnerhtml = /<script|<style|<link/i, 8810 8811 // checked="checked" or checked 8812 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 8813 8814 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 8815 8816// Prefer a tbody over its parent table for containing new rows 8817function manipulationTarget( elem, content ) { 8818 if ( nodeName( elem, "table" ) && 8819 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 8820 8821 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 8822 } 8823 8824 return elem; 8825} 8826 8827// Replace/restore the type attribute of script elements for safe DOM manipulation 8828function disableScript( elem ) { 8829 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 8830 return elem; 8831} 8832function restoreScript( elem ) { 8833 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 8834 elem.type = elem.type.slice( 5 ); 8835 } else { 8836 elem.removeAttribute( "type" ); 8837 } 8838 8839 return elem; 8840} 8841 8842function cloneCopyEvent( src, dest ) { 8843 var i, l, type, pdataOld, udataOld, udataCur, events; 8844 8845 if ( dest.nodeType !== 1 ) { 8846 return; 8847 } 8848 8849 // 1. Copy private data: events, handlers, etc. 8850 if ( dataPriv.hasData( src ) ) { 8851 pdataOld = dataPriv.get( src ); 8852 events = pdataOld.events; 8853 8854 if ( events ) { 8855 dataPriv.remove( dest, "handle events" ); 8856 8857 for ( type in events ) { 8858 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 8859 jQuery.event.add( dest, type, events[ type ][ i ] ); 8860 } 8861 } 8862 } 8863 } 8864 8865 // 2. Copy user data 8866 if ( dataUser.hasData( src ) ) { 8867 udataOld = dataUser.access( src ); 8868 udataCur = jQuery.extend( {}, udataOld ); 8869 8870 dataUser.set( dest, udataCur ); 8871 } 8872} 8873 8874// Fix IE bugs, see support tests 8875function fixInput( src, dest ) { 8876 var nodeName = dest.nodeName.toLowerCase(); 8877 8878 // Fails to persist the checked state of a cloned checkbox or radio button. 8879 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 8880 dest.checked = src.checked; 8881 8882 // Fails to return the selected option to the default selected state when cloning options 8883 } else if ( nodeName === "input" || nodeName === "textarea" ) { 8884 dest.defaultValue = src.defaultValue; 8885 } 8886} 8887 8888function domManip( collection, args, callback, ignored ) { 8889 8890 // Flatten any nested arrays 8891 args = flat( args ); 8892 8893 var fragment, first, scripts, hasScripts, node, doc, 8894 i = 0, 8895 l = collection.length, 8896 iNoClone = l - 1, 8897 value = args[ 0 ], 8898 valueIsFunction = isFunction( value ); 8899 8900 // We can't cloneNode fragments that contain checked, in WebKit 8901 if ( valueIsFunction || 8902 ( l > 1 && typeof value === "string" && 8903 !support.checkClone && rchecked.test( value ) ) ) { 8904 return collection.each( function( index ) { 8905 var self = collection.eq( index ); 8906 if ( valueIsFunction ) { 8907 args[ 0 ] = value.call( this, index, self.html() ); 8908 } 8909 domManip( self, args, callback, ignored ); 8910 } ); 8911 } 8912 8913 if ( l ) { 8914 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 8915 first = fragment.firstChild; 8916 8917 if ( fragment.childNodes.length === 1 ) { 8918 fragment = first; 8919 } 8920 8921 // Require either new content or an interest in ignored elements to invoke the callback 8922 if ( first || ignored ) { 8923 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 8924 hasScripts = scripts.length; 8925 8926 // Use the original fragment for the last item 8927 // instead of the first because it can end up 8928 // being emptied incorrectly in certain situations (trac-8070). 8929 for ( ; i < l; i++ ) { 8930 node = fragment; 8931 8932 if ( i !== iNoClone ) { 8933 node = jQuery.clone( node, true, true ); 8934 8935 // Keep references to cloned scripts for later restoration 8936 if ( hasScripts ) { 8937 8938 // Support: Android <=4.0 only, PhantomJS 1 only 8939 // push.apply(_, arraylike) throws on ancient WebKit 8940 jQuery.merge( scripts, getAll( node, "script" ) ); 8941 } 8942 } 8943 8944 callback.call( collection[ i ], node, i ); 8945 } 8946 8947 if ( hasScripts ) { 8948 doc = scripts[ scripts.length - 1 ].ownerDocument; 8949 8950 // Re-enable scripts 8951 jQuery.map( scripts, restoreScript ); 8952 8953 // Evaluate executable scripts on first document insertion 8954 for ( i = 0; i < hasScripts; i++ ) { 8955 node = scripts[ i ]; 8956 if ( rscriptType.test( node.type || "" ) && 8957 !dataPriv.access( node, "globalEval" ) && 8958 jQuery.contains( doc, node ) ) { 8959 8960 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 8961 8962 // Optional AJAX dependency, but won't run scripts if not present 8963 if ( jQuery._evalUrl && !node.noModule ) { 8964 jQuery._evalUrl( node.src, { 8965 nonce: node.nonce || node.getAttribute( "nonce" ) 8966 }, doc ); 8967 } 8968 } else { 8969 8970 // Unwrap a CDATA section containing script contents. This shouldn't be 8971 // needed as in XML documents they're already not visible when 8972 // inspecting element contents and in HTML documents they have no 8973 // meaning but we're preserving that logic for backwards compatibility. 8974 // This will be removed completely in 4.0. See gh-4904. 8975 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 8976 } 8977 } 8978 } 8979 } 8980 } 8981 } 8982 8983 return collection; 8984} 8985 8986function remove( elem, selector, keepData ) { 8987 var node, 8988 nodes = selector ? jQuery.filter( selector, elem ) : elem, 8989 i = 0; 8990 8991 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 8992 if ( !keepData && node.nodeType === 1 ) { 8993 jQuery.cleanData( getAll( node ) ); 8994 } 8995 8996 if ( node.parentNode ) { 8997 if ( keepData && isAttached( node ) ) { 8998 setGlobalEval( getAll( node, "script" ) ); 8999 } 9000 node.parentNode.removeChild( node ); 9001 } 9002 } 9003 9004 return elem; 9005} 9006 9007jQuery.extend( { 9008 htmlPrefilter: function( html ) { 9009 return html; 9010 }, 9011 9012 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 9013 var i, l, srcElements, destElements, 9014 clone = elem.cloneNode( true ), 9015 inPage = isAttached( elem ); 9016 9017 // Fix IE cloning issues 9018 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 9019 !jQuery.isXMLDoc( elem ) ) { 9020 9021 // We eschew jQuery#find here for performance reasons: 9022 // https://jsperf.com/getall-vs-sizzle/2 9023 destElements = getAll( clone ); 9024 srcElements = getAll( elem ); 9025 9026 for ( i = 0, l = srcElements.length; i < l; i++ ) { 9027 fixInput( srcElements[ i ], destElements[ i ] ); 9028 } 9029 } 9030 9031 // Copy the events from the original to the clone 9032 if ( dataAndEvents ) { 9033 if ( deepDataAndEvents ) { 9034 srcElements = srcElements || getAll( elem ); 9035 destElements = destElements || getAll( clone ); 9036 9037 for ( i = 0, l = srcElements.length; i < l; i++ ) { 9038 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 9039 } 9040 } else { 9041 cloneCopyEvent( elem, clone ); 9042 } 9043 } 9044 9045 // Preserve script evaluation history 9046 destElements = getAll( clone, "script" ); 9047 if ( destElements.length > 0 ) { 9048 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 9049 } 9050 9051 // Return the cloned set 9052 return clone; 9053 }, 9054 9055 cleanData: function( elems ) { 9056 var data, elem, type, 9057 special = jQuery.event.special, 9058 i = 0; 9059 9060 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 9061 if ( acceptData( elem ) ) { 9062 if ( ( data = elem[ dataPriv.expando ] ) ) { 9063 if ( data.events ) { 9064 for ( type in data.events ) { 9065 if ( special[ type ] ) { 9066 jQuery.event.remove( elem, type ); 9067 9068 // This is a shortcut to avoid jQuery.event.remove's overhead 9069 } else { 9070 jQuery.removeEvent( elem, type, data.handle ); 9071 } 9072 } 9073 } 9074 9075 // Support: Chrome <=35 - 45+ 9076 // Assign undefined instead of using delete, see Data#remove 9077 elem[ dataPriv.expando ] = undefined; 9078 } 9079 if ( elem[ dataUser.expando ] ) { 9080 9081 // Support: Chrome <=35 - 45+ 9082 // Assign undefined instead of using delete, see Data#remove 9083 elem[ dataUser.expando ] = undefined; 9084 } 9085 } 9086 } 9087 } 9088} ); 9089 9090jQuery.fn.extend( { 9091 detach: function( selector ) { 9092 return remove( this, selector, true ); 9093 }, 9094 9095 remove: function( selector ) { 9096 return remove( this, selector ); 9097 }, 9098 9099 text: function( value ) { 9100 return access( this, function( value ) { 9101 return value === undefined ? 9102 jQuery.text( this ) : 9103 this.empty().each( function() { 9104 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 9105 this.textContent = value; 9106 } 9107 } ); 9108 }, null, value, arguments.length ); 9109 }, 9110 9111 append: function() { 9112 return domManip( this, arguments, function( elem ) { 9113 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 9114 var target = manipulationTarget( this, elem ); 9115 target.appendChild( elem ); 9116 } 9117 } ); 9118 }, 9119 9120 prepend: function() { 9121 return domManip( this, arguments, function( elem ) { 9122 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 9123 var target = manipulationTarget( this, elem ); 9124 target.insertBefore( elem, target.firstChild ); 9125 } 9126 } ); 9127 }, 9128 9129 before: function() { 9130 return domManip( this, arguments, function( elem ) { 9131 if ( this.parentNode ) { 9132 this.parentNode.insertBefore( elem, this ); 9133 } 9134 } ); 9135 }, 9136 9137 after: function() { 9138 return domManip( this, arguments, function( elem ) { 9139 if ( this.parentNode ) { 9140 this.parentNode.insertBefore( elem, this.nextSibling ); 9141 } 9142 } ); 9143 }, 9144 9145 empty: function() { 9146 var elem, 9147 i = 0; 9148 9149 for ( ; ( elem = this[ i ] ) != null; i++ ) { 9150 if ( elem.nodeType === 1 ) { 9151 9152 // Prevent memory leaks 9153 jQuery.cleanData( getAll( elem, false ) ); 9154 9155 // Remove any remaining nodes 9156 elem.textContent = ""; 9157 } 9158 } 9159 9160 return this; 9161 }, 9162 9163 clone: function( dataAndEvents, deepDataAndEvents ) { 9164 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 9165 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 9166 9167 return this.map( function() { 9168 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 9169 } ); 9170 }, 9171 9172 html: function( value ) { 9173 return access( this, function( value ) { 9174 var elem = this[ 0 ] || {}, 9175 i = 0, 9176 l = this.length; 9177 9178 if ( value === undefined && elem.nodeType === 1 ) { 9179 return elem.innerHTML; 9180 } 9181 9182 // See if we can take a shortcut and just use innerHTML 9183 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 9184 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 9185 9186 value = jQuery.htmlPrefilter( value ); 9187 9188 try { 9189 for ( ; i < l; i++ ) { 9190 elem = this[ i ] || {}; 9191 9192 // Remove element nodes and prevent memory leaks 9193 if ( elem.nodeType === 1 ) { 9194 jQuery.cleanData( getAll( elem, false ) ); 9195 elem.innerHTML = value; 9196 } 9197 } 9198 9199 elem = 0; 9200 9201 // If using innerHTML throws an exception, use the fallback method 9202 } catch ( e ) {} 9203 } 9204 9205 if ( elem ) { 9206 this.empty().append( value ); 9207 } 9208 }, null, value, arguments.length ); 9209 }, 9210 9211 replaceWith: function() { 9212 var ignored = []; 9213 9214 // Make the changes, replacing each non-ignored context element with the new content 9215 return domManip( this, arguments, function( elem ) { 9216 var parent = this.parentNode; 9217 9218 if ( jQuery.inArray( this, ignored ) < 0 ) { 9219 jQuery.cleanData( getAll( this ) ); 9220 if ( parent ) { 9221 parent.replaceChild( elem, this ); 9222 } 9223 } 9224 9225 // Force callback invocation 9226 }, ignored ); 9227 } 9228} ); 9229 9230jQuery.each( { 9231 appendTo: "append", 9232 prependTo: "prepend", 9233 insertBefore: "before", 9234 insertAfter: "after", 9235 replaceAll: "replaceWith" 9236}, function( name, original ) { 9237 jQuery.fn[ name ] = function( selector ) { 9238 var elems, 9239 ret = [], 9240 insert = jQuery( selector ), 9241 last = insert.length - 1, 9242 i = 0; 9243 9244 for ( ; i <= last; i++ ) { 9245 elems = i === last ? this : this.clone( true ); 9246 jQuery( insert[ i ] )[ original ]( elems ); 9247 9248 // Support: Android <=4.0 only, PhantomJS 1 only 9249 // .get() because push.apply(_, arraylike) throws on ancient WebKit 9250 push.apply( ret, elems.get() ); 9251 } 9252 9253 return this.pushStack( ret ); 9254 }; 9255} ); 9256var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 9257 9258var rcustomProp = /^--/; 9259 9260 9261var getStyles = function( elem ) { 9262 9263 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 9264 // IE throws on elements created in popups 9265 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 9266 var view = elem.ownerDocument.defaultView; 9267 9268 if ( !view || !view.opener ) { 9269 view = window; 9270 } 9271 9272 return view.getComputedStyle( elem ); 9273 }; 9274 9275var swap = function( elem, options, callback ) { 9276 var ret, name, 9277 old = {}; 9278 9279 // Remember the old values, and insert the new ones 9280 for ( name in options ) { 9281 old[ name ] = elem.style[ name ]; 9282 elem.style[ name ] = options[ name ]; 9283 } 9284 9285 ret = callback.call( elem ); 9286 9287 // Revert the old values 9288 for ( name in options ) { 9289 elem.style[ name ] = old[ name ]; 9290 } 9291 9292 return ret; 9293}; 9294 9295 9296var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 9297 9298 9299 9300( function() { 9301 9302 // Executing both pixelPosition & boxSizingReliable tests require only one layout 9303 // so they're executed at the same time to save the second computation. 9304 function computeStyleTests() { 9305 9306 // This is a singleton, we need to execute it only once 9307 if ( !div ) { 9308 return; 9309 } 9310 9311 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 9312 "margin-top:1px;padding:0;border:0"; 9313 div.style.cssText = 9314 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 9315 "margin:auto;border:1px;padding:1px;" + 9316 "width:60%;top:1%"; 9317 documentElement.appendChild( container ).appendChild( div ); 9318 9319 var divStyle = window.getComputedStyle( div ); 9320 pixelPositionVal = divStyle.top !== "1%"; 9321 9322 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 9323 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 9324 9325 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 9326 // Some styles come back with percentage values, even though they shouldn't 9327 div.style.right = "60%"; 9328 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 9329 9330 // Support: IE 9 - 11 only 9331 // Detect misreporting of content dimensions for box-sizing:border-box elements 9332 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 9333 9334 // Support: IE 9 only 9335 // Detect overflow:scroll screwiness (gh-3699) 9336 // Support: Chrome <=64 9337 // Don't get tricked when zoom affects offsetWidth (gh-4029) 9338 div.style.position = "absolute"; 9339 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 9340 9341 documentElement.removeChild( container ); 9342 9343 // Nullify the div so it wouldn't be stored in the memory and 9344 // it will also be a sign that checks already performed 9345 div = null; 9346 } 9347 9348 function roundPixelMeasures( measure ) { 9349 return Math.round( parseFloat( measure ) ); 9350 } 9351 9352 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 9353 reliableTrDimensionsVal, reliableMarginLeftVal, 9354 container = document.createElement( "div" ), 9355 div = document.createElement( "div" ); 9356 9357 // Finish early in limited (non-browser) environments 9358 if ( !div.style ) { 9359 return; 9360 } 9361 9362 // Support: IE <=9 - 11 only 9363 // Style of cloned element affects source element cloned (trac-8908) 9364 div.style.backgroundClip = "content-box"; 9365 div.cloneNode( true ).style.backgroundClip = ""; 9366 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 9367 9368 jQuery.extend( support, { 9369 boxSizingReliable: function() { 9370 computeStyleTests(); 9371 return boxSizingReliableVal; 9372 }, 9373 pixelBoxStyles: function() { 9374 computeStyleTests(); 9375 return pixelBoxStylesVal; 9376 }, 9377 pixelPosition: function() { 9378 computeStyleTests(); 9379 return pixelPositionVal; 9380 }, 9381 reliableMarginLeft: function() { 9382 computeStyleTests(); 9383 return reliableMarginLeftVal; 9384 }, 9385 scrollboxSize: function() { 9386 computeStyleTests(); 9387 return scrollboxSizeVal; 9388 }, 9389 9390 // Support: IE 9 - 11+, Edge 15 - 18+ 9391 // IE/Edge misreport `getComputedStyle` of table rows with width/height 9392 // set in CSS while `offset*` properties report correct values. 9393 // Behavior in IE 9 is more subtle than in newer versions & it passes 9394 // some versions of this test; make sure not to make it pass there! 9395 // 9396 // Support: Firefox 70+ 9397 // Only Firefox includes border widths 9398 // in computed dimensions. (gh-4529) 9399 reliableTrDimensions: function() { 9400 var table, tr, trChild, trStyle; 9401 if ( reliableTrDimensionsVal == null ) { 9402 table = document.createElement( "table" ); 9403 tr = document.createElement( "tr" ); 9404 trChild = document.createElement( "div" ); 9405 9406 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 9407 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 9408 9409 // Support: Chrome 86+ 9410 // Height set through cssText does not get applied. 9411 // Computed height then comes back as 0. 9412 tr.style.height = "1px"; 9413 trChild.style.height = "9px"; 9414 9415 // Support: Android 8 Chrome 86+ 9416 // In our bodyBackground.html iframe, 9417 // display for all div elements is set to "inline", 9418 // which causes a problem only in Android 8 Chrome 86. 9419 // Ensuring the div is `display: block` 9420 // gets around this issue. 9421 trChild.style.display = "block"; 9422 9423 documentElement 9424 .appendChild( table ) 9425 .appendChild( tr ) 9426 .appendChild( trChild ); 9427 9428 trStyle = window.getComputedStyle( tr ); 9429 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 9430 parseInt( trStyle.borderTopWidth, 10 ) + 9431 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 9432 9433 documentElement.removeChild( table ); 9434 } 9435 return reliableTrDimensionsVal; 9436 } 9437 } ); 9438} )(); 9439 9440 9441function curCSS( elem, name, computed ) { 9442 var width, minWidth, maxWidth, ret, 9443 isCustomProp = rcustomProp.test( name ), 9444 9445 // Support: Firefox 51+ 9446 // Retrieving style before computed somehow 9447 // fixes an issue with getting wrong values 9448 // on detached elements 9449 style = elem.style; 9450 9451 computed = computed || getStyles( elem ); 9452 9453 // getPropertyValue is needed for: 9454 // .css('filter') (IE 9 only, trac-12537) 9455 // .css('--customProperty) (gh-3144) 9456 if ( computed ) { 9457 9458 // Support: IE <=9 - 11+ 9459 // IE only supports `"float"` in `getPropertyValue`; in computed styles 9460 // it's only available as `"cssFloat"`. We no longer modify properties 9461 // sent to `.css()` apart from camelCasing, so we need to check both. 9462 // Normally, this would create difference in behavior: if 9463 // `getPropertyValue` returns an empty string, the value returned 9464 // by `.css()` would be `undefined`. This is usually the case for 9465 // disconnected elements. However, in IE even disconnected elements 9466 // with no styles return `"none"` for `getPropertyValue( "float" )` 9467 ret = computed.getPropertyValue( name ) || computed[ name ]; 9468 9469 if ( isCustomProp && ret ) { 9470 9471 // Support: Firefox 105+, Chrome <=105+ 9472 // Spec requires trimming whitespace for custom properties (gh-4926). 9473 // Firefox only trims leading whitespace. Chrome just collapses 9474 // both leading & trailing whitespace to a single space. 9475 // 9476 // Fall back to `undefined` if empty string returned. 9477 // This collapses a missing definition with property defined 9478 // and set to an empty string but there's no standard API 9479 // allowing us to differentiate them without a performance penalty 9480 // and returning `undefined` aligns with older jQuery. 9481 // 9482 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 9483 // as whitespace while CSS does not, but this is not a problem 9484 // because CSS preprocessing replaces them with U+000A LINE FEED 9485 // (which *is* CSS whitespace) 9486 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 9487 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 9488 } 9489 9490 if ( ret === "" && !isAttached( elem ) ) { 9491 ret = jQuery.style( elem, name ); 9492 } 9493 9494 // A tribute to the "awesome hack by Dean Edwards" 9495 // Android Browser returns percentage for some values, 9496 // but width seems to be reliably pixels. 9497 // This is against the CSSOM draft spec: 9498 // https://drafts.csswg.org/cssom/#resolved-values 9499 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 9500 9501 // Remember the original values 9502 width = style.width; 9503 minWidth = style.minWidth; 9504 maxWidth = style.maxWidth; 9505 9506 // Put in the new values to get a computed value out 9507 style.minWidth = style.maxWidth = style.width = ret; 9508 ret = computed.width; 9509 9510 // Revert the changed values 9511 style.width = width; 9512 style.minWidth = minWidth; 9513 style.maxWidth = maxWidth; 9514 } 9515 } 9516 9517 return ret !== undefined ? 9518 9519 // Support: IE <=9 - 11 only 9520 // IE returns zIndex value as an integer. 9521 ret + "" : 9522 ret; 9523} 9524 9525 9526function addGetHookIf( conditionFn, hookFn ) { 9527 9528 // Define the hook, we'll check on the first run if it's really needed. 9529 return { 9530 get: function() { 9531 if ( conditionFn() ) { 9532 9533 // Hook not needed (or it's not possible to use it due 9534 // to missing dependency), remove it. 9535 delete this.get; 9536 return; 9537 } 9538 9539 // Hook needed; redefine it so that the support test is not executed again. 9540 return ( this.get = hookFn ).apply( this, arguments ); 9541 } 9542 }; 9543} 9544 9545 9546var cssPrefixes = [ "Webkit", "Moz", "ms" ], 9547 emptyStyle = document.createElement( "div" ).style, 9548 vendorProps = {}; 9549 9550// Return a vendor-prefixed property or undefined 9551function vendorPropName( name ) { 9552 9553 // Check for vendor prefixed names 9554 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 9555 i = cssPrefixes.length; 9556 9557 while ( i-- ) { 9558 name = cssPrefixes[ i ] + capName; 9559 if ( name in emptyStyle ) { 9560 return name; 9561 } 9562 } 9563} 9564 9565// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 9566function finalPropName( name ) { 9567 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 9568 9569 if ( final ) { 9570 return final; 9571 } 9572 if ( name in emptyStyle ) { 9573 return name; 9574 } 9575 return vendorProps[ name ] = vendorPropName( name ) || name; 9576} 9577 9578 9579var 9580 9581 // Swappable if display is none or starts with table 9582 // except "table", "table-cell", or "table-caption" 9583 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 9584 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 9585 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 9586 cssNormalTransform = { 9587 letterSpacing: "0", 9588 fontWeight: "400" 9589 }; 9590 9591function setPositiveNumber( _elem, value, subtract ) { 9592 9593 // Any relative (+/-) values have already been 9594 // normalized at this point 9595 var matches = rcssNum.exec( value ); 9596 return matches ? 9597 9598 // Guard against undefined "subtract", e.g., when used as in cssHooks 9599 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 9600 value; 9601} 9602 9603function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 9604 var i = dimension === "width" ? 1 : 0, 9605 extra = 0, 9606 delta = 0, 9607 marginDelta = 0; 9608 9609 // Adjustment may not be necessary 9610 if ( box === ( isBorderBox ? "border" : "content" ) ) { 9611 return 0; 9612 } 9613 9614 for ( ; i < 4; i += 2 ) { 9615 9616 // Both box models exclude margin 9617 // Count margin delta separately to only add it after scroll gutter adjustment. 9618 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 9619 if ( box === "margin" ) { 9620 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 9621 } 9622 9623 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 9624 if ( !isBorderBox ) { 9625 9626 // Add padding 9627 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 9628 9629 // For "border" or "margin", add border 9630 if ( box !== "padding" ) { 9631 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9632 9633 // But still keep track of it otherwise 9634 } else { 9635 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9636 } 9637 9638 // If we get here with a border-box (content + padding + border), we're seeking "content" or 9639 // "padding" or "margin" 9640 } else { 9641 9642 // For "content", subtract padding 9643 if ( box === "content" ) { 9644 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 9645 } 9646 9647 // For "content" or "padding", subtract border 9648 if ( box !== "margin" ) { 9649 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9650 } 9651 } 9652 } 9653 9654 // Account for positive content-box scroll gutter when requested by providing computedVal 9655 if ( !isBorderBox && computedVal >= 0 ) { 9656 9657 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 9658 // Assuming integer scroll gutter, subtract the rest and round down 9659 delta += Math.max( 0, Math.ceil( 9660 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 9661 computedVal - 9662 delta - 9663 extra - 9664 0.5 9665 9666 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 9667 // Use an explicit zero to avoid NaN (gh-3964) 9668 ) ) || 0; 9669 } 9670 9671 return delta + marginDelta; 9672} 9673 9674function getWidthOrHeight( elem, dimension, extra ) { 9675 9676 // Start with computed style 9677 var styles = getStyles( elem ), 9678 9679 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 9680 // Fake content-box until we know it's needed to know the true value. 9681 boxSizingNeeded = !support.boxSizingReliable() || extra, 9682 isBorderBox = boxSizingNeeded && 9683 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 9684 valueIsBorderBox = isBorderBox, 9685 9686 val = curCSS( elem, dimension, styles ), 9687 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 9688 9689 // Support: Firefox <=54 9690 // Return a confounding non-pixel value or feign ignorance, as appropriate. 9691 if ( rnumnonpx.test( val ) ) { 9692 if ( !extra ) { 9693 return val; 9694 } 9695 val = "auto"; 9696 } 9697 9698 9699 // Support: IE 9 - 11 only 9700 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 9701 // In those cases, the computed value can be trusted to be border-box. 9702 if ( ( !support.boxSizingReliable() && isBorderBox || 9703 9704 // Support: IE 10 - 11+, Edge 15 - 18+ 9705 // IE/Edge misreport `getComputedStyle` of table rows with width/height 9706 // set in CSS while `offset*` properties report correct values. 9707 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 9708 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 9709 9710 // Fall back to offsetWidth/offsetHeight when value is "auto" 9711 // This happens for inline elements with no explicit setting (gh-3571) 9712 val === "auto" || 9713 9714 // Support: Android <=4.1 - 4.3 only 9715 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 9716 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 9717 9718 // Make sure the element is visible & connected 9719 elem.getClientRects().length ) { 9720 9721 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 9722 9723 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 9724 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 9725 // retrieved value as a content box dimension. 9726 valueIsBorderBox = offsetProp in elem; 9727 if ( valueIsBorderBox ) { 9728 val = elem[ offsetProp ]; 9729 } 9730 } 9731 9732 // Normalize "" and auto 9733 val = parseFloat( val ) || 0; 9734 9735 // Adjust for the element's box model 9736 return ( val + 9737 boxModelAdjustment( 9738 elem, 9739 dimension, 9740 extra || ( isBorderBox ? "border" : "content" ), 9741 valueIsBorderBox, 9742 styles, 9743 9744 // Provide the current computed size to request scroll gutter calculation (gh-3589) 9745 val 9746 ) 9747 ) + "px"; 9748} 9749 9750jQuery.extend( { 9751 9752 // Add in style property hooks for overriding the default 9753 // behavior of getting and setting a style property 9754 cssHooks: { 9755 opacity: { 9756 get: function( elem, computed ) { 9757 if ( computed ) { 9758 9759 // We should always get a number back from opacity 9760 var ret = curCSS( elem, "opacity" ); 9761 return ret === "" ? "1" : ret; 9762 } 9763 } 9764 } 9765 }, 9766 9767 // Don't automatically add "px" to these possibly-unitless properties 9768 cssNumber: { 9769 animationIterationCount: true, 9770 aspectRatio: true, 9771 borderImageSlice: true, 9772 columnCount: true, 9773 flexGrow: true, 9774 flexShrink: true, 9775 fontWeight: true, 9776 gridArea: true, 9777 gridColumn: true, 9778 gridColumnEnd: true, 9779 gridColumnStart: true, 9780 gridRow: true, 9781 gridRowEnd: true, 9782 gridRowStart: true, 9783 lineHeight: true, 9784 opacity: true, 9785 order: true, 9786 orphans: true, 9787 scale: true, 9788 widows: true, 9789 zIndex: true, 9790 zoom: true, 9791 9792 // SVG-related 9793 fillOpacity: true, 9794 floodOpacity: true, 9795 stopOpacity: true, 9796 strokeMiterlimit: true, 9797 strokeOpacity: true 9798 }, 9799 9800 // Add in properties whose names you wish to fix before 9801 // setting or getting the value 9802 cssProps: {}, 9803 9804 // Get and set the style property on a DOM Node 9805 style: function( elem, name, value, extra ) { 9806 9807 // Don't set styles on text and comment nodes 9808 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 9809 return; 9810 } 9811 9812 // Make sure that we're working with the right name 9813 var ret, type, hooks, 9814 origName = camelCase( name ), 9815 isCustomProp = rcustomProp.test( name ), 9816 style = elem.style; 9817 9818 // Make sure that we're working with the right name. We don't 9819 // want to query the value if it is a CSS custom property 9820 // since they are user-defined. 9821 if ( !isCustomProp ) { 9822 name = finalPropName( origName ); 9823 } 9824 9825 // Gets hook for the prefixed version, then unprefixed version 9826 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 9827 9828 // Check if we're setting a value 9829 if ( value !== undefined ) { 9830 type = typeof value; 9831 9832 // Convert "+=" or "-=" to relative numbers (trac-7345) 9833 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 9834 value = adjustCSS( elem, name, ret ); 9835 9836 // Fixes bug trac-9237 9837 type = "number"; 9838 } 9839 9840 // Make sure that null and NaN values aren't set (trac-7116) 9841 if ( value == null || value !== value ) { 9842 return; 9843 } 9844 9845 // If a number was passed in, add the unit (except for certain CSS properties) 9846 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 9847 // "px" to a few hardcoded values. 9848 if ( type === "number" && !isCustomProp ) { 9849 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 9850 } 9851 9852 // background-* props affect original clone's values 9853 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 9854 style[ name ] = "inherit"; 9855 } 9856 9857 // If a hook was provided, use that value, otherwise just set the specified value 9858 if ( !hooks || !( "set" in hooks ) || 9859 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 9860 9861 if ( isCustomProp ) { 9862 style.setProperty( name, value ); 9863 } else { 9864 style[ name ] = value; 9865 } 9866 } 9867 9868 } else { 9869 9870 // If a hook was provided get the non-computed value from there 9871 if ( hooks && "get" in hooks && 9872 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 9873 9874 return ret; 9875 } 9876 9877 // Otherwise just get the value from the style object 9878 return style[ name ]; 9879 } 9880 }, 9881 9882 css: function( elem, name, extra, styles ) { 9883 var val, num, hooks, 9884 origName = camelCase( name ), 9885 isCustomProp = rcustomProp.test( name ); 9886 9887 // Make sure that we're working with the right name. We don't 9888 // want to modify the value if it is a CSS custom property 9889 // since they are user-defined. 9890 if ( !isCustomProp ) { 9891 name = finalPropName( origName ); 9892 } 9893 9894 // Try prefixed name followed by the unprefixed name 9895 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 9896 9897 // If a hook was provided get the computed value from there 9898 if ( hooks && "get" in hooks ) { 9899 val = hooks.get( elem, true, extra ); 9900 } 9901 9902 // Otherwise, if a way to get the computed value exists, use that 9903 if ( val === undefined ) { 9904 val = curCSS( elem, name, styles ); 9905 } 9906 9907 // Convert "normal" to computed value 9908 if ( val === "normal" && name in cssNormalTransform ) { 9909 val = cssNormalTransform[ name ]; 9910 } 9911 9912 // Make numeric if forced or a qualifier was provided and val looks numeric 9913 if ( extra === "" || extra ) { 9914 num = parseFloat( val ); 9915 return extra === true || isFinite( num ) ? num || 0 : val; 9916 } 9917 9918 return val; 9919 } 9920} ); 9921 9922jQuery.each( [ "height", "width" ], function( _i, dimension ) { 9923 jQuery.cssHooks[ dimension ] = { 9924 get: function( elem, computed, extra ) { 9925 if ( computed ) { 9926 9927 // Certain elements can have dimension info if we invisibly show them 9928 // but it must have a current display style that would benefit 9929 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 9930 9931 // Support: Safari 8+ 9932 // Table columns in Safari have non-zero offsetWidth & zero 9933 // getBoundingClientRect().width unless display is changed. 9934 // Support: IE <=11 only 9935 // Running getBoundingClientRect on a disconnected node 9936 // in IE throws an error. 9937 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 9938 swap( elem, cssShow, function() { 9939 return getWidthOrHeight( elem, dimension, extra ); 9940 } ) : 9941 getWidthOrHeight( elem, dimension, extra ); 9942 } 9943 }, 9944 9945 set: function( elem, value, extra ) { 9946 var matches, 9947 styles = getStyles( elem ), 9948 9949 // Only read styles.position if the test has a chance to fail 9950 // to avoid forcing a reflow. 9951 scrollboxSizeBuggy = !support.scrollboxSize() && 9952 styles.position === "absolute", 9953 9954 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 9955 boxSizingNeeded = scrollboxSizeBuggy || extra, 9956 isBorderBox = boxSizingNeeded && 9957 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 9958 subtract = extra ? 9959 boxModelAdjustment( 9960 elem, 9961 dimension, 9962 extra, 9963 isBorderBox, 9964 styles 9965 ) : 9966 0; 9967 9968 // Account for unreliable border-box dimensions by comparing offset* to computed and 9969 // faking a content-box to get border and padding (gh-3699) 9970 if ( isBorderBox && scrollboxSizeBuggy ) { 9971 subtract -= Math.ceil( 9972 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 9973 parseFloat( styles[ dimension ] ) - 9974 boxModelAdjustment( elem, dimension, "border", false, styles ) - 9975 0.5 9976 ); 9977 } 9978 9979 // Convert to pixels if value adjustment is needed 9980 if ( subtract && ( matches = rcssNum.exec( value ) ) && 9981 ( matches[ 3 ] || "px" ) !== "px" ) { 9982 9983 elem.style[ dimension ] = value; 9984 value = jQuery.css( elem, dimension ); 9985 } 9986 9987 return setPositiveNumber( elem, value, subtract ); 9988 } 9989 }; 9990} ); 9991 9992jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 9993 function( elem, computed ) { 9994 if ( computed ) { 9995 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 9996 elem.getBoundingClientRect().left - 9997 swap( elem, { marginLeft: 0 }, function() { 9998 return elem.getBoundingClientRect().left; 9999 } ) 10000 ) + "px"; 10001 } 10002 } 10003); 10004 10005// These hooks are used by animate to expand properties 10006jQuery.each( { 10007 margin: "", 10008 padding: "", 10009 border: "Width" 10010}, function( prefix, suffix ) { 10011 jQuery.cssHooks[ prefix + suffix ] = { 10012 expand: function( value ) { 10013 var i = 0, 10014 expanded = {}, 10015 10016 // Assumes a single number if not a string 10017 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 10018 10019 for ( ; i < 4; i++ ) { 10020 expanded[ prefix + cssExpand[ i ] + suffix ] = 10021 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 10022 } 10023 10024 return expanded; 10025 } 10026 }; 10027 10028 if ( prefix !== "margin" ) { 10029 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 10030 } 10031} ); 10032 10033jQuery.fn.extend( { 10034 css: function( name, value ) { 10035 return access( this, function( elem, name, value ) { 10036 var styles, len, 10037 map = {}, 10038 i = 0; 10039 10040 if ( Array.isArray( name ) ) { 10041 styles = getStyles( elem ); 10042 len = name.length; 10043 10044 for ( ; i < len; i++ ) { 10045 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 10046 } 10047 10048 return map; 10049 } 10050 10051 return value !== undefined ? 10052 jQuery.style( elem, name, value ) : 10053 jQuery.css( elem, name ); 10054 }, name, value, arguments.length > 1 ); 10055 } 10056} ); 10057 10058 10059function Tween( elem, options, prop, end, easing ) { 10060 return new Tween.prototype.init( elem, options, prop, end, easing ); 10061} 10062jQuery.Tween = Tween; 10063 10064Tween.prototype = { 10065 constructor: Tween, 10066 init: function( elem, options, prop, end, easing, unit ) { 10067 this.elem = elem; 10068 this.prop = prop; 10069 this.easing = easing || jQuery.easing._default; 10070 this.options = options; 10071 this.start = this.now = this.cur(); 10072 this.end = end; 10073 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 10074 }, 10075 cur: function() { 10076 var hooks = Tween.propHooks[ this.prop ]; 10077 10078 return hooks && hooks.get ? 10079 hooks.get( this ) : 10080 Tween.propHooks._default.get( this ); 10081 }, 10082 run: function( percent ) { 10083 var eased, 10084 hooks = Tween.propHooks[ this.prop ]; 10085 10086 if ( this.options.duration ) { 10087 this.pos = eased = jQuery.easing[ this.easing ]( 10088 percent, this.options.duration * percent, 0, 1, this.options.duration 10089 ); 10090 } else { 10091 this.pos = eased = percent; 10092 } 10093 this.now = ( this.end - this.start ) * eased + this.start; 10094 10095 if ( this.options.step ) { 10096 this.options.step.call( this.elem, this.now, this ); 10097 } 10098 10099 if ( hooks && hooks.set ) { 10100 hooks.set( this ); 10101 } else { 10102 Tween.propHooks._default.set( this ); 10103 } 10104 return this; 10105 } 10106}; 10107 10108Tween.prototype.init.prototype = Tween.prototype; 10109 10110Tween.propHooks = { 10111 _default: { 10112 get: function( tween ) { 10113 var result; 10114 10115 // Use a property on the element directly when it is not a DOM element, 10116 // or when there is no matching style property that exists. 10117 if ( tween.elem.nodeType !== 1 || 10118 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 10119 return tween.elem[ tween.prop ]; 10120 } 10121 10122 // Passing an empty string as a 3rd parameter to .css will automatically 10123 // attempt a parseFloat and fallback to a string if the parse fails. 10124 // Simple values such as "10px" are parsed to Float; 10125 // complex values such as "rotate(1rad)" are returned as-is. 10126 result = jQuery.css( tween.elem, tween.prop, "" ); 10127 10128 // Empty strings, null, undefined and "auto" are converted to 0. 10129 return !result || result === "auto" ? 0 : result; 10130 }, 10131 set: function( tween ) { 10132 10133 // Use step hook for back compat. 10134 // Use cssHook if its there. 10135 // Use .style if available and use plain properties where available. 10136 if ( jQuery.fx.step[ tween.prop ] ) { 10137 jQuery.fx.step[ tween.prop ]( tween ); 10138 } else if ( tween.elem.nodeType === 1 && ( 10139 jQuery.cssHooks[ tween.prop ] || 10140 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 10141 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 10142 } else { 10143 tween.elem[ tween.prop ] = tween.now; 10144 } 10145 } 10146 } 10147}; 10148 10149// Support: IE <=9 only 10150// Panic based approach to setting things on disconnected nodes 10151Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 10152 set: function( tween ) { 10153 if ( tween.elem.nodeType && tween.elem.parentNode ) { 10154 tween.elem[ tween.prop ] = tween.now; 10155 } 10156 } 10157}; 10158 10159jQuery.easing = { 10160 linear: function( p ) { 10161 return p; 10162 }, 10163 swing: function( p ) { 10164 return 0.5 - Math.cos( p * Math.PI ) / 2; 10165 }, 10166 _default: "swing" 10167}; 10168 10169jQuery.fx = Tween.prototype.init; 10170 10171// Back compat <1.8 extension point 10172jQuery.fx.step = {}; 10173 10174 10175 10176 10177var 10178 fxNow, inProgress, 10179 rfxtypes = /^(?:toggle|show|hide)$/, 10180 rrun = /queueHooks$/; 10181 10182function schedule() { 10183 if ( inProgress ) { 10184 if ( document.hidden === false && window.requestAnimationFrame ) { 10185 window.requestAnimationFrame( schedule ); 10186 } else { 10187 window.setTimeout( schedule, jQuery.fx.interval ); 10188 } 10189 10190 jQuery.fx.tick(); 10191 } 10192} 10193 10194// Animations created synchronously will run synchronously 10195function createFxNow() { 10196 window.setTimeout( function() { 10197 fxNow = undefined; 10198 } ); 10199 return ( fxNow = Date.now() ); 10200} 10201 10202// Generate parameters to create a standard animation 10203function genFx( type, includeWidth ) { 10204 var which, 10205 i = 0, 10206 attrs = { height: type }; 10207 10208 // If we include width, step value is 1 to do all cssExpand values, 10209 // otherwise step value is 2 to skip over Left and Right 10210 includeWidth = includeWidth ? 1 : 0; 10211 for ( ; i < 4; i += 2 - includeWidth ) { 10212 which = cssExpand[ i ]; 10213 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 10214 } 10215 10216 if ( includeWidth ) { 10217 attrs.opacity = attrs.width = type; 10218 } 10219 10220 return attrs; 10221} 10222 10223function createTween( value, prop, animation ) { 10224 var tween, 10225 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 10226 index = 0, 10227 length = collection.length; 10228 for ( ; index < length; index++ ) { 10229 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 10230 10231 // We're done with this property 10232 return tween; 10233 } 10234 } 10235} 10236 10237function defaultPrefilter( elem, props, opts ) { 10238 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 10239 isBox = "width" in props || "height" in props, 10240 anim = this, 10241 orig = {}, 10242 style = elem.style, 10243 hidden = elem.nodeType && isHiddenWithinTree( elem ), 10244 dataShow = dataPriv.get( elem, "fxshow" ); 10245 10246 // Queue-skipping animations hijack the fx hooks 10247 if ( !opts.queue ) { 10248 hooks = jQuery._queueHooks( elem, "fx" ); 10249 if ( hooks.unqueued == null ) { 10250 hooks.unqueued = 0; 10251 oldfire = hooks.empty.fire; 10252 hooks.empty.fire = function() { 10253 if ( !hooks.unqueued ) { 10254 oldfire(); 10255 } 10256 }; 10257 } 10258 hooks.unqueued++; 10259 10260 anim.always( function() { 10261 10262 // Ensure the complete handler is called before this completes 10263 anim.always( function() { 10264 hooks.unqueued--; 10265 if ( !jQuery.queue( elem, "fx" ).length ) { 10266 hooks.empty.fire(); 10267 } 10268 } ); 10269 } ); 10270 } 10271 10272 // Detect show/hide animations 10273 for ( prop in props ) { 10274 value = props[ prop ]; 10275 if ( rfxtypes.test( value ) ) { 10276 delete props[ prop ]; 10277 toggle = toggle || value === "toggle"; 10278 if ( value === ( hidden ? "hide" : "show" ) ) { 10279 10280 // Pretend to be hidden if this is a "show" and 10281 // there is still data from a stopped show/hide 10282 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 10283 hidden = true; 10284 10285 // Ignore all other no-op show/hide data 10286 } else { 10287 continue; 10288 } 10289 } 10290 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 10291 } 10292 } 10293 10294 // Bail out if this is a no-op like .hide().hide() 10295 propTween = !jQuery.isEmptyObject( props ); 10296 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 10297 return; 10298 } 10299 10300 // Restrict "overflow" and "display" styles during box animations 10301 if ( isBox && elem.nodeType === 1 ) { 10302 10303 // Support: IE <=9 - 11, Edge 12 - 15 10304 // Record all 3 overflow attributes because IE does not infer the shorthand 10305 // from identically-valued overflowX and overflowY and Edge just mirrors 10306 // the overflowX value there. 10307 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 10308 10309 // Identify a display type, preferring old show/hide data over the CSS cascade 10310 restoreDisplay = dataShow && dataShow.display; 10311 if ( restoreDisplay == null ) { 10312 restoreDisplay = dataPriv.get( elem, "display" ); 10313 } 10314 display = jQuery.css( elem, "display" ); 10315 if ( display === "none" ) { 10316 if ( restoreDisplay ) { 10317 display = restoreDisplay; 10318 } else { 10319 10320 // Get nonempty value(s) by temporarily forcing visibility 10321 showHide( [ elem ], true ); 10322 restoreDisplay = elem.style.display || restoreDisplay; 10323 display = jQuery.css( elem, "display" ); 10324 showHide( [ elem ] ); 10325 } 10326 } 10327 10328 // Animate inline elements as inline-block 10329 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 10330 if ( jQuery.css( elem, "float" ) === "none" ) { 10331 10332 // Restore the original display value at the end of pure show/hide animations 10333 if ( !propTween ) { 10334 anim.done( function() { 10335 style.display = restoreDisplay; 10336 } ); 10337 if ( restoreDisplay == null ) { 10338 display = style.display; 10339 restoreDisplay = display === "none" ? "" : display; 10340 } 10341 } 10342 style.display = "inline-block"; 10343 } 10344 } 10345 } 10346 10347 if ( opts.overflow ) { 10348 style.overflow = "hidden"; 10349 anim.always( function() { 10350 style.overflow = opts.overflow[ 0 ]; 10351 style.overflowX = opts.overflow[ 1 ]; 10352 style.overflowY = opts.overflow[ 2 ]; 10353 } ); 10354 } 10355 10356 // Implement show/hide animations 10357 propTween = false; 10358 for ( prop in orig ) { 10359 10360 // General show/hide setup for this element animation 10361 if ( !propTween ) { 10362 if ( dataShow ) { 10363 if ( "hidden" in dataShow ) { 10364 hidden = dataShow.hidden; 10365 } 10366 } else { 10367 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 10368 } 10369 10370 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 10371 if ( toggle ) { 10372 dataShow.hidden = !hidden; 10373 } 10374 10375 // Show elements before animating them 10376 if ( hidden ) { 10377 showHide( [ elem ], true ); 10378 } 10379 10380 /* eslint-disable no-loop-func */ 10381 10382 anim.done( function() { 10383 10384 /* eslint-enable no-loop-func */ 10385 10386 // The final step of a "hide" animation is actually hiding the element 10387 if ( !hidden ) { 10388 showHide( [ elem ] ); 10389 } 10390 dataPriv.remove( elem, "fxshow" ); 10391 for ( prop in orig ) { 10392 jQuery.style( elem, prop, orig[ prop ] ); 10393 } 10394 } ); 10395 } 10396 10397 // Per-property setup 10398 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 10399 if ( !( prop in dataShow ) ) { 10400 dataShow[ prop ] = propTween.start; 10401 if ( hidden ) { 10402 propTween.end = propTween.start; 10403 propTween.start = 0; 10404 } 10405 } 10406 } 10407} 10408 10409function propFilter( props, specialEasing ) { 10410 var index, name, easing, value, hooks; 10411 10412 // camelCase, specialEasing and expand cssHook pass 10413 for ( index in props ) { 10414 name = camelCase( index ); 10415 easing = specialEasing[ name ]; 10416 value = props[ index ]; 10417 if ( Array.isArray( value ) ) { 10418 easing = value[ 1 ]; 10419 value = props[ index ] = value[ 0 ]; 10420 } 10421 10422 if ( index !== name ) { 10423 props[ name ] = value; 10424 delete props[ index ]; 10425 } 10426 10427 hooks = jQuery.cssHooks[ name ]; 10428 if ( hooks && "expand" in hooks ) { 10429 value = hooks.expand( value ); 10430 delete props[ name ]; 10431 10432 // Not quite $.extend, this won't overwrite existing keys. 10433 // Reusing 'index' because we have the correct "name" 10434 for ( index in value ) { 10435 if ( !( index in props ) ) { 10436 props[ index ] = value[ index ]; 10437 specialEasing[ index ] = easing; 10438 } 10439 } 10440 } else { 10441 specialEasing[ name ] = easing; 10442 } 10443 } 10444} 10445 10446function Animation( elem, properties, options ) { 10447 var result, 10448 stopped, 10449 index = 0, 10450 length = Animation.prefilters.length, 10451 deferred = jQuery.Deferred().always( function() { 10452 10453 // Don't match elem in the :animated selector 10454 delete tick.elem; 10455 } ), 10456 tick = function() { 10457 if ( stopped ) { 10458 return false; 10459 } 10460 var currentTime = fxNow || createFxNow(), 10461 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 10462 10463 // Support: Android 2.3 only 10464 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 10465 temp = remaining / animation.duration || 0, 10466 percent = 1 - temp, 10467 index = 0, 10468 length = animation.tweens.length; 10469 10470 for ( ; index < length; index++ ) { 10471 animation.tweens[ index ].run( percent ); 10472 } 10473 10474 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 10475 10476 // If there's more to do, yield 10477 if ( percent < 1 && length ) { 10478 return remaining; 10479 } 10480 10481 // If this was an empty animation, synthesize a final progress notification 10482 if ( !length ) { 10483 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 10484 } 10485 10486 // Resolve the animation and report its conclusion 10487 deferred.resolveWith( elem, [ animation ] ); 10488 return false; 10489 }, 10490 animation = deferred.promise( { 10491 elem: elem, 10492 props: jQuery.extend( {}, properties ), 10493 opts: jQuery.extend( true, { 10494 specialEasing: {}, 10495 easing: jQuery.easing._default 10496 }, options ), 10497 originalProperties: properties, 10498 originalOptions: options, 10499 startTime: fxNow || createFxNow(), 10500 duration: options.duration, 10501 tweens: [], 10502 createTween: function( prop, end ) { 10503 var tween = jQuery.Tween( elem, animation.opts, prop, end, 10504 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 10505 animation.tweens.push( tween ); 10506 return tween; 10507 }, 10508 stop: function( gotoEnd ) { 10509 var index = 0, 10510 10511 // If we are going to the end, we want to run all the tweens 10512 // otherwise we skip this part 10513 length = gotoEnd ? animation.tweens.length : 0; 10514 if ( stopped ) { 10515 return this; 10516 } 10517 stopped = true; 10518 for ( ; index < length; index++ ) { 10519 animation.tweens[ index ].run( 1 ); 10520 } 10521 10522 // Resolve when we played the last frame; otherwise, reject 10523 if ( gotoEnd ) { 10524 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 10525 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 10526 } else { 10527 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 10528 } 10529 return this; 10530 } 10531 } ), 10532 props = animation.props; 10533 10534 propFilter( props, animation.opts.specialEasing ); 10535 10536 for ( ; index < length; index++ ) { 10537 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 10538 if ( result ) { 10539 if ( isFunction( result.stop ) ) { 10540 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 10541 result.stop.bind( result ); 10542 } 10543 return result; 10544 } 10545 } 10546 10547 jQuery.map( props, createTween, animation ); 10548 10549 if ( isFunction( animation.opts.start ) ) { 10550 animation.opts.start.call( elem, animation ); 10551 } 10552 10553 // Attach callbacks from options 10554 animation 10555 .progress( animation.opts.progress ) 10556 .done( animation.opts.done, animation.opts.complete ) 10557 .fail( animation.opts.fail ) 10558 .always( animation.opts.always ); 10559 10560 jQuery.fx.timer( 10561 jQuery.extend( tick, { 10562 elem: elem, 10563 anim: animation, 10564 queue: animation.opts.queue 10565 } ) 10566 ); 10567 10568 return animation; 10569} 10570 10571jQuery.Animation = jQuery.extend( Animation, { 10572 10573 tweeners: { 10574 "*": [ function( prop, value ) { 10575 var tween = this.createTween( prop, value ); 10576 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 10577 return tween; 10578 } ] 10579 }, 10580 10581 tweener: function( props, callback ) { 10582 if ( isFunction( props ) ) { 10583 callback = props; 10584 props = [ "*" ]; 10585 } else { 10586 props = props.match( rnothtmlwhite ); 10587 } 10588 10589 var prop, 10590 index = 0, 10591 length = props.length; 10592 10593 for ( ; index < length; index++ ) { 10594 prop = props[ index ]; 10595 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 10596 Animation.tweeners[ prop ].unshift( callback ); 10597 } 10598 }, 10599 10600 prefilters: [ defaultPrefilter ], 10601 10602 prefilter: function( callback, prepend ) { 10603 if ( prepend ) { 10604 Animation.prefilters.unshift( callback ); 10605 } else { 10606 Animation.prefilters.push( callback ); 10607 } 10608 } 10609} ); 10610 10611jQuery.speed = function( speed, easing, fn ) { 10612 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 10613 complete: fn || !fn && easing || 10614 isFunction( speed ) && speed, 10615 duration: speed, 10616 easing: fn && easing || easing && !isFunction( easing ) && easing 10617 }; 10618 10619 // Go to the end state if fx are off 10620 if ( jQuery.fx.off ) { 10621 opt.duration = 0; 10622 10623 } else { 10624 if ( typeof opt.duration !== "number" ) { 10625 if ( opt.duration in jQuery.fx.speeds ) { 10626 opt.duration = jQuery.fx.speeds[ opt.duration ]; 10627 10628 } else { 10629 opt.duration = jQuery.fx.speeds._default; 10630 } 10631 } 10632 } 10633 10634 // Normalize opt.queue - true/undefined/null -> "fx" 10635 if ( opt.queue == null || opt.queue === true ) { 10636 opt.queue = "fx"; 10637 } 10638 10639 // Queueing 10640 opt.old = opt.complete; 10641 10642 opt.complete = function() { 10643 if ( isFunction( opt.old ) ) { 10644 opt.old.call( this ); 10645 } 10646 10647 if ( opt.queue ) { 10648 jQuery.dequeue( this, opt.queue ); 10649 } 10650 }; 10651 10652 return opt; 10653}; 10654 10655jQuery.fn.extend( { 10656 fadeTo: function( speed, to, easing, callback ) { 10657 10658 // Show any hidden elements after setting opacity to 0 10659 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 10660 10661 // Animate to the value specified 10662 .end().animate( { opacity: to }, speed, easing, callback ); 10663 }, 10664 animate: function( prop, speed, easing, callback ) { 10665 var empty = jQuery.isEmptyObject( prop ), 10666 optall = jQuery.speed( speed, easing, callback ), 10667 doAnimation = function() { 10668 10669 // Operate on a copy of prop so per-property easing won't be lost 10670 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 10671 10672 // Empty animations, or finishing resolves immediately 10673 if ( empty || dataPriv.get( this, "finish" ) ) { 10674 anim.stop( true ); 10675 } 10676 }; 10677 10678 doAnimation.finish = doAnimation; 10679 10680 return empty || optall.queue === false ? 10681 this.each( doAnimation ) : 10682 this.queue( optall.queue, doAnimation ); 10683 }, 10684 stop: function( type, clearQueue, gotoEnd ) { 10685 var stopQueue = function( hooks ) { 10686 var stop = hooks.stop; 10687 delete hooks.stop; 10688 stop( gotoEnd ); 10689 }; 10690 10691 if ( typeof type !== "string" ) { 10692 gotoEnd = clearQueue; 10693 clearQueue = type; 10694 type = undefined; 10695 } 10696 if ( clearQueue ) { 10697 this.queue( type || "fx", [] ); 10698 } 10699 10700 return this.each( function() { 10701 var dequeue = true, 10702 index = type != null && type + "queueHooks", 10703 timers = jQuery.timers, 10704 data = dataPriv.get( this ); 10705 10706 if ( index ) { 10707 if ( data[ index ] && data[ index ].stop ) { 10708 stopQueue( data[ index ] ); 10709 } 10710 } else { 10711 for ( index in data ) { 10712 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 10713 stopQueue( data[ index ] ); 10714 } 10715 } 10716 } 10717 10718 for ( index = timers.length; index--; ) { 10719 if ( timers[ index ].elem === this && 10720 ( type == null || timers[ index ].queue === type ) ) { 10721 10722 timers[ index ].anim.stop( gotoEnd ); 10723 dequeue = false; 10724 timers.splice( index, 1 ); 10725 } 10726 } 10727 10728 // Start the next in the queue if the last step wasn't forced. 10729 // Timers currently will call their complete callbacks, which 10730 // will dequeue but only if they were gotoEnd. 10731 if ( dequeue || !gotoEnd ) { 10732 jQuery.dequeue( this, type ); 10733 } 10734 } ); 10735 }, 10736 finish: function( type ) { 10737 if ( type !== false ) { 10738 type = type || "fx"; 10739 } 10740 return this.each( function() { 10741 var index, 10742 data = dataPriv.get( this ), 10743 queue = data[ type + "queue" ], 10744 hooks = data[ type + "queueHooks" ], 10745 timers = jQuery.timers, 10746 length = queue ? queue.length : 0; 10747 10748 // Enable finishing flag on private data 10749 data.finish = true; 10750 10751 // Empty the queue first 10752 jQuery.queue( this, type, [] ); 10753 10754 if ( hooks && hooks.stop ) { 10755 hooks.stop.call( this, true ); 10756 } 10757 10758 // Look for any active animations, and finish them 10759 for ( index = timers.length; index--; ) { 10760 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 10761 timers[ index ].anim.stop( true ); 10762 timers.splice( index, 1 ); 10763 } 10764 } 10765 10766 // Look for any animations in the old queue and finish them 10767 for ( index = 0; index < length; index++ ) { 10768 if ( queue[ index ] && queue[ index ].finish ) { 10769 queue[ index ].finish.call( this ); 10770 } 10771 } 10772 10773 // Turn off finishing flag 10774 delete data.finish; 10775 } ); 10776 } 10777} ); 10778 10779jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 10780 var cssFn = jQuery.fn[ name ]; 10781 jQuery.fn[ name ] = function( speed, easing, callback ) { 10782 return speed == null || typeof speed === "boolean" ? 10783 cssFn.apply( this, arguments ) : 10784 this.animate( genFx( name, true ), speed, easing, callback ); 10785 }; 10786} ); 10787 10788// Generate shortcuts for custom animations 10789jQuery.each( { 10790 slideDown: genFx( "show" ), 10791 slideUp: genFx( "hide" ), 10792 slideToggle: genFx( "toggle" ), 10793 fadeIn: { opacity: "show" }, 10794 fadeOut: { opacity: "hide" }, 10795 fadeToggle: { opacity: "toggle" } 10796}, function( name, props ) { 10797 jQuery.fn[ name ] = function( speed, easing, callback ) { 10798 return this.animate( props, speed, easing, callback ); 10799 }; 10800} ); 10801 10802jQuery.timers = []; 10803jQuery.fx.tick = function() { 10804 var timer, 10805 i = 0, 10806 timers = jQuery.timers; 10807 10808 fxNow = Date.now(); 10809 10810 for ( ; i < timers.length; i++ ) { 10811 timer = timers[ i ]; 10812 10813 // Run the timer and safely remove it when done (allowing for external removal) 10814 if ( !timer() && timers[ i ] === timer ) { 10815 timers.splice( i--, 1 ); 10816 } 10817 } 10818 10819 if ( !timers.length ) { 10820 jQuery.fx.stop(); 10821 } 10822 fxNow = undefined; 10823}; 10824 10825jQuery.fx.timer = function( timer ) { 10826 jQuery.timers.push( timer ); 10827 jQuery.fx.start(); 10828}; 10829 10830jQuery.fx.interval = 13; 10831jQuery.fx.start = function() { 10832 if ( inProgress ) { 10833 return; 10834 } 10835 10836 inProgress = true; 10837 schedule(); 10838}; 10839 10840jQuery.fx.stop = function() { 10841 inProgress = null; 10842}; 10843 10844jQuery.fx.speeds = { 10845 slow: 600, 10846 fast: 200, 10847 10848 // Default speed 10849 _default: 400 10850}; 10851 10852 10853// Based off of the plugin by Clint Helfers, with permission. 10854jQuery.fn.delay = function( time, type ) { 10855 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 10856 type = type || "fx"; 10857 10858 return this.queue( type, function( next, hooks ) { 10859 var timeout = window.setTimeout( next, time ); 10860 hooks.stop = function() { 10861 window.clearTimeout( timeout ); 10862 }; 10863 } ); 10864}; 10865 10866 10867( function() { 10868 var input = document.createElement( "input" ), 10869 select = document.createElement( "select" ), 10870 opt = select.appendChild( document.createElement( "option" ) ); 10871 10872 input.type = "checkbox"; 10873 10874 // Support: Android <=4.3 only 10875 // Default value for a checkbox should be "on" 10876 support.checkOn = input.value !== ""; 10877 10878 // Support: IE <=11 only 10879 // Must access selectedIndex to make default options select 10880 support.optSelected = opt.selected; 10881 10882 // Support: IE <=11 only 10883 // An input loses its value after becoming a radio 10884 input = document.createElement( "input" ); 10885 input.value = "t"; 10886 input.type = "radio"; 10887 support.radioValue = input.value === "t"; 10888} )(); 10889 10890 10891var boolHook, 10892 attrHandle = jQuery.expr.attrHandle; 10893 10894jQuery.fn.extend( { 10895 attr: function( name, value ) { 10896 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 10897 }, 10898 10899 removeAttr: function( name ) { 10900 return this.each( function() { 10901 jQuery.removeAttr( this, name ); 10902 } ); 10903 } 10904} ); 10905 10906jQuery.extend( { 10907 attr: function( elem, name, value ) { 10908 var ret, hooks, 10909 nType = elem.nodeType; 10910 10911 // Don't get/set attributes on text, comment and attribute nodes 10912 if ( nType === 3 || nType === 8 || nType === 2 ) { 10913 return; 10914 } 10915 10916 // Fallback to prop when attributes are not supported 10917 if ( typeof elem.getAttribute === "undefined" ) { 10918 return jQuery.prop( elem, name, value ); 10919 } 10920 10921 // Attribute hooks are determined by the lowercase version 10922 // Grab necessary hook if one is defined 10923 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 10924 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 10925 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 10926 } 10927 10928 if ( value !== undefined ) { 10929 if ( value === null ) { 10930 jQuery.removeAttr( elem, name ); 10931 return; 10932 } 10933 10934 if ( hooks && "set" in hooks && 10935 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 10936 return ret; 10937 } 10938 10939 elem.setAttribute( name, value + "" ); 10940 return value; 10941 } 10942 10943 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 10944 return ret; 10945 } 10946 10947 ret = jQuery.find.attr( elem, name ); 10948 10949 // Non-existent attributes return null, we normalize to undefined 10950 return ret == null ? undefined : ret; 10951 }, 10952 10953 attrHooks: { 10954 type: { 10955 set: function( elem, value ) { 10956 if ( !support.radioValue && value === "radio" && 10957 nodeName( elem, "input" ) ) { 10958 var val = elem.value; 10959 elem.setAttribute( "type", value ); 10960 if ( val ) { 10961 elem.value = val; 10962 } 10963 return value; 10964 } 10965 } 10966 } 10967 }, 10968 10969 removeAttr: function( elem, value ) { 10970 var name, 10971 i = 0, 10972 10973 // Attribute names can contain non-HTML whitespace characters 10974 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 10975 attrNames = value && value.match( rnothtmlwhite ); 10976 10977 if ( attrNames && elem.nodeType === 1 ) { 10978 while ( ( name = attrNames[ i++ ] ) ) { 10979 elem.removeAttribute( name ); 10980 } 10981 } 10982 } 10983} ); 10984 10985// Hooks for boolean attributes 10986boolHook = { 10987 set: function( elem, value, name ) { 10988 if ( value === false ) { 10989 10990 // Remove boolean attributes when set to false 10991 jQuery.removeAttr( elem, name ); 10992 } else { 10993 elem.setAttribute( name, name ); 10994 } 10995 return name; 10996 } 10997}; 10998 10999jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 11000 var getter = attrHandle[ name ] || jQuery.find.attr; 11001 11002 attrHandle[ name ] = function( elem, name, isXML ) { 11003 var ret, handle, 11004 lowercaseName = name.toLowerCase(); 11005 11006 if ( !isXML ) { 11007 11008 // Avoid an infinite loop by temporarily removing this function from the getter 11009 handle = attrHandle[ lowercaseName ]; 11010 attrHandle[ lowercaseName ] = ret; 11011 ret = getter( elem, name, isXML ) != null ? 11012 lowercaseName : 11013 null; 11014 attrHandle[ lowercaseName ] = handle; 11015 } 11016 return ret; 11017 }; 11018} ); 11019 11020 11021 11022 11023var rfocusable = /^(?:input|select|textarea|button)$/i, 11024 rclickable = /^(?:a|area)$/i; 11025 11026jQuery.fn.extend( { 11027 prop: function( name, value ) { 11028 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 11029 }, 11030 11031 removeProp: function( name ) { 11032 return this.each( function() { 11033 delete this[ jQuery.propFix[ name ] || name ]; 11034 } ); 11035 } 11036} ); 11037 11038jQuery.extend( { 11039 prop: function( elem, name, value ) { 11040 var ret, hooks, 11041 nType = elem.nodeType; 11042 11043 // Don't get/set properties on text, comment and attribute nodes 11044 if ( nType === 3 || nType === 8 || nType === 2 ) { 11045 return; 11046 } 11047 11048 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 11049 11050 // Fix name and attach hooks 11051 name = jQuery.propFix[ name ] || name; 11052 hooks = jQuery.propHooks[ name ]; 11053 } 11054 11055 if ( value !== undefined ) { 11056 if ( hooks && "set" in hooks && 11057 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 11058 return ret; 11059 } 11060 11061 return ( elem[ name ] = value ); 11062 } 11063 11064 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 11065 return ret; 11066 } 11067 11068 return elem[ name ]; 11069 }, 11070 11071 propHooks: { 11072 tabIndex: { 11073 get: function( elem ) { 11074 11075 // Support: IE <=9 - 11 only 11076 // elem.tabIndex doesn't always return the 11077 // correct value when it hasn't been explicitly set 11078 // Use proper attribute retrieval (trac-12072) 11079 var tabindex = jQuery.find.attr( elem, "tabindex" ); 11080 11081 if ( tabindex ) { 11082 return parseInt( tabindex, 10 ); 11083 } 11084 11085 if ( 11086 rfocusable.test( elem.nodeName ) || 11087 rclickable.test( elem.nodeName ) && 11088 elem.href 11089 ) { 11090 return 0; 11091 } 11092 11093 return -1; 11094 } 11095 } 11096 }, 11097 11098 propFix: { 11099 "for": "htmlFor", 11100 "class": "className" 11101 } 11102} ); 11103 11104// Support: IE <=11 only 11105// Accessing the selectedIndex property 11106// forces the browser to respect setting selected 11107// on the option 11108// The getter ensures a default option is selected 11109// when in an optgroup 11110// eslint rule "no-unused-expressions" is disabled for this code 11111// since it considers such accessions noop 11112if ( !support.optSelected ) { 11113 jQuery.propHooks.selected = { 11114 get: function( elem ) { 11115 11116 /* eslint no-unused-expressions: "off" */ 11117 11118 var parent = elem.parentNode; 11119 if ( parent && parent.parentNode ) { 11120 parent.parentNode.selectedIndex; 11121 } 11122 return null; 11123 }, 11124 set: function( elem ) { 11125 11126 /* eslint no-unused-expressions: "off" */ 11127 11128 var parent = elem.parentNode; 11129 if ( parent ) { 11130 parent.selectedIndex; 11131 11132 if ( parent.parentNode ) { 11133 parent.parentNode.selectedIndex; 11134 } 11135 } 11136 } 11137 }; 11138} 11139 11140jQuery.each( [ 11141 "tabIndex", 11142 "readOnly", 11143 "maxLength", 11144 "cellSpacing", 11145 "cellPadding", 11146 "rowSpan", 11147 "colSpan", 11148 "useMap", 11149 "frameBorder", 11150 "contentEditable" 11151], function() { 11152 jQuery.propFix[ this.toLowerCase() ] = this; 11153} ); 11154 11155 11156 11157 11158 // Strip and collapse whitespace according to HTML spec 11159 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 11160 function stripAndCollapse( value ) { 11161 var tokens = value.match( rnothtmlwhite ) || []; 11162 return tokens.join( " " ); 11163 } 11164 11165 11166function getClass( elem ) { 11167 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 11168} 11169 11170function classesToArray( value ) { 11171 if ( Array.isArray( value ) ) { 11172 return value; 11173 } 11174 if ( typeof value === "string" ) { 11175 return value.match( rnothtmlwhite ) || []; 11176 } 11177 return []; 11178} 11179 11180jQuery.fn.extend( { 11181 addClass: function( value ) { 11182 var classNames, cur, curValue, className, i, finalValue; 11183 11184 if ( isFunction( value ) ) { 11185 return this.each( function( j ) { 11186 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 11187 } ); 11188 } 11189 11190 classNames = classesToArray( value ); 11191 11192 if ( classNames.length ) { 11193 return this.each( function() { 11194 curValue = getClass( this ); 11195 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 11196 11197 if ( cur ) { 11198 for ( i = 0; i < classNames.length; i++ ) { 11199 className = classNames[ i ]; 11200 if ( cur.indexOf( " " + className + " " ) < 0 ) { 11201 cur += className + " "; 11202 } 11203 } 11204 11205 // Only assign if different to avoid unneeded rendering. 11206 finalValue = stripAndCollapse( cur ); 11207 if ( curValue !== finalValue ) { 11208 this.setAttribute( "class", finalValue ); 11209 } 11210 } 11211 } ); 11212 } 11213 11214 return this; 11215 }, 11216 11217 removeClass: function( value ) { 11218 var classNames, cur, curValue, className, i, finalValue; 11219 11220 if ( isFunction( value ) ) { 11221 return this.each( function( j ) { 11222 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 11223 } ); 11224 } 11225 11226 if ( !arguments.length ) { 11227 return this.attr( "class", "" ); 11228 } 11229 11230 classNames = classesToArray( value ); 11231 11232 if ( classNames.length ) { 11233 return this.each( function() { 11234 curValue = getClass( this ); 11235 11236 // This expression is here for better compressibility (see addClass) 11237 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 11238 11239 if ( cur ) { 11240 for ( i = 0; i < classNames.length; i++ ) { 11241 className = classNames[ i ]; 11242 11243 // Remove *all* instances 11244 while ( cur.indexOf( " " + className + " " ) > -1 ) { 11245 cur = cur.replace( " " + className + " ", " " ); 11246 } 11247 } 11248 11249 // Only assign if different to avoid unneeded rendering. 11250 finalValue = stripAndCollapse( cur ); 11251 if ( curValue !== finalValue ) { 11252 this.setAttribute( "class", finalValue ); 11253 } 11254 } 11255 } ); 11256 } 11257 11258 return this; 11259 }, 11260 11261 toggleClass: function( value, stateVal ) { 11262 var classNames, className, i, self, 11263 type = typeof value, 11264 isValidValue = type === "string" || Array.isArray( value ); 11265 11266 if ( isFunction( value ) ) { 11267 return this.each( function( i ) { 11268 jQuery( this ).toggleClass( 11269 value.call( this, i, getClass( this ), stateVal ), 11270 stateVal 11271 ); 11272 } ); 11273 } 11274 11275 if ( typeof stateVal === "boolean" && isValidValue ) { 11276 return stateVal ? this.addClass( value ) : this.removeClass( value ); 11277 } 11278 11279 classNames = classesToArray( value ); 11280 11281 return this.each( function() { 11282 if ( isValidValue ) { 11283 11284 // Toggle individual class names 11285 self = jQuery( this ); 11286 11287 for ( i = 0; i < classNames.length; i++ ) { 11288 className = classNames[ i ]; 11289 11290 // Check each className given, space separated list 11291 if ( self.hasClass( className ) ) { 11292 self.removeClass( className ); 11293 } else { 11294 self.addClass( className ); 11295 } 11296 } 11297 11298 // Toggle whole class name 11299 } else if ( value === undefined || type === "boolean" ) { 11300 className = getClass( this ); 11301 if ( className ) { 11302 11303 // Store className if set 11304 dataPriv.set( this, "__className__", className ); 11305 } 11306 11307 // If the element has a class name or if we're passed `false`, 11308 // then remove the whole classname (if there was one, the above saved it). 11309 // Otherwise bring back whatever was previously saved (if anything), 11310 // falling back to the empty string if nothing was stored. 11311 if ( this.setAttribute ) { 11312 this.setAttribute( "class", 11313 className || value === false ? 11314 "" : 11315 dataPriv.get( this, "__className__" ) || "" 11316 ); 11317 } 11318 } 11319 } ); 11320 }, 11321 11322 hasClass: function( selector ) { 11323 var className, elem, 11324 i = 0; 11325 11326 className = " " + selector + " "; 11327 while ( ( elem = this[ i++ ] ) ) { 11328 if ( elem.nodeType === 1 && 11329 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 11330 return true; 11331 } 11332 } 11333 11334 return false; 11335 } 11336} ); 11337 11338 11339 11340 11341var rreturn = /\r/g; 11342 11343jQuery.fn.extend( { 11344 val: function( value ) { 11345 var hooks, ret, valueIsFunction, 11346 elem = this[ 0 ]; 11347 11348 if ( !arguments.length ) { 11349 if ( elem ) { 11350 hooks = jQuery.valHooks[ elem.type ] || 11351 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 11352 11353 if ( hooks && 11354 "get" in hooks && 11355 ( ret = hooks.get( elem, "value" ) ) !== undefined 11356 ) { 11357 return ret; 11358 } 11359 11360 ret = elem.value; 11361 11362 // Handle most common string cases 11363 if ( typeof ret === "string" ) { 11364 return ret.replace( rreturn, "" ); 11365 } 11366 11367 // Handle cases where value is null/undef or number 11368 return ret == null ? "" : ret; 11369 } 11370 11371 return; 11372 } 11373 11374 valueIsFunction = isFunction( value ); 11375 11376 return this.each( function( i ) { 11377 var val; 11378 11379 if ( this.nodeType !== 1 ) { 11380 return; 11381 } 11382 11383 if ( valueIsFunction ) { 11384 val = value.call( this, i, jQuery( this ).val() ); 11385 } else { 11386 val = value; 11387 } 11388 11389 // Treat null/undefined as ""; convert numbers to string 11390 if ( val == null ) { 11391 val = ""; 11392 11393 } else if ( typeof val === "number" ) { 11394 val += ""; 11395 11396 } else if ( Array.isArray( val ) ) { 11397 val = jQuery.map( val, function( value ) { 11398 return value == null ? "" : value + ""; 11399 } ); 11400 } 11401 11402 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 11403 11404 // If set returns undefined, fall back to normal setting 11405 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 11406 this.value = val; 11407 } 11408 } ); 11409 } 11410} ); 11411 11412jQuery.extend( { 11413 valHooks: { 11414 option: { 11415 get: function( elem ) { 11416 11417 var val = jQuery.find.attr( elem, "value" ); 11418 return val != null ? 11419 val : 11420 11421 // Support: IE <=10 - 11 only 11422 // option.text throws exceptions (trac-14686, trac-14858) 11423 // Strip and collapse whitespace 11424 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 11425 stripAndCollapse( jQuery.text( elem ) ); 11426 } 11427 }, 11428 select: { 11429 get: function( elem ) { 11430 var value, option, i, 11431 options = elem.options, 11432 index = elem.selectedIndex, 11433 one = elem.type === "select-one", 11434 values = one ? null : [], 11435 max = one ? index + 1 : options.length; 11436 11437 if ( index < 0 ) { 11438 i = max; 11439 11440 } else { 11441 i = one ? index : 0; 11442 } 11443 11444 // Loop through all the selected options 11445 for ( ; i < max; i++ ) { 11446 option = options[ i ]; 11447 11448 // Support: IE <=9 only 11449 // IE8-9 doesn't update selected after form reset (trac-2551) 11450 if ( ( option.selected || i === index ) && 11451 11452 // Don't return options that are disabled or in a disabled optgroup 11453 !option.disabled && 11454 ( !option.parentNode.disabled || 11455 !nodeName( option.parentNode, "optgroup" ) ) ) { 11456 11457 // Get the specific value for the option 11458 value = jQuery( option ).val(); 11459 11460 // We don't need an array for one selects 11461 if ( one ) { 11462 return value; 11463 } 11464 11465 // Multi-Selects return an array 11466 values.push( value ); 11467 } 11468 } 11469 11470 return values; 11471 }, 11472 11473 set: function( elem, value ) { 11474 var optionSet, option, 11475 options = elem.options, 11476 values = jQuery.makeArray( value ), 11477 i = options.length; 11478 11479 while ( i-- ) { 11480 option = options[ i ]; 11481 11482 /* eslint-disable no-cond-assign */ 11483 11484 if ( option.selected = 11485 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 11486 ) { 11487 optionSet = true; 11488 } 11489 11490 /* eslint-enable no-cond-assign */ 11491 } 11492 11493 // Force browsers to behave consistently when non-matching value is set 11494 if ( !optionSet ) { 11495 elem.selectedIndex = -1; 11496 } 11497 return values; 11498 } 11499 } 11500 } 11501} ); 11502 11503// Radios and checkboxes getter/setter 11504jQuery.each( [ "radio", "checkbox" ], function() { 11505 jQuery.valHooks[ this ] = { 11506 set: function( elem, value ) { 11507 if ( Array.isArray( value ) ) { 11508 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 11509 } 11510 } 11511 }; 11512 if ( !support.checkOn ) { 11513 jQuery.valHooks[ this ].get = function( elem ) { 11514 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 11515 }; 11516 } 11517} ); 11518 11519 11520 11521 11522// Return jQuery for attributes-only inclusion 11523var location = window.location; 11524 11525var nonce = { guid: Date.now() }; 11526 11527var rquery = ( /\?/ ); 11528 11529 11530 11531// Cross-browser xml parsing 11532jQuery.parseXML = function( data ) { 11533 var xml, parserErrorElem; 11534 if ( !data || typeof data !== "string" ) { 11535 return null; 11536 } 11537 11538 // Support: IE 9 - 11 only 11539 // IE throws on parseFromString with invalid input. 11540 try { 11541 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 11542 } catch ( e ) {} 11543 11544 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 11545 if ( !xml || parserErrorElem ) { 11546 jQuery.error( "Invalid XML: " + ( 11547 parserErrorElem ? 11548 jQuery.map( parserErrorElem.childNodes, function( el ) { 11549 return el.textContent; 11550 } ).join( "\n" ) : 11551 data 11552 ) ); 11553 } 11554 return xml; 11555}; 11556 11557 11558var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 11559 stopPropagationCallback = function( e ) { 11560 e.stopPropagation(); 11561 }; 11562 11563jQuery.extend( jQuery.event, { 11564 11565 trigger: function( event, data, elem, onlyHandlers ) { 11566 11567 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 11568 eventPath = [ elem || document ], 11569 type = hasOwn.call( event, "type" ) ? event.type : event, 11570 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 11571 11572 cur = lastElement = tmp = elem = elem || document; 11573 11574 // Don't do events on text and comment nodes 11575 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 11576 return; 11577 } 11578 11579 // focus/blur morphs to focusin/out; ensure we're not firing them right now 11580 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 11581 return; 11582 } 11583 11584 if ( type.indexOf( "." ) > -1 ) { 11585 11586 // Namespaced trigger; create a regexp to match event type in handle() 11587 namespaces = type.split( "." ); 11588 type = namespaces.shift(); 11589 namespaces.sort(); 11590 } 11591 ontype = type.indexOf( ":" ) < 0 && "on" + type; 11592 11593 // Caller can pass in a jQuery.Event object, Object, or just an event type string 11594 event = event[ jQuery.expando ] ? 11595 event : 11596 new jQuery.Event( type, typeof event === "object" && event ); 11597 11598 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 11599 event.isTrigger = onlyHandlers ? 2 : 3; 11600 event.namespace = namespaces.join( "." ); 11601 event.rnamespace = event.namespace ? 11602 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 11603 null; 11604 11605 // Clean up the event in case it is being reused 11606 event.result = undefined; 11607 if ( !event.target ) { 11608 event.target = elem; 11609 } 11610 11611 // Clone any incoming data and prepend the event, creating the handler arg list 11612 data = data == null ? 11613 [ event ] : 11614 jQuery.makeArray( data, [ event ] ); 11615 11616 // Allow special events to draw outside the lines 11617 special = jQuery.event.special[ type ] || {}; 11618 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 11619 return; 11620 } 11621 11622 // Determine event propagation path in advance, per W3C events spec (trac-9951) 11623 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 11624 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 11625 11626 bubbleType = special.delegateType || type; 11627 if ( !rfocusMorph.test( bubbleType + type ) ) { 11628 cur = cur.parentNode; 11629 } 11630 for ( ; cur; cur = cur.parentNode ) { 11631 eventPath.push( cur ); 11632 tmp = cur; 11633 } 11634 11635 // Only add window if we got to document (e.g., not plain obj or detached DOM) 11636 if ( tmp === ( elem.ownerDocument || document ) ) { 11637 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 11638 } 11639 } 11640 11641 // Fire handlers on the event path 11642 i = 0; 11643 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 11644 lastElement = cur; 11645 event.type = i > 1 ? 11646 bubbleType : 11647 special.bindType || type; 11648 11649 // jQuery handler 11650 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 11651 dataPriv.get( cur, "handle" ); 11652 if ( handle ) { 11653 handle.apply( cur, data ); 11654 } 11655 11656 // Native handler 11657 handle = ontype && cur[ ontype ]; 11658 if ( handle && handle.apply && acceptData( cur ) ) { 11659 event.result = handle.apply( cur, data ); 11660 if ( event.result === false ) { 11661 event.preventDefault(); 11662 } 11663 } 11664 } 11665 event.type = type; 11666 11667 // If nobody prevented the default action, do it now 11668 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 11669 11670 if ( ( !special._default || 11671 special._default.apply( eventPath.pop(), data ) === false ) && 11672 acceptData( elem ) ) { 11673 11674 // Call a native DOM method on the target with the same name as the event. 11675 // Don't do default actions on window, that's where global variables be (trac-6170) 11676 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 11677 11678 // Don't re-trigger an onFOO event when we call its FOO() method 11679 tmp = elem[ ontype ]; 11680 11681 if ( tmp ) { 11682 elem[ ontype ] = null; 11683 } 11684 11685 // Prevent re-triggering of the same event, since we already bubbled it above 11686 jQuery.event.triggered = type; 11687 11688 if ( event.isPropagationStopped() ) { 11689 lastElement.addEventListener( type, stopPropagationCallback ); 11690 } 11691 11692 elem[ type ](); 11693 11694 if ( event.isPropagationStopped() ) { 11695 lastElement.removeEventListener( type, stopPropagationCallback ); 11696 } 11697 11698 jQuery.event.triggered = undefined; 11699 11700 if ( tmp ) { 11701 elem[ ontype ] = tmp; 11702 } 11703 } 11704 } 11705 } 11706 11707 return event.result; 11708 }, 11709 11710 // Piggyback on a donor event to simulate a different one 11711 // Used only for `focus(in | out)` events 11712 simulate: function( type, elem, event ) { 11713 var e = jQuery.extend( 11714 new jQuery.Event(), 11715 event, 11716 { 11717 type: type, 11718 isSimulated: true 11719 } 11720 ); 11721 11722 jQuery.event.trigger( e, null, elem ); 11723 } 11724 11725} ); 11726 11727jQuery.fn.extend( { 11728 11729 trigger: function( type, data ) { 11730 return this.each( function() { 11731 jQuery.event.trigger( type, data, this ); 11732 } ); 11733 }, 11734 triggerHandler: function( type, data ) { 11735 var elem = this[ 0 ]; 11736 if ( elem ) { 11737 return jQuery.event.trigger( type, data, elem, true ); 11738 } 11739 } 11740} ); 11741 11742 11743var 11744 rbracket = /\[\]$/, 11745 rCRLF = /\r?\n/g, 11746 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 11747 rsubmittable = /^(?:input|select|textarea|keygen)/i; 11748 11749function buildParams( prefix, obj, traditional, add ) { 11750 var name; 11751 11752 if ( Array.isArray( obj ) ) { 11753 11754 // Serialize array item. 11755 jQuery.each( obj, function( i, v ) { 11756 if ( traditional || rbracket.test( prefix ) ) { 11757 11758 // Treat each array item as a scalar. 11759 add( prefix, v ); 11760 11761 } else { 11762 11763 // Item is non-scalar (array or object), encode its numeric index. 11764 buildParams( 11765 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 11766 v, 11767 traditional, 11768 add 11769 ); 11770 } 11771 } ); 11772 11773 } else if ( !traditional && toType( obj ) === "object" ) { 11774 11775 // Serialize object item. 11776 for ( name in obj ) { 11777 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 11778 } 11779 11780 } else { 11781 11782 // Serialize scalar item. 11783 add( prefix, obj ); 11784 } 11785} 11786 11787// Serialize an array of form elements or a set of 11788// key/values into a query string 11789jQuery.param = function( a, traditional ) { 11790 var prefix, 11791 s = [], 11792 add = function( key, valueOrFunction ) { 11793 11794 // If value is a function, invoke it and use its return value 11795 var value = isFunction( valueOrFunction ) ? 11796 valueOrFunction() : 11797 valueOrFunction; 11798 11799 s[ s.length ] = encodeURIComponent( key ) + "=" + 11800 encodeURIComponent( value == null ? "" : value ); 11801 }; 11802 11803 if ( a == null ) { 11804 return ""; 11805 } 11806 11807 // If an array was passed in, assume that it is an array of form elements. 11808 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 11809 11810 // Serialize the form elements 11811 jQuery.each( a, function() { 11812 add( this.name, this.value ); 11813 } ); 11814 11815 } else { 11816 11817 // If traditional, encode the "old" way (the way 1.3.2 or older 11818 // did it), otherwise encode params recursively. 11819 for ( prefix in a ) { 11820 buildParams( prefix, a[ prefix ], traditional, add ); 11821 } 11822 } 11823 11824 // Return the resulting serialization 11825 return s.join( "&" ); 11826}; 11827 11828jQuery.fn.extend( { 11829 serialize: function() { 11830 return jQuery.param( this.serializeArray() ); 11831 }, 11832 serializeArray: function() { 11833 return this.map( function() { 11834 11835 // Can add propHook for "elements" to filter or add form elements 11836 var elements = jQuery.prop( this, "elements" ); 11837 return elements ? jQuery.makeArray( elements ) : this; 11838 } ).filter( function() { 11839 var type = this.type; 11840 11841 // Use .is( ":disabled" ) so that fieldset[disabled] works 11842 return this.name && !jQuery( this ).is( ":disabled" ) && 11843 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 11844 ( this.checked || !rcheckableType.test( type ) ); 11845 } ).map( function( _i, elem ) { 11846 var val = jQuery( this ).val(); 11847 11848 if ( val == null ) { 11849 return null; 11850 } 11851 11852 if ( Array.isArray( val ) ) { 11853 return jQuery.map( val, function( val ) { 11854 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11855 } ); 11856 } 11857 11858 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11859 } ).get(); 11860 } 11861} ); 11862 11863 11864var 11865 r20 = /%20/g, 11866 rhash = /#.*$/, 11867 rantiCache = /([?&])_=[^&]*/, 11868 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 11869 11870 // trac-7653, trac-8125, trac-8152: local protocol detection 11871 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 11872 rnoContent = /^(?:GET|HEAD)$/, 11873 rprotocol = /^\/\//, 11874 11875 /* Prefilters 11876 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 11877 * 2) These are called: 11878 * - BEFORE asking for a transport 11879 * - AFTER param serialization (s.data is a string if s.processData is true) 11880 * 3) key is the dataType 11881 * 4) the catchall symbol "*" can be used 11882 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 11883 */ 11884 prefilters = {}, 11885 11886 /* Transports bindings 11887 * 1) key is the dataType 11888 * 2) the catchall symbol "*" can be used 11889 * 3) selection will start with transport dataType and THEN go to "*" if needed 11890 */ 11891 transports = {}, 11892 11893 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 11894 allTypes = "*/".concat( "*" ), 11895 11896 // Anchor tag for parsing the document origin 11897 originAnchor = document.createElement( "a" ); 11898 11899originAnchor.href = location.href; 11900 11901// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 11902function addToPrefiltersOrTransports( structure ) { 11903 11904 // dataTypeExpression is optional and defaults to "*" 11905 return function( dataTypeExpression, func ) { 11906 11907 if ( typeof dataTypeExpression !== "string" ) { 11908 func = dataTypeExpression; 11909 dataTypeExpression = "*"; 11910 } 11911 11912 var dataType, 11913 i = 0, 11914 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 11915 11916 if ( isFunction( func ) ) { 11917 11918 // For each dataType in the dataTypeExpression 11919 while ( ( dataType = dataTypes[ i++ ] ) ) { 11920 11921 // Prepend if requested 11922 if ( dataType[ 0 ] === "+" ) { 11923 dataType = dataType.slice( 1 ) || "*"; 11924 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 11925 11926 // Otherwise append 11927 } else { 11928 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 11929 } 11930 } 11931 } 11932 }; 11933} 11934 11935// Base inspection function for prefilters and transports 11936function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 11937 11938 var inspected = {}, 11939 seekingTransport = ( structure === transports ); 11940 11941 function inspect( dataType ) { 11942 var selected; 11943 inspected[ dataType ] = true; 11944 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 11945 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 11946 if ( typeof dataTypeOrTransport === "string" && 11947 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 11948 11949 options.dataTypes.unshift( dataTypeOrTransport ); 11950 inspect( dataTypeOrTransport ); 11951 return false; 11952 } else if ( seekingTransport ) { 11953 return !( selected = dataTypeOrTransport ); 11954 } 11955 } ); 11956 return selected; 11957 } 11958 11959 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 11960} 11961 11962// A special extend for ajax options 11963// that takes "flat" options (not to be deep extended) 11964// Fixes trac-9887 11965function ajaxExtend( target, src ) { 11966 var key, deep, 11967 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 11968 11969 for ( key in src ) { 11970 if ( src[ key ] !== undefined ) { 11971 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 11972 } 11973 } 11974 if ( deep ) { 11975 jQuery.extend( true, target, deep ); 11976 } 11977 11978 return target; 11979} 11980 11981/* Handles responses to an ajax request: 11982 * - finds the right dataType (mediates between content-type and expected dataType) 11983 * - returns the corresponding response 11984 */ 11985function ajaxHandleResponses( s, jqXHR, responses ) { 11986 11987 var ct, type, finalDataType, firstDataType, 11988 contents = s.contents, 11989 dataTypes = s.dataTypes; 11990 11991 // Remove auto dataType and get content-type in the process 11992 while ( dataTypes[ 0 ] === "*" ) { 11993 dataTypes.shift(); 11994 if ( ct === undefined ) { 11995 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 11996 } 11997 } 11998 11999 // Check if we're dealing with a known content-type 12000 if ( ct ) { 12001 for ( type in contents ) { 12002 if ( contents[ type ] && contents[ type ].test( ct ) ) { 12003 dataTypes.unshift( type ); 12004 break; 12005 } 12006 } 12007 } 12008 12009 // Check to see if we have a response for the expected dataType 12010 if ( dataTypes[ 0 ] in responses ) { 12011 finalDataType = dataTypes[ 0 ]; 12012 } else { 12013 12014 // Try convertible dataTypes 12015 for ( type in responses ) { 12016 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 12017 finalDataType = type; 12018 break; 12019 } 12020 if ( !firstDataType ) { 12021 firstDataType = type; 12022 } 12023 } 12024 12025 // Or just use first one 12026 finalDataType = finalDataType || firstDataType; 12027 } 12028 12029 // If we found a dataType 12030 // We add the dataType to the list if needed 12031 // and return the corresponding response 12032 if ( finalDataType ) { 12033 if ( finalDataType !== dataTypes[ 0 ] ) { 12034 dataTypes.unshift( finalDataType ); 12035 } 12036 return responses[ finalDataType ]; 12037 } 12038} 12039 12040/* Chain conversions given the request and the original response 12041 * Also sets the responseXXX fields on the jqXHR instance 12042 */ 12043function ajaxConvert( s, response, jqXHR, isSuccess ) { 12044 var conv2, current, conv, tmp, prev, 12045 converters = {}, 12046 12047 // Work with a copy of dataTypes in case we need to modify it for conversion 12048 dataTypes = s.dataTypes.slice(); 12049 12050 // Create converters map with lowercased keys 12051 if ( dataTypes[ 1 ] ) { 12052 for ( conv in s.converters ) { 12053 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 12054 } 12055 } 12056 12057 current = dataTypes.shift(); 12058 12059 // Convert to each sequential dataType 12060 while ( current ) { 12061 12062 if ( s.responseFields[ current ] ) { 12063 jqXHR[ s.responseFields[ current ] ] = response; 12064 } 12065 12066 // Apply the dataFilter if provided 12067 if ( !prev && isSuccess && s.dataFilter ) { 12068 response = s.dataFilter( response, s.dataType ); 12069 } 12070 12071 prev = current; 12072 current = dataTypes.shift(); 12073 12074 if ( current ) { 12075 12076 // There's only work to do if current dataType is non-auto 12077 if ( current === "*" ) { 12078 12079 current = prev; 12080 12081 // Convert response if prev dataType is non-auto and differs from current 12082 } else if ( prev !== "*" && prev !== current ) { 12083 12084 // Seek a direct converter 12085 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 12086 12087 // If none found, seek a pair 12088 if ( !conv ) { 12089 for ( conv2 in converters ) { 12090 12091 // If conv2 outputs current 12092 tmp = conv2.split( " " ); 12093 if ( tmp[ 1 ] === current ) { 12094 12095 // If prev can be converted to accepted input 12096 conv = converters[ prev + " " + tmp[ 0 ] ] || 12097 converters[ "* " + tmp[ 0 ] ]; 12098 if ( conv ) { 12099 12100 // Condense equivalence converters 12101 if ( conv === true ) { 12102 conv = converters[ conv2 ]; 12103 12104 // Otherwise, insert the intermediate dataType 12105 } else if ( converters[ conv2 ] !== true ) { 12106 current = tmp[ 0 ]; 12107 dataTypes.unshift( tmp[ 1 ] ); 12108 } 12109 break; 12110 } 12111 } 12112 } 12113 } 12114 12115 // Apply converter (if not an equivalence) 12116 if ( conv !== true ) { 12117 12118 // Unless errors are allowed to bubble, catch and return them 12119 if ( conv && s.throws ) { 12120 response = conv( response ); 12121 } else { 12122 try { 12123 response = conv( response ); 12124 } catch ( e ) { 12125 return { 12126 state: "parsererror", 12127 error: conv ? e : "No conversion from " + prev + " to " + current 12128 }; 12129 } 12130 } 12131 } 12132 } 12133 } 12134 } 12135 12136 return { state: "success", data: response }; 12137} 12138 12139jQuery.extend( { 12140 12141 // Counter for holding the number of active queries 12142 active: 0, 12143 12144 // Last-Modified header cache for next request 12145 lastModified: {}, 12146 etag: {}, 12147 12148 ajaxSettings: { 12149 url: location.href, 12150 type: "GET", 12151 isLocal: rlocalProtocol.test( location.protocol ), 12152 global: true, 12153 processData: true, 12154 async: true, 12155 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 12156 12157 /* 12158 timeout: 0, 12159 data: null, 12160 dataType: null, 12161 username: null, 12162 password: null, 12163 cache: null, 12164 throws: false, 12165 traditional: false, 12166 headers: {}, 12167 */ 12168 12169 accepts: { 12170 "*": allTypes, 12171 text: "text/plain", 12172 html: "text/html", 12173 xml: "application/xml, text/xml", 12174 json: "application/json, text/javascript" 12175 }, 12176 12177 contents: { 12178 xml: /\bxml\b/, 12179 html: /\bhtml/, 12180 json: /\bjson\b/ 12181 }, 12182 12183 responseFields: { 12184 xml: "responseXML", 12185 text: "responseText", 12186 json: "responseJSON" 12187 }, 12188 12189 // Data converters 12190 // Keys separate source (or catchall "*") and destination types with a single space 12191 converters: { 12192 12193 // Convert anything to text 12194 "* text": String, 12195 12196 // Text to html (true = no transformation) 12197 "text html": true, 12198 12199 // Evaluate text as a json expression 12200 "text json": JSON.parse, 12201 12202 // Parse text as xml 12203 "text xml": jQuery.parseXML 12204 }, 12205 12206 // For options that shouldn't be deep extended: 12207 // you can add your own custom options here if 12208 // and when you create one that shouldn't be 12209 // deep extended (see ajaxExtend) 12210 flatOptions: { 12211 url: true, 12212 context: true 12213 } 12214 }, 12215 12216 // Creates a full fledged settings object into target 12217 // with both ajaxSettings and settings fields. 12218 // If target is omitted, writes into ajaxSettings. 12219 ajaxSetup: function( target, settings ) { 12220 return settings ? 12221 12222 // Building a settings object 12223 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 12224 12225 // Extending ajaxSettings 12226 ajaxExtend( jQuery.ajaxSettings, target ); 12227 }, 12228 12229 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 12230 ajaxTransport: addToPrefiltersOrTransports( transports ), 12231 12232 // Main method 12233 ajax: function( url, options ) { 12234 12235 // If url is an object, simulate pre-1.5 signature 12236 if ( typeof url === "object" ) { 12237 options = url; 12238 url = undefined; 12239 } 12240 12241 // Force options to be an object 12242 options = options || {}; 12243 12244 var transport, 12245 12246 // URL without anti-cache param 12247 cacheURL, 12248 12249 // Response headers 12250 responseHeadersString, 12251 responseHeaders, 12252 12253 // timeout handle 12254 timeoutTimer, 12255 12256 // Url cleanup var 12257 urlAnchor, 12258 12259 // Request state (becomes false upon send and true upon completion) 12260 completed, 12261 12262 // To know if global events are to be dispatched 12263 fireGlobals, 12264 12265 // Loop variable 12266 i, 12267 12268 // uncached part of the url 12269 uncached, 12270 12271 // Create the final options object 12272 s = jQuery.ajaxSetup( {}, options ), 12273 12274 // Callbacks context 12275 callbackContext = s.context || s, 12276 12277 // Context for global events is callbackContext if it is a DOM node or jQuery collection 12278 globalEventContext = s.context && 12279 ( callbackContext.nodeType || callbackContext.jquery ) ? 12280 jQuery( callbackContext ) : 12281 jQuery.event, 12282 12283 // Deferreds 12284 deferred = jQuery.Deferred(), 12285 completeDeferred = jQuery.Callbacks( "once memory" ), 12286 12287 // Status-dependent callbacks 12288 statusCode = s.statusCode || {}, 12289 12290 // Headers (they are sent all at once) 12291 requestHeaders = {}, 12292 requestHeadersNames = {}, 12293 12294 // Default abort message 12295 strAbort = "canceled", 12296 12297 // Fake xhr 12298 jqXHR = { 12299 readyState: 0, 12300 12301 // Builds headers hashtable if needed 12302 getResponseHeader: function( key ) { 12303 var match; 12304 if ( completed ) { 12305 if ( !responseHeaders ) { 12306 responseHeaders = {}; 12307 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 12308 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 12309 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 12310 .concat( match[ 2 ] ); 12311 } 12312 } 12313 match = responseHeaders[ key.toLowerCase() + " " ]; 12314 } 12315 return match == null ? null : match.join( ", " ); 12316 }, 12317 12318 // Raw string 12319 getAllResponseHeaders: function() { 12320 return completed ? responseHeadersString : null; 12321 }, 12322 12323 // Caches the header 12324 setRequestHeader: function( name, value ) { 12325 if ( completed == null ) { 12326 name = requestHeadersNames[ name.toLowerCase() ] = 12327 requestHeadersNames[ name.toLowerCase() ] || name; 12328 requestHeaders[ name ] = value; 12329 } 12330 return this; 12331 }, 12332 12333 // Overrides response content-type header 12334 overrideMimeType: function( type ) { 12335 if ( completed == null ) { 12336 s.mimeType = type; 12337 } 12338 return this; 12339 }, 12340 12341 // Status-dependent callbacks 12342 statusCode: function( map ) { 12343 var code; 12344 if ( map ) { 12345 if ( completed ) { 12346 12347 // Execute the appropriate callbacks 12348 jqXHR.always( map[ jqXHR.status ] ); 12349 } else { 12350 12351 // Lazy-add the new callbacks in a way that preserves old ones 12352 for ( code in map ) { 12353 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 12354 } 12355 } 12356 } 12357 return this; 12358 }, 12359 12360 // Cancel the request 12361 abort: function( statusText ) { 12362 var finalText = statusText || strAbort; 12363 if ( transport ) { 12364 transport.abort( finalText ); 12365 } 12366 done( 0, finalText ); 12367 return this; 12368 } 12369 }; 12370 12371 // Attach deferreds 12372 deferred.promise( jqXHR ); 12373 12374 // Add protocol if not provided (prefilters might expect it) 12375 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 12376 // We also use the url parameter if available 12377 s.url = ( ( url || s.url || location.href ) + "" ) 12378 .replace( rprotocol, location.protocol + "//" ); 12379 12380 // Alias method option to type as per ticket trac-12004 12381 s.type = options.method || options.type || s.method || s.type; 12382 12383 // Extract dataTypes list 12384 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 12385 12386 // A cross-domain request is in order when the origin doesn't match the current origin. 12387 if ( s.crossDomain == null ) { 12388 urlAnchor = document.createElement( "a" ); 12389 12390 // Support: IE <=8 - 11, Edge 12 - 15 12391 // IE throws exception on accessing the href property if url is malformed, 12392 // e.g. http://example.com:80x/ 12393 try { 12394 urlAnchor.href = s.url; 12395 12396 // Support: IE <=8 - 11 only 12397 // Anchor's host property isn't correctly set when s.url is relative 12398 urlAnchor.href = urlAnchor.href; 12399 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 12400 urlAnchor.protocol + "//" + urlAnchor.host; 12401 } catch ( e ) { 12402 12403 // If there is an error parsing the URL, assume it is crossDomain, 12404 // it can be rejected by the transport if it is invalid 12405 s.crossDomain = true; 12406 } 12407 } 12408 12409 // Convert data if not already a string 12410 if ( s.data && s.processData && typeof s.data !== "string" ) { 12411 s.data = jQuery.param( s.data, s.traditional ); 12412 } 12413 12414 // Apply prefilters 12415 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 12416 12417 // If request was aborted inside a prefilter, stop there 12418 if ( completed ) { 12419 return jqXHR; 12420 } 12421 12422 // We can fire global events as of now if asked to 12423 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 12424 fireGlobals = jQuery.event && s.global; 12425 12426 // Watch for a new set of requests 12427 if ( fireGlobals && jQuery.active++ === 0 ) { 12428 jQuery.event.trigger( "ajaxStart" ); 12429 } 12430 12431 // Uppercase the type 12432 s.type = s.type.toUpperCase(); 12433 12434 // Determine if request has content 12435 s.hasContent = !rnoContent.test( s.type ); 12436 12437 // Save the URL in case we're toying with the If-Modified-Since 12438 // and/or If-None-Match header later on 12439 // Remove hash to simplify url manipulation 12440 cacheURL = s.url.replace( rhash, "" ); 12441 12442 // More options handling for requests with no content 12443 if ( !s.hasContent ) { 12444 12445 // Remember the hash so we can put it back 12446 uncached = s.url.slice( cacheURL.length ); 12447 12448 // If data is available and should be processed, append data to url 12449 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 12450 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 12451 12452 // trac-9682: remove data so that it's not used in an eventual retry 12453 delete s.data; 12454 } 12455 12456 // Add or update anti-cache param if needed 12457 if ( s.cache === false ) { 12458 cacheURL = cacheURL.replace( rantiCache, "$1" ); 12459 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 12460 uncached; 12461 } 12462 12463 // Put hash and anti-cache on the URL that will be requested (gh-1732) 12464 s.url = cacheURL + uncached; 12465 12466 // Change '%20' to '+' if this is encoded form body content (gh-2658) 12467 } else if ( s.data && s.processData && 12468 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 12469 s.data = s.data.replace( r20, "+" ); 12470 } 12471 12472 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 12473 if ( s.ifModified ) { 12474 if ( jQuery.lastModified[ cacheURL ] ) { 12475 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 12476 } 12477 if ( jQuery.etag[ cacheURL ] ) { 12478 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 12479 } 12480 } 12481 12482 // Set the correct header, if data is being sent 12483 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 12484 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 12485 } 12486 12487 // Set the Accepts header for the server, depending on the dataType 12488 jqXHR.setRequestHeader( 12489 "Accept", 12490 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 12491 s.accepts[ s.dataTypes[ 0 ] ] + 12492 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 12493 s.accepts[ "*" ] 12494 ); 12495 12496 // Check for headers option 12497 for ( i in s.headers ) { 12498 jqXHR.setRequestHeader( i, s.headers[ i ] ); 12499 } 12500 12501 // Allow custom headers/mimetypes and early abort 12502 if ( s.beforeSend && 12503 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 12504 12505 // Abort if not done already and return 12506 return jqXHR.abort(); 12507 } 12508 12509 // Aborting is no longer a cancellation 12510 strAbort = "abort"; 12511 12512 // Install callbacks on deferreds 12513 completeDeferred.add( s.complete ); 12514 jqXHR.done( s.success ); 12515 jqXHR.fail( s.error ); 12516 12517 // Get transport 12518 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 12519 12520 // If no transport, we auto-abort 12521 if ( !transport ) { 12522 done( -1, "No Transport" ); 12523 } else { 12524 jqXHR.readyState = 1; 12525 12526 // Send global event 12527 if ( fireGlobals ) { 12528 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 12529 } 12530 12531 // If request was aborted inside ajaxSend, stop there 12532 if ( completed ) { 12533 return jqXHR; 12534 } 12535 12536 // Timeout 12537 if ( s.async && s.timeout > 0 ) { 12538 timeoutTimer = window.setTimeout( function() { 12539 jqXHR.abort( "timeout" ); 12540 }, s.timeout ); 12541 } 12542 12543 try { 12544 completed = false; 12545 transport.send( requestHeaders, done ); 12546 } catch ( e ) { 12547 12548 // Rethrow post-completion exceptions 12549 if ( completed ) { 12550 throw e; 12551 } 12552 12553 // Propagate others as results 12554 done( -1, e ); 12555 } 12556 } 12557 12558 // Callback for when everything is done 12559 function done( status, nativeStatusText, responses, headers ) { 12560 var isSuccess, success, error, response, modified, 12561 statusText = nativeStatusText; 12562 12563 // Ignore repeat invocations 12564 if ( completed ) { 12565 return; 12566 } 12567 12568 completed = true; 12569 12570 // Clear timeout if it exists 12571 if ( timeoutTimer ) { 12572 window.clearTimeout( timeoutTimer ); 12573 } 12574 12575 // Dereference transport for early garbage collection 12576 // (no matter how long the jqXHR object will be used) 12577 transport = undefined; 12578 12579 // Cache response headers 12580 responseHeadersString = headers || ""; 12581 12582 // Set readyState 12583 jqXHR.readyState = status > 0 ? 4 : 0; 12584 12585 // Determine if successful 12586 isSuccess = status >= 200 && status < 300 || status === 304; 12587 12588 // Get response data 12589 if ( responses ) { 12590 response = ajaxHandleResponses( s, jqXHR, responses ); 12591 } 12592 12593 // Use a noop converter for missing script but not if jsonp 12594 if ( !isSuccess && 12595 jQuery.inArray( "script", s.dataTypes ) > -1 && 12596 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 12597 s.converters[ "text script" ] = function() {}; 12598 } 12599 12600 // Convert no matter what (that way responseXXX fields are always set) 12601 response = ajaxConvert( s, response, jqXHR, isSuccess ); 12602 12603 // If successful, handle type chaining 12604 if ( isSuccess ) { 12605 12606 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 12607 if ( s.ifModified ) { 12608 modified = jqXHR.getResponseHeader( "Last-Modified" ); 12609 if ( modified ) { 12610 jQuery.lastModified[ cacheURL ] = modified; 12611 } 12612 modified = jqXHR.getResponseHeader( "etag" ); 12613 if ( modified ) { 12614 jQuery.etag[ cacheURL ] = modified; 12615 } 12616 } 12617 12618 // if no content 12619 if ( status === 204 || s.type === "HEAD" ) { 12620 statusText = "nocontent"; 12621 12622 // if not modified 12623 } else if ( status === 304 ) { 12624 statusText = "notmodified"; 12625 12626 // If we have data, let's convert it 12627 } else { 12628 statusText = response.state; 12629 success = response.data; 12630 error = response.error; 12631 isSuccess = !error; 12632 } 12633 } else { 12634 12635 // Extract error from statusText and normalize for non-aborts 12636 error = statusText; 12637 if ( status || !statusText ) { 12638 statusText = "error"; 12639 if ( status < 0 ) { 12640 status = 0; 12641 } 12642 } 12643 } 12644 12645 // Set data for the fake xhr object 12646 jqXHR.status = status; 12647 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 12648 12649 // Success/Error 12650 if ( isSuccess ) { 12651 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 12652 } else { 12653 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 12654 } 12655 12656 // Status-dependent callbacks 12657 jqXHR.statusCode( statusCode ); 12658 statusCode = undefined; 12659 12660 if ( fireGlobals ) { 12661 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 12662 [ jqXHR, s, isSuccess ? success : error ] ); 12663 } 12664 12665 // Complete 12666 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 12667 12668 if ( fireGlobals ) { 12669 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 12670 12671 // Handle the global AJAX counter 12672 if ( !( --jQuery.active ) ) { 12673 jQuery.event.trigger( "ajaxStop" ); 12674 } 12675 } 12676 } 12677 12678 return jqXHR; 12679 }, 12680 12681 getJSON: function( url, data, callback ) { 12682 return jQuery.get( url, data, callback, "json" ); 12683 }, 12684 12685 getScript: function( url, callback ) { 12686 return jQuery.get( url, undefined, callback, "script" ); 12687 } 12688} ); 12689 12690jQuery.each( [ "get", "post" ], function( _i, method ) { 12691 jQuery[ method ] = function( url, data, callback, type ) { 12692 12693 // Shift arguments if data argument was omitted 12694 if ( isFunction( data ) ) { 12695 type = type || callback; 12696 callback = data; 12697 data = undefined; 12698 } 12699 12700 // The url can be an options object (which then must have .url) 12701 return jQuery.ajax( jQuery.extend( { 12702 url: url, 12703 type: method, 12704 dataType: type, 12705 data: data, 12706 success: callback 12707 }, jQuery.isPlainObject( url ) && url ) ); 12708 }; 12709} ); 12710 12711jQuery.ajaxPrefilter( function( s ) { 12712 var i; 12713 for ( i in s.headers ) { 12714 if ( i.toLowerCase() === "content-type" ) { 12715 s.contentType = s.headers[ i ] || ""; 12716 } 12717 } 12718} ); 12719 12720 12721jQuery._evalUrl = function( url, options, doc ) { 12722 return jQuery.ajax( { 12723 url: url, 12724 12725 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 12726 type: "GET", 12727 dataType: "script", 12728 cache: true, 12729 async: false, 12730 global: false, 12731 12732 // Only evaluate the response if it is successful (gh-4126) 12733 // dataFilter is not invoked for failure responses, so using it instead 12734 // of the default converter is kludgy but it works. 12735 converters: { 12736 "text script": function() {} 12737 }, 12738 dataFilter: function( response ) { 12739 jQuery.globalEval( response, options, doc ); 12740 } 12741 } ); 12742}; 12743 12744 12745jQuery.fn.extend( { 12746 wrapAll: function( html ) { 12747 var wrap; 12748 12749 if ( this[ 0 ] ) { 12750 if ( isFunction( html ) ) { 12751 html = html.call( this[ 0 ] ); 12752 } 12753 12754 // The elements to wrap the target around 12755 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 12756 12757 if ( this[ 0 ].parentNode ) { 12758 wrap.insertBefore( this[ 0 ] ); 12759 } 12760 12761 wrap.map( function() { 12762 var elem = this; 12763 12764 while ( elem.firstElementChild ) { 12765 elem = elem.firstElementChild; 12766 } 12767 12768 return elem; 12769 } ).append( this ); 12770 } 12771 12772 return this; 12773 }, 12774 12775 wrapInner: function( html ) { 12776 if ( isFunction( html ) ) { 12777 return this.each( function( i ) { 12778 jQuery( this ).wrapInner( html.call( this, i ) ); 12779 } ); 12780 } 12781 12782 return this.each( function() { 12783 var self = jQuery( this ), 12784 contents = self.contents(); 12785 12786 if ( contents.length ) { 12787 contents.wrapAll( html ); 12788 12789 } else { 12790 self.append( html ); 12791 } 12792 } ); 12793 }, 12794 12795 wrap: function( html ) { 12796 var htmlIsFunction = isFunction( html ); 12797 12798 return this.each( function( i ) { 12799 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 12800 } ); 12801 }, 12802 12803 unwrap: function( selector ) { 12804 this.parent( selector ).not( "body" ).each( function() { 12805 jQuery( this ).replaceWith( this.childNodes ); 12806 } ); 12807 return this; 12808 } 12809} ); 12810 12811 12812jQuery.expr.pseudos.hidden = function( elem ) { 12813 return !jQuery.expr.pseudos.visible( elem ); 12814}; 12815jQuery.expr.pseudos.visible = function( elem ) { 12816 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 12817}; 12818 12819 12820 12821 12822jQuery.ajaxSettings.xhr = function() { 12823 try { 12824 return new window.XMLHttpRequest(); 12825 } catch ( e ) {} 12826}; 12827 12828var xhrSuccessStatus = { 12829 12830 // File protocol always yields status code 0, assume 200 12831 0: 200, 12832 12833 // Support: IE <=9 only 12834 // trac-1450: sometimes IE returns 1223 when it should be 204 12835 1223: 204 12836 }, 12837 xhrSupported = jQuery.ajaxSettings.xhr(); 12838 12839support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 12840support.ajax = xhrSupported = !!xhrSupported; 12841 12842jQuery.ajaxTransport( function( options ) { 12843 var callback, errorCallback; 12844 12845 // Cross domain only allowed if supported through XMLHttpRequest 12846 if ( support.cors || xhrSupported && !options.crossDomain ) { 12847 return { 12848 send: function( headers, complete ) { 12849 var i, 12850 xhr = options.xhr(); 12851 12852 xhr.open( 12853 options.type, 12854 options.url, 12855 options.async, 12856 options.username, 12857 options.password 12858 ); 12859 12860 // Apply custom fields if provided 12861 if ( options.xhrFields ) { 12862 for ( i in options.xhrFields ) { 12863 xhr[ i ] = options.xhrFields[ i ]; 12864 } 12865 } 12866 12867 // Override mime type if needed 12868 if ( options.mimeType && xhr.overrideMimeType ) { 12869 xhr.overrideMimeType( options.mimeType ); 12870 } 12871 12872 // X-Requested-With header 12873 // For cross-domain requests, seeing as conditions for a preflight are 12874 // akin to a jigsaw puzzle, we simply never set it to be sure. 12875 // (it can always be set on a per-request basis or even using ajaxSetup) 12876 // For same-domain requests, won't change header if already provided. 12877 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 12878 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 12879 } 12880 12881 // Set headers 12882 for ( i in headers ) { 12883 xhr.setRequestHeader( i, headers[ i ] ); 12884 } 12885 12886 // Callback 12887 callback = function( type ) { 12888 return function() { 12889 if ( callback ) { 12890 callback = errorCallback = xhr.onload = 12891 xhr.onerror = xhr.onabort = xhr.ontimeout = 12892 xhr.onreadystatechange = null; 12893 12894 if ( type === "abort" ) { 12895 xhr.abort(); 12896 } else if ( type === "error" ) { 12897 12898 // Support: IE <=9 only 12899 // On a manual native abort, IE9 throws 12900 // errors on any property access that is not readyState 12901 if ( typeof xhr.status !== "number" ) { 12902 complete( 0, "error" ); 12903 } else { 12904 complete( 12905 12906 // File: protocol always yields status 0; see trac-8605, trac-14207 12907 xhr.status, 12908 xhr.statusText 12909 ); 12910 } 12911 } else { 12912 complete( 12913 xhrSuccessStatus[ xhr.status ] || xhr.status, 12914 xhr.statusText, 12915 12916 // Support: IE <=9 only 12917 // IE9 has no XHR2 but throws on binary (trac-11426) 12918 // For XHR2 non-text, let the caller handle it (gh-2498) 12919 ( xhr.responseType || "text" ) !== "text" || 12920 typeof xhr.responseText !== "string" ? 12921 { binary: xhr.response } : 12922 { text: xhr.responseText }, 12923 xhr.getAllResponseHeaders() 12924 ); 12925 } 12926 } 12927 }; 12928 }; 12929 12930 // Listen to events 12931 xhr.onload = callback(); 12932 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 12933 12934 // Support: IE 9 only 12935 // Use onreadystatechange to replace onabort 12936 // to handle uncaught aborts 12937 if ( xhr.onabort !== undefined ) { 12938 xhr.onabort = errorCallback; 12939 } else { 12940 xhr.onreadystatechange = function() { 12941 12942 // Check readyState before timeout as it changes 12943 if ( xhr.readyState === 4 ) { 12944 12945 // Allow onerror to be called first, 12946 // but that will not handle a native abort 12947 // Also, save errorCallback to a variable 12948 // as xhr.onerror cannot be accessed 12949 window.setTimeout( function() { 12950 if ( callback ) { 12951 errorCallback(); 12952 } 12953 } ); 12954 } 12955 }; 12956 } 12957 12958 // Create the abort callback 12959 callback = callback( "abort" ); 12960 12961 try { 12962 12963 // Do send the request (this may raise an exception) 12964 xhr.send( options.hasContent && options.data || null ); 12965 } catch ( e ) { 12966 12967 // trac-14683: Only rethrow if this hasn't been notified as an error yet 12968 if ( callback ) { 12969 throw e; 12970 } 12971 } 12972 }, 12973 12974 abort: function() { 12975 if ( callback ) { 12976 callback(); 12977 } 12978 } 12979 }; 12980 } 12981} ); 12982 12983 12984 12985 12986// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 12987jQuery.ajaxPrefilter( function( s ) { 12988 if ( s.crossDomain ) { 12989 s.contents.script = false; 12990 } 12991} ); 12992 12993// Install script dataType 12994jQuery.ajaxSetup( { 12995 accepts: { 12996 script: "text/javascript, application/javascript, " + 12997 "application/ecmascript, application/x-ecmascript" 12998 }, 12999 contents: { 13000 script: /\b(?:java|ecma)script\b/ 13001 }, 13002 converters: { 13003 "text script": function( text ) { 13004 jQuery.globalEval( text ); 13005 return text; 13006 } 13007 } 13008} ); 13009 13010// Handle cache's special case and crossDomain 13011jQuery.ajaxPrefilter( "script", function( s ) { 13012 if ( s.cache === undefined ) { 13013 s.cache = false; 13014 } 13015 if ( s.crossDomain ) { 13016 s.type = "GET"; 13017 } 13018} ); 13019 13020// Bind script tag hack transport 13021jQuery.ajaxTransport( "script", function( s ) { 13022 13023 // This transport only deals with cross domain or forced-by-attrs requests 13024 if ( s.crossDomain || s.scriptAttrs ) { 13025 var script, callback; 13026 return { 13027 send: function( _, complete ) { 13028 script = jQuery( "<script>" ) 13029 .attr( s.scriptAttrs || {} ) 13030 .prop( { charset: s.scriptCharset, src: s.url } ) 13031 .on( "load error", callback = function( evt ) { 13032 script.remove(); 13033 callback = null; 13034 if ( evt ) { 13035 complete( evt.type === "error" ? 404 : 200, evt.type ); 13036 } 13037 } ); 13038 13039 // Use native DOM manipulation to avoid our domManip AJAX trickery 13040 document.head.appendChild( script[ 0 ] ); 13041 }, 13042 abort: function() { 13043 if ( callback ) { 13044 callback(); 13045 } 13046 } 13047 }; 13048 } 13049} ); 13050 13051 13052 13053 13054var oldCallbacks = [], 13055 rjsonp = /(=)\?(?=&|$)|\?\?/; 13056 13057// Default jsonp settings 13058jQuery.ajaxSetup( { 13059 jsonp: "callback", 13060 jsonpCallback: function() { 13061 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 13062 this[ callback ] = true; 13063 return callback; 13064 } 13065} ); 13066 13067// Detect, normalize options and install callbacks for jsonp requests 13068jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 13069 13070 var callbackName, overwritten, responseContainer, 13071 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 13072 "url" : 13073 typeof s.data === "string" && 13074 ( s.contentType || "" ) 13075 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 13076 rjsonp.test( s.data ) && "data" 13077 ); 13078 13079 // Handle iff the expected data type is "jsonp" or we have a parameter to set 13080 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 13081 13082 // Get callback name, remembering preexisting value associated with it 13083 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 13084 s.jsonpCallback() : 13085 s.jsonpCallback; 13086 13087 // Insert callback into url or form data 13088 if ( jsonProp ) { 13089 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 13090 } else if ( s.jsonp !== false ) { 13091 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 13092 } 13093 13094 // Use data converter to retrieve json after script execution 13095 s.converters[ "script json" ] = function() { 13096 if ( !responseContainer ) { 13097 jQuery.error( callbackName + " was not called" ); 13098 } 13099 return responseContainer[ 0 ]; 13100 }; 13101 13102 // Force json dataType 13103 s.dataTypes[ 0 ] = "json"; 13104 13105 // Install callback 13106 overwritten = window[ callbackName ]; 13107 window[ callbackName ] = function() { 13108 responseContainer = arguments; 13109 }; 13110 13111 // Clean-up function (fires after converters) 13112 jqXHR.always( function() { 13113 13114 // If previous value didn't exist - remove it 13115 if ( overwritten === undefined ) { 13116 jQuery( window ).removeProp( callbackName ); 13117 13118 // Otherwise restore preexisting value 13119 } else { 13120 window[ callbackName ] = overwritten; 13121 } 13122 13123 // Save back as free 13124 if ( s[ callbackName ] ) { 13125 13126 // Make sure that re-using the options doesn't screw things around 13127 s.jsonpCallback = originalSettings.jsonpCallback; 13128 13129 // Save the callback name for future use 13130 oldCallbacks.push( callbackName ); 13131 } 13132 13133 // Call if it was a function and we have a response 13134 if ( responseContainer && isFunction( overwritten ) ) { 13135 overwritten( responseContainer[ 0 ] ); 13136 } 13137 13138 responseContainer = overwritten = undefined; 13139 } ); 13140 13141 // Delegate to script 13142 return "script"; 13143 } 13144} ); 13145 13146 13147 13148 13149// Support: Safari 8 only 13150// In Safari 8 documents created via document.implementation.createHTMLDocument 13151// collapse sibling forms: the second one becomes a child of the first one. 13152// Because of that, this security measure has to be disabled in Safari 8. 13153// https://bugs.webkit.org/show_bug.cgi?id=137337 13154support.createHTMLDocument = ( function() { 13155 var body = document.implementation.createHTMLDocument( "" ).body; 13156 body.innerHTML = "<form></form><form></form>"; 13157 return body.childNodes.length === 2; 13158} )(); 13159 13160 13161// Argument "data" should be string of html 13162// context (optional): If specified, the fragment will be created in this context, 13163// defaults to document 13164// keepScripts (optional): If true, will include scripts passed in the html string 13165jQuery.parseHTML = function( data, context, keepScripts ) { 13166 if ( typeof data !== "string" ) { 13167 return []; 13168 } 13169 if ( typeof context === "boolean" ) { 13170 keepScripts = context; 13171 context = false; 13172 } 13173 13174 var base, parsed, scripts; 13175 13176 if ( !context ) { 13177 13178 // Stop scripts or inline event handlers from being executed immediately 13179 // by using document.implementation 13180 if ( support.createHTMLDocument ) { 13181 context = document.implementation.createHTMLDocument( "" ); 13182 13183 // Set the base href for the created document 13184 // so any parsed elements with URLs 13185 // are based on the document's URL (gh-2965) 13186 base = context.createElement( "base" ); 13187 base.href = document.location.href; 13188 context.head.appendChild( base ); 13189 } else { 13190 context = document; 13191 } 13192 } 13193 13194 parsed = rsingleTag.exec( data ); 13195 scripts = !keepScripts && []; 13196 13197 // Single tag 13198 if ( parsed ) { 13199 return [ context.createElement( parsed[ 1 ] ) ]; 13200 } 13201 13202 parsed = buildFragment( [ data ], context, scripts ); 13203 13204 if ( scripts && scripts.length ) { 13205 jQuery( scripts ).remove(); 13206 } 13207 13208 return jQuery.merge( [], parsed.childNodes ); 13209}; 13210 13211 13212/** 13213 * Load a url into a page 13214 */ 13215jQuery.fn.load = function( url, params, callback ) { 13216 var selector, type, response, 13217 self = this, 13218 off = url.indexOf( " " ); 13219 13220 if ( off > -1 ) { 13221 selector = stripAndCollapse( url.slice( off ) ); 13222 url = url.slice( 0, off ); 13223 } 13224 13225 // If it's a function 13226 if ( isFunction( params ) ) { 13227 13228 // We assume that it's the callback 13229 callback = params; 13230 params = undefined; 13231 13232 // Otherwise, build a param string 13233 } else if ( params && typeof params === "object" ) { 13234 type = "POST"; 13235 } 13236 13237 // If we have elements to modify, make the request 13238 if ( self.length > 0 ) { 13239 jQuery.ajax( { 13240 url: url, 13241 13242 // If "type" variable is undefined, then "GET" method will be used. 13243 // Make value of this field explicit since 13244 // user can override it through ajaxSetup method 13245 type: type || "GET", 13246 dataType: "html", 13247 data: params 13248 } ).done( function( responseText ) { 13249 13250 // Save response for use in complete callback 13251 response = arguments; 13252 13253 self.html( selector ? 13254 13255 // If a selector was specified, locate the right elements in a dummy div 13256 // Exclude scripts to avoid IE 'Permission Denied' errors 13257 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 13258 13259 // Otherwise use the full result 13260 responseText ); 13261 13262 // If the request succeeds, this function gets "data", "status", "jqXHR" 13263 // but they are ignored because response was set above. 13264 // If it fails, this function gets "jqXHR", "status", "error" 13265 } ).always( callback && function( jqXHR, status ) { 13266 self.each( function() { 13267 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 13268 } ); 13269 } ); 13270 } 13271 13272 return this; 13273}; 13274 13275 13276 13277 13278jQuery.expr.pseudos.animated = function( elem ) { 13279 return jQuery.grep( jQuery.timers, function( fn ) { 13280 return elem === fn.elem; 13281 } ).length; 13282}; 13283 13284 13285 13286 13287jQuery.offset = { 13288 setOffset: function( elem, options, i ) { 13289 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 13290 position = jQuery.css( elem, "position" ), 13291 curElem = jQuery( elem ), 13292 props = {}; 13293 13294 // Set position first, in-case top/left are set even on static elem 13295 if ( position === "static" ) { 13296 elem.style.position = "relative"; 13297 } 13298 13299 curOffset = curElem.offset(); 13300 curCSSTop = jQuery.css( elem, "top" ); 13301 curCSSLeft = jQuery.css( elem, "left" ); 13302 calculatePosition = ( position === "absolute" || position === "fixed" ) && 13303 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 13304 13305 // Need to be able to calculate position if either 13306 // top or left is auto and position is either absolute or fixed 13307 if ( calculatePosition ) { 13308 curPosition = curElem.position(); 13309 curTop = curPosition.top; 13310 curLeft = curPosition.left; 13311 13312 } else { 13313 curTop = parseFloat( curCSSTop ) || 0; 13314 curLeft = parseFloat( curCSSLeft ) || 0; 13315 } 13316 13317 if ( isFunction( options ) ) { 13318 13319 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 13320 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 13321 } 13322 13323 if ( options.top != null ) { 13324 props.top = ( options.top - curOffset.top ) + curTop; 13325 } 13326 if ( options.left != null ) { 13327 props.left = ( options.left - curOffset.left ) + curLeft; 13328 } 13329 13330 if ( "using" in options ) { 13331 options.using.call( elem, props ); 13332 13333 } else { 13334 curElem.css( props ); 13335 } 13336 } 13337}; 13338 13339jQuery.fn.extend( { 13340 13341 // offset() relates an element's border box to the document origin 13342 offset: function( options ) { 13343 13344 // Preserve chaining for setter 13345 if ( arguments.length ) { 13346 return options === undefined ? 13347 this : 13348 this.each( function( i ) { 13349 jQuery.offset.setOffset( this, options, i ); 13350 } ); 13351 } 13352 13353 var rect, win, 13354 elem = this[ 0 ]; 13355 13356 if ( !elem ) { 13357 return; 13358 } 13359 13360 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 13361 // Support: IE <=11 only 13362 // Running getBoundingClientRect on a 13363 // disconnected node in IE throws an error 13364 if ( !elem.getClientRects().length ) { 13365 return { top: 0, left: 0 }; 13366 } 13367 13368 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 13369 rect = elem.getBoundingClientRect(); 13370 win = elem.ownerDocument.defaultView; 13371 return { 13372 top: rect.top + win.pageYOffset, 13373 left: rect.left + win.pageXOffset 13374 }; 13375 }, 13376 13377 // position() relates an element's margin box to its offset parent's padding box 13378 // This corresponds to the behavior of CSS absolute positioning 13379 position: function() { 13380 if ( !this[ 0 ] ) { 13381 return; 13382 } 13383 13384 var offsetParent, offset, doc, 13385 elem = this[ 0 ], 13386 parentOffset = { top: 0, left: 0 }; 13387 13388 // position:fixed elements are offset from the viewport, which itself always has zero offset 13389 if ( jQuery.css( elem, "position" ) === "fixed" ) { 13390 13391 // Assume position:fixed implies availability of getBoundingClientRect 13392 offset = elem.getBoundingClientRect(); 13393 13394 } else { 13395 offset = this.offset(); 13396 13397 // Account for the *real* offset parent, which can be the document or its root element 13398 // when a statically positioned element is identified 13399 doc = elem.ownerDocument; 13400 offsetParent = elem.offsetParent || doc.documentElement; 13401 while ( offsetParent && 13402 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 13403 jQuery.css( offsetParent, "position" ) === "static" ) { 13404 13405 offsetParent = offsetParent.parentNode; 13406 } 13407 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 13408 13409 // Incorporate borders into its offset, since they are outside its content origin 13410 parentOffset = jQuery( offsetParent ).offset(); 13411 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 13412 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 13413 } 13414 } 13415 13416 // Subtract parent offsets and element margins 13417 return { 13418 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 13419 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 13420 }; 13421 }, 13422 13423 // This method will return documentElement in the following cases: 13424 // 1) For the element inside the iframe without offsetParent, this method will return 13425 // documentElement of the parent window 13426 // 2) For the hidden or detached element 13427 // 3) For body or html element, i.e. in case of the html node - it will return itself 13428 // 13429 // but those exceptions were never presented as a real life use-cases 13430 // and might be considered as more preferable results. 13431 // 13432 // This logic, however, is not guaranteed and can change at any point in the future 13433 offsetParent: function() { 13434 return this.map( function() { 13435 var offsetParent = this.offsetParent; 13436 13437 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 13438 offsetParent = offsetParent.offsetParent; 13439 } 13440 13441 return offsetParent || documentElement; 13442 } ); 13443 } 13444} ); 13445 13446// Create scrollLeft and scrollTop methods 13447jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 13448 var top = "pageYOffset" === prop; 13449 13450 jQuery.fn[ method ] = function( val ) { 13451 return access( this, function( elem, method, val ) { 13452 13453 // Coalesce documents and windows 13454 var win; 13455 if ( isWindow( elem ) ) { 13456 win = elem; 13457 } else if ( elem.nodeType === 9 ) { 13458 win = elem.defaultView; 13459 } 13460 13461 if ( val === undefined ) { 13462 return win ? win[ prop ] : elem[ method ]; 13463 } 13464 13465 if ( win ) { 13466 win.scrollTo( 13467 !top ? val : win.pageXOffset, 13468 top ? val : win.pageYOffset 13469 ); 13470 13471 } else { 13472 elem[ method ] = val; 13473 } 13474 }, method, val, arguments.length ); 13475 }; 13476} ); 13477 13478// Support: Safari <=7 - 9.1, Chrome <=37 - 49 13479// Add the top/left cssHooks using jQuery.fn.position 13480// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 13481// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 13482// getComputedStyle returns percent when specified for top/left/bottom/right; 13483// rather than make the css module depend on the offset module, just check for it here 13484jQuery.each( [ "top", "left" ], function( _i, prop ) { 13485 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 13486 function( elem, computed ) { 13487 if ( computed ) { 13488 computed = curCSS( elem, prop ); 13489 13490 // If curCSS returns percentage, fallback to offset 13491 return rnumnonpx.test( computed ) ? 13492 jQuery( elem ).position()[ prop ] + "px" : 13493 computed; 13494 } 13495 } 13496 ); 13497} ); 13498 13499 13500// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 13501jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 13502 jQuery.each( { 13503 padding: "inner" + name, 13504 content: type, 13505 "": "outer" + name 13506 }, function( defaultExtra, funcName ) { 13507 13508 // Margin is only for outerHeight, outerWidth 13509 jQuery.fn[ funcName ] = function( margin, value ) { 13510 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 13511 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 13512 13513 return access( this, function( elem, type, value ) { 13514 var doc; 13515 13516 if ( isWindow( elem ) ) { 13517 13518 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 13519 return funcName.indexOf( "outer" ) === 0 ? 13520 elem[ "inner" + name ] : 13521 elem.document.documentElement[ "client" + name ]; 13522 } 13523 13524 // Get document width or height 13525 if ( elem.nodeType === 9 ) { 13526 doc = elem.documentElement; 13527 13528 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 13529 // whichever is greatest 13530 return Math.max( 13531 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 13532 elem.body[ "offset" + name ], doc[ "offset" + name ], 13533 doc[ "client" + name ] 13534 ); 13535 } 13536 13537 return value === undefined ? 13538 13539 // Get width or height on the element, requesting but not forcing parseFloat 13540 jQuery.css( elem, type, extra ) : 13541 13542 // Set width or height on the element 13543 jQuery.style( elem, type, value, extra ); 13544 }, type, chainable ? margin : undefined, chainable ); 13545 }; 13546 } ); 13547} ); 13548 13549 13550jQuery.each( [ 13551 "ajaxStart", 13552 "ajaxStop", 13553 "ajaxComplete", 13554 "ajaxError", 13555 "ajaxSuccess", 13556 "ajaxSend" 13557], function( _i, type ) { 13558 jQuery.fn[ type ] = function( fn ) { 13559 return this.on( type, fn ); 13560 }; 13561} ); 13562 13563 13564 13565 13566jQuery.fn.extend( { 13567 13568 bind: function( types, data, fn ) { 13569 return this.on( types, null, data, fn ); 13570 }, 13571 unbind: function( types, fn ) { 13572 return this.off( types, null, fn ); 13573 }, 13574 13575 delegate: function( selector, types, data, fn ) { 13576 return this.on( types, selector, data, fn ); 13577 }, 13578 undelegate: function( selector, types, fn ) { 13579 13580 // ( namespace ) or ( selector, types [, fn] ) 13581 return arguments.length === 1 ? 13582 this.off( selector, "**" ) : 13583 this.off( types, selector || "**", fn ); 13584 }, 13585 13586 hover: function( fnOver, fnOut ) { 13587 return this 13588 .on( "mouseenter", fnOver ) 13589 .on( "mouseleave", fnOut || fnOver ); 13590 } 13591} ); 13592 13593jQuery.each( 13594 ( "blur focus focusin focusout resize scroll click dblclick " + 13595 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 13596 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 13597 function( _i, name ) { 13598 13599 // Handle event binding 13600 jQuery.fn[ name ] = function( data, fn ) { 13601 return arguments.length > 0 ? 13602 this.on( name, null, data, fn ) : 13603 this.trigger( name ); 13604 }; 13605 } 13606); 13607 13608 13609 13610 13611// Support: Android <=4.0 only 13612// Make sure we trim BOM and NBSP 13613// Require that the "whitespace run" starts from a non-whitespace 13614// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 13615var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 13616 13617// Bind a function to a context, optionally partially applying any 13618// arguments. 13619// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 13620// However, it is not slated for removal any time soon 13621jQuery.proxy = function( fn, context ) { 13622 var tmp, args, proxy; 13623 13624 if ( typeof context === "string" ) { 13625 tmp = fn[ context ]; 13626 context = fn; 13627 fn = tmp; 13628 } 13629 13630 // Quick check to determine if target is callable, in the spec 13631 // this throws a TypeError, but we will just return undefined. 13632 if ( !isFunction( fn ) ) { 13633 return undefined; 13634 } 13635 13636 // Simulated bind 13637 args = slice.call( arguments, 2 ); 13638 proxy = function() { 13639 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 13640 }; 13641 13642 // Set the guid of unique handler to the same of original handler, so it can be removed 13643 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 13644 13645 return proxy; 13646}; 13647 13648jQuery.holdReady = function( hold ) { 13649 if ( hold ) { 13650 jQuery.readyWait++; 13651 } else { 13652 jQuery.ready( true ); 13653 } 13654}; 13655jQuery.isArray = Array.isArray; 13656jQuery.parseJSON = JSON.parse; 13657jQuery.nodeName = nodeName; 13658jQuery.isFunction = isFunction; 13659jQuery.isWindow = isWindow; 13660jQuery.camelCase = camelCase; 13661jQuery.type = toType; 13662 13663jQuery.now = Date.now; 13664 13665jQuery.isNumeric = function( obj ) { 13666 13667 // As of jQuery 3.0, isNumeric is limited to 13668 // strings and numbers (primitives or objects) 13669 // that can be coerced to finite numbers (gh-2662) 13670 var type = jQuery.type( obj ); 13671 return ( type === "number" || type === "string" ) && 13672 13673 // parseFloat NaNs numeric-cast false positives ("") 13674 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 13675 // subtraction forces infinities to NaN 13676 !isNaN( obj - parseFloat( obj ) ); 13677}; 13678 13679jQuery.trim = function( text ) { 13680 return text == null ? 13681 "" : 13682 ( text + "" ).replace( rtrim, "$1" ); 13683}; 13684 13685 13686 13687// Register as a named AMD module, since jQuery can be concatenated with other 13688// files that may use define, but not via a proper concatenation script that 13689// understands anonymous AMD modules. A named AMD is safest and most robust 13690// way to register. Lowercase jquery is used because AMD module names are 13691// derived from file names, and jQuery is normally delivered in a lowercase 13692// file name. Do this after creating the global so that if an AMD module wants 13693// to call noConflict to hide this version of jQuery, it will work. 13694 13695// Note that for maximum portability, libraries that are not jQuery should 13696// declare themselves as anonymous modules, and avoid setting a global if an 13697// AMD loader is present. jQuery is a special case. For more information, see 13698// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 13699 13700if ( t
13700rue ) { 13701 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 13702 return jQuery; 13703 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 13704 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 13705} 13706 13707 13708 13709 13710var 13711 13712 // Map over jQuery in case of overwrite 13713 _jQuery = window.jQuery, 13714 13715 // Map over the $ in case of overwrite 13716 _$ = window.$; 13717 13718jQuery.noConflict = function( deep ) { 13719 if ( window.$ === jQuery ) { 13720 window.$ = _$; 13721 } 13722 13723 if ( deep && window.jQuery === jQuery ) { 13724 window.jQuery = _jQuery; 13725 } 13726 13727 return jQuery; 13728}; 13729 13730// Expose jQuery and $ identifiers, even in AMD 13731// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 13732// and CommonJS for browser emulators (trac-13566) 13733if ( typeof noGlobal === "undefined" ) { 13734 window.jQuery = window.$ = jQuery; 13735} 13736 13737 13738 13739 13740return jQuery; 13741} ); 13742 13743 13744/***/ }, 13745 13746/***/ "./node_modules/lodash/lodash.js" 13747/*!***************************************!*\ 13748 !*** ./node_modules/lodash/lodash.js ***! 13749 \***************************************/ 13750(module, exports, __webpack_require__) { 13751 13752/* module decorator */ module = __webpack_require__.nmd(module); 13753var __WEBPACK_AMD_DEFINE_RESULT__;/** 13754 * @license 13755 * Lodash <https://lodash.com/> 13756 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 13757 * Released under MIT license <https://lodash.com/license> 13758 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 13759 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 13760 */ 13761;(function() { 13762 13763 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 13764 var undefined; 13765 13766 /** Used as the semantic version number. */ 13767 var VERSION = '4.18.1'; 13768 13769 /** Used as the size to enable large array optimizations. */ 13770 var LARGE_ARRAY_SIZE = 200; 13771 13772 /** Error message constants. */ 13773 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', 13774 FUNC_ERROR_TEXT = 'Expected a function', 13775 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`', 13776 INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports
vendor: 17,754 bytes, lines 13776-14203
13776` option passed into `_.template`'; 13777 13778 /** Used to stand-in for `undefined` hash values. */ 13779 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 13780 13781 /** Used as the maximum memoize cache size. */ 13782 var MAX_MEMOIZE_SIZE = 500; 13783 13784 /** Used as the internal argument placeholder. */ 13785 var PLACEHOLDER = '__lodash_placeholder__'; 13786 13787 /** Used to compose bitmasks for cloning. */ 13788 var CLONE_DEEP_FLAG = 1, 13789 CLONE_FLAT_FLAG = 2, 13790 CLONE_SYMBOLS_FLAG = 4; 13791 13792 /** Used to compose bitmasks for value comparisons. */ 13793 var COMPARE_PARTIAL_FLAG = 1, 13794 COMPARE_UNORDERED_FLAG = 2; 13795 13796 /** Used to compose bitmasks for function metadata. */ 13797 var WRAP_BIND_FLAG = 1, 13798 WRAP_BIND_KEY_FLAG = 2, 13799 WRAP_CURRY_BOUND_FLAG = 4, 13800 WRAP_CURRY_FLAG = 8, 13801 WRAP_CURRY_RIGHT_FLAG = 16, 13802 WRAP_PARTIAL_FLAG = 32, 13803 WRAP_PARTIAL_RIGHT_FLAG = 64, 13804 WRAP_ARY_FLAG = 128, 13805 WRAP_REARG_FLAG = 256, 13806 WRAP_FLIP_FLAG = 512; 13807 13808 /** Used as default options for `_.truncate`. */ 13809 var DEFAULT_TRUNC_LENGTH = 30, 13810 DEFAULT_TRUNC_OMISSION = '...'; 13811 13812 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 13813 var HOT_COUNT = 800, 13814 HOT_SPAN = 16; 13815 13816 /** Used to indicate the type of lazy iteratees. */ 13817 var LAZY_FILTER_FLAG = 1, 13818 LAZY_MAP_FLAG = 2, 13819 LAZY_WHILE_FLAG = 3; 13820 13821 /** Used as references for various `Number` constants. */ 13822 var INFINITY = 1 / 0, 13823 MAX_SAFE_INTEGER = 9007199254740991, 13824 MAX_INTEGER = 1.7976931348623157e+308, 13825 NAN = 0 / 0; 13826 13827 /** Used as references for the maximum length and index of an array. */ 13828 var MAX_ARRAY_LENGTH = 4294967295, 13829 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 13830 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 13831 13832 /** Used to associate wrap methods with their bit flags. */ 13833 var wrapFlags = [ 13834 ['ary', WRAP_ARY_FLAG], 13835 ['bind', WRAP_BIND_FLAG], 13836 ['bindKey', WRAP_BIND_KEY_FLAG], 13837 ['curry', WRAP_CURRY_FLAG], 13838 ['curryRight', WRAP_CURRY_RIGHT_FLAG], 13839 ['flip', WRAP_FLIP_FLAG], 13840 ['partial', WRAP_PARTIAL_FLAG], 13841 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], 13842 ['rearg', WRAP_REARG_FLAG] 13843 ]; 13844 13845 /** `Object#toString` result references. */ 13846 var argsTag = '[object Arguments]', 13847 arrayTag = '[object Array]', 13848 asyncTag = '[object AsyncFunction]', 13849 boolTag = '[object Boolean]', 13850 dateTag = '[object Date]', 13851 domExcTag = '[object DOMException]', 13852 errorTag = '[object Error]', 13853 funcTag = '[object Function]', 13854 genTag = '[object GeneratorFunction]', 13855 mapTag = '[object Map]', 13856 numberTag = '[object Number]', 13857 nullTag = '[object Null]', 13858 objectTag = '[object Object]', 13859 promiseTag = '[object Promise]', 13860 proxyTag = '[object Proxy]', 13861 regexpTag = '[object RegExp]', 13862 setTag = '[object Set]', 13863 stringTag = '[object String]', 13864 symbolTag = '[object Symbol]', 13865 undefinedTag = '[object Undefined]', 13866 weakMapTag = '[object WeakMap]', 13867 weakSetTag = '[object WeakSet]'; 13868 13869 var arrayBufferTag = '[object ArrayBuffer]', 13870 dataViewTag = '[object DataView]', 13871 float32Tag = '[object Float32Array]', 13872 float64Tag = '[object Float64Array]', 13873 int8Tag = '[object Int8Array]', 13874 int16Tag = '[object Int16Array]', 13875 int32Tag = '[object Int32Array]', 13876 uint8Tag = '[object Uint8Array]', 13877 uint8ClampedTag = '[object Uint8ClampedArray]', 13878 uint16Tag = '[object Uint16Array]', 13879 uint32Tag = '[object Uint32Array]'; 13880 13881 /** Used to match empty string literals in compiled template source. */ 13882 var reEmptyStringLeading = /\b__p \+= '';/g, 13883 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 13884 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 13885 13886 /** Used to match HTML entities and HTML characters. */ 13887 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, 13888 reUnescapedHtml = /[&<>"']/g, 13889 reHasEscapedHtml = RegExp(reEscapedHtml.source), 13890 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 13891 13892 /** Used to match template delimiters. */ 13893 var reEscape = /<%-([\s\S]+?)%>/g, 13894 reEvaluate = /<%([\s\S]+?)%>/g, 13895 reInterpolate = /<%=([\s\S]+?)%>/g; 13896 13897 /** Used to match property names within property paths. */ 13898 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 13899 reIsPlainProp = /^\w*$/, 13900 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 13901 13902 /** 13903 * Used to match `RegExp` 13904 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 13905 */ 13906 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 13907 reHasRegExpChar = RegExp(reRegExpChar.source); 13908 13909 /** Used to match leading whitespace. */ 13910 var reTrimStart = /^\s+/; 13911 13912 /** Used to match a single whitespace character. */ 13913 var reWhitespace = /\s/; 13914 13915 /** Used to match wrap detail comments. */ 13916 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, 13917 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 13918 reSplitDetails = /,? & /; 13919 13920 /** Used to match words composed of alphanumeric characters. */ 13921 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 13922 13923 /** 13924 * Used to validate the `validate` option in `_.template` variable. 13925 * 13926 * Forbids characters which could potentially change the meaning of the function argument definition: 13927 * - "()," (modification of function parameters) 13928 * - "=" (default value) 13929 * - "[]{}" (destructuring of function parameters) 13930 * - "/" (beginning of a comment) 13931 * - whitespace 13932 */ 13933 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 13934 13935 /** Used to match backslashes in property paths. */ 13936 var reEscapeChar = /\\(\\)?/g; 13937 13938 /** 13939 * Used to match 13940 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 13941 */ 13942 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 13943 13944 /** Used to match `RegExp` flags from their coerced string values. */ 13945 var reFlags = /\w*$/; 13946 13947 /** Used to detect bad signed hexadecimal string values. */ 13948 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 13949 13950 /** Used to detect binary string values. */ 13951 var reIsBinary = /^0b[01]+$/i; 13952 13953 /** Used to detect host constructors (Safari). */ 13954 var reIsHostCtor = /^\[object .+?Constructor\]$/; 13955 13956 /** Used to detect octal string values. */ 13957 var reIsOctal = /^0o[0-7]+$/i; 13958 13959 /** Used to detect unsigned integer values. */ 13960 var reIsUint = /^(?:0|[1-9]\d*)$/; 13961 13962 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 13963 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 13964 13965 /** Used to ensure capturing order of template delimiters. */ 13966 var reNoMatch = /($^)/; 13967 13968 /** Used to match unescaped characters in compiled string literals. */ 13969 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 13970 13971 /** Used to compose unicode character classes. */ 13972 var rsAstralRange = '\\ud800-\\udfff', 13973 rsComboMarksRange = '\\u0300-\\u036f', 13974 reComboHalfMarksRange = '\\ufe20-\\ufe2f', 13975 rsComboSymbolsRange = '\\u20d0-\\u20ff', 13976 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 13977 rsDingbatRange = '\\u2700-\\u27bf', 13978 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 13979 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 13980 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 13981 rsPunctuationRange = '\\u2000-\\u206f', 13982 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', 13983 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 13984 rsVarRange = '\\ufe0e\\ufe0f', 13985 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 13986 13987 /** Used to compose unicode capture groups. */ 13988 var rsApos = "['\u2019]", 13989 rsAstral = '[' + rsAstralRange + ']', 13990 rsBreak = '[' + rsBreakRange + ']', 13991 rsCombo = '[' + rsComboRange + ']', 13992 rsDigits = '\\d+', 13993 rsDingbat = '[' + rsDingbatRange + ']', 13994 rsLower = '[' + rsLowerRange + ']', 13995 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 13996 rsFitz = '\\ud83c[\\udffb-\\udfff]', 13997 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 13998 rsNonAstral = '[^' + rsAstralRange + ']', 13999 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', 14000 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', 14001 rsUpper = '[' + rsUpperRange + ']', 14002 rsZWJ = '\\u200d'; 14003 14004 /** Used to compose unicode regexes. */ 14005 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 14006 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 14007 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', 14008 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', 14009 reOptMod = rsModifier + '?', 14010 rsOptVar = '[' + rsVarRange + ']?', 14011 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 14012 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 14013 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 14014 rsSeq = rsOptVar + reOptMod + rsOptJoin, 14015 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, 14016 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; 14017 14018 /** Used to match apostrophes. */ 14019 var reApos = RegExp(rsApos, 'g'); 14020 14021 /** 14022 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 14023 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 14024 */ 14025 var reComboMark = RegExp(rsCombo, 'g'); 14026 14027 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ 14028 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); 14029 14030 /** Used to match complex or compound words. */ 14031 var reUnicodeWord = RegExp([ 14032 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', 14033 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', 14034 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, 14035 rsUpper + '+' + rsOptContrUpper, 14036 rsOrdUpper, 14037 rsOrdLower, 14038 rsDigits, 14039 rsEmoji 14040 ].join('|'), 'g'); 14041 14042 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ 14043 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); 14044 14045 /** Used to detect strings that need a more robust regexp to match words. */ 14046 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 14047 14048 /** Used to assign default `context` object properties. */ 14049 var contextProps = [ 14050 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 14051 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 14052 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 14053 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 14054 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' 14055 ]; 14056 14057 /** Used to make template sourceURLs easier to identify. */ 14058 var templateCounter = -1; 14059 14060 /** Used to identify `toStringTag` values of typed arrays. */ 14061 var typedArrayTags = {}; 14062 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 14063 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 14064 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 14065 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 14066 typedArrayTags[uint32Tag] = true; 14067 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 14068 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 14069 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 14070 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 14071 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 14072 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 14073 typedArrayTags[setTag] = typedArrayTags[stringTag] = 14074 typedArrayTags[weakMapTag] = false; 14075 14076 /** Used to identify `toStringTag` values supported by `_.clone`. */ 14077 var cloneableTags = {}; 14078 cloneableTags[argsTag] = cloneableTags[arrayTag] = 14079 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 14080 cloneableTags[boolTag] = cloneableTags[dateTag] = 14081 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 14082 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 14083 cloneableTags[int32Tag] = cloneableTags[mapTag] = 14084 cloneableTags[numberTag] = cloneableTags[objectTag] = 14085 cloneableTags[regexpTag] = cloneableTags[setTag] = 14086 cloneableTags[stringTag] = cloneableTags[symbolTag] = 14087 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 14088 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 14089 cloneableTags[errorTag] = cloneableTags[funcTag] = 14090 cloneableTags[weakMapTag] = false; 14091 14092 /** Used to map Latin Unicode letters to basic Latin letters. */ 14093 var deburredLetters = { 14094 // Latin-1 Supplement block. 14095 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 14096 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 14097 '\xc7': 'C', '\xe7': 'c', 14098 '\xd0': 'D', '\xf0': 'd', 14099 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 14100 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 14101 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 14102 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 14103 '\xd1': 'N', '\xf1': 'n', 14104 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 14105 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 14106 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 14107 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 14108 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 14109 '\xc6': 'Ae', '\xe6': 'ae', 14110 '\xde': 'Th', '\xfe': 'th', 14111 '\xdf': 'ss', 14112 // Latin Extended-A block. 14113 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', 14114 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', 14115 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', 14116 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', 14117 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', 14118 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', 14119 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', 14120 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', 14121 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', 14122 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', 14123 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', 14124 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', 14125 '\u0134': 'J', '\u0135': 'j', 14126 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', 14127 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', 14128 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', 14129 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', 14130 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', 14131 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', 14132 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', 14133 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', 14134 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', 14135 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', 14136 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', 14137 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', 14138 '\u0163': 't', '\u0165': 't', '\u0167': 't', 14139 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', 14140 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', 14141 '\u0174': 'W', '\u0175': 'w', 14142 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', 14143 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', 14144 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', 14145 '\u0132': 'IJ', '\u0133': 'ij', 14146 '\u0152': 'Oe', '\u0153': 'oe', 14147 '\u0149': "'n", '\u017f': 's' 14148 }; 14149 14150 /** Used to map characters to HTML entities. */ 14151 var htmlEscapes = { 14152 '&': '&', 14153 '<': '<', 14154 '>': '>', 14155 '"': '"', 14156 "'": ''' 14157 }; 14158 14159 /** Used to map HTML entities to characters. */ 14160 var htmlUnescapes = { 14161 '&': '&', 14162 '<': '<', 14163 '>': '>', 14164 '"': '"', 14165 ''': "'" 14166 }; 14167 14168 /** Used to escape characters for inclusion in compiled string literals. */ 14169 var stringEscapes = { 14170 '\\': '\\', 14171 "'": "'", 14172 '\n': 'n', 14173 '\r': 'r', 14174 '\u2028': 'u2028', 14175 '\u2029': 'u2029' 14176 }; 14177 14178 /** Built-in method references without a dependency on `root`. */ 14179 var freeParseFloat = parseFloat, 14180 freeParseInt = parseInt; 14181 14182 /** Detect free variable `global` from Node.js. */ 14183 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 14184 14185 /** Detect free variable `self`. */ 14186 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 14187 14188 /** Used as a reference to the global object. */ 14189 var root = freeGlobal || freeSelf || Function('return this')(); 14190 14191 /** Detect free variable `exports`. */ 14192 var freeExports = true && exports && !exports.nodeType && exports; 14193 14194 /** Detect free variable `module`. */ 14195 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 14196 14197 /** Detect the popular CommonJS extension `module.exports`. */ 14198 var moduleExports = freeModule && freeModule.exports === freeExports; 14199 14200 /** Detect free variable `process` from Node.js. */ 14201 var freeProcess = moduleExports && freeGlobal.process; 14202 14203 /** Used to access faster Node.js helpers. */
vendor: 8,860 bytes, lines 14204-14497
14204 var nodeUtil = (function() { 14205 try { 14206 // Use `util.types` for Node.js 10+. 14207 var types = freeModule && freeModule.require && freeModule.require('util').types; 14208 14209 if (types) { 14210 return types; 14211 } 14212 14213 // Legacy `process.binding('util')` for Node.js < 10. 14214 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 14215 } catch (e) {} 14216 }()); 14217 14218 /* Node.js helper references. */ 14219 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, 14220 nodeIsDate = nodeUtil && nodeUtil.isDate, 14221 nodeIsMap = nodeUtil && nodeUtil.isMap, 14222 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, 14223 nodeIsSet = nodeUtil && nodeUtil.isSet, 14224 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 14225 14226 /*--------------------------------------------------------------------------*/ 14227 14228 /** 14229 * A faster alternative to `Function#apply`, this function invokes `func` 14230 * with the `this` binding of `thisArg` and the arguments of `args`. 14231 * 14232 * @private 14233 * @param {Function} func The function to invoke. 14234 * @param {*} thisArg The `this` binding of `func`. 14235 * @param {Array} args The arguments to invoke `func` with. 14236 * @returns {*} Returns the result of `func`. 14237 */ 14238 function apply(func, thisArg, args) { 14239 switch (args.length) { 14240 case 0: return func.call(thisArg); 14241 case 1: return func.call(thisArg, args[0]); 14242 case 2: return func.call(thisArg, args[0], args[1]); 14243 case 3: return func.call(thisArg, args[0], args[1], args[2]); 14244 } 14245 return func.apply(thisArg, args); 14246 } 14247 14248 /** 14249 * A specialized version of `baseAggregator` for arrays. 14250 * 14251 * @private 14252 * @param {Array} [array] The array to iterate over. 14253 * @param {Function} setter The function to set `accumulator` values. 14254 * @param {Function} iteratee The iteratee to transform keys. 14255 * @param {Object} accumulator The initial aggregated object. 14256 * @returns {Function} Returns `accumulator`. 14257 */ 14258 function arrayAggregator(array, setter, iteratee, accumulator) { 14259 var index = -1, 14260 length = array == null ? 0 : array.length; 14261 14262 while (++index < length) { 14263 var value = array[index]; 14264 setter(accumulator, value, iteratee(value), array); 14265 } 14266 return accumulator; 14267 } 14268 14269 /** 14270 * A specialized version of `_.forEach` for arrays without support for 14271 * iteratee shorthands. 14272 * 14273 * @private 14274 * @param {Array} [array] The array to iterate over. 14275 * @param {Function} iteratee The function invoked per iteration. 14276 * @returns {Array} Returns `array`. 14277 */ 14278 function arrayEach(array, iteratee) { 14279 var index = -1, 14280 length = array == null ? 0 : array.length; 14281 14282 while (++index < length) { 14283 if (iteratee(array[index], index, array) === false) { 14284 break; 14285 } 14286 } 14287 return array; 14288 } 14289 14290 /** 14291 * A specialized version of `_.forEachRight` for arrays without support for 14292 * iteratee shorthands. 14293 * 14294 * @private 14295 * @param {Array} [array] The array to iterate over. 14296 * @param {Function} iteratee The function invoked per iteration. 14297 * @returns {Array} Returns `array`. 14298 */ 14299 function arrayEachRight(array, iteratee) { 14300 var length = array == null ? 0 : array.length; 14301 14302 while (length--) { 14303 if (iteratee(array[length], length, array) === false) { 14304 break; 14305 } 14306 } 14307 return array; 14308 } 14309 14310 /** 14311 * A specialized version of `_.every` for arrays without support for 14312 * iteratee shorthands. 14313 * 14314 * @private 14315 * @param {Array} [array] The array to iterate over. 14316 * @param {Function} predicate The function invoked per iteration. 14317 * @returns {boolean} Returns `true` if all elements pass the predicate check, 14318 * else `false`. 14319 */ 14320 function arrayEvery(array, predicate) { 14321 var index = -1, 14322 length = array == null ? 0 : array.length; 14323 14324 while (++index < length) { 14325 if (!predicate(array[index], index, array)) { 14326 return false; 14327 } 14328 } 14329 return true; 14330 } 14331 14332 /** 14333 * A specialized version of `_.filter` for arrays without support for 14334 * iteratee shorthands. 14335 * 14336 * @private 14337 * @param {Array} [array] The array to iterate over. 14338 * @param {Function} predicate The function invoked per iteration. 14339 * @returns {Array} Returns the new filtered array. 14340 */ 14341 function arrayFilter(array, predicate) { 14342 var index = -1, 14343 length = array == null ? 0 : array.length, 14344 resIndex = 0, 14345 result = []; 14346 14347 while (++index < length) { 14348 var value = array[index]; 14349 if (predicate(value, index, array)) { 14350 result[resIndex++] = value; 14351 } 14352 } 14353 return result; 14354 } 14355 14356 /** 14357 * A specialized version of `_.includes` for arrays without support for 14358 * specifying an index to search from. 14359 * 14360 * @private 14361 * @param {Array} [array] The array to inspect. 14362 * @param {*} target The value to search for. 14363 * @returns {boolean} Returns `true` if `target` is found, else `false`. 14364 */ 14365 function arrayIncludes(array, value) { 14366 var length = array == null ? 0 : array.length; 14367 return !!length && baseIndexOf(array, value, 0) > -1; 14368 } 14369 14370 /** 14371 * This function is like `arrayIncludes` except that it accepts a comparator. 14372 * 14373 * @private 14374 * @param {Array} [array] The array to inspect. 14375 * @param {*} target The value to search for. 14376 * @param {Function} comparator The comparator invoked per element. 14377 * @returns {boolean} Returns `true` if `target` is found, else `false`. 14378 */ 14379 function arrayIncludesWith(array, value, comparator) { 14380 var index = -1, 14381 length = array == null ? 0 : array.length; 14382 14383 while (++index < length) { 14384 if (comparator(value, array[index])) { 14385 return true; 14386 } 14387 } 14388 return false; 14389 } 14390 14391 /** 14392 * A specialized version of `_.map` for arrays without support for iteratee 14393 * shorthands. 14394 * 14395 * @private 14396 * @param {Array} [array] The array to iterate over. 14397 * @param {Function} iteratee The function invoked per iteration. 14398 * @returns {Array} Returns the new mapped array. 14399 */ 14400 function arrayMap(array, iteratee) { 14401 var index = -1, 14402 length = array == null ? 0 : array.length, 14403 result = Array(length); 14404 14405 while (++index < length) { 14406 result[index] = iteratee(array[index], index, array); 14407 } 14408 return result; 14409 } 14410 14411 /** 14412 * Appends the elements of `values` to `array`. 14413 * 14414 * @private 14415 * @param {Array} array The array to modify. 14416 * @param {Array} values The values to append. 14417 * @returns {Array} Returns `array`. 14418 */ 14419 function arrayPush(array, values) { 14420 var index = -1, 14421 length = values.length, 14422 offset = array.length; 14423 14424 while (++index < length) { 14425 array[offset + index] = values[index]; 14426 } 14427 return array; 14428 } 14429 14430 /** 14431 * A specialized version of `_.reduce` for arrays without support for 14432 * iteratee shorthands. 14433 * 14434 * @private 14435 * @param {Array} [array] The array to iterate over. 14436 * @param {Function} iteratee The function invoked per iteration. 14437 * @param {*} [accumulator] The initial value. 14438 * @param {boolean} [initAccum] Specify using the first element of `array` as 14439 * the initial value. 14440 * @returns {*} Returns the accumulated value. 14441 */ 14442 function arrayReduce(array, iteratee, accumulator, initAccum) { 14443 var index = -1, 14444 length = array == null ? 0 : array.length; 14445 14446 if (initAccum && length) { 14447 accumulator = array[++index]; 14448 } 14449 while (++index < length) { 14450 accumulator = iteratee(accumulator, array[index], index, array); 14451 } 14452 return accumulator; 14453 } 14454 14455 /** 14456 * A specialized version of `_.reduceRight` for arrays without support for 14457 * iteratee shorthands. 14458 * 14459 * @private 14460 * @param {Array} [array] The array to iterate over. 14461 * @param {Function} iteratee The function invoked per iteration. 14462 * @param {*} [accumulator] The initial value. 14463 * @param {boolean} [initAccum] Specify using the last element of `array` as 14464 * the initial value. 14465 * @returns {*} Returns the accumulated value. 14466 */ 14467 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 14468 var length = array == null ? 0 : array.length; 14469 if (initAccum && length) { 14470 accumulator = array[--length]; 14471 } 14472 while (length--) { 14473 accumulator = iteratee(accumulator, array[length], length, array); 14474 } 14475 return accumulator; 14476 } 14477 14478 /** 14479 * A specialized version of `_.some` for arrays without support for iteratee 14480 * shorthands. 14481 * 14482 * @private 14483 * @param {Array} [array] The array to iterate over. 14484 * @param {Function} predicate The function invoked per iteration. 14485 * @returns {boolean} Returns `true` if any element passes the predicate check, 14486 * else `false`. 14487 */ 14488 function arraySome(array, predicate) { 14489 var index = -1, 14490 length = array == null ? 0 : array.length; 14491 14492 while (++index < length) { 14493 if (predicate(array[index], index, array)) { 14494 return true; 14495 } 14496 } 14497 return false;
vendor: 12,899 bytes, lines 14498-14935
14498 } 14499 14500 /** 14501 * Gets the size of an ASCII `string`. 14502 * 14503 * @private 14504 * @param {string} string The string inspect. 14505 * @returns {number} Returns the string size. 14506 */ 14507 var asciiSize = baseProperty('length'); 14508 14509 /** 14510 * Converts an ASCII `string` to an array. 14511 * 14512 * @private 14513 * @param {string} string The string to convert. 14514 * @returns {Array} Returns the converted array. 14515 */ 14516 function asciiToArray(string) { 14517 return string.split(''); 14518 } 14519 14520 /** 14521 * Splits an ASCII `string` into an array of its words. 14522 * 14523 * @private 14524 * @param {string} The string to inspect. 14525 * @returns {Array} Returns the words of `string`. 14526 */ 14527 function asciiWords(string) { 14528 return string.match(reAsciiWord) || []; 14529 } 14530 14531 /** 14532 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 14533 * without support for iteratee shorthands, which iterates over `collection` 14534 * using `eachFunc`. 14535 * 14536 * @private 14537 * @param {Array|Object} collection The collection to inspect. 14538 * @param {Function} predicate The function invoked per iteration. 14539 * @param {Function} eachFunc The function to iterate over `collection`. 14540 * @returns {*} Returns the found element or its key, else `undefined`. 14541 */ 14542 function baseFindKey(collection, predicate, eachFunc) { 14543 var result; 14544 eachFunc(collection, function(value, key, collection) { 14545 if (predicate(value, key, collection)) { 14546 result = key; 14547 return false; 14548 } 14549 }); 14550 return result; 14551 } 14552 14553 /** 14554 * The base implementation of `_.findIndex` and `_.findLastIndex` without 14555 * support for iteratee shorthands. 14556 * 14557 * @private 14558 * @param {Array} array The array to inspect. 14559 * @param {Function} predicate The function invoked per iteration. 14560 * @param {number} fromIndex The index to search from. 14561 * @param {boolean} [fromRight] Specify iterating from right to left. 14562 * @returns {number} Returns the index of the matched value, else `-1`. 14563 */ 14564 function baseFindIndex(array, predicate, fromIndex, fromRight) { 14565 var length = array.length, 14566 index = fromIndex + (fromRight ? 1 : -1); 14567 14568 while ((fromRight ? index-- : ++index < length)) { 14569 if (predicate(array[index], index, array)) { 14570 return index; 14571 } 14572 } 14573 return -1; 14574 } 14575 14576 /** 14577 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 14578 * 14579 * @private 14580 * @param {Array} array The array to inspect. 14581 * @param {*} value The value to search for. 14582 * @param {number} fromIndex The index to search from. 14583 * @returns {number} Returns the index of the matched value, else `-1`. 14584 */ 14585 function baseIndexOf(array, value, fromIndex) { 14586 return value === value 14587 ? strictIndexOf(array, value, fromIndex) 14588 : baseFindIndex(array, baseIsNaN, fromIndex); 14589 } 14590 14591 /** 14592 * This function is like `baseIndexOf` except that it accepts a comparator. 14593 * 14594 * @private 14595 * @param {Array} array The array to inspect. 14596 * @param {*} value The value to search for. 14597 * @param {number} fromIndex The index to search from. 14598 * @param {Function} comparator The comparator invoked per element. 14599 * @returns {number} Returns the index of the matched value, else `-1`. 14600 */ 14601 function baseIndexOfWith(array, value, fromIndex, comparator) { 14602 var index = fromIndex - 1, 14603 length = array.length; 14604 14605 while (++index < length) { 14606 if (comparator(array[index], value)) { 14607 return index; 14608 } 14609 } 14610 return -1; 14611 } 14612 14613 /** 14614 * The base implementation of `_.isNaN` without support for number objects. 14615 * 14616 * @private 14617 * @param {*} value The value to check. 14618 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 14619 */ 14620 function baseIsNaN(value) { 14621 return value !== value; 14622 } 14623 14624 /** 14625 * The base implementation of `_.mean` and `_.meanBy` without support for 14626 * iteratee shorthands. 14627 * 14628 * @private 14629 * @param {Array} array The array to iterate over. 14630 * @param {Function} iteratee The function invoked per iteration. 14631 * @returns {number} Returns the mean. 14632 */ 14633 function baseMean(array, iteratee) { 14634 var length = array == null ? 0 : array.length; 14635 return length ? (baseSum(array, iteratee) / length) : NAN; 14636 } 14637 14638 /** 14639 * The base implementation of `_.property` without support for deep paths. 14640 * 14641 * @private 14642 * @param {string} key The key of the property to get. 14643 * @returns {Function} Returns the new accessor function. 14644 */ 14645 function baseProperty(key) { 14646 return function(object) { 14647 return object == null ? undefined : object[key]; 14648 }; 14649 } 14650 14651 /** 14652 * The base implementation of `_.propertyOf` without support for deep paths. 14653 * 14654 * @private 14655 * @param {Object} object The object to query. 14656 * @returns {Function} Returns the new accessor function. 14657 */ 14658 function basePropertyOf(object) { 14659 return function(key) { 14660 return object == null ? undefined : object[key]; 14661 }; 14662 } 14663 14664 /** 14665 * The base implementation of `_.reduce` and `_.reduceRight`, without support 14666 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 14667 * 14668 * @private 14669 * @param {Array|Object} collection The collection to iterate over. 14670 * @param {Function} iteratee The function invoked per iteration. 14671 * @param {*} accumulator The initial value. 14672 * @param {boolean} initAccum Specify using the first or last element of 14673 * `collection` as the initial value. 14674 * @param {Function} eachFunc The function to iterate over `collection`. 14675 * @returns {*} Returns the accumulated value. 14676 */ 14677 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 14678 eachFunc(collection, function(value, index, collection) { 14679 accumulator = initAccum 14680 ? (initAccum = false, value) 14681 : iteratee(accumulator, value, index, collection); 14682 }); 14683 return accumulator; 14684 } 14685 14686 /** 14687 * The base implementation of `_.sortBy` which uses `comparer` to define the 14688 * sort order of `array` and replaces criteria objects with their corresponding 14689 * values. 14690 * 14691 * @private 14692 * @param {Array} array The array to sort. 14693 * @param {Function} comparer The function to define sort order. 14694 * @returns {Array} Returns `array`. 14695 */ 14696 function baseSortBy(array, comparer) { 14697 var length = array.length; 14698 14699 array.sort(comparer); 14700 while (length--) { 14701 array[length] = array[length].value; 14702 } 14703 return array; 14704 } 14705 14706 /** 14707 * The base implementation of `_.sum` and `_.sumBy` without support for 14708 * iteratee shorthands. 14709 * 14710 * @private 14711 * @param {Array} array The array to iterate over. 14712 * @param {Function} iteratee The function invoked per iteration. 14713 * @returns {number} Returns the sum. 14714 */ 14715 function baseSum(array, iteratee) { 14716 var result, 14717 index = -1, 14718 length = array.length; 14719 14720 while (++index < length) { 14721 var current = iteratee(array[index]); 14722 if (current !== undefined) { 14723 result = result === undefined ? current : (result + current); 14724 } 14725 } 14726 return result; 14727 } 14728 14729 /** 14730 * The base implementation of `_.times` without support for iteratee shorthands 14731 * or max array length checks. 14732 * 14733 * @private 14734 * @param {number} n The number of times to invoke `iteratee`. 14735 * @param {Function} iteratee The function invoked per iteration. 14736 * @returns {Array} Returns the array of results. 14737 */ 14738 function baseTimes(n, iteratee) { 14739 var index = -1, 14740 result = Array(n); 14741 14742 while (++index < n) { 14743 result[index] = iteratee(index); 14744 } 14745 return result; 14746 } 14747 14748 /** 14749 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 14750 * of key-value pairs for `object` corresponding to the property names of `props`. 14751 * 14752 * @private 14753 * @param {Object} object The object to query. 14754 * @param {Array} props The property names to get values for. 14755 * @returns {Object} Returns the key-value pairs. 14756 */ 14757 function baseToPairs(object, props) { 14758 return arrayMap(props, function(key) { 14759 return [key, object[key]]; 14760 }); 14761 } 14762 14763 /** 14764 * The base implementation of `_.trim`. 14765 * 14766 * @private 14767 * @param {string} string The string to trim. 14768 * @returns {string} Returns the trimmed string. 14769 */ 14770 function baseTrim(string) { 14771 return string 14772 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 14773 : string; 14774 } 14775 14776 /** 14777 * The base implementation of `_.unary` without support for storing metadata. 14778 * 14779 * @private 14780 * @param {Function} func The function to cap arguments for. 14781 * @returns {Function} Returns the new capped function. 14782 */ 14783 function baseUnary(func) { 14784 return function(value) { 14785 return func(value); 14786 }; 14787 } 14788 14789 /** 14790 * The base implementation of `_.values` and `_.valuesIn` which creates an 14791 * array of `object` property values corresponding to the property names 14792 * of `props`. 14793 * 14794 * @private 14795 * @param {Object} object The object to query. 14796 * @param {Array} props The property names to get values for. 14797 * @returns {Object} Returns the array of property values. 14798 */ 14799 function baseValues(object, props) { 14800 return arrayMap(props, function(key) { 14801 return object[key]; 14802 }); 14803 } 14804 14805 /** 14806 * Checks if a `cache` value for `key` exists. 14807 * 14808 * @private 14809 * @param {Object} cache The cache to query. 14810 * @param {string} key The key of the entry to check. 14811 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 14812 */ 14813 function cacheHas(cache, key) { 14814 return cache.has(key); 14815 } 14816 14817 /** 14818 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 14819 * that is not found in the character symbols. 14820 * 14821 * @private 14822 * @param {Array} strSymbols The string symbols to inspect. 14823 * @param {Array} chrSymbols The character symbols to find. 14824 * @returns {number} Returns the index of the first unmatched string symbol. 14825 */ 14826 function charsStartIndex(strSymbols, chrSymbols) { 14827 var index = -1, 14828 length = strSymbols.length; 14829 14830 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 14831 return index; 14832 } 14833 14834 /** 14835 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 14836 * that is not found in the character symbols. 14837 * 14838 * @private 14839 * @param {Array} strSymbols The string symbols to inspect. 14840 * @param {Array} chrSymbols The character symbols to find. 14841 * @returns {number} Returns the index of the last unmatched string symbol. 14842 */ 14843 function charsEndIndex(strSymbols, chrSymbols) { 14844 var index = strSymbols.length; 14845 14846 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 14847 return index; 14848 } 14849 14850 /** 14851 * Gets the number of `placeholder` occurrences in `array`. 14852 * 14853 * @private 14854 * @param {Array} array The array to inspect. 14855 * @param {*} placeholder The placeholder to search for. 14856 * @returns {number} Returns the placeholder count. 14857 */ 14858 function countHolders(array, placeholder) { 14859 var length = array.length, 14860 result = 0; 14861 14862 while (length--) { 14863 if (array[length] === placeholder) { 14864 ++result; 14865 } 14866 } 14867 return result; 14868 } 14869 14870 /** 14871 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 14872 * letters to basic Latin letters. 14873 * 14874 * @private 14875 * @param {string} letter The matched letter to deburr. 14876 * @returns {string} Returns the deburred letter. 14877 */ 14878 var deburrLetter = basePropertyOf(deburredLetters); 14879 14880 /** 14881 * Used by `_.escape` to convert characters to HTML entities. 14882 * 14883 * @private 14884 * @param {string} chr The matched character to escape. 14885 * @returns {string} Returns the escaped character. 14886 */ 14887 var escapeHtmlChar = basePropertyOf(htmlEscapes); 14888 14889 /** 14890 * Used by `_.template` to escape characters for inclusion in compiled string literals. 14891 * 14892 * @private 14893 * @param {string} chr The matched character to escape. 14894 * @returns {string} Returns the escaped character. 14895 */ 14896 function escapeStringChar(chr) { 14897 return '\\' + stringEscapes[chr]; 14898 } 14899 14900 /** 14901 * Gets the value at `key` of `object`. 14902 * 14903 * @private 14904 * @param {Object} [object] The object to query. 14905 * @param {string} key The key of the property to get. 14906 * @returns {*} Returns the property value. 14907 */ 14908 function getValue(object, key) { 14909 return object == null ? undefined : object[key]; 14910 } 14911 14912 /** 14913 * Checks if `string` contains Unicode symbols. 14914 * 14915 * @private 14916 * @param {string} string The string to inspect. 14917 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 14918 */ 14919 function hasUnicode(string) { 14920 return reHasUnicode.test(string); 14921 } 14922 14923 /** 14924 * Checks if `string` contains a word composed of Unicode symbols. 14925 * 14926 * @private 14927 * @param {string} string The string to inspect. 14928 * @returns {boolean} Returns `true` if a word is found, else `false`. 14929 */ 14930 function hasUnicodeWord(string) { 14931 return reHasUnicodeWord.test(string); 14932 } 14933 14934 /** 14935 * Converts `iterator` to an array.
vendor: 8,214 bytes, lines 14936-15245
14936 * 14937 * @private 14938 * @param {Object} iterator The iterator to convert. 14939 * @returns {Array} Returns the converted array. 14940 */ 14941 function iteratorToArray(iterator) { 14942 var data, 14943 result = []; 14944 14945 while (!(data = iterator.next()).done) { 14946 result.push(data.value); 14947 } 14948 return result; 14949 } 14950 14951 /** 14952 * Converts `map` to its key-value pairs. 14953 * 14954 * @private 14955 * @param {Object} map The map to convert. 14956 * @returns {Array} Returns the key-value pairs. 14957 */ 14958 function mapToArray(map) { 14959 var index = -1, 14960 result = Array(map.size); 14961 14962 map.forEach(function(value, key) { 14963 result[++index] = [key, value]; 14964 }); 14965 return result; 14966 } 14967 14968 /** 14969 * Creates a unary function that invokes `func` with its argument transformed. 14970 * 14971 * @private 14972 * @param {Function} func The function to wrap. 14973 * @param {Function} transform The argument transform. 14974 * @returns {Function} Returns the new function. 14975 */ 14976 function overArg(func, transform) { 14977 return function(arg) { 14978 return func(transform(arg)); 14979 }; 14980 } 14981 14982 /** 14983 * Replaces all `placeholder` elements in `array` with an internal placeholder 14984 * and returns an array of their indexes. 14985 * 14986 * @private 14987 * @param {Array} array The array to modify. 14988 * @param {*} placeholder The placeholder to replace. 14989 * @returns {Array} Returns the new array of placeholder indexes. 14990 */ 14991 function replaceHolders(array, placeholder) { 14992 var index = -1, 14993 length = array.length, 14994 resIndex = 0, 14995 result = []; 14996 14997 while (++index < length) { 14998 var value = array[index]; 14999 if (value === placeholder || value === PLACEHOLDER) { 15000 array[index] = PLACEHOLDER; 15001 result[resIndex++] = index; 15002 } 15003 } 15004 return result; 15005 } 15006 15007 /** 15008 * Converts `set` to an array of its values. 15009 * 15010 * @private 15011 * @param {Object} set The set to convert. 15012 * @returns {Array} Returns the values. 15013 */ 15014 function setToArray(set) { 15015 var index = -1, 15016 result = Array(set.size); 15017 15018 set.forEach(function(value) { 15019 result[++index] = value; 15020 }); 15021 return result; 15022 } 15023 15024 /** 15025 * Converts `set` to its value-value pairs. 15026 * 15027 * @private 15028 * @param {Object} set The set to convert. 15029 * @returns {Array} Returns the value-value pairs. 15030 */ 15031 function setToPairs(set) { 15032 var index = -1, 15033 result = Array(set.size); 15034 15035 set.forEach(function(value) { 15036 result[++index] = [value, value]; 15037 }); 15038 return result; 15039 } 15040 15041 /** 15042 * A specialized version of `_.indexOf` which performs strict equality 15043 * comparisons of values, i.e. `===`. 15044 * 15045 * @private 15046 * @param {Array} array The array to inspect. 15047 * @param {*} value The value to search for. 15048 * @param {number} fromIndex The index to search from. 15049 * @returns {number} Returns the index of the matched value, else `-1`. 15050 */ 15051 function strictIndexOf(array, value, fromIndex) { 15052 var index = fromIndex - 1, 15053 length = array.length; 15054 15055 while (++index < length) { 15056 if (array[index] === value) { 15057 return index; 15058 } 15059 } 15060 return -1; 15061 } 15062 15063 /** 15064 * A specialized version of `_.lastIndexOf` which performs strict equality 15065 * comparisons of values, i.e. `===`. 15066 * 15067 * @private 15068 * @param {Array} array The array to inspect. 15069 * @param {*} value The value to search for. 15070 * @param {number} fromIndex The index to search from. 15071 * @returns {number} Returns the index of the matched value, else `-1`. 15072 */ 15073 function strictLastIndexOf(array, value, fromIndex) { 15074 var index = fromIndex + 1; 15075 while (index--) { 15076 if (array[index] === value) { 15077 return index; 15078 } 15079 } 15080 return index; 15081 } 15082 15083 /** 15084 * Gets the number of symbols in `string`. 15085 * 15086 * @private 15087 * @param {string} string The string to inspect. 15088 * @returns {number} Returns the string size. 15089 */ 15090 function stringSize(string) { 15091 return hasUnicode(string) 15092 ? unicodeSize(string) 15093 : asciiSize(string); 15094 } 15095 15096 /** 15097 * Converts `string` to an array. 15098 * 15099 * @private 15100 * @param {string} string The string to convert. 15101 * @returns {Array} Returns the converted array. 15102 */ 15103 function stringToArray(string) { 15104 return hasUnicode(string) 15105 ? unicodeToArray(string) 15106 : asciiToArray(string); 15107 } 15108 15109 /** 15110 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 15111 * character of `string`. 15112 * 15113 * @private 15114 * @param {string} string The string to inspect. 15115 * @returns {number} Returns the index of the last non-whitespace character. 15116 */ 15117 function trimmedEndIndex(string) { 15118 var index = string.length; 15119 15120 while (index-- && reWhitespace.test(string.charAt(index))) {} 15121 return index; 15122 } 15123 15124 /** 15125 * Used by `_.unescape` to convert HTML entities to characters. 15126 * 15127 * @private 15128 * @param {string} chr The matched character to unescape. 15129 * @returns {string} Returns the unescaped character. 15130 */ 15131 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 15132 15133 /** 15134 * Gets the size of a Unicode `string`. 15135 * 15136 * @private 15137 * @param {string} string The string inspect. 15138 * @returns {number} Returns the string size. 15139 */ 15140 function unicodeSize(string) { 15141 var result = reUnicode.lastIndex = 0; 15142 while (reUnicode.test(string)) { 15143 ++result; 15144 } 15145 return result; 15146 } 15147 15148 /** 15149 * Converts a Unicode `string` to an array. 15150 * 15151 * @private 15152 * @param {string} string The string to convert. 15153 * @returns {Array} Returns the converted array. 15154 */ 15155 function unicodeToArray(string) { 15156 return string.match(reUnicode) || []; 15157 } 15158 15159 /** 15160 * Splits a Unicode `string` into an array of its words. 15161 * 15162 * @private 15163 * @param {string} The string to inspect. 15164 * @returns {Array} Returns the words of `string`. 15165 */ 15166 function unicodeWords(string) { 15167 return string.match(reUnicodeWord) || []; 15168 } 15169 15170 /*--------------------------------------------------------------------------*/ 15171 15172 /** 15173 * Create a new pristine `lodash` function using the `context` object. 15174 * 15175 * @static 15176 * @memberOf _ 15177 * @since 1.1.0 15178 * @category Util 15179 * @param {Object} [context=root] The context object. 15180 * @returns {Function} Returns a new `lodash` function. 15181 * @example 15182 * 15183 * _.mixin({ 'foo': _.constant('foo') }); 15184 * 15185 * var lodash = _.runInContext(); 15186 * lodash.mixin({ 'bar': lodash.constant('bar') }); 15187 * 15188 * _.isFunction(_.foo); 15189 * // => true 15190 * _.isFunction(_.bar); 15191 * // => false 15192 * 15193 * lodash.isFunction(lodash.foo); 15194 * // => false 15195 * lodash.isFunction(lodash.bar); 15196 * // => true 15197 * 15198 * // Create a suped-up `defer` in Node.js. 15199 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 15200 */ 15201 var runInContext = (function runInContext(context) { 15202 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 15203 15204 /** Built-in constructor references. */ 15205 var Array = context.Array, 15206 Date = context.Date, 15207 Error = context.Error, 15208 Function = context.Function, 15209 Math = context.Math, 15210 Object = context.Object, 15211 RegExp = context.RegExp, 15212 String = context.String, 15213 TypeError = context.TypeError; 15214 15215 /** Used for built-in method references. */ 15216 var arrayProto = Array.prototype, 15217 funcProto = Function.prototype, 15218 objectProto = Object.prototype; 15219 15220 /** Used to detect overreaching core-js shims. */ 15221 var coreJsData = context['__core-js_shared__']; 15222 15223 /** Used to resolve the decompiled source of functions. */ 15224 var funcToString = funcProto.toString; 15225 15226 /** Used to check objects for own properties. */ 15227 var hasOwnProperty = objectProto.hasOwnProperty; 15228 15229 /** Used to generate unique IDs. */ 15230 var idCounter = 0; 15231 15232 /** Used to detect methods masquerading as native. */ 15233 var maskSrcKey = (function() { 15234 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 15235 return uid ? ('Symbol(src)_1.' + uid) : ''; 15236 }()); 15237 15238 /** 15239 * Used to resolve the 15240 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 15241 * of values. 15242 */ 15243 var nativeObjectToString = objectProto.toString; 15244 15245 /** Used to infer the `Object` constructor. */
vendor: 7,209 bytes, lines 15246-15390
15246 var objectCtorString = funcToString.call(Object); 15247 15248 /** Used to restore the original `_` reference in `_.noConflict`. */ 15249 var oldDash = root._; 15250 15251 /** Used to detect if a method is native. */ 15252 var reIsNative = RegExp('^' + 15253 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 15254 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 15255 ); 15256 15257 /** Built-in value references. */ 15258 var Buffer = moduleExports ? context.Buffer : undefined, 15259 Symbol = context.Symbol, 15260 Uint8Array = context.Uint8Array, 15261 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, 15262 getPrototype = overArg(Object.getPrototypeOf, Object), 15263 objectCreate = Object.create, 15264 propertyIsEnumerable = objectProto.propertyIsEnumerable, 15265 splice = arrayProto.splice, 15266 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, 15267 symIterator = Symbol ? Symbol.iterator : undefined, 15268 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 15269 15270 var defineProperty = (function() { 15271 try { 15272 var func = getNative(Object, 'defineProperty'); 15273 func({}, '', {}); 15274 return func; 15275 } catch (e) {} 15276 }()); 15277 15278 /** Mocked built-ins. */ 15279 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, 15280 ctxNow = Date && Date.now !== root.Date.now && Date.now, 15281 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 15282 15283 /* Built-in method references for those with the same name as other `lodash` methods. */ 15284 var nativeCeil = Math.ceil, 15285 nativeFloor = Math.floor, 15286 nativeGetSymbols = Object.getOwnPropertySymbols, 15287 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 15288 nativeIsFinite = context.isFinite, 15289 nativeJoin = arrayProto.join, 15290 nativeKeys = overArg(Object.keys, Object), 15291 nativeMax = Math.max, 15292 nativeMin = Math.min, 15293 nativeNow = Date.now, 15294 nativeParseInt = context.parseInt, 15295 nativeRandom = Math.random, 15296 nativeReverse = arrayProto.reverse; 15297 15298 /* Built-in method references that are verified to be native. */ 15299 var DataView = getNative(context, 'DataView'), 15300 Map = getNative(context, 'Map'), 15301 Promise = getNative(context, 'Promise'), 15302 Set = getNative(context, 'Set'), 15303 WeakMap = getNative(context, 'WeakMap'), 15304 nativeCreate = getNative(Object, 'create'); 15305 15306 /** Used to store function metadata. */ 15307 var metaMap = WeakMap && new WeakMap; 15308 15309 /** Used to lookup unminified function names. */ 15310 var realNames = {}; 15311 15312 /** Used to detect maps, sets, and weakmaps. */ 15313 var dataViewCtorString = toSource(DataView), 15314 mapCtorString = toSource(Map), 15315 promiseCtorString = toSource(Promise), 15316 setCtorString = toSource(Set), 15317 weakMapCtorString = toSource(WeakMap); 15318 15319 /** Used to convert symbols to primitives and strings. */ 15320 var symbolProto = Symbol ? Symbol.prototype : undefined, 15321 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, 15322 symbolToString = symbolProto ? symbolProto.toString : undefined; 15323 15324 /*------------------------------------------------------------------------*/ 15325 15326 /** 15327 * Creates a `lodash` object which wraps `value` to enable implicit method 15328 * chain sequences. Methods that operate on and return arrays, collections, 15329 * and functions can be chained together. Methods that retrieve a single value 15330 * or may return a primitive value will automatically end the chain sequence 15331 * and return the unwrapped value. Otherwise, the value must be unwrapped 15332 * with `_#value`. 15333 * 15334 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 15335 * enabled using `_.chain`. 15336 * 15337 * The execution of chained methods is lazy, that is, it's deferred until 15338 * `_#value` is implicitly or explicitly called. 15339 * 15340 * Lazy evaluation allows several methods to support shortcut fusion. 15341 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 15342 * the creation of intermediate arrays and can greatly reduce the number of 15343 * iteratee executions. Sections of a chain sequence qualify for shortcut 15344 * fusion if the section is applied to an array and iteratees accept only 15345 * one argument. The heuristic for whether a section qualifies for shortcut 15346 * fusion is subject to change. 15347 * 15348 * Chaining is supported in custom builds as long as the `_#value` method is 15349 * directly or indirectly included in the build. 15350 * 15351 * In addition to lodash methods, wrappers have `Array` and `String` methods. 15352 * 15353 * The wrapper `Array` methods are: 15354 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 15355 * 15356 * The wrapper `String` methods are: 15357 * `replace` and `split` 15358 * 15359 * The wrapper methods that support shortcut fusion are: 15360 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 15361 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 15362 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 15363 * 15364 * The chainable wrapper methods are: 15365 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 15366 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 15367 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 15368 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 15369 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 15370 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 15371 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 15372 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 15373 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 15374 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 15375 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 15376 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 15377 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 15378 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 15379 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 15380 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 15381 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 15382 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 15383 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 15384 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 15385 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 15386 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 15387 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 15388 * `zipObject`, `zipObjectDeep`, and `zipWith` 15389 * 15390 * The wrapper methods that are **not** chainable by default are:
vendor: 5,816 bytes, lines 15391-15568
15391 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 15392 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 15393 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 15394 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 15395 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 15396 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 15397 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 15398 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 15399 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 15400 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 15401 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 15402 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 15403 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 15404 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 15405 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 15406 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 15407 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 15408 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 15409 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 15410 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 15411 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 15412 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 15413 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 15414 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 15415 * `upperFirst`, `value`, and `words` 15416 * 15417 * @name _ 15418 * @constructor 15419 * @category Seq 15420 * @param {*} value The value to wrap in a `lodash` instance. 15421 * @returns {Object} Returns the new `lodash` wrapper instance. 15422 * @example 15423 * 15424 * function square(n) { 15425 * return n * n; 15426 * } 15427 * 15428 * var wrapped = _([1, 2, 3]); 15429 * 15430 * // Returns an unwrapped value. 15431 * wrapped.reduce(_.add); 15432 * // => 6 15433 * 15434 * // Returns a wrapped value. 15435 * var squares = wrapped.map(square); 15436 * 15437 * _.isArray(squares); 15438 * // => false 15439 * 15440 * _.isArray(squares.value()); 15441 * // => true 15442 */ 15443 function lodash(value) { 15444 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { 15445 if (value instanceof LodashWrapper) { 15446 return value; 15447 } 15448 if (hasOwnProperty.call(value, '__wrapped__')) { 15449 return wrapperClone(value); 15450 } 15451 } 15452 return new LodashWrapper(value); 15453 } 15454 15455 /** 15456 * The base implementation of `_.create` without support for assigning 15457 * properties to the created object. 15458 * 15459 * @private 15460 * @param {Object} proto The object to inherit from. 15461 * @returns {Object} Returns the new object. 15462 */ 15463 var baseCreate = (function() { 15464 function object() {} 15465 return function(proto) { 15466 if (!isObject(proto)) { 15467 return {}; 15468 } 15469 if (objectCreate) { 15470 return objectCreate(proto); 15471 } 15472 object.prototype = proto; 15473 var result = new object; 15474 object.prototype = undefined; 15475 return result; 15476 }; 15477 }()); 15478 15479 /** 15480 * The function whose prototype chain sequence wrappers inherit from. 15481 * 15482 * @private 15483 */ 15484 function baseLodash() { 15485 // No operation performed. 15486 } 15487 15488 /** 15489 * The base constructor for creating `lodash` wrapper objects. 15490 * 15491 * @private 15492 * @param {*} value The value to wrap. 15493 * @param {boolean} [chainAll] Enable explicit method chain sequences. 15494 */ 15495 function LodashWrapper(value, chainAll) { 15496 this.__wrapped__ = value; 15497 this.__actions__ = []; 15498 this.__chain__ = !!chainAll; 15499 this.__index__ = 0; 15500 this.__values__ = undefined; 15501 } 15502 15503 /** 15504 * By default, the template delimiters used by lodash are like those in 15505 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 15506 * following template settings to use alternative delimiters. 15507 * 15508 * **Security:** See 15509 * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md) 15510 * — `_.template` is insecure and will be removed in v5. 15511 * 15512 * @static 15513 * @memberOf _ 15514 * @type {Object} 15515 */ 15516 lodash.templateSettings = { 15517 15518 /** 15519 * Used to detect `data` property values to be HTML-escaped. 15520 * 15521 * @memberOf _.templateSettings 15522 * @type {RegExp} 15523 */ 15524 'escape': reEscape, 15525 15526 /** 15527 * Used to detect code to be evaluated. 15528 * 15529 * @memberOf _.templateSettings 15530 * @type {RegExp} 15531 */ 15532 'evaluate': reEvaluate, 15533 15534 /** 15535 * Used to detect `data` property values to inject. 15536 * 15537 * @memberOf _.templateSettings 15538 * @type {RegExp} 15539 */ 15540 'interpolate': reInterpolate, 15541 15542 /** 15543 * Used to reference the data object in the template text. 15544 * 15545 * @memberOf _.templateSettings 15546 * @type {string} 15547 */ 15548 'variable': '', 15549 15550 /** 15551 * Used to import variables into the compiled template. 15552 * 15553 * @memberOf _.templateSettings 15554 * @type {Object} 15555 */ 15556 'imports': { 15557 15558 /** 15559 * A reference to the `lodash` function. 15560 * 15561 * @memberOf _.templateSettings.imports 15562 * @type {Function} 15563 */ 15564 '_': lodash 15565 } 15566 }; 15567 15568 // Ensure wrappers are instances of `baseLodash`.
vendor: 12,811 bytes, lines 15569-16047
15569 lodash.prototype = baseLodash.prototype; 15570 lodash.prototype.constructor = lodash; 15571 15572 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 15573 LodashWrapper.prototype.constructor = LodashWrapper; 15574 15575 /*------------------------------------------------------------------------*/ 15576 15577 /** 15578 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 15579 * 15580 * @private 15581 * @constructor 15582 * @param {*} value The value to wrap. 15583 */ 15584 function LazyWrapper(value) { 15585 this.__wrapped__ = value; 15586 this.__actions__ = []; 15587 this.__dir__ = 1; 15588 this.__filtered__ = false; 15589 this.__iteratees__ = []; 15590 this.__takeCount__ = MAX_ARRAY_LENGTH; 15591 this.__views__ = []; 15592 } 15593 15594 /** 15595 * Creates a clone of the lazy wrapper object. 15596 * 15597 * @private 15598 * @name clone 15599 * @memberOf LazyWrapper 15600 * @returns {Object} Returns the cloned `LazyWrapper` object. 15601 */ 15602 function lazyClone() { 15603 var result = new LazyWrapper(this.__wrapped__); 15604 result.__actions__ = copyArray(this.__actions__); 15605 result.__dir__ = this.__dir__; 15606 result.__filtered__ = this.__filtered__; 15607 result.__iteratees__ = copyArray(this.__iteratees__); 15608 result.__takeCount__ = this.__takeCount__; 15609 result.__views__ = copyArray(this.__views__); 15610 return result; 15611 } 15612 15613 /** 15614 * Reverses the direction of lazy iteration. 15615 * 15616 * @private 15617 * @name reverse 15618 * @memberOf LazyWrapper 15619 * @returns {Object} Returns the new reversed `LazyWrapper` object. 15620 */ 15621 function lazyReverse() { 15622 if (this.__filtered__) { 15623 var result = new LazyWrapper(this); 15624 result.__dir__ = -1; 15625 result.__filtered__ = true; 15626 } else { 15627 result = this.clone(); 15628 result.__dir__ *= -1; 15629 } 15630 return result; 15631 } 15632 15633 /** 15634 * Extracts the unwrapped value from its lazy wrapper. 15635 * 15636 * @private 15637 * @name value 15638 * @memberOf LazyWrapper 15639 * @returns {*} Returns the unwrapped value. 15640 */ 15641 function lazyValue() { 15642 var array = this.__wrapped__.value(), 15643 dir = this.__dir__, 15644 isArr = isArray(array), 15645 isRight = dir < 0, 15646 arrLength = isArr ? array.length : 0, 15647 view = getView(0, arrLength, this.__views__), 15648 start = view.start, 15649 end = view.end, 15650 length = end - start, 15651 index = isRight ? end : (start - 1), 15652 iteratees = this.__iteratees__, 15653 iterLength = iteratees.length, 15654 resIndex = 0, 15655 takeCount = nativeMin(length, this.__takeCount__); 15656 15657 if (!isArr || (!isRight && arrLength == length && takeCount == length)) { 15658 return baseWrapperValue(array, this.__actions__); 15659 } 15660 var result = []; 15661 15662 outer: 15663 while (length-- && resIndex < takeCount) { 15664 index += dir; 15665 15666 var iterIndex = -1, 15667 value = array[index]; 15668 15669 while (++iterIndex < iterLength) { 15670 var data = iteratees[iterIndex], 15671 iteratee = data.iteratee, 15672 type = data.type, 15673 computed = iteratee(value); 15674 15675 if (type == LAZY_MAP_FLAG) { 15676 value = computed; 15677 } else if (!computed) { 15678 if (type == LAZY_FILTER_FLAG) { 15679 continue outer; 15680 } else { 15681 break outer; 15682 } 15683 } 15684 } 15685 result[resIndex++] = value; 15686 } 15687 return result; 15688 } 15689 15690 // Ensure `LazyWrapper` is an instance of `baseLodash`. 15691 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 15692 LazyWrapper.prototype.constructor = LazyWrapper; 15693 15694 /*------------------------------------------------------------------------*/ 15695 15696 /** 15697 * Creates a hash object. 15698 * 15699 * @private 15700 * @constructor 15701 * @param {Array} [entries] The key-value pairs to cache. 15702 */ 15703 function Hash(entries) { 15704 var index = -1, 15705 length = entries == null ? 0 : entries.length; 15706 15707 this.clear(); 15708 while (++index < length) { 15709 var entry = entries[index]; 15710 this.set(entry[0], entry[1]); 15711 } 15712 } 15713 15714 /** 15715 * Removes all key-value entries from the hash. 15716 * 15717 * @private 15718 * @name clear 15719 * @memberOf Hash 15720 */ 15721 function hashClear() { 15722 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 15723 this.size = 0; 15724 } 15725 15726 /** 15727 * Removes `key` and its value from the hash. 15728 * 15729 * @private 15730 * @name delete 15731 * @memberOf Hash 15732 * @param {Object} hash The hash to modify. 15733 * @param {string} key The key of the value to remove. 15734 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 15735 */ 15736 function hashDelete(key) { 15737 var result = this.has(key) && delete this.__data__[key]; 15738 this.size -= result ? 1 : 0; 15739 return result; 15740 } 15741 15742 /** 15743 * Gets the hash value for `key`. 15744 * 15745 * @private 15746 * @name get 15747 * @memberOf Hash 15748 * @param {string} key The key of the value to get. 15749 * @returns {*} Returns the entry value. 15750 */ 15751 function hashGet(key) { 15752 var data = this.__data__; 15753 if (nativeCreate) { 15754 var result = data[key]; 15755 return result === HASH_UNDEFINED ? undefined : result; 15756 } 15757 return hasOwnProperty.call(data, key) ? data[key] : undefined; 15758 } 15759 15760 /** 15761 * Checks if a hash value for `key` exists. 15762 * 15763 * @private 15764 * @name has 15765 * @memberOf Hash 15766 * @param {string} key The key of the entry to check. 15767 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 15768 */ 15769 function hashHas(key) { 15770 var data = this.__data__; 15771 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 15772 } 15773 15774 /** 15775 * Sets the hash `key` to `value`. 15776 * 15777 * @private 15778 * @name set 15779 * @memberOf Hash 15780 * @param {string} key The key of the value to set. 15781 * @param {*} value The value to set. 15782 * @returns {Object} Returns the hash instance. 15783 */ 15784 function hashSet(key, value) { 15785 var data = this.__data__; 15786 this.size += this.has(key) ? 0 : 1; 15787 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 15788 return this; 15789 } 15790 15791 // Add methods to `Hash`. 15792 Hash.prototype.clear = hashClear; 15793 Hash.prototype['delete'] = hashDelete; 15794 Hash.prototype.get = hashGet; 15795 Hash.prototype.has = hashHas; 15796 Hash.prototype.set = hashSet; 15797 15798 /*------------------------------------------------------------------------*/ 15799 15800 /** 15801 * Creates an list cache object. 15802 * 15803 * @private 15804 * @constructor 15805 * @param {Array} [entries] The key-value pairs to cache. 15806 */ 15807 function ListCache(entries) { 15808 var index = -1, 15809 length = entries == null ? 0 : entries.length; 15810 15811 this.clear(); 15812 while (++index < length) { 15813 var entry = entries[index]; 15814 this.set(entry[0], entry[1]); 15815 } 15816 } 15817 15818 /** 15819 * Removes all key-value entries from the list cache. 15820 * 15821 * @private 15822 * @name clear 15823 * @memberOf ListCache 15824 */ 15825 function listCacheClear() { 15826 this.__data__ = []; 15827 this.size = 0; 15828 } 15829 15830 /** 15831 * Removes `key` and its value from the list cache. 15832 * 15833 * @private 15834 * @name delete 15835 * @memberOf ListCache 15836 * @param {string} key The key of the value to remove. 15837 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 15838 */ 15839 function listCacheDelete(key) { 15840 var data = this.__data__, 15841 index = assocIndexOf(data, key); 15842 15843 if (index < 0) { 15844 return false; 15845 } 15846 var lastIndex = data.length - 1; 15847 if (index == lastIndex) { 15848 data.pop(); 15849 } else { 15850 splice.call(data, index, 1); 15851 } 15852 --this.size; 15853 return true; 15854 } 15855 15856 /** 15857 * Gets the list cache value for `key`. 15858 * 15859 * @private 15860 * @name get 15861 * @memberOf ListCache 15862 * @param {string} key The key of the value to get. 15863 * @returns {*} Returns the entry value. 15864 */ 15865 function listCacheGet(key) { 15866 var data = this.__data__, 15867 index = assocIndexOf(data, key); 15868 15869 return index < 0 ? undefined : data[index][1]; 15870 } 15871 15872 /** 15873 * Checks if a list cache value for `key` exists. 15874 * 15875 * @private 15876 * @name has 15877 * @memberOf ListCache 15878 * @param {string} key The key of the entry to check. 15879 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 15880 */ 15881 function listCacheHas(key) { 15882 return assocIndexOf(this.__data__, key) > -1; 15883 } 15884 15885 /** 15886 * Sets the list cache `key` to `value`. 15887 * 15888 * @private 15889 * @name set 15890 * @memberOf ListCache 15891 * @param {string} key The key of the value to set. 15892 * @param {*} value The value to set. 15893 * @returns {Object} Returns the list cache instance. 15894 */ 15895 function listCacheSet(key, value) { 15896 var data = this.__data__, 15897 index = assocIndexOf(data, key); 15898 15899 if (index < 0) { 15900 ++this.size; 15901 data.push([key, value]); 15902 } else { 15903 data[index][1] = value; 15904 } 15905 return this; 15906 } 15907 15908 // Add methods to `ListCache`. 15909 ListCache.prototype.clear = listCacheClear; 15910 ListCache.prototype['delete'] = listCacheDelete; 15911 ListCache.prototype.get = listCacheGet; 15912 ListCache.prototype.has = listCacheHas; 15913 ListCache.prototype.set = listCacheSet; 15914 15915 /*------------------------------------------------------------------------*/ 15916 15917 /** 15918 * Creates a map cache object to store key-value pairs. 15919 * 15920 * @private 15921 * @constructor 15922 * @param {Array} [entries] The key-value pairs to cache. 15923 */ 15924 function MapCache(entries) { 15925 var index = -1, 15926 length = entries == null ? 0 : entries.length; 15927 15928 this.clear(); 15929 while (++index < length) { 15930 var entry = entries[index]; 15931 this.set(entry[0], entry[1]); 15932 } 15933 } 15934 15935 /** 15936 * Removes all key-value entries from the map. 15937 * 15938 * @private 15939 * @name clear 15940 * @memberOf MapCache 15941 */ 15942 function mapCacheClear() { 15943 this.size = 0; 15944 this.__data__ = { 15945 'hash': new Hash, 15946 'map': new (Map || ListCache), 15947 'string': new Hash 15948 }; 15949 } 15950 15951 /** 15952 * Removes `key` and its value from the map. 15953 * 15954 * @private 15955 * @name delete 15956 * @memberOf MapCache 15957 * @param {string} key The key of the value to remove. 15958 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 15959 */ 15960 function mapCacheDelete(key) { 15961 var result = getMapData(this, key)['delete'](key); 15962 this.size -= result ? 1 : 0; 15963 return result; 15964 } 15965 15966 /** 15967 * Gets the map value for `key`. 15968 * 15969 * @private 15970 * @name get 15971 * @memberOf MapCache 15972 * @param {string} key The key of the value to get. 15973 * @returns {*} Returns the entry value. 15974 */ 15975 function mapCacheGet(key) { 15976 return getMapData(this, key).get(key); 15977 } 15978 15979 /** 15980 * Checks if a map value for `key` exists. 15981 * 15982 * @private 15983 * @name has 15984 * @memberOf MapCache 15985 * @param {string} key The key of the entry to check. 15986 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 15987 */ 15988 function mapCacheHas(key) { 15989 return getMapData(this, key).has(key); 15990 } 15991 15992 /** 15993 * Sets the map `key` to `value`. 15994 * 15995 * @private 15996 * @name set 15997 * @memberOf MapCache 15998 * @param {string} key The key of the value to set. 15999 * @param {*} value The value to set. 16000 * @returns {Object} Returns the map cache instance. 16001 */ 16002 function mapCacheSet(key, value) { 16003 var data = getMapData(this, key), 16004 size = data.size; 16005 16006 data.set(key, value); 16007 this.size += data.size == size ? 0 : 1; 16008 return this; 16009 } 16010 16011 // Add methods to `MapCache`. 16012 MapCache.prototype.clear = mapCacheClear; 16013 MapCache.prototype['delete'] = mapCacheDelete; 16014 MapCache.prototype.get = mapCacheGet; 16015 MapCache.prototype.has = mapCacheHas; 16016 MapCache.prototype.set = mapCacheSet; 16017 16018 /*------------------------------------------------------------------------*/ 16019 16020 /** 16021 * 16022 * Creates an array cache object to store unique values. 16023 * 16024 * @private 16025 * @constructor 16026 * @param {Array} [values] The values to cache. 16027 */ 16028 function SetCache(values) { 16029 var index = -1, 16030 length = values == null ? 0 : values.length; 16031 16032 this.__data__ = new MapCache; 16033 while (++index < length) { 16034 this.add(values[index]); 16035 } 16036 } 16037 16038 /** 16039 * Adds `value` to the array cache. 16040 * 16041 * @private 16042 * @name add 16043 * @memberOf SetCache 16044 * @alias push 16045 * @param {*} value The value to cache. 16046 * @returns {Object} Returns the cache instance. 16047 */
vendor: 3,742 bytes, lines 16048-16184
16048 function setCacheAdd(value) { 16049 this.__data__.set(value, HASH_UNDEFINED); 16050 return this; 16051 } 16052 16053 /** 16054 * Checks if `value` is in the array cache. 16055 * 16056 * @private 16057 * @name has 16058 * @memberOf SetCache 16059 * @param {*} value The value to search for. 16060 * @returns {boolean} Returns `true` if `value` is found, else `false`. 16061 */ 16062 function setCacheHas(value) { 16063 return this.__data__.has(value); 16064 } 16065 16066 // Add methods to `SetCache`. 16067 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 16068 SetCache.prototype.has = setCacheHas; 16069 16070 /*------------------------------------------------------------------------*/ 16071 16072 /** 16073 * Creates a stack cache object to store key-value pairs. 16074 * 16075 * @private 16076 * @constructor 16077 * @param {Array} [entries] The key-value pairs to cache. 16078 */ 16079 function Stack(entries) { 16080 var data = this.__data__ = new ListCache(entries); 16081 this.size = data.size; 16082 } 16083 16084 /** 16085 * Removes all key-value entries from the stack. 16086 * 16087 * @private 16088 * @name clear 16089 * @memberOf Stack 16090 */ 16091 function stackClear() { 16092 this.__data__ = new ListCache; 16093 this.size = 0; 16094 } 16095 16096 /** 16097 * Removes `key` and its value from the stack. 16098 * 16099 * @private 16100 * @name delete 16101 * @memberOf Stack 16102 * @param {string} key The key of the value to remove. 16103 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 16104 */ 16105 function stackDelete(key) { 16106 var data = this.__data__, 16107 result = data['delete'](key); 16108 16109 this.size = data.size; 16110 return result; 16111 } 16112 16113 /** 16114 * Gets the stack value for `key`. 16115 * 16116 * @private 16117 * @name get 16118 * @memberOf Stack 16119 * @param {string} key The key of the value to get. 16120 * @returns {*} Returns the entry value. 16121 */ 16122 function stackGet(key) { 16123 return this.__data__.get(key); 16124 } 16125 16126 /** 16127 * Checks if a stack value for `key` exists. 16128 * 16129 * @private 16130 * @name has 16131 * @memberOf Stack 16132 * @param {string} key The key of the entry to check. 16133 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 16134 */ 16135 function stackHas(key) { 16136 return this.__data__.has(key); 16137 } 16138 16139 /** 16140 * Sets the stack `key` to `value`. 16141 * 16142 * @private 16143 * @name set 16144 * @memberOf Stack 16145 * @param {string} key The key of the value to set. 16146 * @param {*} value The value to set. 16147 * @returns {Object} Returns the stack cache instance. 16148 */ 16149 function stackSet(key, value) { 16150 var data = this.__data__; 16151 if (data instanceof ListCache) { 16152 var pairs = data.__data__; 16153 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 16154 pairs.push([key, value]); 16155 this.size = ++data.size; 16156 return this; 16157 } 16158 data = this.__data__ = new MapCache(pairs); 16159 } 16160 data.set(key, value); 16161 this.size = data.size; 16162 return this; 16163 } 16164 16165 // Add methods to `Stack`. 16166 Stack.prototype.clear = stackClear; 16167 Stack.prototype['delete'] = stackDelete; 16168 Stack.prototype.get = stackGet; 16169 Stack.prototype.has = stackHas; 16170 Stack.prototype.set = stackSet; 16171 16172 /*------------------------------------------------------------------------*/ 16173 16174 /** 16175 * Creates an array of the enumerable property names of the array-like `value`. 16176 * 16177 * @private 16178 * @param {*} value The value to query. 16179 * @param {boolean} inherited Specify returning inherited property names. 16180 * @returns {Array} Returns the array of property names. 16181 */ 16182 function arrayLikeKeys(value, inherited) { 16183 var isArr = isArray(value), 16184 isArg = !isArr && isArguments(value),
vendor: 43,113 bytes, lines 16185-17461
16185 isBuff = !isArr && !isArg && isBuffer(value), 16186 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 16187 skipIndexes = isArr || isArg || isBuff || isType, 16188 result = skipIndexes ? baseTimes(value.length, String) : [], 16189 length = result.length; 16190 16191 for (var key in value) { 16192 if ((inherited || hasOwnProperty.call(value, key)) && 16193 !(skipIndexes && ( 16194 // Safari 9 has enumerable `arguments.length` in strict mode. 16195 key == 'length' || 16196 // Node.js 0.10 has enumerable non-index properties on buffers. 16197 (isBuff && (key == 'offset' || key == 'parent')) || 16198 // PhantomJS 2 has enumerable non-index properties on typed arrays. 16199 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 16200 // Skip index properties. 16201 isIndex(key, length) 16202 ))) { 16203 result.push(key); 16204 } 16205 } 16206 return result; 16207 } 16208 16209 /** 16210 * A specialized version of `_.sample` for arrays. 16211 * 16212 * @private 16213 * @param {Array} array The array to sample. 16214 * @returns {*} Returns the random element. 16215 */ 16216 function arraySample(array) { 16217 var length = array.length; 16218 return length ? array[baseRandom(0, length - 1)] : undefined; 16219 } 16220 16221 /** 16222 * A specialized version of `_.sampleSize` for arrays. 16223 * 16224 * @private 16225 * @param {Array} array The array to sample. 16226 * @param {number} n The number of elements to sample. 16227 * @returns {Array} Returns the random elements. 16228 */ 16229 function arraySampleSize(array, n) { 16230 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 16231 } 16232 16233 /** 16234 * A specialized version of `_.shuffle` for arrays. 16235 * 16236 * @private 16237 * @param {Array} array The array to shuffle. 16238 * @returns {Array} Returns the new shuffled array. 16239 */ 16240 function arrayShuffle(array) { 16241 return shuffleSelf(copyArray(array)); 16242 } 16243 16244 /** 16245 * This function is like `assignValue` except that it doesn't assign 16246 * `undefined` values. 16247 * 16248 * @private 16249 * @param {Object} object The object to modify. 16250 * @param {string} key The key of the property to assign. 16251 * @param {*} value The value to assign. 16252 */ 16253 function assignMergeValue(object, key, value) { 16254 if ((value !== undefined && !eq(object[key], value)) || 16255 (value === undefined && !(key in object))) { 16256 baseAssignValue(object, key, value); 16257 } 16258 } 16259 16260 /** 16261 * Assigns `value` to `key` of `object` if the existing value is not equivalent 16262 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 16263 * for equality comparisons. 16264 * 16265 * @private 16266 * @param {Object} object The object to modify. 16267 * @param {string} key The key of the property to assign. 16268 * @param {*} value The value to assign. 16269 */ 16270 function assignValue(object, key, value) { 16271 var objValue = object[key]; 16272 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 16273 (value === undefined && !(key in object))) { 16274 baseAssignValue(object, key, value); 16275 } 16276 } 16277 16278 /** 16279 * Gets the index at which the `key` is found in `array` of key-value pairs. 16280 * 16281 * @private 16282 * @param {Array} array The array to inspect. 16283 * @param {*} key The key to search for. 16284 * @returns {number} Returns the index of the matched value, else `-1`. 16285 */ 16286 function assocIndexOf(array, key) { 16287 var length = array.length; 16288 while (length--) { 16289 if (eq(array[length][0], key)) { 16290 return length; 16291 } 16292 } 16293 return -1; 16294 } 16295 16296 /** 16297 * Aggregates elements of `collection` on `accumulator` with keys transformed 16298 * by `iteratee` and values set by `setter`. 16299 * 16300 * @private 16301 * @param {Array|Object} collection The collection to iterate over. 16302 * @param {Function} setter The function to set `accumulator` values. 16303 * @param {Function} iteratee The iteratee to transform keys. 16304 * @param {Object} accumulator The initial aggregated object. 16305 * @returns {Function} Returns `accumulator`. 16306 */ 16307 function baseAggregator(collection, setter, iteratee, accumulator) { 16308 baseEach(collection, function(value, key, collection) { 16309 setter(accumulator, value, iteratee(value), collection); 16310 }); 16311 return accumulator; 16312 } 16313 16314 /** 16315 * The base implementation of `_.assign` without support for multiple sources 16316 * or `customizer` functions. 16317 * 16318 * @private 16319 * @param {Object} object The destination object. 16320 * @param {Object} source The source object. 16321 * @returns {Object} Returns `object`. 16322 */ 16323 function baseAssign(object, source) { 16324 return object && copyObject(source, keys(source), object); 16325 } 16326 16327 /** 16328 * The base implementation of `_.assignIn` without support for multiple sources 16329 * or `customizer` functions. 16330 * 16331 * @private 16332 * @param {Object} object The destination object. 16333 * @param {Object} source The source object. 16334 * @returns {Object} Returns `object`. 16335 */ 16336 function baseAssignIn(object, source) { 16337 return object && copyObject(source, keysIn(source), object); 16338 } 16339 16340 /** 16341 * The base implementation of `assignValue` and `assignMergeValue` without 16342 * value checks. 16343 * 16344 * @private 16345 * @param {Object} object The object to modify. 16346 * @param {string} key The key of the property to assign. 16347 * @param {*} value The value to assign. 16348 */ 16349 function baseAssignValue(object, key, value) { 16350 if (key == '__proto__' && defineProperty) { 16351 defineProperty(object, key, { 16352 'configurable': true, 16353 'enumerable': true, 16354 'value': value, 16355 'writable': true 16356 }); 16357 } else { 16358 object[key] = value; 16359 } 16360 } 16361 16362 /** 16363 * The base implementation of `_.at` without support for individual paths. 16364 * 16365 * @private 16366 * @param {Object} object The object to iterate over. 16367 * @param {string[]} paths The property paths to pick. 16368 * @returns {Array} Returns the picked elements. 16369 */ 16370 function baseAt(object, paths) { 16371 var index = -1, 16372 length = paths.length, 16373 result = Array(length), 16374 skip = object == null; 16375 16376 while (++index < length) { 16377 result[index] = skip ? undefined : get(object, paths[index]); 16378 } 16379 return result; 16380 } 16381 16382 /** 16383 * The base implementation of `_.clamp` which doesn't coerce arguments. 16384 * 16385 * @private 16386 * @param {number} number The number to clamp. 16387 * @param {number} [lower] The lower bound. 16388 * @param {number} upper The upper bound. 16389 * @returns {number} Returns the clamped number. 16390 */ 16391 function baseClamp(number, lower, upper) { 16392 if (number === number) { 16393 if (upper !== undefined) { 16394 number = number <= upper ? number : upper; 16395 } 16396 if (lower !== undefined) { 16397 number = number >= lower ? number : lower; 16398 } 16399 } 16400 return number; 16401 } 16402 16403 /** 16404 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 16405 * traversed objects. 16406 * 16407 * @private 16408 * @param {*} value The value to clone. 16409 * @param {boolean} bitmask The bitmask flags. 16410 * 1 - Deep clone 16411 * 2 - Flatten inherited properties 16412 * 4 - Clone symbols 16413 * @param {Function} [customizer] The function to customize cloning. 16414 * @param {string} [key] The key of `value`. 16415 * @param {Object} [object] The parent object of `value`. 16416 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 16417 * @returns {*} Returns the cloned value. 16418 */ 16419 function baseClone(value, bitmask, customizer, key, object, stack) { 16420 var result, 16421 isDeep = bitmask & CLONE_DEEP_FLAG, 16422 isFlat = bitmask & CLONE_FLAT_FLAG, 16423 isFull = bitmask & CLONE_SYMBOLS_FLAG; 16424 16425 if (customizer) { 16426 result = object ? customizer(value, key, object, stack) : customizer(value); 16427 } 16428 if (result !== undefined) { 16429 return result; 16430 } 16431 if (!isObject(value)) { 16432 return value; 16433 } 16434 var isArr = isArray(value); 16435 if (isArr) { 16436 result = initCloneArray(value); 16437 if (!isDeep) { 16438 return copyArray(value, result); 16439 } 16440 } else { 16441 var tag = getTag(value), 16442 isFunc = tag == funcTag || tag == genTag; 16443 16444 if (isBuffer(value)) { 16445 return cloneBuffer(value, isDeep); 16446 } 16447 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 16448 result = (isFlat || isFunc) ? {} : initCloneObject(value); 16449 if (!isDeep) { 16450 return isFlat 16451 ? copySymbolsIn(value, baseAssignIn(result, value)) 16452 : copySymbols(value, baseAssign(result, value)); 16453 } 16454 } else { 16455 if (!cloneableTags[tag]) { 16456 return object ? value : {}; 16457 } 16458 result = initCloneByTag(value, tag, isDeep); 16459 } 16460 } 16461 // Check for circular references and return its corresponding clone. 16462 stack || (stack = new Stack); 16463 var stacked = stack.get(value); 16464 if (stacked) { 16465 return stacked; 16466 } 16467 stack.set(value, result); 16468 16469 if (isSet(value)) { 16470 value.forEach(function(subValue) { 16471 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 16472 }); 16473 } else if (isMap(value)) { 16474 value.forEach(function(subValue, key) { 16475 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 16476 }); 16477 } 16478 16479 var keysFunc = isFull 16480 ? (isFlat ? getAllKeysIn : getAllKeys) 16481 : (isFlat ? keysIn : keys); 16482 16483 var props = isArr ? undefined : keysFunc(value); 16484 arrayEach(props || value, function(subValue, key) { 16485 if (props) { 16486 key = subValue; 16487 subValue = value[key]; 16488 } 16489 // Recursively populate clone (susceptible to call stack limits). 16490 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 16491 }); 16492 return result; 16493 } 16494 16495 /** 16496 * The base implementation of `_.conforms` which doesn't clone `source`. 16497 * 16498 * @private 16499 * @param {Object} source The object of property predicates to conform to. 16500 * @returns {Function} Returns the new spec function. 16501 */ 16502 function baseConforms(source) { 16503 var props = keys(source); 16504 return function(object) { 16505 return baseConformsTo(object, source, props); 16506 }; 16507 } 16508 16509 /** 16510 * The base implementation of `_.conformsTo` which accepts `props` to check. 16511 * 16512 * @private 16513 * @param {Object} object The object to inspect. 16514 * @param {Object} source The object of property predicates to conform to. 16515 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 16516 */ 16517 function baseConformsTo(object, source, props) { 16518 var length = props.length; 16519 if (object == null) { 16520 return !length; 16521 } 16522 object = Object(object); 16523 while (length--) { 16524 var key = props[length], 16525 predicate = source[key], 16526 value = object[key]; 16527 16528 if ((value === undefined && !(key in object)) || !predicate(value)) { 16529 return false; 16530 } 16531 } 16532 return true; 16533 } 16534 16535 /** 16536 * The base implementation of `_.delay` and `_.defer` which accepts `args` 16537 * to provide to `func`. 16538 * 16539 * @private 16540 * @param {Function} func The function to delay. 16541 * @param {number} wait The number of milliseconds to delay invocation. 16542 * @param {Array} args The arguments to provide to `func`. 16543 * @returns {number|Object} Returns the timer id or timeout object. 16544 */ 16545 function baseDelay(func, wait, args) { 16546 if (typeof func != 'function') { 16547 throw new TypeError(FUNC_ERROR_TEXT); 16548 } 16549 return setTimeout(function() { func.apply(undefined, args); }, wait); 16550 } 16551 16552 /** 16553 * The base implementation of methods like `_.difference` without support 16554 * for excluding multiple arrays or iteratee shorthands. 16555 * 16556 * @private 16557 * @param {Array} array The array to inspect. 16558 * @param {Array} values The values to exclude. 16559 * @param {Function} [iteratee] The iteratee invoked per element. 16560 * @param {Function} [comparator] The comparator invoked per element. 16561 * @returns {Array} Returns the new array of filtered values. 16562 */ 16563 function baseDifference(array, values, iteratee, comparator) { 16564 var index = -1, 16565 includes = arrayIncludes, 16566 isCommon = true, 16567 length = array.length, 16568 result = [], 16569 valuesLength = values.length; 16570 16571 if (!length) { 16572 return result; 16573 } 16574 if (iteratee) { 16575 values = arrayMap(values, baseUnary(iteratee)); 16576 } 16577 if (comparator) { 16578 includes = arrayIncludesWith; 16579 isCommon = false; 16580 } 16581 else if (values.length >= LARGE_ARRAY_SIZE) { 16582 includes = cacheHas; 16583 isCommon = false; 16584 values = new SetCache(values); 16585 } 16586 outer: 16587 while (++index < length) { 16588 var value = array[index], 16589 computed = iteratee == null ? value : iteratee(value); 16590 16591 value = (comparator || value !== 0) ? value : 0; 16592 if (isCommon && computed === computed) { 16593 var valuesIndex = valuesLength; 16594 while (valuesIndex--) { 16595 if (values[valuesIndex] === computed) { 16596 continue outer; 16597 } 16598 } 16599 result.push(value); 16600 } 16601 else if (!includes(values, computed, comparator)) { 16602 result.push(value); 16603 } 16604 } 16605 return result; 16606 } 16607 16608 /** 16609 * The base implementation of `_.forEach` without support for iteratee shorthands. 16610 * 16611 * @private 16612 * @param {Array|Object} collection The collection to iterate over. 16613 * @param {Function} iteratee The function invoked per iteration. 16614 * @returns {Array|Object} Returns `collection`. 16615 */ 16616 var baseEach = createBaseEach(baseForOwn); 16617 16618 /** 16619 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 16620 * 16621 * @private 16622 * @param {Array|Object} collection The collection to iterate over. 16623 * @param {Function} iteratee The function invoked per iteration. 16624 * @returns {Array|Object} Returns `collection`. 16625 */ 16626 var baseEachRight = createBaseEach(baseForOwnRight, true); 16627 16628 /** 16629 * The base implementation of `_.every` without support for iteratee shorthands. 16630 * 16631 * @private 16632 * @param {Array|Object} collection The collection to iterate over. 16633 * @param {Function} predicate The function invoked per iteration. 16634 * @returns {boolean} Returns `true` if all elements pass the predicate check, 16635 * else `false` 16636 */ 16637 function baseEvery(collection, predicate) { 16638 var result = true; 16639 baseEach(collection, function(value, index, collection) { 16640 result = !!predicate(value, index, collection); 16641 return result; 16642 }); 16643 return result; 16644 } 16645 16646 /** 16647 * The base implementation of methods like `_.max` and `_.min` which accepts a 16648 * `comparator` to determine the extremum value. 16649 * 16650 * @private 16651 * @param {Array} array The array to iterate over. 16652 * @param {Function} iteratee The iteratee invoked per iteration. 16653 * @param {Function} comparator The comparator used to compare values. 16654 * @returns {*} Returns the extremum value. 16655 */ 16656 function baseExtremum(array, iteratee, comparator) { 16657 var index = -1, 16658 length = array.length; 16659 16660 while (++index < length) { 16661 var value = array[index], 16662 current = iteratee(value); 16663 16664 if (current != null && (computed === undefined 16665 ? (current === current && !isSymbol(current)) 16666 : comparator(current, computed) 16667 )) { 16668 var computed = current, 16669 result = value; 16670 } 16671 } 16672 return result; 16673 } 16674 16675 /** 16676 * The base implementation of `_.fill` without an iteratee call guard. 16677 * 16678 * @private 16679 * @param {Array} array The array to fill. 16680 * @param {*} value The value to fill `array` with. 16681 * @param {number} [start=0] The start position. 16682 * @param {number} [end=array.length] The end position. 16683 * @returns {Array} Returns `array`. 16684 */ 16685 function baseFill(array, value, start, end) { 16686 var length = array.length; 16687 16688 start = toInteger(start); 16689 if (start < 0) { 16690 start = -start > length ? 0 : (length + start); 16691 } 16692 end = (end === undefined || end > length) ? length : toInteger(end); 16693 if (end < 0) { 16694 end += length; 16695 } 16696 end = start > end ? 0 : toLength(end); 16697 while (start < end) { 16698 array[start++] = value; 16699 } 16700 return array; 16701 } 16702 16703 /** 16704 * The base implementation of `_.filter` without support for iteratee shorthands. 16705 * 16706 * @private 16707 * @param {Array|Object} collection The collection to iterate over. 16708 * @param {Function} predicate The function invoked per iteration. 16709 * @returns {Array} Returns the new filtered array. 16710 */ 16711 function baseFilter(collection, predicate) { 16712 var result = []; 16713 baseEach(collection, function(value, index, collection) { 16714 if (predicate(value, index, collection)) { 16715 result.push(value); 16716 } 16717 }); 16718 return result; 16719 } 16720 16721 /** 16722 * The base implementation of `_.flatten` with support for restricting flattening. 16723 * 16724 * @private 16725 * @param {Array} array The array to flatten. 16726 * @param {number} depth The maximum recursion depth. 16727 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 16728 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 16729 * @param {Array} [result=[]] The initial result value. 16730 * @returns {Array} Returns the new flattened array. 16731 */ 16732 function baseFlatten(array, depth, predicate, isStrict, result) { 16733 var index = -1, 16734 length = array.length; 16735 16736 predicate || (predicate = isFlattenable); 16737 result || (result = []); 16738 16739 while (++index < length) { 16740 var value = array[index]; 16741 if (depth > 0 && predicate(value)) { 16742 if (depth > 1) { 16743 // Recursively flatten arrays (susceptible to call stack limits). 16744 baseFlatten(value, depth - 1, predicate, isStrict, result); 16745 } else { 16746 arrayPush(result, value); 16747 } 16748 } else if (!isStrict) { 16749 result[result.length] = value; 16750 } 16751 } 16752 return result; 16753 } 16754 16755 /** 16756 * The base implementation of `baseForOwn` which iterates over `object` 16757 * properties returned by `keysFunc` and invokes `iteratee` for each property. 16758 * Iteratee functions may exit iteration early by explicitly returning `false`. 16759 * 16760 * @private 16761 * @param {Object} object The object to iterate over. 16762 * @param {Function} iteratee The function invoked per iteration. 16763 * @param {Function} keysFunc The function to get the keys of `object`. 16764 * @returns {Object} Returns `object`. 16765 */ 16766 var baseFor = createBaseFor(); 16767 16768 /** 16769 * This function is like `baseFor` except that it iterates over properties 16770 * in the opposite order. 16771 * 16772 * @private 16773 * @param {Object} object The object to iterate over. 16774 * @param {Function} iteratee The function invoked per iteration. 16775 * @param {Function} keysFunc The function to get the keys of `object`. 16776 * @returns {Object} Returns `object`. 16777 */ 16778 var baseForRight = createBaseFor(true); 16779 16780 /** 16781 * The base implementation of `_.forOwn` without support for iteratee shorthands. 16782 * 16783 * @private 16784 * @param {Object} object The object to iterate over. 16785 * @param {Function} iteratee The function invoked per iteration. 16786 * @returns {Object} Returns `object`. 16787 */ 16788 function baseForOwn(object, iteratee) { 16789 return object && baseFor(object, iteratee, keys); 16790 } 16791 16792 /** 16793 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 16794 * 16795 * @private 16796 * @param {Object} object The object to iterate over. 16797 * @param {Function} iteratee The function invoked per iteration. 16798 * @returns {Object} Returns `object`. 16799 */ 16800 function baseForOwnRight(object, iteratee) { 16801 return object && baseForRight(object, iteratee, keys); 16802 } 16803 16804 /** 16805 * The base implementation of `_.functions` which creates an array of 16806 * `object` function property names filtered from `props`. 16807 * 16808 * @private 16809 * @param {Object} object The object to inspect. 16810 * @param {Array} props The property names to filter. 16811 * @returns {Array} Returns the function names. 16812 */ 16813 function baseFunctions(object, props) { 16814 return arrayFilter(props, function(key) { 16815 return isFunction(object[key]); 16816 }); 16817 } 16818 16819 /** 16820 * The base implementation of `_.get` without support for default values. 16821 * 16822 * @private 16823 * @param {Object} object The object to query. 16824 * @param {Array|string} path The path of the property to get. 16825 * @returns {*} Returns the resolved value. 16826 */ 16827 function baseGet(object, path) { 16828 path = castPath(path, object); 16829 16830 var index = 0, 16831 length = path.length; 16832 16833 while (object != null && index < length) { 16834 object = object[toKey(path[index++])]; 16835 } 16836 return (index && index == length) ? object : undefined; 16837 } 16838 16839 /** 16840 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 16841 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 16842 * symbols of `object`. 16843 * 16844 * @private 16845 * @param {Object} object The object to query. 16846 * @param {Function} keysFunc The function to get the keys of `object`. 16847 * @param {Function} symbolsFunc The function to get the symbols of `object`. 16848 * @returns {Array} Returns the array of property names and symbols. 16849 */ 16850 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 16851 var result = keysFunc(object); 16852 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 16853 } 16854 16855 /** 16856 * The base implementation of `getTag` without fallbacks for buggy environments. 16857 * 16858 * @private 16859 * @param {*} value The value to query. 16860 * @returns {string} Returns the `toStringTag`. 16861 */ 16862 function baseGetTag(value) { 16863 if (value == null) { 16864 return value === undefined ? undefinedTag : nullTag; 16865 } 16866 return (symToStringTag && symToStringTag in Object(value)) 16867 ? getRawTag(value) 16868 : objectToString(value); 16869 } 16870 16871 /** 16872 * The base implementation of `_.gt` which doesn't coerce arguments. 16873 * 16874 * @private 16875 * @param {*} value The value to compare. 16876 * @param {*} other The other value to compare. 16877 * @returns {boolean} Returns `true` if `value` is greater than `other`, 16878 * else `false`. 16879 */ 16880 function baseGt(value, other) { 16881 return value > other; 16882 } 16883 16884 /** 16885 * The base implementation of `_.has` without support for deep paths. 16886 * 16887 * @private 16888 * @param {Object} [object] The object to query. 16889 * @param {Array|string} key The key to check. 16890 * @returns {boolean} Returns `true` if `key` exists, else `false`. 16891 */ 16892 function baseHas(object, key) { 16893 return object != null && hasOwnProperty.call(object, key); 16894 } 16895 16896 /** 16897 * The base implementation of `_.hasIn` without support for deep paths. 16898 * 16899 * @private 16900 * @param {Object} [object] The object to query. 16901 * @param {Array|string} key The key to check. 16902 * @returns {boolean} Returns `true` if `key` exists, else `false`. 16903 */ 16904 function baseHasIn(object, key) { 16905 return object != null && key in Object(object); 16906 } 16907 16908 /** 16909 * The base implementation of `_.inRange` which doesn't coerce arguments. 16910 * 16911 * @private 16912 * @param {number} number The number to check. 16913 * @param {number} start The start of the range. 16914 * @param {number} end The end of the range. 16915 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 16916 */ 16917 function baseInRange(number, start, end) { 16918 return number >= nativeMin(start, end) && number < nativeMax(start, end); 16919 } 16920 16921 /** 16922 * The base implementation of methods like `_.intersection`, without support 16923 * for iteratee shorthands, that accepts an array of arrays to inspect. 16924 * 16925 * @private 16926 * @param {Array} arrays The arrays to inspect. 16927 * @param {Function} [iteratee] The iteratee invoked per element. 16928 * @param {Function} [comparator] The comparator invoked per element. 16929 * @returns {Array} Returns the new array of shared values. 16930 */ 16931 function baseIntersection(arrays, iteratee, comparator) { 16932 var includes = comparator ? arrayIncludesWith : arrayIncludes, 16933 length = arrays[0].length, 16934 othLength = arrays.length, 16935 othIndex = othLength, 16936 caches = Array(othLength), 16937 maxLength = Infinity, 16938 result = []; 16939 16940 while (othIndex--) { 16941 var array = arrays[othIndex]; 16942 if (othIndex && iteratee) { 16943 array = arrayMap(array, baseUnary(iteratee)); 16944 } 16945 maxLength = nativeMin(array.length, maxLength); 16946 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) 16947 ? new SetCache(othIndex && array) 16948 : undefined; 16949 } 16950 array = arrays[0]; 16951 16952 var index = -1, 16953 seen = caches[0]; 16954 16955 outer: 16956 while (++index < length && result.length < maxLength) { 16957 var value = array[index], 16958 computed = iteratee ? iteratee(value) : value; 16959 16960 value = (comparator || value !== 0) ? value : 0; 16961 if (!(seen 16962 ? cacheHas(seen, computed) 16963 : includes(result, computed, comparator) 16964 )) { 16965 othIndex = othLength; 16966 while (--othIndex) { 16967 var cache = caches[othIndex]; 16968 if (!(cache 16969 ? cacheHas(cache, computed) 16970 : includes(arrays[othIndex], computed, comparator)) 16971 ) { 16972 continue outer; 16973 } 16974 } 16975 if (seen) { 16976 seen.push(computed); 16977 } 16978 result.push(value); 16979 } 16980 } 16981 return result; 16982 } 16983 16984 /** 16985 * The base implementation of `_.invert` and `_.invertBy` which inverts 16986 * `object` with values transformed by `iteratee` and set by `setter`. 16987 * 16988 * @private 16989 * @param {Object} object The object to iterate over. 16990 * @param {Function} setter The function to set `accumulator` values. 16991 * @param {Function} iteratee The iteratee to transform values. 16992 * @param {Object} accumulator The initial inverted object. 16993 * @returns {Function} Returns `accumulator`. 16994 */ 16995 function baseInverter(object, setter, iteratee, accumulator) { 16996 baseForOwn(object, function(value, key, object) { 16997 setter(accumulator, iteratee(value), key, object); 16998 }); 16999 return accumulator; 17000 } 17001 17002 /** 17003 * The base implementation of `_.invoke` without support for individual 17004 * method arguments. 17005 * 17006 * @private 17007 * @param {Object} object The object to query. 17008 * @param {Array|string} path The path of the method to invoke. 17009 * @param {Array} args The arguments to invoke the method with. 17010 * @returns {*} Returns the result of the invoked method. 17011 */ 17012 function baseInvoke(object, path, args) { 17013 path = castPath(path, object); 17014 object = parent(object, path); 17015 var func = object == null ? object : object[toKey(last(path))]; 17016 return func == null ? undefined : apply(func, object, args); 17017 } 17018 17019 /** 17020 * The base implementation of `_.isArguments`. 17021 * 17022 * @private 17023 * @param {*} value The value to check. 17024 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 17025 */ 17026 function baseIsArguments(value) { 17027 return isObjectLike(value) && baseGetTag(value) == argsTag; 17028 } 17029 17030 /** 17031 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 17032 * 17033 * @private 17034 * @param {*} value The value to check. 17035 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 17036 */ 17037 function baseIsArrayBuffer(value) { 17038 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 17039 } 17040 17041 /** 17042 * The base implementation of `_.isDate` without Node.js optimizations. 17043 * 17044 * @private 17045 * @param {*} value The value to check. 17046 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 17047 */ 17048 function baseIsDate(value) { 17049 return isObjectLike(value) && baseGetTag(value) == dateTag; 17050 } 17051 17052 /** 17053 * The base implementation of `_.isEqual` which supports partial comparisons 17054 * and tracks traversed objects. 17055 * 17056 * @private 17057 * @param {*} value The value to compare. 17058 * @param {*} other The other value to compare. 17059 * @param {boolean} bitmask The bitmask flags. 17060 * 1 - Unordered comparison 17061 * 2 - Partial comparison 17062 * @param {Function} [customizer] The function to customize comparisons. 17063 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 17064 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 17065 */ 17066 function baseIsEqual(value, other, bitmask, customizer, stack) { 17067 if (value === other) { 17068 return true; 17069 } 17070 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 17071 return value !== value && other !== other; 17072 } 17073 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 17074 } 17075 17076 /** 17077 * A specialized version of `baseIsEqual` for arrays and objects which performs 17078 * deep comparisons and tracks traversed objects enabling objects with circular 17079 * references to be compared. 17080 * 17081 * @private 17082 * @param {Object} object The object to compare. 17083 * @param {Object} other The other object to compare. 17084 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 17085 * @param {Function} customizer The function to customize comparisons. 17086 * @param {Function} equalFunc The function to determine equivalents of values. 17087 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 17088 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 17089 */ 17090 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 17091 var objIsArr = isArray(object), 17092 othIsArr = isArray(other), 17093 objTag = objIsArr ? arrayTag : getTag(object), 17094 othTag = othIsArr ? arrayTag : getTag(other); 17095 17096 objTag = objTag == argsTag ? objectTag : objTag; 17097 othTag = othTag == argsTag ? objectTag : othTag; 17098 17099 var objIsObj = objTag == objectTag, 17100 othIsObj = othTag == objectTag, 17101 isSameTag = objTag == othTag; 17102 17103 if (isSameTag && isBuffer(object)) { 17104 if (!isBuffer(other)) { 17105 return false; 17106 } 17107 objIsArr = true; 17108 objIsObj = false; 17109 } 17110 if (isSameTag && !objIsObj) { 17111 stack || (stack = new Stack); 17112 return (objIsArr || isTypedArray(object)) 17113 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 17114 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 17115 } 17116 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 17117 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 17118 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 17119 17120 if (objIsWrapped || othIsWrapped) { 17121 var objUnwrapped = objIsWrapped ? object.value() : object, 17122 othUnwrapped = othIsWrapped ? other.value() : other; 17123 17124 stack || (stack = new Stack); 17125 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 17126 } 17127 } 17128 if (!isSameTag) { 17129 return false; 17130 } 17131 stack || (stack = new Stack); 17132 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 17133 } 17134 17135 /** 17136 * The base implementation of `_.isMap` without Node.js optimizations. 17137 * 17138 * @private 17139 * @param {*} value The value to check. 17140 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 17141 */ 17142 function baseIsMap(value) { 17143 return isObjectLike(value) && getTag(value) == mapTag; 17144 } 17145 17146 /** 17147 * The base implementation of `_.isMatch` without support for iteratee shorthands. 17148 * 17149 * @private 17150 * @param {Object} object The object to inspect. 17151 * @param {Object} source The object of property values to match. 17152 * @param {Array} matchData The property names, values, and compare flags to match. 17153 * @param {Function} [customizer] The function to customize comparisons. 17154 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 17155 */ 17156 function baseIsMatch(object, source, matchData, customizer) { 17157 var index = matchData.length, 17158 length = index, 17159 noCustomizer = !customizer; 17160 17161 if (object == null) { 17162 return !length; 17163 } 17164 object = Object(object); 17165 while (index--) { 17166 var data = matchData[index]; 17167 if ((noCustomizer && data[2]) 17168 ? data[1] !== object[data[0]] 17169 : !(data[0] in object) 17170 ) { 17171 return false; 17172 } 17173 } 17174 while (++index < length) { 17175 data = matchData[index]; 17176 var key = data[0], 17177 objValue = object[key], 17178 srcValue = data[1]; 17179 17180 if (noCustomizer && data[2]) { 17181 if (objValue === undefined && !(key in object)) { 17182 return false; 17183 } 17184 } else { 17185 var stack = new Stack; 17186 if (customizer) { 17187 var result = customizer(objValue, srcValue, key, object, source, stack); 17188 } 17189 if (!(result === undefined 17190 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) 17191 : result 17192 )) { 17193 return false; 17194 } 17195 } 17196 } 17197 return true; 17198 } 17199 17200 /** 17201 * The base implementation of `_.isNative` without bad shim checks. 17202 * 17203 * @private 17204 * @param {*} value The value to check. 17205 * @returns {boolean} Returns `true` if `value` is a native function, 17206 * else `false`. 17207 */ 17208 function baseIsNative(value) { 17209 if (!isObject(value) || isMasked(value)) { 17210 return false; 17211 } 17212 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 17213 return pattern.test(toSource(value)); 17214 } 17215 17216 /** 17217 * The base implementation of `_.isRegExp` without Node.js optimizations. 17218 * 17219 * @private 17220 * @param {*} value The value to check. 17221 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 17222 */ 17223 function baseIsRegExp(value) { 17224 return isObjectLike(value) && baseGetTag(value) == regexpTag; 17225 } 17226 17227 /** 17228 * The base implementation of `_.isSet` without Node.js optimizations. 17229 * 17230 * @private 17231 * @param {*} value The value to check. 17232 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 17233 */ 17234 function baseIsSet(value) { 17235 return isObjectLike(value) && getTag(value) == setTag; 17236 } 17237 17238 /** 17239 * The base implementation of `_.isTypedArray` without Node.js optimizations. 17240 * 17241 * @private 17242 * @param {*} value The value to check. 17243 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 17244 */ 17245 function baseIsTypedArray(value) { 17246 return isObjectLike(value) && 17247 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 17248 } 17249 17250 /** 17251 * The base implementation of `_.iteratee`. 17252 * 17253 * @private 17254 * @param {*} [value=_.identity] The value to convert to an iteratee. 17255 * @returns {Function} Returns the iteratee. 17256 */ 17257 function baseIteratee(value) { 17258 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 17259 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 17260 if (typeof value == 'function') { 17261 return value; 17262 } 17263 if (value == null) { 17264 return identity; 17265 } 17266 if (typeof value == 'object') { 17267 return isArray(value) 17268 ? baseMatchesProperty(value[0], value[1]) 17269 : baseMatches(value); 17270 } 17271 return property(value); 17272 } 17273 17274 /** 17275 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 17276 * 17277 * @private 17278 * @param {Object} object The object to query. 17279 * @returns {Array} Returns the array of property names. 17280 */ 17281 function baseKeys(object) { 17282 if (!isPrototype(object)) { 17283 return nativeKeys(object); 17284 } 17285 var result = []; 17286 for (var key in Object(object)) { 17287 if (hasOwnProperty.call(object, key) && key != 'constructor') { 17288 result.push(key); 17289 } 17290 } 17291 return result; 17292 } 17293 17294 /** 17295 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 17296 * 17297 * @private 17298 * @param {Object} object The object to query. 17299 * @returns {Array} Returns the array of property names. 17300 */ 17301 function baseKeysIn(object) { 17302 if (!isObject(object)) { 17303 return nativeKeysIn(object); 17304 } 17305 var isProto = isPrototype(object), 17306 result = []; 17307 17308 for (var key in object) { 17309 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 17310 result.push(key); 17311 } 17312 } 17313 return result; 17314 } 17315 17316 /** 17317 * The base implementation of `_.lt` which doesn't coerce arguments. 17318 * 17319 * @private 17320 * @param {*} value The value to compare. 17321 * @param {*} other The other value to compare. 17322 * @returns {boolean} Returns `true` if `value` is less than `other`, 17323 * else `false`. 17324 */ 17325 function baseLt(value, other) { 17326 return value < other; 17327 } 17328 17329 /** 17330 * The base implementation of `_.map` without support for iteratee shorthands. 17331 * 17332 * @private 17333 * @param {Array|Object} collection The collection to iterate over. 17334 * @param {Function} iteratee The function invoked per iteration. 17335 * @returns {Array} Returns the new mapped array. 17336 */ 17337 function baseMap(collection, iteratee) { 17338 var index = -1, 17339 result = isArrayLike(collection) ? Array(collection.length) : []; 17340 17341 baseEach(collection, function(value, key, collection) { 17342 result[++index] = iteratee(value, key, collection); 17343 }); 17344 return result; 17345 } 17346 17347 /** 17348 * The base implementation of `_.matches` which doesn't clone `source`. 17349 * 17350 * @private 17351 * @param {Object} source The object of property values to match. 17352 * @returns {Function} Returns the new spec function. 17353 */ 17354 function baseMatches(source) { 17355 var matchData = getMatchData(source); 17356 if (matchData.length == 1 && matchData[0][2]) { 17357 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 17358 } 17359 return function(object) { 17360 return object === source || baseIsMatch(object, source, matchData); 17361 }; 17362 } 17363 17364 /** 17365 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 17366 * 17367 * @private 17368 * @param {string} path The path of the property to get. 17369 * @param {*} srcValue The value to match. 17370 * @returns {Function} Returns the new spec function. 17371 */ 17372 function baseMatchesProperty(path, srcValue) { 17373 if (isKey(path) && isStrictComparable(srcValue)) { 17374 return matchesStrictComparable(toKey(path), srcValue); 17375 } 17376 return function(object) { 17377 var objValue = get(object, path); 17378 return (objValue === undefined && objValue === srcValue) 17379 ? hasIn(object, path) 17380 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 17381 }; 17382 } 17383 17384 /** 17385 * The base implementation of `_.merge` without support for multiple sources. 17386 * 17387 * @private 17388 * @param {Object} object The destination object. 17389 * @param {Object} source The source object. 17390 * @param {number} srcIndex The index of `source`. 17391 * @param {Function} [customizer] The function to customize merged values. 17392 * @param {Object} [stack] Tracks traversed source values and their merged 17393 * counterparts. 17394 */ 17395 function baseMerge(object, source, srcIndex, customizer, stack) { 17396 if (object === source) { 17397 return; 17398 } 17399 baseFor(source, function(srcValue, key) { 17400 stack || (stack = new Stack); 17401 if (isObject(srcValue)) { 17402 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 17403 } 17404 else { 17405 var newValue = customizer 17406 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) 17407 : undefined; 17408 17409 if (newValue === undefined) { 17410 newValue = srcValue; 17411 } 17412 assignMergeValue(object, key, newValue); 17413 } 17414 }, keysIn); 17415 } 17416 17417 /** 17418 * A specialized version of `baseMerge` for arrays and objects which performs 17419 * deep merges and tracks traversed objects enabling objects with circular 17420 * references to be merged. 17421 * 17422 * @private 17423 * @param {Object} object The destination object. 17424 * @param {Object} source The source object. 17425 * @param {string} key The key of the value to merge. 17426 * @param {number} srcIndex The index of `source`. 17427 * @param {Function} mergeFunc The function to merge values. 17428 * @param {Function} [customizer] The function to customize assigned values. 17429 * @param {Object} [stack] Tracks traversed source values and their merged 17430 * counterparts. 17431 */ 17432 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 17433 var objValue = safeGet(object, key), 17434 srcValue = safeGet(source, key), 17435 stacked = stack.get(srcValue); 17436 17437 if (stacked) { 17438 assignMergeValue(object, key, stacked); 17439 return; 17440 } 17441 var newValue = customizer 17442 ? customizer(objValue, srcValue, (key + ''), object, source, stack) 17443 : undefined; 17444 17445 var isCommon = newValue === undefined; 17446 17447 if (isCommon) { 17448 var isArr = isArray(srcValue), 17449 isBuff = !isArr && isBuffer(srcValue), 17450 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 17451 17452 newValue = srcValue; 17453 if (isArr || isBuff || isTyped) { 17454 if (isArray(objValue)) { 17455 newValue = objValue; 17456 } 17457 else if (isArrayLikeObject(objValue)) { 17458 newValue = copyArray(objValue); 17459 } 17460 else if (isBuff) { 17461 isCommon = false;
vendor: 8,178 bytes, lines 17462-17723
17462 newValue = cloneBuffer(srcValue, true); 17463 } 17464 else if (isTyped) { 17465 isCommon = false; 17466 newValue = cloneTypedArray(srcValue, true); 17467 } 17468 else { 17469 newValue = []; 17470 } 17471 } 17472 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 17473 newValue = objValue; 17474 if (isArguments(objValue)) { 17475 newValue = toPlainObject(objValue); 17476 } 17477 else if (!isObject(objValue) || isFunction(objValue)) { 17478 newValue = initCloneObject(srcValue); 17479 } 17480 } 17481 else { 17482 isCommon = false; 17483 } 17484 } 17485 if (isCommon) { 17486 // Recursively merge objects and arrays (susceptible to call stack limits). 17487 stack.set(srcValue, newValue); 17488 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 17489 stack['delete'](srcValue); 17490 } 17491 assignMergeValue(object, key, newValue); 17492 } 17493 17494 /** 17495 * The base implementation of `_.nth` which doesn't coerce arguments. 17496 * 17497 * @private 17498 * @param {Array} array The array to query. 17499 * @param {number} n The index of the element to return. 17500 * @returns {*} Returns the nth element of `array`. 17501 */ 17502 function baseNth(array, n) { 17503 var length = array.length; 17504 if (!length) { 17505 return; 17506 } 17507 n += n < 0 ? length : 0; 17508 return isIndex(n, length) ? array[n] : undefined; 17509 } 17510 17511 /** 17512 * The base implementation of `_.orderBy` without param guards. 17513 * 17514 * @private 17515 * @param {Array|Object} collection The collection to iterate over. 17516 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 17517 * @param {string[]} orders The sort orders of `iteratees`. 17518 * @returns {Array} Returns the new sorted array. 17519 */ 17520 function baseOrderBy(collection, iteratees, orders) { 17521 if (iteratees.length) { 17522 iteratees = arrayMap(iteratees, function(iteratee) { 17523 if (isArray(iteratee)) { 17524 return function(value) { 17525 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); 17526 }; 17527 } 17528 return iteratee; 17529 }); 17530 } else { 17531 iteratees = [identity]; 17532 } 17533 17534 var index = -1; 17535 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 17536 17537 var result = baseMap(collection, function(value, key, collection) { 17538 var criteria = arrayMap(iteratees, function(iteratee) { 17539 return iteratee(value); 17540 }); 17541 return { 'criteria': criteria, 'index': ++index, 'value': value }; 17542 }); 17543 17544 return baseSortBy(result, function(object, other) { 17545 return compareMultiple(object, other, orders); 17546 }); 17547 } 17548 17549 /** 17550 * The base implementation of `_.pick` without support for individual 17551 * property identifiers. 17552 * 17553 * @private 17554 * @param {Object} object The source object. 17555 * @param {string[]} paths The property paths to pick. 17556 * @returns {Object} Returns the new object. 17557 */ 17558 function basePick(object, paths) { 17559 return basePickBy(object, paths, function(value, path) { 17560 return hasIn(object, path); 17561 }); 17562 } 17563 17564 /** 17565 * The base implementation of `_.pickBy` without support for iteratee shorthands. 17566 * 17567 * @private 17568 * @param {Object} object The source object. 17569 * @param {string[]} paths The property paths to pick. 17570 * @param {Function} predicate The function invoked per property. 17571 * @returns {Object} Returns the new object. 17572 */ 17573 function basePickBy(object, paths, predicate) { 17574 var index = -1, 17575 length = paths.length, 17576 result = {}; 17577 17578 while (++index < length) { 17579 var path = paths[index], 17580 value = baseGet(object, path); 17581 17582 if (predicate(value, path)) { 17583 baseSet(result, castPath(path, object), value); 17584 } 17585 } 17586 return result; 17587 } 17588 17589 /** 17590 * A specialized version of `baseProperty` which supports deep paths. 17591 * 17592 * @private 17593 * @param {Array|string} path The path of the property to get. 17594 * @returns {Function} Returns the new accessor function. 17595 */ 17596 function basePropertyDeep(path) { 17597 return function(object) { 17598 return baseGet(object, path); 17599 }; 17600 } 17601 17602 /** 17603 * The base implementation of `_.pullAllBy` without support for iteratee 17604 * shorthands. 17605 * 17606 * @private 17607 * @param {Array} array The array to modify. 17608 * @param {Array} values The values to remove. 17609 * @param {Function} [iteratee] The iteratee invoked per element. 17610 * @param {Function} [comparator] The comparator invoked per element. 17611 * @returns {Array} Returns `array`. 17612 */ 17613 function basePullAll(array, values, iteratee, comparator) { 17614 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 17615 index = -1, 17616 length = values.length, 17617 seen = array; 17618 17619 if (array === values) { 17620 values = copyArray(values); 17621 } 17622 if (iteratee) { 17623 seen = arrayMap(array, baseUnary(iteratee)); 17624 } 17625 while (++index < length) { 17626 var fromIndex = 0, 17627 value = values[index], 17628 computed = iteratee ? iteratee(value) : value; 17629 17630 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 17631 if (seen !== array) { 17632 splice.call(seen, fromIndex, 1); 17633 } 17634 splice.call(array, fromIndex, 1); 17635 } 17636 } 17637 return array; 17638 } 17639 17640 /** 17641 * The base implementation of `_.pullAt` without support for individual 17642 * indexes or capturing the removed elements. 17643 * 17644 * @private 17645 * @param {Array} array The array to modify. 17646 * @param {number[]} indexes The indexes of elements to remove. 17647 * @returns {Array} Returns `array`. 17648 */ 17649 function basePullAt(array, indexes) { 17650 var length = array ? indexes.length : 0, 17651 lastIndex = length - 1; 17652 17653 while (length--) { 17654 var index = indexes[length]; 17655 if (length == lastIndex || index !== previous) { 17656 var previous = index; 17657 if (isIndex(index)) { 17658 splice.call(array, index, 1); 17659 } else { 17660 baseUnset(array, index); 17661 } 17662 } 17663 } 17664 return array; 17665 } 17666 17667 /** 17668 * The base implementation of `_.random` without support for returning 17669 * floating-point numbers. 17670 * 17671 * @private 17672 * @param {number} lower The lower bound. 17673 * @param {number} upper The upper bound. 17674 * @returns {number} Returns the random number. 17675 */ 17676 function baseRandom(lower, upper) { 17677 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 17678 } 17679 17680 /** 17681 * The base implementation of `_.range` and `_.rangeRight` which doesn't 17682 * coerce arguments. 17683 * 17684 * @private 17685 * @param {number} start The start of the range. 17686 * @param {number} end The end of the range. 17687 * @param {number} step The value to increment or decrement by. 17688 * @param {boolean} [fromRight] Specify iterating from right to left. 17689 * @returns {Array} Returns the range of numbers. 17690 */ 17691 function baseRange(start, end, step, fromRight) { 17692 var index = -1, 17693 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), 17694 result = Array(length); 17695 17696 while (length--) { 17697 result[fromRight ? length : ++index] = start; 17698 start += step; 17699 } 17700 return result; 17701 } 17702 17703 /** 17704 * The base implementation of `_.repeat` which doesn't coerce arguments. 17705 * 17706 * @private 17707 * @param {string} string The string to repeat. 17708 * @param {number} n The number of times to repeat the string. 17709 * @returns {string} Returns the repeated string. 17710 */ 17711 function baseRepeat(string, n) { 17712 var result = ''; 17713 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 17714 return result; 17715 } 17716 // Leverage the exponentiation by squaring algorithm for a faster repeat. 17717 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 17718 do { 17719 if (n % 2) { 17720 result += string; 17721 } 17722 n = nativeFloor(n / 2); 17723 if (n) {
vendor: 7,562 bytes, lines 17724-17960
17724 string += string; 17725 } 17726 } while (n); 17727 17728 return result; 17729 } 17730 17731 /** 17732 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 17733 * 17734 * @private 17735 * @param {Function} func The function to apply a rest parameter to. 17736 * @param {number} [start=func.length-1] The start position of the rest parameter. 17737 * @returns {Function} Returns the new function. 17738 */ 17739 function baseRest(func, start) { 17740 return setToString(overRest(func, start, identity), func + ''); 17741 } 17742 17743 /** 17744 * The base implementation of `_.sample`. 17745 * 17746 * @private 17747 * @param {Array|Object} collection The collection to sample. 17748 * @returns {*} Returns the random element. 17749 */ 17750 function baseSample(collection) { 17751 return arraySample(values(collection)); 17752 } 17753 17754 /** 17755 * The base implementation of `_.sampleSize` without param guards. 17756 * 17757 * @private 17758 * @param {Array|Object} collection The collection to sample. 17759 * @param {number} n The number of elements to sample. 17760 * @returns {Array} Returns the random elements. 17761 */ 17762 function baseSampleSize(collection, n) { 17763 var array = values(collection); 17764 return shuffleSelf(array, baseClamp(n, 0, array.length)); 17765 } 17766 17767 /** 17768 * The base implementation of `_.set`. 17769 * 17770 * @private 17771 * @param {Object} object The object to modify. 17772 * @param {Array|string} path The path of the property to set. 17773 * @param {*} value The value to set. 17774 * @param {Function} [customizer] The function to customize path creation. 17775 * @returns {Object} Returns `object`. 17776 */ 17777 function baseSet(object, path, value, customizer) { 17778 if (!isObject(object)) { 17779 return object; 17780 } 17781 path = castPath(path, object); 17782 17783 var index = -1, 17784 length = path.length, 17785 lastIndex = length - 1, 17786 nested = object; 17787 17788 while (nested != null && ++index < length) { 17789 var key = toKey(path[index]), 17790 newValue = value; 17791 17792 if (key === '__proto__' || key === 'constructor' || key === 'prototype') { 17793 return object; 17794 } 17795 17796 if (index != lastIndex) { 17797 var objValue = nested[key]; 17798 newValue = customizer ? customizer(objValue, key, nested) : undefined; 17799 if (newValue === undefined) { 17800 newValue = isObject(objValue) 17801 ? objValue 17802 : (isIndex(path[index + 1]) ? [] : {}); 17803 } 17804 } 17805 assignValue(nested, key, newValue); 17806 nested = nested[key]; 17807 } 17808 return object; 17809 } 17810 17811 /** 17812 * The base implementation of `setData` without support for hot loop shorting. 17813 * 17814 * @private 17815 * @param {Function} func The function to associate metadata with. 17816 * @param {*} data The metadata. 17817 * @returns {Function} Returns `func`. 17818 */ 17819 var baseSetData = !metaMap ? identity : function(func, data) { 17820 metaMap.set(func, data); 17821 return func; 17822 }; 17823 17824 /** 17825 * The base implementation of `setToString` without support for hot loop shorting. 17826 * 17827 * @private 17828 * @param {Function} func The function to modify. 17829 * @param {Function} string The `toString` result. 17830 * @returns {Function} Returns `func`. 17831 */ 17832 var baseSetToString = !defineProperty ? identity : function(func, string) { 17833 return defineProperty(func, 'toString', { 17834 'configurable': true, 17835 'enumerable': false, 17836 'value': constant(string), 17837 'writable': true 17838 }); 17839 }; 17840 17841 /** 17842 * The base implementation of `_.shuffle`. 17843 * 17844 * @private 17845 * @param {Array|Object} collection The collection to shuffle. 17846 * @returns {Array} Returns the new shuffled array. 17847 */ 17848 function baseShuffle(collection) { 17849 return shuffleSelf(values(collection)); 17850 } 17851 17852 /** 17853 * The base implementation of `_.slice` without an iteratee call guard. 17854 * 17855 * @private 17856 * @param {Array} array The array to slice. 17857 * @param {number} [start=0] The start position. 17858 * @param {number} [end=array.length] The end position. 17859 * @returns {Array} Returns the slice of `array`. 17860 */ 17861 function baseSlice(array, start, end) { 17862 var index = -1, 17863 length = array.length; 17864 17865 if (start < 0) { 17866 start = -start > length ? 0 : (length + start); 17867 } 17868 end = end > length ? length : end; 17869 if (end < 0) { 17870 end += length; 17871 } 17872 length = start > end ? 0 : ((end - start) >>> 0); 17873 start >>>= 0; 17874 17875 var result = Array(length); 17876 while (++index < length) { 17877 result[index] = array[index + start]; 17878 } 17879 return result; 17880 } 17881 17882 /** 17883 * The base implementation of `_.some` without support for iteratee shorthands. 17884 * 17885 * @private 17886 * @param {Array|Object} collection The collection to iterate over. 17887 * @param {Function} predicate The function invoked per iteration. 17888 * @returns {boolean} Returns `true` if any element passes the predicate check, 17889 * else `false`. 17890 */ 17891 function baseSome(collection, predicate) { 17892 var result; 17893 17894 baseEach(collection, function(value, index, collection) { 17895 result = predicate(value, index, collection); 17896 return !result; 17897 }); 17898 return !!result; 17899 } 17900 17901 /** 17902 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 17903 * performs a binary search of `array` to determine the index at which `value` 17904 * should be inserted into `array` in order to maintain its sort order. 17905 * 17906 * @private 17907 * @param {Array} array The sorted array to inspect. 17908 * @param {*} value The value to evaluate. 17909 * @param {boolean} [retHighest] Specify returning the highest qualified index. 17910 * @returns {number} Returns the index at which `value` should be inserted 17911 * into `array`. 17912 */ 17913 function baseSortedIndex(array, value, retHighest) { 17914 var low = 0, 17915 high = array == null ? low : array.length; 17916 17917 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 17918 while (low < high) { 17919 var mid = (low + high) >>> 1, 17920 computed = array[mid]; 17921 17922 if (computed !== null && !isSymbol(computed) && 17923 (retHighest ? (computed <= value) : (computed < value))) { 17924 low = mid + 1; 17925 } else { 17926 high = mid; 17927 } 17928 } 17929 return high; 17930 } 17931 return baseSortedIndexBy(array, value, identity, retHighest); 17932 } 17933 17934 /** 17935 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 17936 * which invokes `iteratee` for `value` and each element of `array` to compute 17937 * their sort ranking. The iteratee is invoked with one argument; (value). 17938 * 17939 * @private 17940 * @param {Array} array The sorted array to inspect. 17941 * @param {*} value The value to evaluate. 17942 * @param {Function} iteratee The iteratee invoked per element. 17943 * @param {boolean} [retHighest] Specify returning the highest qualified index. 17944 * @returns {number} Returns the index at which `value` should be inserted 17945 * into `array`. 17946 */ 17947 function baseSortedIndexBy(array, value, iteratee, retHighest) { 17948 var low = 0, 17949 high = array == null ? 0 : array.length; 17950 if (high === 0) { 17951 return 0; 17952 } 17953 17954 value = iteratee(value); 17955 var valIsNaN = value !== value, 17956 valIsNull = value === null, 17957 valIsSymbol = isSymbol(value), 17958 valIsUndefined = value === undefined; 17959 17960 while (low < high) {
vendor: 8,410 bytes, lines 17961-18213
17961 var mid = nativeFloor((low + high) / 2), 17962 computed = iteratee(array[mid]), 17963 othIsDefined = computed !== undefined, 17964 othIsNull = computed === null, 17965 othIsReflexive = computed === computed, 17966 othIsSymbol = isSymbol(computed); 17967 17968 if (valIsNaN) { 17969 var setLow = retHighest || othIsReflexive; 17970 } else if (valIsUndefined) { 17971 setLow = othIsReflexive && (retHighest || othIsDefined); 17972 } else if (valIsNull) { 17973 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 17974 } else if (valIsSymbol) { 17975 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 17976 } else if (othIsNull || othIsSymbol) { 17977 setLow = false; 17978 } else { 17979 setLow = retHighest ? (computed <= value) : (computed < value); 17980 } 17981 if (setLow) { 17982 low = mid + 1; 17983 } else { 17984 high = mid; 17985 } 17986 } 17987 return nativeMin(high, MAX_ARRAY_INDEX); 17988 } 17989 17990 /** 17991 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 17992 * support for iteratee shorthands. 17993 * 17994 * @private 17995 * @param {Array} array The array to inspect. 17996 * @param {Function} [iteratee] The iteratee invoked per element. 17997 * @returns {Array} Returns the new duplicate free array. 17998 */ 17999 function baseSortedUniq(array, iteratee) { 18000 var index = -1, 18001 length = array.length, 18002 resIndex = 0, 18003 result = []; 18004 18005 while (++index < length) { 18006 var value = array[index], 18007 computed = iteratee ? iteratee(value) : value; 18008 18009 if (!index || !eq(computed, seen)) { 18010 var seen = computed; 18011 result[resIndex++] = value === 0 ? 0 : value; 18012 } 18013 } 18014 return result; 18015 } 18016 18017 /** 18018 * The base implementation of `_.toNumber` which doesn't ensure correct 18019 * conversions of binary, hexadecimal, or octal string values. 18020 * 18021 * @private 18022 * @param {*} value The value to process. 18023 * @returns {number} Returns the number. 18024 */ 18025 function baseToNumber(value) { 18026 if (typeof value == 'number') { 18027 return value; 18028 } 18029 if (isSymbol(value)) { 18030 return NAN; 18031 } 18032 return +value; 18033 } 18034 18035 /** 18036 * The base implementation of `_.toString` which doesn't convert nullish 18037 * values to empty strings. 18038 * 18039 * @private 18040 * @param {*} value The value to process. 18041 * @returns {string} Returns the string. 18042 */ 18043 function baseToString(value) { 18044 // Exit early for strings to avoid a performance hit in some environments. 18045 if (typeof value == 'string') { 18046 return value; 18047 } 18048 if (isArray(value)) { 18049 // Recursively convert values (susceptible to call stack limits). 18050 return arrayMap(value, baseToString) + ''; 18051 } 18052 if (isSymbol(value)) { 18053 return symbolToString ? symbolToString.call(value) : ''; 18054 } 18055 var result = (value + ''); 18056 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 18057 } 18058 18059 /** 18060 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 18061 * 18062 * @private 18063 * @param {Array} array The array to inspect. 18064 * @param {Function} [iteratee] The iteratee invoked per element. 18065 * @param {Function} [comparator] The comparator invoked per element. 18066 * @returns {Array} Returns the new duplicate free array. 18067 */ 18068 function baseUniq(array, iteratee, comparator) { 18069 var index = -1, 18070 includes = arrayIncludes, 18071 length = array.length, 18072 isCommon = true, 18073 result = [], 18074 seen = result; 18075 18076 if (comparator) { 18077 isCommon = false; 18078 includes = arrayIncludesWith; 18079 } 18080 else if (length >= LARGE_ARRAY_SIZE) { 18081 var set = iteratee ? null : createSet(array); 18082 if (set) { 18083 return setToArray(set); 18084 } 18085 isCommon = false; 18086 includes = cacheHas; 18087 seen = new SetCache; 18088 } 18089 else { 18090 seen = iteratee ? [] : result; 18091 } 18092 outer: 18093 while (++index < length) { 18094 var value = array[index], 18095 computed = iteratee ? iteratee(value) : value; 18096 18097 value = (comparator || value !== 0) ? value : 0; 18098 if (isCommon && computed === computed) { 18099 var seenIndex = seen.length; 18100 while (seenIndex--) { 18101 if (seen[seenIndex] === computed) { 18102 continue outer; 18103 } 18104 } 18105 if (iteratee) { 18106 seen.push(computed); 18107 } 18108 result.push(value); 18109 } 18110 else if (!includes(seen, computed, comparator)) { 18111 if (seen !== result) { 18112 seen.push(computed); 18113 } 18114 result.push(value); 18115 } 18116 } 18117 return result; 18118 } 18119 18120 /** 18121 * The base implementation of `_.unset`. 18122 * 18123 * @private 18124 * @param {Object} object The object to modify. 18125 * @param {Array|string} path The property path to unset. 18126 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 18127 */ 18128 function baseUnset(object, path) { 18129 path = castPath(path, object); 18130 18131 // Prevent prototype pollution: 18132 // https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg 18133 // https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh 18134 var index = -1, 18135 length = path.length; 18136 18137 if (!length) { 18138 return true; 18139 } 18140 18141 while (++index < length) { 18142 var key = toKey(path[index]); 18143 18144 // Always block "__proto__" anywhere in the path if it's not expected 18145 if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) { 18146 return false; 18147 } 18148 18149 // Block constructor/prototype as non-terminal traversal keys to prevent 18150 // escaping the object graph into built-in constructors and prototypes. 18151 if ((key === 'constructor' || key === 'prototype') && index < length - 1) { 18152 return false; 18153 } 18154 } 18155 18156 var obj = parent(object, path); 18157 return obj == null || delete obj[toKey(last(path))]; 18158 } 18159 18160 /** 18161 * The base implementation of `_.update`. 18162 * 18163 * @private 18164 * @param {Object} object The object to modify. 18165 * @param {Array|string} path The path of the property to update. 18166 * @param {Function} updater The function to produce the updated value. 18167 * @param {Function} [customizer] The function to customize path creation. 18168 * @returns {Object} Returns `object`. 18169 */ 18170 function baseUpdate(object, path, updater, customizer) { 18171 return baseSet(object, path, updater(baseGet(object, path)), customizer); 18172 } 18173 18174 /** 18175 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 18176 * without support for iteratee shorthands. 18177 * 18178 * @private 18179 * @param {Array} array The array to query. 18180 * @param {Function} predicate The function invoked per iteration. 18181 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 18182 * @param {boolean} [fromRight] Specify iterating from right to left. 18183 * @returns {Array} Returns the slice of `array`. 18184 */ 18185 function baseWhile(array, predicate, isDrop, fromRight) { 18186 var length = array.length, 18187 index = fromRight ? length : -1; 18188 18189 while ((fromRight ? index-- : ++index < length) && 18190 predicate(array[index], index, array)) {} 18191 18192 return isDrop 18193 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) 18194 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); 18195 } 18196 18197 /** 18198 * The base implementation of `wrapperValue` which returns the result of 18199 * performing a sequence of actions on the unwrapped `value`, where each 18200 * successive action is supplied the return value of the previous. 18201 * 18202 * @private 18203 * @param {*} value The unwrapped value. 18204 * @param {Array} actions Actions to perform to resolve the unwrapped value. 18205 * @returns {*} Returns the resolved value. 18206 */ 18207 function baseWrapperValue(value, actions) { 18208 var result = value; 18209 if (result instanceof LazyWrapper) { 18210 result = result.value(); 18211 } 18212 return arrayReduce(actions, function(result, action) { 18213 return action.func.apply(action.thisArg, arrayPush([result], action.args
vendor: 45,119 bytes, lines 18213-19504
18213)); 18214 }, result); 18215 } 18216 18217 /** 18218 * The base implementation of methods like `_.xor`, without support for 18219 * iteratee shorthands, that accepts an array of arrays to inspect. 18220 * 18221 * @private 18222 * @param {Array} arrays The arrays to inspect. 18223 * @param {Function} [iteratee] The iteratee invoked per element. 18224 * @param {Function} [comparator] The comparator invoked per element. 18225 * @returns {Array} Returns the new array of values. 18226 */ 18227 function baseXor(arrays, iteratee, comparator) { 18228 var length = arrays.length; 18229 if (length < 2) { 18230 return length ? baseUniq(arrays[0]) : []; 18231 } 18232 var index = -1, 18233 result = Array(length); 18234 18235 while (++index < length) { 18236 var array = arrays[index], 18237 othIndex = -1; 18238 18239 while (++othIndex < length) { 18240 if (othIndex != index) { 18241 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); 18242 } 18243 } 18244 } 18245 return baseUniq(baseFlatten(result, 1), iteratee, comparator); 18246 } 18247 18248 /** 18249 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 18250 * 18251 * @private 18252 * @param {Array} props The property identifiers. 18253 * @param {Array} values The property values. 18254 * @param {Function} assignFunc The function to assign values. 18255 * @returns {Object} Returns the new object. 18256 */ 18257 function baseZipObject(props, values, assignFunc) { 18258 var index = -1, 18259 length = props.length, 18260 valsLength = values.length, 18261 result = {}; 18262 18263 while (++index < length) { 18264 var value = index < valsLength ? values[index] : undefined; 18265 assignFunc(result, props[index], value); 18266 } 18267 return result; 18268 } 18269 18270 /** 18271 * Casts `value` to an empty array if it's not an array like object. 18272 * 18273 * @private 18274 * @param {*} value The value to inspect. 18275 * @returns {Array|Object} Returns the cast array-like object. 18276 */ 18277 function castArrayLikeObject(value) { 18278 return isArrayLikeObject(value) ? value : []; 18279 } 18280 18281 /** 18282 * Casts `value` to `identity` if it's not a function. 18283 * 18284 * @private 18285 * @param {*} value The value to inspect. 18286 * @returns {Function} Returns cast function. 18287 */ 18288 function castFunction(value) { 18289 return typeof value == 'function' ? value : identity; 18290 } 18291 18292 /** 18293 * Casts `value` to a path array if it's not one. 18294 * 18295 * @private 18296 * @param {*} value The value to inspect. 18297 * @param {Object} [object] The object to query keys on. 18298 * @returns {Array} Returns the cast property path array. 18299 */ 18300 function castPath(value, object) { 18301 if (isArray(value)) { 18302 return value; 18303 } 18304 return isKey(value, object) ? [value] : stringToPath(toString(value)); 18305 } 18306 18307 /** 18308 * A `baseRest` alias which can be replaced with `identity` by module 18309 * replacement plugins. 18310 * 18311 * @private 18312 * @type {Function} 18313 * @param {Function} func The function to apply a rest parameter to. 18314 * @returns {Function} Returns the new function. 18315 */ 18316 var castRest = baseRest; 18317 18318 /** 18319 * Casts `array` to a slice if it's needed. 18320 * 18321 * @private 18322 * @param {Array} array The array to inspect. 18323 * @param {number} start The start position. 18324 * @param {number} [end=array.length] The end position. 18325 * @returns {Array} Returns the cast slice. 18326 */ 18327 function castSlice(array, start, end) { 18328 var length = array.length; 18329 end = end === undefined ? length : end; 18330 return (!start && end >= length) ? array : baseSlice(array, start, end); 18331 } 18332 18333 /** 18334 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 18335 * 18336 * @private 18337 * @param {number|Object} id The timer id or timeout object of the timer to clear. 18338 */ 18339 var clearTimeout = ctxClearTimeout || function(id) { 18340 return root.clearTimeout(id); 18341 }; 18342 18343 /** 18344 * Creates a clone of `buffer`. 18345 * 18346 * @private 18347 * @param {Buffer} buffer The buffer to clone. 18348 * @param {boolean} [isDeep] Specify a deep clone. 18349 * @returns {Buffer} Returns the cloned buffer. 18350 */ 18351 function cloneBuffer(buffer, isDeep) { 18352 if (isDeep) { 18353 return buffer.slice(); 18354 } 18355 var length = buffer.length, 18356 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 18357 18358 buffer.copy(result); 18359 return result; 18360 } 18361 18362 /** 18363 * Creates a clone of `arrayBuffer`. 18364 * 18365 * @private 18366 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 18367 * @returns {ArrayBuffer} Returns the cloned array buffer. 18368 */ 18369 function cloneArrayBuffer(arrayBuffer) { 18370 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 18371 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 18372 return result; 18373 } 18374 18375 /** 18376 * Creates a clone of `dataView`. 18377 * 18378 * @private 18379 * @param {Object} dataView The data view to clone. 18380 * @param {boolean} [isDeep] Specify a deep clone. 18381 * @returns {Object} Returns the cloned data view. 18382 */ 18383 function cloneDataView(dataView, isDeep) { 18384 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 18385 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 18386 } 18387 18388 /** 18389 * Creates a clone of `regexp`. 18390 * 18391 * @private 18392 * @param {Object} regexp The regexp to clone. 18393 * @returns {Object} Returns the cloned regexp. 18394 */ 18395 function cloneRegExp(regexp) { 18396 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 18397 result.lastIndex = regexp.lastIndex; 18398 return result; 18399 } 18400 18401 /** 18402 * Creates a clone of the `symbol` object. 18403 * 18404 * @private 18405 * @param {Object} symbol The symbol object to clone. 18406 * @returns {Object} Returns the cloned symbol object. 18407 */ 18408 function cloneSymbol(symbol) { 18409 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 18410 } 18411 18412 /** 18413 * Creates a clone of `typedArray`. 18414 * 18415 * @private 18416 * @param {Object} typedArray The typed array to clone. 18417 * @param {boolean} [isDeep] Specify a deep clone. 18418 * @returns {Object} Returns the cloned typed array. 18419 */ 18420 function cloneTypedArray(typedArray, isDeep) { 18421 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 18422 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 18423 } 18424 18425 /** 18426 * Compares values to sort them in ascending order. 18427 * 18428 * @private 18429 * @param {*} value The value to compare. 18430 * @param {*} other The other value to compare. 18431 * @returns {number} Returns the sort order indicator for `value`. 18432 */ 18433 function compareAscending(value, other) { 18434 if (value !== other) { 18435 var valIsDefined = value !== undefined, 18436 valIsNull = value === null, 18437 valIsReflexive = value === value, 18438 valIsSymbol = isSymbol(value); 18439 18440 var othIsDefined = other !== undefined, 18441 othIsNull = other === null, 18442 othIsReflexive = other === other, 18443 othIsSymbol = isSymbol(other); 18444 18445 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 18446 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 18447 (valIsNull && othIsDefined && othIsReflexive) || 18448 (!valIsDefined && othIsReflexive) || 18449 !valIsReflexive) { 18450 return 1; 18451 } 18452 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 18453 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 18454 (othIsNull && valIsDefined && valIsReflexive) || 18455 (!othIsDefined && valIsReflexive) || 18456 !othIsReflexive) { 18457 return -1; 18458 } 18459 } 18460 return 0; 18461 } 18462 18463 /** 18464 * Used by `_.orderBy` to compare multiple properties of a value to another 18465 * and stable sort them. 18466 * 18467 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 18468 * specify an order of "desc" for descending or "asc" for ascending sort order 18469 * of corresponding values. 18470 * 18471 * @private 18472 * @param {Object} object The object to compare. 18473 * @param {Object} other The other object to compare. 18474 * @param {boolean[]|string[]} orders The order to sort by for each property. 18475 * @returns {number} Returns the sort order indicator for `object`. 18476 */ 18477 function compareMultiple(object, other, orders) { 18478 var index = -1, 18479 objCriteria = object.criteria, 18480 othCriteria = other.criteria, 18481 length = objCriteria.length, 18482 ordersLength = orders.length; 18483 18484 while (++index < length) { 18485 var result = compareAscending(objCriteria[index], othCriteria[index]); 18486 if (result) { 18487 if (index >= ordersLength) { 18488 return result; 18489 } 18490 var order = orders[index]; 18491 return result * (order == 'desc' ? -1 : 1); 18492 } 18493 } 18494 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 18495 // that causes it, under certain circumstances, to provide the same value for 18496 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 18497 // for more details. 18498 // 18499 // This also ensures a stable sort in V8 and other engines. 18500 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 18501 return object.index - other.index; 18502 } 18503 18504 /** 18505 * Creates an array that is the composition of partially applied arguments, 18506 * placeholders, and provided arguments into a single array of arguments. 18507 * 18508 * @private 18509 * @param {Array} args The provided arguments. 18510 * @param {Array} partials The arguments to prepend to those provided. 18511 * @param {Array} holders The `partials` placeholder indexes. 18512 * @params {boolean} [isCurried] Specify composing for a curried function. 18513 * @returns {Array} Returns the new array of composed arguments. 18514 */ 18515 function composeArgs(args, partials, holders, isCurried) { 18516 var argsIndex = -1, 18517 argsLength = args.length, 18518 holdersLength = holders.length, 18519 leftIndex = -1, 18520 leftLength = partials.length, 18521 rangeLength = nativeMax(argsLength - holdersLength, 0), 18522 result = Array(leftLength + rangeLength), 18523 isUncurried = !isCurried; 18524 18525 while (++leftIndex < leftLength) { 18526 result[leftIndex] = partials[leftIndex]; 18527 } 18528 while (++argsIndex < holdersLength) { 18529 if (isUncurried || argsIndex < argsLength) { 18530 result[holders[argsIndex]] = args[argsIndex]; 18531 } 18532 } 18533 while (rangeLength--) { 18534 result[leftIndex++] = args[argsIndex++]; 18535 } 18536 return result; 18537 } 18538 18539 /** 18540 * This function is like `composeArgs` except that the arguments composition 18541 * is tailored for `_.partialRight`. 18542 * 18543 * @private 18544 * @param {Array} args The provided arguments. 18545 * @param {Array} partials The arguments to append to those provided. 18546 * @param {Array} holders The `partials` placeholder indexes. 18547 * @params {boolean} [isCurried] Specify composing for a curried function. 18548 * @returns {Array} Returns the new array of composed arguments. 18549 */ 18550 function composeArgsRight(args, partials, holders, isCurried) { 18551 var argsIndex = -1, 18552 argsLength = args.length, 18553 holdersIndex = -1, 18554 holdersLength = holders.length, 18555 rightIndex = -1, 18556 rightLength = partials.length, 18557 rangeLength = nativeMax(argsLength - holdersLength, 0), 18558 result = Array(rangeLength + rightLength), 18559 isUncurried = !isCurried; 18560 18561 while (++argsIndex < rangeLength) { 18562 result[argsIndex] = args[argsIndex]; 18563 } 18564 var offset = argsIndex; 18565 while (++rightIndex < rightLength) { 18566 result[offset + rightIndex] = partials[rightIndex]; 18567 } 18568 while (++holdersIndex < holdersLength) { 18569 if (isUncurried || argsIndex < argsLength) { 18570 result[offset + holders[holdersIndex]] = args[argsIndex++]; 18571 } 18572 } 18573 return result; 18574 } 18575 18576 /** 18577 * Copies the values of `source` to `array`. 18578 * 18579 * @private 18580 * @param {Array} source The array to copy values from. 18581 * @param {Array} [array=[]] The array to copy values to. 18582 * @returns {Array} Returns `array`. 18583 */ 18584 function copyArray(source, array) { 18585 var index = -1, 18586 length = source.length; 18587 18588 array || (array = Array(length)); 18589 while (++index < length) { 18590 array[index] = source[index]; 18591 } 18592 return array; 18593 } 18594 18595 /** 18596 * Copies properties of `source` to `object`. 18597 * 18598 * @private 18599 * @param {Object} source The object to copy properties from. 18600 * @param {Array} props The property identifiers to copy. 18601 * @param {Object} [object={}] The object to copy properties to. 18602 * @param {Function} [customizer] The function to customize copied values. 18603 * @returns {Object} Returns `object`. 18604 */ 18605 function copyObject(source, props, object, customizer) { 18606 var isNew = !object; 18607 object || (object = {}); 18608 18609 var index = -1, 18610 length = props.length; 18611 18612 while (++index < length) { 18613 var key = props[index]; 18614 18615 var newValue = customizer 18616 ? customizer(object[key], source[key], key, object, source) 18617 : undefined; 18618 18619 if (newValue === undefined) { 18620 newValue = source[key]; 18621 } 18622 if (isNew) { 18623 baseAssignValue(object, key, newValue); 18624 } else { 18625 assignValue(object, key, newValue); 18626 } 18627 } 18628 return object; 18629 } 18630 18631 /** 18632 * Copies own symbols of `source` to `object`. 18633 * 18634 * @private 18635 * @param {Object} source The object to copy symbols from. 18636 * @param {Object} [object={}] The object to copy symbols to. 18637 * @returns {Object} Returns `object`. 18638 */ 18639 function copySymbols(source, object) { 18640 return copyObject(source, getSymbols(source), object); 18641 } 18642 18643 /** 18644 * Copies own and inherited symbols of `source` to `object`. 18645 * 18646 * @private 18647 * @param {Object} source The object to copy symbols from. 18648 * @param {Object} [object={}] The object to copy symbols to. 18649 * @returns {Object} Returns `object`. 18650 */ 18651 function copySymbolsIn(source, object) { 18652 return copyObject(source, getSymbolsIn(source), object); 18653 } 18654 18655 /** 18656 * Creates a function like `_.groupBy`. 18657 * 18658 * @private 18659 * @param {Function} setter The function to set accumulator values. 18660 * @param {Function} [initializer] The accumulator object initializer. 18661 * @returns {Function} Returns the new aggregator function. 18662 */ 18663 function createAggregator(setter, initializer) { 18664 return function(collection, iteratee) { 18665 var func = isArray(collection) ? arrayAggregator : baseAggregator, 18666 accumulator = initializer ? initializer() : {}; 18667 18668 return func(collection, setter, getIteratee(iteratee, 2), accumulator); 18669 }; 18670 } 18671 18672 /** 18673 * Creates a function like `_.assign`. 18674 * 18675 * @private 18676 * @param {Function} assigner The function to assign values. 18677 * @returns {Function} Returns the new assigner function. 18678 */ 18679 function createAssigner(assigner) { 18680 return baseRest(function(object, sources) { 18681 var index = -1, 18682 length = sources.length, 18683 customizer = length > 1 ? sources[length - 1] : undefined, 18684 guard = length > 2 ? sources[2] : undefined; 18685 18686 customizer = (assigner.length > 3 && typeof customizer == 'function') 18687 ? (length--, customizer) 18688 : undefined; 18689 18690 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 18691 customizer = length < 3 ? undefined : customizer; 18692 length = 1; 18693 } 18694 object = Object(object); 18695 while (++index < length) { 18696 var source = sources[index]; 18697 if (source) { 18698 assigner(object, source, index, customizer); 18699 } 18700 } 18701 return object; 18702 }); 18703 } 18704 18705 /** 18706 * Creates a `baseEach` or `baseEachRight` function. 18707 * 18708 * @private 18709 * @param {Function} eachFunc The function to iterate over a collection. 18710 * @param {boolean} [fromRight] Specify iterating from right to left. 18711 * @returns {Function} Returns the new base function. 18712 */ 18713 function createBaseEach(eachFunc, fromRight) { 18714 return function(collection, iteratee) { 18715 if (collection == null) { 18716 return collection; 18717 } 18718 if (!isArrayLike(collection)) { 18719 return eachFunc(collection, iteratee); 18720 } 18721 var length = collection.length, 18722 index = fromRight ? length : -1, 18723 iterable = Object(collection); 18724 18725 while ((fromRight ? index-- : ++index < length)) { 18726 if (iteratee(iterable[index], index, iterable) === false) { 18727 break; 18728 } 18729 } 18730 return collection; 18731 }; 18732 } 18733 18734 /** 18735 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 18736 * 18737 * @private 18738 * @param {boolean} [fromRight] Specify iterating from right to left. 18739 * @returns {Function} Returns the new base function. 18740 */ 18741 function createBaseFor(fromRight) { 18742 return function(object, iteratee, keysFunc) { 18743 var index = -1, 18744 iterable = Object(object), 18745 props = keysFunc(object), 18746 length = props.length; 18747 18748 while (length--) { 18749 var key = props[fromRight ? length : ++index]; 18750 if (iteratee(iterable[key], key, iterable) === false) { 18751 break; 18752 } 18753 } 18754 return object; 18755 }; 18756 } 18757 18758 /** 18759 * Creates a function that wraps `func` to invoke it with the optional `this` 18760 * binding of `thisArg`. 18761 * 18762 * @private 18763 * @param {Function} func The function to wrap. 18764 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 18765 * @param {*} [thisArg] The `this` binding of `func`. 18766 * @returns {Function} Returns the new wrapped function. 18767 */ 18768 function createBind(func, bitmask, thisArg) { 18769 var isBind = bitmask & WRAP_BIND_FLAG, 18770 Ctor = createCtor(func); 18771 18772 function wrapper() { 18773 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 18774 return fn.apply(isBind ? thisArg : this, arguments); 18775 } 18776 return wrapper; 18777 } 18778 18779 /** 18780 * Creates a function like `_.lowerFirst`. 18781 * 18782 * @private 18783 * @param {string} methodName The name of the `String` case method to use. 18784 * @returns {Function} Returns the new case function. 18785 */ 18786 function createCaseFirst(methodName) { 18787 return function(string) { 18788 string = toString(string); 18789 18790 var strSymbols = hasUnicode(string) 18791 ? stringToArray(string) 18792 : undefined; 18793 18794 var chr = strSymbols 18795 ? strSymbols[0] 18796 : string.charAt(0); 18797 18798 var trailing = strSymbols 18799 ? castSlice(strSymbols, 1).join('') 18800 : string.slice(1); 18801 18802 return chr[methodName]() + trailing; 18803 }; 18804 } 18805 18806 /** 18807 * Creates a function like `_.camelCase`. 18808 * 18809 * @private 18810 * @param {Function} callback The function to combine each word. 18811 * @returns {Function} Returns the new compounder function. 18812 */ 18813 function createCompounder(callback) { 18814 return function(string) { 18815 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 18816 }; 18817 } 18818 18819 /** 18820 * Creates a function that produces an instance of `Ctor` regardless of 18821 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 18822 * 18823 * @private 18824 * @param {Function} Ctor The constructor to wrap. 18825 * @returns {Function} Returns the new wrapped function. 18826 */ 18827 function createCtor(Ctor) { 18828 return function() { 18829 // Use a `switch` statement to work with class constructors. See 18830 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 18831 // for more details. 18832 var args = arguments; 18833 switch (args.length) { 18834 case 0: return new Ctor; 18835 case 1: return new Ctor(args[0]); 18836 case 2: return new Ctor(args[0], args[1]); 18837 case 3: return new Ctor(args[0], args[1], args[2]); 18838 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 18839 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 18840 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 18841 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 18842 } 18843 var thisBinding = baseCreate(Ctor.prototype), 18844 result = Ctor.apply(thisBinding, args); 18845 18846 // Mimic the constructor's `return` behavior. 18847 // See https://es5.github.io/#x13.2.2 for more details. 18848 return isObject(result) ? result : thisBinding; 18849 }; 18850 } 18851 18852 /** 18853 * Creates a function that wraps `func` to enable currying. 18854 * 18855 * @private 18856 * @param {Function} func The function to wrap. 18857 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 18858 * @param {number} arity The arity of `func`. 18859 * @returns {Function} Returns the new wrapped function. 18860 */ 18861 function createCurry(func, bitmask, arity) { 18862 var Ctor = createCtor(func); 18863 18864 function wrapper() { 18865 var length = arguments.length, 18866 args = Array(length), 18867 index = length, 18868 placeholder = getHolder(wrapper); 18869 18870 while (index--) { 18871 args[index] = arguments[index]; 18872 } 18873 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 18874 ? [] 18875 : replaceHolders(args, placeholder); 18876 18877 length -= holders.length; 18878 if (length < arity) { 18879 return createRecurry( 18880 func, bitmask, createHybrid, wrapper.placeholder, undefined, 18881 args, holders, undefined, undefined, arity - length); 18882 } 18883 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 18884 return apply(fn, this, args); 18885 } 18886 return wrapper; 18887 } 18888 18889 /** 18890 * Creates a `_.find` or `_.findLast` function. 18891 * 18892 * @private 18893 * @param {Function} findIndexFunc The function to find the collection index. 18894 * @returns {Function} Returns the new find function. 18895 */ 18896 function createFind(findIndexFunc) { 18897 return function(collection, predicate, fromIndex) { 18898 var iterable = Object(collection); 18899 if (!isArrayLike(collection)) { 18900 var iteratee = getIteratee(predicate, 3); 18901 collection = keys(collection); 18902 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 18903 } 18904 var index = findIndexFunc(collection, predicate, fromIndex); 18905 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 18906 }; 18907 } 18908 18909 /** 18910 * Creates a `_.flow` or `_.flowRight` function. 18911 * 18912 * @private 18913 * @param {boolean} [fromRight] Specify iterating from right to left. 18914 * @returns {Function} Returns the new flow function. 18915 */ 18916 function createFlow(fromRight) { 18917 return flatRest(function(funcs) { 18918 var length = funcs.length, 18919 index = length, 18920 prereq = LodashWrapper.prototype.thru; 18921 18922 if (fromRight) { 18923 funcs.reverse(); 18924 } 18925 while (index--) { 18926 var func = funcs[index]; 18927 if (typeof func != 'function') { 18928 throw new TypeError(FUNC_ERROR_TEXT); 18929 } 18930 if (prereq && !wrapper && getFuncName(func) == 'wrapper') { 18931 var wrapper = new LodashWrapper([], true); 18932 } 18933 } 18934 index = wrapper ? index : length; 18935 while (++index < length) { 18936 func = funcs[index]; 18937 18938 var funcName = getFuncName(func), 18939 data = funcName == 'wrapper' ? getData(func) : undefined; 18940 18941 if (data && isLaziable(data[0]) && 18942 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && 18943 !data[4].length && data[9] == 1 18944 ) { 18945 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 18946 } else { 18947 wrapper = (func.length == 1 && isLaziable(func)) 18948 ? wrapper[funcName]() 18949 : wrapper.thru(func); 18950 } 18951 } 18952 return function() { 18953 var args = arguments, 18954 value = args[0]; 18955 18956 if (wrapper && args.length == 1 && isArray(value)) { 18957 return wrapper.plant(value).value(); 18958 } 18959 var index = 0, 18960 result = length ? funcs[index].apply(this, args) : value; 18961 18962 while (++index < length) { 18963 result = funcs[index].call(this, result); 18964 } 18965 return result; 18966 }; 18967 }); 18968 } 18969 18970 /** 18971 * Creates a function that wraps `func` to invoke it with optional `this` 18972 * binding of `thisArg`, partial application, and currying. 18973 * 18974 * @private 18975 * @param {Function|string} func The function or method name to wrap. 18976 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 18977 * @param {*} [thisArg] The `this` binding of `func`. 18978 * @param {Array} [partials] The arguments to prepend to those provided to 18979 * the new function. 18980 * @param {Array} [holders] The `partials` placeholder indexes. 18981 * @param {Array} [partialsRight] The arguments to append to those provided 18982 * to the new function. 18983 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 18984 * @param {Array} [argPos] The argument positions of the new function. 18985 * @param {number} [ary] The arity cap of `func`. 18986 * @param {number} [arity] The arity of `func`. 18987 * @returns {Function} Returns the new wrapped function. 18988 */ 18989 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 18990 var isAry = bitmask & WRAP_ARY_FLAG, 18991 isBind = bitmask & WRAP_BIND_FLAG, 18992 isBindKey = bitmask & WRAP_BIND_KEY_FLAG, 18993 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), 18994 isFlip = bitmask & WRAP_FLIP_FLAG, 18995 Ctor = isBindKey ? undefined : createCtor(func); 18996 18997 function wrapper() { 18998 var length = arguments.length, 18999 args = Array(length), 19000 index = length; 19001 19002 while (index--) { 19003 args[index] = arguments[index]; 19004 } 19005 if (isCurried) { 19006 var placeholder = getHolder(wrapper), 19007 holdersCount = countHolders(args, placeholder); 19008 } 19009 if (partials) { 19010 args = composeArgs(args, partials, holders, isCurried); 19011 } 19012 if (partialsRight) { 19013 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 19014 } 19015 length -= holdersCount; 19016 if (isCurried && length < arity) { 19017 var newHolders = replaceHolders(args, placeholder); 19018 return createRecurry( 19019 func, bitmask, createHybrid, wrapper.placeholder, thisArg, 19020 args, newHolders, argPos, ary, arity - length 19021 ); 19022 } 19023 var thisBinding = isBind ? thisArg : this, 19024 fn = isBindKey ? thisBinding[func] : func; 19025 19026 length = args.length; 19027 if (argPos) { 19028 args = reorder(args, argPos); 19029 } else if (isFlip && length > 1) { 19030 args.reverse(); 19031 } 19032 if (isAry && ary < length) { 19033 args.length = ary; 19034 } 19035 if (this && this !== root && this instanceof wrapper) { 19036 fn = Ctor || createCtor(fn); 19037 } 19038 return fn.apply(thisBinding, args); 19039 } 19040 return wrapper; 19041 } 19042 19043 /** 19044 * Creates a function like `_.invertBy`. 19045 * 19046 * @private 19047 * @param {Function} setter The function to set accumulator values. 19048 * @param {Function} toIteratee The function to resolve iteratees. 19049 * @returns {Function} Returns the new inverter function. 19050 */ 19051 function createInverter(setter, toIteratee) { 19052 return function(object, iteratee) { 19053 return baseInverter(object, setter, toIteratee(iteratee), {}); 19054 }; 19055 } 19056 19057 /** 19058 * Creates a function that performs a mathematical operation on two values. 19059 * 19060 * @private 19061 * @param {Function} operator The function to perform the operation. 19062 * @param {number} [defaultValue] The value used for `undefined` arguments. 19063 * @returns {Function} Returns the new mathematical operation function. 19064 */ 19065 function createMathOperation(operator, defaultValue) { 19066 return function(value, other) { 19067 var result; 19068 if (value === undefined && other === undefined) { 19069 return defaultValue; 19070 } 19071 if (value !== undefined) { 19072 result = value; 19073 } 19074 if (other !== undefined) { 19075 if (result === undefined) { 19076 return other; 19077 } 19078 if (typeof value == 'string' || typeof other == 'string') { 19079 value = baseToString(value); 19080 other = baseToString(other); 19081 } else { 19082 value = baseToNumber(value); 19083 other = baseToNumber(other); 19084 } 19085 result = operator(value, other); 19086 } 19087 return result; 19088 }; 19089 } 19090 19091 /** 19092 * Creates a function like `_.over`. 19093 * 19094 * @private 19095 * @param {Function} arrayFunc The function to iterate over iteratees. 19096 * @returns {Function} Returns the new over function. 19097 */ 19098 function createOver(arrayFunc) { 19099 return flatRest(function(iteratees) { 19100 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 19101 return baseRest(function(args) { 19102 var thisArg = this; 19103 return arrayFunc(iteratees, function(iteratee) { 19104 return apply(iteratee, thisArg, args); 19105 }); 19106 }); 19107 }); 19108 } 19109 19110 /** 19111 * Creates the padding for `string` based on `length`. The `chars` string 19112 * is truncated if the number of characters exceeds `length`. 19113 * 19114 * @private 19115 * @param {number} length The padding length. 19116 * @param {string} [chars=' '] The string used as padding. 19117 * @returns {string} Returns the padding for `string`. 19118 */ 19119 function createPadding(length, chars) { 19120 chars = chars === undefined ? ' ' : baseToString(chars); 19121 19122 var charsLength = chars.length; 19123 if (charsLength < 2) { 19124 return charsLength ? baseRepeat(chars, length) : chars; 19125 } 19126 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 19127 return hasUnicode(chars) 19128 ? castSlice(stringToArray(result), 0, length).join('') 19129 : result.slice(0, length); 19130 } 19131 19132 /** 19133 * Creates a function that wraps `func` to invoke it with the `this` binding 19134 * of `thisArg` and `partials` prepended to the arguments it receives. 19135 * 19136 * @private 19137 * @param {Function} func The function to wrap. 19138 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 19139 * @param {*} thisArg The `this` binding of `func`. 19140 * @param {Array} partials The arguments to prepend to those provided to 19141 * the new function. 19142 * @returns {Function} Returns the new wrapped function. 19143 */ 19144 function createPartial(func, bitmask, thisArg, partials) { 19145 var isBind = bitmask & WRAP_BIND_FLAG, 19146 Ctor = createCtor(func); 19147 19148 function wrapper() { 19149 var argsIndex = -1, 19150 argsLength = arguments.length, 19151 leftIndex = -1, 19152 leftLength = partials.length, 19153 args = Array(leftLength + argsLength), 19154 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 19155 19156 while (++leftIndex < leftLength) { 19157 args[leftIndex] = partials[leftIndex]; 19158 } 19159 while (argsLength--) { 19160 args[leftIndex++] = arguments[++argsIndex]; 19161 } 19162 return apply(fn, isBind ? thisArg : this, args); 19163 } 19164 return wrapper; 19165 } 19166 19167 /** 19168 * Creates a `_.range` or `_.rangeRight` function. 19169 * 19170 * @private 19171 * @param {boolean} [fromRight] Specify iterating from right to left. 19172 * @returns {Function} Returns the new range function. 19173 */ 19174 function createRange(fromRight) { 19175 return function(start, end, step) { 19176 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { 19177 end = step = undefined; 19178 } 19179 // Ensure the sign of `-0` is preserved. 19180 start = toFinite(start); 19181 if (end === undefined) { 19182 end = start; 19183 start = 0; 19184 } else { 19185 end = toFinite(end); 19186 } 19187 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); 19188 return baseRange(start, end, step, fromRight); 19189 }; 19190 } 19191 19192 /** 19193 * Creates a function that performs a relational operation on two values. 19194 * 19195 * @private 19196 * @param {Function} operator The function to perform the operation. 19197 * @returns {Function} Returns the new relational operation function. 19198 */ 19199 function createRelationalOperation(operator) { 19200 return function(value, other) { 19201 if (!(typeof value == 'string' && typeof other == 'string')) { 19202 value = toNumber(value); 19203 other = toNumber(other); 19204 } 19205 return operator(value, other); 19206 }; 19207 } 19208 19209 /** 19210 * Creates a function that wraps `func` to continue currying. 19211 * 19212 * @private 19213 * @param {Function} func The function to wrap. 19214 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 19215 * @param {Function} wrapFunc The function to create the `func` wrapper. 19216 * @param {*} placeholder The placeholder value. 19217 * @param {*} [thisArg] The `this` binding of `func`. 19218 * @param {Array} [partials] The arguments to prepend to those provided to 19219 * the new function. 19220 * @param {Array} [holders] The `partials` placeholder indexes. 19221 * @param {Array} [argPos] The argument positions of the new function. 19222 * @param {number} [ary] The arity cap of `func`. 19223 * @param {number} [arity] The arity of `func`. 19224 * @returns {Function} Returns the new wrapped function. 19225 */ 19226 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 19227 var isCurry = bitmask & WRAP_CURRY_FLAG, 19228 newHolders = isCurry ? holders : undefined, 19229 newHoldersRight = isCurry ? undefined : holders, 19230 newPartials = isCurry ? partials : undefined, 19231 newPartialsRight = isCurry ? undefined : partials; 19232 19233 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); 19234 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 19235 19236 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 19237 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); 19238 } 19239 var newData = [ 19240 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, 19241 newHoldersRight, argPos, ary, arity 19242 ]; 19243 19244 var result = wrapFunc.apply(undefined, newData); 19245 if (isLaziable(func)) { 19246 setData(result, newData); 19247 } 19248 result.placeholder = placeholder; 19249 return setWrapToString(result, func, bitmask); 19250 } 19251 19252 /** 19253 * Creates a function like `_.round`. 19254 * 19255 * @private 19256 * @param {string} methodName The name of the `Math` method to use when rounding. 19257 * @returns {Function} Returns the new round function. 19258 */ 19259 function createRound(methodName) { 19260 var func = Math[methodName]; 19261 return function(number, precision) { 19262 number = toNumber(number); 19263 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 19264 if (precision && nativeIsFinite(number)) { 19265 // Shift with exponential notation to avoid floating-point issues. 19266 // See [MDN](https://mdn.io/round#Examples) for more details. 19267 var pair = (toString(number) + 'e').split('e'), 19268 value = func(pair[0] + 'e' + (+pair[1] + precision)); 19269 19270 pair = (toString(value) + 'e').split('e'); 19271 return +(pair[0] + 'e' + (+pair[1] - precision)); 19272 } 19273 return func(number); 19274 }; 19275 } 19276 19277 /** 19278 * Creates a set object of `values`. 19279 * 19280 * @private 19281 * @param {Array} values The values to add to the set. 19282 * @returns {Object} Returns the new set. 19283 */ 19284 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 19285 return new Set(values); 19286 }; 19287 19288 /** 19289 * Creates a `_.toPairs` or `_.toPairsIn` function. 19290 * 19291 * @private 19292 * @param {Function} keysFunc The function to get the keys of a given object. 19293 * @returns {Function} Returns the new pairs function. 19294 */ 19295 function createToPairs(keysFunc) { 19296 return function(object) { 19297 var tag = getTag(object); 19298 if (tag == mapTag) { 19299 return mapToArray(object); 19300 } 19301 if (tag == setTag) { 19302 return setToPairs(object); 19303 } 19304 return baseToPairs(object, keysFunc(object)); 19305 }; 19306 } 19307 19308 /** 19309 * Creates a function that either curries or invokes `func` with optional 19310 * `this` binding and partially applied arguments. 19311 * 19312 * @private 19313 * @param {Function|string} func The function or method name to wrap. 19314 * @param {number} bitmask The bitmask flags. 19315 * 1 - `_.bind` 19316 * 2 - `_.bindKey` 19317 * 4 - `_.curry` or `_.curryRight` of a bound function 19318 * 8 - `_.curry` 19319 * 16 - `_.curryRight` 19320 * 32 - `_.partial` 19321 * 64 - `_.partialRight` 19322 * 128 - `_.rearg` 19323 * 256 - `_.ary` 19324 * 512 - `_.flip` 19325 * @param {*} [thisArg] The `this` binding of `func`. 19326 * @param {Array} [partials] The arguments to be partially applied. 19327 * @param {Array} [holders] The `partials` placeholder indexes. 19328 * @param {Array} [argPos] The argument positions of the new function. 19329 * @param {number} [ary] The arity cap of `func`. 19330 * @param {number} [arity] The arity of `func`. 19331 * @returns {Function} Returns the new wrapped function. 19332 */ 19333 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 19334 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 19335 if (!isBindKey && typeof func != 'function') { 19336 throw new TypeError(FUNC_ERROR_TEXT); 19337 } 19338 var length = partials ? partials.length : 0; 19339 if (!length) { 19340 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); 19341 partials = holders = undefined; 19342 } 19343 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 19344 arity = arity === undefined ? arity : toInteger(arity); 19345 length -= holders ? holders.length : 0; 19346 19347 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 19348 var partialsRight = partials, 19349 holdersRight = holders; 19350 19351 partials = holders = undefined; 19352 } 19353 var data = isBindKey ? undefined : getData(func); 19354 19355 var newData = [ 19356 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, 19357 argPos, ary, arity 19358 ]; 19359 19360 if (data) { 19361 mergeData(newData, data); 19362 } 19363 func = newData[0]; 19364 bitmask = newData[1]; 19365 thisArg = newData[2]; 19366 partials = newData[3]; 19367 holders = newData[4]; 19368 arity = newData[9] = newData[9] === undefined 19369 ? (isBindKey ? 0 : func.length) 19370 : nativeMax(newData[9] - length, 0); 19371 19372 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 19373 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); 19374 } 19375 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 19376 var result = createBind(func, bitmask, thisArg); 19377 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 19378 result = createCurry(func, bitmask, arity); 19379 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 19380 result = createPartial(func, bitmask, thisArg, partials); 19381 } else { 19382 result = createHybrid.apply(undefined, newData); 19383 } 19384 var setter = data ? baseSetData : setData; 19385 return setWrapToString(setter(result, newData), func, bitmask); 19386 } 19387 19388 /** 19389 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 19390 * of source objects to the destination object for all destination properties 19391 * that resolve to `undefined`. 19392 * 19393 * @private 19394 * @param {*} objValue The destination value. 19395 * @param {*} srcValue The source value. 19396 * @param {string} key The key of the property to assign. 19397 * @param {Object} object The parent object of `objValue`. 19398 * @returns {*} Returns the value to assign. 19399 */ 19400 function customDefaultsAssignIn(objValue, srcValue, key, object) { 19401 if (objValue === undefined || 19402 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { 19403 return srcValue; 19404 } 19405 return objValue; 19406 } 19407 19408 /** 19409 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 19410 * objects into destination objects that are passed thru. 19411 * 19412 * @private 19413 * @param {*} objValue The destination value. 19414 * @param {*} srcValue The source value. 19415 * @param {string} key The key of the property to merge. 19416 * @param {Object} object The parent object of `objValue`. 19417 * @param {Object} source The parent object of `srcValue`. 19418 * @param {Object} [stack] Tracks traversed source values and their merged 19419 * counterparts. 19420 * @returns {*} Returns the value to assign. 19421 */ 19422 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { 19423 if (isObject(objValue) && isObject(srcValue)) { 19424 // Recursively merge objects and arrays (susceptible to call stack limits). 19425 stack.set(srcValue, objValue); 19426 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); 19427 stack['delete'](srcValue); 19428 } 19429 return objValue; 19430 } 19431 19432 /** 19433 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 19434 * objects. 19435 * 19436 * @private 19437 * @param {*} value The value to inspect. 19438 * @param {string} key The key of the property to inspect. 19439 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 19440 */ 19441 function customOmitClone(value) { 19442 return isPlainObject(value) ? undefined : value; 19443 } 19444 19445 /** 19446 * A specialized version of `baseIsEqualDeep` for arrays with support for 19447 * partial deep comparisons. 19448 * 19449 * @private 19450 * @param {Array} array The array to compare. 19451 * @param {Array} other The other array to compare. 19452 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 19453 * @param {Function} customizer The function to customize comparisons. 19454 * @param {Function} equalFunc The function to determine equivalents of values. 19455 * @param {Object} stack Tracks traversed `array` and `other` objects. 19456 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 19457 */ 19458 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 19459 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 19460 arrLength = array.length, 19461 othLength = other.length; 19462 19463 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 19464 return false; 19465 } 19466 // Check that cyclic values are equal. 19467 var arrStacked = stack.get(array); 19468 var othStacked = stack.get(other); 19469 if (arrStacked && othStacked) { 19470 return arrStacked == other && othStacked == array; 19471 } 19472 var index = -1, 19473 result = true, 19474 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; 19475 19476 stack.set(array, other); 19477 stack.set(other, array); 19478 19479 // Ignore non-index properties. 19480 while (++index < arrLength) { 19481 var arrValue = array[index], 19482 othValue = other[index]; 19483 19484 if (customizer) { 19485 var compared = isPartial 19486 ? customizer(othValue, arrValue, index, other, array, stack) 19487 : customizer(arrValue, othValue, index, array, other, stack); 19488 } 19489 if (compared !== undefined) { 19490 if (compared) { 19491 continue; 19492 } 19493 result = false; 19494 break; 19495 } 19496 // Recursively compare arrays (susceptible to call stack limits). 19497 if (seen) { 19498 if (!arraySome(other, function(othValue, othIndex) { 19499 if (!cacheHas(seen, othIndex) && 19500 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 19501 return seen.push(othIndex); 19502 } 19503 })) { 19504 result = false;
vendor: 4,179 bytes, lines 19505-19616
19505 break; 19506 } 19507 } else if (!( 19508 arrValue === othValue || 19509 equalFunc(arrValue, othValue, bitmask, customizer, stack) 19510 )) { 19511 result = false; 19512 break; 19513 } 19514 } 19515 stack['delete'](array); 19516 stack['delete'](other); 19517 return result; 19518 } 19519 19520 /** 19521 * A specialized version of `baseIsEqualDeep` for comparing objects of 19522 * the same `toStringTag`. 19523 * 19524 * **Note:** This function only supports comparing values with tags of 19525 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 19526 * 19527 * @private 19528 * @param {Object} object The object to compare. 19529 * @param {Object} other The other object to compare. 19530 * @param {string} tag The `toStringTag` of the objects to compare. 19531 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 19532 * @param {Function} customizer The function to customize comparisons. 19533 * @param {Function} equalFunc The function to determine equivalents of values. 19534 * @param {Object} stack Tracks traversed `object` and `other` objects. 19535 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 19536 */ 19537 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 19538 switch (tag) { 19539 case dataViewTag: 19540 if ((object.byteLength != other.byteLength) || 19541 (object.byteOffset != other.byteOffset)) { 19542 return false; 19543 } 19544 object = object.buffer; 19545 other = other.buffer; 19546 19547 case arrayBufferTag: 19548 if ((object.byteLength != other.byteLength) || 19549 !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 19550 return false; 19551 } 19552 return true; 19553 19554 case boolTag: 19555 case dateTag: 19556 case numberTag: 19557 // Coerce booleans to `1` or `0` and dates to milliseconds. 19558 // Invalid dates are coerced to `NaN`. 19559 return eq(+object, +other); 19560 19561 case errorTag: 19562 return object.name == other.name && object.message == other.message; 19563 19564 case regexpTag: 19565 case stringTag: 19566 // Coerce regexes to strings and treat strings, primitives and objects, 19567 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 19568 // for more details. 19569 return object == (other + ''); 19570 19571 case mapTag: 19572 var convert = mapToArray; 19573 19574 case setTag: 19575 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 19576 convert || (convert = setToArray); 19577 19578 if (object.size != other.size && !isPartial) { 19579 return false; 19580 } 19581 // Assume cyclic values are equal. 19582 var stacked = stack.get(object); 19583 if (stacked) { 19584 return stacked == other; 19585 } 19586 bitmask |= COMPARE_UNORDERED_FLAG; 19587 19588 // Recursively compare objects (susceptible to call stack limits). 19589 stack.set(object, other); 19590 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 19591 stack['delete'](object); 19592 return result; 19593 19594 case symbolTag: 19595 if (symbolValueOf) { 19596 return symbolValueOf.call(object) == symbolValueOf.call(other); 19597 } 19598 } 19599 return false; 19600 } 19601 19602 /** 19603 * A specialized version of `baseIsEqualDeep` for objects with support for 19604 * partial deep comparisons. 19605 * 19606 * @private 19607 * @param {Object} object The object to compare. 19608 * @param {Object} other The other object to compare. 19609 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 19610 * @param {Function} customizer The function to customize comparisons. 19611 * @param {Function} equalFunc The function to determine equivalents of values. 19612 * @param {Object} stack Tracks traversed `object` and `other` objects. 19613 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 19614 */ 19615 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 19616 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
vendor: 9,614 bytes, lines 19617-19924
19617 objProps = getAllKeys(object), 19618 objLength = objProps.length, 19619 othProps = getAllKeys(other), 19620 othLength = othProps.length; 19621 19622 if (objLength != othLength && !isPartial) { 19623 return false; 19624 } 19625 var index = objLength; 19626 while (index--) { 19627 var key = objProps[index]; 19628 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 19629 return false; 19630 } 19631 } 19632 // Check that cyclic values are equal. 19633 var objStacked = stack.get(object); 19634 var othStacked = stack.get(other); 19635 if (objStacked && othStacked) { 19636 return objStacked == other && othStacked == object; 19637 } 19638 var result = true; 19639 stack.set(object, other); 19640 stack.set(other, object); 19641 19642 var skipCtor = isPartial; 19643 while (++index < objLength) { 19644 key = objProps[index]; 19645 var objValue = object[key], 19646 othValue = other[key]; 19647 19648 if (customizer) { 19649 var compared = isPartial 19650 ? customizer(othValue, objValue, key, other, object, stack) 19651 : customizer(objValue, othValue, key, object, other, stack); 19652 } 19653 // Recursively compare objects (susceptible to call stack limits). 19654 if (!(compared === undefined 19655 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 19656 : compared 19657 )) { 19658 result = false; 19659 break; 19660 } 19661 skipCtor || (skipCtor = key == 'constructor'); 19662 } 19663 if (result && !skipCtor) { 19664 var objCtor = object.constructor, 19665 othCtor = other.constructor; 19666 19667 // Non `Object` object instances with different constructors are not equal. 19668 if (objCtor != othCtor && 19669 ('constructor' in object && 'constructor' in other) && 19670 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 19671 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 19672 result = false; 19673 } 19674 } 19675 stack['delete'](object); 19676 stack['delete'](other); 19677 return result; 19678 } 19679 19680 /** 19681 * A specialized version of `baseRest` which flattens the rest array. 19682 * 19683 * @private 19684 * @param {Function} func The function to apply a rest parameter to. 19685 * @returns {Function} Returns the new function. 19686 */ 19687 function flatRest(func) { 19688 return setToString(overRest(func, undefined, flatten), func + ''); 19689 } 19690 19691 /** 19692 * Creates an array of own enumerable property names and symbols of `object`. 19693 * 19694 * @private 19695 * @param {Object} object The object to query. 19696 * @returns {Array} Returns the array of property names and symbols. 19697 */ 19698 function getAllKeys(object) { 19699 return baseGetAllKeys(object, keys, getSymbols); 19700 } 19701 19702 /** 19703 * Creates an array of own and inherited enumerable property names and 19704 * symbols of `object`. 19705 * 19706 * @private 19707 * @param {Object} object The object to query. 19708 * @returns {Array} Returns the array of property names and symbols. 19709 */ 19710 function getAllKeysIn(object) { 19711 return baseGetAllKeys(object, keysIn, getSymbolsIn); 19712 } 19713 19714 /** 19715 * Gets metadata for `func`. 19716 * 19717 * @private 19718 * @param {Function} func The function to query. 19719 * @returns {*} Returns the metadata for `func`. 19720 */ 19721 var getData = !metaMap ? noop : function(func) { 19722 return metaMap.get(func); 19723 }; 19724 19725 /** 19726 * Gets the name of `func`. 19727 * 19728 * @private 19729 * @param {Function} func The function to query. 19730 * @returns {string} Returns the function name. 19731 */ 19732 function getFuncName(func) { 19733 var result = (func.name + ''), 19734 array = realNames[result], 19735 length = hasOwnProperty.call(realNames, result) ? array.length : 0; 19736 19737 while (length--) { 19738 var data = array[length], 19739 otherFunc = data.func; 19740 if (otherFunc == null || otherFunc == func) { 19741 return data.name; 19742 } 19743 } 19744 return result; 19745 } 19746 19747 /** 19748 * Gets the argument placeholder value for `func`. 19749 * 19750 * @private 19751 * @param {Function} func The function to inspect. 19752 * @returns {*} Returns the placeholder value. 19753 */ 19754 function getHolder(func) { 19755 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; 19756 return object.placeholder; 19757 } 19758 19759 /** 19760 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 19761 * this function returns the custom method, otherwise it returns `baseIteratee`. 19762 * If arguments are provided, the chosen function is invoked with them and 19763 * its result is returned. 19764 * 19765 * @private 19766 * @param {*} [value] The value to convert to an iteratee. 19767 * @param {number} [arity] The arity of the created iteratee. 19768 * @returns {Function} Returns the chosen function or its result. 19769 */ 19770 function getIteratee() { 19771 var result = lodash.iteratee || iteratee; 19772 result = result === iteratee ? baseIteratee : result; 19773 return arguments.length ? result(arguments[0], arguments[1]) : result; 19774 } 19775 19776 /** 19777 * Gets the data for `map`. 19778 * 19779 * @private 19780 * @param {Object} map The map to query. 19781 * @param {string} key The reference key. 19782 * @returns {*} Returns the map data. 19783 */ 19784 function getMapData(map, key) { 19785 var data = map.__data__; 19786 return isKeyable(key) 19787 ? data[typeof key == 'string' ? 'string' : 'hash'] 19788 : data.map; 19789 } 19790 19791 /** 19792 * Gets the property names, values, and compare flags of `object`. 19793 * 19794 * @private 19795 * @param {Object} object The object to query. 19796 * @returns {Array} Returns the match data of `object`. 19797 */ 19798 function getMatchData(object) { 19799 var result = keys(object), 19800 length = result.length; 19801 19802 while (length--) { 19803 var key = result[length], 19804 value = object[key]; 19805 19806 result[length] = [key, value, isStrictComparable(value)]; 19807 } 19808 return result; 19809 } 19810 19811 /** 19812 * Gets the native function at `key` of `object`. 19813 * 19814 * @private 19815 * @param {Object} object The object to query. 19816 * @param {string} key The key of the method to get. 19817 * @returns {*} Returns the function if it's native, else `undefined`. 19818 */ 19819 function getNative(object, key) { 19820 var value = getValue(object, key); 19821 return baseIsNative(value) ? value : undefined; 19822 } 19823 19824 /** 19825 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 19826 * 19827 * @private 19828 * @param {*} value The value to query. 19829 * @returns {string} Returns the raw `toStringTag`. 19830 */ 19831 function getRawTag(value) { 19832 var isOwn = hasOwnProperty.call(value, symToStringTag), 19833 tag = value[symToStringTag]; 19834 19835 try { 19836 value[symToStringTag] = undefined; 19837 var unmasked = true; 19838 } catch (e) {} 19839 19840 var result = nativeObjectToString.call(value); 19841 if (unmasked) { 19842 if (isOwn) { 19843 value[symToStringTag] = tag; 19844 } else { 19845 delete value[symToStringTag]; 19846 } 19847 } 19848 return result; 19849 } 19850 19851 /** 19852 * Creates an array of the own enumerable symbols of `object`. 19853 * 19854 * @private 19855 * @param {Object} object The object to query. 19856 * @returns {Array} Returns the array of symbols. 19857 */ 19858 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 19859 if (object == null) { 19860 return []; 19861 } 19862 object = Object(object); 19863 return arrayFilter(nativeGetSymbols(object), function(symbol) { 19864 return propertyIsEnumerable.call(object, symbol); 19865 }); 19866 }; 19867 19868 /** 19869 * Creates an array of the own and inherited enumerable symbols of `object`. 19870 * 19871 * @private 19872 * @param {Object} object The object to query. 19873 * @returns {Array} Returns the array of symbols. 19874 */ 19875 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 19876 var result = []; 19877 while (object) { 19878 arrayPush(result, getSymbols(object)); 19879 object = getPrototype(object); 19880 } 19881 return result; 19882 }; 19883 19884 /** 19885 * Gets the `toStringTag` of `value`. 19886 * 19887 * @private 19888 * @param {*} value The value to query. 19889 * @returns {string} Returns the `toStringTag`. 19890 */ 19891 var getTag = baseGetTag; 19892 19893 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 19894 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 19895 (Map && getTag(new Map) != mapTag) || 19896 (Promise && getTag(Promise.resolve()) != promiseTag) || 19897 (Set && getTag(new Set) != setTag) || 19898 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 19899 getTag = function(value) { 19900 var result = baseGetTag(value), 19901 Ctor = result == objectTag ? value.constructor : undefined, 19902 ctorString = Ctor ? toSource(Ctor) : ''; 19903 19904 if (ctorString) { 19905 switch (ctorString) { 19906 case dataViewCtorString: return dataViewTag; 19907 case mapCtorString: return mapTag; 19908 case promiseCtorString: return promiseTag; 19909 case setCtorString: return setTag; 19910 case weakMapCtorString: return weakMapTag; 19911 } 19912 } 19913 return result; 19914 }; 19915 } 19916 19917 /** 19918 * Gets the view, applying any `transforms` to the `start` and `end` positions. 19919 * 19920 * @private 19921 * @param {number} start The start of the view. 19922 * @param {number} end The end of the view. 19923 * @param {Array} transforms The transformations to apply to the view. 19924 * @returns {Object}
vendor: 6,432 bytes, lines 19924-20129
19924 Returns an object containing the `start` and `end` 19925 * positions of the view. 19926 */ 19927 function getView(start, end, transforms) { 19928 var index = -1, 19929 length = transforms.length; 19930 19931 while (++index < length) { 19932 var data = transforms[index], 19933 size = data.size; 19934 19935 switch (data.type) { 19936 case 'drop': start += size; break; 19937 case 'dropRight': end -= size; break; 19938 case 'take': end = nativeMin(end, start + size); break; 19939 case 'takeRight': start = nativeMax(start, end - size); break; 19940 } 19941 } 19942 return { 'start': start, 'end': end }; 19943 } 19944 19945 /** 19946 * Extracts wrapper details from the `source` body comment. 19947 * 19948 * @private 19949 * @param {string} source The source to inspect. 19950 * @returns {Array} Returns the wrapper details. 19951 */ 19952 function getWrapDetails(source) { 19953 var match = source.match(reWrapDetails); 19954 return match ? match[1].split(reSplitDetails) : []; 19955 } 19956 19957 /** 19958 * Checks if `path` exists on `object`. 19959 * 19960 * @private 19961 * @param {Object} object The object to query. 19962 * @param {Array|string} path The path to check. 19963 * @param {Function} hasFunc The function to check properties. 19964 * @returns {boolean} Returns `true` if `path` exists, else `false`. 19965 */ 19966 function hasPath(object, path, hasFunc) { 19967 path = castPath(path, object); 19968 19969 var index = -1, 19970 length = path.length, 19971 result = false; 19972 19973 while (++index < length) { 19974 var key = toKey(path[index]); 19975 if (!(result = object != null && hasFunc(object, key))) { 19976 break; 19977 } 19978 object = object[key]; 19979 } 19980 if (result || ++index != length) { 19981 return result; 19982 } 19983 length = object == null ? 0 : object.length; 19984 return !!length && isLength(length) && isIndex(key, length) && 19985 (isArray(object) || isArguments(object)); 19986 } 19987 19988 /** 19989 * Initializes an array clone. 19990 * 19991 * @private 19992 * @param {Array} array The array to clone. 19993 * @returns {Array} Returns the initialized clone. 19994 */ 19995 function initCloneArray(array) { 19996 var length = array.length, 19997 result = new array.constructor(length); 19998 19999 // Add properties assigned by `RegExp#exec`. 20000 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 20001 result.index = array.index; 20002 result.input = array.input; 20003 } 20004 return result; 20005 } 20006 20007 /** 20008 * Initializes an object clone. 20009 * 20010 * @private 20011 * @param {Object} object The object to clone. 20012 * @returns {Object} Returns the initialized clone. 20013 */ 20014 function initCloneObject(object) { 20015 return (typeof object.constructor == 'function' && !isPrototype(object)) 20016 ? baseCreate(getPrototype(object)) 20017 : {}; 20018 } 20019 20020 /** 20021 * Initializes an object clone based on its `toStringTag`. 20022 * 20023 * **Note:** This function only supports cloning values with tags of 20024 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 20025 * 20026 * @private 20027 * @param {Object} object The object to clone. 20028 * @param {string} tag The `toStringTag` of the object to clone. 20029 * @param {boolean} [isDeep] Specify a deep clone. 20030 * @returns {Object} Returns the initialized clone. 20031 */ 20032 function initCloneByTag(object, tag, isDeep) { 20033 var Ctor = object.constructor; 20034 switch (tag) { 20035 case arrayBufferTag: 20036 return cloneArrayBuffer(object); 20037 20038 case boolTag: 20039 case dateTag: 20040 return new Ctor(+object); 20041 20042 case dataViewTag: 20043 return cloneDataView(object, isDeep); 20044 20045 case float32Tag: case float64Tag: 20046 case int8Tag: case int16Tag: case int32Tag: 20047 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 20048 return cloneTypedArray(object, isDeep); 20049 20050 case mapTag: 20051 return new Ctor; 20052 20053 case numberTag: 20054 case stringTag: 20055 return new Ctor(object); 20056 20057 case regexpTag: 20058 return cloneRegExp(object); 20059 20060 case setTag: 20061 return new Ctor; 20062 20063 case symbolTag: 20064 return cloneSymbol(object); 20065 } 20066 } 20067 20068 /** 20069 * Inserts wrapper `details` in a comment at the top of the `source` body. 20070 * 20071 * @private 20072 * @param {string} source The source to modify. 20073 * @returns {Array} details The details to insert. 20074 * @returns {string} Returns the modified source. 20075 */ 20076 function insertWrapDetails(source, details) { 20077 var length = details.length; 20078 if (!length) { 20079 return source; 20080 } 20081 var lastIndex = length - 1; 20082 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; 20083 details = details.join(length > 2 ? ', ' : ' '); 20084 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); 20085 } 20086 20087 /** 20088 * Checks if `value` is a flattenable `arguments` object or array. 20089 * 20090 * @private 20091 * @param {*} value The value to check. 20092 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 20093 */ 20094 function isFlattenable(value) { 20095 return isArray(value) || isArguments(value) || 20096 !!(spreadableSymbol && value && value[spreadableSymbol]); 20097 } 20098 20099 /** 20100 * Checks if `value` is a valid array-like index. 20101 * 20102 * @private 20103 * @param {*} value The value to check. 20104 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 20105 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 20106 */ 20107 function isIndex(value, length) { 20108 var type = typeof value; 20109 length = length == null ? MAX_SAFE_INTEGER : length; 20110 20111 return !!length && 20112 (type == 'number' || 20113 (type != 'symbol' && reIsUint.test(value))) && 20114 (value > -1 && value % 1 == 0 && value < length); 20115 } 20116 20117 /** 20118 * Checks if the given arguments are from an iteratee call. 20119 * 20120 * @private 20121 * @param {*} value The potential iteratee value argument. 20122 * @param {*} index The potential iteratee index or key argument. 20123 * @param {*} object The potential iteratee object argument. 20124 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 20125 * else `false`. 20126 */ 20127 function isIterateeCall(value, index, object) { 20128 if (!isObject(object)) { 20129 return false;
vendor: 14,387 bytes, lines 20130-20576
20130 } 20131 var type = typeof index; 20132 if (type == 'number' 20133 ? (isArrayLike(object) && isIndex(index, object.length)) 20134 : (type == 'string' && index in object) 20135 ) { 20136 return eq(object[index], value); 20137 } 20138 return false; 20139 } 20140 20141 /** 20142 * Checks if `value` is a property name and not a property path. 20143 * 20144 * @private 20145 * @param {*} value The value to check. 20146 * @param {Object} [object] The object to query keys on. 20147 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 20148 */ 20149 function isKey(value, object) { 20150 if (isArray(value)) { 20151 return false; 20152 } 20153 var type = typeof value; 20154 if (type == 'number' || type == 'symbol' || type == 'boolean' || 20155 value == null || isSymbol(value)) { 20156 return true; 20157 } 20158 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 20159 (object != null && value in Object(object)); 20160 } 20161 20162 /** 20163 * Checks if `value` is suitable for use as unique object key. 20164 * 20165 * @private 20166 * @param {*} value The value to check. 20167 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 20168 */ 20169 function isKeyable(value) { 20170 var type = typeof value; 20171 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 20172 ? (value !== '__proto__') 20173 : (value === null); 20174 } 20175 20176 /** 20177 * Checks if `func` has a lazy counterpart. 20178 * 20179 * @private 20180 * @param {Function} func The function to check. 20181 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 20182 * else `false`. 20183 */ 20184 function isLaziable(func) { 20185 var funcName = getFuncName(func), 20186 other = lodash[funcName]; 20187 20188 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { 20189 return false; 20190 } 20191 if (func === other) { 20192 return true; 20193 } 20194 var data = getData(other); 20195 return !!data && func === data[0]; 20196 } 20197 20198 /** 20199 * Checks if `func` has its source masked. 20200 * 20201 * @private 20202 * @param {Function} func The function to check. 20203 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 20204 */ 20205 function isMasked(func) { 20206 return !!maskSrcKey && (maskSrcKey in func); 20207 } 20208 20209 /** 20210 * Checks if `func` is capable of being masked. 20211 * 20212 * @private 20213 * @param {*} value The value to check. 20214 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 20215 */ 20216 var isMaskable = coreJsData ? isFunction : stubFalse; 20217 20218 /** 20219 * Checks if `value` is likely a prototype object. 20220 * 20221 * @private 20222 * @param {*} value The value to check. 20223 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 20224 */ 20225 function isPrototype(value) { 20226 var Ctor = value && value.constructor, 20227 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 20228 20229 return value === proto; 20230 } 20231 20232 /** 20233 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 20234 * 20235 * @private 20236 * @param {*} value The value to check. 20237 * @returns {boolean} Returns `true` if `value` if suitable for strict 20238 * equality comparisons, else `false`. 20239 */ 20240 function isStrictComparable(value) { 20241 return value === value && !isObject(value); 20242 } 20243 20244 /** 20245 * A specialized version of `matchesProperty` for source values suitable 20246 * for strict equality comparisons, i.e. `===`. 20247 * 20248 * @private 20249 * @param {string} key The key of the property to get. 20250 * @param {*} srcValue The value to match. 20251 * @returns {Function} Returns the new spec function. 20252 */ 20253 function matchesStrictComparable(key, srcValue) { 20254 return function(object) { 20255 if (object == null) { 20256 return false; 20257 } 20258 return object[key] === srcValue && 20259 (srcValue !== undefined || (key in Object(object))); 20260 }; 20261 } 20262 20263 /** 20264 * A specialized version of `_.memoize` which clears the memoized function's 20265 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 20266 * 20267 * @private 20268 * @param {Function} func The function to have its output memoized. 20269 * @returns {Function} Returns the new memoized function. 20270 */ 20271 function memoizeCapped(func) { 20272 var result = memoize(func, function(key) { 20273 if (cache.size === MAX_MEMOIZE_SIZE) { 20274 cache.clear(); 20275 } 20276 return key; 20277 }); 20278 20279 var cache = result.cache; 20280 return result; 20281 } 20282 20283 /** 20284 * Merges the function metadata of `source` into `data`. 20285 * 20286 * Merging metadata reduces the number of wrappers used to invoke a function. 20287 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 20288 * may be applied regardless of execution order. Methods like `_.ary` and 20289 * `_.rearg` modify function arguments, making the order in which they are 20290 * executed important, preventing the merging of metadata. However, we make 20291 * an exception for a safe combined case where curried functions have `_.ary` 20292 * and or `_.rearg` applied. 20293 * 20294 * @private 20295 * @param {Array} data The destination metadata. 20296 * @param {Array} source The source metadata. 20297 * @returns {Array} Returns `data`. 20298 */ 20299 function mergeData(data, source) { 20300 var bitmask = data[1], 20301 srcBitmask = source[1], 20302 newBitmask = bitmask | srcBitmask, 20303 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 20304 20305 var isCombo = 20306 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || 20307 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || 20308 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); 20309 20310 // Exit early if metadata can't be merged. 20311 if (!(isCommon || isCombo)) { 20312 return data; 20313 } 20314 // Use source `thisArg` if available. 20315 if (srcBitmask & WRAP_BIND_FLAG) { 20316 data[2] = source[2]; 20317 // Set when currying a bound function. 20318 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 20319 } 20320 // Compose partial arguments. 20321 var value = source[3]; 20322 if (value) { 20323 var partials = data[3]; 20324 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 20325 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 20326 } 20327 // Compose partial right arguments. 20328 value = source[5]; 20329 if (value) { 20330 partials = data[5]; 20331 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 20332 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 20333 } 20334 // Use source `argPos` if available. 20335 value = source[7]; 20336 if (value) { 20337 data[7] = value; 20338 } 20339 // Use source `ary` if it's smaller. 20340 if (srcBitmask & WRAP_ARY_FLAG) { 20341 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 20342 } 20343 // Use source `arity` if one is not provided. 20344 if (data[9] == null) { 20345 data[9] = source[9]; 20346 } 20347 // Use source `func` and merge bitmasks. 20348 data[0] = source[0]; 20349 data[1] = newBitmask; 20350 20351 return data; 20352 } 20353 20354 /** 20355 * This function is like 20356 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 20357 * except that it includes inherited enumerable properties. 20358 * 20359 * @private 20360 * @param {Object} object The object to query. 20361 * @returns {Array} Returns the array of property names. 20362 */ 20363 function nativeKeysIn(object) { 20364 var result = []; 20365 if (object != null) { 20366 for (var key in Object(object)) { 20367 result.push(key); 20368 } 20369 } 20370 return result; 20371 } 20372 20373 /** 20374 * Converts `value` to a string using `Object.prototype.toString`. 20375 * 20376 * @private 20377 * @param {*} value The value to convert. 20378 * @returns {string} Returns the converted string. 20379 */ 20380 function objectToString(value) { 20381 return nativeObjectToString.call(value); 20382 } 20383 20384 /** 20385 * A specialized version of `baseRest` which transforms the rest array. 20386 * 20387 * @private 20388 * @param {Function} func The function to apply a rest parameter to. 20389 * @param {number} [start=func.length-1] The start position of the rest parameter. 20390 * @param {Function} transform The rest array transform. 20391 * @returns {Function} Returns the new function. 20392 */ 20393 function overRest(func, start, transform) { 20394 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 20395 return function() { 20396 var args = arguments, 20397 index = -1, 20398 length = nativeMax(args.length - start, 0), 20399 array = Array(length); 20400 20401 while (++index < length) { 20402 array[index] = args[start + index]; 20403 } 20404 index = -1; 20405 var otherArgs = Array(start + 1); 20406 while (++index < start) { 20407 otherArgs[index] = args[index]; 20408 } 20409 otherArgs[start] = transform(array); 20410 return apply(func, this, otherArgs); 20411 }; 20412 } 20413 20414 /** 20415 * Gets the parent value at `path` of `object`. 20416 * 20417 * @private 20418 * @param {Object} object The object to query. 20419 * @param {Array} path The path to get the parent value of. 20420 * @returns {*} Returns the parent value. 20421 */ 20422 function parent(object, path) { 20423 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 20424 } 20425 20426 /** 20427 * Reorder `array` according to the specified indexes where the element at 20428 * the first index is assigned as the first element, the element at 20429 * the second index is assigned as the second element, and so on. 20430 * 20431 * @private 20432 * @param {Array} array The array to reorder. 20433 * @param {Array} indexes The arranged array indexes. 20434 * @returns {Array} Returns `array`. 20435 */ 20436 function reorder(array, indexes) { 20437 var arrLength = array.length, 20438 length = nativeMin(indexes.length, arrLength), 20439 oldArray = copyArray(array); 20440 20441 while (length--) { 20442 var index = indexes[length]; 20443 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 20444 } 20445 return array; 20446 } 20447 20448 /** 20449 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 20450 * 20451 * @private 20452 * @param {Object} object The object to query. 20453 * @param {string} key The key of the property to get. 20454 * @returns {*} Returns the property value. 20455 */ 20456 function safeGet(object, key) { 20457 if (key === 'constructor' && typeof object[key] === 'function') { 20458 return; 20459 } 20460 20461 if (key == '__proto__') { 20462 return; 20463 } 20464 20465 return object[key]; 20466 } 20467 20468 /** 20469 * Sets metadata for `func`. 20470 * 20471 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 20472 * period of time, it will trip its breaker and transition to an identity 20473 * function to avoid garbage collection pauses in V8. See 20474 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 20475 * for more details. 20476 * 20477 * @private 20478 * @param {Function} func The function to associate metadata with. 20479 * @param {*} data The metadata. 20480 * @returns {Function} Returns `func`. 20481 */ 20482 var setData = shortOut(baseSetData); 20483 20484 /** 20485 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 20486 * 20487 * @private 20488 * @param {Function} func The function to delay. 20489 * @param {number} wait The number of milliseconds to delay invocation. 20490 * @returns {number|Object} Returns the timer id or timeout object. 20491 */ 20492 var setTimeout = ctxSetTimeout || function(func, wait) { 20493 return root.setTimeout(func, wait); 20494 }; 20495 20496 /** 20497 * Sets the `toString` method of `func` to return `string`. 20498 * 20499 * @private 20500 * @param {Function} func The function to modify. 20501 * @param {Function} string The `toString` result. 20502 * @returns {Function} Returns `func`. 20503 */ 20504 var setToString = shortOut(baseSetToString); 20505 20506 /** 20507 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 20508 * with wrapper details in a comment at the top of the source body. 20509 * 20510 * @private 20511 * @param {Function} wrapper The function to modify. 20512 * @param {Function} reference The reference function. 20513 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 20514 * @returns {Function} Returns `wrapper`. 20515 */ 20516 function setWrapToString(wrapper, reference, bitmask) { 20517 var source = (reference + ''); 20518 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 20519 } 20520 20521 /** 20522 * Creates a function that'll short out and invoke `identity` instead 20523 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 20524 * milliseconds. 20525 * 20526 * @private 20527 * @param {Function} func The function to restrict. 20528 * @returns {Function} Returns the new shortable function. 20529 */ 20530 function shortOut(func) { 20531 var count = 0, 20532 lastCalled = 0; 20533 20534 return function() { 20535 var stamp = nativeNow(), 20536 remaining = HOT_SPAN - (stamp - lastCalled); 20537 20538 lastCalled = stamp; 20539 if (remaining > 0) { 20540 if (++count >= HOT_COUNT) { 20541 return arguments[0]; 20542 } 20543 } else { 20544 count = 0; 20545 } 20546 return func.apply(undefined, arguments); 20547 }; 20548 } 20549 20550 /** 20551 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 20552 * 20553 * @private 20554 * @param {Array} array The array to shuffle. 20555 * @param {number} [size=array.length] The size of `array`. 20556 * @returns {Array} Returns `array`. 20557 */ 20558 function shuffleSelf(array, size) { 20559 var index = -1, 20560 length = array.length, 20561 lastIndex = length - 1; 20562 20563 size = size === undefined ? length : size; 20564 while (++index < size) { 20565 var rand = baseRandom(index, lastIndex), 20566 value = array[rand]; 20567 20568 array[rand] = array[index]; 20569 array[index] = value; 20570 } 20571 array.length = size; 20572 return array; 20573 } 20574 20575 /** 20576 * Converts `string` to a property path array.
vendor: 1,775 bytes, lines 20577-20637
20577 * 20578 * @private 20579 * @param {string} string The string to convert. 20580 * @returns {Array} Returns the property path array. 20581 */ 20582 var stringToPath = memoizeCapped(function(string) { 20583 var result = []; 20584 if (string.charCodeAt(0) === 46 /* . */) { 20585 result.push(''); 20586 } 20587 string.replace(rePropName, function(match, number, quote, subString) { 20588 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); 20589 }); 20590 return result; 20591 }); 20592 20593 /** 20594 * Converts `value` to a string key if it's not a string or symbol. 20595 * 20596 * @private 20597 * @param {*} value The value to inspect. 20598 * @returns {string|symbol} Returns the key. 20599 */ 20600 function toKey(value) { 20601 if (typeof value == 'string' || isSymbol(value)) { 20602 return value; 20603 } 20604 var result = (value + ''); 20605 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 20606 } 20607 20608 /** 20609 * Converts `func` to its source code. 20610 * 20611 * @private 20612 * @param {Function} func The function to convert. 20613 * @returns {string} Returns the source code. 20614 */ 20615 function toSource(func) { 20616 if (func != null) { 20617 try { 20618 return funcToString.call(func); 20619 } catch (e) {} 20620 try { 20621 return (func + ''); 20622 } catch (e) {} 20623 } 20624 return ''; 20625 } 20626 20627 /** 20628 * Updates wrapper `details` based on `bitmask` flags. 20629 * 20630 * @private 20631 * @returns {Array} details The details to modify. 20632 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 20633 * @returns {Array} Returns `details`. 20634 */ 20635 function updateWrapDetails(details, bitmask) { 20636 arrayEach(wrapFlags, function(pair) { 20637 var value = '_.' + pair[0];
vendor: 7,345 bytes, lines 20638-20865
20638 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { 20639 details.push(value); 20640 } 20641 }); 20642 return details.sort(); 20643 } 20644 20645 /** 20646 * Creates a clone of `wrapper`. 20647 * 20648 * @private 20649 * @param {Object} wrapper The wrapper to clone. 20650 * @returns {Object} Returns the cloned wrapper. 20651 */ 20652 function wrapperClone(wrapper) { 20653 if (wrapper instanceof LazyWrapper) { 20654 return wrapper.clone(); 20655 } 20656 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 20657 result.__actions__ = copyArray(wrapper.__actions__); 20658 result.__index__ = wrapper.__index__; 20659 result.__values__ = wrapper.__values__; 20660 return result; 20661 } 20662 20663 /*------------------------------------------------------------------------*/ 20664 20665 /** 20666 * Creates an array of elements split into groups the length of `size`. 20667 * If `array` can't be split evenly, the final chunk will be the remaining 20668 * elements. 20669 * 20670 * @static 20671 * @memberOf _ 20672 * @since 3.0.0 20673 * @category Array 20674 * @param {Array} array The array to process. 20675 * @param {number} [size=1] The length of each chunk 20676 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 20677 * @returns {Array} Returns the new array of chunks. 20678 * @example 20679 * 20680 * _.chunk(['a', 'b', 'c', 'd'], 2); 20681 * // => [['a', 'b'], ['c', 'd']] 20682 * 20683 * _.chunk(['a', 'b', 'c', 'd'], 3); 20684 * // => [['a', 'b', 'c'], ['d']] 20685 */ 20686 function chunk(array, size, guard) { 20687 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { 20688 size = 1; 20689 } else { 20690 size = nativeMax(toInteger(size), 0); 20691 } 20692 var length = array == null ? 0 : array.length; 20693 if (!length || size < 1) { 20694 return []; 20695 } 20696 var index = 0, 20697 resIndex = 0, 20698 result = Array(nativeCeil(length / size)); 20699 20700 while (index < length) { 20701 result[resIndex++] = baseSlice(array, index, (index += size)); 20702 } 20703 return result; 20704 } 20705 20706 /** 20707 * Creates an array with all falsey values removed. The values `false`, `null`, 20708 * `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy. 20709 * 20710 * @static 20711 * @memberOf _ 20712 * @since 0.1.0 20713 * @category Array 20714 * @param {Array} array The array to compact. 20715 * @returns {Array} Returns the new array of filtered values. 20716 * @example 20717 * 20718 * _.compact([0, 1, false, 2, '', 3]); 20719 * // => [1, 2, 3] 20720 */ 20721 function compact(array) { 20722 var index = -1, 20723 length = array == null ? 0 : array.length, 20724 resIndex = 0, 20725 result = []; 20726 20727 while (++index < length) { 20728 var value = array[index]; 20729 if (value) { 20730 result[resIndex++] = value; 20731 } 20732 } 20733 return result; 20734 } 20735 20736 /** 20737 * Creates a new array concatenating `array` with any additional arrays 20738 * and/or values. 20739 * 20740 * @static 20741 * @memberOf _ 20742 * @since 4.0.0 20743 * @category Array 20744 * @param {Array} array The array to concatenate. 20745 * @param {...*} [values] The values to concatenate. 20746 * @returns {Array} Returns the new concatenated array. 20747 * @example 20748 * 20749 * var array = [1]; 20750 * var other = _.concat(array, 2, [3], [[4]]); 20751 * 20752 * console.log(other); 20753 * // => [1, 2, 3, [4]] 20754 * 20755 * console.log(array); 20756 * // => [1] 20757 */ 20758 function concat() { 20759 var length = arguments.length; 20760 if (!length) { 20761 return []; 20762 } 20763 var args = Array(length - 1), 20764 array = arguments[0], 20765 index = length; 20766 20767 while (index--) { 20768 args[index - 1] = arguments[index]; 20769 } 20770 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 20771 } 20772 20773 /** 20774 * Creates an array of `array` values not included in the other given arrays 20775 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 20776 * for equality comparisons. The order and references of result values are 20777 * determined by the first array. 20778 * 20779 * **Note:** Unlike `_.pullAll`, this method returns a new array. 20780 * 20781 * @static 20782 * @memberOf _ 20783 * @since 0.1.0 20784 * @category Array 20785 * @param {Array} array The array to inspect. 20786 * @param {...Array} [values] The values to exclude. 20787 * @returns {Array} Returns the new array of filtered values. 20788 * @see _.without, _.xor 20789 * @example 20790 * 20791 * _.difference([2, 1], [2, 3]); 20792 * // => [1] 20793 */ 20794 var difference = baseRest(function(array, values) { 20795 return isArrayLikeObject(array) 20796 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) 20797 : []; 20798 }); 20799 20800 /** 20801 * This method is like `_.difference` except that it accepts `iteratee` which 20802 * is invoked for each element of `array` and `values` to generate the criterion 20803 * by which they're compared. The order and references of result values are 20804 * determined by the first array. The iteratee is invoked with one argument: 20805 * (value). 20806 * 20807 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 20808 * 20809 * @static 20810 * @memberOf _ 20811 * @since 4.0.0 20812 * @category Array 20813 * @param {Array} array The array to inspect. 20814 * @param {...Array} [values] The values to exclude. 20815 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 20816 * @returns {Array} Returns the new array of filtered values. 20817 * @example 20818 * 20819 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 20820 * // => [1.2] 20821 * 20822 * // The `_.property` iteratee shorthand. 20823 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 20824 * // => [{ 'x': 2 }] 20825 */ 20826 var differenceBy = baseRest(function(array, values) { 20827 var iteratee = last(values); 20828 if (isArrayLikeObject(iteratee)) { 20829 iteratee = undefined; 20830 } 20831 return isArrayLikeObject(array) 20832 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) 20833 : []; 20834 }); 20835 20836 /** 20837 * This method is like `_.difference` except that it accepts `comparator` 20838 * which is invoked to compare elements of `array` to `values`. The order and 20839 * references of result values are determined by the first array. The comparator 20840 * is invoked with two arguments: (arrVal, othVal). 20841 * 20842 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 20843 * 20844 * @static 20845 * @memberOf _ 20846 * @since 4.0.0 20847 * @category Array 20848 * @param {Array} array The array to inspect. 20849 * @param {...Array} [values] The values to exclude. 20850 * @param {Function} [comparator] The comparator invoked per element. 20851 * @returns {Array} Returns the new array of filtered values. 20852 * @example 20853 * 20854 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 20855 * 20856 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 20857 * // => [{ 'x': 2, 'y': 1 }] 20858 */ 20859 var differenceWith = baseRest(function(array, values) { 20860 var comparator = last(values); 20861 if (isArrayLikeObject(comparator)) { 20862 comparator = undefined; 20863 } 20864 return isArrayLikeObject(array) 20865 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, c
vendor: 10,912 bytes, lines 20865-21226
20865omparator) 20866 : []; 20867 }); 20868 20869 /** 20870 * Creates a slice of `array` with `n` elements dropped from the beginning. 20871 * 20872 * @static 20873 * @memberOf _ 20874 * @since 0.5.0 20875 * @category Array 20876 * @param {Array} array The array to query. 20877 * @param {number} [n=1] The number of elements to drop. 20878 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 20879 * @returns {Array} Returns the slice of `array`. 20880 * @example 20881 * 20882 * _.drop([1, 2, 3]); 20883 * // => [2, 3] 20884 * 20885 * _.drop([1, 2, 3], 2); 20886 * // => [3] 20887 * 20888 * _.drop([1, 2, 3], 5); 20889 * // => [] 20890 * 20891 * _.drop([1, 2, 3], 0); 20892 * // => [1, 2, 3] 20893 */ 20894 function drop(array, n, guard) { 20895 var length = array == null ? 0 : array.length; 20896 if (!length) { 20897 return []; 20898 } 20899 n = (guard || n === undefined) ? 1 : toInteger(n); 20900 return baseSlice(array, n < 0 ? 0 : n, length); 20901 } 20902 20903 /** 20904 * Creates a slice of `array` with `n` elements dropped from the end. 20905 * 20906 * @static 20907 * @memberOf _ 20908 * @since 3.0.0 20909 * @category Array 20910 * @param {Array} array The array to query. 20911 * @param {number} [n=1] The number of elements to drop. 20912 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 20913 * @returns {Array} Returns the slice of `array`. 20914 * @example 20915 * 20916 * _.dropRight([1, 2, 3]); 20917 * // => [1, 2] 20918 * 20919 * _.dropRight([1, 2, 3], 2); 20920 * // => [1] 20921 * 20922 * _.dropRight([1, 2, 3], 5); 20923 * // => [] 20924 * 20925 * _.dropRight([1, 2, 3], 0); 20926 * // => [1, 2, 3] 20927 */ 20928 function dropRight(array, n, guard) { 20929 var length = array == null ? 0 : array.length; 20930 if (!length) { 20931 return []; 20932 } 20933 n = (guard || n === undefined) ? 1 : toInteger(n); 20934 n = length - n; 20935 return baseSlice(array, 0, n < 0 ? 0 : n); 20936 } 20937 20938 /** 20939 * Creates a slice of `array` excluding elements dropped from the end. 20940 * Elements are dropped until `predicate` returns falsey. The predicate is 20941 * invoked with three arguments: (value, index, array). 20942 * 20943 * @static 20944 * @memberOf _ 20945 * @since 3.0.0 20946 * @category Array 20947 * @param {Array} array The array to query. 20948 * @param {Function} [predicate=_.identity] The function invoked per iteration. 20949 * @returns {Array} Returns the slice of `array`. 20950 * @example 20951 * 20952 * var users = [ 20953 * { 'user': 'barney', 'active': true }, 20954 * { 'user': 'fred', 'active': false }, 20955 * { 'user': 'pebbles', 'active': false } 20956 * ]; 20957 * 20958 * _.dropRightWhile(users, function(o) { return !o.active; }); 20959 * // => objects for ['barney'] 20960 * 20961 * // The `_.matches` iteratee shorthand. 20962 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 20963 * // => objects for ['barney', 'fred'] 20964 * 20965 * // The `_.matchesProperty` iteratee shorthand. 20966 * _.dropRightWhile(users, ['active', false]); 20967 * // => objects for ['barney'] 20968 * 20969 * // The `_.property` iteratee shorthand. 20970 * _.dropRightWhile(users, 'active'); 20971 * // => objects for ['barney', 'fred', 'pebbles'] 20972 */ 20973 function dropRightWhile(array, predicate) { 20974 return (array && array.length) 20975 ? baseWhile(array, getIteratee(predicate, 3), true, true) 20976 : []; 20977 } 20978 20979 /** 20980 * Creates a slice of `array` excluding elements dropped from the beginning. 20981 * Elements are dropped until `predicate` returns falsey. The predicate is 20982 * invoked with three arguments: (value, index, array). 20983 * 20984 * @static 20985 * @memberOf _ 20986 * @since 3.0.0 20987 * @category Array 20988 * @param {Array} array The array to query. 20989 * @param {Function} [predicate=_.identity] The function invoked per iteration. 20990 * @returns {Array} Returns the slice of `array`. 20991 * @example 20992 * 20993 * var users = [ 20994 * { 'user': 'barney', 'active': false }, 20995 * { 'user': 'fred', 'active': false }, 20996 * { 'user': 'pebbles', 'active': true } 20997 * ]; 20998 * 20999 * _.dropWhile(users, function(o) { return !o.active; }); 21000 * // => objects for ['pebbles'] 21001 * 21002 * // The `_.matches` iteratee shorthand. 21003 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 21004 * // => objects for ['fred', 'pebbles'] 21005 * 21006 * // The `_.matchesProperty` iteratee shorthand. 21007 * _.dropWhile(users, ['active', false]); 21008 * // => objects for ['pebbles'] 21009 * 21010 * // The `_.property` iteratee shorthand. 21011 * _.dropWhile(users, 'active'); 21012 * // => objects for ['barney', 'fred', 'pebbles'] 21013 */ 21014 function dropWhile(array, predicate) { 21015 return (array && array.length) 21016 ? baseWhile(array, getIteratee(predicate, 3), true) 21017 : []; 21018 } 21019 21020 /** 21021 * Fills elements of `array` with `value` from `start` up to, but not 21022 * including, `end`. 21023 * 21024 * **Note:** This method mutates `array`. 21025 * 21026 * @static 21027 * @memberOf _ 21028 * @since 3.2.0 21029 * @category Array 21030 * @param {Array} array The array to fill. 21031 * @param {*} value The value to fill `array` with. 21032 * @param {number} [start=0] The start position. 21033 * @param {number} [end=array.length] The end position. 21034 * @returns {Array} Returns `array`. 21035 * @example 21036 * 21037 * var array = [1, 2, 3]; 21038 * 21039 * _.fill(array, 'a'); 21040 * console.log(array); 21041 * // => ['a', 'a', 'a'] 21042 * 21043 * _.fill(Array(3), 2); 21044 * // => [2, 2, 2] 21045 * 21046 * _.fill([4, 6, 8, 10], '*', 1, 3); 21047 * // => [4, '*', '*', 10] 21048 */ 21049 function fill(array, value, start, end) { 21050 var length = array == null ? 0 : array.length; 21051 if (!length) { 21052 return []; 21053 } 21054 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { 21055 start = 0; 21056 end = length; 21057 } 21058 return baseFill(array, value, start, end); 21059 } 21060 21061 /** 21062 * This method is like `_.find` except that it returns the index of the first 21063 * element `predicate` returns truthy for instead of the element itself. 21064 * 21065 * @static 21066 * @memberOf _ 21067 * @since 1.1.0 21068 * @category Array 21069 * @param {Array} array The array to inspect. 21070 * @param {Function} [predicate=_.identity] The function invoked per iteration. 21071 * @param {number} [fromIndex=0] The index to search from. 21072 * @returns {number} Returns the index of the found element, else `-1`. 21073 * @example 21074 * 21075 * var users = [ 21076 * { 'user': 'barney', 'active': false }, 21077 * { 'user': 'fred', 'active': false }, 21078 * { 'user': 'pebbles', 'active': true } 21079 * ]; 21080 * 21081 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 21082 * // => 0 21083 * 21084 * // The `_.matches` iteratee shorthand. 21085 * _.findIndex(users, { 'user': 'fred', 'active': false }); 21086 * // => 1 21087 * 21088 * // The `_.matchesProperty` iteratee shorthand. 21089 * _.findIndex(users, ['active', false]); 21090 * // => 0 21091 * 21092 * // The `_.property` iteratee shorthand. 21093 * _.findIndex(users, 'active'); 21094 * // => 2 21095 */ 21096 function findIndex(array, predicate, fromIndex) { 21097 var length = array == null ? 0 : array.length; 21098 if (!length) { 21099 return -1; 21100 } 21101 var index = fromIndex == null ? 0 : toInteger(fromIndex); 21102 if (index < 0) { 21103 index = nativeMax(length + index, 0); 21104 } 21105 return baseFindIndex(array, getIteratee(predicate, 3), index); 21106 } 21107 21108 /** 21109 * This method is like `_.findIndex` except that it iterates over elements 21110 * of `collection` from right to left. 21111 * 21112 * @static 21113 * @memberOf _ 21114 * @since 2.0.0 21115 * @category Array 21116 * @param {Array} array The array to inspect. 21117 * @param {Function} [predicate=_.identity] The function invoked per iteration. 21118 * @param {number} [fromIndex=array.length-1] The index to search from. 21119 * @returns {number} Returns the index of the found element, else `-1`. 21120 * @example 21121 * 21122 * var users = [ 21123 * { 'user': 'barney', 'active': true }, 21124 * { 'user': 'fred', 'active': false }, 21125 * { 'user': 'pebbles', 'active': false } 21126 * ]; 21127 * 21128 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 21129 * // => 2 21130 * 21131 * // The `_.matches` iteratee shorthand. 21132 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 21133 * // => 0 21134 * 21135 * // The `_.matchesProperty` iteratee shorthand. 21136 * _.findLastIndex(users, ['active', false]); 21137 * // => 2 21138 * 21139 * // The `_.property` iteratee shorthand. 21140 * _.findLastIndex(users, 'active'); 21141 * // => 0 21142 */ 21143 function findLastIndex(array, predicate, fromIndex) { 21144 var length = array == null ? 0 : array.length; 21145 if (!length) { 21146 return -1; 21147 } 21148 var index = length - 1; 21149 if (fromIndex !== undefined) { 21150 index = toInteger(fromIndex); 21151 index = fromIndex < 0 21152 ? nativeMax(length + index, 0) 21153 : nativeMin(index, length - 1); 21154 } 21155 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 21156 } 21157 21158 /** 21159 * Flattens `array` a single level deep. 21160 * 21161 * @static 21162 * @memberOf _ 21163 * @since 0.1.0 21164 * @category Array 21165 * @param {Array} array The array to flatten. 21166 * @returns {Array} Returns the new flattened array. 21167 * @example 21168 * 21169 * _.flatten([1, [2, [3, [4]], 5]]); 21170 * // => [1, 2, [3, [4]], 5] 21171 */ 21172 function flatten(array) { 21173 var length = array == null ? 0 : array.length; 21174 return length ? baseFlatten(array, 1) : []; 21175 } 21176 21177 /** 21178 * Recursively flattens `array`. 21179 * 21180 * @static 21181 * @memberOf _ 21182 * @since 3.0.0 21183 * @category Array 21184 * @param {Array} array The array to flatten. 21185 * @returns {Array} Returns the new flattened array. 21186 * @example 21187 * 21188 * _.flattenDeep([1, [2, [3, [4]], 5]]); 21189 * // => [1, 2, 3, 4, 5] 21190 */ 21191 function flattenDeep(array) { 21192 var length = array == null ? 0 : array.length; 21193 return length ? baseFlatten(array, INFINITY) : []; 21194 } 21195 21196 /** 21197 * Recursively flatten `array` up to `depth` times. 21198 * 21199 * @static 21200 * @memberOf _ 21201 * @since 4.4.0 21202 * @category Array 21203 * @param {Array} array The array to flatten. 21204 * @param {number} [depth=1] The maximum recursion depth. 21205 * @returns {Array} Returns the new flattened array. 21206 * @example 21207 * 21208 * var array = [1, [2, [3, [4]], 5]]; 21209 * 21210 * _.flattenDepth(array, 1); 21211 * // => [1, 2, [3, [4]], 5] 21212 * 21213 * _.flattenDepth(array, 2); 21214 * // => [1, 2, 3, [4], 5] 21215 */ 21216 function flattenDepth(array, depth) { 21217 var length = array == null ? 0 : array.length; 21218 if (!length) { 21219 return []; 21220 } 21221 depth = depth === undefined ? 1 : toInteger(depth); 21222 return baseFlatten(array, depth); 21223 } 21224 21225 /** 21226 * The inverse of `_.toPairs`;
vendor: 6,026 bytes, lines 21226-21418
21226 this method returns an object composed 21227 * from key-value `pairs`. 21228 * 21229 * @static 21230 * @memberOf _ 21231 * @since 4.0.0 21232 * @category Array 21233 * @param {Array} pairs The key-value pairs. 21234 * @returns {Object} Returns the new object. 21235 * @example 21236 * 21237 * _.fromPairs([['a', 1], ['b', 2]]); 21238 * // => { 'a': 1, 'b': 2 } 21239 */ 21240 function fromPairs(pairs) { 21241 var index = -1, 21242 length = pairs == null ? 0 : pairs.length, 21243 result = {}; 21244 21245 while (++index < length) { 21246 var pair = pairs[index]; 21247 baseAssignValue(result, pair[0], pair[1]); 21248 } 21249 return result; 21250 } 21251 21252 /** 21253 * Gets the first element of `array`. 21254 * 21255 * @static 21256 * @memberOf _ 21257 * @since 0.1.0 21258 * @alias first 21259 * @category Array 21260 * @param {Array} array The array to query. 21261 * @returns {*} Returns the first element of `array`. 21262 * @example 21263 * 21264 * _.head([1, 2, 3]); 21265 * // => 1 21266 * 21267 * _.head([]); 21268 * // => undefined 21269 */ 21270 function head(array) { 21271 return (array && array.length) ? array[0] : undefined; 21272 } 21273 21274 /** 21275 * Gets the index at which the first occurrence of `value` is found in `array` 21276 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 21277 * for equality comparisons. If `fromIndex` is negative, it's used as the 21278 * offset from the end of `array`. 21279 * 21280 * @static 21281 * @memberOf _ 21282 * @since 0.1.0 21283 * @category Array 21284 * @param {Array} array The array to inspect. 21285 * @param {*} value The value to search for. 21286 * @param {number} [fromIndex=0] The index to search from. 21287 * @returns {number} Returns the index of the matched value, else `-1`. 21288 * @example 21289 * 21290 * _.indexOf([1, 2, 1, 2], 2); 21291 * // => 1 21292 * 21293 * // Search from the `fromIndex`. 21294 * _.indexOf([1, 2, 1, 2], 2, 2); 21295 * // => 3 21296 */ 21297 function indexOf(array, value, fromIndex) { 21298 var length = array == null ? 0 : array.length; 21299 if (!length) { 21300 return -1; 21301 } 21302 var index = fromIndex == null ? 0 : toInteger(fromIndex); 21303 if (index < 0) { 21304 index = nativeMax(length + index, 0); 21305 } 21306 return baseIndexOf(array, value, index); 21307 } 21308 21309 /** 21310 * Gets all but the last element of `array`. 21311 * 21312 * @static 21313 * @memberOf _ 21314 * @since 0.1.0 21315 * @category Array 21316 * @param {Array} array The array to query. 21317 * @returns {Array} Returns the slice of `array`. 21318 * @example 21319 * 21320 * _.initial([1, 2, 3]); 21321 * // => [1, 2] 21322 */ 21323 function initial(array) { 21324 var length = array == null ? 0 : array.length; 21325 return length ? baseSlice(array, 0, -1) : []; 21326 } 21327 21328 /** 21329 * Creates an array of unique values that are included in all given arrays 21330 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 21331 * for equality comparisons. The order and references of result values are 21332 * determined by the first array. 21333 * 21334 * @static 21335 * @memberOf _ 21336 * @since 0.1.0 21337 * @category Array 21338 * @param {...Array} [arrays] The arrays to inspect. 21339 * @returns {Array} Returns the new array of intersecting values. 21340 * @example 21341 * 21342 * _.intersection([2, 1], [2, 3]); 21343 * // => [2] 21344 */ 21345 var intersection = baseRest(function(arrays) { 21346 var mapped = arrayMap(arrays, castArrayLikeObject); 21347 return (mapped.length && mapped[0] === arrays[0]) 21348 ? baseIntersection(mapped) 21349 : []; 21350 }); 21351 21352 /** 21353 * This method is like `_.intersection` except that it accepts `iteratee` 21354 * which is invoked for each element of each `arrays` to generate the criterion 21355 * by which they're compared. The order and references of result values are 21356 * determined by the first array. The iteratee is invoked with one argument: 21357 * (value). 21358 * 21359 * @static 21360 * @memberOf _ 21361 * @since 4.0.0 21362 * @category Array 21363 * @param {...Array} [arrays] The arrays to inspect. 21364 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 21365 * @returns {Array} Returns the new array of intersecting values. 21366 * @example 21367 * 21368 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 21369 * // => [2.1] 21370 * 21371 * // The `_.property` iteratee shorthand. 21372 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 21373 * // => [{ 'x': 1 }] 21374 */ 21375 var intersectionBy = baseRest(function(arrays) { 21376 var iteratee = last(arrays), 21377 mapped = arrayMap(arrays, castArrayLikeObject); 21378 21379 if (iteratee === last(mapped)) { 21380 iteratee = undefined; 21381 } else { 21382 mapped.pop(); 21383 } 21384 return (mapped.length && mapped[0] === arrays[0]) 21385 ? baseIntersection(mapped, getIteratee(iteratee, 2)) 21386 : []; 21387 }); 21388 21389 /** 21390 * This method is like `_.intersection` except that it accepts `comparator` 21391 * which is invoked to compare elements of `arrays`. The order and references 21392 * of result values are determined by the first array. The comparator is 21393 * invoked with two arguments: (arrVal, othVal). 21394 * 21395 * @static 21396 * @memberOf _ 21397 * @since 4.0.0 21398 * @category Array 21399 * @param {...Array} [arrays] The arrays to inspect. 21400 * @param {Function} [comparator] The comparator invoked per element. 21401 * @returns {Array} Returns the new array of intersecting values. 21402 * @example 21403 * 21404 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 21405 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 21406 * 21407 * _.intersectionWith(objects, others, _.isEqual); 21408 * // => [{ 'x': 1, 'y': 2 }] 21409 */ 21410 var intersectionWith = baseRest(function(arrays) { 21411 var comparator = last(arrays), 21412 mapped = arrayMap(arrays, castArrayLikeObject); 21413 21414 comparator = typeof comparator == 'function' ? comparator : undefined; 21415 if (comparator) { 21416 mapped.pop(); 21417 } 21418 return (mapped.length && mapped[0] === arrays[0])
vendor: 56,125 bytes, lines 21419-23221
21419 ? baseIntersection(mapped, undefined, comparator) 21420 : []; 21421 }); 21422 21423 /** 21424 * Converts all elements in `array` into a string separated by `separator`. 21425 * 21426 * @static 21427 * @memberOf _ 21428 * @since 4.0.0 21429 * @category Array 21430 * @param {Array} array The array to convert. 21431 * @param {string} [separator=','] The element separator. 21432 * @returns {string} Returns the joined string. 21433 * @example 21434 * 21435 * _.join(['a', 'b', 'c'], '~'); 21436 * // => 'a~b~c' 21437 */ 21438 function join(array, separator) { 21439 return array == null ? '' : nativeJoin.call(array, separator); 21440 } 21441 21442 /** 21443 * Gets the last element of `array`. 21444 * 21445 * @static 21446 * @memberOf _ 21447 * @since 0.1.0 21448 * @category Array 21449 * @param {Array} array The array to query. 21450 * @returns {*} Returns the last element of `array`. 21451 * @example 21452 * 21453 * _.last([1, 2, 3]); 21454 * // => 3 21455 */ 21456 function last(array) { 21457 var length = array == null ? 0 : array.length; 21458 return length ? array[length - 1] : undefined; 21459 } 21460 21461 /** 21462 * This method is like `_.indexOf` except that it iterates over elements of 21463 * `array` from right to left. 21464 * 21465 * @static 21466 * @memberOf _ 21467 * @since 0.1.0 21468 * @category Array 21469 * @param {Array} array The array to inspect. 21470 * @param {*} value The value to search for. 21471 * @param {number} [fromIndex=array.length-1] The index to search from. 21472 * @returns {number} Returns the index of the matched value, else `-1`. 21473 * @example 21474 * 21475 * _.lastIndexOf([1, 2, 1, 2], 2); 21476 * // => 3 21477 * 21478 * // Search from the `fromIndex`. 21479 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 21480 * // => 1 21481 */ 21482 function lastIndexOf(array, value, fromIndex) { 21483 var length = array == null ? 0 : array.length; 21484 if (!length) { 21485 return -1; 21486 } 21487 var index = length; 21488 if (fromIndex !== undefined) { 21489 index = toInteger(fromIndex); 21490 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 21491 } 21492 return value === value 21493 ? strictLastIndexOf(array, value, index) 21494 : baseFindIndex(array, baseIsNaN, index, true); 21495 } 21496 21497 /** 21498 * Gets the element at index `n` of `array`. If `n` is negative, the nth 21499 * element from the end is returned. 21500 * 21501 * @static 21502 * @memberOf _ 21503 * @since 4.11.0 21504 * @category Array 21505 * @param {Array} array The array to query. 21506 * @param {number} [n=0] The index of the element to return. 21507 * @returns {*} Returns the nth element of `array`. 21508 * @example 21509 * 21510 * var array = ['a', 'b', 'c', 'd']; 21511 * 21512 * _.nth(array, 1); 21513 * // => 'b' 21514 * 21515 * _.nth(array, -2); 21516 * // => 'c'; 21517 */ 21518 function nth(array, n) { 21519 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; 21520 } 21521 21522 /** 21523 * Removes all given values from `array` using 21524 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 21525 * for equality comparisons. 21526 * 21527 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 21528 * to remove elements from an array by predicate. 21529 * 21530 * @static 21531 * @memberOf _ 21532 * @since 2.0.0 21533 * @category Array 21534 * @param {Array} array The array to modify. 21535 * @param {...*} [values] The values to remove. 21536 * @returns {Array} Returns `array`. 21537 * @example 21538 * 21539 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 21540 * 21541 * _.pull(array, 'a', 'c'); 21542 * console.log(array); 21543 * // => ['b', 'b'] 21544 */ 21545 var pull = baseRest(pullAll); 21546 21547 /** 21548 * This method is like `_.pull` except that it accepts an array of values to remove. 21549 * 21550 * **Note:** Unlike `_.difference`, this method mutates `array`. 21551 * 21552 * @static 21553 * @memberOf _ 21554 * @since 4.0.0 21555 * @category Array 21556 * @param {Array} array The array to modify. 21557 * @param {Array} values The values to remove. 21558 * @returns {Array} Returns `array`. 21559 * @example 21560 * 21561 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 21562 * 21563 * _.pullAll(array, ['a', 'c']); 21564 * console.log(array); 21565 * // => ['b', 'b'] 21566 */ 21567 function pullAll(array, values) { 21568 return (array && array.length && values && values.length) 21569 ? basePullAll(array, values) 21570 : array; 21571 } 21572 21573 /** 21574 * This method is like `_.pullAll` except that it accepts `iteratee` which is 21575 * invoked for each element of `array` and `values` to generate the criterion 21576 * by which they're compared. The iteratee is invoked with one argument: (value). 21577 * 21578 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 21579 * 21580 * @static 21581 * @memberOf _ 21582 * @since 4.0.0 21583 * @category Array 21584 * @param {Array} array The array to modify. 21585 * @param {Array} values The values to remove. 21586 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 21587 * @returns {Array} Returns `array`. 21588 * @example 21589 * 21590 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 21591 * 21592 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 21593 * console.log(array); 21594 * // => [{ 'x': 2 }] 21595 */ 21596 function pullAllBy(array, values, iteratee) { 21597 return (array && array.length && values && values.length) 21598 ? basePullAll(array, values, getIteratee(iteratee, 2)) 21599 : array; 21600 } 21601 21602 /** 21603 * This method is like `_.pullAll` except that it accepts `comparator` which 21604 * is invoked to compare elements of `array` to `values`. The comparator is 21605 * invoked with two arguments: (arrVal, othVal). 21606 * 21607 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 21608 * 21609 * @static 21610 * @memberOf _ 21611 * @since 4.6.0 21612 * @category Array 21613 * @param {Array} array The array to modify. 21614 * @param {Array} values The values to remove. 21615 * @param {Function} [comparator] The comparator invoked per element. 21616 * @returns {Array} Returns `array`. 21617 * @example 21618 * 21619 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 21620 * 21621 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 21622 * console.log(array); 21623 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 21624 */ 21625 function pullAllWith(array, values, comparator) { 21626 return (array && array.length && values && values.length) 21627 ? basePullAll(array, values, undefined, comparator) 21628 : array; 21629 } 21630 21631 /** 21632 * Removes elements from `array` corresponding to `indexes` and returns an 21633 * array of removed elements. 21634 * 21635 * **Note:** Unlike `_.at`, this method mutates `array`. 21636 * 21637 * @static 21638 * @memberOf _ 21639 * @since 3.0.0 21640 * @category Array 21641 * @param {Array} array The array to modify. 21642 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 21643 * @returns {Array} Returns the new array of removed elements. 21644 * @example 21645 * 21646 * var array = ['a', 'b', 'c', 'd']; 21647 * var pulled = _.pullAt(array, [1, 3]); 21648 * 21649 * console.log(array); 21650 * // => ['a', 'c'] 21651 * 21652 * console.log(pulled); 21653 * // => ['b', 'd'] 21654 */ 21655 var pullAt = flatRest(function(array, indexes) { 21656 var length = array == null ? 0 : array.length, 21657 result = baseAt(array, indexes); 21658 21659 basePullAt(array, arrayMap(indexes, function(index) { 21660 return isIndex(index, length) ? +index : index; 21661 }).sort(compareAscending)); 21662 21663 return result; 21664 }); 21665 21666 /** 21667 * Removes all elements from `array` that `predicate` returns truthy for 21668 * and returns an array of the removed elements. The predicate is invoked 21669 * with three arguments: (value, index, array). 21670 * 21671 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 21672 * to pull elements from an array by value. 21673 * 21674 * @static 21675 * @memberOf _ 21676 * @since 2.0.0 21677 * @category Array 21678 * @param {Array} array The array to modify. 21679 * @param {Function} [predicate=_.identity] The function invoked per iteration. 21680 * @returns {Array} Returns the new array of removed elements. 21681 * @example 21682 * 21683 * var array = [1, 2, 3, 4]; 21684 * var evens = _.remove(array, function(n) { 21685 * return n % 2 == 0; 21686 * }); 21687 * 21688 * console.log(array); 21689 * // => [1, 3] 21690 * 21691 * console.log(evens); 21692 * // => [2, 4] 21693 */ 21694 function remove(array, predicate) { 21695 var result = []; 21696 if (!(array && array.length)) { 21697 return result; 21698 } 21699 var index = -1, 21700 indexes = [], 21701 length = array.length; 21702 21703 predicate = getIteratee(predicate, 3); 21704 while (++index < length) { 21705 var value = array[index]; 21706 if (predicate(value, index, array)) { 21707 result.push(value); 21708 indexes.push(index); 21709 } 21710 } 21711 basePullAt(array, indexes); 21712 return result; 21713 } 21714 21715 /** 21716 * Reverses `array` so that the first element becomes the last, the second 21717 * element becomes the second to last, and so on. 21718 * 21719 * **Note:** This method mutates `array` and is based on 21720 * [`Array#reverse`](https://mdn.io/Array/reverse). 21721 * 21722 * @static 21723 * @memberOf _ 21724 * @since 4.0.0 21725 * @category Array 21726 * @param {Array} array The array to modify. 21727 * @returns {Array} Returns `array`. 21728 * @example 21729 * 21730 * var array = [1, 2, 3]; 21731 * 21732 * _.reverse(array); 21733 * // => [3, 2, 1] 21734 * 21735 * console.log(array); 21736 * // => [3, 2, 1] 21737 */ 21738 function reverse(array) { 21739 return array == null ? array : nativeReverse.call(array); 21740 } 21741 21742 /** 21743 * Creates a slice of `array` from `start` up to, but not including, `end`. 21744 * 21745 * **Note:** This method is used instead of 21746 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 21747 * returned. 21748 * 21749 * @static 21750 * @memberOf _ 21751 * @since 3.0.0 21752 * @category Array 21753 * @param {Array} array The array to slice. 21754 * @param {number} [start=0] The start position. 21755 * @param {number} [end=array.length] The end position. 21756 * @returns {Array} Returns the slice of `array`. 21757 */ 21758 function slice(array, start, end) { 21759 var length = array == null ? 0 : array.length; 21760 if (!length) { 21761 return []; 21762 } 21763 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 21764 start = 0; 21765 end = length; 21766 } 21767 else { 21768 start = start == null ? 0 : toInteger(start); 21769 end = end === undefined ? length : toInteger(end); 21770 } 21771 return baseSlice(array, start, end); 21772 } 21773 21774 /** 21775 * Uses a binary search to determine the lowest index at which `value` 21776 * should be inserted into `array` in order to maintain its sort order. 21777 * 21778 * @static 21779 * @memberOf _ 21780 * @since 0.1.0 21781 * @category Array 21782 * @param {Array} array The sorted array to inspect. 21783 * @param {*} value The value to evaluate. 21784 * @returns {number} Returns the index at which `value` should be inserted 21785 * into `array`. 21786 * @example 21787 * 21788 * _.sortedIndex([30, 50], 40); 21789 * // => 1 21790 */ 21791 function sortedIndex(array, value) { 21792 return baseSortedIndex(array, value); 21793 } 21794 21795 /** 21796 * This method is like `_.sortedIndex` except that it accepts `iteratee` 21797 * which is invoked for `value` and each element of `array` to compute their 21798 * sort ranking. The iteratee is invoked with one argument: (value). 21799 * 21800 * @static 21801 * @memberOf _ 21802 * @since 4.0.0 21803 * @category Array 21804 * @param {Array} array The sorted array to inspect. 21805 * @param {*} value The value to evaluate. 21806 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 21807 * @returns {number} Returns the index at which `value` should be inserted 21808 * into `array`. 21809 * @example 21810 * 21811 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 21812 * 21813 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 21814 * // => 0 21815 * 21816 * // The `_.property` iteratee shorthand. 21817 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 21818 * // => 0 21819 */ 21820 function sortedIndexBy(array, value, iteratee) { 21821 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); 21822 } 21823 21824 /** 21825 * This method is like `_.indexOf` except that it performs a binary 21826 * search on a sorted `array`. 21827 * 21828 * @static 21829 * @memberOf _ 21830 * @since 4.0.0 21831 * @category Array 21832 * @param {Array} array The array to inspect. 21833 * @param {*} value The value to search for. 21834 * @returns {number} Returns the index of the matched value, else `-1`. 21835 * @example 21836 * 21837 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 21838 * // => 1 21839 */ 21840 function sortedIndexOf(array, value) { 21841 var length = array == null ? 0 : array.length; 21842 if (length) { 21843 var index = baseSortedIndex(array, value); 21844 if (index < length && eq(array[index], value)) { 21845 return index; 21846 } 21847 } 21848 return -1; 21849 } 21850 21851 /** 21852 * This method is like `_.sortedIndex` except that it returns the highest 21853 * index at which `value` should be inserted into `array` in order to 21854 * maintain its sort order. 21855 * 21856 * @static 21857 * @memberOf _ 21858 * @since 3.0.0 21859 * @category Array 21860 * @param {Array} array The sorted array to inspect. 21861 * @param {*} value The value to evaluate. 21862 * @returns {number} Returns the index at which `value` should be inserted 21863 * into `array`. 21864 * @example 21865 * 21866 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 21867 * // => 4 21868 */ 21869 function sortedLastIndex(array, value) { 21870 return baseSortedIndex(array, value, true); 21871 } 21872 21873 /** 21874 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 21875 * which is invoked for `value` and each element of `array` to compute their 21876 * sort ranking. The iteratee is invoked with one argument: (value). 21877 * 21878 * @static 21879 * @memberOf _ 21880 * @since 4.0.0 21881 * @category Array 21882 * @param {Array} array The sorted array to inspect. 21883 * @param {*} value The value to evaluate. 21884 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 21885 * @returns {number} Returns the index at which `value` should be inserted 21886 * into `array`. 21887 * @example 21888 * 21889 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 21890 * 21891 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 21892 * // => 1 21893 * 21894 * // The `_.property` iteratee shorthand. 21895 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 21896 * // => 1 21897 */ 21898 function sortedLastIndexBy(array, value, iteratee) { 21899 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); 21900 } 21901 21902 /** 21903 * This method is like `_.lastIndexOf` except that it performs a binary 21904 * search on a sorted `array`. 21905 * 21906 * @static 21907 * @memberOf _ 21908 * @since 4.0.0 21909 * @category Array 21910 * @param {Array} array The array to inspect. 21911 * @param {*} value The value to search for. 21912 * @returns {number} Returns the index of the matched value, else `-1`. 21913 * @example 21914 * 21915 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 21916 * // => 3 21917 */ 21918 function sortedLastIndexOf(array, value) { 21919 var length = array == null ? 0 : array.length; 21920 if (length) { 21921 var index = baseSortedIndex(array, value, true) - 1; 21922 if (eq(array[index], value)) { 21923 return index; 21924 } 21925 } 21926 return -1; 21927 } 21928 21929 /** 21930 * This method is like `_.uniq` except that it's designed and optimized 21931 * for sorted arrays. 21932 * 21933 * @static 21934 * @memberOf _ 21935 * @since 4.0.0 21936 * @category Array 21937 * @param {Array} array The array to inspect. 21938 * @returns {Array} Returns the new duplicate free array. 21939 * @example 21940 * 21941 * _.sortedUniq([1, 1, 2]); 21942 * // => [1, 2] 21943 */ 21944 function sortedUniq(array) { 21945 return (array && array.length) 21946 ? baseSortedUniq(array) 21947 : []; 21948 } 21949 21950 /** 21951 * This method is like `_.uniqBy` except that it's designed and optimized 21952 * for sorted arrays. 21953 * 21954 * @static 21955 * @memberOf _ 21956 * @since 4.0.0 21957 * @category Array 21958 * @param {Array} array The array to inspect. 21959 * @param {Function} [iteratee] The iteratee invoked per element. 21960 * @returns {Array} Returns the new duplicate free array. 21961 * @example 21962 * 21963 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 21964 * // => [1.1, 2.3] 21965 */ 21966 function sortedUniqBy(array, iteratee) { 21967 return (array && array.length) 21968 ? baseSortedUniq(array, getIteratee(iteratee, 2)) 21969 : []; 21970 } 21971 21972 /** 21973 * Gets all but the first element of `array`. 21974 * 21975 * @static 21976 * @memberOf _ 21977 * @since 4.0.0 21978 * @category Array 21979 * @param {Array} array The array to query. 21980 * @returns {Array} Returns the slice of `array`. 21981 * @example 21982 * 21983 * _.tail([1, 2, 3]); 21984 * // => [2, 3] 21985 */ 21986 function tail(array) { 21987 var length = array == null ? 0 : array.length; 21988 return length ? baseSlice(array, 1, length) : []; 21989 } 21990 21991 /** 21992 * Creates a slice of `array` with `n` elements taken from the beginning. 21993 * 21994 * @static 21995 * @memberOf _ 21996 * @since 0.1.0 21997 * @category Array 21998 * @param {Array} array The array to query. 21999 * @param {number} [n=1] The number of elements to take. 22000 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 22001 * @returns {Array} Returns the slice of `array`. 22002 * @example 22003 * 22004 * _.take([1, 2, 3]); 22005 * // => [1] 22006 * 22007 * _.take([1, 2, 3], 2); 22008 * // => [1, 2] 22009 * 22010 * _.take([1, 2, 3], 5); 22011 * // => [1, 2, 3] 22012 * 22013 * _.take([1, 2, 3], 0); 22014 * // => [] 22015 */ 22016 function take(array, n, guard) { 22017 if (!(array && array.length)) { 22018 return []; 22019 } 22020 n = (guard || n === undefined) ? 1 : toInteger(n); 22021 return baseSlice(array, 0, n < 0 ? 0 : n); 22022 } 22023 22024 /** 22025 * Creates a slice of `array` with `n` elements taken from the end. 22026 * 22027 * @static 22028 * @memberOf _ 22029 * @since 3.0.0 22030 * @category Array 22031 * @param {Array} array The array to query. 22032 * @param {number} [n=1] The number of elements to take. 22033 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 22034 * @returns {Array} Returns the slice of `array`. 22035 * @example 22036 * 22037 * _.takeRight([1, 2, 3]); 22038 * // => [3] 22039 * 22040 * _.takeRight([1, 2, 3], 2); 22041 * // => [2, 3] 22042 * 22043 * _.takeRight([1, 2, 3], 5); 22044 * // => [1, 2, 3] 22045 * 22046 * _.takeRight([1, 2, 3], 0); 22047 * // => [] 22048 */ 22049 function takeRight(array, n, guard) { 22050 var length = array == null ? 0 : array.length; 22051 if (!length) { 22052 return []; 22053 } 22054 n = (guard || n === undefined) ? 1 : toInteger(n); 22055 n = length - n; 22056 return baseSlice(array, n < 0 ? 0 : n, length); 22057 } 22058 22059 /** 22060 * Creates a slice of `array` with elements taken from the end. Elements are 22061 * taken until `predicate` returns falsey. The predicate is invoked with 22062 * three arguments: (value, index, array). 22063 * 22064 * @static 22065 * @memberOf _ 22066 * @since 3.0.0 22067 * @category Array 22068 * @param {Array} array The array to query. 22069 * @param {Function} [predicate=_.identity] The function invoked per iteration. 22070 * @returns {Array} Returns the slice of `array`. 22071 * @example 22072 * 22073 * var users = [ 22074 * { 'user': 'barney', 'active': true }, 22075 * { 'user': 'fred', 'active': false }, 22076 * { 'user': 'pebbles', 'active': false } 22077 * ]; 22078 * 22079 * _.takeRightWhile(users, function(o) { return !o.active; }); 22080 * // => objects for ['fred', 'pebbles'] 22081 * 22082 * // The `_.matches` iteratee shorthand. 22083 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 22084 * // => objects for ['pebbles'] 22085 * 22086 * // The `_.matchesProperty` iteratee shorthand. 22087 * _.takeRightWhile(users, ['active', false]); 22088 * // => objects for ['fred', 'pebbles'] 22089 * 22090 * // The `_.property` iteratee shorthand. 22091 * _.takeRightWhile(users, 'active'); 22092 * // => [] 22093 */ 22094 function takeRightWhile(array, predicate) { 22095 return (array && array.length) 22096 ? baseWhile(array, getIteratee(predicate, 3), false, true) 22097 : []; 22098 } 22099 22100 /** 22101 * Creates a slice of `array` with elements taken from the beginning. Elements 22102 * are taken until `predicate` returns falsey. The predicate is invoked with 22103 * three arguments: (value, index, array). 22104 * 22105 * @static 22106 * @memberOf _ 22107 * @since 3.0.0 22108 * @category Array 22109 * @param {Array} array The array to query. 22110 * @param {Function} [predicate=_.identity] The function invoked per iteration. 22111 * @returns {Array} Returns the slice of `array`. 22112 * @example 22113 * 22114 * var users = [ 22115 * { 'user': 'barney', 'active': false }, 22116 * { 'user': 'fred', 'active': false }, 22117 * { 'user': 'pebbles', 'active': true } 22118 * ]; 22119 * 22120 * _.takeWhile(users, function(o) { return !o.active; }); 22121 * // => objects for ['barney', 'fred'] 22122 * 22123 * // The `_.matches` iteratee shorthand. 22124 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 22125 * // => objects for ['barney'] 22126 * 22127 * // The `_.matchesProperty` iteratee shorthand. 22128 * _.takeWhile(users, ['active', false]); 22129 * // => objects for ['barney', 'fred'] 22130 * 22131 * // The `_.property` iteratee shorthand. 22132 * _.takeWhile(users, 'active'); 22133 * // => [] 22134 */ 22135 function takeWhile(array, predicate) { 22136 return (array && array.length) 22137 ? baseWhile(array, getIteratee(predicate, 3)) 22138 : []; 22139 } 22140 22141 /** 22142 * Creates an array of unique values, in order, from all given arrays using 22143 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 22144 * for equality comparisons. 22145 * 22146 * @static 22147 * @memberOf _ 22148 * @since 0.1.0 22149 * @category Array 22150 * @param {...Array} [arrays] The arrays to inspect. 22151 * @returns {Array} Returns the new array of combined values. 22152 * @example 22153 * 22154 * _.union([2], [1, 2]); 22155 * // => [2, 1] 22156 */ 22157 var union = baseRest(function(arrays) { 22158 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 22159 }); 22160 22161 /** 22162 * This method is like `_.union` except that it accepts `iteratee` which is 22163 * invoked for each element of each `arrays` to generate the criterion by 22164 * which uniqueness is computed. Result values are chosen from the first 22165 * array in which the value occurs. The iteratee is invoked with one argument: 22166 * (value). 22167 * 22168 * @static 22169 * @memberOf _ 22170 * @since 4.0.0 22171 * @category Array 22172 * @param {...Array} [arrays] The arrays to inspect. 22173 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22174 * @returns {Array} Returns the new array of combined values. 22175 * @example 22176 * 22177 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 22178 * // => [2.1, 1.2] 22179 * 22180 * // The `_.property` iteratee shorthand. 22181 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 22182 * // => [{ 'x': 1 }, { 'x': 2 }] 22183 */ 22184 var unionBy = baseRest(function(arrays) { 22185 var iteratee = last(arrays); 22186 if (isArrayLikeObject(iteratee)) { 22187 iteratee = undefined; 22188 } 22189 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); 22190 }); 22191 22192 /** 22193 * This method is like `_.union` except that it accepts `comparator` which 22194 * is invoked to compare elements of `arrays`. Result values are chosen from 22195 * the first array in which the value occurs. The comparator is invoked 22196 * with two arguments: (arrVal, othVal). 22197 * 22198 * @static 22199 * @memberOf _ 22200 * @since 4.0.0 22201 * @category Array 22202 * @param {...Array} [arrays] The arrays to inspect. 22203 * @param {Function} [comparator] The comparator invoked per element. 22204 * @returns {Array} Returns the new array of combined values. 22205 * @example 22206 * 22207 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 22208 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 22209 * 22210 * _.unionWith(objects, others, _.isEqual); 22211 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 22212 */ 22213 var unionWith = baseRest(function(arrays) { 22214 var comparator = last(arrays); 22215 comparator = typeof comparator == 'function' ? comparator : undefined; 22216 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); 22217 }); 22218 22219 /** 22220 * Creates a duplicate-free version of an array, using 22221 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 22222 * for equality comparisons, in which only the first occurrence of each element 22223 * is kept. The order of result values is determined by the order they occur 22224 * in the array. 22225 * 22226 * @static 22227 * @memberOf _ 22228 * @since 0.1.0 22229 * @category Array 22230 * @param {Array} array The array to inspect. 22231 * @returns {Array} Returns the new duplicate free array. 22232 * @example 22233 * 22234 * _.uniq([2, 1, 2]); 22235 * // => [2, 1] 22236 */ 22237 function uniq(array) { 22238 return (array && array.length) ? baseUniq(array) : []; 22239 } 22240 22241 /** 22242 * This method is like `_.uniq` except that it accepts `iteratee` which is 22243 * invoked for each element in `array` to generate the criterion by which 22244 * uniqueness is computed. The order of result values is determined by the 22245 * order they occur in the array. The iteratee is invoked with one argument: 22246 * (value). 22247 * 22248 * @static 22249 * @memberOf _ 22250 * @since 4.0.0 22251 * @category Array 22252 * @param {Array} array The array to inspect. 22253 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22254 * @returns {Array} Returns the new duplicate free array. 22255 * @example 22256 * 22257 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 22258 * // => [2.1, 1.2] 22259 * 22260 * // The `_.property` iteratee shorthand. 22261 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 22262 * // => [{ 'x': 1 }, { 'x': 2 }] 22263 */ 22264 function uniqBy(array, iteratee) { 22265 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; 22266 } 22267 22268 /** 22269 * This method is like `_.uniq` except that it accepts `comparator` which 22270 * is invoked to compare elements of `array`. The order of result values is 22271 * determined by the order they occur in the array.The comparator is invoked 22272 * with two arguments: (arrVal, othVal). 22273 * 22274 * @static 22275 * @memberOf _ 22276 * @since 4.0.0 22277 * @category Array 22278 * @param {Array} array The array to inspect. 22279 * @param {Function} [comparator] The comparator invoked per element. 22280 * @returns {Array} Returns the new duplicate free array. 22281 * @example 22282 * 22283 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 22284 * 22285 * _.uniqWith(objects, _.isEqual); 22286 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 22287 */ 22288 function uniqWith(array, comparator) { 22289 comparator = typeof comparator == 'function' ? comparator : undefined; 22290 return (array && array.length) ? baseUniq(array, undefined, comparator) : []; 22291 } 22292 22293 /** 22294 * This method is like `_.zip` except that it accepts an array of grouped 22295 * elements and creates an array regrouping the elements to their pre-zip 22296 * configuration. 22297 * 22298 * @static 22299 * @memberOf _ 22300 * @since 1.2.0 22301 * @category Array 22302 * @param {Array} array The array of grouped elements to process. 22303 * @returns {Array} Returns the new array of regrouped elements. 22304 * @example 22305 * 22306 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 22307 * // => [['a', 1, true], ['b', 2, false]] 22308 * 22309 * _.unzip(zipped); 22310 * // => [['a', 'b'], [1, 2], [true, false]] 22311 */ 22312 function unzip(array) { 22313 if (!(array && array.length)) { 22314 return []; 22315 } 22316 var length = 0; 22317 array = arrayFilter(array, function(group) { 22318 if (isArrayLikeObject(group)) { 22319 length = nativeMax(group.length, length); 22320 return true; 22321 } 22322 }); 22323 return baseTimes(length, function(index) { 22324 return arrayMap(array, baseProperty(index)); 22325 }); 22326 } 22327 22328 /** 22329 * This method is like `_.unzip` except that it accepts `iteratee` to specify 22330 * how regrouped values should be combined. The iteratee is invoked with the 22331 * elements of each group: (...group). 22332 * 22333 * @static 22334 * @memberOf _ 22335 * @since 3.8.0 22336 * @category Array 22337 * @param {Array} array The array of grouped elements to process. 22338 * @param {Function} [iteratee=_.identity] The function to combine 22339 * regrouped values. 22340 * @returns {Array} Returns the new array of regrouped elements. 22341 * @example 22342 * 22343 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 22344 * // => [[1, 10, 100], [2, 20, 200]] 22345 * 22346 * _.unzipWith(zipped, _.add); 22347 * // => [3, 30, 300] 22348 */ 22349 function unzipWith(array, iteratee) { 22350 if (!(array && array.length)) { 22351 return []; 22352 } 22353 var result = unzip(array); 22354 if (iteratee == null) { 22355 return result; 22356 } 22357 return arrayMap(result, function(group) { 22358 return apply(iteratee, undefined, group); 22359 }); 22360 } 22361 22362 /** 22363 * Creates an array excluding all given values using 22364 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 22365 * for equality comparisons. 22366 * 22367 * **Note:** Unlike `_.pull`, this method returns a new array. 22368 * 22369 * @static 22370 * @memberOf _ 22371 * @since 0.1.0 22372 * @category Array 22373 * @param {Array} array The array to inspect. 22374 * @param {...*} [values] The values to exclude. 22375 * @returns {Array} Returns the new array of filtered values. 22376 * @see _.difference, _.xor 22377 * @example 22378 * 22379 * _.without([2, 1, 2, 3], 1, 2); 22380 * // => [3] 22381 */ 22382 var without = baseRest(function(array, values) { 22383 return isArrayLikeObject(array) 22384 ? baseDifference(array, values) 22385 : []; 22386 }); 22387 22388 /** 22389 * Creates an array of unique values that is the 22390 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 22391 * of the given arrays. The order of result values is determined by the order 22392 * they occur in the arrays. 22393 * 22394 * @static 22395 * @memberOf _ 22396 * @since 2.4.0 22397 * @category Array 22398 * @param {...Array} [arrays] The arrays to inspect. 22399 * @returns {Array} Returns the new array of filtered values. 22400 * @see _.difference, _.without 22401 * @example 22402 * 22403 * _.xor([2, 1], [2, 3]); 22404 * // => [1, 3] 22405 */ 22406 var xor = baseRest(function(arrays) { 22407 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 22408 }); 22409 22410 /** 22411 * This method is like `_.xor` except that it accepts `iteratee` which is 22412 * invoked for each element of each `arrays` to generate the criterion by 22413 * which by which they're compared. The order of result values is determined 22414 * by the order they occur in the arrays. The iteratee is invoked with one 22415 * argument: (value). 22416 * 22417 * @static 22418 * @memberOf _ 22419 * @since 4.0.0 22420 * @category Array 22421 * @param {...Array} [arrays] The arrays to inspect. 22422 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22423 * @returns {Array} Returns the new array of filtered values. 22424 * @example 22425 * 22426 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 22427 * // => [1.2, 3.4] 22428 * 22429 * // The `_.property` iteratee shorthand. 22430 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 22431 * // => [{ 'x': 2 }] 22432 */ 22433 var xorBy = baseRest(function(arrays) { 22434 var iteratee = last(arrays); 22435 if (isArrayLikeObject(iteratee)) { 22436 iteratee = undefined; 22437 } 22438 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); 22439 }); 22440 22441 /** 22442 * This method is like `_.xor` except that it accepts `comparator` which is 22443 * invoked to compare elements of `arrays`. The order of result values is 22444 * determined by the order they occur in the arrays. The comparator is invoked 22445 * with two arguments: (arrVal, othVal). 22446 * 22447 * @static 22448 * @memberOf _ 22449 * @since 4.0.0 22450 * @category Array 22451 * @param {...Array} [arrays] The arrays to inspect. 22452 * @param {Function} [comparator] The comparator invoked per element. 22453 * @returns {Array} Returns the new array of filtered values. 22454 * @example 22455 * 22456 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 22457 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 22458 * 22459 * _.xorWith(objects, others, _.isEqual); 22460 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 22461 */ 22462 var xorWith = baseRest(function(arrays) { 22463 var comparator = last(arrays); 22464 comparator = typeof comparator == 'function' ? comparator : undefined; 22465 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); 22466 }); 22467 22468 /** 22469 * Creates an array of grouped elements, the first of which contains the 22470 * first elements of the given arrays, the second of which contains the 22471 * second elements of the given arrays, and so on. 22472 * 22473 * @static 22474 * @memberOf _ 22475 * @since 0.1.0 22476 * @category Array 22477 * @param {...Array} [arrays] The arrays to process. 22478 * @returns {Array} Returns the new array of grouped elements. 22479 * @example 22480 * 22481 * _.zip(['a', 'b'], [1, 2], [true, false]); 22482 * // => [['a', 1, true], ['b', 2, false]] 22483 */ 22484 var zip = baseRest(unzip); 22485 22486 /** 22487 * This method is like `_.fromPairs` except that it accepts two arrays, 22488 * one of property identifiers and one of corresponding values. 22489 * 22490 * @static 22491 * @memberOf _ 22492 * @since 0.4.0 22493 * @category Array 22494 * @param {Array} [props=[]] The property identifiers. 22495 * @param {Array} [values=[]] The property values. 22496 * @returns {Object} Returns the new object. 22497 * @example 22498 * 22499 * _.zipObject(['a', 'b'], [1, 2]); 22500 * // => { 'a': 1, 'b': 2 } 22501 */ 22502 function zipObject(props, values) { 22503 return baseZipObject(props || [], values || [], assignValue); 22504 } 22505 22506 /** 22507 * This method is like `_.zipObject` except that it supports property paths. 22508 * 22509 * @static 22510 * @memberOf _ 22511 * @since 4.1.0 22512 * @category Array 22513 * @param {Array} [props=[]] The property identifiers. 22514 * @param {Array} [values=[]] The property values. 22515 * @returns {Object} Returns the new object. 22516 * @example 22517 * 22518 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 22519 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 22520 */ 22521 function zipObjectDeep(props, values) { 22522 return baseZipObject(props || [], values || [], baseSet); 22523 } 22524 22525 /** 22526 * This method is like `_.zip` except that it accepts `iteratee` to specify 22527 * how grouped values should be combined. The iteratee is invoked with the 22528 * elements of each group: (...group). 22529 * 22530 * @static 22531 * @memberOf _ 22532 * @since 3.8.0 22533 * @category Array 22534 * @param {...Array} [arrays] The arrays to process. 22535 * @param {Function} [iteratee=_.identity] The function to combine 22536 * grouped values. 22537 * @returns {Array} Returns the new array of grouped elements. 22538 * @example 22539 * 22540 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 22541 * return a + b + c; 22542 * }); 22543 * // => [111, 222] 22544 */ 22545 var zipWith = baseRest(function(arrays) { 22546 var length = arrays.length, 22547 iteratee = length > 1 ? arrays[length - 1] : undefined; 22548 22549 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; 22550 return unzipWith(arrays, iteratee); 22551 }); 22552 22553 /*------------------------------------------------------------------------*/ 22554 22555 /** 22556 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 22557 * chain sequences enabled. The result of such sequences must be unwrapped 22558 * with `_#value`. 22559 * 22560 * @static 22561 * @memberOf _ 22562 * @since 1.3.0 22563 * @category Seq 22564 * @param {*} value The value to wrap. 22565 * @returns {Object} Returns the new `lodash` wrapper instance. 22566 * @example 22567 * 22568 * var users = [ 22569 * { 'user': 'barney', 'age': 36 }, 22570 * { 'user': 'fred', 'age': 40 }, 22571 * { 'user': 'pebbles', 'age': 1 } 22572 * ]; 22573 * 22574 * var youngest = _ 22575 * .chain(users) 22576 * .sortBy('age') 22577 * .map(function(o) { 22578 * return o.user + ' is ' + o.age; 22579 * }) 22580 * .head() 22581 * .value(); 22582 * // => 'pebbles is 1' 22583 */ 22584 function chain(value) { 22585 var result = lodash(value); 22586 result.__chain__ = true; 22587 return result; 22588 } 22589 22590 /** 22591 * This method invokes `interceptor` and returns `value`. The interceptor 22592 * is invoked with one argument; (value). The purpose of this method is to 22593 * "tap into" a method chain sequence in order to modify intermediate results. 22594 * 22595 * @static 22596 * @memberOf _ 22597 * @since 0.1.0 22598 * @category Seq 22599 * @param {*} value The value to provide to `interceptor`. 22600 * @param {Function} interceptor The function to invoke. 22601 * @returns {*} Returns `value`. 22602 * @example 22603 * 22604 * _([1, 2, 3]) 22605 * .tap(function(array) { 22606 * // Mutate input array. 22607 * array.pop(); 22608 * }) 22609 * .reverse() 22610 * .value(); 22611 * // => [2, 1] 22612 */ 22613 function tap(value, interceptor) { 22614 interceptor(value); 22615 return value; 22616 } 22617 22618 /** 22619 * This method is like `_.tap` except that it returns the result of `interceptor`. 22620 * The purpose of this method is to "pass thru" values replacing intermediate 22621 * results in a method chain sequence. 22622 * 22623 * @static 22624 * @memberOf _ 22625 * @since 3.0.0 22626 * @category Seq 22627 * @param {*} value The value to provide to `interceptor`. 22628 * @param {Function} interceptor The function to invoke. 22629 * @returns {*} Returns the result of `interceptor`. 22630 * @example 22631 * 22632 * _(' abc ') 22633 * .chain() 22634 * .trim() 22635 * .thru(function(value) { 22636 * return [value]; 22637 * }) 22638 * .value(); 22639 * // => ['abc'] 22640 */ 22641 function thru(value, interceptor) { 22642 return interceptor(value); 22643 } 22644 22645 /** 22646 * This method is the wrapper version of `_.at`. 22647 * 22648 * @name at 22649 * @memberOf _ 22650 * @since 1.0.0 22651 * @category Seq 22652 * @param {...(string|string[])} [paths] The property paths to pick. 22653 * @returns {Object} Returns the new `lodash` wrapper instance. 22654 * @example 22655 * 22656 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 22657 * 22658 * _(object).at(['a[0].b.c', 'a[1]']).value(); 22659 * // => [3, 4] 22660 */ 22661 var wrapperAt = flatRest(function(paths) { 22662 var length = paths.length, 22663 start = length ? paths[0] : 0, 22664 value = this.__wrapped__, 22665 interceptor = function(object) { return baseAt(object, paths); }; 22666 22667 if (length > 1 || this.__actions__.length || 22668 !(value instanceof LazyWrapper) || !isIndex(start)) { 22669 return this.thru(interceptor); 22670 } 22671 value = value.slice(start, +start + (length ? 1 : 0)); 22672 value.__actions__.push({ 22673 'func': thru, 22674 'args': [interceptor], 22675 'thisArg': undefined 22676 }); 22677 return new LodashWrapper(value, this.__chain__).thru(function(array) { 22678 if (length && !array.length) { 22679 array.push(undefined); 22680 } 22681 return array; 22682 }); 22683 }); 22684 22685 /** 22686 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 22687 * 22688 * @name chain 22689 * @memberOf _ 22690 * @since 0.1.0 22691 * @category Seq 22692 * @returns {Object} Returns the new `lodash` wrapper instance. 22693 * @example 22694 * 22695 * var users = [ 22696 * { 'user': 'barney', 'age': 36 }, 22697 * { 'user': 'fred', 'age': 40 } 22698 * ]; 22699 * 22700 * // A sequence without explicit chaining. 22701 * _(users).head(); 22702 * // => { 'user': 'barney', 'age': 36 } 22703 * 22704 * // A sequence with explicit chaining. 22705 * _(users) 22706 * .chain() 22707 * .head() 22708 * .pick('user') 22709 * .value(); 22710 * // => { 'user': 'barney' } 22711 */ 22712 function wrapperChain() { 22713 return chain(this); 22714 } 22715 22716 /** 22717 * Executes the chain sequence and returns the wrapped result. 22718 * 22719 * @name commit 22720 * @memberOf _ 22721 * @since 3.2.0 22722 * @category Seq 22723 * @returns {Object} Returns the new `lodash` wrapper instance. 22724 * @example 22725 * 22726 * var array = [1, 2]; 22727 * var wrapped = _(array).push(3); 22728 * 22729 * console.log(array); 22730 * // => [1, 2] 22731 * 22732 * wrapped = wrapped.commit(); 22733 * console.log(array); 22734 * // => [1, 2, 3] 22735 * 22736 * wrapped.last(); 22737 * // => 3 22738 * 22739 * console.log(array); 22740 * // => [1, 2, 3] 22741 */ 22742 function wrapperCommit() { 22743 return new LodashWrapper(this.value(), this.__chain__); 22744 } 22745 22746 /** 22747 * Gets the next value on a wrapped object following the 22748 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 22749 * 22750 * @name next 22751 * @memberOf _ 22752 * @since 4.0.0 22753 * @category Seq 22754 * @returns {Object} Returns the next iterator value. 22755 * @example 22756 * 22757 * var wrapped = _([1, 2]); 22758 * 22759 * wrapped.next(); 22760 * // => { 'done': false, 'value': 1 } 22761 * 22762 * wrapped.next(); 22763 * // => { 'done': false, 'value': 2 } 22764 * 22765 * wrapped.next(); 22766 * // => { 'done': true, 'value': undefined } 22767 */ 22768 function wrapperNext() { 22769 if (this.__values__ === undefined) { 22770 this.__values__ = toArray(this.value()); 22771 } 22772 var done = this.__index__ >= this.__values__.length, 22773 value = done ? undefined : this.__values__[this.__index__++]; 22774 22775 return { 'done': done, 'value': value }; 22776 } 22777 22778 /** 22779 * Enables the wrapper to be iterable. 22780 * 22781 * @name Symbol.iterator 22782 * @memberOf _ 22783 * @since 4.0.0 22784 * @category Seq 22785 * @returns {Object} Returns the wrapper object. 22786 * @example 22787 * 22788 * var wrapped = _([1, 2]); 22789 * 22790 * wrapped[Symbol.iterator]() === wrapped; 22791 * // => true 22792 * 22793 * Array.from(wrapped); 22794 * // => [1, 2] 22795 */ 22796 function wrapperToIterator() { 22797 return this; 22798 } 22799 22800 /** 22801 * Creates a clone of the chain sequence planting `value` as the wrapped value. 22802 * 22803 * @name plant 22804 * @memberOf _ 22805 * @since 3.2.0 22806 * @category Seq 22807 * @param {*} value The value to plant. 22808 * @returns {Object} Returns the new `lodash` wrapper instance. 22809 * @example 22810 * 22811 * function square(n) { 22812 * return n * n; 22813 * } 22814 * 22815 * var wrapped = _([1, 2]).map(square); 22816 * var other = wrapped.plant([3, 4]); 22817 * 22818 * other.value(); 22819 * // => [9, 16] 22820 * 22821 * wrapped.value(); 22822 * // => [1, 4] 22823 */ 22824 function wrapperPlant(value) { 22825 var result, 22826 parent = this; 22827 22828 while (parent instanceof baseLodash) { 22829 var clone = wrapperClone(parent); 22830 clone.__index__ = 0; 22831 clone.__values__ = undefined; 22832 if (result) { 22833 previous.__wrapped__ = clone; 22834 } else { 22835 result = clone; 22836 } 22837 var previous = clone; 22838 parent = parent.__wrapped__; 22839 } 22840 previous.__wrapped__ = value; 22841 return result; 22842 } 22843 22844 /** 22845 * This method is the wrapper version of `_.reverse`. 22846 * 22847 * **Note:** This method mutates the wrapped array. 22848 * 22849 * @name reverse 22850 * @memberOf _ 22851 * @since 0.1.0 22852 * @category Seq 22853 * @returns {Object} Returns the new `lodash` wrapper instance. 22854 * @example 22855 * 22856 * var array = [1, 2, 3]; 22857 * 22858 * _(array).reverse().value() 22859 * // => [3, 2, 1] 22860 * 22861 * console.log(array); 22862 * // => [3, 2, 1] 22863 */ 22864 function wrapperReverse() { 22865 var value = this.__wrapped__; 22866 if (value instanceof LazyWrapper) { 22867 var wrapped = value; 22868 if (this.__actions__.length) { 22869 wrapped = new LazyWrapper(this); 22870 } 22871 wrapped = wrapped.reverse(); 22872 wrapped.__actions__.push({ 22873 'func': thru, 22874 'args': [reverse], 22875 'thisArg': undefined 22876 }); 22877 return new LodashWrapper(wrapped, this.__chain__); 22878 } 22879 return this.thru(reverse); 22880 } 22881 22882 /** 22883 * Executes the chain sequence to resolve the unwrapped value. 22884 * 22885 * @name value 22886 * @memberOf _ 22887 * @since 0.1.0 22888 * @alias toJSON, valueOf 22889 * @category Seq 22890 * @returns {*} Returns the resolved unwrapped value. 22891 * @example 22892 * 22893 * _([1, 2, 3]).value(); 22894 * // => [1, 2, 3] 22895 */ 22896 function wrapperValue() { 22897 return baseWrapperValue(this.__wrapped__, this.__actions__); 22898 } 22899 22900 /*------------------------------------------------------------------------*/ 22901 22902 /** 22903 * Creates an object composed of keys generated from the results of running 22904 * each element of `collection` thru `iteratee`. The corresponding value of 22905 * each key is the number of times the key was returned by `iteratee`. The 22906 * iteratee is invoked with one argument: (value). 22907 * 22908 * @static 22909 * @memberOf _ 22910 * @since 0.5.0 22911 * @category Collection 22912 * @param {Array|Object} collection The collection to iterate over. 22913 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 22914 * @returns {Object} Returns the composed aggregate object. 22915 * @example 22916 * 22917 * _.countBy([6.1, 4.2, 6.3], Math.floor); 22918 * // => { '4': 1, '6': 2 } 22919 * 22920 * // The `_.property` iteratee shorthand. 22921 * _.countBy(['one', 'two', 'three'], 'length'); 22922 * // => { '3': 2, '5': 1 } 22923 */ 22924 var countBy = createAggregator(function(result, value, key) { 22925 if (hasOwnProperty.call(result, key)) { 22926 ++result[key]; 22927 } else { 22928 baseAssignValue(result, key, 1); 22929 } 22930 }); 22931 22932 /** 22933 * Checks if `predicate` returns truthy for **all** elements of `collection`. 22934 * Iteration is stopped once `predicate` returns falsey. The predicate is 22935 * invoked with three arguments: (value, index|key, collection). 22936 * 22937 * **Note:** This method returns `true` for 22938 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 22939 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 22940 * elements of empty collections. 22941 * 22942 * @static 22943 * @memberOf _ 22944 * @since 0.1.0 22945 * @category Collection 22946 * @param {Array|Object} collection The collection to iterate over. 22947 * @param {Function} [predicate=_.identity] The function invoked per iteration. 22948 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 22949 * @returns {boolean} Returns `true` if all elements pass the predicate check, 22950 * else `false`. 22951 * @example 22952 * 22953 * _.every([true, 1, null, 'yes'], Boolean); 22954 * // => false 22955 * 22956 * var users = [ 22957 * { 'user': 'barney', 'age': 36, 'active': false }, 22958 * { 'user': 'fred', 'age': 40, 'active': false } 22959 * ]; 22960 * 22961 * // The `_.matches` iteratee shorthand. 22962 * _.every(users, { 'user': 'barney', 'active': false }); 22963 * // => false 22964 * 22965 * // The `_.matchesProperty` iteratee shorthand. 22966 * _.every(users, ['active', false]); 22967 * // => true 22968 * 22969 * // The `_.property` iteratee shorthand. 22970 * _.every(users, 'active'); 22971 * // => false 22972 */ 22973 function every(collection, predicate, guard) { 22974 var func = isArray(collection) ? arrayEvery : baseEvery; 22975 if (guard && isIterateeCall(collection, predicate, guard)) { 22976 predicate = undefined; 22977 } 22978 return func(collection, getIteratee(predicate, 3)); 22979 } 22980 22981 /** 22982 * Iterates over elements of `collection`, returning an array of all elements 22983 * `predicate` returns truthy for. The predicate is invoked with three 22984 * arguments: (value, index|key, collection). 22985 * 22986 * **Note:** Unlike `_.remove`, this method returns a new array. 22987 * 22988 * @static 22989 * @memberOf _ 22990 * @since 0.1.0 22991 * @category Collection 22992 * @param {Array|Object} collection The collection to iterate over. 22993 * @param {Function} [predicate=_.identity] The function invoked per iteration. 22994 * @returns {Array} Returns the new filtered array. 22995 * @see _.reject 22996 * @example 22997 * 22998 * var users = [ 22999 * { 'user': 'barney', 'age': 36, 'active': true }, 23000 * { 'user': 'fred', 'age': 40, 'active': false } 23001 * ]; 23002 * 23003 * _.filter(users, function(o) { return !o.active; }); 23004 * // => objects for ['fred'] 23005 * 23006 * // The `_.matches` iteratee shorthand. 23007 * _.filter(users, { 'age': 36, 'active': true }); 23008 * // => objects for ['barney'] 23009 * 23010 * // The `_.matchesProperty` iteratee shorthand. 23011 * _.filter(users, ['active', false]); 23012 * // => objects for ['fred'] 23013 * 23014 * // The `_.property` iteratee shorthand. 23015 * _.filter(users, 'active'); 23016 * // => objects for ['barney'] 23017 * 23018 * // Combining several predicates using `_.overEvery` or `_.overSome`. 23019 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 23020 * // => objects for ['fred', 'barney'] 23021 */ 23022 function filter(collection, predicate) { 23023 var func = isArray(collection) ? arrayFilter : baseFilter; 23024 return func(collection, getIteratee(predicate, 3)); 23025 } 23026 23027 /** 23028 * Iterates over elements of `collection`, returning the first element 23029 * `predicate` returns truthy for. The predicate is invoked with three 23030 * arguments: (value, index|key, collection). 23031 * 23032 * @static 23033 * @memberOf _ 23034 * @since 0.1.0 23035 * @category Collection 23036 * @param {Array|Object} collection The collection to inspect. 23037 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23038 * @param {number} [fromIndex=0] The index to search from. 23039 * @returns {*} Returns the matched element, else `undefined`. 23040 * @example 23041 * 23042 * var users = [ 23043 * { 'user': 'barney', 'age': 36, 'active': true }, 23044 * { 'user': 'fred', 'age': 40, 'active': false }, 23045 * { 'user': 'pebbles', 'age': 1, 'active': true } 23046 * ]; 23047 * 23048 * _.find(users, function(o) { return o.age < 40; }); 23049 * // => object for 'barney' 23050 * 23051 * // The `_.matches` iteratee shorthand. 23052 * _.find(users, { 'age': 1, 'active': true }); 23053 * // => object for 'pebbles' 23054 * 23055 * // The `_.matchesProperty` iteratee shorthand. 23056 * _.find(users, ['active', false]); 23057 * // => object for 'fred' 23058 * 23059 * // The `_.property` iteratee shorthand. 23060 * _.find(users, 'active'); 23061 * // => object for 'barney' 23062 */ 23063 var find = createFind(findIndex); 23064 23065 /** 23066 * This method is like `_.find` except that it iterates over elements of 23067 * `collection` from right to left. 23068 * 23069 * @static 23070 * @memberOf _ 23071 * @since 2.0.0 23072 * @category Collection 23073 * @param {Array|Object} collection The collection to inspect. 23074 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23075 * @param {number} [fromIndex=collection.length-1] The index to search from. 23076 * @returns {*} Returns the matched element, else `undefined`. 23077 * @example 23078 * 23079 * _.findLast([1, 2, 3, 4], function(n) { 23080 * return n % 2 == 1; 23081 * }); 23082 * // => 3 23083 */ 23084 var findLast = createFind(findLastIndex); 23085 23086 /** 23087 * Creates a flattened array of values by running each element in `collection` 23088 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 23089 * with three arguments: (value, index|key, collection). 23090 * 23091 * @static 23092 * @memberOf _ 23093 * @since 4.0.0 23094 * @category Collection 23095 * @param {Array|Object} collection The collection to iterate over. 23096 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23097 * @returns {Array} Returns the new flattened array. 23098 * @example 23099 * 23100 * function duplicate(n) { 23101 * return [n, n]; 23102 * } 23103 * 23104 * _.flatMap([1, 2], duplicate); 23105 * // => [1, 1, 2, 2] 23106 */ 23107 function flatMap(collection, iteratee) { 23108 return baseFlatten(map(collection, iteratee), 1); 23109 } 23110 23111 /** 23112 * This method is like `_.flatMap` except that it recursively flattens the 23113 * mapped results. 23114 * 23115 * @static 23116 * @memberOf _ 23117 * @since 4.7.0 23118 * @category Collection 23119 * @param {Array|Object} collection The collection to iterate over. 23120 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23121 * @returns {Array} Returns the new flattened array. 23122 * @example 23123 * 23124 * function duplicate(n) { 23125 * return [[[n, n]]]; 23126 * } 23127 * 23128 * _.flatMapDeep([1, 2], duplicate); 23129 * // => [1, 1, 2, 2] 23130 */ 23131 function flatMapDeep(collection, iteratee) { 23132 return baseFlatten(map(collection, iteratee), INFINITY); 23133 } 23134 23135 /** 23136 * This method is like `_.flatMap` except that it recursively flattens the 23137 * mapped results up to `depth` times. 23138 * 23139 * @static 23140 * @memberOf _ 23141 * @since 4.7.0 23142 * @category Collection 23143 * @param {Array|Object} collection The collection to iterate over. 23144 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23145 * @param {number} [depth=1] The maximum recursion depth. 23146 * @returns {Array} Returns the new flattened array. 23147 * @example 23148 * 23149 * function duplicate(n) { 23150 * return [[[n, n]]]; 23151 * } 23152 * 23153 * _.flatMapDepth([1, 2], duplicate, 2); 23154 * // => [[1, 1], [2, 2]] 23155 */ 23156 function flatMapDepth(collection, iteratee, depth) { 23157 depth = depth === undefined ? 1 : toInteger(depth); 23158 return baseFlatten(map(collection, iteratee), depth); 23159 } 23160 23161 /** 23162 * Iterates over elements of `collection` and invokes `iteratee` for each element. 23163 * The iteratee is invoked with three arguments: (value, index|key, collection). 23164 * Iteratee functions may exit iteration early by explicitly returning `false`. 23165 * 23166 * **Note:** As with other "Collections" methods, objects with a "length" 23167 * property are iterated like arrays. To avoid this behavior use `_.forIn` 23168 * or `_.forOwn` for object iteration. 23169 * 23170 * @static 23171 * @memberOf _ 23172 * @since 0.1.0 23173 * @alias each 23174 * @category Collection 23175 * @param {Array|Object} collection The collection to iterate over. 23176 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23177 * @returns {Array|Object} Returns `collection`. 23178 * @see _.forEachRight 23179 * @example 23180 * 23181 * _.forEach([1, 2], function(value) { 23182 * console.log(value); 23183 * }); 23184 * // => Logs `1` then `2`. 23185 * 23186 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 23187 * console.log(key); 23188 * }); 23189 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 23190 */ 23191 function forEach(collection, iteratee) { 23192 var func = isArray(collection) ? arrayEach : baseEach; 23193 return func(collection, getIteratee(iteratee, 3)); 23194 } 23195 23196 /** 23197 * This method is like `_.forEach` except that it iterates over elements of 23198 * `collection` from right to left. 23199 * 23200 * @static 23201 * @memberOf _ 23202 * @since 2.0.0 23203 * @alias eachRight 23204 * @category Collection 23205 * @param {Array|Object} collection The collection to iterate over. 23206 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23207 * @returns {Array|Object} Returns `collection`. 23208 * @see _.forEach 23209 * @example 23210 * 23211 * _.forEachRight([1, 2], function(value) { 23212 * console.log(value); 23213 * }); 23214 * // => Logs `2` then `1`. 23215 */ 23216 function forEachRight(collection, iteratee) { 23217 var func = isArray(collection) ? arrayEachRight : baseEachRight; 23218 return func(collection, getIteratee(iteratee, 3)); 23219 } 23220 23221 /**
vendor: 4,136 bytes, lines 23222-23329
23222 * Creates an object composed of keys generated from the results of running 23223 * each element of `collection` thru `iteratee`. The order of grouped values 23224 * is determined by the order they occur in `collection`. The corresponding 23225 * value of each key is an array of elements responsible for generating the 23226 * key. The iteratee is invoked with one argument: (value). 23227 * 23228 * @static 23229 * @memberOf _ 23230 * @since 0.1.0 23231 * @category Collection 23232 * @param {Array|Object} collection The collection to iterate over. 23233 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 23234 * @returns {Object} Returns the composed aggregate object. 23235 * @example 23236 * 23237 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 23238 * // => { '4': [4.2], '6': [6.1, 6.3] } 23239 * 23240 * // The `_.property` iteratee shorthand. 23241 * _.groupBy(['one', 'two', 'three'], 'length'); 23242 * // => { '3': ['one', 'two'], '5': ['three'] } 23243 */ 23244 var groupBy = createAggregator(function(result, value, key) { 23245 if (hasOwnProperty.call(result, key)) { 23246 result[key].push(value); 23247 } else { 23248 baseAssignValue(result, key, [value]); 23249 } 23250 }); 23251 23252 /** 23253 * Checks if `value` is in `collection`. If `collection` is a string, it's 23254 * checked for a substring of `value`, otherwise 23255 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 23256 * is used for equality comparisons. If `fromIndex` is negative, it's used as 23257 * the offset from the end of `collection`. 23258 * 23259 * @static 23260 * @memberOf _ 23261 * @since 0.1.0 23262 * @category Collection 23263 * @param {Array|Object|string} collection The collection to inspect. 23264 * @param {*} value The value to search for. 23265 * @param {number} [fromIndex=0] The index to search from. 23266 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 23267 * @returns {boolean} Returns `true` if `value` is found, else `false`. 23268 * @example 23269 * 23270 * _.includes([1, 2, 3], 1); 23271 * // => true 23272 * 23273 * _.includes([1, 2, 3], 1, 2); 23274 * // => false 23275 * 23276 * _.includes({ 'a': 1, 'b': 2 }, 1); 23277 * // => true 23278 * 23279 * _.includes('abcd', 'bc'); 23280 * // => true 23281 */ 23282 function includes(collection, value, fromIndex, guard) { 23283 collection = isArrayLike(collection) ? collection : values(collection); 23284 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; 23285 23286 var length = collection.length; 23287 if (fromIndex < 0) { 23288 fromIndex = nativeMax(length + fromIndex, 0); 23289 } 23290 return isString(collection) 23291 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) 23292 : (!!length && baseIndexOf(collection, value, fromIndex) > -1); 23293 } 23294 23295 /** 23296 * Invokes the method at `path` of each element in `collection`, returning 23297 * an array of the results of each invoked method. Any additional arguments 23298 * are provided to each invoked method. If `path` is a function, it's invoked 23299 * for, and `this` bound to, each element in `collection`. 23300 * 23301 * @static 23302 * @memberOf _ 23303 * @since 4.0.0 23304 * @category Collection 23305 * @param {Array|Object} collection The collection to iterate over. 23306 * @param {Array|Function|string} path The path of the method to invoke or 23307 * the function invoked per iteration. 23308 * @param {...*} [args] The arguments to invoke each method with. 23309 * @returns {Array} Returns the array of results. 23310 * @example 23311 * 23312 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 23313 * // => [[1, 5, 7], [1, 2, 3]] 23314 * 23315 * _.invokeMap([123, 456], String.prototype.split, ''); 23316 * // => [['1', '2', '3'], ['4', '5', '6']] 23317 */ 23318 var invokeMap = baseRest(function(collection, path, args) { 23319 var index = -1, 23320 isFunc = typeof path == 'function', 23321 result = isArrayLike(collection) ? Array(collection.length) : []; 23322 23323 baseEach(collection, function(value) { 23324 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); 23325 }); 23326 return result; 23327 }); 23328 23329 /**
vendor: 68,500 bytes, lines 23330-25444
23330 * Creates an object composed of keys generated from the results of running 23331 * each element of `collection` thru `iteratee`. The corresponding value of 23332 * each key is the last element responsible for generating the key. The 23333 * iteratee is invoked with one argument: (value). 23334 * 23335 * @static 23336 * @memberOf _ 23337 * @since 4.0.0 23338 * @category Collection 23339 * @param {Array|Object} collection The collection to iterate over. 23340 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 23341 * @returns {Object} Returns the composed aggregate object. 23342 * @example 23343 * 23344 * var array = [ 23345 * { 'dir': 'left', 'code': 97 }, 23346 * { 'dir': 'right', 'code': 100 } 23347 * ]; 23348 * 23349 * _.keyBy(array, function(o) { 23350 * return String.fromCharCode(o.code); 23351 * }); 23352 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 23353 * 23354 * _.keyBy(array, 'dir'); 23355 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 23356 */ 23357 var keyBy = createAggregator(function(result, value, key) { 23358 baseAssignValue(result, key, value); 23359 }); 23360 23361 /** 23362 * Creates an array of values by running each element in `collection` thru 23363 * `iteratee`. The iteratee is invoked with three arguments: 23364 * (value, index|key, collection). 23365 * 23366 * Many lodash methods are guarded to work as iteratees for methods like 23367 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 23368 * 23369 * The guarded methods are: 23370 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 23371 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 23372 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 23373 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 23374 * 23375 * @static 23376 * @memberOf _ 23377 * @since 0.1.0 23378 * @category Collection 23379 * @param {Array|Object} collection The collection to iterate over. 23380 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23381 * @returns {Array} Returns the new mapped array. 23382 * @example 23383 * 23384 * function square(n) { 23385 * return n * n; 23386 * } 23387 * 23388 * _.map([4, 8], square); 23389 * // => [16, 64] 23390 * 23391 * _.map({ 'a': 4, 'b': 8 }, square); 23392 * // => [16, 64] (iteration order is not guaranteed) 23393 * 23394 * var users = [ 23395 * { 'user': 'barney' }, 23396 * { 'user': 'fred' } 23397 * ]; 23398 * 23399 * // The `_.property` iteratee shorthand. 23400 * _.map(users, 'user'); 23401 * // => ['barney', 'fred'] 23402 */ 23403 function map(collection, iteratee) { 23404 var func = isArray(collection) ? arrayMap : baseMap; 23405 return func(collection, getIteratee(iteratee, 3)); 23406 } 23407 23408 /** 23409 * This method is like `_.sortBy` except that it allows specifying the sort 23410 * orders of the iteratees to sort by. If `orders` is unspecified, all values 23411 * are sorted in ascending order. Otherwise, specify an order of "desc" for 23412 * descending or "asc" for ascending sort order of corresponding values. 23413 * 23414 * @static 23415 * @memberOf _ 23416 * @since 4.0.0 23417 * @category Collection 23418 * @param {Array|Object} collection The collection to iterate over. 23419 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 23420 * The iteratees to sort by. 23421 * @param {string[]} [orders] The sort orders of `iteratees`. 23422 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 23423 * @returns {Array} Returns the new sorted array. 23424 * @example 23425 * 23426 * var users = [ 23427 * { 'user': 'fred', 'age': 48 }, 23428 * { 'user': 'barney', 'age': 34 }, 23429 * { 'user': 'fred', 'age': 40 }, 23430 * { 'user': 'barney', 'age': 36 } 23431 * ]; 23432 * 23433 * // Sort by `user` in ascending order and by `age` in descending order. 23434 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 23435 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 23436 */ 23437 function orderBy(collection, iteratees, orders, guard) { 23438 if (collection == null) { 23439 return []; 23440 } 23441 if (!isArray(iteratees)) { 23442 iteratees = iteratees == null ? [] : [iteratees]; 23443 } 23444 orders = guard ? undefined : orders; 23445 if (!isArray(orders)) { 23446 orders = orders == null ? [] : [orders]; 23447 } 23448 return baseOrderBy(collection, iteratees, orders); 23449 } 23450 23451 /** 23452 * Creates an array of elements split into two groups, the first of which 23453 * contains elements `predicate` returns truthy for, the second of which 23454 * contains elements `predicate` returns falsey for. The predicate is 23455 * invoked with one argument: (value). 23456 * 23457 * @static 23458 * @memberOf _ 23459 * @since 3.0.0 23460 * @category Collection 23461 * @param {Array|Object} collection The collection to iterate over. 23462 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23463 * @returns {Array} Returns the array of grouped elements. 23464 * @example 23465 * 23466 * var users = [ 23467 * { 'user': 'barney', 'age': 36, 'active': false }, 23468 * { 'user': 'fred', 'age': 40, 'active': true }, 23469 * { 'user': 'pebbles', 'age': 1, 'active': false } 23470 * ]; 23471 * 23472 * _.partition(users, function(o) { return o.active; }); 23473 * // => objects for [['fred'], ['barney', 'pebbles']] 23474 * 23475 * // The `_.matches` iteratee shorthand. 23476 * _.partition(users, { 'age': 1, 'active': false }); 23477 * // => objects for [['pebbles'], ['barney', 'fred']] 23478 * 23479 * // The `_.matchesProperty` iteratee shorthand. 23480 * _.partition(users, ['active', false]); 23481 * // => objects for [['barney', 'pebbles'], ['fred']] 23482 * 23483 * // The `_.property` iteratee shorthand. 23484 * _.partition(users, 'active'); 23485 * // => objects for [['fred'], ['barney', 'pebbles']] 23486 */ 23487 var partition = createAggregator(function(result, value, key) { 23488 result[key ? 0 : 1].push(value); 23489 }, function() { return [[], []]; }); 23490 23491 /** 23492 * Reduces `collection` to a value which is the accumulated result of running 23493 * each element in `collection` thru `iteratee`, where each successive 23494 * invocation is supplied the return value of the previous. If `accumulator` 23495 * is not given, the first element of `collection` is used as the initial 23496 * value. The iteratee is invoked with four arguments: 23497 * (accumulator, value, index|key, collection). 23498 * 23499 * Many lodash methods are guarded to work as iteratees for methods like 23500 * `_.reduce`, `_.reduceRight`, and `_.transform`. 23501 * 23502 * The guarded methods are: 23503 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 23504 * and `sortBy` 23505 * 23506 * @static 23507 * @memberOf _ 23508 * @since 0.1.0 23509 * @category Collection 23510 * @param {Array|Object} collection The collection to iterate over. 23511 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23512 * @param {*} [accumulator] The initial value. 23513 * @returns {*} Returns the accumulated value. 23514 * @see _.reduceRight 23515 * @example 23516 * 23517 * _.reduce([1, 2], function(sum, n) { 23518 * return sum + n; 23519 * }, 0); 23520 * // => 3 23521 * 23522 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 23523 * (result[value] || (result[value] = [])).push(key); 23524 * return result; 23525 * }, {}); 23526 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 23527 */ 23528 function reduce(collection, iteratee, accumulator) { 23529 var func = isArray(collection) ? arrayReduce : baseReduce, 23530 initAccum = arguments.length < 3; 23531 23532 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); 23533 } 23534 23535 /** 23536 * This method is like `_.reduce` except that it iterates over elements of 23537 * `collection` from right to left. 23538 * 23539 * @static 23540 * @memberOf _ 23541 * @since 0.1.0 23542 * @category Collection 23543 * @param {Array|Object} collection The collection to iterate over. 23544 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 23545 * @param {*} [accumulator] The initial value. 23546 * @returns {*} Returns the accumulated value. 23547 * @see _.reduce 23548 * @example 23549 * 23550 * var array = [[0, 1], [2, 3], [4, 5]]; 23551 * 23552 * _.reduceRight(array, function(flattened, other) { 23553 * return flattened.concat(other); 23554 * }, []); 23555 * // => [4, 5, 2, 3, 0, 1] 23556 */ 23557 function reduceRight(collection, iteratee, accumulator) { 23558 var func = isArray(collection) ? arrayReduceRight : baseReduce, 23559 initAccum = arguments.length < 3; 23560 23561 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); 23562 } 23563 23564 /** 23565 * The opposite of `_.filter`; this method returns the elements of `collection` 23566 * that `predicate` does **not** return truthy for. 23567 * 23568 * @static 23569 * @memberOf _ 23570 * @since 0.1.0 23571 * @category Collection 23572 * @param {Array|Object} collection The collection to iterate over. 23573 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23574 * @returns {Array} Returns the new filtered array. 23575 * @see _.filter 23576 * @example 23577 * 23578 * var users = [ 23579 * { 'user': 'barney', 'age': 36, 'active': false }, 23580 * { 'user': 'fred', 'age': 40, 'active': true } 23581 * ]; 23582 * 23583 * _.reject(users, function(o) { return !o.active; }); 23584 * // => objects for ['fred'] 23585 * 23586 * // The `_.matches` iteratee shorthand. 23587 * _.reject(users, { 'age': 40, 'active': true }); 23588 * // => objects for ['barney'] 23589 * 23590 * // The `_.matchesProperty` iteratee shorthand. 23591 * _.reject(users, ['active', false]); 23592 * // => objects for ['fred'] 23593 * 23594 * // The `_.property` iteratee shorthand. 23595 * _.reject(users, 'active'); 23596 * // => objects for ['barney'] 23597 */ 23598 function reject(collection, predicate) { 23599 var func = isArray(collection) ? arrayFilter : baseFilter; 23600 return func(collection, negate(getIteratee(predicate, 3))); 23601 } 23602 23603 /** 23604 * Gets a random element from `collection`. 23605 * 23606 * @static 23607 * @memberOf _ 23608 * @since 2.0.0 23609 * @category Collection 23610 * @param {Array|Object} collection The collection to sample. 23611 * @returns {*} Returns the random element. 23612 * @example 23613 * 23614 * _.sample([1, 2, 3, 4]); 23615 * // => 2 23616 */ 23617 function sample(collection) { 23618 var func = isArray(collection) ? arraySample : baseSample; 23619 return func(collection); 23620 } 23621 23622 /** 23623 * Gets `n` random elements at unique keys from `collection` up to the 23624 * size of `collection`. 23625 * 23626 * @static 23627 * @memberOf _ 23628 * @since 4.0.0 23629 * @category Collection 23630 * @param {Array|Object} collection The collection to sample. 23631 * @param {number} [n=1] The number of elements to sample. 23632 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 23633 * @returns {Array} Returns the random elements. 23634 * @example 23635 * 23636 * _.sampleSize([1, 2, 3], 2); 23637 * // => [3, 1] 23638 * 23639 * _.sampleSize([1, 2, 3], 4); 23640 * // => [2, 3, 1] 23641 */ 23642 function sampleSize(collection, n, guard) { 23643 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { 23644 n = 1; 23645 } else { 23646 n = toInteger(n); 23647 } 23648 var func = isArray(collection) ? arraySampleSize : baseSampleSize; 23649 return func(collection, n); 23650 } 23651 23652 /** 23653 * Creates an array of shuffled values, using a version of the 23654 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 23655 * 23656 * @static 23657 * @memberOf _ 23658 * @since 0.1.0 23659 * @category Collection 23660 * @param {Array|Object} collection The collection to shuffle. 23661 * @returns {Array} Returns the new shuffled array. 23662 * @example 23663 * 23664 * _.shuffle([1, 2, 3, 4]); 23665 * // => [4, 1, 3, 2] 23666 */ 23667 function shuffle(collection) { 23668 var func = isArray(collection) ? arrayShuffle : baseShuffle; 23669 return func(collection); 23670 } 23671 23672 /** 23673 * Gets the size of `collection` by returning its length for array-like 23674 * values or the number of own enumerable string keyed properties for objects. 23675 * 23676 * @static 23677 * @memberOf _ 23678 * @since 0.1.0 23679 * @category Collection 23680 * @param {Array|Object|string} collection The collection to inspect. 23681 * @returns {number} Returns the collection size. 23682 * @example 23683 * 23684 * _.size([1, 2, 3]); 23685 * // => 3 23686 * 23687 * _.size({ 'a': 1, 'b': 2 }); 23688 * // => 2 23689 * 23690 * _.size('pebbles'); 23691 * // => 7 23692 */ 23693 function size(collection) { 23694 if (collection == null) { 23695 return 0; 23696 } 23697 if (isArrayLike(collection)) { 23698 return isString(collection) ? stringSize(collection) : collection.length; 23699 } 23700 var tag = getTag(collection); 23701 if (tag == mapTag || tag == setTag) { 23702 return collection.size; 23703 } 23704 return baseKeys(collection).length; 23705 } 23706 23707 /** 23708 * Checks if `predicate` returns truthy for **any** element of `collection`. 23709 * Iteration is stopped once `predicate` returns truthy. The predicate is 23710 * invoked with three arguments: (value, index|key, collection). 23711 * 23712 * @static 23713 * @memberOf _ 23714 * @since 0.1.0 23715 * @category Collection 23716 * @param {Array|Object} collection The collection to iterate over. 23717 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23718 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 23719 * @returns {boolean} Returns `true` if any element passes the predicate check, 23720 * else `false`. 23721 * @example 23722 * 23723 * _.some([null, 0, 'yes', false], Boolean); 23724 * // => true 23725 * 23726 * var users = [ 23727 * { 'user': 'barney', 'active': true }, 23728 * { 'user': 'fred', 'active': false } 23729 * ]; 23730 * 23731 * // The `_.matches` iteratee shorthand. 23732 * _.some(users, { 'user': 'barney', 'active': false }); 23733 * // => false 23734 * 23735 * // The `_.matchesProperty` iteratee shorthand. 23736 * _.some(users, ['active', false]); 23737 * // => true 23738 * 23739 * // The `_.property` iteratee shorthand. 23740 * _.some(users, 'active'); 23741 * // => true 23742 */ 23743 function some(collection, predicate, guard) { 23744 var func = isArray(collection) ? arraySome : baseSome; 23745 if (guard && isIterateeCall(collection, predicate, guard)) { 23746 predicate = undefined; 23747 } 23748 return func(collection, getIteratee(predicate, 3)); 23749 } 23750 23751 /** 23752 * Creates an array of elements, sorted in ascending order by the results of 23753 * running each element in a collection thru each iteratee. This method 23754 * performs a stable sort, that is, it preserves the original sort order of 23755 * equal elements. The iteratees are invoked with one argument: (value). 23756 * 23757 * @static 23758 * @memberOf _ 23759 * @since 0.1.0 23760 * @category Collection 23761 * @param {Array|Object} collection The collection to iterate over. 23762 * @param {...(Function|Function[])} [iteratees=[_.identity]] 23763 * The iteratees to sort by. 23764 * @returns {Array} Returns the new sorted array. 23765 * @example 23766 * 23767 * var users = [ 23768 * { 'user': 'fred', 'age': 48 }, 23769 * { 'user': 'barney', 'age': 36 }, 23770 * { 'user': 'fred', 'age': 30 }, 23771 * { 'user': 'barney', 'age': 34 } 23772 * ]; 23773 * 23774 * _.sortBy(users, [function(o) { return o.user; }]); 23775 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 23776 * 23777 * _.sortBy(users, ['user', 'age']); 23778 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 23779 */ 23780 var sortBy = baseRest(function(collection, iteratees) { 23781 if (collection == null) { 23782 return []; 23783 } 23784 var length = iteratees.length; 23785 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 23786 iteratees = []; 23787 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 23788 iteratees = [iteratees[0]]; 23789 } 23790 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 23791 }); 23792 23793 /*------------------------------------------------------------------------*/ 23794 23795 /** 23796 * Gets the timestamp of the number of milliseconds that have elapsed since 23797 * the Unix epoch (1 January 1970 00:00:00 UTC). 23798 * 23799 * @static 23800 * @memberOf _ 23801 * @since 2.4.0 23802 * @category Date 23803 * @returns {number} Returns the timestamp. 23804 * @example 23805 * 23806 * _.defer(function(stamp) { 23807 * console.log(_.now() - stamp); 23808 * }, _.now()); 23809 * // => Logs the number of milliseconds it took for the deferred invocation. 23810 */ 23811 var now = ctxNow || function() { 23812 return root.Date.now(); 23813 }; 23814 23815 /*------------------------------------------------------------------------*/ 23816 23817 /** 23818 * The opposite of `_.before`; this method creates a function that invokes 23819 * `func` once it's called `n` or more times. 23820 * 23821 * @static 23822 * @memberOf _ 23823 * @since 0.1.0 23824 * @category Function 23825 * @param {number} n The number of calls before `func` is invoked. 23826 * @param {Function} func The function to restrict. 23827 * @returns {Function} Returns the new restricted function. 23828 * @example 23829 * 23830 * var saves = ['profile', 'settings']; 23831 * 23832 * var done = _.after(saves.length, function() { 23833 * console.log('done saving!'); 23834 * }); 23835 * 23836 * _.forEach(saves, function(type) { 23837 * asyncSave({ 'type': type, 'complete': done }); 23838 * }); 23839 * // => Logs 'done saving!' after the two async saves have completed. 23840 */ 23841 function after(n, func) { 23842 if (typeof func != 'function') { 23843 throw new TypeError(FUNC_ERROR_TEXT); 23844 } 23845 n = toInteger(n); 23846 return function() { 23847 if (--n < 1) { 23848 return func.apply(this, arguments); 23849 } 23850 }; 23851 } 23852 23853 /** 23854 * Creates a function that invokes `func`, with up to `n` arguments, 23855 * ignoring any additional arguments. 23856 * 23857 * @static 23858 * @memberOf _ 23859 * @since 3.0.0 23860 * @category Function 23861 * @param {Function} func The function to cap arguments for. 23862 * @param {number} [n=func.length] The arity cap. 23863 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 23864 * @returns {Function} Returns the new capped function. 23865 * @example 23866 * 23867 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 23868 * // => [6, 8, 10] 23869 */ 23870 function ary(func, n, guard) { 23871 n = guard ? undefined : n; 23872 n = (func && n == null) ? func.length : n; 23873 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); 23874 } 23875 23876 /** 23877 * Creates a function that invokes `func`, with the `this` binding and arguments 23878 * of the created function, while it's called less than `n` times. Subsequent 23879 * calls to the created function return the result of the last `func` invocation. 23880 * 23881 * @static 23882 * @memberOf _ 23883 * @since 3.0.0 23884 * @category Function 23885 * @param {number} n The number of calls at which `func` is no longer invoked. 23886 * @param {Function} func The function to restrict. 23887 * @returns {Function} Returns the new restricted function. 23888 * @example 23889 * 23890 * jQuery(element).on('click', _.before(5, addContactToList)); 23891 * // => Allows adding up to 4 contacts to the list. 23892 */ 23893 function before(n, func) { 23894 var result; 23895 if (typeof func != 'function') { 23896 throw new TypeError(FUNC_ERROR_TEXT); 23897 } 23898 n = toInteger(n); 23899 return function() { 23900 if (--n > 0) { 23901 result = func.apply(this, arguments); 23902 } 23903 if (n <= 1) { 23904 func = undefined; 23905 } 23906 return result; 23907 }; 23908 } 23909 23910 /** 23911 * Creates a function that invokes `func` with the `this` binding of `thisArg` 23912 * and `partials` prepended to the arguments it receives. 23913 * 23914 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 23915 * may be used as a placeholder for partially applied arguments. 23916 * 23917 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 23918 * property of bound functions. 23919 * 23920 * @static 23921 * @memberOf _ 23922 * @since 0.1.0 23923 * @category Function 23924 * @param {Function} func The function to bind. 23925 * @param {*} thisArg The `this` binding of `func`. 23926 * @param {...*} [partials] The arguments to be partially applied. 23927 * @returns {Function} Returns the new bound function. 23928 * @example 23929 * 23930 * function greet(greeting, punctuation) { 23931 * return greeting + ' ' + this.user + punctuation; 23932 * } 23933 * 23934 * var object = { 'user': 'fred' }; 23935 * 23936 * var bound = _.bind(greet, object, 'hi'); 23937 * bound('!'); 23938 * // => 'hi fred!' 23939 * 23940 * // Bound with placeholders. 23941 * var bound = _.bind(greet, object, _, '!'); 23942 * bound('hi'); 23943 * // => 'hi fred!' 23944 */ 23945 var bind = baseRest(function(func, thisArg, partials) { 23946 var bitmask = WRAP_BIND_FLAG; 23947 if (partials.length) { 23948 var holders = replaceHolders(partials, getHolder(bind)); 23949 bitmask |= WRAP_PARTIAL_FLAG; 23950 } 23951 return createWrap(func, bitmask, thisArg, partials, holders); 23952 }); 23953 23954 /** 23955 * Creates a function that invokes the method at `object[key]` with `partials` 23956 * prepended to the arguments it receives. 23957 * 23958 * This method differs from `_.bind` by allowing bound functions to reference 23959 * methods that may be redefined or don't yet exist. See 23960 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 23961 * for more details. 23962 * 23963 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 23964 * builds, may be used as a placeholder for partially applied arguments. 23965 * 23966 * @static 23967 * @memberOf _ 23968 * @since 0.10.0 23969 * @category Function 23970 * @param {Object} object The object to invoke the method on. 23971 * @param {string} key The key of the method. 23972 * @param {...*} [partials] The arguments to be partially applied. 23973 * @returns {Function} Returns the new bound function. 23974 * @example 23975 * 23976 * var object = { 23977 * 'user': 'fred', 23978 * 'greet': function(greeting, punctuation) { 23979 * return greeting + ' ' + this.user + punctuation; 23980 * } 23981 * }; 23982 * 23983 * var bound = _.bindKey(object, 'greet', 'hi'); 23984 * bound('!'); 23985 * // => 'hi fred!' 23986 * 23987 * object.greet = function(greeting, punctuation) { 23988 * return greeting + 'ya ' + this.user + punctuation; 23989 * }; 23990 * 23991 * bound('!'); 23992 * // => 'hiya fred!' 23993 * 23994 * // Bound with placeholders. 23995 * var bound = _.bindKey(object, 'greet', _, '!'); 23996 * bound('hi'); 23997 * // => 'hiya fred!' 23998 */ 23999 var bindKey = baseRest(function(object, key, partials) { 24000 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 24001 if (partials.length) { 24002 var holders = replaceHolders(partials, getHolder(bindKey)); 24003 bitmask |= WRAP_PARTIAL_FLAG; 24004 } 24005 return createWrap(key, bitmask, object, partials, holders); 24006 }); 24007 24008 /** 24009 * Creates a function that accepts arguments of `func` and either invokes 24010 * `func` returning its result, if at least `arity` number of arguments have 24011 * been provided, or returns a function that accepts the remaining `func` 24012 * arguments, and so on. The arity of `func` may be specified if `func.length` 24013 * is not sufficient. 24014 * 24015 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 24016 * may be used as a placeholder for provided arguments. 24017 * 24018 * **Note:** This method doesn't set the "length" property of curried functions. 24019 * 24020 * @static 24021 * @memberOf _ 24022 * @since 2.0.0 24023 * @category Function 24024 * @param {Function} func The function to curry. 24025 * @param {number} [arity=func.length] The arity of `func`. 24026 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 24027 * @returns {Function} Returns the new curried function. 24028 * @example 24029 * 24030 * var abc = function(a, b, c) { 24031 * return [a, b, c]; 24032 * }; 24033 * 24034 * var curried = _.curry(abc); 24035 * 24036 * curried(1)(2)(3); 24037 * // => [1, 2, 3] 24038 * 24039 * curried(1, 2)(3); 24040 * // => [1, 2, 3] 24041 * 24042 * curried(1, 2, 3); 24043 * // => [1, 2, 3] 24044 * 24045 * // Curried with placeholders. 24046 * curried(1)(_, 3)(2); 24047 * // => [1, 2, 3] 24048 */ 24049 function curry(func, arity, guard) { 24050 arity = guard ? undefined : arity; 24051 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 24052 result.placeholder = curry.placeholder; 24053 return result; 24054 } 24055 24056 /** 24057 * This method is like `_.curry` except that arguments are applied to `func` 24058 * in the manner of `_.partialRight` instead of `_.partial`. 24059 * 24060 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 24061 * builds, may be used as a placeholder for provided arguments. 24062 * 24063 * **Note:** This method doesn't set the "length" property of curried functions. 24064 * 24065 * @static 24066 * @memberOf _ 24067 * @since 3.0.0 24068 * @category Function 24069 * @param {Function} func The function to curry. 24070 * @param {number} [arity=func.length] The arity of `func`. 24071 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 24072 * @returns {Function} Returns the new curried function. 24073 * @example 24074 * 24075 * var abc = function(a, b, c) { 24076 * return [a, b, c]; 24077 * }; 24078 * 24079 * var curried = _.curryRight(abc); 24080 * 24081 * curried(3)(2)(1); 24082 * // => [1, 2, 3] 24083 * 24084 * curried(2, 3)(1); 24085 * // => [1, 2, 3] 24086 * 24087 * curried(1, 2, 3); 24088 * // => [1, 2, 3] 24089 * 24090 * // Curried with placeholders. 24091 * curried(3)(1, _)(2); 24092 * // => [1, 2, 3] 24093 */ 24094 function curryRight(func, arity, guard) { 24095 arity = guard ? undefined : arity; 24096 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 24097 result.placeholder = curryRight.placeholder; 24098 return result; 24099 } 24100 24101 /** 24102 * Creates a debounced function that delays invoking `func` until after `wait` 24103 * milliseconds have elapsed since the last time the debounced function was 24104 * invoked. The debounced function comes with a `cancel` method to cancel 24105 * delayed `func` invocations and a `flush` method to immediately invoke them. 24106 * Provide `options` to indicate whether `func` should be invoked on the 24107 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 24108 * with the last arguments provided to the debounced function. Subsequent 24109 * calls to the debounced function return the result of the last `func` 24110 * invocation. 24111 * 24112 * **Note:** If `leading` and `trailing` options are `true`, `func` is 24113 * invoked on the trailing edge of the timeout only if the debounced function 24114 * is invoked more than once during the `wait` timeout. 24115 * 24116 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 24117 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 24118 * 24119 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 24120 * for details over the differences between `_.debounce` and `_.throttle`. 24121 * 24122 * @static 24123 * @memberOf _ 24124 * @since 0.1.0 24125 * @category Function 24126 * @param {Function} func The function to debounce. 24127 * @param {number} [wait=0] The number of milliseconds to delay. 24128 * @param {Object} [options={}] The options object. 24129 * @param {boolean} [options.leading=false] 24130 * Specify invoking on the leading edge of the timeout. 24131 * @param {number} [options.maxWait] 24132 * The maximum time `func` is allowed to be delayed before it's invoked. 24133 * @param {boolean} [options.trailing=true] 24134 * Specify invoking on the trailing edge of the timeout. 24135 * @returns {Function} Returns the new debounced function. 24136 * @example 24137 * 24138 * // Avoid costly calculations while the window size is in flux. 24139 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 24140 * 24141 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 24142 * jQuery(element).on('click', _.debounce(sendMail, 300, { 24143 * 'leading': true, 24144 * 'trailing': false 24145 * })); 24146 * 24147 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 24148 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 24149 * var source = new EventSource('/stream'); 24150 * jQuery(source).on('message', debounced); 24151 * 24152 * // Cancel the trailing debounced invocation. 24153 * jQuery(window).on('popstate', debounced.cancel); 24154 */ 24155 function debounce(func, wait, options) { 24156 var lastArgs, 24157 lastThis, 24158 maxWait, 24159 result, 24160 timerId, 24161 lastCallTime, 24162 lastInvokeTime = 0, 24163 leading = false, 24164 maxing = false, 24165 trailing = true; 24166 24167 if (typeof func != 'function') { 24168 throw new TypeError(FUNC_ERROR_TEXT); 24169 } 24170 wait = toNumber(wait) || 0; 24171 if (isObject(options)) { 24172 leading = !!options.leading; 24173 maxing = 'maxWait' in options; 24174 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 24175 trailing = 'trailing' in options ? !!options.trailing : trailing; 24176 } 24177 24178 function invokeFunc(time) { 24179 var args = lastArgs, 24180 thisArg = lastThis; 24181 24182 lastArgs = lastThis = undefined; 24183 lastInvokeTime = time; 24184 result = func.apply(thisArg, args); 24185 return result; 24186 } 24187 24188 function leadingEdge(time) { 24189 // Reset any `maxWait` timer. 24190 lastInvokeTime = time; 24191 // Start the timer for the trailing edge. 24192 timerId = setTimeout(timerExpired, wait); 24193 // Invoke the leading edge. 24194 return leading ? invokeFunc(time) : result; 24195 } 24196 24197 function remainingWait(time) { 24198 var timeSinceLastCall = time - lastCallTime, 24199 timeSinceLastInvoke = time - lastInvokeTime, 24200 timeWaiting = wait - timeSinceLastCall; 24201 24202 return maxing 24203 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 24204 : timeWaiting; 24205 } 24206 24207 function shouldInvoke(time) { 24208 var timeSinceLastCall = time - lastCallTime, 24209 timeSinceLastInvoke = time - lastInvokeTime; 24210 24211 // Either this is the first call, activity has stopped and we're at the 24212 // trailing edge, the system time has gone backwards and we're treating 24213 // it as the trailing edge, or we've hit the `maxWait` limit. 24214 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 24215 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 24216 } 24217 24218 function timerExpired() { 24219 var time = now(); 24220 if (shouldInvoke(time)) { 24221 return trailingEdge(time); 24222 } 24223 // Restart the timer. 24224 timerId = setTimeout(timerExpired, remainingWait(time)); 24225 } 24226 24227 function trailingEdge(time) { 24228 timerId = undefined; 24229 24230 // Only invoke if we have `lastArgs` which means `func` has been 24231 // debounced at least once. 24232 if (trailing && lastArgs) { 24233 return invokeFunc(time); 24234 } 24235 lastArgs = lastThis = undefined; 24236 return result; 24237 } 24238 24239 function cancel() { 24240 if (timerId !== undefined) { 24241 clearTimeout(timerId); 24242 } 24243 lastInvokeTime = 0; 24244 lastArgs = lastCallTime = lastThis = timerId = undefined; 24245 } 24246 24247 function flush() { 24248 return timerId === undefined ? result : trailingEdge(now()); 24249 } 24250 24251 function debounced() { 24252 var time = now(), 24253 isInvoking = shouldInvoke(time); 24254 24255 lastArgs = arguments; 24256 lastThis = this; 24257 lastCallTime = time; 24258 24259 if (isInvoking) { 24260 if (timerId === undefined) { 24261 return leadingEdge(lastCallTime); 24262 } 24263 if (maxing) { 24264 // Handle invocations in a tight loop. 24265 clearTimeout(timerId); 24266 timerId = setTimeout(timerExpired, wait); 24267 return invokeFunc(lastCallTime); 24268 } 24269 } 24270 if (timerId === undefined) { 24271 timerId = setTimeout(timerExpired, wait); 24272 } 24273 return result; 24274 } 24275 debounced.cancel = cancel; 24276 debounced.flush = flush; 24277 return debounced; 24278 } 24279 24280 /** 24281 * Defers invoking the `func` until the current call stack has cleared. Any 24282 * additional arguments are provided to `func` when it's invoked. 24283 * 24284 * @static 24285 * @memberOf _ 24286 * @since 0.1.0 24287 * @category Function 24288 * @param {Function} func The function to defer. 24289 * @param {...*} [args] The arguments to invoke `func` with. 24290 * @returns {number} Returns the timer id. 24291 * @example 24292 * 24293 * _.defer(function(text) { 24294 * console.log(text); 24295 * }, 'deferred'); 24296 * // => Logs 'deferred' after one millisecond. 24297 */ 24298 var defer = baseRest(function(func, args) { 24299 return baseDelay(func, 1, args); 24300 }); 24301 24302 /** 24303 * Invokes `func` after `wait` milliseconds. Any additional arguments are 24304 * provided to `func` when it's invoked. 24305 * 24306 * @static 24307 * @memberOf _ 24308 * @since 0.1.0 24309 * @category Function 24310 * @param {Function} func The function to delay. 24311 * @param {number} wait The number of milliseconds to delay invocation. 24312 * @param {...*} [args] The arguments to invoke `func` with. 24313 * @returns {number} Returns the timer id. 24314 * @example 24315 * 24316 * _.delay(function(text) { 24317 * console.log(text); 24318 * }, 1000, 'later'); 24319 * // => Logs 'later' after one second. 24320 */ 24321 var delay = baseRest(function(func, wait, args) { 24322 return baseDelay(func, toNumber(wait) || 0, args); 24323 }); 24324 24325 /** 24326 * Creates a function that invokes `func` with arguments reversed. 24327 * 24328 * @static 24329 * @memberOf _ 24330 * @since 4.0.0 24331 * @category Function 24332 * @param {Function} func The function to flip arguments for. 24333 * @returns {Function} Returns the new flipped function. 24334 * @example 24335 * 24336 * var flipped = _.flip(function() { 24337 * return _.toArray(arguments); 24338 * }); 24339 * 24340 * flipped('a', 'b', 'c', 'd'); 24341 * // => ['d', 'c', 'b', 'a'] 24342 */ 24343 function flip(func) { 24344 return createWrap(func, WRAP_FLIP_FLAG); 24345 } 24346 24347 /** 24348 * Creates a function that memoizes the result of `func`. If `resolver` is 24349 * provided, it determines the cache key for storing the result based on the 24350 * arguments provided to the memoized function. By default, the first argument 24351 * provided to the memoized function is used as the map cache key. The `func` 24352 * is invoked with the `this` binding of the memoized function. 24353 * 24354 * **Note:** The cache is exposed as the `cache` property on the memoized 24355 * function. Its creation may be customized by replacing the `_.memoize.Cache` 24356 * constructor with one whose instances implement the 24357 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 24358 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 24359 * 24360 * @static 24361 * @memberOf _ 24362 * @since 0.1.0 24363 * @category Function 24364 * @param {Function} func The function to have its output memoized. 24365 * @param {Function} [resolver] The function to resolve the cache key. 24366 * @returns {Function} Returns the new memoized function. 24367 * @example 24368 * 24369 * var object = { 'a': 1, 'b': 2 }; 24370 * var other = { 'c': 3, 'd': 4 }; 24371 * 24372 * var values = _.memoize(_.values); 24373 * values(object); 24374 * // => [1, 2] 24375 * 24376 * values(other); 24377 * // => [3, 4] 24378 * 24379 * object.a = 2; 24380 * values(object); 24381 * // => [1, 2] 24382 * 24383 * // Modify the result cache. 24384 * values.cache.set(object, ['a', 'b']); 24385 * values(object); 24386 * // => ['a', 'b'] 24387 * 24388 * // Replace `_.memoize.Cache`. 24389 * _.memoize.Cache = WeakMap; 24390 */ 24391 function memoize(func, resolver) { 24392 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { 24393 throw new TypeError(FUNC_ERROR_TEXT); 24394 } 24395 var memoized = function() { 24396 var args = arguments, 24397 key = resolver ? resolver.apply(this, args) : args[0], 24398 cache = memoized.cache; 24399 24400 if (cache.has(key)) { 24401 return cache.get(key); 24402 } 24403 var result = func.apply(this, args); 24404 memoized.cache = cache.set(key, result) || cache; 24405 return result; 24406 }; 24407 memoized.cache = new (memoize.Cache || MapCache); 24408 return memoized; 24409 } 24410 24411 // Expose `MapCache`. 24412 memoize.Cache = MapCache; 24413 24414 /** 24415 * Creates a function that negates the result of the predicate `func`. The 24416 * `func` predicate is invoked with the `this` binding and arguments of the 24417 * created function. 24418 * 24419 * @static 24420 * @memberOf _ 24421 * @since 3.0.0 24422 * @category Function 24423 * @param {Function} predicate The predicate to negate. 24424 * @returns {Function} Returns the new negated function. 24425 * @example 24426 * 24427 * function isEven(n) { 24428 * return n % 2 == 0; 24429 * } 24430 * 24431 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 24432 * // => [1, 3, 5] 24433 */ 24434 function negate(predicate) { 24435 if (typeof predicate != 'function') { 24436 throw new TypeError(FUNC_ERROR_TEXT); 24437 } 24438 return function() { 24439 var args = arguments; 24440 switch (args.length) { 24441 case 0: return !predicate.call(this); 24442 case 1: return !predicate.call(this, args[0]); 24443 case 2: return !predicate.call(this, args[0], args[1]); 24444 case 3: return !predicate.call(this, args[0], args[1], args[2]); 24445 } 24446 return !predicate.apply(this, args); 24447 }; 24448 } 24449 24450 /** 24451 * Creates a function that is restricted to invoking `func` once. Repeat calls 24452 * to the function return the value of the first invocation. The `func` is 24453 * invoked with the `this` binding and arguments of the created function. 24454 * 24455 * @static 24456 * @memberOf _ 24457 * @since 0.1.0 24458 * @category Function 24459 * @param {Function} func The function to restrict. 24460 * @returns {Function} Returns the new restricted function. 24461 * @example 24462 * 24463 * var initialize = _.once(createApplication); 24464 * initialize(); 24465 * initialize(); 24466 * // => `createApplication` is invoked once 24467 */ 24468 function once(func) { 24469 return before(2, func); 24470 } 24471 24472 /** 24473 * Creates a function that invokes `func` with its arguments transformed. 24474 * 24475 * @static 24476 * @since 4.0.0 24477 * @memberOf _ 24478 * @category Function 24479 * @param {Function} func The function to wrap. 24480 * @param {...(Function|Function[])} [transforms=[_.identity]] 24481 * The argument transforms. 24482 * @returns {Function} Returns the new function. 24483 * @example 24484 * 24485 * function doubled(n) { 24486 * return n * 2; 24487 * } 24488 * 24489 * function square(n) { 24490 * return n * n; 24491 * } 24492 * 24493 * var func = _.overArgs(function(x, y) { 24494 * return [x, y]; 24495 * }, [square, doubled]); 24496 * 24497 * func(9, 3); 24498 * // => [81, 6] 24499 * 24500 * func(10, 5); 24501 * // => [100, 10] 24502 */ 24503 var overArgs = castRest(function(func, transforms) { 24504 transforms = (transforms.length == 1 && isArray(transforms[0])) 24505 ? arrayMap(transforms[0], baseUnary(getIteratee())) 24506 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 24507 24508 var funcsLength = transforms.length; 24509 return baseRest(function(args) { 24510 var index = -1, 24511 length = nativeMin(args.length, funcsLength); 24512 24513 while (++index < length) { 24514 args[index] = transforms[index].call(this, args[index]); 24515 } 24516 return apply(func, this, args); 24517 }); 24518 }); 24519 24520 /** 24521 * Creates a function that invokes `func` with `partials` prepended to the 24522 * arguments it receives. This method is like `_.bind` except it does **not** 24523 * alter the `this` binding. 24524 * 24525 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 24526 * builds, may be used as a placeholder for partially applied arguments. 24527 * 24528 * **Note:** This method doesn't set the "length" property of partially 24529 * applied functions. 24530 * 24531 * @static 24532 * @memberOf _ 24533 * @since 0.2.0 24534 * @category Function 24535 * @param {Function} func The function to partially apply arguments to. 24536 * @param {...*} [partials] The arguments to be partially applied. 24537 * @returns {Function} Returns the new partially applied function. 24538 * @example 24539 * 24540 * function greet(greeting, name) { 24541 * return greeting + ' ' + name; 24542 * } 24543 * 24544 * var sayHelloTo = _.partial(greet, 'hello'); 24545 * sayHelloTo('fred'); 24546 * // => 'hello fred' 24547 * 24548 * // Partially applied with placeholders. 24549 * var greetFred = _.partial(greet, _, 'fred'); 24550 * greetFred('hi'); 24551 * // => 'hi fred' 24552 */ 24553 var partial = baseRest(function(func, partials) { 24554 var holders = replaceHolders(partials, getHolder(partial)); 24555 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); 24556 }); 24557 24558 /** 24559 * This method is like `_.partial` except that partially applied arguments 24560 * are appended to the arguments it receives. 24561 * 24562 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 24563 * builds, may be used as a placeholder for partially applied arguments. 24564 * 24565 * **Note:** This method doesn't set the "length" property of partially 24566 * applied functions. 24567 * 24568 * @static 24569 * @memberOf _ 24570 * @since 1.0.0 24571 * @category Function 24572 * @param {Function} func The function to partially apply arguments to. 24573 * @param {...*} [partials] The arguments to be partially applied. 24574 * @returns {Function} Returns the new partially applied function. 24575 * @example 24576 * 24577 * function greet(greeting, name) { 24578 * return greeting + ' ' + name; 24579 * } 24580 * 24581 * var greetFred = _.partialRight(greet, 'fred'); 24582 * greetFred('hi'); 24583 * // => 'hi fred' 24584 * 24585 * // Partially applied with placeholders. 24586 * var sayHelloTo = _.partialRight(greet, 'hello', _); 24587 * sayHelloTo('fred'); 24588 * // => 'hello fred' 24589 */ 24590 var partialRight = baseRest(function(func, partials) { 24591 var holders = replaceHolders(partials, getHolder(partialRight)); 24592 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); 24593 }); 24594 24595 /** 24596 * Creates a function that invokes `func` with arguments arranged according 24597 * to the specified `indexes` where the argument value at the first index is 24598 * provided as the first argument, the argument value at the second index is 24599 * provided as the second argument, and so on. 24600 * 24601 * @static 24602 * @memberOf _ 24603 * @since 3.0.0 24604 * @category Function 24605 * @param {Function} func The function to rearrange arguments for. 24606 * @param {...(number|number[])} indexes The arranged argument indexes. 24607 * @returns {Function} Returns the new function. 24608 * @example 24609 * 24610 * var rearged = _.rearg(function(a, b, c) { 24611 * return [a, b, c]; 24612 * }, [2, 0, 1]); 24613 * 24614 * rearged('b', 'c', 'a') 24615 * // => ['a', 'b', 'c'] 24616 */ 24617 var rearg = flatRest(function(func, indexes) { 24618 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); 24619 }); 24620 24621 /** 24622 * Creates a function that invokes `func` with the `this` binding of the 24623 * created function and arguments from `start` and beyond provided as 24624 * an array. 24625 * 24626 * **Note:** This method is based on the 24627 * [rest parameter](https://mdn.io/rest_parameters). 24628 * 24629 * @static 24630 * @memberOf _ 24631 * @since 4.0.0 24632 * @category Function 24633 * @param {Function} func The function to apply a rest parameter to. 24634 * @param {number} [start=func.length-1] The start position of the rest parameter. 24635 * @returns {Function} Returns the new function. 24636 * @example 24637 * 24638 * var say = _.rest(function(what, names) { 24639 * return what + ' ' + _.initial(names).join(', ') + 24640 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 24641 * }); 24642 * 24643 * say('hello', 'fred', 'barney', 'pebbles'); 24644 * // => 'hello fred, barney, & pebbles' 24645 */ 24646 function rest(func, start) { 24647 if (typeof func != 'function') { 24648 throw new TypeError(FUNC_ERROR_TEXT); 24649 } 24650 start = start === undefined ? start : toInteger(start); 24651 return baseRest(func, start); 24652 } 24653 24654 /** 24655 * Creates a function that invokes `func` with the `this` binding of the 24656 * create function and an array of arguments much like 24657 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 24658 * 24659 * **Note:** This method is based on the 24660 * [spread operator](https://mdn.io/spread_operator). 24661 * 24662 * @static 24663 * @memberOf _ 24664 * @since 3.2.0 24665 * @category Function 24666 * @param {Function} func The function to spread arguments over. 24667 * @param {number} [start=0] The start position of the spread. 24668 * @returns {Function} Returns the new function. 24669 * @example 24670 * 24671 * var say = _.spread(function(who, what) { 24672 * return who + ' says ' + what; 24673 * }); 24674 * 24675 * say(['fred', 'hello']); 24676 * // => 'fred says hello' 24677 * 24678 * var numbers = Promise.all([ 24679 * Promise.resolve(40), 24680 * Promise.resolve(36) 24681 * ]); 24682 * 24683 * numbers.then(_.spread(function(x, y) { 24684 * return x + y; 24685 * })); 24686 * // => a Promise of 76 24687 */ 24688 function spread(func, start) { 24689 if (typeof func != 'function') { 24690 throw new TypeError(FUNC_ERROR_TEXT); 24691 } 24692 start = start == null ? 0 : nativeMax(toInteger(start), 0); 24693 return baseRest(function(args) { 24694 var array = args[start], 24695 otherArgs = castSlice(args, 0, start); 24696 24697 if (array) { 24698 arrayPush(otherArgs, array); 24699 } 24700 return apply(func, this, otherArgs); 24701 }); 24702 } 24703 24704 /** 24705 * Creates a throttled function that only invokes `func` at most once per 24706 * every `wait` milliseconds. The throttled function comes with a `cancel` 24707 * method to cancel delayed `func` invocations and a `flush` method to 24708 * immediately invoke them. Provide `options` to indicate whether `func` 24709 * should be invoked on the leading and/or trailing edge of the `wait` 24710 * timeout. The `func` is invoked with the last arguments provided to the 24711 * throttled function. Subsequent calls to the throttled function return the 24712 * result of the last `func` invocation. 24713 * 24714 * **Note:** If `leading` and `trailing` options are `true`, `func` is 24715 * invoked on the trailing edge of the timeout only if the throttled function 24716 * is invoked more than once during the `wait` timeout. 24717 * 24718 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 24719 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 24720 * 24721 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 24722 * for details over the differences between `_.throttle` and `_.debounce`. 24723 * 24724 * @static 24725 * @memberOf _ 24726 * @since 0.1.0 24727 * @category Function 24728 * @param {Function} func The function to throttle. 24729 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 24730 * @param {Object} [options={}] The options object. 24731 * @param {boolean} [options.leading=true] 24732 * Specify invoking on the leading edge of the timeout. 24733 * @param {boolean} [options.trailing=true] 24734 * Specify invoking on the trailing edge of the timeout. 24735 * @returns {Function} Returns the new throttled function. 24736 * @example 24737 * 24738 * // Avoid excessively updating the position while scrolling. 24739 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 24740 * 24741 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 24742 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 24743 * jQuery(element).on('click', throttled); 24744 * 24745 * // Cancel the trailing throttled invocation. 24746 * jQuery(window).on('popstate', throttled.cancel); 24747 */ 24748 function throttle(func, wait, options) { 24749 var leading = true, 24750 trailing = true; 24751 24752 if (typeof func != 'function') { 24753 throw new TypeError(FUNC_ERROR_TEXT); 24754 } 24755 if (isObject(options)) { 24756 leading = 'leading' in options ? !!options.leading : leading; 24757 trailing = 'trailing' in options ? !!options.trailing : trailing; 24758 } 24759 return debounce(func, wait, { 24760 'leading': leading, 24761 'maxWait': wait, 24762 'trailing': trailing 24763 }); 24764 } 24765 24766 /** 24767 * Creates a function that accepts up to one argument, ignoring any 24768 * additional arguments. 24769 * 24770 * @static 24771 * @memberOf _ 24772 * @since 4.0.0 24773 * @category Function 24774 * @param {Function} func The function to cap arguments for. 24775 * @returns {Function} Returns the new capped function. 24776 * @example 24777 * 24778 * _.map(['6', '8', '10'], _.unary(parseInt)); 24779 * // => [6, 8, 10] 24780 */ 24781 function unary(func) { 24782 return ary(func, 1); 24783 } 24784 24785 /** 24786 * Creates a function that provides `value` to `wrapper` as its first 24787 * argument. Any additional arguments provided to the function are appended 24788 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 24789 * binding of the created function. 24790 * 24791 * @static 24792 * @memberOf _ 24793 * @since 0.1.0 24794 * @category Function 24795 * @param {*} value The value to wrap. 24796 * @param {Function} [wrapper=identity] The wrapper function. 24797 * @returns {Function} Returns the new function. 24798 * @example 24799 * 24800 * var p = _.wrap(_.escape, function(func, text) { 24801 * return '<p>' + func(text) + '</p>'; 24802 * }); 24803 * 24804 * p('fred, barney, & pebbles'); 24805 * // => '<p>fred, barney, & pebbles</p>' 24806 */ 24807 function wrap(value, wrapper) { 24808 return partial(castFunction(wrapper), value); 24809 } 24810 24811 /*------------------------------------------------------------------------*/ 24812 24813 /** 24814 * Casts `value` as an array if it's not one. 24815 * 24816 * @static 24817 * @memberOf _ 24818 * @since 4.4.0 24819 * @category Lang 24820 * @param {*} value The value to inspect. 24821 * @returns {Array} Returns the cast array. 24822 * @example 24823 * 24824 * _.castArray(1); 24825 * // => [1] 24826 * 24827 * _.castArray({ 'a': 1 }); 24828 * // => [{ 'a': 1 }] 24829 * 24830 * _.castArray('abc'); 24831 * // => ['abc'] 24832 * 24833 * _.castArray(null); 24834 * // => [null] 24835 * 24836 * _.castArray(undefined); 24837 * // => [undefined] 24838 * 24839 * _.castArray(); 24840 * // => [] 24841 * 24842 * var array = [1, 2, 3]; 24843 * console.log(_.castArray(array) === array); 24844 * // => true 24845 */ 24846 function castArray() { 24847 if (!arguments.length) { 24848 return []; 24849 } 24850 var value = arguments[0]; 24851 return isArray(value) ? value : [value]; 24852 } 24853 24854 /** 24855 * Creates a shallow clone of `value`. 24856 * 24857 * **Note:** This method is loosely based on the 24858 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 24859 * and supports cloning arrays, array buffers, booleans, date objects, maps, 24860 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 24861 * arrays. The own enumerable properties of `arguments` objects are cloned 24862 * as plain objects. An empty object is returned for uncloneable values such 24863 * as error objects, functions, DOM nodes, and WeakMaps. 24864 * 24865 * @static 24866 * @memberOf _ 24867 * @since 0.1.0 24868 * @category Lang 24869 * @param {*} value The value to clone. 24870 * @returns {*} Returns the cloned value. 24871 * @see _.cloneDeep 24872 * @example 24873 * 24874 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 24875 * 24876 * var shallow = _.clone(objects); 24877 * console.log(shallow[0] === objects[0]); 24878 * // => true 24879 */ 24880 function clone(value) { 24881 return baseClone(value, CLONE_SYMBOLS_FLAG); 24882 } 24883 24884 /** 24885 * This method is like `_.clone` except that it accepts `customizer` which 24886 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 24887 * cloning is handled by the method instead. The `customizer` is invoked with 24888 * up to four arguments; (value [, index|key, object, stack]). 24889 * 24890 * @static 24891 * @memberOf _ 24892 * @since 4.0.0 24893 * @category Lang 24894 * @param {*} value The value to clone. 24895 * @param {Function} [customizer] The function to customize cloning. 24896 * @returns {*} Returns the cloned value. 24897 * @see _.cloneDeepWith 24898 * @example 24899 * 24900 * function customizer(value) { 24901 * if (_.isElement(value)) { 24902 * return value.cloneNode(false); 24903 * } 24904 * } 24905 * 24906 * var el = _.cloneWith(document.body, customizer); 24907 * 24908 * console.log(el === document.body); 24909 * // => false 24910 * console.log(el.nodeName); 24911 * // => 'BODY' 24912 * console.log(el.childNodes.length); 24913 * // => 0 24914 */ 24915 function cloneWith(value, customizer) { 24916 customizer = typeof customizer == 'function' ? customizer : undefined; 24917 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 24918 } 24919 24920 /** 24921 * This method is like `_.clone` except that it recursively clones `value`. 24922 * 24923 * @static 24924 * @memberOf _ 24925 * @since 1.0.0 24926 * @category Lang 24927 * @param {*} value The value to recursively clone. 24928 * @returns {*} Returns the deep cloned value. 24929 * @see _.clone 24930 * @example 24931 * 24932 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 24933 * 24934 * var deep = _.cloneDeep(objects); 24935 * console.log(deep[0] === objects[0]); 24936 * // => false 24937 */ 24938 function cloneDeep(value) { 24939 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 24940 } 24941 24942 /** 24943 * This method is like `_.cloneWith` except that it recursively clones `value`. 24944 * 24945 * @static 24946 * @memberOf _ 24947 * @since 4.0.0 24948 * @category Lang 24949 * @param {*} value The value to recursively clone. 24950 * @param {Function} [customizer] The function to customize cloning. 24951 * @returns {*} Returns the deep cloned value. 24952 * @see _.cloneWith 24953 * @example 24954 * 24955 * function customizer(value) { 24956 * if (_.isElement(value)) { 24957 * return value.cloneNode(true); 24958 * } 24959 * } 24960 * 24961 * var el = _.cloneDeepWith(document.body, customizer); 24962 * 24963 * console.log(el === document.body); 24964 * // => false 24965 * console.log(el.nodeName); 24966 * // => 'BODY' 24967 * console.log(el.childNodes.length); 24968 * // => 20 24969 */ 24970 function cloneDeepWith(value, customizer) { 24971 customizer = typeof customizer == 'function' ? customizer : undefined; 24972 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 24973 } 24974 24975 /** 24976 * Checks if `object` conforms to `source` by invoking the predicate 24977 * properties of `source` with the corresponding property values of `object`. 24978 * 24979 * **Note:** This method is equivalent to `_.conforms` when `source` is 24980 * partially applied. 24981 * 24982 * @static 24983 * @memberOf _ 24984 * @since 4.14.0 24985 * @category Lang 24986 * @param {Object} object The object to inspect. 24987 * @param {Object} source The object of property predicates to conform to. 24988 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 24989 * @example 24990 * 24991 * var object = { 'a': 1, 'b': 2 }; 24992 * 24993 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 24994 * // => true 24995 * 24996 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 24997 * // => false 24998 */ 24999 function conformsTo(object, source) { 25000 return source == null || baseConformsTo(object, source, keys(source)); 25001 } 25002 25003 /** 25004 * Performs a 25005 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 25006 * comparison between two values to determine if they are equivalent. 25007 * 25008 * @static 25009 * @memberOf _ 25010 * @since 4.0.0 25011 * @category Lang 25012 * @param {*} value The value to compare. 25013 * @param {*} other The other value to compare. 25014 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 25015 * @example 25016 * 25017 * var object = { 'a': 1 }; 25018 * var other = { 'a': 1 }; 25019 * 25020 * _.eq(object, object); 25021 * // => true 25022 * 25023 * _.eq(object, other); 25024 * // => false 25025 * 25026 * _.eq('a', 'a'); 25027 * // => true 25028 * 25029 * _.eq('a', Object('a')); 25030 * // => false 25031 * 25032 * _.eq(NaN, NaN); 25033 * // => true 25034 */ 25035 function eq(value, other) { 25036 return value === other || (value !== value && other !== other); 25037 } 25038 25039 /** 25040 * Checks if `value` is greater than `other`. 25041 * 25042 * @static 25043 * @memberOf _ 25044 * @since 3.9.0 25045 * @category Lang 25046 * @param {*} value The value to compare. 25047 * @param {*} other The other value to compare. 25048 * @returns {boolean} Returns `true` if `value` is greater than `other`, 25049 * else `false`. 25050 * @see _.lt 25051 * @example 25052 * 25053 * _.gt(3, 1); 25054 * // => true 25055 * 25056 * _.gt(3, 3); 25057 * // => false 25058 * 25059 * _.gt(1, 3); 25060 * // => false 25061 */ 25062 var gt = createRelationalOperation(baseGt); 25063 25064 /** 25065 * Checks if `value` is greater than or equal to `other`. 25066 * 25067 * @static 25068 * @memberOf _ 25069 * @since 3.9.0 25070 * @category Lang 25071 * @param {*} value The value to compare. 25072 * @param {*} other The other value to compare. 25073 * @returns {boolean} Returns `true` if `value` is greater than or equal to 25074 * `other`, else `false`. 25075 * @see _.lte 25076 * @example 25077 * 25078 * _.gte(3, 1); 25079 * // => true 25080 * 25081 * _.gte(3, 3); 25082 * // => true 25083 * 25084 * _.gte(1, 3); 25085 * // => false 25086 */ 25087 var gte = createRelationalOperation(function(value, other) { 25088 return value >= other; 25089 }); 25090 25091 /** 25092 * Checks if `value` is likely an `arguments` object. 25093 * 25094 * @static 25095 * @memberOf _ 25096 * @since 0.1.0 25097 * @category Lang 25098 * @param {*} value The value to check. 25099 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 25100 * else `false`. 25101 * @example 25102 * 25103 * _.isArguments(function() { return arguments; }()); 25104 * // => true 25105 * 25106 * _.isArguments([1, 2, 3]); 25107 * // => false 25108 */ 25109 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 25110 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 25111 !propertyIsEnumerable.call(value, 'callee'); 25112 }; 25113 25114 /** 25115 * Checks if `value` is classified as an `Array` object. 25116 * 25117 * @static 25118 * @memberOf _ 25119 * @since 0.1.0 25120 * @category Lang 25121 * @param {*} value The value to check. 25122 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 25123 * @example 25124 * 25125 * _.isArray([1, 2, 3]); 25126 * // => true 25127 * 25128 * _.isArray(document.body.children); 25129 * // => false 25130 * 25131 * _.isArray('abc'); 25132 * // => false 25133 * 25134 * _.isArray(_.noop); 25135 * // => false 25136 */ 25137 var isArray = Array.isArray; 25138 25139 /** 25140 * Checks if `value` is classified as an `ArrayBuffer` object. 25141 * 25142 * @static 25143 * @memberOf _ 25144 * @since 4.3.0 25145 * @category Lang 25146 * @param {*} value The value to check. 25147 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 25148 * @example 25149 * 25150 * _.isArrayBuffer(new ArrayBuffer(2)); 25151 * // => true 25152 * 25153 * _.isArrayBuffer(new Array(2)); 25154 * // => false 25155 */ 25156 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 25157 25158 /** 25159 * Checks if `value` is array-like. A value is considered array-like if it's 25160 * not a function and has a `value.length` that's an integer greater than or 25161 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 25162 * 25163 * @static 25164 * @memberOf _ 25165 * @since 4.0.0 25166 * @category Lang 25167 * @param {*} value The value to check. 25168 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 25169 * @example 25170 * 25171 * _.isArrayLike([1, 2, 3]); 25172 * // => true 25173 * 25174 * _.isArrayLike(document.body.children); 25175 * // => true 25176 * 25177 * _.isArrayLike('abc'); 25178 * // => true 25179 * 25180 * _.isArrayLike(_.noop); 25181 * // => false 25182 */ 25183 function isArrayLike(value) { 25184 return value != null && isLength(value.length) && !isFunction(value); 25185 } 25186 25187 /** 25188 * This method is like `_.isArrayLike` except that it also checks if `value` 25189 * is an object. 25190 * 25191 * @static 25192 * @memberOf _ 25193 * @since 4.0.0 25194 * @category Lang 25195 * @param {*} value The value to check. 25196 * @returns {boolean} Returns `true` if `value` is an array-like object, 25197 * else `false`. 25198 * @example 25199 * 25200 * _.isArrayLikeObject([1, 2, 3]); 25201 * // => true 25202 * 25203 * _.isArrayLikeObject(document.body.children); 25204 * // => true 25205 * 25206 * _.isArrayLikeObject('abc'); 25207 * // => false 25208 * 25209 * _.isArrayLikeObject(_.noop); 25210 * // => false 25211 */ 25212 function isArrayLikeObject(value) { 25213 return isObjectLike(value) && isArrayLike(value); 25214 } 25215 25216 /** 25217 * Checks if `value` is classified as a boolean primitive or object. 25218 * 25219 * @static 25220 * @memberOf _ 25221 * @since 0.1.0 25222 * @category Lang 25223 * @param {*} value The value to check. 25224 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 25225 * @example 25226 * 25227 * _.isBoolean(false); 25228 * // => true 25229 * 25230 * _.isBoolean(null); 25231 * // => false 25232 */ 25233 function isBoolean(value) { 25234 return value === true || value === false || 25235 (isObjectLike(value) && baseGetTag(value) == boolTag); 25236 } 25237 25238 /** 25239 * Checks if `value` is a buffer. 25240 * 25241 * @static 25242 * @memberOf _ 25243 * @since 4.3.0 25244 * @category Lang 25245 * @param {*} value The value to check. 25246 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 25247 * @example 25248 * 25249 * _.isBuffer(new Buffer(2)); 25250 * // => true 25251 * 25252 * _.isBuffer(new Uint8Array(2)); 25253 * // => false 25254 */ 25255 var isBuffer = nativeIsBuffer || stubFalse; 25256 25257 /** 25258 * Checks if `value` is classified as a `Date` object. 25259 * 25260 * @static 25261 * @memberOf _ 25262 * @since 0.1.0 25263 * @category Lang 25264 * @param {*} value The value to check. 25265 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 25266 * @example 25267 * 25268 * _.isDate(new Date); 25269 * // => true 25270 * 25271 * _.isDate('Mon April 23 2012'); 25272 * // => false 25273 */ 25274 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 25275 25276 /** 25277 * Checks if `value` is likely a DOM element. 25278 * 25279 * @static 25280 * @memberOf _ 25281 * @since 0.1.0 25282 * @category Lang 25283 * @param {*} value The value to check. 25284 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 25285 * @example 25286 * 25287 * _.isElement(document.body); 25288 * // => true 25289 * 25290 * _.isElement('<body>'); 25291 * // => false 25292 */ 25293 function isElement(value) { 25294 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); 25295 } 25296 25297 /** 25298 * Checks if `value` is an empty object, collection, map, or set. 25299 * 25300 * Objects are considered empty if they have no own enumerable string keyed 25301 * properties. 25302 * 25303 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 25304 * jQuery-like collections are considered empty if they have a `length` of `0`. 25305 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 25306 * 25307 * @static 25308 * @memberOf _ 25309 * @since 0.1.0 25310 * @category Lang 25311 * @param {*} value The value to check. 25312 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 25313 * @example 25314 * 25315 * _.isEmpty(null); 25316 * // => true 25317 * 25318 * _.isEmpty(true); 25319 * // => true 25320 * 25321 * _.isEmpty(1); 25322 * // => true 25323 * 25324 * _.isEmpty([1, 2, 3]); 25325 * // => false 25326 * 25327 * _.isEmpty({ 'a': 1 }); 25328 * // => false 25329 */ 25330 function isEmpty(value) { 25331 if (value == null) { 25332 return true; 25333 } 25334 if (isArrayLike(value) && 25335 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 25336 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 25337 return !value.length; 25338 } 25339 var tag = getTag(value); 25340 if (tag == mapTag || tag == setTag) { 25341 return !value.size; 25342 } 25343 if (isPrototype(value)) { 25344 return !baseKeys(value).length; 25345 } 25346 for (var key in value) { 25347 if (hasOwnProperty.call(value, key)) { 25348 return false; 25349 } 25350 } 25351 return true; 25352 } 25353 25354 /** 25355 * Performs a deep comparison between two values to determine if they are 25356 * equivalent. 25357 * 25358 * **Note:** This method supports comparing arrays, array buffers, booleans, 25359 * date objects, error objects, maps, numbers, `Object` objects, regexes, 25360 * sets, strings, symbols, and typed arrays. `Object` objects are compared 25361 * by their own, not inherited, enumerable properties. Functions and DOM 25362 * nodes are compared by strict equality, i.e. `===`. 25363 * 25364 * @static 25365 * @memberOf _ 25366 * @since 0.1.0 25367 * @category Lang 25368 * @param {*} value The value to compare. 25369 * @param {*} other The other value to compare. 25370 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 25371 * @example 25372 * 25373 * var object = { 'a': 1 }; 25374 * var other = { 'a': 1 }; 25375 * 25376 * _.isEqual(object, other); 25377 * // => true 25378 * 25379 * object === other; 25380 * // => false 25381 */ 25382 function isEqual(value, other) { 25383 return baseIsEqual(value, other); 25384 } 25385 25386 /** 25387 * This method is like `_.isEqual` except that it accepts `customizer` which 25388 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 25389 * are handled by the method instead. The `customizer` is invoked with up to 25390 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 25391 * 25392 * @static 25393 * @memberOf _ 25394 * @since 4.0.0 25395 * @category Lang 25396 * @param {*} value The value to compare. 25397 * @param {*} other The other value to compare. 25398 * @param {Function} [customizer] The function to customize comparisons. 25399 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 25400 * @example 25401 * 25402 * function isGreeting(value) { 25403 * return /^h(?:i|ello)$/.test(value); 25404 * } 25405 * 25406 * function customizer(objValue, othValue) { 25407 * if (isGreeting(objValue) && isGreeting(othValue)) { 25408 * return true; 25409 * } 25410 * } 25411 * 25412 * var array = ['hello', 'goodbye']; 25413 * var other = ['hi', 'goodbye']; 25414 * 25415 * _.isEqualWith(array, other, customizer); 25416 * // => true 25417 */ 25418 function isEqualWith(value, other, customizer) { 25419 customizer = typeof customizer == 'function' ? customizer : undefined; 25420 var result = customizer ? customizer(value, other) : undefined; 25421 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; 25422 } 25423 25424 /** 25425 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 25426 * `SyntaxError`, `TypeError`, or `URIError` object. 25427 * 25428 * @static 25429 * @memberOf _ 25430 * @since 3.0.0 25431 * @category Lang 25432 * @param {*} value The value to check. 25433 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 25434 * @example 25435 * 25436 * _.isError(new Error); 25437 * // => true 25438 * 25439 * _.isError(Error); 25440 * // => false 25441 */ 25442 function isError(value) { 25443 if (!isObjectLike(value)) { 25444 return false;
vendor: 6,607 bytes, lines 25445-25682
25445 } 25446 var tag = baseGetTag(value); 25447 return tag == errorTag || tag == domExcTag || 25448 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); 25449 } 25450 25451 /** 25452 * Checks if `value` is a finite primitive number. 25453 * 25454 * **Note:** This method is based on 25455 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 25456 * 25457 * @static 25458 * @memberOf _ 25459 * @since 0.1.0 25460 * @category Lang 25461 * @param {*} value The value to check. 25462 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 25463 * @example 25464 * 25465 * _.isFinite(3); 25466 * // => true 25467 * 25468 * _.isFinite(Number.MIN_VALUE); 25469 * // => true 25470 * 25471 * _.isFinite(Infinity); 25472 * // => false 25473 * 25474 * _.isFinite('3'); 25475 * // => false 25476 */ 25477 function isFinite(value) { 25478 return typeof value == 'number' && nativeIsFinite(value); 25479 } 25480 25481 /** 25482 * Checks if `value` is classified as a `Function` object. 25483 * 25484 * @static 25485 * @memberOf _ 25486 * @since 0.1.0 25487 * @category Lang 25488 * @param {*} value The value to check. 25489 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 25490 * @example 25491 * 25492 * _.isFunction(_); 25493 * // => true 25494 * 25495 * _.isFunction(/abc/); 25496 * // => false 25497 */ 25498 function isFunction(value) { 25499 if (!isObject(value)) { 25500 return false; 25501 } 25502 // The use of `Object#toString` avoids issues with the `typeof` operator 25503 // in Safari 9 which returns 'object' for typed arrays and other constructors. 25504 var tag = baseGetTag(value); 25505 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 25506 } 25507 25508 /** 25509 * Checks if `value` is an integer. 25510 * 25511 * **Note:** This method is based on 25512 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 25513 * 25514 * @static 25515 * @memberOf _ 25516 * @since 4.0.0 25517 * @category Lang 25518 * @param {*} value The value to check. 25519 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 25520 * @example 25521 * 25522 * _.isInteger(3); 25523 * // => true 25524 * 25525 * _.isInteger(Number.MIN_VALUE); 25526 * // => false 25527 * 25528 * _.isInteger(Infinity); 25529 * // => false 25530 * 25531 * _.isInteger('3'); 25532 * // => false 25533 */ 25534 function isInteger(value) { 25535 return typeof value == 'number' && value == toInteger(value); 25536 } 25537 25538 /** 25539 * Checks if `value` is a valid array-like length. 25540 * 25541 * **Note:** This method is loosely based on 25542 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 25543 * 25544 * @static 25545 * @memberOf _ 25546 * @since 4.0.0 25547 * @category Lang 25548 * @param {*} value The value to check. 25549 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 25550 * @example 25551 * 25552 * _.isLength(3); 25553 * // => true 25554 * 25555 * _.isLength(Number.MIN_VALUE); 25556 * // => false 25557 * 25558 * _.isLength(Infinity); 25559 * // => false 25560 * 25561 * _.isLength('3'); 25562 * // => false 25563 */ 25564 function isLength(value) { 25565 return typeof value == 'number' && 25566 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 25567 } 25568 25569 /** 25570 * Checks if `value` is the 25571 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 25572 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 25573 * 25574 * @static 25575 * @memberOf _ 25576 * @since 0.1.0 25577 * @category Lang 25578 * @param {*} value The value to check. 25579 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 25580 * @example 25581 * 25582 * _.isObject({}); 25583 * // => true 25584 * 25585 * _.isObject([1, 2, 3]); 25586 * // => true 25587 * 25588 * _.isObject(_.noop); 25589 * // => true 25590 * 25591 * _.isObject(null); 25592 * // => false 25593 */ 25594 function isObject(value) { 25595 var type = typeof value; 25596 return value != null && (type == 'object' || type == 'function'); 25597 } 25598 25599 /** 25600 * Checks if `value` is object-like. A value is object-like if it's not `null` 25601 * and has a `typeof` result of "object". 25602 * 25603 * @static 25604 * @memberOf _ 25605 * @since 4.0.0 25606 * @category Lang 25607 * @param {*} value The value to check. 25608 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 25609 * @example 25610 * 25611 * _.isObjectLike({}); 25612 * // => true 25613 * 25614 * _.isObjectLike([1, 2, 3]); 25615 * // => true 25616 * 25617 * _.isObjectLike(_.noop); 25618 * // => false 25619 * 25620 * _.isObjectLike(null); 25621 * // => false 25622 */ 25623 function isObjectLike(value) { 25624 return value != null && typeof value == 'object'; 25625 } 25626 25627 /** 25628 * Checks if `value` is classified as a `Map` object. 25629 * 25630 * @static 25631 * @memberOf _ 25632 * @since 4.3.0 25633 * @category Lang 25634 * @param {*} value The value to check. 25635 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 25636 * @example 25637 * 25638 * _.isMap(new Map); 25639 * // => true 25640 * 25641 * _.isMap(new WeakMap); 25642 * // => false 25643 */ 25644 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 25645 25646 /** 25647 * Performs a partial deep comparison between `object` and `source` to 25648 * determine if `object` contains equivalent property values. 25649 * 25650 * **Note:** This method is equivalent to `_.matches` when `source` is 25651 * partially applied. 25652 * 25653 * Partial comparisons will match empty array and empty object `source` 25654 * values against any array or object value, respectively. See `_.isEqual` 25655 * for a list of supported value comparisons. 25656 * 25657 * @static 25658 * @memberOf _ 25659 * @since 3.0.0 25660 * @category Lang 25661 * @param {Object} object The object to inspect. 25662 * @param {Object} source The object of property values to match. 25663 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 25664 * @example 25665 * 25666 * var object = { 'a': 1, 'b': 2 }; 25667 * 25668 * _.isMatch(object, { 'b': 2 }); 25669 * // => true 25670 * 25671 * _.isMatch(object, { 'b': 1 }); 25672 * // => false 25673 */ 25674 function isMatch(object, source) { 25675 return object === source || baseIsMatch(object, source, getMatchData(source)); 25676 } 25677 25678 /** 25679 * This method is like `_.isMatch` except that it accepts `customizer` which 25680 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 25681 * are handled by the method instead. The `customizer` is invoked with five 25682 * arguments: (objValue, srcValue, index|key, object, source).
vendor: 12,241 bytes, lines 25683-26148
25683 * 25684 * @static 25685 * @memberOf _ 25686 * @since 4.0.0 25687 * @category Lang 25688 * @param {Object} object The object to inspect. 25689 * @param {Object} source The object of property values to match. 25690 * @param {Function} [customizer] The function to customize comparisons. 25691 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 25692 * @example 25693 * 25694 * function isGreeting(value) { 25695 * return /^h(?:i|ello)$/.test(value); 25696 * } 25697 * 25698 * function customizer(objValue, srcValue) { 25699 * if (isGreeting(objValue) && isGreeting(srcValue)) { 25700 * return true; 25701 * } 25702 * } 25703 * 25704 * var object = { 'greeting': 'hello' }; 25705 * var source = { 'greeting': 'hi' }; 25706 * 25707 * _.isMatchWith(object, source, customizer); 25708 * // => true 25709 */ 25710 function isMatchWith(object, source, customizer) { 25711 customizer = typeof customizer == 'function' ? customizer : undefined; 25712 return baseIsMatch(object, source, getMatchData(source), customizer); 25713 } 25714 25715 /** 25716 * Checks if `value` is `NaN`. 25717 * 25718 * **Note:** This method is based on 25719 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 25720 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 25721 * `undefined` and other non-number values. 25722 * 25723 * @static 25724 * @memberOf _ 25725 * @since 0.1.0 25726 * @category Lang 25727 * @param {*} value The value to check. 25728 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 25729 * @example 25730 * 25731 * _.isNaN(NaN); 25732 * // => true 25733 * 25734 * _.isNaN(new Number(NaN)); 25735 * // => true 25736 * 25737 * isNaN(undefined); 25738 * // => true 25739 * 25740 * _.isNaN(undefined); 25741 * // => false 25742 */ 25743 function isNaN(value) { 25744 // An `NaN` primitive is the only value that is not equal to itself. 25745 // Perform the `toStringTag` check first to avoid errors with some 25746 // ActiveX objects in IE. 25747 return isNumber(value) && value != +value; 25748 } 25749 25750 /** 25751 * Checks if `value` is a pristine native function. 25752 * 25753 * **Note:** This method can't reliably detect native functions in the presence 25754 * of the core-js package because core-js circumvents this kind of detection. 25755 * Despite multiple requests, the core-js maintainer has made it clear: any 25756 * attempt to fix the detection will be obstructed. As a result, we're left 25757 * with little choice but to throw an error. Unfortunately, this also affects 25758 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 25759 * which rely on core-js. 25760 * 25761 * @static 25762 * @memberOf _ 25763 * @since 3.0.0 25764 * @category Lang 25765 * @param {*} value The value to check. 25766 * @returns {boolean} Returns `true` if `value` is a native function, 25767 * else `false`. 25768 * @example 25769 * 25770 * _.isNative(Array.prototype.push); 25771 * // => true 25772 * 25773 * _.isNative(_); 25774 * // => false 25775 */ 25776 function isNative(value) { 25777 if (isMaskable(value)) { 25778 throw new Error(CORE_ERROR_TEXT); 25779 } 25780 return baseIsNative(value); 25781 } 25782 25783 /** 25784 * Checks if `value` is `null`. 25785 * 25786 * @static 25787 * @memberOf _ 25788 * @since 0.1.0 25789 * @category Lang 25790 * @param {*} value The value to check. 25791 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 25792 * @example 25793 * 25794 * _.isNull(null); 25795 * // => true 25796 * 25797 * _.isNull(void 0); 25798 * // => false 25799 */ 25800 function isNull(value) { 25801 return value === null; 25802 } 25803 25804 /** 25805 * Checks if `value` is `null` or `undefined`. 25806 * 25807 * @static 25808 * @memberOf _ 25809 * @since 4.0.0 25810 * @category Lang 25811 * @param {*} value The value to check. 25812 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 25813 * @example 25814 * 25815 * _.isNil(null); 25816 * // => true 25817 * 25818 * _.isNil(void 0); 25819 * // => true 25820 * 25821 * _.isNil(NaN); 25822 * // => false 25823 */ 25824 function isNil(value) { 25825 return value == null; 25826 } 25827 25828 /** 25829 * Checks if `value` is classified as a `Number` primitive or object. 25830 * 25831 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 25832 * classified as numbers, use the `_.isFinite` method. 25833 * 25834 * @static 25835 * @memberOf _ 25836 * @since 0.1.0 25837 * @category Lang 25838 * @param {*} value The value to check. 25839 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 25840 * @example 25841 * 25842 * _.isNumber(3); 25843 * // => true 25844 * 25845 * _.isNumber(Number.MIN_VALUE); 25846 * // => true 25847 * 25848 * _.isNumber(Infinity); 25849 * // => true 25850 * 25851 * _.isNumber('3'); 25852 * // => false 25853 */ 25854 function isNumber(value) { 25855 return typeof value == 'number' || 25856 (isObjectLike(value) && baseGetTag(value) == numberTag); 25857 } 25858 25859 /** 25860 * Checks if `value` is a plain object, that is, an object created by the 25861 * `Object` constructor or one with a `[[Prototype]]` of `null`. 25862 * 25863 * @static 25864 * @memberOf _ 25865 * @since 0.8.0 25866 * @category Lang 25867 * @param {*} value The value to check. 25868 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 25869 * @example 25870 * 25871 * function Foo() { 25872 * this.a = 1; 25873 * } 25874 * 25875 * _.isPlainObject(new Foo); 25876 * // => false 25877 * 25878 * _.isPlainObject([1, 2, 3]); 25879 * // => false 25880 * 25881 * _.isPlainObject({ 'x': 0, 'y': 0 }); 25882 * // => true 25883 * 25884 * _.isPlainObject(Object.create(null)); 25885 * // => true 25886 */ 25887 function isPlainObject(value) { 25888 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 25889 return false; 25890 } 25891 var proto = getPrototype(value); 25892 if (proto === null) { 25893 return true; 25894 } 25895 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 25896 return typeof Ctor == 'function' && Ctor instanceof Ctor && 25897 funcToString.call(Ctor) == objectCtorString; 25898 } 25899 25900 /** 25901 * Checks if `value` is classified as a `RegExp` object. 25902 * 25903 * @static 25904 * @memberOf _ 25905 * @since 0.1.0 25906 * @category Lang 25907 * @param {*} value The value to check. 25908 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 25909 * @example 25910 * 25911 * _.isRegExp(/abc/); 25912 * // => true 25913 * 25914 * _.isRegExp('/abc/'); 25915 * // => false 25916 */ 25917 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 25918 25919 /** 25920 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 25921 * double precision number which isn't the result of a rounded unsafe integer. 25922 * 25923 * **Note:** This method is based on 25924 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 25925 * 25926 * @static 25927 * @memberOf _ 25928 * @since 4.0.0 25929 * @category Lang 25930 * @param {*} value The value to check. 25931 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 25932 * @example 25933 * 25934 * _.isSafeInteger(3); 25935 * // => true 25936 * 25937 * _.isSafeInteger(Number.MIN_VALUE); 25938 * // => false 25939 * 25940 * _.isSafeInteger(Infinity); 25941 * // => false 25942 * 25943 * _.isSafeInteger('3'); 25944 * // => false 25945 */ 25946 function isSafeInteger(value) { 25947 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 25948 } 25949 25950 /** 25951 * Checks if `value` is classified as a `Set` object. 25952 * 25953 * @static 25954 * @memberOf _ 25955 * @since 4.3.0 25956 * @category Lang 25957 * @param {*} value The value to check. 25958 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 25959 * @example 25960 * 25961 * _.isSet(new Set); 25962 * // => true 25963 * 25964 * _.isSet(new WeakSet); 25965 * // => false 25966 */ 25967 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 25968 25969 /** 25970 * Checks if `value` is classified as a `String` primitive or object. 25971 * 25972 * @static 25973 * @since 0.1.0 25974 * @memberOf _ 25975 * @category Lang 25976 * @param {*} value The value to check. 25977 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 25978 * @example 25979 * 25980 * _.isString('abc'); 25981 * // => true 25982 * 25983 * _.isString(1); 25984 * // => false 25985 */ 25986 function isString(value) { 25987 return typeof value == 'string' || 25988 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 25989 } 25990 25991 /** 25992 * Checks if `value` is classified as a `Symbol` primitive or object. 25993 * 25994 * @static 25995 * @memberOf _ 25996 * @since 4.0.0 25997 * @category Lang 25998 * @param {*} value The value to check. 25999 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 26000 * @example 26001 * 26002 * _.isSymbol(Symbol.iterator); 26003 * // => true 26004 * 26005 * _.isSymbol('abc'); 26006 * // => false 26007 */ 26008 function isSymbol(value) { 26009 return typeof value == 'symbol' || 26010 (isObjectLike(value) && baseGetTag(value) == symbolTag); 26011 } 26012 26013 /** 26014 * Checks if `value` is classified as a typed array. 26015 * 26016 * @static 26017 * @memberOf _ 26018 * @since 3.0.0 26019 * @category Lang 26020 * @param {*} value The value to check. 26021 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 26022 * @example 26023 * 26024 * _.isTypedArray(new Uint8Array); 26025 * // => true 26026 * 26027 * _.isTypedArray([]); 26028 * // => false 26029 */ 26030 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 26031 26032 /** 26033 * Checks if `value` is `undefined`. 26034 * 26035 * @static 26036 * @since 0.1.0 26037 * @memberOf _ 26038 * @category Lang 26039 * @param {*} value The value to check. 26040 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 26041 * @example 26042 * 26043 * _.isUndefined(void 0); 26044 * // => true 26045 * 26046 * _.isUndefined(null); 26047 * // => false 26048 */ 26049 function isUndefined(value) { 26050 return value === undefined; 26051 } 26052 26053 /** 26054 * Checks if `value` is classified as a `WeakMap` object. 26055 * 26056 * @static 26057 * @memberOf _ 26058 * @since 4.3.0 26059 * @category Lang 26060 * @param {*} value The value to check. 26061 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 26062 * @example 26063 * 26064 * _.isWeakMap(new WeakMap); 26065 * // => true 26066 * 26067 * _.isWeakMap(new Map); 26068 * // => false 26069 */ 26070 function isWeakMap(value) { 26071 return isObjectLike(value) && getTag(value) == weakMapTag; 26072 } 26073 26074 /** 26075 * Checks if `value` is classified as a `WeakSet` object. 26076 * 26077 * @static 26078 * @memberOf _ 26079 * @since 4.3.0 26080 * @category Lang 26081 * @param {*} value The value to check. 26082 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 26083 * @example 26084 * 26085 * _.isWeakSet(new WeakSet); 26086 * // => true 26087 * 26088 * _.isWeakSet(new Set); 26089 * // => false 26090 */ 26091 function isWeakSet(value) { 26092 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 26093 } 26094 26095 /** 26096 * Checks if `value` is less than `other`. 26097 * 26098 * @static 26099 * @memberOf _ 26100 * @since 3.9.0 26101 * @category Lang 26102 * @param {*} value The value to compare. 26103 * @param {*} other The other value to compare. 26104 * @returns {boolean} Returns `true` if `value` is less than `other`, 26105 * else `false`. 26106 * @see _.gt 26107 * @example 26108 * 26109 * _.lt(1, 3); 26110 * // => true 26111 * 26112 * _.lt(3, 3); 26113 * // => false 26114 * 26115 * _.lt(3, 1); 26116 * // => false 26117 */ 26118 var lt = createRelationalOperation(baseLt); 26119 26120 /** 26121 * Checks if `value` is less than or equal to `other`. 26122 * 26123 * @static 26124 * @memberOf _ 26125 * @since 3.9.0 26126 * @category Lang 26127 * @param {*} value The value to compare. 26128 * @param {*} other The other value to compare. 26129 * @returns {boolean} Returns `true` if `value` is less than or equal to 26130 * `other`, else `false`. 26131 * @see _.gte 26132 * @example 26133 * 26134 * _.lte(1, 3); 26135 * // => true 26136 * 26137 * _.lte(3, 3); 26138 * // => true 26139 * 26140 * _.lte(3, 1); 26141 * // => false 26142 */ 26143 var lte = createRelationalOperation(function(value, other) { 26144 return value <= other; 26145 }); 26146 26147 /** 26148 * Converts `value` to an array.
vendor: 11,756 bytes, lines 26149-26578
26149 * 26150 * @static 26151 * @since 0.1.0 26152 * @memberOf _ 26153 * @category Lang 26154 * @param {*} value The value to convert. 26155 * @returns {Array} Returns the converted array. 26156 * @example 26157 * 26158 * _.toArray({ 'a': 1, 'b': 2 }); 26159 * // => [1, 2] 26160 * 26161 * _.toArray('abc'); 26162 * // => ['a', 'b', 'c'] 26163 * 26164 * _.toArray(1); 26165 * // => [] 26166 * 26167 * _.toArray(null); 26168 * // => [] 26169 */ 26170 function toArray(value) { 26171 if (!value) { 26172 return []; 26173 } 26174 if (isArrayLike(value)) { 26175 return isString(value) ? stringToArray(value) : copyArray(value); 26176 } 26177 if (symIterator && value[symIterator]) { 26178 return iteratorToArray(value[symIterator]()); 26179 } 26180 var tag = getTag(value), 26181 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); 26182 26183 return func(value); 26184 } 26185 26186 /** 26187 * Converts `value` to a finite number. 26188 * 26189 * @static 26190 * @memberOf _ 26191 * @since 4.12.0 26192 * @category Lang 26193 * @param {*} value The value to convert. 26194 * @returns {number} Returns the converted number. 26195 * @example 26196 * 26197 * _.toFinite(3.2); 26198 * // => 3.2 26199 * 26200 * _.toFinite(Number.MIN_VALUE); 26201 * // => 5e-324 26202 * 26203 * _.toFinite(Infinity); 26204 * // => 1.7976931348623157e+308 26205 * 26206 * _.toFinite('3.2'); 26207 * // => 3.2 26208 */ 26209 function toFinite(value) { 26210 if (!value) { 26211 return value === 0 ? value : 0; 26212 } 26213 value = toNumber(value); 26214 if (value === INFINITY || value === -INFINITY) { 26215 var sign = (value < 0 ? -1 : 1); 26216 return sign * MAX_INTEGER; 26217 } 26218 return value === value ? value : 0; 26219 } 26220 26221 /** 26222 * Converts `value` to an integer. 26223 * 26224 * **Note:** This method is loosely based on 26225 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 26226 * 26227 * @static 26228 * @memberOf _ 26229 * @since 4.0.0 26230 * @category Lang 26231 * @param {*} value The value to convert. 26232 * @returns {number} Returns the converted integer. 26233 * @example 26234 * 26235 * _.toInteger(3.2); 26236 * // => 3 26237 * 26238 * _.toInteger(Number.MIN_VALUE); 26239 * // => 0 26240 * 26241 * _.toInteger(Infinity); 26242 * // => 1.7976931348623157e+308 26243 * 26244 * _.toInteger('3.2'); 26245 * // => 3 26246 */ 26247 function toInteger(value) { 26248 var result = toFinite(value), 26249 remainder = result % 1; 26250 26251 return result === result ? (remainder ? result - remainder : result) : 0; 26252 } 26253 26254 /** 26255 * Converts `value` to an integer suitable for use as the length of an 26256 * array-like object. 26257 * 26258 * **Note:** This method is based on 26259 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 26260 * 26261 * @static 26262 * @memberOf _ 26263 * @since 4.0.0 26264 * @category Lang 26265 * @param {*} value The value to convert. 26266 * @returns {number} Returns the converted integer. 26267 * @example 26268 * 26269 * _.toLength(3.2); 26270 * // => 3 26271 * 26272 * _.toLength(Number.MIN_VALUE); 26273 * // => 0 26274 * 26275 * _.toLength(Infinity); 26276 * // => 4294967295 26277 * 26278 * _.toLength('3.2'); 26279 * // => 3 26280 */ 26281 function toLength(value) { 26282 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 26283 } 26284 26285 /** 26286 * Converts `value` to a number. 26287 * 26288 * @static 26289 * @memberOf _ 26290 * @since 4.0.0 26291 * @category Lang 26292 * @param {*} value The value to process. 26293 * @returns {number} Returns the number. 26294 * @example 26295 * 26296 * _.toNumber(3.2); 26297 * // => 3.2 26298 * 26299 * _.toNumber(Number.MIN_VALUE); 26300 * // => 5e-324 26301 * 26302 * _.toNumber(Infinity); 26303 * // => Infinity 26304 * 26305 * _.toNumber('3.2'); 26306 * // => 3.2 26307 */ 26308 function toNumber(value) { 26309 if (typeof value == 'number') { 26310 return value; 26311 } 26312 if (isSymbol(value)) { 26313 return NAN; 26314 } 26315 if (isObject(value)) { 26316 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 26317 value = isObject(other) ? (other + '') : other; 26318 } 26319 if (typeof value != 'string') { 26320 return value === 0 ? value : +value; 26321 } 26322 value = baseTrim(value); 26323 var isBinary = reIsBinary.test(value); 26324 return (isBinary || reIsOctal.test(value)) 26325 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 26326 : (reIsBadHex.test(value) ? NAN : +value); 26327 } 26328 26329 /** 26330 * Converts `value` to a plain object flattening inherited enumerable string 26331 * keyed properties of `value` to own properties of the plain object. 26332 * 26333 * @static 26334 * @memberOf _ 26335 * @since 3.0.0 26336 * @category Lang 26337 * @param {*} value The value to convert. 26338 * @returns {Object} Returns the converted plain object. 26339 * @example 26340 * 26341 * function Foo() { 26342 * this.b = 2; 26343 * } 26344 * 26345 * Foo.prototype.c = 3; 26346 * 26347 * _.assign({ 'a': 1 }, new Foo); 26348 * // => { 'a': 1, 'b': 2 } 26349 * 26350 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 26351 * // => { 'a': 1, 'b': 2, 'c': 3 } 26352 */ 26353 function toPlainObject(value) { 26354 return copyObject(value, keysIn(value)); 26355 } 26356 26357 /** 26358 * Converts `value` to a safe integer. A safe integer can be compared and 26359 * represented correctly. 26360 * 26361 * @static 26362 * @memberOf _ 26363 * @since 4.0.0 26364 * @category Lang 26365 * @param {*} value The value to convert. 26366 * @returns {number} Returns the converted integer. 26367 * @example 26368 * 26369 * _.toSafeInteger(3.2); 26370 * // => 3 26371 * 26372 * _.toSafeInteger(Number.MIN_VALUE); 26373 * // => 0 26374 * 26375 * _.toSafeInteger(Infinity); 26376 * // => 9007199254740991 26377 * 26378 * _.toSafeInteger('3.2'); 26379 * // => 3 26380 */ 26381 function toSafeInteger(value) { 26382 return value 26383 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) 26384 : (value === 0 ? value : 0); 26385 } 26386 26387 /** 26388 * Converts `value` to a string. An empty string is returned for `null` 26389 * and `undefined` values. The sign of `-0` is preserved. 26390 * 26391 * @static 26392 * @memberOf _ 26393 * @since 4.0.0 26394 * @category Lang 26395 * @param {*} value The value to convert. 26396 * @returns {string} Returns the converted string. 26397 * @example 26398 * 26399 * _.toString(null); 26400 * // => '' 26401 * 26402 * _.toString(-0); 26403 * // => '-0' 26404 * 26405 * _.toString([1, 2, 3]); 26406 * // => '1,2,3' 26407 */ 26408 function toString(value) { 26409 return value == null ? '' : baseToString(value); 26410 } 26411 26412 /*------------------------------------------------------------------------*/ 26413 26414 /** 26415 * Assigns own enumerable string keyed properties of source objects to the 26416 * destination object. Source objects are applied from left to right. 26417 * Subsequent sources overwrite property assignments of previous sources. 26418 * 26419 * **Note:** This method mutates `object` and is loosely based on 26420 * [`Object.assign`](https://mdn.io/Object/assign). 26421 * 26422 * @static 26423 * @memberOf _ 26424 * @since 0.10.0 26425 * @category Object 26426 * @param {Object} object The destination object. 26427 * @param {...Object} [sources] The source objects. 26428 * @returns {Object} Returns `object`. 26429 * @see _.assignIn 26430 * @example 26431 * 26432 * function Foo() { 26433 * this.a = 1; 26434 * } 26435 * 26436 * function Bar() { 26437 * this.c = 3; 26438 * } 26439 * 26440 * Foo.prototype.b = 2; 26441 * Bar.prototype.d = 4; 26442 * 26443 * _.assign({ 'a': 0 }, new Foo, new Bar); 26444 * // => { 'a': 1, 'c': 3 } 26445 */ 26446 var assign = createAssigner(function(object, source) { 26447 if (isPrototype(source) || isArrayLike(source)) { 26448 copyObject(source, keys(source), object); 26449 return; 26450 } 26451 for (var key in source) { 26452 if (hasOwnProperty.call(source, key)) { 26453 assignValue(object, key, source[key]); 26454 } 26455 } 26456 }); 26457 26458 /** 26459 * This method is like `_.assign` except that it iterates over own and 26460 * inherited source properties. 26461 * 26462 * **Note:** This method mutates `object`. 26463 * 26464 * @static 26465 * @memberOf _ 26466 * @since 4.0.0 26467 * @alias extend 26468 * @category Object 26469 * @param {Object} object The destination object. 26470 * @param {...Object} [sources] The source objects. 26471 * @returns {Object} Returns `object`. 26472 * @see _.assign 26473 * @example 26474 * 26475 * function Foo() { 26476 * this.a = 1; 26477 * } 26478 * 26479 * function Bar() { 26480 * this.c = 3; 26481 * } 26482 * 26483 * Foo.prototype.b = 2; 26484 * Bar.prototype.d = 4; 26485 * 26486 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 26487 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 26488 */ 26489 var assignIn = createAssigner(function(object, source) { 26490 copyObject(source, keysIn(source), object); 26491 }); 26492 26493 /** 26494 * This method is like `_.assignIn` except that it accepts `customizer` 26495 * which is invoked to produce the assigned values. If `customizer` returns 26496 * `undefined`, assignment is handled by the method instead. The `customizer` 26497 * is invoked with five arguments: (objValue, srcValue, key, object, source). 26498 * 26499 * **Note:** This method mutates `object`. 26500 * 26501 * @static 26502 * @memberOf _ 26503 * @since 4.0.0 26504 * @alias extendWith 26505 * @category Object 26506 * @param {Object} object The destination object. 26507 * @param {...Object} sources The source objects. 26508 * @param {Function} [customizer] The function to customize assigned values. 26509 * @returns {Object} Returns `object`. 26510 * @see _.assignWith 26511 * @example 26512 * 26513 * function customizer(objValue, srcValue) { 26514 * return _.isUndefined(objValue) ? srcValue : objValue; 26515 * } 26516 * 26517 * var defaults = _.partialRight(_.assignInWith, customizer); 26518 * 26519 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 26520 * // => { 'a': 1, 'b': 2 } 26521 */ 26522 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 26523 copyObject(source, keysIn(source), object, customizer); 26524 }); 26525 26526 /** 26527 * This method is like `_.assign` except that it accepts `customizer` 26528 * which is invoked to produce the assigned values. If `customizer` returns 26529 * `undefined`, assignment is handled by the method instead. The `customizer` 26530 * is invoked with five arguments: (objValue, srcValue, key, object, source). 26531 * 26532 * **Note:** This method mutates `object`. 26533 * 26534 * @static 26535 * @memberOf _ 26536 * @since 4.0.0 26537 * @category Object 26538 * @param {Object} object The destination object. 26539 * @param {...Object} sources The source objects. 26540 * @param {Function} [customizer] The function to customize assigned values. 26541 * @returns {Object} Returns `object`. 26542 * @see _.assignInWith 26543 * @example 26544 * 26545 * function customizer(objValue, srcValue) { 26546 * return _.isUndefined(objValue) ? srcValue : objValue; 26547 * } 26548 * 26549 * var defaults = _.partialRight(_.assignWith, customizer); 26550 * 26551 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 26552 * // => { 'a': 1, 'b': 2 } 26553 */ 26554 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 26555 copyObject(source, keys(source), object, customizer); 26556 }); 26557 26558 /** 26559 * Creates an array of values corresponding to `paths` of `object`. 26560 * 26561 * @static 26562 * @memberOf _ 26563 * @since 1.0.0 26564 * @category Object 26565 * @param {Object} object The object to iterate over. 26566 * @param {...(string|string[])} [paths] The property paths to pick. 26567 * @returns {Array} Returns the picked values. 26568 * @example 26569 * 26570 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 26571 * 26572 * _.at(object, ['a[0].b.c', 'a[1]']); 26573 * // => [3, 4] 26574 */ 26575 var at = flatRest(baseAt); 26576 26577 /** 26578 * Creates an object that inherits from the `prototype` object. If a
vendor: 13,619 bytes, lines 26579-27043
26579 * `properties` object is given, its own enumerable string keyed properties 26580 * are assigned to the created object. 26581 * 26582 * @static 26583 * @memberOf _ 26584 * @since 2.3.0 26585 * @category Object 26586 * @param {Object} prototype The object to inherit from. 26587 * @param {Object} [properties] The properties to assign to the object. 26588 * @returns {Object} Returns the new object. 26589 * @example 26590 * 26591 * function Shape() { 26592 * this.x = 0; 26593 * this.y = 0; 26594 * } 26595 * 26596 * function Circle() { 26597 * Shape.call(this); 26598 * } 26599 * 26600 * Circle.prototype = _.create(Shape.prototype, { 26601 * 'constructor': Circle 26602 * }); 26603 * 26604 * var circle = new Circle; 26605 * circle instanceof Circle; 26606 * // => true 26607 * 26608 * circle instanceof Shape; 26609 * // => true 26610 */ 26611 function create(prototype, properties) { 26612 var result = baseCreate(prototype); 26613 return properties == null ? result : baseAssign(result, properties); 26614 } 26615 26616 /** 26617 * Assigns own and inherited enumerable string keyed properties of source 26618 * objects to the destination object for all destination properties that 26619 * resolve to `undefined`. Source objects are applied from left to right. 26620 * Once a property is set, additional values of the same property are ignored. 26621 * 26622 * **Note:** This method mutates `object`. 26623 * 26624 * @static 26625 * @since 0.1.0 26626 * @memberOf _ 26627 * @category Object 26628 * @param {Object} object The destination object. 26629 * @param {...Object} [sources] The source objects. 26630 * @returns {Object} Returns `object`. 26631 * @see _.defaultsDeep 26632 * @example 26633 * 26634 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 26635 * // => { 'a': 1, 'b': 2 } 26636 */ 26637 var defaults = baseRest(function(object, sources) { 26638 object = Object(object); 26639 26640 var index = -1; 26641 var length = sources.length; 26642 var guard = length > 2 ? sources[2] : undefined; 26643 26644 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 26645 length = 1; 26646 } 26647 26648 while (++index < length) { 26649 var source = sources[index]; 26650 var props = keysIn(source); 26651 var propsIndex = -1; 26652 var propsLength = props.length; 26653 26654 while (++propsIndex < propsLength) { 26655 var key = props[propsIndex]; 26656 var value = object[key]; 26657 26658 if (value === undefined || 26659 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 26660 object[key] = source[key]; 26661 } 26662 } 26663 } 26664 26665 return object; 26666 }); 26667 26668 /** 26669 * This method is like `_.defaults` except that it recursively assigns 26670 * default properties. 26671 * 26672 * **Note:** This method mutates `object`. 26673 * 26674 * @static 26675 * @memberOf _ 26676 * @since 3.10.0 26677 * @category Object 26678 * @param {Object} object The destination object. 26679 * @param {...Object} [sources] The source objects. 26680 * @returns {Object} Returns `object`. 26681 * @see _.defaults 26682 * @example 26683 * 26684 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 26685 * // => { 'a': { 'b': 2, 'c': 3 } } 26686 */ 26687 var defaultsDeep = baseRest(function(args) { 26688 args.push(undefined, customDefaultsMerge); 26689 return apply(mergeWith, undefined, args); 26690 }); 26691 26692 /** 26693 * This method is like `_.find` except that it returns the key of the first 26694 * element `predicate` returns truthy for instead of the element itself. 26695 * 26696 * @static 26697 * @memberOf _ 26698 * @since 1.1.0 26699 * @category Object 26700 * @param {Object} object The object to inspect. 26701 * @param {Function} [predicate=_.identity] The function invoked per iteration. 26702 * @returns {string|undefined} Returns the key of the matched element, 26703 * else `undefined`. 26704 * @example 26705 * 26706 * var users = { 26707 * 'barney': { 'age': 36, 'active': true }, 26708 * 'fred': { 'age': 40, 'active': false }, 26709 * 'pebbles': { 'age': 1, 'active': true } 26710 * }; 26711 * 26712 * _.findKey(users, function(o) { return o.age < 40; }); 26713 * // => 'barney' (iteration order is not guaranteed) 26714 * 26715 * // The `_.matches` iteratee shorthand. 26716 * _.findKey(users, { 'age': 1, 'active': true }); 26717 * // => 'pebbles' 26718 * 26719 * // The `_.matchesProperty` iteratee shorthand. 26720 * _.findKey(users, ['active', false]); 26721 * // => 'fred' 26722 * 26723 * // The `_.property` iteratee shorthand. 26724 * _.findKey(users, 'active'); 26725 * // => 'barney' 26726 */ 26727 function findKey(object, predicate) { 26728 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 26729 } 26730 26731 /** 26732 * This method is like `_.findKey` except that it iterates over elements of 26733 * a collection in the opposite order. 26734 * 26735 * @static 26736 * @memberOf _ 26737 * @since 2.0.0 26738 * @category Object 26739 * @param {Object} object The object to inspect. 26740 * @param {Function} [predicate=_.identity] The function invoked per iteration. 26741 * @returns {string|undefined} Returns the key of the matched element, 26742 * else `undefined`. 26743 * @example 26744 * 26745 * var users = { 26746 * 'barney': { 'age': 36, 'active': true }, 26747 * 'fred': { 'age': 40, 'active': false }, 26748 * 'pebbles': { 'age': 1, 'active': true } 26749 * }; 26750 * 26751 * _.findLastKey(users, function(o) { return o.age < 40; }); 26752 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 26753 * 26754 * // The `_.matches` iteratee shorthand. 26755 * _.findLastKey(users, { 'age': 36, 'active': true }); 26756 * // => 'barney' 26757 * 26758 * // The `_.matchesProperty` iteratee shorthand. 26759 * _.findLastKey(users, ['active', false]); 26760 * // => 'fred' 26761 * 26762 * // The `_.property` iteratee shorthand. 26763 * _.findLastKey(users, 'active'); 26764 * // => 'pebbles' 26765 */ 26766 function findLastKey(object, predicate) { 26767 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 26768 } 26769 26770 /** 26771 * Iterates over own and inherited enumerable string keyed properties of an 26772 * object and invokes `iteratee` for each property. The iteratee is invoked 26773 * with three arguments: (value, key, object). Iteratee functions may exit 26774 * iteration early by explicitly returning `false`. 26775 * 26776 * @static 26777 * @memberOf _ 26778 * @since 0.3.0 26779 * @category Object 26780 * @param {Object} object The object to iterate over. 26781 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 26782 * @returns {Object} Returns `object`. 26783 * @see _.forInRight 26784 * @example 26785 * 26786 * function Foo() { 26787 * this.a = 1; 26788 * this.b = 2; 26789 * } 26790 * 26791 * Foo.prototype.c = 3; 26792 * 26793 * _.forIn(new Foo, function(value, key) { 26794 * console.log(key); 26795 * }); 26796 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 26797 */ 26798 function forIn(object, iteratee) { 26799 return object == null 26800 ? object 26801 : baseFor(object, getIteratee(iteratee, 3), keysIn); 26802 } 26803 26804 /** 26805 * This method is like `_.forIn` except that it iterates over properties of 26806 * `object` in the opposite order. 26807 * 26808 * @static 26809 * @memberOf _ 26810 * @since 2.0.0 26811 * @category Object 26812 * @param {Object} object The object to iterate over. 26813 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 26814 * @returns {Object} Returns `object`. 26815 * @see _.forIn 26816 * @example 26817 * 26818 * function Foo() { 26819 * this.a = 1; 26820 * this.b = 2; 26821 * } 26822 * 26823 * Foo.prototype.c = 3; 26824 * 26825 * _.forInRight(new Foo, function(value, key) { 26826 * console.log(key); 26827 * }); 26828 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 26829 */ 26830 function forInRight(object, iteratee) { 26831 return object == null 26832 ? object 26833 : baseForRight(object, getIteratee(iteratee, 3), keysIn); 26834 } 26835 26836 /** 26837 * Iterates over own enumerable string keyed properties of an object and 26838 * invokes `iteratee` for each property. The iteratee is invoked with three 26839 * arguments: (value, key, object). Iteratee functions may exit iteration 26840 * early by explicitly returning `false`. 26841 * 26842 * @static 26843 * @memberOf _ 26844 * @since 0.3.0 26845 * @category Object 26846 * @param {Object} object The object to iterate over. 26847 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 26848 * @returns {Object} Returns `object`. 26849 * @see _.forOwnRight 26850 * @example 26851 * 26852 * function Foo() { 26853 * this.a = 1; 26854 * this.b = 2; 26855 * } 26856 * 26857 * Foo.prototype.c = 3; 26858 * 26859 * _.forOwn(new Foo, function(value, key) { 26860 * console.log(key); 26861 * }); 26862 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 26863 */ 26864 function forOwn(object, iteratee) { 26865 return object && baseForOwn(object, getIteratee(iteratee, 3)); 26866 } 26867 26868 /** 26869 * This method is like `_.forOwn` except that it iterates over properties of 26870 * `object` in the opposite order. 26871 * 26872 * @static 26873 * @memberOf _ 26874 * @since 2.0.0 26875 * @category Object 26876 * @param {Object} object The object to iterate over. 26877 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 26878 * @returns {Object} Returns `object`. 26879 * @see _.forOwn 26880 * @example 26881 * 26882 * function Foo() { 26883 * this.a = 1; 26884 * this.b = 2; 26885 * } 26886 * 26887 * Foo.prototype.c = 3; 26888 * 26889 * _.forOwnRight(new Foo, function(value, key) { 26890 * console.log(key); 26891 * }); 26892 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 26893 */ 26894 function forOwnRight(object, iteratee) { 26895 return object && baseForOwnRight(object, getIteratee(iteratee, 3)); 26896 } 26897 26898 /** 26899 * Creates an array of function property names from own enumerable properties 26900 * of `object`. 26901 * 26902 * @static 26903 * @since 0.1.0 26904 * @memberOf _ 26905 * @category Object 26906 * @param {Object} object The object to inspect. 26907 * @returns {Array} Returns the function names. 26908 * @see _.functionsIn 26909 * @example 26910 * 26911 * function Foo() { 26912 * this.a = _.constant('a'); 26913 * this.b = _.constant('b'); 26914 * } 26915 * 26916 * Foo.prototype.c = _.constant('c'); 26917 * 26918 * _.functions(new Foo); 26919 * // => ['a', 'b'] 26920 */ 26921 function functions(object) { 26922 return object == null ? [] : baseFunctions(object, keys(object)); 26923 } 26924 26925 /** 26926 * Creates an array of function property names from own and inherited 26927 * enumerable properties of `object`. 26928 * 26929 * @static 26930 * @memberOf _ 26931 * @since 4.0.0 26932 * @category Object 26933 * @param {Object} object The object to inspect. 26934 * @returns {Array} Returns the function names. 26935 * @see _.functions 26936 * @example 26937 * 26938 * function Foo() { 26939 * this.a = _.constant('a'); 26940 * this.b = _.constant('b'); 26941 * } 26942 * 26943 * Foo.prototype.c = _.constant('c'); 26944 * 26945 * _.functionsIn(new Foo); 26946 * // => ['a', 'b', 'c'] 26947 */ 26948 function functionsIn(object) { 26949 return object == null ? [] : baseFunctions(object, keysIn(object)); 26950 } 26951 26952 /** 26953 * Gets the value at `path` of `object`. If the resolved value is 26954 * `undefined`, the `defaultValue` is returned in its place. 26955 * 26956 * @static 26957 * @memberOf _ 26958 * @since 3.7.0 26959 * @category Object 26960 * @param {Object} object The object to query. 26961 * @param {Array|string} path The path of the property to get. 26962 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 26963 * @returns {*} Returns the resolved value. 26964 * @example 26965 * 26966 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 26967 * 26968 * _.get(object, 'a[0].b.c'); 26969 * // => 3 26970 * 26971 * _.get(object, ['a', '0', 'b', 'c']); 26972 * // => 3 26973 * 26974 * _.get(object, 'a.b.c', 'default'); 26975 * // => 'default' 26976 */ 26977 function get(object, path, defaultValue) { 26978 var result = object == null ? undefined : baseGet(object, path); 26979 return result === undefined ? defaultValue : result; 26980 } 26981 26982 /** 26983 * Checks if `path` is a direct property of `object`. 26984 * 26985 * @static 26986 * @since 0.1.0 26987 * @memberOf _ 26988 * @category Object 26989 * @param {Object} object The object to query. 26990 * @param {Array|string} path The path to check. 26991 * @returns {boolean} Returns `true` if `path` exists, else `false`. 26992 * @example 26993 * 26994 * var object = { 'a': { 'b': 2 } }; 26995 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 26996 * 26997 * _.has(object, 'a'); 26998 * // => true 26999 * 27000 * _.has(object, 'a.b'); 27001 * // => true 27002 * 27003 * _.has(object, ['a', 'b']); 27004 * // => true 27005 * 27006 * _.has(other, 'a'); 27007 * // => false 27008 */ 27009 function has(object, path) { 27010 return object != null && hasPath(object, path, baseHas); 27011 } 27012 27013 /** 27014 * Checks if `path` is a direct or inherited property of `object`. 27015 * 27016 * @static 27017 * @memberOf _ 27018 * @since 4.0.0 27019 * @category Object 27020 * @param {Object} object The object to query. 27021 * @param {Array|string} path The path to check. 27022 * @returns {boolean} Returns `true` if `path` exists, else `false`. 27023 * @example 27024 * 27025 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 27026 * 27027 * _.hasIn(object, 'a'); 27028 * // => true 27029 * 27030 * _.hasIn(object, 'a.b'); 27031 * // => true 27032 * 27033 * _.hasIn(object, ['a', 'b']); 27034 * // => true 27035 * 27036 * _.hasIn(object, 'b'); 27037 * // => false 27038 */ 27039 function hasIn(object, path) { 27040 return object != null && hasPath(object, path, baseHasIn); 27041 } 27042 27043 /**
vendor: 11,848 bytes, lines 27044-27414
27044 * Creates an object composed of the inverted keys and values of `object`. 27045 * If `object` contains duplicate values, subsequent values overwrite 27046 * property assignments of previous values. 27047 * 27048 * @static 27049 * @memberOf _ 27050 * @since 0.7.0 27051 * @category Object 27052 * @param {Object} object The object to invert. 27053 * @returns {Object} Returns the new inverted object. 27054 * @example 27055 * 27056 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 27057 * 27058 * _.invert(object); 27059 * // => { '1': 'c', '2': 'b' } 27060 */ 27061 var invert = createInverter(function(result, value, key) { 27062 if (value != null && 27063 typeof value.toString != 'function') { 27064 value = nativeObjectToString.call(value); 27065 } 27066 27067 result[value] = key; 27068 }, constant(identity)); 27069 27070 /** 27071 * This method is like `_.invert` except that the inverted object is generated 27072 * from the results of running each element of `object` thru `iteratee`. The 27073 * corresponding inverted value of each inverted key is an array of keys 27074 * responsible for generating the inverted value. The iteratee is invoked 27075 * with one argument: (value). 27076 * 27077 * @static 27078 * @memberOf _ 27079 * @since 4.1.0 27080 * @category Object 27081 * @param {Object} object The object to invert. 27082 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 27083 * @returns {Object} Returns the new inverted object. 27084 * @example 27085 * 27086 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 27087 * 27088 * _.invertBy(object); 27089 * // => { '1': ['a', 'c'], '2': ['b'] } 27090 * 27091 * _.invertBy(object, function(value) { 27092 * return 'group' + value; 27093 * }); 27094 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 27095 */ 27096 var invertBy = createInverter(function(result, value, key) { 27097 if (value != null && 27098 typeof value.toString != 'function') { 27099 value = nativeObjectToString.call(value); 27100 } 27101 27102 if (hasOwnProperty.call(result, value)) { 27103 result[value].push(key); 27104 } else { 27105 result[value] = [key]; 27106 } 27107 }, getIteratee); 27108 27109 /** 27110 * Invokes the method at `path` of `object`. 27111 * 27112 * @static 27113 * @memberOf _ 27114 * @since 4.0.0 27115 * @category Object 27116 * @param {Object} object The object to query. 27117 * @param {Array|string} path The path of the method to invoke. 27118 * @param {...*} [args] The arguments to invoke the method with. 27119 * @returns {*} Returns the result of the invoked method. 27120 * @example 27121 * 27122 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 27123 * 27124 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 27125 * // => [2, 3] 27126 */ 27127 var invoke = baseRest(baseInvoke); 27128 27129 /** 27130 * Creates an array of the own enumerable property names of `object`. 27131 * 27132 * **Note:** Non-object values are coerced to objects. See the 27133 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 27134 * for more details. 27135 * 27136 * @static 27137 * @since 0.1.0 27138 * @memberOf _ 27139 * @category Object 27140 * @param {Object} object The object to query. 27141 * @returns {Array} Returns the array of property names. 27142 * @example 27143 * 27144 * function Foo() { 27145 * this.a = 1; 27146 * this.b = 2; 27147 * } 27148 * 27149 * Foo.prototype.c = 3; 27150 * 27151 * _.keys(new Foo); 27152 * // => ['a', 'b'] (iteration order is not guaranteed) 27153 * 27154 * _.keys('hi'); 27155 * // => ['0', '1'] 27156 */ 27157 function keys(object) { 27158 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 27159 } 27160 27161 /** 27162 * Creates an array of the own and inherited enumerable property names of `object`. 27163 * 27164 * **Note:** Non-object values are coerced to objects. 27165 * 27166 * @static 27167 * @memberOf _ 27168 * @since 3.0.0 27169 * @category Object 27170 * @param {Object} object The object to query. 27171 * @returns {Array} Returns the array of property names. 27172 * @example 27173 * 27174 * function Foo() { 27175 * this.a = 1; 27176 * this.b = 2; 27177 * } 27178 * 27179 * Foo.prototype.c = 3; 27180 * 27181 * _.keysIn(new Foo); 27182 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 27183 */ 27184 function keysIn(object) { 27185 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 27186 } 27187 27188 /** 27189 * The opposite of `_.mapValues`; this method creates an object with the 27190 * same values as `object` and keys generated by running each own enumerable 27191 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 27192 * with three arguments: (value, key, object). 27193 * 27194 * @static 27195 * @memberOf _ 27196 * @since 3.8.0 27197 * @category Object 27198 * @param {Object} object The object to iterate over. 27199 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 27200 * @returns {Object} Returns the new mapped object. 27201 * @see _.mapValues 27202 * @example 27203 * 27204 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 27205 * return key + value; 27206 * }); 27207 * // => { 'a1': 1, 'b2': 2 } 27208 */ 27209 function mapKeys(object, iteratee) { 27210 var result = {}; 27211 iteratee = getIteratee(iteratee, 3); 27212 27213 baseForOwn(object, function(value, key, object) { 27214 baseAssignValue(result, iteratee(value, key, object), value); 27215 }); 27216 return result; 27217 } 27218 27219 /** 27220 * Creates an object with the same keys as `object` and values generated 27221 * by running each own enumerable string keyed property of `object` thru 27222 * `iteratee`. The iteratee is invoked with three arguments: 27223 * (value, key, object). 27224 * 27225 * @static 27226 * @memberOf _ 27227 * @since 2.4.0 27228 * @category Object 27229 * @param {Object} object The object to iterate over. 27230 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 27231 * @returns {Object} Returns the new mapped object. 27232 * @see _.mapKeys 27233 * @example 27234 * 27235 * var users = { 27236 * 'fred': { 'user': 'fred', 'age': 40 }, 27237 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 27238 * }; 27239 * 27240 * _.mapValues(users, function(o) { return o.age; }); 27241 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 27242 * 27243 * // The `_.property` iteratee shorthand. 27244 * _.mapValues(users, 'age'); 27245 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 27246 */ 27247 function mapValues(object, iteratee) { 27248 var result = {}; 27249 iteratee = getIteratee(iteratee, 3); 27250 27251 baseForOwn(object, function(value, key, object) { 27252 baseAssignValue(result, key, iteratee(value, key, object)); 27253 }); 27254 return result; 27255 } 27256 27257 /** 27258 * This method is like `_.assign` except that it recursively merges own and 27259 * inherited enumerable string keyed properties of source objects into the 27260 * destination object. Source properties that resolve to `undefined` are 27261 * skipped if a destination value exists. Array and plain object properties 27262 * are merged recursively. Other objects and value types are overridden by 27263 * assignment. Source objects are applied from left to right. Subsequent 27264 * sources overwrite property assignments of previous sources. 27265 * 27266 * **Note:** This method mutates `object`. 27267 * 27268 * @static 27269 * @memberOf _ 27270 * @since 0.5.0 27271 * @category Object 27272 * @param {Object} object The destination object. 27273 * @param {...Object} [sources] The source objects. 27274 * @returns {Object} Returns `object`. 27275 * @example 27276 * 27277 * var object = { 27278 * 'a': [{ 'b': 2 }, { 'd': 4 }] 27279 * }; 27280 * 27281 * var other = { 27282 * 'a': [{ 'c': 3 }, { 'e': 5 }] 27283 * }; 27284 * 27285 * _.merge(object, other); 27286 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 27287 */ 27288 var merge = createAssigner(function(object, source, srcIndex) { 27289 baseMerge(object, source, srcIndex); 27290 }); 27291 27292 /** 27293 * This method is like `_.merge` except that it accepts `customizer` which 27294 * is invoked to produce the merged values of the destination and source 27295 * properties. If `customizer` returns `undefined`, merging is handled by the 27296 * method instead. The `customizer` is invoked with six arguments: 27297 * (objValue, srcValue, key, object, source, stack). 27298 * 27299 * **Note:** This method mutates `object`. 27300 * 27301 * @static 27302 * @memberOf _ 27303 * @since 4.0.0 27304 * @category Object 27305 * @param {Object} object The destination object. 27306 * @param {...Object} sources The source objects. 27307 * @param {Function} customizer The function to customize assigned values. 27308 * @returns {Object} Returns `object`. 27309 * @example 27310 * 27311 * function customizer(objValue, srcValue) { 27312 * if (_.isArray(objValue)) { 27313 * return objValue.concat(srcValue); 27314 * } 27315 * } 27316 * 27317 * var object = { 'a': [1], 'b': [2] }; 27318 * var other = { 'a': [3], 'b': [4] }; 27319 * 27320 * _.mergeWith(object, other, customizer); 27321 * // => { 'a': [1, 3], 'b': [2, 4] } 27322 */ 27323 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 27324 baseMerge(object, source, srcIndex, customizer); 27325 }); 27326 27327 /** 27328 * The opposite of `_.pick`; this method creates an object composed of the 27329 * own and inherited enumerable property paths of `object` that are not omitted. 27330 * 27331 * **Note:** This method is considerably slower than `_.pick`. 27332 * 27333 * @static 27334 * @since 0.1.0 27335 * @memberOf _ 27336 * @category Object 27337 * @param {Object} object The source object. 27338 * @param {...(string|string[])} [paths] The property paths to omit. 27339 * @returns {Object} Returns the new object. 27340 * @example 27341 * 27342 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 27343 * 27344 * _.omit(object, ['a', 'c']); 27345 * // => { 'b': '2' } 27346 */ 27347 var omit = flatRest(function(object, paths) { 27348 var result = {}; 27349 if (object == null) { 27350 return result; 27351 } 27352 var isDeep = false; 27353 paths = arrayMap(paths, function(path) { 27354 path = castPath(path, object); 27355 isDeep || (isDeep = path.length > 1); 27356 return path; 27357 }); 27358 copyObject(object, getAllKeysIn(object), result); 27359 if (isDeep) { 27360 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 27361 } 27362 var length = paths.length; 27363 while (length--) { 27364 baseUnset(result, paths[length]); 27365 } 27366 return result; 27367 }); 27368 27369 /** 27370 * The opposite of `_.pickBy`; this method creates an object composed of 27371 * the own and inherited enumerable string keyed properties of `object` that 27372 * `predicate` doesn't return truthy for. The predicate is invoked with two 27373 * arguments: (value, key). 27374 * 27375 * @static 27376 * @memberOf _ 27377 * @since 4.0.0 27378 * @category Object 27379 * @param {Object} object The source object. 27380 * @param {Function} [predicate=_.identity] The function invoked per property. 27381 * @returns {Object} Returns the new object. 27382 * @example 27383 * 27384 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 27385 * 27386 * _.omitBy(object, _.isNumber); 27387 * // => { 'b': '2' } 27388 */ 27389 function omitBy(object, predicate) { 27390 return pickBy(object, negate(getIteratee(predicate))); 27391 } 27392 27393 /** 27394 * Creates an object composed of the picked `object` properties. 27395 * 27396 * @static 27397 * @since 0.1.0 27398 * @memberOf _ 27399 * @category Object 27400 * @param {Object} object The source object. 27401 * @param {...(string|string[])} [paths] The property paths to pick. 27402 * @returns {Object} Returns the new object. 27403 * @example 27404 * 27405 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 27406 * 27407 * _.pick(object, ['a', 'c']); 27408 * // => { 'a': 1, 'c': 3 } 27409 */ 27410 var pick = flatRest(function(object, paths) { 27411 return object == null ? {} : basePick(object, paths); 27412 }); 27413 27414 /**
vendor: 11,160 bytes, lines 27415-27753
27415 * Creates an object composed of the `object` properties `predicate` returns 27416 * truthy for. The predicate is invoked with two arguments: (value, key). 27417 * 27418 * @static 27419 * @memberOf _ 27420 * @since 4.0.0 27421 * @category Object 27422 * @param {Object} object The source object. 27423 * @param {Function} [predicate=_.identity] The function invoked per property. 27424 * @returns {Object} Returns the new object. 27425 * @example 27426 * 27427 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 27428 * 27429 * _.pickBy(object, _.isNumber); 27430 * // => { 'a': 1, 'c': 3 } 27431 */ 27432 function pickBy(object, predicate) { 27433 if (object == null) { 27434 return {}; 27435 } 27436 var props = arrayMap(getAllKeysIn(object), function(prop) { 27437 return [prop]; 27438 }); 27439 predicate = getIteratee(predicate); 27440 return basePickBy(object, props, function(value, path) { 27441 return predicate(value, path[0]); 27442 }); 27443 } 27444 27445 /** 27446 * This method is like `_.get` except that if the resolved value is a 27447 * function it's invoked with the `this` binding of its parent object and 27448 * its result is returned. 27449 * 27450 * @static 27451 * @since 0.1.0 27452 * @memberOf _ 27453 * @category Object 27454 * @param {Object} object The object to query. 27455 * @param {Array|string} path The path of the property to resolve. 27456 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 27457 * @returns {*} Returns the resolved value. 27458 * @example 27459 * 27460 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 27461 * 27462 * _.result(object, 'a[0].b.c1'); 27463 * // => 3 27464 * 27465 * _.result(object, 'a[0].b.c2'); 27466 * // => 4 27467 * 27468 * _.result(object, 'a[0].b.c3', 'default'); 27469 * // => 'default' 27470 * 27471 * _.result(object, 'a[0].b.c3', _.constant('default')); 27472 * // => 'default' 27473 */ 27474 function result(object, path, defaultValue) { 27475 path = castPath(path, object); 27476 27477 var index = -1, 27478 length = path.length; 27479 27480 // Ensure the loop is entered when path is empty. 27481 if (!length) { 27482 length = 1; 27483 object = undefined; 27484 } 27485 while (++index < length) { 27486 var value = object == null ? undefined : object[toKey(path[index])]; 27487 if (value === undefined) { 27488 index = length; 27489 value = defaultValue; 27490 } 27491 object = isFunction(value) ? value.call(object) : value; 27492 } 27493 return object; 27494 } 27495 27496 /** 27497 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 27498 * it's created. Arrays are created for missing index properties while objects 27499 * are created for all other missing properties. Use `_.setWith` to customize 27500 * `path` creation. 27501 * 27502 * **Note:** This method mutates `object`. 27503 * 27504 * @static 27505 * @memberOf _ 27506 * @since 3.7.0 27507 * @category Object 27508 * @param {Object} object The object to modify. 27509 * @param {Array|string} path The path of the property to set. 27510 * @param {*} value The value to set. 27511 * @returns {Object} Returns `object`. 27512 * @example 27513 * 27514 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 27515 * 27516 * _.set(object, 'a[0].b.c', 4); 27517 * console.log(object.a[0].b.c); 27518 * // => 4 27519 * 27520 * _.set(object, ['x', '0', 'y', 'z'], 5); 27521 * console.log(object.x[0].y.z); 27522 * // => 5 27523 */ 27524 function set(object, path, value) { 27525 return object == null ? object : baseSet(object, path, value); 27526 } 27527 27528 /** 27529 * This method is like `_.set` except that it accepts `customizer` which is 27530 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 27531 * path creation is handled by the method instead. The `customizer` is invoked 27532 * with three arguments: (nsValue, key, nsObject). 27533 * 27534 * **Note:** This method mutates `object`. 27535 * 27536 * @static 27537 * @memberOf _ 27538 * @since 4.0.0 27539 * @category Object 27540 * @param {Object} object The object to modify. 27541 * @param {Array|string} path The path of the property to set. 27542 * @param {*} value The value to set. 27543 * @param {Function} [customizer] The function to customize assigned values. 27544 * @returns {Object} Returns `object`. 27545 * @example 27546 * 27547 * var object = {}; 27548 * 27549 * _.setWith(object, '[0][1]', 'a', Object); 27550 * // => { '0': { '1': 'a' } } 27551 */ 27552 function setWith(object, path, value, customizer) { 27553 customizer = typeof customizer == 'function' ? customizer : undefined; 27554 return object == null ? object : baseSet(object, path, value, customizer); 27555 } 27556 27557 /** 27558 * Creates an array of own enumerable string keyed-value pairs for `object` 27559 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 27560 * entries are returned. 27561 * 27562 * @static 27563 * @memberOf _ 27564 * @since 4.0.0 27565 * @alias entries 27566 * @category Object 27567 * @param {Object} object The object to query. 27568 * @returns {Array} Returns the key-value pairs. 27569 * @example 27570 * 27571 * function Foo() { 27572 * this.a = 1; 27573 * this.b = 2; 27574 * } 27575 * 27576 * Foo.prototype.c = 3; 27577 * 27578 * _.toPairs(new Foo); 27579 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 27580 */ 27581 var toPairs = createToPairs(keys); 27582 27583 /** 27584 * Creates an array of own and inherited enumerable string keyed-value pairs 27585 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 27586 * or set, its entries are returned. 27587 * 27588 * @static 27589 * @memberOf _ 27590 * @since 4.0.0 27591 * @alias entriesIn 27592 * @category Object 27593 * @param {Object} object The object to query. 27594 * @returns {Array} Returns the key-value pairs. 27595 * @example 27596 * 27597 * function Foo() { 27598 * this.a = 1; 27599 * this.b = 2; 27600 * } 27601 * 27602 * Foo.prototype.c = 3; 27603 * 27604 * _.toPairsIn(new Foo); 27605 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 27606 */ 27607 var toPairsIn = createToPairs(keysIn); 27608 27609 /** 27610 * An alternative to `_.reduce`; this method transforms `object` to a new 27611 * `accumulator` object which is the result of running each of its own 27612 * enumerable string keyed properties thru `iteratee`, with each invocation 27613 * potentially mutating the `accumulator` object. If `accumulator` is not 27614 * provided, a new object with the same `[[Prototype]]` will be used. The 27615 * iteratee is invoked with four arguments: (accumulator, value, key, object). 27616 * Iteratee functions may exit iteration early by explicitly returning `false`. 27617 * 27618 * @static 27619 * @memberOf _ 27620 * @since 1.3.0 27621 * @category Object 27622 * @param {Object} object The object to iterate over. 27623 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 27624 * @param {*} [accumulator] The custom accumulator value. 27625 * @returns {*} Returns the accumulated value. 27626 * @example 27627 * 27628 * _.transform([2, 3, 4], function(result, n) { 27629 * result.push(n *= n); 27630 * return n % 2 == 0; 27631 * }, []); 27632 * // => [4, 9] 27633 * 27634 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 27635 * (result[value] || (result[value] = [])).push(key); 27636 * }, {}); 27637 * // => { '1': ['a', 'c'], '2': ['b'] } 27638 */ 27639 function transform(object, iteratee, accumulator) { 27640 var isArr = isArray(object), 27641 isArrLike = isArr || isBuffer(object) || isTypedArray(object); 27642 27643 iteratee = getIteratee(iteratee, 4); 27644 if (accumulator == null) { 27645 var Ctor = object && object.constructor; 27646 if (isArrLike) { 27647 accumulator = isArr ? new Ctor : []; 27648 } 27649 else if (isObject(object)) { 27650 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; 27651 } 27652 else { 27653 accumulator = {}; 27654 } 27655 } 27656 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { 27657 return iteratee(accumulator, value, index, object); 27658 }); 27659 return accumulator; 27660 } 27661 27662 /** 27663 * Removes the property at `path` of `object`. 27664 * 27665 * **Note:** This method mutates `object`. 27666 * 27667 * @static 27668 * @memberOf _ 27669 * @since 4.0.0 27670 * @category Object 27671 * @param {Object} object The object to modify. 27672 * @param {Array|string} path The path of the property to unset. 27673 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 27674 * @example 27675 * 27676 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 27677 * _.unset(object, 'a[0].b.c'); 27678 * // => true 27679 * 27680 * console.log(object); 27681 * // => { 'a': [{ 'b': {} }] }; 27682 * 27683 * _.unset(object, ['a', '0', 'b', 'c']); 27684 * // => true 27685 * 27686 * console.log(object); 27687 * // => { 'a': [{ 'b': {} }] }; 27688 */ 27689 function unset(object, path) { 27690 return object == null ? true : baseUnset(object, path); 27691 } 27692 27693 /** 27694 * This method is like `_.set` except that accepts `updater` to produce the 27695 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 27696 * is invoked with one argument: (value). 27697 * 27698 * **Note:** This method mutates `object`. 27699 * 27700 * @static 27701 * @memberOf _ 27702 * @since 4.6.0 27703 * @category Object 27704 * @param {Object} object The object to modify. 27705 * @param {Array|string} path The path of the property to set. 27706 * @param {Function} updater The function to produce the updated value. 27707 * @returns {Object} Returns `object`. 27708 * @example 27709 * 27710 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 27711 * 27712 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 27713 * console.log(object.a[0].b.c); 27714 * // => 9 27715 * 27716 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 27717 * console.log(object.x[0].y.z); 27718 * // => 0 27719 */ 27720 function update(object, path, updater) { 27721 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 27722 } 27723 27724 /** 27725 * This method is like `_.update` except that it accepts `customizer` which is 27726 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 27727 * path creation is handled by the method instead. The `customizer` is invoked 27728 * with three arguments: (nsValue, key, nsObject). 27729 * 27730 * **Note:** This method mutates `object`. 27731 * 27732 * @static 27733 * @memberOf _ 27734 * @since 4.6.0 27735 * @category Object 27736 * @param {Object} object The object to modify. 27737 * @param {Array|string} path The path of the property to set. 27738 * @param {Function} updater The function to produce the updated value. 27739 * @param {Function} [customizer] The function to customize assigned values. 27740 * @returns {Object} Returns `object`. 27741 * @example 27742 * 27743 * var object = {}; 27744 * 27745 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 27746 * // => { '0': { '1': 'a' } } 27747 */ 27748 function updateWith(object, path, updater, customizer) { 27749 customizer = typeof customizer == 'function' ? customizer : undefined; 27750 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 27751 } 27752 27753 /**
vendor: 1,263 bytes, lines 27754-27803
27754 * Creates an array of the own enumerable string keyed property values of `object`. 27755 * 27756 * **Note:** Non-object values are coerced to objects. 27757 * 27758 * @static 27759 * @since 0.1.0 27760 * @memberOf _ 27761 * @category Object 27762 * @param {Object} object The object to query. 27763 * @returns {Array} Returns the array of property values. 27764 * @example 27765 * 27766 * function Foo() { 27767 * this.a = 1; 27768 * this.b = 2; 27769 * } 27770 * 27771 * Foo.prototype.c = 3; 27772 * 27773 * _.values(new Foo); 27774 * // => [1, 2] (iteration order is not guaranteed) 27775 * 27776 * _.values('hi'); 27777 * // => ['h', 'i'] 27778 */ 27779 function values(object) { 27780 return object == null ? [] : baseValues(object, keys(object)); 27781 } 27782 27783 /** 27784 * Creates an array of the own and inherited enumerable string keyed property 27785 * values of `object`. 27786 * 27787 * **Note:** Non-object values are coerced to objects. 27788 * 27789 * @static 27790 * @memberOf _ 27791 * @since 3.0.0 27792 * @category Object 27793 * @param {Object} object The object to query. 27794 * @returns {Array} Returns the array of property values. 27795 * @example 27796 * 27797 * function Foo() { 27798 * this.a = 1; 27799 * this.b = 2; 27800 * } 27801 * 27802 * Foo.prototype.c = 3; 27803 *
vendor: 5,617 bytes, lines 27804-27998
27804 * _.valuesIn(new Foo); 27805 * // => [1, 2, 3] (iteration order is not guaranteed) 27806 */ 27807 function valuesIn(object) { 27808 return object == null ? [] : baseValues(object, keysIn(object)); 27809 } 27810 27811 /*------------------------------------------------------------------------*/ 27812 27813 /** 27814 * Clamps `number` within the inclusive `lower` and `upper` bounds. 27815 * 27816 * @static 27817 * @memberOf _ 27818 * @since 4.0.0 27819 * @category Number 27820 * @param {number} number The number to clamp. 27821 * @param {number} [lower] The lower bound. 27822 * @param {number} upper The upper bound. 27823 * @returns {number} Returns the clamped number. 27824 * @example 27825 * 27826 * _.clamp(-10, -5, 5); 27827 * // => -5 27828 * 27829 * _.clamp(10, -5, 5); 27830 * // => 5 27831 */ 27832 function clamp(number, lower, upper) { 27833 if (upper === undefined) { 27834 upper = lower; 27835 lower = undefined; 27836 } 27837 if (upper !== undefined) { 27838 upper = toNumber(upper); 27839 upper = upper === upper ? upper : 0; 27840 } 27841 if (lower !== undefined) { 27842 lower = toNumber(lower); 27843 lower = lower === lower ? lower : 0; 27844 } 27845 return baseClamp(toNumber(number), lower, upper); 27846 } 27847 27848 /** 27849 * Checks if `n` is between `start` and up to, but not including, `end`. If 27850 * `end` is not specified, it's set to `start` with `start` then set to `0`. 27851 * If `start` is greater than `end` the params are swapped to support 27852 * negative ranges. 27853 * 27854 * @static 27855 * @memberOf _ 27856 * @since 3.3.0 27857 * @category Number 27858 * @param {number} number The number to check. 27859 * @param {number} [start=0] The start of the range. 27860 * @param {number} end The end of the range. 27861 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 27862 * @see _.range, _.rangeRight 27863 * @example 27864 * 27865 * _.inRange(3, 2, 4); 27866 * // => true 27867 * 27868 * _.inRange(4, 8); 27869 * // => true 27870 * 27871 * _.inRange(4, 2); 27872 * // => false 27873 * 27874 * _.inRange(2, 2); 27875 * // => false 27876 * 27877 * _.inRange(1.2, 2); 27878 * // => true 27879 * 27880 * _.inRange(5.2, 4); 27881 * // => false 27882 * 27883 * _.inRange(-3, -2, -6); 27884 * // => true 27885 */ 27886 function inRange(number, start, end) { 27887 start = toFinite(start); 27888 if (end === undefined) { 27889 end = start; 27890 start = 0; 27891 } else { 27892 end = toFinite(end); 27893 } 27894 number = toNumber(number); 27895 return baseInRange(number, start, end); 27896 } 27897 27898 /** 27899 * Produces a random number between the inclusive `lower` and `upper` bounds. 27900 * If only one argument is provided a number between `0` and the given number 27901 * is returned. If `floating` is `true`, or either `lower` or `upper` are 27902 * floats, a floating-point number is returned instead of an integer. 27903 * 27904 * **Note:** JavaScript follows the IEEE-754 standard for resolving 27905 * floating-point values which can produce unexpected results. 27906 * 27907 * **Note:** If `lower` is greater than `upper`, the values are swapped. 27908 * 27909 * @static 27910 * @memberOf _ 27911 * @since 0.7.0 27912 * @category Number 27913 * @param {number} [lower=0] The lower bound. 27914 * @param {number} [upper=1] The upper bound. 27915 * @param {boolean} [floating] Specify returning a floating-point number. 27916 * @returns {number} Returns the random number. 27917 * @example 27918 * 27919 * _.random(0, 5); 27920 * // => an integer between 0 and 5 27921 * 27922 * // when lower is greater than upper the values are swapped 27923 * _.random(5, 0); 27924 * // => an integer between 0 and 5 27925 * 27926 * _.random(5); 27927 * // => also an integer between 0 and 5 27928 * 27929 * _.random(-5); 27930 * // => an integer between -5 and 0 27931 * 27932 * _.random(5, true); 27933 * // => a floating-point number between 0 and 5 27934 * 27935 * _.random(1.2, 5.2); 27936 * // => a floating-point number between 1.2 and 5.2 27937 */ 27938 function random(lower, upper, floating) { 27939 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { 27940 upper = floating = undefined; 27941 } 27942 if (floating === undefined) { 27943 if (typeof upper == 'boolean') { 27944 floating = upper; 27945 upper = undefined; 27946 } 27947 else if (typeof lower == 'boolean') { 27948 floating = lower; 27949 lower = undefined; 27950 } 27951 } 27952 if (lower === undefined && upper === undefined) { 27953 lower = 0; 27954 upper = 1; 27955 } 27956 else { 27957 lower = toFinite(lower); 27958 if (upper === undefined) { 27959 upper = lower; 27960 lower = 0; 27961 } else { 27962 upper = toFinite(upper); 27963 } 27964 } 27965 if (lower > upper) { 27966 var temp = lower; 27967 lower = upper; 27968 upper = temp; 27969 } 27970 if (floating || lower % 1 || upper % 1) { 27971 var rand = nativeRandom(); 27972 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); 27973 } 27974 return baseRandom(lower, upper); 27975 } 27976 27977 /*------------------------------------------------------------------------*/ 27978 27979 /** 27980 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 27981 * 27982 * @static 27983 * @memberOf _ 27984 * @since 3.0.0 27985 * @category String 27986 * @param {string} [string=''] The string to convert. 27987 * @returns {string} Returns the camel cased string. 27988 * @example 27989 * 27990 * _.camelCase('Foo Bar'); 27991 * // => 'fooBar' 27992 * 27993 * _.camelCase('--foo-bar--'); 27994 * // => 'fooBar' 27995 * 27996 * _.camelCase('__FOO_BAR__'); 27997 * // => 'fooBar' 27998 */
vendor: 4,351 bytes, lines 27999-28133
27999 var camelCase = createCompounder(function(result, word, index) { 28000 word = word.toLowerCase(); 28001 return result + (index ? capitalize(word) : word); 28002 }); 28003 28004 /** 28005 * Converts the first character of `string` to upper case and the remaining 28006 * to lower case. 28007 * 28008 * @static 28009 * @memberOf _ 28010 * @since 3.0.0 28011 * @category String 28012 * @param {string} [string=''] The string to capitalize. 28013 * @returns {string} Returns the capitalized string. 28014 * @example 28015 * 28016 * _.capitalize('FRED'); 28017 * // => 'Fred' 28018 */ 28019 function capitalize(string) { 28020 return upperFirst(toString(string).toLowerCase()); 28021 } 28022 28023 /** 28024 * Deburrs `string` by converting 28025 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 28026 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 28027 * letters to basic Latin letters and removing 28028 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 28029 * 28030 * @static 28031 * @memberOf _ 28032 * @since 3.0.0 28033 * @category String 28034 * @param {string} [string=''] The string to deburr. 28035 * @returns {string} Returns the deburred string. 28036 * @example 28037 * 28038 * _.deburr('déjàvu'); 28039 * // => 'deja vu' 28040 */ 28041 function deburr(string) { 28042 string = toString(string); 28043 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); 28044 } 28045 28046 /** 28047 * Checks if `string` ends with the given target string. 28048 * 28049 * @static 28050 * @memberOf _ 28051 * @since 3.0.0 28052 * @category String 28053 * @param {string} [string=''] The string to inspect. 28054 * @param {string} [target] The string to search for. 28055 * @param {number} [position=string.length] The position to search up to. 28056 * @returns {boolean} Returns `true` if `string` ends with `target`, 28057 * else `false`. 28058 * @example 28059 * 28060 * _.endsWith('abc', 'c'); 28061 * // => true 28062 * 28063 * _.endsWith('abc', 'b'); 28064 * // => false 28065 * 28066 * _.endsWith('abc', 'b', 2); 28067 * // => true 28068 */ 28069 function endsWith(string, target, position) { 28070 string = toString(string); 28071 target = baseToString(target); 28072 28073 var length = string.length; 28074 position = position === undefined 28075 ? length 28076 : baseClamp(toInteger(position), 0, length); 28077 28078 var end = position; 28079 position -= target.length; 28080 return position >= 0 && string.slice(position, end) == target; 28081 } 28082 28083 /** 28084 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 28085 * corresponding HTML entities. 28086 * 28087 * **Note:** No other characters are escaped. To escape additional 28088 * characters use a third-party library like [_he_](https://mths.be/he). 28089 * 28090 * Though the ">" character is escaped for symmetry, characters like 28091 * ">" and "/" don't need escaping in HTML and have no special meaning 28092 * unless they're part of a tag or unquoted attribute value. See 28093 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 28094 * (under "semi-related fun fact") for more details. 28095 * 28096 * When working with HTML you should always 28097 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 28098 * XSS vectors. 28099 * 28100 * @static 28101 * @since 0.1.0 28102 * @memberOf _ 28103 * @category String 28104 * @param {string} [string=''] The string to escape. 28105 * @returns {string} Returns the escaped string. 28106 * @example 28107 * 28108 * _.escape('fred, barney, & pebbles'); 28109 * // => 'fred, barney, & pebbles' 28110 */ 28111 function escape(string) { 28112 string = toString(string); 28113 return (string && reHasUnescapedHtml.test(string)) 28114 ? string.replace(reUnescapedHtml, escapeHtmlChar) 28115 : string; 28116 } 28117 28118 /** 28119 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 28120 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 28121 * 28122 * @static 28123 * @memberOf _ 28124 * @since 3.0.0 28125 * @category String 28126 * @param {string} [string=''] The string to escape. 28127 * @returns {string} Returns the escaped string. 28128 * @example 28129 * 28130 * _.escapeRegExp('[lodash](https://lodash.com/)'); 28131 * // => '\[lodash\]\(https://lodash\.com/\)' 28132 */ 28133 function escapeRegExp(string) {
vendor: 4,658 bytes, lines 28134-28303
28134 string = toString(string); 28135 return (string && reHasRegExpChar.test(string)) 28136 ? string.replace(reRegExpChar, '\\$&') 28137 : string; 28138 } 28139 28140 /** 28141 * Converts `string` to 28142 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 28143 * 28144 * @static 28145 * @memberOf _ 28146 * @since 3.0.0 28147 * @category String 28148 * @param {string} [string=''] The string to convert. 28149 * @returns {string} Returns the kebab cased string. 28150 * @example 28151 * 28152 * _.kebabCase('Foo Bar'); 28153 * // => 'foo-bar' 28154 * 28155 * _.kebabCase('fooBar'); 28156 * // => 'foo-bar' 28157 * 28158 * _.kebabCase('__FOO_BAR__'); 28159 * // => 'foo-bar' 28160 */ 28161 var kebabCase = createCompounder(function(result, word, index) { 28162 return result + (index ? '-' : '') + word.toLowerCase(); 28163 }); 28164 28165 /** 28166 * Converts `string`, as space separated words, to lower case. 28167 * 28168 * @static 28169 * @memberOf _ 28170 * @since 4.0.0 28171 * @category String 28172 * @param {string} [string=''] The string to convert. 28173 * @returns {string} Returns the lower cased string. 28174 * @example 28175 * 28176 * _.lowerCase('--Foo-Bar--'); 28177 * // => 'foo bar' 28178 * 28179 * _.lowerCase('fooBar'); 28180 * // => 'foo bar' 28181 * 28182 * _.lowerCase('__FOO_BAR__'); 28183 * // => 'foo bar' 28184 */ 28185 var lowerCase = createCompounder(function(result, word, index) { 28186 return result + (index ? ' ' : '') + word.toLowerCase(); 28187 }); 28188 28189 /** 28190 * Converts the first character of `string` to lower case. 28191 * 28192 * @static 28193 * @memberOf _ 28194 * @since 4.0.0 28195 * @category String 28196 * @param {string} [string=''] The string to convert. 28197 * @returns {string} Returns the converted string. 28198 * @example 28199 * 28200 * _.lowerFirst('Fred'); 28201 * // => 'fred' 28202 * 28203 * _.lowerFirst('FRED'); 28204 * // => 'fRED' 28205 */ 28206 var lowerFirst = createCaseFirst('toLowerCase'); 28207 28208 /** 28209 * Pads `string` on the left and right sides if it's shorter than `length`. 28210 * Padding characters are truncated if they can't be evenly divided by `length`. 28211 * 28212 * @static 28213 * @memberOf _ 28214 * @since 3.0.0 28215 * @category String 28216 * @param {string} [string=''] The string to pad. 28217 * @param {number} [length=0] The padding length. 28218 * @param {string} [chars=' '] The string used as padding. 28219 * @returns {string} Returns the padded string. 28220 * @example 28221 * 28222 * _.pad('abc', 8); 28223 * // => ' abc ' 28224 * 28225 * _.pad('abc', 8, '_-'); 28226 * // => '_-abc_-_' 28227 * 28228 * _.pad('abc', 3); 28229 * // => 'abc' 28230 */ 28231 function pad(string, length, chars) { 28232 string = toString(string); 28233 length = toInteger(length); 28234 28235 var strLength = length ? stringSize(string) : 0; 28236 if (!length || strLength >= length) { 28237 return string; 28238 } 28239 var mid = (length - strLength) / 2; 28240 return ( 28241 createPadding(nativeFloor(mid), chars) + 28242 string + 28243 createPadding(nativeCeil(mid), chars) 28244 ); 28245 } 28246 28247 /** 28248 * Pads `string` on the right side if it's shorter than `length`. Padding 28249 * characters are truncated if they exceed `length`. 28250 * 28251 * @static 28252 * @memberOf _ 28253 * @since 4.0.0 28254 * @category String 28255 * @param {string} [string=''] The string to pad. 28256 * @param {number} [length=0] The padding length. 28257 * @param {string} [chars=' '] The string used as padding. 28258 * @returns {string} Returns the padded string. 28259 * @example 28260 * 28261 * _.padEnd('abc', 6); 28262 * // => 'abc ' 28263 * 28264 * _.padEnd('abc', 6, '_-'); 28265 * // => 'abc_-_' 28266 * 28267 * _.padEnd('abc', 3); 28268 * // => 'abc' 28269 */ 28270 function padEnd(string, length, chars) { 28271 string = toString(string); 28272 length = toInteger(length); 28273 28274 var strLength = length ? stringSize(string) : 0; 28275 return (length && strLength < length) 28276 ? (string + createPadding(length - strLength, chars)) 28277 : string; 28278 } 28279 28280 /** 28281 * Pads `string` on the left side if it's shorter than `length`. Padding 28282 * characters are truncated if they exceed `length`. 28283 * 28284 * @static 28285 * @memberOf _ 28286 * @since 4.0.0 28287 * @category String 28288 * @param {string} [string=''] The string to pad. 28289 * @param {number} [length=0] The padding length. 28290 * @param {string} [chars=' '] The string used as padding. 28291 * @returns {string} Returns the padded string. 28292 * @example 28293 * 28294 * _.padStart('abc', 6); 28295 * // => ' abc' 28296 * 28297 * _.padStart('abc', 6, '_-'); 28298 * // => '_-_abc' 28299 * 28300 * _.padStart('abc', 3); 28301 * // => 'abc' 28302 */ 28303 function padStart(string, length, chars) {
vendor: 2,753 bytes, lines 28304-28394
28304 string = toString(string); 28305 length = toInteger(length); 28306 28307 var strLength = length ? stringSize(string) : 0; 28308 return (length && strLength < length) 28309 ? (createPadding(length - strLength, chars) + string) 28310 : string; 28311 } 28312 28313 /** 28314 * Converts `string` to an integer of the specified radix. If `radix` is 28315 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 28316 * hexadecimal, in which case a `radix` of `16` is used. 28317 * 28318 * **Note:** This method aligns with the 28319 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 28320 * 28321 * @static 28322 * @memberOf _ 28323 * @since 1.1.0 28324 * @category String 28325 * @param {string} string The string to convert. 28326 * @param {number} [radix=10] The radix to interpret `value` by. 28327 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28328 * @returns {number} Returns the converted integer. 28329 * @example 28330 * 28331 * _.parseInt('08'); 28332 * // => 8 28333 * 28334 * _.map(['6', '08', '10'], _.parseInt); 28335 * // => [6, 8, 10] 28336 */ 28337 function parseInt(string, radix, guard) { 28338 if (guard || radix == null) { 28339 radix = 0; 28340 } else if (radix) { 28341 radix = +radix; 28342 } 28343 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 28344 } 28345 28346 /** 28347 * Repeats the given string `n` times. 28348 * 28349 * @static 28350 * @memberOf _ 28351 * @since 3.0.0 28352 * @category String 28353 * @param {string} [string=''] The string to repeat. 28354 * @param {number} [n=1] The number of times to repeat the string. 28355 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28356 * @returns {string} Returns the repeated string. 28357 * @example 28358 * 28359 * _.repeat('*', 3); 28360 * // => '***' 28361 * 28362 * _.repeat('abc', 2); 28363 * // => 'abcabc' 28364 * 28365 * _.repeat('abc', 0); 28366 * // => '' 28367 */ 28368 function repeat(string, n, guard) { 28369 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { 28370 n = 1; 28371 } else { 28372 n = toInteger(n); 28373 } 28374 return baseRepeat(toString(string), n); 28375 } 28376 28377 /** 28378 * Replaces matches for `pattern` in `string` with `replacement`. 28379 * 28380 * **Note:** This method is based on 28381 * [`String#replace`](https://mdn.io/String/replace). 28382 * 28383 * @static 28384 * @memberOf _ 28385 * @since 4.0.0 28386 * @category String 28387 * @param {string} [string=''] The string to modify. 28388 * @param {RegExp|string} pattern The pattern to replace. 28389 * @param {Function|string} replacement The match replacement. 28390 * @returns {string} Returns the modified string. 28391 * @example 28392 * 28393 * _.replace('Hi Fred', 'Fred', 'Barney'); 28394 * // =>
vendor: 11,956 bytes, lines 28394-28708
28394 'Hi Barney' 28395 */ 28396 function replace() { 28397 var args = arguments, 28398 string = toString(args[0]); 28399 28400 return args.length < 3 ? string : string.replace(args[1], args[2]); 28401 } 28402 28403 /** 28404 * Converts `string` to 28405 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 28406 * 28407 * @static 28408 * @memberOf _ 28409 * @since 3.0.0 28410 * @category String 28411 * @param {string} [string=''] The string to convert. 28412 * @returns {string} Returns the snake cased string. 28413 * @example 28414 * 28415 * _.snakeCase('Foo Bar'); 28416 * // => 'foo_bar' 28417 * 28418 * _.snakeCase('fooBar'); 28419 * // => 'foo_bar' 28420 * 28421 * _.snakeCase('--FOO-BAR--'); 28422 * // => 'foo_bar' 28423 */ 28424 var snakeCase = createCompounder(function(result, word, index) { 28425 return result + (index ? '_' : '') + word.toLowerCase(); 28426 }); 28427 28428 /** 28429 * Splits `string` by `separator`. 28430 * 28431 * **Note:** This method is based on 28432 * [`String#split`](https://mdn.io/String/split). 28433 * 28434 * @static 28435 * @memberOf _ 28436 * @since 4.0.0 28437 * @category String 28438 * @param {string} [string=''] The string to split. 28439 * @param {RegExp|string} separator The separator pattern to split by. 28440 * @param {number} [limit] The length to truncate results to. 28441 * @returns {Array} Returns the string segments. 28442 * @example 28443 * 28444 * _.split('a-b-c', '-', 2); 28445 * // => ['a', 'b'] 28446 */ 28447 function split(string, separator, limit) { 28448 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { 28449 separator = limit = undefined; 28450 } 28451 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; 28452 if (!limit) { 28453 return []; 28454 } 28455 string = toString(string); 28456 if (string && ( 28457 typeof separator == 'string' || 28458 (separator != null && !isRegExp(separator)) 28459 )) { 28460 separator = baseToString(separator); 28461 if (!separator && hasUnicode(string)) { 28462 return castSlice(stringToArray(string), 0, limit); 28463 } 28464 } 28465 return string.split(separator, limit); 28466 } 28467 28468 /** 28469 * Converts `string` to 28470 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 28471 * 28472 * @static 28473 * @memberOf _ 28474 * @since 3.1.0 28475 * @category String 28476 * @param {string} [string=''] The string to convert. 28477 * @returns {string} Returns the start cased string. 28478 * @example 28479 * 28480 * _.startCase('--foo-bar--'); 28481 * // => 'Foo Bar' 28482 * 28483 * _.startCase('fooBar'); 28484 * // => 'Foo Bar' 28485 * 28486 * _.startCase('__FOO_BAR__'); 28487 * // => 'FOO BAR' 28488 */ 28489 var startCase = createCompounder(function(result, word, index) { 28490 return result + (index ? ' ' : '') + upperFirst(word); 28491 }); 28492 28493 /** 28494 * Checks if `string` starts with the given target string. 28495 * 28496 * @static 28497 * @memberOf _ 28498 * @since 3.0.0 28499 * @category String 28500 * @param {string} [string=''] The string to inspect. 28501 * @param {string} [target] The string to search for. 28502 * @param {number} [position=0] The position to search from. 28503 * @returns {boolean} Returns `true` if `string` starts with `target`, 28504 * else `false`. 28505 * @example 28506 * 28507 * _.startsWith('abc', 'a'); 28508 * // => true 28509 * 28510 * _.startsWith('abc', 'b'); 28511 * // => false 28512 * 28513 * _.startsWith('abc', 'b', 1); 28514 * // => true 28515 */ 28516 function startsWith(string, target, position) { 28517 string = toString(string); 28518 position = position == null 28519 ? 0 28520 : baseClamp(toInteger(position), 0, string.length); 28521 28522 target = baseToString(target); 28523 return string.slice(position, position + target.length) == target; 28524 } 28525 28526 /** 28527 * Creates a compiled template function that can interpolate data properties 28528 * in "interpolate" delimiters, HTML-escape interpolated data properties in 28529 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 28530 * properties may be accessed as free variables in the template. If a setting 28531 * object is given, it takes precedence over `_.templateSettings` values. 28532 * 28533 * **Security:** `_.template` is insecure and should not be used. It will be 28534 * removed in Lodash v5. Avoid untrusted input. See 28535 * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md). 28536 * 28537 * **Note:** In the development build `_.template` utilizes 28538 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 28539 * for easier debugging. 28540 * 28541 * For more information on precompiling templates see 28542 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 28543 * 28544 * For more information on Chrome extension sandboxes see 28545 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 28546 * 28547 * @static 28548 * @since 0.1.0 28549 * @memberOf _ 28550 * @category String 28551 * @param {string} [string=''] The template string. 28552 * @param {Object} [options={}] The options object. 28553 * @param {RegExp} [options.escape=_.templateSettings.escape] 28554 * The HTML "escape" delimiter. 28555 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 28556 * The "evaluate" delimiter. 28557 * @param {Object} [options.imports=_.templateSettings.imports] 28558 * An object to import into the template as free variables. 28559 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 28560 * The "interpolate" delimiter. 28561 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 28562 * The sourceURL of the compiled template. 28563 * @param {string} [options.variable='obj'] 28564 * The data object variable name. 28565 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28566 * @returns {Function} Returns the compiled template function. 28567 * @example 28568 * 28569 * // Use the "interpolate" delimiter to create a compiled template. 28570 * var compiled = _.template('hello <%= user %>!'); 28571 * compiled({ 'user': 'fred' }); 28572 * // => 'hello fred!' 28573 * 28574 * // Use the HTML "escape" delimiter to escape data property values. 28575 * var compiled = _.template('<b><%- value %></b>'); 28576 * compiled({ 'value': '<script>' }); 28577 * // => '<b><script></b>' 28578 * 28579 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 28580 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 28581 * compiled({ 'users': ['fred', 'barney'] }); 28582 * // => '<li>fred</li><li>barney</li>' 28583 * 28584 * // Use the internal `print` function in "evaluate" delimiters. 28585 * var compiled = _.template('<% print("hello " + user); %>!'); 28586 * compiled({ 'user': 'barney' }); 28587 * // => 'hello barney!' 28588 * 28589 * // Use the ES template literal delimiter as an "interpolate" delimiter. 28590 * // Disable support by replacing the "interpolate" delimiter. 28591 * var compiled = _.template('hello ${ user }!'); 28592 * compiled({ 'user': 'pebbles' }); 28593 * // => 'hello pebbles!' 28594 * 28595 * // Use backslashes to treat delimiters as plain text. 28596 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 28597 * compiled({ 'value': 'ignored' }); 28598 * // => '<%- value %>' 28599 * 28600 * // Use the `imports` option to import `jQuery` as `jq`. 28601 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 28602 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 28603 * compiled({ 'users': ['fred', 'barney'] }); 28604 * // => '<li>fred</li><li>barney</li>' 28605 * 28606 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 28607 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 28608 * compiled(data); 28609 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 28610 * 28611 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 28612 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 28613 * compiled.source; 28614 * // => function(data) { 28615 * // var __t, __p = ''; 28616 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 28617 * // return __p; 28618 * // } 28619 * 28620 * // Use custom template delimiters. 28621 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 28622 * var compiled = _.template('hello {{ user }}!'); 28623 * compiled({ 'user': 'mustache' }); 28624 * // => 'hello mustache!' 28625 * 28626 * // Use the `source` property to inline compiled templates for meaningful 28627 * // line numbers in error messages and stack traces. 28628 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 28629 * var JST = {\ 28630 * "main": ' + _.template(mainText).source + '\ 28631 * };\ 28632 * '); 28633 */ 28634 function template(string, options, guard) { 28635 // Based on John Resig's `tmpl` implementation 28636 // (http://ejohn.org/blog/javascript-micro-templating/) 28637 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 28638 var settings = lodash.templateSettings; 28639 28640 if (guard && isIterateeCall(string, options, guard)) { 28641 options = undefined; 28642 } 28643 string = toString(string); 28644 options = assignWith({}, options, settings, customDefaultsAssignIn); 28645 28646 var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn), 28647 importsKeys = keys(imports), 28648 importsValues = baseValues(imports, importsKeys); 28649 28650 arrayEach(importsKeys, function(key) { 28651 if (reForbiddenIdentifierChars.test(key)) { 28652 throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT); 28653 } 28654 }); 28655 28656 var isEscaping, 28657 isEvaluating, 28658 index = 0, 28659 interpolate = options.interpolate || reNoMatch, 28660 source = "__p += '"; 28661 28662 // Compile the regexp to match each delimiter. 28663 var reDelimiters = RegExp( 28664 (options.escape || reNoMatch).source + '|' + 28665 interpolate.source + '|' + 28666 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 28667 (options.evaluate || reNoMatch).source + '|$' 28668 , 'g'); 28669 28670 // Use a sourceURL for easier debugging. 28671 // The sourceURL gets injected into the source that's eval-ed, so be careful 28672 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 28673 // and escape the comment, thus injecting code that gets evaled. 28674 var sourceURL = '//# sourceURL=' + 28675 (hasOwnProperty.call(options, 'sourceURL') 28676 ? (options.sourceURL + '').replace(/\s/g, ' ') 28677 : ('lodash.templateSources[' + (++templateCounter) + ']') 28678 ) + '\n'; 28679 28680 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 28681 interpolateValue || (interpolateValue = esTemplateValue); 28682 28683 // Escape characters that can't be included in string literals. 28684 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 28685 28686 // Replace delimiters with snippets. 28687 if (escapeValue) { 28688 isEscaping = true; 28689 source += "' +\n__e(" + escapeValue + ") +\n'"; 28690 } 28691 if (evaluateValue) { 28692 isEvaluating = true; 28693 source += "';\n" + evaluateValue + ";\n__p += '"; 28694 } 28695 if (interpolateValue) { 28696 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 28697 } 28698 index = offset + match.length; 28699 28700 // The JS engine embedded in Adobe products needs `match` returned in 28701 // order to produce the correct `offset` value. 28702 return match; 28703 }); 28704 28705 source += "';\n"; 28706 28707 // If `variable` is not specified wrap a with-statement around the generated 28708 // code to add the data object to the top of the scope chain.
vendor: 15,520 bytes, lines 28709-29211
28709 var variable = hasOwnProperty.call(options, 'variable') && options.variable; 28710 if (!variable) { 28711 source = 'with (obj) {\n' + source + '\n}\n'; 28712 } 28713 // Throw an error if a forbidden character was found in `variable`, to prevent 28714 // potential command injection attacks. 28715 else if (reForbiddenIdentifierChars.test(variable)) { 28716 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); 28717 } 28718 28719 // Cleanup code by stripping empty strings. 28720 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 28721 .replace(reEmptyStringMiddle, '$1') 28722 .replace(reEmptyStringTrailing, '$1;'); 28723 28724 // Frame code as the function body. 28725 source = 'function(' + (variable || 'obj') + ') {\n' + 28726 (variable 28727 ? '' 28728 : 'obj || (obj = {});\n' 28729 ) + 28730 "var __t, __p = ''" + 28731 (isEscaping 28732 ? ', __e = _.escape' 28733 : '' 28734 ) + 28735 (isEvaluating 28736 ? ', __j = Array.prototype.join;\n' + 28737 "function print() { __p += __j.call(arguments, '') }\n" 28738 : ';\n' 28739 ) + 28740 source + 28741 'return __p\n}'; 28742 28743 var result = attempt(function() { 28744 return Function(importsKeys, sourceURL + 'return ' + source) 28745 .apply(undefined, importsValues); 28746 }); 28747 28748 // Provide the compiled function's source by its `toString` method or 28749 // the `source` property as a convenience for inlining compiled templates. 28750 result.source = source; 28751 if (isError(result)) { 28752 throw result; 28753 } 28754 return result; 28755 } 28756 28757 /** 28758 * Converts `string`, as a whole, to lower case just like 28759 * [String#toLowerCase](https://mdn.io/toLowerCase). 28760 * 28761 * @static 28762 * @memberOf _ 28763 * @since 4.0.0 28764 * @category String 28765 * @param {string} [string=''] The string to convert. 28766 * @returns {string} Returns the lower cased string. 28767 * @example 28768 * 28769 * _.toLower('--Foo-Bar--'); 28770 * // => '--foo-bar--' 28771 * 28772 * _.toLower('fooBar'); 28773 * // => 'foobar' 28774 * 28775 * _.toLower('__FOO_BAR__'); 28776 * // => '__foo_bar__' 28777 */ 28778 function toLower(value) { 28779 return toString(value).toLowerCase(); 28780 } 28781 28782 /** 28783 * Converts `string`, as a whole, to upper case just like 28784 * [String#toUpperCase](https://mdn.io/toUpperCase). 28785 * 28786 * @static 28787 * @memberOf _ 28788 * @since 4.0.0 28789 * @category String 28790 * @param {string} [string=''] The string to convert. 28791 * @returns {string} Returns the upper cased string. 28792 * @example 28793 * 28794 * _.toUpper('--foo-bar--'); 28795 * // => '--FOO-BAR--' 28796 * 28797 * _.toUpper('fooBar'); 28798 * // => 'FOOBAR' 28799 * 28800 * _.toUpper('__foo_bar__'); 28801 * // => '__FOO_BAR__' 28802 */ 28803 function toUpper(value) { 28804 return toString(value).toUpperCase(); 28805 } 28806 28807 /** 28808 * Removes leading and trailing whitespace or specified characters from `string`. 28809 * 28810 * @static 28811 * @memberOf _ 28812 * @since 3.0.0 28813 * @category String 28814 * @param {string} [string=''] The string to trim. 28815 * @param {string} [chars=whitespace] The characters to trim. 28816 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28817 * @returns {string} Returns the trimmed string. 28818 * @example 28819 * 28820 * _.trim(' abc '); 28821 * // => 'abc' 28822 * 28823 * _.trim('-_-abc-_-', '_-'); 28824 * // => 'abc' 28825 * 28826 * _.map([' foo ', ' bar '], _.trim); 28827 * // => ['foo', 'bar'] 28828 */ 28829 function trim(string, chars, guard) { 28830 string = toString(string); 28831 if (string && (guard || chars === undefined)) { 28832 return baseTrim(string); 28833 } 28834 if (!string || !(chars = baseToString(chars))) { 28835 return string; 28836 } 28837 var strSymbols = stringToArray(string), 28838 chrSymbols = stringToArray(chars), 28839 start = charsStartIndex(strSymbols, chrSymbols), 28840 end = charsEndIndex(strSymbols, chrSymbols) + 1; 28841 28842 return castSlice(strSymbols, start, end).join(''); 28843 } 28844 28845 /** 28846 * Removes trailing whitespace or specified characters from `string`. 28847 * 28848 * @static 28849 * @memberOf _ 28850 * @since 4.0.0 28851 * @category String 28852 * @param {string} [string=''] The string to trim. 28853 * @param {string} [chars=whitespace] The characters to trim. 28854 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28855 * @returns {string} Returns the trimmed string. 28856 * @example 28857 * 28858 * _.trimEnd(' abc '); 28859 * // => ' abc' 28860 * 28861 * _.trimEnd('-_-abc-_-', '_-'); 28862 * // => '-_-abc' 28863 */ 28864 function trimEnd(string, chars, guard) { 28865 string = toString(string); 28866 if (string && (guard || chars === undefined)) { 28867 return string.slice(0, trimmedEndIndex(string) + 1); 28868 } 28869 if (!string || !(chars = baseToString(chars))) { 28870 return string; 28871 } 28872 var strSymbols = stringToArray(string), 28873 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 28874 28875 return castSlice(strSymbols, 0, end).join(''); 28876 } 28877 28878 /** 28879 * Removes leading whitespace or specified characters from `string`. 28880 * 28881 * @static 28882 * @memberOf _ 28883 * @since 4.0.0 28884 * @category String 28885 * @param {string} [string=''] The string to trim. 28886 * @param {string} [chars=whitespace] The characters to trim. 28887 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28888 * @returns {string} Returns the trimmed string. 28889 * @example 28890 * 28891 * _.trimStart(' abc '); 28892 * // => 'abc ' 28893 * 28894 * _.trimStart('-_-abc-_-', '_-'); 28895 * // => 'abc-_-' 28896 */ 28897 function trimStart(string, chars, guard) { 28898 string = toString(string); 28899 if (string && (guard || chars === undefined)) { 28900 return string.replace(reTrimStart, ''); 28901 } 28902 if (!string || !(chars = baseToString(chars))) { 28903 return string; 28904 } 28905 var strSymbols = stringToArray(string), 28906 start = charsStartIndex(strSymbols, stringToArray(chars)); 28907 28908 return castSlice(strSymbols, start).join(''); 28909 } 28910 28911 /** 28912 * Truncates `string` if it's longer than the given maximum string length. 28913 * The last characters of the truncated string are replaced with the omission 28914 * string which defaults to "...". 28915 * 28916 * @static 28917 * @memberOf _ 28918 * @since 4.0.0 28919 * @category String 28920 * @param {string} [string=''] The string to truncate. 28921 * @param {Object} [options={}] The options object. 28922 * @param {number} [options.length=30] The maximum string length. 28923 * @param {string} [options.omission='...'] The string to indicate text is omitted. 28924 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 28925 * @returns {string} Returns the truncated string. 28926 * @example 28927 * 28928 * _.truncate('hi-diddly-ho there, neighborino'); 28929 * // => 'hi-diddly-ho there, neighbo...' 28930 * 28931 * _.truncate('hi-diddly-ho there, neighborino', { 28932 * 'length': 24, 28933 * 'separator': ' ' 28934 * }); 28935 * // => 'hi-diddly-ho there,...' 28936 * 28937 * _.truncate('hi-diddly-ho there, neighborino', { 28938 * 'length': 24, 28939 * 'separator': /,? +/ 28940 * }); 28941 * // => 'hi-diddly-ho there...' 28942 * 28943 * _.truncate('hi-diddly-ho there, neighborino', { 28944 * 'omission': ' [...]' 28945 * }); 28946 * // => 'hi-diddly-ho there, neig [...]' 28947 */ 28948 function truncate(string, options) { 28949 var length = DEFAULT_TRUNC_LENGTH, 28950 omission = DEFAULT_TRUNC_OMISSION; 28951 28952 if (isObject(options)) { 28953 var separator = 'separator' in options ? options.separator : separator; 28954 length = 'length' in options ? toInteger(options.length) : length; 28955 omission = 'omission' in options ? baseToString(options.omission) : omission; 28956 } 28957 string = toString(string); 28958 28959 var strLength = string.length; 28960 if (hasUnicode(string)) { 28961 var strSymbols = stringToArray(string); 28962 strLength = strSymbols.length; 28963 } 28964 if (length >= strLength) { 28965 return string; 28966 } 28967 var end = length - stringSize(omission); 28968 if (end < 1) { 28969 return omission; 28970 } 28971 var result = strSymbols 28972 ? castSlice(strSymbols, 0, end).join('') 28973 : string.slice(0, end); 28974 28975 if (separator === undefined) { 28976 return result + omission; 28977 } 28978 if (strSymbols) { 28979 end += (result.length - end); 28980 } 28981 if (isRegExp(separator)) { 28982 if (string.slice(end).search(separator)) { 28983 var match, 28984 substring = result; 28985 28986 if (!separator.global) { 28987 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); 28988 } 28989 separator.lastIndex = 0; 28990 while ((match = separator.exec(substring))) { 28991 var newEnd = match.index; 28992 } 28993 result = result.slice(0, newEnd === undefined ? end : newEnd); 28994 } 28995 } else if (string.indexOf(baseToString(separator), end) != end) { 28996 var index = result.lastIndexOf(separator); 28997 if (index > -1) { 28998 result = result.slice(0, index); 28999 } 29000 } 29001 return result + omission; 29002 } 29003 29004 /** 29005 * The inverse of `_.escape`; this method converts the HTML entities 29006 * `&`, `<`, `>`, `"`, and `'` in `string` to 29007 * their corresponding characters. 29008 * 29009 * **Note:** No other HTML entities are unescaped. To unescape additional 29010 * HTML entities use a third-party library like [_he_](https://mths.be/he). 29011 * 29012 * @static 29013 * @memberOf _ 29014 * @since 0.6.0 29015 * @category String 29016 * @param {string} [string=''] The string to unescape. 29017 * @returns {string} Returns the unescaped string. 29018 * @example 29019 * 29020 * _.unescape('fred, barney, & pebbles'); 29021 * // => 'fred, barney, & pebbles' 29022 */ 29023 function unescape(string) { 29024 string = toString(string); 29025 return (string && reHasEscapedHtml.test(string)) 29026 ? string.replace(reEscapedHtml, unescapeHtmlChar) 29027 : string; 29028 } 29029 29030 /** 29031 * Converts `string`, as space separated words, to upper case. 29032 * 29033 * @static 29034 * @memberOf _ 29035 * @since 4.0.0 29036 * @category String 29037 * @param {string} [string=''] The string to convert. 29038 * @returns {string} Returns the upper cased string. 29039 * @example 29040 * 29041 * _.upperCase('--foo-bar'); 29042 * // => 'FOO BAR' 29043 * 29044 * _.upperCase('fooBar'); 29045 * // => 'FOO BAR' 29046 * 29047 * _.upperCase('__foo_bar__'); 29048 * // => 'FOO BAR' 29049 */ 29050 var upperCase = createCompounder(function(result, word, index) { 29051 return result + (index ? ' ' : '') + word.toUpperCase(); 29052 }); 29053 29054 /** 29055 * Converts the first character of `string` to upper case. 29056 * 29057 * @static 29058 * @memberOf _ 29059 * @since 4.0.0 29060 * @category String 29061 * @param {string} [string=''] The string to convert. 29062 * @returns {string} Returns the converted string. 29063 * @example 29064 * 29065 * _.upperFirst('fred'); 29066 * // => 'Fred' 29067 * 29068 * _.upperFirst('FRED'); 29069 * // => 'FRED' 29070 */ 29071 var upperFirst = createCaseFirst('toUpperCase'); 29072 29073 /** 29074 * Splits `string` into an array of its words. 29075 * 29076 * @static 29077 * @memberOf _ 29078 * @since 3.0.0 29079 * @category String 29080 * @param {string} [string=''] The string to inspect. 29081 * @param {RegExp|string} [pattern] The pattern to match words. 29082 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 29083 * @returns {Array} Returns the words of `string`. 29084 * @example 29085 * 29086 * _.words('fred, barney, & pebbles'); 29087 * // => ['fred', 'barney', 'pebbles'] 29088 * 29089 * _.words('fred, barney, & pebbles', /[^, ]+/g); 29090 * // => ['fred', 'barney', '&', 'pebbles'] 29091 */ 29092 function words(string, pattern, guard) { 29093 string = toString(string); 29094 pattern = guard ? undefined : pattern; 29095 29096 if (pattern === undefined) { 29097 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 29098 } 29099 return string.match(pattern) || []; 29100 } 29101 29102 /*------------------------------------------------------------------------*/ 29103 29104 /** 29105 * Attempts to invoke `func`, returning either the result or the caught error 29106 * object. Any additional arguments are provided to `func` when it's invoked. 29107 * 29108 * @static 29109 * @memberOf _ 29110 * @since 3.0.0 29111 * @category Util 29112 * @param {Function} func The function to attempt. 29113 * @param {...*} [args] The arguments to invoke `func` with. 29114 * @returns {*} Returns the `func` result or error object. 29115 * @example 29116 * 29117 * // Avoid throwing errors for invalid selectors. 29118 * var elements = _.attempt(function(selector) { 29119 * return document.querySelectorAll(selector); 29120 * }, '>_>'); 29121 * 29122 * if (_.isError(elements)) { 29123 * elements = []; 29124 * } 29125 */ 29126 var attempt = baseRest(function(func, args) { 29127 try { 29128 return apply(func, undefined, args); 29129 } catch (e) { 29130 return isError(e) ? e : new Error(e); 29131 } 29132 }); 29133 29134 /** 29135 * Binds methods of an object to the object itself, overwriting the existing 29136 * method. 29137 * 29138 * **Note:** This method doesn't set the "length" property of bound functions. 29139 * 29140 * @static 29141 * @since 0.1.0 29142 * @memberOf _ 29143 * @category Util 29144 * @param {Object} object The object to bind and assign the bound methods to. 29145 * @param {...(string|string[])} methodNames The object method names to bind. 29146 * @returns {Object} Returns `object`. 29147 * @example 29148 * 29149 * var view = { 29150 * 'label': 'docs', 29151 * 'click': function() { 29152 * console.log('clicked ' + this.label); 29153 * } 29154 * }; 29155 * 29156 * _.bindAll(view, ['click']); 29157 * jQuery(element).on('click', view.click); 29158 * // => Logs 'clicked docs' when clicked. 29159 */ 29160 var bindAll = flatRest(function(object, methodNames) { 29161 arrayEach(methodNames, function(key) { 29162 key = toKey(key); 29163 baseAssignValue(object, key, bind(object[key], object)); 29164 }); 29165 return object; 29166 }); 29167 29168 /** 29169 * Creates a function that iterates over `pairs` and invokes the corresponding 29170 * function of the first predicate to return truthy. The predicate-function 29171 * pairs are invoked with the `this` binding and arguments of the created 29172 * function. 29173 * 29174 * @static 29175 * @memberOf _ 29176 * @since 4.0.0 29177 * @category Util 29178 * @param {Array} pairs The predicate-function pairs. 29179 * @returns {Function} Returns the new composite function. 29180 * @example 29181 * 29182 * var func = _.cond([ 29183 * [_.matches({ 'a': 1 }), _.constant('matches A')], 29184 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 29185 * [_.stubTrue, _.constant('no match')] 29186 * ]); 29187 * 29188 * func({ 'a': 1, 'b': 2 }); 29189 * // => 'matches A' 29190 * 29191 * func({ 'a': 0, 'b': 1 }); 29192 * // => 'matches B' 29193 * 29194 * func({ 'a': '1', 'b': '2' }); 29195 * // => 'no match' 29196 */ 29197 function cond(pairs) { 29198 var length = pairs == null ? 0 : pairs.length, 29199 toIteratee = getIteratee(); 29200 29201 pairs = !length ? [] : arrayMap(pairs, function(pair) { 29202 if (typeof pair[1] != 'function') { 29203 throw new TypeError(FUNC_ERROR_TEXT); 29204 } 29205 return [toIteratee(pair[0]), pair[1]]; 29206 }); 29207 29208 return baseRest(function(args) { 29209 var index = -1; 29210 while (++index < length) { 29211 var pair = pairs[index];
vendor: 10,296 bytes, lines 29212-29544
29212 if (apply(pair[0], this, args)) { 29213 return apply(pair[1], this, args); 29214 } 29215 } 29216 }); 29217 } 29218 29219 /** 29220 * Creates a function that invokes the predicate properties of `source` with 29221 * the corresponding property values of a given object, returning `true` if 29222 * all predicates return truthy, else `false`. 29223 * 29224 * **Note:** The created function is equivalent to `_.conformsTo` with 29225 * `source` partially applied. 29226 * 29227 * @static 29228 * @memberOf _ 29229 * @since 4.0.0 29230 * @category Util 29231 * @param {Object} source The object of property predicates to conform to. 29232 * @returns {Function} Returns the new spec function. 29233 * @example 29234 * 29235 * var objects = [ 29236 * { 'a': 2, 'b': 1 }, 29237 * { 'a': 1, 'b': 2 } 29238 * ]; 29239 * 29240 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 29241 * // => [{ 'a': 1, 'b': 2 }] 29242 */ 29243 function conforms(source) { 29244 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 29245 } 29246 29247 /** 29248 * Creates a function that returns `value`. 29249 * 29250 * @static 29251 * @memberOf _ 29252 * @since 2.4.0 29253 * @category Util 29254 * @param {*} value The value to return from the new function. 29255 * @returns {Function} Returns the new constant function. 29256 * @example 29257 * 29258 * var objects = _.times(2, _.constant({ 'a': 1 })); 29259 * 29260 * console.log(objects); 29261 * // => [{ 'a': 1 }, { 'a': 1 }] 29262 * 29263 * console.log(objects[0] === objects[1]); 29264 * // => true 29265 */ 29266 function constant(value) { 29267 return function() { 29268 return value; 29269 }; 29270 } 29271 29272 /** 29273 * Checks `value` to determine whether a default value should be returned in 29274 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 29275 * or `undefined`. 29276 * 29277 * @static 29278 * @memberOf _ 29279 * @since 4.14.0 29280 * @category Util 29281 * @param {*} value The value to check. 29282 * @param {*} defaultValue The default value. 29283 * @returns {*} Returns the resolved value. 29284 * @example 29285 * 29286 * _.defaultTo(1, 10); 29287 * // => 1 29288 * 29289 * _.defaultTo(undefined, 10); 29290 * // => 10 29291 */ 29292 function defaultTo(value, defaultValue) { 29293 return (value == null || value !== value) ? defaultValue : value; 29294 } 29295 29296 /** 29297 * Creates a function that returns the result of invoking the given functions 29298 * with the `this` binding of the created function, where each successive 29299 * invocation is supplied the return value of the previous. 29300 * 29301 * @static 29302 * @memberOf _ 29303 * @since 3.0.0 29304 * @category Util 29305 * @param {...(Function|Function[])} [funcs] The functions to invoke. 29306 * @returns {Function} Returns the new composite function. 29307 * @see _.flowRight 29308 * @example 29309 * 29310 * function square(n) { 29311 * return n * n; 29312 * } 29313 * 29314 * var addSquare = _.flow([_.add, square]); 29315 * addSquare(1, 2); 29316 * // => 9 29317 */ 29318 var flow = createFlow(); 29319 29320 /** 29321 * This method is like `_.flow` except that it creates a function that 29322 * invokes the given functions from right to left. 29323 * 29324 * @static 29325 * @since 3.0.0 29326 * @memberOf _ 29327 * @category Util 29328 * @param {...(Function|Function[])} [funcs] The functions to invoke. 29329 * @returns {Function} Returns the new composite function. 29330 * @see _.flow 29331 * @example 29332 * 29333 * function square(n) { 29334 * return n * n; 29335 * } 29336 * 29337 * var addSquare = _.flowRight([square, _.add]); 29338 * addSquare(1, 2); 29339 * // => 9 29340 */ 29341 var flowRight = createFlow(true); 29342 29343 /** 29344 * This method returns the first argument it receives. 29345 * 29346 * @static 29347 * @since 0.1.0 29348 * @memberOf _ 29349 * @category Util 29350 * @param {*} value Any value. 29351 * @returns {*} Returns `value`. 29352 * @example 29353 * 29354 * var object = { 'a': 1 }; 29355 * 29356 * console.log(_.identity(object) === object); 29357 * // => true 29358 */ 29359 function identity(value) { 29360 return value; 29361 } 29362 29363 /** 29364 * Creates a function that invokes `func` with the arguments of the created 29365 * function. If `func` is a property name, the created function returns the 29366 * property value for a given element. If `func` is an array or object, the 29367 * created function returns `true` for elements that contain the equivalent 29368 * source properties, otherwise it returns `false`. 29369 * 29370 * @static 29371 * @since 4.0.0 29372 * @memberOf _ 29373 * @category Util 29374 * @param {*} [func=_.identity] The value to convert to a callback. 29375 * @returns {Function} Returns the callback. 29376 * @example 29377 * 29378 * var users = [ 29379 * { 'user': 'barney', 'age': 36, 'active': true }, 29380 * { 'user': 'fred', 'age': 40, 'active': false } 29381 * ]; 29382 * 29383 * // The `_.matches` iteratee shorthand. 29384 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 29385 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 29386 * 29387 * // The `_.matchesProperty` iteratee shorthand. 29388 * _.filter(users, _.iteratee(['user', 'fred'])); 29389 * // => [{ 'user': 'fred', 'age': 40 }] 29390 * 29391 * // The `_.property` iteratee shorthand. 29392 * _.map(users, _.iteratee('user')); 29393 * // => ['barney', 'fred'] 29394 * 29395 * // Create custom iteratee shorthands. 29396 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 29397 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 29398 * return func.test(string); 29399 * }; 29400 * }); 29401 * 29402 * _.filter(['abc', 'def'], /ef/); 29403 * // => ['def'] 29404 */ 29405 function iteratee(func) { 29406 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); 29407 } 29408 29409 /** 29410 * Creates a function that performs a partial deep comparison between a given 29411 * object and `source`, returning `true` if the given object has equivalent 29412 * property values, else `false`. 29413 * 29414 * **Note:** The created function is equivalent to `_.isMatch` with `source` 29415 * partially applied. 29416 * 29417 * Partial comparisons will match empty array and empty object `source` 29418 * values against any array or object value, respectively. See `_.isEqual` 29419 * for a list of supported value comparisons. 29420 * 29421 * **Note:** Multiple values can be checked by combining several matchers 29422 * using `_.overSome` 29423 * 29424 * @static 29425 * @memberOf _ 29426 * @since 3.0.0 29427 * @category Util 29428 * @param {Object} source The object of property values to match. 29429 * @returns {Function} Returns the new spec function. 29430 * @example 29431 * 29432 * var objects = [ 29433 * { 'a': 1, 'b': 2, 'c': 3 }, 29434 * { 'a': 4, 'b': 5, 'c': 6 } 29435 * ]; 29436 * 29437 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 29438 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 29439 * 29440 * // Checking for several possible values 29441 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 29442 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 29443 */ 29444 function matches(source) { 29445 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 29446 } 29447 29448 /** 29449 * Creates a function that performs a partial deep comparison between the 29450 * value at `path` of a given object to `srcValue`, returning `true` if the 29451 * object value is equivalent, else `false`. 29452 * 29453 * **Note:** Partial comparisons will match empty array and empty object 29454 * `srcValue` values against any array or object value, respectively. See 29455 * `_.isEqual` for a list of supported value comparisons. 29456 * 29457 * **Note:** Multiple values can be checked by combining several matchers 29458 * using `_.overSome` 29459 * 29460 * @static 29461 * @memberOf _ 29462 * @since 3.2.0 29463 * @category Util 29464 * @param {Array|string} path The path of the property to get. 29465 * @param {*} srcValue The value to match. 29466 * @returns {Function} Returns the new spec function. 29467 * @example 29468 * 29469 * var objects = [ 29470 * { 'a': 1, 'b': 2, 'c': 3 }, 29471 * { 'a': 4, 'b': 5, 'c': 6 } 29472 * ]; 29473 * 29474 * _.find(objects, _.matchesProperty('a', 4)); 29475 * // => { 'a': 4, 'b': 5, 'c': 6 } 29476 * 29477 * // Checking for several possible values 29478 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 29479 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 29480 */ 29481 function matchesProperty(path, srcValue) { 29482 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 29483 } 29484 29485 /** 29486 * Creates a function that invokes the method at `path` of a given object. 29487 * Any additional arguments are provided to the invoked method. 29488 * 29489 * @static 29490 * @memberOf _ 29491 * @since 3.7.0 29492 * @category Util 29493 * @param {Array|string} path The path of the method to invoke. 29494 * @param {...*} [args] The arguments to invoke the method with. 29495 * @returns {Function} Returns the new invoker function. 29496 * @example 29497 * 29498 * var objects = [ 29499 * { 'a': { 'b': _.constant(2) } }, 29500 * { 'a': { 'b': _.constant(1) } } 29501 * ]; 29502 * 29503 * _.map(objects, _.method('a.b')); 29504 * // => [2, 1] 29505 * 29506 * _.map(objects, _.method(['a', 'b'])); 29507 * // => [2, 1] 29508 */ 29509 var method = baseRest(function(path, args) { 29510 return function(object) { 29511 return baseInvoke(object, path, args); 29512 }; 29513 }); 29514 29515 /** 29516 * The opposite of `_.method`; this method creates a function that invokes 29517 * the method at a given path of `object`. Any additional arguments are 29518 * provided to the invoked method. 29519 * 29520 * @static 29521 * @memberOf _ 29522 * @since 3.7.0 29523 * @category Util 29524 * @param {Object} object The object to query. 29525 * @param {...*} [args] The arguments to invoke the method with. 29526 * @returns {Function} Returns the new invoker function. 29527 * @example 29528 * 29529 * var array = _.times(3, _.constant), 29530 * object = { 'a': array, 'b': array, 'c': array }; 29531 * 29532 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 29533 * // => [2, 0] 29534 * 29535 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 29536 * // => [2, 0] 29537 */ 29538 var methodOf = baseRest(function(object, args) { 29539 return function(path) { 29540 return baseInvoke(object, path, args); 29541 }; 29542 }); 29543 29544 /**
vendor: 10,734 bytes, lines 29545-29932
29545 * Adds all own enumerable string keyed function properties of a source 29546 * object to the destination object. If `object` is a function, then methods 29547 * are added to its prototype as well. 29548 * 29549 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 29550 * avoid conflicts caused by modifying the original. 29551 * 29552 * @static 29553 * @since 0.1.0 29554 * @memberOf _ 29555 * @category Util 29556 * @param {Function|Object} [object=lodash] The destination object. 29557 * @param {Object} source The object of functions to add. 29558 * @param {Object} [options={}] The options object. 29559 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 29560 * @returns {Function|Object} Returns `object`. 29561 * @example 29562 * 29563 * function vowels(string) { 29564 * return _.filter(string, function(v) { 29565 * return /[aeiou]/i.test(v); 29566 * }); 29567 * } 29568 * 29569 * _.mixin({ 'vowels': vowels }); 29570 * _.vowels('fred'); 29571 * // => ['e'] 29572 * 29573 * _('fred').vowels().value(); 29574 * // => ['e'] 29575 * 29576 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 29577 * _('fred').vowels(); 29578 * // => ['e'] 29579 */ 29580 function mixin(object, source, options) { 29581 var props = keys(source), 29582 methodNames = baseFunctions(source, props); 29583 29584 if (options == null && 29585 !(isObject(source) && (methodNames.length || !props.length))) { 29586 options = source; 29587 source = object; 29588 object = this; 29589 methodNames = baseFunctions(source, keys(source)); 29590 } 29591 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 29592 isFunc = isFunction(object); 29593 29594 arrayEach(methodNames, function(methodName) { 29595 var func = source[methodName]; 29596 object[methodName] = func; 29597 if (isFunc) { 29598 object.prototype[methodName] = function() { 29599 var chainAll = this.__chain__; 29600 if (chain || chainAll) { 29601 var result = object(this.__wrapped__), 29602 actions = result.__actions__ = copyArray(this.__actions__); 29603 29604 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 29605 result.__chain__ = chainAll; 29606 return result; 29607 } 29608 return func.apply(object, arrayPush([this.value()], arguments)); 29609 }; 29610 } 29611 }); 29612 29613 return object; 29614 } 29615 29616 /** 29617 * Reverts the `_` variable to its previous value and returns a reference to 29618 * the `lodash` function. 29619 * 29620 * @static 29621 * @since 0.1.0 29622 * @memberOf _ 29623 * @category Util 29624 * @returns {Function} Returns the `lodash` function. 29625 * @example 29626 * 29627 * var lodash = _.noConflict(); 29628 */ 29629 function noConflict() { 29630 if (root._ === this) { 29631 root._ = oldDash; 29632 } 29633 return this; 29634 } 29635 29636 /** 29637 * This method returns `undefined`. 29638 * 29639 * @static 29640 * @memberOf _ 29641 * @since 2.3.0 29642 * @category Util 29643 * @example 29644 * 29645 * _.times(2, _.noop); 29646 * // => [undefined, undefined] 29647 */ 29648 function noop() { 29649 // No operation performed. 29650 } 29651 29652 /** 29653 * Creates a function that gets the argument at index `n`. If `n` is negative, 29654 * the nth argument from the end is returned. 29655 * 29656 * @static 29657 * @memberOf _ 29658 * @since 4.0.0 29659 * @category Util 29660 * @param {number} [n=0] The index of the argument to return. 29661 * @returns {Function} Returns the new pass-thru function. 29662 * @example 29663 * 29664 * var func = _.nthArg(1); 29665 * func('a', 'b', 'c', 'd'); 29666 * // => 'b' 29667 * 29668 * var func = _.nthArg(-2); 29669 * func('a', 'b', 'c', 'd'); 29670 * // => 'c' 29671 */ 29672 function nthArg(n) { 29673 n = toInteger(n); 29674 return baseRest(function(args) { 29675 return baseNth(args, n); 29676 }); 29677 } 29678 29679 /** 29680 * Creates a function that invokes `iteratees` with the arguments it receives 29681 * and returns their results. 29682 * 29683 * @static 29684 * @memberOf _ 29685 * @since 4.0.0 29686 * @category Util 29687 * @param {...(Function|Function[])} [iteratees=[_.identity]] 29688 * The iteratees to invoke. 29689 * @returns {Function} Returns the new function. 29690 * @example 29691 * 29692 * var func = _.over([Math.max, Math.min]); 29693 * 29694 * func(1, 2, 3, 4); 29695 * // => [4, 1] 29696 */ 29697 var over = createOver(arrayMap); 29698 29699 /** 29700 * Creates a function that checks if **all** of the `predicates` return 29701 * truthy when invoked with the arguments it receives. 29702 * 29703 * Following shorthands are possible for providing predicates. 29704 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 29705 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 29706 * 29707 * @static 29708 * @memberOf _ 29709 * @since 4.0.0 29710 * @category Util 29711 * @param {...(Function|Function[])} [predicates=[_.identity]] 29712 * The predicates to check. 29713 * @returns {Function} Returns the new function. 29714 * @example 29715 * 29716 * var func = _.overEvery([Boolean, isFinite]); 29717 * 29718 * func('1'); 29719 * // => true 29720 * 29721 * func(null); 29722 * // => false 29723 * 29724 * func(NaN); 29725 * // => false 29726 */ 29727 var overEvery = createOver(arrayEvery); 29728 29729 /** 29730 * Creates a function that checks if **any** of the `predicates` return 29731 * truthy when invoked with the arguments it receives. 29732 * 29733 * Following shorthands are possible for providing predicates. 29734 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 29735 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 29736 * 29737 * @static 29738 * @memberOf _ 29739 * @since 4.0.0 29740 * @category Util 29741 * @param {...(Function|Function[])} [predicates=[_.identity]] 29742 * The predicates to check. 29743 * @returns {Function} Returns the new function. 29744 * @example 29745 * 29746 * var func = _.overSome([Boolean, isFinite]); 29747 * 29748 * func('1'); 29749 * // => true 29750 * 29751 * func(null); 29752 * // => true 29753 * 29754 * func(NaN); 29755 * // => false 29756 * 29757 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 29758 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 29759 */ 29760 var overSome = createOver(arraySome); 29761 29762 /** 29763 * Creates a function that returns the value at `path` of a given object. 29764 * 29765 * @static 29766 * @memberOf _ 29767 * @since 2.4.0 29768 * @category Util 29769 * @param {Array|string} path The path of the property to get. 29770 * @returns {Function} Returns the new accessor function. 29771 * @example 29772 * 29773 * var objects = [ 29774 * { 'a': { 'b': 2 } }, 29775 * { 'a': { 'b': 1 } } 29776 * ]; 29777 * 29778 * _.map(objects, _.property('a.b')); 29779 * // => [2, 1] 29780 * 29781 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 29782 * // => [1, 2] 29783 */ 29784 function property(path) { 29785 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 29786 } 29787 29788 /** 29789 * The opposite of `_.property`; this method creates a function that returns 29790 * the value at a given path of `object`. 29791 * 29792 * @static 29793 * @memberOf _ 29794 * @since 3.0.0 29795 * @category Util 29796 * @param {Object} object The object to query. 29797 * @returns {Function} Returns the new accessor function. 29798 * @example 29799 * 29800 * var array = [0, 1, 2], 29801 * object = { 'a': array, 'b': array, 'c': array }; 29802 * 29803 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 29804 * // => [2, 0] 29805 * 29806 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 29807 * // => [2, 0] 29808 */ 29809 function propertyOf(object) { 29810 return function(path) { 29811 return object == null ? undefined : baseGet(object, path); 29812 }; 29813 } 29814 29815 /** 29816 * Creates an array of numbers (positive and/or negative) progressing from 29817 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 29818 * `start` is specified without an `end` or `step`. If `end` is not specified, 29819 * it's set to `start` with `start` then set to `0`. 29820 * 29821 * **Note:** JavaScript follows the IEEE-754 standard for resolving 29822 * floating-point values which can produce unexpected results. 29823 * 29824 * @static 29825 * @since 0.1.0 29826 * @memberOf _ 29827 * @category Util 29828 * @param {number} [start=0] The start of the range. 29829 * @param {number} end The end of the range. 29830 * @param {number} [step=1] The value to increment or decrement by. 29831 * @returns {Array} Returns the range of numbers. 29832 * @see _.inRange, _.rangeRight 29833 * @example 29834 * 29835 * _.range(4); 29836 * // => [0, 1, 2, 3] 29837 * 29838 * _.range(-4); 29839 * // => [0, -1, -2, -3] 29840 * 29841 * _.range(1, 5); 29842 * // => [1, 2, 3, 4] 29843 * 29844 * _.range(0, 20, 5); 29845 * // => [0, 5, 10, 15] 29846 * 29847 * _.range(0, -4, -1); 29848 * // => [0, -1, -2, -3] 29849 * 29850 * _.range(1, 4, 0); 29851 * // => [1, 1, 1] 29852 * 29853 * _.range(0); 29854 * // => [] 29855 */ 29856 var range = createRange(); 29857 29858 /** 29859 * This method is like `_.range` except that it populates values in 29860 * descending order. 29861 * 29862 * @static 29863 * @memberOf _ 29864 * @since 4.0.0 29865 * @category Util 29866 * @param {number} [start=0] The start of the range. 29867 * @param {number} end The end of the range. 29868 * @param {number} [step=1] The value to increment or decrement by. 29869 * @returns {Array} Returns the range of numbers. 29870 * @see _.inRange, _.range 29871 * @example 29872 * 29873 * _.rangeRight(4); 29874 * // => [3, 2, 1, 0] 29875 * 29876 * _.rangeRight(-4); 29877 * // => [-3, -2, -1, 0] 29878 * 29879 * _.rangeRight(1, 5); 29880 * // => [4, 3, 2, 1] 29881 * 29882 * _.rangeRight(0, 20, 5); 29883 * // => [15, 10, 5, 0] 29884 * 29885 * _.rangeRight(0, -4, -1); 29886 * // => [-3, -2, -1, 0] 29887 * 29888 * _.rangeRight(1, 4, 0); 29889 * // => [1, 1, 1] 29890 * 29891 * _.rangeRight(0); 29892 * // => [] 29893 */ 29894 var rangeRight = createRange(true); 29895 29896 /** 29897 * This method returns a new empty array. 29898 * 29899 * @static 29900 * @memberOf _ 29901 * @since 4.13.0 29902 * @category Util 29903 * @returns {Array} Returns the new empty array. 29904 * @example 29905 * 29906 * var arrays = _.times(2, _.stubArray); 29907 * 29908 * console.log(arrays); 29909 * // => [[], []] 29910 * 29911 * console.log(arrays[0] === arrays[1]); 29912 * // => false 29913 */ 29914 function stubArray() { 29915 return []; 29916 } 29917 29918 /** 29919 * This method returns `false`. 29920 * 29921 * @static 29922 * @memberOf _ 29923 * @since 4.13.0 29924 * @category Util 29925 * @returns {boolean} Returns `false`. 29926 * @example 29927 * 29928 * _.times(2, _.stubFalse); 29929 * // => [false, false] 29930 */ 29931 function stubFalse() { 29932 return false;
vendor: 1,044 bytes, lines 29933-29986
29933 } 29934 29935 /** 29936 * This method returns a new empty object. 29937 * 29938 * @static 29939 * @memberOf _ 29940 * @since 4.13.0 29941 * @category Util 29942 * @returns {Object} Returns the new empty object. 29943 * @example 29944 * 29945 * var objects = _.times(2, _.stubObject); 29946 * 29947 * console.log(objects); 29948 * // => [{}, {}] 29949 * 29950 * console.log(objects[0] === objects[1]); 29951 * // => false 29952 */ 29953 function stubObject() { 29954 return {}; 29955 } 29956 29957 /** 29958 * This method returns an empty string. 29959 * 29960 * @static 29961 * @memberOf _ 29962 * @since 4.13.0 29963 * @category Util 29964 * @returns {string} Returns the empty string. 29965 * @example 29966 * 29967 * _.times(2, _.stubString); 29968 * // => ['', ''] 29969 */ 29970 function stubString() { 29971 return ''; 29972 } 29973 29974 /** 29975 * This method returns `true`. 29976 * 29977 * @static 29978 * @memberOf _ 29979 * @since 4.13.0 29980 * @category Util 29981 * @returns {boolean} Returns `true`. 29982 * @example 29983 * 29984 * _.times(2, _.stubTrue); 29985 * // => [true, true] 29986 */
vendor: 9,081 bytes, lines 29987-30330
29987 function stubTrue() { 29988 return true; 29989 } 29990 29991 /** 29992 * Invokes the iteratee `n` times, returning an array of the results of 29993 * each invocation. The iteratee is invoked with one argument; (index). 29994 * 29995 * @static 29996 * @since 0.1.0 29997 * @memberOf _ 29998 * @category Util 29999 * @param {number} n The number of times to invoke `iteratee`. 30000 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 30001 * @returns {Array} Returns the array of results. 30002 * @example 30003 * 30004 * _.times(3, String); 30005 * // => ['0', '1', '2'] 30006 * 30007 * _.times(4, _.constant(0)); 30008 * // => [0, 0, 0, 0] 30009 */ 30010 function times(n, iteratee) { 30011 n = toInteger(n); 30012 if (n < 1 || n > MAX_SAFE_INTEGER) { 30013 return []; 30014 } 30015 var index = MAX_ARRAY_LENGTH, 30016 length = nativeMin(n, MAX_ARRAY_LENGTH); 30017 30018 iteratee = getIteratee(iteratee); 30019 n -= MAX_ARRAY_LENGTH; 30020 30021 var result = baseTimes(length, iteratee); 30022 while (++index < n) { 30023 iteratee(index); 30024 } 30025 return result; 30026 } 30027 30028 /** 30029 * Converts `value` to a property path array. 30030 * 30031 * @static 30032 * @memberOf _ 30033 * @since 4.0.0 30034 * @category Util 30035 * @param {*} value The value to convert. 30036 * @returns {Array} Returns the new property path array. 30037 * @example 30038 * 30039 * _.toPath('a.b.c'); 30040 * // => ['a', 'b', 'c'] 30041 * 30042 * _.toPath('a[0].b.c'); 30043 * // => ['a', '0', 'b', 'c'] 30044 */ 30045 function toPath(value) { 30046 if (isArray(value)) { 30047 return arrayMap(value, toKey); 30048 } 30049 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 30050 } 30051 30052 /** 30053 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 30054 * 30055 * @static 30056 * @since 0.1.0 30057 * @memberOf _ 30058 * @category Util 30059 * @param {string} [prefix=''] The value to prefix the ID with. 30060 * @returns {string} Returns the unique ID. 30061 * @example 30062 * 30063 * _.uniqueId('contact_'); 30064 * // => 'contact_104' 30065 * 30066 * _.uniqueId(); 30067 * // => '105' 30068 */ 30069 function uniqueId(prefix) { 30070 var id = ++idCounter; 30071 return toString(prefix) + id; 30072 } 30073 30074 /*------------------------------------------------------------------------*/ 30075 30076 /** 30077 * Adds two numbers. 30078 * 30079 * @static 30080 * @memberOf _ 30081 * @since 3.4.0 30082 * @category Math 30083 * @param {number} augend The first number in an addition. 30084 * @param {number} addend The second number in an addition. 30085 * @returns {number} Returns the total. 30086 * @example 30087 * 30088 * _.add(6, 4); 30089 * // => 10 30090 */ 30091 var add = createMathOperation(function(augend, addend) { 30092 return augend + addend; 30093 }, 0); 30094 30095 /** 30096 * Computes `number` rounded up to `precision`. 30097 * 30098 * @static 30099 * @memberOf _ 30100 * @since 3.10.0 30101 * @category Math 30102 * @param {number} number The number to round up. 30103 * @param {number} [precision=0] The precision to round up to. 30104 * @returns {number} Returns the rounded up number. 30105 * @example 30106 * 30107 * _.ceil(4.006); 30108 * // => 5 30109 * 30110 * _.ceil(6.004, 2); 30111 * // => 6.01 30112 * 30113 * _.ceil(6040, -2); 30114 * // => 6100 30115 */ 30116 var ceil = createRound('ceil'); 30117 30118 /** 30119 * Divide two numbers. 30120 * 30121 * @static 30122 * @memberOf _ 30123 * @since 4.7.0 30124 * @category Math 30125 * @param {number} dividend The first number in a division. 30126 * @param {number} divisor The second number in a division. 30127 * @returns {number} Returns the quotient. 30128 * @example 30129 * 30130 * _.divide(6, 4); 30131 * // => 1.5 30132 */ 30133 var divide = createMathOperation(function(dividend, divisor) { 30134 return dividend / divisor; 30135 }, 1); 30136 30137 /** 30138 * Computes `number` rounded down to `precision`. 30139 * 30140 * @static 30141 * @memberOf _ 30142 * @since 3.10.0 30143 * @category Math 30144 * @param {number} number The number to round down. 30145 * @param {number} [precision=0] The precision to round down to. 30146 * @returns {number} Returns the rounded down number. 30147 * @example 30148 * 30149 * _.floor(4.006); 30150 * // => 4 30151 * 30152 * _.floor(0.046, 2); 30153 * // => 0.04 30154 * 30155 * _.floor(4060, -2); 30156 * // => 4000 30157 */ 30158 var floor = createRound('floor'); 30159 30160 /** 30161 * Computes the maximum value of `array`. If `array` is empty or falsey, 30162 * `undefined` is returned. 30163 * 30164 * @static 30165 * @since 0.1.0 30166 * @memberOf _ 30167 * @category Math 30168 * @param {Array} array The array to iterate over. 30169 * @returns {*} Returns the maximum value. 30170 * @example 30171 * 30172 * _.max([4, 2, 8, 6]); 30173 * // => 8 30174 * 30175 * _.max([]); 30176 * // => undefined 30177 */ 30178 function max(array) { 30179 return (array && array.length) 30180 ? baseExtremum(array, identity, baseGt) 30181 : undefined; 30182 } 30183 30184 /** 30185 * This method is like `_.max` except that it accepts `iteratee` which is 30186 * invoked for each element in `array` to generate the criterion by which 30187 * the value is ranked. The iteratee is invoked with one argument: (value). 30188 * 30189 * @static 30190 * @memberOf _ 30191 * @since 4.0.0 30192 * @category Math 30193 * @param {Array} array The array to iterate over. 30194 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 30195 * @returns {*} Returns the maximum value. 30196 * @example 30197 * 30198 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 30199 * 30200 * _.maxBy(objects, function(o) { return o.n; }); 30201 * // => { 'n': 2 } 30202 * 30203 * // The `_.property` iteratee shorthand. 30204 * _.maxBy(objects, 'n'); 30205 * // => { 'n': 2 } 30206 */ 30207 function maxBy(array, iteratee) { 30208 return (array && array.length) 30209 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) 30210 : undefined; 30211 } 30212 30213 /** 30214 * Computes the mean of the values in `array`. 30215 * 30216 * @static 30217 * @memberOf _ 30218 * @since 4.0.0 30219 * @category Math 30220 * @param {Array} array The array to iterate over. 30221 * @returns {number} Returns the mean. 30222 * @example 30223 * 30224 * _.mean([4, 2, 8, 6]); 30225 * // => 5 30226 */ 30227 function mean(array) { 30228 return baseMean(array, identity); 30229 } 30230 30231 /** 30232 * This method is like `_.mean` except that it accepts `iteratee` which is 30233 * invoked for each element in `array` to generate the value to be averaged. 30234 * The iteratee is invoked with one argument: (value). 30235 * 30236 * @static 30237 * @memberOf _ 30238 * @since 4.7.0 30239 * @category Math 30240 * @param {Array} array The array to iterate over. 30241 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 30242 * @returns {number} Returns the mean. 30243 * @example 30244 * 30245 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 30246 * 30247 * _.meanBy(objects, function(o) { return o.n; }); 30248 * // => 5 30249 * 30250 * // The `_.property` iteratee shorthand. 30251 * _.meanBy(objects, 'n'); 30252 * // => 5 30253 */ 30254 function meanBy(array, iteratee) { 30255 return baseMean(array, getIteratee(iteratee, 2)); 30256 } 30257 30258 /** 30259 * Computes the minimum value of `array`. If `array` is empty or falsey, 30260 * `undefined` is returned. 30261 * 30262 * @static 30263 * @since 0.1.0 30264 * @memberOf _ 30265 * @category Math 30266 * @param {Array} array The array to iterate over. 30267 * @returns {*} Returns the minimum value. 30268 * @example 30269 * 30270 * _.min([4, 2, 8, 6]); 30271 * // => 2 30272 * 30273 * _.min([]); 30274 * // => undefined 30275 */ 30276 function min(array) { 30277 return (array && array.length) 30278 ? baseExtremum(array, identity, baseLt) 30279 : undefined; 30280 } 30281 30282 /** 30283 * This method is like `_.min` except that it accepts `iteratee` which is 30284 * invoked for each element in `array` to generate the criterion by which 30285 * the value is ranked. The iteratee is invoked with one argument: (value). 30286 * 30287 * @static 30288 * @memberOf _ 30289 * @since 4.0.0 30290 * @category Math 30291 * @param {Array} array The array to iterate over. 30292 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 30293 * @returns {*} Returns the minimum value. 30294 * @example 30295 * 30296 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 30297 * 30298 * _.minBy(objects, function(o) { return o.n; }); 30299 * // => { 'n': 1 } 30300 * 30301 * // The `_.property` iteratee shorthand. 30302 * _.minBy(objects, 'n'); 30303 * // => { 'n': 1 } 30304 */ 30305 function minBy(array, iteratee) { 30306 return (array && array.length) 30307 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) 30308 : undefined; 30309 } 30310 30311 /** 30312 * Multiply two numbers. 30313 * 30314 * @static 30315 * @memberOf _ 30316 * @since 4.7.0 30317 * @category Math 30318 * @param {number} multiplier The first number in a multiplication. 30319 * @param {number} multiplicand The second number in a multiplication. 30320 * @returns {number} Returns the product. 30321 * @example 30322 * 30323 * _.multiply(6, 4); 30324 * // => 24 30325 */ 30326 var multiply = createMathOperation(function(multiplier, multiplicand) { 30327 return multiplier * multiplicand; 30328 }, 1); 30329 30330 /**
vendor: 13,137 bytes, lines 30331-30769
30331 * Computes `number` rounded to `precision`. 30332 * 30333 * @static 30334 * @memberOf _ 30335 * @since 3.10.0 30336 * @category Math 30337 * @param {number} number The number to round. 30338 * @param {number} [precision=0] The precision to round to. 30339 * @returns {number} Returns the rounded number. 30340 * @example 30341 * 30342 * _.round(4.006); 30343 * // => 4 30344 * 30345 * _.round(4.006, 2); 30346 * // => 4.01 30347 * 30348 * _.round(4060, -2); 30349 * // => 4100 30350 */ 30351 var round = createRound('round'); 30352 30353 /** 30354 * Subtract two numbers. 30355 * 30356 * @static 30357 * @memberOf _ 30358 * @since 4.0.0 30359 * @category Math 30360 * @param {number} minuend The first number in a subtraction. 30361 * @param {number} subtrahend The second number in a subtraction. 30362 * @returns {number} Returns the difference. 30363 * @example 30364 * 30365 * _.subtract(6, 4); 30366 * // => 2 30367 */ 30368 var subtract = createMathOperation(function(minuend, subtrahend) { 30369 return minuend - subtrahend; 30370 }, 0); 30371 30372 /** 30373 * Computes the sum of the values in `array`. 30374 * 30375 * @static 30376 * @memberOf _ 30377 * @since 3.4.0 30378 * @category Math 30379 * @param {Array} array The array to iterate over. 30380 * @returns {number} Returns the sum. 30381 * @example 30382 * 30383 * _.sum([4, 2, 8, 6]); 30384 * // => 20 30385 */ 30386 function sum(array) { 30387 return (array && array.length) 30388 ? baseSum(array, identity) 30389 : 0; 30390 } 30391 30392 /** 30393 * This method is like `_.sum` except that it accepts `iteratee` which is 30394 * invoked for each element in `array` to generate the value to be summed. 30395 * The iteratee is invoked with one argument: (value). 30396 * 30397 * @static 30398 * @memberOf _ 30399 * @since 4.0.0 30400 * @category Math 30401 * @param {Array} array The array to iterate over. 30402 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 30403 * @returns {number} Returns the sum. 30404 * @example 30405 * 30406 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 30407 * 30408 * _.sumBy(objects, function(o) { return o.n; }); 30409 * // => 20 30410 * 30411 * // The `_.property` iteratee shorthand. 30412 * _.sumBy(objects, 'n'); 30413 * // => 20 30414 */ 30415 function sumBy(array, iteratee) { 30416 return (array && array.length) 30417 ? baseSum(array, getIteratee(iteratee, 2)) 30418 : 0; 30419 } 30420 30421 /*------------------------------------------------------------------------*/ 30422 30423 // Add methods that return wrapped values in chain sequences. 30424 lodash.after = after; 30425 lodash.ary = ary; 30426 lodash.assign = assign; 30427 lodash.assignIn = assignIn; 30428 lodash.assignInWith = assignInWith; 30429 lodash.assignWith = assignWith; 30430 lodash.at = at; 30431 lodash.before = before; 30432 lodash.bind = bind; 30433 lodash.bindAll = bindAll; 30434 lodash.bindKey = bindKey; 30435 lodash.castArray = castArray; 30436 lodash.chain = chain; 30437 lodash.chunk = chunk; 30438 lodash.compact = compact; 30439 lodash.concat = concat; 30440 lodash.cond = cond; 30441 lodash.conforms = conforms; 30442 lodash.constant = constant; 30443 lodash.countBy = countBy; 30444 lodash.create = create; 30445 lodash.curry = curry; 30446 lodash.curryRight = curryRight; 30447 lodash.debounce = debounce; 30448 lodash.defaults = defaults; 30449 lodash.defaultsDeep = defaultsDeep; 30450 lodash.defer = defer; 30451 lodash.delay = delay; 30452 lodash.difference = difference; 30453 lodash.differenceBy = differenceBy; 30454 lodash.differenceWith = differenceWith; 30455 lodash.drop = drop; 30456 lodash.dropRight = dropRight; 30457 lodash.dropRightWhile = dropRightWhile; 30458 lodash.dropWhile = dropWhile; 30459 lodash.fill = fill; 30460 lodash.filter = filter; 30461 lodash.flatMap = flatMap; 30462 lodash.flatMapDeep = flatMapDeep; 30463 lodash.flatMapDepth = flatMapDepth; 30464 lodash.flatten = flatten; 30465 lodash.flattenDeep = flattenDeep; 30466 lodash.flattenDepth = flattenDepth; 30467 lodash.flip = flip; 30468 lodash.flow = flow; 30469 lodash.flowRight = flowRight; 30470 lodash.fromPairs = fromPairs; 30471 lodash.functions = functions; 30472 lodash.functionsIn = functionsIn; 30473 lodash.groupBy = groupBy; 30474 lodash.initial = initial; 30475 lodash.intersection = intersection; 30476 lodash.intersectionBy = intersectionBy; 30477 lodash.intersectionWith = intersectionWith; 30478 lodash.invert = invert; 30479 lodash.invertBy = invertBy; 30480 lodash.invokeMap = invokeMap; 30481 lodash.iteratee = iteratee; 30482 lodash.keyBy = keyBy; 30483 lodash.keys = keys; 30484 lodash.keysIn = keysIn; 30485 lodash.map = map; 30486 lodash.mapKeys = mapKeys; 30487 lodash.mapValues = mapValues; 30488 lodash.matches = matches; 30489 lodash.matchesProperty = matchesProperty; 30490 lodash.memoize = memoize; 30491 lodash.merge = merge; 30492 lodash.mergeWith = mergeWith; 30493 lodash.method = method; 30494 lodash.methodOf = methodOf; 30495 lodash.mixin = mixin; 30496 lodash.negate = negate; 30497 lodash.nthArg = nthArg; 30498 lodash.omit = omit; 30499 lodash.omitBy = omitBy; 30500 lodash.once = once; 30501 lodash.orderBy = orderBy; 30502 lodash.over = over; 30503 lodash.overArgs = overArgs; 30504 lodash.overEvery = overEvery; 30505 lodash.overSome = overSome; 30506 lodash.partial = partial; 30507 lodash.partialRight = partialRight; 30508 lodash.partition = partition; 30509 lodash.pick = pick; 30510 lodash.pickBy = pickBy; 30511 lodash.property = property; 30512 lodash.propertyOf = propertyOf; 30513 lodash.pull = pull; 30514 lodash.pullAll = pullAll; 30515 lodash.pullAllBy = pullAllBy; 30516 lodash.pullAllWith = pullAllWith; 30517 lodash.pullAt = pullAt; 30518 lodash.range = range; 30519 lodash.rangeRight = rangeRight; 30520 lodash.rearg = rearg; 30521 lodash.reject = reject; 30522 lodash.remove = remove; 30523 lodash.rest = rest; 30524 lodash.reverse = reverse; 30525 lodash.sampleSize = sampleSize; 30526 lodash.set = set; 30527 lodash.setWith = setWith; 30528 lodash.shuffle = shuffle; 30529 lodash.slice = slice; 30530 lodash.sortBy = sortBy; 30531 lodash.sortedUniq = sortedUniq; 30532 lodash.sortedUniqBy = sortedUniqBy; 30533 lodash.split = split; 30534 lodash.spread = spread; 30535 lodash.tail = tail; 30536 lodash.take = take; 30537 lodash.takeRight = takeRight; 30538 lodash.takeRightWhile = takeRightWhile; 30539 lodash.takeWhile = takeWhile; 30540 lodash.tap = tap; 30541 lodash.throttle = throttle; 30542 lodash.thru = thru; 30543 lodash.toArray = toArray; 30544 lodash.toPairs = toPairs; 30545 lodash.toPairsIn = toPairsIn; 30546 lodash.toPath = toPath; 30547 lodash.toPlainObject = toPlainObject; 30548 lodash.transform = transform; 30549 lodash.unary = unary; 30550 lodash.union = union; 30551 lodash.unionBy = unionBy; 30552 lodash.unionWith = unionWith; 30553 lodash.uniq = uniq; 30554 lodash.uniqBy = uniqBy; 30555 lodash.uniqWith = uniqWith; 30556 lodash.unset = unset; 30557 lodash.unzip = unzip; 30558 lodash.unzipWith = unzipWith; 30559 lodash.update = update; 30560 lodash.updateWith = updateWith; 30561 lodash.values = values; 30562 lodash.valuesIn = valuesIn; 30563 lodash.without = without; 30564 lodash.words = words; 30565 lodash.wrap = wrap; 30566 lodash.xor = xor; 30567 lodash.xorBy = xorBy; 30568 lodash.xorWith = xorWith; 30569 lodash.zip = zip; 30570 lodash.zipObject = zipObject; 30571 lodash.zipObjectDeep = zipObjectDeep; 30572 lodash.zipWith = zipWith; 30573 30574 // Add aliases. 30575 lodash.entries = toPairs; 30576 lodash.entriesIn = toPairsIn; 30577 lodash.extend = assignIn; 30578 lodash.extendWith = assignInWith; 30579 30580 // Add methods to `lodash.prototype`. 30581 mixin(lodash, lodash); 30582 30583 /*------------------------------------------------------------------------*/ 30584 30585 // Add methods that return unwrapped values in chain sequences. 30586 lodash.add = add; 30587 lodash.attempt = attempt; 30588 lodash.camelCase = camelCase; 30589 lodash.capitalize = capitalize; 30590 lodash.ceil = ceil; 30591 lodash.clamp = clamp; 30592 lodash.clone = clone; 30593 lodash.cloneDeep = cloneDeep; 30594 lodash.cloneDeepWith = cloneDeepWith; 30595 lodash.cloneWith = cloneWith; 30596 lodash.conformsTo = conformsTo; 30597 lodash.deburr = deburr; 30598 lodash.defaultTo = defaultTo; 30599 lodash.divide = divide; 30600 lodash.endsWith = endsWith; 30601 lodash.eq = eq; 30602 lodash.escape = escape; 30603 lodash.escapeRegExp = escapeRegExp; 30604 lodash.every = every; 30605 lodash.find = find; 30606 lodash.findIndex = findIndex; 30607 lodash.findKey = findKey; 30608 lodash.findLast = findLast; 30609 lodash.findLastIndex = findLastIndex; 30610 lodash.findLastKey = findLastKey; 30611 lodash.floor = floor; 30612 lodash.forEach = forEach; 30613 lodash.forEachRight = forEachRight; 30614 lodash.forIn = forIn; 30615 lodash.forInRight = forInRight; 30616 lodash.forOwn = forOwn; 30617 lodash.forOwnRight = forOwnRight; 30618 lodash.get = get; 30619 lodash.gt = gt; 30620 lodash.gte = gte; 30621 lodash.has = has; 30622 lodash.hasIn = hasIn; 30623 lodash.head = head; 30624 lodash.identity = identity; 30625 lodash.includes = includes; 30626 lodash.indexOf = indexOf; 30627 lodash.inRange = inRange; 30628 lodash.invoke = invoke; 30629 lodash.isArguments = isArguments; 30630 lodash.isArray = isArray; 30631 lodash.isArrayBuffer = isArrayBuffer; 30632 lodash.isArrayLike = isArrayLike; 30633 lodash.isArrayLikeObject = isArrayLikeObject; 30634 lodash.isBoolean = isBoolean; 30635 lodash.isBuffer = isBuffer; 30636 lodash.isDate = isDate; 30637 lodash.isElement = isElement; 30638 lodash.isEmpty = isEmpty; 30639 lodash.isEqual = isEqual; 30640 lodash.isEqualWith = isEqualWith; 30641 lodash.isError = isError; 30642 lodash.isFinite = isFinite; 30643 lodash.isFunction = isFunction; 30644 lodash.isInteger = isInteger; 30645 lodash.isLength = isLength; 30646 lodash.isMap = isMap; 30647 lodash.isMatch = isMatch; 30648 lodash.isMatchWith = isMatchWith; 30649 lodash.isNaN = isNaN; 30650 lodash.isNative = isNative; 30651 lodash.isNil = isNil; 30652 lodash.isNull = isNull; 30653 lodash.isNumber = isNumber; 30654 lodash.isObject = isObject; 30655 lodash.isObjectLike = isObjectLike; 30656 lodash.isPlainObject = isPlainObject; 30657 lodash.isRegExp = isRegExp; 30658 lodash.isSafeInteger = isSafeInteger; 30659 lodash.isSet = isSet; 30660 lodash.isString = isString; 30661 lodash.isSymbol = isSymbol; 30662 lodash.isTypedArray = isTypedArray; 30663 lodash.isUndefined = isUndefined; 30664 lodash.isWeakMap = isWeakMap; 30665 lodash.isWeakSet = isWeakSet; 30666 lodash.join = join; 30667 lodash.kebabCase = kebabCase; 30668 lodash.last = last; 30669 lodash.lastIndexOf = lastIndexOf; 30670 lodash.lowerCase = lowerCase; 30671 lodash.lowerFirst = lowerFirst; 30672 lodash.lt = lt; 30673 lodash.lte = lte; 30674 lodash.max = max; 30675 lodash.maxBy = maxBy; 30676 lodash.mean = mean; 30677 lodash.meanBy = meanBy; 30678 lodash.min = min; 30679 lodash.minBy = minBy; 30680 lodash.stubArray = stubArray; 30681 lodash.stubFalse = stubFalse; 30682 lodash.stubObject = stubObject; 30683 lodash.stubString = stubString; 30684 lodash.stubTrue = stubTrue; 30685 lodash.multiply = multiply; 30686 lodash.nth = nth; 30687 lodash.noConflict = noConflict; 30688 lodash.noop = noop; 30689 lodash.now = now; 30690 lodash.pad = pad; 30691 lodash.padEnd = padEnd; 30692 lodash.padStart = padStart; 30693 lodash.parseInt = parseInt; 30694 lodash.random = random; 30695 lodash.reduce = reduce; 30696 lodash.reduceRight = reduceRight; 30697 lodash.repeat = repeat; 30698 lodash.replace = replace; 30699 lodash.result = result; 30700 lodash.round = round; 30701 lodash.runInContext = runInContext; 30702 lodash.sample = sample; 30703 lodash.size = size; 30704 lodash.snakeCase = snakeCase; 30705 lodash.some = some; 30706 lodash.sortedIndex = sortedIndex; 30707 lodash.sortedIndexBy = sortedIndexBy; 30708 lodash.sortedIndexOf = sortedIndexOf; 30709 lodash.sortedLastIndex = sortedLastIndex; 30710 lodash.sortedLastIndexBy = sortedLastIndexBy; 30711 lodash.sortedLastIndexOf = sortedLastIndexOf; 30712 lodash.startCase = startCase; 30713 lodash.startsWith = startsWith; 30714 lodash.subtract = subtract; 30715 lodash.sum = sum; 30716 lodash.sumBy = sumBy; 30717 lodash.template = template; 30718 lodash.times = times; 30719 lodash.toFinite = toFinite; 30720 lodash.toInteger = toInteger; 30721 lodash.toLength = toLength; 30722 lodash.toLower = toLower; 30723 lodash.toNumber = toNumber; 30724 lodash.toSafeInteger = toSafeInteger; 30725 lodash.toString = toString; 30726 lodash.toUpper = toUpper; 30727 lodash.trim = trim; 30728 lodash.trimEnd = trimEnd; 30729 lodash.trimStart = trimStart; 30730 lodash.truncate = truncate; 30731 lodash.unescape = unescape; 30732 lodash.uniqueId = uniqueId; 30733 lodash.upperCase = upperCase; 30734 lodash.upperFirst = upperFirst; 30735 30736 // Add aliases. 30737 lodash.each = forEach; 30738 lodash.eachRight = forEachRight; 30739 lodash.first = head; 30740 30741 mixin(lodash, (function() { 30742 var source = {}; 30743 baseForOwn(lodash, function(func, methodName) { 30744 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 30745 source[methodName] = func; 30746 } 30747 }); 30748 return source; 30749 }()), { 'chain': false }); 30750 30751 /*------------------------------------------------------------------------*/ 30752 30753 /** 30754 * The semantic version number. 30755 * 30756 * @static 30757 * @memberOf _ 30758 * @type {string} 30759 */ 30760 lodash.VERSION = VERSION; 30761 30762 // Assign default placeholders. 30763 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 30764 lodash[methodName].placeholder = lodash; 30765 }); 30766 30767 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 30768 arrayEach(['drop', 'take'], function(methodName, index) { 30769 LazyWrapper.prototype[methodName] = function(n) {
vendor: 8,173 bytes, lines 30770-31002
30770 n = n === undefined ? 1 : nativeMax(toInteger(n), 0); 30771 30772 var result = (this.__filtered__ && !index) 30773 ? new LazyWrapper(this) 30774 : this.clone(); 30775 30776 if (result.__filtered__) { 30777 result.__takeCount__ = nativeMin(n, result.__takeCount__); 30778 } else { 30779 result.__views__.push({ 30780 'size': nativeMin(n, MAX_ARRAY_LENGTH), 30781 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') 30782 }); 30783 } 30784 return result; 30785 }; 30786 30787 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 30788 return this.reverse()[methodName](n).reverse(); 30789 }; 30790 }); 30791 30792 // Add `LazyWrapper` methods that accept an `iteratee` value. 30793 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 30794 var type = index + 1, 30795 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 30796 30797 LazyWrapper.prototype[methodName] = function(iteratee) { 30798 var result = this.clone(); 30799 result.__iteratees__.push({ 30800 'iteratee': getIteratee(iteratee, 3), 30801 'type': type 30802 }); 30803 result.__filtered__ = result.__filtered__ || isFilter; 30804 return result; 30805 }; 30806 }); 30807 30808 // Add `LazyWrapper` methods for `_.head` and `_.last`. 30809 arrayEach(['head', 'last'], function(methodName, index) { 30810 var takeName = 'take' + (index ? 'Right' : ''); 30811 30812 LazyWrapper.prototype[methodName] = function() { 30813 return this[takeName](1).value()[0]; 30814 }; 30815 }); 30816 30817 // Add `LazyWrapper` methods for `_.initial` and `_.tail`. 30818 arrayEach(['initial', 'tail'], function(methodName, index) { 30819 var dropName = 'drop' + (index ? '' : 'Right'); 30820 30821 LazyWrapper.prototype[methodName] = function() { 30822 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 30823 }; 30824 }); 30825 30826 LazyWrapper.prototype.compact = function() { 30827 return this.filter(identity); 30828 }; 30829 30830 LazyWrapper.prototype.find = function(predicate) { 30831 return this.filter(predicate).head(); 30832 }; 30833 30834 LazyWrapper.prototype.findLast = function(predicate) { 30835 return this.reverse().find(predicate); 30836 }; 30837 30838 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 30839 if (typeof path == 'function') { 30840 return new LazyWrapper(this); 30841 } 30842 return this.map(function(value) { 30843 return baseInvoke(value, path, args); 30844 }); 30845 }); 30846 30847 LazyWrapper.prototype.reject = function(predicate) { 30848 return this.filter(negate(getIteratee(predicate))); 30849 }; 30850 30851 LazyWrapper.prototype.slice = function(start, end) { 30852 start = toInteger(start); 30853 30854 var result = this; 30855 if (result.__filtered__ && (start > 0 || end < 0)) { 30856 return new LazyWrapper(result); 30857 } 30858 if (start < 0) { 30859 result = result.takeRight(-start); 30860 } else if (start) { 30861 result = result.drop(start); 30862 } 30863 if (end !== undefined) { 30864 end = toInteger(end); 30865 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 30866 } 30867 return result; 30868 }; 30869 30870 LazyWrapper.prototype.takeRightWhile = function(predicate) { 30871 return this.reverse().takeWhile(predicate).reverse(); 30872 }; 30873 30874 LazyWrapper.prototype.toArray = function() { 30875 return this.take(MAX_ARRAY_LENGTH); 30876 }; 30877 30878 // Add `LazyWrapper` methods to `lodash.prototype`. 30879 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 30880 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), 30881 isTaker = /^(?:head|last)$/.test(methodName), 30882 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], 30883 retUnwrapped = isTaker || /^find/.test(methodName); 30884 30885 if (!lodashFunc) { 30886 return; 30887 } 30888 lodash.prototype[methodName] = function() { 30889 var value = this.__wrapped__, 30890 args = isTaker ? [1] : arguments, 30891 isLazy = value instanceof LazyWrapper, 30892 iteratee = args[0], 30893 useLazy = isLazy || isArray(value); 30894 30895 var interceptor = function(value) { 30896 var result = lodashFunc.apply(lodash, arrayPush([value], args)); 30897 return (isTaker && chainAll) ? result[0] : result; 30898 }; 30899 30900 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { 30901 // Avoid lazy use if the iteratee has a "length" value other than `1`. 30902 isLazy = useLazy = false; 30903 } 30904 var chainAll = this.__chain__, 30905 isHybrid = !!this.__actions__.length, 30906 isUnwrapped = retUnwrapped && !chainAll, 30907 onlyLazy = isLazy && !isHybrid; 30908 30909 if (!retUnwrapped && useLazy) { 30910 value = onlyLazy ? value : new LazyWrapper(this); 30911 var result = func.apply(value, args); 30912 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); 30913 return new LodashWrapper(result, chainAll); 30914 } 30915 if (isUnwrapped && onlyLazy) { 30916 return func.apply(this, args); 30917 } 30918 result = this.thru(interceptor); 30919 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; 30920 }; 30921 }); 30922 30923 // Add `Array` methods to `lodash.prototype`. 30924 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 30925 var func = arrayProto[methodName], 30926 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 30927 retUnwrapped = /^(?:pop|shift)$/.test(methodName); 30928 30929 lodash.prototype[methodName] = function() { 30930 var args = arguments; 30931 if (retUnwrapped && !this.__chain__) { 30932 var value = this.value(); 30933 return func.apply(isArray(value) ? value : [], args); 30934 } 30935 return this[chainName](function(value) { 30936 return func.apply(isArray(value) ? value : [], args); 30937 }); 30938 }; 30939 }); 30940 30941 // Map minified method names to their real names. 30942 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 30943 var lodashFunc = lodash[methodName]; 30944 if (lodashFunc) { 30945 var key = lodashFunc.name + ''; 30946 if (!hasOwnProperty.call(realNames, key)) { 30947 realNames[key] = []; 30948 } 30949 realNames[key].push({ 'name': methodName, 'func': lodashFunc }); 30950 } 30951 }); 30952 30953 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 30954 'name': 'wrapper', 30955 'func': undefined 30956 }]; 30957 30958 // Add methods to `LazyWrapper`. 30959 LazyWrapper.prototype.clone = lazyClone; 30960 LazyWrapper.prototype.reverse = lazyReverse; 30961 LazyWrapper.prototype.value = lazyValue; 30962 30963 // Add chain sequence methods to the `lodash` wrapper. 30964 lodash.prototype.at = wrapperAt; 30965 lodash.prototype.chain = wrapperChain; 30966 lodash.prototype.commit = wrapperCommit; 30967 lodash.prototype.next = wrapperNext; 30968 lodash.prototype.plant = wrapperPlant; 30969 lodash.prototype.reverse = wrapperReverse; 30970 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 30971 30972 // Add lazy aliases. 30973 lodash.prototype.first = lodash.prototype.head; 30974 30975 if (symIterator) { 30976 lodash.prototype[symIterator] = wrapperToIterator; 30977 } 30978 return lodash; 30979 }); 30980 30981 /*--------------------------------------------------------------------------*/ 30982 30983 // Export lodash. 30984 var _ = runInContext(); 30985 30986 // Some AMD build optimizers, like r.js, check for condition patterns like: 30987 if (true) { 30988 // Expose Lodash on the global object to prevent errors when Lodash is 30989 // loaded by a script tag in the presence of an AMD loader. 30990 // See http://requirejs.org/docs/errors.html#mismatch for more details. 30991 // Use `_.noConflict` to remove Lodash from the global object. 30992 root._ = _; 30993 30994 // Define as an anonymous module so, through path mapping, it can be 30995 // referenced as the "underscore" module. 30996 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 30997 return _; 30998 }).call(exports, __webpack_require__, exports, module), 30999 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 31000 } 31001 // Check for `exports` after `define` in case a build optimizer adds it. 31002 else
31002// removed by dead control flow 31003{} 31004}.call(this));
vendor: 7,305 bytes, lines 31005-31216
31005 31006 31007/***/ }, 31008 31009/***/ "./node_modules/loglevel/lib/loglevel.js" 31010/*!***********************************************!*\ 31011 !*** ./node_modules/loglevel/lib/loglevel.js ***! 31012 \***********************************************/ 31013(module, exports, __webpack_require__) { 31014 31015var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 31016* loglevel - https://github.com/pimterry/loglevel 31017* 31018* Copyright (c) 2013 Tim Perry 31019* Licensed under the MIT license. 31020*/ 31021(function (root, definition) { 31022 "use strict"; 31023 if (true) { 31024 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition), 31025 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 31026 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 31027 __WEBPACK_AMD_DEFINE_FACTORY__), 31028 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 31029 } else // removed by dead control flow 31030{} 31031}(this, function () { 31032 "use strict"; 31033 31034 // Slightly dubious tricks to cut down minimized file size 31035 var noop = function() {}; 31036 var undefinedType = "undefined"; 31037 var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && ( 31038 /Trident\/|MSIE /.test(window.navigator.userAgent) 31039 ); 31040 31041 var logMethods = [ 31042 "trace", 31043 "debug", 31044 "info", 31045 "warn", 31046 "error" 31047 ]; 31048 31049 var _loggersByName = {}; 31050 var defaultLogger = null; 31051 31052 // Cross-browser bind equivalent that works at least back to IE6 31053 function bindMethod(obj, methodName) { 31054 var method = obj[methodName]; 31055 if (typeof method.bind === 'function') { 31056 return method.bind(obj); 31057 } else { 31058 try { 31059 return Function.prototype.bind.call(method, obj); 31060 } catch (e) { 31061 // Missing bind shim or IE8 + Modernizr, fallback to wrapping 31062 return function() { 31063 return Function.prototype.apply.apply(method, [obj, arguments]); 31064 }; 31065 } 31066 } 31067 } 31068 31069 // Trace() doesn't print the message in IE, so for that case we need to wrap it 31070 function traceForIE() { 31071 if (console.log) { 31072 if (console.log.apply) { 31073 console.log.apply(console, arguments); 31074 } else { 31075 // In old IE, native console methods themselves don't have apply(). 31076 Function.prototype.apply.apply(console.log, [console, arguments]); 31077 } 31078 } 31079 if (console.trace) console.trace(); 31080 } 31081 31082 // Build the best logging method possible for this env 31083 // Wherever possible we want to bind, not wrap, to preserve stack traces 31084 function realMethod(methodName) { 31085 if (methodName === 'debug') { 31086 methodName = 'log'; 31087 } 31088 31089 if (typeof console === undefinedType) { 31090 return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives 31091 } else if (methodName === 'trace' && isIE) { 31092 return traceForIE; 31093 } else if (console[methodName] !== undefined) { 31094 return bindMethod(console, methodName); 31095 } else if (console.log !== undefined) { 31096 return bindMethod(console, 'log'); 31097 } else { 31098 return noop; 31099 } 31100 } 31101 31102 // These private functions always need `this` to be set properly 31103 31104 function replaceLoggingMethods() { 31105 /*jshint validthis:true */ 31106 var level = this.getLevel(); 31107 31108 // Replace the actual methods. 31109 for (var i = 0; i < logMethods.length; i++) { 31110 var methodName = logMethods[i]; 31111 this[methodName] = (i < level) ? 31112 noop : 31113 this.methodFactory(methodName, level, this.name); 31114 } 31115 31116 // Define log.log as an alias for log.debug 31117 this.log = this.debug; 31118 31119 // Return any important warnings. 31120 if (typeof console === undefinedType && level < this.levels.SILENT) { 31121 return "No console available for logging"; 31122 } 31123 } 31124 31125 // In old IE versions, the console isn't present until you first open it. 31126 // We build realMethod() replacements here that regenerate logging methods 31127 function enableLoggingWhenConsoleArrives(methodName) { 31128 return function () { 31129 if (typeof console !== undefinedType) { 31130 replaceLoggingMethods.call(this); 31131 this[methodName].apply(this, arguments); 31132 } 31133 }; 31134 } 31135 31136 // By default, we use closely bound real methods wherever possible, and 31137 // otherwise we wait for a console to appear, and then try again. 31138 function defaultMethodFactory(methodName, _level, _loggerName) { 31139 /*jshint validthis:true */ 31140 return realMethod(methodName) || 31141 enableLoggingWhenConsoleArrives.apply(this, arguments); 31142 } 31143 31144 function Logger(name, factory) { 31145 // Private instance variables. 31146 var self = this; 31147 /** 31148 * The level inherited from a parent logger (or a global default). We 31149 * cache this here rather than delegating to the parent so that it stays 31150 * in sync with the actual logging methods that we have installed (the 31151 * parent could change levels but we might not have rebuilt the loggers 31152 * in this child yet). 31153 * @type {number} 31154 */ 31155 var inheritedLevel; 31156 /** 31157 * The default level for this logger, if any. If set, this overrides 31158 * `inheritedLevel`. 31159 * @type {number|null} 31160 */ 31161 var defaultLevel; 31162 /** 31163 * A user-specific level for this logger. If set, this overrides 31164 * `defaultLevel`. 31165 * @type {number|null} 31166 */ 31167 var userLevel; 31168 31169 var storageKey = "loglevel"; 31170 if (typeof name === "string") { 31171 storageKey += ":" + name; 31172 } else if (typeof name === "symbol") { 31173 storageKey = undefined; 31174 } 31175 31176 function persistLevelIfPossible(levelNum) { 31177 var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); 31178 31179 if (typeof window === undefinedType || !storageKey) return; 31180 31181 // Use localStorage if available 31182 try { 31183 window.localStorage[storageKey] = levelName; 31184 return; 31185 } catch (ignore) {} 31186 31187 // Use session cookie as fallback 31188 try { 31189 window.document.cookie = 31190 encodeURIComponent(storageKey) + "=" + levelName + ";"; 31191 } catch (ignore) {} 31192 } 31193 31194 function getPersistedLevel() { 31195 var storedLevel; 31196 31197 if (typeof window === undefinedType || !storageKey) return; 31198 31199 try { 31200 storedLevel = window.localStorage[storageKey]; 31201 } catch (ignore) {} 31202 31203 // Fallback to cookies if local storage gives us nothing 31204 if (typeof storedLevel === undefinedType) { 31205 try { 31206 var cookie = window.document.cookie; 31207 var cookieName = encodeURIComponent(storageKey); 31208 var location = cookie.indexOf(cookieName + "="); 31209 if (location !== -1) { 31210 storedLevel = /^([^;]+)/.exec( 31211 cookie.slice(location + cookieName.length + 1) 31212 )[1]; 31213 } 31214 } catch (ignore) {} 31215 } 31216
vendor: 4,556 bytes, lines 31217-31375
31217 // If the stored level is not valid, treat it as if nothing was stored. 31218 if (self.levels[storedLevel] === undefined) { 31219 storedLevel = undefined; 31220 } 31221 31222 return storedLevel; 31223 } 31224 31225 function clearPersistedLevel() { 31226 if (typeof window === undefinedType || !storageKey) return; 31227 31228 // Use localStorage if available 31229 try { 31230 window.localStorage.removeItem(storageKey); 31231 } catch (ignore) {} 31232 31233 // Use session cookie as fallback 31234 try { 31235 window.document.cookie = 31236 encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; 31237 } catch (ignore) {} 31238 } 31239 31240 function normalizeLevel(input) { 31241 var level = input; 31242 if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { 31243 level = self.levels[level.toUpperCase()]; 31244 } 31245 if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { 31246 return level; 31247 } else { 31248 throw new TypeError("log.setLevel() called with invalid level: " + input); 31249 } 31250 } 31251 31252 /* 31253 * 31254 * Public logger API - see https://github.com/pimterry/loglevel for details 31255 * 31256 */ 31257 31258 self.name = name; 31259 31260 self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, 31261 "ERROR": 4, "SILENT": 5}; 31262 31263 self.methodFactory = factory || defaultMethodFactory; 31264 31265 self.getLevel = function () { 31266 if (userLevel != null) { 31267 return userLevel; 31268 } else if (defaultLevel != null) { 31269 return defaultLevel; 31270 } else { 31271 return inheritedLevel; 31272 } 31273 }; 31274 31275 self.setLevel = function (level, persist) { 31276 userLevel = normalizeLevel(level); 31277 if (persist !== false) { // defaults to true 31278 persistLevelIfPossible(userLevel); 31279 } 31280 31281 // NOTE: in v2, this should call rebuild(), which updates children. 31282 return replaceLoggingMethods.call(self); 31283 }; 31284 31285 self.setDefaultLevel = function (level) { 31286 defaultLevel = normalizeLevel(level); 31287 if (!getPersistedLevel()) { 31288 self.setLevel(level, false); 31289 } 31290 }; 31291 31292 self.resetLevel = function () { 31293 userLevel = null; 31294 clearPersistedLevel(); 31295 replaceLoggingMethods.call(self); 31296 }; 31297 31298 self.enableAll = function(persist) { 31299 self.setLevel(self.levels.TRACE, persist); 31300 }; 31301 31302 self.disableAll = function(persist) { 31303 self.setLevel(self.levels.SILENT, persist); 31304 }; 31305 31306 self.rebuild = function () { 31307 if (defaultLogger !== self) { 31308 inheritedLevel = normalizeLevel(defaultLogger.getLevel()); 31309 } 31310 replaceLoggingMethods.call(self); 31311 31312 if (defaultLogger === self) { 31313 for (var childName in _loggersByName) { 31314 _loggersByName[childName].rebuild(); 31315 } 31316 } 31317 }; 31318 31319 // Initialize all the internal levels. 31320 inheritedLevel = normalizeLevel( 31321 defaultLogger ? defaultLogger.getLevel() : "WARN" 31322 ); 31323 var initialLevel = getPersistedLevel(); 31324 if (initialLevel != null) { 31325 userLevel = normalizeLevel(initialLevel); 31326 } 31327 replaceLoggingMethods.call(self); 31328 } 31329 31330 /* 31331 * 31332 * Top-level API 31333 * 31334 */ 31335 31336 defaultLogger = new Logger(); 31337 31338 defaultLogger.getLogger = function getLogger(name) { 31339 if ((typeof name !== "symbol" && typeof name !== "string") || name === "") { 31340 throw new TypeError("You must supply a name when creating a logger."); 31341 } 31342 31343 var logger = _loggersByName[name]; 31344 if (!logger) { 31345 logger = _loggersByName[name] = new Logger( 31346 name, 31347 defaultLogger.methodFactory 31348 ); 31349 } 31350 return logger; 31351 }; 31352 31353 // Grab the current global log variable in case of overwrite 31354 var _log = (typeof window !== undefinedType) ? window.log : undefined; 31355 defaultLogger.noConflict = function() { 31356 if (typeof window !== undefinedType && 31357 window.log === defaultLogger) { 31358 window.log = _log; 31359 } 31360 31361 return defaultLogger; 31362 }; 31363 31364 defaultLogger.getLoggers = function getLoggers() { 31365 return _loggersByName; 31366 }; 31367 31368 // ES6 default export, for compatibility 31369 defaultLogger['default'] = defaultLogger; 31370 31371 return defaultLogger; 31372})); 31373 31374 31375/***/ }
vendor: 19,553 bytes, lines 31375-31876
31375, 31376 31377/***/ "./node_modules/@babel/runtime/helpers/OverloadYield.js" 31378/*!**************************************************************!*\ 31379 !*** ./node_modules/@babel/runtime/helpers/OverloadYield.js ***! 31380 \**************************************************************/ 31381(module) { 31382 31383function _OverloadYield(e, d) { 31384 this.v = e, this.k = d; 31385} 31386module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; 31387 31388/***/ }, 31389 31390/***/ "./node_modules/@babel/runtime/helpers/regenerator.js" 31391/*!************************************************************!*\ 31392 !*** ./node_modules/@babel/runtime/helpers/regenerator.js ***! 31393 \************************************************************/ 31394(module, __unused_webpack_exports, __webpack_require__) { 31395 31396var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js"); 31397function _regenerator() { 31398 /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ 31399 var e, 31400 t, 31401 r = "function" == typeof Symbol ? Symbol : {}, 31402 n = r.iterator || "@@iterator", 31403 o = r.toStringTag || "@@toStringTag"; 31404 function i(r, n, o, i) { 31405 var c = n && n.prototype instanceof Generator ? n : Generator, 31406 u = Object.create(c.prototype); 31407 return regeneratorDefine(u, "_invoke", function (r, n, o) { 31408 var i, 31409 c, 31410 u, 31411 f = 0, 31412 p = o || [], 31413 y = !1, 31414 G = { 31415 p: 0, 31416 n: 0, 31417 v: e, 31418 a: d, 31419 f: d.bind(e, 4), 31420 d: function d(t, r) { 31421 return i = t, c = 0, u = e, G.n = r, a; 31422 } 31423 }; 31424 function d(r, n) { 31425 for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { 31426 var o, 31427 i = p[t], 31428 d = G.p, 31429 l = i[2]; 31430 r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); 31431 } 31432 if (o || r > 1) return a; 31433 throw y = !0, n; 31434 } 31435 return function (o, p, l) { 31436 if (f > 1) throw TypeError("Generator is already running"); 31437 for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { 31438 i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); 31439 try { 31440 if (f = 2, i) { 31441 if (c || (o = "next"), t = i[o]) { 31442 if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); 31443 if (!t.done) return t; 31444 u = t.value, c < 2 && (c = 0); 31445 } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); 31446 i = e; 31447 } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; 31448 } catch (t) { 31449 i = e, c = 1, u = t; 31450 } finally { 31451 f = 1; 31452 } 31453 } 31454 return { 31455 value: t, 31456 done: y 31457 }; 31458 }; 31459 }(r, o, i), !0), u; 31460 } 31461 var a = {}; 31462 function Generator() {} 31463 function GeneratorFunction() {} 31464 function GeneratorFunctionPrototype() {} 31465 t = Object.getPrototypeOf; 31466 var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { 31467 return this; 31468 }), t), 31469 u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); 31470 function f(e) { 31471 return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; 31472 } 31473 return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () { 31474 return this; 31475 }), regeneratorDefine(u, "toString", function () { 31476 return "[object Generator]"; 31477 }), (module.exports = _regenerator = function _regenerator() { 31478 return { 31479 w: i, 31480 m: f 31481 }; 31482 }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); 31483} 31484module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; 31485 31486/***/ }, 31487 31488/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsync.js" 31489/*!*****************************************************************!*\ 31490 !*** ./node_modules/@babel/runtime/helpers/regeneratorAsync.js ***! 31491 \*****************************************************************/ 31492(module, __unused_webpack_exports, __webpack_require__) { 31493 31494var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); 31495function _regeneratorAsync(n, e, r, t, o) { 31496 var a = regeneratorAsyncGen(n, e, r, t, o); 31497 return a.next().then(function (n) { 31498 return n.done ? n.value : a.next(); 31499 }); 31500} 31501module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; 31502 31503/***/ }, 31504 31505/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js" 31506/*!********************************************************************!*\ 31507 !*** ./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***! 31508 \********************************************************************/ 31509(module, __unused_webpack_exports, __webpack_require__) { 31510 31511var regenerator = __webpack_require__(/*! ./regenerator.js */ "./node_modules/@babel/runtime/helpers/regenerator.js"); 31512var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); 31513function _regeneratorAsyncGen(r, e, t, o, n) { 31514 return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); 31515} 31516module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; 31517 31518/***/ }, 31519 31520/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js" 31521/*!*************************************************************************!*\ 31522 !*** ./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***! 31523 \*************************************************************************/ 31524(module, __unused_webpack_exports, __webpack_require__) { 31525 31526var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "./node_modules/@babel/runtime/helpers/OverloadYield.js"); 31527var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js"); 31528function AsyncIterator(t, e) { 31529 function n(r, o, i, f) { 31530 try { 31531 var c = t[r](o), 31532 u = c.value; 31533 return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { 31534 n("next", t, i, f); 31535 }, function (t) { 31536 n("throw", t, i, f); 31537 }) : e.resolve(u).then(function (t) { 31538 c.value = t, i(c); 31539 }, function (t) { 31540 return n("throw", t, i, f); 31541 }); 31542 } catch (t) { 31543 f(t); 31544 } 31545 } 31546 var r; 31547 this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { 31548 return this; 31549 })), regeneratorDefine(this, "_invoke", function (t, o, i) { 31550 function f() { 31551 return new e(function (e, r) { 31552 n(t, i, e, r); 31553 }); 31554 } 31555 return r = r ? r.then(f, f) : f(); 31556 }, !0); 31557} 31558module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; 31559 31560/***/ }, 31561 31562/***/ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js" 31563/*!******************************************************************!*\ 31564 !*** ./node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! 31565 \******************************************************************/ 31566(module) { 31567 31568function _regeneratorDefine(e, r, n, t) { 31569 var i = Object.defineProperty; 31570 try { 31571 i({}, "", {}); 31572 } catch (e) { 31573 i = 0; 31574 } 31575 module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { 31576 function o(r, n) { 31577 _regeneratorDefine(e, r, function (e) { 31578 return this._invoke(r, n, e); 31579 }); 31580 } 31581 r ? i ? i(e, r, { 31582 value: n, 31583 enumerable: !t, 31584 configurable: !t, 31585 writable: !t 31586 }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); 31587 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); 31588} 31589module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; 31590 31591/***/ }, 31592 31593/***/ "./node_modules/@babel/runtime/helpers/regeneratorKeys.js" 31594/*!****************************************************************!*\ 31595 !*** ./node_modules/@babel/runtime/helpers/regeneratorKeys.js ***! 31596 \****************************************************************/ 31597(module) { 31598 31599function _regeneratorKeys(e) { 31600 var n = Object(e), 31601 r = []; 31602 for (var t in n) r.unshift(t); 31603 return function e() { 31604 for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; 31605 return e.done = !0, e; 31606 }; 31607} 31608module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; 31609 31610/***/ }, 31611 31612/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js" 31613/*!*******************************************************************!*\ 31614 !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! 31615 \*******************************************************************/ 31616(module, __unused_webpack_exports, __webpack_require__) { 31617 31618var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "./node_modules/@babel/runtime/helpers/OverloadYield.js"); 31619var regenerator = __webpack_require__(/*! ./regenerator.js */ "./node_modules/@babel/runtime/helpers/regenerator.js"); 31620var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsync.js"); 31621var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); 31622var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); 31623var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "./node_modules/@babel/runtime/helpers/regeneratorKeys.js"); 31624var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "./node_modules/@babel/runtime/helpers/regeneratorValues.js"); 31625function _regeneratorRuntime() { 31626 "use strict"; 31627 31628 var r = regenerator(), 31629 e = r.m(_regeneratorRuntime), 31630 t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; 31631 function n(r) { 31632 var e = "function" == typeof r && r.constructor; 31633 return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); 31634 } 31635 var o = { 31636 "throw": 1, 31637 "return": 2, 31638 "break": 3, 31639 "continue": 3 31640 }; 31641 function a(r) { 31642 var e, t; 31643 return function (n) { 31644 e || (e = { 31645 stop: function stop() { 31646 return t(n.a, 2); 31647 }, 31648 "catch": function _catch() { 31649 return n.v; 31650 }, 31651 abrupt: function abrupt(r, e) { 31652 return t(n.a, o[r], e); 31653 }, 31654 delegateYield: function delegateYield(r, o, a) { 31655 return e.resultName = o, t(n.d, regeneratorValues(r), a); 31656 }, 31657 finish: function finish(r) { 31658 return t(n.f, r); 31659 } 31660 }, t = function t(r, _t, o) { 31661 n.p = e.prev, n.n = e.next; 31662 try { 31663 return r(_t, o); 31664 } finally { 31665 e.next = n.n; 31666 } 31667 }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; 31668 try { 31669 return r.call(this, e); 31670 } finally { 31671 n.p = e.prev, n.n = e.next; 31672 } 31673 }; 31674 } 31675 return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { 31676 return { 31677 wrap: function wrap(e, t, n, o) { 31678 return r.w(a(e), t, n, o && o.reverse()); 31679 }, 31680 isGeneratorFunction: n, 31681 mark: r.m, 31682 awrap: function awrap(r, e) { 31683 return new OverloadYield(r, e); 31684 }, 31685 AsyncIterator: regeneratorAsyncIterator, 31686 async: function async(r, e, t, o, u) { 31687 return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); 31688 }, 31689 keys: regeneratorKeys, 31690 values: regeneratorValues 31691 }; 31692 }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); 31693} 31694module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; 31695 31696/***/ }, 31697 31698/***/ "./node_modules/@babel/runtime/helpers/regeneratorValues.js" 31699/*!******************************************************************!*\ 31700 !*** ./node_modules/@babel/runtime/helpers/regeneratorValues.js ***! 31701 \******************************************************************/ 31702(module, __unused_webpack_exports, __webpack_require__) { 31703 31704var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]); 31705function _regeneratorValues(e) { 31706 if (null != e) { 31707 var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], 31708 r = 0; 31709 if (t) return t.call(e); 31710 if ("function" == typeof e.next) return e; 31711 if (!isNaN(e.length)) return { 31712 next: function next() { 31713 return e && r >= e.length && (e = void 0), { 31714 value: e && e[r++], 31715 done: !e 31716 }; 31717 } 31718 }; 31719 } 31720 throw new TypeError(_typeof(e) + " is not iterable"); 31721} 31722module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; 31723 31724/***/ }, 31725 31726/***/ "./node_modules/@babel/runtime/helpers/typeof.js" 31727/*!*******************************************************!*\ 31728 !*** ./node_modules/@babel/runtime/helpers/typeof.js ***! 31729 \*******************************************************/ 31730(module) { 31731 31732function _typeof(o) { 31733 "@babel/helpers - typeof"; 31734 31735 return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { 31736 return typeof o; 31737 } : function (o) { 31738 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; 31739 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); 31740} 31741module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; 31742 31743/***/ }, 31744 31745/***/ "./node_modules/@babel/runtime/regenerator/index.js" 31746/*!**********************************************************!*\ 31747 !*** ./node_modules/@babel/runtime/regenerator/index.js ***! 31748 \**********************************************************/ 31749(module, __unused_webpack_exports, __webpack_require__) { 31750 31751// TODO(Babel 8): Remove this file. 31752 31753var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); 31754module.exports = runtime; 31755 31756// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= 31757try { 31758 regeneratorRuntime = runtime; 31759} catch (accidentalStrictMode) { 31760 if (typeof globalThis === "object") { 31761 globalThis.regeneratorRuntime = runtime; 31762 } else { 31763 Function("r", "regeneratorRuntime = r")(runtime); 31764 } 31765} 31766 31767 31768/***/ }, 31769 31770/***/ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js" 31771/*!*********************************************************************!*\ 31772 !*** ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***! 31773 \*********************************************************************/ 31774(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31775 31776"use strict"; 31777__webpack_require__.r(__webpack_exports__); 31778/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31779/* harmony export */ "default": () => (/* binding */ _arrayLikeToArray) 31780/* harmony export */ }); 31781function _arrayLikeToArray(r, a) { 31782 (null == a || a > r.length) && (a = r.length); 31783 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 31784 return n; 31785} 31786 31787 31788/***/ }, 31789 31790/***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js" 31791/*!*******************************************************************!*\ 31792 !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***! 31793 \*******************************************************************/ 31794(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31795 31796"use strict"; 31797__webpack_require__.r(__webpack_exports__); 31798/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31799/* harmony export */ "default": () => (/* binding */ _arrayWithHoles) 31800/* harmony export */ }); 31801function _arrayWithHoles(r) { 31802 if (Array.isArray(r)) return r; 31803} 31804 31805 31806/***/ }, 31807 31808/***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js" 31809/*!*********************************************************************!*\ 31810 !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! 31811 \*********************************************************************/ 31812(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31813 31814"use strict"; 31815__webpack_require__.r(__webpack_exports__); 31816/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31817/* harmony export */ "default": () => (/* binding */ _asyncToGenerator) 31818/* harmony export */ }); 31819function asyncGeneratorStep(n, t, e, r, o, a, c) { 31820 try { 31821 var i = n[a](c), 31822 u = i.value; 31823 } catch (n) { 31824 return void e(n); 31825 } 31826 i.done ? t(u) : Promise.resolve(u).then(r, o); 31827} 31828function _asyncToGenerator(n) { 31829 return function () { 31830 var t = this, 31831 e = arguments; 31832 return new Promise(function (r, o) { 31833 var a = n.apply(t, e); 31834 function _next(n) { 31835 asyncGeneratorStep(a, r, o, _next, _throw, "next", n); 31836 } 31837 function _throw(n) { 31838 asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); 31839 } 31840 _next(void 0); 31841 }); 31842 }; 31843} 31844 31845 31846/***/ }, 31847 31848/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js" 31849/*!*************************************************************************!*\ 31850 !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***! 31851 \*************************************************************************/ 31852(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31853 31854"use strict"; 31855__webpack_require__.r(__webpack_exports__); 31856/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31857/* harmony export */ "default": () => (/* binding */ _iterableToArrayLimit) 31858/* harmony export */ }); 31859function _iterableToArrayLimit(r, l) { 31860 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 31861 if (null != t) { 31862 var e, 31863 n, 31864 i, 31865 u, 31866 a = [], 31867 f = !0, 31868 o = !1; 31869 try { 31870 if (i = (t = t.call(r)).next, 0 === l) { 31871 if (Object(t) !== t) return; 31872 f = !1; 31873 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 31874 } catch (r) { 31875 o = !0, n = r; 31876 } finally {
31877 try { 31878 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; 31879 } finally { 31880 if (o) throw n; 31881 } 31882 } 31883 return a; 31884 } 31885} 31886 31887 31888/***/ }, 31889 31890/***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js" 31891/*!********************************************************************!*\ 31892 !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***! 31893 \********************************************************************/ 31894(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31895 31896"use strict"; 31897__webpack_require__.r(__webpack_exports__); 31898/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31899/* harmony export */ "default": () => (/* binding */ _nonIterableRest) 31900/* harmony export */ }); 31901function _nonIterableRest() { 31902 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 31903} 31904 31905 31906/***/ }, 31907 31908/***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js" 31909/*!******************************************************************!*\ 31910 !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***! 31911 \******************************************************************/ 31912(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31913 31914"use strict"; 31915__webpack_require__.r(__webpack_exports__); 31916/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31917/* harmony export */ "default": () => (/* binding */ _slicedToArray) 31918/* harmony export */ }); 31919/* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"); 31920/* harmony import */ var _iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit.js */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"); 31921/* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"); 31922/* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"); 31923 31924 31925 31926 31927function _slicedToArray(r, e) { 31928 return (0,_arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r) || (0,_iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__["default"])(r, e) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(r, e) || (0,_nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(); 31929} 31930 31931 31932/***/ }, 31933 31934/***/ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js" 31935/*!*******************************************************************************!*\ 31936 !*** ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***! 31937 \*******************************************************************************/ 31938(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31939 31940"use strict"; 31941__webpack_require__.r(__webpack_exports__); 31942/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31943/* harmony export */ "default": () => (/* binding */ _unsupportedIterableToArray) 31944/* harmony export */ }); 31945/* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js"); 31946 31947function _unsupportedIterableToArray(r, a) { 31948 if (r) { 31949 if ("string" == typeof r) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r, a); 31950 var t = {}.toString.call(r).slice(8, -1); 31951 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r, a) : void 0; 31952 } 31953} 31954 31955 31956/***/ }, 31957 31958/***/ "./node_modules/underscore/modules/_baseCreate.js" 31959/*!********************************************************!*\ 31960 !*** ./node_modules/underscore/modules/_baseCreate.js ***! 31961 \********************************************************/ 31962(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31963 31964"use strict"; 31965__webpack_require__.r(__webpack_exports__); 31966/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31967/* harmony export */ "default": () => (/* binding */ baseCreate) 31968/* harmony export */ }); 31969/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 31970/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 31971 31972 31973 31974// Create a naked function reference for surrogate-prototype-swapping. 31975function ctor() { 31976 return function(){}; 31977} 31978 31979// An internal function for creating a new object that inherits from another. 31980function baseCreate(prototype) { 31981 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prototype)) return {}; 31982 if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeCreate) return (0,_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeCreate)(prototype); 31983 var Ctor = ctor(); 31984 Ctor.prototype = prototype; 31985 var result = new Ctor; 31986 Ctor.prototype = null; 31987 return result; 31988} 31989 31990 31991/***/ }, 31992 31993/***/ "./node_modules/underscore/modules/_baseIteratee.js" 31994/*!**********************************************************!*\ 31995 !*** ./node_modules/underscore/modules/_baseIteratee.js ***! 31996 \**********************************************************/ 31997(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31998 31999"use strict"; 32000__webpack_require__.r(__webpack_exports__); 32001/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32002/* harmony export */ "default": () => (/* binding */ baseIteratee) 32003/* harmony export */ }); 32004/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/underscore/modules/identity.js"); 32005/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 32006/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 32007/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 32008/* harmony import */ var _matcher_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./matcher.js */ "./node_modules/underscore/modules/matcher.js"); 32009/* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./property.js */ "./node_modules/underscore/modules/property.js"); 32010/* harmony import */ var _optimizeCb_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_optimizeCb.js */ "./node_modules/underscore/modules/_optimizeCb.js"); 32011 32012 32013 32014 32015 32016 32017 32018 32019// An internal function to generate callbacks that can be applied to each 32020// element in a collection, returning the desired result — either `_.identity`, 32021// an arbitrary callback, a property matcher, or a property accessor. 32022function baseIteratee(value, context, argCount) { 32023 if (value == null) return _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"]; 32024 if ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) return (0,_optimizeCb_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, context, argCount); 32025 if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) && !(0,_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) return (0,_matcher_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value); 32026 return (0,_property_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value); 32027} 32028 32029 32030/***/ }, 32031 32032/***/ "./node_modules/underscore/modules/_cb.js" 32033/*!************************************************!*\ 32034 !*** ./node_modules/underscore/modules/_cb.js ***! 32035 \************************************************/ 32036(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32037 32038"use strict"; 32039__webpack_require__.r(__webpack_exports__); 32040/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32041/* harmony export */ "default": () => (/* binding */ cb) 32042/* harmony export */ }); 32043/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 32044/* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/underscore/modules/_baseIteratee.js"); 32045/* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/underscore/modules/iteratee.js"); 32046 32047 32048 32049 32050// The function we call internally to generate a callback. It invokes 32051// `_.iteratee` if overridden, otherwise `baseIteratee`. 32052function cb(value, context, argCount) { 32053 if (_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].iteratee !== _iteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]) return _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].iteratee(value, context); 32054 return (0,_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, context, argCount); 32055} 32056 32057 32058/***/ }, 32059 32060/***/ "./node_modules/underscore/modules/_chainResult.js" 32061/*!*********************************************************!*\ 32062 !*** ./node_modules/underscore/modules/_chainResult.js ***! 32063 \*********************************************************/ 32064(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32065 32066"use strict"; 32067__webpack_require__.r(__webpack_exports__); 32068/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32069/* harmony export */ "default": () => (/* binding */ chainResult) 32070/* harmony export */ }); 32071/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 32072 32073 32074// Helper function to continue chaining intermediate results. 32075function chainResult(instance, obj) { 32076 return instance._chain ? (0,_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj).chain() : obj; 32077} 32078 32079 32080/***/ }, 32081 32082/***/ "./node_modules/underscore/modules/_collectNonEnumProps.js" 32083/*!*****************************************************************!*\ 32084 !*** ./node_modules/underscore/modules/_collectNonEnumProps.js ***! 32085 \*****************************************************************/ 32086(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32087 32088"use strict"; 32089__webpack_require__.r(__webpack_exports__); 32090/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32091/* harmony export */ "default": () => (/* binding */ collectNonEnumProps) 32092/* harmony export */ }); 32093/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32094/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 32095/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 32096 32097 32098 32099 32100// Internal helper to create a simple lookup structure. 32101// `collectNonEnumProps` used to depend on `_.contains`, but this led to 32102// circular imports. `emulatedSet` is a one-off solution that only works for
32103// arrays of strings. 32104function emulatedSet(keys) { 32105 var hash = {}; 32106 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; 32107 return { 32108 contains: function(key) { return hash[key] === true; }, 32109 push: function(key) { 32110 hash[key] = true; 32111 return keys.push(key); 32112 } 32113 }; 32114} 32115 32116// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't 32117// be iterated by `for key in ...` and thus missed. Extends `keys` in place if 32118// needed. 32119function collectNonEnumProps(obj, keys) { 32120 keys = emulatedSet(keys); 32121 var nonEnumIdx = _setup_js__WEBPACK_IMPORTED_MODULE_0__.nonEnumerableProps.length; 32122 var constructor = obj.constructor; 32123 var proto = ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(constructor) && constructor.prototype) || _setup_js__WEBPACK_IMPORTED_MODULE_0__.ObjProto; 32124 32125 // Constructor is a special case. 32126 var prop = 'constructor'; 32127 if ((0,_has_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, prop) && !keys.contains(prop)) keys.push(prop); 32128 32129 while (nonEnumIdx--) { 32130 prop = _setup_js__WEBPACK_IMPORTED_MODULE_0__.nonEnumerableProps[nonEnumIdx]; 32131 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { 32132 keys.push(prop); 32133 } 32134 } 32135} 32136 32137 32138/***/ }, 32139 32140/***/ "./node_modules/underscore/modules/_createAssigner.js" 32141/*!************************************************************!*\ 32142 !*** ./node_modules/underscore/modules/_createAssigner.js ***! 32143 \************************************************************/ 32144(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32145 32146"use strict"; 32147__webpack_require__.r(__webpack_exports__); 32148/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32149/* harmony export */ "default": () => (/* binding */ createAssigner)
32150/* harmony export */ }); 32151// An internal function for creating assigner functions. 32152function createAssigner(keysFunc, defaults) { 32153 return function(obj) { 32154 var length = arguments.length; 32155 if (defaults) obj = Object(obj); 32156 if (length < 2 || obj == null) return obj; 32157 for (var index = 1; index < length; index++) { 32158 var source = arguments[index], 32159 keys = keysFunc(source), 32160 l = keys.length; 32161 for (var i = 0; i < l; i++) { 32162 var key = keys[i]; 32163 if (!defaults || obj[key] === void 0) obj[key] = source[key]; 32164 } 32165 } 32166 return obj; 32167 }; 32168} 32169 32170 32171/***/ }, 32172 32173/***/ "./node_modules/underscore/modules/_createEscaper.js" 32174/*!***********************************************************!*\ 32175 !*** ./node_modules/underscore/modules/_createEscaper.js ***! 32176 \***********************************************************/ 32177(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32178 32179"use strict"; 32180__webpack_require__.r(__webpack_exports__); 32181/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32182/* harmony export */ "default": () => (/* binding */ createEscaper) 32183/* harmony export */ }); 32184/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 32185 32186 32187// Internal helper to generate functions for escaping and unescaping strings 32188// to/from HTML interpolation. 32189function createEscaper(map) { 32190 var escaper = function(match) { 32191 return map[match]; 32192 }; 32193 // Regexes for identifying a key that needs to be escaped. 32194 var source = '(?:' + (0,_keys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(map).join('|') + ')'; 32195 var testRegexp = RegExp(source); 32196 var replaceRegexp = RegExp(source, 'g'); 32197 return function(string) { 32198 string = string == null ? '' : '' + string; 32199 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; 32200 }; 32201} 32202 32203 32204/***/ }, 32205 32206/***/ "./node_modules/underscore/modules/_createIndexFinder.js" 32207/*!***************************************************************!*\ 32208 !*** ./node_modules/underscore/modules/_createIndexFinder.js ***! 32209 \***************************************************************/ 32210(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32211 32212"use strict"; 32213__webpack_require__.r(__webpack_exports__); 32214/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32215/* harmony export */ "default": () => (/* binding */ createIndexFinder) 32216/* harmony export */ }); 32217/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 32218/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32219/* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/underscore/modules/isNaN.js"); 32220 32221 32222 32223 32224// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. 32225function createIndexFinder(dir, predicateFind, sortedIndex) { 32226 return function(array, item, idx) { 32227 var i = 0, length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array); 32228 if (typeof idx == 'number') { 32229 if (dir > 0) { 32230 i = idx >= 0 ? idx : Math.max(idx + length, i); 32231 } else { 32232 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; 32233 } 32234 } else if (sortedIndex && idx && length) { 32235 idx = sortedIndex(array, item); 32236 return array[idx] === item ? idx : -1; 32237 } 32238 if (item !== item) { 32239 idx = predicateFind(_setup_js__WEBPACK_IMPORTED_MODULE_1__.slice.call(array, i, length), _isNaN_js__WEBPACK_IMPORTED_MODULE_2__["default"]); 32240 return idx >= 0 ? idx + i : -1; 32241 } 32242 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { 32243 if (array[idx] === item) return idx; 32244 } 32245 return -1; 32246 }; 32247} 32248 32249 32250/***/ }, 32251 32252/***/ "./node_modules/underscore/modules/_createPredicateIndexFinder.js" 32253/*!************************************************************************!*\ 32254 !*** ./node_modules/underscore/modules/_createPredicateIndexFinder.js ***! 32255 \************************************************************************/ 32256(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32257 32258"use strict"; 32259__webpack_require__.r(__webpack_exports__); 32260/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32261/* harmony export */ "default": () => (/* binding */ createPredicateIndexFinder)
32262/* harmony export */ }); 32263/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 32264/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 32265 32266 32267 32268// Internal function to generate `_.findIndex` and `_.findLastIndex`. 32269function createPredicateIndexFinder(dir) { 32270 return function(array, predicate, context) { 32271 predicate = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, context); 32272 var length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array); 32273 var index = dir > 0 ? 0 : length - 1; 32274 for (; index >= 0 && index < length; index += dir) { 32275 if (predicate(array[index], index, array)) return index; 32276 } 32277 return -1; 32278 }; 32279} 32280 32281 32282/***/ }, 32283 32284/***/ "./node_modules/underscore/modules/_createReduce.js" 32285/*!**********************************************************!*\ 32286 !*** ./node_modules/underscore/modules/_createReduce.js ***! 32287 \**********************************************************/ 32288(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32289 32290"use strict"; 32291__webpack_require__.r(__webpack_exports__); 32292/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32293/* harmony export */ "default": () => (/* binding */ createReduce) 32294/* harmony export */ }); 32295/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 32296/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 32297/* harmony import */ var _optimizeCb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_optimizeCb.js */ "./node_modules/underscore/modules/_optimizeCb.js"); 32298 32299 32300 32301 32302// Internal helper to create a reducing function, iterating left or right. 32303function createReduce(dir) { 32304 // Wrap code that reassigns argument variables in a separate function than 32305 // the one that accesses `arguments.length` to avoid a perf hit. (#1991) 32306 var reducer = function(obj, iteratee, memo, initial) { 32307 var _keys = !(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) && (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj), 32308 length = (_keys || obj).length, 32309 index = dir > 0 ? 0 : length - 1; 32310 if (!initial) { 32311 memo = obj[_keys ? _keys[index] : index]; 32312 index += dir; 32313 } 32314 for (; index >= 0 && index < length; index += dir) { 32315 var currentKey = _keys ? _keys[index] : index; 32316 memo = iteratee(memo, obj[currentKey], currentKey, obj); 32317 } 32318 return memo; 32319 }; 32320 32321 return function(obj, iteratee, memo, context) { 32322 var initial = arguments.length >= 3; 32323 return reducer(obj, (0,_optimizeCb_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, context, 4), memo, initial); 32324 }; 32325} 32326 32327 32328/***/ }, 32329 32330/***/ "./node_modules/underscore/modules/_createSizePropertyCheck.js" 32331/*!*********************************************************************!*\ 32332 !*** ./node_modules/underscore/modules/_createSizePropertyCheck.js ***! 32333 \*********************************************************************/ 32334(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32335 32336"use strict"; 32337__webpack_require__.r(__webpack_exports__); 32338/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32339/* harmony export */ "default": () => (/* binding */ createSizePropertyCheck) 32340/* harmony export */ }); 32341/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32342 32343 32344// Common internal logic for `isArrayLike` and `isBufferLike`. 32345function createSizePropertyCheck(getSizeProperty) { 32346 return function(collection) { 32347 var sizeProperty = getSizeProperty(collection); 32348 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= _setup_js__WEBPACK_IMPORTED_MODULE_0__.MAX_ARRAY_INDEX; 32349 } 32350} 32351 32352 32353/***/ }, 32354 32355/***/ "./node_modules/underscore/modules/_deepGet.js" 32356/*!*****************************************************!*\ 32357 !*** ./node_modules/underscore/modules/_deepGet.js ***! 32358 \*****************************************************/ 32359(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32360 32361"use strict"; 32362__webpack_require__.r(__webpack_exports__); 32363/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32364/* harmony export */ "default": () => (/* binding */ deepGet) 32365/* harmony export */ }); 32366// Internal function to obtain a nested property in `obj` along `path`. 32367function deepGet(obj, path) { 32368 var length = path.length; 32369 for (var i = 0; i < length; i++) { 32370 if (obj == null) return void 0; 32371 obj = obj[path[i]]; 32372 } 32373 return length ? obj : void 0; 32374} 32375 32376 32377/***/ }, 32378 32379/***/ "./node_modules/underscore/modules/_escapeMap.js" 32380/*!*******************************************************!*\ 32381 !*** ./node_modules/underscore/modules/_escapeMap.js ***! 32382 \*******************************************************/ 32383(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32384 32385"use strict"; 32386__webpack_require__.r(__webpack_exports__); 32387/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32388/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32389/* harmony export */ }); 32390// Internal list of HTML entities for escaping. 32391/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 32392 '&': '&', 32393 '<': '<', 32394 '>': '>', 32395 '"': '"', 32396 "'": ''', 32397 '`': '`' 32398}); 32399 32400 32401/***/ }, 32402 32403/***/ "./node_modules/underscore/modules/_executeBound.js" 32404/*!**********************************************************!*\ 32405 !*** ./node_modules/underscore/modules/_executeBound.js ***! 32406 \**********************************************************/ 32407(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32408 32409"use strict"; 32410__webpack_require__.r(__webpack_exports__); 32411/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32412/* harmony export */ "default": () => (/* binding */ executeBound) 32413/* harmony export */ }); 32414/* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/underscore/modules/_baseCreate.js"); 32415/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 32416 32417 32418 32419// Internal function to execute `sourceFunc` bound to `context` with optional 32420// `args`. Determines whether to execute a function as a constructor or as a 32421// normal function. 32422function executeBound(sourceFunc, boundFunc, context, callingContext, args
32422) { 32423 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); 32424 var self = (0,_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(sourceFunc.prototype); 32425 var result = sourceFunc.apply(self, args); 32426 if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result)) return result; 32427 return self; 32428} 32429 32430 32431/***/ }, 32432 32433/***/ "./node_modules/underscore/modules/_flatten.js" 32434/*!*****************************************************!*\ 32435 !*** ./node_modules/underscore/modules/_flatten.js ***! 32436 \*****************************************************/ 32437(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32438 32439"use strict"; 32440__webpack_require__.r(__webpack_exports__); 32441/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32442/* harmony export */ "default": () => (/* binding */ flatten) 32443/* harmony export */ }); 32444/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 32445/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 32446/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 32447/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/underscore/modules/isArguments.js"); 32448 32449 32450 32451 32452 32453// Internal implementation of a recursive `flatten` function. 32454function flatten(input, depth, strict) { 32455 if (!depth && depth !== 0) depth = Infinity; 32456 var output = [], idx = 0, i = 0, length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input) || 0, stack = []; 32457 while (true) { 32458 if (i >= length) { 32459 if (!stack.length) break; 32460 var frame = stack.pop(); 32461 i = frame.i; 32462 input = frame.v; 32463 length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input); 32464 continue; 32465 } 32466 var value = input[i++]; 32467 if (stack.length >= depth) { 32468 output[idx++] = value; 32469 } else if ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value))) { 32470 // Flatten current level of array or arguments object. 32471 stack.push({i: i, v: input}); 32472 i = 0; 32473 input = value; 32474 length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input); 32475 } else if (!strict) { 32476 output[idx++] = value; 32477 } 32478 } 32479 return output; 32480} 32481 32482 32483/***/ }, 32484 32485/***/ "./node_modules/underscore/modules/_getByteLength.js" 32486/*!***********************************************************!*\ 32487 !*** ./node_modules/underscore/modules/_getByteLength.js ***! 32488 \***********************************************************/ 32489(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32490 32491"use strict"; 32492__webpack_require__.r(__webpack_exports__); 32493/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32494/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32495/* harmony export */ }); 32496/* harmony import */ var _shallowProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shallowProperty.js */ "./node_modules/underscore/modules/_shallowProperty.js"); 32497 32498 32499// Internal helper to obtain the `byteLength` property of an object. 32500/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_shallowProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('byteLength')); 32501 32502 32503/***/ }, 32504 32505/***/ "./node_modules/underscore/modules/_getLength.js" 32506/*!*******************************************************!*\ 32507 !*** ./node_modules/underscore/modules/_getLength.js ***! 32508 \*******************************************************/ 32509(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32510 32511"use strict"; 32512__webpack_require__.r(__webpack_exports__); 32513/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32514/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32515/* harmony export */ }); 32516/* harmony import */ var _shallowProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shallowProperty.js */ "./node_modules/underscore/modules/_shallowProperty.js"); 32517 32518 32519// Internal helper to obtain the `length` property of an object. 32520/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_shallowProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('length')); 32521 32522 32523/***/ }, 32524 32525/***/ "./node_modules/underscore/modules/_group.js" 32526/*!***************************************************!*\ 32527 !*** ./node_modules/underscore/modules/_group.js ***! 32528 \***************************************************/ 32529(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32530 32531"use strict"; 32532__webpack_require__.r(__webpack_exports__); 32533/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32534/* harmony export */ "default": () => (/* binding */ group) 32535/* harmony export */ }); 32536/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 32537/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 32538 32539 32540 32541// An internal function used for aggregate "group by" operations. 32542function group(behavior, partition) { 32543 return function(obj, iteratee, context) { 32544 var result = partition ? [[], []] : {}; 32545 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context); 32546 (0,_each_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj, function(value, index) { 32547 var key = iteratee(value, index, obj); 32548 behavior(result, value, key); 32549 }); 32550 return result; 32551 }; 32552} 32553 32554 32555/***/ }, 32556 32557/***/ "./node_modules/underscore/modules/_has.js" 32558/*!*************************************************!*\ 32559 !*** ./node_modules/underscore/modules/_has.js ***! 32560 \*************************************************/ 32561(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32562 32563"use strict"; 32564__webpack_require__.r(__webpack_exports__); 32565/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32566/* harmony export */ "default": () => (/* binding */ has) 32567/* harmony export */ }); 32568/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32569 32570 32571// Internal function to check whether `key` is an own property name of `obj`. 32572function has(obj, key) { 32573 return obj != null && _setup_js__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty.call(obj, key); 32574} 32575 32576 32577/***/ }, 32578 32579/***/ "./node_modules/underscore/modules/_hasObjectTag.js" 32580/*!**********************************************************!*\ 32581 !*** ./node_modules/underscore/modules/_hasObjectTag.js ***! 32582 \**********************************************************/ 32583(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32584 32585"use strict"; 32586__webpack_require__.r(__webpack_exports__); 32587/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32588/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32589/* harmony export */ }); 32590/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 32591 32592 32593/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Object')); 32594 32595 32596/***/ }, 32597 32598/***/ "./node_modules/underscore/modules/_isArrayLike.js" 32599/*!*********************************************************!*\ 32600 !*** ./node_modules/underscore/modules/_isArrayLike.js ***! 32601 \*********************************************************/ 32602(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32603 32604"use strict"; 32605__webpack_require__.r(__webpack_exports__); 32606/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32607/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32608/* harmony export */ }); 32609/* harmony import */ var _createSizePropertyCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createSizePropertyCheck.js */ "./node_modules/underscore/modules/_createSizePropertyCheck.js"); 32610/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 32611 32612 32613 32614// Internal helper for collection methods to determine whether a collection 32615// should be iterated as an array or as an object. 32616// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength 32617// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 32618/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createSizePropertyCheck_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_getLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 32619 32620 32621/***/ }, 32622 32623/***/ "./node_modules/underscore/modules/_isBufferLike.js" 32624/*!**********************************************************!*\ 32625 !*** ./node_modules/underscore/modules/_isBufferLike.js ***! 32626 \**********************************************************/ 32627(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32628 32629"use strict"; 32630__webpack_require__.r(__webpack_exports__); 32631/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32632/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32633/* harmony export */ }); 32634/* harmony import */ var _createSizePropertyCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createSizePropertyCheck.js */ "./node_modules/underscore/modules/_createSizePropertyCheck.js"); 32635/* harmony import */ var _getByteLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getByteLength.js */ "./node_modules/underscore/modules/_getByteLength.js"); 32636 32637 32638 32639// Internal helper to determine whether we should spend extensive checks against 32640// `ArrayBuffer` et al. 32641/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createSizePropertyCheck_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_getByteLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 32642 32643 32644/***/ }, 32645 32646/***/ "./node_modules/underscore/modules/_keyInObj.js" 32647/*!******************************************************!*\ 32648 !*** ./node_modules/underscore/modules/_keyInObj.js ***! 32649 \******************************************************/ 32650(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32651 32652"use strict"; 32653__webpack_require__.r(__webpack_exports__); 32654/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32655/* harmony export */ "default": () => (/* binding */ keyInObj) 32656/* harmony export */ }); 32657// Internal `_.pick` helper function to determine whether `key` is an enumerable 32658// property name of `obj`. 32659function keyInObj(value, key, obj) { 32660 return key in obj; 32661} 32662 32663 32664/***/ }, 32665 32666/***/ "./node_modules/underscore/modules/_methodFingerprint.js" 32667/*!***************************************************************!*\ 32668 !*** ./node_modules/underscore/modules/_methodFingerprint.js ***! 32669 \***************************************************************/ 32670(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32671 32672"use strict"; 32673__webpack_require__.r(__webpack_exports__); 32674/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32675/* harmony export */ ie11fingerprint: () => (/* binding */ ie11fingerprint), 32676/* harmony export */ mapMethods: () => (/* binding */ mapMethods), 32677/* harmony export */ setMethods: () => (/* binding */ setMethods), 32678/* harmony export */ weakMapMethods: () => (/* binding */ weakMapMethods) 32679/* harmony export */ }); 32680/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 32681/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 32682/* harmony import */ var _allKeys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./allKeys.js */ "./node_modules/underscore/modules/allKeys.js"); 32683 32684 32685 32686 32687// Since the regular `Object.prototype.toString` type tests don't work for 32688// some types in IE 11, we use a fingerprinting heuristic instead, based 32689// on the methods. It's not great, but it's the best we got. 32690// The fingerprint method lists are defined below. 32691function ie11fingerprint(methods) { 32692 var length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methods); 32693 return function(obj) { 32694 if (obj == null) return false;
32695 // `Map`, `WeakMap` and `Set` have no enumerable keys. 32696 var keys = (0,_allKeys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj); 32697 if ((0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(keys)) return false; 32698 for (var i = 0; i < length; i++) { 32699 if (!(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj[methods[i]])) return false; 32700 } 32701 // If we are testing against `WeakMap`, we need to ensure that 32702 // `obj` doesn't have a `forEach` method in order to distinguish 32703 // it from a regular `Map`. 32704 return methods !== weakMapMethods || !(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj[forEachName]); 32705 }; 32706} 32707 32708// In the interest of compact minification, we write 32709// each string in the fingerprints only once. 32710var forEachName = 'forEach', 32711 hasName = 'has', 32712 commonInit = ['clear', 'delete'], 32713 mapTail = ['get', hasName, 'set']; 32714 32715// `Map`, `WeakMap` and `Set` each have slightly different 32716// combinations of the above sublists. 32717var mapMethods = commonInit.concat(forEachName, mapTail), 32718 weakMapMethods = commonInit.concat(mapTail), 32719 setMethods = ['add'].concat(commonInit, forEachName, hasName); 32720 32721 32722/***/ }, 32723 32724/***/ "./node_modules/underscore/modules/_optimizeCb.js" 32725/*!********************************************************!*\ 32726 !*** ./node_modules/underscore/modules/_optimizeCb.js ***! 32727 \********************************************************/ 32728(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32729 32730"use strict"; 32731__webpack_require__.r(__webpack_exports__); 32732/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32733/* harmony export */ "default": () => (/* binding */ optimizeCb) 32734/* harmony export */ }); 32735// Internal function that returns an efficient (for current engines) version 32736// of the passed-in callback, to be repeatedly applied in other Underscore 32737// functions. 32738function optimizeCb(func, context, argCount) { 32739 if (context === void 0) return func; 32740 switch (argCount == null ? 3 : argCount) { 32741 case 1: return function(value) { 32742 return func.call(context, value); 32743 }; 32744 // The 2-argument case is omitted because we’re not using it. 32745 case 3: return function(value, index, collection) { 32746 return func.call(context, value, index, collection); 32747 }; 32748 case 4: return function(accumulator, value, index, collection) { 32749 return func.call(context, accumulator, value, index, collection); 32750 }; 32751 } 32752 return function() { 32753 return func.apply(context, arguments); 32754 }; 32755} 32756 32757 32758/***/ }, 32759 32760/***/ "./node_modules/underscore/modules/_setup.js" 32761/*!***************************************************!*\ 32762 !*** ./node_modules/underscore/modules/_setup.js ***! 32763 \***************************************************/ 32764(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32765 32766"use strict"; 32767__webpack_require__.r(__webpack_exports__); 32768/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32769/* harmony export */ ArrayProto: () => (/* binding */ ArrayProto), 32770/* harmony export */ MAX_ARRAY_INDEX: () => (/* binding */ MAX_ARRAY_INDEX), 32771/* harmony export */ ObjProto: () => (/* binding */ ObjProto), 32772/* harmony export */ SymbolProto: () => (/* binding */ SymbolProto), 32773/* harmony export */ VERSION: () => (/* binding */ VERSION), 32774/* harmony export */ _isFinite: () => (/* binding */ _isFinite), 32775/* harmony export */ _isNaN: () => (/* binding */ _isNaN), 32776/* harmony export */ hasEnumBug: () => (/* binding */ hasEnumBug), 32777/* harmony export */ hasOwnProperty: () => (/* binding */ hasOwnProperty), 32778/* harmony export */ nativeCreate: () => (/* binding */ nativeCreate), 32779/* harmony export */ nativeIsArray: () => (/* binding */ nativeIsArray), 32780/* harmony export */ nativeIsView: () => (/* binding */ nativeIsView), 32781/* harmony export */ nativeKeys: () => (/* binding */ nativeKeys), 32782/* harmony export */ nonEnumerableProps: () => (/* binding */ nonEnumerableProps), 32783/* harmony export */ push: () => (/* binding */ push), 32784/* harmony export */ root: () => (/* binding */ root), 32785/* harmony export */ slice: () => (/* binding */ slice), 32786/* harmony export */ supportsArrayBuffer: () => (/* binding */ supportsArrayBuffer),
32787/* harmony export */ supportsDataView: () => (/* binding */ supportsDataView), 32788/* harmony export */ toString: () => (/* binding */ toString) 32789/* harmony export */ }); 32790// Current version. 32791var VERSION = '1.13.8'; 32792 32793// Establish the root object, `window` (`self`) in the browser, `global` 32794// on the server, or `this` in some virtual machines. We use `self` 32795// instead of `window` for `WebWorker` support. 32796var root = (typeof self == 'object' && self.self === self && self) || 32797 (typeof __webpack_require__.g == 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g) || 32798 Function('return this')() || 32799 {}; 32800 32801// Save bytes in the minified (but not gzipped) version: 32802var ArrayProto = Array.prototype, ObjProto = Object.prototype; 32803var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; 32804 32805// Create quick reference variables for speed access to core prototypes. 32806var push = ArrayProto.push, 32807 slice = ArrayProto.slice, 32808 toString = ObjProto.toString, 32809 hasOwnProperty = ObjProto.hasOwnProperty; 32810 32811// Modern feature detection. 32812var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', 32813 supportsDataView = typeof DataView !== 'undefined'; 32814 32815// All **ECMAScript 5+** native function implementations that we hope to use 32816// are declared here. 32817var nativeIsArray = Array.isArray, 32818 nativeKeys = Object.keys, 32819 nativeCreate = Object.create, 32820 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; 32821 32822// Create references to these builtin functions because we override them. 32823var _isNaN = isNaN, 32824 _isFinite = isFinite; 32825 32826// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. 32827var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); 32828var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 32829 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; 32830 32831// The largest integer that can be represented exactly. 32832var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; 32833 32834 32835/***/ }, 32836 32837/***/ "./node_modules/underscore/modules/_shallowProperty.js" 32838/*!*************************************************************!*\ 32839 !*** ./node_modules/underscore/modules/_shallowProperty.js ***! 32840 \*************************************************************/ 32841(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32842 32843"use strict"; 32844__webpack_require__.r(__webpack_exports__); 32845/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32846/* harmony export */ "default": () => (/* binding */ shallowProperty) 32847/* harmony export */ }); 32848// Internal helper to generate a function to obtain property `key` from `obj`. 32849function shallowProperty(key) { 32850 return function(obj) { 32851 return obj == null ? void 0 : obj[key]; 32852 }; 32853} 32854 32855 32856/***/ }, 32857 32858/***/ "./node_modules/underscore/modules/_stringTagBug.js" 32859/*!**********************************************************!*\ 32860 !*** ./node_modules/underscore/modules/_stringTagBug.js ***! 32861 \**********************************************************/ 32862(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32863 32864"use strict"; 32865__webpack_require__.r(__webpack_exports__); 32866/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32867/* harmony export */ hasDataViewBug: () => (/* binding */ hasDataViewBug), 32868/* harmony export */ isIE11: () => (/* binding */ isIE11) 32869/* harmony export */ }); 32870/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32871/* harmony import */ var _hasObjectTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasObjectTag.js */ "./node_modules/underscore/modules/_hasObjectTag.js"); 32872 32873 32874 32875// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. 32876// In IE 11, the most common among them, this problem also applies to 32877// `Map`, `WeakMap` and `Set`. 32878// Also, there are cases where an application can override the native 32879// `DataView` object, in cases like that we can't use the constructor 32880// safely and should just rely on alternate `DataView` checks 32881var hasDataViewBug = (
32882 _setup_js__WEBPACK_IMPORTED_MODULE_0__.supportsDataView && (!/\[native code\]/.test(String(DataView)) || (0,_hasObjectTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(new DataView(new ArrayBuffer(8)))) 32883 ), 32884 isIE11 = (typeof Map !== 'undefined' && (0,_hasObjectTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(new Map)); 32885 32886 32887/***/ }, 32888 32889/***/ "./node_modules/underscore/modules/_tagTester.js" 32890/*!*******************************************************!*\ 32891 !*** ./node_modules/underscore/modules/_tagTester.js ***! 32892 \*******************************************************/ 32893(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32894 32895"use strict"; 32896__webpack_require__.r(__webpack_exports__); 32897/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32898/* harmony export */ "default": () => (/* binding */ tagTester) 32899/* harmony export */ }); 32900/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 32901 32902 32903// Internal function for creating a `toString`-based type tester. 32904function tagTester(name) { 32905 var tag = '[object ' + name + ']'; 32906 return function(obj) { 32907 return _setup_js__WEBPACK_IMPORTED_MODULE_0__.toString.call(obj) === tag; 32908 }; 32909} 32910 32911 32912/***/ }, 32913 32914/***/ "./node_modules/underscore/modules/_toBufferView.js" 32915/*!**********************************************************!*\ 32916 !*** ./node_modules/underscore/modules/_toBufferView.js ***! 32917 \**********************************************************/ 32918(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32919 32920"use strict"; 32921__webpack_require__.r(__webpack_exports__); 32922/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32923/* harmony export */ "default": () => (/* binding */ toBufferView) 32924/* harmony export */ }); 32925/* harmony import */ var _getByteLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getByteLength.js */ "./node_modules/underscore/modules/_getByteLength.js"); 32926 32927 32928// Internal function to wrap or shallow-copy an ArrayBuffer, 32929// typed array or DataView to a new view, reusing the buffer. 32930function toBufferView(bufferSource) { 32931 return new Uint8Array( 32932 bufferSource.buffer || bufferSource, 32933 bufferSource.byteOffset || 0, 32934 (0,_getByteLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(bufferSource) 32935 ); 32936} 32937 32938 32939/***/ }, 32940 32941/***/ "./node_modules/underscore/modules/_toPath.js" 32942/*!****************************************************!*\ 32943 !*** ./node_modules/underscore/modules/_toPath.js ***! 32944 \****************************************************/ 32945(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32946 32947"use strict"; 32948__webpack_require__.r(__webpack_exports__); 32949/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32950/* harmony export */ "default": () => (/* binding */ toPath) 32951/* harmony export */ }); 32952/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 32953/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/underscore/modules/toPath.js"); 32954 32955 32956 32957// Internal wrapper for `_.toPath` to enable minification. 32958// Similar to `cb` for `_.iteratee`. 32959function toPath(path) { 32960 return _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].toPath(path); 32961} 32962 32963 32964/***/ }, 32965 32966/***/ "./node_modules/underscore/modules/_unescapeMap.js" 32967/*!*********************************************************!*\ 32968 !*** ./node_modules/underscore/modules/_unescapeMap.js ***! 32969 \*********************************************************/ 32970(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32971 32972"use strict"; 32973__webpack_require__.r(__webpack_exports__); 32974/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32975/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 32976/* harmony export */ }); 32977/* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./invert.js */ "./node_modules/underscore/modules/invert.js"); 32978/* harmony import */ var _escapeMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_escapeMap.js */ "./node_modules/underscore/modules/_escapeMap.js"); 32979 32980 32981 32982// Internal list of HTML entities for unescaping. 32983/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_invert_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_escapeMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 32984 32985 32986/***/ }, 32987 32988/***/ "./node_modules/underscore/modules/after.js" 32989/*!**************************************************!*\ 32990 !*** ./node_modules/underscore/modules/after.js ***! 32991 \**************************************************/ 32992(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32993 32994"use strict"; 32995__webpack_require__.r(__webpack_exports__); 32996/* harmony export */ __webpack_require__.d(__webpack_exports__, { 32997/* harmony export */ "default": () => (/* binding */ after) 32998/* harmony export */ }); 32999// Returns a function that will only be executed on and after the Nth call. 33000function after(times, func) { 33001 return function() { 33002 if (--times < 1) { 33003 return func.apply(this, arguments); 33004 } 33005 }; 33006} 33007 33008 33009/***/ }, 33010 33011/***/ "./node_modules/underscore/modules/allKeys.js" 33012/*!****************************************************!*\ 33013 !*** ./node_modules/underscore/modules/allKeys.js ***! 33014 \****************************************************/ 33015(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33016 33017"use strict"; 33018__webpack_require__.r(__webpack_exports__); 33019/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33020/* harmony export */ "default": () => (/* binding */ allKeys) 33021/* harmony export */ }); 33022/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 33023/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 33024/* harmony import */ var _collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_collectNonEnumProps.js */ "./node_modules/underscore/modules/_collectNonEnumProps.js"); 33025 33026 33027 33028 33029// Retrieve all the enumerable property names of an object. 33030function allKeys(obj) { 33031 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return []; 33032 var keys = []; 33033 for (var key in obj) keys.push(key); 33034 // Ahem, IE < 9. 33035 if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, keys); 33036 return keys; 33037} 33038 33039 33040/***/ }, 33041 33042/***/ "./node_modules/underscore/modules/before.js" 33043/*!***************************************************!*\ 33044 !*** ./node_modules/underscore/modules/before.js ***! 33045 \***************************************************/ 33046(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33047 33048"use strict"; 33049__webpack_require__.r(__webpack_exports__); 33050/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33051/* harmony export */ "default": () => (/* binding */ before) 33052/* harmony export */ }); 33053// Returns a function that will only be executed up to (but not including) the 33054// Nth call. 33055function before(times, func) { 33056 var memo; 33057 return function() { 33058 if (--times > 0) { 33059 memo = func.apply(this, arguments); 33060 } 33061 if (times <= 1) func = null; 33062 return memo; 33063 }; 33064} 33065 33066 33067/***/ }, 33068 33069/***/ "./node_modules/underscore/modules/bind.js" 33070/*!*************************************************!*\ 33071 !*** ./node_modules/underscore/modules/bind.js ***! 33072 \*************************************************/ 33073(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33074 33075"use strict"; 33076__webpack_require__.r(__webpack_exports__); 33077/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33078/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33079/* harmony export */ }); 33080/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 33081/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 33082/* harmony import */ var _executeBound_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_executeBound.js */ "./node_modules/underscore/modules/_executeBound.js"); 33083 33084 33085 33086 33087// Create a function bound to a given object (assigning `this`, and arguments, 33088// optionally). 33089/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, context, args
33089) { 33090 if (!(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func)) throw new TypeError('Bind must be called on a function'); 33091 var bound = (0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(callArgs) { 33092 return (0,_executeBound_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func, bound, context, this, args.concat(callArgs)); 33093 }); 33094 return bound; 33095})); 33096 33097 33098/***/ }, 33099 33100/***/ "./node_modules/underscore/modules/bindAll.js" 33101/*!****************************************************!*\ 33102 !*** ./node_modules/underscore/modules/bindAll.js ***! 33103 \****************************************************/ 33104(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33105 33106"use strict"; 33107__webpack_require__.r(__webpack_exports__); 33108/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33109/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33110/* harmony export */ }); 33111/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 33112/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 33113/* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bind.js */ "./node_modules/underscore/modules/bind.js"); 33114 33115 33116 33117 33118// Bind a number of an object's methods to that object. Remaining arguments 33119// are the method names to be bound. Useful for ensuring that all callbacks 33120// defined on an object belong to it. 33121/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(obj, keys) { 33122 keys = (0,_flatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(keys, false, false); 33123 var index = keys.length; 33124 if (index < 1) throw new Error('bindAll must be passed function names'); 33125 while (index--) { 33126 var key = keys[index]; 33127 obj[key] = (0,_bind_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj[key], obj); 33128 } 33129 return obj; 33130})); 33131 33132 33133/***/ }, 33134 33135/***/ "./node_modules/underscore/modules/chain.js" 33136/*!**************************************************!*\ 33137 !*** ./node_modules/underscore/modules/chain.js ***! 33138 \**************************************************/ 33139(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33140 33141"use strict"; 33142__webpack_require__.r(__webpack_exports__); 33143/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33144/* harmony export */ "default": () => (/* binding */ chain) 33145/* harmony export */ }); 33146/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 33147 33148 33149// Start chaining a wrapped Underscore object. 33150function chain(obj) { 33151 var instance = (0,_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj); 33152 instance._chain = true; 33153 return instance; 33154} 33155 33156 33157/***/ }, 33158 33159/***/ "./node_modules/underscore/modules/chunk.js" 33160/*!**************************************************!*\ 33161 !*** ./node_modules/underscore/modules/chunk.js ***! 33162 \**************************************************/ 33163(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33164 33165"use strict"; 33166__webpack_require__.r(__webpack_exports__); 33167/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33168/* harmony export */ "default": () => (/* binding */ chunk) 33169/* harmony export */ }); 33170/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 33171 33172 33173// Chunk a single array into multiple arrays, each containing `count` or fewer 33174// items. 33175function chunk(array, count) { 33176 if (count == null || count < 1) return []; 33177 var result = []; 33178 var i = 0, length = array.length; 33179 while (i < length) { 33180 result.push(_setup_js__WEBPACK_IMPORTED_MODULE_0__.slice.call(array, i, i += count)); 33181 } 33182 return result; 33183} 33184 33185 33186/***/ }, 33187 33188/***/ "./node_modules/underscore/modules/clone.js" 33189/*!**************************************************!*\ 33190 !*** ./node_modules/underscore/modules/clone.js ***! 33191 \**************************************************/ 33192(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33193 33194"use strict"; 33195__webpack_require__.r(__webpack_exports__); 33196/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33197/* harmony export */ "default": () => (/* binding */ clone) 33198/* harmony export */ }); 33199/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 33200/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 33201/* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extend.js */ "./node_modules/underscore/modules/extend.js"); 33202 33203 33204 33205 33206// Create a (shallow-cloned) duplicate of an object. 33207function clone(obj) { 33208 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return obj; 33209 return (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) ? obj.slice() : (0,_extend_js__WEBPACK_IMPORTED_MODULE_2__["default"])({}, obj); 33210} 33211 33212 33213/***/ }, 33214 33215/***/ "./node_modules/underscore/modules/compact.js" 33216/*!****************************************************!*\ 33217 !*** ./node_modules/underscore/modules/compact.js ***! 33218 \****************************************************/ 33219(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33220 33221"use strict"; 33222__webpack_require__.r(__webpack_exports__); 33223/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33224/* harmony export */ "default": () => (/* binding */ compact) 33225/* harmony export */ }); 33226/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter.js */ "./node_modules/underscore/modules/filter.js"); 33227 33228 33229// Trim out all falsy values from an array.
33230function compact(array) { 33231 return (0,_filter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Boolean); 33232} 33233 33234 33235/***/ }, 33236 33237/***/ "./node_modules/underscore/modules/compose.js" 33238/*!****************************************************!*\ 33239 !*** ./node_modules/underscore/modules/compose.js ***! 33240 \****************************************************/ 33241(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33242 33243"use strict"; 33244__webpack_require__.r(__webpack_exports__); 33245/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33246/* harmony export */ "default": () => (/* binding */ compose) 33247/* harmony export */ }); 33248// Returns a function that is the composition of a list of functions, each 33249// consuming the return value of the function that follows. 33250function compose() { 33251 var args = arguments; 33252 var start = args.length - 1; 33253 return function() { 33254 var i = start; 33255 var result = args[start].apply(this, arguments); 33256 while (i--) result = args[i].call(this, result); 33257 return result; 33258 }; 33259} 33260 33261 33262/***/ }, 33263 33264/***/ "./node_modules/underscore/modules/constant.js" 33265/*!*****************************************************!*\ 33266 !*** ./node_modules/underscore/modules/constant.js ***! 33267 \*****************************************************/ 33268(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33269 33270"use strict"; 33271__webpack_require__.r(__webpack_exports__); 33272/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33273/* harmony export */ "default": () => (/* binding */ constant) 33274/* harmony export */ }); 33275// Predicate-generating function. Often useful outside of Underscore. 33276function constant(value) { 33277 return function() { 33278 return value; 33279 }; 33280} 33281 33282 33283/***/ }, 33284 33285/***/ "./node_modules/underscore/modules/contains.js" 33286/*!*****************************************************!*\ 33287 !*** ./node_modules/underscore/modules/contains.js ***! 33288 \*****************************************************/ 33289(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33290 33291"use strict"; 33292__webpack_require__.r(__webpack_exports__); 33293/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33294/* harmony export */ "default": () => (/* binding */ contains) 33295/* harmony export */ }); 33296/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 33297/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 33298/* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/underscore/modules/indexOf.js"); 33299 33300 33301 33302 33303// Determine if the array or object contains a given item (using `===`). 33304function contains(obj, item, fromIndex, guard) { 33305 if (!(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) obj = (0,_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj); 33306 if (typeof fromIndex != 'number' || guard) fromIndex = 0; 33307 return (0,_indexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, item, fromIndex) >= 0; 33308} 33309 33310 33311/***/ }, 33312 33313/***/ "./node_modules/underscore/modules/countBy.js" 33314/*!****************************************************!*\ 33315 !*** ./node_modules/underscore/modules/countBy.js ***! 33316 \****************************************************/ 33317(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33318 33319"use strict"; 33320__webpack_require__.r(__webpack_exports__); 33321/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33322/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33323/* harmony export */ }); 33324/* harmony import */ var _group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_group.js */ "./node_modules/underscore/modules/_group.js"); 33325/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 33326 33327 33328 33329// Counts instances of an object that group by a certain criterion. Pass 33330// either a string attribute to count by, or a function that returns the 33331// criterion. 33332/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_group_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) { 33333 if ((0,_has_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, key)) result[key]++; else result[key] = 1; 33334})); 33335 33336 33337/***/ }, 33338 33339/***/ "./node_modules/underscore/modules/create.js" 33340/*!***************************************************!*\ 33341 !*** ./node_modules/underscore/modules/create.js ***! 33342 \***************************************************/ 33343(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33344 33345"use strict"; 33346__webpack_require__.r(__webpack_exports__); 33347/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33348/* harmony export */ "default": () => (/* binding */ create) 33349/* harmony export */ }); 33350/* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/underscore/modules/_baseCreate.js"); 33351/* harmony import */ var _extendOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extendOwn.js */ "./node_modules/underscore/modules/extendOwn.js"); 33352 33353 33354 33355// Creates an object that inherits from the given prototype object. 33356// If additional properties are provided then they will be added to the 33357// created object. 33358function create(prototype, props) { 33359 var result = (0,_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prototype); 33360 if (props) (0,_extendOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, props); 33361 return result; 33362} 33363 33364 33365/***/ }, 33366 33367/***/ "./node_modules/underscore/modules/debounce.js" 33368/*!*****************************************************!*\ 33369 !*** ./node_modules/underscore/modules/debounce.js ***! 33370 \*****************************************************/ 33371(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33372 33373"use strict"; 33374__webpack_require__.r(__webpack_exports__); 33375/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33376/* harmony export */ "default": () => (/* binding */ debounce) 33377/* harmony export */ }); 33378/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 33379/* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now.js */ "./node_modules/underscore/modules/now.js"); 33380 33381 33382 33383// When a sequence of calls of the returned function ends, the argument 33384// function is triggered. The end of a sequence is defined by the `wait` 33385// parameter. If `immediate` is passed, the argument function will be 33386// triggered at the beginning of the sequence instead of at the end. 33387function debounce(func, wait, immediate) { 33388 var timeout, previous, args, result, context; 33389 33390 var later = function() { 33391 var passed = (0,_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])() - previous; 33392 if (wait > passed) { 33393 timeout = setTimeout(later, wait - passed); 33394 } else { 33395 timeout = null;
33396 if (!immediate) result = func.apply(context, args); 33397 // This check is needed because `func` can recursively invoke `debounced`. 33398 if (!timeout) args = context = null; 33399 } 33400 }; 33401 33402 var debounced = (0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(_args) { 33403 context = this; 33404 args = _args; 33405 previous = (0,_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])(); 33406 if (!timeout) { 33407 timeout = setTimeout(later, wait); 33408 if (immediate) result = func.apply(context, args); 33409 } 33410 return result; 33411 }); 33412 33413 debounced.cancel = function() { 33414 clearTimeout(timeout); 33415 timeout = args = context = null; 33416 }; 33417 33418 return debounced; 33419} 33420 33421 33422/***/ }, 33423 33424/***/ "./node_modules/underscore/modules/defaults.js" 33425/*!*****************************************************!*\ 33426 !*** ./node_modules/underscore/modules/defaults.js ***! 33427 \*****************************************************/ 33428(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33429 33430"use strict"; 33431__webpack_require__.r(__webpack_exports__); 33432/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33433/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33434/* harmony export */ }); 33435/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/underscore/modules/_createAssigner.js"); 33436/* harmony import */ var _allKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./allKeys.js */ "./node_modules/underscore/modules/allKeys.js"); 33437 33438 33439 33440// Fill in a given object with default properties. 33441/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_allKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"], true)); 33442 33443 33444/***/ }, 33445 33446/***/ "./node_modules/underscore/modules/defer.js" 33447/*!**************************************************!*\ 33448 !*** ./node_modules/underscore/modules/defer.js ***! 33449 \**************************************************/ 33450(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33451 33452"use strict"; 33453__webpack_require__.r(__webpack_exports__); 33454/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33455/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33456/* harmony export */ }); 33457/* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./partial.js */ "./node_modules/underscore/modules/partial.js"); 33458/* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./delay.js */ "./node_modules/underscore/modules/delay.js"); 33459/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 33460 33461 33462 33463 33464// Defers a function, scheduling it to run after the current call stack has 33465// cleared. 33466/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_partial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_delay_js__WEBPACK_IMPORTED_MODULE_1__["default"], _underscore_js__WEBPACK_IMPORTED_MODULE_2__["default"], 1)); 33467 33468 33469/***/ }, 33470 33471/***/ "./node_modules/underscore/modules/delay.js" 33472/*!**************************************************!*\ 33473 !*** ./node_modules/underscore/modules/delay.js ***! 33474 \**************************************************/ 33475(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33476 33477"use strict"; 33478__webpack_require__.r(__webpack_exports__); 33479/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33480/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33481/* harmony export */ }); 33482/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 33483 33484 33485// Delays a function for the given number of milliseconds, and then calls 33486// it with the arguments supplied. 33487/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, wait, args
33487) { 33488 return setTimeout(function() { 33489 return func.apply(null, args); 33490 }, wait); 33491})); 33492 33493 33494/***/ }, 33495 33496/***/ "./node_modules/underscore/modules/difference.js" 33497/*!*******************************************************!*\ 33498 !*** ./node_modules/underscore/modules/difference.js ***! 33499 \*******************************************************/ 33500(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33501 33502"use strict"; 33503__webpack_require__.r(__webpack_exports__); 33504/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33505/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33506/* harmony export */ }); 33507/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 33508/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 33509/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filter.js */ "./node_modules/underscore/modules/filter.js"); 33510/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contains.js */ "./node_modules/underscore/modules/contains.js"); 33511 33512 33513 33514 33515 33516// Take the difference between one array and a number of other arrays. 33517// Only the elements present in just the first array will remain. 33518/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(array, rest) { 33519 rest = (0,_flatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(rest, true, true); 33520 return (0,_filter_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, function(value){ 33521 return !(0,_contains_js__WEBPACK_IMPORTED_MODULE_3__["default"])(rest, value); 33522 }); 33523})); 33524 33525 33526/***/ }, 33527 33528/***/ "./node_modules/underscore/modules/each.js" 33529/*!*************************************************!*\ 33530 !*** ./node_modules/underscore/modules/each.js ***! 33531 \*************************************************/ 33532(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33533 33534"use strict"; 33535__webpack_require__.r(__webpack_exports__); 33536/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33537/* harmony export */ "default": () => (/* binding */ each) 33538/* harmony export */ }); 33539/* harmony import */ var _optimizeCb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_optimizeCb.js */ "./node_modules/underscore/modules/_optimizeCb.js"); 33540/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 33541/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 33542 33543 33544 33545 33546// The cornerstone for collection functions, an `each` 33547// implementation, aka `forEach`. 33548// Handles raw objects in addition to array-likes. Treats all 33549// sparse array-likes as if they were dense. 33550function each(obj, iteratee, context) { 33551 iteratee = (0,_optimizeCb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context); 33552 var i, length; 33553 if ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj)) { 33554 for (i = 0, length = obj.length; i < length; i++) { 33555 iteratee(obj[i], i, obj); 33556 } 33557 } else { 33558 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj); 33559 for (i = 0, length = _keys.length; i < length; i++) { 33560 iteratee(obj[_keys[i]], _keys[i], obj); 33561 } 33562 } 33563 return obj; 33564} 33565 33566 33567/***/ }, 33568 33569/***/ "./node_modules/underscore/modules/escape.js" 33570/*!***************************************************!*\ 33571 !*** ./node_modules/underscore/modules/escape.js ***! 33572 \***************************************************/ 33573(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33574 33575"use strict"; 33576__webpack_require__.r(__webpack_exports__); 33577/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33578/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33579/* harmony export */ }); 33580/* harmony import */ var _createEscaper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createEscaper.js */ "./node_modules/underscore/modules/_createEscaper.js"); 33581/* harmony import */ var _escapeMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_escapeMap.js */ "./node_modules/underscore/modules/_escapeMap.js"); 33582 33583 33584 33585// Function for escaping strings to HTML interpolation. 33586/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createEscaper_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_escapeMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 33587 33588 33589/***/ }, 33590 33591/***/ "./node_modules/underscore/modules/every.js" 33592/*!**************************************************!*\ 33593 !*** ./node_modules/underscore/modules/every.js ***! 33594 \**************************************************/ 33595(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33596 33597"use strict"; 33598__webpack_require__.r(__webpack_exports__); 33599/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33600/* harmony export */ "default": () => (/* binding */ every) 33601/* harmony export */ }); 33602/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 33603/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 33604/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 33605 33606 33607 33608 33609// Determine whether all of the elements pass a truth test. 33610function every(obj, predicate, context) { 33611 predicate = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, context); 33612 var _keys = !(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && (0,_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj), 33613 length = (_keys || obj).length; 33614 for (var index = 0; index < length; index++) { 33615 var currentKey = _keys ? _keys[index] : index; 33616 if (!predicate(obj[currentKey], currentKey, obj)) return false;
33617 } 33618 return true; 33619} 33620 33621 33622/***/ }, 33623 33624/***/ "./node_modules/underscore/modules/extend.js" 33625/*!***************************************************!*\ 33626 !*** ./node_modules/underscore/modules/extend.js ***! 33627 \***************************************************/ 33628(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33629 33630"use strict"; 33631__webpack_require__.r(__webpack_exports__); 33632/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33633/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33634/* harmony export */ }); 33635/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/underscore/modules/_createAssigner.js"); 33636/* harmony import */ var _allKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./allKeys.js */ "./node_modules/underscore/modules/allKeys.js"); 33637 33638 33639 33640// Extend a given object with all the properties in passed-in object(s). 33641/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_allKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 33642 33643 33644/***/ }, 33645 33646/***/ "./node_modules/underscore/modules/extendOwn.js" 33647/*!******************************************************!*\ 33648 !*** ./node_modules/underscore/modules/extendOwn.js ***! 33649 \******************************************************/ 33650(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33651 33652"use strict"; 33653__webpack_require__.r(__webpack_exports__); 33654/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33655/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33656/* harmony export */ }); 33657/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/underscore/modules/_createAssigner.js"); 33658/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 33659 33660 33661 33662// Assigns a given object with all the own properties in the passed-in 33663// object(s). 33664// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) 33665/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 33666 33667 33668/***/ }, 33669 33670/***/ "./node_modules/underscore/modules/filter.js" 33671/*!***************************************************!*\ 33672 !*** ./node_modules/underscore/modules/filter.js ***! 33673 \***************************************************/ 33674(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33675 33676"use strict"; 33677__webpack_require__.r(__webpack_exports__); 33678/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33679/* harmony export */ "default": () => (/* binding */ filter) 33680/* harmony export */ }); 33681/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 33682/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 33683 33684 33685 33686// Return all the elements that pass a truth test. 33687function filter(obj, predicate, context) { 33688 var results = []; 33689 predicate = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, context); 33690 (0,_each_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj, function(value, index, list) { 33691 if (predicate(value, index, list)) results.push(value); 33692 }); 33693 return results; 33694} 33695 33696 33697/***/ }, 33698 33699/***/ "./node_modules/underscore/modules/find.js" 33700/*!*************************************************!*\ 33701 !*** ./node_modules/underscore/modules/find.js ***! 33702 \*************************************************/ 33703(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33704 33705"use strict"; 33706__webpack_require__.r(__webpack_exports__); 33707/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33708/* harmony export */ "default": () => (/* binding */ find) 33709/* harmony export */ }); 33710/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 33711/* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/underscore/modules/findIndex.js"); 33712/* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/underscore/modules/findKey.js"); 33713 33714 33715 33716 33717// Return the first value which passes a truth test. 33718function find(obj, predicate, context) { 33719 var keyFinder = (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) ? _findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _findKey_js__WEBPACK_IMPORTED_MODULE_2__["default"]; 33720 var key = keyFinder(obj, predicate, context); 33721 if (key !== void 0 && key !== -1) return obj[key]; 33722} 33723 33724 33725/***/ }, 33726 33727/***/ "./node_modules/underscore/modules/findIndex.js" 33728/*!******************************************************!*\ 33729 !*** ./node_modules/underscore/modules/findIndex.js ***! 33730 \******************************************************/ 33731(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33732 33733"use strict"; 33734__webpack_require__.r(__webpack_exports__); 33735/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33736/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33737/* harmony export */ }); 33738/* harmony import */ var _createPredicateIndexFinder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPredicateIndexFinder.js */ "./node_modules/underscore/modules/_createPredicateIndexFinder.js"); 33739 33740 33741// Returns the first index on an array-like that passes a truth test. 33742/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createPredicateIndexFinder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1)); 33743 33744 33745/***/ }, 33746 33747/***/ "./node_modules/underscore/modules/findKey.js" 33748/*!****************************************************!*\ 33749 !*** ./node_modules/underscore/modules/findKey.js ***! 33750 \****************************************************/ 33751(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33752 33753"use strict"; 33754__webpack_require__.r(__webpack_exports__); 33755/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33756/* harmony export */ "default": () =>
33756 (/* binding */ findKey) 33757/* harmony export */ }); 33758/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 33759/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 33760 33761 33762 33763// Returns the first key on an object that passes a truth test. 33764function findKey(obj, predicate, context) { 33765 predicate = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, context); 33766 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj), key; 33767 for (var i = 0, length = _keys.length; i < length; i++) { 33768 key = _keys[i]; 33769 if (predicate(obj[key], key, obj)) return key; 33770 } 33771} 33772 33773 33774/***/ }, 33775 33776/***/ "./node_modules/underscore/modules/findLastIndex.js" 33777/*!**********************************************************!*\ 33778 !*** ./node_modules/underscore/modules/findLastIndex.js ***! 33779 \**********************************************************/ 33780(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33781 33782"use strict"; 33783__webpack_require__.r(__webpack_exports__); 33784/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33785/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33786/* harmony export */ }); 33787/* harmony import */ var _createPredicateIndexFinder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPredicateIndexFinder.js */ "./node_modules/underscore/modules/_createPredicateIndexFinder.js"); 33788 33789 33790// Returns the last index on an array-like that passes a truth test. 33791/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createPredicateIndexFinder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(-1)); 33792 33793 33794/***/ }, 33795 33796/***/ "./node_modules/underscore/modules/findWhere.js" 33797/*!******************************************************!*\ 33798 !*** ./node_modules/underscore/modules/findWhere.js ***! 33799 \******************************************************/ 33800(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33801 33802"use strict"; 33803__webpack_require__.r(__webpack_exports__); 33804/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33805/* harmony export */ "default": () => (/* binding */ findWhere) 33806/* harmony export */ }); 33807/* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./find.js */ "./node_modules/underscore/modules/find.js"); 33808/* harmony import */ var _matcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matcher.js */ "./node_modules/underscore/modules/matcher.js"); 33809 33810 33811 33812// Convenience version of a common use case of `_.find`: getting the first 33813// object containing specific `key:value` pairs. 33814function findWhere(obj, attrs) { 33815 return (0,_find_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, (0,_matcher_js__WEBPACK_IMPORTED_MODULE_1__["default"])(attrs)); 33816} 33817 33818 33819/***/ }, 33820 33821/***/ "./node_modules/underscore/modules/first.js" 33822/*!**************************************************!*\ 33823 !*** ./node_modules/underscore/modules/first.js ***! 33824 \**************************************************/ 33825(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33826 33827"use strict"; 33828__webpack_require__.r(__webpack_exports__); 33829/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33830/* harmony export */ "default": () => (/* binding */ first) 33831/* harmony export */ }); 33832/* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./initial.js */ "./node_modules/underscore/modules/initial.js"); 33833 33834 33835// Get the first element of an array. Passing **n** will return the first N 33836// values in the array. The **guard** check allows it to work with `_.map`. 33837function first(array, n, guard) { 33838 if (array == null || array.length < 1) return n == null || guard ? void 0 : []; 33839 if (n == null || guard) return array[0]; 33840 return (0,_initial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, array.length - n); 33841} 33842 33843 33844/***/ }, 33845 33846/***/ "./node_modules/underscore/modules/flatten.js" 33847/*!****************************************************!*\ 33848 !*** ./node_modules/underscore/modules/flatten.js ***! 33849 \****************************************************/ 33850(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33851 33852"use strict"; 33853__webpack_require__.r(__webpack_exports__); 33854/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33855/* harmony export */ "default": () => (/* binding */ flatten) 33856/* harmony export */ }); 33857/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 33858 33859 33860// Flatten out an array, either recursively (by default), or up to `depth`. 33861// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. 33862function flatten(array, depth) { 33863 return (0,_flatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, depth, false); 33864} 33865 33866 33867/***/ }, 33868 33869/***/ "./node_modules/underscore/modules/functions.js" 33870/*!******************************************************!*\ 33871 !*** ./node_modules/underscore/modules/functions.js ***! 33872 \******************************************************/ 33873(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33874 33875"use strict"; 33876__webpack_require__.r(__webpack_exports__); 33877/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33878/* harmony export */ "default": () => (/* binding */ functions) 33879/* harmony export */ }); 33880/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 33881 33882 33883// Return a sorted list of the function names available on the object. 33884function functions(obj) { 33885 var names = []; 33886 for (var key in obj) { 33887 if ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj[key])) names.push(key); 33888 } 33889 return names.sort(); 33890} 33891 33892 33893/***/ }, 33894 33895/***/ "./node_modules/underscore/modules/get.js" 33896/*!************************************************!*\ 33897 !*** ./node_modules/underscore/modules/get.js ***! 33898 \************************************************/ 33899(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33900 33901"use strict"; 33902__webpack_require__.r(__webpack_exports__); 33903/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33904/* harmony export */ "default": () => (/* binding */ get)
33905/* harmony export */ }); 33906/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_toPath.js */ "./node_modules/underscore/modules/_toPath.js"); 33907/* harmony import */ var _deepGet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_deepGet.js */ "./node_modules/underscore/modules/_deepGet.js"); 33908/* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/underscore/modules/isUndefined.js"); 33909 33910 33911 33912 33913// Get the value of the (deep) property on `path` from `object`. 33914// If any property in `path` does not exist or if the value is 33915// `undefined`, return `defaultValue` instead. 33916// The `path` is normalized through `_.toPath`. 33917function get(object, path, defaultValue) { 33918 var value = (0,_deepGet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, (0,_toPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path)); 33919 return (0,_isUndefined_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) ? defaultValue : value; 33920} 33921 33922 33923/***/ }, 33924 33925/***/ "./node_modules/underscore/modules/groupBy.js" 33926/*!****************************************************!*\ 33927 !*** ./node_modules/underscore/modules/groupBy.js ***! 33928 \****************************************************/ 33929(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33930 33931"use strict"; 33932__webpack_require__.r(__webpack_exports__); 33933/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33934/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33935/* harmony export */ }); 33936/* harmony import */ var _group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_group.js */ "./node_modules/underscore/modules/_group.js"); 33937/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 33938 33939 33940 33941// Groups the object's values by a criterion. Pass either a string attribute 33942// to group by, or a function that returns the criterion. 33943/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_group_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) { 33944 if ((0,_has_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, key)) result[key].push(value); else result[key] = [value]; 33945})); 33946 33947 33948/***/ }, 33949 33950/***/ "./node_modules/underscore/modules/has.js" 33951/*!************************************************!*\ 33952 !*** ./node_modules/underscore/modules/has.js ***! 33953 \************************************************/ 33954(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33955 33956"use strict"; 33957__webpack_require__.r(__webpack_exports__); 33958/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33959/* harmony export */ "default": () => (/* binding */ has) 33960/* harmony export */ }); 33961/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 33962/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toPath.js */ "./node_modules/underscore/modules/_toPath.js"); 33963 33964 33965 33966// Shortcut function for checking if an object has a given property directly on 33967// itself (in other words, not on a prototype). Unlike the internal `has` 33968// function, this public version can also traverse nested properties. 33969function has(obj, path) { 33970 path = (0,_toPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path); 33971 var length = path.length; 33972 for (var i = 0; i < length; i++) { 33973 var key = path[i]; 33974 if (!(0,_has_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, key)) return false; 33975 obj = obj[key]; 33976 } 33977 return !!length; 33978} 33979 33980 33981/***/ }, 33982 33983/***/ "./node_modules/underscore/modules/identity.js" 33984/*!*****************************************************!*\ 33985 !*** ./node_modules/underscore/modules/identity.js ***! 33986 \*****************************************************/ 33987(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33988 33989"use strict"; 33990__webpack_require__.r(__webpack_exports__); 33991/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33992/* harmony export */ "default": () => (/* binding */ identity) 33993/* harmony export */ }); 33994// Keep the identity function around for default iteratees. 33995function identity(value) { 33996 return value; 33997} 33998 33999 34000/***/ }, 34001 34002/***/ "./node_modules/underscore/modules/index-all.js" 34003/*!******************************************************!*\ 34004 !*** ./node_modules/underscore/modules/index-all.js ***! 34005 \******************************************************/ 34006(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34007 34008"use strict"; 34009__webpack_require__.r(__webpack_exports__); 34010/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34011/* harmony export */ VERSION: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.VERSION), 34012/* harmony export */ after: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.after), 34013/* harmony export */ all: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.all), 34014/* harmony export */ allKeys: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.allKeys), 34015/* harmony export */ any: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.any), 34016/* harmony export */ assign: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.assign), 34017/* harmony export */ before: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.before), 34018/* harmony export */ bind: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.bind), 34019/* harmony export */ bindAll: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.bindAll), 34020/* harmony export */ chain: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.chain), 34021/* harmony export */ chunk: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.chunk), 34022/* harmony export */ clone: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.clone), 34023/* harmony export */ collect: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.collect), 34024/* harmony export */ compact: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.compact), 34025/* harmony export */ compose: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.compose), 34026/* harmony export */ constant: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.constant), 34027/* harmony export */ contains: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.contains), 34028/* harmony export */ countBy: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.countBy), 34029/* harmony export */ create: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.create), 34030/* harmony export */ debounce: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.debounce), 34031/* harmony export */ "default": () => (/* reexport safe */ _index_default_js__WEBPACK_IMPORTED_MODULE_0__["default"]), 34032/* harmony export */ defaults: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.defaults), 34033/* harmony export */ defer: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.defer), 34034/* harmony export */ delay: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.delay), 34035/* harmony export */ detect: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.detect), 34036/* harmony export */ difference: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.difference), 34037/* harmony export */ drop: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.drop), 34038/* harmony export */ each: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.each), 34039/* harmony export */ escape: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.escape), 34040/* harmony export */ every: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.every), 34041/* harmony export */ extend: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.extend), 34042/* harmony export */ extendOwn: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.extendOwn), 34043/* harmony export */ filter: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.filter), 34044/* harmony export */ find: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.find), 34045/* harmony export */ findIndex: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.findIndex), 34046/* harmony export */ findKey: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.findKey), 34047/* harmony export */ findLastIndex: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.findLastIndex), 34048/* harmony export */ findWhere: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.findWhere), 34049/* harmony export */ first: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.first), 34050/* harmony export */ flatten: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.flatten), 34051/* harmony export */ foldl: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.foldl), 34052/* harmony export */ foldr: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.foldr),
34053/* harmony export */ forEach: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.forEach), 34054/* harmony export */ functions: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.functions), 34055/* harmony export */ get: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.get), 34056/* harmony export */ groupBy: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.groupBy), 34057/* harmony export */ has: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.has), 34058/* harmony export */ head: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.head), 34059/* harmony export */ identity: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.identity), 34060/* harmony export */ include: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.include), 34061/* harmony export */ includes: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.includes), 34062/* harmony export */ indexBy: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.indexBy), 34063/* harmony export */ indexOf: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.indexOf), 34064/* harmony export */ initial: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.initial), 34065/* harmony export */ inject: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.inject), 34066/* harmony export */ intersection: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.intersection), 34067/* harmony export */ invert: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.invert), 34068/* harmony export */ invoke: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.invoke), 34069/* harmony export */ isArguments: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isArguments), 34070/* harmony export */ isArray: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isArray), 34071/* harmony export */ isArrayBuffer: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isArrayBuffer), 34072/* harmony export */ isBoolean: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isBoolean), 34073/* harmony export */ isDataView: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isDataView), 34074/* harmony export */ isDate: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isDate), 34075/* harmony export */ isElement: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isElement), 34076/* harmony export */ isEmpty: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isEmpty), 34077/* harmony export */ isEqual: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isEqual), 34078/* harmony export */ isError: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isError), 34079/* harmony export */ isFinite: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isFinite), 34080/* harmony export */ isFunction: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction), 34081/* harmony export */ isMap: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isMap), 34082/* harmony export */ isMatch: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isMatch), 34083/* harmony export */ isNaN: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isNaN), 34084/* harmony export */ isNull: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isNull), 34085/* harmony export */ isNumber: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isNumber), 34086/* harmony export */ isObject: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isObject), 34087/* harmony export */ isRegExp: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isRegExp), 34088/* harmony export */ isSet: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isSet), 34089/* harmony export */ isString: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isString), 34090/* harmony export */ isSymbol: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isSymbol), 34091/* harmony export */ isTypedArray: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isTypedArray), 34092/* harmony export */ isUndefined: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isUndefined), 34093/* harmony export */ isWeakMap: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isWeakMap), 34094/* harmony export */ isWeakSet: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.isWeakSet), 34095/* harmony export */ iteratee: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.iteratee), 34096/* harmony export */ keys: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.keys), 34097/* harmony export */ last: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.last),
34098/* harmony export */ lastIndexOf: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.lastIndexOf), 34099/* harmony export */ map: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.map), 34100/* harmony export */ mapObject: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.mapObject), 34101/* harmony export */ matcher: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.matcher), 34102/* harmony export */ matches: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.matches), 34103/* harmony export */ max: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.max), 34104/* harmony export */ memoize: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.memoize), 34105/* harmony export */ methods: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.methods), 34106/* harmony export */ min: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.min), 34107/* harmony export */ mixin: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.mixin), 34108/* harmony export */ negate: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.negate), 34109/* harmony export */ noop: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.noop), 34110/* harmony export */ now: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.now), 34111/* harmony export */ object: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.object), 34112/* harmony export */ omit: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.omit), 34113/* harmony export */ once: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.once), 34114/* harmony export */ pairs: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.pairs), 34115/* harmony export */ partial: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.partial), 34116/* harmony export */ partition: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.partition), 34117/* harmony export */ pick: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.pick), 34118/* harmony export */ pluck: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.pluck), 34119/* harmony export */ property: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.property), 34120/* harmony export */ propertyOf: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.propertyOf), 34121/* harmony export */ random: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.random), 34122/* harmony export */ range: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.range), 34123/* harmony export */ reduce: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.reduce), 34124/* harmony export */ reduceRight: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.reduceRight), 34125/* harmony export */ reject: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.reject), 34126/* harmony export */ rest: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.rest), 34127/* harmony export */ restArguments: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.restArguments), 34128/* harmony export */ result: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.result), 34129/* harmony export */ sample: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.sample), 34130/* harmony export */ select: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.select), 34131/* harmony export */ shuffle: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.shuffle), 34132/* harmony export */ size: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.size), 34133/* harmony export */ some: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.some), 34134/* harmony export */ sortBy: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.sortBy), 34135/* harmony export */ sortedIndex: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.sortedIndex), 34136/* harmony export */ tail: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.tail), 34137/* harmony export */ take: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.take), 34138/* harmony export */ tap: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.tap), 34139/* harmony export */ template: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.template), 34140/* harmony export */ templateSettings: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.templateSettings), 34141/* harmony export */ throttle: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.throttle),
34142/* harmony export */ times: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.times), 34143/* harmony export */ toArray: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.toArray), 34144/* harmony export */ toPath: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.toPath), 34145/* harmony export */ transpose: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.transpose), 34146/* harmony export */ unescape: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.unescape), 34147/* harmony export */ union: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.union), 34148/* harmony export */ uniq: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.uniq), 34149/* harmony export */ unique: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.unique), 34150/* harmony export */ uniqueId: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.uniqueId), 34151/* harmony export */ unzip: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.unzip), 34152/* harmony export */ values: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.values), 34153/* harmony export */ where: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.where), 34154/* harmony export */ without: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.without), 34155/* harmony export */ wrap: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.wrap), 34156/* harmony export */ zip: () => (/* reexport safe */ _index_js__WEBPACK_IMPORTED_MODULE_1__.zip) 34157/* harmony export */ }); 34158/* harmony import */ var _index_default_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-default.js */ "./node_modules/underscore/modules/index-default.js"); 34159/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "./node_modules/underscore/modules/index.js"); 34160// ESM Exports 34161// =========== 34162// This module is the package entry point for ES module users. In other words, 34163// it is the module they are interfacing with when they import from the whole 34164// package instead of from a submodule, like this: 34165// 34166// ```js 34167// import { map } from 'underscore'; 34168// ``` 34169// 34170// The difference with `./index-default`, which is the package entry point for 34171// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and 34172// default exports are considered to be siblings, so when you have a default 34173// export, its properties are not automatically available as named exports. For 34174// this reason, we re-export the named exports in addition to providing the same 34175// default export as in `./index-default`. 34176 34177 34178 34179 34180/***/ }, 34181 34182/***/ "./node_modules/underscore/modules/index-default.js" 34183/*!**********************************************************!*\ 34184 !*** ./node_modules/underscore/modules/index-default.js ***! 34185 \**********************************************************/ 34186(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34187 34188"use strict"; 34189__webpack_require__.r(__webpack_exports__); 34190/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34191/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34192/* harmony export */ }); 34193/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "./node_modules/underscore/modules/index.js"); 34194// Default Export 34195// ============== 34196// In this module, we mix our bundled exports into the `_` object and export 34197// the result. This is analogous to setting `module.exports = _` in CommonJS. 34198// Hence, this module is also the entry point of our UMD bundle and the package 34199// entry point for CommonJS and AMD users. In other words, this is (the source 34200// of) the module you are interfacing with when you do any of the following: 34201// 34202// ```js 34203// // CommonJS 34204// var _ = require('underscore'); 34205// 34206// // AMD 34207// define(['underscore'], function(_) {...}); 34208// 34209// // UMD in the browser 34210// // _ is available as a global variable 34211// ``` 34212 34213 34214 34215// Add all of the Underscore functions to the wrapper object. 34216var _ = (0,_index_js__WEBPACK_IMPORTED_MODULE_0__.mixin)(_index_js__WEBPACK_IMPORTED_MODULE_0__); 34217// Legacy Node.js API. 34218_._ = _; 34219// Export the Underscore API. 34220/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_); 34221 34222 34223/***/ }, 34224 34225/***/ "./node_modules/underscore/modules/index.js" 34226/*!**************************************************!*\ 34227 !*** ./node_modules/underscore/modules/index.js ***! 34228 \**************************************************/ 34229(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34230 34231"use strict"; 34232__webpack_require__.r(__webpack_exports__); 34233/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34234/* harmony export */ VERSION: () => (/* reexport safe */ _setup_js__WEBPACK_IMPORTED_MODULE_0__.VERSION), 34235/* harmony export */ after: () => (/* reexport safe */ _after_js__WEBPACK_IMPORTED_MODULE_72__["default"]), 34236/* harmony export */ all: () => (/* reexport safe */ _every_js__WEBPACK_IMPORTED_MODULE_89__["default"]), 34237/* harmony export */ allKeys: () => (/* reexport safe */ _allKeys_js__WEBPACK_IMPORTED_MODULE_29__["default"]), 34238/* harmony export */ any: () => (/* reexport safe */ _some_js__WEBPACK_IMPORTED_MODULE_90__["default"]), 34239/* harmony export */ assign: () => (/* reexport safe */ _extendOwn_js__WEBPACK_IMPORTED_MODULE_35__["default"]), 34240/* harmony export */ before: () => (/* reexport safe */ _before_js__WEBPACK_IMPORTED_MODULE_73__["default"]), 34241/* harmony export */ bind: () => (/* reexport safe */ _bind_js__WEBPACK_IMPORTED_MODULE_62__["default"]), 34242/* harmony export */ bindAll: () => (/* reexport safe */ _bindAll_js__WEBPACK_IMPORTED_MODULE_63__["default"]), 34243/* harmony export */ chain: () => (/* reexport safe */ _chain_js__WEBPACK_IMPORTED_MODULE_59__["default"]), 34244/* harmony export */ chunk: () => (/* reexport safe */ _chunk_js__WEBPACK_IMPORTED_MODULE_123__["default"]), 34245/* harmony export */ clone: () => (/* reexport safe */ _clone_js__WEBPACK_IMPORTED_MODULE_38__["default"]), 34246/* harmony export */ collect: () => (/* reexport safe */ _map_js__WEBPACK_IMPORTED_MODULE_84__["default"]), 34247/* harmony export */ compact: () => (/* reexport safe */ _compact_js__WEBPACK_IMPORTED_MODULE_112__["default"]), 34248/* harmony export */ compose: () => (/* reexport safe */ _compose_js__WEBPACK_IMPORTED_MODULE_71__["default"]), 34249/* harmony export */ constant: () => (/* reexport safe */ _constant_js__WEBPACK_IMPORTED_MODULE_44__["default"]), 34250/* harmony export */ contains: () => (/* reexport safe */ _contains_js__WEBPACK_IMPORTED_MODULE_91__["default"]), 34251/* harmony export */ countBy: () => (/* reexport safe */ _countBy_js__WEBPACK_IMPORTED_MODULE_102__["default"]), 34252/* harmony export */ create: () => (/* reexport safe */ _create_js__WEBPACK_IMPORTED_MODULE_37__["default"]), 34253/* harmony export */ debounce: () => (/* reexport safe */ _debounce_js__WEBPACK_IMPORTED_MODULE_68__["default"]), 34254/* harmony export */ "default": () => (/* reexport safe */ _underscore_array_methods_js__WEBPACK_IMPORTED_MODULE_125__["default"]), 34255/* harmony export */ defaults: () => (/* reexport safe */ _defaults_js__WEBPACK_IMPORTED_MODULE_36__["default"]), 34256/* harmony export */ defer: () => (/* reexport safe */ _defer_js__WEBPACK_IMPORTED_MODULE_66__["default"]), 34257/* harmony export */ delay: () => (/* reexport safe */ _delay_js__WEBPACK_IMPORTED_MODULE_65__["default"]), 34258/* harmony export */ detect: () => (/* reexport safe */ _find_js__WEBPACK_IMPORTED_MODULE_81__["default"]), 34259/* harmony export */ difference: () => (/* reexport safe */ _difference_js__WEBPACK_IMPORTED_MODULE_118__["default"]), 34260/* harmony export */ drop: () => (/* reexport safe */ _rest_js__WEBPACK_IMPORTED_MODULE_111__["default"]), 34261/* harmony export */ each: () => (/* reexport safe */ _each_js__WEBPACK_IMPORTED_MODULE_83__["default"]), 34262/* harmony export */ escape: () => (/* reexport safe */ _escape_js__WEBPACK_IMPORTED_MODULE_53__["default"]), 34263/* harmony export */ every: () => (/* reexport safe */ _every_js__WEBPACK_IMPORTED_MODULE_89__["default"]), 34264/* harmony export */ extend: () => (/* reexport safe */ _extend_js__WEBPACK_IMPORTED_MODULE_34__["default"]), 34265/* harmony export */ extendOwn: () => (/* reexport safe */ _extendOwn_js__WEBPACK_IMPORTED_MODULE_35__["default"]), 34266/* harmony export */ filter: () => (/* reexport safe */ _filter_js__WEBPACK_IMPORTED_MODULE_87__["default"]), 34267/* harmony export */ find: () => (/* reexport safe */ _find_js__WEBPACK_IMPORTED_MODULE_81__["default"]), 34268/* harmony export */ findIndex: () => (/* reexport safe */ _findIndex_js__WEBPACK_IMPORTED_MODULE_76__["default"]), 34269/* harmony export */ findKey: () => (/* reexport safe */ _findKey_js__WEBPACK_IMPORTED_MODULE_75__["default"]), 34270/* harmony export */ findLastIndex: () => (/* reexport safe */ _findLastIndex_js__WEBPACK_IMPORTED_MODULE_77__["default"]), 34271/* harmony export */ findWhere: () => (/* reexport safe */ _findWhere_js__WEBPACK_IMPORTED_MODULE_82__["default"]), 34272/* harmony export */ first: () => (/* reexport safe */ _first_js__WEBPACK_IMPORTED_MODULE_108__["default"]), 34273/* harmony export */ flatten: () => (/* reexport safe */ _flatten_js__WEBPACK_IMPORTED_MODULE_113__["default"]), 34274/* harmony export */ foldl: () => (/* reexport safe */ _reduce_js__WEBPACK_IMPORTED_MODULE_85__["default"]), 34275/* harmony export */ foldr: () => (/* reexport safe */ _reduceRight_js__WEBPACK_IMPORTED_MODULE_86__["default"]),
34276/* harmony export */ forEach: () => (/* reexport safe */ _each_js__WEBPACK_IMPORTED_MODULE_83__["default"]), 34277/* harmony export */ functions: () => (/* reexport safe */ _functions_js__WEBPACK_IMPORTED_MODULE_33__["default"]), 34278/* harmony export */ get: () => (/* reexport safe */ _get_js__WEBPACK_IMPORTED_MODULE_40__["default"]), 34279/* harmony export */ groupBy: () => (/* reexport safe */ _groupBy_js__WEBPACK_IMPORTED_MODULE_100__["default"]), 34280/* harmony export */ has: () => (/* reexport safe */ _has_js__WEBPACK_IMPORTED_MODULE_41__["default"]), 34281/* harmony export */ head: () => (/* reexport safe */ _first_js__WEBPACK_IMPORTED_MODULE_108__["default"]), 34282/* harmony export */ identity: () => (/* reexport safe */ _identity_js__WEBPACK_IMPORTED_MODULE_43__["default"]), 34283/* harmony export */ include: () => (/* reexport safe */ _contains_js__WEBPACK_IMPORTED_MODULE_91__["default"]), 34284/* harmony export */ includes: () => (/* reexport safe */ _contains_js__WEBPACK_IMPORTED_MODULE_91__["default"]), 34285/* harmony export */ indexBy: () => (/* reexport safe */ _indexBy_js__WEBPACK_IMPORTED_MODULE_101__["default"]), 34286/* harmony export */ indexOf: () => (/* reexport safe */ _indexOf_js__WEBPACK_IMPORTED_MODULE_79__["default"]), 34287/* harmony export */ initial: () => (/* reexport safe */ _initial_js__WEBPACK_IMPORTED_MODULE_109__["default"]), 34288/* harmony export */ inject: () => (/* reexport safe */ _reduce_js__WEBPACK_IMPORTED_MODULE_85__["default"]), 34289/* harmony export */ intersection: () => (/* reexport safe */ _intersection_js__WEBPACK_IMPORTED_MODULE_117__["default"]), 34290/* harmony export */ invert: () => (/* reexport safe */ _invert_js__WEBPACK_IMPORTED_MODULE_32__["default"]), 34291/* harmony export */ invoke: () => (/* reexport safe */ _invoke_js__WEBPACK_IMPORTED_MODULE_92__["default"]), 34292/* harmony export */ isArguments: () => (/* reexport safe */ _isArguments_js__WEBPACK_IMPORTED_MODULE_17__["default"]), 34293/* harmony export */ isArray: () => (/* reexport safe */ _isArray_js__WEBPACK_IMPORTED_MODULE_15__["default"]), 34294/* harmony export */ isArrayBuffer: () => (/* reexport safe */ _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_13__["default"]), 34295/* harmony export */ isBoolean: () => (/* reexport safe */ _isBoolean_js__WEBPACK_IMPORTED_MODULE_5__["default"]), 34296/* harmony export */ isDataView: () => (/* reexport safe */ _isDataView_js__WEBPACK_IMPORTED_MODULE_14__["default"]), 34297/* harmony export */ isDate: () => (/* reexport safe */ _isDate_js__WEBPACK_IMPORTED_MODULE_9__["default"]), 34298/* harmony export */ isElement: () => (/* reexport safe */ _isElement_js__WEBPACK_IMPORTED_MODULE_6__["default"]), 34299/* harmony export */ isEmpty: () => (/* reexport safe */ _isEmpty_js__WEBPACK_IMPORTED_MODULE_21__["default"]), 34300/* harmony export */ isEqual: () => (/* reexport safe */ _isEqual_js__WEBPACK_IMPORTED_MODULE_23__["default"]), 34301/* harmony export */ isError: () => (/* reexport safe */ _isError_js__WEBPACK_IMPORTED_MODULE_11__["default"]), 34302/* harmony export */ isFinite: () => (/* reexport safe */ _isFinite_js__WEBPACK_IMPORTED_MODULE_18__["default"]), 34303/* harmony export */ isFunction: () => (/* reexport safe */ _isFunction_js__WEBPACK_IMPORTED_MODULE_16__["default"]), 34304/* harmony export */ isMap: () => (/* reexport safe */ _isMap_js__WEBPACK_IMPORTED_MODULE_24__["default"]), 34305/* harmony export */ isMatch: () => (/* reexport safe */ _isMatch_js__WEBPACK_IMPORTED_MODULE_22__["default"]), 34306/* harmony export */ isNaN: () => (/* reexport safe */ _isNaN_js__WEBPACK_IMPORTED_MODULE_19__["default"]), 34307/* harmony export */ isNull: () => (/* reexport safe */ _isNull_js__WEBPACK_IMPORTED_MODULE_3__["default"]), 34308/* harmony export */ isNumber: () => (/* reexport safe */ _isNumber_js__WEBPACK_IMPORTED_MODULE_8__["default"]), 34309/* harmony export */ isObject: () => (/* reexport safe */ _isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"]), 34310/* harmony export */ isRegExp: () => (/* reexport safe */ _isRegExp_js__WEBPACK_IMPORTED_MODULE_10__["default"]), 34311/* harmony export */ isSet: () => (/* reexport safe */ _isSet_js__WEBPACK_IMPORTED_MODULE_26__["default"]), 34312/* harmony export */ isString: () => (/* reexport safe */ _isString_js__WEBPACK_IMPORTED_MODULE_7__["default"]), 34313/* harmony export */ isSymbol: () => (/* reexport safe */ _isSymbol_js__WEBPACK_IMPORTED_MODULE_12__["default"]), 34314/* harmony export */ isTypedArray: () => (/* reexport safe */ _isTypedArray_js__WEBPACK_IMPORTED_MODULE_20__["default"]), 34315/* harmony export */ isUndefined: () => (/* reexport safe */ _isUndefined_js__WEBPACK_IMPORTED_MODULE_4__["default"]), 34316/* harmony export */ isWeakMap: () => (/* reexport safe */ _isWeakMap_js__WEBPACK_IMPORTED_MODULE_25__["default"]), 34317/* harmony export */ isWeakSet: () => (/* reexport safe */ _isWeakSet_js__WEBPACK_IMPORTED_MODULE_27__["default"]), 34318/* harmony export */ iteratee: () => (/* reexport safe */ _iteratee_js__WEBPACK_IMPORTED_MODULE_60__["default"]), 34319/* harmony export */ keys: () => (/* reexport safe */ _keys_js__WEBPACK_IMPORTED_MODULE_28__["default"]), 34320/* harmony export */ last: () => (/* reexport safe */ _last_js__WEBPACK_IMPORTED_MODULE_110__["default"]), 34321/* harmony export */ lastIndexOf: () => (/* reexport safe */ _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_80__["default"]), 34322/* harmony export */ map: () => (/* reexport safe */ _map_js__WEBPACK_IMPORTED_MODULE_84__["default"]), 34323/* harmony export */ mapObject: () => (/* reexport safe */ _mapObject_js__WEBPACK_IMPORTED_MODULE_42__["default"]), 34324/* harmony export */ matcher: () => (/* reexport safe */ _matcher_js__WEBPACK_IMPORTED_MODULE_49__["default"]), 34325/* harmony export */ matches: () => (/* reexport safe */ _matcher_js__WEBPACK_IMPORTED_MODULE_49__["default"]), 34326/* harmony export */ max: () => (/* reexport safe */ _max_js__WEBPACK_IMPORTED_MODULE_95__["default"]), 34327/* harmony export */ memoize: () => (/* reexport safe */ _memoize_js__WEBPACK_IMPORTED_MODULE_64__["default"]), 34328/* harmony export */ methods: () => (/* reexport safe */ _functions_js__WEBPACK_IMPORTED_MODULE_33__["default"]), 34329/* harmony export */ min: () => (/* reexport safe */ _min_js__WEBPACK_IMPORTED_MODULE_96__["default"]), 34330/* harmony export */ mixin: () => (/* reexport safe */ _mixin_js__WEBPACK_IMPORTED_MODULE_124__["default"]), 34331/* harmony export */ negate: () => (/* reexport safe */ _negate_js__WEBPACK_IMPORTED_MODULE_70__["default"]), 34332/* harmony export */ noop: () => (/* reexport safe */ _noop_js__WEBPACK_IMPORTED_MODULE_45__["default"]), 34333/* harmony export */ now: () => (/* reexport safe */ _now_js__WEBPACK_IMPORTED_MODULE_52__["default"]), 34334/* harmony export */ object: () => (/* reexport safe */ _object_js__WEBPACK_IMPORTED_MODULE_121__["default"]), 34335/* harmony export */ omit: () => (/* reexport safe */ _omit_js__WEBPACK_IMPORTED_MODULE_107__["default"]), 34336/* harmony export */ once: () => (/* reexport safe */ _once_js__WEBPACK_IMPORTED_MODULE_74__["default"]), 34337/* harmony export */ pairs: () => (/* reexport safe */ _pairs_js__WEBPACK_IMPORTED_MODULE_31__["default"]), 34338/* harmony export */ partial: () => (/* reexport safe */ _partial_js__WEBPACK_IMPORTED_MODULE_61__["default"]), 34339/* harmony export */ partition: () => (/* reexport safe */ _partition_js__WEBPACK_IMPORTED_MODULE_103__["default"]), 34340/* harmony export */ pick: () => (/* reexport safe */ _pick_js__WEBPACK_IMPORTED_MODULE_106__["default"]), 34341/* harmony export */ pluck: () => (/* reexport safe */ _pluck_js__WEBPACK_IMPORTED_MODULE_93__["default"]), 34342/* harmony export */ property: () => (/* reexport safe */ _property_js__WEBPACK_IMPORTED_MODULE_47__["default"]), 34343/* harmony export */ propertyOf: () => (/* reexport safe */ _propertyOf_js__WEBPACK_IMPORTED_MODULE_48__["default"]), 34344/* harmony export */ random: () => (/* reexport safe */ _random_js__WEBPACK_IMPORTED_MODULE_51__["default"]), 34345/* harmony export */ range: () => (/* reexport safe */ _range_js__WEBPACK_IMPORTED_MODULE_122__["default"]), 34346/* harmony export */ reduce: () => (/* reexport safe */ _reduce_js__WEBPACK_IMPORTED_MODULE_85__["default"]), 34347/* harmony export */ reduceRight: () => (/* reexport safe */ _reduceRight_js__WEBPACK_IMPORTED_MODULE_86__["default"]), 34348/* harmony export */ reject: () => (/* reexport safe */ _reject_js__WEBPACK_IMPORTED_MODULE_88__["default"]), 34349/* harmony export */ rest: () => (/* reexport safe */ _rest_js__WEBPACK_IMPORTED_MODULE_111__["default"]), 34350/* harmony export */ restArguments: () => (/* reexport safe */ _restArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"]), 34351/* harmony export */ result: () => (/* reexport safe */ _result_js__WEBPACK_IMPORTED_MODULE_57__["default"]), 34352/* harmony export */ sample: () => (/* reexport safe */ _sample_js__WEBPACK_IMPORTED_MODULE_98__["default"]), 34353/* harmony export */ select: () => (/* reexport safe */ _filter_js__WEBPACK_IMPORTED_MODULE_87__["default"]), 34354/* harmony export */ shuffle: () => (/* reexport safe */ _shuffle_js__WEBPACK_IMPORTED_MODULE_97__["default"]), 34355/* harmony export */ size: () => (/* reexport safe */ _size_js__WEBPACK_IMPORTED_MODULE_105__["default"]), 34356/* harmony export */ some: () => (/* reexport safe */ _some_js__WEBPACK_IMPORTED_MODULE_90__["default"]), 34357/* harmony export */ sortBy: () => (/* reexport safe */ _sortBy_js__WEBPACK_IMPORTED_MODULE_99__["default"]), 34358/* harmony export */ sortedIndex: () => (/* reexport safe */ _sortedIndex_js__WEBPACK_IMPORTED_MODULE_78__["default"]), 34359/* harmony export */ tail: () => (/* reexport safe */ _rest_js__WEBPACK_IMPORTED_MODULE_111__["default"]), 34360/* harmony export */ take: () => (/* reexport safe */ _first_js__WEBPACK_IMPORTED_MODULE_108__["default"]), 34361/* harmony export */ tap: () => (/* reexport safe */ _tap_js__WEBPACK_IMPORTED_MODULE_39__["default"]), 34362/* harmony export */ template: () => (/* reexport safe */ _template_js__WEBPACK_IMPORTED_MODULE_56__["default"]), 34363/* harmony export */ templateSettings: () => (/* reexport safe */ _templateSettings_js__WEBPACK_IMPORTED_MODULE_55__["default"]), 34364/* harmony export */ throttle: () => (/* reexport safe */ _throttle_js__WEBPACK_IMPORTED_MODULE_67__["default"]), 34365/* harmony export */ times: () => (/* reexport safe */ _times_js__WEBPACK_IMPORTED_MODULE_50__["default"]), 34366/* harmony export */ toArray: () => (/* reexport safe */ _toArray_js__WEBPACK_IMPORTED_MODULE_104__["default"]), 34367/* harmony export */ toPath: () => (/* reexport safe */ _toPath_js__WEBPACK_IMPORTED_MODULE_46__["default"]), 34368/* harmony export */ transpose: () => (/* reexport safe */ _unzip_js__WEBPACK_IMPORTED_MODULE_119__["default"]), 34369/* harmony export */ unescape: () => (/* reexport safe */ _unescape_js__WEBPACK_IMPORTED_MODULE_54__["default"]), 34370/* harmony export */ union: () => (/* reexport safe */ _union_js__WEBPACK_IMPORTED_MODULE_116__["default"]), 34371/* harmony export */ uniq: () => (/* reexport safe */ _uniq_js__WEBPACK_IMPORTED_MODULE_115__["default"]), 34372/* harmony export */ unique: () => (/* reexport safe */ _uniq_js__WEBPACK_IMPORTED_MODULE_115__["default"]), 34373/* harmony export */ uniqueId: () => (/* reexport safe */ _uniqueId_js__WEBPACK_IMPORTED_MODULE_58__["default"]), 34374/* harmony export */ unzip: () => (/* reexport safe */ _unzip_js__WEBPACK_IMPORTED_MODULE_119__["default"]), 34375/* harmony export */ values: () => (/* reexport safe */ _values_js__WEBPACK_IMPORTED_MODULE_30__["default"]), 34376/* harmony export */ where: () => (/* reexport safe */ _where_js__WEBPACK_IMPORTED_MODULE_94__["default"]), 34377/* harmony export */ without: () => (/* reexport safe */ _without_js__WEBPACK_IMPORTED_MODULE_114__["default"]), 34378/* harmony export */ wrap: () => (/* reexport safe */ _wrap_js__WEBPACK_IMPORTED_MODULE_69__["default"]), 34379/* harmony export */ zip: () => (/* reexport safe */ _zip_js__WEBPACK_IMPORTED_MODULE_120__["default"]) 34380/* harmony export */ }); 34381/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 34382/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 34383/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 34384/* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/underscore/modules/isNull.js"); 34385/* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/underscore/modules/isUndefined.js"); 34386/* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/underscore/modules/isBoolean.js"); 34387/* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/underscore/modules/isElement.js"); 34388/* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isString.js */ "./node_modules/underscore/modules/isString.js"); 34389/* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/underscore/modules/isNumber.js"); 34390/* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/underscore/modules/isDate.js"); 34391/* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/underscore/modules/isRegExp.js"); 34392/* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isError.js */ "./node_modules/underscore/modules/isError.js"); 34393/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/underscore/modules/isSymbol.js"); 34394/* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/underscore/modules/isArrayBuffer.js"); 34395/* harmony import */ var _isDataView_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isDataView.js */ "./node_modules/underscore/modules/isDataView.js"); 34396/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 34397/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 34398/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/underscore/modules/isArguments.js"); 34399/* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/underscore/modules/isFinite.js"); 34400/* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/underscore/modules/isNaN.js"); 34401/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/underscore/modules/isTypedArray.js"); 34402/* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/underscore/modules/isEmpty.js"); 34403/* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/underscore/modules/isMatch.js"); 34404/* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/underscore/modules/isEqual.js"); 34405/* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/underscore/modules/isMap.js"); 34406/* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/underscore/modules/isWeakMap.js"); 34407/* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/underscore/modules/isSet.js"); 34408/* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/underscore/modules/isWeakSet.js"); 34409/* harmony import
34409*/ var _keys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 34410/* harmony import */ var _allKeys_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./allKeys.js */ "./node_modules/underscore/modules/allKeys.js"); 34411/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 34412/* harmony import */ var _pairs_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pairs.js */ "./node_modules/underscore/modules/pairs.js"); 34413/* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./invert.js */ "./node_modules/underscore/modules/invert.js"); 34414/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./functions.js */ "./node_modules/underscore/modules/functions.js"); 34415/* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./extend.js */ "./node_modules/underscore/modules/extend.js"); 34416/* harmony import */ var _extendOwn_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./extendOwn.js */ "./node_modules/underscore/modules/extendOwn.js"); 34417/* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/underscore/modules/defaults.js"); 34418/* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./create.js */ "./node_modules/underscore/modules/create.js"); 34419/* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./clone.js */ "./node_modules/underscore/modules/clone.js"); 34420/* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./tap.js */ "./node_modules/underscore/modules/tap.js"); 34421/* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./get.js */ "./node_modules/underscore/modules/get.js"); 34422/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./has.js */ "./node_modules/underscore/modules/has.js"); 34423/* harmony import */ var _mapObject_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./mapObject.js */ "./node_modules/underscore/modules/mapObject.js"); 34424/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./identity.js */ "./node_modules/underscore/modules/identity.js"); 34425/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./constant.js */ "./node_modules/underscore/modules/constant.js"); 34426/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./noop.js */ "./node_modules/underscore/modules/noop.js"); 34427/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/underscore/modules/toPath.js"); 34428/* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./property.js */ "./node_modules/underscore/modules/property.js"); 34429/* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/underscore/modules/propertyOf.js"); 34430/* harmony import */ var _matcher_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./matcher.js */ "./node_modules/underscore/modules/matcher.js"); 34431/* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./times.js */ "./node_modules/underscore/modules/times.js"); 34432/* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./random.js */ "./node_modules/underscore/modules/random.js"); 34433/* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./now.js */ "./node_modules/underscore/modules/now.js"); 34434/* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./escape.js */ "./node_modules/underscore/modules/escape.js"); 34435/* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/underscore/modules/unescape.js"); 34436/* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/underscore/modules/templateSettings.js"); 34437/* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./template.js */ "./node_modules/underscore/modules/template.js"); 34438/* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./result.js */ "./node_modules/underscore/modules/result.js"); 34439/* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/underscore/modules/uniqueId.js"); 34440/* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./chain.js */ "./node_modules/underscore/modules/chain.js"); 34441/* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/underscore/modules/iteratee.js"); 34442/* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./partial.js */ "./node_modules/underscore/modules/partial.js"); 34443/* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./bind.js */ "./node_modules/underscore/modules/bind.js"); 34444/* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/underscore/modules/bindAll.js"); 34445/* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/underscore/modules/memoize.js"); 34446/* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./delay.js */ "./node_modules/underscore/modules/delay.js"); 34447/* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./defer.js */ "./node_modules/underscore/modules/defer.js"); 34448/* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/underscore/modules/throttle.js"); 34449/* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/underscore/modules/debounce.js"); 34450/* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/underscore/modules/wrap.js"); 34451/* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./negate.js */ "./node_modules/underscore/modules/negate.js"); 34452/* harmony import */ var _compose_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./compose.js */ "./node_modules/underscore/modules/compose.js"); 34453/* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./after.js */ "./node_modules/underscore/modules/after.js"); 34454/* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./before.js */ "./node_modules/underscore/modules/before.js"); 34455/* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./once.js */ "./node_modules/underscore/modules/once.js"); 34456/* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/underscore/modules/findKey.js"); 34457/* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/underscore/modules/findIndex.js"); 34458/* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/underscore/modules/findLastIndex.js"); 34459/* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/underscore/modules/sortedIndex.js"); 34460/* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/underscore/modules/indexOf.js"); 34461/* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/underscore/modules/lastIndexOf.js"); 34462/* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./find.js */ "./node_modules/underscore/modules/find.js"); 34463/* harmony import */ var _findWhere_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./findWhere.js */ "./node_modules/underscore/modules/findWhere.js"); 34464/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 34465/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 34466/* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/underscore/modules/reduce.js"); 34467/* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/underscore/modules/reduceRight.js"); 34468/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./filter.js */ "./node_modules/underscore/modules/filter.js"); 34469/* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./reject.js */ "./node_modules/underscore/modules/reject.js"); 34470/* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./every.js */ "./node_modules/underscore/modules/every.js"); 34471/* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./some.js */ "./node_modules/underscore/modules/some.js"); 34472/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./contains.js */ "./node_modules/underscore/modules/contains.js"); 34473/* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/underscore/modules/invoke.js"); 34474/* harmony import */ var _pluck_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./pluck.js */ "./node_modules/underscore/modules/pluck.js"); 34475/* harmony import */ var _where_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./where.js */ "./node_modules/underscore/modules/where.js"); 34476/* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./max.js */ "./node_modules/underscore/modules/max.js"); 34477/* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./min.js */ "./node_modules/underscore/modules/min.js"); 34478/* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/underscore/modules/shuffle.js"); 34479/* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./sample.js */ "./node_modules/underscore/modules/sample.js"); 34480/* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/underscore/modules/sortBy.js"); 34481/* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/underscore/modules/groupBy.js"); 34482/* harmony import */ var _indexBy_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./indexBy.js */ "./node_modules/underscore/modules/indexBy.js"); 34483/* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/underscore/modules/countBy.js"); 34484/* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./partition.js */ "./node_modules/underscore/modules/partition.js"); 34485/* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/underscore/modules/toArray.js"); 34486/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./size.js */ "./node_modules/underscore/modules/size.js"); 34487/* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./pick.js */ "./node_modules/underscore/modules/pick.js"); 34488/* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./omit.js */ "./node_modules/underscore/modules/omit.js"); 34489/* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./first.js */ "./node_modules/underscore/modules/first.js"); 34490/* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./initial.js */ "./node_modules/underscore/modules/initial.js"); 34491/* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./last.js */ "./node_modules/underscore/modules/last.js"); 34492/* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./rest.
34492js */ "./node_modules/underscore/modules/rest.js"); 34493/* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./compact.js */ "./node_modules/underscore/modules/compact.js"); 34494/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/underscore/modules/flatten.js"); 34495/* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./without.js */ "./node_modules/underscore/modules/without.js"); 34496/* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/underscore/modules/uniq.js"); 34497/* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./union.js */ "./node_modules/underscore/modules/union.js"); 34498/* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/underscore/modules/intersection.js"); 34499/* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./difference.js */ "./node_modules/underscore/modules/difference.js"); 34500/* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/underscore/modules/unzip.js"); 34501/* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./zip.js */ "./node_modules/underscore/modules/zip.js"); 34502/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./object.js */ "./node_modules/underscore/modules/object.js"); 34503/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./range.js */ "./node_modules/underscore/modules/range.js"); 34504/* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/underscore/modules/chunk.js"); 34505/* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/underscore/modules/mixin.js"); 34506/* harmony import */ var _underscore_array_methods_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./underscore-array-methods.js */ "./node_modules/underscore/modules/underscore-array-methods.js"); 34507// Named Exports 34508// ============= 34509 34510// Underscore.js 1.13.8 34511// https://underscorejs.org 34512// (c) 2009-2026 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors 34513// Underscore may be freely distributed under the MIT license. 34514 34515// Baseline setup. 34516 34517 34518 34519// Object Functions 34520// ---------------- 34521// Our most fundamental functions operate on any JavaScript object. 34522// Most functions in Underscore depend on at least one function in this section. 34523 34524// A group of functions that check the types of core JavaScript values. 34525// These are often informally referred to as the "isType" functions. 34526 34527 34528 34529 34530 34531 34532 34533 34534 34535 34536 34537 34538 34539 34540 34541 34542 34543 34544 34545 34546 34547 34548 34549 34550 34551 34552 34553// Functions that treat an object as a dictionary of key-value pairs. 34554 34555 34556 34557 34558 34559 34560 34561 34562 34563 34564 34565 34566 34567 34568 34569 34570// Utility Functions 34571// ----------------- 34572// A bit of a grab bag: Predicate-generating functions for use with filters and 34573// loops, string escaping and templating, create random numbers and unique ids, 34574// and functions that facilitate Underscore's chaining and iteration conventions. 34575 34576 34577 34578 34579 34580 34581 34582 34583 34584 34585 34586 34587 34588 34589 34590 34591 34592 34593 34594// Function (ahem) Functions 34595// ------------------------- 34596// These functions take a function as an argument and return a new function 34597// as the result. Also known as higher-order functions. 34598 34599 34600 34601 34602 34603 34604 34605 34606 34607 34608 34609 34610 34611 34612 34613// Finders 34614// ------- 34615// Functions that extract (the position of) a single element from an object 34616// or array based on some criterion. 34617 34618 34619 34620 34621 34622 34623 34624 34625 34626// Collection Functions 34627// -------------------- 34628// Functions that work on any collection of elements: either an array, or 34629// an object of key-value pairs. 34630 34631 34632 34633 34634 34635 34636 34637 34638 34639 34640 34641 34642 34643 34644 34645 34646 34647 34648 34649 34650 34651 34652 34653 34654// `_.pick` and `_.omit` are actually object functions, but we put 34655// them here in order to create a more natural reading order in the 34656// monolithic build as they depend on `_.contains`. 34657 34658 34659 34660// Array Functions 34661// --------------- 34662// Functions that operate on arrays (and array-likes) only, because they’re 34663// expressed in terms of operations on an ordered list of values. 34664 34665 34666 34667 34668 34669 34670 34671 34672 34673 34674 34675 34676 34677 34678 34679 34680 34681// OOP 34682// --- 34683// These modules support the "object-oriented" calling style. See also 34684// `underscore.js` and `index-default.js`. 34685 34686 34687 34688 34689/***/ }, 34690 34691/***/ "./node_modules/underscore/modules/indexBy.js" 34692/*!****************************************************!*\ 34693 !*** ./node_modules/underscore/modules/indexBy.js ***! 34694 \****************************************************/ 34695(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34696 34697"use strict"; 34698__webpack_require__.r(__webpack_exports__); 34699/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34700/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34701/* harmony export */ }); 34702/* harmony import */ var _group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_group.js */ "./node_modules/underscore/modules/_group.js"); 34703 34704 34705// Indexes the object's values by a criterion, similar to `_.groupBy`, but for 34706// when you know that your index values will be unique. 34707/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_group_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) { 34708 result[key] = value; 34709})); 34710 34711 34712/***/ }, 34713 34714/***/ "./node_modules/underscore/modules/indexOf.js" 34715/*!****************************************************!*\ 34716 !*** ./node_modules/underscore/modules/indexOf.js ***! 34717 \****************************************************/ 34718(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34719 34720"use strict"; 34721__webpack_require__.r(__webpack_exports__); 34722/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34723/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34724/* harmony export */ }); 34725/* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/underscore/modules/sortedIndex.js"); 34726/* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/underscore/modules/findIndex.js"); 34727/* harmony import */ var _createIndexFinder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createIndexFinder.js */ "./node_modules/underscore/modules/_createIndexFinder.js"); 34728 34729 34730 34731 34732// Return the position of the first occurrence of an item in an array, 34733// or -1 if the item is not included in the array. 34734// If the array is large and already in sort order, pass `true` 34735// for **isSorted** to use binary search. 34736/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createIndexFinder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(1, _findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"], _sortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])); 34737 34738 34739/***/ }, 34740 34741/***/ "./node_modules/underscore/modules/initial.js" 34742/*!****************************************************!*\ 34743 !*** ./node_modules/underscore/modules/initial.js ***! 34744 \****************************************************/ 34745(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34746 34747"use strict"; 34748__webpack_require__.r(__webpack_exports__); 34749/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34750/* harmony export */ "default": () => (/* binding */ initial) 34751/* harmony export */ }); 34752/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 34753 34754 34755// Returns everything but the last entry of the array. Especially useful on 34756// the arguments object. Passing **n** will return all the values in 34757// the array, excluding the last N. 34758function initial(array, n, guard) { 34759 return _setup_js__WEBPACK_IMPORTED_MODULE_0__.slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); 34760} 34761 34762 34763/***/ }, 34764 34765/***/ "./node_modules/underscore/modules/intersection.js" 34766/*!*********************************************************!*\ 34767 !*** ./node_modules/underscore/modules/intersection.js ***! 34768 \*********************************************************/ 34769(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34770 34771"use strict"; 34772__webpack_require__.r(__webpack_exports__); 34773/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34774/* harmony export */ "default": () => (/* binding */ intersection) 34775/* harmony export */ }); 34776/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 34777/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains.js */ "./node_modules/underscore/modules/contains.js"); 34778 34779 34780 34781// Produce an array that contains every item shared between all the 34782// passed-in arrays. 34783function intersection(array) { 34784 var result = []; 34785 var argsLength = arguments.length; 34786 for (var i = 0, length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array); i < length; i++) { 34787 var item = array[i]; 34788 if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, item)) continue; 34789 var j; 34790 for (j = 1; j < argsLength; j++) { 34791 if (!(0,_contains_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arguments[j], item)) break; 34792 } 34793 if (j === argsLength) result.push(item); 34794 } 34795 return result; 34796} 34797 34798 34799/***/ }, 34800 34801/***/ "./node_modules/underscore/modules/invert.js" 34802/*!***************************************************!*\ 34803 !*** ./node_modules/underscore/modules/invert.js ***! 34804 \***************************************************/ 34805(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34806 34807"use strict"; 34808__webpack_require__.r(__webpack_exports__); 34809/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34810/* harmony export */ "default": () => (/* binding */ invert) 34811/* harmony export */ }); 34812/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 34813 34814 34815// Invert the keys and values of an object. The values must be serializable. 34816function invert(obj) { 34817 var result = {}; 34818 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj); 34819 for (var i = 0, length = _keys.length; i < length; i++) { 34820 result[obj[_keys[i]]] = _keys[i]; 34821 } 34822 return result; 34823} 34824 34825 34826/***/ }, 34827 34828/***/ "./node_modules/underscore/modules/invoke.js" 34829/*!***************************************************!*\ 34830 !*** ./node_modules/underscore/modules/invoke.js ***! 34831 \***************************************************/ 34832(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34833 34834"use strict"; 34835__webpack_require__.r(__webpack_exports__); 34836/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34837/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34838/* harmony export */ }); 34839/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 34840/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 34841/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 34842/* harmony import */ var _deepGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_deepGet.js */ "./node_modules/underscore/modules/_deepGet.js"); 34843/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toPath.js */ "./node_modules/underscore/modules/_toPath.js"); 34844 34845 34846 34847 34848 34849 34850// Invoke a method (with arguments) on every item in a collection. 34851/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(obj, path, args) { 34852 var contextPath, func; 34853 if ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path)) { 34854 func = path; 34855 } else { 34856 path = (0,_toPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(path); 34857 contextPath = path.slice(0, -1); 34858 path = path[path.length - 1]; 34859 } 34860 return (0,_map_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, function(context) { 34861 var method = func;
34862 if (!method) { 34863 if (contextPath && contextPath.length) { 34864 context = (0,_deepGet_js__WEBPACK_IMPORTED_MODULE_3__["default"])(context, contextPath); 34865 } 34866 if (context == null) return void 0; 34867 method = context[path]; 34868 } 34869 return method == null ? method : method.apply(context, args); 34870 }); 34871})); 34872 34873 34874/***/ }, 34875 34876/***/ "./node_modules/underscore/modules/isArguments.js" 34877/*!********************************************************!*\ 34878 !*** ./node_modules/underscore/modules/isArguments.js ***! 34879 \********************************************************/ 34880(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34881 34882"use strict"; 34883__webpack_require__.r(__webpack_exports__); 34884/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34885/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34886/* harmony export */ }); 34887/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 34888/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 34889 34890 34891 34892var isArguments = (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Arguments'); 34893 34894// Define a fallback version of the method in browsers (ahem, IE < 9), where 34895// there isn't any inspectable "Arguments" type. 34896(function() { 34897 if (!isArguments(arguments)) { 34898 isArguments = function(obj) { 34899 return (0,_has_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj, 'callee'); 34900 }; 34901 } 34902}()); 34903 34904/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArguments); 34905 34906 34907/***/ }, 34908 34909/***/ "./node_modules/underscore/modules/isArray.js" 34910/*!****************************************************!*\ 34911 !*** ./node_modules/underscore/modules/isArray.js ***! 34912 \****************************************************/ 34913(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34914 34915"use strict"; 34916__webpack_require__.r(__webpack_exports__); 34917/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34918/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34919/* harmony export */ }); 34920/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 34921/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 34922 34923 34924 34925// Is a given value an array? 34926// Delegates to ECMA5's native `Array.isArray`. 34927/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_setup_js__WEBPACK_IMPORTED_MODULE_0__.nativeIsArray || (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_1__["default"])('Array')); 34928 34929 34930/***/ }, 34931 34932/***/ "./node_modules/underscore/modules/isArrayBuffer.js" 34933/*!**********************************************************!*\ 34934 !*** ./node_modules/underscore/modules/isArrayBuffer.js ***! 34935 \**********************************************************/ 34936(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34937 34938"use strict"; 34939__webpack_require__.r(__webpack_exports__); 34940/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34941/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34942/* harmony export */ }); 34943/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 34944 34945 34946/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('ArrayBuffer')); 34947 34948 34949/***/ }, 34950 34951/***/ "./node_modules/underscore/modules/isBoolean.js" 34952/*!******************************************************!*\ 34953 !*** ./node_modules/underscore/modules/isBoolean.js ***! 34954 \******************************************************/ 34955(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34956 34957"use strict"; 34958__webpack_require__.r(__webpack_exports__); 34959/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34960/* harmony export */ "default": () => (/* binding */ isBoolean) 34961/* harmony export */ }); 34962/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 34963 34964 34965// Is a given value a boolean? 34966function isBoolean(obj) { 34967 return obj === true || obj === false || _setup_js__WEBPACK_IMPORTED_MODULE_0__.toString.call(obj) === '[object Boolean]'; 34968} 34969 34970 34971/***/ }, 34972 34973/***/ "./node_modules/underscore/modules/isDataView.js" 34974/*!*******************************************************!*\ 34975 !*** ./node_modules/underscore/modules/isDataView.js ***! 34976 \*******************************************************/ 34977(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34978 34979"use strict"; 34980__webpack_require__.r(__webpack_exports__); 34981/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34982/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34983/* harmony export */ }); 34984/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 34985/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 34986/* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/underscore/modules/isArrayBuffer.js"); 34987/* harmony import */ var _stringTagBug_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringTagBug.js */ "./node_modules/underscore/modules/_stringTagBug.js"); 34988 34989 34990 34991 34992 34993var isDataView = (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('DataView'); 34994 34995// In IE 10 - Edge 13, we need a different heuristic 34996// to determine whether an object is a `DataView`. 34997// Also, in cases where the native `DataView` is 34998// overridden we can't rely on the tag itself. 34999function alternateIsDataView(obj) { 35000 return obj != null && (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj.getInt8) && (0,_isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj.buffer); 35001} 35002 35003/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_stringTagBug_js__WEBPACK_IMPORTED_MODULE_3__.hasDataViewBug ? alternateIsDataView : isDataView); 35004 35005 35006/***/ }, 35007 35008/***/ "./node_modules/underscore/modules/isDate.js" 35009/*!***************************************************!*\ 35010 !*** ./node_modules/underscore/modules/isDate.js ***! 35011 \***************************************************/ 35012(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35013 35014"use strict"; 35015__webpack_require__.r(__webpack_exports__); 35016/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35017/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35018/* harmony export */ }); 35019/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35020 35021 35022/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Date')); 35023 35024 35025/***/ }, 35026 35027/***/ "./node_modules/underscore/modules/isElement.js" 35028/*!******************************************************!*\ 35029 !*** ./node_modules/underscore/modules/isElement.js ***! 35030 \******************************************************/ 35031(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35032 35033"use strict"; 35034__webpack_require__.r(__webpack_exports__); 35035/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35036/* harmony export */ "default": () => (/* binding */ isElement) 35037/* harmony export */ }); 35038// Is a given value a DOM element? 35039function isElement(obj) { 35040 return !!(obj && obj.nodeType === 1); 35041} 35042 35043 35044/***/ }, 35045 35046/***/ "./node_modules/underscore/modules/isEmpty.js" 35047/*!****************************************************!*\ 35048 !*** ./node_modules/underscore/modules/isEmpty.js ***! 35049 \****************************************************/ 35050(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35051 35052"use strict"; 35053__webpack_require__.r(__webpack_exports__); 35054/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35055/* harmony export */ "default": () => (/* binding */ isEmpty) 35056/* harmony export */ }); 35057/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 35058/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 35059/* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/underscore/modules/isString.js"); 35060/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/underscore/modules/isArguments.js"); 35061/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 35062 35063 35064 35065 35066 35067 35068// Is a given array, string, or object empty? 35069// An "empty" object has no enumerable own-properties. 35070function isEmpty(obj) { 35071 if (obj == null) return true; 35072 // Skip the more expensive `toString`-based type checks if `obj` has no 35073 // `.length`. 35074 var length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj); 35075 if (typeof length == 'number' && ( 35076 (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) || (0,_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj) 35077 )) return length === 0; 35078 return (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_keys_js__WEBPACK_IMPORTED_MODULE_4__["default"])(obj)) === 0; 35079} 35080 35081 35082/***/ }, 35083 35084/***/ "./node_modules/underscore/modules/isEqual.js" 35085/*!****************************************************!*\ 35086 !*** ./node_modules/underscore/modules/isEqual.js ***! 35087 \****************************************************/ 35088(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35089 35090"use strict"; 35091__webpack_require__.r(__webpack_exports__); 35092/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35093/* harmony export */ "default": () => (/* binding */ isEqual) 35094/* harmony export */ }); 35095/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 35096/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35097/* harmony import */ var _getByteLength_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getByteLength.js */ "./node_modules/underscore/modules/_getByteLength.js"); 35098/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/underscore/modules/isTypedArray.js"); 35099/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 35100/* harmony import */ var _stringTagBug_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringTagBug.js */ "./node_modules/underscore/modules/_stringTagBug.js"); 35101/* harmony import */ var _isDataView_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isDataView.js */ "./node_modules/underscore/modules/isDataView.js"); 35102/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 35103/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 35104/* harmony import */ var _toBufferView_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_toBufferView.js */ "./node_modules/underscore/modules/_toBufferView.js"); 35105 35106 35107 35108 35109 35110 35111 35112 35113 35114 35115 35116// We use this string twice, so give it a name for minification. 35117var tagDataView = '[object DataView]'; 35118 35119// Perform a deep comparison to check if two objects are equal. 35120function isEqual(a, b) { 35121 var todo = [{a: a, b: b}]; 35122 // Initializing stacks of traversed objects for cycle detection. 35123 var aStack = [], bStack = []; 35124 35125 while (todo.length) { 35126 var frame = todo.pop(); 35127 if (frame === true) { 35128 // Remove the first object from the stack of traversed objects. 35129 aStack.pop(); 35130 bStack.pop(); 35131 continue; 35132 } 35133 a = frame.a; 35134 b = frame.b; 35135 35136 // Identical objects are equal. `0 === -0`, but they aren't identical. 35137 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). 35138 if (a === b) { 35139 if (a !== 0 || 1 / a === 1 / b) continue; 35140 return false;
35141 } 35142 // `null` or `undefined` only equal to itself (strict comparison). 35143 if (a == null || b == null) return false; 35144 // `NaN`s are equivalent, but non-reflexive. 35145 if (a !== a) { 35146 if (b !== b) continue; 35147 return false; 35148 } 35149 // Exhaust primitive checks 35150 var type = typeof a; 35151 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; 35152 35153// Internal recursive comparison function for `_.isEqual`. 35154 // Unwrap any wrapped objects. 35155 if (a instanceof _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"]) a = a._wrapped; 35156 if (b instanceof _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"]) b = b._wrapped; 35157 // Compare `[[Class]]` names. 35158 var className = _setup_js__WEBPACK_IMPORTED_MODULE_1__.toString.call(a); 35159 if (className !== _setup_js__WEBPACK_IMPORTED_MODULE_1__.toString.call(b)) return false; 35160 // Work around a bug in IE 10 - Edge 13. 35161 if (_stringTagBug_js__WEBPACK_IMPORTED_MODULE_5__.hasDataViewBug && className == '[object Object]' && (0,_isDataView_js__WEBPACK_IMPORTED_MODULE_6__["default"])(a)) { 35162 if (!(0,_isDataView_js__WEBPACK_IMPORTED_MODULE_6__["default"])(b)) return false; 35163 className = tagDataView; 35164 } 35165 switch (className) { 35166 // These types are compared by value. 35167 case '[object RegExp]': 35168 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') 35169 case '[object String]': 35170 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is 35171 // equivalent to `new String("5")`. 35172 if ('' + a === '' + b) continue; 35173 return false; 35174 case '[object Number]': 35175 todo.push({a: +a, b: +b}); 35176 continue; 35177 case '[object Date]': 35178 case '[object Boolean]': 35179 // Coerce dates and booleans to numeric primitive values. Dates are compared by their 35180 // millisecond representations. Note that invalid dates with millisecond representations 35181 // of `NaN` are not equivalent. 35182 if (+a === +b) continue; 35183 return false; 35184 case '[object Symbol]': 35185 if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.SymbolProto.valueOf.call(a) === _setup_js__WEBPACK_IMPORTED_MODULE_1__.SymbolProto.valueOf.call(b)) continue; 35186 return false; 35187 case '[object ArrayBuffer]': 35188 case tagDataView: 35189 // Coerce to typed array so we can fall through. 35190 todo.push({a: (0,_toBufferView_js__WEBPACK_IMPORTED_MODULE_9__["default"])(a), b: (0,_toBufferView_js__WEBPACK_IMPORTED_MODULE_9__["default"])(b)}); 35191 continue; 35192 } 35193 35194 var areArrays = className === '[object Array]'; 35195 if (!areArrays && (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(a)) { 35196 var byteLength = (0,_getByteLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a); 35197 if (byteLength !== (0,_getByteLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(b)) return false; 35198 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) continue; 35199 areArrays = true; 35200 } 35201 if (!areArrays) { 35202 if (typeof a != 'object' || typeof b != 'object') return false; 35203 35204 // Objects with different constructors are not equivalent, but `Object`s or `Array`s 35205 // from different frames are. 35206 var aCtor = a.constructor, bCtor = b.constructor; 35207 if (aCtor !== bCtor && !((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(aCtor) && aCtor instanceof aCtor && 35208 (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(bCtor) && bCtor instanceof bCtor) 35209 && ('constructor' in a && 'constructor' in b)) { 35210 return false; 35211 } 35212 } 35213 35214 // Assume equality for cyclic structures. The algorithm for detecting cyclic 35215 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. 35216 35217 var length = aStack.length; 35218 while (length--) { 35219 // Linear search. Performance is inversely proportional to the number of 35220 // unique nested structures. 35221 if (aStack[length] === a) { 35222 if (bStack[length] === b) break; 35223 return false; 35224 } 35225 } 35226 if (length >= 0) continue; 35227 35228 // Add the first object to the stack of traversed objects. 35229 aStack.push(a); 35230 bStack.push(b); 35231 todo.push(true); 35232 35233 // Recursively compare objects and arrays. 35234 if (areArrays) { 35235 // Compare array lengths to determine if a deep comparison is necessary. 35236 length = a.length; 35237 if (length !== b.length) return false;
35238 // Deep compare the contents, ignoring non-numeric properties. 35239 while (length--) { 35240 todo.push({a: a[length], b: b[length]}); 35241 } 35242 } else { 35243 // Deep compare objects. 35244 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(a), key; 35245 length = _keys.length; 35246 // Ensure that both objects contain the same number of properties before comparing deep equality. 35247 if ((0,_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(b).length !== length) return false; 35248 while (length--) { 35249 // Deep compare each member 35250 key = _keys[length]; 35251 if (!(0,_has_js__WEBPACK_IMPORTED_MODULE_8__["default"])(b, key)) return false; 35252 todo.push({a: a[key], b: b[key]}); 35253 } 35254 } 35255 } 35256 return true; 35257} 35258 35259 35260/***/ }, 35261 35262/***/ "./node_modules/underscore/modules/isError.js" 35263/*!****************************************************!*\ 35264 !*** ./node_modules/underscore/modules/isError.js ***! 35265 \****************************************************/ 35266(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35267 35268"use strict"; 35269__webpack_require__.r(__webpack_exports__); 35270/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35271/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35272/* harmony export */ }); 35273/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35274 35275 35276/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Error')); 35277 35278 35279/***/ }, 35280 35281/***/ "./node_modules/underscore/modules/isFinite.js" 35282/*!*****************************************************!*\ 35283 !*** ./node_modules/underscore/modules/isFinite.js ***! 35284 \*****************************************************/ 35285(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35286 35287"use strict"; 35288__webpack_require__.r(__webpack_exports__); 35289/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35290/* harmony export */ "default": () => (/* binding */ isFinite) 35291/* harmony export */ }); 35292/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35293/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/underscore/modules/isSymbol.js"); 35294 35295 35296 35297// Is a given object a finite number? 35298function isFinite(obj) { 35299 return !(0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && (0,_setup_js__WEBPACK_IMPORTED_MODULE_0__._isFinite)(obj) && !isNaN(parseFloat(obj)); 35300} 35301 35302 35303/***/ }, 35304 35305/***/ "./node_modules/underscore/modules/isFunction.js" 35306/*!*******************************************************!*\ 35307 !*** ./node_modules/underscore/modules/isFunction.js ***! 35308 \*******************************************************/ 35309(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35310 35311"use strict"; 35312__webpack_require__.r(__webpack_exports__); 35313/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35314/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35315/* harmony export */ }); 35316/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35317/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35318 35319 35320 35321var isFunction = (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Function'); 35322 35323// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old 35324// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). 35325var nodelist = _setup_js__WEBPACK_IMPORTED_MODULE_1__.root.document && _setup_js__WEBPACK_IMPORTED_MODULE_1__.root.document.childNodes; 35326if ( true && typeof Int8Array != 'object' && typeof nodelist != 'function') { 35327 isFunction = function(obj) { 35328 return typeof obj == 'function' || false; 35329 }; 35330} 35331 35332/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFunction); 35333 35334 35335/***/ }, 35336 35337/***/ "./node_modules/underscore/modules/isMap.js" 35338/*!**************************************************!*\ 35339 !*** ./node_modules/underscore/modules/isMap.js ***! 35340 \**************************************************/ 35341(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35342 35343"use strict"; 35344__webpack_require__.r(__webpack_exports__); 35345/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35346/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35347/* harmony export */ }); 35348/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35349/* harmony import */ var _stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringTagBug.js */ "./node_modules/underscore/modules/_stringTagBug.js"); 35350/* harmony import */ var _methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_methodFingerprint.js */ "./node_modules/underscore/modules/_methodFingerprint.js"); 35351 35352 35353 35354 35355/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__.isIE11 ? (0,_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.ie11fingerprint)(_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.mapMethods) : (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Map')); 35356 35357 35358/***/ }, 35359 35360/***/ "./node_modules/underscore/modules/isMatch.js" 35361/*!****************************************************!*\ 35362 !*** ./node_modules/underscore/modules/isMatch.js ***! 35363 \****************************************************/ 35364(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35365 35366"use strict"; 35367__webpack_require__.r(__webpack_exports__); 35368/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35369/* harmony export */ "default": () => (/* binding */ isMatch) 35370/* harmony export */ }); 35371/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 35372 35373 35374// Returns whether an object has a given set of `key:value` pairs. 35375function isMatch(object, attrs) { 35376 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(attrs), length = _keys.length; 35377 if (object == null) return !length; 35378 var obj = Object(object); 35379 for (var i = 0; i < length; i++) { 35380 var key = _keys[i]; 35381 if (attrs[key] !== obj[key] || !(key in obj)) return false;
35382 } 35383 return true; 35384} 35385 35386 35387/***/ }, 35388 35389/***/ "./node_modules/underscore/modules/isNaN.js" 35390/*!**************************************************!*\ 35391 !*** ./node_modules/underscore/modules/isNaN.js ***! 35392 \**************************************************/ 35393(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35394 35395"use strict"; 35396__webpack_require__.r(__webpack_exports__); 35397/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35398/* harmony export */ "default": () => (/* binding */ isNaN) 35399/* harmony export */ }); 35400/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35401/* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/underscore/modules/isNumber.js"); 35402 35403 35404 35405// Is the given value `NaN`? 35406function isNaN(obj) { 35407 return (0,_isNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && (0,_setup_js__WEBPACK_IMPORTED_MODULE_0__._isNaN)(obj); 35408} 35409 35410 35411/***/ }, 35412 35413/***/ "./node_modules/underscore/modules/isNull.js" 35414/*!***************************************************!*\ 35415 !*** ./node_modules/underscore/modules/isNull.js ***! 35416 \***************************************************/ 35417(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35418 35419"use strict"; 35420__webpack_require__.r(__webpack_exports__); 35421/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35422/* harmony export */ "default": () => (/* binding */ isNull) 35423/* harmony export */ }); 35424// Is a given value equal to null? 35425function isNull(obj) { 35426 return obj === null; 35427} 35428 35429 35430/***/ }, 35431 35432/***/ "./node_modules/underscore/modules/isNumber.js" 35433/*!*****************************************************!*\ 35434 !*** ./node_modules/underscore/modules/isNumber.js ***! 35435 \*****************************************************/ 35436(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35437 35438"use strict"; 35439__webpack_require__.r(__webpack_exports__); 35440/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35441/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35442/* harmony export */ }); 35443/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35444 35445 35446/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Number')); 35447 35448 35449/***/ }, 35450 35451/***/ "./node_modules/underscore/modules/isObject.js" 35452/*!*****************************************************!*\ 35453 !*** ./node_modules/underscore/modules/isObject.js ***! 35454 \*****************************************************/ 35455(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35456 35457"use strict"; 35458__webpack_require__.r(__webpack_exports__); 35459/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35460/* harmony export */ "default": () => (/* binding */ isObject) 35461/* harmony export */ }); 35462// Is a given variable an object? 35463function isObject(obj) { 35464 var type = typeof obj; 35465 return type === 'function' || (type === 'object' && !!obj); 35466} 35467 35468 35469/***/ }, 35470 35471/***/ "./node_modules/underscore/modules/isRegExp.js" 35472/*!*****************************************************!*\ 35473 !*** ./node_modules/underscore/modules/isRegExp.js ***! 35474 \*****************************************************/ 35475(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35476 35477"use strict"; 35478__webpack_require__.r(__webpack_exports__); 35479/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35480/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35481/* harmony export */ }); 35482/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35483 35484 35485/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('RegExp')); 35486 35487 35488/***/ }, 35489 35490/***/ "./node_modules/underscore/modules/isSet.js" 35491/*!**************************************************!*\ 35492 !*** ./node_modules/underscore/modules/isSet.js ***! 35493 \**************************************************/ 35494(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35495 35496"use strict"; 35497__webpack_require__.r(__webpack_exports__); 35498/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35499/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35500/* harmony export */ }); 35501/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35502/* harmony import */ var _stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringTagBug.js */ "./node_modules/underscore/modules/_stringTagBug.js"); 35503/* harmony import */ var _methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_methodFingerprint.js */ "./node_modules/underscore/modules/_methodFingerprint.js"); 35504 35505 35506 35507 35508/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__.isIE11 ? (0,_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.ie11fingerprint)(_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.setMethods) : (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Set')); 35509 35510 35511/***/ }, 35512 35513/***/ "./node_modules/underscore/modules/isString.js" 35514/*!*****************************************************!*\ 35515 !*** ./node_modules/underscore/modules/isString.js ***! 35516 \*****************************************************/ 35517(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35518 35519"use strict"; 35520__webpack_require__.r(__webpack_exports__); 35521/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35522/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35523/* harmony export */ }); 35524/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35525 35526 35527/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('String')); 35528 35529 35530/***/ }, 35531 35532/***/ "./node_modules/underscore/modules/isSymbol.js" 35533/*!*****************************************************!*\ 35534 !*** ./node_modules/underscore/modules/isSymbol.js ***! 35535 \*****************************************************/ 35536(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35537 35538"use strict"; 35539__webpack_require__.r(__webpack_exports__); 35540/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35541/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35542/* harmony export */ }); 35543/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35544 35545 35546/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('Symbol')); 35547 35548 35549/***/ }, 35550 35551/***/ "./node_modules/underscore/modules/isTypedArray.js" 35552/*!*********************************************************!*\ 35553 !*** ./node_modules/underscore/modules/isTypedArray.js ***! 35554 \*********************************************************/ 35555(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35556 35557"use strict"; 35558__webpack_require__.r(__webpack_exports__); 35559/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35560/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35561/* harmony export */ }); 35562/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35563/* harmony import */ var _isDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isDataView.js */ "./node_modules/underscore/modules/isDataView.js"); 35564/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constant.js */ "./node_modules/underscore/modules/constant.js"); 35565/* harmony import */ var _isBufferLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isBufferLike.js */ "./node_modules/underscore/modules/_isBufferLike.js"); 35566 35567 35568 35569 35570 35571// Is a given value a typed array? 35572var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; 35573function isTypedArray(obj) { 35574 // `ArrayBuffer.isView` is the most future-proof, so use it when available. 35575 // Otherwise, fall back on the above regular expression. 35576 return _setup_js__WEBPACK_IMPORTED_MODULE_0__.nativeIsView ? ((0,_setup_js__WEBPACK_IMPORTED_MODULE_0__.nativeIsView)(obj) && !(0,_isDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj)) : 35577 (0,_isBufferLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj) && typedArrayPattern.test(_setup_js__WEBPACK_IMPORTED_MODULE_0__.toString.call(obj)); 35578} 35579 35580/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_setup_js__WEBPACK_IMPORTED_MODULE_0__.supp
35580ortsArrayBuffer ? isTypedArray : (0,_constant_js__WEBPACK_IMPORTED_MODULE_2__["default"])(false)); 35581 35582 35583/***/ }, 35584 35585/***/ "./node_modules/underscore/modules/isUndefined.js" 35586/*!********************************************************!*\ 35587 !*** ./node_modules/underscore/modules/isUndefined.js ***! 35588 \********************************************************/ 35589(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35590 35591"use strict"; 35592__webpack_require__.r(__webpack_exports__); 35593/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35594/* harmony export */ "default": () => (/* binding */ isUndefined) 35595/* harmony export */ }); 35596// Is a given variable undefined? 35597function isUndefined(obj) { 35598 return obj === void 0; 35599} 35600 35601 35602/***/ }, 35603 35604/***/ "./node_modules/underscore/modules/isWeakMap.js" 35605/*!******************************************************!*\ 35606 !*** ./node_modules/underscore/modules/isWeakMap.js ***! 35607 \******************************************************/ 35608(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35609 35610"use strict"; 35611__webpack_require__.r(__webpack_exports__); 35612/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35613/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35614/* harmony export */ }); 35615/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35616/* harmony import */ var _stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringTagBug.js */ "./node_modules/underscore/modules/_stringTagBug.js"); 35617/* harmony import */ var _methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_methodFingerprint.js */ "./node_modules/underscore/modules/_methodFingerprint.js"); 35618 35619 35620 35621 35622/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_stringTagBug_js__WEBPACK_IMPORTED_MODULE_1__.isIE11 ? (0,_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.ie11fingerprint)(_methodFingerprint_js__WEBPACK_IMPORTED_MODULE_2__.weakMapMethods) : (0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('WeakMap')); 35623 35624 35625/***/ }, 35626 35627/***/ "./node_modules/underscore/modules/isWeakSet.js" 35628/*!******************************************************!*\ 35629 !*** ./node_modules/underscore/modules/isWeakSet.js ***! 35630 \******************************************************/ 35631(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35632 35633"use strict"; 35634__webpack_require__.r(__webpack_exports__); 35635/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35636/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35637/* harmony export */ }); 35638/* harmony import */ var _tagTester_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_tagTester.js */ "./node_modules/underscore/modules/_tagTester.js"); 35639 35640 35641/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_tagTester_js__WEBPACK_IMPORTED_MODULE_0__["default"])('WeakSet')); 35642 35643 35644/***/ }, 35645 35646/***/ "./node_modules/underscore/modules/iteratee.js" 35647/*!*****************************************************!*\ 35648 !*** ./node_modules/underscore/modules/iteratee.js ***! 35649 \*****************************************************/ 35650(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35651 35652"use strict"; 35653__webpack_require__.r(__webpack_exports__); 35654/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35655/* harmony export */ "default": () => (/* binding */ iteratee) 35656/* harmony export */ }); 35657/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 35658/* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/underscore/modules/_baseIteratee.js"); 35659 35660 35661 35662// External wrapper for our callback generator. Users may customize 35663// `_.iteratee` if they want additional predicate/iteratee shorthand styles. 35664// This abstraction hides the internal-only `argCount` argument. 35665function iteratee(value, context) { 35666 return (0,_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, context, Infinity); 35667} 35668_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].iteratee = iteratee; 35669 35670 35671/***/ }, 35672 35673/***/ "./node_modules/underscore/modules/keys.js" 35674/*!*************************************************!*\ 35675 !*** ./node_modules/underscore/modules/keys.js ***! 35676 \*************************************************/ 35677(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35678 35679"use strict"; 35680__webpack_require__.r(__webpack_exports__); 35681/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35682/* harmony export */ "default": () => (/* binding */ keys) 35683/* harmony export */ }); 35684/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/underscore/modules/isObject.js"); 35685/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35686/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 35687/* harmony import */ var _collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_collectNonEnumProps.js */ "./node_modules/underscore/modules/_collectNonEnumProps.js"); 35688 35689 35690 35691 35692 35693// Retrieve the names of an object's own properties. 35694// Delegates to **ECMAScript 5**'s native `Object.keys`. 35695function keys(obj) { 35696 if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return []; 35697 if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys) return (0,_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys)(obj); 35698 var keys = []; 35699 for (var key in obj) if ((0,_has_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, key)) keys.push(key); 35700 // Ahem, IE < 9. 35701 if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj, keys); 35702 return keys; 35703} 35704 35705 35706/***/ }, 35707 35708/***/ "./node_modules/underscore/modules/last.js" 35709/*!*************************************************!*\ 35710 !*** ./node_modules/underscore/modules/last.js ***! 35711 \*************************************************/ 35712(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35713 35714"use strict"; 35715__webpack_require__.r(__webpack_exports__); 35716/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35717/* harmony export */ "default": () => (/* binding */ last) 35718/* harmony export */ }); 35719/* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rest.
35719js */ "./node_modules/underscore/modules/rest.js"); 35720 35721 35722// Get the last element of an array. Passing **n** will return the last N 35723// values in the array. 35724function last(array, n, guard) { 35725 if (array == null || array.length < 1) return n == null || guard ? void 0 : []; 35726 if (n == null || guard) return array[array.length - 1]; 35727 return (0,_rest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Math.max(0, array.length - n)); 35728} 35729 35730 35731/***/ }, 35732 35733/***/ "./node_modules/underscore/modules/lastIndexOf.js" 35734/*!********************************************************!*\ 35735 !*** ./node_modules/underscore/modules/lastIndexOf.js ***! 35736 \********************************************************/ 35737(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35738 35739"use strict"; 35740__webpack_require__.r(__webpack_exports__); 35741/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35742/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 35743/* harmony export */ }); 35744/* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/underscore/modules/findLastIndex.js"); 35745/* harmony import */ var _createIndexFinder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createIndexFinder.js */ "./node_modules/underscore/modules/_createIndexFinder.js"); 35746 35747 35748 35749// Return the position of the last occurrence of an item in an array, 35750// or -1 if the item is not included in the array. 35751/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createIndexFinder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(-1, _findLastIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])); 35752 35753 35754/***/ }, 35755 35756/***/ "./node_modules/underscore/modules/map.js" 35757/*!************************************************!*\ 35758 !*** ./node_modules/underscore/modules/map.js ***! 35759 \************************************************/ 35760(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35761 35762"use strict"; 35763__webpack_require__.r(__webpack_exports__); 35764/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35765/* harmony export */ "default": () => (/* binding */ map) 35766/* harmony export */ }); 35767/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 35768/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 35769/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 35770 35771 35772 35773 35774// Return the results of applying the iteratee to each element. 35775function map(obj, iteratee, context) { 35776 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context); 35777 var _keys = !(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && (0,_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj), 35778 length = (_keys || obj).length, 35779 results = Array(length); 35780 for (var index = 0; index < length; index++) { 35781 var currentKey = _keys ? _keys[index] : index; 35782 results[index] = iteratee(obj[currentKey], currentKey, obj); 35783 } 35784 return results; 35785} 35786 35787 35788/***/ }, 35789 35790/***/ "./node_modules/underscore/modules/mapObject.js" 35791/*!******************************************************!*\ 35792 !*** ./node_modules/underscore/modules/mapObject.js ***! 35793 \******************************************************/ 35794(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35795 35796"use strict"; 35797__webpack_require__.r(__webpack_exports__); 35798/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35799/* harmony export */ "default": () => (/* binding */ mapObject) 35800/* harmony export */ }); 35801/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 35802/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 35803 35804 35805 35806// Returns the results of applying the `iteratee` to each element of `obj`. 35807// In contrast to `_.map` it returns an object. 35808function mapObject(obj, iteratee, context) { 35809 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context); 35810 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj), 35811 length = _keys.length, 35812 results = {}; 35813 for (var index = 0; index < length; index++) { 35814 var currentKey = _keys[index]; 35815 results[currentKey] = iteratee(obj[currentKey], currentKey, obj); 35816 } 35817 return results; 35818} 35819 35820 35821/***/ }, 35822 35823/***/ "./node_modules/underscore/modules/matcher.js" 35824/*!****************************************************!*\ 35825 !*** ./node_modules/underscore/modules/matcher.js ***! 35826 \****************************************************/ 35827(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35828 35829"use strict"; 35830__webpack_require__.r(__webpack_exports__); 35831/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35832/* harmony export */ "default": () => (/* binding */ matcher) 35833/* harmony export */ }); 35834/* harmony import */ var _extendOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extendOwn.js */ "./node_modules/underscore/modules/extendOwn.js"); 35835/* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/underscore/modules/isMatch.js"); 35836 35837 35838 35839// Returns a predicate for checking whether an object has a given set of 35840// `key:value` pairs. 35841function matcher(attrs) { 35842 attrs = (0,_extendOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, attrs); 35843 return function(obj) { 35844 return (0,_isMatch_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj, attrs); 35845 }; 35846} 35847 35848 35849/***/ }, 35850 35851/***/ "./node_modules/underscore/modules/max.js" 35852/*!************************************************!*\ 35853 !*** ./node_modules/underscore/modules/max.js ***! 35854 \************************************************/ 35855(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35856 35857"use strict"; 35858__webpack_require__.r(__webpack_exports__); 35859/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35860/* harmony export */ "default": () => (/* binding */ max) 35861/* harmony export */ }); 35862/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 35863/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 35864/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 35865/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 35866 35867 35868 35869 35870 35871// Return the maximum element (or element-based computation). 35872function max(obj, iteratee, context) { 35873 var result = -Infinity, lastComputed = -Infinity, 35874 value, computed; 35875 if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { 35876 obj = (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) ? obj : (0,_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj); 35877 for (var i = 0, length = obj.length; i < length; i++) { 35878 value = obj[i]; 35879 if (value != null && value > result) { 35880 result = value; 35881 } 35882 } 35883 } else { 35884 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, context); 35885 (0,_each_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj, function(v, index, list) { 35886 computed = iteratee(v, index, list); 35887 if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { 35888 result = v; 35889 lastComputed = computed; 35890 } 35891 }); 35892 } 35893 return result; 35894} 35895 35896 35897/***/ }, 35898 35899/***/ "./node_modules/underscore/modules/memoize.js" 35900/*!****************************************************!*\ 35901 !*** ./node_modules/underscore/modules/memoize.js ***! 35902 \****************************************************/ 35903(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35904 35905"use strict"; 35906__webpack_require__.r(__webpack_exports__); 35907/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35908/* harmony export */ "default": () => (/* binding */ memoize) 35909/* harmony export */ }); 35910/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_has.js */ "./node_modules/underscore/modules/_has.js"); 35911 35912 35913// Memoize an expensive function by storing its results. 35914function memoize(func, hasher) { 35915 var memoize = function(key) { 35916 var cache = memoize.cache;
35917 var address = '' + (hasher ? hasher.apply(this, arguments) : key); 35918 if (!(0,_has_js__WEBPACK_IMPORTED_MODULE_0__["default"])(cache, address)) cache[address] = func.apply(this, arguments); 35919 return cache[address]; 35920 }; 35921 memoize.cache = {}; 35922 return memoize; 35923} 35924 35925 35926/***/ }, 35927 35928/***/ "./node_modules/underscore/modules/min.js" 35929/*!************************************************!*\ 35930 !*** ./node_modules/underscore/modules/min.js ***! 35931 \************************************************/ 35932(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35933 35934"use strict"; 35935__webpack_require__.r(__webpack_exports__); 35936/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35937/* harmony export */ "default": () => (/* binding */ min) 35938/* harmony export */ }); 35939/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 35940/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 35941/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 35942/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 35943 35944 35945 35946 35947 35948// Return the minimum element (or element-based computation). 35949function min(obj, iteratee, context) { 35950 var result = Infinity, lastComputed = Infinity, 35951 value, computed; 35952 if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { 35953 obj = (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) ? obj : (0,_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj); 35954 for (var i = 0, length = obj.length; i < length; i++) { 35955 value = obj[i]; 35956 if (value != null && value < result) { 35957 result = value; 35958 } 35959 } 35960 } else { 35961 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, context); 35962 (0,_each_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj, function(v, index, list) { 35963 computed = iteratee(v, index, list); 35964 if (computed < lastComputed || (computed === Infinity && result === Infinity)) { 35965 result = v; 35966 lastComputed = computed; 35967 } 35968 }); 35969 } 35970 return result; 35971} 35972 35973 35974/***/ }, 35975 35976/***/ "./node_modules/underscore/modules/mixin.js" 35977/*!**************************************************!*\ 35978 !*** ./node_modules/underscore/modules/mixin.js ***! 35979 \**************************************************/ 35980(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 35981 35982"use strict"; 35983__webpack_require__.r(__webpack_exports__); 35984/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35985/* harmony export */ "default": () => (/* binding */ mixin) 35986/* harmony export */ }); 35987/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 35988/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 35989/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./functions.js */ "./node_modules/underscore/modules/functions.js"); 35990/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 35991/* harmony import */ var _chainResult_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_chainResult.js */ "./node_modules/underscore/modules/_chainResult.js"); 35992 35993 35994 35995 35996 35997 35998// Add your own custom functions to the Underscore object. 35999function mixin(obj) { 36000 (0,_each_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_functions_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj), function(name) { 36001 var func = _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"][name] = obj[name]; 36002 _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype[name] = function() { 36003 var args = [this._wrapped]; 36004 _setup_js__WEBPACK_IMPORTED_MODULE_3__.push.apply(args, arguments); 36005 return (0,_chainResult_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this, func.apply(_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"], args)); 36006 }; 36007 }); 36008 return _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"]; 36009} 36010 36011 36012/***/ }, 36013 36014/***/ "./node_modules/underscore/modules/negate.js" 36015/*!***************************************************!*\ 36016 !*** ./node_modules/underscore/modules/negate.js ***! 36017 \***************************************************/ 36018(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36019 36020"use strict"; 36021__webpack_require__.r(__webpack_exports__); 36022/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36023/* harmony export */ "default": () => (/* binding */ negate) 36024/* harmony export */ });
36025// Returns a negated version of the passed-in predicate. 36026function negate(predicate) { 36027 return function() { 36028 return !predicate.apply(this, arguments); 36029 }; 36030} 36031 36032 36033/***/ }, 36034 36035/***/ "./node_modules/underscore/modules/noop.js" 36036/*!*************************************************!*\ 36037 !*** ./node_modules/underscore/modules/noop.js ***! 36038 \*************************************************/ 36039(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36040 36041"use strict"; 36042__webpack_require__.r(__webpack_exports__); 36043/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36044/* harmony export */ "default": () => (/* binding */ noop) 36045/* harmony export */ }); 36046// Predicate-generating function. Often useful outside of Underscore. 36047function noop(){} 36048 36049 36050/***/ }, 36051 36052/***/ "./node_modules/underscore/modules/now.js" 36053/*!************************************************!*\ 36054 !*** ./node_modules/underscore/modules/now.js ***! 36055 \************************************************/ 36056(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36057 36058"use strict"; 36059__webpack_require__.r(__webpack_exports__); 36060/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36061/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36062/* harmony export */ }); 36063// A (possibly faster) way to get the current timestamp as an integer. 36064/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Date.now || function() { 36065 return new Date().getTime(); 36066}); 36067 36068 36069/***/ }, 36070 36071/***/ "./node_modules/underscore/modules/object.js" 36072/*!***************************************************!*\ 36073 !*** ./node_modules/underscore/modules/object.js ***! 36074 \***************************************************/ 36075(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36076 36077"use strict"; 36078__webpack_require__.r(__webpack_exports__); 36079/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36080/* harmony export */ "default": () => (/* binding */ object) 36081/* harmony export */ }); 36082/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 36083 36084 36085// Converts lists into objects. Pass either a single array of `[key, value]` 36086// pairs, or two parallel arrays of the same length -- one of keys, and one of 36087// the corresponding values. Passing by pairs is the reverse of `_.pairs`. 36088function object(list, values) { 36089 var result = {}; 36090 for (var i = 0, length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(list); i < length; i++) { 36091 if (values) { 36092 result[list[i]] = values[i]; 36093 } else { 36094 result[list[i][0]] = list[i][1]; 36095 } 36096 } 36097 return result; 36098} 36099 36100 36101/***/ }, 36102 36103/***/ "./node_modules/underscore/modules/omit.js" 36104/*!*************************************************!*\ 36105 !*** ./node_modules/underscore/modules/omit.js ***! 36106 \*************************************************/ 36107(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36108 36109"use strict"; 36110__webpack_require__.r(__webpack_exports__); 36111/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36112/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36113/* harmony export */ }); 36114/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 36115/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 36116/* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./negate.js */ "./node_modules/underscore/modules/negate.js"); 36117/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 36118/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 36119/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contains.js */ "./node_modules/underscore/modules/contains.js"); 36120/* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pick.js */ "./node_modules/underscore/modules/pick.js"); 36121 36122 36123 36124 36125 36126 36127 36128 36129// Return a copy of the object without the disallowed properties. 36130/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(obj, keys) {
36131 var iteratee = keys[0], context; 36132 if ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee)) { 36133 iteratee = (0,_negate_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee); 36134 if (keys.length > 1) context = keys[1]; 36135 } else { 36136 keys = (0,_map_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_flatten_js__WEBPACK_IMPORTED_MODULE_4__["default"])(keys, false, false), String); 36137 iteratee = function(value, key) { 36138 return !(0,_contains_js__WEBPACK_IMPORTED_MODULE_5__["default"])(keys, key); 36139 }; 36140 } 36141 return (0,_pick_js__WEBPACK_IMPORTED_MODULE_6__["default"])(obj, iteratee, context); 36142})); 36143 36144 36145/***/ }, 36146 36147/***/ "./node_modules/underscore/modules/once.js" 36148/*!*************************************************!*\ 36149 !*** ./node_modules/underscore/modules/once.js ***! 36150 \*************************************************/ 36151(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36152 36153"use strict"; 36154__webpack_require__.r(__webpack_exports__); 36155/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36156/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36157/* harmony export */ }); 36158/* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./partial.js */ "./node_modules/underscore/modules/partial.js"); 36159/* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./before.js */ "./node_modules/underscore/modules/before.js"); 36160 36161 36162 36163// Returns a function that will be executed at most one time, no matter how 36164// often you call it. Useful for lazy initialization. 36165/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_partial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_before_js__WEBPACK_IMPORTED_MODULE_1__["default"], 2)); 36166 36167 36168/***/ }, 36169 36170/***/ "./node_modules/underscore/modules/pairs.js" 36171/*!**************************************************!*\ 36172 !*** ./node_modules/underscore/modules/pairs.js ***! 36173 \**************************************************/ 36174(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36175 36176"use strict"; 36177__webpack_require__.r(__webpack_exports__); 36178/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36179/* harmony export */ "default": () => (/* binding */ pairs) 36180/* harmony export */ }); 36181/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 36182 36183 36184// Convert an object into a list of `[key, value]` pairs. 36185// The opposite of `_.object` with one argument. 36186function pairs(obj) { 36187 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj); 36188 var length = _keys.length; 36189 var pairs = Array(length); 36190 for (var i = 0; i < length; i++) { 36191 pairs[i] = [_keys[i], obj[_keys[i]]]; 36192 } 36193 return pairs; 36194} 36195 36196 36197/***/ }, 36198 36199/***/ "./node_modules/underscore/modules/partial.js" 36200/*!****************************************************!*\ 36201 !*** ./node_modules/underscore/modules/partial.js ***! 36202 \****************************************************/ 36203(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36204 36205"use strict"; 36206__webpack_require__.r(__webpack_exports__); 36207/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36208/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36209/* harmony export */ }); 36210/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 36211/* harmony import */ var _executeBound_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_executeBound.js */ "./node_modules/underscore/modules/_executeBound.js"); 36212/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 36213 36214 36215 36216 36217// Partially apply a function by creating a version that has had some of its 36218// arguments pre-filled, without changing its dynamic `this` context. `_` acts 36219// as a placeholder by default, allowing any combination of arguments to be 36220// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. 36221var partial = (0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, boundArgs) { 36222 var placeholder = partial.placeholder; 36223 var bound = function() { 36224 var position = 0, length = boundArgs.length; 36225 var args = Array(length); 36226 for (var i = 0; i < length; i++) { 36227 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; 36228 } 36229 while (position < arguments.length) args.push(arguments[position++]); 36230 return (0,_executeBound_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bound, this, this, args); 36231 }; 36232 return bound; 36233}); 36234 36235partial.placeholder = _underscore_js__WEBPACK_IMPORTED_MODULE_2__["default"]; 36236/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (partial); 36237 36238 36239/***/ }, 36240 36241/***/ "./node_modules/underscore/modules/partition.js" 36242/*!******************************************************!*\ 36243 !*** ./node_modules/underscore/modules/partition.js ***! 36244 \******************************************************/ 36245(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36246 36247"use strict"; 36248__webpack_require__.r(__webpack_exports__); 36249/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36250/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36251/* harmony export */ }); 36252/* harmony import */ var _group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_group.js */ "./node_modules/underscore/modules/_group.js"); 36253 36254 36255// Split a collection into two arrays: one whose elements all pass the given 36256// truth test, and one whose elements all do not pass the truth test. 36257/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_group_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, pass) { 36258 result[pass ? 0 : 1].push(value); 36259}, true)); 36260 36261 36262/***/ }, 36263 36264/***/ "./node_modules/underscore/modules/pick.js" 36265/*!*************************************************!*\ 36266 !*** ./node_modules/underscore/modules/pick.js ***! 36267 \*************************************************/ 36268(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36269 36270"use strict"; 36271__webpack_require__.r(__webpack_exports__); 36272/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36273/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36274/* harmony export */ }); 36275/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 36276/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 36277/* harmony import */ var _optimizeCb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_optimizeCb.js */ "./node_modules/underscore/modules/_optimizeCb.js"); 36278/* harmony import */ var _allKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./allKeys.js */ "./node_modules/underscore/modules/allKeys.js"); 36279/* harmony import */ var _keyInObj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_keyInObj.js */ "./node_modules/underscore/modules/_keyInObj.js"); 36280/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 36281 36282 36283 36284 36285 36286 36287 36288// Return a copy of the object only containing the allowed properties. 36289/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(obj, keys) { 36290 var result = {}
36290, iteratee = keys[0]; 36291 if (obj == null) return result; 36292 if ((0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee)) { 36293 if (keys.length > 1) iteratee = (0,_optimizeCb_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, keys[1]); 36294 keys = (0,_allKeys_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj); 36295 } else { 36296 iteratee = _keyInObj_js__WEBPACK_IMPORTED_MODULE_4__["default"]; 36297 keys = (0,_flatten_js__WEBPACK_IMPORTED_MODULE_5__["default"])(keys, false, false); 36298 obj = Object(obj); 36299 } 36300 for (var i = 0, length = keys.length; i < length; i++) { 36301 var key = keys[i]; 36302 var value = obj[key]; 36303 if (iteratee(value, key, obj)) result[key] = value; 36304 } 36305 return result; 36306})); 36307 36308 36309/***/ }, 36310 36311/***/ "./node_modules/underscore/modules/pluck.js" 36312/*!**************************************************!*\ 36313 !*** ./node_modules/underscore/modules/pluck.js ***! 36314 \**************************************************/ 36315(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36316 36317"use strict"; 36318__webpack_require__.r(__webpack_exports__); 36319/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36320/* harmony export */ "default": () => (/* binding */ pluck) 36321/* harmony export */ }); 36322/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 36323/* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./property.js */ "./node_modules/underscore/modules/property.js"); 36324 36325 36326 36327// Convenience version of a common use case of `_.map`: fetching a property. 36328function pluck(obj, key) { 36329 return (0,_map_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, (0,_property_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key)); 36330} 36331 36332 36333/***/ }, 36334 36335/***/ "./node_modules/underscore/modules/property.js" 36336/*!*****************************************************!*\ 36337 !*** ./node_modules/underscore/modules/property.js ***! 36338 \*****************************************************/ 36339(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36340 36341"use strict"; 36342__webpack_require__.r(__webpack_exports__); 36343/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36344/* harmony export */ "default": () => (/* binding */ property) 36345/* harmony export */ }); 36346/* harmony import */ var _deepGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deepGet.js */ "./node_modules/underscore/modules/_deepGet.js"); 36347/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toPath.js */ "./node_modules/underscore/modules/_toPath.js"); 36348 36349 36350 36351// Creates a function that, when passed an object, will traverse that object’s 36352// properties down the given `path`, specified as an array of keys or indices. 36353function property(path) { 36354 path = (0,_toPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path); 36355 return function(obj) { 36356 return (0,_deepGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, path); 36357 }; 36358} 36359 36360 36361/***/ }, 36362 36363/***/ "./node_modules/underscore/modules/propertyOf.js" 36364/*!*******************************************************!*\ 36365 !*** ./node_modules/underscore/modules/propertyOf.js ***! 36366 \*******************************************************/ 36367(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36368 36369"use strict"; 36370__webpack_require__.r(__webpack_exports__); 36371/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36372/* harmony export */ "default": () => (/* binding */ propertyOf) 36373/* harmony export */ }); 36374/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./noop.js */ "./node_modules/underscore/modules/noop.js"); 36375/* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get.js */ "./node_modules/underscore/modules/get.js"); 36376 36377 36378 36379// Generates a function for a given object that returns a given property. 36380function propertyOf(obj) { 36381 if (obj == null) return _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"]; 36382 return function(path) { 36383 return (0,_get_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj, path); 36384 }; 36385} 36386 36387 36388/***/ }, 36389 36390/***/ "./node_modules/underscore/modules/random.js" 36391/*!***************************************************!*\ 36392 !*** ./node_modules/underscore/modules/random.js ***! 36393 \***************************************************/ 36394(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36395 36396"use strict"; 36397__webpack_require__.r(__webpack_exports__); 36398/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36399/* harmony export */ "default": () => (/* binding */ random)
36400/* harmony export */ }); 36401// Return a random integer between `min` and `max` (inclusive). 36402function random(min, max) { 36403 if (max == null) { 36404 max = min; 36405 min = 0; 36406 } 36407 return min + Math.floor(Math.random() * (max - min + 1)); 36408} 36409 36410 36411/***/ }, 36412 36413/***/ "./node_modules/underscore/modules/range.js" 36414/*!**************************************************!*\ 36415 !*** ./node_modules/underscore/modules/range.js ***! 36416 \**************************************************/ 36417(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36418 36419"use strict"; 36420__webpack_require__.r(__webpack_exports__); 36421/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36422/* harmony export */ "default": () => (/* binding */ range) 36423/* harmony export */ }); 36424// Generate an integer Array containing an arithmetic progression. A port of 36425// the native Python `range()` function. See 36426// [the Python documentation](https://docs.python.org/library/functions.html#range). 36427function range(start, stop, step) { 36428 if (stop == null) { 36429 stop = start || 0; 36430 start = 0; 36431 } 36432 if (!step) { 36433 step = stop < start ? -1 : 1; 36434 } 36435 36436 var length = Math.max(Math.ceil((stop - start) / step), 0); 36437 var range = Array(length); 36438 36439 for (var idx = 0; idx < length; idx++, start += step) { 36440 range[idx] = start; 36441 } 36442 36443 return range; 36444} 36445 36446 36447/***/ }, 36448 36449/***/ "./node_modules/underscore/modules/reduce.js" 36450/*!***************************************************!*\ 36451 !*** ./node_modules/underscore/modules/reduce.js ***! 36452 \***************************************************/ 36453(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36454 36455"use strict"; 36456__webpack_require__.r(__webpack_exports__); 36457/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36458/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36459/* harmony export */ }); 36460/* harmony import */ var _createReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createReduce.js */ "./node_modules/underscore/modules/_createReduce.js"); 36461 36462 36463// **Reduce** builds up a single result from a list of values, aka `inject`, 36464// or `foldl`. 36465/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1)); 36466 36467 36468/***/ }, 36469 36470/***/ "./node_modules/underscore/modules/reduceRight.js" 36471/*!********************************************************!*\ 36472 !*** ./node_modules/underscore/modules/reduceRight.js ***! 36473 \********************************************************/ 36474(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36475 36476"use strict"; 36477__webpack_require__.r(__webpack_exports__); 36478/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36479/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36480/* harmony export */ }); 36481/* harmony import */ var _createReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createReduce.js */ "./node_modules/underscore/modules/_createReduce.js"); 36482 36483 36484// The right-associative version of reduce, also known as `foldr`. 36485/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(-1)); 36486 36487 36488/***/ }, 36489 36490/***/ "./node_modules/underscore/modules/reject.js" 36491/*!***************************************************!*\ 36492 !*** ./node_modules/underscore/modules/reject.js ***! 36493 \***************************************************/ 36494(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36495 36496"use strict"; 36497__webpack_require__.r(__webpack_exports__); 36498/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36499/* harmony export */ "default": () => (/* binding */ reject) 36500/* harmony export */ }); 36501/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter.js */ "./node_modules/underscore/modules/filter.js"); 36502/* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./negate.js */ "./node_modules/underscore/modules/negate.js"); 36503/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 36504 36505 36506 36507 36508// Return all the elements for which a truth test fails. 36509function reject(obj, predicate, context) { 36510 return (0,_filter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, (0,_negate_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_cb_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate)), context); 36511} 36512 36513 36514/***/ }, 36515 36516/***/ "./node_modules/underscore/modules/rest.js" 36517/*!*************************************************!*\ 36518 !*** ./node_modules/underscore/modules/rest.js ***! 36519 \*************************************************/ 36520(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36521 36522"use strict"; 36523__webpack_require__.r(__webpack_exports__); 36524/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36525/* harmony export */ "default": () => (/* binding */ rest) 36526/* harmony export */ }); 36527/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 36528 36529 36530// Returns everything but the first entry of the `array`. Especially useful on 36531// the `arguments` object. Passing an **n** will return the rest N values in the 36532// `array`. 36533function rest(array, n, guard) { 36534 return _setup_js__WEBPACK_IMPORTED_MODULE_0__.slice.call(array, n == null || guard ? 1 : n); 36535} 36536 36537 36538/***/ }, 36539 36540/***/ "./node_modules/underscore/modules/restArguments.js" 36541/*!**********************************************************!*\ 36542 !*** ./node_modules/underscore/modules/restArguments.js ***! 36543 \**********************************************************/ 36544(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36545 36546"use strict"; 36547__webpack_require__.r(__webpack_exports__); 36548/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36549/* harmony export */ "default": () => (/* binding */ restArguments) 36550/* harmony export */ }); 36551// Some functions take a variable number of arguments, or a few expected 36552// arguments at the beginning and then a variable number of values to operate 36553// on. This helper accumulates all remaining arguments past the function’s 36554// argument length (or an explicit `startIndex`), into an array that becomes 36555// the last argument. Similar to ES6’s "rest parameter". 36556function restArguments(func, startIndex) { 36557 startIndex = startIndex == null ? func.length - 1 : +startIndex; 36558 return function() { 36559 var length = Math.max(arguments.length - startIndex, 0), 36560 rest = Array(length), 36561 index = 0; 36562 for (; index < length; index++) { 36563 rest[index] = arguments[index + startIndex]; 36564 } 36565 switch (startIndex) { 36566 case 0: return func.call(this, rest); 36567 case 1: return func.call(this, arguments[0], rest); 36568 case 2: return func.call(this, arguments[0], arguments[1], rest); 36569 } 36570 var args = Array(startIndex + 1); 36571 for (index = 0; index < startIndex; index++) { 36572 args[index] = arguments[index]; 36573 } 36574 args[startIndex] = rest; 36575 return func.apply(this, args); 36576 }; 36577} 36578 36579 36580/***/ }, 36581 36582/***/ "./node_modules/underscore/modules/result.js" 36583/*!***************************************************!*\ 36584 !*** ./node_modules/underscore/modules/result.js ***! 36585 \***************************************************/ 36586(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36587 36588"use strict"; 36589__webpack_require__.r(__webpack_exports__); 36590/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36591/* harmony export */ "default": () => (/* binding */ result) 36592/* harmony export */ }); 36593/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/underscore/modules/isFunction.js"); 36594/* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toPath.js */ "./node_modules/underscore/modules/_toPath.js"); 36595 36596 36597 36598// Traverses the children of `obj` along `path`. If a child is a function, it 36599// is invoked with its parent as context. Returns the value of the final 36600// child, or `fallback` if any child is undefined. 36601function result(obj, path, fallback) { 36602 path = (0,_toPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path); 36603 var length = path.length; 36604 if (!length) { 36605 return (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fallback) ? fallback.call(obj) : fallback; 36606 } 36607 for (var i = 0; i < length; i++) { 36608 var prop = obj == null ? void 0 : obj[path[i]]; 36609 if (prop === void 0) { 36610 prop = fallback; 36611 i = length; // Ensure we don't continue iterating. 36612 } 36613 obj = (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prop) ? prop.call(obj) : prop; 36614 } 36615 return obj; 36616} 36617 36618 36619/***/ }, 36620 36621/***/ "./node_modules/underscore/modules/sample.js" 36622/*!***************************************************!*\ 36623 !*** ./node_modules/underscore/modules/sample.js ***! 36624 \***************************************************/ 36625(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36626 36627"use strict"; 36628__webpack_require__.r(__webpack_exports__); 36629/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36630/* harmony export */ "default": () => (/* binding */ sample) 36631/* harmony export */ }); 36632/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 36633/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 36634/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 36635/* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./random.js */ "./node_modules/underscore/modules/random.js"); 36636/* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/underscore/modules/toArray.js"); 36637 36638 36639 36640 36641 36642 36643// Sample **n** random values from a collection using the modern version of the 36644// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). 36645// If **n** is not specified, returns a single random element. 36646// The internal `guard` argument allows it to work with `_.map`. 36647function sample(obj, n, guard) { 36648 if (n == null || guard) { 36649 if (!(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) obj = (0,_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj); 36650 return obj[(0,_random_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj.length - 1)]; 36651 } 36652 var sample = (0,_toArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(obj); 36653 var length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(sample); 36654 n = Math.max(Math.min(n, length), 0); 36655 var last = length - 1; 36656 for (var index = 0; index < n; index++) { 36657 var rand = (0,_random_js__WEBPACK_IMPORTED_MODULE_3__["default"])(index, last); 36658 var temp = sample[index]; 36659 sample[index] = sample[rand]; 36660 sample[rand] = temp; 36661 } 36662 return sample.slice(0, n); 36663} 36664 36665 36666/***/ }, 36667 36668/***/ "./node_modules/underscore/modules/shuffle.js" 36669/*!****************************************************!*\ 36670 !*** ./node_modules/underscore/modules/shuffle.js ***! 36671 \****************************************************/ 36672(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36673 36674"use strict"; 36675__webpack_require__.r(__webpack_exports__); 36676/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36677/* harmony export */ "default": () => (/* binding */ shuffle) 36678/* harmony export */ }); 36679/* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sample.js */ "./node_modules/underscore/modules/sample.js"); 36680 36681 36682// Shuffle a collection. 36683function shuffle(obj) { 36684 return (0,_sample_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, Infinity); 36685} 36686 36687 36688/***/ }, 36689 36690/***/ "./node_modules/underscore/modules/size.js" 36691/*!*************************************************!*\ 36692 !*** ./node_modules/underscore/modules/size.js ***! 36693 \*************************************************/ 36694(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36695 36696"use strict"; 36697__webpack_require__.r(__webpack_exports__); 36698/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36699/* harmony export */ "default": () => (/* binding */ size) 36700/* harmony export */ }); 36701/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 36702/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 36703 36704 36705 36706// Return the number of elements in a collection. 36707function size(obj) { 36708 if (obj == null) return 0; 36709 return (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) ? obj.length : (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj).length; 36710} 36711 36712 36713/***/ }, 36714 36715/***/ "./node_modules/underscore/modules/some.js" 36716/*!*************************************************!*\ 36717 !*** ./node_modules/underscore/modules/some.js ***! 36718 \*************************************************/ 36719(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36720 36721"use strict"; 36722__webpack_require__.r(__webpack_exports__); 36723/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36724/* harmony export */ "default": () => (/* binding */ some) 36725/* harmony export */ }); 36726/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 36727/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 36728/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 36729 36730 36731 36732 36733// Determine if at least one element in the object passes a truth test. 36734function some(obj, predicate, context) { 36735 predicate = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, context); 36736 var _keys = !(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && (0,_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj), 36737 length = (_keys || obj).length; 36738 for (var index = 0; index < length; index++) { 36739 var currentKey = _keys ? _keys[index] : index; 36740 if (predicate(obj[currentKey], currentKey, obj)) return true; 36741 } 36742 return false;
36743} 36744 36745 36746/***/ }, 36747 36748/***/ "./node_modules/underscore/modules/sortBy.js" 36749/*!***************************************************!*\ 36750 !*** ./node_modules/underscore/modules/sortBy.js ***! 36751 \***************************************************/ 36752(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36753 36754"use strict"; 36755__webpack_require__.r(__webpack_exports__); 36756/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36757/* harmony export */ "default": () => (/* binding */ sortBy) 36758/* harmony export */ }); 36759/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 36760/* harmony import */ var _pluck_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pluck.js */ "./node_modules/underscore/modules/pluck.js"); 36761/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 36762 36763 36764 36765 36766// Sort the object's values by a criterion produced by an iteratee. 36767function sortBy(obj, iteratee, context) { 36768 var index = 0; 36769 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context); 36770 return (0,_pluck_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_map_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, function(value, key, list) { 36771 return { 36772 value: value, 36773 index: index++, 36774 criteria: iteratee(value, key, list) 36775 }; 36776 }).sort(function(left, right) { 36777 var a = left.criteria; 36778 var b = right.criteria; 36779 if (a !== b) { 36780 if (a > b || a === void 0) return 1; 36781 if (a < b || b === void 0) return -1; 36782 } 36783 return left.index - right.index; 36784 }), 'value'); 36785} 36786 36787 36788/***/ }, 36789 36790/***/ "./node_modules/underscore/modules/sortedIndex.js" 36791/*!********************************************************!*\ 36792 !*** ./node_modules/underscore/modules/sortedIndex.js ***! 36793 \********************************************************/ 36794(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36795 36796"use strict"; 36797__webpack_require__.r(__webpack_exports__); 36798/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36799/* harmony export */ "default": () => (/* binding */ sortedIndex) 36800/* harmony export */ }); 36801/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 36802/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 36803 36804 36805 36806// Use a comparator function to figure out the smallest index at which 36807// an object should be inserted so as to maintain order. Uses binary search. 36808function sortedIndex(array, obj, iteratee, context) { 36809 iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context, 1); 36810 var value = iteratee(obj); 36811 var low = 0, high = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array); 36812 while (low < high) { 36813 var mid = Math.floor((low + high) / 2); 36814 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; 36815 } 36816 return low; 36817} 36818 36819 36820/***/ }, 36821 36822/***/ "./node_modules/underscore/modules/tap.js" 36823/*!************************************************!*\ 36824 !*** ./node_modules/underscore/modules/tap.js ***! 36825 \************************************************/ 36826(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36827 36828"use strict"; 36829__webpack_require__.r(__webpack_exports__); 36830/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36831/* harmony export */ "default": () => (/* binding */ tap) 36832/* harmony export */ }); 36833// Invokes `interceptor` with the `obj` and then returns `obj`. 36834// The primary purpose of this method is to "tap into" a method chain, in 36835// order to perform operations on intermediate results within the chain. 36836function tap(obj, interceptor) { 36837 interceptor(obj); 36838 return obj; 36839} 36840 36841 36842/***/ }, 36843 36844/***/ "./node_modules/underscore/modules/template.js" 36845/*!*****************************************************!*\ 36846 !*** ./node_modules/underscore/modules/template.js ***! 36847 \*****************************************************/ 36848(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36849 36850"use strict"; 36851__webpack_require__.r(__webpack_exports__); 36852/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36853/* harmony export */ "default": () => (/* binding */ template) 36854/* harmony export */ }); 36855/* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/underscore/modules/defaults.js"); 36856/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 36857/* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/underscore/modules/templateSettings.js"); 36858 36859 36860 36861 36862// When customizing `_.templateSettings`, if you don't want to define an 36863// interpolation, evaluation or escaping regex, we need one that is 36864// guaranteed not to match. 36865var noMatch = /(.)^/; 36866 36867// Certain characters need to be escaped so that they can be put into a 36868// string literal. 36869var escapes = { 36870 "'": "'", 36871 '\\': '\\', 36872 '\r': 'r', 36873 '\n': 'n', 36874 '\u2028': 'u2028', 36875 '\u2029': 'u2029' 36876}; 36877 36878var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; 36879 36880function escapeChar(match) { 36881 return '\\' + escapes[match]; 36882} 36883 36884// In order to prevent third-party code injection through 36885// `_.templateSettings.variable`, we test it against the following regular 36886// expression. It is intentionally a bit more liberal than just matching valid 36887// identifiers, but still prevents possible loopholes through defaults or 36888// destructuring assignment. 36889var bareIdentifier = /^\s*(\w|\$)+\s*$/; 36890 36891// JavaScript micro-templating, similar to John Resig's implementation. 36892// Underscore templating handles arbitrary delimiters, preserves whitespace, 36893// and correctly escapes quotes within interpolated code. 36894// NB: `oldSettings` only exists for backwards compatibility. 36895function template(text, settings, oldSettings) { 36896 if (!settings && oldSettings) settings = oldSettings; 36897 settings = (0,_defaults_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, settings, _underscore_js__WEBPACK_IMPORTED_MODULE_1__["default"].templateSettings); 36898 36899 // Combine delimiters into one regular expression via alternation. 36900 var matcher = RegExp([
36901 (settings.escape || noMatch).source, 36902 (settings.interpolate || noMatch).source, 36903 (settings.evaluate || noMatch).source 36904 ].join('|') + '|$', 'g'); 36905 36906 // Compile the template source, escaping string literals appropriately. 36907 var index = 0; 36908 var source = "__p+='"; 36909 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { 36910 source += text.slice(index, offset).replace(escapeRegExp, escapeChar); 36911 index = offset + match.length; 36912 36913 if (escape) { 36914 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; 36915 } else if (interpolate) { 36916 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; 36917 } else if (evaluate) { 36918 source += "';\n" + evaluate + "\n__p+='"; 36919 } 36920 36921 // Adobe VMs need the match returned to produce the correct offset. 36922 return match; 36923 }); 36924 source += "';\n"; 36925 36926 var argument = settings.variable; 36927 if (argument) { 36928 // Insure against third-party code injection. (CVE-2021-23358) 36929 if (!bareIdentifier.test(argument)) throw new Error( 36930 'variable is not a bare identifier: ' + argument 36931 ); 36932 } else { 36933 // If a variable is not specified, place data values in local scope. 36934 source = 'with(obj||{}){\n' + source + '}\n'; 36935 argument = 'obj'; 36936 } 36937 36938 source = "var __t,__p='',__j=Array.prototype.join," + 36939 "print=function(){__p+=__j.call(arguments,'');};\n" + 36940 source + 'return __p;\n'; 36941 36942 var render; 36943 try { 36944 render = new Function(argument, '_', source); 36945 } catch (e) { 36946 e.source = source; 36947 throw e; 36948 } 36949 36950 var template = function(data) { 36951 return render.call(this, data, _underscore_js__WEBPACK_IMPORTED_MODULE_1__["default"]); 36952 }; 36953 36954 // Provide the compiled source as a convenience for precompilation. 36955 template.source = 'function(' + argument + '){\n' + source + '}'; 36956 36957 return template; 36958} 36959 36960 36961/***/ }, 36962 36963/***/ "./node_modules/underscore/modules/templateSettings.js" 36964/*!*************************************************************!*\ 36965 !*** ./node_modules/underscore/modules/templateSettings.js ***! 36966 \*************************************************************/ 36967(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36968 36969"use strict"; 36970__webpack_require__.r(__webpack_exports__); 36971/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36972/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 36973/* harmony export */ }); 36974/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 36975 36976 36977// By default, Underscore uses ERB-style template delimiters. Change the 36978// following template settings to use alternative delimiters. 36979/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].templateSettings = { 36980 evaluate: /<%([\s\S]+?)%>/g, 36981 interpolate: /<%=([\s\S]+?)%>/g, 36982 escape: /<%-([\s\S]+?)%>/g 36983}); 36984 36985 36986/***/ }, 36987 36988/***/ "./node_modules/underscore/modules/throttle.js" 36989/*!*****************************************************!*\ 36990 !*** ./node_modules/underscore/modules/throttle.js ***! 36991 \*****************************************************/ 36992(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 36993 36994"use strict"; 36995__webpack_require__.r(__webpack_exports__); 36996/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36997/* harmony export */ "default": () => (/* binding */ throttle) 36998/* harmony export */ }); 36999/* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/underscore/modules/now.js"); 37000 37001 37002// Returns a function, that, when invoked, will only be triggered at most once 37003// during a given window of time. Normally, the throttled function will run 37004// as much as it can, without ever going more than once per `wait` duration; 37005// but if you'd like to disable the execution on the leading edge, pass 37006// `{leading: false}`. To disable execution on the trailing edge, ditto. 37007function throttle(func, wait, options) { 37008 var timeout, context, args, result; 37009 var previous = 0; 37010 if (!options) options = {}; 37011 37012 var later = function() { 37013 previous = options.leading === false ? 0 : (0,_now_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); 37014 timeout = null;
37015 result = func.apply(context, args); 37016 if (!timeout) context = args = null; 37017 }; 37018 37019 var throttled = function() { 37020 var _now = (0,_now_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); 37021 if (!previous && options.leading === false) previous = _now; 37022 var remaining = wait - (_now - previous); 37023 context = this; 37024 args = arguments; 37025 if (remaining <= 0 || remaining > wait) { 37026 if (timeout) { 37027 clearTimeout(timeout); 37028 timeout = null; 37029 } 37030 previous = _now; 37031 result = func.apply(context, args); 37032 if (!timeout) context = args = null; 37033 } else if (!timeout && options.trailing !== false) { 37034 timeout = setTimeout(later, remaining); 37035 } 37036 return result; 37037 }; 37038 37039 throttled.cancel = function() { 37040 clearTimeout(timeout); 37041 previous = 0; 37042 timeout = context = args = null; 37043 }; 37044 37045 return throttled; 37046} 37047 37048 37049/***/ }, 37050 37051/***/ "./node_modules/underscore/modules/times.js" 37052/*!**************************************************!*\ 37053 !*** ./node_modules/underscore/modules/times.js ***! 37054 \**************************************************/ 37055(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37056 37057"use strict"; 37058__webpack_require__.r(__webpack_exports__); 37059/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37060/* harmony export */ "default": () => (/* binding */ times) 37061/* harmony export */ }); 37062/* harmony import */ var _optimizeCb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_optimizeCb.js */ "./node_modules/underscore/modules/_optimizeCb.js"); 37063 37064 37065// Run a function **n** times. 37066function times(n, iteratee, context) { 37067 var accum = Array(Math.max(0, n)); 37068 iteratee = (0,_optimizeCb_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, context, 1); 37069 for (var i = 0; i < n; i++) accum[i] = iteratee(i); 37070 return accum; 37071} 37072 37073 37074/***/ }, 37075 37076/***/ "./node_modules/underscore/modules/toArray.js" 37077/*!****************************************************!*\ 37078 !*** ./node_modules/underscore/modules/toArray.js ***! 37079 \****************************************************/ 37080(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37081 37082"use strict"; 37083__webpack_require__.r(__webpack_exports__); 37084/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37085/* harmony export */ "default": () => (/* binding */ toArray) 37086/* harmony export */ }); 37087/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 37088/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 37089/* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/underscore/modules/isString.js"); 37090/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isArrayLike.js */ "./node_modules/underscore/modules/_isArrayLike.js"); 37091/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./map.js */ "./node_modules/underscore/modules/map.js"); 37092/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./identity.js */ "./node_modules/underscore/modules/identity.js"); 37093/* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./values.js */ "./node_modules/underscore/modules/values.js"); 37094 37095 37096 37097 37098 37099 37100 37101 37102// Safely create a real, live array from anything iterable. 37103var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; 37104function toArray(obj) { 37105 if (!obj) return []; 37106 if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return _setup_js__WEBPACK_IMPORTED_MODULE_1__.slice.call(obj); 37107 if ((0,_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(obj)) { 37108 // Keep surrogate pair characters together. 37109 return obj.match(reStrSymbol); 37110 } 37111 if ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(obj)) return (0,_map_js__WEBPACK_IMPORTED_MODULE_4__["default"])(obj, _identity_js__WEBPACK_IMPORTED_MODULE_5__["default"]); 37112 return (0,_values_js__WEBPACK_IMPORTED_MODULE_6__["default"])(obj); 37113} 37114 37115 37116/***/ }, 37117 37118/***/ "./node_modules/underscore/modules/toPath.js" 37119/*!***************************************************!*\ 37120 !*** ./node_modules/underscore/modules/toPath.js ***! 37121 \***************************************************/ 37122(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37123 37124"use strict"; 37125__webpack_require__.r(__webpack_exports__); 37126/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37127/* harmony export */ "default": () => (/* binding */ toPath) 37128/* harmony export */ }); 37129/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 37130/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/underscore/modules/isArray.js"); 37131 37132 37133 37134// Normalize a (deep) property `path` to array.
37135// Like `_.iteratee`, this function can be customized. 37136function toPath(path) { 37137 return (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path) ? path : [path]; 37138} 37139_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].toPath = toPath; 37140 37141 37142/***/ }, 37143 37144/***/ "./node_modules/underscore/modules/underscore-array-methods.js" 37145/*!*********************************************************************!*\ 37146 !*** ./node_modules/underscore/modules/underscore-array-methods.js ***! 37147 \*********************************************************************/ 37148(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37149 37150"use strict"; 37151__webpack_require__.r(__webpack_exports__); 37152/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37153/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 37154/* harmony export */ }); 37155/* harmony import */ var _underscore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./underscore.js */ "./node_modules/underscore/modules/underscore.js"); 37156/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/underscore/modules/each.js"); 37157/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 37158/* harmony import */ var _chainResult_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_chainResult.js */ "./node_modules/underscore/modules/_chainResult.js"); 37159 37160 37161 37162 37163 37164// Add all mutator `Array` functions to the wrapper. 37165(0,_each_js__WEBPACK_IMPORTED_MODULE_1__["default"])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { 37166 var method = _setup_js__WEBPACK_IMPORTED_MODULE_2__.ArrayProto[name]; 37167 _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype[name] = function() { 37168 var obj = this._wrapped; 37169 if (obj != null) { 37170 method.apply(obj, arguments); 37171 if ((name === 'shift' || name === 'splice') && obj.length === 0) { 37172 delete obj[0]; 37173 } 37174 } 37175 return (0,_chainResult_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this, obj); 37176 }; 37177}); 37178 37179// Add all accessor `Array` functions to the wrapper. 37180(0,_each_js__WEBPACK_IMPORTED_MODULE_1__["default"])(['concat', 'join', 'slice'], function(name) { 37181 var method = _setup_js__WEBPACK_IMPORTED_MODULE_2__.ArrayProto[name]; 37182 _underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype[name] = function() { 37183 var obj = this._wrapped; 37184 if (obj != null) obj = method.apply(obj, arguments); 37185 return (0,_chainResult_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this, obj); 37186 }; 37187}); 37188 37189/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_underscore_js__WEBPACK_IMPORTED_MODULE_0__["default"]); 37190 37191 37192/***/ }, 37193 37194/***/ "./node_modules/underscore/modules/underscore.js" 37195/*!*******************************************************!*\ 37196 !*** ./node_modules/underscore/modules/underscore.js ***! 37197 \*******************************************************/ 37198(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37199 37200"use strict"; 37201__webpack_require__.r(__webpack_exports__); 37202/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37203/* harmony export */ "default": () => (/* binding */ _) 37204/* harmony export */ }); 37205/* harmony import */ var _setup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setup.js */ "./node_modules/underscore/modules/_setup.js"); 37206 37207 37208// If Underscore is called as a function, it returns a wrapped object that can 37209// be used OO-style. This wrapper holds altered versions of all functions added 37210// through `_.mixin`. Wrapped objects may be chained. 37211function _(obj) { 37212 if (obj instanceof _) return obj; 37213 if (!(this instanceof _)) return new _(obj); 37214 this._wrapped = obj; 37215} 37216 37217_.VERSION = _setup_js__WEBPACK_IMPORTED_MODULE_0__.VERSION; 37218 37219// Extracts the result from a wrapped and chained object. 37220_.prototype.value = function() { 37221 return this._wrapped; 37222}; 37223 37224// Provide unwrapping proxies for some methods used in engine operations 37225// such as arithmetic and JSON stringification. 37226_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; 37227 37228_.prototype.toString = function() { 37229 return String(this._wrapped); 37230}; 37231 37232 37233/***/ }, 37234 37235/***/ "./node_modules/underscore/modules/unescape.js" 37236/*!*****************************************************!*\ 37237 !*** ./node_modules/underscore/modules/unescape.js ***! 37238 \*****************************************************/ 37239(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37240 37241"use strict"; 37242__webpack_require__.r(__webpack_exports__); 37243/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37244/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 37245/* harmony export */ }); 37246/* harmony import */ var _createEscaper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createEscaper.js */ "./node_modules/underscore/modules/_createEscaper.js"); 37247/* harmony import */ var _unescapeMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_unescapeMap.js */ "./node_modules/underscore/modules/_unescapeMap.js"); 37248 37249 37250 37251// Function for unescaping strings from HTML interpolation. 37252/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_createEscaper_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unescapeMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 37253 37254 37255/***/ }, 37256 37257/***/ "./node_modules/underscore/modules/union.js" 37258/*!**************************************************!*\ 37259 !*** ./node_modules/underscore/modules/union.js ***! 37260 \**************************************************/ 37261(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37262 37263"use strict"; 37264__webpack_require__.r(__webpack_exports__); 37265/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37266/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 37267/* harmony export */ }); 37268/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 37269/* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/underscore/modules/uniq.js"); 37270/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_flatten.js */ "./node_modules/underscore/modules/_flatten.js"); 37271 37272 37273 37274 37275// Produce an array that contains the union: each distinct element from all of 37276// the passed-in arrays. 37277/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(arrays) { 37278 return (0,_uniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_flatten_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arrays, true, true)); 37279})); 37280 37281 37282/***/ }, 37283 37284/***/ "./node_modules/underscore/modules/uniq.js" 37285/*!*************************************************!*\ 37286 !*** ./node_modules/underscore/modules/uniq.js ***! 37287 \*************************************************/ 37288(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37289 37290"use strict"; 37291__webpack_require__.r(__webpack_exports__); 37292/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37293/* harmony export */ "default": () => (/* binding */ uniq) 37294/* harmony export */ }); 37295/* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/underscore/modules/isBoolean.js"); 37296/* harmony import */ var _cb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cb.js */ "./node_modules/underscore/modules/_cb.js"); 37297/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 37298/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contains.js */ "./node_modules/underscore/modules/contains.js"); 37299 37300 37301 37302 37303 37304// Produce a duplicate-free version of the array. If the array has already 37305// been sorted, you have the option of using a faster algorithm. 37306// The faster algorithm will not work with an iteratee if the iteratee 37307// is not a one-to-one function, so providing an iteratee will disable 37308// the faster algorithm. 37309function uniq(array, isSorted, iteratee, context) { 37310 if (!(0,_isBoolean_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isSorted)) { 37311 context = iteratee; 37312 iteratee = isSorted; 37313 isSorted = false;
37314 } 37315 if (iteratee != null) iteratee = (0,_cb_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, context); 37316 var result = []; 37317 var seen = []; 37318 for (var i = 0, length = (0,_getLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array); i < length; i++) { 37319 var value = array[i], 37320 computed = iteratee ? iteratee(value, i, array) : value; 37321 if (isSorted && !iteratee) { 37322 if (!i || seen !== computed) result.push(value); 37323 seen = computed; 37324 } else if (iteratee) { 37325 if (!(0,_contains_js__WEBPACK_IMPORTED_MODULE_3__["default"])(seen, computed)) { 37326 seen.push(computed); 37327 result.push(value); 37328 } 37329 } else if (!(0,_contains_js__WEBPACK_IMPORTED_MODULE_3__["default"])(result, value)) { 37330 result.push(value); 37331 } 37332 } 37333 return result; 37334} 37335 37336 37337/***/ }, 37338 37339/***/ "./node_modules/underscore/modules/uniqueId.js" 37340/*!*****************************************************!*\ 37341 !*** ./node_modules/underscore/modules/uniqueId.js ***! 37342 \*****************************************************/ 37343(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37344 37345"use strict"; 37346__webpack_require__.r(__webpack_exports__); 37347/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37348/* harmony export */ "default": () => (/* binding */ uniqueId) 37349/* harmony export */ }); 37350// Generate a unique integer id (unique within the entire client session). 37351// Useful for temporary DOM ids. 37352var idCounter = 0; 37353function uniqueId(prefix) { 37354 var id = ++idCounter + ''; 37355 return prefix ? prefix + id : id; 37356} 37357 37358 37359/***/ }, 37360 37361/***/ "./node_modules/underscore/modules/unzip.js" 37362/*!**************************************************!*\ 37363 !*** ./node_modules/underscore/modules/unzip.js ***! 37364 \**************************************************/ 37365(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37366 37367"use strict"; 37368__webpack_require__.r(__webpack_exports__); 37369/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37370/* harmony export */ "default": () => (/* binding */ unzip) 37371/* harmony export */ }); 37372/* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./max.js */ "./node_modules/underscore/modules/max.js"); 37373/* harmony import */ var _getLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getLength.js */ "./node_modules/underscore/modules/_getLength.js"); 37374/* harmony import */ var _pluck_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pluck.js */ "./node_modules/underscore/modules/pluck.js"); 37375 37376 37377 37378 37379// Complement of zip. Unzip accepts an array of arrays and groups 37380// each array's elements on shared indices. 37381function unzip(array) { 37382 var length = (array && (0,_max_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _getLength_js__WEBPACK_IMPORTED_MODULE_1__["default"]).length) || 0; 37383 var result = Array(length); 37384 37385 for (var index = 0; index < length; index++) { 37386 result[index] = (0,_pluck_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, index); 37387 } 37388 return result; 37389} 37390 37391 37392/***/ }, 37393 37394/***/ "./node_modules/underscore/modules/values.js" 37395/*!***************************************************!*\ 37396 !*** ./node_modules/underscore/modules/values.js ***! 37397 \***************************************************/ 37398(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37399 37400"use strict"; 37401__webpack_require__.r(__webpack_exports__); 37402/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37403/* harmony export */ "default": () => (/* binding */ values) 37404/* harmony export */ }); 37405/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ "./node_modules/underscore/modules/keys.js"); 37406 37407 37408// Retrieve the values of an object's properties. 37409function values(obj) { 37410 var _keys = (0,_keys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj); 37411 var length = _keys.length; 37412 var values = Array(length); 37413 for (var i = 0; i < length; i++) { 37414 values[i] = obj[_keys[i]]; 37415 } 37416 return values; 37417} 37418 37419 37420/***/ }, 37421 37422/***/ "./node_modules/underscore/modules/where.js" 37423/*!**************************************************!*\ 37424 !*** ./node_modules/underscore/modules/where.js ***! 37425 \**************************************************/ 37426(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37427 37428"use strict"; 37429__webpack_require__.r(__webpack_exports__); 37430/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37431/* harmony export */ "default": () => (/* binding */ where) 37432/* harmony export */ }); 37433/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter.js */ "./node_modules/underscore/modules/filter.js"); 37434/* harmony import */ var _matcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matcher.js */ "./node_modules/underscore/modules/matcher.js"); 37435 37436 37437 37438// Convenience version of a common use case of `_.filter`: selecting only 37439// objects containing specific `key:value` pairs. 37440function where(obj, attrs) { 37441 return (0,_filter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, (0,_matcher_js__WEBPACK_IMPORTED_MODULE_1__["default"])(attrs)); 37442} 37443 37444 37445/***/ }, 37446 37447/***/ "./node_modules/underscore/modules/without.js" 37448/*!****************************************************!*\ 37449 !*** ./node_modules/underscore/modules/without.js ***! 37450 \****************************************************/ 37451(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37452 37453"use strict"; 37454__webpack_require__.r(__webpack_exports__); 37455/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37456/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 37457/* harmony export */ }); 37458/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 37459/* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference.js */ "./node_modules/underscore/modules/difference.js"); 37460 37461 37462 37463// Return a version of the array that does not contain the specified value(s). 37464/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(array, otherArrays) { 37465 return (0,_difference_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, otherArrays); 37466})); 37467 37468 37469/***/ }, 37470 37471/***/ "./node_modules/underscore/modules/wrap.js" 37472/*!*************************************************!*\ 37473 !*** ./node_modules/underscore/modules/wrap.js ***! 37474 \*************************************************/ 37475(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37476 37477"use strict"; 37478__webpack_require__.r(__webpack_exports__); 37479/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37480/* harmony export */ "default": () => (/* binding */ wrap) 37481/* harmony export */ }); 37482/* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./partial.js */ "./node_modules/underscore/modules/partial.js"); 37483 37484 37485// Returns the first function passed as an argument to the second, 37486// allowing you to adjust arguments, run code before and after, and 37487// conditionally execute the original function. 37488function wrap(func, wrapper) { 37489 return (0,_partial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapper, func); 37490} 37491 37492 37493/***/ }, 37494 37495/***/ "./node_modules/underscore/modules/zip.js" 37496/*!************************************************!*\ 37497 !*** ./node_modules/underscore/modules/zip.js ***! 37498 \************************************************/ 37499(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 37500 37501"use strict"; 37502__webpack_require__.r(__webpack_exports__); 37503/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37504/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 37505/* harmony export */ }); 37506/* harmony import */ var _restArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./restArguments.js */ "./node_modules/underscore/modules/restArguments.js"); 37507/* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/underscore/modules/unzip.js"); 37508 37509 37510 37511// Zip together multiple lists into a single array -- elements that share 37512// an index go together. 37513/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_restArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unzip_js__WEBPACK_IMPORTED_MODULE_1__["default"])); 37514 37515 37516/***/ } 37517 37518/******/ }); 37519/************************************************************************/ 37520/******/ // The module cache 37521/******/ const __webpack_module_cache__ = {}; 37522/******/ 37523/******/ // The require function 37524/******/ function __webpack_require__(moduleId) { 37525/******/ // Check if module is in cache 37526/******/ const cachedModule = __webpack_module_cache__[moduleId]; 37527/******/ if (cachedModule !== undefined) { 37528/******/ return cachedModule.exports; 37529/******/ } 37530/******/ // Create a new module (and put it into the cache) 37531/******/ const module = __webpack_module_cache__[moduleId] = { 37532/******/ id: moduleId, 37533/******/ loaded: false, 37534/******/ exports: {} 37535/******/ }; 37536/******/ 37537/******/ // Execute the module function 37538/******/ if (!(moduleId in __webpack_modules__)) { 37539/******/ delete __webpack_module_cache__[moduleId]; 37540/******/ const e = new Error("Cannot find module '" + moduleId + "'"); 37541/******/ e.code = 'MODULE_NOT_FOUND'; 37542/******/ throw e; 37543/******/ } 37544/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 37545/******/ 37546/******/ // Flag the module as loaded
37547/******/ module.loaded = true; 37548/******/ 37549/******/ // Return the exports of the module 37550/******/ return module.exports; 37551/******/ } 37552/******/ 37553/************************************************************************/ 37554/******/ /* webpack/runtime/compat get default export */ 37555/******/ (() => { 37556/******/ // getDefaultExport function for compatibility with non-harmony modules 37557/******/ __webpack_require__.n = (module) => { 37558/******/ const getter = module && module.__esModule ? 37559/******/ () => (module['default']) : 37560/******/ () => (module); 37561/******/ __webpack_require__.d(getter, { a: getter }); 37562/******/ return getter; 37563/******/ }; 37564/******/ })(); 37565/******/ 37566/******/ /* webpack/runtime/define property getters */ 37567/******/ (() => { 37568/******/ // define getter/value functions for harmony exports 37569/******/ __webpack_require__.d = (exports, definition) => { 37570/******/ if(Array.isArray(definition)) { 37571/******/ var i = 0; 37572/******/ while(i < definition.length) { 37573/******/ var key = definition[i++]; 37574/******/ var binding = definition[i++]; 37575/******/ if(!__webpack_require__.o(exports, key)) { 37576/******/ if(binding === 0) { 37577/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] }); 37578/******/ } else { 37579/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding }); 37580/******/ } 37581/******/ } else if(binding === 0) { i++; } 37582/******/ } 37583/******/ } else { 37584/******/ for(var key in definition) { 37585/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 37586/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 37587/******/ } 37588/******/ } 37589/******/ } 37590/******/ }; 37591/******/ })(); 37592/******/ 37593/******/ /* webpack/runtime/global */ 37594/******/ (() => { 37595/******/ __webpack_require__.g = (function() { 37596/******/ if (typeof globalThis === 'object') return globalThis; 37597/******/ try { 37598/******/ return this || new Function('return this')(); 37599/******/ } catch (e) { 37600/******/ if (typeof window === 'object') return window; 37601/******/ } 37602/******/ })(); 37603/******/ })(); 37604/******/ 37605/******/ /* webpack/runtime/hasOwnProperty shorthand */ 37606/******/ (() => { 37607/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 37608/******/ })(); 37609/******/ 37610/******/ /* webpack/runtime/make namespace object */ 37611/******/ (() => { 37612/******/ // define __esModule on exports 37613/******/ __webpack_require__.r = (exports) => { 37614/******/ if(Symbol.toStringTag) { 37615/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 37616/******/ } 37617/******/ Object.defineProperty(exports, '__esModule', { value: true }); 37618/******/ }; 37619/******/ })(); 37620/******/ 37621/******/ /* webpack/runtime/node module decorator */ 37622/******/ (() => { 37623/******/ __webpack_require__.nmd = (module) => { 37624/******/ module.paths = []; 37625/******/ if (!module.children) module.children = []; 37626/******/ return module; 37627/******/ }; 37628/******/ })(); 37629/******/ 37630/************************************************************************/ 37631let __webpack_exports__ = {}; 37632// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 37633(() => { 37634"use strict"; 37635/*!*****************************************************!*\ 37636 !*** ./smithsonian/frontend/src/js/ads/freestar.js ***! 37637 \*****************************************************/ 37638__webpack_require__.r(__webpack_exports__); 37639/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"); 37640/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); 37641/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); 37642/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); 37643/* harmony import */ var _smithsonian_js_ads_freestar_views_AdsAppView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @smithsonian/js/ads/freestar/views/AdsAppView */ "./smithsonian/frontend/src/js/ads/freestar/views/AdsAppView.js"); 37644 37645 37646 37647 37648(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee3() { 37649 var normalizeEmail, hashSHA256, _hashSHA, waitForFreestar, pushHashToFreestar, send, _send, sendHashed; 37650 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context3) { 37651 while (1) switch (_context3.prev = _context3.next) { 37652 case 0: 37653 sendHashed = function _sendHashed(sha256Hash) { 37654 if (!sha256Hash || !/^[a-f0-9]{64}$/i.test(sha256Hash)) return; 37655 pushHashToFreestar(sha256Hash); 37656 }; 37657 _send = function _send3() { 37658 _send = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2(email) { 37659 var normalized, sha256Hash, _t; 37660 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context2) { 37661 while (1) switch (_context2.prev = _context2.next) { 37662 case 0: 37663 if (email) { 37664 _context2.next = 1; 37665 break; 37666 } 37667 return _context2.abrupt("return"); 37668 case 1: 37669 _context2.prev = 1; 37670 normalized = normalizeEmail(email); 37671 _context2.next = 2; 37672 return hashSHA256(normalized); 37673 case 2: 37674 sha256Hash = _context2.sent; 37675 pushHashToFreestar(sha256Hash); 37676 _context2.next = 4; 37677 break; 37678 case 3: 37679 _context2.prev = 3; 37680 _t = _context2["catch"](1); 37681 case 4: 37682 case "end": 37683 return _context2.stop(); 37684 } 37685 }, _callee2, null, [[1, 3]]); 37686 })); 37687 return _send.apply(this, arguments); 37688 }; 37689 send = function _send2(_x2) { 37690 return _send.apply(this, arguments); 37691 }; 37692 pushHashToFreestar = function _pushHashToFreestar(sha256Hash) { 37693 waitForFreestar(function () { 37694 freestar.queue.push(function () { 37695 freestar.identity.setIdentity({ 37696 hashes: { 37697 sha256: sha256Hash 37698 } 37699 }); 37700 }); 37701 }); 37702 }; 37703 waitForFreestar = function _waitForFreestar(callback) { 37704 var retries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; 37705 var interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300; 37706 var tryLoad = function tryLoad() { 37707 if (typeof freestar !== 'undefined' && freestar.queue) { 37708 callback(); 37709 } else if (retries > 0) { 37710 setTimeout(function () { 37711 return waitForFreestar(callback, retries - 1, interval); 37712 }, interval); 37713 } 37714 }; 37715 tryLoad(); 37716 }; 37717 _hashSHA = function _hashSHA3() { 37718 _hashSHA = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(email) { 37719 var data, hashBuffer, hex; 37720 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) { 37721 while (1) switch (_context.prev = _context.next) { 37722 case 0: 37723 data = new TextEncoder().encode(email); 37724 _context.next = 1; 37725 return crypto.subtle.digest('SHA-256', data); 37726 case 1: 37727 hashBuffer = _context.sent; 37728 hex = Array.from(new Uint8Array(hashBuffer)).map(function (b) { 37729 return b.toString(16).padStart(2, '0'); 37730 }).join(''); 37731 return _context.abrupt("return", hex); 37732 case 2: 37733 case "end": 37734 return _context.stop(); 37735 } 37736 }, _callee); 37737 })); 37738 return _hashSHA.apply(this, arguments); 37739 }; 37740 hashSHA256 = function _hashSHA2(_x) { 37741 return _hashSHA.apply(this, arguments); 37742 }; 37743 normalizeEmail = function _normalizeEmail(email) { 37744 email = email.trim().toLowerCase(); 37745 var _email$split = email.split('@'), 37746 _email$split2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_email$split, 2), 37747 local = _email$split2[0], 37748 domain = _email$split2[1]; 37749 if (domain === 'gmail.com') { 37750 var cleanedLocal = local.split('+')[0].replace(/\./g, ''); 37751 return "".concat(cleanedLocal, "@").concat(domain); 37752 } 37753 return "".concat(local, "@").concat(domain); 37754 }; 37755 /* 37756 * Default for Articles/Categories/Video List 37757 */ 37758 new _smithsonian_js_ads_freestar_views_AdsAppView__WEBPACK_IMPORTED_MODULE_3__.FreeStarAdsAppView(); 37759 37760 /* 37761 * Freestar HEM 37762 */ 37763 // Manually keep normalizeEmail and hashSHA256 in sync with hem_encoder 37764 37765 window.sendFreestarUid = send; 37766 window.sendFreestarHashedUid = sendHashed; 37767 case 1: 37768 case "end": 37769 return _context3.stop(); 37770 } 37771 }, _callee3); 37772}))(); 37773})(); 37774 37775BUILD_ID = __webpack_exports__; 37776/******/ })() 37777; 37778//# sourceMappingURL=freestar.bundle.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.