vendor: 78 bytes, lines 1-3
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
vendor: 342 bytes, lines 4-13
4/***/ "./node_modules/axios/index.js": 5/*!*************************************!*\ 6 !*** ./node_modules/axios/index.js ***! 7 \*************************************/ 8/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 9 10module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); 11 12/***/ }), 13
vendor: 7,873 bytes, lines 14-236
14/***/ "./node_modules/axios/lib/adapters/xhr.js": 15/*!************************************************!*\ 16 !*** ./node_modules/axios/lib/adapters/xhr.js ***! 17 \************************************************/ 18/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 19 20"use strict"; 21 22 23var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 24var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); 25var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); 26var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 27var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); 28var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); 29var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); 30var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); 31var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); 32var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 33 34module.exports = function xhrAdapter(config) { 35 return new Promise(function dispatchXhrRequest(resolve, reject) { 36 var requestData = config.data; 37 var requestHeaders = config.headers; 38 var responseType = config.responseType; 39 var onCanceled; 40 function done() { 41 if (config.cancelToken) { 42 config.cancelToken.unsubscribe(onCanceled); 43 } 44 45 if (config.signal) { 46 config.signal.removeEventListener('abort', onCanceled); 47 } 48 } 49 50 if (utils.isFormData(requestData)) { 51 delete requestHeaders['Content-Type']; // Let the browser set it 52 } 53 54 var request = new XMLHttpRequest(); 55 56 // HTTP basic authentication 57 if (config.auth) { 58 var username = config.auth.username || ''; 59 var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; 60 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); 61 } 62 63 var fullPath = buildFullPath(config.baseURL, config.url); 64 request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); 65 66 // Set the request timeout in MS 67 request.timeout = config.timeout; 68 69 function onloadend() { 70 if (!request) { 71 return; 72 } 73 // Prepare the response 74 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; 75 var responseData = !responseType || responseType === 'text' || responseType === 'json' ? 76 request.responseText : request.response; 77 var response = { 78 data: responseData, 79 status: request.status, 80 statusText: request.statusText, 81 headers: responseHeaders, 82 config: config, 83 request: request 84 }; 85 86 settle(function _resolve(value) { 87 resolve(value); 88 done(); 89 }, function _reject(err) { 90 reject(err); 91 done(); 92 }, response); 93 94 // Clean up request 95 request = null; 96 } 97 98 if ('onloadend' in request) { 99 // Use onloadend if available 100 request.onloadend = onloadend; 101 } else { 102 // Listen for ready state to emulate onloadend 103 request.onreadystatechange = function handleLoad() { 104 if (!request || request.readyState !== 4) { 105 return; 106 } 107 108 // The request errored out and we didn't get a response, this will be 109 // handled by onerror instead 110 // With one exception: request that using file: protocol, most browsers 111 // will return status as 0 even though it's a successful request 112 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 113 return; 114 } 115 // readystate handler is calling before onerror or ontimeout handlers, 116 // so we should call onloadend on the next 'tick' 117 setTimeout(onloadend); 118 }; 119 } 120 121 // Handle browser request cancellation (as opposed to a manual cancellation) 122 request.onabort = function handleAbort() { 123 if (!request) { 124 return; 125 } 126 127 reject(createError('Request aborted', config, 'ECONNABORTED', request)); 128 129 // Clean up request 130 request = null; 131 }; 132 133 // Handle low level network errors 134 request.onerror = function handleError() { 135 // Real errors are hidden from us by the browser 136 // onerror should only fire if it's a network error 137 reject(createError('Network Error', config, null, request)); 138 139 // Clean up request 140 request = null; 141 }; 142 143 // Handle timeout 144 request.ontimeout = function handleTimeout() { 145 var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; 146 var transitional = config.transitional || defaults.transitional; 147 if (config.timeoutErrorMessage) { 148 timeoutErrorMessage = config.timeoutErrorMessage; 149 } 150 reject(createError( 151 timeoutErrorMessage, 152 config, 153 transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', 154 request)); 155 156 // Clean up request 157 request = null; 158 }; 159 160 // Add xsrf header 161 // This is only done if running in a standard browser environment. 162 // Specifically not if we're in a web worker, or react-native. 163 if (utils.isStandardBrowserEnv()) { 164 // Add xsrf header 165 var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? 166 cookies.read(config.xsrfCookieName) : 167 undefined; 168 169 if (xsrfValue) { 170 requestHeaders[config.xsrfHeaderName] = xsrfValue; 171 } 172 } 173 174 // Add headers to the request 175 if ('setRequestHeader' in request) { 176 utils.forEach(requestHeaders, function setRequestHeader(val, key) { 177 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { 178 // Remove Content-Type if data is undefined 179 delete requestHeaders[key]; 180 } else { 181 // Otherwise add header to the request 182 request.setRequestHeader(key, val); 183 } 184 }); 185 } 186 187 // Add withCredentials to request if needed 188 if (!utils.isUndefined(config.withCredentials)) { 189 request.withCredentials = !!config.withCredentials; 190 } 191 192 // Add responseType to request if needed 193 if (responseType && responseType !== 'json') { 194 request.responseType = config.responseType; 195 } 196 197 // Handle progress if needed 198 if (typeof config.onDownloadProgress === 'function') { 199 request.addEventListener('progress', config.onDownloadProgress); 200 } 201 202 // Not all browsers support upload events 203 if (typeof config.onUploadProgress === 'function' && request.upload) { 204 request.upload.addEventListener('progress', config.onUploadProgress); 205 } 206 207 if (config.cancelToken || config.signal) { 208 // Handle cancellation 209 // eslint-disable-next-line func-names 210 onCanceled = function(cancel) { 211 if (!request) { 212 return; 213 } 214 reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); 215 request.abort(); 216 request = null; 217 }; 218 219 config.cancelToken && config.cancelToken.subscribe(onCanceled); 220 if (config.signal) { 221 config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); 222 } 223 } 224 225 if (!requestData) { 226 requestData = null; 227 } 228 229 // Send the request 230 request.send(requestData); 231 }); 232}; 233 234 235/***/ }), 236
vendor: 2,498 bytes, lines 237-304
237/***/ "./node_modules/axios/lib/axios.js": 238/*!*****************************************!*\ 239 !*** ./node_modules/axios/lib/axios.js ***! 240 \*****************************************/ 241/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 242 243"use strict"; 244 245 246var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); 247var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 248var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); 249var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 250var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); 251 252/** 253 * Create an instance of Axios 254 * 255 * @param {Object} defaultConfig The default config for the instance 256 * @return {Axios} A new instance of Axios 257 */ 258function createInstance(defaultConfig) { 259 var context = new Axios(defaultConfig); 260 var instance = bind(Axios.prototype.request, context); 261 262 // Copy axios.prototype to instance 263 utils.extend(instance, Axios.prototype, context); 264 265 // Copy context to instance 266 utils.extend(instance, context); 267 268 // Factory for creating new instances 269 instance.create = function create(instanceConfig) { 270 return createInstance(mergeConfig(defaultConfig, instanceConfig)); 271 }; 272 273 return instance; 274} 275 276// Create the default instance to be exported 277var axios = createInstance(defaults); 278 279// Expose Axios class to allow class inheritance 280axios.Axios = Axios; 281 282// Expose Cancel & CancelToken 283axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 284axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); 285axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 286axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version); 287 288// Expose all/spread 289axios.all = function all(promises) { 290 return Promise.all(promises); 291}; 292axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); 293 294// Expose isAxiosError 295axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); 296 297module.exports = axios; 298 299// Allow use of default import syntax in TypeScript 300module.exports["default"] = axios; 301 302 303/***/ }), 304
vendor: 636 bytes, lines 305-334
305/***/ "./node_modules/axios/lib/cancel/Cancel.js": 306/*!*************************************************!*\ 307 !*** ./node_modules/axios/lib/cancel/Cancel.js ***! 308 \*************************************************/ 309/***/ ((module) => { 310 311"use strict"; 312 313 314/** 315 * A `Cancel` is an object that is thrown when an operation is canceled. 316 * 317 * @class 318 * @param {string=} message The message. 319 */ 320function Cancel(message) { 321 this.message = message; 322} 323 324Cancel.prototype.toString = function toString() { 325 return 'Cancel' + (this.message ? ': ' + this.message : ''); 326}; 327 328Cancel.prototype.__CANCEL__ = true; 329 330module.exports = Cancel; 331 332 333/***/ }), 334
vendor: 2,848 bytes, lines 335-464
335/***/ "./node_modules/axios/lib/cancel/CancelToken.js": 336/*!******************************************************!*\ 337 !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! 338 \******************************************************/ 339/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 340 341"use strict"; 342 343 344var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 345 346/** 347 * A `CancelToken` is an object that can be used to request cancellation of an operation. 348 * 349 * @class 350 * @param {Function} executor The executor function. 351 */ 352function CancelToken(executor) { 353 if (typeof executor !== 'function') { 354 throw new TypeError('executor must be a function.'); 355 } 356 357 var resolvePromise; 358 359 this.promise = new Promise(function promiseExecutor(resolve) { 360 resolvePromise = resolve; 361 }); 362 363 var token = this; 364 365 // eslint-disable-next-line func-names 366 this.promise.then(function(cancel) { 367 if (!token._listeners) return; 368 369 var i; 370 var l = token._listeners.length; 371 372 for (i = 0; i < l; i++) { 373 token._listeners[i](cancel); 374 } 375 token._listeners = null; 376 }); 377 378 // eslint-disable-next-line func-names 379 this.promise.then = function(onfulfilled) { 380 var _resolve; 381 // eslint-disable-next-line func-names 382 var promise = new Promise(function(resolve) { 383 token.subscribe(resolve); 384 _resolve = resolve; 385 }).then(onfulfilled); 386 387 promise.cancel = function reject() { 388 token.unsubscribe(_resolve); 389 }; 390 391 return promise; 392 }; 393 394 executor(function cancel(message) { 395 if (token.reason) { 396 // Cancellation has already been requested 397 return; 398 } 399 400 token.reason = new Cancel(message); 401 resolvePromise(token.reason); 402 }); 403} 404 405/** 406 * Throws a `Cancel` if cancellation has been requested. 407 */ 408CancelToken.prototype.throwIfRequested = function throwIfRequested() { 409 if (this.reason) { 410 throw this.reason; 411 } 412}; 413 414/** 415 * Subscribe to the cancel signal 416 */ 417 418CancelToken.prototype.subscribe = function subscribe(listener) { 419 if (this.reason) { 420 listener(this.reason); 421 return; 422 } 423 424 if (this._listeners) { 425 this._listeners.push(listener); 426 } else { 427 this._listeners = [listener]; 428 } 429}; 430 431/** 432 * Unsubscribe from the cancel signal 433 */ 434 435CancelToken.prototype.unsubscribe = function unsubscribe(listener) { 436 if (!this._listeners) { 437 return; 438 } 439 var index = this._listeners.indexOf(listener); 440 if (index !== -1) { 441 this._listeners.splice(index, 1); 442 } 443}; 444 445/** 446 * Returns an object that contains a new `CancelToken` and a function that, when called, 447 * cancels the `CancelToken`. 448 */ 449CancelToken.source = function source() { 450 var cancel; 451 var token = new CancelToken(function executor(c) { 452 cancel = c; 453 }); 454 return { 455 token: token, 456 cancel: cancel 457 }; 458}; 459 460module.exports = CancelToken; 461 462 463/***/ }), 464
vendor: 361 bytes, lines 465-480
465/***/ "./node_modules/axios/lib/cancel/isCancel.js": 466/*!***************************************************!*\ 467 !*** ./node_modules/axios/lib/cancel/isCancel.js ***! 468 \***************************************************/ 469/***/ ((module) => { 470 471"use strict"; 472 473 474module.exports = function isCancel(value) { 475 return !!(value && value.__CANCEL__); 476}; 477 478 479/***/ }), 480
vendor: 4,892 bytes, lines 481-639
481/***/ "./node_modules/axios/lib/core/Axios.js": 482/*!**********************************************!*\ 483 !*** ./node_modules/axios/lib/core/Axios.js ***! 484 \**********************************************/ 485/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 486 487"use strict"; 488 489 490var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 491var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 492var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); 493var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); 494var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 495var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js"); 496 497var validators = validator.validators; 498/** 499 * Create a new instance of Axios 500 * 501 * @param {Object} instanceConfig The default config for the instance 502 */ 503function Axios(instanceConfig) { 504 this.defaults = instanceConfig; 505 this.interceptors = { 506 request: new InterceptorManager(), 507 response: new InterceptorManager() 508 }; 509} 510 511/** 512 * Dispatch a request 513 * 514 * @param {Object} config The config specific for this request (merged with this.defaults) 515 */ 516Axios.prototype.request = function request(config) { 517 /*eslint no-param-reassign:0*/ 518 // Allow for axios('example/url'[, config]) a la fetch API 519 if (typeof config === 'string') { 520 config = arguments[1] || {}; 521 config.url = arguments[0]; 522 } else { 523 config = config || {}; 524 } 525 526 config = mergeConfig(this.defaults, config); 527 528 // Set config.method 529 if (config.method) { 530 config.method = config.method.toLowerCase(); 531 } else if (this.defaults.method) { 532 config.method = this.defaults.method.toLowerCase(); 533 } else { 534 config.method = 'get'; 535 } 536 537 var transitional = config.transitional; 538 539 if (transitional !== undefined) { 540 validator.assertOptions(transitional, { 541 silentJSONParsing: validators.transitional(validators.boolean), 542 forcedJSONParsing: validators.transitional(validators.boolean), 543 clarifyTimeoutError: validators.transitional(validators.boolean) 544 }, false); 545 } 546 547 // filter out skipped interceptors 548 var requestInterceptorChain = []; 549 var synchronousRequestInterceptors = true; 550 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 551 if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { 552 return; 553 } 554 555 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 556 557 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 558 }); 559 560 var responseInterceptorChain = []; 561 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 562 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 563 }); 564 565 var promise; 566 567 if (!synchronousRequestInterceptors) { 568 var chain = [dispatchRequest, undefined]; 569 570 Array.prototype.unshift.apply(chain, requestInterceptorChain); 571 chain = chain.concat(responseInterceptorChain); 572 573 promise = Promise.resolve(config); 574 while (chain.length) { 575 promise = promise.then(chain.shift(), chain.shift()); 576 } 577 578 return promise; 579 } 580 581 582 var newConfig = config; 583 while (requestInterceptorChain.length) { 584 var onFulfilled = requestInterceptorChain.shift(); 585 var onRejected = requestInterceptorChain.shift(); 586 try { 587 newConfig = onFulfilled(newConfig); 588 } catch (error) { 589 onRejected(error); 590 break; 591 } 592 } 593 594 try { 595 promise = dispatchRequest(newConfig); 596 } catch (error) { 597 return Promise.reject(error); 598 } 599 600 while (responseInterceptorChain.length) { 601 promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); 602 } 603 604 return promise; 605}; 606 607Axios.prototype.getUri = function getUri(config) { 608 config = mergeConfig(this.defaults, config); 609 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); 610}; 611 612// Provide aliases for supported request methods 613utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 614 /*eslint func-names:0*/ 615 Axios.prototype[method] = function(url, config) { 616 return this.request(mergeConfig(config || {}, { 617 method: method, 618 url: url, 619 data: (config || {}).data 620 })); 621 }; 622}); 623 624utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 625 /*eslint func-names:0*/ 626 Axios.prototype[method] = function(url, data, config) { 627 return this.request(mergeConfig(config || {}, { 628 method: method, 629 url: url, 630 data: data 631 })); 632 }; 633}); 634 635module.exports = Axios; 636 637 638/***/ }), 639
vendor: 1,754 bytes, lines 640-704
640/***/ "./node_modules/axios/lib/core/InterceptorManager.js": 641/*!***********************************************************!*\ 642 !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! 643 \***********************************************************/ 644/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 645 646"use strict"; 647 648 649var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 650 651function InterceptorManager() { 652 this.handlers = []; 653} 654 655/** 656 * Add a new interceptor to the stack 657 * 658 * @param {Function} fulfilled The function to handle `then` for a `Promise` 659 * @param {Function} rejected The function to handle `reject` for a `Promise` 660 * 661 * @return {Number} An ID used to remove interceptor later 662 */ 663InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { 664 this.handlers.push({ 665 fulfilled: fulfilled, 666 rejected: rejected, 667 synchronous: options ? options.synchronous : false, 668 runWhen: options ? options.runWhen : null 669 }); 670 return this.handlers.length - 1; 671}; 672 673/** 674 * Remove an interceptor from the stack 675 * 676 * @param {Number} id The ID that was returned by `use` 677 */ 678InterceptorManager.prototype.eject = function eject(id) { 679 if (this.handlers[id]) { 680 this.handlers[id] = null; 681 } 682}; 683 684/** 685 * Iterate over all the registered interceptors 686 * 687 * This method is particularly useful for skipping over any 688 * interceptors that may have become `null` calling `eject`. 689 * 690 * @param {Function} fn The function to call for each interceptor 691 */ 692InterceptorManager.prototype.forEach = function forEach(fn) { 693 utils.forEach(this.handlers, function forEachHandler(h) { 694 if (h !== null) { 695 fn(h); 696 } 697 }); 698}; 699 700module.exports = InterceptorManager; 701 702 703/***/ }), 704
vendor: 1,149 bytes, lines 705-735
705/***/ "./node_modules/axios/lib/core/buildFullPath.js": 706/*!******************************************************!*\ 707 !*** ./node_modules/axios/lib/core/buildFullPath.js ***! 708 \******************************************************/ 709/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 710 711"use strict"; 712 713 714var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); 715var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); 716 717/** 718 * Creates a new URL by combining the baseURL with the requestedURL, 719 * only when the requestedURL is not already an absolute URL. 720 * If the requestURL is absolute, this function returns the requestedURL untouched. 721 * 722 * @param {string} baseURL The base URL 723 * @param {string} requestedURL Absolute or relative URL to combine 724 * @returns {string} The combined full path 725 */ 726module.exports = function buildFullPath(baseURL, requestedURL) { 727 if (baseURL && !isAbsoluteURL(requestedURL)) { 728 return combineURLs(baseURL, requestedURL); 729 } 730 return requestedURL; 731}; 732 733 734/***/ }), 735
vendor: 1,000 bytes, lines 736-764
736/***/ "./node_modules/axios/lib/core/createError.js": 737/*!****************************************************!*\ 738 !*** ./node_modules/axios/lib/core/createError.js ***! 739 \****************************************************/ 740/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 741 742"use strict"; 743 744 745var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); 746 747/** 748 * Create an Error with the specified message, config, error code, request and response. 749 * 750 * @param {string} message The error message. 751 * @param {Object} config The config. 752 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 753 * @param {Object} [request] The request. 754 * @param {Object} [response] The response. 755 * @returns {Error} The created error. 756 */ 757module.exports = function createError(message, config, code, request, response) { 758 var error = new Error(message); 759 return enhanceError(error, config, code, request, response); 760}; 761 762 763/***/ }), 764
vendor: 2,747 bytes, lines 765-862
765/***/ "./node_modules/axios/lib/core/dispatchRequest.js": 766/*!********************************************************!*\ 767 !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! 768 \********************************************************/ 769/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 770 771"use strict"; 772 773 774var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 775var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); 776var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 777var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); 778var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 779 780/** 781 * Throws a `Cancel` if cancellation has been requested. 782 */ 783function throwIfCancellationRequested(config) { 784 if (config.cancelToken) { 785 config.cancelToken.throwIfRequested(); 786 } 787 788 if (config.signal && config.signal.aborted) { 789 throw new Cancel('canceled'); 790 } 791} 792 793/** 794 * Dispatch a request to the server using the configured adapter. 795 * 796 * @param {object} config The config that is to be used for the request 797 * @returns {Promise} The Promise to be fulfilled 798 */ 799module.exports = function dispatchRequest(config) { 800 throwIfCancellationRequested(config); 801 802 // Ensure headers exist 803 config.headers = config.headers || {}; 804 805 // Transform request data 806 config.data = transformData.call( 807 config, 808 config.data, 809 config.headers, 810 config.transformRequest 811 ); 812 813 // Flatten headers 814 config.headers = utils.merge( 815 config.headers.common || {}, 816 config.headers[config.method] || {}, 817 config.headers 818 ); 819 820 utils.forEach( 821 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 822 function cleanHeaderConfig(method) { 823 delete config.headers[method]; 824 } 825 ); 826 827 var adapter = config.adapter || defaults.adapter; 828 829 return adapter(config).then(function onAdapterResolution(response) { 830 throwIfCancellationRequested(config); 831 832 // Transform response data 833 response.data = transformData.call( 834 config, 835 response.data, 836 response.headers, 837 config.transformResponse 838 ); 839 840 return response; 841 }, function onAdapterRejection(reason) { 842 if (!isCancel(reason)) { 843 throwIfCancellationRequested(config); 844 845 // Transform response data 846 if (reason && reason.response) { 847 reason.response.data = transformData.call( 848 config, 849 reason.response.data, 850 reason.response.headers, 851 config.transformResponse 852 ); 853 } 854 } 855 856 return Promise.reject(reason); 857 }); 858}; 859 860 861/***/ }), 862
vendor: 1,399 bytes, lines 863-916
863/***/ "./node_modules/axios/lib/core/enhanceError.js": 864/*!*****************************************************!*\ 865 !*** ./node_modules/axios/lib/core/enhanceError.js ***! 866 \*****************************************************/ 867/***/ ((module) => { 868 869"use strict"; 870 871 872/** 873 * Update an Error with the specified config, error code, and response. 874 * 875 * @param {Error} error The error to update. 876 * @param {Object} config The config. 877 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 878 * @param {Object} [request] The request. 879 * @param {Object} [response] The response. 880 * @returns {Error} The error. 881 */ 882module.exports = function enhanceError(error, config, code, request, response) { 883 error.config = config; 884 if (code) { 885 error.code = code; 886 } 887 888 error.request = request; 889 error.response = response; 890 error.isAxiosError = true; 891 892 error.toJSON = function toJSON() { 893 return { 894 // Standard 895 message: this.message, 896 name: this.name, 897 // Microsoft 898 description: this.description, 899 number: this.number, 900 // Mozilla 901 fileName: this.fileName, 902 lineNumber: this.lineNumber, 903 columnNumber: this.columnNumber, 904 stack: this.stack, 905 // Axios 906 config: this.config, 907 code: this.code, 908 status: this.response && this.response.status ? this.response.status : null 909 }; 910 }; 911 return error; 912}; 913 914 915/***/ }), 916
vendor: 3,558 bytes, lines 917-1026
917/***/ "./node_modules/axios/lib/core/mergeConfig.js": 918/*!****************************************************!*\ 919 !*** ./node_modules/axios/lib/core/mergeConfig.js ***! 920 \****************************************************/ 921/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 922 923"use strict"; 924 925 926var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 927 928/** 929 * Config-specific merge-function which creates a new config-object 930 * by merging two configuration objects together. 931 * 932 * @param {Object} config1 933 * @param {Object} config2 934 * @returns {Object} New object resulting from merging config2 to config1 935 */ 936module.exports = function mergeConfig(config1, config2) { 937 // eslint-disable-next-line no-param-reassign 938 config2 = config2 || {}; 939 var config = {}; 940 941 function getMergedValue(target, source) { 942 if (utils.isPlainObject(target) && utils.isPlainObject(source)) { 943 return utils.merge(target, source); 944 } else if (utils.isPlainObject(source)) { 945 return utils.merge({}, source); 946 } else if (utils.isArray(source)) { 947 return source.slice(); 948 } 949 return source; 950 } 951 952 // eslint-disable-next-line consistent-return 953 function mergeDeepProperties(prop) { 954 if (!utils.isUndefined(config2[prop])) { 955 return getMergedValue(config1[prop], config2[prop]); 956 } else if (!utils.isUndefined(config1[prop])) { 957 return getMergedValue(undefined, config1[prop]); 958 } 959 } 960 961 // eslint-disable-next-line consistent-return 962 function valueFromConfig2(prop) { 963 if (!utils.isUndefined(config2[prop])) { 964 return getMergedValue(undefined, config2[prop]); 965 } 966 } 967 968 // eslint-disable-next-line consistent-return 969 function defaultToConfig2(prop) { 970 if (!utils.isUndefined(config2[prop])) { 971 return getMergedValue(undefined, config2[prop]); 972 } else if (!utils.isUndefined(config1[prop])) { 973 return getMergedValue(undefined, config1[prop]); 974 } 975 } 976 977 // eslint-disable-next-line consistent-return 978 function mergeDirectKeys(prop) { 979 if (prop in config2) { 980 return getMergedValue(config1[prop], config2[prop]); 981 } else if (prop in config1) { 982 return getMergedValue(undefined, config1[prop]); 983 } 984 } 985 986 var mergeMap = { 987 'url': valueFromConfig2, 988 'method': valueFromConfig2, 989 'data': valueFromConfig2, 990 'baseURL': defaultToConfig2, 991 'transformRequest': defaultToConfig2, 992 'transformResponse': defaultToConfig2, 993 'paramsSerializer': defaultToConfig2, 994 'timeout': defaultToConfig2, 995 'timeoutMessage': defaultToConfig2, 996 'withCredentials': defaultToConfig2, 997 'adapter': defaultToConfig2, 998 'responseType': defaultToConfig2, 999 'xsrfCookieName': defaultToConfig2, 1000 'xsrfHeaderName': defaultToConfig2, 1001 'onUploadProgress': defaultToConfig2, 1002 'onDownloadProgress': defaultToConfig2, 1003 'decompress': defaultToConfig2, 1004 'maxContentLength': defaultToConfig2, 1005 'maxBodyLength': defaultToConfig2, 1006 'transport': defaultToConfig2, 1007 'httpAgent': defaultToConfig2, 1008 'httpsAgent': defaultToConfig2, 1009 'cancelToken': defaultToConfig2, 1010 'socketPath': defaultToConfig2, 1011 'responseEncoding': defaultToConfig2, 1012 'validateStatus': mergeDirectKeys 1013 }; 1014 1015 utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { 1016 var merge = mergeMap[prop] || mergeDeepProperties; 1017 var configValue = merge(prop); 1018 (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); 1019 }); 1020 1021 return config; 1022}; 1023 1024 1025/***/ }), 1026
vendor: 1,060 bytes, lines 1027-1062
1027/***/ "./node_modules/axios/lib/core/settle.js": 1028/*!***********************************************!*\ 1029 !*** ./node_modules/axios/lib/core/settle.js ***! 1030 \***********************************************/ 1031/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1032 1033"use strict"; 1034 1035 1036var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); 1037 1038/** 1039 * Resolve or reject a Promise based on response status. 1040 * 1041 * @param {Function} resolve A function that resolves the promise. 1042 * @param {Function} reject A function that rejects the promise. 1043 * @param {object} response The response. 1044 */ 1045module.exports = function settle(resolve, reject, response) { 1046 var validateStatus = response.config.validateStatus; 1047 if (!response.status || !validateStatus || validateStatus(response.status)) { 1048 resolve(response); 1049 } else { 1050 reject(createError( 1051 'Request failed with status code ' + response.status, 1052 response.config, 1053 null, 1054 response.request, 1055 response 1056 )); 1057 } 1058}; 1059 1060 1061/***/ }), 1062
vendor: 1,066 bytes, lines 1063-1095
1063/***/ "./node_modules/axios/lib/core/transformData.js": 1064/*!******************************************************!*\ 1065 !*** ./node_modules/axios/lib/core/transformData.js ***! 1066 \******************************************************/ 1067/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1068 1069"use strict"; 1070 1071 1072var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1073var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js"); 1074 1075/** 1076 * Transform the data for a request or a response 1077 * 1078 * @param {Object|String} data The data to be transformed 1079 * @param {Array} headers The headers for the request or response 1080 * @param {Array|Function} fns A single function or Array of functions 1081 * @returns {*} The resulting transformed data 1082 */ 1083module.exports = function transformData(data, headers, fns) { 1084 var context = this || defaults; 1085 /*eslint no-param-reassign:0*/ 1086 utils.forEach(fns, function transform(fn) { 1087 data = fn.call(context, data, headers); 1088 }); 1089 1090 return data; 1091}; 1092 1093 1094/***/ }), 1095
vendor: 4,297 bytes, lines 1096-1241
1096/***/ "./node_modules/axios/lib/defaults.js": 1097/*!********************************************!*\ 1098 !*** ./node_modules/axios/lib/defaults.js ***! 1099 \********************************************/ 1100/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1101 1102"use strict"; 1103/* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); 1104 1105 1106var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); 1107var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); 1108var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); 1109 1110var DEFAULT_CONTENT_TYPE = { 1111 'Content-Type': 'application/x-www-form-urlencoded' 1112}; 1113 1114function setContentTypeIfUnset(headers, value) { 1115 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { 1116 headers['Content-Type'] = value; 1117 } 1118} 1119 1120function getDefaultAdapter() { 1121 var adapter; 1122 if (typeof XMLHttpRequest !== 'undefined') { 1123 // For browsers use XHR adapter 1124 adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); 1125 } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { 1126 // For node use HTTP adapter 1127 adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); 1128 } 1129 return adapter; 1130} 1131 1132function stringifySafely(rawValue, parser, encoder) { 1133 if (utils.isString(rawValue)) { 1134 try { 1135 (parser || JSON.parse)(rawValue); 1136 return utils.trim(rawValue); 1137 } catch (e) { 1138 if (e.name !== 'SyntaxError') { 1139 throw e; 1140 } 1141 } 1142 } 1143 1144 return (encoder || JSON.stringify)(rawValue); 1145} 1146 1147var defaults = { 1148 1149 transitional: { 1150 silentJSONParsing: true, 1151 forcedJSONParsing: true, 1152 clarifyTimeoutError: false 1153 }, 1154 1155 adapter: getDefaultAdapter(), 1156 1157 transformRequest: [function transformRequest(data, headers) { 1158 normalizeHeaderName(headers, 'Accept'); 1159 normalizeHeaderName(headers, 'Content-Type'); 1160 1161 if (utils.isFormData(data) || 1162 utils.isArrayBuffer(data) || 1163 utils.isBuffer(data) || 1164 utils.isStream(data) || 1165 utils.isFile(data) || 1166 utils.isBlob(data) 1167 ) { 1168 return data; 1169 } 1170 if (utils.isArrayBufferView(data)) { 1171 return data.buffer; 1172 } 1173 if (utils.isURLSearchParams(data)) { 1174 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); 1175 return data.toString(); 1176 } 1177 if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { 1178 setContentTypeIfUnset(headers, 'application/json'); 1179 return stringifySafely(data); 1180 } 1181 return data; 1182 }], 1183 1184 transformResponse: [function transformResponse(data) { 1185 var transitional = this.transitional || defaults.transitional; 1186 var silentJSONParsing = transitional && transitional.silentJSONParsing; 1187 var forcedJSONParsing = transitional && transitional.forcedJSONParsing; 1188 var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; 1189 1190 if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { 1191 try { 1192 return JSON.parse(data); 1193 } catch (e) { 1194 if (strictJSONParsing) { 1195 if (e.name === 'SyntaxError') { 1196 throw enhanceError(e, this, 'E_JSON_PARSE'); 1197 } 1198 throw e; 1199 } 1200 } 1201 } 1202 1203 return data; 1204 }], 1205 1206 /** 1207 * A timeout in milliseconds to abort a request. If set to 0 (default) a 1208 * timeout is not created. 1209 */ 1210 timeout: 0, 1211 1212 xsrfCookieName: 'XSRF-TOKEN', 1213 xsrfHeaderName: 'X-XSRF-TOKEN', 1214 1215 maxContentLength: -1, 1216 maxBodyLength: -1, 1217 1218 validateStatus: function validateStatus(status) { 1219 return status >= 200 && status < 300; 1220 }, 1221 1222 headers: { 1223 common: { 1224 'Accept': 'application/json, text/plain, */*' 1225 } 1226 } 1227}; 1228 1229utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { 1230 defaults.headers[method] = {}; 1231}); 1232 1233utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 1234 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); 1235}); 1236 1237module.exports = defaults; 1238 1239 1240/***/ }), 1241
vendor: 273 bytes, lines 1242-1253
1242/***/ "./node_modules/axios/lib/env/data.js": 1243/*!********************************************!*\ 1244 !*** ./node_modules/axios/lib/env/data.js ***! 1245 \********************************************/ 1246/***/ ((module) => { 1247 1248module.exports = { 1249 "version": "0.24.0" 1250}; 1251 1252/***/ }), 1253
vendor: 503 bytes, lines 1254-1275
1254/***/ "./node_modules/axios/lib/helpers/bind.js": 1255/*!************************************************!*\ 1256 !*** ./node_modules/axios/lib/helpers/bind.js ***! 1257 \************************************************/ 1258/***/ ((module) => { 1259 1260"use strict"; 1261 1262 1263module.exports = function bind(fn, thisArg) { 1264 return function wrap() { 1265 var args = new Array(arguments.length); 1266 for (var i = 0; i < args.length; i++) { 1267 args[i] = arguments[i]; 1268 } 1269 return fn.apply(thisArg, args); 1270 }; 1271}; 1272 1273 1274/***/ }), 1275
vendor: 2,007 bytes, lines 1276-1356
1276/***/ "./node_modules/axios/lib/helpers/buildURL.js": 1277/*!****************************************************!*\ 1278 !*** ./node_modules/axios/lib/helpers/buildURL.js ***! 1279 \****************************************************/ 1280/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1281 1282"use strict"; 1283 1284 1285var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1286 1287function encode(val) { 1288 return encodeURIComponent(val). 1289 replace(/%3A/gi, ':'). 1290 replace(/%24/g, '$'). 1291 replace(/%2C/gi, ','). 1292 replace(/%20/g, '+'). 1293 replace(/%5B/gi, '['). 1294 replace(/%5D/gi, ']'); 1295} 1296 1297/** 1298 * Build a URL by appending params to the end 1299 * 1300 * @param {string} url The base of the url (e.g., http://www.google.com) 1301 * @param {object} [params] The params to be appended 1302 * @returns {string} The formatted url 1303 */ 1304module.exports = function buildURL(url, params, paramsSerializer) { 1305 /*eslint no-param-reassign:0*/ 1306 if (!params) { 1307 return url; 1308 } 1309 1310 var serializedParams; 1311 if (paramsSerializer) { 1312 serializedParams = paramsSerializer(params); 1313 } else if (utils.isURLSearchParams(params)) { 1314 serializedParams = params.toString(); 1315 } else { 1316 var parts = []; 1317 1318 utils.forEach(params, function serialize(val, key) { 1319 if (val === null || typeof val === 'undefined') { 1320 return; 1321 } 1322 1323 if (utils.isArray(val)) { 1324 key = key + '[]'; 1325 } else { 1326 val = [val]; 1327 } 1328 1329 utils.forEach(val, function parseValue(v) { 1330 if (utils.isDate(v)) { 1331 v = v.toISOString(); 1332 } else if (utils.isObject(v)) { 1333 v = JSON.stringify(v); 1334 } 1335 parts.push(encode(key) + '=' + encode(v)); 1336 }); 1337 }); 1338 1339 serializedParams = parts.join('&'); 1340 } 1341 1342 if (serializedParams) { 1343 var hashmarkIndex = url.indexOf('#'); 1344 if (hashmarkIndex !== -1) { 1345 url = url.slice(0, hashmarkIndex); 1346 } 1347 1348 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 1349 } 1350 1351 return url; 1352}; 1353 1354 1355/***/ }), 1356
vendor: 655 bytes, lines 1357-1381
1357/***/ "./node_modules/axios/lib/helpers/combineURLs.js": 1358/*!*******************************************************!*\ 1359 !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! 1360 \*******************************************************/ 1361/***/ ((module) => { 1362 1363"use strict"; 1364 1365 1366/** 1367 * Creates a new URL by combining the specified URLs 1368 * 1369 * @param {string} baseURL The base URL 1370 * @param {string} relativeURL The relative URL 1371 * @returns {string} The combined URL 1372 */ 1373module.exports = function combineURLs(baseURL, relativeURL) { 1374 return relativeURL 1375 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') 1376 : baseURL; 1377}; 1378 1379 1380/***/ }), 1381
vendor: 1,794 bytes, lines 1382-1445
1382/***/ "./node_modules/axios/lib/helpers/cookies.js": 1383/*!***************************************************!*\ 1384 !*** ./node_modules/axios/lib/helpers/cookies.js ***! 1385 \***************************************************/ 1386/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1387 1388"use strict"; 1389 1390 1391var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1392 1393module.exports = ( 1394 utils.isStandardBrowserEnv() ? 1395 1396 // Standard browser envs support document.cookie 1397 (function standardBrowserEnv() { 1398 return { 1399 write: function write(name, value, expires, path, domain, secure) { 1400 var cookie = []; 1401 cookie.push(name + '=' + encodeURIComponent(value)); 1402 1403 if (utils.isNumber(expires)) { 1404 cookie.push('expires=' + new Date(expires).toGMTString()); 1405 } 1406 1407 if (utils.isString(path)) { 1408 cookie.push('path=' + path); 1409 } 1410 1411 if (utils.isString(domain)) { 1412 cookie.push('domain=' + domain); 1413 } 1414 1415 if (secure === true) { 1416 cookie.push('secure'); 1417 } 1418 1419 document.cookie = cookie.join('; '); 1420 }, 1421 1422 read: function read(name) { 1423 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); 1424 return (match ? decodeURIComponent(match[3]) : null); 1425 }, 1426 1427 remove: function remove(name) { 1428 this.write(name, '', Date.now() - 86400000); 1429 } 1430 }; 1431 })() : 1432 1433 // Non standard browser env (web workers, react-native) lack needed support. 1434 (function nonStandardBrowserEnv() { 1435 return { 1436 write: function write() {}, 1437 read: function read() { return null; }, 1438 remove: function remove() {} 1439 }; 1440 })() 1441); 1442 1443 1444/***/ }), 1445
vendor: 846 bytes, lines 1446-1470
1446/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": 1447/*!*********************************************************!*\ 1448 !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! 1449 \*********************************************************/ 1450/***/ ((module) => { 1451 1452"use strict"; 1453 1454 1455/** 1456 * Determines whether the specified URL is absolute 1457 * 1458 * @param {string} url The URL to test 1459 * @returns {boolean} True if the specified URL is absolute, otherwise false 1460 */ 1461module.exports = function isAbsoluteURL(url) { 1462 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 1463 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 1464 // by any combination of letters, digits, plus, period, or hyphen. 1465 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); 1466}; 1467 1468 1469/***/ }), 1470
vendor: 622 bytes, lines 1471-1492
1471/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": 1472/*!********************************************************!*\ 1473 !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! 1474 \********************************************************/ 1475/***/ ((module) => { 1476 1477"use strict"; 1478 1479 1480/** 1481 * Determines whether the payload is an error thrown by Axios 1482 * 1483 * @param {*} payload The value to test 1484 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false 1485 */ 1486module.exports = function isAxiosError(payload) { 1487 return (typeof payload === 'object') && (payload.isAxiosError === true); 1488}; 1489 1490 1491/***/ }), 1492
vendor: 2,696 bytes, lines 1493-1571
1493/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": 1494/*!***********************************************************!*\ 1495 !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! 1496 \***********************************************************/ 1497/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1498 1499"use strict"; 1500 1501 1502var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1503 1504module.exports = ( 1505 utils.isStandardBrowserEnv() ? 1506 1507 // Standard browser envs have full support of the APIs needed to test 1508 // whether the request URL is of the same origin as current location. 1509 (function standardBrowserEnv() { 1510 var msie = /(msie|trident)/i.test(navigator.userAgent); 1511 var urlParsingNode = document.createElement('a'); 1512 var originURL; 1513 1514 /** 1515 * Parse a URL to discover it's components 1516 * 1517 * @param {String} url The URL to be parsed 1518 * @returns {Object} 1519 */ 1520 function resolveURL(url) { 1521 var href = url; 1522 1523 if (msie) { 1524 // IE needs attribute set twice to normalize properties 1525 urlParsingNode.setAttribute('href', href); 1526 href = urlParsingNode.href; 1527 } 1528 1529 urlParsingNode.setAttribute('href', href); 1530 1531 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 1532 return { 1533 href: urlParsingNode.href, 1534 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 1535 host: urlParsingNode.host, 1536 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 1537 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 1538 hostname: urlParsingNode.hostname, 1539 port: urlParsingNode.port, 1540 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 1541 urlParsingNode.pathname : 1542 '/' + urlParsingNode.pathname 1543 }; 1544 } 1545 1546 originURL = resolveURL(window.location.href); 1547 1548 /** 1549 * Determine if a URL shares the same origin as the current location 1550 * 1551 * @param {String} requestURL The URL to test 1552 * @returns {boolean} True if URL shares the same origin, otherwise false 1553 */ 1554 return function isURLSameOrigin(requestURL) { 1555 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 1556 return (parsed.protocol === originURL.protocol && 1557 parsed.host === originURL.host); 1558 }; 1559 })() : 1560 1561 // Non standard browser envs (web workers, react-native) lack needed support. 1562 (function nonStandardBrowserEnv() { 1563 return function isURLSameOrigin() { 1564 return true; 1565 }; 1566 })() 1567); 1568 1569 1570/***/ }), 1571
vendor: 764 bytes, lines 1572-1594
1572/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": 1573/*!***************************************************************!*\ 1574 !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! 1575 \***************************************************************/ 1576/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1577 1578"use strict"; 1579 1580 1581var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 1582 1583module.exports = function normalizeHeaderName(headers, normalizedName) { 1584 utils.forEach(headers, function processHeader(value, name) { 1585 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { 1586 headers[normalizedName] = value; 1587 delete headers[name]; 1588 } 1589 }); 1590}; 1591 1592 1593/***/ }), 1594
vendor: 1,772 bytes, lines 1595-1658
1595/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": 1596/*!********************************************************!*\ 1597 !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! 1598 \********************************************************/ 1599/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1600 1601"use strict"; 1602 1603 1604var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1605 1606// Headers whose duplicates are ignored by node 1607// c.f. https://nodejs.org/api/http.html#http_message_headers 1608var ignoreDuplicateOf = [ 1609 'age', 'authorization', 'content-length', 'content-type', 'etag', 1610 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 1611 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 1612 'referer', 'retry-after', 'user-agent' 1613]; 1614 1615/** 1616 * Parse headers into an object 1617 * 1618 * ``` 1619 * Date: Wed, 27 Aug 2014 08:58:49 GMT 1620 * Content-Type: application/json 1621 * Connection: keep-alive 1622 * Transfer-Encoding: chunked 1623 * ``` 1624 * 1625 * @param {String} headers Headers needing to be parsed 1626 * @returns {Object} Headers parsed into an object 1627 */ 1628module.exports = function parseHeaders(headers) { 1629 var parsed = {}; 1630 var key; 1631 var val; 1632 var i; 1633 1634 if (!headers) { return parsed; } 1635 1636 utils.forEach(headers.split('\n'), function parser(line) { 1637 i = line.indexOf(':'); 1638 key = utils.trim(line.substr(0, i)).toLowerCase(); 1639 val = utils.trim(line.substr(i + 1)); 1640 1641 if (key) { 1642 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { 1643 return; 1644 } 1645 if (key === 'set-cookie') { 1646 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); 1647 } else { 1648 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 1649 } 1650 } 1651 }); 1652 1653 return parsed; 1654}; 1655 1656 1657/***/ }), 1658
vendor: 819 bytes, lines 1659-1696
1659/***/ "./node_modules/axios/lib/helpers/spread.js": 1660/*!**************************************************!*\ 1661 !*** ./node_modules/axios/lib/helpers/spread.js ***! 1662 \**************************************************/ 1663/***/ ((module) => { 1664 1665"use strict"; 1666 1667 1668/** 1669 * Syntactic sugar for invoking a function and expanding an array for arguments. 1670 * 1671 * Common use case would be to use `Function.prototype.apply`. 1672 * 1673 * ```js 1674 * function f(x, y, z) {} 1675 * var args = [1, 2, 3]; 1676 * f.apply(null, args); 1677 * ``` 1678 * 1679 * With `spread` this example can be re-written. 1680 * 1681 * ```js 1682 * spread(function(x, y, z) {})([1, 2, 3]); 1683 * ``` 1684 * 1685 * @param {Function} callback 1686 * @returns {Function} 1687 */ 1688module.exports = function spread(callback) { 1689 return function wrap(arr) { 1690 return callback.apply(null, arr); 1691 }; 1692}; 1693 1694 1695/***/ }), 1696
vendor: 2,719 bytes, lines 1697-1789
1697/***/ "./node_modules/axios/lib/helpers/validator.js": 1698/*!*****************************************************!*\ 1699 !*** ./node_modules/axios/lib/helpers/validator.js ***! 1700 \*****************************************************/ 1701/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1702 1703"use strict"; 1704 1705 1706var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version); 1707 1708var validators = {}; 1709 1710// eslint-disable-next-line func-names 1711['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { 1712 validators[type] = function validator(thing) { 1713 return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; 1714 }; 1715}); 1716 1717var deprecatedWarnings = {}; 1718 1719/** 1720 * Transitional option validator 1721 * @param {function|boolean?} validator - set to false if the transitional option has been removed 1722 * @param {string?} version - deprecated version / removed since version 1723 * @param {string?} message - some message with additional info 1724 * @returns {function} 1725 */ 1726validators.transitional = function transitional(validator, version, message) { 1727 function formatMessage(opt, desc) { 1728 return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); 1729 } 1730 1731 // eslint-disable-next-line func-names 1732 return function(value, opt, opts) { 1733 if (validator === false) { 1734 throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : ''))); 1735 } 1736 1737 if (version && !deprecatedWarnings[opt]) { 1738 deprecatedWarnings[opt] = true; 1739 // eslint-disable-next-line no-console 1740 console.warn( 1741 formatMessage( 1742 opt, 1743 ' has been deprecated since v' + version + ' and will be removed in the near future' 1744 ) 1745 ); 1746 } 1747 1748 return validator ? validator(value, opt, opts) : true; 1749 }; 1750}; 1751 1752/** 1753 * Assert object's properties type 1754 * @param {object} options 1755 * @param {object} schema 1756 * @param {boolean?} allowUnknown 1757 */ 1758 1759function assertOptions(options, schema, allowUnknown) { 1760 if (typeof options !== 'object') { 1761 throw new TypeError('options must be an object'); 1762 } 1763 var keys = Object.keys(options); 1764 var i = keys.length; 1765 while (i-- > 0) { 1766 var opt = keys[i]; 1767 var validator = schema[opt]; 1768 if (validator) { 1769 var value = options[opt]; 1770 var result = value === undefined || validator(value, opt, options); 1771 if (result !== true) { 1772 throw new TypeError('option ' + opt + ' must be ' + result); 1773 } 1774 continue; 1775 } 1776 if (allowUnknown !== true) { 1777 throw Error('Unknown option ' + opt); 1778 } 1779 } 1780} 1781 1782module.exports = { 1783 assertOptions: assertOptions, 1784 validators: validators 1785}; 1786 1787 1788/***/ }), 1789
vendor: 19,444 bytes, lines 1790-2388
1790/***/ "./node_modules/axios/lib/utils.js": 1791/*!*****************************************!*\ 1792 !*** ./node_modules/axios/lib/utils.js ***! 1793 \*****************************************/ 1794/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1795 1796"use strict"; 1797 1798 1799var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 1800 1801// utils is a library of generic helper functions non-specific to axios 1802 1803var toString = Object.prototype.toString; 1804 1805/** 1806 * Determine if a value is an Array 1807 * 1808 * @param {Object} val The value to test 1809 * @returns {boolean} True if value is an Array, otherwise false 1810 */ 1811function isArray(val) { 1812 return toString.call(val) === '[object Array]'; 1813} 1814 1815/** 1816 * Determine if a value is undefined 1817 * 1818 * @param {Object} val The value to test 1819 * @returns {boolean} True if the value is undefined, otherwise false 1820 */ 1821function isUndefined(val) { 1822 return typeof val === 'undefined'; 1823} 1824 1825/** 1826 * Determine if a value is a Buffer 1827 * 1828 * @param {Object} val The value to test 1829 * @returns {boolean} True if value is a Buffer, otherwise false 1830 */ 1831function isBuffer(val) { 1832 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) 1833 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); 1834} 1835 1836/** 1837 * Determine if a value is an ArrayBuffer 1838 * 1839 * @param {Object} val The value to test 1840 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 1841 */ 1842function isArrayBuffer(val) { 1843 return toString.call(val) === '[object ArrayBuffer]'; 1844} 1845 1846/** 1847 * Determine if a value is a FormData 1848 * 1849 * @param {Object} val The value to test 1850 * @returns {boolean} True if value is an FormData, otherwise false 1851 */ 1852function isFormData(val) { 1853 return (typeof FormData !== 'undefined') && (val instanceof FormData); 1854} 1855 1856/** 1857 * Determine if a value is a view on an ArrayBuffer 1858 * 1859 * @param {Object} val The value to test 1860 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 1861 */ 1862function isArrayBufferView(val) { 1863 var result; 1864 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 1865 result = ArrayBuffer.isView(val); 1866 } else { 1867 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); 1868 } 1869 return result; 1870} 1871 1872/** 1873 * Determine if a value is a String 1874 * 1875 * @param {Object} val The value to test 1876 * @returns {boolean} True if value is a String, otherwise false 1877 */ 1878function isString(val) { 1879 return typeof val === 'string'; 1880} 1881 1882/** 1883 * Determine if a value is a Number 1884 * 1885 * @param {Object} val The value to test 1886 * @returns {boolean} True if value is a Number, otherwise false 1887 */ 1888function isNumber(val) { 1889 return typeof val === 'number'; 1890} 1891 1892/** 1893 * Determine if a value is an Object 1894 * 1895 * @param {Object} val The value to test 1896 * @returns {boolean} True if value is an Object, otherwise false 1897 */ 1898function isObject(val) { 1899 return val !== null && typeof val === 'object'; 1900} 1901 1902/** 1903 * Determine if a value is a plain Object 1904 * 1905 * @param {Object} val The value to test 1906 * @return {boolean} True if value is a plain Object, otherwise false 1907 */ 1908function isPlainObject(val) { 1909 if (toString.call(val) !== '[object Object]') { 1910 return false; 1911 } 1912 1913 var prototype = Object.getPrototypeOf(val); 1914 return prototype === null || prototype === Object.prototype; 1915} 1916 1917/** 1918 * Determine if a value is a Date 1919 * 1920 * @param {Object} val The value to test 1921 * @returns {boolean} True if value is a Date, otherwise false 1922 */ 1923function isDate(val) { 1924 return toString.call(val) === '[object Date]'; 1925} 1926 1927/** 1928 * Determine if a value is a File 1929 * 1930 * @param {Object} val The value to test 1931 * @returns {boolean} True if value is a File, otherwise false 1932 */ 1933function isFile(val) { 1934 return toString.call(val) === '[object File]'; 1935} 1936 1937/** 1938 * Determine if a value is a Blob 1939 * 1940 * @param {Object} val The value to test 1941 * @returns {boolean} True if value is a Blob, otherwise false 1942 */ 1943function isBlob(val) { 1944 return toString.call(val) === '[object Blob]'; 1945} 1946 1947/** 1948 * Determine if a value is a Function 1949 * 1950 * @param {Object} val The value to test 1951 * @returns {boolean} True if value is a Function, otherwise false 1952 */ 1953function isFunction(val) { 1954 return toString.call(val) === '[object Function]'; 1955} 1956 1957/** 1958 * Determine if a value is a Stream 1959 * 1960 * @param {Object} val The value to test 1961 * @returns {boolean} True if value is a Stream, otherwise false 1962 */ 1963function isStream(val) { 1964 return isObject(val) && isFunction(val.pipe); 1965} 1966 1967/** 1968 * Determine if a value is a URLSearchParams object 1969 * 1970 * @param {Object} val The value to test 1971 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 1972 */ 1973function isURLSearchParams(val) { 1974 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; 1975} 1976 1977/** 1978 * Trim excess whitespace off the beginning and end of a string 1979 * 1980 * @param {String} str The String to trim 1981 * @returns {String} The String freed of excess whitespace 1982 */ 1983function trim(str) { 1984 return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); 1985} 1986 1987/** 1988 * Determine if we're running in a standard browser environment 1989 * 1990 * This allows axios to run in a web worker, and react-native. 1991 * Both environments support XMLHttpRequest, but not fully standard globals. 1992 * 1993 * web workers: 1994 * typeof window -> undefined 1995 * typeof document -> undefined 1996 * 1997 * react-native: 1998 * navigator.product -> 'ReactNative' 1999 * nativescript 2000 * navigator.product -> 'NativeScript' or 'NS' 2001 */ 2002function isStandardBrowserEnv() { 2003 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || 2004 navigator.product === 'NativeScript' || 2005 navigator.product === 'NS')) { 2006 return false; 2007 } 2008 return ( 2009 typeof window !== 'undefined' && 2010 typeof document !== 'undefined' 2011 ); 2012} 2013 2014/** 2015 * Iterate over an Array or an Object invoking a function for each item. 2016 * 2017 * If `obj` is an Array callback will be called passing 2018 * the value, index, and complete array for each item. 2019 * 2020 * If 'obj' is an Object callback will be called passing 2021 * the value, key, and complete object for each property. 2022 * 2023 * @param {Object|Array} obj The object to iterate 2024 * @param {Function} fn The callback to invoke for each item 2025 */ 2026function forEach(obj, fn) { 2027 // Don't bother if no value provided 2028 if (obj === null || typeof obj === 'undefined') { 2029 return; 2030 } 2031 2032 // Force an array if not already something iterable 2033 if (typeof obj !== 'object') { 2034 /*eslint no-param-reassign:0*/ 2035 obj = [obj]; 2036 } 2037 2038 if (isArray(obj)) { 2039 // Iterate over array values 2040 for (var i = 0, l = obj.length; i < l; i++) { 2041 fn.call(null, obj[i], i, obj); 2042 } 2043 } else { 2044 // Iterate over object keys 2045 for (var key in obj) { 2046 if (Object.prototype.hasOwnProperty.call(obj, key)) { 2047 fn.call(null, obj[key], key, obj); 2048 } 2049 } 2050 } 2051} 2052 2053/** 2054 * Accepts varargs expecting each argument to be an object, then 2055 * immutably merges the properties of each object and returns result. 2056 * 2057 * When multiple objects contain the same key the later object in 2058 * the arguments list will take precedence. 2059 * 2060 * Example: 2061 * 2062 * ```js 2063 * var result = merge({foo: 123}, {foo: 456}); 2064 * console.log(result.foo); // outputs 456 2065 * ``` 2066 * 2067 * @param {Object} obj1 Object to merge 2068 * @returns {Object} Result of all merge properties 2069 */ 2070function merge(/* obj1, obj2, obj3, ... */) { 2071 var result = {}; 2072 function assignValue(val, key) { 2073 if (isPlainObject(result[key]) && isPlainObject(val)) { 2074 result[key] = merge(result[key], val); 2075 } else if (isPlainObject(val)) { 2076 result[key] = merge({}, val); 2077 } else if (isArray(val)) { 2078 result[key] = val.slice(); 2079 } else { 2080 result[key] = val; 2081 } 2082 } 2083 2084 for (var i = 0, l = arguments.length; i < l; i++) { 2085 forEach(arguments[i], assignValue); 2086 } 2087 return result; 2088} 2089 2090/** 2091 * Extends object a by mutably adding to it the properties of object b. 2092 * 2093 * @param {Object} a The object to be extended 2094 * @param {Object} b The object to copy properties from 2095 * @param {Object} thisArg The object to bind function to 2096 * @return {Object} The resulting value of object a 2097 */ 2098function extend(a, b, thisArg) { 2099 forEach(b, function assignValue(val, key) { 2100 if (thisArg && typeof val === 'function') { 2101 a[key] = bind(val, thisArg); 2102 } else { 2103 a[key] = val; 2104 } 2105 }); 2106 return a; 2107} 2108 2109/** 2110 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 2111 * 2112 * @param {string} content with BOM 2113 * @return {string} content value without BOM 2114 */ 2115function stripBOM(content) { 2116 if (content.charCodeAt(0) === 0xFEFF) { 2117 content = content.slice(1); 2118 } 2119 return content; 2120} 2121 2122module.exports = { 2123 isArray: isArray, 2124 isArrayBuffer: isArrayBuffer, 2125 isBuffer: isBuffer, 2126 isFormData: isFormData, 2127 isArrayBufferView: isArrayBufferView, 2128 isString: isString, 2129 isNumber: isNumber, 2130 isObject: isObject, 2131 isPlainObject: isPlainObject, 2132 isUndefined: isUndefined, 2133 isDate: isDate, 2134 isFile: isFile, 2135 isBlob: isBlob, 2136 isFunction: isFunction, 2137 isStream: isStream, 2138 isURLSearchParams: isURLSearchParams, 2139 isStandardBrowserEnv: isStandardBrowserEnv, 2140 forEach: forEach, 2141 merge: merge, 2142 extend: extend, 2143 trim: trim, 2144 stripBOM: stripBOM 2145}; 2146 2147 2148/***/ }), 2149 2150/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js&": 2151/*!****************************************************************************************************************************************************************************************************************************!*\ 2152 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js& ***! 2153 \****************************************************************************************************************************************************************************************************************************/ 2154/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2155 2156"use strict"; 2157__webpack_require__.r(__webpack_exports__); 2158/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2159/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2160/* harmony export */ }); 2161// 2162// 2163// 2164// 2165/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 2166 data: function data() { 2167 return {}; 2168 }, 2169 mounted: function mounted() { 2170 var vm = this; 2171 vm.timer = setInterval(vm.next, 9000); 2172 vm.$slider = $('.js-mini-slider'); 2173 vm.$item = vm.$slider.find("li"); 2174 vm.$dots = $(".js-mini-slider-dots"); 2175 vm.$layerbox = $(".js-layerbox"); // Make the first slide active 2176 2177 vm.$item.first().addClass("active"); // Count and add nav dots 2178 2179 vm.$item.each(function () { 2180 vm.$dots.append("<li/>"); 2181 }); 2182 vm.$dots.find("li").first().addClass("active"); // Change slider on dot click 2183 2184 vm.$dots.find("li").click(function () { 2185 var $this = $(this); 2186 var $i = $this.index(); 2187 vm.next($i); 2188 }); 2189 vm.$slider.hover(function () { 2190 clearInterval(vm.timer); 2191 }, function () { 2192 vm.restartInterval(); 2193 }); 2194 }, 2195 methods: { 2196 next: function next($i) { 2197 var vm = this; 2198 2199 if ($i == null) { 2200 if (vm.$slider.find("li").last().hasClass("active")) { 2201 $i = 0; 2202 } else { 2203 $i = vm.$slider.find("li.active").next().index(); 2204 } 2205 } 2206 2207 var $this = vm.$item.eq($i); 2208 vm.$slider.fadeOut(200, function () { 2209 vm.$dots.find("li.active").removeClass("active"); 2210 vm.$dots.find("li").eq($i).addClass("active"); 2211 $this.addClass("active"); 2212 vm.$slider.find("li.active").removeClass("active"); 2213 vm.$item.eq($i).addClass("active"); 2214 vm.restartInterval(); 2215 vm.$slider.fadeIn(200); 2216 }); 2217 }, 2218 restartInterval: function restartInterval() { 2219 var vm = this; 2220 clearInterval(vm.timer); 2221 vm.timer = setInterval(vm.next, 9000); 2222 } 2223 } 2224}); 2225 2226/***/ }), 2227 2228/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js&": 2229/*!*************************************************************************************************************************************************************************************************************************!*\ 2230 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js& ***! 2231 \*************************************************************************************************************************************************************************************************************************/ 2232/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2233 2234"use strict"; 2235__webpack_require__.r(__webpack_exports__); 2236/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2237/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2238/* harmony export */ }); 2239/* harmony import */ var _Slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Slider */ "./user/themes/enormail/js/components/Slider.vue"); 2240// 2241// 2242// 2243// 2244 2245/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 2246 data: function data() { 2247 return { 2248 totalContacts: 2500, 2249 type: 'year', 2250 planLimits: { 2251 sumo: 2500, 2252 mammoet: 10000 2253 }, 2254 planPrices: { 2255 sumo: 15, 2256 mammoet: 60 2257 } 2258 }; 2259 }, 2260 computed: { 2261 priceSumo: function priceSumo() { 2262 var price = this.planPrices.sumo; 2263 2264 if (this.totalContacts > this.planLimits.sumo) { 2265 price = price + Math.ceil((this.totalContacts - this.planLimits.sumo) / 2500) * 5; 2266 } 2267 2268 return this.formatPrice(price); 2269 }, 2270 priceMammoet: function priceMammoet() { 2271 var price = this.planPrices.mammoet * 0.75; 2272 2273 if (this.totalContacts > this.planLimits.mammoet) { 2274 price = price + Math.ceil((this.totalContacts - this.planLimits.mammoet) / 2500) * 5; 2275 } 2276 2277 return this.formatPrice(price); 2278 }, 2279 priceOld: function priceOld() { 2280 var price = this.planPrices.mammoet; 2281 2282 if (this.totalContacts > this.planLimits.mammoet) { 2283 price = price + Math.ceil((this.totalContacts - this.planLimits.mammoet) / 2500) * 5; 2284 } 2285 2286 return this.formatPrice(price, true); 2287 } 2288 }, 2289 methods: { 2290 contactLimit: function contactLimit(account) { 2291 if (account === 'sumo') { 2292 var total = this.totalContacts > this.planLimits.sumo ? this.totalContacts : this.planLimits.sumo; 2293 return total.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1."); 2294 } 2295 2296 if (account === 'mammoet') { 2297 var _total = this.totalContacts > this.planLimits.mammoet ? this.totalContacts : this.planLimits.mammoet; 2298 2299 return _total.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1."); 2300 } 2301 }, 2302 formatPrice: function formatPrice(price, old) { 2303 if (this.type === 'year') { 2304 price = price * (old ? 12 : 10) / 12; 2305 } 2306 2307 return price.toFixed(2).replace('.', ',').replace(',00', ''); 2308 } 2309 }, 2310 components: { 2311 Slider: _Slider__WEBPACK_IMPORTED_MODULE_0__["default"] 2312 } 2313}); 2314 2315/***/ }), 2316 2317/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js&": 2318/*!*******************************************************************************************************************************************************************************************************************************!*\ 2319 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js& ***! 2320 \*******************************************************************************************************************************************************************************************************************************/ 2321/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2322 2323"use strict"; 2324__webpack_require__.r(__webpack_exports__); 2325/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2326/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2327/* harmony export */ }); 2328// 2329// 2330// 2331// 2332/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 2333 data: function data() { 2334 return {}; 2335 }, 2336 mounted: function mounted() { 2337 var vm = this; 2338 $(window).scroll(function () { 2339 if ($(document).scrollTop() > 100) { 2340 $('.main-header').addClass('u-cstm-box-shadow--narrow'); 2341 } else { 2342 $('.main-header').removeClass('u-cstm-box-shadow--narrow'); 2343 } 2344 }); 2345 } 2346}); 2347 2348/***/ }), 2349 2350/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js&": 2351/*!************************************************************************************************************************************************************************************************************************!*\ 2352 !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js& ***! 2353 \************************************************************************************************************************************************************************************************************************/ 2354/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2355 2356"use strict"; 2357__webpack_require__.r(__webpack_exports__); 2358/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2359/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 2360/* harmony export */ }); 2361/* harmony import */ var rangeslider_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rangeslider.js */ "./node_modules/rangeslider.js/dist/rangeslider.js"); 2362/* harmony import */ var rangeslider_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rangeslider_js__WEBPACK_IMPORTED_MODULE_0__); 2363// 2364// 2365// 2366// 2367 2368/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 2369 props: ['value'], 2370 mounted: function mounted() { 2371 var vm = this; 2372 $(this.$el).val(this.value).rangeslider({ 2373 polyfill: false, 2374 onInit: function onInit() { 2375 var total = this.value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1."); 2376 this.$handle.html('<div class="rangeslider__tooltip">' + total + '</div>'); 2377 this.$tooltip = this.$handle.find('.rangeslider__tooltip'); 2378 }, 2379 onSlide: function onSlide(position, value) { 2380 this.$tooltip.text(value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1.")); 2381 vm.$emit('input', value); 2382 } 2383 }); 2384 } 2385}); 2386 2387/***/ }), 2388
2389/***/ "./user/themes/enormail/js/app.js": 2390/*!****************************************!*\ 2391 !*** ./user/themes/enormail/js/app.js ***! 2392 \****************************************/ 2393/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2394 2395"use strict"; 2396__webpack_require__.r(__webpack_exports__); 2397/* harmony import */ var medium_zoom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! medium-zoom */ "./node_modules/medium-zoom/dist/medium-zoom.esm.js"); 2398/** 2399 * First we will load all of this project's JavaScript dependencies which 2400 * include Vue and Vue Resource. This gives a great starting point for 2401 * building robust, powerful web applications using Vue and Laravel. 2402 */ 2403__webpack_require__(/*! ./bootstrap */ "./user/themes/enormail/js/bootstrap.js"); 2404 2405__webpack_require__(/*! ./jg */ "./user/themes/enormail/js/jg.js"); 2406/** 2407 * Finally, we will create a fresh Vue application instance and attach it to 2408 * the body of the page. From here, you may begin adding components to 2409 * the application, or feel free to tweak this setup for your needs. 2410 */ 2411 2412 2413Vue.component('pricing', (__webpack_require__(/*! ./components/Pricing.vue */ "./user/themes/enormail/js/components/Pricing.vue")["default"])); 2414Vue.component('mini-slider', (__webpack_require__(/*! ./components/MiniSlider.vue */ "./user/themes/enormail/js/components/MiniSlider.vue")["default"])); 2415Vue.component('scroll-trigger', (__webpack_require__(/*! ./components/ScrollTrigger.vue */ "./user/themes/enormail/js/components/ScrollTrigger.vue")["default"])); 2416var app = new Vue({ 2417 el: '#app' 2418}); 2419/** 2420 * Load medium zoom 2421 */ 2422 2423 2424(0,medium_zoom__WEBPACK_IMPORTED_MODULE_0__["default"])(document.querySelectorAll('[data-zoomable]')); 2425 2426/***/ }), 2427
2428/***/ "./user/themes/enormail/js/bootstrap.js": 2429/*!**********************************************!*\ 2430 !*** ./user/themes/enormail/js/bootstrap.js ***! 2431 \**********************************************/ 2432/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 2433 2434/** 2435 * Load and setup lodash. 2436 */ 2437window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 2438/** 2439 * We'll load jQuery and the Bootstrap jQuery plugin which provides support 2440 * for JavaScript based Bootstrap features such as modals and tabs. This 2441 * code may be modified to fit the specific needs of your application. 2442 */ 2443 2444try { 2445 window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 2446 2447 __webpack_require__(/*! bootstrap-sass */ "./node_modules/bootstrap-sass/assets/javascripts/bootstrap.js"); 2448} catch (e) {} 2449/** 2450 * We'll load the axios HTTP library which allows us to easily issue requests 2451 * to our Laravel back-end. This library automatically handles sending the 2452 * CSRF token as a header based on the value of the "XSRF" token cookie. 2453 */ 2454 2455 2456window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); 2457window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 2458/** 2459 * Setup and load Vue. 2460 */ 2461 2462window.Vue = (__webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm.js")["default"]); 2463/** 2464 * Create a separate Vue instance for bus communication. 2465 */ 2466 2467window.Bus = new Vue(); 2468 2469/***/ }), 2470
2471/***/ "./user/themes/enormail/js/jg.js": 2472/*!***************************************!*\ 2473 !*** ./user/themes/enormail/js/jg.js ***! 2474 \***************************************/ 2475/***/ (() => { 2476 2477$(function () { 2478 var $attribute = $('[data-smart-affix-share]'); 2479 $attribute.each(function () { 2480 $(this).affix({ 2481 offset: { 2482 top: $(this).offset().top - 95 2483 } 2484 }); 2485 }); 2486 $(window).on("resize", function () { 2487 $attribute.each(function () { 2488 $(this).data('bs.affix').options.offset.top = $(this).offset().top; 2489 }); 2490 }); 2491}); 2492$(function () { 2493 var $attribute = $('[data-smart-affix-optin]'); 2494 $attribute.each(function () { 2495 $(this).affix({ 2496 offset: { 2497 top: $(this).offset().top + 1100 2498 } 2499 }); 2500 }); 2501 $(window).on("resize", function () { 2502 $attribute.each(function () { 2503 $(this).data('bs.affix').options.offset.top = $(this).offset().top; 2504 }); 2505 }); 2506}); 2507 2508/***/ }), 2509
vendor: 75,808 bytes, lines 2510-5099
2510/***/ "./node_modules/bootstrap-sass/assets/javascripts/bootstrap.js": 2511/*!*********************************************************************!*\ 2512 !*** ./node_modules/bootstrap-sass/assets/javascripts/bootstrap.js ***! 2513 \*********************************************************************/ 2514/***/ (() => { 2515 2516/*! 2517 * Bootstrap v3.4.1 (https://getbootstrap.com/) 2518 * Copyright 2011-2019 Twitter, Inc. 2519 * Licensed under the MIT license 2520 */ 2521 2522if (typeof jQuery === 'undefined') { 2523 throw new Error('Bootstrap\'s JavaScript requires jQuery') 2524} 2525 2526+function ($) { 2527 'use strict'; 2528 var version = $.fn.jquery.split(' ')[0].split('.') 2529 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { 2530 throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') 2531 } 2532}(jQuery); 2533 2534/* ======================================================================== 2535 * Bootstrap: transition.js v3.4.1 2536 * https://getbootstrap.com/docs/3.4/javascript/#transitions 2537 * ======================================================================== 2538 * Copyright 2011-2019 Twitter, Inc. 2539 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2540 * ======================================================================== */ 2541 2542 2543+function ($) { 2544 'use strict'; 2545 2546 // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/) 2547 // ============================================================ 2548 2549 function transitionEnd() { 2550 var el = document.createElement('bootstrap') 2551 2552 var transEndEventNames = { 2553 WebkitTransition : 'webkitTransitionEnd', 2554 MozTransition : 'transitionend', 2555 OTransition : 'oTransitionEnd otransitionend', 2556 transition : 'transitionend' 2557 } 2558 2559 for (var name in transEndEventNames) { 2560 if (el.style[name] !== undefined) { 2561 return { end: transEndEventNames[name] } 2562 } 2563 } 2564 2565 return false // explicit for ie8 ( ._.) 2566 } 2567 2568 // https://blog.alexmaccaw.com/css-transitions 2569 $.fn.emulateTransitionEnd = function (duration) { 2570 var called = false 2571 var $el = this 2572 $(this).one('bsTransitionEnd', function () { called = true }) 2573 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 2574 setTimeout(callback, duration) 2575 return this 2576 } 2577 2578 $(function () { 2579 $.support.transition = transitionEnd() 2580 2581 if (!$.support.transition) return 2582 2583 $.event.special.bsTransitionEnd = { 2584 bindType: $.support.transition.end, 2585 delegateType: $.support.transition.end, 2586 handle: function (e) { 2587 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 2588 } 2589 } 2590 }) 2591 2592}(jQuery); 2593 2594/* ======================================================================== 2595 * Bootstrap: alert.js v3.4.1 2596 * https://getbootstrap.com/docs/3.4/javascript/#alerts 2597 * ======================================================================== 2598 * Copyright 2011-2019 Twitter, Inc. 2599 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2600 * ======================================================================== */ 2601 2602 2603+function ($) { 2604 'use strict'; 2605 2606 // ALERT CLASS DEFINITION 2607 // ====================== 2608 2609 var dismiss = '[data-dismiss="alert"]' 2610 var Alert = function (el) { 2611 $(el).on('click', dismiss, this.close) 2612 } 2613 2614 Alert.VERSION = '3.4.1' 2615 2616 Alert.TRANSITION_DURATION = 150 2617 2618 Alert.prototype.close = function (e) { 2619 var $this = $(this) 2620 var selector = $this.attr('data-target') 2621 2622 if (!selector) { 2623 selector = $this.attr('href') 2624 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 2625 } 2626 2627 selector = selector === '#' ? [] : selector 2628 var $parent = $(document).find(selector) 2629 2630 if (e) e.preventDefault() 2631 2632 if (!$parent.length) { 2633 $parent = $this.closest('.alert') 2634 } 2635 2636 $parent.trigger(e = $.Event('close.bs.alert')) 2637 2638 if (e.isDefaultPrevented()) return 2639 2640 $parent.removeClass('in') 2641 2642 function removeElement() { 2643 // detach from parent, fire event then clean up data 2644 $parent.detach().trigger('closed.bs.alert').remove() 2645 } 2646 2647 $.support.transition && $parent.hasClass('fade') ? 2648 $parent 2649 .one('bsTransitionEnd', removeElement) 2650 .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 2651 removeElement() 2652 } 2653 2654 2655 // ALERT PLUGIN DEFINITION 2656 // ======================= 2657 2658 function Plugin(option) { 2659 return this.each(function () { 2660 var $this = $(this) 2661 var data = $this.data('bs.alert') 2662 2663 if (!data) $this.data('bs.alert', (data = new Alert(this))) 2664 if (typeof option == 'string') data[option].call($this) 2665 }) 2666 } 2667 2668 var old = $.fn.alert 2669 2670 $.fn.alert = Plugin 2671 $.fn.alert.Constructor = Alert 2672 2673 2674 // ALERT NO CONFLICT 2675 // ================= 2676 2677 $.fn.alert.noConflict = function () { 2678 $.fn.alert = old 2679 return this 2680 } 2681 2682 2683 // ALERT DATA-API 2684 // ============== 2685 2686 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 2687 2688}(jQuery); 2689 2690/* ======================================================================== 2691 * Bootstrap: button.js v3.4.1 2692 * https://getbootstrap.com/docs/3.4/javascript/#buttons 2693 * ======================================================================== 2694 * Copyright 2011-2019 Twitter, Inc. 2695 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2696 * ======================================================================== */ 2697 2698 2699+function ($) { 2700 'use strict'; 2701 2702 // BUTTON PUBLIC CLASS DEFINITION 2703 // ============================== 2704 2705 var Button = function (element, options) { 2706 this.$element = $(element) 2707 this.options = $.extend({}, Button.DEFAULTS, options) 2708 this.isLoading = false 2709 } 2710 2711 Button.VERSION = '3.4.1' 2712 2713 Button.DEFAULTS = { 2714 loadingText: 'loading...' 2715 } 2716 2717 Button.prototype.setState = function (state) { 2718 var d = 'disabled' 2719 var $el = this.$element 2720 var val = $el.is('input') ? 'val' : 'html' 2721 var data = $el.data() 2722 2723 state += 'Text' 2724 2725 if (data.resetText == null) $el.data('resetText', $el[val]()) 2726 2727 // push to event loop to allow forms to submit 2728 setTimeout($.proxy(function () { 2729 $el[val](data[state] == null ? this.options[state] : data[state]) 2730 2731 if (state == 'loadingText') { 2732 this.isLoading = true 2733 $el.addClass(d).attr(d, d).prop(d, true) 2734 } else if (this.isLoading) { 2735 this.isLoading = false 2736 $el.removeClass(d).removeAttr(d).prop(d, false) 2737 } 2738 }, this), 0) 2739 } 2740 2741 Button.prototype.toggle = function () { 2742 var changed = true 2743 var $parent = this.$element.closest('[data-toggle="buttons"]') 2744 2745 if ($parent.length) { 2746 var $input = this.$element.find('input') 2747 if ($input.prop('type') == 'radio') { 2748 if ($input.prop('checked')) changed = false 2749 $parent.find('.active').removeClass('active') 2750 this.$element.addClass('active') 2751 } else if ($input.prop('type') == 'checkbox') { 2752 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false 2753 this.$element.toggleClass('active') 2754 } 2755 $input.prop('checked', this.$element.hasClass('active')) 2756 if (changed) $input.trigger('change') 2757 } else { 2758 this.$element.attr('aria-pressed', !this.$element.hasClass('active')) 2759 this.$element.toggleClass('active') 2760 } 2761 } 2762 2763 2764 // BUTTON PLUGIN DEFINITION 2765 // ======================== 2766 2767 function Plugin(option) { 2768 return this.each(function () { 2769 var $this = $(this) 2770 var data = $this.data('bs.button') 2771 var options = typeof option == 'object' && option 2772 2773 if (!data) $this.data('bs.button', (data = new Button(this, options))) 2774 2775 if (option == 'toggle') data.toggle() 2776 else if (option) data.setState(option) 2777 }) 2778 } 2779 2780 var old = $.fn.button 2781 2782 $.fn.button = Plugin 2783 $.fn.button.Constructor = Button 2784 2785 2786 // BUTTON NO CONFLICT 2787 // ================== 2788 2789 $.fn.button.noConflict = function () { 2790 $.fn.button = old 2791 return this 2792 } 2793 2794 2795 // BUTTON DATA-API 2796 // =============== 2797 2798 $(document) 2799 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { 2800 var $btn = $(e.target).closest('.btn') 2801 Plugin.call($btn, 'toggle') 2802 if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { 2803 // Prevent double click on radios, and the double selections (so cancellation) on checkboxes 2804 e.preventDefault() 2805 // The target component still receive the focus 2806 if ($btn.is('input,button')) $btn.trigger('focus') 2807 else $btn.find('input:visible,button:visible').first().trigger('focus') 2808 } 2809 }) 2810 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { 2811 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) 2812 }) 2813 2814}(jQuery); 2815 2816/* ======================================================================== 2817 * Bootstrap: carousel.js v3.4.1 2818 * https://getbootstrap.com/docs/3.4/javascript/#carousel 2819 * ======================================================================== 2820 * Copyright 2011-2019 Twitter, Inc. 2821 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 2822 * ======================================================================== */ 2823 2824 2825+function ($) { 2826 'use strict'; 2827 2828 // CAROUSEL CLASS DEFINITION 2829 // ========================= 2830 2831 var Carousel = function (element, options) { 2832 this.$element = $(element) 2833 this.$indicators = this.$element.find('.carousel-indicators') 2834 this.options = options 2835 this.paused = null 2836 this.sliding = null 2837 this.interval = null 2838 this.$active = null 2839 this.$items = null 2840 2841 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) 2842 2843 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element 2844 .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) 2845 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) 2846 } 2847 2848 Carousel.VERSION = '3.4.1' 2849 2850 Carousel.TRANSITION_DURATION = 600 2851 2852 Carousel.DEFAULTS = { 2853 interval: 5000, 2854 pause: 'hover', 2855 wrap: true, 2856 keyboard: true 2857 } 2858 2859 Carousel.prototype.keydown = function (e) { 2860 if (/input|textarea/i.test(e.target.tagName)) return 2861 switch (e.which) { 2862 case 37: this.prev(); break 2863 case 39: this.next(); break 2864 default: return 2865 } 2866 2867 e.preventDefault() 2868 } 2869 2870 Carousel.prototype.cycle = function (e) { 2871 e || (this.paused = false) 2872 2873 this.interval && clearInterval(this.interval) 2874 2875 this.options.interval 2876 && !this.paused 2877 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 2878 2879 return this 2880 } 2881 2882 Carousel.prototype.getItemIndex = function (item) { 2883 this.$items = item.parent().children('.item') 2884 return this.$items.index(item || this.$active) 2885 } 2886 2887 Carousel.prototype.getItemForDirection = function (direction, active) { 2888 var activeIndex = this.getItemIndex(active) 2889 var willWrap = (direction == 'prev' && activeIndex === 0) 2890 || (direction == 'next' && activeIndex == (this.$items.length - 1)) 2891 if (willWrap && !this.options.wrap) return active 2892 var delta = direction == 'prev' ? -1 : 1 2893 var itemIndex = (activeIndex + delta) % this.$items.length 2894 return this.$items.eq(itemIndex) 2895 } 2896 2897 Carousel.prototype.to = function (pos) { 2898 var that = this 2899 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) 2900 2901 if (pos > (this.$items.length - 1) || pos < 0) return 2902 2903 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" 2904 if (activeIndex == pos) return this.pause().cycle() 2905 2906 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) 2907 } 2908 2909 Carousel.prototype.pause = function (e) { 2910 e || (this.paused = true) 2911 2912 if (this.$element.find('.next, .prev').length && $.support.transition) { 2913 this.$element.trigger($.support.transition.end) 2914 this.cycle(true) 2915 } 2916 2917 this.interval = clearInterval(this.interval) 2918 2919 return this 2920 } 2921 2922 Carousel.prototype.next = function () { 2923 if (this.sliding) return 2924 return this.slide('next') 2925 } 2926 2927 Carousel.prototype.prev = function () { 2928 if (this.sliding) return 2929 return this.slide('prev') 2930 } 2931 2932 Carousel.prototype.slide = function (type, next) { 2933 var $active = this.$element.find('.item.active') 2934 var $next = next || this.getItemForDirection(type, $active) 2935 var isCycling = this.interval 2936 var direction = type == 'next' ? 'left' : 'right' 2937 var that = this 2938 2939 if ($next.hasClass('active')) return (this.sliding = false) 2940 2941 var relatedTarget = $next[0] 2942 var slideEvent = $.Event('slide.bs.carousel', { 2943 relatedTarget: relatedTarget, 2944 direction: direction 2945 }) 2946 this.$element.trigger(slideEvent) 2947 if (slideEvent.isDefaultPrevented()) return 2948 2949 this.sliding = true 2950 2951 isCycling && this.pause() 2952 2953 if (this.$indicators.length) { 2954 this.$indicators.find('.active').removeClass('active') 2955 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) 2956 $nextIndicator && $nextIndicator.addClass('active') 2957 } 2958 2959 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" 2960 if ($.support.transition && this.$element.hasClass('slide')) { 2961 $next.addClass(type) 2962 if (typeof $next === 'object' && $next.length) { 2963 $next[0].offsetWidth // force reflow 2964 } 2965 $active.addClass(direction) 2966 $next.addClass(direction) 2967 $active 2968 .one('bsTransitionEnd', function () { 2969 $next.removeClass([type, direction].join(' ')).addClass('active') 2970 $active.removeClass(['active', direction].join(' ')) 2971 that.sliding = false 2972 setTimeout(function () { 2973 that.$element.trigger(slidEvent) 2974 }, 0) 2975 }) 2976 .emulateTransitionEnd(Carousel.TRANSITION_DURATION) 2977 } else { 2978 $active.removeClass('active') 2979 $next.addClass('active') 2980 this.sliding = false 2981 this.$element.trigger(slidEvent) 2982 } 2983 2984 isCycling && this.cycle() 2985 2986 return this 2987 } 2988 2989 2990 // CAROUSEL PLUGIN DEFINITION 2991 // ========================== 2992 2993 function Plugin(option) { 2994 return this.each(function () { 2995 var $this = $(this) 2996 var data = $this.data('bs.carousel') 2997 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) 2998 var action = typeof option == 'string' ? option : options.slide 2999 3000 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) 3001 if (typeof option == 'number') data.to(option) 3002 else if (action) data[action]() 3003 else if (options.interval) data.pause().cycle() 3004 }) 3005 } 3006 3007 var old = $.fn.carousel 3008 3009 $.fn.carousel = Plugin 3010 $.fn.carousel.Constructor = Carousel 3011 3012 3013 // CAROUSEL NO CONFLICT 3014 // ==================== 3015 3016 $.fn.carousel.noConflict = function () { 3017 $.fn.carousel = old 3018 return this 3019 } 3020 3021 3022 // CAROUSEL DATA-API 3023 // ================= 3024 3025 var clickHandler = function (e) { 3026 var $this = $(this) 3027 var href = $this.attr('href') 3028 if (href) { 3029 href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 3030 } 3031 3032 var target = $this.attr('data-target') || href 3033 var $target = $(document).find(target) 3034 3035 if (!$target.hasClass('carousel')) return 3036 3037 var options = $.extend({}, $target.data(), $this.data()) 3038 var slideIndex = $this.attr('data-slide-to') 3039 if (slideIndex) options.interval = false 3040 3041 Plugin.call($target, options) 3042 3043 if (slideIndex) { 3044 $target.data('bs.carousel').to(slideIndex) 3045 } 3046 3047 e.preventDefault() 3048 } 3049 3050 $(document) 3051 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) 3052 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) 3053 3054 $(window).on('load', function () { 3055 $('[data-ride="carousel"]').each(function () { 3056 var $carousel = $(this) 3057 Plugin.call($carousel, $carousel.data()) 3058 }) 3059 }) 3060 3061}(jQuery); 3062 3063/* ======================================================================== 3064 * Bootstrap: collapse.js v3.4.1 3065 * https://getbootstrap.com/docs/3.4/javascript/#collapse 3066 * ======================================================================== 3067 * Copyright 2011-2019 Twitter, Inc. 3068 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3069 * ======================================================================== */ 3070 3071/* jshint latedef: false */ 3072 3073+function ($) { 3074 'use strict'; 3075 3076 // COLLAPSE PUBLIC CLASS DEFINITION 3077 // ================================ 3078 3079 var Collapse = function (element, options) { 3080 this.$element = $(element) 3081 this.options = $.extend({}, Collapse.DEFAULTS, options) 3082 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + 3083 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 3084 this.transitioning = null 3085 3086 if (this.options.parent) { 3087 this.$parent = this.getParent() 3088 } else { 3089 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 3090 } 3091 3092 if (this.options.toggle) this.toggle() 3093 } 3094 3095 Collapse.VERSION = '3.4.1' 3096 3097 Collapse.TRANSITION_DURATION = 350 3098 3099 Collapse.DEFAULTS = { 3100 toggle: true 3101 } 3102 3103 Collapse.prototype.dimension = function () { 3104 var hasWidth = this.$element.hasClass('width') 3105 return hasWidth ? 'width' : 'height' 3106 } 3107 3108 Collapse.prototype.show = function () { 3109 if (this.transitioning || this.$element.hasClass('in')) return 3110 3111 var activesData 3112 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 3113 3114 if (actives && actives.length) { 3115 activesData = actives.data('bs.collapse') 3116 if (activesData && activesData.transitioning) return 3117 } 3118 3119 var startEvent = $.Event('show.bs.collapse') 3120 this.$element.trigger(startEvent) 3121 if (startEvent.isDefaultPrevented()) return 3122 3123 if (actives && actives.length) { 3124 Plugin.call(actives, 'hide') 3125 activesData || actives.data('bs.collapse', null) 3126 } 3127 3128 var dimension = this.dimension() 3129 3130 this.$element 3131 .removeClass('collapse') 3132 .addClass('collapsing')[dimension](0) 3133 .attr('aria-expanded', true) 3134 3135 this.$trigger 3136 .removeClass('collapsed') 3137 .attr('aria-expanded', true) 3138 3139 this.transitioning = 1 3140 3141 var complete = function () { 3142 this.$element 3143 .removeClass('collapsing') 3144 .addClass('collapse in')[dimension]('') 3145 this.transitioning = 0 3146 this.$element 3147 .trigger('shown.bs.collapse') 3148 } 3149 3150 if (!$.support.transition) return complete.call(this) 3151 3152 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 3153 3154 this.$element 3155 .one('bsTransitionEnd', $.proxy(complete, this)) 3156 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 3157 } 3158 3159 Collapse.prototype.hide = function () { 3160 if (this.transitioning || !this.$element.hasClass('in')) return 3161 3162 var startEvent = $.Event('hide.bs.collapse') 3163 this.$element.trigger(startEvent) 3164 if (startEvent.isDefaultPrevented()) return 3165 3166 var dimension = this.dimension() 3167 3168 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 3169 3170 this.$element 3171 .addClass('collapsing') 3172 .removeClass('collapse in') 3173 .attr('aria-expanded', false) 3174 3175 this.$trigger 3176 .addClass('collapsed') 3177 .attr('aria-expanded', false) 3178 3179 this.transitioning = 1 3180 3181 var complete = function () { 3182 this.transitioning = 0 3183 this.$element 3184 .removeClass('collapsing') 3185 .addClass('collapse') 3186 .trigger('hidden.bs.collapse') 3187 } 3188 3189 if (!$.support.transition) return complete.call(this) 3190 3191 this.$element 3192 [dimension](0) 3193 .one('bsTransitionEnd', $.proxy(complete, this)) 3194 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 3195 } 3196 3197 Collapse.prototype.toggle = function () { 3198 this[this.$element.hasClass('in') ? 'hide' : 'show']() 3199 } 3200 3201 Collapse.prototype.getParent = function () { 3202 return $(document).find(this.options.parent) 3203 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 3204 .each($.proxy(function (i, element) { 3205 var $element = $(element) 3206 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 3207 }, this)) 3208 .end() 3209 } 3210 3211 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 3212 var isOpen = $element.hasClass('in') 3213 3214 $element.attr('aria-expanded', isOpen) 3215 $trigger 3216 .toggleClass('collapsed', !isOpen) 3217 .attr('aria-expanded', isOpen) 3218 } 3219 3220 function getTargetFromTrigger($trigger) { 3221 var href 3222 var target = $trigger.attr('data-target') 3223 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 3224 3225 return $(document).find(target) 3226 } 3227 3228 3229 // COLLAPSE PLUGIN DEFINITION 3230 // ========================== 3231 3232 function Plugin(option) { 3233 return this.each(function () { 3234 var $this = $(this) 3235 var data = $this.data('bs.collapse') 3236 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 3237 3238 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 3239 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 3240 if (typeof option == 'string') data[option]() 3241 }) 3242 } 3243 3244 var old = $.fn.collapse 3245 3246 $.fn.collapse = Plugin 3247 $.fn.collapse.Constructor = Collapse 3248 3249 3250 // COLLAPSE NO CONFLICT 3251 // ==================== 3252 3253 $.fn.collapse.noConflict = function () { 3254 $.fn.collapse = old 3255 return this 3256 } 3257 3258 3259 // COLLAPSE DATA-API 3260 // ================= 3261 3262 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 3263 var $this = $(this) 3264 3265 if (!$this.attr('data-target')) e.preventDefault() 3266 3267 var $target = getTargetFromTrigger($this) 3268 var data = $target.data('bs.collapse') 3269 var option = data ? 'toggle' : $this.data() 3270 3271 Plugin.call($target, option) 3272 }) 3273 3274}(jQuery); 3275 3276/* ======================================================================== 3277 * Bootstrap: dropdown.js v3.4.1 3278 * https://getbootstrap.com/docs/3.4/javascript/#dropdowns 3279 * ======================================================================== 3280 * Copyright 2011-2019 Twitter, Inc. 3281 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3282 * ======================================================================== */ 3283 3284 3285+function ($) { 3286 'use strict'; 3287 3288 // DROPDOWN CLASS DEFINITION 3289 // ========================= 3290 3291 var backdrop = '.dropdown-backdrop' 3292 var toggle = '[data-toggle="dropdown"]' 3293 var Dropdown = function (element) { 3294 $(element).on('click.bs.dropdown', this.toggle) 3295 } 3296 3297 Dropdown.VERSION = '3.4.1' 3298 3299 function getParent($this) { 3300 var selector = $this.attr('data-target') 3301 3302 if (!selector) { 3303 selector = $this.attr('href') 3304 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 3305 } 3306 3307 var $parent = selector !== '#' ? $(document).find(selector) : null 3308 3309 return $parent && $parent.length ? $parent : $this.parent() 3310 } 3311 3312 function clearMenus(e) { 3313 if (e && e.which === 3) return 3314 $(backdrop).remove() 3315 $(toggle).each(function () { 3316 var $this = $(this) 3317 var $parent = getParent($this) 3318 var relatedTarget = { relatedTarget: this } 3319 3320 if (!$parent.hasClass('open')) return 3321 3322 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return 3323 3324 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 3325 3326 if (e.isDefaultPrevented()) return 3327 3328 $this.attr('aria-expanded', 'false') 3329 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) 3330 }) 3331 } 3332 3333 Dropdown.prototype.toggle = function (e) { 3334 var $this = $(this) 3335 3336 if ($this.is('.disabled, :disabled')) return 3337 3338 var $parent = getParent($this) 3339 var isActive = $parent.hasClass('open') 3340 3341 clearMenus() 3342 3343 if (!isActive) { 3344 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 3345 // if mobile we use a backdrop because click events don't delegate 3346 $(document.createElement('div')) 3347 .addClass('dropdown-backdrop') 3348 .insertAfter($(this)) 3349 .on('click', clearMenus) 3350 } 3351 3352 var relatedTarget = { relatedTarget: this } 3353 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 3354 3355 if (e.isDefaultPrevented()) return 3356 3357 $this 3358 .trigger('focus') 3359 .attr('aria-expanded', 'true') 3360 3361 $parent 3362 .toggleClass('open') 3363 .trigger($.Event('shown.bs.dropdown', relatedTarget)) 3364 } 3365 3366 return false 3367 } 3368 3369 Dropdown.prototype.keydown = function (e) { 3370 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return 3371 3372 var $this = $(this) 3373 3374 e.preventDefault() 3375 e.stopPropagation() 3376 3377 if ($this.is('.disabled, :disabled')) return 3378 3379 var $parent = getParent($this) 3380 var isActive = $parent.hasClass('open') 3381 3382 if (!isActive && e.which != 27 || isActive && e.which == 27) { 3383 if (e.which == 27) $parent.find(toggle).trigger('focus') 3384 return $this.trigger('click') 3385 } 3386 3387 var desc = ' li:not(.disabled):visible a' 3388 var $items = $parent.find('.dropdown-menu' + desc) 3389 3390 if (!$items.length) return 3391 3392 var index = $items.index(e.target) 3393 3394 if (e.which == 38 && index > 0) index-- // up 3395 if (e.which == 40 && index < $items.length - 1) index++ // down 3396 if (!~index) index = 0 3397 3398 $items.eq(index).trigger('focus') 3399 } 3400 3401 3402 // DROPDOWN PLUGIN DEFINITION 3403 // ========================== 3404 3405 function Plugin(option) { 3406 return this.each(function () { 3407 var $this = $(this) 3408 var data = $this.data('bs.dropdown') 3409 3410 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 3411 if (typeof option == 'string') data[option].call($this) 3412 }) 3413 } 3414 3415 var old = $.fn.dropdown 3416 3417 $.fn.dropdown = Plugin 3418 $.fn.dropdown.Constructor = Dropdown 3419 3420 3421 // DROPDOWN NO CONFLICT 3422 // ==================== 3423 3424 $.fn.dropdown.noConflict = function () { 3425 $.fn.dropdown = old 3426 return this 3427 } 3428 3429 3430 // APPLY TO STANDARD DROPDOWN ELEMENTS 3431 // =================================== 3432 3433 $(document) 3434 .on('click.bs.dropdown.data-api', clearMenus) 3435 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 3436 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 3437 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 3438 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 3439 3440}(jQuery); 3441 3442/* ======================================================================== 3443 * Bootstrap: modal.js v3.4.1 3444 * https://getbootstrap.com/docs/3.4/javascript/#modals 3445 * ======================================================================== 3446 * Copyright 2011-2019 Twitter, Inc. 3447 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3448 * ======================================================================== */ 3449 3450 3451+function ($) { 3452 'use strict'; 3453 3454 // MODAL CLASS DEFINITION 3455 // ====================== 3456 3457 var Modal = function (element, options) { 3458 this.options = options 3459 this.$body = $(document.body) 3460 this.$element = $(element) 3461 this.$dialog = this.$element.find('.modal-dialog') 3462 this.$backdrop = null 3463 this.isShown = null 3464 this.originalBodyPad = null 3465 this.scrollbarWidth = 0 3466 this.ignoreBackdropClick = false 3467 this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom' 3468 3469 if (this.options.remote) { 3470 this.$element 3471 .find('.modal-content') 3472 .load(this.options.remote, $.proxy(function () { 3473 this.$element.trigger('loaded.bs.modal') 3474 }, this)) 3475 } 3476 } 3477 3478 Modal.VERSION = '3.4.1' 3479 3480 Modal.TRANSITION_DURATION = 300 3481 Modal.BACKDROP_TRANSITION_DURATION = 150 3482 3483 Modal.DEFAULTS = { 3484 backdrop: true, 3485 keyboard: true, 3486 show: true 3487 } 3488 3489 Modal.prototype.toggle = function (_relatedTarget) { 3490 return this.isShown ? this.hide() : this.show(_relatedTarget) 3491 } 3492 3493 Modal.prototype.show = function (_relatedTarget) { 3494 var that = this 3495 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 3496 3497 this.$element.trigger(e) 3498 3499 if (this.isShown || e.isDefaultPrevented()) return 3500 3501 this.isShown = true 3502 3503 this.checkScrollbar() 3504 this.setScrollbar() 3505 this.$body.addClass('modal-open') 3506 3507 this.escape() 3508 this.resize() 3509 3510 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 3511 3512 this.$dialog.on('mousedown.dismiss.bs.modal', function () { 3513 that.$element.one('mouseup.dismiss.bs.modal', function (e) { 3514 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true 3515 }) 3516 }) 3517 3518 this.backdrop(function () { 3519 var transition = $.support.transition && that.$element.hasClass('fade') 3520 3521 if (!that.$element.parent().length) { 3522 that.$element.appendTo(that.$body) // don't move modals dom position 3523 } 3524 3525 that.$element 3526 .show() 3527 .scrollTop(0) 3528 3529 that.adjustDialog() 3530 3531 if (transition) { 3532 that.$element[0].offsetWidth // force reflow 3533 } 3534 3535 that.$element.addClass('in') 3536 3537 that.enforceFocus() 3538 3539 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 3540 3541 transition ? 3542 that.$dialog // wait for modal to slide in 3543 .one('bsTransitionEnd', function () { 3544 that.$element.trigger('focus').trigger(e) 3545 }) 3546 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 3547 that.$element.trigger('focus').trigger(e) 3548 }) 3549 } 3550 3551 Modal.prototype.hide = function (e) { 3552 if (e) e.preventDefault() 3553 3554 e = $.Event('hide.bs.modal') 3555 3556 this.$element.trigger(e) 3557 3558 if (!this.isShown || e.isDefaultPrevented()) return 3559 3560 this.isShown = false 3561 3562 this.escape() 3563 this.resize() 3564 3565 $(document).off('focusin.bs.modal') 3566 3567 this.$element 3568 .removeClass('in') 3569 .off('click.dismiss.bs.modal') 3570 .off('mouseup.dismiss.bs.modal') 3571 3572 this.$dialog.off('mousedown.dismiss.bs.modal') 3573 3574 $.support.transition && this.$element.hasClass('fade') ? 3575 this.$element 3576 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 3577 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 3578 this.hideModal() 3579 } 3580 3581 Modal.prototype.enforceFocus = function () { 3582 $(document) 3583 .off('focusin.bs.modal') // guard against infinite focus loop 3584 .on('focusin.bs.modal', $.proxy(function (e) { 3585 if (document !== e.target && 3586 this.$element[0] !== e.target && 3587 !this.$element.has(e.target).length) { 3588 this.$element.trigger('focus') 3589 } 3590 }, this)) 3591 } 3592 3593 Modal.prototype.escape = function () { 3594 if (this.isShown && this.options.keyboard) { 3595 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 3596 e.which == 27 && this.hide() 3597 }, this)) 3598 } else if (!this.isShown) { 3599 this.$element.off('keydown.dismiss.bs.modal') 3600 } 3601 } 3602 3603 Modal.prototype.resize = function () { 3604 if (this.isShown) { 3605 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) 3606 } else { 3607 $(window).off('resize.bs.modal') 3608 } 3609 } 3610 3611 Modal.prototype.hideModal = function () { 3612 var that = this 3613 this.$element.hide() 3614 this.backdrop(function () { 3615 that.$body.removeClass('modal-open') 3616 that.resetAdjustments() 3617 that.resetScrollbar() 3618 that.$element.trigger('hidden.bs.modal') 3619 }) 3620 } 3621 3622 Modal.prototype.removeBackdrop = function () { 3623 this.$backdrop && this.$backdrop.remove() 3624 this.$backdrop = null 3625 } 3626 3627 Modal.prototype.backdrop = function (callback) { 3628 var that = this 3629 var animate = this.$element.hasClass('fade') ? 'fade' : '' 3630 3631 if (this.isShown && this.options.backdrop) { 3632 var doAnimate = $.support.transition && animate 3633 3634 this.$backdrop = $(document.createElement('div')) 3635 .addClass('modal-backdrop ' + animate) 3636 .appendTo(this.$body) 3637 3638 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 3639 if (this.ignoreBackdropClick) { 3640 this.ignoreBackdropClick = false 3641 return 3642 } 3643 if (e.target !== e.currentTarget) return 3644 this.options.backdrop == 'static' 3645 ? this.$element[0].focus() 3646 : this.hide() 3647 }, this)) 3648 3649 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 3650 3651 this.$backdrop.addClass('in') 3652 3653 if (!callback) return 3654 3655 doAnimate ? 3656 this.$backdrop 3657 .one('bsTransitionEnd', callback) 3658 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 3659 callback() 3660 3661 } else if (!this.isShown && this.$backdrop) { 3662 this.$backdrop.removeClass('in') 3663 3664 var callbackRemove = function () { 3665 that.removeBackdrop() 3666 callback && callback() 3667 } 3668 $.support.transition && this.$element.hasClass('fade') ? 3669 this.$backdrop 3670 .one('bsTransitionEnd', callbackRemove) 3671 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 3672 callbackRemove() 3673 3674 } else if (callback) { 3675 callback() 3676 } 3677 } 3678 3679 // these following methods are used to handle overflowing modals 3680 3681 Modal.prototype.handleUpdate = function () { 3682 this.adjustDialog() 3683 } 3684 3685 Modal.prototype.adjustDialog = function () { 3686 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight 3687 3688 this.$element.css({ 3689 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', 3690 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' 3691 }) 3692 } 3693 3694 Modal.prototype.resetAdjustments = function () { 3695 this.$element.css({ 3696 paddingLeft: '', 3697 paddingRight: '' 3698 }) 3699 } 3700 3701 Modal.prototype.checkScrollbar = function () { 3702 var fullWindowWidth = window.innerWidth 3703 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 3704 var documentElementRect = document.documentElement.getBoundingClientRect() 3705 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) 3706 } 3707 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth 3708 this.scrollbarWidth = this.measureScrollbar() 3709 } 3710 3711 Modal.prototype.setScrollbar = function () { 3712 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 3713 this.originalBodyPad = document.body.style.paddingRight || '' 3714 var scrollbarWidth = this.scrollbarWidth 3715 if (this.bodyIsOverflowing) { 3716 this.$body.css('padding-right', bodyPad + scrollbarWidth) 3717 $(this.fixedContent).each(function (index, element) { 3718 var actualPadding = element.style.paddingRight 3719 var calculatedPadding = $(element).css('padding-right') 3720 $(element) 3721 .data('padding-right', actualPadding) 3722 .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px') 3723 }) 3724 } 3725 } 3726 3727 Modal.prototype.resetScrollbar = function () { 3728 this.$body.css('padding-right', this.originalBodyPad) 3729 $(this.fixedContent).each(function (index, element) { 3730 var padding = $(element).data('padding-right') 3731 $(element).removeData('padding-right') 3732 element.style.paddingRight = padding ? padding : '' 3733 }) 3734 } 3735 3736 Modal.prototype.measureScrollbar = function () { // thx walsh 3737 var scrollDiv = document.createElement('div') 3738 scrollDiv.className = 'modal-scrollbar-measure' 3739 this.$body.append(scrollDiv) 3740 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 3741 this.$body[0].removeChild(scrollDiv) 3742 return scrollbarWidth 3743 } 3744 3745 3746 // MODAL PLUGIN DEFINITION 3747 // ======================= 3748 3749 function Plugin(option, _relatedTarget) { 3750 return this.each(function () { 3751 var $this = $(this) 3752 var data = $this.data('bs.modal') 3753 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 3754 3755 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 3756 if (typeof option == 'string') data[option](_relatedTarget) 3757 else if (options.show) data.show(_relatedTarget) 3758 }) 3759 } 3760 3761 var old = $.fn.modal 3762 3763 $.fn.modal = Plugin 3764 $.fn.modal.Constructor = Modal 3765 3766 3767 // MODAL NO CONFLICT 3768 // ================= 3769 3770 $.fn.modal.noConflict = function () { 3771 $.fn.modal = old 3772 return this 3773 } 3774 3775 3776 // MODAL DATA-API 3777 // ============== 3778 3779 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 3780 var $this = $(this) 3781 var href = $this.attr('href') 3782 var target = $this.attr('data-target') || 3783 (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 3784 3785 var $target = $(document).find(target) 3786 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 3787 3788 if ($this.is('a')) e.preventDefault() 3789 3790 $target.one('show.bs.modal', function (showEvent) { 3791 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown 3792 $target.one('hidden.bs.modal', function () { 3793 $this.is(':visible') && $this.trigger('focus') 3794 }) 3795 }) 3796 Plugin.call($target, option, this) 3797 }) 3798 3799}(jQuery); 3800 3801/* ======================================================================== 3802 * Bootstrap: tooltip.js v3.4.1 3803 * https://getbootstrap.com/docs/3.4/javascript/#tooltip 3804 * Inspired by the original jQuery.tipsy by Jason Frame 3805 * ======================================================================== 3806 * Copyright 2011-2019 Twitter, Inc. 3807 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3808 * ======================================================================== */ 3809 3810+function ($) { 3811 'use strict'; 3812 3813 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'] 3814 3815 var uriAttrs = [ 3816 'background', 3817 'cite', 3818 'href', 3819 'itemtype', 3820 'longdesc', 3821 'poster', 3822 'src', 3823 'xlink:href' 3824 ] 3825 3826 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i 3827 3828 var DefaultWhitelist = { 3829 // Global attributes allowed on any supplied element below. 3830 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 3831 a: ['target', 'href', 'title', 'rel'], 3832 area: [], 3833 b: [], 3834 br: [], 3835 col: [], 3836 code: [], 3837 div: [], 3838 em: [], 3839 hr: [], 3840 h1: [], 3841 h2: [], 3842 h3: [], 3843 h4: [], 3844 h5: [], 3845 h6: [], 3846 i: [], 3847 img: ['src', 'alt', 'title', 'width', 'height'], 3848 li: [], 3849 ol: [], 3850 p: [], 3851 pre: [], 3852 s: [], 3853 small: [], 3854 span: [], 3855 sub: [], 3856 sup: [], 3857 strong: [], 3858 u: [], 3859 ul: [] 3860 } 3861 3862 /** 3863 * A pattern that recognizes a commonly useful subset of URLs that are safe. 3864 * 3865 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3866 */ 3867 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi 3868 3869 /** 3870 * A pattern that matches safe data URLs. Only matches image, video and audio types. 3871 * 3872 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3873 */ 3874 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i 3875 3876 function allowedAttribute(attr, allowedAttributeList) { 3877 var attrName = attr.nodeName.toLowerCase() 3878 3879 if ($.inArray(attrName, allowedAttributeList) !== -1) { 3880 if ($.inArray(attrName, uriAttrs) !== -1) { 3881 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)) 3882 } 3883 3884 return true 3885 } 3886 3887 var regExp = $(allowedAttributeList).filter(function (index, value) { 3888 return value instanceof RegExp 3889 }) 3890 3891 // Check if a regular expression validates the attribute. 3892 for (var i = 0, l = regExp.length; i < l; i++) { 3893 if (attrName.match(regExp[i])) { 3894 return true 3895 } 3896 } 3897 3898 return false 3899 } 3900 3901 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 3902 if (unsafeHtml.length === 0) { 3903 return unsafeHtml 3904 } 3905 3906 if (sanitizeFn && typeof sanitizeFn === 'function') { 3907 return sanitizeFn(unsafeHtml) 3908 } 3909 3910 // IE 8 and below don't support createHTMLDocument 3911 if (!document.implementation || !document.implementation.createHTMLDocument) { 3912 return unsafeHtml 3913 } 3914 3915 var createdDocument = document.implementation.createHTMLDocument('sanitization') 3916 createdDocument.body.innerHTML = unsafeHtml 3917 3918 var whitelistKeys = $.map(whiteList, function (el, i) { return i }) 3919 var elements = $(createdDocument.body).find('*') 3920 3921 for (var i = 0, len = elements.length; i < len; i++) { 3922 var el = elements[i] 3923 var elName = el.nodeName.toLowerCase() 3924 3925 if ($.inArray(elName, whitelistKeys) === -1) { 3926 el.parentNode.removeChild(el) 3927 3928 continue 3929 } 3930 3931 var attributeList = $.map(el.attributes, function (el) { return el }) 3932 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []) 3933 3934 for (var j = 0, len2 = attributeList.length; j < len2; j++) { 3935 if (!allowedAttribute(attributeList[j], whitelistedAttributes)) { 3936 el.removeAttribute(attributeList[j].nodeName) 3937 } 3938 } 3939 } 3940 3941 return createdDocument.body.innerHTML 3942 } 3943 3944 // TOOLTIP PUBLIC CLASS DEFINITION 3945 // =============================== 3946 3947 var Tooltip = function (element, options) { 3948 this.type = null 3949 this.options = null 3950 this.enabled = null 3951 this.timeout = null 3952 this.hoverState = null 3953 this.$element = null 3954 this.inState = null 3955 3956 this.init('tooltip', element, options) 3957 } 3958 3959 Tooltip.VERSION = '3.4.1' 3960 3961 Tooltip.TRANSITION_DURATION = 150 3962 3963 Tooltip.DEFAULTS = { 3964 animation: true, 3965 placement: 'top', 3966 selector: false, 3967 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 3968 trigger: 'hover focus', 3969 title: '', 3970 delay: 0, 3971 html: false, 3972 container: false, 3973 viewport: { 3974 selector: 'body', 3975 padding: 0 3976 }, 3977 sanitize : true, 3978 sanitizeFn : null, 3979 whiteList : DefaultWhitelist 3980 } 3981 3982 Tooltip.prototype.init = function (type, element, options) { 3983 this.enabled = true 3984 this.type = type 3985 this.$element = $(element) 3986 this.options = this.getOptions(options) 3987 this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 3988 this.inState = { click: false, hover: false, focus: false } 3989 3990 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 3991 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 3992 } 3993 3994 var triggers = this.options.trigger.split(' ') 3995 3996 for (var i = triggers.length; i--;) { 3997 var trigger = triggers[i] 3998 3999 if (trigger == 'click') { 4000 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 4001 } else if (trigger != 'manual') { 4002 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 4003 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 4004 4005 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 4006 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 4007 } 4008 } 4009 4010 this.options.selector ? 4011 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 4012 this.fixTitle() 4013 } 4014 4015 Tooltip.prototype.getDefaults = function () { 4016 return Tooltip.DEFAULTS 4017 } 4018 4019 Tooltip.prototype.getOptions = function (options) { 4020 var dataAttributes = this.$element.data() 4021 4022 for (var dataAttr in dataAttributes) { 4023 if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { 4024 delete dataAttributes[dataAttr] 4025 } 4026 } 4027 4028 options = $.extend({}, this.getDefaults(), dataAttributes, options) 4029 4030 if (options.delay && typeof options.delay == 'number') { 4031 options.delay = { 4032 show: options.delay, 4033 hide: options.delay 4034 } 4035 } 4036 4037 if (options.sanitize) { 4038 options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn) 4039 } 4040 4041 return options 4042 } 4043 4044 Tooltip.prototype.getDelegateOptions = function () { 4045 var options = {} 4046 var defaults = this.getDefaults() 4047 4048 this._options && $.each(this._options, function (key, value) { 4049 if (defaults[key] != value) options[key] = value 4050 }) 4051 4052 return options 4053 } 4054 4055 Tooltip.prototype.enter = function (obj) { 4056 var self = obj instanceof this.constructor ? 4057 obj : $(obj.currentTarget).data('bs.' + this.type) 4058 4059 if (!self) { 4060 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 4061 $(obj.currentTarget).data('bs.' + this.type, self) 4062 } 4063 4064 if (obj instanceof $.Event) { 4065 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 4066 } 4067 4068 if (self.tip().hasClass('in') || self.hoverState == 'in') { 4069 self.hoverState = 'in' 4070 return 4071 } 4072 4073 clearTimeout(self.timeout) 4074 4075 self.hoverState = 'in' 4076 4077 if (!self.options.delay || !self.options.delay.show) return self.show() 4078 4079 self.timeout = setTimeout(function () { 4080 if (self.hoverState == 'in') self.show() 4081 }, self.options.delay.show) 4082 } 4083 4084 Tooltip.prototype.isInStateTrue = function () { 4085 for (var key in this.inState) { 4086 if (this.inState[key]) return true 4087 } 4088 4089 return false 4090 } 4091 4092 Tooltip.prototype.leave = function (obj) { 4093 var self = obj instanceof this.constructor ? 4094 obj : $(obj.currentTarget).data('bs.' + this.type) 4095 4096 if (!self) { 4097 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 4098 $(obj.currentTarget).data('bs.' + this.type, self) 4099 } 4100 4101 if (obj instanceof $.Event) { 4102 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 4103 } 4104 4105 if (self.isInStateTrue()) return 4106 4107 clearTimeout(self.timeout) 4108 4109 self.hoverState = 'out' 4110 4111 if (!self.options.delay || !self.options.delay.hide) return self.hide() 4112 4113 self.timeout = setTimeout(function () { 4114 if (self.hoverState == 'out') self.hide() 4115 }, self.options.delay.hide) 4116 } 4117 4118 Tooltip.prototype.show = function () { 4119 var e = $.Event('show.bs.' + this.type) 4120 4121 if (this.hasContent() && this.enabled) { 4122 this.$element.trigger(e) 4123 4124 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 4125 if (e.isDefaultPrevented() || !inDom) return 4126 var that = this 4127 4128 var $tip = this.tip() 4129 4130 var tipId = this.getUID(this.type) 4131 4132 this.setContent() 4133 $tip.attr('id', tipId) 4134 this.$element.attr('aria-describedby', tipId) 4135 4136 if (this.options.animation) $tip.addClass('fade') 4137 4138 var placement = typeof this.options.placement == 'function' ? 4139 this.options.placement.call(this, $tip[0], this.$element[0]) : 4140 this.options.placement 4141 4142 var autoToken = /\s?auto?\s?/i 4143 var autoPlace = autoToken.test(placement) 4144 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 4145 4146 $tip 4147 .detach() 4148 .css({ top: 0, left: 0, display: 'block' }) 4149 .addClass(placement) 4150 .data('bs.' + this.type, this) 4151 4152 this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element) 4153 this.$element.trigger('inserted.bs.' + this.type) 4154 4155 var pos = this.getPosition() 4156 var actualWidth = $tip[0].offsetWidth 4157 var actualHeight = $tip[0].offsetHeight 4158 4159 if (autoPlace) { 4160 var orgPlacement = placement 4161 var viewportDim = this.getPosition(this.$viewport) 4162 4163 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 4164 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 4165 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 4166 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 4167 placement 4168 4169 $tip 4170 .removeClass(orgPlacement) 4171 .addClass(placement) 4172 } 4173 4174 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 4175 4176 this.applyPlacement(calculatedOffset, placement) 4177 4178 var complete = function () { 4179 var prevHoverState = that.hoverState 4180 that.$element.trigger('shown.bs.' + that.type) 4181 that.hoverState = null 4182 4183 if (prevHoverState == 'out') that.leave(that) 4184 } 4185 4186 $.support.transition && this.$tip.hasClass('fade') ? 4187 $tip 4188 .one('bsTransitionEnd', complete) 4189 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 4190 complete() 4191 } 4192 } 4193 4194 Tooltip.prototype.applyPlacement = function (offset, placement) { 4195 var $tip = this.tip() 4196 var width = $tip[0].offsetWidth 4197 var height = $tip[0].offsetHeight 4198 4199 // manually read margins because getBoundingClientRect includes difference 4200 var marginTop = parseInt($tip.css('margin-top'), 10) 4201 var marginLeft = parseInt($tip.css('margin-left'), 10) 4202 4203 // we must check for NaN for ie 8/9 4204 if (isNaN(marginTop)) marginTop = 0 4205 if (isNaN(marginLeft)) marginLeft = 0 4206 4207 offset.top += marginTop 4208 offset.left += marginLeft 4209 4210 // $.fn.offset doesn't round pixel values 4211 // so we use setOffset directly with our own function B-0 4212 $.offset.setOffset($tip[0], $.extend({ 4213 using: function (props) { 4214 $tip.css({ 4215 top: Math.round(props.top), 4216 left: Math.round(props.left) 4217 }) 4218 } 4219 }, offset), 0) 4220 4221 $tip.addClass('in') 4222 4223 // check to see if placing tip in new offset caused the tip to resize itself 4224 var actualWidth = $tip[0].offsetWidth 4225 var actualHeight = $tip[0].offsetHeight 4226 4227 if (placement == 'top' && actualHeight != height) { 4228 offset.top = offset.top + height - actualHeight 4229 } 4230 4231 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 4232 4233 if (delta.left) offset.left += delta.left 4234 else offset.top += delta.top 4235 4236 var isVertical = /top|bottom/.test(placement) 4237 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 4238 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 4239 4240 $tip.offset(offset) 4241 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 4242 } 4243 4244 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 4245 this.arrow() 4246 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 4247 .css(isVertical ? 'top' : 'left', '') 4248 } 4249 4250 Tooltip.prototype.setContent = function () { 4251 var $tip = this.tip() 4252 var title = this.getTitle() 4253 4254 if (this.options.html) { 4255 if (this.options.sanitize) { 4256 title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn) 4257 } 4258 4259 $tip.find('.tooltip-inner').html(title) 4260 } else { 4261 $tip.find('.tooltip-inner').text(title) 4262 } 4263 4264 $tip.removeClass('fade in top bottom left right') 4265 } 4266 4267 Tooltip.prototype.hide = function (callback) { 4268 var that = this 4269 var $tip = $(this.$tip) 4270 var e = $.Event('hide.bs.' + this.type) 4271 4272 function complete() { 4273 if (that.hoverState != 'in') $tip.detach() 4274 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 4275 that.$element 4276 .removeAttr('aria-describedby') 4277 .trigger('hidden.bs.' + that.type) 4278 } 4279 callback && callback() 4280 } 4281 4282 this.$element.trigger(e) 4283 4284 if (e.isDefaultPrevented()) return 4285 4286 $tip.removeClass('in') 4287 4288 $.support.transition && $tip.hasClass('fade') ? 4289 $tip 4290 .one('bsTransitionEnd', complete) 4291 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 4292 complete() 4293 4294 this.hoverState = null 4295 4296 return this 4297 } 4298 4299 Tooltip.prototype.fixTitle = function () { 4300 var $e = this.$element 4301 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 4302 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 4303 } 4304 } 4305 4306 Tooltip.prototype.hasContent = function () { 4307 return this.getTitle() 4308 } 4309 4310 Tooltip.prototype.getPosition = function ($element) { 4311 $element = $element || this.$element 4312 4313 var el = $element[0] 4314 var isBody = el.tagName == 'BODY' 4315 4316 var elRect = el.getBoundingClientRect() 4317 if (elRect.width == null) { 4318 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 4319 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 4320 } 4321 var isSvg = window.SVGElement && el instanceof window.SVGElement 4322 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 4323 // See https://github.com/twbs/bootstrap/issues/20280 4324 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 4325 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 4326 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 4327 4328 return $.extend({}, elRect, scroll, outerDims, elOffset) 4329 } 4330 4331 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 4332 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 4333 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 4334 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 4335 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 4336 4337 } 4338 4339 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 4340 var delta = { top: 0, left: 0 } 4341 if (!this.$viewport) return delta 4342 4343 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 4344 var viewportDimensions = this.getPosition(this.$viewport) 4345 4346 if (/right|left/.test(placement)) { 4347 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 4348 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 4349 if (topEdgeOffset < viewportDimensions.top) { // top overflow 4350 delta.top = viewportDimensions.top - topEdgeOffset 4351 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 4352 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset 4353 } 4354 } else { 4355 var leftEdgeOffset = pos.left - viewportPadding 4356 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 4357 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 4358 delta.left = viewportDimensions.left - leftEdgeOffset 4359 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 4360 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 4361 } 4362 } 4363 4364 return delta 4365 } 4366 4367 Tooltip.prototype.getTitle = function () { 4368 var title 4369 var $e = this.$element 4370 var o = this.options 4371 4372 title = $e.attr('data-original-title') 4373 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 4374 4375 return title 4376 } 4377 4378 Tooltip.prototype.getUID = function (prefix) { 4379 do prefix += ~~(Math.random() * 1000000) 4380 while (document.getElementById(prefix)) 4381 return prefix 4382 } 4383 4384 Tooltip.prototype.tip = function () { 4385 if (!this.$tip) { 4386 this.$tip = $(this.options.template) 4387 if (this.$tip.length != 1) { 4388 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 4389 } 4390 } 4391 return this.$tip 4392 } 4393 4394 Tooltip.prototype.arrow = function () { 4395 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 4396 } 4397 4398 Tooltip.prototype.enable = function () { 4399 this.enabled = true 4400 } 4401 4402 Tooltip.prototype.disable = function () { 4403 this.enabled = false 4404 } 4405 4406 Tooltip.prototype.toggleEnabled = function () { 4407 this.enabled = !this.enabled 4408 } 4409 4410 Tooltip.prototype.toggle = function (e) { 4411 var self = this 4412 if (e) { 4413 self = $(e.currentTarget).data('bs.' + this.type) 4414 if (!self) { 4415 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 4416 $(e.currentTarget).data('bs.' + this.type, self) 4417 } 4418 } 4419 4420 if (e) { 4421 self.inState.click = !self.inState.click 4422 if (self.isInStateTrue()) self.enter(self) 4423 else self.leave(self) 4424 } else { 4425 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 4426 } 4427 } 4428 4429 Tooltip.prototype.destroy = function () { 4430 var that = this 4431 clearTimeout(this.timeout) 4432 this.hide(function () { 4433 that.$element.off('.' + that.type).removeData('bs.' + that.type) 4434 if (that.$tip) { 4435 that.$tip.detach() 4436 } 4437 that.$tip = null 4438 that.$arrow = null 4439 that.$viewport = null 4440 that.$element = null 4441 }) 4442 } 4443 4444 Tooltip.prototype.sanitizeHtml = function (unsafeHtml) { 4445 return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn) 4446 } 4447 4448 // TOOLTIP PLUGIN DEFINITION 4449 // ========================= 4450 4451 function Plugin(option) { 4452 return this.each(function () { 4453 var $this = $(this) 4454 var data = $this.data('bs.tooltip') 4455 var options = typeof option == 'object' && option 4456 4457 if (!data && /destroy|hide/.test(option)) return 4458 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 4459 if (typeof option == 'string') data[option]() 4460 }) 4461 } 4462 4463 var old = $.fn.tooltip 4464 4465 $.fn.tooltip = Plugin 4466 $.fn.tooltip.Constructor = Tooltip 4467 4468 4469 // TOOLTIP NO CONFLICT 4470 // =================== 4471 4472 $.fn.tooltip.noConflict = function () { 4473 $.fn.tooltip = old 4474 return this 4475 } 4476 4477}(jQuery); 4478 4479/* ======================================================================== 4480 * Bootstrap: popover.js v3.4.1 4481 * https://getbootstrap.com/docs/3.4/javascript/#popovers 4482 * ======================================================================== 4483 * Copyright 2011-2019 Twitter, Inc. 4484 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4485 * ======================================================================== */ 4486 4487 4488+function ($) { 4489 'use strict'; 4490 4491 // POPOVER PUBLIC CLASS DEFINITION 4492 // =============================== 4493 4494 var Popover = function (element, options) { 4495 this.init('popover', element, options) 4496 } 4497 4498 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 4499 4500 Popover.VERSION = '3.4.1' 4501 4502 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 4503 placement: 'right', 4504 trigger: 'click', 4505 content: '', 4506 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 4507 }) 4508 4509 4510 // NOTE: POPOVER EXTENDS tooltip.js 4511 // ================================ 4512 4513 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 4514 4515 Popover.prototype.constructor = Popover 4516 4517 Popover.prototype.getDefaults = function () { 4518 return Popover.DEFAULTS 4519 } 4520 4521 Popover.prototype.setContent = function () { 4522 var $tip = this.tip() 4523 var title = this.getTitle() 4524 var content = this.getContent() 4525 4526 if (this.options.html) { 4527 var typeContent = typeof content 4528 4529 if (this.options.sanitize) { 4530 title = this.sanitizeHtml(title) 4531 4532 if (typeContent === 'string') { 4533 content = this.sanitizeHtml(content) 4534 } 4535 } 4536 4537 $tip.find('.popover-title').html(title) 4538 $tip.find('.popover-content').children().detach().end()[ 4539 typeContent === 'string' ? 'html' : 'append' 4540 ](content) 4541 } else { 4542 $tip.find('.popover-title').text(title) 4543 $tip.find('.popover-content').children().detach().end().text(content) 4544 } 4545 4546 $tip.removeClass('fade top bottom left right in') 4547 4548 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 4549 // this manually by checking the contents. 4550 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 4551 } 4552 4553 Popover.prototype.hasContent = function () { 4554 return this.getTitle() || this.getContent() 4555 } 4556 4557 Popover.prototype.getContent = function () { 4558 var $e = this.$element 4559 var o = this.options 4560 4561 return $e.attr('data-content') 4562 || (typeof o.content == 'function' ? 4563 o.content.call($e[0]) : 4564 o.content) 4565 } 4566 4567 Popover.prototype.arrow = function () { 4568 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 4569 } 4570 4571 4572 // POPOVER PLUGIN DEFINITION 4573 // ========================= 4574 4575 function Plugin(option) { 4576 return this.each(function () { 4577 var $this = $(this) 4578 var data = $this.data('bs.popover') 4579 var options = typeof option == 'object' && option 4580 4581 if (!data && /destroy|hide/.test(option)) return 4582 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 4583 if (typeof option == 'string') data[option]() 4584 }) 4585 } 4586 4587 var old = $.fn.popover 4588 4589 $.fn.popover = Plugin 4590 $.fn.popover.Constructor = Popover 4591 4592 4593 // POPOVER NO CONFLICT 4594 // =================== 4595 4596 $.fn.popover.noConflict = function () { 4597 $.fn.popover = old 4598 return this 4599 } 4600 4601}(jQuery); 4602 4603/* ======================================================================== 4604 * Bootstrap: scrollspy.js v3.4.1 4605 * https://getbootstrap.com/docs/3.4/javascript/#scrollspy 4606 * ======================================================================== 4607 * Copyright 2011-2019 Twitter, Inc. 4608 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4609 * ======================================================================== */ 4610 4611 4612+function ($) { 4613 'use strict'; 4614 4615 // SCROLLSPY CLASS DEFINITION 4616 // ========================== 4617 4618 function ScrollSpy(element, options) { 4619 this.$body = $(document.body) 4620 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) 4621 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 4622 this.selector = (this.options.target || '') + ' .nav li > a' 4623 this.offsets = [] 4624 this.targets = [] 4625 this.activeTarget = null 4626 this.scrollHeight = 0 4627 4628 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) 4629 this.refresh() 4630 this.process() 4631 } 4632 4633 ScrollSpy.VERSION = '3.4.1' 4634 4635 ScrollSpy.DEFAULTS = { 4636 offset: 10 4637 } 4638 4639 ScrollSpy.prototype.getScrollHeight = function () { 4640 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 4641 } 4642 4643 ScrollSpy.prototype.refresh = function () { 4644 var that = this 4645 var offsetMethod = 'offset' 4646 var offsetBase = 0 4647 4648 this.offsets = [] 4649 this.targets = [] 4650 this.scrollHeight = this.getScrollHeight() 4651 4652 if (!$.isWindow(this.$scrollElement[0])) { 4653 offsetMethod = 'position' 4654 offsetBase = this.$scrollElement.scrollTop() 4655 } 4656 4657 this.$body 4658 .find(this.selector) 4659 .map(function () { 4660 var $el = $(this) 4661 var href = $el.data('target') || $el.attr('href') 4662 var $href = /^#./.test(href) && $(href) 4663 4664 return ($href 4665 && $href.length 4666 && $href.is(':visible') 4667 && [[$href[offsetMethod]().top + offsetBase, href]]) || null 4668 }) 4669 .sort(function (a, b) { return a[0] - b[0] }) 4670 .each(function () { 4671 that.offsets.push(this[0]) 4672 that.targets.push(this[1]) 4673 }) 4674 } 4675 4676 ScrollSpy.prototype.process = function () { 4677 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 4678 var scrollHeight = this.getScrollHeight() 4679 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() 4680 var offsets = this.offsets 4681 var targets = this.targets 4682 var activeTarget = this.activeTarget 4683 var i 4684 4685 if (this.scrollHeight != scrollHeight) { 4686 this.refresh() 4687 } 4688 4689 if (scrollTop >= maxScroll) { 4690 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) 4691 } 4692 4693 if (activeTarget && scrollTop < offsets[0]) { 4694 this.activeTarget = null 4695 return this.clear() 4696 } 4697 4698 for (i = offsets.length; i--;) { 4699 activeTarget != targets[i] 4700 && scrollTop >= offsets[i] 4701 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) 4702 && this.activate(targets[i]) 4703 } 4704 } 4705 4706 ScrollSpy.prototype.activate = function (target) { 4707 this.activeTarget = target 4708 4709 this.clear() 4710 4711 var selector = this.selector + 4712 '[data-target="' + target + '"],' + 4713 this.selector + '[href="' + target + '"]' 4714 4715 var active = $(selector) 4716 .parents('li') 4717 .addClass('active') 4718 4719 if (active.parent('.dropdown-menu').length) { 4720 active = active 4721 .closest('li.dropdown') 4722 .addClass('active') 4723 } 4724 4725 active.trigger('activate.bs.scrollspy') 4726 } 4727 4728 ScrollSpy.prototype.clear = function () { 4729 $(this.selector) 4730 .parentsUntil(this.options.target, '.active') 4731 .removeClass('active') 4732 } 4733 4734 4735 // SCROLLSPY PLUGIN DEFINITION 4736 // =========================== 4737 4738 function Plugin(option) { 4739 return this.each(function () { 4740 var $this = $(this) 4741 var data = $this.data('bs.scrollspy') 4742 var options = typeof option == 'object' && option 4743 4744 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 4745 if (typeof option == 'string') data[option]() 4746 }) 4747 } 4748 4749 var old = $.fn.scrollspy 4750 4751 $.fn.scrollspy = Plugin 4752 $.fn.scrollspy.Constructor = ScrollSpy 4753 4754 4755 // SCROLLSPY NO CONFLICT 4756 // ===================== 4757 4758 $.fn.scrollspy.noConflict = function () { 4759 $.fn.scrollspy = old 4760 return this 4761 } 4762 4763 4764 // SCROLLSPY DATA-API 4765 // ================== 4766 4767 $(window).on('load.bs.scrollspy.data-api', function () { 4768 $('[data-spy="scroll"]').each(function () { 4769 var $spy = $(this) 4770 Plugin.call($spy, $spy.data()) 4771 }) 4772 }) 4773 4774}(jQuery); 4775 4776/* ======================================================================== 4777 * Bootstrap: tab.js v3.4.1 4778 * https://getbootstrap.com/docs/3.4/javascript/#tabs 4779 * ======================================================================== 4780 * Copyright 2011-2019 Twitter, Inc. 4781 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4782 * ======================================================================== */ 4783 4784 4785+function ($) { 4786 'use strict'; 4787 4788 // TAB CLASS DEFINITION 4789 // ==================== 4790 4791 var Tab = function (element) { 4792 // jscs:disable requireDollarBeforejQueryAssignment 4793 this.element = $(element) 4794 // jscs:enable requireDollarBeforejQueryAssignment 4795 } 4796 4797 Tab.VERSION = '3.4.1' 4798 4799 Tab.TRANSITION_DURATION = 150 4800 4801 Tab.prototype.show = function () { 4802 var $this = this.element 4803 var $ul = $this.closest('ul:not(.dropdown-menu)') 4804 var selector = $this.data('target') 4805 4806 if (!selector) { 4807 selector = $this.attr('href') 4808 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 4809 } 4810 4811 if ($this.parent('li').hasClass('active')) return 4812 4813 var $previous = $ul.find('.active:last a') 4814 var hideEvent = $.Event('hide.bs.tab', { 4815 relatedTarget: $this[0] 4816 }) 4817 var showEvent = $.Event('show.bs.tab', { 4818 relatedTarget: $previous[0] 4819 }) 4820 4821 $previous.trigger(hideEvent) 4822 $this.trigger(showEvent) 4823 4824 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return 4825 4826 var $target = $(document).find(selector) 4827 4828 this.activate($this.closest('li'), $ul) 4829 this.activate($target, $target.parent(), function () { 4830 $previous.trigger({ 4831 type: 'hidden.bs.tab', 4832 relatedTarget: $this[0] 4833 }) 4834 $this.trigger({ 4835 type: 'shown.bs.tab', 4836 relatedTarget: $previous[0] 4837 }) 4838 }) 4839 } 4840 4841 Tab.prototype.activate = function (element, container, callback) { 4842 var $active = container.find('> .active') 4843 var transition = callback 4844 && $.support.transition 4845 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) 4846 4847 function next() { 4848 $active 4849 .removeClass('active') 4850 .find('> .dropdown-menu > .active') 4851 .removeClass('active') 4852 .end() 4853 .find('[data-toggle="tab"]') 4854 .attr('aria-expanded', false) 4855 4856 element 4857 .addClass('active') 4858 .find('[data-toggle="tab"]') 4859 .attr('aria-expanded', true) 4860 4861 if (transition) { 4862 element[0].offsetWidth // reflow for transition 4863 element.addClass('in') 4864 } else { 4865 element.removeClass('fade') 4866 } 4867 4868 if (element.parent('.dropdown-menu').length) { 4869 element 4870 .closest('li.dropdown') 4871 .addClass('active') 4872 .end() 4873 .find('[data-toggle="tab"]') 4874 .attr('aria-expanded', true) 4875 } 4876 4877 callback && callback() 4878 } 4879 4880 $active.length && transition ? 4881 $active 4882 .one('bsTransitionEnd', next) 4883 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : 4884 next() 4885 4886 $active.removeClass('in') 4887 } 4888 4889 4890 // TAB PLUGIN DEFINITION 4891 // ===================== 4892 4893 function Plugin(option) { 4894 return this.each(function () { 4895 var $this = $(this) 4896 var data = $this.data('bs.tab') 4897 4898 if (!data) $this.data('bs.tab', (data = new Tab(this))) 4899 if (typeof option == 'string') data[option]() 4900 }) 4901 } 4902 4903 var old = $.fn.tab 4904 4905 $.fn.tab = Plugin 4906 $.fn.tab.Constructor = Tab 4907 4908 4909 // TAB NO CONFLICT 4910 // =============== 4911 4912 $.fn.tab.noConflict = function () { 4913 $.fn.tab = old 4914 return this 4915 } 4916 4917 4918 // TAB DATA-API 4919 // ============ 4920 4921 var clickHandler = function (e) { 4922 e.preventDefault() 4923 Plugin.call($(this), 'show') 4924 } 4925 4926 $(document) 4927 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) 4928 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) 4929 4930}(jQuery); 4931 4932/* ======================================================================== 4933 * Bootstrap: affix.js v3.4.1 4934 * https://getbootstrap.com/docs/3.4/javascript/#affix 4935 * ======================================================================== 4936 * Copyright 2011-2019 Twitter, Inc. 4937 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4938 * ======================================================================== */ 4939 4940 4941+function ($) { 4942 'use strict'; 4943 4944 // AFFIX CLASS DEFINITION 4945 // ====================== 4946 4947 var Affix = function (element, options) { 4948 this.options = $.extend({}, Affix.DEFAULTS, options) 4949 4950 var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target) 4951 4952 this.$target = target 4953 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 4954 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 4955 4956 this.$element = $(element) 4957 this.affixed = null 4958 this.unpin = null 4959 this.pinnedOffset = null 4960 4961 this.checkPosition() 4962 } 4963 4964 Affix.VERSION = '3.4.1' 4965 4966 Affix.RESET = 'affix affix-top affix-bottom' 4967 4968 Affix.DEFAULTS = { 4969 offset: 0, 4970 target: window 4971 } 4972 4973 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { 4974 var scrollTop = this.$target.scrollTop() 4975 var position = this.$element.offset() 4976 var targetHeight = this.$target.height() 4977 4978 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false 4979 4980 if (this.affixed == 'bottom') { 4981 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' 4982 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' 4983 } 4984 4985 var initializing = this.affixed == null 4986 var colliderTop = initializing ? scrollTop : position.top 4987 var colliderHeight = initializing ? targetHeight : height 4988 4989 if (offsetTop != null && scrollTop <= offsetTop) return 'top' 4990 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' 4991 4992 return false 4993 } 4994 4995 Affix.prototype.getPinnedOffset = function () { 4996 if (this.pinnedOffset) return this.pinnedOffset 4997 this.$element.removeClass(Affix.RESET).addClass('affix') 4998 var scrollTop = this.$target.scrollTop() 4999 var position = this.$element.offset() 5000 return (this.pinnedOffset = position.top - scrollTop) 5001 } 5002 5003 Affix.prototype.checkPositionWithEventLoop = function () { 5004 setTimeout($.proxy(this.checkPosition, this), 1) 5005 } 5006 5007 Affix.prototype.checkPosition = function () { 5008 if (!this.$element.is(':visible')) return 5009 5010 var height = this.$element.height() 5011 var offset = this.options.offset 5012 var offsetTop = offset.top 5013 var offsetBottom = offset.bottom 5014 var scrollHeight = Math.max($(document).height(), $(document.body).height()) 5015 5016 if (typeof offset != 'object') offsetBottom = offsetTop = offset 5017 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) 5018 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) 5019 5020 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) 5021 5022 if (this.affixed != affix) { 5023 if (this.unpin != null) this.$element.css('top', '') 5024 5025 var affixType = 'affix' + (affix ? '-' + affix : '') 5026 var e = $.Event(affixType + '.bs.affix') 5027 5028 this.$element.trigger(e) 5029 5030 if (e.isDefaultPrevented()) return 5031 5032 this.affixed = affix 5033 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null 5034 5035 this.$element 5036 .removeClass(Affix.RESET) 5037 .addClass(affixType) 5038 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') 5039 } 5040 5041 if (affix == 'bottom') { 5042 this.$element.offset({ 5043 top: scrollHeight - height - offsetBottom 5044 }) 5045 } 5046 } 5047 5048 5049 // AFFIX PLUGIN DEFINITION 5050 // ======================= 5051 5052 function Plugin(option) { 5053 return this.each(function () { 5054 var $this = $(this) 5055 var data = $this.data('bs.affix') 5056 var options = typeof option == 'object' && option 5057 5058 if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 5059 if (typeof option == 'string') data[option]() 5060 }) 5061 } 5062 5063 var old = $.fn.affix 5064 5065 $.fn.affix = Plugin 5066 $.fn.affix.Constructor = Affix 5067 5068 5069 // AFFIX NO CONFLICT 5070 // ================= 5071 5072 $.fn.affix.noConflict = function () { 5073 $.fn.affix = old 5074 return this 5075 } 5076 5077 5078 // AFFIX DATA-API 5079 // ============== 5080 5081 $(window).on('load', function () { 5082 $('[data-spy="affix"]').each(function () { 5083 var $spy = $(this) 5084 var data = $spy.data() 5085 5086 data.offset = data.offset || {} 5087 5088 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom 5089 if (data.offsetTop != null) data.offset.top = data.offsetTop 5090 5091 Plugin.call($spy, data) 5092 }) 5093 }) 5094 5095}(jQuery); 5096 5097 5098/***/ }), 5099
vendor: 289,021 bytes, lines 5100-15991
5100/***/ "./node_modules/jquery/dist/jquery.js": 5101/*!********************************************!*\ 5102 !*** ./node_modules/jquery/dist/jquery.js ***! 5103 \********************************************/ 5104/***/ (function(module, exports) { 5105 5106var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 5107 * jQuery JavaScript Library v3.6.0 5108 * https://jquery.com/ 5109 * 5110 * Includes Sizzle.js 5111 * https://sizzlejs.com/ 5112 * 5113 * Copyright OpenJS Foundation and other contributors 5114 * Released under the MIT license 5115 * https://jquery.org/license 5116 * 5117 * Date: 2021-03-02T17:08Z 5118 */ 5119( function( global, factory ) { 5120 5121 "use strict"; 5122 5123 if ( true && typeof module.exports === "object" ) { 5124 5125 // For CommonJS and CommonJS-like environments where a proper `window` 5126 // is present, execute the factory and get jQuery. 5127 // For environments that do not have a `window` with a `document` 5128 // (such as Node.js), expose a factory as module.exports. 5129 // This accentuates the need for the creation of a real `window`. 5130 // e.g. var jQuery = require("jquery")(window); 5131 // See ticket #14549 for more info. 5132 module.exports = global.document ? 5133 factory( global, true ) : 5134 function( w ) { 5135 if ( !w.document ) { 5136 throw new Error( "jQuery requires a window with a document" ); 5137 } 5138 return factory( w ); 5139 }; 5140 } else { 5141 factory( global ); 5142 } 5143 5144// Pass this if window is not defined yet 5145} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 5146 5147// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 5148// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 5149// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 5150// enough that all such attempts are guarded in a try block. 5151"use strict"; 5152 5153var arr = []; 5154 5155var getProto = Object.getPrototypeOf; 5156 5157var slice = arr.slice; 5158 5159var flat = arr.flat ? function( array ) { 5160 return arr.flat.call( array ); 5161} : function( array ) { 5162 return arr.concat.apply( [], array ); 5163}; 5164 5165 5166var push = arr.push; 5167 5168var indexOf = arr.indexOf; 5169 5170var class2type = {}; 5171 5172var toString = class2type.toString; 5173 5174var hasOwn = class2type.hasOwnProperty; 5175 5176var fnToString = hasOwn.toString; 5177 5178var ObjectFunctionString = fnToString.call( Object ); 5179 5180var support = {}; 5181 5182var isFunction = function isFunction( obj ) { 5183 5184 // Support: Chrome <=57, Firefox <=52 5185 // In some browsers, typeof returns "function" for HTML <object> elements 5186 // (i.e., `typeof document.createElement( "object" ) === "function"`). 5187 // We don't want to classify *any* DOM node as a function. 5188 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 5189 // Plus for old WebKit, typeof returns "function" for HTML collections 5190 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 5191 return typeof obj === "function" && typeof obj.nodeType !== "number" && 5192 typeof obj.item !== "function"; 5193 }; 5194 5195 5196var isWindow = function isWindow( obj ) { 5197 return obj != null && obj === obj.window; 5198 }; 5199 5200 5201var document = window.document; 5202 5203 5204 5205 var preservedScriptAttributes = { 5206 type: true, 5207 src: true, 5208 nonce: true, 5209 noModule: true 5210 }; 5211 5212 function DOMEval( code, node, doc ) { 5213 doc = doc || document; 5214 5215 var i, val, 5216 script = doc.createElement( "script" ); 5217 5218 script.text = code; 5219 if ( node ) { 5220 for ( i in preservedScriptAttributes ) { 5221 5222 // Support: Firefox 64+, Edge 18+ 5223 // Some browsers don't support the "nonce" property on scripts. 5224 // On the other hand, just using `getAttribute` is not enough as 5225 // the `nonce` attribute is reset to an empty string whenever it 5226 // becomes browsing-context connected. 5227 // See https://github.com/whatwg/html/issues/2369 5228 // See https://html.spec.whatwg.org/#nonce-attributes 5229 // The `node.getAttribute` check was added for the sake of 5230 // `jQuery.globalEval` so that it can fake a nonce-containing node 5231 // via an object. 5232 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 5233 if ( val ) { 5234 script.setAttribute( i, val ); 5235 } 5236 } 5237 } 5238 doc.head.appendChild( script ).parentNode.removeChild( script ); 5239 } 5240 5241 5242function toType( obj ) { 5243 if ( obj == null ) { 5244 return obj + ""; 5245 } 5246 5247 // Support: Android <=2.3 only (functionish RegExp) 5248 return typeof obj === "object" || typeof obj === "function" ? 5249 class2type[ toString.call( obj ) ] || "object" : 5250 typeof obj; 5251} 5252/* global Symbol */ 5253// Defining this global in .eslintrc.json would create a danger of using the global 5254// unguarded in another place, it seems safer to define global only for this module 5255 5256 5257 5258var 5259 version = "3.6.0", 5260 5261 // Define a local copy of jQuery 5262 jQuery = function( selector, context ) { 5263 5264 // The jQuery object is actually just the init constructor 'enhanced' 5265 // Need init if jQuery is called (just allow error to be thrown if not included) 5266 return new jQuery.fn.init( selector, context ); 5267 }; 5268 5269jQuery.fn = jQuery.prototype = { 5270 5271 // The current version of jQuery being used 5272 jquery: version, 5273 5274 constructor: jQuery, 5275 5276 // The default length of a jQuery object is 0 5277 length: 0, 5278 5279 toArray: function() { 5280 return slice.call( this ); 5281 }, 5282 5283 // Get the Nth element in the matched element set OR 5284 // Get the whole matched element set as a clean array 5285 get: function( num ) { 5286 5287 // Return all the elements in a clean array 5288 if ( num == null ) { 5289 return slice.call( this ); 5290 } 5291 5292 // Return just the one element from the set 5293 return num < 0 ? this[ num + this.length ] : this[ num ]; 5294 }, 5295 5296 // Take an array of elements and push it onto the stack 5297 // (returning the new matched element set) 5298 pushStack: function( elems ) { 5299 5300 // Build a new jQuery matched element set 5301 var ret = jQuery.merge( this.constructor(), elems ); 5302 5303 // Add the old object onto the stack (as a reference) 5304 ret.prevObject = this; 5305 5306 // Return the newly-formed element set 5307 return ret; 5308 }, 5309 5310 // Execute a callback for every element in the matched set. 5311 each: function( callback ) { 5312 return jQuery.each( this, callback ); 5313 }, 5314 5315 map: function( callback ) { 5316 return this.pushStack( jQuery.map( this, function( elem, i ) { 5317 return callback.call( elem, i, elem ); 5318 } ) ); 5319 }, 5320 5321 slice: function() { 5322 return this.pushStack( slice.apply( this, arguments ) ); 5323 }, 5324 5325 first: function() { 5326 return this.eq( 0 ); 5327 }, 5328 5329 last: function() { 5330 return this.eq( -1 ); 5331 }, 5332 5333 even: function() { 5334 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5335 return ( i + 1 ) % 2; 5336 } ) ); 5337 }, 5338 5339 odd: function() { 5340 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5341 return i % 2; 5342 } ) ); 5343 }, 5344 5345 eq: function( i ) { 5346 var len = this.length, 5347 j = +i + ( i < 0 ? len : 0 ); 5348 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 5349 }, 5350 5351 end: function() { 5352 return this.prevObject || this.constructor(); 5353 }, 5354 5355 // For internal use only. 5356 // Behaves like an Array's method, not like a jQuery method. 5357 push: push, 5358 sort: arr.sort, 5359 splice: arr.splice 5360}; 5361 5362jQuery.extend = jQuery.fn.extend = function() { 5363 var options, name, src, copy, copyIsArray, clone, 5364 target = arguments[ 0 ] || {}, 5365 i = 1, 5366 length = arguments.length, 5367 deep = false; 5368 5369 // Handle a deep copy situation 5370 if ( typeof target === "boolean" ) { 5371 deep = target; 5372 5373 // Skip the boolean and the target 5374 target = arguments[ i ] || {}; 5375 i++; 5376 } 5377 5378 // Handle case when target is a string or something (possible in deep copy) 5379 if ( typeof target !== "object" && !isFunction( target ) ) { 5380 target = {}; 5381 } 5382 5383 // Extend jQuery itself if only one argument is passed 5384 if ( i === length ) { 5385 target = this; 5386 i--; 5387 } 5388 5389 for ( ; i < length; i++ ) { 5390 5391 // Only deal with non-null/undefined values 5392 if ( ( options = arguments[ i ] ) != null ) { 5393 5394 // Extend the base object 5395 for ( name in options ) { 5396 copy = options[ name ]; 5397 5398 // Prevent Object.prototype pollution 5399 // Prevent never-ending loop 5400 if ( name === "__proto__" || target === copy ) { 5401 continue; 5402 } 5403 5404 // Recurse if we're merging plain objects or arrays 5405 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 5406 ( copyIsArray = Array.isArray( copy ) ) ) ) { 5407 src = target[ name ]; 5408 5409 // Ensure proper type for the source value 5410 if ( copyIsArray && !Array.isArray( src ) ) { 5411 clone = []; 5412 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 5413 clone = {}; 5414 } else { 5415 clone = src; 5416 } 5417 copyIsArray = false; 5418 5419 // Never move original objects, clone them 5420 target[ name ] = jQuery.extend( deep, clone, copy ); 5421 5422 // Don't bring in undefined values 5423 } else if ( copy !== undefined ) { 5424 target[ name ] = copy; 5425 } 5426 } 5427 } 5428 } 5429 5430 // Return the modified object 5431 return target; 5432}; 5433 5434jQuery.extend( { 5435 5436 // Unique for each copy of jQuery on the page 5437 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 5438 5439 // Assume jQuery is ready without the ready module 5440 isReady: true, 5441 5442 error: function( msg ) { 5443 throw new Error( msg ); 5444 }, 5445 5446 noop: function() {}, 5447 5448 isPlainObject: function( obj ) { 5449 var proto, Ctor; 5450 5451 // Detect obvious negatives 5452 // Use toString instead of jQuery.type to catch host objects 5453 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 5454 return false; 5455 } 5456 5457 proto = getProto( obj ); 5458 5459 // Objects with no prototype (e.g., `Object.create( null )`) are plain 5460 if ( !proto ) { 5461 return true; 5462 } 5463 5464 // Objects with prototype are plain iff they were constructed by a global Object function 5465 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 5466 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 5467 }, 5468 5469 isEmptyObject: function( obj ) { 5470 var name; 5471 5472 for ( name in obj ) { 5473 return false; 5474 } 5475 return true; 5476 }, 5477 5478 // Evaluates a script in a provided context; falls back to the global one 5479 // if not specified. 5480 globalEval: function( code, options, doc ) { 5481 DOMEval( code, { nonce: options && options.nonce }, doc ); 5482 }, 5483 5484 each: function( obj, callback ) { 5485 var length, i = 0; 5486 5487 if ( isArrayLike( obj ) ) { 5488 length = obj.length; 5489 for ( ; i < length; i++ ) { 5490 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5491 break; 5492 } 5493 } 5494 } else { 5495 for ( i in obj ) { 5496 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5497 break; 5498 } 5499 } 5500 } 5501 5502 return obj; 5503 }, 5504 5505 // results is for internal usage only 5506 makeArray: function( arr, results ) { 5507 var ret = results || []; 5508 5509 if ( arr != null ) { 5510 if ( isArrayLike( Object( arr ) ) ) { 5511 jQuery.merge( ret, 5512 typeof arr === "string" ? 5513 [ arr ] : arr 5514 ); 5515 } else { 5516 push.call( ret, arr ); 5517 } 5518 } 5519 5520 return ret; 5521 }, 5522 5523 inArray: function( elem, arr, i ) { 5524 return arr == null ? -1 : indexOf.call( arr, elem, i ); 5525 }, 5526 5527 // Support: Android <=4.0 only, PhantomJS 1 only 5528 // push.apply(_, arraylike) throws on ancient WebKit 5529 merge: function( first, second ) { 5530 var len = +second.length, 5531 j = 0, 5532 i = first.length; 5533 5534 for ( ; j < len; j++ ) { 5535 first[ i++ ] = second[ j ]; 5536 } 5537 5538 first.length = i; 5539 5540 return first; 5541 }, 5542 5543 grep: function( elems, callback, invert ) { 5544 var callbackInverse, 5545 matches = [], 5546 i = 0, 5547 length = elems.length, 5548 callbackExpect = !invert; 5549 5550 // Go through the array, only saving the items 5551 // that pass the validator function 5552 for ( ; i < length; i++ ) { 5553 callbackInverse = !callback( elems[ i ], i ); 5554 if ( callbackInverse !== callbackExpect ) { 5555 matches.push( elems[ i ] ); 5556 } 5557 } 5558 5559 return matches; 5560 }, 5561 5562 // arg is for internal usage only 5563 map: function( elems, callback, arg ) { 5564 var length, value, 5565 i = 0, 5566 ret = []; 5567 5568 // Go through the array, translating each of the items to their new values 5569 if ( isArrayLike( elems ) ) { 5570 length = elems.length; 5571 for ( ; i < length; i++ ) { 5572 value = callback( elems[ i ], i, arg ); 5573 5574 if ( value != null ) { 5575 ret.push( value ); 5576 } 5577 } 5578 5579 // Go through every key on the object, 5580 } else { 5581 for ( i in elems ) { 5582 value = callback( elems[ i ], i, arg ); 5583 5584 if ( value != null ) { 5585 ret.push( value ); 5586 } 5587 } 5588 } 5589 5590 // Flatten any nested arrays 5591 return flat( ret ); 5592 }, 5593 5594 // A global GUID counter for objects 5595 guid: 1, 5596 5597 // jQuery.support is not used in Core but other projects attach their 5598 // properties to it so it needs to exist. 5599 support: support 5600} ); 5601 5602if ( typeof Symbol === "function" ) { 5603 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 5604} 5605 5606// Populate the class2type map 5607jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 5608 function( _i, name ) { 5609 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 5610 } ); 5611 5612function isArrayLike( obj ) { 5613 5614 // Support: real iOS 8.2 only (not reproducible in simulator) 5615 // `in` check used to prevent JIT error (gh-2145) 5616 // hasOwn isn't used here due to false negatives 5617 // regarding Nodelist length in IE 5618 var length = !!obj && "length" in obj && obj.length, 5619 type = toType( obj ); 5620 5621 if ( isFunction( obj ) || isWindow( obj ) ) { 5622 return false; 5623 } 5624 5625 return type === "array" || length === 0 || 5626 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 5627} 5628var Sizzle = 5629/*! 5630 * Sizzle CSS Selector Engine v2.3.6 5631 * https://sizzlejs.com/ 5632 * 5633 * Copyright JS Foundation and other contributors 5634 * Released under the MIT license 5635 * https://js.foundation/ 5636 * 5637 * Date: 2021-02-16 5638 */ 5639( function( window ) { 5640var i, 5641 support, 5642 Expr, 5643 getText, 5644 isXML, 5645 tokenize, 5646 compile, 5647 select, 5648 outermostContext, 5649 sortInput, 5650 hasDuplicate, 5651 5652 // Local document vars 5653 setDocument, 5654 document, 5655 docElem, 5656 documentIsHTML, 5657 rbuggyQSA, 5658 rbuggyMatches, 5659 matches, 5660 contains, 5661 5662 // Instance-specific data 5663 expando = "sizzle" + 1 * new Date(), 5664 preferredDoc = window.document, 5665 dirruns = 0, 5666 done = 0, 5667 classCache = createCache(), 5668 tokenCache = createCache(), 5669 compilerCache = createCache(), 5670 nonnativeSelectorCache = createCache(), 5671 sortOrder = function( a, b ) { 5672 if ( a === b ) { 5673 hasDuplicate = true; 5674 } 5675 return 0; 5676 }, 5677 5678 // Instance methods 5679 hasOwn = ( {} ).hasOwnProperty, 5680 arr = [], 5681 pop = arr.pop, 5682 pushNative = arr.push, 5683 push = arr.push, 5684 slice = arr.slice, 5685 5686 // Use a stripped-down indexOf as it's faster than native 5687 // https://jsperf.com/thor-indexof-vs-for/5 5688 indexOf = function( list, elem ) { 5689 var i = 0, 5690 len = list.length; 5691 for ( ; i < len; i++ ) { 5692 if ( list[ i ] === elem ) { 5693 return i; 5694 } 5695 } 5696 return -1; 5697 }, 5698 5699 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 5700 "ismap|loop|multiple|open|readonly|required|scoped", 5701 5702 // Regular expressions 5703 5704 // http://www.w3.org/TR/css3-selectors/#whitespace 5705 whitespace = "[\\x20\\t\\r\\n\\f]", 5706 5707 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 5708 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 5709 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 5710 5711 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 5712 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 5713 5714 // Operator (capture 2) 5715 "*([*^$|!~]?=)" + whitespace + 5716 5717 // "Attribute values must be CSS identifiers [capture 5] 5718 // or strings [capture 3 or capture 4]" 5719 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 5720 whitespace + "*\\]", 5721 5722 pseudos = ":(" + identifier + ")(?:\\((" + 5723 5724 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 5725 // 1. quoted (capture 3; capture 4 or capture 5) 5726 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 5727 5728 // 2. simple (capture 6) 5729 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 5730 5731 // 3. anything else (capture 2) 5732 ".*" + 5733 ")\\)|)", 5734 5735 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 5736 rwhitespace = new RegExp( whitespace + "+", "g" ), 5737 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 5738 whitespace + "+$", "g" ), 5739 5740 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 5741 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 5742 "*" ), 5743 rdescend = new RegExp( whitespace + "|>" ), 5744 5745 rpseudo = new RegExp( pseudos ), 5746 ridentifier = new RegExp( "^" + identifier + "$" ), 5747 5748 matchExpr = { 5749 "ID": new RegExp( "^#(" + identifier + ")" ), 5750 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 5751 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 5752 "ATTR": new RegExp( "^" + attributes ), 5753 "PSEUDO": new RegExp( "^" + pseudos ), 5754 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 5755 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 5756 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 5757 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 5758 5759 // For use in libraries implementing .is() 5760 // We use this for POS matching in `select` 5761 "needsContext": new RegExp( "^" + whitespace + 5762 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 5763 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 5764 }, 5765 5766 rhtml = /HTML$/i, 5767 rinputs = /^(?:input|select|textarea|button)$/i, 5768 rheader = /^h\d$/i, 5769 5770 rnative = /^[^{]+\{\s*\[native \w/, 5771 5772 // Easily-parseable/retrievable ID or TAG or CLASS selectors 5773 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 5774 5775 rsibling = /[+~]/, 5776 5777 // CSS escapes 5778 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 5779 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 5780 funescape = function( escape, nonHex ) { 5781 var high = "0x" + escape.slice( 1 ) - 0x10000; 5782 5783 return nonHex ? 5784 5785 // Strip the backslash prefix from a non-hex escape sequence 5786 nonHex : 5787 5788 // Replace a hexadecimal escape sequence with the encoded Unicode code point 5789 // Support: IE <=11+ 5790 // For values outside the Basic Multilingual Plane (BMP), manually construct a 5791 // surrogate pair 5792 high < 0 ? 5793 String.fromCharCode( high + 0x10000 ) : 5794 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 5795 }, 5796 5797 // CSS string/identifier serialization 5798 // https://drafts.csswg.org/cssom/#common-serializing-idioms 5799 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 5800 fcssescape = function( ch, asCodePoint ) { 5801 if ( asCodePoint ) { 5802 5803 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 5804 if ( ch === "\0" ) { 5805 return "\uFFFD"; 5806 } 5807 5808 // Control characters and (dependent upon position) numbers get escaped as code points 5809 return ch.slice( 0, -1 ) + "\\" + 5810 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 5811 } 5812 5813 // Other potentially-special ASCII characters get backslash-escaped 5814 return "\\" + ch; 5815 }, 5816 5817 // Used for iframes 5818 // See setDocument() 5819 // Removing the function wrapper causes a "Permission Denied" 5820 // error in IE 5821 unloadHandler = function() { 5822 setDocument(); 5823 }, 5824 5825 inDisabledFieldset = addCombinator( 5826 function( elem ) { 5827 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 5828 }, 5829 { dir: "parentNode", next: "legend" } 5830 ); 5831 5832// Optimize for push.apply( _, NodeList ) 5833try { 5834 push.apply( 5835 ( arr = slice.call( preferredDoc.childNodes ) ), 5836 preferredDoc.childNodes 5837 ); 5838 5839 // Support: Android<4.0 5840 // Detect silently failing push.apply 5841 // eslint-disable-next-line no-unused-expressions 5842 arr[ preferredDoc.childNodes.length ].nodeType; 5843} catch ( e ) { 5844 push = { apply: arr.length ? 5845 5846 // Leverage slice if possible 5847 function( target, els ) { 5848 pushNative.apply( target, slice.call( els ) ); 5849 } : 5850 5851 // Support: IE<9 5852 // Otherwise append directly 5853 function( target, els ) { 5854 var j = target.length, 5855 i = 0; 5856 5857 // Can't trust NodeList.length 5858 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 5859 target.length = j - 1; 5860 } 5861 }; 5862} 5863 5864function Sizzle( selector, context, results, seed ) { 5865 var m, i, elem, nid, match, groups, newSelector, 5866 newContext = context && context.ownerDocument, 5867 5868 // nodeType defaults to 9, since context defaults to document 5869 nodeType = context ? context.nodeType : 9; 5870 5871 results = results || []; 5872 5873 // Return early from calls with invalid selector or context 5874 if ( typeof selector !== "string" || !selector || 5875 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 5876 5877 return results; 5878 } 5879 5880 // Try to shortcut find operations (as opposed to filters) in HTML documents 5881 if ( !seed ) { 5882 setDocument( context ); 5883 context = context || document; 5884 5885 if ( documentIsHTML ) { 5886 5887 // If the selector is sufficiently simple, try using a "get*By*" DOM method 5888 // (excepting DocumentFragment context, where the methods don't exist) 5889 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 5890 5891 // ID selector 5892 if ( ( m = match[ 1 ] ) ) { 5893 5894 // Document context 5895 if ( nodeType === 9 ) { 5896 if ( ( elem = context.getElementById( m ) ) ) { 5897 5898 // Support: IE, Opera, Webkit 5899 // TODO: identify versions 5900 // getElementById can match elements by name instead of ID 5901 if ( elem.id === m ) { 5902 results.push( elem ); 5903 return results; 5904 } 5905 } else { 5906 return results; 5907 } 5908 5909 // Element context 5910 } else { 5911 5912 // Support: IE, Opera, Webkit 5913 // TODO: identify versions 5914 // getElementById can match elements by name instead of ID 5915 if ( newContext && ( elem = newContext.getElementById( m ) ) && 5916 contains( context, elem ) && 5917 elem.id === m ) { 5918 5919 results.push( elem ); 5920 return results; 5921 } 5922 } 5923 5924 // Type selector 5925 } else if ( match[ 2 ] ) { 5926 push.apply( results, context.getElementsByTagName( selector ) ); 5927 return results; 5928 5929 // Class selector 5930 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 5931 context.getElementsByClassName ) { 5932 5933 push.apply( results, context.getElementsByClassName( m ) ); 5934 return results; 5935 } 5936 } 5937 5938 // Take advantage of querySelectorAll 5939 if ( support.qsa && 5940 !nonnativeSelectorCache[ selector + " " ] && 5941 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 5942 5943 // Support: IE 8 only 5944 // Exclude object elements 5945 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 5946 5947 newSelector = selector; 5948 newContext = context; 5949 5950 // qSA considers elements outside a scoping root when evaluating child or 5951 // descendant combinators, which is not what we want. 5952 // In such cases, we work around the behavior by prefixing every selector in the 5953 // list with an ID selector referencing the scope context. 5954 // The technique has to be used as well when a leading combinator is used 5955 // as such selectors are not recognized by querySelectorAll. 5956 // Thanks to Andrew Dupont for this technique. 5957 if ( nodeType === 1 && 5958 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 5959 5960 // Expand context for sibling selectors 5961 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 5962 context; 5963 5964 // We can use :scope instead of the ID hack if the browser 5965 // supports it & if we're not changing the context. 5966 if ( newContext !== context || !support.scope ) { 5967 5968 // Capture the context ID, setting it first if necessary 5969 if ( ( nid = context.getAttribute( "id" ) ) ) { 5970 nid = nid.replace( rcssescape, fcssescape ); 5971 } else { 5972 context.setAttribute( "id", ( nid = expando ) ); 5973 } 5974 } 5975 5976 // Prefix every selector in the list 5977 groups = tokenize( selector ); 5978 i = groups.length; 5979 while ( i-- ) { 5980 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 5981 toSelector( groups[ i ] ); 5982 } 5983 newSelector = groups.join( "," ); 5984 } 5985 5986 try { 5987 push.apply( results, 5988 newContext.querySelectorAll( newSelector ) 5989 ); 5990 return results; 5991 } catch ( qsaError ) { 5992 nonnativeSelectorCache( selector, true ); 5993 } finally { 5994 if ( nid === expando ) { 5995 context.removeAttribute( "id" ); 5996 } 5997 } 5998 } 5999 } 6000 } 6001 6002 // All others 6003 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 6004} 6005 6006/** 6007 * Create key-value caches of limited size 6008 * @returns {function(string, object)} Returns the Object data after storing it on itself with 6009 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 6010 * deleting the oldest entry 6011 */ 6012function createCache() { 6013 var keys = []; 6014 6015 function cache( key, value ) { 6016 6017 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 6018 if ( keys.push( key + " " ) > Expr.cacheLength ) { 6019 6020 // Only keep the most recent entries 6021 delete cache[ keys.shift() ]; 6022 } 6023 return ( cache[ key + " " ] = value ); 6024 } 6025 return cache; 6026} 6027 6028/** 6029 * Mark a function for special use by Sizzle 6030 * @param {Function} fn The function to mark 6031 */ 6032function markFunction( fn ) { 6033 fn[ expando ] = true; 6034 return fn; 6035} 6036 6037/** 6038 * Support testing using an element 6039 * @param {Function} fn Passed the created element and returns a boolean result 6040 */ 6041function assert( fn ) { 6042 var el = document.createElement( "fieldset" ); 6043 6044 try { 6045 return !!fn( el ); 6046 } catch ( e ) { 6047 return false; 6048 } finally { 6049 6050 // Remove from its parent by default 6051 if ( el.parentNode ) { 6052 el.parentNode.removeChild( el ); 6053 } 6054 6055 // release memory in IE 6056 el = null; 6057 } 6058} 6059 6060/** 6061 * Adds the same handler for all of the specified attrs 6062 * @param {String} attrs Pipe-separated list of attributes 6063 * @param {Function} handler The method that will be applied 6064 */ 6065function addHandle( attrs, handler ) { 6066 var arr = attrs.split( "|" ), 6067 i = arr.length; 6068 6069 while ( i-- ) { 6070 Expr.attrHandle[ arr[ i ] ] = handler; 6071 } 6072} 6073 6074/** 6075 * Checks document order of two siblings 6076 * @param {Element} a 6077 * @param {Element} b 6078 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 6079 */ 6080function siblingCheck( a, b ) { 6081 var cur = b && a, 6082 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 6083 a.sourceIndex - b.sourceIndex; 6084 6085 // Use IE sourceIndex if available on both nodes 6086 if ( diff ) { 6087 return diff; 6088 } 6089 6090 // Check if b follows a 6091 if ( cur ) { 6092 while ( ( cur = cur.nextSibling ) ) { 6093 if ( cur === b ) { 6094 return -1; 6095 } 6096 } 6097 } 6098 6099 return a ? 1 : -1; 6100} 6101 6102/** 6103 * Returns a function to use in pseudos for input types 6104 * @param {String} type 6105 */ 6106function createInputPseudo( type ) { 6107 return function( elem ) { 6108 var name = elem.nodeName.toLowerCase(); 6109 return name === "input" && elem.type === type; 6110 }; 6111} 6112 6113/** 6114 * Returns a function to use in pseudos for buttons 6115 * @param {String} type 6116 */ 6117function createButtonPseudo( type ) { 6118 return function( elem ) { 6119 var name = elem.nodeName.toLowerCase(); 6120 return ( name === "input" || name === "button" ) && elem.type === type; 6121 }; 6122} 6123 6124/** 6125 * Returns a function to use in pseudos for :enabled/:disabled 6126 * @param {Boolean} disabled true for :disabled; false for :enabled 6127 */ 6128function createDisabledPseudo( disabled ) { 6129 6130 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 6131 return function( elem ) { 6132 6133 // Only certain elements can match :enabled or :disabled 6134 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 6135 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 6136 if ( "form" in elem ) { 6137 6138 // Check for inherited disabledness on relevant non-disabled elements: 6139 // * listed form-associated elements in a disabled fieldset 6140 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 6141 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 6142 // * option elements in a disabled optgroup 6143 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 6144 // All such elements have a "form" property. 6145 if ( elem.parentNode && elem.disabled === false ) { 6146 6147 // Option elements defer to a parent optgroup if present 6148 if ( "label" in elem ) { 6149 if ( "label" in elem.parentNode ) { 6150 return elem.parentNode.disabled === disabled; 6151 } else { 6152 return elem.disabled === disabled; 6153 } 6154 } 6155 6156 // Support: IE 6 - 11 6157 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 6158 return elem.isDisabled === disabled || 6159 6160 // Where there is no isDisabled, check manually 6161 /* jshint -W018 */ 6162 elem.isDisabled !== !disabled && 6163 inDisabledFieldset( elem ) === disabled; 6164 } 6165 6166 return elem.disabled === disabled; 6167 6168 // Try to winnow out elements that can't be disabled before trusting the disabled property. 6169 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 6170 // even exist on them, let alone have a boolean value. 6171 } else if ( "label" in elem ) { 6172 return elem.disabled === disabled; 6173 } 6174 6175 // Remaining elements are neither :enabled nor :disabled 6176 return false; 6177 }; 6178} 6179 6180/** 6181 * Returns a function to use in pseudos for positionals 6182 * @param {Function} fn 6183 */ 6184function createPositionalPseudo( fn ) { 6185 return markFunction( function( argument ) { 6186 argument = +argument; 6187 return markFunction( function( seed, matches ) { 6188 var j, 6189 matchIndexes = fn( [], seed.length, argument ), 6190 i = matchIndexes.length; 6191 6192 // Match elements found at the specified indexes 6193 while ( i-- ) { 6194 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 6195 seed[ j ] = !( matches[ j ] = seed[ j ] ); 6196 } 6197 } 6198 } ); 6199 } ); 6200} 6201 6202/** 6203 * Checks a node for validity as a Sizzle context 6204 * @param {Element|Object=} context 6205 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 6206 */ 6207function testContext( context ) { 6208 return context && typeof context.getElementsByTagName !== "undefined" && context; 6209} 6210 6211// Expose support vars for convenience 6212support = Sizzle.support = {}; 6213 6214/** 6215 * Detects XML nodes 6216 * @param {Element|Object} elem An element or a document 6217 * @returns {Boolean} True iff elem is a non-HTML XML node 6218 */ 6219isXML = Sizzle.isXML = function( elem ) { 6220 var namespace = elem && elem.namespaceURI, 6221 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 6222 6223 // Support: IE <=8 6224 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 6225 // https://bugs.jquery.com/ticket/4833 6226 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 6227}; 6228 6229/** 6230 * Sets document-related variables once based on the current document 6231 * @param {Element|Object} [doc] An element or document object to use to set the document 6232 * @returns {Object} Returns the current document 6233 */ 6234setDocument = Sizzle.setDocument = function( node ) { 6235 var hasCompare, subWindow, 6236 doc = node ? node.ownerDocument || node : preferredDoc; 6237 6238 // Return early if doc is invalid or already selected 6239 // Support: IE 11+, Edge 17 - 18+ 6240 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6241 // two documents; shallow comparisons work. 6242 // eslint-disable-next-line eqeqeq 6243 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 6244 return document; 6245 } 6246 6247 // Update global variables 6248 document = doc; 6249 docElem = document.documentElement; 6250 documentIsHTML = !isXML( document ); 6251 6252 // Support: IE 9 - 11+, Edge 12 - 18+ 6253 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 6254 // Support: IE 11+, Edge 17 - 18+ 6255 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6256 // two documents; shallow comparisons work. 6257 // eslint-disable-next-line eqeqeq 6258 if ( preferredDoc != document && 6259 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 6260 6261 // Support: IE 11, Edge 6262 if ( subWindow.addEventListener ) { 6263 subWindow.addEventListener( "unload", unloadHandler, false ); 6264 6265 // Support: IE 9 - 10 only 6266 } else if ( subWindow.attachEvent ) { 6267 subWindow.attachEvent( "onunload", unloadHandler ); 6268 } 6269 } 6270 6271 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 6272 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 6273 // IE/Edge & older browsers don't support the :scope pseudo-class. 6274 // Support: Safari 6.0 only 6275 // Safari 6.0 supports :scope but it's an alias of :root there. 6276 support.scope = assert( function( el ) { 6277 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 6278 return typeof el.querySelectorAll !== "undefined" && 6279 !el.querySelectorAll( ":scope fieldset div" ).length; 6280 } ); 6281 6282 /* Attributes 6283 ---------------------------------------------------------------------- */ 6284 6285 // Support: IE<8 6286 // Verify that getAttribute really returns attributes and not properties 6287 // (excepting IE8 booleans) 6288 support.attributes = assert( function( el ) { 6289 el.className = "i"; 6290 return !el.getAttribute( "className" ); 6291 } ); 6292 6293 /* getElement(s)By* 6294 ---------------------------------------------------------------------- */ 6295 6296 // Check if getElementsByTagName("*") returns only elements 6297 support.getElementsByTagName = assert( function( el ) { 6298 el.appendChild( document.createComment( "" ) ); 6299 return !el.getElementsByTagName( "*" ).length; 6300 } ); 6301 6302 // Support: IE<9 6303 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 6304 6305 // Support: IE<10 6306 // Check if getElementById returns elements by name 6307 // The broken getElementById methods don't pick up programmatically-set names, 6308 // so use a roundabout getElementsByName test 6309 support.getById = assert( function( el ) { 6310 docElem.appendChild( el ).id = expando; 6311 return !document.getElementsByName || !document.getElementsByName( expando ).length; 6312 } ); 6313 6314 // ID filter and find 6315 if ( support.getById ) { 6316 Expr.filter[ "ID" ] = function( id ) { 6317 var attrId = id.replace( runescape, funescape ); 6318 return function( elem ) { 6319 return elem.getAttribute( "id" ) === attrId; 6320 }; 6321 }; 6322 Expr.find[ "ID" ] = function( id, context ) { 6323 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6324 var elem = context.getElementById( id ); 6325 return elem ? [ elem ] : []; 6326 } 6327 }; 6328 } else { 6329 Expr.filter[ "ID" ] = function( id ) { 6330 var attrId = id.replace( runescape, funescape ); 6331 return function( elem ) { 6332 var node = typeof elem.getAttributeNode !== "undefined" && 6333 elem.getAttributeNode( "id" ); 6334 return node && node.value === attrId; 6335 }; 6336 }; 6337 6338 // Support: IE 6 - 7 only 6339 // getElementById is not reliable as a find shortcut 6340 Expr.find[ "ID" ] = function( id, context ) { 6341 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6342 var node, i, elems, 6343 elem = context.getElementById( id ); 6344 6345 if ( elem ) { 6346 6347 // Verify the id attribute 6348 node = elem.getAttributeNode( "id" ); 6349 if ( node && node.value === id ) { 6350 return [ elem ]; 6351 } 6352 6353 // Fall back on getElementsByName 6354 elems = context.getElementsByName( id ); 6355 i = 0; 6356 while ( ( elem = elems[ i++ ] ) ) { 6357 node = elem.getAttributeNode( "id" ); 6358 if ( node && node.value === id ) { 6359 return [ elem ]; 6360 } 6361 } 6362 } 6363 6364 return []; 6365 } 6366 }; 6367 } 6368 6369 // Tag 6370 Expr.find[ "TAG" ] = support.getElementsByTagName ? 6371 function( tag, context ) { 6372 if ( typeof context.getElementsByTagName !== "undefined" ) { 6373 return context.getElementsByTagName( tag ); 6374 6375 // DocumentFragment nodes don't have gEBTN 6376 } else if ( support.qsa ) { 6377 return context.querySelectorAll( tag ); 6378 } 6379 } : 6380 6381 function( tag, context ) { 6382 var elem, 6383 tmp = [], 6384 i = 0, 6385 6386 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 6387 results = context.getElementsByTagName( tag ); 6388 6389 // Filter out possible comments 6390 if ( tag === "*" ) { 6391 while ( ( elem = results[ i++ ] ) ) { 6392 if ( elem.nodeType === 1 ) { 6393 tmp.push( elem ); 6394 } 6395 } 6396 6397 return tmp; 6398 } 6399 return results; 6400 }; 6401 6402 // Class 6403 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 6404 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 6405 return context.getElementsByClassName( className ); 6406 } 6407 }; 6408 6409 /* QSA/matchesSelector 6410 ---------------------------------------------------------------------- */ 6411 6412 // QSA and matchesSelector support 6413 6414 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 6415 rbuggyMatches = []; 6416 6417 // qSa(:focus) reports false when true (Chrome 21) 6418 // We allow this because of a bug in IE8/9 that throws an error 6419 // whenever `document.activeElement` is accessed on an iframe 6420 // So, we allow :focus to pass through QSA all the time to avoid the IE error 6421 // See https://bugs.jquery.com/ticket/13378 6422 rbuggyQSA = []; 6423 6424 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 6425 6426 // Build QSA regex 6427 // Regex strategy adopted from Diego Perini 6428 assert( function( el ) { 6429 6430 var input; 6431 6432 // Select is set to empty string on purpose 6433 // This is to test IE's treatment of not explicitly 6434 // setting a boolean content attribute, 6435 // since its presence should be enough 6436 // https://bugs.jquery.com/ticket/12359 6437 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 6438 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 6439 "<option selected=''></option></select>"; 6440 6441 // Support: IE8, Opera 11-12.16 6442 // Nothing should be selected when empty strings follow ^= or $= or *= 6443 // The test attribute must be unknown in Opera but "safe" for WinRT 6444 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 6445 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 6446 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 6447 } 6448 6449 // Support: IE8 6450 // Boolean attributes and "value" are not treated correctly 6451 if ( !el.querySelectorAll( "[selected]" ).length ) { 6452 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 6453 } 6454 6455 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 6456 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 6457 rbuggyQSA.push( "~=" ); 6458 } 6459 6460 // Support: IE 11+, Edge 15 - 18+ 6461 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 6462 // Adding a temporary attribute to the document before the selection works 6463 // around the issue. 6464 // Interestingly, IE 10 & older don't seem to have the issue. 6465 input = document.createElement( "input" ); 6466 input.setAttribute( "name", "" ); 6467 el.appendChild( input ); 6468 if ( !el.querySelectorAll( "[name='']" ).length ) { 6469 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 6470 whitespace + "*(?:''|\"\")" ); 6471 } 6472 6473 // Webkit/Opera - :checked should return selected option elements 6474 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 6475 // IE8 throws error here and will not see later tests 6476 if ( !el.querySelectorAll( ":checked" ).length ) { 6477 rbuggyQSA.push( ":checked" ); 6478 } 6479 6480 // Support: Safari 8+, iOS 8+ 6481 // https://bugs.webkit.org/show_bug.cgi?id=136851 6482 // In-page `selector#id sibling-combinator selector` fails 6483 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 6484 rbuggyQSA.push( ".#.+[+~]" ); 6485 } 6486 6487 // Support: Firefox <=3.6 - 5 only 6488 // Old Firefox doesn't throw on a badly-escaped identifier. 6489 el.querySelectorAll( "\\\f" ); 6490 rbuggyQSA.push( "[\\r\\n\\f]" ); 6491 } ); 6492 6493 assert( function( el ) { 6494 el.innerHTML = "<a href='' disabled='disabled'></a>" + 6495 "<select disabled='disabled'><option/></select>"; 6496 6497 // Support: Windows 8 Native Apps 6498 // The type and name attributes are restricted during .innerHTML assignment 6499 var input = document.createElement( "input" ); 6500 input.setAttribute( "type", "hidden" ); 6501 el.appendChild( input ).setAttribute( "name", "D" ); 6502 6503 // Support: IE8 6504 // Enforce case-sensitivity of name attribute 6505 if ( el.querySelectorAll( "[name=d]" ).length ) { 6506 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 6507 } 6508 6509 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 6510 // IE8 throws error here and will not see later tests 6511 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 6512 rbuggyQSA.push( ":enabled", ":disabled" ); 6513 } 6514 6515 // Support: IE9-11+ 6516 // IE's :disabled selector does not pick up the children of disabled fieldsets 6517 docElem.appendChild( el ).disabled = true; 6518 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 6519 rbuggyQSA.push( ":enabled", ":disabled" ); 6520 } 6521 6522 // Support: Opera 10 - 11 only 6523 // Opera 10-11 does not throw on post-comma invalid pseudos 6524 el.querySelectorAll( "*,:x" ); 6525 rbuggyQSA.push( ",.*:" ); 6526 } ); 6527 } 6528 6529 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 6530 docElem.webkitMatchesSelector || 6531 docElem.mozMatchesSelector || 6532 docElem.oMatchesSelector || 6533 docElem.msMatchesSelector ) ) ) ) { 6534 6535 assert( function( el ) { 6536 6537 // Check to see if it's possible to do matchesSelector 6538 // on a disconnected node (IE 9) 6539 support.disconnectedMatch = matches.call( el, "*" ); 6540 6541 // This should fail with an exception 6542 // Gecko does not error, returns false instead 6543 matches.call( el, "[s!='']:x" ); 6544 rbuggyMatches.push( "!=", pseudos ); 6545 } ); 6546 } 6547 6548 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 6549 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 6550 6551 /* Contains 6552 ---------------------------------------------------------------------- */ 6553 hasCompare = rnative.test( docElem.compareDocumentPosition ); 6554 6555 // Element contains another 6556 // Purposefully self-exclusive 6557 // As in, an element does not contain itself 6558 contains = hasCompare || rnative.test( docElem.contains ) ? 6559 function( a, b ) { 6560 var adown = a.nodeType === 9 ? a.documentElement : a, 6561 bup = b && b.parentNode; 6562 return a === bup || !!( bup && bup.nodeType === 1 && ( 6563 adown.contains ? 6564 adown.contains( bup ) : 6565 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 6566 ) ); 6567 } : 6568 function( a, b ) { 6569 if ( b ) { 6570 while ( ( b = b.parentNode ) ) { 6571 if ( b === a ) { 6572 return true; 6573 } 6574 } 6575 } 6576 return false; 6577 }; 6578 6579 /* Sorting 6580 ---------------------------------------------------------------------- */ 6581 6582 // Document order sorting 6583 sortOrder = hasCompare ? 6584 function( a, b ) { 6585 6586 // Flag for duplicate removal 6587 if ( a === b ) { 6588 hasDuplicate = true; 6589 return 0; 6590 } 6591 6592 // Sort on method existence if only one input has compareDocumentPosition 6593 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 6594 if ( compare ) { 6595 return compare; 6596 } 6597 6598 // Calculate position if both inputs belong to the same document 6599 // Support: IE 11+, Edge 17 - 18+ 6600 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6601 // two documents; shallow comparisons work. 6602 // eslint-disable-next-line eqeqeq 6603 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 6604 a.compareDocumentPosition( b ) : 6605 6606 // Otherwise we know they are disconnected 6607 1; 6608 6609 // Disconnected nodes 6610 if ( compare & 1 || 6611 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 6612 6613 // Choose the first element that is related to our preferred document 6614 // Support: IE 11+, Edge 17 - 18+ 6615 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6616 // two documents; shallow comparisons work. 6617 // eslint-disable-next-line eqeqeq 6618 if ( a == document || a.ownerDocument == preferredDoc && 6619 contains( preferredDoc, a ) ) { 6620 return -1; 6621 } 6622 6623 // Support: IE 11+, Edge 17 - 18+ 6624 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6625 // two documents; shallow comparisons work. 6626 // eslint-disable-next-line eqeqeq 6627 if ( b == document || b.ownerDocument == preferredDoc && 6628 contains( preferredDoc, b ) ) { 6629 return 1; 6630 } 6631 6632 // Maintain original order 6633 return sortInput ? 6634 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6635 0; 6636 } 6637 6638 return compare & 4 ? -1 : 1; 6639 } : 6640 function( a, b ) { 6641 6642 // Exit early if the nodes are identical 6643 if ( a === b ) { 6644 hasDuplicate = true; 6645 return 0; 6646 } 6647 6648 var cur, 6649 i = 0, 6650 aup = a.parentNode, 6651 bup = b.parentNode, 6652 ap = [ a ], 6653 bp = [ b ]; 6654 6655 // Parentless nodes are either documents or disconnected 6656 if ( !aup || !bup ) { 6657 6658 // Support: IE 11+, Edge 17 - 18+ 6659 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6660 // two documents; shallow comparisons work. 6661 /* eslint-disable eqeqeq */ 6662 return a == document ? -1 : 6663 b == document ? 1 : 6664 /* eslint-enable eqeqeq */ 6665 aup ? -1 : 6666 bup ? 1 : 6667 sortInput ? 6668 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6669 0; 6670 6671 // If the nodes are siblings, we can do a quick check 6672 } else if ( aup === bup ) { 6673 return siblingCheck( a, b ); 6674 } 6675 6676 // Otherwise we need full lists of their ancestors for comparison 6677 cur = a; 6678 while ( ( cur = cur.parentNode ) ) { 6679 ap.unshift( cur ); 6680 } 6681 cur = b; 6682 while ( ( cur = cur.parentNode ) ) { 6683 bp.unshift( cur ); 6684 } 6685 6686 // Walk down the tree looking for a discrepancy 6687 while ( ap[ i ] === bp[ i ] ) { 6688 i++; 6689 } 6690 6691 return i ? 6692 6693 // Do a sibling check if the nodes have a common ancestor 6694 siblingCheck( ap[ i ], bp[ i ] ) : 6695 6696 // Otherwise nodes in our document sort first 6697 // Support: IE 11+, Edge 17 - 18+ 6698 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6699 // two documents; shallow comparisons work. 6700 /* eslint-disable eqeqeq */ 6701 ap[ i ] == preferredDoc ? -1 : 6702 bp[ i ] == preferredDoc ? 1 : 6703 /* eslint-enable eqeqeq */ 6704 0; 6705 }; 6706 6707 return document; 6708}; 6709 6710Sizzle.matches = function( expr, elements ) { 6711 return Sizzle( expr, null, null, elements ); 6712}; 6713 6714Sizzle.matchesSelector = function( elem, expr ) { 6715 setDocument( elem ); 6716 6717 if ( support.matchesSelector && documentIsHTML && 6718 !nonnativeSelectorCache[ expr + " " ] && 6719 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 6720 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 6721 6722 try { 6723 var ret = matches.call( elem, expr ); 6724 6725 // IE 9's matchesSelector returns false on disconnected nodes 6726 if ( ret || support.disconnectedMatch || 6727 6728 // As well, disconnected nodes are said to be in a document 6729 // fragment in IE 9 6730 elem.document && elem.document.nodeType !== 11 ) { 6731 return ret; 6732 } 6733 } catch ( e ) { 6734 nonnativeSelectorCache( expr, true ); 6735 } 6736 } 6737 6738 return Sizzle( expr, document, null, [ elem ] ).length > 0; 6739}; 6740 6741Sizzle.contains = function( context, elem ) { 6742 6743 // Set document vars if needed 6744 // Support: IE 11+, Edge 17 - 18+ 6745 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6746 // two documents; shallow comparisons work. 6747 // eslint-disable-next-line eqeqeq 6748 if ( ( context.ownerDocument || context ) != document ) { 6749 setDocument( context ); 6750 } 6751 return contains( context, elem ); 6752}; 6753 6754Sizzle.attr = function( elem, name ) { 6755 6756 // Set document vars if needed 6757 // Support: IE 11+, Edge 17 - 18+ 6758 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6759 // two documents; shallow comparisons work. 6760 // eslint-disable-next-line eqeqeq 6761 if ( ( elem.ownerDocument || elem ) != document ) { 6762 setDocument( elem ); 6763 } 6764 6765 var fn = Expr.attrHandle[ name.toLowerCase() ], 6766 6767 // Don't get fooled by Object.prototype properties (jQuery #13807) 6768 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 6769 fn( elem, name, !documentIsHTML ) : 6770 undefined; 6771 6772 return val !== undefined ? 6773 val : 6774 support.attributes || !documentIsHTML ? 6775 elem.getAttribute( name ) : 6776 ( val = elem.getAttributeNode( name ) ) && val.specified ? 6777 val.value : 6778 null; 6779}; 6780 6781Sizzle.escape = function( sel ) { 6782 return ( sel + "" ).replace( rcssescape, fcssescape ); 6783}; 6784 6785Sizzle.error = function( msg ) { 6786 throw new Error( "Syntax error, unrecognized expression: " + msg ); 6787}; 6788 6789/** 6790 * Document sorting and removing duplicates 6791 * @param {ArrayLike} results 6792 */ 6793Sizzle.uniqueSort = function( results ) { 6794 var elem, 6795 duplicates = [], 6796 j = 0, 6797 i = 0; 6798 6799 // Unless we *know* we can detect duplicates, assume their presence 6800 hasDuplicate = !support.detectDuplicates; 6801 sortInput = !support.sortStable && results.slice( 0 ); 6802 results.sort( sortOrder ); 6803 6804 if ( hasDuplicate ) { 6805 while ( ( elem = results[ i++ ] ) ) { 6806 if ( elem === results[ i ] ) { 6807 j = duplicates.push( i ); 6808 } 6809 } 6810 while ( j-- ) { 6811 results.splice( duplicates[ j ], 1 ); 6812 } 6813 } 6814 6815 // Clear input after sorting to release objects 6816 // See https://github.com/jquery/sizzle/pull/225 6817 sortInput = null; 6818 6819 return results; 6820}; 6821 6822/** 6823 * Utility function for retrieving the text value of an array of DOM nodes 6824 * @param {Array|Element} elem 6825 */ 6826getText = Sizzle.getText = function( elem ) { 6827 var node, 6828 ret = "", 6829 i = 0, 6830 nodeType = elem.nodeType; 6831 6832 if ( !nodeType ) { 6833 6834 // If no nodeType, this is expected to be an array 6835 while ( ( node = elem[ i++ ] ) ) { 6836 6837 // Do not traverse comment nodes 6838 ret += getText( node ); 6839 } 6840 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 6841 6842 // Use textContent for elements 6843 // innerText usage removed for consistency of new lines (jQuery #11153) 6844 if ( typeof elem.textContent === "string" ) { 6845 return elem.textContent; 6846 } else { 6847 6848 // Traverse its children 6849 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6850 ret += getText( elem ); 6851 } 6852 } 6853 } else if ( nodeType === 3 || nodeType === 4 ) { 6854 return elem.nodeValue; 6855 } 6856 6857 // Do not include comment or processing instruction nodes 6858 6859 return ret; 6860}; 6861 6862Expr = Sizzle.selectors = { 6863 6864 // Can be adjusted by the user 6865 cacheLength: 50, 6866 6867 createPseudo: markFunction, 6868 6869 match: matchExpr, 6870 6871 attrHandle: {}, 6872 6873 find: {}, 6874 6875 relative: { 6876 ">": { dir: "parentNode", first: true }, 6877 " ": { dir: "parentNode" }, 6878 "+": { dir: "previousSibling", first: true }, 6879 "~": { dir: "previousSibling" } 6880 }, 6881 6882 preFilter: { 6883 "ATTR": function( match ) { 6884 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 6885 6886 // Move the given value to match[3] whether quoted or unquoted 6887 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 6888 match[ 5 ] || "" ).replace( runescape, funescape ); 6889 6890 if ( match[ 2 ] === "~=" ) { 6891 match[ 3 ] = " " + match[ 3 ] + " "; 6892 } 6893 6894 return match.slice( 0, 4 ); 6895 }, 6896 6897 "CHILD": function( match ) { 6898 6899 /* matches from matchExpr["CHILD"] 6900 1 type (only|nth|...) 6901 2 what (child|of-type) 6902 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 6903 4 xn-component of xn+y argument ([+-]?\d*n|) 6904 5 sign of xn-component 6905 6 x of xn-component 6906 7 sign of y-component 6907 8 y of y-component 6908 */ 6909 match[ 1 ] = match[ 1 ].toLowerCase(); 6910 6911 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 6912 6913 // nth-* requires argument 6914 if ( !match[ 3 ] ) { 6915 Sizzle.error( match[ 0 ] ); 6916 } 6917 6918 // numeric x and y parameters for Expr.filter.CHILD 6919 // remember that false/true cast respectively to 0/1 6920 match[ 4 ] = +( match[ 4 ] ? 6921 match[ 5 ] + ( match[ 6 ] || 1 ) : 6922 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 6923 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 6924 6925 // other types prohibit arguments 6926 } else if ( match[ 3 ] ) { 6927 Sizzle.error( match[ 0 ] ); 6928 } 6929 6930 return match; 6931 }, 6932 6933 "PSEUDO": function( match ) { 6934 var excess, 6935 unquoted = !match[ 6 ] && match[ 2 ]; 6936 6937 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 6938 return null; 6939 } 6940 6941 // Accept quoted arguments as-is 6942 if ( match[ 3 ] ) { 6943 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 6944 6945 // Strip excess characters from unquoted arguments 6946 } else if ( unquoted && rpseudo.test( unquoted ) && 6947 6948 // Get excess from tokenize (recursively) 6949 ( excess = tokenize( unquoted, true ) ) && 6950 6951 // advance to the next closing parenthesis 6952 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 6953 6954 // excess is a negative index 6955 match[ 0 ] = match[ 0 ].slice( 0, excess ); 6956 match[ 2 ] = unquoted.slice( 0, excess ); 6957 } 6958 6959 // Return only captures needed by the pseudo filter method (type and argument) 6960 return match.slice( 0, 3 ); 6961 } 6962 }, 6963 6964 filter: { 6965 6966 "TAG": function( nodeNameSelector ) { 6967 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 6968 return nodeNameSelector === "*" ? 6969 function() { 6970 return true; 6971 } : 6972 function( elem ) { 6973 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 6974 }; 6975 }, 6976 6977 "CLASS": function( className ) { 6978 var pattern = classCache[ className + " " ]; 6979 6980 return pattern || 6981 ( pattern = new RegExp( "(^|" + whitespace + 6982 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 6983 className, function( elem ) { 6984 return pattern.test( 6985 typeof elem.className === "string" && elem.className || 6986 typeof elem.getAttribute !== "undefined" && 6987 elem.getAttribute( "class" ) || 6988 "" 6989 ); 6990 } ); 6991 }, 6992 6993 "ATTR": function( name, operator, check ) { 6994 return function( elem ) { 6995 var result = Sizzle.attr( elem, name ); 6996 6997 if ( result == null ) { 6998 return operator === "!="; 6999 } 7000 if ( !operator ) { 7001 return true; 7002 } 7003 7004 result += ""; 7005 7006 /* eslint-disable max-len */ 7007 7008 return operator === "=" ? result === check : 7009 operator === "!=" ? result !== check : 7010 operator === "^=" ? check && result.indexOf( check ) === 0 : 7011 operator === "*=" ? check && result.indexOf( check ) > -1 : 7012 operator === "$=" ? check && result.slice( -check.length ) === check : 7013 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 7014 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 7015 false; 7016 /* eslint-enable max-len */ 7017 7018 }; 7019 }, 7020 7021 "CHILD": function( type, what, _argument, first, last ) { 7022 var simple = type.slice( 0, 3 ) !== "nth", 7023 forward = type.slice( -4 ) !== "last", 7024 ofType = what === "of-type"; 7025 7026 return first === 1 && last === 0 ? 7027 7028 // Shortcut for :nth-*(n) 7029 function( elem ) { 7030 return !!elem.parentNode; 7031 } : 7032 7033 function( elem, _context, xml ) { 7034 var cache, uniqueCache, outerCache, node, nodeIndex, start, 7035 dir = simple !== forward ? "nextSibling" : "previousSibling", 7036 parent = elem.parentNode, 7037 name = ofType && elem.nodeName.toLowerCase(), 7038 useCache = !xml && !ofType, 7039 diff = false; 7040 7041 if ( parent ) { 7042 7043 // :(first|last|only)-(child|of-type) 7044 if ( simple ) { 7045 while ( dir ) { 7046 node = elem; 7047 while ( ( node = node[ dir ] ) ) { 7048 if ( ofType ? 7049 node.nodeName.toLowerCase() === name : 7050 node.nodeType === 1 ) { 7051 7052 return false; 7053 } 7054 } 7055 7056 // Reverse direction for :only-* (if we haven't yet done so) 7057 start = dir = type === "only" && !start && "nextSibling"; 7058 } 7059 return true; 7060 } 7061 7062 start = [ forward ? parent.firstChild : parent.lastChild ]; 7063 7064 // non-xml :nth-child(...) stores cache data on `parent` 7065 if ( forward && useCache ) { 7066 7067 // Seek `elem` from a previously-cached index 7068 7069 // ...in a gzip-friendly way 7070 node = parent; 7071 outerCache = node[ expando ] || ( node[ expando ] = {} ); 7072 7073 // Support: IE <9 only 7074 // Defend against cloned attroperties (jQuery gh-1709) 7075 uniqueCache = outerCache[ node.uniqueID ] || 7076 ( outerCache[ node.uniqueID ] = {} ); 7077 7078 cache = uniqueCache[ type ] || []; 7079 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 7080 diff = nodeIndex && cache[ 2 ]; 7081 node = nodeIndex && parent.childNodes[ nodeIndex ]; 7082 7083 while ( ( node = ++nodeIndex && node && node[ dir ] || 7084 7085 // Fallback to seeking `elem` from the start 7086 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 7087 7088 // When found, cache indexes on `parent` and break 7089 if ( node.nodeType === 1 && ++diff && node === elem ) { 7090 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 7091 break; 7092 } 7093 } 7094 7095 } else { 7096 7097 // Use previously-cached element index if available 7098 if ( useCache ) { 7099 7100 // ...in a gzip-friendly way 7101 node = elem; 7102 outerCache = node[ expando ] || ( node[ expando ] = {} ); 7103 7104 // Support: IE <9 only 7105 // Defend against cloned attroperties (jQuery gh-1709) 7106 uniqueCache = outerCache[ node.uniqueID ] || 7107 ( outerCache[ node.uniqueID ] = {} ); 7108 7109 cache = uniqueCache[ type ] || []; 7110 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 7111 diff = nodeIndex; 7112 } 7113 7114 // xml :nth-child(...) 7115 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 7116 if ( diff === false ) { 7117 7118 // Use the same loop as above to seek `elem` from the start 7119 while ( ( node = ++nodeIndex && node && node[ dir ] || 7120 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 7121 7122 if ( ( ofType ? 7123 node.nodeName.toLowerCase() === name : 7124 node.nodeType === 1 ) && 7125 ++diff ) { 7126 7127 // Cache the index of each encountered element 7128 if ( useCache ) { 7129 outerCache = node[ expando ] || 7130 ( node[ expando ] = {} ); 7131 7132 // Support: IE <9 only 7133 // Defend against cloned attroperties (jQuery gh-1709) 7134 uniqueCache = outerCache[ node.uniqueID ] || 7135 ( outerCache[ node.uniqueID ] = {} ); 7136 7137 uniqueCache[ type ] = [ dirruns, diff ]; 7138 } 7139 7140 if ( node === elem ) { 7141 break; 7142 } 7143 } 7144 } 7145 } 7146 } 7147 7148 // Incorporate the offset, then check against cycle size 7149 diff -= last; 7150 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 7151 } 7152 }; 7153 }, 7154 7155 "PSEUDO": function( pseudo, argument ) { 7156 7157 // pseudo-class names are case-insensitive 7158 // http://www.w3.org/TR/selectors/#pseudo-classes 7159 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 7160 // Remember that setFilters inherits from pseudos 7161 var args, 7162 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 7163 Sizzle.error( "unsupported pseudo: " + pseudo ); 7164 7165 // The user may use createPseudo to indicate that 7166 // arguments are needed to create the filter function 7167 // just as Sizzle does 7168 if ( fn[ expando ] ) { 7169 return fn( argument ); 7170 } 7171 7172 // But maintain support for old signatures 7173 if ( fn.length > 1 ) { 7174 args = [ pseudo, pseudo, "", argument ]; 7175 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 7176 markFunction( function( seed, matches ) { 7177 var idx, 7178 matched = fn( seed, argument ), 7179 i = matched.length; 7180 while ( i-- ) { 7181 idx = indexOf( seed, matched[ i ] ); 7182 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 7183 } 7184 } ) : 7185 function( elem ) { 7186 return fn( elem, 0, args ); 7187 }; 7188 } 7189 7190 return fn; 7191 } 7192 }, 7193 7194 pseudos: { 7195 7196 // Potentially complex pseudos 7197 "not": markFunction( function( selector ) { 7198 7199 // Trim the selector passed to compile 7200 // to avoid treating leading and trailing 7201 // spaces as combinators 7202 var input = [], 7203 results = [], 7204 matcher = compile( selector.replace( rtrim, "$1" ) ); 7205 7206 return matcher[ expando ] ? 7207 markFunction( function( seed, matches, _context, xml ) { 7208 var elem, 7209 unmatched = matcher( seed, null, xml, [] ), 7210 i = seed.length; 7211 7212 // Match elements unmatched by `matcher` 7213 while ( i-- ) { 7214 if ( ( elem = unmatched[ i ] ) ) { 7215 seed[ i ] = !( matches[ i ] = elem ); 7216 } 7217 } 7218 } ) : 7219 function( elem, _context, xml ) { 7220 input[ 0 ] = elem; 7221 matcher( input, null, xml, results ); 7222 7223 // Don't keep the element (issue #299) 7224 input[ 0 ] = null; 7225 return !results.pop(); 7226 }; 7227 } ), 7228 7229 "has": markFunction( function( selector ) { 7230 return function( elem ) { 7231 return Sizzle( selector, elem ).length > 0; 7232 }; 7233 } ), 7234 7235 "contains": markFunction( function( text ) { 7236 text = text.replace( runescape, funescape ); 7237 return function( elem ) { 7238 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 7239 }; 7240 } ), 7241 7242 // "Whether an element is represented by a :lang() selector 7243 // is based solely on the element's language value 7244 // being equal to the identifier C, 7245 // or beginning with the identifier C immediately followed by "-". 7246 // The matching of C against the element's language value is performed case-insensitively. 7247 // The identifier C does not have to be a valid language name." 7248 // http://www.w3.org/TR/selectors/#lang-pseudo 7249 "lang": markFunction( function( lang ) { 7250 7251 // lang value must be a valid identifier 7252 if ( !ridentifier.test( lang || "" ) ) { 7253 Sizzle.error( "unsupported lang: " + lang ); 7254 } 7255 lang = lang.replace( runescape, funescape ).toLowerCase(); 7256 return function( elem ) { 7257 var elemLang; 7258 do { 7259 if ( ( elemLang = documentIsHTML ? 7260 elem.lang : 7261 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 7262 7263 elemLang = elemLang.toLowerCase(); 7264 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 7265 } 7266 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 7267 return false; 7268 }; 7269 } ), 7270 7271 // Miscellaneous 7272 "target": function( elem ) { 7273 var hash = window.location && window.location.hash; 7274 return hash && hash.slice( 1 ) === elem.id; 7275 }, 7276 7277 "root": function( elem ) { 7278 return elem === docElem; 7279 }, 7280 7281 "focus": function( elem ) { 7282 return elem === document.activeElement && 7283 ( !document.hasFocus || document.hasFocus() ) && 7284 !!( elem.type || elem.href || ~elem.tabIndex ); 7285 }, 7286 7287 // Boolean properties 7288 "enabled": createDisabledPseudo( false ), 7289 "disabled": createDisabledPseudo( true ), 7290 7291 "checked": function( elem ) { 7292 7293 // In CSS3, :checked should return both checked and selected elements 7294 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 7295 var nodeName = elem.nodeName.toLowerCase(); 7296 return ( nodeName === "input" && !!elem.checked ) || 7297 ( nodeName === "option" && !!elem.selected ); 7298 }, 7299 7300 "selected": function( elem ) { 7301 7302 // Accessing this property makes selected-by-default 7303 // options in Safari work properly 7304 if ( elem.parentNode ) { 7305 // eslint-disable-next-line no-unused-expressions 7306 elem.parentNode.selectedIndex; 7307 } 7308 7309 return elem.selected === true; 7310 }, 7311 7312 // Contents 7313 "empty": function( elem ) { 7314 7315 // http://www.w3.org/TR/selectors/#empty-pseudo 7316 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 7317 // but not by others (comment: 8; processing instruction: 7; etc.) 7318 // nodeType < 6 works because attributes (2) do not appear as children 7319 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 7320 if ( elem.nodeType < 6 ) { 7321 return false; 7322 } 7323 } 7324 return true; 7325 }, 7326 7327 "parent": function( elem ) { 7328 return !Expr.pseudos[ "empty" ]( elem ); 7329 }, 7330 7331 // Element/input types 7332 "header": function( elem ) { 7333 return rheader.test( elem.nodeName ); 7334 }, 7335 7336 "input": function( elem ) { 7337 return rinputs.test( elem.nodeName ); 7338 }, 7339 7340 "button": function( elem ) { 7341 var name = elem.nodeName.toLowerCase(); 7342 return name === "input" && elem.type === "button" || name === "button"; 7343 }, 7344 7345 "text": function( elem ) { 7346 var attr; 7347 return elem.nodeName.toLowerCase() === "input" && 7348 elem.type === "text" && 7349 7350 // Support: IE<8 7351 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 7352 ( ( attr = elem.getAttribute( "type" ) ) == null || 7353 attr.toLowerCase() === "text" ); 7354 }, 7355 7356 // Position-in-collection 7357 "first": createPositionalPseudo( function() { 7358 return [ 0 ]; 7359 } ), 7360 7361 "last": createPositionalPseudo( function( _matchIndexes, length ) { 7362 return [ length - 1 ]; 7363 } ), 7364 7365 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 7366 return [ argument < 0 ? argument + length : argument ]; 7367 } ), 7368 7369 "even": createPositionalPseudo( function( matchIndexes, length ) { 7370 var i = 0; 7371 for ( ; i < length; i += 2 ) { 7372 matchIndexes.push( i ); 7373 } 7374 return matchIndexes; 7375 } ), 7376 7377 "odd": createPositionalPseudo( function( matchIndexes, length ) { 7378 var i = 1; 7379 for ( ; i < length; i += 2 ) { 7380 matchIndexes.push( i ); 7381 } 7382 return matchIndexes; 7383 } ), 7384 7385 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 7386 var i = argument < 0 ? 7387 argument + length : 7388 argument > length ? 7389 length : 7390 argument; 7391 for ( ; --i >= 0; ) { 7392 matchIndexes.push( i ); 7393 } 7394 return matchIndexes; 7395 } ), 7396 7397 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 7398 var i = argument < 0 ? argument + length : argument; 7399 for ( ; ++i < length; ) { 7400 matchIndexes.push( i ); 7401 } 7402 return matchIndexes; 7403 } ) 7404 } 7405}; 7406 7407Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 7408 7409// Add button/input type pseudos 7410for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 7411 Expr.pseudos[ i ] = createInputPseudo( i ); 7412} 7413for ( i in { submit: true, reset: true } ) { 7414 Expr.pseudos[ i ] = createButtonPseudo( i ); 7415} 7416 7417// Easy API for creating new setFilters 7418function setFilters() {} 7419setFilters.prototype = Expr.filters = Expr.pseudos; 7420Expr.setFilters = new setFilters(); 7421 7422tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 7423 var matched, match, tokens, type, 7424 soFar, groups, preFilters, 7425 cached = tokenCache[ selector + " " ]; 7426 7427 if ( cached ) { 7428 return parseOnly ? 0 : cached.slice( 0 ); 7429 } 7430 7431 soFar = selector; 7432 groups = []; 7433 preFilters = Expr.preFilter; 7434 7435 while ( soFar ) { 7436 7437 // Comma and first run 7438 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 7439 if ( match ) { 7440 7441 // Don't consume trailing commas as valid 7442 soFar = soFar.slice( match[ 0 ].length ) || soFar; 7443 } 7444 groups.push( ( tokens = [] ) ); 7445 } 7446 7447 matched = false; 7448 7449 // Combinators 7450 if ( ( match = rcombinators.exec( soFar ) ) ) { 7451 matched = match.shift(); 7452 tokens.push( { 7453 value: matched, 7454 7455 // Cast descendant combinators to space 7456 type: match[ 0 ].replace( rtrim, " " ) 7457 } ); 7458 soFar = soFar.slice( matched.length ); 7459 } 7460 7461 // Filters 7462 for ( type in Expr.filter ) { 7463 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 7464 ( match = preFilters[ type ]( match ) ) ) ) { 7465 matched = match.shift(); 7466 tokens.push( { 7467 value: matched, 7468 type: type, 7469 matches: match 7470 } ); 7471 soFar = soFar.slice( matched.length ); 7472 } 7473 } 7474 7475 if ( !matched ) { 7476 break; 7477 } 7478 } 7479 7480 // Return the length of the invalid excess 7481 // if we're just parsing 7482 // Otherwise, throw an error or return tokens 7483 return parseOnly ? 7484 soFar.length : 7485 soFar ? 7486 Sizzle.error( selector ) : 7487 7488 // Cache the tokens 7489 tokenCache( selector, groups ).slice( 0 ); 7490}; 7491 7492function toSelector( tokens ) { 7493 var i = 0, 7494 len = tokens.length, 7495 selector = ""; 7496 for ( ; i < len; i++ ) { 7497 selector += tokens[ i ].value; 7498 } 7499 return selector; 7500} 7501 7502function addCombinator( matcher, combinator, base ) { 7503 var dir = combinator.dir, 7504 skip = combinator.next, 7505 key = skip || dir, 7506 checkNonElements = base && key === "parentNode", 7507 doneName = done++; 7508 7509 return combinator.first ? 7510 7511 // Check against closest ancestor/preceding element 7512 function( elem, context, xml ) { 7513 while ( ( elem = elem[ dir ] ) ) { 7514 if ( elem.nodeType === 1 || checkNonElements ) { 7515 return matcher( elem, context, xml ); 7516 } 7517 } 7518 return false; 7519 } : 7520 7521 // Check against all ancestor/preceding elements 7522 function( elem, context, xml ) { 7523 var oldCache, uniqueCache, outerCache, 7524 newCache = [ dirruns, doneName ]; 7525 7526 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 7527 if ( xml ) { 7528 while ( ( elem = elem[ dir ] ) ) { 7529 if ( elem.nodeType === 1 || checkNonElements ) { 7530 if ( matcher( elem, context, xml ) ) { 7531 return true; 7532 } 7533 } 7534 } 7535 } else { 7536 while ( ( elem = elem[ dir ] ) ) { 7537 if ( elem.nodeType === 1 || checkNonElements ) { 7538 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 7539 7540 // Support: IE <9 only 7541 // Defend against cloned attroperties (jQuery gh-1709) 7542 uniqueCache = outerCache[ elem.uniqueID ] || 7543 ( outerCache[ elem.uniqueID ] = {} ); 7544 7545 if ( skip && skip === elem.nodeName.toLowerCase() ) { 7546 elem = elem[ dir ] || elem; 7547 } else if ( ( oldCache = uniqueCache[ key ] ) && 7548 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 7549 7550 // Assign to newCache so results back-propagate to previous elements 7551 return ( newCache[ 2 ] = oldCache[ 2 ] ); 7552 } else { 7553 7554 // Reuse newcache so results back-propagate to previous elements 7555 uniqueCache[ key ] = newCache; 7556 7557 // A match means we're done; a fail means we have to keep checking 7558 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 7559 return true; 7560 } 7561 } 7562 } 7563 } 7564 } 7565 return false; 7566 }; 7567} 7568 7569function elementMatcher( matchers ) { 7570 return matchers.length > 1 ? 7571 function( elem, context, xml ) { 7572 var i = matchers.length; 7573 while ( i-- ) { 7574 if ( !matchers[ i ]( elem, context, xml ) ) { 7575 return false; 7576 } 7577 } 7578 return true; 7579 } : 7580 matchers[ 0 ]; 7581} 7582 7583function multipleContexts( selector, contexts, results ) { 7584 var i = 0, 7585 len = contexts.length; 7586 for ( ; i < len; i++ ) { 7587 Sizzle( selector, contexts[ i ], results ); 7588 } 7589 return results; 7590} 7591 7592function condense( unmatched, map, filter, context, xml ) { 7593 var elem, 7594 newUnmatched = [], 7595 i = 0, 7596 len = unmatched.length, 7597 mapped = map != null; 7598 7599 for ( ; i < len; i++ ) { 7600 if ( ( elem = unmatched[ i ] ) ) { 7601 if ( !filter || filter( elem, context, xml ) ) { 7602 newUnmatched.push( elem ); 7603 if ( mapped ) { 7604 map.push( i ); 7605 } 7606 } 7607 } 7608 } 7609 7610 return newUnmatched; 7611} 7612 7613function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 7614 if ( postFilter && !postFilter[ expando ] ) { 7615 postFilter = setMatcher( postFilter ); 7616 } 7617 if ( postFinder && !postFinder[ expando ] ) { 7618 postFinder = setMatcher( postFinder, postSelector ); 7619 } 7620 return markFunction( function( seed, results, context, xml ) { 7621 var temp, i, elem, 7622 preMap = [], 7623 postMap = [], 7624 preexisting = results.length, 7625 7626 // Get initial elements from seed or context 7627 elems = seed || multipleContexts( 7628 selector || "*", 7629 context.nodeType ? [ context ] : context, 7630 [] 7631 ), 7632 7633 // Prefilter to get matcher input, preserving a map for seed-results synchronization 7634 matcherIn = preFilter && ( seed || !selector ) ? 7635 condense( elems, preMap, preFilter, context, xml ) : 7636 elems, 7637 7638 matcherOut = matcher ? 7639 7640 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 7641 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 7642 7643 // ...intermediate processing is necessary 7644 [] : 7645 7646 // ...otherwise use results directly 7647 results : 7648 matcherIn; 7649 7650 // Find primary matches 7651 if ( matcher ) { 7652 matcher( matcherIn, matcherOut, context, xml ); 7653 } 7654 7655 // Apply postFilter 7656 if ( postFilter ) { 7657 temp = condense( matcherOut, postMap ); 7658 postFilter( temp, [], context, xml ); 7659 7660 // Un-match failing elements by moving them back to matcherIn 7661 i = temp.length; 7662 while ( i-- ) { 7663 if ( ( elem = temp[ i ] ) ) { 7664 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 7665 } 7666 } 7667 } 7668 7669 if ( seed ) { 7670 if ( postFinder || preFilter ) { 7671 if ( postFinder ) { 7672 7673 // Get the final matcherOut by condensing this intermediate into postFinder contexts 7674 temp = []; 7675 i = matcherOut.length; 7676 while ( i-- ) { 7677 if ( ( elem = matcherOut[ i ] ) ) { 7678 7679 // Restore matcherIn since elem is not yet a final match 7680 temp.push( ( matcherIn[ i ] = elem ) ); 7681 } 7682 } 7683 postFinder( null, ( matcherOut = [] ), temp, xml ); 7684 } 7685 7686 // Move matched elements from seed to results to keep them synchronized 7687 i = matcherOut.length; 7688 while ( i-- ) { 7689 if ( ( elem = matcherOut[ i ] ) && 7690 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 7691 7692 seed[ temp ] = !( results[ temp ] = elem ); 7693 } 7694 } 7695 } 7696 7697 // Add elements to results, through postFinder if defined 7698 } else { 7699 matcherOut = condense( 7700 matcherOut === results ? 7701 matcherOut.splice( preexisting, matcherOut.length ) : 7702 matcherOut 7703 ); 7704 if ( postFinder ) { 7705 postFinder( null, results, matcherOut, xml ); 7706 } else { 7707 push.apply( results, matcherOut ); 7708 } 7709 } 7710 } ); 7711} 7712 7713function matcherFromTokens( tokens ) { 7714 var checkContext, matcher, j, 7715 len = tokens.length, 7716 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 7717 implicitRelative = leadingRelative || Expr.relative[ " " ], 7718 i = leadingRelative ? 1 : 0, 7719 7720 // The foundational matcher ensures that elements are reachable from top-level context(s) 7721 matchContext = addCombinator( function( elem ) { 7722 return elem === checkContext; 7723 }, implicitRelative, true ), 7724 matchAnyContext = addCombinator( function( elem ) { 7725 return indexOf( checkContext, elem ) > -1; 7726 }, implicitRelative, true ), 7727 matchers = [ function( elem, context, xml ) { 7728 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 7729 ( checkContext = context ).nodeType ? 7730 matchContext( elem, context, xml ) : 7731 matchAnyContext( elem, context, xml ) ); 7732 7733 // Avoid hanging onto element (issue #299) 7734 checkContext = null; 7735 return ret; 7736 } ]; 7737 7738 for ( ; i < len; i++ ) { 7739 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 7740 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 7741 } else { 7742 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 7743 7744 // Return special upon seeing a positional matcher 7745 if ( matcher[ expando ] ) { 7746 7747 // Find the next relative operator (if any) for proper handling 7748 j = ++i; 7749 for ( ; j < len; j++ ) { 7750 if ( Expr.relative[ tokens[ j ].type ] ) { 7751 break; 7752 } 7753 } 7754 return setMatcher( 7755 i > 1 && elementMatcher( matchers ), 7756 i > 1 && toSelector( 7757 7758 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 7759 tokens 7760 .slice( 0, i - 1 ) 7761 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 7762 ).replace( rtrim, "$1" ), 7763 matcher, 7764 i < j && matcherFromTokens( tokens.slice( i, j ) ), 7765 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 7766 j < len && toSelector( tokens ) 7767 ); 7768 } 7769 matchers.push( matcher ); 7770 } 7771 } 7772 7773 return elementMatcher( matchers ); 7774} 7775 7776function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 7777 var bySet = setMatchers.length > 0, 7778 byElement = elementMatchers.length > 0, 7779 superMatcher = function( seed, context, xml, results, outermost ) { 7780 var elem, j, matcher, 7781 matchedCount = 0, 7782 i = "0", 7783 unmatched = seed && [], 7784 setMatched = [], 7785 contextBackup = outermostContext, 7786 7787 // We must always have either seed elements or outermost context 7788 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 7789 7790 // Use integer dirruns iff this is the outermost matcher 7791 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 7792 len = elems.length; 7793 7794 if ( outermost ) { 7795 7796 // Support: IE 11+, Edge 17 - 18+ 7797 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7798 // two documents; shallow comparisons work. 7799 // eslint-disable-next-line eqeqeq 7800 outermostContext = context == document || context || outermost; 7801 } 7802 7803 // Add elements passing elementMatchers directly to results 7804 // Support: IE<9, Safari 7805 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 7806 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 7807 if ( byElement && elem ) { 7808 j = 0; 7809 7810 // Support: IE 11+, Edge 17 - 18+ 7811 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7812 // two documents; shallow comparisons work. 7813 // eslint-disable-next-line eqeqeq 7814 if ( !context && elem.ownerDocument != document ) { 7815 setDocument( elem ); 7816 xml = !documentIsHTML; 7817 } 7818 while ( ( matcher = elementMatchers[ j++ ] ) ) { 7819 if ( matcher( elem, context || document, xml ) ) { 7820 results.push( elem ); 7821 break; 7822 } 7823 } 7824 if ( outermost ) { 7825 dirruns = dirrunsUnique; 7826 } 7827 } 7828 7829 // Track unmatched elements for set filters 7830 if ( bySet ) { 7831 7832 // They will have gone through all possible matchers 7833 if ( ( elem = !matcher && elem ) ) { 7834 matchedCount--; 7835 } 7836 7837 // Lengthen the array for every element, matched or not 7838 if ( seed ) { 7839 unmatched.push( elem ); 7840 } 7841 } 7842 } 7843 7844 // `i` is now the count of elements visited above, and adding it to `matchedCount` 7845 // makes the latter nonnegative. 7846 matchedCount += i; 7847 7848 // Apply set filters to unmatched elements 7849 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 7850 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 7851 // no element matchers and no seed. 7852 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 7853 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 7854 // numerically zero. 7855 if ( bySet && i !== matchedCount ) { 7856 j = 0; 7857 while ( ( matcher = setMatchers[ j++ ] ) ) { 7858 matcher( unmatched, setMatched, context, xml ); 7859 } 7860 7861 if ( seed ) { 7862 7863 // Reintegrate element matches to eliminate the need for sorting 7864 if ( matchedCount > 0 ) { 7865 while ( i-- ) { 7866 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 7867 setMatched[ i ] = pop.call( results ); 7868 } 7869 } 7870 } 7871 7872 // Discard index placeholder values to get only actual matches 7873 setMatched = condense( setMatched ); 7874 } 7875 7876 // Add matches to results 7877 push.apply( results, setMatched ); 7878 7879 // Seedless set matches succeeding multiple successful matchers stipulate sorting 7880 if ( outermost && !seed && setMatched.length > 0 && 7881 ( matchedCount + setMatchers.length ) > 1 ) { 7882 7883 Sizzle.uniqueSort( results ); 7884 } 7885 } 7886 7887 // Override manipulation of globals by nested matchers 7888 if ( outermost ) { 7889 dirruns = dirrunsUnique; 7890 outermostContext = contextBackup; 7891 } 7892 7893 return unmatched; 7894 }; 7895 7896 return bySet ? 7897 markFunction( superMatcher ) : 7898 superMatcher; 7899} 7900 7901compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 7902 var i, 7903 setMatchers = [], 7904 elementMatchers = [], 7905 cached = compilerCache[ selector + " " ]; 7906 7907 if ( !cached ) { 7908 7909 // Generate a function of recursive functions that can be used to check each element 7910 if ( !match ) { 7911 match = tokenize( selector ); 7912 } 7913 i = match.length; 7914 while ( i-- ) { 7915 cached = matcherFromTokens( match[ i ] ); 7916 if ( cached[ expando ] ) { 7917 setMatchers.push( cached ); 7918 } else { 7919 elementMatchers.push( cached ); 7920 } 7921 } 7922 7923 // Cache the compiled function 7924 cached = compilerCache( 7925 selector, 7926 matcherFromGroupMatchers( elementMatchers, setMatchers ) 7927 ); 7928 7929 // Save selector and tokenization 7930 cached.selector = selector; 7931 } 7932 return cached; 7933}; 7934 7935/** 7936 * A low-level selection function that works with Sizzle's compiled 7937 * selector functions 7938 * @param {String|Function} selector A selector or a pre-compiled 7939 * selector function built with Sizzle.compile 7940 * @param {Element} context 7941 * @param {Array} [results] 7942 * @param {Array} [seed] A set of elements to match against 7943 */ 7944select = Sizzle.select = function( selector, context, results, seed ) { 7945 var i, tokens, token, type, find, 7946 compiled = typeof selector === "function" && selector, 7947 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 7948 7949 results = results || []; 7950 7951 // Try to minimize operations if there is only one selector in the list and no seed 7952 // (the latter of which guarantees us context) 7953 if ( match.length === 1 ) { 7954 7955 // Reduce context if the leading compound selector is an ID 7956 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 7957 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 7958 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 7959 7960 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 7961 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 7962 if ( !context ) { 7963 return results; 7964 7965 // Precompiled matchers will still verify ancestry, so step up a level 7966 } else if ( compiled ) { 7967 context = context.parentNode; 7968 } 7969 7970 selector = selector.slice( tokens.shift().value.length ); 7971 } 7972 7973 // Fetch a seed set for right-to-left matching 7974 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 7975 while ( i-- ) { 7976 token = tokens[ i ]; 7977 7978 // Abort if we hit a combinator 7979 if ( Expr.relative[ ( type = token.type ) ] ) { 7980 break; 7981 } 7982 if ( ( find = Expr.find[ type ] ) ) { 7983 7984 // Search, expanding context for leading sibling combinators 7985 if ( ( seed = find( 7986 token.matches[ 0 ].replace( runescape, funescape ), 7987 rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || 7988 context 7989 ) ) ) { 7990 7991 // If seed is empty or no tokens remain, we can return early 7992 tokens.splice( i, 1 ); 7993 selector = seed.length && toSelector( tokens ); 7994 if ( !selector ) { 7995 push.apply( results, seed ); 7996 return results; 7997 } 7998 7999 break; 8000 } 8001 } 8002 } 8003 } 8004 8005 // Compile and execute a filtering function if one is not provided 8006 // Provide `match` to avoid retokenization if we modified the selector above 8007 ( compiled || compile( selector, match ) )( 8008 seed, 8009 context, 8010 !documentIsHTML, 8011 results, 8012 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 8013 ); 8014 return results; 8015}; 8016 8017// One-time assignments 8018 8019// Sort stability 8020support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 8021 8022// Support: Chrome 14-35+ 8023// Always assume duplicates if they aren't passed to the comparison function 8024support.detectDuplicates = !!hasDuplicate; 8025 8026// Initialize against the default document 8027setDocument(); 8028 8029// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 8030// Detached nodes confoundingly follow *each other* 8031support.sortDetached = assert( function( el ) { 8032 8033 // Should return 1, but returns 4 (following) 8034 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 8035} ); 8036 8037// Support: IE<8 8038// Prevent attribute/property "interpolation" 8039// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 8040if ( !assert( function( el ) { 8041 el.innerHTML = "<a href='#'></a>"; 8042 return el.firstChild.getAttribute( "href" ) === "#"; 8043} ) ) { 8044 addHandle( "type|href|height|width", function( elem, name, isXML ) { 8045 if ( !isXML ) { 8046 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 8047 } 8048 } ); 8049} 8050 8051// Support: IE<9 8052// Use defaultValue in place of getAttribute("value") 8053if ( !support.attributes || !assert( function( el ) { 8054 el.innerHTML = "<input/>"; 8055 el.firstChild.setAttribute( "value", "" ); 8056 return el.firstChild.getAttribute( "value" ) === ""; 8057} ) ) { 8058 addHandle( "value", function( elem, _name, isXML ) { 8059 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 8060 return elem.defaultValue; 8061 } 8062 } ); 8063} 8064 8065// Support: IE<9 8066// Use getAttributeNode to fetch booleans when getAttribute lies 8067if ( !assert( function( el ) { 8068 return el.getAttribute( "disabled" ) == null; 8069} ) ) { 8070 addHandle( booleans, function( elem, name, isXML ) { 8071 var val; 8072 if ( !isXML ) { 8073 return elem[ name ] === true ? name.toLowerCase() : 8074 ( val = elem.getAttributeNode( name ) ) && val.specified ? 8075 val.value : 8076 null; 8077 } 8078 } ); 8079} 8080 8081return Sizzle; 8082 8083} )( window ); 8084 8085 8086 8087jQuery.find = Sizzle; 8088jQuery.expr = Sizzle.selectors; 8089 8090// Deprecated 8091jQuery.expr[ ":" ] = jQuery.expr.pseudos; 8092jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 8093jQuery.text = Sizzle.getText; 8094jQuery.isXMLDoc = Sizzle.isXML; 8095jQuery.contains = Sizzle.contains; 8096jQuery.escapeSelector = Sizzle.escape; 8097 8098 8099 8100 8101var dir = function( elem, dir, until ) { 8102 var matched = [], 8103 truncate = until !== undefined; 8104 8105 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 8106 if ( elem.nodeType === 1 ) { 8107 if ( truncate && jQuery( elem ).is( until ) ) { 8108 break; 8109 } 8110 matched.push( elem ); 8111 } 8112 } 8113 return matched; 8114}; 8115 8116 8117var siblings = function( n, elem ) { 8118 var matched = []; 8119 8120 for ( ; n; n = n.nextSibling ) { 8121 if ( n.nodeType === 1 && n !== elem ) { 8122 matched.push( n ); 8123 } 8124 } 8125 8126 return matched; 8127}; 8128 8129 8130var rneedsContext = jQuery.expr.match.needsContext; 8131 8132 8133 8134function nodeName( elem, name ) { 8135 8136 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 8137 8138} 8139var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 8140 8141 8142 8143// Implement the identical functionality for filter and not 8144function winnow( elements, qualifier, not ) { 8145 if ( isFunction( qualifier ) ) { 8146 return jQuery.grep( elements, function( elem, i ) { 8147 return !!qualifier.call( elem, i, elem ) !== not; 8148 } ); 8149 } 8150 8151 // Single element 8152 if ( qualifier.nodeType ) { 8153 return jQuery.grep( elements, function( elem ) { 8154 return ( elem === qualifier ) !== not; 8155 } ); 8156 } 8157 8158 // Arraylike of elements (jQuery, arguments, Array) 8159 if ( typeof qualifier !== "string" ) { 8160 return jQuery.grep( elements, function( elem ) { 8161 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 8162 } ); 8163 } 8164 8165 // Filtered directly for both simple and complex selectors 8166 return jQuery.filter( qualifier, elements, not ); 8167} 8168 8169jQuery.filter = function( expr, elems, not ) { 8170 var elem = elems[ 0 ]; 8171 8172 if ( not ) { 8173 expr = ":not(" + expr + ")"; 8174 } 8175 8176 if ( elems.length === 1 && elem.nodeType === 1 ) { 8177 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 8178 } 8179 8180 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 8181 return elem.nodeType === 1; 8182 } ) ); 8183}; 8184 8185jQuery.fn.extend( { 8186 find: function( selector ) { 8187 var i, ret, 8188 len = this.length, 8189 self = this; 8190 8191 if ( typeof selector !== "string" ) { 8192 return this.pushStack( jQuery( selector ).filter( function() { 8193 for ( i = 0; i < len; i++ ) { 8194 if ( jQuery.contains( self[ i ], this ) ) { 8195 return true; 8196 } 8197 } 8198 } ) ); 8199 } 8200 8201 ret = this.pushStack( [] ); 8202 8203 for ( i = 0; i < len; i++ ) { 8204 jQuery.find( selector, self[ i ], ret ); 8205 } 8206 8207 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 8208 }, 8209 filter: function( selector ) { 8210 return this.pushStack( winnow( this, selector || [], false ) ); 8211 }, 8212 not: function( selector ) { 8213 return this.pushStack( winnow( this, selector || [], true ) ); 8214 }, 8215 is: function( selector ) { 8216 return !!winnow( 8217 this, 8218 8219 // If this is a positional/relative selector, check membership in the returned set 8220 // so $("p:first").is("p:last") won't return true for a doc with two "p". 8221 typeof selector === "string" && rneedsContext.test( selector ) ? 8222 jQuery( selector ) : 8223 selector || [], 8224 false 8225 ).length; 8226 } 8227} ); 8228 8229 8230// Initialize a jQuery object 8231 8232 8233// A central reference to the root jQuery(document) 8234var rootjQuery, 8235 8236 // A simple way to check for HTML strings 8237 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 8238 // Strict HTML recognition (#11290: must start with <) 8239 // Shortcut simple #id case for speed 8240 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 8241 8242 init = jQuery.fn.init = function( selector, context, root ) { 8243 var match, elem; 8244 8245 // HANDLE: $(""), $(null), $(undefined), $(false) 8246 if ( !selector ) { 8247 return this; 8248 } 8249 8250 // Method init() accepts an alternate rootjQuery 8251 // so migrate can support jQuery.sub (gh-2101) 8252 root = root || rootjQuery; 8253 8254 // Handle HTML strings 8255 if ( typeof selector === "string" ) { 8256 if ( selector[ 0 ] === "<" && 8257 selector[ selector.length - 1 ] === ">" && 8258 selector.length >= 3 ) { 8259 8260 // Assume that strings that start and end with <> are HTML and skip the regex check 8261 match = [ null, selector, null ]; 8262 8263 } else { 8264 match = rquickExpr.exec( selector ); 8265 } 8266 8267 // Match html or make sure no context is specified for #id 8268 if ( match && ( match[ 1 ] || !context ) ) { 8269 8270 // HANDLE: $(html) -> $(array) 8271 if ( match[ 1 ] ) { 8272 context = context instanceof jQuery ? context[ 0 ] : context; 8273 8274 // Option to run scripts is true for back-compat 8275 // Intentionally let the error be thrown if parseHTML is not present 8276 jQuery.merge( this, jQuery.parseHTML( 8277 match[ 1 ], 8278 context && context.nodeType ? context.ownerDocument || context : document, 8279 true 8280 ) ); 8281 8282 // HANDLE: $(html, props) 8283 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 8284 for ( match in context ) { 8285 8286 // Properties of context are called as methods if possible 8287 if ( isFunction( this[ match ] ) ) { 8288 this[ match ]( context[ match ] ); 8289 8290 // ...and otherwise set as attributes 8291 } else { 8292 this.attr( match, context[ match ] ); 8293 } 8294 } 8295 } 8296 8297 return this; 8298 8299 // HANDLE: $(#id) 8300 } else { 8301 elem = document.getElementById( match[ 2 ] ); 8302 8303 if ( elem ) { 8304 8305 // Inject the element directly into the jQuery object 8306 this[ 0 ] = elem; 8307 this.length = 1; 8308 } 8309 return this; 8310 } 8311 8312 // HANDLE: $(expr, $(...)) 8313 } else if ( !context || context.jquery ) { 8314 return ( context || root ).find( selector ); 8315 8316 // HANDLE: $(expr, context) 8317 // (which is just equivalent to: $(context).find(expr) 8318 } else { 8319 return this.constructor( context ).find( selector ); 8320 } 8321 8322 // HANDLE: $(DOMElement) 8323 } else if ( selector.nodeType ) { 8324 this[ 0 ] = selector; 8325 this.length = 1; 8326 return this; 8327 8328 // HANDLE: $(function) 8329 // Shortcut for document ready 8330 } else if ( isFunction( selector ) ) { 8331 return root.ready !== undefined ? 8332 root.ready( selector ) : 8333 8334 // Execute immediately if ready is not present 8335 selector( jQuery ); 8336 } 8337 8338 return jQuery.makeArray( selector, this ); 8339 }; 8340 8341// Give the init function the jQuery prototype for later instantiation 8342init.prototype = jQuery.fn; 8343 8344// Initialize central reference 8345rootjQuery = jQuery( document ); 8346 8347 8348var rparentsprev = /^(?:parents|prev(?:Until|All))/, 8349 8350 // Methods guaranteed to produce a unique set when starting from a unique set 8351 guaranteedUnique = { 8352 children: true, 8353 contents: true, 8354 next: true, 8355 prev: true 8356 }; 8357 8358jQuery.fn.extend( { 8359 has: function( target ) { 8360 var targets = jQuery( target, this ), 8361 l = targets.length; 8362 8363 return this.filter( function() { 8364 var i = 0; 8365 for ( ; i < l; i++ ) { 8366 if ( jQuery.contains( this, targets[ i ] ) ) { 8367 return true; 8368 } 8369 } 8370 } ); 8371 }, 8372 8373 closest: function( selectors, context ) { 8374 var cur, 8375 i = 0, 8376 l = this.length, 8377 matched = [], 8378 targets = typeof selectors !== "string" && jQuery( selectors ); 8379 8380 // Positional selectors never match, since there's no _selection_ context 8381 if ( !rneedsContext.test( selectors ) ) { 8382 for ( ; i < l; i++ ) { 8383 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 8384 8385 // Always skip document fragments 8386 if ( cur.nodeType < 11 && ( targets ? 8387 targets.index( cur ) > -1 : 8388 8389 // Don't pass non-elements to Sizzle 8390 cur.nodeType === 1 && 8391 jQuery.find.matchesSelector( cur, selectors ) ) ) { 8392 8393 matched.push( cur ); 8394 break; 8395 } 8396 } 8397 } 8398 } 8399 8400 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 8401 }, 8402 8403 // Determine the position of an element within the set 8404 index: function( elem ) { 8405 8406 // No argument, return index in parent 8407 if ( !elem ) { 8408 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 8409 } 8410 8411 // Index in selector 8412 if ( typeof elem === "string" ) { 8413 return indexOf.call( jQuery( elem ), this[ 0 ] ); 8414 } 8415 8416 // Locate the position of the desired element 8417 return indexOf.call( this, 8418 8419 // If it receives a jQuery object, the first element is used 8420 elem.jquery ? elem[ 0 ] : elem 8421 ); 8422 }, 8423 8424 add: function( selector, context ) { 8425 return this.pushStack( 8426 jQuery.uniqueSort( 8427 jQuery.merge( this.get(), jQuery( selector, context ) ) 8428 ) 8429 ); 8430 }, 8431 8432 addBack: function( selector ) { 8433 return this.add( selector == null ? 8434 this.prevObject : this.prevObject.filter( selector ) 8435 ); 8436 } 8437} ); 8438 8439function sibling( cur, dir ) { 8440 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 8441 return cur; 8442} 8443 8444jQuery.each( { 8445 parent: function( elem ) { 8446 var parent = elem.parentNode; 8447 return parent && parent.nodeType !== 11 ? parent : null; 8448 }, 8449 parents: function( elem ) { 8450 return dir( elem, "parentNode" ); 8451 }, 8452 parentsUntil: function( elem, _i, until ) { 8453 return dir( elem, "parentNode", until ); 8454 }, 8455 next: function( elem ) { 8456 return sibling( elem, "nextSibling" ); 8457 }, 8458 prev: function( elem ) { 8459 return sibling( elem, "previousSibling" ); 8460 }, 8461 nextAll: function( elem ) { 8462 return dir( elem, "nextSibling" ); 8463 }, 8464 prevAll: function( elem ) { 8465 return dir( elem, "previousSibling" ); 8466 }, 8467 nextUntil: function( elem, _i, until ) { 8468 return dir( elem, "nextSibling", until ); 8469 }, 8470 prevUntil: function( elem, _i, until ) { 8471 return dir( elem, "previousSibling", until ); 8472 }, 8473 siblings: function( elem ) { 8474 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 8475 }, 8476 children: function( elem ) { 8477 return siblings( elem.firstChild ); 8478 }, 8479 contents: function( elem ) { 8480 if ( elem.contentDocument != null && 8481 8482 // Support: IE 11+ 8483 // <object> elements with no `data` attribute has an object 8484 // `contentDocument` with a `null` prototype. 8485 getProto( elem.contentDocument ) ) { 8486 8487 return elem.contentDocument; 8488 } 8489 8490 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 8491 // Treat the template element as a regular one in browsers that 8492 // don't support it. 8493 if ( nodeName( elem, "template" ) ) { 8494 elem = elem.content || elem; 8495 } 8496 8497 return jQuery.merge( [], elem.childNodes ); 8498 } 8499}, function( name, fn ) { 8500 jQuery.fn[ name ] = function( until, selector ) { 8501 var matched = jQuery.map( this, fn, until ); 8502 8503 if ( name.slice( -5 ) !== "Until" ) { 8504 selector = until; 8505 } 8506 8507 if ( selector && typeof selector === "string" ) { 8508 matched = jQuery.filter( selector, matched ); 8509 } 8510 8511 if ( this.length > 1 ) { 8512 8513 // Remove duplicates 8514 if ( !guaranteedUnique[ name ] ) { 8515 jQuery.uniqueSort( matched ); 8516 } 8517 8518 // Reverse order for parents* and prev-derivatives 8519 if ( rparentsprev.test( name ) ) { 8520 matched.reverse(); 8521 } 8522 } 8523 8524 return this.pushStack( matched ); 8525 }; 8526} ); 8527var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 8528 8529 8530 8531// Convert String-formatted options into Object-formatted ones 8532function createOptions( options ) { 8533 var object = {}; 8534 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 8535 object[ flag ] = true; 8536 } ); 8537 return object; 8538} 8539 8540/* 8541 * Create a callback list using the following parameters: 8542 * 8543 * options: an optional list of space-separated options that will change how 8544 * the callback list behaves or a more traditional option object 8545 * 8546 * By default a callback list will act like an event callback list and can be 8547 * "fired" multiple times. 8548 * 8549 * Possible options: 8550 * 8551 * once: will ensure the callback list can only be fired once (like a Deferred) 8552 * 8553 * memory: will keep track of previous values and will call any callback added 8554 * after the list has been fired right away with the latest "memorized" 8555 * values (like a Deferred) 8556 * 8557 * unique: will ensure a callback can only be added once (no duplicate in the list) 8558 * 8559 * stopOnFalse: interrupt callings when a callback returns false 8560 * 8561 */ 8562jQuery.Callbacks = function( options ) { 8563 8564 // Convert options from String-formatted to Object-formatted if needed 8565 // (we check in cache first) 8566 options = typeof options === "string" ? 8567 createOptions( options ) : 8568 jQuery.extend( {}, options ); 8569 8570 var // Flag to know if list is currently firing 8571 firing, 8572 8573 // Last fire value for non-forgettable lists 8574 memory, 8575 8576 // Flag to know if list was already fired 8577 fired, 8578 8579 // Flag to prevent firing 8580 locked, 8581 8582 // Actual callback list 8583 list = [], 8584 8585 // Queue of execution data for repeatable lists 8586 queue = [], 8587 8588 // Index of currently firing callback (modified by add/remove as needed) 8589 firingIndex = -1, 8590 8591 // Fire callbacks 8592 fire = function() { 8593 8594 // Enforce single-firing 8595 locked = locked || options.once; 8596 8597 // Execute callbacks for all pending executions, 8598 // respecting firingIndex overrides and runtime changes 8599 fired = firing = true; 8600 for ( ; queue.length; firingIndex = -1 ) { 8601 memory = queue.shift(); 8602 while ( ++firingIndex < list.length ) { 8603 8604 // Run callback and check for early termination 8605 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 8606 options.stopOnFalse ) { 8607 8608 // Jump to end and forget the data so .add doesn't re-fire 8609 firingIndex = list.length; 8610 memory = false; 8611 } 8612 } 8613 } 8614 8615 // Forget the data if we're done with it 8616 if ( !options.memory ) { 8617 memory = false; 8618 } 8619 8620 firing = false; 8621 8622 // Clean up if we're done firing for good 8623 if ( locked ) { 8624 8625 // Keep an empty list if we have data for future add calls 8626 if ( memory ) { 8627 list = []; 8628 8629 // Otherwise, this object is spent 8630 } else { 8631 list = ""; 8632 } 8633 } 8634 }, 8635 8636 // Actual Callbacks object 8637 self = { 8638 8639 // Add a callback or a collection of callbacks to the list 8640 add: function() { 8641 if ( list ) { 8642 8643 // If we have memory from a past run, we should fire after adding 8644 if ( memory && !firing ) { 8645 firingIndex = list.length - 1; 8646 queue.push( memory ); 8647 } 8648 8649 ( function add( args ) { 8650 jQuery.each( args, function( _, arg ) { 8651 if ( isFunction( arg ) ) { 8652 if ( !options.unique || !self.has( arg ) ) { 8653 list.push( arg ); 8654 } 8655 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 8656 8657 // Inspect recursively 8658 add( arg ); 8659 } 8660 } ); 8661 } )( arguments ); 8662 8663 if ( memory && !firing ) { 8664 fire(); 8665 } 8666 } 8667 return this; 8668 }, 8669 8670 // Remove a callback from the list 8671 remove: function() { 8672 jQuery.each( arguments, function( _, arg ) { 8673 var index; 8674 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 8675 list.splice( index, 1 ); 8676 8677 // Handle firing indexes 8678 if ( index <= firingIndex ) { 8679 firingIndex--; 8680 } 8681 } 8682 } ); 8683 return this; 8684 }, 8685 8686 // Check if a given callback is in the list. 8687 // If no argument is given, return whether or not list has callbacks attached. 8688 has: function( fn ) { 8689 return fn ? 8690 jQuery.inArray( fn, list ) > -1 : 8691 list.length > 0; 8692 }, 8693 8694 // Remove all callbacks from the list 8695 empty: function() { 8696 if ( list ) { 8697 list = []; 8698 } 8699 return this; 8700 }, 8701 8702 // Disable .fire and .add 8703 // Abort any current/pending executions 8704 // Clear all callbacks and values 8705 disable: function() { 8706 locked = queue = []; 8707 list = memory = ""; 8708 return this; 8709 }, 8710 disabled: function() { 8711 return !list; 8712 }, 8713 8714 // Disable .fire 8715 // Also disable .add unless we have memory (since it would have no effect) 8716 // Abort any pending executions 8717 lock: function() { 8718 locked = queue = []; 8719 if ( !memory && !firing ) { 8720 list = memory = ""; 8721 } 8722 return this; 8723 }, 8724 locked: function() { 8725 return !!locked; 8726 }, 8727 8728 // Call all callbacks with the given context and arguments 8729 fireWith: function( context, args ) { 8730 if ( !locked ) { 8731 args = args || []; 8732 args = [ context, args.slice ? args.slice() : args ]; 8733 queue.push( args ); 8734 if ( !firing ) { 8735 fire(); 8736 } 8737 } 8738 return this; 8739 }, 8740 8741 // Call all the callbacks with the given arguments 8742 fire: function() { 8743 self.fireWith( this, arguments ); 8744 return this; 8745 }, 8746 8747 // To know if the callbacks have already been called at least once 8748 fired: function() { 8749 return !!fired; 8750 } 8751 }; 8752 8753 return self; 8754}; 8755 8756 8757function Identity( v ) { 8758 return v; 8759} 8760function Thrower( ex ) { 8761 throw ex; 8762} 8763 8764function adoptValue( value, resolve, reject, noValue ) { 8765 var method; 8766 8767 try { 8768 8769 // Check for promise aspect first to privilege synchronous behavior 8770 if ( value && isFunction( ( method = value.promise ) ) ) { 8771 method.call( value ).done( resolve ).fail( reject ); 8772 8773 // Other thenables 8774 } else if ( value && isFunction( ( method = value.then ) ) ) { 8775 method.call( value, resolve, reject ); 8776 8777 // Other non-thenables 8778 } else { 8779 8780 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 8781 // * false: [ value ].slice( 0 ) => resolve( value ) 8782 // * true: [ value ].slice( 1 ) => resolve() 8783 resolve.apply( undefined, [ value ].slice( noValue ) ); 8784 } 8785 8786 // For Promises/A+, convert exceptions into rejections 8787 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 8788 // Deferred#then to conditionally suppress rejection. 8789 } catch ( value ) { 8790 8791 // Support: Android 4.0 only 8792 // Strict mode functions invoked without .call/.apply get global-object context 8793 reject.apply( undefined, [ value ] ); 8794 } 8795} 8796 8797jQuery.extend( { 8798 8799 Deferred: function( func ) { 8800 var tuples = [ 8801 8802 // action, add listener, callbacks, 8803 // ... .then handlers, argument index, [final state] 8804 [ "notify", "progress", jQuery.Callbacks( "memory" ), 8805 jQuery.Callbacks( "memory" ), 2 ], 8806 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 8807 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 8808 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 8809 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 8810 ], 8811 state = "pending", 8812 promise = { 8813 state: function() { 8814 return state; 8815 }, 8816 always: function() { 8817 deferred.done( arguments ).fail( arguments ); 8818 return this; 8819 }, 8820 "catch": function( fn ) { 8821 return promise.then( null, fn ); 8822 }, 8823 8824 // Keep pipe for back-compat 8825 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 8826 var fns = arguments; 8827 8828 return jQuery.Deferred( function( newDefer ) { 8829 jQuery.each( tuples, function( _i, tuple ) { 8830 8831 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 8832 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 8833 8834 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 8835 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 8836 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 8837 deferred[ tuple[ 1 ] ]( function() { 8838 var returned = fn && fn.apply( this, arguments ); 8839 if ( returned && isFunction( returned.promise ) ) { 8840 returned.promise() 8841 .progress( newDefer.notify ) 8842 .done( newDefer.resolve ) 8843 .fail( newDefer.reject ); 8844 } else { 8845 newDefer[ tuple[ 0 ] + "With" ]( 8846 this, 8847 fn ? [ returned ] : arguments 8848 ); 8849 } 8850 } ); 8851 } ); 8852 fns = null; 8853 } ).promise(); 8854 }, 8855 then: function( onFulfilled, onRejected, onProgress ) { 8856 var maxDepth = 0; 8857 function resolve( depth, deferred, handler, special ) { 8858 return function() { 8859 var that = this, 8860 args = arguments, 8861 mightThrow = function() { 8862 var returned, then; 8863 8864 // Support: Promises/A+ section 2.3.3.3.3 8865 // https://promisesaplus.com/#point-59 8866 // Ignore double-resolution attempts 8867 if ( depth < maxDepth ) { 8868 return; 8869 } 8870 8871 returned = handler.apply( that, args ); 8872 8873 // Support: Promises/A+ section 2.3.1 8874 // https://promisesaplus.com/#point-48 8875 if ( returned === deferred.promise() ) { 8876 throw new TypeError( "Thenable self-resolution" ); 8877 } 8878 8879 // Support: Promises/A+ sections 2.3.3.1, 3.5 8880 // https://promisesaplus.com/#point-54 8881 // https://promisesaplus.com/#point-75 8882 // Retrieve `then` only once 8883 then = returned && 8884 8885 // Support: Promises/A+ section 2.3.4 8886 // https://promisesaplus.com/#point-64 8887 // Only check objects and functions for thenability 8888 ( typeof returned === "object" || 8889 typeof returned === "function" ) && 8890 returned.then; 8891 8892 // Handle a returned thenable 8893 if ( isFunction( then ) ) { 8894 8895 // Special processors (notify) just wait for resolution 8896 if ( special ) { 8897 then.call( 8898 returned, 8899 resolve( maxDepth, deferred, Identity, special ), 8900 resolve( maxDepth, deferred, Thrower, special ) 8901 ); 8902 8903 // Normal processors (resolve) also hook into progress 8904 } else { 8905 8906 // ...and disregard older resolution values 8907 maxDepth++; 8908 8909 then.call( 8910 returned, 8911 resolve( maxDepth, deferred, Identity, special ), 8912 resolve( maxDepth, deferred, Thrower, special ), 8913 resolve( maxDepth, deferred, Identity, 8914 deferred.notifyWith ) 8915 ); 8916 } 8917 8918 // Handle all other returned values 8919 } else { 8920 8921 // Only substitute handlers pass on context 8922 // and multiple values (non-spec behavior) 8923 if ( handler !== Identity ) { 8924 that = undefined; 8925 args = [ returned ]; 8926 } 8927 8928 // Process the value(s) 8929 // Default process is resolve 8930 ( special || deferred.resolveWith )( that, args ); 8931 } 8932 }, 8933 8934 // Only normal processors (resolve) catch and reject exceptions 8935 process = special ? 8936 mightThrow : 8937 function() { 8938 try { 8939 mightThrow(); 8940 } catch ( e ) { 8941 8942 if ( jQuery.Deferred.exceptionHook ) { 8943 jQuery.Deferred.exceptionHook( e, 8944 process.stackTrace ); 8945 } 8946 8947 // Support: Promises/A+ section 2.3.3.3.4.1 8948 // https://promisesaplus.com/#point-61 8949 // Ignore post-resolution exceptions 8950 if ( depth + 1 >= maxDepth ) { 8951 8952 // Only substitute handlers pass on context 8953 // and multiple values (non-spec behavior) 8954 if ( handler !== Thrower ) { 8955 that = undefined; 8956 args = [ e ]; 8957 } 8958 8959 deferred.rejectWith( that, args ); 8960 } 8961 } 8962 }; 8963 8964 // Support: Promises/A+ section 2.3.3.3.1 8965 // https://promisesaplus.com/#point-57 8966 // Re-resolve promises immediately to dodge false rejection from 8967 // subsequent errors 8968 if ( depth ) { 8969 process(); 8970 } else { 8971 8972 // Call an optional hook to record the stack, in case of exception 8973 // since it's otherwise lost when execution goes async 8974 if ( jQuery.Deferred.getStackHook ) { 8975 process.stackTrace = jQuery.Deferred.getStackHook(); 8976 } 8977 window.setTimeout( process ); 8978 } 8979 }; 8980 } 8981 8982 return jQuery.Deferred( function( newDefer ) { 8983 8984 // progress_handlers.add( ... ) 8985 tuples[ 0 ][ 3 ].add( 8986 resolve( 8987 0, 8988 newDefer, 8989 isFunction( onProgress ) ? 8990 onProgress : 8991 Identity, 8992 newDefer.notifyWith 8993 ) 8994 ); 8995 8996 // fulfilled_handlers.add( ... ) 8997 tuples[ 1 ][ 3 ].add( 8998 resolve( 8999 0, 9000 newDefer, 9001 isFunction( onFulfilled ) ? 9002 onFulfilled : 9003 Identity 9004 ) 9005 ); 9006 9007 // rejected_handlers.add( ... ) 9008 tuples[ 2 ][ 3 ].add( 9009 resolve( 9010 0, 9011 newDefer, 9012 isFunction( onRejected ) ? 9013 onRejected : 9014 Thrower 9015 ) 9016 ); 9017 } ).promise(); 9018 }, 9019 9020 // Get a promise for this deferred 9021 // If obj is provided, the promise aspect is added to the object 9022 promise: function( obj ) { 9023 return obj != null ? jQuery.extend( obj, promise ) : promise; 9024 } 9025 }, 9026 deferred = {}; 9027 9028 // Add list-specific methods 9029 jQuery.each( tuples, function( i, tuple ) { 9030 var list = tuple[ 2 ], 9031 stateString = tuple[ 5 ]; 9032 9033 // promise.progress = list.add 9034 // promise.done = list.add 9035 // promise.fail = list.add 9036 promise[ tuple[ 1 ] ] = list.add; 9037 9038 // Handle state 9039 if ( stateString ) { 9040 list.add( 9041 function() { 9042 9043 // state = "resolved" (i.e., fulfilled) 9044 // state = "rejected" 9045 state = stateString; 9046 }, 9047 9048 // rejected_callbacks.disable 9049 // fulfilled_callbacks.disable 9050 tuples[ 3 - i ][ 2 ].disable, 9051 9052 // rejected_handlers.disable 9053 // fulfilled_handlers.disable 9054 tuples[ 3 - i ][ 3 ].disable, 9055 9056 // progress_callbacks.lock 9057 tuples[ 0 ][ 2 ].lock, 9058 9059 // progress_handlers.lock 9060 tuples[ 0 ][ 3 ].lock 9061 ); 9062 } 9063 9064 // progress_handlers.fire 9065 // fulfilled_handlers.fire 9066 // rejected_handlers.fire 9067 list.add( tuple[ 3 ].fire ); 9068 9069 // deferred.notify = function() { deferred.notifyWith(...) } 9070 // deferred.resolve = function() { deferred.resolveWith(...) } 9071 // deferred.reject = function() { deferred.rejectWith(...) } 9072 deferred[ tuple[ 0 ] ] = function() { 9073 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 9074 return this; 9075 }; 9076 9077 // deferred.notifyWith = list.fireWith 9078 // deferred.resolveWith = list.fireWith 9079 // deferred.rejectWith = list.fireWith 9080 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 9081 } ); 9082 9083 // Make the deferred a promise 9084 promise.promise( deferred ); 9085 9086 // Call given func if any 9087 if ( func ) { 9088 func.call( deferred, deferred ); 9089 } 9090 9091 // All done! 9092 return deferred; 9093 }, 9094 9095 // Deferred helper 9096 when: function( singleValue ) { 9097 var 9098 9099 // count of uncompleted subordinates 9100 remaining = arguments.length, 9101 9102 // count of unprocessed arguments 9103 i = remaining, 9104 9105 // subordinate fulfillment data 9106 resolveContexts = Array( i ), 9107 resolveValues = slice.call( arguments ), 9108 9109 // the primary Deferred 9110 primary = jQuery.Deferred(), 9111 9112 // subordinate callback factory 9113 updateFunc = function( i ) { 9114 return function( value ) { 9115 resolveContexts[ i ] = this; 9116 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 9117 if ( !( --remaining ) ) { 9118 primary.resolveWith( resolveContexts, resolveValues ); 9119 } 9120 }; 9121 }; 9122 9123 // Single- and empty arguments are adopted like Promise.resolve 9124 if ( remaining <= 1 ) { 9125 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 9126 !remaining ); 9127 9128 // Use .then() to unwrap secondary thenables (cf. gh-3000) 9129 if ( primary.state() === "pending" || 9130 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 9131 9132 return primary.then(); 9133 } 9134 } 9135 9136 // Multiple arguments are aggregated like Promise.all array elements 9137 while ( i-- ) { 9138 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 9139 } 9140 9141 return primary.promise(); 9142 } 9143} ); 9144 9145 9146// These usually indicate a programmer mistake during development, 9147// warn about them ASAP rather than swallowing them by default. 9148var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 9149 9150jQuery.Deferred.exceptionHook = function( error, stack ) { 9151 9152 // Support: IE 8 - 9 only 9153 // Console exists when dev tools are open, which can happen at any time 9154 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 9155 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 9156 } 9157}; 9158 9159 9160 9161 9162jQuery.readyException = function( error ) { 9163 window.setTimeout( function() { 9164 throw error; 9165 } ); 9166}; 9167 9168 9169 9170 9171// The deferred used on DOM ready 9172var readyList = jQuery.Deferred(); 9173 9174jQuery.fn.ready = function( fn ) { 9175 9176 readyList 9177 .then( fn ) 9178 9179 // Wrap jQuery.readyException in a function so that the lookup 9180 // happens at the time of error handling instead of callback 9181 // registration. 9182 .catch( function( error ) { 9183 jQuery.readyException( error ); 9184 } ); 9185 9186 return this; 9187}; 9188 9189jQuery.extend( { 9190 9191 // Is the DOM ready to be used? Set to true once it occurs. 9192 isReady: false, 9193 9194 // A counter to track how many items to wait for before 9195 // the ready event fires. See #6781 9196 readyWait: 1, 9197 9198 // Handle when the DOM is ready 9199 ready: function( wait ) { 9200 9201 // Abort if there are pending holds or we're already ready 9202 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 9203 return; 9204 } 9205 9206 // Remember that the DOM is ready 9207 jQuery.isReady = true; 9208 9209 // If a normal DOM Ready event fired, decrement, and wait if need be 9210 if ( wait !== true && --jQuery.readyWait > 0 ) { 9211 return; 9212 } 9213 9214 // If there are functions bound, to execute 9215 readyList.resolveWith( document, [ jQuery ] ); 9216 } 9217} ); 9218 9219jQuery.ready.then = readyList.then; 9220 9221// The ready event handler and self cleanup method 9222function completed() { 9223 document.removeEventListener( "DOMContentLoaded", completed ); 9224 window.removeEventListener( "load", completed ); 9225 jQuery.ready(); 9226} 9227 9228// Catch cases where $(document).ready() is called 9229// after the browser event has already occurred. 9230// Support: IE <=9 - 10 only 9231// Older IE sometimes signals "interactive" too soon 9232if ( document.readyState === "complete" || 9233 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 9234 9235 // Handle it asynchronously to allow scripts the opportunity to delay ready 9236 window.setTimeout( jQuery.ready ); 9237 9238} else { 9239 9240 // Use the handy event callback 9241 document.addEventListener( "DOMContentLoaded", completed ); 9242 9243 // A fallback to window.onload, that will always work 9244 window.addEventListener( "load", completed ); 9245} 9246 9247 9248 9249 9250// Multifunctional method to get and set values of a collection 9251// The value/s can optionally be executed if it's a function 9252var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 9253 var i = 0, 9254 len = elems.length, 9255 bulk = key == null; 9256 9257 // Sets many values 9258 if ( toType( key ) === "object" ) { 9259 chainable = true; 9260 for ( i in key ) { 9261 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 9262 } 9263 9264 // Sets one value 9265 } else if ( value !== undefined ) { 9266 chainable = true; 9267 9268 if ( !isFunction( value ) ) { 9269 raw = true; 9270 } 9271 9272 if ( bulk ) { 9273 9274 // Bulk operations run against the entire set 9275 if ( raw ) { 9276 fn.call( elems, value ); 9277 fn = null; 9278 9279 // ...except when executing function values 9280 } else { 9281 bulk = fn; 9282 fn = function( elem, _key, value ) { 9283 return bulk.call( jQuery( elem ), value ); 9284 }; 9285 } 9286 } 9287 9288 if ( fn ) { 9289 for ( ; i < len; i++ ) { 9290 fn( 9291 elems[ i ], key, raw ? 9292 value : 9293 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 9294 ); 9295 } 9296 } 9297 } 9298 9299 if ( chainable ) { 9300 return elems; 9301 } 9302 9303 // Gets 9304 if ( bulk ) { 9305 return fn.call( elems ); 9306 } 9307 9308 return len ? fn( elems[ 0 ], key ) : emptyGet; 9309}; 9310 9311 9312// Matches dashed string for camelizing 9313var rmsPrefix = /^-ms-/, 9314 rdashAlpha = /-([a-z])/g; 9315 9316// Used by camelCase as callback to replace() 9317function fcamelCase( _all, letter ) { 9318 return letter.toUpperCase(); 9319} 9320 9321// Convert dashed to camelCase; used by the css and data modules 9322// Support: IE <=9 - 11, Edge 12 - 15 9323// Microsoft forgot to hump their vendor prefix (#9572) 9324function camelCase( string ) { 9325 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 9326} 9327var acceptData = function( owner ) { 9328 9329 // Accepts only: 9330 // - Node 9331 // - Node.ELEMENT_NODE 9332 // - Node.DOCUMENT_NODE 9333 // - Object 9334 // - Any 9335 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 9336}; 9337 9338 9339 9340 9341function Data() { 9342 this.expando = jQuery.expando + Data.uid++; 9343} 9344 9345Data.uid = 1; 9346 9347Data.prototype = { 9348 9349 cache: function( owner ) { 9350 9351 // Check if the owner object already has a cache 9352 var value = owner[ this.expando ]; 9353 9354 // If not, create one 9355 if ( !value ) { 9356 value = {}; 9357 9358 // We can accept data for non-element nodes in modern browsers, 9359 // but we should not, see #8335. 9360 // Always return an empty object. 9361 if ( acceptData( owner ) ) { 9362 9363 // If it is a node unlikely to be stringify-ed or looped over 9364 // use plain assignment 9365 if ( owner.nodeType ) { 9366 owner[ this.expando ] = value; 9367 9368 // Otherwise secure it in a non-enumerable property 9369 // configurable must be true to allow the property to be 9370 // deleted when data is removed 9371 } else { 9372 Object.defineProperty( owner, this.expando, { 9373 value: value, 9374 configurable: true 9375 } ); 9376 } 9377 } 9378 } 9379 9380 return value; 9381 }, 9382 set: function( owner, data, value ) { 9383 var prop, 9384 cache = this.cache( owner ); 9385 9386 // Handle: [ owner, key, value ] args 9387 // Always use camelCase key (gh-2257) 9388 if ( typeof data === "string" ) { 9389 cache[ camelCase( data ) ] = value; 9390 9391 // Handle: [ owner, { properties } ] args 9392 } else { 9393 9394 // Copy the properties one-by-one to the cache object 9395 for ( prop in data ) { 9396 cache[ camelCase( prop ) ] = data[ prop ]; 9397 } 9398 } 9399 return cache; 9400 }, 9401 get: function( owner, key ) { 9402 return key === undefined ? 9403 this.cache( owner ) : 9404 9405 // Always use camelCase key (gh-2257) 9406 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 9407 }, 9408 access: function( owner, key, value ) { 9409 9410 // In cases where either: 9411 // 9412 // 1. No key was specified 9413 // 2. A string key was specified, but no value provided 9414 // 9415 // Take the "read" path and allow the get method to determine 9416 // which value to return, respectively either: 9417 // 9418 // 1. The entire cache object 9419 // 2. The data stored at the key 9420 // 9421 if ( key === undefined || 9422 ( ( key && typeof key === "string" ) && value === undefined ) ) { 9423 9424 return this.get( owner, key ); 9425 } 9426 9427 // When the key is not a string, or both a key and value 9428 // are specified, set or extend (existing objects) with either: 9429 // 9430 // 1. An object of properties 9431 // 2. A key and value 9432 // 9433 this.set( owner, key, value ); 9434 9435 // Since the "set" path can have two possible entry points 9436 // return the expected data based on which path was taken[*] 9437 return value !== undefined ? value : key; 9438 }, 9439 remove: function( owner, key ) { 9440 var i, 9441 cache = owner[ this.expando ]; 9442 9443 if ( cache === undefined ) { 9444 return; 9445 } 9446 9447 if ( key !== undefined ) { 9448 9449 // Support array or space separated string of keys 9450 if ( Array.isArray( key ) ) { 9451 9452 // If key is an array of keys... 9453 // We always set camelCase keys, so remove that. 9454 key = key.map( camelCase ); 9455 } else { 9456 key = camelCase( key ); 9457 9458 // If a key with the spaces exists, use it. 9459 // Otherwise, create an array by matching non-whitespace 9460 key = key in cache ? 9461 [ key ] : 9462 ( key.match( rnothtmlwhite ) || [] ); 9463 } 9464 9465 i = key.length; 9466 9467 while ( i-- ) { 9468 delete cache[ key[ i ] ]; 9469 } 9470 } 9471 9472 // Remove the expando if there's no more data 9473 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 9474 9475 // Support: Chrome <=35 - 45 9476 // Webkit & Blink performance suffers when deleting properties 9477 // from DOM nodes, so set to undefined instead 9478 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 9479 if ( owner.nodeType ) { 9480 owner[ this.expando ] = undefined; 9481 } else { 9482 delete owner[ this.expando ]; 9483 } 9484 } 9485 }, 9486 hasData: function( owner ) { 9487 var cache = owner[ this.expando ]; 9488 return cache !== undefined && !jQuery.isEmptyObject( cache ); 9489 } 9490}; 9491var dataPriv = new Data(); 9492 9493var dataUser = new Data(); 9494 9495 9496 9497// Implementation Summary 9498// 9499// 1. Enforce API surface and semantic compatibility with 1.9.x branch 9500// 2. Improve the module's maintainability by reducing the storage 9501// paths to a single mechanism. 9502// 3. Use the same single mechanism to support "private" and "user" data. 9503// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 9504// 5. Avoid exposing implementation details on user objects (eg. expando properties) 9505// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 9506 9507var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 9508 rmultiDash = /[A-Z]/g; 9509 9510function getData( data ) { 9511 if ( data === "true" ) { 9512 return true; 9513 } 9514 9515 if ( data === "false" ) { 9516 return false; 9517 } 9518 9519 if ( data === "null" ) { 9520 return null; 9521 } 9522 9523 // Only convert to a number if it doesn't change the string 9524 if ( data === +data + "" ) { 9525 return +data; 9526 } 9527 9528 if ( rbrace.test( data ) ) { 9529 return JSON.parse( data ); 9530 } 9531 9532 return data; 9533} 9534 9535function dataAttr( elem, key, data ) { 9536 var name; 9537 9538 // If nothing was found internally, try to fetch any 9539 // data from the HTML5 data-* attribute 9540 if ( data === undefined && elem.nodeType === 1 ) { 9541 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 9542 data = elem.getAttribute( name ); 9543 9544 if ( typeof data === "string" ) { 9545 try { 9546 data = getData( data ); 9547 } catch ( e ) {} 9548 9549 // Make sure we set the data so it isn't changed later 9550 dataUser.set( elem, key, data ); 9551 } else { 9552 data = undefined; 9553 } 9554 } 9555 return data; 9556} 9557 9558jQuery.extend( { 9559 hasData: function( elem ) { 9560 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 9561 }, 9562 9563 data: function( elem, name, data ) { 9564 return dataUser.access( elem, name, data ); 9565 }, 9566 9567 removeData: function( elem, name ) { 9568 dataUser.remove( elem, name ); 9569 }, 9570 9571 // TODO: Now that all calls to _data and _removeData have been replaced 9572 // with direct calls to dataPriv methods, these can be deprecated. 9573 _data: function( elem, name, data ) { 9574 return dataPriv.access( elem, name, data ); 9575 }, 9576 9577 _removeData: function( elem, name ) { 9578 dataPriv.remove( elem, name ); 9579 } 9580} ); 9581 9582jQuery.fn.extend( { 9583 data: function( key, value ) { 9584 var i, name, data, 9585 elem = this[ 0 ], 9586 attrs = elem && elem.attributes; 9587 9588 // Gets all values 9589 if ( key === undefined ) { 9590 if ( this.length ) { 9591 data = dataUser.get( elem ); 9592 9593 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 9594 i = attrs.length; 9595 while ( i-- ) { 9596 9597 // Support: IE 11 only 9598 // The attrs elements can be null (#14894) 9599 if ( attrs[ i ] ) { 9600 name = attrs[ i ].name; 9601 if ( name.indexOf( "data-" ) === 0 ) { 9602 name = camelCase( name.slice( 5 ) ); 9603 dataAttr( elem, name, data[ name ] ); 9604 } 9605 } 9606 } 9607 dataPriv.set( elem, "hasDataAttrs", true ); 9608 } 9609 } 9610 9611 return data; 9612 } 9613 9614 // Sets multiple values 9615 if ( typeof key === "object" ) { 9616 return this.each( function() { 9617 dataUser.set( this, key ); 9618 } ); 9619 } 9620 9621 return access( this, function( value ) { 9622 var data; 9623 9624 // The calling jQuery object (element matches) is not empty 9625 // (and therefore has an element appears at this[ 0 ]) and the 9626 // `value` parameter was not undefined. An empty jQuery object 9627 // will result in `undefined` for elem = this[ 0 ] which will 9628 // throw an exception if an attempt to read a data cache is made. 9629 if ( elem && value === undefined ) { 9630 9631 // Attempt to get data from the cache 9632 // The key will always be camelCased in Data 9633 data = dataUser.get( elem, key ); 9634 if ( data !== undefined ) { 9635 return data; 9636 } 9637 9638 // Attempt to "discover" the data in 9639 // HTML5 custom data-* attrs 9640 data = dataAttr( elem, key ); 9641 if ( data !== undefined ) { 9642 return data; 9643 } 9644 9645 // We tried really hard, but the data doesn't exist. 9646 return; 9647 } 9648 9649 // Set the data... 9650 this.each( function() { 9651 9652 // We always store the camelCased key 9653 dataUser.set( this, key, value ); 9654 } ); 9655 }, null, value, arguments.length > 1, null, true ); 9656 }, 9657 9658 removeData: function( key ) { 9659 return this.each( function() { 9660 dataUser.remove( this, key ); 9661 } ); 9662 } 9663} ); 9664 9665 9666jQuery.extend( { 9667 queue: function( elem, type, data ) { 9668 var queue; 9669 9670 if ( elem ) { 9671 type = ( type || "fx" ) + "queue"; 9672 queue = dataPriv.get( elem, type ); 9673 9674 // Speed up dequeue by getting out quickly if this is just a lookup 9675 if ( data ) { 9676 if ( !queue || Array.isArray( data ) ) { 9677 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 9678 } else { 9679 queue.push( data ); 9680 } 9681 } 9682 return queue || []; 9683 } 9684 }, 9685 9686 dequeue: function( elem, type ) { 9687 type = type || "fx"; 9688 9689 var queue = jQuery.queue( elem, type ), 9690 startLength = queue.length, 9691 fn = queue.shift(), 9692 hooks = jQuery._queueHooks( elem, type ), 9693 next = function() { 9694 jQuery.dequeue( elem, type ); 9695 }; 9696 9697 // If the fx queue is dequeued, always remove the progress sentinel 9698 if ( fn === "inprogress" ) { 9699 fn = queue.shift(); 9700 startLength--; 9701 } 9702 9703 if ( fn ) { 9704 9705 // Add a progress sentinel to prevent the fx queue from being 9706 // automatically dequeued 9707 if ( type === "fx" ) { 9708 queue.unshift( "inprogress" ); 9709 } 9710 9711 // Clear up the last queue stop function 9712 delete hooks.stop; 9713 fn.call( elem, next, hooks ); 9714 } 9715 9716 if ( !startLength && hooks ) { 9717 hooks.empty.fire(); 9718 } 9719 }, 9720 9721 // Not public - generate a queueHooks object, or return the current one 9722 _queueHooks: function( elem, type ) { 9723 var key = type + "queueHooks"; 9724 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 9725 empty: jQuery.Callbacks( "once memory" ).add( function() { 9726 dataPriv.remove( elem, [ type + "queue", key ] ); 9727 } ) 9728 } ); 9729 } 9730} ); 9731 9732jQuery.fn.extend( { 9733 queue: function( type, data ) { 9734 var setter = 2; 9735 9736 if ( typeof type !== "string" ) { 9737 data = type; 9738 type = "fx"; 9739 setter--; 9740 } 9741 9742 if ( arguments.length < setter ) { 9743 return jQuery.queue( this[ 0 ], type ); 9744 } 9745 9746 return data === undefined ? 9747 this : 9748 this.each( function() { 9749 var queue = jQuery.queue( this, type, data ); 9750 9751 // Ensure a hooks for this queue 9752 jQuery._queueHooks( this, type ); 9753 9754 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 9755 jQuery.dequeue( this, type ); 9756 } 9757 } ); 9758 }, 9759 dequeue: function( type ) { 9760 return this.each( function() { 9761 jQuery.dequeue( this, type ); 9762 } ); 9763 }, 9764 clearQueue: function( type ) { 9765 return this.queue( type || "fx", [] ); 9766 }, 9767 9768 // Get a promise resolved when queues of a certain type 9769 // are emptied (fx is the type by default) 9770 promise: function( type, obj ) { 9771 var tmp, 9772 count = 1, 9773 defer = jQuery.Deferred(), 9774 elements = this, 9775 i = this.length, 9776 resolve = function() { 9777 if ( !( --count ) ) { 9778 defer.resolveWith( elements, [ elements ] ); 9779 } 9780 }; 9781 9782 if ( typeof type !== "string" ) { 9783 obj = type; 9784 type = undefined; 9785 } 9786 type = type || "fx"; 9787 9788 while ( i-- ) { 9789 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 9790 if ( tmp && tmp.empty ) { 9791 count++; 9792 tmp.empty.add( resolve ); 9793 } 9794 } 9795 resolve(); 9796 return defer.promise( obj ); 9797 } 9798} ); 9799var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 9800 9801var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 9802 9803 9804var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 9805 9806var documentElement = document.documentElement; 9807 9808 9809 9810 var isAttached = function( elem ) { 9811 return jQuery.contains( elem.ownerDocument, elem ); 9812 }, 9813 composed = { composed: true }; 9814 9815 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 9816 // Check attachment across shadow DOM boundaries when possible (gh-3504) 9817 // Support: iOS 10.0-10.2 only 9818 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 9819 // leading to errors. We need to check for `getRootNode`. 9820 if ( documentElement.getRootNode ) { 9821 isAttached = function( elem ) { 9822 return jQuery.contains( elem.ownerDocument, elem ) || 9823 elem.getRootNode( composed ) === elem.ownerDocument; 9824 }; 9825 } 9826var isHiddenWithinTree = function( elem, el ) { 9827 9828 // isHiddenWithinTree might be called from jQuery#filter function; 9829 // in that case, element will be second argument 9830 elem = el || elem; 9831 9832 // Inline style trumps all 9833 return elem.style.display === "none" || 9834 elem.style.display === "" && 9835 9836 // Otherwise, check computed style 9837 // Support: Firefox <=43 - 45 9838 // Disconnected elements can have computed display: none, so first confirm that elem is 9839 // in the document. 9840 isAttached( elem ) && 9841 9842 jQuery.css( elem, "display" ) === "none"; 9843 }; 9844 9845 9846 9847function adjustCSS( elem, prop, valueParts, tween ) { 9848 var adjusted, scale, 9849 maxIterations = 20, 9850 currentValue = tween ? 9851 function() { 9852 return tween.cur(); 9853 } : 9854 function() { 9855 return jQuery.css( elem, prop, "" ); 9856 }, 9857 initial = currentValue(), 9858 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 9859 9860 // Starting value computation is required for potential unit mismatches 9861 initialInUnit = elem.nodeType && 9862 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 9863 rcssNum.exec( jQuery.css( elem, prop ) ); 9864 9865 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 9866 9867 // Support: Firefox <=54 9868 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 9869 initial = initial / 2; 9870 9871 // Trust units reported by jQuery.css 9872 unit = unit || initialInUnit[ 3 ]; 9873 9874 // Iteratively approximate from a nonzero starting point 9875 initialInUnit = +initial || 1; 9876 9877 while ( maxIterations-- ) { 9878 9879 // Evaluate and update our best guess (doubling guesses that zero out). 9880 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 9881 jQuery.style( elem, prop, initialInUnit + unit ); 9882 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 9883 maxIterations = 0; 9884 } 9885 initialInUnit = initialInUnit / scale; 9886 9887 } 9888 9889 initialInUnit = initialInUnit * 2; 9890 jQuery.style( elem, prop, initialInUnit + unit ); 9891 9892 // Make sure we update the tween properties later on 9893 valueParts = valueParts || []; 9894 } 9895 9896 if ( valueParts ) { 9897 initialInUnit = +initialInUnit || +initial || 0; 9898 9899 // Apply relative offset (+=/-=) if specified 9900 adjusted = valueParts[ 1 ] ? 9901 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 9902 +valueParts[ 2 ]; 9903 if ( tween ) { 9904 tween.unit = unit; 9905 tween.start = initialInUnit; 9906 tween.end = adjusted; 9907 } 9908 } 9909 return adjusted; 9910} 9911 9912 9913var defaultDisplayMap = {}; 9914 9915function getDefaultDisplay( elem ) { 9916 var temp, 9917 doc = elem.ownerDocument, 9918 nodeName = elem.nodeName, 9919 display = defaultDisplayMap[ nodeName ]; 9920 9921 if ( display ) { 9922 return display; 9923 } 9924 9925 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 9926 display = jQuery.css( temp, "display" ); 9927 9928 temp.parentNode.removeChild( temp ); 9929 9930 if ( display === "none" ) { 9931 display = "block"; 9932 } 9933 defaultDisplayMap[ nodeName ] = display; 9934 9935 return display; 9936} 9937 9938function showHide( elements, show ) { 9939 var display, elem, 9940 values = [], 9941 index = 0, 9942 length = elements.length; 9943 9944 // Determine new display value for elements that need to change 9945 for ( ; index < length; index++ ) { 9946 elem = elements[ index ]; 9947 if ( !elem.style ) { 9948 continue; 9949 } 9950 9951 display = elem.style.display; 9952 if ( show ) { 9953 9954 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 9955 // check is required in this first loop unless we have a nonempty display value (either 9956 // inline or about-to-be-restored) 9957 if ( display === "none" ) { 9958 values[ index ] = dataPriv.get( elem, "display" ) || null; 9959 if ( !values[ index ] ) { 9960 elem.style.display = ""; 9961 } 9962 } 9963 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 9964 values[ index ] = getDefaultDisplay( elem ); 9965 } 9966 } else { 9967 if ( display !== "none" ) { 9968 values[ index ] = "none"; 9969 9970 // Remember what we're overwriting 9971 dataPriv.set( elem, "display", display ); 9972 } 9973 } 9974 } 9975 9976 // Set the display of the elements in a second loop to avoid constant reflow 9977 for ( index = 0; index < length; index++ ) { 9978 if ( values[ index ] != null ) { 9979 elements[ index ].style.display = values[ index ]; 9980 } 9981 } 9982 9983 return elements; 9984} 9985 9986jQuery.fn.extend( { 9987 show: function() { 9988 return showHide( this, true ); 9989 }, 9990 hide: function() { 9991 return showHide( this ); 9992 }, 9993 toggle: function( state ) { 9994 if ( typeof state === "boolean" ) { 9995 return state ? this.show() : this.hide(); 9996 } 9997 9998 return this.each( function() { 9999 if ( isHiddenWithinTree( this ) ) { 10000 jQuery( this ).show(); 10001 } else { 10002 jQuery( this ).hide(); 10003 } 10004 } ); 10005 } 10006} ); 10007var rcheckableType = ( /^(?:checkbox|radio)$/i ); 10008 10009var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 10010 10011var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 10012 10013 10014 10015( function() { 10016 var fragment = document.createDocumentFragment(), 10017 div = fragment.appendChild( document.createElement( "div" ) ), 10018 input = document.createElement( "input" ); 10019 10020 // Support: Android 4.0 - 4.3 only 10021 // Check state lost if the name is set (#11217) 10022 // Support: Windows Web Apps (WWA) 10023 // `name` and `type` must use .setAttribute for WWA (#14901) 10024 input.setAttribute( "type", "radio" ); 10025 input.setAttribute( "checked", "checked" ); 10026 input.setAttribute( "name", "t" ); 10027 10028 div.appendChild( input ); 10029 10030 // Support: Android <=4.1 only 10031 // Older WebKit doesn't clone checked state correctly in fragments 10032 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 10033 10034 // Support: IE <=11 only 10035 // Make sure textarea (and checkbox) defaultValue is properly cloned 10036 div.innerHTML = "<textarea>x</textarea>"; 10037 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 10038 10039 // Support: IE <=9 only 10040 // IE <=9 replaces <option> tags with their contents when inserted outside of 10041 // the select element. 10042 div.innerHTML = "<option></option>"; 10043 support.option = !!div.lastChild; 10044} )(); 10045 10046 10047// We have to close these tags to support XHTML (#13200) 10048var wrapMap = { 10049 10050 // XHTML parsers do not magically insert elements in the 10051 // same way that tag soup parsers do. So we cannot shorten 10052 // this by omitting <tbody> or other required elements. 10053 thead: [ 1, "<table>", "</table>" ], 10054 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 10055 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 10056 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 10057 10058 _default: [ 0, "", "" ] 10059}; 10060 10061wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 10062wrapMap.th = wrapMap.td; 10063 10064// Support: IE <=9 only 10065if ( !support.option ) { 10066 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 10067} 10068 10069 10070function getAll( context, tag ) { 10071 10072 // Support: IE <=9 - 11 only 10073 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 10074 var ret; 10075 10076 if ( typeof context.getElementsByTagName !== "undefined" ) { 10077 ret = context.getElementsByTagName( tag || "*" ); 10078 10079 } else if ( typeof context.querySelectorAll !== "undefined" ) { 10080 ret = context.querySelectorAll( tag || "*" ); 10081 10082 } else { 10083 ret = []; 10084 } 10085 10086 if ( tag === undefined || tag && nodeName( context, tag ) ) { 10087 return jQuery.merge( [ context ], ret ); 10088 } 10089 10090 return ret; 10091} 10092 10093 10094// Mark scripts as having already been evaluated 10095function setGlobalEval( elems, refElements ) { 10096 var i = 0, 10097 l = elems.length; 10098 10099 for ( ; i < l; i++ ) { 10100 dataPriv.set( 10101 elems[ i ], 10102 "globalEval", 10103 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 10104 ); 10105 } 10106} 10107 10108 10109var rhtml = /<|&#?\w+;/; 10110 10111function buildFragment( elems, context, scripts, selection, ignored ) { 10112 var elem, tmp, tag, wrap, attached, j, 10113 fragment = context.createDocumentFragment(), 10114 nodes = [], 10115 i = 0, 10116 l = elems.length; 10117 10118 for ( ; i < l; i++ ) { 10119 elem = elems[ i ]; 10120 10121 if ( elem || elem === 0 ) { 10122 10123 // Add nodes directly 10124 if ( toType( elem ) === "object" ) { 10125 10126 // Support: Android <=4.0 only, PhantomJS 1 only 10127 // push.apply(_, arraylike) throws on ancient WebKit 10128 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 10129 10130 // Convert non-html into a text node 10131 } else if ( !rhtml.test( elem ) ) { 10132 nodes.push( context.createTextNode( elem ) ); 10133 10134 // Convert html into DOM nodes 10135 } else { 10136 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 10137 10138 // Deserialize a standard representation 10139 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 10140 wrap = wrapMap[ tag ] || wrapMap._default; 10141 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 10142 10143 // Descend through wrappers to the right content 10144 j = wrap[ 0 ]; 10145 while ( j-- ) { 10146 tmp = tmp.lastChild; 10147 } 10148 10149 // Support: Android <=4.0 only, PhantomJS 1 only 10150 // push.apply(_, arraylike) throws on ancient WebKit 10151 jQuery.merge( nodes, tmp.childNodes ); 10152 10153 // Remember the top-level container 10154 tmp = fragment.firstChild; 10155 10156 // Ensure the created nodes are orphaned (#12392) 10157 tmp.textContent = ""; 10158 } 10159 } 10160 } 10161 10162 // Remove wrapper from fragment 10163 fragment.textContent = ""; 10164 10165 i = 0; 10166 while ( ( elem = nodes[ i++ ] ) ) { 10167 10168 // Skip elements already in the context collection (trac-4087) 10169 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 10170 if ( ignored ) { 10171 ignored.push( elem ); 10172 } 10173 continue; 10174 } 10175 10176 attached = isAttached( elem ); 10177 10178 // Append to fragment 10179 tmp = getAll( fragment.appendChild( elem ), "script" ); 10180 10181 // Preserve script evaluation history 10182 if ( attached ) { 10183 setGlobalEval( tmp ); 10184 } 10185 10186 // Capture executables 10187 if ( scripts ) { 10188 j = 0; 10189 while ( ( elem = tmp[ j++ ] ) ) { 10190 if ( rscriptType.test( elem.type || "" ) ) { 10191 scripts.push( elem ); 10192 } 10193 } 10194 } 10195 } 10196 10197 return fragment; 10198} 10199 10200 10201var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 10202 10203function returnTrue() { 10204 return true; 10205} 10206 10207function returnFalse() { 10208 return false; 10209} 10210 10211// Support: IE <=9 - 11+ 10212// focus() and blur() are asynchronous, except when they are no-op. 10213// So expect focus to be synchronous when the element is already active, 10214// and blur to be synchronous when the element is not already active. 10215// (focus and blur are always synchronous in other supported browsers, 10216// this just defines when we can count on it). 10217function expectSync( elem, type ) { 10218 return ( elem === safeActiveElement() ) === ( type === "focus" ); 10219} 10220 10221// Support: IE <=9 only 10222// Accessing document.activeElement can throw unexpectedly 10223// https://bugs.jquery.com/ticket/13393 10224function safeActiveElement() { 10225 try { 10226 return document.activeElement; 10227 } catch ( err ) { } 10228} 10229 10230function on( elem, types, selector, data, fn, one ) { 10231 var origFn, type; 10232 10233 // Types can be a map of types/handlers 10234 if ( typeof types === "object" ) { 10235 10236 // ( types-Object, selector, data ) 10237 if ( typeof selector !== "string" ) { 10238 10239 // ( types-Object, data ) 10240 data = data || selector; 10241 selector = undefined; 10242 } 10243 for ( type in types ) { 10244 on( elem, type, selector, data, types[ type ], one ); 10245 } 10246 return elem; 10247 } 10248 10249 if ( data == null && fn == null ) { 10250 10251 // ( types, fn ) 10252 fn = selector; 10253 data = selector = undefined; 10254 } else if ( fn == null ) { 10255 if ( typeof selector === "string" ) { 10256 10257 // ( types, selector, fn ) 10258 fn = data; 10259 data = undefined; 10260 } else { 10261 10262 // ( types, data, fn ) 10263 fn = data; 10264 data = selector; 10265 selector = undefined; 10266 } 10267 } 10268 if ( fn === false ) { 10269 fn = returnFalse; 10270 } else if ( !fn ) { 10271 return elem; 10272 } 10273 10274 if ( one === 1 ) { 10275 origFn = fn; 10276 fn = function( event ) { 10277 10278 // Can use an empty set, since event contains the info 10279 jQuery().off( event ); 10280 return origFn.apply( this, arguments ); 10281 }; 10282 10283 // Use same guid so caller can remove using origFn 10284 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 10285 } 10286 return elem.each( function() { 10287 jQuery.event.add( this, types, fn, data, selector ); 10288 } ); 10289} 10290 10291/* 10292 * Helper functions for managing events -- not part of the public interface. 10293 * Props to Dean Edwards' addEvent library for many of the ideas. 10294 */ 10295jQuery.event = { 10296 10297 global: {}, 10298 10299 add: function( elem, types, handler, data, selector ) { 10300 10301 var handleObjIn, eventHandle, tmp, 10302 events, t, handleObj, 10303 special, handlers, type, namespaces, origType, 10304 elemData = dataPriv.get( elem ); 10305 10306 // Only attach events to objects that accept data 10307 if ( !acceptData( elem ) ) { 10308 return; 10309 } 10310 10311 // Caller can pass in an object of custom data in lieu of the handler 10312 if ( handler.handler ) { 10313 handleObjIn = handler; 10314 handler = handleObjIn.handler; 10315 selector = handleObjIn.selector; 10316 } 10317 10318 // Ensure that invalid selectors throw exceptions at attach time 10319 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 10320 if ( selector ) { 10321 jQuery.find.matchesSelector( documentElement, selector ); 10322 } 10323 10324 // Make sure that the handler has a unique ID, used to find/remove it later 10325 if ( !handler.guid ) { 10326 handler.guid = jQuery.guid++; 10327 } 10328 10329 // Init the element's event structure and main handler, if this is the first 10330 if ( !( events = elemData.events ) ) { 10331 events = elemData.events = Object.create( null ); 10332 } 10333 if ( !( eventHandle = elemData.handle ) ) { 10334 eventHandle = elemData.handle = function( e ) { 10335 10336 // Discard the second event of a jQuery.event.trigger() and 10337 // when an event is called after a page has unloaded 10338 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 10339 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 10340 }; 10341 } 10342 10343 // Handle multiple events separated by a space 10344 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10345 t = types.length; 10346 while ( t-- ) { 10347 tmp = rtypenamespace.exec( types[ t ] ) || []; 10348 type = origType = tmp[ 1 ]; 10349 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10350 10351 // There *must* be a type, no attaching namespace-only handlers 10352 if ( !type ) { 10353 continue; 10354 } 10355 10356 // If event changes its type, use the special event handlers for the changed type 10357 special = jQuery.event.special[ type ] || {}; 10358 10359 // If selector defined, determine special event api type, otherwise given type 10360 type = ( selector ? special.delegateType : special.bindType ) || type; 10361 10362 // Update special based on newly reset type 10363 special = jQuery.event.special[ type ] || {}; 10364 10365 // handleObj is passed to all event handlers 10366 handleObj = jQuery.extend( { 10367 type: type, 10368 origType: origType, 10369 data: data, 10370 handler: handler, 10371 guid: handler.guid, 10372 selector: selector, 10373 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 10374 namespace: namespaces.join( "." ) 10375 }, handleObjIn ); 10376 10377 // Init the event handler queue if we're the first 10378 if ( !( handlers = events[ type ] ) ) { 10379 handlers = events[ type ] = []; 10380 handlers.delegateCount = 0; 10381 10382 // Only use addEventListener if the special events handler returns false 10383 if ( !special.setup || 10384 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 10385 10386 if ( elem.addEventListener ) { 10387 elem.addEventListener( type, eventHandle ); 10388 } 10389 } 10390 } 10391 10392 if ( special.add ) { 10393 special.add.call( elem, handleObj ); 10394 10395 if ( !handleObj.handler.guid ) { 10396 handleObj.handler.guid = handler.guid; 10397 } 10398 } 10399 10400 // Add to the element's handler list, delegates in front 10401 if ( selector ) { 10402 handlers.splice( handlers.delegateCount++, 0, handleObj ); 10403 } else { 10404 handlers.push( handleObj ); 10405 } 10406 10407 // Keep track of which events have ever been used, for event optimization 10408 jQuery.event.global[ type ] = true; 10409 } 10410 10411 }, 10412 10413 // Detach an event or set of events from an element 10414 remove: function( elem, types, handler, selector, mappedTypes ) { 10415 10416 var j, origCount, tmp, 10417 events, t, handleObj, 10418 special, handlers, type, namespaces, origType, 10419 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 10420 10421 if ( !elemData || !( events = elemData.events ) ) { 10422 return; 10423 } 10424 10425 // Once for each type.namespace in types; type may be omitted 10426 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10427 t = types.length; 10428 while ( t-- ) { 10429 tmp = rtypenamespace.exec( types[ t ] ) || []; 10430 type = origType = tmp[ 1 ]; 10431 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10432 10433 // Unbind all events (on this namespace, if provided) for the element 10434 if ( !type ) { 10435 for ( type in events ) { 10436 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 10437 } 10438 continue; 10439 } 10440 10441 special = jQuery.event.special[ type ] || {}; 10442 type = ( selector ? special.delegateType : special.bindType ) || type; 10443 handlers = events[ type ] || []; 10444 tmp = tmp[ 2 ] && 10445 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 10446 10447 // Remove matching events 10448 origCount = j = handlers.length; 10449 while ( j-- ) { 10450 handleObj = handlers[ j ]; 10451 10452 if ( ( mappedTypes || origType === handleObj.origType ) && 10453 ( !handler || handler.guid === handleObj.guid ) && 10454 ( !tmp || tmp.test( handleObj.namespace ) ) && 10455 ( !selector || selector === handleObj.selector || 10456 selector === "**" && handleObj.selector ) ) { 10457 handlers.splice( j, 1 ); 10458 10459 if ( handleObj.selector ) { 10460 handlers.delegateCount--; 10461 } 10462 if ( special.remove ) { 10463 special.remove.call( elem, handleObj ); 10464 } 10465 } 10466 } 10467 10468 // Remove generic event handler if we removed something and no more handlers exist 10469 // (avoids potential for endless recursion during removal of special event handlers) 10470 if ( origCount && !handlers.length ) { 10471 if ( !special.teardown || 10472 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 10473 10474 jQuery.removeEvent( elem, type, elemData.handle ); 10475 } 10476 10477 delete events[ type ]; 10478 } 10479 } 10480 10481 // Remove data and the expando if it's no longer used 10482 if ( jQuery.isEmptyObject( events ) ) { 10483 dataPriv.remove( elem, "handle events" ); 10484 } 10485 }, 10486 10487 dispatch: function( nativeEvent ) { 10488 10489 var i, j, ret, matched, handleObj, handlerQueue, 10490 args = new Array( arguments.length ), 10491 10492 // Make a writable jQuery.Event from the native event object 10493 event = jQuery.event.fix( nativeEvent ), 10494 10495 handlers = ( 10496 dataPriv.get( this, "events" ) || Object.create( null ) 10497 )[ event.type ] || [], 10498 special = jQuery.event.special[ event.type ] || {}; 10499 10500 // Use the fix-ed jQuery.Event rather than the (read-only) native event 10501 args[ 0 ] = event; 10502 10503 for ( i = 1; i < arguments.length; i++ ) { 10504 args[ i ] = arguments[ i ]; 10505 } 10506 10507 event.delegateTarget = this; 10508 10509 // Call the preDispatch hook for the mapped type, and let it bail if desired 10510 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 10511 return; 10512 } 10513 10514 // Determine handlers 10515 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 10516 10517 // Run delegates first; they may want to stop propagation beneath us 10518 i = 0; 10519 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 10520 event.currentTarget = matched.elem; 10521 10522 j = 0; 10523 while ( ( handleObj = matched.handlers[ j++ ] ) && 10524 !event.isImmediatePropagationStopped() ) { 10525 10526 // If the event is namespaced, then each handler is only invoked if it is 10527 // specially universal or its namespaces are a superset of the event's. 10528 if ( !event.rnamespace || handleObj.namespace === false || 10529 event.rnamespace.test( handleObj.namespace ) ) { 10530 10531 event.handleObj = handleObj; 10532 event.data = handleObj.data; 10533 10534 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 10535 handleObj.handler ).apply( matched.elem, args ); 10536 10537 if ( ret !== undefined ) { 10538 if ( ( event.result = ret ) === false ) { 10539 event.preventDefault(); 10540 event.stopPropagation(); 10541 } 10542 } 10543 } 10544 } 10545 } 10546 10547 // Call the postDispatch hook for the mapped type 10548 if ( special.postDispatch ) { 10549 special.postDispatch.call( this, event ); 10550 } 10551 10552 return event.result; 10553 }, 10554 10555 handlers: function( event, handlers ) { 10556 var i, handleObj, sel, matchedHandlers, matchedSelectors, 10557 handlerQueue = [], 10558 delegateCount = handlers.delegateCount, 10559 cur = event.target; 10560 10561 // Find delegate handlers 10562 if ( delegateCount && 10563 10564 // Support: IE <=9 10565 // Black-hole SVG <use> instance trees (trac-13180) 10566 cur.nodeType && 10567 10568 // Support: Firefox <=42 10569 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 10570 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 10571 // Support: IE 11 only 10572 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 10573 !( event.type === "click" && event.button >= 1 ) ) { 10574 10575 for ( ; cur !== this; cur = cur.parentNode || this ) { 10576 10577 // Don't check non-elements (#13208) 10578 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 10579 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 10580 matchedHandlers = []; 10581 matchedSelectors = {}; 10582 for ( i = 0; i < delegateCount; i++ ) { 10583 handleObj = handlers[ i ]; 10584 10585 // Don't conflict with Object.prototype properties (#13203) 10586 sel = handleObj.selector + " "; 10587 10588 if ( matchedSelectors[ sel ] === undefined ) { 10589 matchedSelectors[ sel ] = handleObj.needsContext ? 10590 jQuery( sel, this ).index( cur ) > -1 : 10591 jQuery.find( sel, this, null, [ cur ] ).length; 10592 } 10593 if ( matchedSelectors[ sel ] ) { 10594 matchedHandlers.push( handleObj ); 10595 } 10596 } 10597 if ( matchedHandlers.length ) { 10598 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 10599 } 10600 } 10601 } 10602 } 10603 10604 // Add the remaining (directly-bound) handlers 10605 cur = this; 10606 if ( delegateCount < handlers.length ) { 10607 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 10608 } 10609 10610 return handlerQueue; 10611 }, 10612 10613 addProp: function( name, hook ) { 10614 Object.defineProperty( jQuery.Event.prototype, name, { 10615 enumerable: true, 10616 configurable: true, 10617 10618 get: isFunction( hook ) ? 10619 function() { 10620 if ( this.originalEvent ) { 10621 return hook( this.originalEvent ); 10622 } 10623 } : 10624 function() { 10625 if ( this.originalEvent ) { 10626 return this.originalEvent[ name ]; 10627 } 10628 }, 10629 10630 set: function( value ) { 10631 Object.defineProperty( this, name, { 10632 enumerable: true, 10633 configurable: true, 10634 writable: true, 10635 value: value 10636 } ); 10637 } 10638 } ); 10639 }, 10640 10641 fix: function( originalEvent ) { 10642 return originalEvent[ jQuery.expando ] ? 10643 originalEvent : 10644 new jQuery.Event( originalEvent ); 10645 }, 10646 10647 special: { 10648 load: { 10649 10650 // Prevent triggered image.load events from bubbling to window.load 10651 noBubble: true 10652 }, 10653 click: { 10654 10655 // Utilize native event to ensure correct state for checkable inputs 10656 setup: function( data ) { 10657 10658 // For mutual compressibility with _default, replace `this` access with a local var. 10659 // `|| data` is dead code meant only to preserve the variable through minification. 10660 var el = this || data; 10661 10662 // Claim the first handler 10663 if ( rcheckableType.test( el.type ) && 10664 el.click && nodeName( el, "input" ) ) { 10665 10666 // dataPriv.set( el, "click", ... ) 10667 leverageNative( el, "click", returnTrue ); 10668 } 10669 10670 // Return false to allow normal processing in the caller 10671 return false; 10672 }, 10673 trigger: function( data ) { 10674 10675 // For mutual compressibility with _default, replace `this` access with a local var. 10676 // `|| data` is dead code meant only to preserve the variable through minification. 10677 var el = this || data; 10678 10679 // Force setup before triggering a click 10680 if ( rcheckableType.test( el.type ) && 10681 el.click && nodeName( el, "input" ) ) { 10682 10683 leverageNative( el, "click" ); 10684 } 10685 10686 // Return non-false to allow normal event-path propagation 10687 return true; 10688 }, 10689 10690 // For cross-browser consistency, suppress native .click() on links 10691 // Also prevent it if we're currently inside a leveraged native-event stack 10692 _default: function( event ) { 10693 var target = event.target; 10694 return rcheckableType.test( target.type ) && 10695 target.click && nodeName( target, "input" ) && 10696 dataPriv.get( target, "click" ) || 10697 nodeName( target, "a" ); 10698 } 10699 }, 10700 10701 beforeunload: { 10702 postDispatch: function( event ) { 10703 10704 // Support: Firefox 20+ 10705 // Firefox doesn't alert if the returnValue field is not set. 10706 if ( event.result !== undefined && event.originalEvent ) { 10707 event.originalEvent.returnValue = event.result; 10708 } 10709 } 10710 } 10711 } 10712}; 10713 10714// Ensure the presence of an event listener that handles manually-triggered 10715// synthetic events by interrupting progress until reinvoked in response to 10716// *native* events that it fires directly, ensuring that state changes have 10717// already occurred before other listeners are invoked. 10718function leverageNative( el, type, expectSync ) { 10719 10720 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 10721 if ( !expectSync ) { 10722 if ( dataPriv.get( el, type ) === undefined ) { 10723 jQuery.event.add( el, type, returnTrue ); 10724 } 10725 return; 10726 } 10727 10728 // Register the controller as a special universal handler for all event namespaces 10729 dataPriv.set( el, type, false ); 10730 jQuery.event.add( el, type, { 10731 namespace: false, 10732 handler: function( event ) { 10733 var notAsync, result, 10734 saved = dataPriv.get( this, type ); 10735 10736 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 10737 10738 // Interrupt processing of the outer synthetic .trigger()ed event 10739 // Saved data should be false in such cases, but might be a leftover capture object 10740 // from an async native handler (gh-4350) 10741 if ( !saved.length ) { 10742 10743 // Store arguments for use when handling the inner native event 10744 // There will always be at least one argument (an event object), so this array 10745 // will not be confused with a leftover capture object. 10746 saved = slice.call( arguments ); 10747 dataPriv.set( this, type, saved ); 10748 10749 // Trigger the native event and capture its result 10750 // Support: IE <=9 - 11+ 10751 // focus() and blur() are asynchronous 10752 notAsync = expectSync( this, type ); 10753 this[ type ](); 10754 result = dataPriv.get( this, type ); 10755 if ( saved !== result || notAsync ) { 10756 dataPriv.set( this, type, false ); 10757 } else { 10758 result = {}; 10759 } 10760 if ( saved !== result ) { 10761 10762 // Cancel the outer synthetic event 10763 event.stopImmediatePropagation(); 10764 event.preventDefault(); 10765 10766 // Support: Chrome 86+ 10767 // In Chrome, if an element having a focusout handler is blurred by 10768 // clicking outside of it, it invokes the handler synchronously. If 10769 // that handler calls `.remove()` on the element, the data is cleared, 10770 // leaving `result` undefined. We need to guard against this. 10771 return result && result.value; 10772 } 10773 10774 // If this is an inner synthetic event for an event with a bubbling surrogate 10775 // (focus or blur), assume that the surrogate already propagated from triggering the 10776 // native event and prevent that from happening again here. 10777 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 10778 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 10779 // less bad than duplication. 10780 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 10781 event.stopPropagation(); 10782 } 10783 10784 // If this is a native event triggered above, everything is now in order 10785 // Fire an inner synthetic event with the original arguments 10786 } else if ( saved.length ) { 10787 10788 // ...and capture the result 10789 dataPriv.set( this, type, { 10790 value: jQuery.event.trigger( 10791 10792 // Support: IE <=9 - 11+ 10793 // Extend with the prototype to reset the above stopImmediatePropagation() 10794 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 10795 saved.slice( 1 ), 10796 this 10797 ) 10798 } ); 10799 10800 // Abort handling of the native event 10801 event.stopImmediatePropagation(); 10802 } 10803 } 10804 } ); 10805} 10806 10807jQuery.removeEvent = function( elem, type, handle ) { 10808 10809 // This "if" is needed for plain objects 10810 if ( elem.removeEventListener ) { 10811 elem.removeEventListener( type, handle ); 10812 } 10813}; 10814 10815jQuery.Event = function( src, props ) { 10816 10817 // Allow instantiation without the 'new' keyword 10818 if ( !( this instanceof jQuery.Event ) ) { 10819 return new jQuery.Event( src, props ); 10820 } 10821 10822 // Event object 10823 if ( src && src.type ) { 10824 this.originalEvent = src; 10825 this.type = src.type; 10826 10827 // Events bubbling up the document may have been marked as prevented 10828 // by a handler lower down the tree; reflect the correct value. 10829 this.isDefaultPrevented = src.defaultPrevented || 10830 src.defaultPrevented === undefined && 10831 10832 // Support: Android <=2.3 only 10833 src.returnValue === false ? 10834 returnTrue : 10835 returnFalse; 10836 10837 // Create target properties 10838 // Support: Safari <=6 - 7 only 10839 // Target should not be a text node (#504, #13143) 10840 this.target = ( src.target && src.target.nodeType === 3 ) ? 10841 src.target.parentNode : 10842 src.target; 10843 10844 this.currentTarget = src.currentTarget; 10845 this.relatedTarget = src.relatedTarget; 10846 10847 // Event type 10848 } else { 10849 this.type = src; 10850 } 10851 10852 // Put explicitly provided properties onto the event object 10853 if ( props ) { 10854 jQuery.extend( this, props ); 10855 } 10856 10857 // Create a timestamp if incoming event doesn't have one 10858 this.timeStamp = src && src.timeStamp || Date.now(); 10859 10860 // Mark it as fixed 10861 this[ jQuery.expando ] = true; 10862}; 10863 10864// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 10865// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 10866jQuery.Event.prototype = { 10867 constructor: jQuery.Event, 10868 isDefaultPrevented: returnFalse, 10869 isPropagationStopped: returnFalse, 10870 isImmediatePropagationStopped: returnFalse, 10871 isSimulated: false, 10872 10873 preventDefault: function() { 10874 var e = this.originalEvent; 10875 10876 this.isDefaultPrevented = returnTrue; 10877 10878 if ( e && !this.isSimulated ) { 10879 e.preventDefault(); 10880 } 10881 }, 10882 stopPropagation: function() { 10883 var e = this.originalEvent; 10884 10885 this.isPropagationStopped = returnTrue; 10886 10887 if ( e && !this.isSimulated ) { 10888 e.stopPropagation(); 10889 } 10890 }, 10891 stopImmediatePropagation: function() { 10892 var e = this.originalEvent; 10893 10894 this.isImmediatePropagationStopped = returnTrue; 10895 10896 if ( e && !this.isSimulated ) { 10897 e.stopImmediatePropagation(); 10898 } 10899 10900 this.stopPropagation(); 10901 } 10902}; 10903 10904// Includes all common event props including KeyEvent and MouseEvent specific props 10905jQuery.each( { 10906 altKey: true, 10907 bubbles: true, 10908 cancelable: true, 10909 changedTouches: true, 10910 ctrlKey: true, 10911 detail: true, 10912 eventPhase: true, 10913 metaKey: true, 10914 pageX: true, 10915 pageY: true, 10916 shiftKey: true, 10917 view: true, 10918 "char": true, 10919 code: true, 10920 charCode: true, 10921 key: true, 10922 keyCode: true, 10923 button: true, 10924 buttons: true, 10925 clientX: true, 10926 clientY: true, 10927 offsetX: true, 10928 offsetY: true, 10929 pointerId: true, 10930 pointerType: true, 10931 screenX: true, 10932 screenY: true, 10933 targetTouches: true, 10934 toElement: true, 10935 touches: true, 10936 which: true 10937}, jQuery.event.addProp ); 10938 10939jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 10940 jQuery.event.special[ type ] = { 10941 10942 // Utilize native event if possible so blur/focus sequence is correct 10943 setup: function() { 10944 10945 // Claim the first handler 10946 // dataPriv.set( this, "focus", ... ) 10947 // dataPriv.set( this, "blur", ... ) 10948 leverageNative( this, type, expectSync ); 10949 10950 // Return false to allow normal processing in the caller 10951 return false; 10952 }, 10953 trigger: function() { 10954 10955 // Force setup before trigger 10956 leverageNative( this, type ); 10957 10958 // Return non-false to allow normal event-path propagation 10959 return true; 10960 }, 10961 10962 // Suppress native focus or blur as it's already being fired 10963 // in leverageNative. 10964 _default: function() { 10965 return true; 10966 }, 10967 10968 delegateType: delegateType 10969 }; 10970} ); 10971 10972// Create mouseenter/leave events using mouseover/out and event-time checks 10973// so that event delegation works in jQuery. 10974// Do the same for pointerenter/pointerleave and pointerover/pointerout 10975// 10976// Support: Safari 7 only 10977// Safari sends mouseenter too often; see: 10978// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 10979// for the description of the bug (it existed in older Chrome versions as well). 10980jQuery.each( { 10981 mouseenter: "mouseover", 10982 mouseleave: "mouseout", 10983 pointerenter: "pointerover", 10984 pointerleave: "pointerout" 10985}, function( orig, fix ) { 10986 jQuery.event.special[ orig ] = { 10987 delegateType: fix, 10988 bindType: fix, 10989 10990 handle: function( event ) { 10991 var ret, 10992 target = this, 10993 related = event.relatedTarget, 10994 handleObj = event.handleObj; 10995 10996 // For mouseenter/leave call the handler if related is outside the target. 10997 // NB: No relatedTarget if the mouse left/entered the browser window 10998 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 10999 event.type = handleObj.origType; 11000 ret = handleObj.handler.apply( this, arguments ); 11001 event.type = fix; 11002 } 11003 return ret; 11004 } 11005 }; 11006} ); 11007 11008jQuery.fn.extend( { 11009 11010 on: function( types, selector, data, fn ) { 11011 return on( this, types, selector, data, fn ); 11012 }, 11013 one: function( types, selector, data, fn ) { 11014 return on( this, types, selector, data, fn, 1 ); 11015 }, 11016 off: function( types, selector, fn ) { 11017 var handleObj, type; 11018 if ( types && types.preventDefault && types.handleObj ) { 11019 11020 // ( event ) dispatched jQuery.Event 11021 handleObj = types.handleObj; 11022 jQuery( types.delegateTarget ).off( 11023 handleObj.namespace ? 11024 handleObj.origType + "." + handleObj.namespace : 11025 handleObj.origType, 11026 handleObj.selector, 11027 handleObj.handler 11028 ); 11029 return this; 11030 } 11031 if ( typeof types === "object" ) { 11032 11033 // ( types-object [, selector] ) 11034 for ( type in types ) { 11035 this.off( type, selector, types[ type ] ); 11036 } 11037 return this; 11038 } 11039 if ( selector === false || typeof selector === "function" ) { 11040 11041 // ( types [, fn] ) 11042 fn = selector; 11043 selector = undefined; 11044 } 11045 if ( fn === false ) { 11046 fn = returnFalse; 11047 } 11048 return this.each( function() { 11049 jQuery.event.remove( this, types, fn, selector ); 11050 } ); 11051 } 11052} ); 11053 11054 11055var 11056 11057 // Support: IE <=10 - 11, Edge 12 - 13 only 11058 // In IE/Edge using regex groups here causes severe slowdowns. 11059 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 11060 rnoInnerhtml = /<script|<style|<link/i, 11061 11062 // checked="checked" or checked 11063 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 11064 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 11065 11066// Prefer a tbody over its parent table for containing new rows 11067function manipulationTarget( elem, content ) { 11068 if ( nodeName( elem, "table" ) && 11069 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 11070 11071 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 11072 } 11073 11074 return elem; 11075} 11076 11077// Replace/restore the type attribute of script elements for safe DOM manipulation 11078function disableScript( elem ) { 11079 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 11080 return elem; 11081} 11082function restoreScript( elem ) { 11083 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 11084 elem.type = elem.type.slice( 5 ); 11085 } else { 11086 elem.removeAttribute( "type" ); 11087 } 11088 11089 return elem; 11090} 11091 11092function cloneCopyEvent( src, dest ) { 11093 var i, l, type, pdataOld, udataOld, udataCur, events; 11094 11095 if ( dest.nodeType !== 1 ) { 11096 return; 11097 } 11098 11099 // 1. Copy private data: events, handlers, etc. 11100 if ( dataPriv.hasData( src ) ) { 11101 pdataOld = dataPriv.get( src ); 11102 events = pdataOld.events; 11103 11104 if ( events ) { 11105 dataPriv.remove( dest, "handle events" ); 11106 11107 for ( type in events ) { 11108 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 11109 jQuery.event.add( dest, type, events[ type ][ i ] ); 11110 } 11111 } 11112 } 11113 } 11114 11115 // 2. Copy user data 11116 if ( dataUser.hasData( src ) ) { 11117 udataOld = dataUser.access( src ); 11118 udataCur = jQuery.extend( {}, udataOld ); 11119 11120 dataUser.set( dest, udataCur ); 11121 } 11122} 11123 11124// Fix IE bugs, see support tests 11125function fixInput( src, dest ) { 11126 var nodeName = dest.nodeName.toLowerCase(); 11127 11128 // Fails to persist the checked state of a cloned checkbox or radio button. 11129 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 11130 dest.checked = src.checked; 11131 11132 // Fails to return the selected option to the default selected state when cloning options 11133 } else if ( nodeName === "input" || nodeName === "textarea" ) { 11134 dest.defaultValue = src.defaultValue; 11135 } 11136} 11137 11138function domManip( collection, args, callback, ignored ) { 11139 11140 // Flatten any nested arrays 11141 args = flat( args ); 11142 11143 var fragment, first, scripts, hasScripts, node, doc, 11144 i = 0, 11145 l = collection.length, 11146 iNoClone = l - 1, 11147 value = args[ 0 ], 11148 valueIsFunction = isFunction( value ); 11149 11150 // We can't cloneNode fragments that contain checked, in WebKit 11151 if ( valueIsFunction || 11152 ( l > 1 && typeof value === "string" && 11153 !support.checkClone && rchecked.test( value ) ) ) { 11154 return collection.each( function( index ) { 11155 var self = collection.eq( index ); 11156 if ( valueIsFunction ) { 11157 args[ 0 ] = value.call( this, index, self.html() ); 11158 } 11159 domManip( self, args, callback, ignored ); 11160 } ); 11161 } 11162 11163 if ( l ) { 11164 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 11165 first = fragment.firstChild; 11166 11167 if ( fragment.childNodes.length === 1 ) { 11168 fragment = first; 11169 } 11170 11171 // Require either new content or an interest in ignored elements to invoke the callback 11172 if ( first || ignored ) { 11173 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 11174 hasScripts = scripts.length; 11175 11176 // Use the original fragment for the last item 11177 // instead of the first because it can end up 11178 // being emptied incorrectly in certain situations (#8070). 11179 for ( ; i < l; i++ ) { 11180 node = fragment; 11181 11182 if ( i !== iNoClone ) { 11183 node = jQuery.clone( node, true, true ); 11184 11185 // Keep references to cloned scripts for later restoration 11186 if ( hasScripts ) { 11187 11188 // Support: Android <=4.0 only, PhantomJS 1 only 11189 // push.apply(_, arraylike) throws on ancient WebKit 11190 jQuery.merge( scripts, getAll( node, "script" ) ); 11191 } 11192 } 11193 11194 callback.call( collection[ i ], node, i ); 11195 } 11196 11197 if ( hasScripts ) { 11198 doc = scripts[ scripts.length - 1 ].ownerDocument; 11199 11200 // Reenable scripts 11201 jQuery.map( scripts, restoreScript ); 11202 11203 // Evaluate executable scripts on first document insertion 11204 for ( i = 0; i < hasScripts; i++ ) { 11205 node = scripts[ i ]; 11206 if ( rscriptType.test( node.type || "" ) && 11207 !dataPriv.access( node, "globalEval" ) && 11208 jQuery.contains( doc, node ) ) { 11209 11210 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 11211 11212 // Optional AJAX dependency, but won't run scripts if not present 11213 if ( jQuery._evalUrl && !node.noModule ) { 11214 jQuery._evalUrl( node.src, { 11215 nonce: node.nonce || node.getAttribute( "nonce" ) 11216 }, doc ); 11217 } 11218 } else { 11219 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 11220 } 11221 } 11222 } 11223 } 11224 } 11225 } 11226 11227 return collection; 11228} 11229 11230function remove( elem, selector, keepData ) { 11231 var node, 11232 nodes = selector ? jQuery.filter( selector, elem ) : elem, 11233 i = 0; 11234 11235 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 11236 if ( !keepData && node.nodeType === 1 ) { 11237 jQuery.cleanData( getAll( node ) ); 11238 } 11239 11240 if ( node.parentNode ) { 11241 if ( keepData && isAttached( node ) ) { 11242 setGlobalEval( getAll( node, "script" ) ); 11243 } 11244 node.parentNode.removeChild( node ); 11245 } 11246 } 11247 11248 return elem; 11249} 11250 11251jQuery.extend( { 11252 htmlPrefilter: function( html ) { 11253 return html; 11254 }, 11255 11256 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 11257 var i, l, srcElements, destElements, 11258 clone = elem.cloneNode( true ), 11259 inPage = isAttached( elem ); 11260 11261 // Fix IE cloning issues 11262 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 11263 !jQuery.isXMLDoc( elem ) ) { 11264 11265 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 11266 destElements = getAll( clone ); 11267 srcElements = getAll( elem ); 11268 11269 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11270 fixInput( srcElements[ i ], destElements[ i ] ); 11271 } 11272 } 11273 11274 // Copy the events from the original to the clone 11275 if ( dataAndEvents ) { 11276 if ( deepDataAndEvents ) { 11277 srcElements = srcElements || getAll( elem ); 11278 destElements = destElements || getAll( clone ); 11279 11280 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11281 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 11282 } 11283 } else { 11284 cloneCopyEvent( elem, clone ); 11285 } 11286 } 11287 11288 // Preserve script evaluation history 11289 destElements = getAll( clone, "script" ); 11290 if ( destElements.length > 0 ) { 11291 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 11292 } 11293 11294 // Return the cloned set 11295 return clone; 11296 }, 11297 11298 cleanData: function( elems ) { 11299 var data, elem, type, 11300 special = jQuery.event.special, 11301 i = 0; 11302 11303 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 11304 if ( acceptData( elem ) ) { 11305 if ( ( data = elem[ dataPriv.expando ] ) ) { 11306 if ( data.events ) { 11307 for ( type in data.events ) { 11308 if ( special[ type ] ) { 11309 jQuery.event.remove( elem, type ); 11310 11311 // This is a shortcut to avoid jQuery.event.remove's overhead 11312 } else { 11313 jQuery.removeEvent( elem, type, data.handle ); 11314 } 11315 } 11316 } 11317 11318 // Support: Chrome <=35 - 45+ 11319 // Assign undefined instead of using delete, see Data#remove 11320 elem[ dataPriv.expando ] = undefined; 11321 } 11322 if ( elem[ dataUser.expando ] ) { 11323 11324 // Support: Chrome <=35 - 45+ 11325 // Assign undefined instead of using delete, see Data#remove 11326 elem[ dataUser.expando ] = undefined; 11327 } 11328 } 11329 } 11330 } 11331} ); 11332 11333jQuery.fn.extend( { 11334 detach: function( selector ) { 11335 return remove( this, selector, true ); 11336 }, 11337 11338 remove: function( selector ) { 11339 return remove( this, selector ); 11340 }, 11341 11342 text: function( value ) { 11343 return access( this, function( value ) { 11344 return value === undefined ? 11345 jQuery.text( this ) : 11346 this.empty().each( function() { 11347 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11348 this.textContent = value; 11349 } 11350 } ); 11351 }, null, value, arguments.length ); 11352 }, 11353 11354 append: function() { 11355 return domManip( this, arguments, function( elem ) { 11356 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11357 var target = manipulationTarget( this, elem ); 11358 target.appendChild( elem ); 11359 } 11360 } ); 11361 }, 11362 11363 prepend: function() { 11364 return domManip( this, arguments, function( elem ) { 11365 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11366 var target = manipulationTarget( this, elem ); 11367 target.insertBefore( elem, target.firstChild ); 11368 } 11369 } ); 11370 }, 11371 11372 before: function() { 11373 return domManip( this, arguments, function( elem ) { 11374 if ( this.parentNode ) { 11375 this.parentNode.insertBefore( elem, this ); 11376 } 11377 } ); 11378 }, 11379 11380 after: function() { 11381 return domManip( this, arguments, function( elem ) { 11382 if ( this.parentNode ) { 11383 this.parentNode.insertBefore( elem, this.nextSibling ); 11384 } 11385 } ); 11386 }, 11387 11388 empty: function() { 11389 var elem, 11390 i = 0; 11391 11392 for ( ; ( elem = this[ i ] ) != null; i++ ) { 11393 if ( elem.nodeType === 1 ) { 11394 11395 // Prevent memory leaks 11396 jQuery.cleanData( getAll( elem, false ) ); 11397 11398 // Remove any remaining nodes 11399 elem.textContent = ""; 11400 } 11401 } 11402 11403 return this; 11404 }, 11405 11406 clone: function( dataAndEvents, deepDataAndEvents ) { 11407 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 11408 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 11409 11410 return this.map( function() { 11411 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 11412 } ); 11413 }, 11414 11415 html: function( value ) { 11416 return access( this, function( value ) { 11417 var elem = this[ 0 ] || {}, 11418 i = 0, 11419 l = this.length; 11420 11421 if ( value === undefined && elem.nodeType === 1 ) { 11422 return elem.innerHTML; 11423 } 11424 11425 // See if we can take a shortcut and just use innerHTML 11426 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 11427 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 11428 11429 value = jQuery.htmlPrefilter( value ); 11430 11431 try { 11432 for ( ; i < l; i++ ) { 11433 elem = this[ i ] || {}; 11434 11435 // Remove element nodes and prevent memory leaks 11436 if ( elem.nodeType === 1 ) { 11437 jQuery.cleanData( getAll( elem, false ) ); 11438 elem.innerHTML = value; 11439 } 11440 } 11441 11442 elem = 0; 11443 11444 // If using innerHTML throws an exception, use the fallback method 11445 } catch ( e ) {} 11446 } 11447 11448 if ( elem ) { 11449 this.empty().append( value ); 11450 } 11451 }, null, value, arguments.length ); 11452 }, 11453 11454 replaceWith: function() { 11455 var ignored = []; 11456 11457 // Make the changes, replacing each non-ignored context element with the new content 11458 return domManip( this, arguments, function( elem ) { 11459 var parent = this.parentNode; 11460 11461 if ( jQuery.inArray( this, ignored ) < 0 ) { 11462 jQuery.cleanData( getAll( this ) ); 11463 if ( parent ) { 11464 parent.replaceChild( elem, this ); 11465 } 11466 } 11467 11468 // Force callback invocation 11469 }, ignored ); 11470 } 11471} ); 11472 11473jQuery.each( { 11474 appendTo: "append", 11475 prependTo: "prepend", 11476 insertBefore: "before", 11477 insertAfter: "after", 11478 replaceAll: "replaceWith" 11479}, function( name, original ) { 11480 jQuery.fn[ name ] = function( selector ) { 11481 var elems, 11482 ret = [], 11483 insert = jQuery( selector ), 11484 last = insert.length - 1, 11485 i = 0; 11486 11487 for ( ; i <= last; i++ ) { 11488 elems = i === last ? this : this.clone( true ); 11489 jQuery( insert[ i ] )[ original ]( elems ); 11490 11491 // Support: Android <=4.0 only, PhantomJS 1 only 11492 // .get() because push.apply(_, arraylike) throws on ancient WebKit 11493 push.apply( ret, elems.get() ); 11494 } 11495 11496 return this.pushStack( ret ); 11497 }; 11498} ); 11499var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 11500 11501var getStyles = function( elem ) { 11502 11503 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 11504 // IE throws on elements created in popups 11505 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 11506 var view = elem.ownerDocument.defaultView; 11507 11508 if ( !view || !view.opener ) { 11509 view = window; 11510 } 11511 11512 return view.getComputedStyle( elem ); 11513 }; 11514 11515var swap = function( elem, options, callback ) { 11516 var ret, name, 11517 old = {}; 11518 11519 // Remember the old values, and insert the new ones 11520 for ( name in options ) { 11521 old[ name ] = elem.style[ name ]; 11522 elem.style[ name ] = options[ name ]; 11523 } 11524 11525 ret = callback.call( elem ); 11526 11527 // Revert the old values 11528 for ( name in options ) { 11529 elem.style[ name ] = old[ name ]; 11530 } 11531 11532 return ret; 11533}; 11534 11535 11536var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 11537 11538 11539 11540( function() { 11541 11542 // Executing both pixelPosition & boxSizingReliable tests require only one layout 11543 // so they're executed at the same time to save the second computation. 11544 function computeStyleTests() { 11545 11546 // This is a singleton, we need to execute it only once 11547 if ( !div ) { 11548 return; 11549 } 11550 11551 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 11552 "margin-top:1px;padding:0;border:0"; 11553 div.style.cssText = 11554 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 11555 "margin:auto;border:1px;padding:1px;" + 11556 "width:60%;top:1%"; 11557 documentElement.appendChild( container ).appendChild( div ); 11558 11559 var divStyle = window.getComputedStyle( div ); 11560 pixelPositionVal = divStyle.top !== "1%"; 11561 11562 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 11563 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 11564 11565 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 11566 // Some styles come back with percentage values, even though they shouldn't 11567 div.style.right = "60%"; 11568 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 11569 11570 // Support: IE 9 - 11 only 11571 // Detect misreporting of content dimensions for box-sizing:border-box elements 11572 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 11573 11574 // Support: IE 9 only 11575 // Detect overflow:scroll screwiness (gh-3699) 11576 // Support: Chrome <=64 11577 // Don't get tricked when zoom affects offsetWidth (gh-4029) 11578 div.style.position = "absolute"; 11579 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 11580 11581 documentElement.removeChild( container ); 11582 11583 // Nullify the div so it wouldn't be stored in the memory and 11584 // it will also be a sign that checks already performed 11585 div = null; 11586 } 11587 11588 function roundPixelMeasures( measure ) { 11589 return Math.round( parseFloat( measure ) ); 11590 } 11591 11592 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 11593 reliableTrDimensionsVal, reliableMarginLeftVal, 11594 container = document.createElement( "div" ), 11595 div = document.createElement( "div" ); 11596 11597 // Finish early in limited (non-browser) environments 11598 if ( !div.style ) { 11599 return; 11600 } 11601 11602 // Support: IE <=9 - 11 only 11603 // Style of cloned element affects source element cloned (#8908) 11604 div.style.backgroundClip = "content-box"; 11605 div.cloneNode( true ).style.backgroundClip = ""; 11606 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 11607 11608 jQuery.extend( support, { 11609 boxSizingReliable: function() { 11610 computeStyleTests(); 11611 return boxSizingReliableVal; 11612 }, 11613 pixelBoxStyles: function() { 11614 computeStyleTests(); 11615 return pixelBoxStylesVal; 11616 }, 11617 pixelPosition: function() { 11618 computeStyleTests(); 11619 return pixelPositionVal; 11620 }, 11621 reliableMarginLeft: function() { 11622 computeStyleTests(); 11623 return reliableMarginLeftVal; 11624 }, 11625 scrollboxSize: function() { 11626 computeStyleTests(); 11627 return scrollboxSizeVal; 11628 }, 11629 11630 // Support: IE 9 - 11+, Edge 15 - 18+ 11631 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11632 // set in CSS while `offset*` properties report correct values. 11633 // Behavior in IE 9 is more subtle than in newer versions & it passes 11634 // some versions of this test; make sure not to make it pass there! 11635 // 11636 // Support: Firefox 70+ 11637 // Only Firefox includes border widths 11638 // in computed dimensions. (gh-4529) 11639 reliableTrDimensions: function() { 11640 var table, tr, trChild, trStyle; 11641 if ( reliableTrDimensionsVal == null ) { 11642 table = document.createElement( "table" ); 11643 tr = document.createElement( "tr" ); 11644 trChild = document.createElement( "div" ); 11645 11646 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 11647 tr.style.cssText = "border:1px solid"; 11648 11649 // Support: Chrome 86+ 11650 // Height set through cssText does not get applied. 11651 // Computed height then comes back as 0. 11652 tr.style.height = "1px"; 11653 trChild.style.height = "9px"; 11654 11655 // Support: Android 8 Chrome 86+ 11656 // In our bodyBackground.html iframe, 11657 // display for all div elements is set to "inline", 11658 // which causes a problem only in Android 8 Chrome 86. 11659 // Ensuring the div is display: block 11660 // gets around this issue. 11661 trChild.style.display = "block"; 11662 11663 documentElement 11664 .appendChild( table ) 11665 .appendChild( tr ) 11666 .appendChild( trChild ); 11667 11668 trStyle = window.getComputedStyle( tr ); 11669 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 11670 parseInt( trStyle.borderTopWidth, 10 ) + 11671 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 11672 11673 documentElement.removeChild( table ); 11674 } 11675 return reliableTrDimensionsVal; 11676 } 11677 } ); 11678} )(); 11679 11680 11681function curCSS( elem, name, computed ) { 11682 var width, minWidth, maxWidth, ret, 11683 11684 // Support: Firefox 51+ 11685 // Retrieving style before computed somehow 11686 // fixes an issue with getting wrong values 11687 // on detached elements 11688 style = elem.style; 11689 11690 computed = computed || getStyles( elem ); 11691 11692 // getPropertyValue is needed for: 11693 // .css('filter') (IE 9 only, #12537) 11694 // .css('--customProperty) (#3144) 11695 if ( computed ) { 11696 ret = computed.getPropertyValue( name ) || computed[ name ]; 11697 11698 if ( ret === "" && !isAttached( elem ) ) { 11699 ret = jQuery.style( elem, name ); 11700 } 11701 11702 // A tribute to the "awesome hack by Dean Edwards" 11703 // Android Browser returns percentage for some values, 11704 // but width seems to be reliably pixels. 11705 // This is against the CSSOM draft spec: 11706 // https://drafts.csswg.org/cssom/#resolved-values 11707 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 11708 11709 // Remember the original values 11710 width = style.width; 11711 minWidth = style.minWidth; 11712 maxWidth = style.maxWidth; 11713 11714 // Put in the new values to get a computed value out 11715 style.minWidth = style.maxWidth = style.width = ret; 11716 ret = computed.width; 11717 11718 // Revert the changed values 11719 style.width = width; 11720 style.minWidth = minWidth; 11721 style.maxWidth = maxWidth; 11722 } 11723 } 11724 11725 return ret !== undefined ? 11726 11727 // Support: IE <=9 - 11 only 11728 // IE returns zIndex value as an integer. 11729 ret + "" : 11730 ret; 11731} 11732 11733 11734function addGetHookIf( conditionFn, hookFn ) { 11735 11736 // Define the hook, we'll check on the first run if it's really needed. 11737 return { 11738 get: function() { 11739 if ( conditionFn() ) { 11740 11741 // Hook not needed (or it's not possible to use it due 11742 // to missing dependency), remove it. 11743 delete this.get; 11744 return; 11745 } 11746 11747 // Hook needed; redefine it so that the support test is not executed again. 11748 return ( this.get = hookFn ).apply( this, arguments ); 11749 } 11750 }; 11751} 11752 11753 11754var cssPrefixes = [ "Webkit", "Moz", "ms" ], 11755 emptyStyle = document.createElement( "div" ).style, 11756 vendorProps = {}; 11757 11758// Return a vendor-prefixed property or undefined 11759function vendorPropName( name ) { 11760 11761 // Check for vendor prefixed names 11762 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 11763 i = cssPrefixes.length; 11764 11765 while ( i-- ) { 11766 name = cssPrefixes[ i ] + capName; 11767 if ( name in emptyStyle ) { 11768 return name; 11769 } 11770 } 11771} 11772 11773// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 11774function finalPropName( name ) { 11775 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 11776 11777 if ( final ) { 11778 return final; 11779 } 11780 if ( name in emptyStyle ) { 11781 return name; 11782 } 11783 return vendorProps[ name ] = vendorPropName( name ) || name; 11784} 11785 11786 11787var 11788 11789 // Swappable if display is none or starts with table 11790 // except "table", "table-cell", or "table-caption" 11791 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 11792 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 11793 rcustomProp = /^--/, 11794 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 11795 cssNormalTransform = { 11796 letterSpacing: "0", 11797 fontWeight: "400" 11798 }; 11799 11800function setPositiveNumber( _elem, value, subtract ) { 11801 11802 // Any relative (+/-) values have already been 11803 // normalized at this point 11804 var matches = rcssNum.exec( value ); 11805 return matches ? 11806 11807 // Guard against undefined "subtract", e.g., when used as in cssHooks 11808 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 11809 value; 11810} 11811 11812function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 11813 var i = dimension === "width" ? 1 : 0, 11814 extra = 0, 11815 delta = 0; 11816 11817 // Adjustment may not be necessary 11818 if ( box === ( isBorderBox ? "border" : "content" ) ) { 11819 return 0; 11820 } 11821 11822 for ( ; i < 4; i += 2 ) { 11823 11824 // Both box models exclude margin 11825 if ( box === "margin" ) { 11826 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 11827 } 11828 11829 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 11830 if ( !isBorderBox ) { 11831 11832 // Add padding 11833 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11834 11835 // For "border" or "margin", add border 11836 if ( box !== "padding" ) { 11837 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11838 11839 // But still keep track of it otherwise 11840 } else { 11841 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11842 } 11843 11844 // If we get here with a border-box (content + padding + border), we're seeking "content" or 11845 // "padding" or "margin" 11846 } else { 11847 11848 // For "content", subtract padding 11849 if ( box === "content" ) { 11850 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11851 } 11852 11853 // For "content" or "padding", subtract border 11854 if ( box !== "margin" ) { 11855 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11856 } 11857 } 11858 } 11859 11860 // Account for positive content-box scroll gutter when requested by providing computedVal 11861 if ( !isBorderBox && computedVal >= 0 ) { 11862 11863 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 11864 // Assuming integer scroll gutter, subtract the rest and round down 11865 delta += Math.max( 0, Math.ceil( 11866 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11867 computedVal - 11868 delta - 11869 extra - 11870 0.5 11871 11872 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 11873 // Use an explicit zero to avoid NaN (gh-3964) 11874 ) ) || 0; 11875 } 11876 11877 return delta; 11878} 11879 11880function getWidthOrHeight( elem, dimension, extra ) { 11881 11882 // Start with computed style 11883 var styles = getStyles( elem ), 11884 11885 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 11886 // Fake content-box until we know it's needed to know the true value. 11887 boxSizingNeeded = !support.boxSizingReliable() || extra, 11888 isBorderBox = boxSizingNeeded && 11889 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11890 valueIsBorderBox = isBorderBox, 11891 11892 val = curCSS( elem, dimension, styles ), 11893 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 11894 11895 // Support: Firefox <=54 11896 // Return a confounding non-pixel value or feign ignorance, as appropriate. 11897 if ( rnumnonpx.test( val ) ) { 11898 if ( !extra ) { 11899 return val; 11900 } 11901 val = "auto"; 11902 } 11903 11904 11905 // Support: IE 9 - 11 only 11906 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 11907 // In those cases, the computed value can be trusted to be border-box. 11908 if ( ( !support.boxSizingReliable() && isBorderBox || 11909 11910 // Support: IE 10 - 11+, Edge 15 - 18+ 11911 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11912 // set in CSS while `offset*` properties report correct values. 11913 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 11914 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 11915 11916 // Fall back to offsetWidth/offsetHeight when value is "auto" 11917 // This happens for inline elements with no explicit setting (gh-3571) 11918 val === "auto" || 11919 11920 // Support: Android <=4.1 - 4.3 only 11921 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 11922 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 11923 11924 // Make sure the element is visible & connected 11925 elem.getClientRects().length ) { 11926 11927 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 11928 11929 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 11930 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 11931 // retrieved value as a content box dimension. 11932 valueIsBorderBox = offsetProp in elem; 11933 if ( valueIsBorderBox ) { 11934 val = elem[ offsetProp ]; 11935 } 11936 } 11937 11938 // Normalize "" and auto 11939 val = parseFloat( val ) || 0; 11940 11941 // Adjust for the element's box model 11942 return ( val + 11943 boxModelAdjustment( 11944 elem, 11945 dimension, 11946 extra || ( isBorderBox ? "border" : "content" ), 11947 valueIsBorderBox, 11948 styles, 11949 11950 // Provide the current computed size to request scroll gutter calculation (gh-3589) 11951 val 11952 ) 11953 ) + "px"; 11954} 11955 11956jQuery.extend( { 11957 11958 // Add in style property hooks for overriding the default 11959 // behavior of getting and setting a style property 11960 cssHooks: { 11961 opacity: { 11962 get: function( elem, computed ) { 11963 if ( computed ) { 11964 11965 // We should always get a number back from opacity 11966 var ret = curCSS( elem, "opacity" ); 11967 return ret === "" ? "1" : ret; 11968 } 11969 } 11970 } 11971 }, 11972 11973 // Don't automatically add "px" to these possibly-unitless properties 11974 cssNumber: { 11975 "animationIterationCount": true, 11976 "columnCount": true, 11977 "fillOpacity": true, 11978 "flexGrow": true, 11979 "flexShrink": true, 11980 "fontWeight": true, 11981 "gridArea": true, 11982 "gridColumn": true, 11983 "gridColumnEnd": true, 11984 "gridColumnStart": true, 11985 "gridRow": true, 11986 "gridRowEnd": true, 11987 "gridRowStart": true, 11988 "lineHeight": true, 11989 "opacity": true, 11990 "order": true, 11991 "orphans": true, 11992 "widows": true, 11993 "zIndex": true, 11994 "zoom": true 11995 }, 11996 11997 // Add in properties whose names you wish to fix before 11998 // setting or getting the value 11999 cssProps: {}, 12000 12001 // Get and set the style property on a DOM Node 12002 style: function( elem, name, value, extra ) { 12003 12004 // Don't set styles on text and comment nodes 12005 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 12006 return; 12007 } 12008 12009 // Make sure that we're working with the right name 12010 var ret, type, hooks, 12011 origName = camelCase( name ), 12012 isCustomProp = rcustomProp.test( name ), 12013 style = elem.style; 12014 12015 // Make sure that we're working with the right name. We don't 12016 // want to query the value if it is a CSS custom property 12017 // since they are user-defined. 12018 if ( !isCustomProp ) { 12019 name = finalPropName( origName ); 12020 } 12021 12022 // Gets hook for the prefixed version, then unprefixed version 12023 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12024 12025 // Check if we're setting a value 12026 if ( value !== undefined ) { 12027 type = typeof value; 12028 12029 // Convert "+=" or "-=" to relative numbers (#7345) 12030 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 12031 value = adjustCSS( elem, name, ret ); 12032 12033 // Fixes bug #9237 12034 type = "number"; 12035 } 12036 12037 // Make sure that null and NaN values aren't set (#7116) 12038 if ( value == null || value !== value ) { 12039 return; 12040 } 12041 12042 // If a number was passed in, add the unit (except for certain CSS properties) 12043 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 12044 // "px" to a few hardcoded values. 12045 if ( type === "number" && !isCustomProp ) { 12046 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 12047 } 12048 12049 // background-* props affect original clone's values 12050 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 12051 style[ name ] = "inherit"; 12052 } 12053 12054 // If a hook was provided, use that value, otherwise just set the specified value 12055 if ( !hooks || !( "set" in hooks ) || 12056 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 12057 12058 if ( isCustomProp ) { 12059 style.setProperty( name, value ); 12060 } else { 12061 style[ name ] = value; 12062 } 12063 } 12064 12065 } else { 12066 12067 // If a hook was provided get the non-computed value from there 12068 if ( hooks && "get" in hooks && 12069 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 12070 12071 return ret; 12072 } 12073 12074 // Otherwise just get the value from the style object 12075 return style[ name ]; 12076 } 12077 }, 12078 12079 css: function( elem, name, extra, styles ) { 12080 var val, num, hooks, 12081 origName = camelCase( name ), 12082 isCustomProp = rcustomProp.test( name ); 12083 12084 // Make sure that we're working with the right name. We don't 12085 // want to modify the value if it is a CSS custom property 12086 // since they are user-defined. 12087 if ( !isCustomProp ) { 12088 name = finalPropName( origName ); 12089 } 12090 12091 // Try prefixed name followed by the unprefixed name 12092 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12093 12094 // If a hook was provided get the computed value from there 12095 if ( hooks && "get" in hooks ) { 12096 val = hooks.get( elem, true, extra ); 12097 } 12098 12099 // Otherwise, if a way to get the computed value exists, use that 12100 if ( val === undefined ) { 12101 val = curCSS( elem, name, styles ); 12102 } 12103 12104 // Convert "normal" to computed value 12105 if ( val === "normal" && name in cssNormalTransform ) { 12106 val = cssNormalTransform[ name ]; 12107 } 12108 12109 // Make numeric if forced or a qualifier was provided and val looks numeric 12110 if ( extra === "" || extra ) { 12111 num = parseFloat( val ); 12112 return extra === true || isFinite( num ) ? num || 0 : val; 12113 } 12114 12115 return val; 12116 } 12117} ); 12118 12119jQuery.each( [ "height", "width" ], function( _i, dimension ) { 12120 jQuery.cssHooks[ dimension ] = { 12121 get: function( elem, computed, extra ) { 12122 if ( computed ) { 12123 12124 // Certain elements can have dimension info if we invisibly show them 12125 // but it must have a current display style that would benefit 12126 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 12127 12128 // Support: Safari 8+ 12129 // Table columns in Safari have non-zero offsetWidth & zero 12130 // getBoundingClientRect().width unless display is changed. 12131 // Support: IE <=11 only 12132 // Running getBoundingClientRect on a disconnected node 12133 // in IE throws an error. 12134 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 12135 swap( elem, cssShow, function() { 12136 return getWidthOrHeight( elem, dimension, extra ); 12137 } ) : 12138 getWidthOrHeight( elem, dimension, extra ); 12139 } 12140 }, 12141 12142 set: function( elem, value, extra ) { 12143 var matches, 12144 styles = getStyles( elem ), 12145 12146 // Only read styles.position if the test has a chance to fail 12147 // to avoid forcing a reflow. 12148 scrollboxSizeBuggy = !support.scrollboxSize() && 12149 styles.position === "absolute", 12150 12151 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 12152 boxSizingNeeded = scrollboxSizeBuggy || extra, 12153 isBorderBox = boxSizingNeeded && 12154 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 12155 subtract = extra ? 12156 boxModelAdjustment( 12157 elem, 12158 dimension, 12159 extra, 12160 isBorderBox, 12161 styles 12162 ) : 12163 0; 12164 12165 // Account for unreliable border-box dimensions by comparing offset* to computed and 12166 // faking a content-box to get border and padding (gh-3699) 12167 if ( isBorderBox && scrollboxSizeBuggy ) { 12168 subtract -= Math.ceil( 12169 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 12170 parseFloat( styles[ dimension ] ) - 12171 boxModelAdjustment( elem, dimension, "border", false, styles ) - 12172 0.5 12173 ); 12174 } 12175 12176 // Convert to pixels if value adjustment is needed 12177 if ( subtract && ( matches = rcssNum.exec( value ) ) && 12178 ( matches[ 3 ] || "px" ) !== "px" ) { 12179 12180 elem.style[ dimension ] = value; 12181 value = jQuery.css( elem, dimension ); 12182 } 12183 12184 return setPositiveNumber( elem, value, subtract ); 12185 } 12186 }; 12187} ); 12188 12189jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 12190 function( elem, computed ) { 12191 if ( computed ) { 12192 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 12193 elem.getBoundingClientRect().left - 12194 swap( elem, { marginLeft: 0 }, function() { 12195 return elem.getBoundingClientRect().left; 12196 } ) 12197 ) + "px"; 12198 } 12199 } 12200); 12201 12202// These hooks are used by animate to expand properties 12203jQuery.each( { 12204 margin: "", 12205 padding: "", 12206 border: "Width" 12207}, function( prefix, suffix ) { 12208 jQuery.cssHooks[ prefix + suffix ] = { 12209 expand: function( value ) { 12210 var i = 0, 12211 expanded = {}, 12212 12213 // Assumes a single number if not a string 12214 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 12215 12216 for ( ; i < 4; i++ ) { 12217 expanded[ prefix + cssExpand[ i ] + suffix ] = 12218 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 12219 } 12220 12221 return expanded; 12222 } 12223 }; 12224 12225 if ( prefix !== "margin" ) { 12226 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 12227 } 12228} ); 12229 12230jQuery.fn.extend( { 12231 css: function( name, value ) { 12232 return access( this, function( elem, name, value ) { 12233 var styles, len, 12234 map = {}, 12235 i = 0; 12236 12237 if ( Array.isArray( name ) ) { 12238 styles = getStyles( elem ); 12239 len = name.length; 12240 12241 for ( ; i < len; i++ ) { 12242 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 12243 } 12244 12245 return map; 12246 } 12247 12248 return value !== undefined ? 12249 jQuery.style( elem, name, value ) : 12250 jQuery.css( elem, name ); 12251 }, name, value, arguments.length > 1 ); 12252 } 12253} ); 12254 12255 12256function Tween( elem, options, prop, end, easing ) { 12257 return new Tween.prototype.init( elem, options, prop, end, easing ); 12258} 12259jQuery.Tween = Tween; 12260 12261Tween.prototype = { 12262 constructor: Tween, 12263 init: function( elem, options, prop, end, easing, unit ) { 12264 this.elem = elem; 12265 this.prop = prop; 12266 this.easing = easing || jQuery.easing._default; 12267 this.options = options; 12268 this.start = this.now = this.cur(); 12269 this.end = end; 12270 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 12271 }, 12272 cur: function() { 12273 var hooks = Tween.propHooks[ this.prop ]; 12274 12275 return hooks && hooks.get ? 12276 hooks.get( this ) : 12277 Tween.propHooks._default.get( this ); 12278 }, 12279 run: function( percent ) { 12280 var eased, 12281 hooks = Tween.propHooks[ this.prop ]; 12282 12283 if ( this.options.duration ) { 12284 this.pos = eased = jQuery.easing[ this.easing ]( 12285 percent, this.options.duration * percent, 0, 1, this.options.duration 12286 ); 12287 } else { 12288 this.pos = eased = percent; 12289 } 12290 this.now = ( this.end - this.start ) * eased + this.start; 12291 12292 if ( this.options.step ) { 12293 this.options.step.call( this.elem, this.now, this ); 12294 } 12295 12296 if ( hooks && hooks.set ) { 12297 hooks.set( this ); 12298 } else { 12299 Tween.propHooks._default.set( this ); 12300 } 12301 return this; 12302 } 12303}; 12304 12305Tween.prototype.init.prototype = Tween.prototype; 12306 12307Tween.propHooks = { 12308 _default: { 12309 get: function( tween ) { 12310 var result; 12311 12312 // Use a property on the element directly when it is not a DOM element, 12313 // or when there is no matching style property that exists. 12314 if ( tween.elem.nodeType !== 1 || 12315 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 12316 return tween.elem[ tween.prop ]; 12317 } 12318 12319 // Passing an empty string as a 3rd parameter to .css will automatically 12320 // attempt a parseFloat and fallback to a string if the parse fails. 12321 // Simple values such as "10px" are parsed to Float; 12322 // complex values such as "rotate(1rad)" are returned as-is. 12323 result = jQuery.css( tween.elem, tween.prop, "" ); 12324 12325 // Empty strings, null, undefined and "auto" are converted to 0. 12326 return !result || result === "auto" ? 0 : result; 12327 }, 12328 set: function( tween ) { 12329 12330 // Use step hook for back compat. 12331 // Use cssHook if its there. 12332 // Use .style if available and use plain properties where available. 12333 if ( jQuery.fx.step[ tween.prop ] ) { 12334 jQuery.fx.step[ tween.prop ]( tween ); 12335 } else if ( tween.elem.nodeType === 1 && ( 12336 jQuery.cssHooks[ tween.prop ] || 12337 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 12338 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 12339 } else { 12340 tween.elem[ tween.prop ] = tween.now; 12341 } 12342 } 12343 } 12344}; 12345 12346// Support: IE <=9 only 12347// Panic based approach to setting things on disconnected nodes 12348Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 12349 set: function( tween ) { 12350 if ( tween.elem.nodeType && tween.elem.parentNode ) { 12351 tween.elem[ tween.prop ] = tween.now; 12352 } 12353 } 12354}; 12355 12356jQuery.easing = { 12357 linear: function( p ) { 12358 return p; 12359 }, 12360 swing: function( p ) { 12361 return 0.5 - Math.cos( p * Math.PI ) / 2; 12362 }, 12363 _default: "swing" 12364}; 12365 12366jQuery.fx = Tween.prototype.init; 12367 12368// Back compat <1.8 extension point 12369jQuery.fx.step = {}; 12370 12371 12372 12373 12374var 12375 fxNow, inProgress, 12376 rfxtypes = /^(?:toggle|show|hide)$/, 12377 rrun = /queueHooks$/; 12378 12379function schedule() { 12380 if ( inProgress ) { 12381 if ( document.hidden === false && window.requestAnimationFrame ) { 12382 window.requestAnimationFrame( schedule ); 12383 } else { 12384 window.setTimeout( schedule, jQuery.fx.interval ); 12385 } 12386 12387 jQuery.fx.tick(); 12388 } 12389} 12390 12391// Animations created synchronously will run synchronously 12392function createFxNow() { 12393 window.setTimeout( function() { 12394 fxNow = undefined; 12395 } ); 12396 return ( fxNow = Date.now() ); 12397} 12398 12399// Generate parameters to create a standard animation 12400function genFx( type, includeWidth ) { 12401 var which, 12402 i = 0, 12403 attrs = { height: type }; 12404 12405 // If we include width, step value is 1 to do all cssExpand values, 12406 // otherwise step value is 2 to skip over Left and Right 12407 includeWidth = includeWidth ? 1 : 0; 12408 for ( ; i < 4; i += 2 - includeWidth ) { 12409 which = cssExpand[ i ]; 12410 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 12411 } 12412 12413 if ( includeWidth ) { 12414 attrs.opacity = attrs.width = type; 12415 } 12416 12417 return attrs; 12418} 12419 12420function createTween( value, prop, animation ) { 12421 var tween, 12422 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 12423 index = 0, 12424 length = collection.length; 12425 for ( ; index < length; index++ ) { 12426 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 12427 12428 // We're done with this property 12429 return tween; 12430 } 12431 } 12432} 12433 12434function defaultPrefilter( elem, props, opts ) { 12435 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 12436 isBox = "width" in props || "height" in props, 12437 anim = this, 12438 orig = {}, 12439 style = elem.style, 12440 hidden = elem.nodeType && isHiddenWithinTree( elem ), 12441 dataShow = dataPriv.get( elem, "fxshow" ); 12442 12443 // Queue-skipping animations hijack the fx hooks 12444 if ( !opts.queue ) { 12445 hooks = jQuery._queueHooks( elem, "fx" ); 12446 if ( hooks.unqueued == null ) { 12447 hooks.unqueued = 0; 12448 oldfire = hooks.empty.fire; 12449 hooks.empty.fire = function() { 12450 if ( !hooks.unqueued ) { 12451 oldfire(); 12452 } 12453 }; 12454 } 12455 hooks.unqueued++; 12456 12457 anim.always( function() { 12458 12459 // Ensure the complete handler is called before this completes 12460 anim.always( function() { 12461 hooks.unqueued--; 12462 if ( !jQuery.queue( elem, "fx" ).length ) { 12463 hooks.empty.fire(); 12464 } 12465 } ); 12466 } ); 12467 } 12468 12469 // Detect show/hide animations 12470 for ( prop in props ) { 12471 value = props[ prop ]; 12472 if ( rfxtypes.test( value ) ) { 12473 delete props[ prop ]; 12474 toggle = toggle || value === "toggle"; 12475 if ( value === ( hidden ? "hide" : "show" ) ) { 12476 12477 // Pretend to be hidden if this is a "show" and 12478 // there is still data from a stopped show/hide 12479 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 12480 hidden = true; 12481 12482 // Ignore all other no-op show/hide data 12483 } else { 12484 continue; 12485 } 12486 } 12487 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 12488 } 12489 } 12490 12491 // Bail out if this is a no-op like .hide().hide() 12492 propTween = !jQuery.isEmptyObject( props ); 12493 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 12494 return; 12495 } 12496 12497 // Restrict "overflow" and "display" styles during box animations 12498 if ( isBox && elem.nodeType === 1 ) { 12499 12500 // Support: IE <=9 - 11, Edge 12 - 15 12501 // Record all 3 overflow attributes because IE does not infer the shorthand 12502 // from identically-valued overflowX and overflowY and Edge just mirrors 12503 // the overflowX value there. 12504 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 12505 12506 // Identify a display type, preferring old show/hide data over the CSS cascade 12507 restoreDisplay = dataShow && dataShow.display; 12508 if ( restoreDisplay == null ) { 12509 restoreDisplay = dataPriv.get( elem, "display" ); 12510 } 12511 display = jQuery.css( elem, "display" ); 12512 if ( display === "none" ) { 12513 if ( restoreDisplay ) { 12514 display = restoreDisplay; 12515 } else { 12516 12517 // Get nonempty value(s) by temporarily forcing visibility 12518 showHide( [ elem ], true ); 12519 restoreDisplay = elem.style.display || restoreDisplay; 12520 display = jQuery.css( elem, "display" ); 12521 showHide( [ elem ] ); 12522 } 12523 } 12524 12525 // Animate inline elements as inline-block 12526 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 12527 if ( jQuery.css( elem, "float" ) === "none" ) { 12528 12529 // Restore the original display value at the end of pure show/hide animations 12530 if ( !propTween ) { 12531 anim.done( function() { 12532 style.display = restoreDisplay; 12533 } ); 12534 if ( restoreDisplay == null ) { 12535 display = style.display; 12536 restoreDisplay = display === "none" ? "" : display; 12537 } 12538 } 12539 style.display = "inline-block"; 12540 } 12541 } 12542 } 12543 12544 if ( opts.overflow ) { 12545 style.overflow = "hidden"; 12546 anim.always( function() { 12547 style.overflow = opts.overflow[ 0 ]; 12548 style.overflowX = opts.overflow[ 1 ]; 12549 style.overflowY = opts.overflow[ 2 ]; 12550 } ); 12551 } 12552 12553 // Implement show/hide animations 12554 propTween = false; 12555 for ( prop in orig ) { 12556 12557 // General show/hide setup for this element animation 12558 if ( !propTween ) { 12559 if ( dataShow ) { 12560 if ( "hidden" in dataShow ) { 12561 hidden = dataShow.hidden; 12562 } 12563 } else { 12564 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 12565 } 12566 12567 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 12568 if ( toggle ) { 12569 dataShow.hidden = !hidden; 12570 } 12571 12572 // Show elements before animating them 12573 if ( hidden ) { 12574 showHide( [ elem ], true ); 12575 } 12576 12577 /* eslint-disable no-loop-func */ 12578 12579 anim.done( function() { 12580 12581 /* eslint-enable no-loop-func */ 12582 12583 // The final step of a "hide" animation is actually hiding the element 12584 if ( !hidden ) { 12585 showHide( [ elem ] ); 12586 } 12587 dataPriv.remove( elem, "fxshow" ); 12588 for ( prop in orig ) { 12589 jQuery.style( elem, prop, orig[ prop ] ); 12590 } 12591 } ); 12592 } 12593 12594 // Per-property setup 12595 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 12596 if ( !( prop in dataShow ) ) { 12597 dataShow[ prop ] = propTween.start; 12598 if ( hidden ) { 12599 propTween.end = propTween.start; 12600 propTween.start = 0; 12601 } 12602 } 12603 } 12604} 12605 12606function propFilter( props, specialEasing ) { 12607 var index, name, easing, value, hooks; 12608 12609 // camelCase, specialEasing and expand cssHook pass 12610 for ( index in props ) { 12611 name = camelCase( index ); 12612 easing = specialEasing[ name ]; 12613 value = props[ index ]; 12614 if ( Array.isArray( value ) ) { 12615 easing = value[ 1 ]; 12616 value = props[ index ] = value[ 0 ]; 12617 } 12618 12619 if ( index !== name ) { 12620 props[ name ] = value; 12621 delete props[ index ]; 12622 } 12623 12624 hooks = jQuery.cssHooks[ name ]; 12625 if ( hooks && "expand" in hooks ) { 12626 value = hooks.expand( value ); 12627 delete props[ name ]; 12628 12629 // Not quite $.extend, this won't overwrite existing keys. 12630 // Reusing 'index' because we have the correct "name" 12631 for ( index in value ) { 12632 if ( !( index in props ) ) { 12633 props[ index ] = value[ index ]; 12634 specialEasing[ index ] = easing; 12635 } 12636 } 12637 } else { 12638 specialEasing[ name ] = easing; 12639 } 12640 } 12641} 12642 12643function Animation( elem, properties, options ) { 12644 var result, 12645 stopped, 12646 index = 0, 12647 length = Animation.prefilters.length, 12648 deferred = jQuery.Deferred().always( function() { 12649 12650 // Don't match elem in the :animated selector 12651 delete tick.elem; 12652 } ), 12653 tick = function() { 12654 if ( stopped ) { 12655 return false; 12656 } 12657 var currentTime = fxNow || createFxNow(), 12658 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 12659 12660 // Support: Android 2.3 only 12661 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 12662 temp = remaining / animation.duration || 0, 12663 percent = 1 - temp, 12664 index = 0, 12665 length = animation.tweens.length; 12666 12667 for ( ; index < length; index++ ) { 12668 animation.tweens[ index ].run( percent ); 12669 } 12670 12671 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 12672 12673 // If there's more to do, yield 12674 if ( percent < 1 && length ) { 12675 return remaining; 12676 } 12677 12678 // If this was an empty animation, synthesize a final progress notification 12679 if ( !length ) { 12680 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12681 } 12682 12683 // Resolve the animation and report its conclusion 12684 deferred.resolveWith( elem, [ animation ] ); 12685 return false; 12686 }, 12687 animation = deferred.promise( { 12688 elem: elem, 12689 props: jQuery.extend( {}, properties ), 12690 opts: jQuery.extend( true, { 12691 specialEasing: {}, 12692 easing: jQuery.easing._default 12693 }, options ), 12694 originalProperties: properties, 12695 originalOptions: options, 12696 startTime: fxNow || createFxNow(), 12697 duration: options.duration, 12698 tweens: [], 12699 createTween: function( prop, end ) { 12700 var tween = jQuery.Tween( elem, animation.opts, prop, end, 12701 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 12702 animation.tweens.push( tween ); 12703 return tween; 12704 }, 12705 stop: function( gotoEnd ) { 12706 var index = 0, 12707 12708 // If we are going to the end, we want to run all the tweens 12709 // otherwise we skip this part 12710 length = gotoEnd ? animation.tweens.length : 0; 12711 if ( stopped ) { 12712 return this; 12713 } 12714 stopped = true; 12715 for ( ; index < length; index++ ) { 12716 animation.tweens[ index ].run( 1 ); 12717 } 12718 12719 // Resolve when we played the last frame; otherwise, reject 12720 if ( gotoEnd ) { 12721 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12722 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 12723 } else { 12724 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 12725 } 12726 return this; 12727 } 12728 } ), 12729 props = animation.props; 12730 12731 propFilter( props, animation.opts.specialEasing ); 12732 12733 for ( ; index < length; index++ ) { 12734 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 12735 if ( result ) { 12736 if ( isFunction( result.stop ) ) { 12737 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 12738 result.stop.bind( result ); 12739 } 12740 return result; 12741 } 12742 } 12743 12744 jQuery.map( props, createTween, animation ); 12745 12746 if ( isFunction( animation.opts.start ) ) { 12747 animation.opts.start.call( elem, animation ); 12748 } 12749 12750 // Attach callbacks from options 12751 animation 12752 .progress( animation.opts.progress ) 12753 .done( animation.opts.done, animation.opts.complete ) 12754 .fail( animation.opts.fail ) 12755 .always( animation.opts.always ); 12756 12757 jQuery.fx.timer( 12758 jQuery.extend( tick, { 12759 elem: elem, 12760 anim: animation, 12761 queue: animation.opts.queue 12762 } ) 12763 ); 12764 12765 return animation; 12766} 12767 12768jQuery.Animation = jQuery.extend( Animation, { 12769 12770 tweeners: { 12771 "*": [ function( prop, value ) { 12772 var tween = this.createTween( prop, value ); 12773 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 12774 return tween; 12775 } ] 12776 }, 12777 12778 tweener: function( props, callback ) { 12779 if ( isFunction( props ) ) { 12780 callback = props; 12781 props = [ "*" ]; 12782 } else { 12783 props = props.match( rnothtmlwhite ); 12784 } 12785 12786 var prop, 12787 index = 0, 12788 length = props.length; 12789 12790 for ( ; index < length; index++ ) { 12791 prop = props[ index ]; 12792 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 12793 Animation.tweeners[ prop ].unshift( callback ); 12794 } 12795 }, 12796 12797 prefilters: [ defaultPrefilter ], 12798 12799 prefilter: function( callback, prepend ) { 12800 if ( prepend ) { 12801 Animation.prefilters.unshift( callback ); 12802 } else { 12803 Animation.prefilters.push( callback ); 12804 } 12805 } 12806} ); 12807 12808jQuery.speed = function( speed, easing, fn ) { 12809 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 12810 complete: fn || !fn && easing || 12811 isFunction( speed ) && speed, 12812 duration: speed, 12813 easing: fn && easing || easing && !isFunction( easing ) && easing 12814 }; 12815 12816 // Go to the end state if fx are off 12817 if ( jQuery.fx.off ) { 12818 opt.duration = 0; 12819 12820 } else { 12821 if ( typeof opt.duration !== "number" ) { 12822 if ( opt.duration in jQuery.fx.speeds ) { 12823 opt.duration = jQuery.fx.speeds[ opt.duration ]; 12824 12825 } else { 12826 opt.duration = jQuery.fx.speeds._default; 12827 } 12828 } 12829 } 12830 12831 // Normalize opt.queue - true/undefined/null -> "fx" 12832 if ( opt.queue == null || opt.queue === true ) { 12833 opt.queue = "fx"; 12834 } 12835 12836 // Queueing 12837 opt.old = opt.complete; 12838 12839 opt.complete = function() { 12840 if ( isFunction( opt.old ) ) { 12841 opt.old.call( this ); 12842 } 12843 12844 if ( opt.queue ) { 12845 jQuery.dequeue( this, opt.queue ); 12846 } 12847 }; 12848 12849 return opt; 12850}; 12851 12852jQuery.fn.extend( { 12853 fadeTo: function( speed, to, easing, callback ) { 12854 12855 // Show any hidden elements after setting opacity to 0 12856 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 12857 12858 // Animate to the value specified 12859 .end().animate( { opacity: to }, speed, easing, callback ); 12860 }, 12861 animate: function( prop, speed, easing, callback ) { 12862 var empty = jQuery.isEmptyObject( prop ), 12863 optall = jQuery.speed( speed, easing, callback ), 12864 doAnimation = function() { 12865 12866 // Operate on a copy of prop so per-property easing won't be lost 12867 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 12868 12869 // Empty animations, or finishing resolves immediately 12870 if ( empty || dataPriv.get( this, "finish" ) ) { 12871 anim.stop( true ); 12872 } 12873 }; 12874 12875 doAnimation.finish = doAnimation; 12876 12877 return empty || optall.queue === false ? 12878 this.each( doAnimation ) : 12879 this.queue( optall.queue, doAnimation ); 12880 }, 12881 stop: function( type, clearQueue, gotoEnd ) { 12882 var stopQueue = function( hooks ) { 12883 var stop = hooks.stop; 12884 delete hooks.stop; 12885 stop( gotoEnd ); 12886 }; 12887 12888 if ( typeof type !== "string" ) { 12889 gotoEnd = clearQueue; 12890 clearQueue = type; 12891 type = undefined; 12892 } 12893 if ( clearQueue ) { 12894 this.queue( type || "fx", [] ); 12895 } 12896 12897 return this.each( function() { 12898 var dequeue = true, 12899 index = type != null && type + "queueHooks", 12900 timers = jQuery.timers, 12901 data = dataPriv.get( this ); 12902 12903 if ( index ) { 12904 if ( data[ index ] && data[ index ].stop ) { 12905 stopQueue( data[ index ] ); 12906 } 12907 } else { 12908 for ( index in data ) { 12909 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 12910 stopQueue( data[ index ] ); 12911 } 12912 } 12913 } 12914 12915 for ( index = timers.length; index--; ) { 12916 if ( timers[ index ].elem === this && 12917 ( type == null || timers[ index ].queue === type ) ) { 12918 12919 timers[ index ].anim.stop( gotoEnd ); 12920 dequeue = false; 12921 timers.splice( index, 1 ); 12922 } 12923 } 12924 12925 // Start the next in the queue if the last step wasn't forced. 12926 // Timers currently will call their complete callbacks, which 12927 // will dequeue but only if they were gotoEnd. 12928 if ( dequeue || !gotoEnd ) { 12929 jQuery.dequeue( this, type ); 12930 } 12931 } ); 12932 }, 12933 finish: function( type ) { 12934 if ( type !== false ) { 12935 type = type || "fx"; 12936 } 12937 return this.each( function() { 12938 var index, 12939 data = dataPriv.get( this ), 12940 queue = data[ type + "queue" ], 12941 hooks = data[ type + "queueHooks" ], 12942 timers = jQuery.timers, 12943 length = queue ? queue.length : 0; 12944 12945 // Enable finishing flag on private data 12946 data.finish = true; 12947 12948 // Empty the queue first 12949 jQuery.queue( this, type, [] ); 12950 12951 if ( hooks && hooks.stop ) { 12952 hooks.stop.call( this, true ); 12953 } 12954 12955 // Look for any active animations, and finish them 12956 for ( index = timers.length; index--; ) { 12957 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 12958 timers[ index ].anim.stop( true ); 12959 timers.splice( index, 1 ); 12960 } 12961 } 12962 12963 // Look for any animations in the old queue and finish them 12964 for ( index = 0; index < length; index++ ) { 12965 if ( queue[ index ] && queue[ index ].finish ) { 12966 queue[ index ].finish.call( this ); 12967 } 12968 } 12969 12970 // Turn off finishing flag 12971 delete data.finish; 12972 } ); 12973 } 12974} ); 12975 12976jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 12977 var cssFn = jQuery.fn[ name ]; 12978 jQuery.fn[ name ] = function( speed, easing, callback ) { 12979 return speed == null || typeof speed === "boolean" ? 12980 cssFn.apply( this, arguments ) : 12981 this.animate( genFx( name, true ), speed, easing, callback ); 12982 }; 12983} ); 12984 12985// Generate shortcuts for custom animations 12986jQuery.each( { 12987 slideDown: genFx( "show" ), 12988 slideUp: genFx( "hide" ), 12989 slideToggle: genFx( "toggle" ), 12990 fadeIn: { opacity: "show" }, 12991 fadeOut: { opacity: "hide" }, 12992 fadeToggle: { opacity: "toggle" } 12993}, function( name, props ) { 12994 jQuery.fn[ name ] = function( speed, easing, callback ) { 12995 return this.animate( props, speed, easing, callback ); 12996 }; 12997} ); 12998 12999jQuery.timers = []; 13000jQuery.fx.tick = function() { 13001 var timer, 13002 i = 0, 13003 timers = jQuery.timers; 13004 13005 fxNow = Date.now(); 13006 13007 for ( ; i < timers.length; i++ ) { 13008 timer = timers[ i ]; 13009 13010 // Run the timer and safely remove it when done (allowing for external removal) 13011 if ( !timer() && timers[ i ] === timer ) { 13012 timers.splice( i--, 1 ); 13013 } 13014 } 13015 13016 if ( !timers.length ) { 13017 jQuery.fx.stop(); 13018 } 13019 fxNow = undefined; 13020}; 13021 13022jQuery.fx.timer = function( timer ) { 13023 jQuery.timers.push( timer ); 13024 jQuery.fx.start(); 13025}; 13026 13027jQuery.fx.interval = 13; 13028jQuery.fx.start = function() { 13029 if ( inProgress ) { 13030 return; 13031 } 13032 13033 inProgress = true; 13034 schedule(); 13035}; 13036 13037jQuery.fx.stop = function() { 13038 inProgress = null; 13039}; 13040 13041jQuery.fx.speeds = { 13042 slow: 600, 13043 fast: 200, 13044 13045 // Default speed 13046 _default: 400 13047}; 13048 13049 13050// Based off of the plugin by Clint Helfers, with permission. 13051// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 13052jQuery.fn.delay = function( time, type ) { 13053 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 13054 type = type || "fx"; 13055 13056 return this.queue( type, function( next, hooks ) { 13057 var timeout = window.setTimeout( next, time ); 13058 hooks.stop = function() { 13059 window.clearTimeout( timeout ); 13060 }; 13061 } ); 13062}; 13063 13064 13065( function() { 13066 var input = document.createElement( "input" ), 13067 select = document.createElement( "select" ), 13068 opt = select.appendChild( document.createElement( "option" ) ); 13069 13070 input.type = "checkbox"; 13071 13072 // Support: Android <=4.3 only 13073 // Default value for a checkbox should be "on" 13074 support.checkOn = input.value !== ""; 13075 13076 // Support: IE <=11 only 13077 // Must access selectedIndex to make default options select 13078 support.optSelected = opt.selected; 13079 13080 // Support: IE <=11 only 13081 // An input loses its value after becoming a radio 13082 input = document.createElement( "input" ); 13083 input.value = "t"; 13084 input.type = "radio"; 13085 support.radioValue = input.value === "t"; 13086} )(); 13087 13088 13089var boolHook, 13090 attrHandle = jQuery.expr.attrHandle; 13091 13092jQuery.fn.extend( { 13093 attr: function( name, value ) { 13094 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 13095 }, 13096 13097 removeAttr: function( name ) { 13098 return this.each( function() { 13099 jQuery.removeAttr( this, name ); 13100 } ); 13101 } 13102} ); 13103 13104jQuery.extend( { 13105 attr: function( elem, name, value ) { 13106 var ret, hooks, 13107 nType = elem.nodeType; 13108 13109 // Don't get/set attributes on text, comment and attribute nodes 13110 if ( nType === 3 || nType === 8 || nType === 2 ) { 13111 return; 13112 } 13113 13114 // Fallback to prop when attributes are not supported 13115 if ( typeof elem.getAttribute === "undefined" ) { 13116 return jQuery.prop( elem, name, value ); 13117 } 13118 13119 // Attribute hooks are determined by the lowercase version 13120 // Grab necessary hook if one is defined 13121 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13122 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 13123 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 13124 } 13125 13126 if ( value !== undefined ) { 13127 if ( value === null ) { 13128 jQuery.removeAttr( elem, name ); 13129 return; 13130 } 13131 13132 if ( hooks && "set" in hooks && 13133 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13134 return ret; 13135 } 13136 13137 elem.setAttribute( name, value + "" ); 13138 return value; 13139 } 13140 13141 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13142 return ret; 13143 } 13144 13145 ret = jQuery.find.attr( elem, name ); 13146 13147 // Non-existent attributes return null, we normalize to undefined 13148 return ret == null ? undefined : ret; 13149 }, 13150 13151 attrHooks: { 13152 type: { 13153 set: function( elem, value ) { 13154 if ( !support.radioValue && value === "radio" && 13155 nodeName( elem, "input" ) ) { 13156 var val = elem.value; 13157 elem.setAttribute( "type", value ); 13158 if ( val ) { 13159 elem.value = val; 13160 } 13161 return value; 13162 } 13163 } 13164 } 13165 }, 13166 13167 removeAttr: function( elem, value ) { 13168 var name, 13169 i = 0, 13170 13171 // Attribute names can contain non-HTML whitespace characters 13172 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 13173 attrNames = value && value.match( rnothtmlwhite ); 13174 13175 if ( attrNames && elem.nodeType === 1 ) { 13176 while ( ( name = attrNames[ i++ ] ) ) { 13177 elem.removeAttribute( name ); 13178 } 13179 } 13180 } 13181} ); 13182 13183// Hooks for boolean attributes 13184boolHook = { 13185 set: function( elem, value, name ) { 13186 if ( value === false ) { 13187 13188 // Remove boolean attributes when set to false 13189 jQuery.removeAttr( elem, name ); 13190 } else { 13191 elem.setAttribute( name, name ); 13192 } 13193 return name; 13194 } 13195}; 13196 13197jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 13198 var getter = attrHandle[ name ] || jQuery.find.attr; 13199 13200 attrHandle[ name ] = function( elem, name, isXML ) { 13201 var ret, handle, 13202 lowercaseName = name.toLowerCase(); 13203 13204 if ( !isXML ) { 13205 13206 // Avoid an infinite loop by temporarily removing this function from the getter 13207 handle = attrHandle[ lowercaseName ]; 13208 attrHandle[ lowercaseName ] = ret; 13209 ret = getter( elem, name, isXML ) != null ? 13210 lowercaseName : 13211 null; 13212 attrHandle[ lowercaseName ] = handle; 13213 } 13214 return ret; 13215 }; 13216} ); 13217 13218 13219 13220 13221var rfocusable = /^(?:input|select|textarea|button)$/i, 13222 rclickable = /^(?:a|area)$/i; 13223 13224jQuery.fn.extend( { 13225 prop: function( name, value ) { 13226 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 13227 }, 13228 13229 removeProp: function( name ) { 13230 return this.each( function() { 13231 delete this[ jQuery.propFix[ name ] || name ]; 13232 } ); 13233 } 13234} ); 13235 13236jQuery.extend( { 13237 prop: function( elem, name, value ) { 13238 var ret, hooks, 13239 nType = elem.nodeType; 13240 13241 // Don't get/set properties on text, comment and attribute nodes 13242 if ( nType === 3 || nType === 8 || nType === 2 ) { 13243 return; 13244 } 13245 13246 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13247 13248 // Fix name and attach hooks 13249 name = jQuery.propFix[ name ] || name; 13250 hooks = jQuery.propHooks[ name ]; 13251 } 13252 13253 if ( value !== undefined ) { 13254 if ( hooks && "set" in hooks && 13255 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13256 return ret; 13257 } 13258 13259 return ( elem[ name ] = value ); 13260 } 13261 13262 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13263 return ret; 13264 } 13265 13266 return elem[ name ]; 13267 }, 13268 13269 propHooks: { 13270 tabIndex: { 13271 get: function( elem ) { 13272 13273 // Support: IE <=9 - 11 only 13274 // elem.tabIndex doesn't always return the 13275 // correct value when it hasn't been explicitly set 13276 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 13277 // Use proper attribute retrieval(#12072) 13278 var tabindex = jQuery.find.attr( elem, "tabindex" ); 13279 13280 if ( tabindex ) { 13281 return parseInt( tabindex, 10 ); 13282 } 13283 13284 if ( 13285 rfocusable.test( elem.nodeName ) || 13286 rclickable.test( elem.nodeName ) && 13287 elem.href 13288 ) { 13289 return 0; 13290 } 13291 13292 return -1; 13293 } 13294 } 13295 }, 13296 13297 propFix: { 13298 "for": "htmlFor", 13299 "class": "className" 13300 } 13301} ); 13302 13303// Support: IE <=11 only 13304// Accessing the selectedIndex property 13305// forces the browser to respect setting selected 13306// on the option 13307// The getter ensures a default option is selected 13308// when in an optgroup 13309// eslint rule "no-unused-expressions" is disabled for this code 13310// since it considers such accessions noop 13311if ( !support.optSelected ) { 13312 jQuery.propHooks.selected = { 13313 get: function( elem ) { 13314 13315 /* eslint no-unused-expressions: "off" */ 13316 13317 var parent = elem.parentNode; 13318 if ( parent && parent.parentNode ) { 13319 parent.parentNode.selectedIndex; 13320 } 13321 return null; 13322 }, 13323 set: function( elem ) { 13324 13325 /* eslint no-unused-expressions: "off" */ 13326 13327 var parent = elem.parentNode; 13328 if ( parent ) { 13329 parent.selectedIndex; 13330 13331 if ( parent.parentNode ) { 13332 parent.parentNode.selectedIndex; 13333 } 13334 } 13335 } 13336 }; 13337} 13338 13339jQuery.each( [ 13340 "tabIndex", 13341 "readOnly", 13342 "maxLength", 13343 "cellSpacing", 13344 "cellPadding", 13345 "rowSpan", 13346 "colSpan", 13347 "useMap", 13348 "frameBorder", 13349 "contentEditable" 13350], function() { 13351 jQuery.propFix[ this.toLowerCase() ] = this; 13352} ); 13353 13354 13355 13356 13357 // Strip and collapse whitespace according to HTML spec 13358 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 13359 function stripAndCollapse( value ) { 13360 var tokens = value.match( rnothtmlwhite ) || []; 13361 return tokens.join( " " ); 13362 } 13363 13364 13365function getClass( elem ) { 13366 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 13367} 13368 13369function classesToArray( value ) { 13370 if ( Array.isArray( value ) ) { 13371 return value; 13372 } 13373 if ( typeof value === "string" ) { 13374 return value.match( rnothtmlwhite ) || []; 13375 } 13376 return []; 13377} 13378 13379jQuery.fn.extend( { 13380 addClass: function( value ) { 13381 var classes, elem, cur, curValue, clazz, j, finalValue, 13382 i = 0; 13383 13384 if ( isFunction( value ) ) { 13385 return this.each( function( j ) { 13386 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 13387 } ); 13388 } 13389 13390 classes = classesToArray( value ); 13391 13392 if ( classes.length ) { 13393 while ( ( elem = this[ i++ ] ) ) { 13394 curValue = getClass( elem ); 13395 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13396 13397 if ( cur ) { 13398 j = 0; 13399 while ( ( clazz = classes[ j++ ] ) ) { 13400 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 13401 cur += clazz + " "; 13402 } 13403 } 13404 13405 // Only assign if different to avoid unneeded rendering. 13406 finalValue = stripAndCollapse( cur ); 13407 if ( curValue !== finalValue ) { 13408 elem.setAttribute( "class", finalValue ); 13409 } 13410 } 13411 } 13412 } 13413 13414 return this; 13415 }, 13416 13417 removeClass: function( value ) { 13418 var classes, elem, cur, curValue, clazz, j, finalValue, 13419 i = 0; 13420 13421 if ( isFunction( value ) ) { 13422 return this.each( function( j ) { 13423 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 13424 } ); 13425 } 13426 13427 if ( !arguments.length ) { 13428 return this.attr( "class", "" ); 13429 } 13430 13431 classes = classesToArray( value ); 13432 13433 if ( classes.length ) { 13434 while ( ( elem = this[ i++ ] ) ) { 13435 curValue = getClass( elem ); 13436 13437 // This expression is here for better compressibility (see addClass) 13438 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13439 13440 if ( cur ) { 13441 j = 0; 13442 while ( ( clazz = classes[ j++ ] ) ) { 13443 13444 // Remove *all* instances 13445 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 13446 cur = cur.replace( " " + clazz + " ", " " ); 13447 } 13448 } 13449 13450 // Only assign if different to avoid unneeded rendering. 13451 finalValue = stripAndCollapse( cur ); 13452 if ( curValue !== finalValue ) { 13453 elem.setAttribute( "class", finalValue ); 13454 } 13455 } 13456 } 13457 } 13458 13459 return this; 13460 }, 13461 13462 toggleClass: function( value, stateVal ) { 13463 var type = typeof value, 13464 isValidValue = type === "string" || Array.isArray( value ); 13465 13466 if ( typeof stateVal === "boolean" && isValidValue ) { 13467 return stateVal ? this.addClass( value ) : this.removeClass( value ); 13468 } 13469 13470 if ( isFunction( value ) ) { 13471 return this.each( function( i ) { 13472 jQuery( this ).toggleClass( 13473 value.call( this, i, getClass( this ), stateVal ), 13474 stateVal 13475 ); 13476 } ); 13477 } 13478 13479 return this.each( function() { 13480 var className, i, self, classNames; 13481 13482 if ( isValidValue ) { 13483 13484 // Toggle individual class names 13485 i = 0; 13486 self = jQuery( this ); 13487 classNames = classesToArray( value ); 13488 13489 while ( ( className = classNames[ i++ ] ) ) { 13490 13491 // Check each className given, space separated list 13492 if ( self.hasClass( className ) ) { 13493 self.removeClass( className ); 13494 } else { 13495 self.addClass( className ); 13496 } 13497 } 13498 13499 // Toggle whole class name 13500 } else if ( value === undefined || type === "boolean" ) { 13501 className = getClass( this ); 13502 if ( className ) { 13503 13504 // Store className if set 13505 dataPriv.set( this, "__className__", className ); 13506 } 13507 13508 // If the element has a class name or if we're passed `false`, 13509 // then remove the whole classname (if there was one, the above saved it). 13510 // Otherwise bring back whatever was previously saved (if anything), 13511 // falling back to the empty string if nothing was stored. 13512 if ( this.setAttribute ) { 13513 this.setAttribute( "class", 13514 className || value === false ? 13515 "" : 13516 dataPriv.get( this, "__className__" ) || "" 13517 ); 13518 } 13519 } 13520 } ); 13521 }, 13522 13523 hasClass: function( selector ) { 13524 var className, elem, 13525 i = 0; 13526 13527 className = " " + selector + " "; 13528 while ( ( elem = this[ i++ ] ) ) { 13529 if ( elem.nodeType === 1 && 13530 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 13531 return true; 13532 } 13533 } 13534 13535 return false; 13536 } 13537} ); 13538 13539 13540 13541 13542var rreturn = /\r/g; 13543 13544jQuery.fn.extend( { 13545 val: function( value ) { 13546 var hooks, ret, valueIsFunction, 13547 elem = this[ 0 ]; 13548 13549 if ( !arguments.length ) { 13550 if ( elem ) { 13551 hooks = jQuery.valHooks[ elem.type ] || 13552 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 13553 13554 if ( hooks && 13555 "get" in hooks && 13556 ( ret = hooks.get( elem, "value" ) ) !== undefined 13557 ) { 13558 return ret; 13559 } 13560 13561 ret = elem.value; 13562 13563 // Handle most common string cases 13564 if ( typeof ret === "string" ) { 13565 return ret.replace( rreturn, "" ); 13566 } 13567 13568 // Handle cases where value is null/undef or number 13569 return ret == null ? "" : ret; 13570 } 13571 13572 return; 13573 } 13574 13575 valueIsFunction = isFunction( value ); 13576 13577 return this.each( function( i ) { 13578 var val; 13579 13580 if ( this.nodeType !== 1 ) { 13581 return; 13582 } 13583 13584 if ( valueIsFunction ) { 13585 val = value.call( this, i, jQuery( this ).val() ); 13586 } else { 13587 val = value; 13588 } 13589 13590 // Treat null/undefined as ""; convert numbers to string 13591 if ( val == null ) { 13592 val = ""; 13593 13594 } else if ( typeof val === "number" ) { 13595 val += ""; 13596 13597 } else if ( Array.isArray( val ) ) { 13598 val = jQuery.map( val, function( value ) { 13599 return value == null ? "" : value + ""; 13600 } ); 13601 } 13602 13603 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 13604 13605 // If set returns undefined, fall back to normal setting 13606 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 13607 this.value = val; 13608 } 13609 } ); 13610 } 13611} ); 13612 13613jQuery.extend( { 13614 valHooks: { 13615 option: { 13616 get: function( elem ) { 13617 13618 var val = jQuery.find.attr( elem, "value" ); 13619 return val != null ? 13620 val : 13621 13622 // Support: IE <=10 - 11 only 13623 // option.text throws exceptions (#14686, #14858) 13624 // Strip and collapse whitespace 13625 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 13626 stripAndCollapse( jQuery.text( elem ) ); 13627 } 13628 }, 13629 select: { 13630 get: function( elem ) { 13631 var value, option, i, 13632 options = elem.options, 13633 index = elem.selectedIndex, 13634 one = elem.type === "select-one", 13635 values = one ? null : [], 13636 max = one ? index + 1 : options.length; 13637 13638 if ( index < 0 ) { 13639 i = max; 13640 13641 } else { 13642 i = one ? index : 0; 13643 } 13644 13645 // Loop through all the selected options 13646 for ( ; i < max; i++ ) { 13647 option = options[ i ]; 13648 13649 // Support: IE <=9 only 13650 // IE8-9 doesn't update selected after form reset (#2551) 13651 if ( ( option.selected || i === index ) && 13652 13653 // Don't return options that are disabled or in a disabled optgroup 13654 !option.disabled && 13655 ( !option.parentNode.disabled || 13656 !nodeName( option.parentNode, "optgroup" ) ) ) { 13657 13658 // Get the specific value for the option 13659 value = jQuery( option ).val(); 13660 13661 // We don't need an array for one selects 13662 if ( one ) { 13663 return value; 13664 } 13665 13666 // Multi-Selects return an array 13667 values.push( value ); 13668 } 13669 } 13670 13671 return values; 13672 }, 13673 13674 set: function( elem, value ) { 13675 var optionSet, option, 13676 options = elem.options, 13677 values = jQuery.makeArray( value ), 13678 i = options.length; 13679 13680 while ( i-- ) { 13681 option = options[ i ]; 13682 13683 /* eslint-disable no-cond-assign */ 13684 13685 if ( option.selected = 13686 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 13687 ) { 13688 optionSet = true; 13689 } 13690 13691 /* eslint-enable no-cond-assign */ 13692 } 13693 13694 // Force browsers to behave consistently when non-matching value is set 13695 if ( !optionSet ) { 13696 elem.selectedIndex = -1; 13697 } 13698 return values; 13699 } 13700 } 13701 } 13702} ); 13703 13704// Radios and checkboxes getter/setter 13705jQuery.each( [ "radio", "checkbox" ], function() { 13706 jQuery.valHooks[ this ] = { 13707 set: function( elem, value ) { 13708 if ( Array.isArray( value ) ) { 13709 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 13710 } 13711 } 13712 }; 13713 if ( !support.checkOn ) { 13714 jQuery.valHooks[ this ].get = function( elem ) { 13715 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 13716 }; 13717 } 13718} ); 13719 13720 13721 13722 13723// Return jQuery for attributes-only inclusion 13724 13725 13726support.focusin = "onfocusin" in window; 13727 13728 13729var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 13730 stopPropagationCallback = function( e ) { 13731 e.stopPropagation(); 13732 }; 13733 13734jQuery.extend( jQuery.event, { 13735 13736 trigger: function( event, data, elem, onlyHandlers ) { 13737 13738 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 13739 eventPath = [ elem || document ], 13740 type = hasOwn.call( event, "type" ) ? event.type : event, 13741 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 13742 13743 cur = lastElement = tmp = elem = elem || document; 13744 13745 // Don't do events on text and comment nodes 13746 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 13747 return; 13748 } 13749 13750 // focus/blur morphs to focusin/out; ensure we're not firing them right now 13751 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 13752 return; 13753 } 13754 13755 if ( type.indexOf( "." ) > -1 ) { 13756 13757 // Namespaced trigger; create a regexp to match event type in handle() 13758 namespaces = type.split( "." ); 13759 type = namespaces.shift(); 13760 namespaces.sort(); 13761 } 13762 ontype = type.indexOf( ":" ) < 0 && "on" + type; 13763 13764 // Caller can pass in a jQuery.Event object, Object, or just an event type string 13765 event = event[ jQuery.expando ] ? 13766 event : 13767 new jQuery.Event( type, typeof event === "object" && event ); 13768 13769 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 13770 event.isTrigger = onlyHandlers ? 2 : 3; 13771 event.namespace = namespaces.join( "." ); 13772 event.rnamespace = event.namespace ? 13773 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 13774 null; 13775 13776 // Clean up the event in case it is being reused 13777 event.result = undefined; 13778 if ( !event.target ) { 13779 event.target = elem; 13780 } 13781 13782 // Clone any incoming data and prepend the event, creating the handler arg list 13783 data = data == null ? 13784 [ event ] : 13785 jQuery.makeArray( data, [ event ] ); 13786 13787 // Allow special events to draw outside the lines 13788 special = jQuery.event.special[ type ] || {}; 13789 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 13790 return; 13791 } 13792 13793 // Determine event propagation path in advance, per W3C events spec (#9951) 13794 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 13795 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 13796 13797 bubbleType = special.delegateType || type; 13798 if ( !rfocusMorph.test( bubbleType + type ) ) { 13799 cur = cur.parentNode; 13800 } 13801 for ( ; cur; cur = cur.parentNode ) { 13802 eventPath.push( cur ); 13803 tmp = cur; 13804 } 13805 13806 // Only add window if we got to document (e.g., not plain obj or detached DOM) 13807 if ( tmp === ( elem.ownerDocument || document ) ) { 13808 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 13809 } 13810 } 13811 13812 // Fire handlers on the event path 13813 i = 0; 13814 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 13815 lastElement = cur; 13816 event.type = i > 1 ? 13817 bubbleType : 13818 special.bindType || type; 13819 13820 // jQuery handler 13821 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 13822 dataPriv.get( cur, "handle" ); 13823 if ( handle ) { 13824 handle.apply( cur, data ); 13825 } 13826 13827 // Native handler 13828 handle = ontype && cur[ ontype ]; 13829 if ( handle && handle.apply && acceptData( cur ) ) { 13830 event.result = handle.apply( cur, data ); 13831 if ( event.result === false ) { 13832 event.preventDefault(); 13833 } 13834 } 13835 } 13836 event.type = type; 13837 13838 // If nobody prevented the default action, do it now 13839 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 13840 13841 if ( ( !special._default || 13842 special._default.apply( eventPath.pop(), data ) === false ) && 13843 acceptData( elem ) ) { 13844 13845 // Call a native DOM method on the target with the same name as the event. 13846 // Don't do default actions on window, that's where global variables be (#6170) 13847 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 13848 13849 // Don't re-trigger an onFOO event when we call its FOO() method 13850 tmp = elem[ ontype ]; 13851 13852 if ( tmp ) { 13853 elem[ ontype ] = null; 13854 } 13855 13856 // Prevent re-triggering of the same event, since we already bubbled it above 13857 jQuery.event.triggered = type; 13858 13859 if ( event.isPropagationStopped() ) { 13860 lastElement.addEventListener( type, stopPropagationCallback ); 13861 } 13862 13863 elem[ type ](); 13864 13865 if ( event.isPropagationStopped() ) { 13866 lastElement.removeEventListener( type, stopPropagationCallback ); 13867 } 13868 13869 jQuery.event.triggered = undefined; 13870 13871 if ( tmp ) { 13872 elem[ ontype ] = tmp; 13873 } 13874 } 13875 } 13876 } 13877 13878 return event.result; 13879 }, 13880 13881 // Piggyback on a donor event to simulate a different one 13882 // Used only for `focus(in | out)` events 13883 simulate: function( type, elem, event ) { 13884 var e = jQuery.extend( 13885 new jQuery.Event(), 13886 event, 13887 { 13888 type: type, 13889 isSimulated: true 13890 } 13891 ); 13892 13893 jQuery.event.trigger( e, null, elem ); 13894 } 13895 13896} ); 13897 13898jQuery.fn.extend( { 13899 13900 trigger: function( type, data ) { 13901 return this.each( function() { 13902 jQuery.event.trigger( type, data, this ); 13903 } ); 13904 }, 13905 triggerHandler: function( type, data ) { 13906 var elem = this[ 0 ]; 13907 if ( elem ) { 13908 return jQuery.event.trigger( type, data, elem, true ); 13909 } 13910 } 13911} ); 13912 13913 13914// Support: Firefox <=44 13915// Firefox doesn't have focus(in | out) events 13916// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 13917// 13918// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 13919// focus(in | out) events fire after focus & blur events, 13920// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 13921// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 13922if ( !support.focusin ) { 13923 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 13924 13925 // Attach a single capturing handler on the document while someone wants focusin/focusout 13926 var handler = function( event ) { 13927 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 13928 }; 13929 13930 jQuery.event.special[ fix ] = { 13931 setup: function() { 13932 13933 // Handle: regular nodes (via `this.ownerDocument`), window 13934 // (via `this.document`) & document (via `this`). 13935 var doc = this.ownerDocument || this.document || this, 13936 attaches = dataPriv.access( doc, fix ); 13937 13938 if ( !attaches ) { 13939 doc.addEventListener( orig, handler, true ); 13940 } 13941 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 13942 }, 13943 teardown: function() { 13944 var doc = this.ownerDocument || this.document || this, 13945 attaches = dataPriv.access( doc, fix ) - 1; 13946 13947 if ( !attaches ) { 13948 doc.removeEventListener( orig, handler, true ); 13949 dataPriv.remove( doc, fix ); 13950 13951 } else { 13952 dataPriv.access( doc, fix, attaches ); 13953 } 13954 } 13955 }; 13956 } ); 13957} 13958var location = window.location; 13959 13960var nonce = { guid: Date.now() }; 13961 13962var rquery = ( /\?/ ); 13963 13964 13965 13966// Cross-browser xml parsing 13967jQuery.parseXML = function( data ) { 13968 var xml, parserErrorElem; 13969 if ( !data || typeof data !== "string" ) { 13970 return null; 13971 } 13972 13973 // Support: IE 9 - 11 only 13974 // IE throws on parseFromString with invalid input. 13975 try { 13976 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 13977 } catch ( e ) {} 13978 13979 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 13980 if ( !xml || parserErrorElem ) { 13981 jQuery.error( "Invalid XML: " + ( 13982 parserErrorElem ? 13983 jQuery.map( parserErrorElem.childNodes, function( el ) { 13984 return el.textContent; 13985 } ).join( "\n" ) : 13986 data 13987 ) ); 13988 } 13989 return xml; 13990}; 13991 13992 13993var 13994 rbracket = /\[\]$/, 13995 rCRLF = /\r?\n/g, 13996 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 13997 rsubmittable = /^(?:input|select|textarea|keygen)/i; 13998 13999function buildParams( prefix, obj, traditional, add ) { 14000 var name; 14001 14002 if ( Array.isArray( obj ) ) { 14003 14004 // Serialize array item. 14005 jQuery.each( obj, function( i, v ) { 14006 if ( traditional || rbracket.test( prefix ) ) { 14007 14008 // Treat each array item as a scalar. 14009 add( prefix, v ); 14010 14011 } else { 14012 14013 // Item is non-scalar (array or object), encode its numeric index. 14014 buildParams( 14015 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 14016 v, 14017 traditional, 14018 add 14019 ); 14020 } 14021 } ); 14022 14023 } else if ( !traditional && toType( obj ) === "object" ) { 14024 14025 // Serialize object item. 14026 for ( name in obj ) { 14027 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 14028 } 14029 14030 } else { 14031 14032 // Serialize scalar item. 14033 add( prefix, obj ); 14034 } 14035} 14036 14037// Serialize an array of form elements or a set of 14038// key/values into a query string 14039jQuery.param = function( a, traditional ) { 14040 var prefix, 14041 s = [], 14042 add = function( key, valueOrFunction ) { 14043 14044 // If value is a function, invoke it and use its return value 14045 var value = isFunction( valueOrFunction ) ? 14046 valueOrFunction() : 14047 valueOrFunction; 14048 14049 s[ s.length ] = encodeURIComponent( key ) + "=" + 14050 encodeURIComponent( value == null ? "" : value ); 14051 }; 14052 14053 if ( a == null ) { 14054 return ""; 14055 } 14056 14057 // If an array was passed in, assume that it is an array of form elements. 14058 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 14059 14060 // Serialize the form elements 14061 jQuery.each( a, function() { 14062 add( this.name, this.value ); 14063 } ); 14064 14065 } else { 14066 14067 // If traditional, encode the "old" way (the way 1.3.2 or older 14068 // did it), otherwise encode params recursively. 14069 for ( prefix in a ) { 14070 buildParams( prefix, a[ prefix ], traditional, add ); 14071 } 14072 } 14073 14074 // Return the resulting serialization 14075 return s.join( "&" ); 14076}; 14077 14078jQuery.fn.extend( { 14079 serialize: function() { 14080 return jQuery.param( this.serializeArray() ); 14081 }, 14082 serializeArray: function() { 14083 return this.map( function() { 14084 14085 // Can add propHook for "elements" to filter or add form elements 14086 var elements = jQuery.prop( this, "elements" ); 14087 return elements ? jQuery.makeArray( elements ) : this; 14088 } ).filter( function() { 14089 var type = this.type; 14090 14091 // Use .is( ":disabled" ) so that fieldset[disabled] works 14092 return this.name && !jQuery( this ).is( ":disabled" ) && 14093 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 14094 ( this.checked || !rcheckableType.test( type ) ); 14095 } ).map( function( _i, elem ) { 14096 var val = jQuery( this ).val(); 14097 14098 if ( val == null ) { 14099 return null; 14100 } 14101 14102 if ( Array.isArray( val ) ) { 14103 return jQuery.map( val, function( val ) { 14104 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14105 } ); 14106 } 14107 14108 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14109 } ).get(); 14110 } 14111} ); 14112 14113 14114var 14115 r20 = /%20/g, 14116 rhash = /#.*$/, 14117 rantiCache = /([?&])_=[^&]*/, 14118 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 14119 14120 // #7653, #8125, #8152: local protocol detection 14121 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 14122 rnoContent = /^(?:GET|HEAD)$/, 14123 rprotocol = /^\/\//, 14124 14125 /* Prefilters 14126 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 14127 * 2) These are called: 14128 * - BEFORE asking for a transport 14129 * - AFTER param serialization (s.data is a string if s.processData is true) 14130 * 3) key is the dataType 14131 * 4) the catchall symbol "*" can be used 14132 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 14133 */ 14134 prefilters = {}, 14135 14136 /* Transports bindings 14137 * 1) key is the dataType 14138 * 2) the catchall symbol "*" can be used 14139 * 3) selection will start with transport dataType and THEN go to "*" if needed 14140 */ 14141 transports = {}, 14142 14143 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 14144 allTypes = "*/".concat( "*" ), 14145 14146 // Anchor tag for parsing the document origin 14147 originAnchor = document.createElement( "a" ); 14148 14149originAnchor.href = location.href; 14150 14151// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 14152function addToPrefiltersOrTransports( structure ) { 14153 14154 // dataTypeExpression is optional and defaults to "*" 14155 return function( dataTypeExpression, func ) { 14156 14157 if ( typeof dataTypeExpression !== "string" ) { 14158 func = dataTypeExpression; 14159 dataTypeExpression = "*"; 14160 } 14161 14162 var dataType, 14163 i = 0, 14164 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 14165 14166 if ( isFunction( func ) ) { 14167 14168 // For each dataType in the dataTypeExpression 14169 while ( ( dataType = dataTypes[ i++ ] ) ) { 14170 14171 // Prepend if requested 14172 if ( dataType[ 0 ] === "+" ) { 14173 dataType = dataType.slice( 1 ) || "*"; 14174 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 14175 14176 // Otherwise append 14177 } else { 14178 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 14179 } 14180 } 14181 } 14182 }; 14183} 14184 14185// Base inspection function for prefilters and transports 14186function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 14187 14188 var inspected = {}, 14189 seekingTransport = ( structure === transports ); 14190 14191 function inspect( dataType ) { 14192 var selected; 14193 inspected[ dataType ] = true; 14194 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 14195 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 14196 if ( typeof dataTypeOrTransport === "string" && 14197 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 14198 14199 options.dataTypes.unshift( dataTypeOrTransport ); 14200 inspect( dataTypeOrTransport ); 14201 return false; 14202 } else if ( seekingTransport ) { 14203 return !( selected = dataTypeOrTransport ); 14204 } 14205 } ); 14206 return selected; 14207 } 14208 14209 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 14210} 14211 14212// A special extend for ajax options 14213// that takes "flat" options (not to be deep extended) 14214// Fixes #9887 14215function ajaxExtend( target, src ) { 14216 var key, deep, 14217 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 14218 14219 for ( key in src ) { 14220 if ( src[ key ] !== undefined ) { 14221 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 14222 } 14223 } 14224 if ( deep ) { 14225 jQuery.extend( true, target, deep ); 14226 } 14227 14228 return target; 14229} 14230 14231/* Handles responses to an ajax request: 14232 * - finds the right dataType (mediates between content-type and expected dataType) 14233 * - returns the corresponding response 14234 */ 14235function ajaxHandleResponses( s, jqXHR, responses ) { 14236 14237 var ct, type, finalDataType, firstDataType, 14238 contents = s.contents, 14239 dataTypes = s.dataTypes; 14240 14241 // Remove auto dataType and get content-type in the process 14242 while ( dataTypes[ 0 ] === "*" ) { 14243 dataTypes.shift(); 14244 if ( ct === undefined ) { 14245 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 14246 } 14247 } 14248 14249 // Check if we're dealing with a known content-type 14250 if ( ct ) { 14251 for ( type in contents ) { 14252 if ( contents[ type ] && contents[ type ].test( ct ) ) { 14253 dataTypes.unshift( type ); 14254 break; 14255 } 14256 } 14257 } 14258 14259 // Check to see if we have a response for the expected dataType 14260 if ( dataTypes[ 0 ] in responses ) { 14261 finalDataType = dataTypes[ 0 ]; 14262 } else { 14263 14264 // Try convertible dataTypes 14265 for ( type in responses ) { 14266 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 14267 finalDataType = type; 14268 break; 14269 } 14270 if ( !firstDataType ) { 14271 firstDataType = type; 14272 } 14273 } 14274 14275 // Or just use first one 14276 finalDataType = finalDataType || firstDataType; 14277 } 14278 14279 // If we found a dataType 14280 // We add the dataType to the list if needed 14281 // and return the corresponding response 14282 if ( finalDataType ) { 14283 if ( finalDataType !== dataTypes[ 0 ] ) { 14284 dataTypes.unshift( finalDataType ); 14285 } 14286 return responses[ finalDataType ]; 14287 } 14288} 14289 14290/* Chain conversions given the request and the original response 14291 * Also sets the responseXXX fields on the jqXHR instance 14292 */ 14293function ajaxConvert( s, response, jqXHR, isSuccess ) { 14294 var conv2, current, conv, tmp, prev, 14295 converters = {}, 14296 14297 // Work with a copy of dataTypes in case we need to modify it for conversion 14298 dataTypes = s.dataTypes.slice(); 14299 14300 // Create converters map with lowercased keys 14301 if ( dataTypes[ 1 ] ) { 14302 for ( conv in s.converters ) { 14303 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 14304 } 14305 } 14306 14307 current = dataTypes.shift(); 14308 14309 // Convert to each sequential dataType 14310 while ( current ) { 14311 14312 if ( s.responseFields[ current ] ) { 14313 jqXHR[ s.responseFields[ current ] ] = response; 14314 } 14315 14316 // Apply the dataFilter if provided 14317 if ( !prev && isSuccess && s.dataFilter ) { 14318 response = s.dataFilter( response, s.dataType ); 14319 } 14320 14321 prev = current; 14322 current = dataTypes.shift(); 14323 14324 if ( current ) { 14325 14326 // There's only work to do if current dataType is non-auto 14327 if ( current === "*" ) { 14328 14329 current = prev; 14330 14331 // Convert response if prev dataType is non-auto and differs from current 14332 } else if ( prev !== "*" && prev !== current ) { 14333 14334 // Seek a direct converter 14335 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 14336 14337 // If none found, seek a pair 14338 if ( !conv ) { 14339 for ( conv2 in converters ) { 14340 14341 // If conv2 outputs current 14342 tmp = conv2.split( " " ); 14343 if ( tmp[ 1 ] === current ) { 14344 14345 // If prev can be converted to accepted input 14346 conv = converters[ prev + " " + tmp[ 0 ] ] || 14347 converters[ "* " + tmp[ 0 ] ]; 14348 if ( conv ) { 14349 14350 // Condense equivalence converters 14351 if ( conv === true ) { 14352 conv = converters[ conv2 ]; 14353 14354 // Otherwise, insert the intermediate dataType 14355 } else if ( converters[ conv2 ] !== true ) { 14356 current = tmp[ 0 ]; 14357 dataTypes.unshift( tmp[ 1 ] ); 14358 } 14359 break; 14360 } 14361 } 14362 } 14363 } 14364 14365 // Apply converter (if not an equivalence) 14366 if ( conv !== true ) { 14367 14368 // Unless errors are allowed to bubble, catch and return them 14369 if ( conv && s.throws ) { 14370 response = conv( response ); 14371 } else { 14372 try { 14373 response = conv( response ); 14374 } catch ( e ) { 14375 return { 14376 state: "parsererror", 14377 error: conv ? e : "No conversion from " + prev + " to " + current 14378 }; 14379 } 14380 } 14381 } 14382 } 14383 } 14384 } 14385 14386 return { state: "success", data: response }; 14387} 14388 14389jQuery.extend( { 14390 14391 // Counter for holding the number of active queries 14392 active: 0, 14393 14394 // Last-Modified header cache for next request 14395 lastModified: {}, 14396 etag: {}, 14397 14398 ajaxSettings: { 14399 url: location.href, 14400 type: "GET", 14401 isLocal: rlocalProtocol.test( location.protocol ), 14402 global: true, 14403 processData: true, 14404 async: true, 14405 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 14406 14407 /* 14408 timeout: 0, 14409 data: null, 14410 dataType: null, 14411 username: null, 14412 password: null, 14413 cache: null, 14414 throws: false, 14415 traditional: false, 14416 headers: {}, 14417 */ 14418 14419 accepts: { 14420 "*": allTypes, 14421 text: "text/plain", 14422 html: "text/html", 14423 xml: "application/xml, text/xml", 14424 json: "application/json, text/javascript" 14425 }, 14426 14427 contents: { 14428 xml: /\bxml\b/, 14429 html: /\bhtml/, 14430 json: /\bjson\b/ 14431 }, 14432 14433 responseFields: { 14434 xml: "responseXML", 14435 text: "responseText", 14436 json: "responseJSON" 14437 }, 14438 14439 // Data converters 14440 // Keys separate source (or catchall "*") and destination types with a single space 14441 converters: { 14442 14443 // Convert anything to text 14444 "* text": String, 14445 14446 // Text to html (true = no transformation) 14447 "text html": true, 14448 14449 // Evaluate text as a json expression 14450 "text json": JSON.parse, 14451 14452 // Parse text as xml 14453 "text xml": jQuery.parseXML 14454 }, 14455 14456 // For options that shouldn't be deep extended: 14457 // you can add your own custom options here if 14458 // and when you create one that shouldn't be 14459 // deep extended (see ajaxExtend) 14460 flatOptions: { 14461 url: true, 14462 context: true 14463 } 14464 }, 14465 14466 // Creates a full fledged settings object into target 14467 // with both ajaxSettings and settings fields. 14468 // If target is omitted, writes into ajaxSettings. 14469 ajaxSetup: function( target, settings ) { 14470 return settings ? 14471 14472 // Building a settings object 14473 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 14474 14475 // Extending ajaxSettings 14476 ajaxExtend( jQuery.ajaxSettings, target ); 14477 }, 14478 14479 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 14480 ajaxTransport: addToPrefiltersOrTransports( transports ), 14481 14482 // Main method 14483 ajax: function( url, options ) { 14484 14485 // If url is an object, simulate pre-1.5 signature 14486 if ( typeof url === "object" ) { 14487 options = url; 14488 url = undefined; 14489 } 14490 14491 // Force options to be an object 14492 options = options || {}; 14493 14494 var transport, 14495 14496 // URL without anti-cache param 14497 cacheURL, 14498 14499 // Response headers 14500 responseHeadersString, 14501 responseHeaders, 14502 14503 // timeout handle 14504 timeoutTimer, 14505 14506 // Url cleanup var 14507 urlAnchor, 14508 14509 // Request state (becomes false upon send and true upon completion) 14510 completed, 14511 14512 // To know if global events are to be dispatched 14513 fireGlobals, 14514 14515 // Loop variable 14516 i, 14517 14518 // uncached part of the url 14519 uncached, 14520 14521 // Create the final options object 14522 s = jQuery.ajaxSetup( {}, options ), 14523 14524 // Callbacks context 14525 callbackContext = s.context || s, 14526 14527 // Context for global events is callbackContext if it is a DOM node or jQuery collection 14528 globalEventContext = s.context && 14529 ( callbackContext.nodeType || callbackContext.jquery ) ? 14530 jQuery( callbackContext ) : 14531 jQuery.event, 14532 14533 // Deferreds 14534 deferred = jQuery.Deferred(), 14535 completeDeferred = jQuery.Callbacks( "once memory" ), 14536 14537 // Status-dependent callbacks 14538 statusCode = s.statusCode || {}, 14539 14540 // Headers (they are sent all at once) 14541 requestHeaders = {}, 14542 requestHeadersNames = {}, 14543 14544 // Default abort message 14545 strAbort = "canceled", 14546 14547 // Fake xhr 14548 jqXHR = { 14549 readyState: 0, 14550 14551 // Builds headers hashtable if needed 14552 getResponseHeader: function( key ) { 14553 var match; 14554 if ( completed ) { 14555 if ( !responseHeaders ) { 14556 responseHeaders = {}; 14557 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 14558 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 14559 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 14560 .concat( match[ 2 ] ); 14561 } 14562 } 14563 match = responseHeaders[ key.toLowerCase() + " " ]; 14564 } 14565 return match == null ? null : match.join( ", " ); 14566 }, 14567 14568 // Raw string 14569 getAllResponseHeaders: function() { 14570 return completed ? responseHeadersString : null; 14571 }, 14572 14573 // Caches the header 14574 setRequestHeader: function( name, value ) { 14575 if ( completed == null ) { 14576 name = requestHeadersNames[ name.toLowerCase() ] = 14577 requestHeadersNames[ name.toLowerCase() ] || name; 14578 requestHeaders[ name ] = value; 14579 } 14580 return this; 14581 }, 14582 14583 // Overrides response content-type header 14584 overrideMimeType: function( type ) { 14585 if ( completed == null ) { 14586 s.mimeType = type; 14587 } 14588 return this; 14589 }, 14590 14591 // Status-dependent callbacks 14592 statusCode: function( map ) { 14593 var code; 14594 if ( map ) { 14595 if ( completed ) { 14596 14597 // Execute the appropriate callbacks 14598 jqXHR.always( map[ jqXHR.status ] ); 14599 } else { 14600 14601 // Lazy-add the new callbacks in a way that preserves old ones 14602 for ( code in map ) { 14603 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 14604 } 14605 } 14606 } 14607 return this; 14608 }, 14609 14610 // Cancel the request 14611 abort: function( statusText ) { 14612 var finalText = statusText || strAbort; 14613 if ( transport ) { 14614 transport.abort( finalText ); 14615 } 14616 done( 0, finalText ); 14617 return this; 14618 } 14619 }; 14620 14621 // Attach deferreds 14622 deferred.promise( jqXHR ); 14623 14624 // Add protocol if not provided (prefilters might expect it) 14625 // Handle falsy url in the settings object (#10093: consistency with old signature) 14626 // We also use the url parameter if available 14627 s.url = ( ( url || s.url || location.href ) + "" ) 14628 .replace( rprotocol, location.protocol + "//" ); 14629 14630 // Alias method option to type as per ticket #12004 14631 s.type = options.method || options.type || s.method || s.type; 14632 14633 // Extract dataTypes list 14634 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 14635 14636 // A cross-domain request is in order when the origin doesn't match the current origin. 14637 if ( s.crossDomain == null ) { 14638 urlAnchor = document.createElement( "a" ); 14639 14640 // Support: IE <=8 - 11, Edge 12 - 15 14641 // IE throws exception on accessing the href property if url is malformed, 14642 // e.g. http://example.com:80x/ 14643 try { 14644 urlAnchor.href = s.url; 14645 14646 // Support: IE <=8 - 11 only 14647 // Anchor's host property isn't correctly set when s.url is relative 14648 urlAnchor.href = urlAnchor.href; 14649 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 14650 urlAnchor.protocol + "//" + urlAnchor.host; 14651 } catch ( e ) { 14652 14653 // If there is an error parsing the URL, assume it is crossDomain, 14654 // it can be rejected by the transport if it is invalid 14655 s.crossDomain = true; 14656 } 14657 } 14658 14659 // Convert data if not already a string 14660 if ( s.data && s.processData && typeof s.data !== "string" ) { 14661 s.data = jQuery.param( s.data, s.traditional ); 14662 } 14663 14664 // Apply prefilters 14665 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 14666 14667 // If request was aborted inside a prefilter, stop there 14668 if ( completed ) { 14669 return jqXHR; 14670 } 14671 14672 // We can fire global events as of now if asked to 14673 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 14674 fireGlobals = jQuery.event && s.global; 14675 14676 // Watch for a new set of requests 14677 if ( fireGlobals && jQuery.active++ === 0 ) { 14678 jQuery.event.trigger( "ajaxStart" ); 14679 } 14680 14681 // Uppercase the type 14682 s.type = s.type.toUpperCase(); 14683 14684 // Determine if request has content 14685 s.hasContent = !rnoContent.test( s.type ); 14686 14687 // Save the URL in case we're toying with the If-Modified-Since 14688 // and/or If-None-Match header later on 14689 // Remove hash to simplify url manipulation 14690 cacheURL = s.url.replace( rhash, "" ); 14691 14692 // More options handling for requests with no content 14693 if ( !s.hasContent ) { 14694 14695 // Remember the hash so we can put it back 14696 uncached = s.url.slice( cacheURL.length ); 14697 14698 // If data is available and should be processed, append data to url 14699 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 14700 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 14701 14702 // #9682: remove data so that it's not used in an eventual retry 14703 delete s.data; 14704 } 14705 14706 // Add or update anti-cache param if needed 14707 if ( s.cache === false ) { 14708 cacheURL = cacheURL.replace( rantiCache, "$1" ); 14709 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 14710 uncached; 14711 } 14712 14713 // Put hash and anti-cache on the URL that will be requested (gh-1732) 14714 s.url = cacheURL + uncached; 14715 14716 // Change '%20' to '+' if this is encoded form body content (gh-2658) 14717 } else if ( s.data && s.processData && 14718 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 14719 s.data = s.data.replace( r20, "+" ); 14720 } 14721 14722 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14723 if ( s.ifModified ) { 14724 if ( jQuery.lastModified[ cacheURL ] ) { 14725 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 14726 } 14727 if ( jQuery.etag[ cacheURL ] ) { 14728 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 14729 } 14730 } 14731 14732 // Set the correct header, if data is being sent 14733 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 14734 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 14735 } 14736 14737 // Set the Accepts header for the server, depending on the dataType 14738 jqXHR.setRequestHeader( 14739 "Accept", 14740 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 14741 s.accepts[ s.dataTypes[ 0 ] ] + 14742 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 14743 s.accepts[ "*" ] 14744 ); 14745 14746 // Check for headers option 14747 for ( i in s.headers ) { 14748 jqXHR.setRequestHeader( i, s.headers[ i ] ); 14749 } 14750 14751 // Allow custom headers/mimetypes and early abort 14752 if ( s.beforeSend && 14753 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 14754 14755 // Abort if not done already and return 14756 return jqXHR.abort(); 14757 } 14758 14759 // Aborting is no longer a cancellation 14760 strAbort = "abort"; 14761 14762 // Install callbacks on deferreds 14763 completeDeferred.add( s.complete ); 14764 jqXHR.done( s.success ); 14765 jqXHR.fail( s.error ); 14766 14767 // Get transport 14768 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 14769 14770 // If no transport, we auto-abort 14771 if ( !transport ) { 14772 done( -1, "No Transport" ); 14773 } else { 14774 jqXHR.readyState = 1; 14775 14776 // Send global event 14777 if ( fireGlobals ) { 14778 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 14779 } 14780 14781 // If request was aborted inside ajaxSend, stop there 14782 if ( completed ) { 14783 return jqXHR; 14784 } 14785 14786 // Timeout 14787 if ( s.async && s.timeout > 0 ) { 14788 timeoutTimer = window.setTimeout( function() { 14789 jqXHR.abort( "timeout" ); 14790 }, s.timeout ); 14791 } 14792 14793 try { 14794 completed = false; 14795 transport.send( requestHeaders, done ); 14796 } catch ( e ) { 14797 14798 // Rethrow post-completion exceptions 14799 if ( completed ) { 14800 throw e; 14801 } 14802 14803 // Propagate others as results 14804 done( -1, e ); 14805 } 14806 } 14807 14808 // Callback for when everything is done 14809 function done( status, nativeStatusText, responses, headers ) { 14810 var isSuccess, success, error, response, modified, 14811 statusText = nativeStatusText; 14812 14813 // Ignore repeat invocations 14814 if ( completed ) { 14815 return; 14816 } 14817 14818 completed = true; 14819 14820 // Clear timeout if it exists 14821 if ( timeoutTimer ) { 14822 window.clearTimeout( timeoutTimer ); 14823 } 14824 14825 // Dereference transport for early garbage collection 14826 // (no matter how long the jqXHR object will be used) 14827 transport = undefined; 14828 14829 // Cache response headers 14830 responseHeadersString = headers || ""; 14831 14832 // Set readyState 14833 jqXHR.readyState = status > 0 ? 4 : 0; 14834 14835 // Determine if successful 14836 isSuccess = status >= 200 && status < 300 || status === 304; 14837 14838 // Get response data 14839 if ( responses ) { 14840 response = ajaxHandleResponses( s, jqXHR, responses ); 14841 } 14842 14843 // Use a noop converter for missing script but not if jsonp 14844 if ( !isSuccess && 14845 jQuery.inArray( "script", s.dataTypes ) > -1 && 14846 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 14847 s.converters[ "text script" ] = function() {}; 14848 } 14849 14850 // Convert no matter what (that way responseXXX fields are always set) 14851 response = ajaxConvert( s, response, jqXHR, isSuccess ); 14852 14853 // If successful, handle type chaining 14854 if ( isSuccess ) { 14855 14856 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14857 if ( s.ifModified ) { 14858 modified = jqXHR.getResponseHeader( "Last-Modified" ); 14859 if ( modified ) { 14860 jQuery.lastModified[ cacheURL ] = modified; 14861 } 14862 modified = jqXHR.getResponseHeader( "etag" ); 14863 if ( modified ) { 14864 jQuery.etag[ cacheURL ] = modified; 14865 } 14866 } 14867 14868 // if no content 14869 if ( status === 204 || s.type === "HEAD" ) { 14870 statusText = "nocontent"; 14871 14872 // if not modified 14873 } else if ( status === 304 ) { 14874 statusText = "notmodified"; 14875 14876 // If we have data, let's convert it 14877 } else { 14878 statusText = response.state; 14879 success = response.data; 14880 error = response.error; 14881 isSuccess = !error; 14882 } 14883 } else { 14884 14885 // Extract error from statusText and normalize for non-aborts 14886 error = statusText; 14887 if ( status || !statusText ) { 14888 statusText = "error"; 14889 if ( status < 0 ) { 14890 status = 0; 14891 } 14892 } 14893 } 14894 14895 // Set data for the fake xhr object 14896 jqXHR.status = status; 14897 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 14898 14899 // Success/Error 14900 if ( isSuccess ) { 14901 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 14902 } else { 14903 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 14904 } 14905 14906 // Status-dependent callbacks 14907 jqXHR.statusCode( statusCode ); 14908 statusCode = undefined; 14909 14910 if ( fireGlobals ) { 14911 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 14912 [ jqXHR, s, isSuccess ? success : error ] ); 14913 } 14914 14915 // Complete 14916 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 14917 14918 if ( fireGlobals ) { 14919 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 14920 14921 // Handle the global AJAX counter 14922 if ( !( --jQuery.active ) ) { 14923 jQuery.event.trigger( "ajaxStop" ); 14924 } 14925 } 14926 } 14927 14928 return jqXHR; 14929 }, 14930 14931 getJSON: function( url, data, callback ) { 14932 return jQuery.get( url, data, callback, "json" ); 14933 }, 14934 14935 getScript: function( url, callback ) { 14936 return jQuery.get( url, undefined, callback, "script" ); 14937 } 14938} ); 14939 14940jQuery.each( [ "get", "post" ], function( _i, method ) { 14941 jQuery[ method ] = function( url, data, callback, type ) { 14942 14943 // Shift arguments if data argument was omitted 14944 if ( isFunction( data ) ) { 14945 type = type || callback; 14946 callback = data; 14947 data = undefined; 14948 } 14949 14950 // The url can be an options object (which then must have .url) 14951 return jQuery.ajax( jQuery.extend( { 14952 url: url, 14953 type: method, 14954 dataType: type, 14955 data: data, 14956 success: callback 14957 }, jQuery.isPlainObject( url ) && url ) ); 14958 }; 14959} ); 14960 14961jQuery.ajaxPrefilter( function( s ) { 14962 var i; 14963 for ( i in s.headers ) { 14964 if ( i.toLowerCase() === "content-type" ) { 14965 s.contentType = s.headers[ i ] || ""; 14966 } 14967 } 14968} ); 14969 14970 14971jQuery._evalUrl = function( url, options, doc ) { 14972 return jQuery.ajax( { 14973 url: url, 14974 14975 // Make this explicit, since user can override this through ajaxSetup (#11264) 14976 type: "GET", 14977 dataType: "script", 14978 cache: true, 14979 async: false, 14980 global: false, 14981 14982 // Only evaluate the response if it is successful (gh-4126) 14983 // dataFilter is not invoked for failure responses, so using it instead 14984 // of the default converter is kludgy but it works. 14985 converters: { 14986 "text script": function() {} 14987 }, 14988 dataFilter: function( response ) { 14989 jQuery.globalEval( response, options, doc ); 14990 } 14991 } ); 14992}; 14993 14994 14995jQuery.fn.extend( { 14996 wrapAll: function( html ) { 14997 var wrap; 14998 14999 if ( this[ 0 ] ) { 15000 if ( isFunction( html ) ) { 15001 html = html.call( this[ 0 ] ); 15002 } 15003 15004 // The elements to wrap the target around 15005 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 15006 15007 if ( this[ 0 ].parentNode ) { 15008 wrap.insertBefore( this[ 0 ] ); 15009 } 15010 15011 wrap.map( function() { 15012 var elem = this; 15013 15014 while ( elem.firstElementChild ) { 15015 elem = elem.firstElementChild; 15016 } 15017 15018 return elem; 15019 } ).append( this ); 15020 } 15021 15022 return this; 15023 }, 15024 15025 wrapInner: function( html ) { 15026 if ( isFunction( html ) ) { 15027 return this.each( function( i ) { 15028 jQuery( this ).wrapInner( html.call( this, i ) ); 15029 } ); 15030 } 15031 15032 return this.each( function() { 15033 var self = jQuery( this ), 15034 contents = self.contents(); 15035 15036 if ( contents.length ) { 15037 contents.wrapAll( html ); 15038 15039 } else { 15040 self.append( html ); 15041 } 15042 } ); 15043 }, 15044 15045 wrap: function( html ) { 15046 var htmlIsFunction = isFunction( html ); 15047 15048 return this.each( function( i ) { 15049 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 15050 } ); 15051 }, 15052 15053 unwrap: function( selector ) { 15054 this.parent( selector ).not( "body" ).each( function() { 15055 jQuery( this ).replaceWith( this.childNodes ); 15056 } ); 15057 return this; 15058 } 15059} ); 15060 15061 15062jQuery.expr.pseudos.hidden = function( elem ) { 15063 return !jQuery.expr.pseudos.visible( elem ); 15064}; 15065jQuery.expr.pseudos.visible = function( elem ) { 15066 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 15067}; 15068 15069 15070 15071 15072jQuery.ajaxSettings.xhr = function() { 15073 try { 15074 return new window.XMLHttpRequest(); 15075 } catch ( e ) {} 15076}; 15077 15078var xhrSuccessStatus = { 15079 15080 // File protocol always yields status code 0, assume 200 15081 0: 200, 15082 15083 // Support: IE <=9 only 15084 // #1450: sometimes IE returns 1223 when it should be 204 15085 1223: 204 15086 }, 15087 xhrSupported = jQuery.ajaxSettings.xhr(); 15088 15089support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 15090support.ajax = xhrSupported = !!xhrSupported; 15091 15092jQuery.ajaxTransport( function( options ) { 15093 var callback, errorCallback; 15094 15095 // Cross domain only allowed if supported through XMLHttpRequest 15096 if ( support.cors || xhrSupported && !options.crossDomain ) { 15097 return { 15098 send: function( headers, complete ) { 15099 var i, 15100 xhr = options.xhr(); 15101 15102 xhr.open( 15103 options.type, 15104 options.url, 15105 options.async, 15106 options.username, 15107 options.password 15108 ); 15109 15110 // Apply custom fields if provided 15111 if ( options.xhrFields ) { 15112 for ( i in options.xhrFields ) { 15113 xhr[ i ] = options.xhrFields[ i ]; 15114 } 15115 } 15116 15117 // Override mime type if needed 15118 if ( options.mimeType && xhr.overrideMimeType ) { 15119 xhr.overrideMimeType( options.mimeType ); 15120 } 15121 15122 // X-Requested-With header 15123 // For cross-domain requests, seeing as conditions for a preflight are 15124 // akin to a jigsaw puzzle, we simply never set it to be sure. 15125 // (it can always be set on a per-request basis or even using ajaxSetup) 15126 // For same-domain requests, won't change header if already provided. 15127 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 15128 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 15129 } 15130 15131 // Set headers 15132 for ( i in headers ) { 15133 xhr.setRequestHeader( i, headers[ i ] ); 15134 } 15135 15136 // Callback 15137 callback = function( type ) { 15138 return function() { 15139 if ( callback ) { 15140 callback = errorCallback = xhr.onload = 15141 xhr.onerror = xhr.onabort = xhr.ontimeout = 15142 xhr.onreadystatechange = null; 15143 15144 if ( type === "abort" ) { 15145 xhr.abort(); 15146 } else if ( type === "error" ) { 15147 15148 // Support: IE <=9 only 15149 // On a manual native abort, IE9 throws 15150 // errors on any property access that is not readyState 15151 if ( typeof xhr.status !== "number" ) { 15152 complete( 0, "error" ); 15153 } else { 15154 complete( 15155 15156 // File: protocol always yields status 0; see #8605, #14207 15157 xhr.status, 15158 xhr.statusText 15159 ); 15160 } 15161 } else { 15162 complete( 15163 xhrSuccessStatus[ xhr.status ] || xhr.status, 15164 xhr.statusText, 15165 15166 // Support: IE <=9 only 15167 // IE9 has no XHR2 but throws on binary (trac-11426) 15168 // For XHR2 non-text, let the caller handle it (gh-2498) 15169 ( xhr.responseType || "text" ) !== "text" || 15170 typeof xhr.responseText !== "string" ? 15171 { binary: xhr.response } : 15172 { text: xhr.responseText }, 15173 xhr.getAllResponseHeaders() 15174 ); 15175 } 15176 } 15177 }; 15178 }; 15179 15180 // Listen to events 15181 xhr.onload = callback(); 15182 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 15183 15184 // Support: IE 9 only 15185 // Use onreadystatechange to replace onabort 15186 // to handle uncaught aborts 15187 if ( xhr.onabort !== undefined ) { 15188 xhr.onabort = errorCallback; 15189 } else { 15190 xhr.onreadystatechange = function() { 15191 15192 // Check readyState before timeout as it changes 15193 if ( xhr.readyState === 4 ) { 15194 15195 // Allow onerror to be called first, 15196 // but that will not handle a native abort 15197 // Also, save errorCallback to a variable 15198 // as xhr.onerror cannot be accessed 15199 window.setTimeout( function() { 15200 if ( callback ) { 15201 errorCallback(); 15202 } 15203 } ); 15204 } 15205 }; 15206 } 15207 15208 // Create the abort callback 15209 callback = callback( "abort" ); 15210 15211 try { 15212 15213 // Do send the request (this may raise an exception) 15214 xhr.send( options.hasContent && options.data || null ); 15215 } catch ( e ) { 15216 15217 // #14683: Only rethrow if this hasn't been notified as an error yet 15218 if ( callback ) { 15219 throw e; 15220 } 15221 } 15222 }, 15223 15224 abort: function() { 15225 if ( callback ) { 15226 callback(); 15227 } 15228 } 15229 }; 15230 } 15231} ); 15232 15233 15234 15235 15236// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 15237jQuery.ajaxPrefilter( function( s ) { 15238 if ( s.crossDomain ) { 15239 s.contents.script = false; 15240 } 15241} ); 15242 15243// Install script dataType 15244jQuery.ajaxSetup( { 15245 accepts: { 15246 script: "text/javascript, application/javascript, " + 15247 "application/ecmascript, application/x-ecmascript" 15248 }, 15249 contents: { 15250 script: /\b(?:java|ecma)script\b/ 15251 }, 15252 converters: { 15253 "text script": function( text ) { 15254 jQuery.globalEval( text ); 15255 return text; 15256 } 15257 } 15258} ); 15259 15260// Handle cache's special case and crossDomain 15261jQuery.ajaxPrefilter( "script", function( s ) { 15262 if ( s.cache === undefined ) { 15263 s.cache = false; 15264 } 15265 if ( s.crossDomain ) { 15266 s.type = "GET"; 15267 } 15268} ); 15269 15270// Bind script tag hack transport 15271jQuery.ajaxTransport( "script", function( s ) { 15272 15273 // This transport only deals with cross domain or forced-by-attrs requests 15274 if ( s.crossDomain || s.scriptAttrs ) { 15275 var script, callback; 15276 return { 15277 send: function( _, complete ) { 15278 script = jQuery( "<script>" ) 15279 .attr( s.scriptAttrs || {} ) 15280 .prop( { charset: s.scriptCharset, src: s.url } ) 15281 .on( "load error", callback = function( evt ) { 15282 script.remove(); 15283 callback = null; 15284 if ( evt ) { 15285 complete( evt.type === "error" ? 404 : 200, evt.type ); 15286 } 15287 } ); 15288 15289 // Use native DOM manipulation to avoid our domManip AJAX trickery 15290 document.head.appendChild( script[ 0 ] ); 15291 }, 15292 abort: function() { 15293 if ( callback ) { 15294 callback(); 15295 } 15296 } 15297 }; 15298 } 15299} ); 15300 15301 15302 15303 15304var oldCallbacks = [], 15305 rjsonp = /(=)\?(?=&|$)|\?\?/; 15306 15307// Default jsonp settings 15308jQuery.ajaxSetup( { 15309 jsonp: "callback", 15310 jsonpCallback: function() { 15311 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 15312 this[ callback ] = true; 15313 return callback; 15314 } 15315} ); 15316 15317// Detect, normalize options and install callbacks for jsonp requests 15318jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 15319 15320 var callbackName, overwritten, responseContainer, 15321 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 15322 "url" : 15323 typeof s.data === "string" && 15324 ( s.contentType || "" ) 15325 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 15326 rjsonp.test( s.data ) && "data" 15327 ); 15328 15329 // Handle iff the expected data type is "jsonp" or we have a parameter to set 15330 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 15331 15332 // Get callback name, remembering preexisting value associated with it 15333 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 15334 s.jsonpCallback() : 15335 s.jsonpCallback; 15336 15337 // Insert callback into url or form data 15338 if ( jsonProp ) { 15339 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 15340 } else if ( s.jsonp !== false ) { 15341 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 15342 } 15343 15344 // Use data converter to retrieve json after script execution 15345 s.converters[ "script json" ] = function() { 15346 if ( !responseContainer ) { 15347 jQuery.error( callbackName + " was not called" ); 15348 } 15349 return responseContainer[ 0 ]; 15350 }; 15351 15352 // Force json dataType 15353 s.dataTypes[ 0 ] = "json"; 15354 15355 // Install callback 15356 overwritten = window[ callbackName ]; 15357 window[ callbackName ] = function() { 15358 responseContainer = arguments; 15359 }; 15360 15361 // Clean-up function (fires after converters) 15362 jqXHR.always( function() { 15363 15364 // If previous value didn't exist - remove it 15365 if ( overwritten === undefined ) { 15366 jQuery( window ).removeProp( callbackName ); 15367 15368 // Otherwise restore preexisting value 15369 } else { 15370 window[ callbackName ] = overwritten; 15371 } 15372 15373 // Save back as free 15374 if ( s[ callbackName ] ) { 15375 15376 // Make sure that re-using the options doesn't screw things around 15377 s.jsonpCallback = originalSettings.jsonpCallback; 15378 15379 // Save the callback name for future use 15380 oldCallbacks.push( callbackName ); 15381 } 15382 15383 // Call if it was a function and we have a response 15384 if ( responseContainer && isFunction( overwritten ) ) { 15385 overwritten( responseContainer[ 0 ] ); 15386 } 15387 15388 responseContainer = overwritten = undefined; 15389 } ); 15390 15391 // Delegate to script 15392 return "script"; 15393 } 15394} ); 15395 15396 15397 15398 15399// Support: Safari 8 only 15400// In Safari 8 documents created via document.implementation.createHTMLDocument 15401// collapse sibling forms: the second one becomes a child of the first one. 15402// Because of that, this security measure has to be disabled in Safari 8. 15403// https://bugs.webkit.org/show_bug.cgi?id=137337 15404support.createHTMLDocument = ( function() { 15405 var body = document.implementation.createHTMLDocument( "" ).body; 15406 body.innerHTML = "<form></form><form></form>"; 15407 return body.childNodes.length === 2; 15408} )(); 15409 15410 15411// Argument "data" should be string of html 15412// context (optional): If specified, the fragment will be created in this context, 15413// defaults to document 15414// keepScripts (optional): If true, will include scripts passed in the html string 15415jQuery.parseHTML = function( data, context, keepScripts ) { 15416 if ( typeof data !== "string" ) { 15417 return []; 15418 } 15419 if ( typeof context === "boolean" ) { 15420 keepScripts = context; 15421 context = false; 15422 } 15423 15424 var base, parsed, scripts; 15425 15426 if ( !context ) { 15427 15428 // Stop scripts or inline event handlers from being executed immediately 15429 // by using document.implementation 15430 if ( support.createHTMLDocument ) { 15431 context = document.implementation.createHTMLDocument( "" ); 15432 15433 // Set the base href for the created document 15434 // so any parsed elements with URLs 15435 // are based on the document's URL (gh-2965) 15436 base = context.createElement( "base" ); 15437 base.href = document.location.href; 15438 context.head.appendChild( base ); 15439 } else { 15440 context = document; 15441 } 15442 } 15443 15444 parsed = rsingleTag.exec( data ); 15445 scripts = !keepScripts && []; 15446 15447 // Single tag 15448 if ( parsed ) { 15449 return [ context.createElement( parsed[ 1 ] ) ]; 15450 } 15451 15452 parsed = buildFragment( [ data ], context, scripts ); 15453 15454 if ( scripts && scripts.length ) { 15455 jQuery( scripts ).remove(); 15456 } 15457 15458 return jQuery.merge( [], parsed.childNodes ); 15459}; 15460 15461 15462/** 15463 * Load a url into a page 15464 */ 15465jQuery.fn.load = function( url, params, callback ) { 15466 var selector, type, response, 15467 self = this, 15468 off = url.indexOf( " " ); 15469 15470 if ( off > -1 ) { 15471 selector = stripAndCollapse( url.slice( off ) ); 15472 url = url.slice( 0, off ); 15473 } 15474 15475 // If it's a function 15476 if ( isFunction( params ) ) { 15477 15478 // We assume that it's the callback 15479 callback = params; 15480 params = undefined; 15481 15482 // Otherwise, build a param string 15483 } else if ( params && typeof params === "object" ) { 15484 type = "POST"; 15485 } 15486 15487 // If we have elements to modify, make the request 15488 if ( self.length > 0 ) { 15489 jQuery.ajax( { 15490 url: url, 15491 15492 // If "type" variable is undefined, then "GET" method will be used. 15493 // Make value of this field explicit since 15494 // user can override it through ajaxSetup method 15495 type: type || "GET", 15496 dataType: "html", 15497 data: params 15498 } ).done( function( responseText ) { 15499 15500 // Save response for use in complete callback 15501 response = arguments; 15502 15503 self.html( selector ? 15504 15505 // If a selector was specified, locate the right elements in a dummy div 15506 // Exclude scripts to avoid IE 'Permission Denied' errors 15507 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 15508 15509 // Otherwise use the full result 15510 responseText ); 15511 15512 // If the request succeeds, this function gets "data", "status", "jqXHR" 15513 // but they are ignored because response was set above. 15514 // If it fails, this function gets "jqXHR", "status", "error" 15515 } ).always( callback && function( jqXHR, status ) { 15516 self.each( function() { 15517 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 15518 } ); 15519 } ); 15520 } 15521 15522 return this; 15523}; 15524 15525 15526 15527 15528jQuery.expr.pseudos.animated = function( elem ) { 15529 return jQuery.grep( jQuery.timers, function( fn ) { 15530 return elem === fn.elem; 15531 } ).length; 15532}; 15533 15534 15535 15536 15537jQuery.offset = { 15538 setOffset: function( elem, options, i ) { 15539 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 15540 position = jQuery.css( elem, "position" ), 15541 curElem = jQuery( elem ), 15542 props = {}; 15543 15544 // Set position first, in-case top/left are set even on static elem 15545 if ( position === "static" ) { 15546 elem.style.position = "relative"; 15547 } 15548 15549 curOffset = curElem.offset(); 15550 curCSSTop = jQuery.css( elem, "top" ); 15551 curCSSLeft = jQuery.css( elem, "left" ); 15552 calculatePosition = ( position === "absolute" || position === "fixed" ) && 15553 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 15554 15555 // Need to be able to calculate position if either 15556 // top or left is auto and position is either absolute or fixed 15557 if ( calculatePosition ) { 15558 curPosition = curElem.position(); 15559 curTop = curPosition.top; 15560 curLeft = curPosition.left; 15561 15562 } else { 15563 curTop = parseFloat( curCSSTop ) || 0; 15564 curLeft = parseFloat( curCSSLeft ) || 0; 15565 } 15566 15567 if ( isFunction( options ) ) { 15568 15569 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 15570 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 15571 } 15572 15573 if ( options.top != null ) { 15574 props.top = ( options.top - curOffset.top ) + curTop; 15575 } 15576 if ( options.left != null ) { 15577 props.left = ( options.left - curOffset.left ) + curLeft; 15578 } 15579 15580 if ( "using" in options ) { 15581 options.using.call( elem, props ); 15582 15583 } else { 15584 curElem.css( props ); 15585 } 15586 } 15587}; 15588 15589jQuery.fn.extend( { 15590 15591 // offset() relates an element's border box to the document origin 15592 offset: function( options ) { 15593 15594 // Preserve chaining for setter 15595 if ( arguments.length ) { 15596 return options === undefined ? 15597 this : 15598 this.each( function( i ) { 15599 jQuery.offset.setOffset( this, options, i ); 15600 } ); 15601 } 15602 15603 var rect, win, 15604 elem = this[ 0 ]; 15605 15606 if ( !elem ) { 15607 return; 15608 } 15609 15610 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 15611 // Support: IE <=11 only 15612 // Running getBoundingClientRect on a 15613 // disconnected node in IE throws an error 15614 if ( !elem.getClientRects().length ) { 15615 return { top: 0, left: 0 }; 15616 } 15617 15618 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 15619 rect = elem.getBoundingClientRect(); 15620 win = elem.ownerDocument.defaultView; 15621 return { 15622 top: rect.top + win.pageYOffset, 15623 left: rect.left + win.pageXOffset 15624 }; 15625 }, 15626 15627 // position() relates an element's margin box to its offset parent's padding box 15628 // This corresponds to the behavior of CSS absolute positioning 15629 position: function() { 15630 if ( !this[ 0 ] ) { 15631 return; 15632 } 15633 15634 var offsetParent, offset, doc, 15635 elem = this[ 0 ], 15636 parentOffset = { top: 0, left: 0 }; 15637 15638 // position:fixed elements are offset from the viewport, which itself always has zero offset 15639 if ( jQuery.css( elem, "position" ) === "fixed" ) { 15640 15641 // Assume position:fixed implies availability of getBoundingClientRect 15642 offset = elem.getBoundingClientRect(); 15643 15644 } else { 15645 offset = this.offset(); 15646 15647 // Account for the *real* offset parent, which can be the document or its root element 15648 // when a statically positioned element is identified 15649 doc = elem.ownerDocument; 15650 offsetParent = elem.offsetParent || doc.documentElement; 15651 while ( offsetParent && 15652 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 15653 jQuery.css( offsetParent, "position" ) === "static" ) { 15654 15655 offsetParent = offsetParent.parentNode; 15656 } 15657 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 15658 15659 // Incorporate borders into its offset, since they are outside its content origin 15660 parentOffset = jQuery( offsetParent ).offset(); 15661 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 15662 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 15663 } 15664 } 15665 15666 // Subtract parent offsets and element margins 15667 return { 15668 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 15669 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 15670 }; 15671 }, 15672 15673 // This method will return documentElement in the following cases: 15674 // 1) For the element inside the iframe without offsetParent, this method will return 15675 // documentElement of the parent window 15676 // 2) For the hidden or detached element 15677 // 3) For body or html element, i.e. in case of the html node - it will return itself 15678 // 15679 // but those exceptions were never presented as a real life use-cases 15680 // and might be considered as more preferable results. 15681 // 15682 // This logic, however, is not guaranteed and can change at any point in the future 15683 offsetParent: function() { 15684 return this.map( function() { 15685 var offsetParent = this.offsetParent; 15686 15687 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 15688 offsetParent = offsetParent.offsetParent; 15689 } 15690 15691 return offsetParent || documentElement; 15692 } ); 15693 } 15694} ); 15695 15696// Create scrollLeft and scrollTop methods 15697jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 15698 var top = "pageYOffset" === prop; 15699 15700 jQuery.fn[ method ] = function( val ) { 15701 return access( this, function( elem, method, val ) { 15702 15703 // Coalesce documents and windows 15704 var win; 15705 if ( isWindow( elem ) ) { 15706 win = elem; 15707 } else if ( elem.nodeType === 9 ) { 15708 win = elem.defaultView; 15709 } 15710 15711 if ( val === undefined ) { 15712 return win ? win[ prop ] : elem[ method ]; 15713 } 15714 15715 if ( win ) { 15716 win.scrollTo( 15717 !top ? val : win.pageXOffset, 15718 top ? val : win.pageYOffset 15719 ); 15720 15721 } else { 15722 elem[ method ] = val; 15723 } 15724 }, method, val, arguments.length ); 15725 }; 15726} ); 15727 15728// Support: Safari <=7 - 9.1, Chrome <=37 - 49 15729// Add the top/left cssHooks using jQuery.fn.position 15730// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 15731// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 15732// getComputedStyle returns percent when specified for top/left/bottom/right; 15733// rather than make the css module depend on the offset module, just check for it here 15734jQuery.each( [ "top", "left" ], function( _i, prop ) { 15735 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 15736 function( elem, computed ) { 15737 if ( computed ) { 15738 computed = curCSS( elem, prop ); 15739 15740 // If curCSS returns percentage, fallback to offset 15741 return rnumnonpx.test( computed ) ? 15742 jQuery( elem ).position()[ prop ] + "px" : 15743 computed; 15744 } 15745 } 15746 ); 15747} ); 15748 15749 15750// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 15751jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 15752 jQuery.each( { 15753 padding: "inner" + name, 15754 content: type, 15755 "": "outer" + name 15756 }, function( defaultExtra, funcName ) { 15757 15758 // Margin is only for outerHeight, outerWidth 15759 jQuery.fn[ funcName ] = function( margin, value ) { 15760 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 15761 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 15762 15763 return access( this, function( elem, type, value ) { 15764 var doc; 15765 15766 if ( isWindow( elem ) ) { 15767 15768 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 15769 return funcName.indexOf( "outer" ) === 0 ? 15770 elem[ "inner" + name ] : 15771 elem.document.documentElement[ "client" + name ]; 15772 } 15773 15774 // Get document width or height 15775 if ( elem.nodeType === 9 ) { 15776 doc = elem.documentElement; 15777 15778 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 15779 // whichever is greatest 15780 return Math.max( 15781 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 15782 elem.body[ "offset" + name ], doc[ "offset" + name ], 15783 doc[ "client" + name ] 15784 ); 15785 } 15786 15787 return value === undefined ? 15788 15789 // Get width or height on the element, requesting but not forcing parseFloat 15790 jQuery.css( elem, type, extra ) : 15791 15792 // Set width or height on the element 15793 jQuery.style( elem, type, value, extra ); 15794 }, type, chainable ? margin : undefined, chainable ); 15795 }; 15796 } ); 15797} ); 15798 15799 15800jQuery.each( [ 15801 "ajaxStart", 15802 "ajaxStop", 15803 "ajaxComplete", 15804 "ajaxError", 15805 "ajaxSuccess", 15806 "ajaxSend" 15807], function( _i, type ) { 15808 jQuery.fn[ type ] = function( fn ) { 15809 return this.on( type, fn ); 15810 }; 15811} ); 15812 15813 15814 15815 15816jQuery.fn.extend( { 15817 15818 bind: function( types, data, fn ) { 15819 return this.on( types, null, data, fn ); 15820 }, 15821 unbind: function( types, fn ) { 15822 return this.off( types, null, fn ); 15823 }, 15824 15825 delegate: function( selector, types, data, fn ) { 15826 return this.on( types, selector, data, fn ); 15827 }, 15828 undelegate: function( selector, types, fn ) { 15829 15830 // ( namespace ) or ( selector, types [, fn] ) 15831 return arguments.length === 1 ? 15832 this.off( selector, "**" ) : 15833 this.off( types, selector || "**", fn ); 15834 }, 15835 15836 hover: function( fnOver, fnOut ) { 15837 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 15838 } 15839} ); 15840 15841jQuery.each( 15842 ( "blur focus focusin focusout resize scroll click dblclick " + 15843 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 15844 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 15845 function( _i, name ) { 15846 15847 // Handle event binding 15848 jQuery.fn[ name ] = function( data, fn ) { 15849 return arguments.length > 0 ? 15850 this.on( name, null, data, fn ) : 15851 this.trigger( name ); 15852 }; 15853 } 15854); 15855 15856 15857 15858 15859// Support: Android <=4.0 only 15860// Make sure we trim BOM and NBSP 15861var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 15862 15863// Bind a function to a context, optionally partially applying any 15864// arguments. 15865// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 15866// However, it is not slated for removal any time soon 15867jQuery.proxy = function( fn, context ) { 15868 var tmp, args, proxy; 15869 15870 if ( typeof context === "string" ) { 15871 tmp = fn[ context ]; 15872 context = fn; 15873 fn = tmp; 15874 } 15875 15876 // Quick check to determine if target is callable, in the spec 15877 // this throws a TypeError, but we will just return undefined. 15878 if ( !isFunction( fn ) ) { 15879 return undefined; 15880 } 15881 15882 // Simulated bind 15883 args = slice.call( arguments, 2 ); 15884 proxy = function() { 15885 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 15886 }; 15887 15888 // Set the guid of unique handler to the same of original handler, so it can be removed 15889 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 15890 15891 return proxy; 15892}; 15893 15894jQuery.holdReady = function( hold ) { 15895 if ( hold ) { 15896 jQuery.readyWait++; 15897 } else { 15898 jQuery.ready( true ); 15899 } 15900}; 15901jQuery.isArray = Array.isArray; 15902jQuery.parseJSON = JSON.parse; 15903jQuery.nodeName = nodeName; 15904jQuery.isFunction = isFunction; 15905jQuery.isWindow = isWindow; 15906jQuery.camelCase = camelCase; 15907jQuery.type = toType; 15908 15909jQuery.now = Date.now; 15910 15911jQuery.isNumeric = function( obj ) { 15912 15913 // As of jQuery 3.0, isNumeric is limited to 15914 // strings and numbers (primitives or objects) 15915 // that can be coerced to finite numbers (gh-2662) 15916 var type = jQuery.type( obj ); 15917 return ( type === "number" || type === "string" ) && 15918 15919 // parseFloat NaNs numeric-cast false positives ("") 15920 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 15921 // subtraction forces infinities to NaN 15922 !isNaN( obj - parseFloat( obj ) ); 15923}; 15924 15925jQuery.trim = function( text ) { 15926 return text == null ? 15927 "" : 15928 ( text + "" ).replace( rtrim, "" ); 15929}; 15930 15931 15932 15933// Register as a named AMD module, since jQuery can be concatenated with other 15934// files that may use define, but not via a proper concatenation script that 15935// understands anonymous AMD modules. A named AMD is safest and most robust 15936// way to register. Lowercase jquery is used because AMD module names are 15937// derived from file names, and jQuery is normally delivered in a lowercase 15938// file name. Do this after creating the global so that if an AMD module wants 15939// to call noConflict to hide this version of jQuery, it will work. 15940 15941// Note that for maximum portability, libraries that are not jQuery should 15942// declare themselves as anonymous modules, and avoid setting a global if an 15943// AMD loader is present. jQuery is a special case. For more information, see 15944// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 15945 15946if ( true ) { 15947 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 15948 return jQuery; 15949 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 15950 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15951} 15952 15953 15954 15955 15956var 15957 15958 // Map over jQuery in case of overwrite 15959 _jQuery = window.jQuery, 15960 15961 // Map over the $ in case of overwrite 15962 _$ = window.$; 15963 15964jQuery.noConflict = function( deep ) { 15965 if ( window.$ === jQuery ) { 15966 window.$ = _$; 15967 } 15968 15969 if ( deep && window.jQuery === jQuery ) { 15970 window.jQuery = _jQuery; 15971 } 15972 15973 return jQuery; 15974}; 15975 15976// Expose jQuery and $ identifiers, even in AMD 15977// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 15978// and CommonJS for browser emulators (#13566) 15979if ( typeof noGlobal === "undefined" ) { 15980 window.jQuery = window.$ = jQuery; 15981} 15982 15983 15984 15985 15986return jQuery; 15987} ); 15988 15989 15990/***/ }), 15991
vendor: 544,380 bytes, lines 15992-33203
15992/***/ "./node_modules/lodash/lodash.js": 15993/*!***************************************!*\ 15994 !*** ./node_modules/lodash/lodash.js ***! 15995 \***************************************/ 15996/***/ (function(module, exports, __webpack_require__) { 15997 15998/* module decorator */ module = __webpack_require__.nmd(module); 15999var __WEBPACK_AMD_DEFINE_RESULT__;/** 16000 * @license 16001 * Lodash <https://lodash.com/> 16002 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 16003 * Released under MIT license <https://lodash.com/license> 16004 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 16005 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 16006 */ 16007;(function() { 16008 16009 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 16010 var undefined; 16011 16012 /** Used as the semantic version number. */ 16013 var VERSION = '4.17.21'; 16014 16015 /** Used as the size to enable large array optimizations. */ 16016 var LARGE_ARRAY_SIZE = 200; 16017 16018 /** Error message constants. */ 16019 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', 16020 FUNC_ERROR_TEXT = 'Expected a function', 16021 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; 16022 16023 /** Used to stand-in for `undefined` hash values. */ 16024 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 16025 16026 /** Used as the maximum memoize cache size. */ 16027 var MAX_MEMOIZE_SIZE = 500; 16028 16029 /** Used as the internal argument placeholder. */ 16030 var PLACEHOLDER = '__lodash_placeholder__'; 16031 16032 /** Used to compose bitmasks for cloning. */ 16033 var CLONE_DEEP_FLAG = 1, 16034 CLONE_FLAT_FLAG = 2, 16035 CLONE_SYMBOLS_FLAG = 4; 16036 16037 /** Used to compose bitmasks for value comparisons. */ 16038 var COMPARE_PARTIAL_FLAG = 1, 16039 COMPARE_UNORDERED_FLAG = 2; 16040 16041 /** Used to compose bitmasks for function metadata. */ 16042 var WRAP_BIND_FLAG = 1, 16043 WRAP_BIND_KEY_FLAG = 2, 16044 WRAP_CURRY_BOUND_FLAG = 4, 16045 WRAP_CURRY_FLAG = 8, 16046 WRAP_CURRY_RIGHT_FLAG = 16, 16047 WRAP_PARTIAL_FLAG = 32, 16048 WRAP_PARTIAL_RIGHT_FLAG = 64, 16049 WRAP_ARY_FLAG = 128, 16050 WRAP_REARG_FLAG = 256, 16051 WRAP_FLIP_FLAG = 512; 16052 16053 /** Used as default options for `_.truncate`. */ 16054 var DEFAULT_TRUNC_LENGTH = 30, 16055 DEFAULT_TRUNC_OMISSION = '...'; 16056 16057 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 16058 var HOT_COUNT = 800, 16059 HOT_SPAN = 16; 16060 16061 /** Used to indicate the type of lazy iteratees. */ 16062 var LAZY_FILTER_FLAG = 1, 16063 LAZY_MAP_FLAG = 2, 16064 LAZY_WHILE_FLAG = 3; 16065 16066 /** Used as references for various `Number` constants. */ 16067 var INFINITY = 1 / 0, 16068 MAX_SAFE_INTEGER = 9007199254740991, 16069 MAX_INTEGER = 1.7976931348623157e+308, 16070 NAN = 0 / 0; 16071 16072 /** Used as references for the maximum length and index of an array. */ 16073 var MAX_ARRAY_LENGTH = 4294967295, 16074 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 16075 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 16076 16077 /** Used to associate wrap methods with their bit flags. */ 16078 var wrapFlags = [ 16079 ['ary', WRAP_ARY_FLAG], 16080 ['bind', WRAP_BIND_FLAG], 16081 ['bindKey', WRAP_BIND_KEY_FLAG], 16082 ['curry', WRAP_CURRY_FLAG], 16083 ['curryRight', WRAP_CURRY_RIGHT_FLAG], 16084 ['flip', WRAP_FLIP_FLAG], 16085 ['partial', WRAP_PARTIAL_FLAG], 16086 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], 16087 ['rearg', WRAP_REARG_FLAG] 16088 ]; 16089 16090 /** `Object#toString` result references. */ 16091 var argsTag = '[object Arguments]', 16092 arrayTag = '[object Array]', 16093 asyncTag = '[object AsyncFunction]', 16094 boolTag = '[object Boolean]', 16095 dateTag = '[object Date]', 16096 domExcTag = '[object DOMException]', 16097 errorTag = '[object Error]', 16098 funcTag = '[object Function]', 16099 genTag = '[object GeneratorFunction]', 16100 mapTag = '[object Map]', 16101 numberTag = '[object Number]', 16102 nullTag = '[object Null]', 16103 objectTag = '[object Object]', 16104 promiseTag = '[object Promise]', 16105 proxyTag = '[object Proxy]', 16106 regexpTag = '[object RegExp]', 16107 setTag = '[object Set]', 16108 stringTag = '[object String]', 16109 symbolTag = '[object Symbol]', 16110 undefinedTag = '[object Undefined]', 16111 weakMapTag = '[object WeakMap]', 16112 weakSetTag = '[object WeakSet]'; 16113 16114 var arrayBufferTag = '[object ArrayBuffer]', 16115 dataViewTag = '[object DataView]', 16116 float32Tag = '[object Float32Array]', 16117 float64Tag = '[object Float64Array]', 16118 int8Tag = '[object Int8Array]', 16119 int16Tag = '[object Int16Array]', 16120 int32Tag = '[object Int32Array]', 16121 uint8Tag = '[object Uint8Array]', 16122 uint8ClampedTag = '[object Uint8ClampedArray]', 16123 uint16Tag = '[object Uint16Array]', 16124 uint32Tag = '[object Uint32Array]'; 16125 16126 /** Used to match empty string literals in compiled template source. */ 16127 var reEmptyStringLeading = /\b__p \+= '';/g, 16128 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 16129 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 16130 16131 /** Used to match HTML entities and HTML characters. */ 16132 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, 16133 reUnescapedHtml = /[&<>"']/g, 16134 reHasEscapedHtml = RegExp(reEscapedHtml.source), 16135 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 16136 16137 /** Used to match template delimiters. */ 16138 var reEscape = /<%-([\s\S]+?)%>/g, 16139 reEvaluate = /<%([\s\S]+?)%>/g, 16140 reInterpolate = /<%=([\s\S]+?)%>/g; 16141 16142 /** Used to match property names within property paths. */ 16143 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 16144 reIsPlainProp = /^\w*$/, 16145 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 16146 16147 /** 16148 * Used to match `RegExp` 16149 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 16150 */ 16151 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 16152 reHasRegExpChar = RegExp(reRegExpChar.source); 16153 16154 /** Used to match leading whitespace. */ 16155 var reTrimStart = /^\s+/; 16156 16157 /** Used to match a single whitespace character. */ 16158 var reWhitespace = /\s/; 16159 16160 /** Used to match wrap detail comments. */ 16161 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, 16162 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 16163 reSplitDetails = /,? & /; 16164 16165 /** Used to match words composed of alphanumeric characters. */ 16166 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 16167 16168 /** 16169 * Used to validate the `validate` option in `_.template` variable. 16170 * 16171 * Forbids characters which could potentially change the meaning of the function argument definition: 16172 * - "()," (modification of function parameters) 16173 * - "=" (default value) 16174 * - "[]{}" (destructuring of function parameters) 16175 * - "/" (beginning of a comment) 16176 * - whitespace 16177 */ 16178 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 16179 16180 /** Used to match backslashes in property paths. */ 16181 var reEscapeChar = /\\(\\)?/g; 16182 16183 /** 16184 * Used to match 16185 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 16186 */ 16187 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 16188 16189 /** Used to match `RegExp` flags from their coerced string values. */ 16190 var reFlags = /\w*$/; 16191 16192 /** Used to detect bad signed hexadecimal string values. */ 16193 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 16194 16195 /** Used to detect binary string values. */ 16196 var reIsBinary = /^0b[01]+$/i; 16197 16198 /** Used to detect host constructors (Safari). */ 16199 var reIsHostCtor = /^\[object .+?Constructor\]$/; 16200 16201 /** Used to detect octal string values. */ 16202 var reIsOctal = /^0o[0-7]+$/i; 16203 16204 /** Used to detect unsigned integer values. */ 16205 var reIsUint = /^(?:0|[1-9]\d*)$/; 16206 16207 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 16208 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 16209 16210 /** Used to ensure capturing order of template delimiters. */ 16211 var reNoMatch = /($^)/; 16212 16213 /** Used to match unescaped characters in compiled string literals. */ 16214 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 16215 16216 /** Used to compose unicode character classes. */ 16217 var rsAstralRange = '\\ud800-\\udfff', 16218 rsComboMarksRange = '\\u0300-\\u036f', 16219 reComboHalfMarksRange = '\\ufe20-\\ufe2f', 16220 rsComboSymbolsRange = '\\u20d0-\\u20ff', 16221 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 16222 rsDingbatRange = '\\u2700-\\u27bf', 16223 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 16224 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 16225 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 16226 rsPunctuationRange = '\\u2000-\\u206f', 16227 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', 16228 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 16229 rsVarRange = '\\ufe0e\\ufe0f', 16230 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 16231 16232 /** Used to compose unicode capture groups. */ 16233 var rsApos = "['\u2019]", 16234 rsAstral = '[' + rsAstralRange + ']', 16235 rsBreak = '[' + rsBreakRange + ']', 16236 rsCombo = '[' + rsComboRange + ']', 16237 rsDigits = '\\d+', 16238 rsDingbat = '[' + rsDingbatRange + ']', 16239 rsLower = '[' + rsLowerRange + ']', 16240 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 16241 rsFitz = '\\ud83c[\\udffb-\\udfff]', 16242 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 16243 rsNonAstral = '[^' + rsAstralRange + ']', 16244 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', 16245 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', 16246 rsUpper = '[' + rsUpperRange + ']', 16247 rsZWJ = '\\u200d'; 16248 16249 /** Used to compose unicode regexes. */ 16250 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 16251 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 16252 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', 16253 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', 16254 reOptMod = rsModifier + '?', 16255 rsOptVar = '[' + rsVarRange + ']?', 16256 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 16257 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 16258 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 16259 rsSeq = rsOptVar + reOptMod + rsOptJoin, 16260 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, 16261 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; 16262 16263 /** Used to match apostrophes. */ 16264 var reApos = RegExp(rsApos, 'g'); 16265 16266 /** 16267 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 16268 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 16269 */ 16270 var reComboMark = RegExp(rsCombo, 'g'); 16271 16272 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ 16273 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); 16274 16275 /** Used to match complex or compound words. */ 16276 var reUnicodeWord = RegExp([ 16277 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', 16278 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', 16279 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, 16280 rsUpper + '+' + rsOptContrUpper, 16281 rsOrdUpper, 16282 rsOrdLower, 16283 rsDigits, 16284 rsEmoji 16285 ].join('|'), 'g'); 16286 16287 /** 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/). */ 16288 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); 16289 16290 /** Used to detect strings that need a more robust regexp to match words. */ 16291 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 ]/; 16292 16293 /** Used to assign default `context` object properties. */ 16294 var contextProps = [ 16295 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 16296 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 16297 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 16298 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 16299 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' 16300 ]; 16301 16302 /** Used to make template sourceURLs easier to identify. */ 16303 var templateCounter = -1; 16304 16305 /** Used to identify `toStringTag` values of typed arrays. */ 16306 var typedArrayTags = {}; 16307 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 16308 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 16309 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 16310 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 16311 typedArrayTags[uint32Tag] = true; 16312 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 16313 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 16314 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 16315 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 16316 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 16317 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 16318 typedArrayTags[setTag] = typedArrayTags[stringTag] = 16319 typedArrayTags[weakMapTag] = false; 16320 16321 /** Used to identify `toStringTag` values supported by `_.clone`. */ 16322 var cloneableTags = {}; 16323 cloneableTags[argsTag] = cloneableTags[arrayTag] = 16324 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 16325 cloneableTags[boolTag] = cloneableTags[dateTag] = 16326 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 16327 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 16328 cloneableTags[int32Tag] = cloneableTags[mapTag] = 16329 cloneableTags[numberTag] = cloneableTags[objectTag] = 16330 cloneableTags[regexpTag] = cloneableTags[setTag] = 16331 cloneableTags[stringTag] = cloneableTags[symbolTag] = 16332 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 16333 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 16334 cloneableTags[errorTag] = cloneableTags[funcTag] = 16335 cloneableTags[weakMapTag] = false; 16336 16337 /** Used to map Latin Unicode letters to basic Latin letters. */ 16338 var deburredLetters = { 16339 // Latin-1 Supplement block. 16340 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 16341 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 16342 '\xc7': 'C', '\xe7': 'c', 16343 '\xd0': 'D', '\xf0': 'd', 16344 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 16345 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 16346 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 16347 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 16348 '\xd1': 'N', '\xf1': 'n', 16349 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 16350 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 16351 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 16352 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 16353 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 16354 '\xc6': 'Ae', '\xe6': 'ae', 16355 '\xde': 'Th', '\xfe': 'th', 16356 '\xdf': 'ss', 16357 // Latin Extended-A block. 16358 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', 16359 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', 16360 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', 16361 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', 16362 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', 16363 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', 16364 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', 16365 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', 16366 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', 16367 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', 16368 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', 16369 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', 16370 '\u0134': 'J', '\u0135': 'j', 16371 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', 16372 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', 16373 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', 16374 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', 16375 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', 16376 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', 16377 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', 16378 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', 16379 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', 16380 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', 16381 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', 16382 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', 16383 '\u0163': 't', '\u0165': 't', '\u0167': 't', 16384 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', 16385 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', 16386 '\u0174': 'W', '\u0175': 'w', 16387 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', 16388 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', 16389 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', 16390 '\u0132': 'IJ', '\u0133': 'ij', 16391 '\u0152': 'Oe', '\u0153': 'oe', 16392 '\u0149': "'n", '\u017f': 's' 16393 }; 16394 16395 /** Used to map characters to HTML entities. */ 16396 var htmlEscapes = { 16397 '&': '&', 16398 '<': '<', 16399 '>': '>', 16400 '"': '"', 16401 "'": ''' 16402 }; 16403 16404 /** Used to map HTML entities to characters. */ 16405 var htmlUnescapes = { 16406 '&': '&', 16407 '<': '<', 16408 '>': '>', 16409 '"': '"', 16410 ''': "'" 16411 }; 16412 16413 /** Used to escape characters for inclusion in compiled string literals. */ 16414 var stringEscapes = { 16415 '\\': '\\', 16416 "'": "'", 16417 '\n': 'n', 16418 '\r': 'r', 16419 '\u2028': 'u2028', 16420 '\u2029': 'u2029' 16421 }; 16422 16423 /** Built-in method references without a dependency on `root`. */ 16424 var freeParseFloat = parseFloat, 16425 freeParseInt = parseInt; 16426 16427 /** Detect free variable `global` from Node.js. */ 16428 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 16429 16430 /** Detect free variable `self`. */ 16431 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 16432 16433 /** Used as a reference to the global object. */ 16434 var root = freeGlobal || freeSelf || Function('return this')(); 16435 16436 /** Detect free variable `exports`. */ 16437 var freeExports = true && exports && !exports.nodeType && exports; 16438 16439 /** Detect free variable `module`. */ 16440 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 16441 16442 /** Detect the popular CommonJS extension `module.exports`. */ 16443 var moduleExports = freeModule && freeModule.exports === freeExports; 16444 16445 /** Detect free variable `process` from Node.js. */ 16446 var freeProcess = moduleExports && freeGlobal.process; 16447 16448 /** Used to access faster Node.js helpers. */ 16449 var nodeUtil = (function() { 16450 try { 16451 // Use `util.types` for Node.js 10+. 16452 var types = freeModule && freeModule.require && freeModule.require('util').types; 16453 16454 if (types) { 16455 return types; 16456 } 16457 16458 // Legacy `process.binding('util')` for Node.js < 10. 16459 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 16460 } catch (e) {} 16461 }()); 16462 16463 /* Node.js helper references. */ 16464 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, 16465 nodeIsDate = nodeUtil && nodeUtil.isDate, 16466 nodeIsMap = nodeUtil && nodeUtil.isMap, 16467 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, 16468 nodeIsSet = nodeUtil && nodeUtil.isSet, 16469 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 16470 16471 /*--------------------------------------------------------------------------*/ 16472 16473 /** 16474 * A faster alternative to `Function#apply`, this function invokes `func` 16475 * with the `this` binding of `thisArg` and the arguments of `args`. 16476 * 16477 * @private 16478 * @param {Function} func The function to invoke. 16479 * @param {*} thisArg The `this` binding of `func`. 16480 * @param {Array} args The arguments to invoke `func` with. 16481 * @returns {*} Returns the result of `func`. 16482 */ 16483 function apply(func, thisArg, args) { 16484 switch (args.length) { 16485 case 0: return func.call(thisArg); 16486 case 1: return func.call(thisArg, args[0]); 16487 case 2: return func.call(thisArg, args[0], args[1]); 16488 case 3: return func.call(thisArg, args[0], args[1], args[2]); 16489 } 16490 return func.apply(thisArg, args); 16491 } 16492 16493 /** 16494 * A specialized version of `baseAggregator` for arrays. 16495 * 16496 * @private 16497 * @param {Array} [array] The array to iterate over. 16498 * @param {Function} setter The function to set `accumulator` values. 16499 * @param {Function} iteratee The iteratee to transform keys. 16500 * @param {Object} accumulator The initial aggregated object. 16501 * @returns {Function} Returns `accumulator`. 16502 */ 16503 function arrayAggregator(array, setter, iteratee, accumulator) { 16504 var index = -1, 16505 length = array == null ? 0 : array.length; 16506 16507 while (++index < length) { 16508 var value = array[index]; 16509 setter(accumulator, value, iteratee(value), array); 16510 } 16511 return accumulator; 16512 } 16513 16514 /** 16515 * A specialized version of `_.forEach` for arrays without support for 16516 * iteratee shorthands. 16517 * 16518 * @private 16519 * @param {Array} [array] The array to iterate over. 16520 * @param {Function} iteratee The function invoked per iteration. 16521 * @returns {Array} Returns `array`. 16522 */ 16523 function arrayEach(array, iteratee) { 16524 var index = -1, 16525 length = array == null ? 0 : array.length; 16526 16527 while (++index < length) { 16528 if (iteratee(array[index], index, array) === false) { 16529 break; 16530 } 16531 } 16532 return array; 16533 } 16534 16535 /** 16536 * A specialized version of `_.forEachRight` for arrays without support for 16537 * iteratee shorthands. 16538 * 16539 * @private 16540 * @param {Array} [array] The array to iterate over. 16541 * @param {Function} iteratee The function invoked per iteration. 16542 * @returns {Array} Returns `array`. 16543 */ 16544 function arrayEachRight(array, iteratee) { 16545 var length = array == null ? 0 : array.length; 16546 16547 while (length--) { 16548 if (iteratee(array[length], length, array) === false) { 16549 break; 16550 } 16551 } 16552 return array; 16553 } 16554 16555 /** 16556 * A specialized version of `_.every` for arrays without support for 16557 * iteratee shorthands. 16558 * 16559 * @private 16560 * @param {Array} [array] The array to iterate over. 16561 * @param {Function} predicate The function invoked per iteration. 16562 * @returns {boolean} Returns `true` if all elements pass the predicate check, 16563 * else `false`. 16564 */ 16565 function arrayEvery(array, predicate) { 16566 var index = -1, 16567 length = array == null ? 0 : array.length; 16568 16569 while (++index < length) { 16570 if (!predicate(array[index], index, array)) { 16571 return false; 16572 } 16573 } 16574 return true; 16575 } 16576 16577 /** 16578 * A specialized version of `_.filter` for arrays without support for 16579 * iteratee shorthands. 16580 * 16581 * @private 16582 * @param {Array} [array] The array to iterate over. 16583 * @param {Function} predicate The function invoked per iteration. 16584 * @returns {Array} Returns the new filtered array. 16585 */ 16586 function arrayFilter(array, predicate) { 16587 var index = -1, 16588 length = array == null ? 0 : array.length, 16589 resIndex = 0, 16590 result = []; 16591 16592 while (++index < length) { 16593 var value = array[index]; 16594 if (predicate(value, index, array)) { 16595 result[resIndex++] = value; 16596 } 16597 } 16598 return result; 16599 } 16600 16601 /** 16602 * A specialized version of `_.includes` for arrays without support for 16603 * specifying an index to search from. 16604 * 16605 * @private 16606 * @param {Array} [array] The array to inspect. 16607 * @param {*} target The value to search for. 16608 * @returns {boolean} Returns `true` if `target` is found, else `false`. 16609 */ 16610 function arrayIncludes(array, value) { 16611 var length = array == null ? 0 : array.length; 16612 return !!length && baseIndexOf(array, value, 0) > -1; 16613 } 16614 16615 /** 16616 * This function is like `arrayIncludes` except that it accepts a comparator. 16617 * 16618 * @private 16619 * @param {Array} [array] The array to inspect. 16620 * @param {*} target The value to search for. 16621 * @param {Function} comparator The comparator invoked per element. 16622 * @returns {boolean} Returns `true` if `target` is found, else `false`. 16623 */ 16624 function arrayIncludesWith(array, value, comparator) { 16625 var index = -1, 16626 length = array == null ? 0 : array.length; 16627 16628 while (++index < length) { 16629 if (comparator(value, array[index])) { 16630 return true; 16631 } 16632 } 16633 return false; 16634 } 16635 16636 /** 16637 * A specialized version of `_.map` for arrays without support for iteratee 16638 * shorthands. 16639 * 16640 * @private 16641 * @param {Array} [array] The array to iterate over. 16642 * @param {Function} iteratee The function invoked per iteration. 16643 * @returns {Array} Returns the new mapped array. 16644 */ 16645 function arrayMap(array, iteratee) { 16646 var index = -1, 16647 length = array == null ? 0 : array.length, 16648 result = Array(length); 16649 16650 while (++index < length) { 16651 result[index] = iteratee(array[index], index, array); 16652 } 16653 return result; 16654 } 16655 16656 /** 16657 * Appends the elements of `values` to `array`. 16658 * 16659 * @private 16660 * @param {Array} array The array to modify. 16661 * @param {Array} values The values to append. 16662 * @returns {Array} Returns `array`. 16663 */ 16664 function arrayPush(array, values) { 16665 var index = -1, 16666 length = values.length, 16667 offset = array.length; 16668 16669 while (++index < length) { 16670 array[offset + index] = values[index]; 16671 } 16672 return array; 16673 } 16674 16675 /** 16676 * A specialized version of `_.reduce` for arrays without support for 16677 * iteratee shorthands. 16678 * 16679 * @private 16680 * @param {Array} [array] The array to iterate over. 16681 * @param {Function} iteratee The function invoked per iteration. 16682 * @param {*} [accumulator] The initial value. 16683 * @param {boolean} [initAccum] Specify using the first element of `array` as 16684 * the initial value. 16685 * @returns {*} Returns the accumulated value. 16686 */ 16687 function arrayReduce(array, iteratee, accumulator, initAccum) { 16688 var index = -1, 16689 length = array == null ? 0 : array.length; 16690 16691 if (initAccum && length) { 16692 accumulator = array[++index]; 16693 } 16694 while (++index < length) { 16695 accumulator = iteratee(accumulator, array[index], index, array); 16696 } 16697 return accumulator; 16698 } 16699 16700 /** 16701 * A specialized version of `_.reduceRight` for arrays without support for 16702 * iteratee shorthands. 16703 * 16704 * @private 16705 * @param {Array} [array] The array to iterate over. 16706 * @param {Function} iteratee The function invoked per iteration. 16707 * @param {*} [accumulator] The initial value. 16708 * @param {boolean} [initAccum] Specify using the last element of `array` as 16709 * the initial value. 16710 * @returns {*} Returns the accumulated value. 16711 */ 16712 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 16713 var length = array == null ? 0 : array.length; 16714 if (initAccum && length) { 16715 accumulator = array[--length]; 16716 } 16717 while (length--) { 16718 accumulator = iteratee(accumulator, array[length], length, array); 16719 } 16720 return accumulator; 16721 } 16722 16723 /** 16724 * A specialized version of `_.some` for arrays without support for iteratee 16725 * shorthands. 16726 * 16727 * @private 16728 * @param {Array} [array] The array to iterate over. 16729 * @param {Function} predicate The function invoked per iteration. 16730 * @returns {boolean} Returns `true` if any element passes the predicate check, 16731 * else `false`. 16732 */ 16733 function arraySome(array, predicate) { 16734 var index = -1, 16735 length = array == null ? 0 : array.length; 16736 16737 while (++index < length) { 16738 if (predicate(array[index], index, array)) { 16739 return true; 16740 } 16741 } 16742 return false; 16743 } 16744 16745 /** 16746 * Gets the size of an ASCII `string`. 16747 * 16748 * @private 16749 * @param {string} string The string inspect. 16750 * @returns {number} Returns the string size. 16751 */ 16752 var asciiSize = baseProperty('length'); 16753 16754 /** 16755 * Converts an ASCII `string` to an array. 16756 * 16757 * @private 16758 * @param {string} string The string to convert. 16759 * @returns {Array} Returns the converted array. 16760 */ 16761 function asciiToArray(string) { 16762 return string.split(''); 16763 } 16764 16765 /** 16766 * Splits an ASCII `string` into an array of its words. 16767 * 16768 * @private 16769 * @param {string} The string to inspect. 16770 * @returns {Array} Returns the words of `string`. 16771 */ 16772 function asciiWords(string) { 16773 return string.match(reAsciiWord) || []; 16774 } 16775 16776 /** 16777 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 16778 * without support for iteratee shorthands, which iterates over `collection` 16779 * using `eachFunc`. 16780 * 16781 * @private 16782 * @param {Array|Object} collection The collection to inspect. 16783 * @param {Function} predicate The function invoked per iteration. 16784 * @param {Function} eachFunc The function to iterate over `collection`. 16785 * @returns {*} Returns the found element or its key, else `undefined`. 16786 */ 16787 function baseFindKey(collection, predicate, eachFunc) { 16788 var result; 16789 eachFunc(collection, function(value, key, collection) { 16790 if (predicate(value, key, collection)) { 16791 result = key; 16792 return false; 16793 } 16794 }); 16795 return result; 16796 } 16797 16798 /** 16799 * The base implementation of `_.findIndex` and `_.findLastIndex` without 16800 * support for iteratee shorthands. 16801 * 16802 * @private 16803 * @param {Array} array The array to inspect. 16804 * @param {Function} predicate The function invoked per iteration. 16805 * @param {number} fromIndex The index to search from. 16806 * @param {boolean} [fromRight] Specify iterating from right to left. 16807 * @returns {number} Returns the index of the matched value, else `-1`. 16808 */ 16809 function baseFindIndex(array, predicate, fromIndex, fromRight) { 16810 var length = array.length, 16811 index = fromIndex + (fromRight ? 1 : -1); 16812 16813 while ((fromRight ? index-- : ++index < length)) { 16814 if (predicate(array[index], index, array)) { 16815 return index; 16816 } 16817 } 16818 return -1; 16819 } 16820 16821 /** 16822 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 16823 * 16824 * @private 16825 * @param {Array} array The array to inspect. 16826 * @param {*} value The value to search for. 16827 * @param {number} fromIndex The index to search from. 16828 * @returns {number} Returns the index of the matched value, else `-1`. 16829 */ 16830 function baseIndexOf(array, value, fromIndex) { 16831 return value === value 16832 ? strictIndexOf(array, value, fromIndex) 16833 : baseFindIndex(array, baseIsNaN, fromIndex); 16834 } 16835 16836 /** 16837 * This function is like `baseIndexOf` except that it accepts a comparator. 16838 * 16839 * @private 16840 * @param {Array} array The array to inspect. 16841 * @param {*} value The value to search for. 16842 * @param {number} fromIndex The index to search from. 16843 * @param {Function} comparator The comparator invoked per element. 16844 * @returns {number} Returns the index of the matched value, else `-1`. 16845 */ 16846 function baseIndexOfWith(array, value, fromIndex, comparator) { 16847 var index = fromIndex - 1, 16848 length = array.length; 16849 16850 while (++index < length) { 16851 if (comparator(array[index], value)) { 16852 return index; 16853 } 16854 } 16855 return -1; 16856 } 16857 16858 /** 16859 * The base implementation of `_.isNaN` without support for number objects. 16860 * 16861 * @private 16862 * @param {*} value The value to check. 16863 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 16864 */ 16865 function baseIsNaN(value) { 16866 return value !== value; 16867 } 16868 16869 /** 16870 * The base implementation of `_.mean` and `_.meanBy` without support for 16871 * iteratee shorthands. 16872 * 16873 * @private 16874 * @param {Array} array The array to iterate over. 16875 * @param {Function} iteratee The function invoked per iteration. 16876 * @returns {number} Returns the mean. 16877 */ 16878 function baseMean(array, iteratee) { 16879 var length = array == null ? 0 : array.length; 16880 return length ? (baseSum(array, iteratee) / length) : NAN; 16881 } 16882 16883 /** 16884 * The base implementation of `_.property` without support for deep paths. 16885 * 16886 * @private 16887 * @param {string} key The key of the property to get. 16888 * @returns {Function} Returns the new accessor function. 16889 */ 16890 function baseProperty(key) { 16891 return function(object) { 16892 return object == null ? undefined : object[key]; 16893 }; 16894 } 16895 16896 /** 16897 * The base implementation of `_.propertyOf` without support for deep paths. 16898 * 16899 * @private 16900 * @param {Object} object The object to query. 16901 * @returns {Function} Returns the new accessor function. 16902 */ 16903 function basePropertyOf(object) { 16904 return function(key) { 16905 return object == null ? undefined : object[key]; 16906 }; 16907 } 16908 16909 /** 16910 * The base implementation of `_.reduce` and `_.reduceRight`, without support 16911 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 16912 * 16913 * @private 16914 * @param {Array|Object} collection The collection to iterate over. 16915 * @param {Function} iteratee The function invoked per iteration. 16916 * @param {*} accumulator The initial value. 16917 * @param {boolean} initAccum Specify using the first or last element of 16918 * `collection` as the initial value. 16919 * @param {Function} eachFunc The function to iterate over `collection`. 16920 * @returns {*} Returns the accumulated value. 16921 */ 16922 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 16923 eachFunc(collection, function(value, index, collection) { 16924 accumulator = initAccum 16925 ? (initAccum = false, value) 16926 : iteratee(accumulator, value, index, collection); 16927 }); 16928 return accumulator; 16929 } 16930 16931 /** 16932 * The base implementation of `_.sortBy` which uses `comparer` to define the 16933 * sort order of `array` and replaces criteria objects with their corresponding 16934 * values. 16935 * 16936 * @private 16937 * @param {Array} array The array to sort. 16938 * @param {Function} comparer The function to define sort order. 16939 * @returns {Array} Returns `array`. 16940 */ 16941 function baseSortBy(array, comparer) { 16942 var length = array.length; 16943 16944 array.sort(comparer); 16945 while (length--) { 16946 array[length] = array[length].value; 16947 } 16948 return array; 16949 } 16950 16951 /** 16952 * The base implementation of `_.sum` and `_.sumBy` without support for 16953 * iteratee shorthands. 16954 * 16955 * @private 16956 * @param {Array} array The array to iterate over. 16957 * @param {Function} iteratee The function invoked per iteration. 16958 * @returns {number} Returns the sum. 16959 */ 16960 function baseSum(array, iteratee) { 16961 var result, 16962 index = -1, 16963 length = array.length; 16964 16965 while (++index < length) { 16966 var current = iteratee(array[index]); 16967 if (current !== undefined) { 16968 result = result === undefined ? current : (result + current); 16969 } 16970 } 16971 return result; 16972 } 16973 16974 /** 16975 * The base implementation of `_.times` without support for iteratee shorthands 16976 * or max array length checks. 16977 * 16978 * @private 16979 * @param {number} n The number of times to invoke `iteratee`. 16980 * @param {Function} iteratee The function invoked per iteration. 16981 * @returns {Array} Returns the array of results. 16982 */ 16983 function baseTimes(n, iteratee) { 16984 var index = -1, 16985 result = Array(n); 16986 16987 while (++index < n) { 16988 result[index] = iteratee(index); 16989 } 16990 return result; 16991 } 16992 16993 /** 16994 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 16995 * of key-value pairs for `object` corresponding to the property names of `props`. 16996 * 16997 * @private 16998 * @param {Object} object The object to query. 16999 * @param {Array} props The property names to get values for. 17000 * @returns {Object} Returns the key-value pairs. 17001 */ 17002 function baseToPairs(object, props) { 17003 return arrayMap(props, function(key) { 17004 return [key, object[key]]; 17005 }); 17006 } 17007 17008 /** 17009 * The base implementation of `_.trim`. 17010 * 17011 * @private 17012 * @param {string} string The string to trim. 17013 * @returns {string} Returns the trimmed string. 17014 */ 17015 function baseTrim(string) { 17016 return string 17017 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 17018 : string; 17019 } 17020 17021 /** 17022 * The base implementation of `_.unary` without support for storing metadata. 17023 * 17024 * @private 17025 * @param {Function} func The function to cap arguments for. 17026 * @returns {Function} Returns the new capped function. 17027 */ 17028 function baseUnary(func) { 17029 return function(value) { 17030 return func(value); 17031 }; 17032 } 17033 17034 /** 17035 * The base implementation of `_.values` and `_.valuesIn` which creates an 17036 * array of `object` property values corresponding to the property names 17037 * of `props`. 17038 * 17039 * @private 17040 * @param {Object} object The object to query. 17041 * @param {Array} props The property names to get values for. 17042 * @returns {Object} Returns the array of property values. 17043 */ 17044 function baseValues(object, props) { 17045 return arrayMap(props, function(key) { 17046 return object[key]; 17047 }); 17048 } 17049 17050 /** 17051 * Checks if a `cache` value for `key` exists. 17052 * 17053 * @private 17054 * @param {Object} cache The cache to query. 17055 * @param {string} key The key of the entry to check. 17056 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 17057 */ 17058 function cacheHas(cache, key) { 17059 return cache.has(key); 17060 } 17061 17062 /** 17063 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 17064 * that is not found in the character symbols. 17065 * 17066 * @private 17067 * @param {Array} strSymbols The string symbols to inspect. 17068 * @param {Array} chrSymbols The character symbols to find. 17069 * @returns {number} Returns the index of the first unmatched string symbol. 17070 */ 17071 function charsStartIndex(strSymbols, chrSymbols) { 17072 var index = -1, 17073 length = strSymbols.length; 17074 17075 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 17076 return index; 17077 } 17078 17079 /** 17080 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 17081 * that is not found in the character symbols. 17082 * 17083 * @private 17084 * @param {Array} strSymbols The string symbols to inspect. 17085 * @param {Array} chrSymbols The character symbols to find. 17086 * @returns {number} Returns the index of the last unmatched string symbol. 17087 */ 17088 function charsEndIndex(strSymbols, chrSymbols) { 17089 var index = strSymbols.length; 17090 17091 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 17092 return index; 17093 } 17094 17095 /** 17096 * Gets the number of `placeholder` occurrences in `array`. 17097 * 17098 * @private 17099 * @param {Array} array The array to inspect. 17100 * @param {*} placeholder The placeholder to search for. 17101 * @returns {number} Returns the placeholder count. 17102 */ 17103 function countHolders(array, placeholder) { 17104 var length = array.length, 17105 result = 0; 17106 17107 while (length--) { 17108 if (array[length] === placeholder) { 17109 ++result; 17110 } 17111 } 17112 return result; 17113 } 17114 17115 /** 17116 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 17117 * letters to basic Latin letters. 17118 * 17119 * @private 17120 * @param {string} letter The matched letter to deburr. 17121 * @returns {string} Returns the deburred letter. 17122 */ 17123 var deburrLetter = basePropertyOf(deburredLetters); 17124 17125 /** 17126 * Used by `_.escape` to convert characters to HTML entities. 17127 * 17128 * @private 17129 * @param {string} chr The matched character to escape. 17130 * @returns {string} Returns the escaped character. 17131 */ 17132 var escapeHtmlChar = basePropertyOf(htmlEscapes); 17133 17134 /** 17135 * Used by `_.template` to escape characters for inclusion in compiled string literals. 17136 * 17137 * @private 17138 * @param {string} chr The matched character to escape. 17139 * @returns {string} Returns the escaped character. 17140 */ 17141 function escapeStringChar(chr) { 17142 return '\\' + stringEscapes[chr]; 17143 } 17144 17145 /** 17146 * Gets the value at `key` of `object`. 17147 * 17148 * @private 17149 * @param {Object} [object] The object to query. 17150 * @param {string} key The key of the property to get. 17151 * @returns {*} Returns the property value. 17152 */ 17153 function getValue(object, key) { 17154 return object == null ? undefined : object[key]; 17155 } 17156 17157 /** 17158 * Checks if `string` contains Unicode symbols. 17159 * 17160 * @private 17161 * @param {string} string The string to inspect. 17162 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 17163 */ 17164 function hasUnicode(string) { 17165 return reHasUnicode.test(string); 17166 } 17167 17168 /** 17169 * Checks if `string` contains a word composed of Unicode symbols. 17170 * 17171 * @private 17172 * @param {string} string The string to inspect. 17173 * @returns {boolean} Returns `true` if a word is found, else `false`. 17174 */ 17175 function hasUnicodeWord(string) { 17176 return reHasUnicodeWord.test(string); 17177 } 17178 17179 /** 17180 * Converts `iterator` to an array. 17181 * 17182 * @private 17183 * @param {Object} iterator The iterator to convert. 17184 * @returns {Array} Returns the converted array. 17185 */ 17186 function iteratorToArray(iterator) { 17187 var data, 17188 result = []; 17189 17190 while (!(data = iterator.next()).done) { 17191 result.push(data.value); 17192 } 17193 return result; 17194 } 17195 17196 /** 17197 * Converts `map` to its key-value pairs. 17198 * 17199 * @private 17200 * @param {Object} map The map to convert. 17201 * @returns {Array} Returns the key-value pairs. 17202 */ 17203 function mapToArray(map) { 17204 var index = -1, 17205 result = Array(map.size); 17206 17207 map.forEach(function(value, key) { 17208 result[++index] = [key, value]; 17209 }); 17210 return result; 17211 } 17212 17213 /** 17214 * Creates a unary function that invokes `func` with its argument transformed. 17215 * 17216 * @private 17217 * @param {Function} func The function to wrap. 17218 * @param {Function} transform The argument transform. 17219 * @returns {Function} Returns the new function. 17220 */ 17221 function overArg(func, transform) { 17222 return function(arg) { 17223 return func(transform(arg)); 17224 }; 17225 } 17226 17227 /** 17228 * Replaces all `placeholder` elements in `array` with an internal placeholder 17229 * and returns an array of their indexes. 17230 * 17231 * @private 17232 * @param {Array} array The array to modify. 17233 * @param {*} placeholder The placeholder to replace. 17234 * @returns {Array} Returns the new array of placeholder indexes. 17235 */ 17236 function replaceHolders(array, placeholder) { 17237 var index = -1, 17238 length = array.length, 17239 resIndex = 0, 17240 result = []; 17241 17242 while (++index < length) { 17243 var value = array[index]; 17244 if (value === placeholder || value === PLACEHOLDER) { 17245 array[index] = PLACEHOLDER; 17246 result[resIndex++] = index; 17247 } 17248 } 17249 return result; 17250 } 17251 17252 /** 17253 * Converts `set` to an array of its values. 17254 * 17255 * @private 17256 * @param {Object} set The set to convert. 17257 * @returns {Array} Returns the values. 17258 */ 17259 function setToArray(set) { 17260 var index = -1, 17261 result = Array(set.size); 17262 17263 set.forEach(function(value) { 17264 result[++index] = value; 17265 }); 17266 return result; 17267 } 17268 17269 /** 17270 * Converts `set` to its value-value pairs. 17271 * 17272 * @private 17273 * @param {Object} set The set to convert. 17274 * @returns {Array} Returns the value-value pairs. 17275 */ 17276 function setToPairs(set) { 17277 var index = -1, 17278 result = Array(set.size); 17279 17280 set.forEach(function(value) { 17281 result[++index] = [value, value]; 17282 }); 17283 return result; 17284 } 17285 17286 /** 17287 * A specialized version of `_.indexOf` which performs strict equality 17288 * comparisons of values, i.e. `===`. 17289 * 17290 * @private 17291 * @param {Array} array The array to inspect. 17292 * @param {*} value The value to search for. 17293 * @param {number} fromIndex The index to search from. 17294 * @returns {number} Returns the index of the matched value, else `-1`. 17295 */ 17296 function strictIndexOf(array, value, fromIndex) { 17297 var index = fromIndex - 1, 17298 length = array.length; 17299 17300 while (++index < length) { 17301 if (array[index] === value) { 17302 return index; 17303 } 17304 } 17305 return -1; 17306 } 17307 17308 /** 17309 * A specialized version of `_.lastIndexOf` which performs strict equality 17310 * comparisons of values, i.e. `===`. 17311 * 17312 * @private 17313 * @param {Array} array The array to inspect. 17314 * @param {*} value The value to search for. 17315 * @param {number} fromIndex The index to search from. 17316 * @returns {number} Returns the index of the matched value, else `-1`. 17317 */ 17318 function strictLastIndexOf(array, value, fromIndex) { 17319 var index = fromIndex + 1; 17320 while (index--) { 17321 if (array[index] === value) { 17322 return index; 17323 } 17324 } 17325 return index; 17326 } 17327 17328 /** 17329 * Gets the number of symbols in `string`. 17330 * 17331 * @private 17332 * @param {string} string The string to inspect. 17333 * @returns {number} Returns the string size. 17334 */ 17335 function stringSize(string) { 17336 return hasUnicode(string) 17337 ? unicodeSize(string) 17338 : asciiSize(string); 17339 } 17340 17341 /** 17342 * Converts `string` to an array. 17343 * 17344 * @private 17345 * @param {string} string The string to convert. 17346 * @returns {Array} Returns the converted array. 17347 */ 17348 function stringToArray(string) { 17349 return hasUnicode(string) 17350 ? unicodeToArray(string) 17351 : asciiToArray(string); 17352 } 17353 17354 /** 17355 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 17356 * character of `string`. 17357 * 17358 * @private 17359 * @param {string} string The string to inspect. 17360 * @returns {number} Returns the index of the last non-whitespace character. 17361 */ 17362 function trimmedEndIndex(string) { 17363 var index = string.length; 17364 17365 while (index-- && reWhitespace.test(string.charAt(index))) {} 17366 return index; 17367 } 17368 17369 /** 17370 * Used by `_.unescape` to convert HTML entities to characters. 17371 * 17372 * @private 17373 * @param {string} chr The matched character to unescape. 17374 * @returns {string} Returns the unescaped character. 17375 */ 17376 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 17377 17378 /** 17379 * Gets the size of a Unicode `string`. 17380 * 17381 * @private 17382 * @param {string} string The string inspect. 17383 * @returns {number} Returns the string size. 17384 */ 17385 function unicodeSize(string) { 17386 var result = reUnicode.lastIndex = 0; 17387 while (reUnicode.test(string)) { 17388 ++result; 17389 } 17390 return result; 17391 } 17392 17393 /** 17394 * Converts a Unicode `string` to an array. 17395 * 17396 * @private 17397 * @param {string} string The string to convert. 17398 * @returns {Array} Returns the converted array. 17399 */ 17400 function unicodeToArray(string) { 17401 return string.match(reUnicode) || []; 17402 } 17403 17404 /** 17405 * Splits a Unicode `string` into an array of its words. 17406 * 17407 * @private 17408 * @param {string} The string to inspect. 17409 * @returns {Array} Returns the words of `string`. 17410 */ 17411 function unicodeWords(string) { 17412 return string.match(reUnicodeWord) || []; 17413 } 17414 17415 /*--------------------------------------------------------------------------*/ 17416 17417 /** 17418 * Create a new pristine `lodash` function using the `context` object. 17419 * 17420 * @static 17421 * @memberOf _ 17422 * @since 1.1.0 17423 * @category Util 17424 * @param {Object} [context=root] The context object. 17425 * @returns {Function} Returns a new `lodash` function. 17426 * @example 17427 * 17428 * _.mixin({ 'foo': _.constant('foo') }); 17429 * 17430 * var lodash = _.runInContext(); 17431 * lodash.mixin({ 'bar': lodash.constant('bar') }); 17432 * 17433 * _.isFunction(_.foo); 17434 * // => true 17435 * _.isFunction(_.bar); 17436 * // => false 17437 * 17438 * lodash.isFunction(lodash.foo); 17439 * // => false 17440 * lodash.isFunction(lodash.bar); 17441 * // => true 17442 * 17443 * // Create a suped-up `defer` in Node.js. 17444 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 17445 */ 17446 var runInContext = (function runInContext(context) { 17447 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 17448 17449 /** Built-in constructor references. */ 17450 var Array = context.Array, 17451 Date = context.Date, 17452 Error = context.Error, 17453 Function = context.Function, 17454 Math = context.Math, 17455 Object = context.Object, 17456 RegExp = context.RegExp, 17457 String = context.String, 17458 TypeError = context.TypeError; 17459 17460 /** Used for built-in method references. */ 17461 var arrayProto = Array.prototype, 17462 funcProto = Function.prototype, 17463 objectProto = Object.prototype; 17464 17465 /** Used to detect overreaching core-js shims. */ 17466 var coreJsData = context['__core-js_shared__']; 17467 17468 /** Used to resolve the decompiled source of functions. */ 17469 var funcToString = funcProto.toString; 17470 17471 /** Used to check objects for own properties. */ 17472 var hasOwnProperty = objectProto.hasOwnProperty; 17473 17474 /** Used to generate unique IDs. */ 17475 var idCounter = 0; 17476 17477 /** Used to detect methods masquerading as native. */ 17478 var maskSrcKey = (function() { 17479 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 17480 return uid ? ('Symbol(src)_1.' + uid) : ''; 17481 }()); 17482 17483 /** 17484 * Used to resolve the 17485 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 17486 * of values. 17487 */ 17488 var nativeObjectToString = objectProto.toString; 17489 17490 /** Used to infer the `Object` constructor. */ 17491 var objectCtorString = funcToString.call(Object); 17492 17493 /** Used to restore the original `_` reference in `_.noConflict`. */ 17494 var oldDash = root._; 17495 17496 /** Used to detect if a method is native. */ 17497 var reIsNative = RegExp('^' + 17498 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 17499 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 17500 ); 17501 17502 /** Built-in value references. */ 17503 var Buffer = moduleExports ? context.Buffer : undefined, 17504 Symbol = context.Symbol, 17505 Uint8Array = context.Uint8Array, 17506 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, 17507 getPrototype = overArg(Object.getPrototypeOf, Object), 17508 objectCreate = Object.create, 17509 propertyIsEnumerable = objectProto.propertyIsEnumerable, 17510 splice = arrayProto.splice, 17511 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, 17512 symIterator = Symbol ? Symbol.iterator : undefined, 17513 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 17514 17515 var defineProperty = (function() { 17516 try { 17517 var func = getNative(Object, 'defineProperty'); 17518 func({}, '', {}); 17519 return func; 17520 } catch (e) {} 17521 }()); 17522 17523 /** Mocked built-ins. */ 17524 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, 17525 ctxNow = Date && Date.now !== root.Date.now && Date.now, 17526 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 17527 17528 /* Built-in method references for those with the same name as other `lodash` methods. */ 17529 var nativeCeil = Math.ceil, 17530 nativeFloor = Math.floor, 17531 nativeGetSymbols = Object.getOwnPropertySymbols, 17532 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 17533 nativeIsFinite = context.isFinite, 17534 nativeJoin = arrayProto.join, 17535 nativeKeys = overArg(Object.keys, Object), 17536 nativeMax = Math.max, 17537 nativeMin = Math.min, 17538 nativeNow = Date.now, 17539 nativeParseInt = context.parseInt, 17540 nativeRandom = Math.random, 17541 nativeReverse = arrayProto.reverse; 17542 17543 /* Built-in method references that are verified to be native. */ 17544 var DataView = getNative(context, 'DataView'), 17545 Map = getNative(context, 'Map'), 17546 Promise = getNative(context, 'Promise'), 17547 Set = getNative(context, 'Set'), 17548 WeakMap = getNative(context, 'WeakMap'), 17549 nativeCreate = getNative(Object, 'create'); 17550 17551 /** Used to store function metadata. */ 17552 var metaMap = WeakMap && new WeakMap; 17553 17554 /** Used to lookup unminified function names. */ 17555 var realNames = {}; 17556 17557 /** Used to detect maps, sets, and weakmaps. */ 17558 var dataViewCtorString = toSource(DataView), 17559 mapCtorString = toSource(Map), 17560 promiseCtorString = toSource(Promise), 17561 setCtorString = toSource(Set), 17562 weakMapCtorString = toSource(WeakMap); 17563 17564 /** Used to convert symbols to primitives and strings. */ 17565 var symbolProto = Symbol ? Symbol.prototype : undefined, 17566 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, 17567 symbolToString = symbolProto ? symbolProto.toString : undefined; 17568 17569 /*------------------------------------------------------------------------*/ 17570 17571 /** 17572 * Creates a `lodash` object which wraps `value` to enable implicit method 17573 * chain sequences. Methods that operate on and return arrays, collections, 17574 * and functions can be chained together. Methods that retrieve a single value 17575 * or may return a primitive value will automatically end the chain sequence 17576 * and return the unwrapped value. Otherwise, the value must be unwrapped 17577 * with `_#value`. 17578 * 17579 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 17580 * enabled using `_.chain`. 17581 * 17582 * The execution of chained methods is lazy, that is, it's deferred until 17583 * `_#value` is implicitly or explicitly called. 17584 * 17585 * Lazy evaluation allows several methods to support shortcut fusion. 17586 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 17587 * the creation of intermediate arrays and can greatly reduce the number of 17588 * iteratee executions. Sections of a chain sequence qualify for shortcut 17589 * fusion if the section is applied to an array and iteratees accept only 17590 * one argument. The heuristic for whether a section qualifies for shortcut 17591 * fusion is subject to change. 17592 * 17593 * Chaining is supported in custom builds as long as the `_#value` method is 17594 * directly or indirectly included in the build. 17595 * 17596 * In addition to lodash methods, wrappers have `Array` and `String` methods. 17597 * 17598 * The wrapper `Array` methods are: 17599 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 17600 * 17601 * The wrapper `String` methods are: 17602 * `replace` and `split` 17603 * 17604 * The wrapper methods that support shortcut fusion are: 17605 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 17606 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 17607 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 17608 * 17609 * The chainable wrapper methods are: 17610 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 17611 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 17612 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 17613 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 17614 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 17615 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 17616 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 17617 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 17618 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 17619 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 17620 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 17621 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 17622 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 17623 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 17624 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 17625 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 17626 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 17627 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 17628 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 17629 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 17630 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 17631 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 17632 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 17633 * `zipObject`, `zipObjectDeep`, and `zipWith` 17634 * 17635 * The wrapper methods that are **not** chainable by default are: 17636 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 17637 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 17638 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 17639 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 17640 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 17641 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 17642 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 17643 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 17644 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 17645 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 17646 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 17647 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 17648 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 17649 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 17650 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 17651 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 17652 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 17653 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 17654 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 17655 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 17656 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 17657 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 17658 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 17659 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 17660 * `upperFirst`, `value`, and `words` 17661 * 17662 * @name _ 17663 * @constructor 17664 * @category Seq 17665 * @param {*} value The value to wrap in a `lodash` instance. 17666 * @returns {Object} Returns the new `lodash` wrapper instance. 17667 * @example 17668 * 17669 * function square(n) { 17670 * return n * n; 17671 * } 17672 * 17673 * var wrapped = _([1, 2, 3]); 17674 * 17675 * // Returns an unwrapped value. 17676 * wrapped.reduce(_.add); 17677 * // => 6 17678 * 17679 * // Returns a wrapped value. 17680 * var squares = wrapped.map(square); 17681 * 17682 * _.isArray(squares); 17683 * // => false 17684 * 17685 * _.isArray(squares.value()); 17686 * // => true 17687 */ 17688 function lodash(value) { 17689 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { 17690 if (value instanceof LodashWrapper) { 17691 return value; 17692 } 17693 if (hasOwnProperty.call(value, '__wrapped__')) { 17694 return wrapperClone(value); 17695 } 17696 } 17697 return new LodashWrapper(value); 17698 } 17699 17700 /** 17701 * The base implementation of `_.create` without support for assigning 17702 * properties to the created object. 17703 * 17704 * @private 17705 * @param {Object} proto The object to inherit from. 17706 * @returns {Object} Returns the new object. 17707 */ 17708 var baseCreate = (function() { 17709 function object() {} 17710 return function(proto) { 17711 if (!isObject(proto)) { 17712 return {}; 17713 } 17714 if (objectCreate) { 17715 return objectCreate(proto); 17716 } 17717 object.prototype = proto; 17718 var result = new object; 17719 object.prototype = undefined; 17720 return result; 17721 }; 17722 }()); 17723 17724 /** 17725 * The function whose prototype chain sequence wrappers inherit from. 17726 * 17727 * @private 17728 */ 17729 function baseLodash() { 17730 // No operation performed. 17731 } 17732 17733 /** 17734 * The base constructor for creating `lodash` wrapper objects. 17735 * 17736 * @private 17737 * @param {*} value The value to wrap. 17738 * @param {boolean} [chainAll] Enable explicit method chain sequences. 17739 */ 17740 function LodashWrapper(value, chainAll) { 17741 this.__wrapped__ = value; 17742 this.__actions__ = []; 17743 this.__chain__ = !!chainAll; 17744 this.__index__ = 0; 17745 this.__values__ = undefined; 17746 } 17747 17748 /** 17749 * By default, the template delimiters used by lodash are like those in 17750 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 17751 * following template settings to use alternative delimiters. 17752 * 17753 * @static 17754 * @memberOf _ 17755 * @type {Object} 17756 */ 17757 lodash.templateSettings = { 17758 17759 /** 17760 * Used to detect `data` property values to be HTML-escaped. 17761 * 17762 * @memberOf _.templateSettings 17763 * @type {RegExp} 17764 */ 17765 'escape': reEscape, 17766 17767 /** 17768 * Used to detect code to be evaluated. 17769 * 17770 * @memberOf _.templateSettings 17771 * @type {RegExp} 17772 */ 17773 'evaluate': reEvaluate, 17774 17775 /** 17776 * Used to detect `data` property values to inject. 17777 * 17778 * @memberOf _.templateSettings 17779 * @type {RegExp} 17780 */ 17781 'interpolate': reInterpolate, 17782 17783 /** 17784 * Used to reference the data object in the template text. 17785 * 17786 * @memberOf _.templateSettings 17787 * @type {string} 17788 */ 17789 'variable': '', 17790 17791 /** 17792 * Used to import variables into the compiled template. 17793 * 17794 * @memberOf _.templateSettings 17795 * @type {Object} 17796 */ 17797 'imports': { 17798 17799 /** 17800 * A reference to the `lodash` function. 17801 * 17802 * @memberOf _.templateSettings.imports 17803 * @type {Function} 17804 */ 17805 '_': lodash 17806 } 17807 }; 17808 17809 // Ensure wrappers are instances of `baseLodash`. 17810 lodash.prototype = baseLodash.prototype; 17811 lodash.prototype.constructor = lodash; 17812 17813 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 17814 LodashWrapper.prototype.constructor = LodashWrapper; 17815 17816 /*------------------------------------------------------------------------*/ 17817 17818 /** 17819 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 17820 * 17821 * @private 17822 * @constructor 17823 * @param {*} value The value to wrap. 17824 */ 17825 function LazyWrapper(value) { 17826 this.__wrapped__ = value; 17827 this.__actions__ = []; 17828 this.__dir__ = 1; 17829 this.__filtered__ = false; 17830 this.__iteratees__ = []; 17831 this.__takeCount__ = MAX_ARRAY_LENGTH; 17832 this.__views__ = []; 17833 } 17834 17835 /** 17836 * Creates a clone of the lazy wrapper object. 17837 * 17838 * @private 17839 * @name clone 17840 * @memberOf LazyWrapper 17841 * @returns {Object} Returns the cloned `LazyWrapper` object. 17842 */ 17843 function lazyClone() { 17844 var result = new LazyWrapper(this.__wrapped__); 17845 result.__actions__ = copyArray(this.__actions__); 17846 result.__dir__ = this.__dir__; 17847 result.__filtered__ = this.__filtered__; 17848 result.__iteratees__ = copyArray(this.__iteratees__); 17849 result.__takeCount__ = this.__takeCount__; 17850 result.__views__ = copyArray(this.__views__); 17851 return result; 17852 } 17853 17854 /** 17855 * Reverses the direction of lazy iteration. 17856 * 17857 * @private 17858 * @name reverse 17859 * @memberOf LazyWrapper 17860 * @returns {Object} Returns the new reversed `LazyWrapper` object. 17861 */ 17862 function lazyReverse() { 17863 if (this.__filtered__) { 17864 var result = new LazyWrapper(this); 17865 result.__dir__ = -1; 17866 result.__filtered__ = true; 17867 } else { 17868 result = this.clone(); 17869 result.__dir__ *= -1; 17870 } 17871 return result; 17872 } 17873 17874 /** 17875 * Extracts the unwrapped value from its lazy wrapper. 17876 * 17877 * @private 17878 * @name value 17879 * @memberOf LazyWrapper 17880 * @returns {*} Returns the unwrapped value. 17881 */ 17882 function lazyValue() { 17883 var array = this.__wrapped__.value(), 17884 dir = this.__dir__, 17885 isArr = isArray(array), 17886 isRight = dir < 0, 17887 arrLength = isArr ? array.length : 0, 17888 view = getView(0, arrLength, this.__views__), 17889 start = view.start, 17890 end = view.end, 17891 length = end - start, 17892 index = isRight ? end : (start - 1), 17893 iteratees = this.__iteratees__, 17894 iterLength = iteratees.length, 17895 resIndex = 0, 17896 takeCount = nativeMin(length, this.__takeCount__); 17897 17898 if (!isArr || (!isRight && arrLength == length && takeCount == length)) { 17899 return baseWrapperValue(array, this.__actions__); 17900 } 17901 var result = []; 17902 17903 outer: 17904 while (length-- && resIndex < takeCount) { 17905 index += dir; 17906 17907 var iterIndex = -1, 17908 value = array[index]; 17909 17910 while (++iterIndex < iterLength) { 17911 var data = iteratees[iterIndex], 17912 iteratee = data.iteratee, 17913 type = data.type, 17914 computed = iteratee(value); 17915 17916 if (type == LAZY_MAP_FLAG) { 17917 value = computed; 17918 } else if (!computed) { 17919 if (type == LAZY_FILTER_FLAG) { 17920 continue outer; 17921 } else { 17922 break outer; 17923 } 17924 } 17925 } 17926 result[resIndex++] = value; 17927 } 17928 return result; 17929 } 17930 17931 // Ensure `LazyWrapper` is an instance of `baseLodash`. 17932 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 17933 LazyWrapper.prototype.constructor = LazyWrapper; 17934 17935 /*------------------------------------------------------------------------*/ 17936 17937 /** 17938 * Creates a hash object. 17939 * 17940 * @private 17941 * @constructor 17942 * @param {Array} [entries] The key-value pairs to cache. 17943 */ 17944 function Hash(entries) { 17945 var index = -1, 17946 length = entries == null ? 0 : entries.length; 17947 17948 this.clear(); 17949 while (++index < length) { 17950 var entry = entries[index]; 17951 this.set(entry[0], entry[1]); 17952 } 17953 } 17954 17955 /** 17956 * Removes all key-value entries from the hash. 17957 * 17958 * @private 17959 * @name clear 17960 * @memberOf Hash 17961 */ 17962 function hashClear() { 17963 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 17964 this.size = 0; 17965 } 17966 17967 /** 17968 * Removes `key` and its value from the hash. 17969 * 17970 * @private 17971 * @name delete 17972 * @memberOf Hash 17973 * @param {Object} hash The hash to modify. 17974 * @param {string} key The key of the value to remove. 17975 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 17976 */ 17977 function hashDelete(key) { 17978 var result = this.has(key) && delete this.__data__[key]; 17979 this.size -= result ? 1 : 0; 17980 return result; 17981 } 17982 17983 /** 17984 * Gets the hash value for `key`. 17985 * 17986 * @private 17987 * @name get 17988 * @memberOf Hash 17989 * @param {string} key The key of the value to get. 17990 * @returns {*} Returns the entry value. 17991 */ 17992 function hashGet(key) { 17993 var data = this.__data__; 17994 if (nativeCreate) { 17995 var result = data[key]; 17996 return result === HASH_UNDEFINED ? undefined : result; 17997 } 17998 return hasOwnProperty.call(data, key) ? data[key] : undefined; 17999 } 18000 18001 /** 18002 * Checks if a hash value for `key` exists. 18003 * 18004 * @private 18005 * @name has 18006 * @memberOf Hash 18007 * @param {string} key The key of the entry to check. 18008 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 18009 */ 18010 function hashHas(key) { 18011 var data = this.__data__; 18012 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 18013 } 18014 18015 /** 18016 * Sets the hash `key` to `value`. 18017 * 18018 * @private 18019 * @name set 18020 * @memberOf Hash 18021 * @param {string} key The key of the value to set. 18022 * @param {*} value The value to set. 18023 * @returns {Object} Returns the hash instance. 18024 */ 18025 function hashSet(key, value) { 18026 var data = this.__data__; 18027 this.size += this.has(key) ? 0 : 1; 18028 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 18029 return this; 18030 } 18031 18032 // Add methods to `Hash`. 18033 Hash.prototype.clear = hashClear; 18034 Hash.prototype['delete'] = hashDelete; 18035 Hash.prototype.get = hashGet; 18036 Hash.prototype.has = hashHas; 18037 Hash.prototype.set = hashSet; 18038 18039 /*------------------------------------------------------------------------*/ 18040 18041 /** 18042 * Creates an list cache object. 18043 * 18044 * @private 18045 * @constructor 18046 * @param {Array} [entries] The key-value pairs to cache. 18047 */ 18048 function ListCache(entries) { 18049 var index = -1, 18050 length = entries == null ? 0 : entries.length; 18051 18052 this.clear(); 18053 while (++index < length) { 18054 var entry = entries[index]; 18055 this.set(entry[0], entry[1]); 18056 } 18057 } 18058 18059 /** 18060 * Removes all key-value entries from the list cache. 18061 * 18062 * @private 18063 * @name clear 18064 * @memberOf ListCache 18065 */ 18066 function listCacheClear() { 18067 this.__data__ = []; 18068 this.size = 0; 18069 } 18070 18071 /** 18072 * Removes `key` and its value from the list cache. 18073 * 18074 * @private 18075 * @name delete 18076 * @memberOf ListCache 18077 * @param {string} key The key of the value to remove. 18078 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 18079 */ 18080 function listCacheDelete(key) { 18081 var data = this.__data__, 18082 index = assocIndexOf(data, key); 18083 18084 if (index < 0) { 18085 return false; 18086 } 18087 var lastIndex = data.length - 1; 18088 if (index == lastIndex) { 18089 data.pop(); 18090 } else { 18091 splice.call(data, index, 1); 18092 } 18093 --this.size; 18094 return true; 18095 } 18096 18097 /** 18098 * Gets the list cache value for `key`. 18099 * 18100 * @private 18101 * @name get 18102 * @memberOf ListCache 18103 * @param {string} key The key of the value to get. 18104 * @returns {*} Returns the entry value. 18105 */ 18106 function listCacheGet(key) { 18107 var data = this.__data__, 18108 index = assocIndexOf(data, key); 18109 18110 return index < 0 ? undefined : data[index][1]; 18111 } 18112 18113 /** 18114 * Checks if a list cache value for `key` exists. 18115 * 18116 * @private 18117 * @name has 18118 * @memberOf ListCache 18119 * @param {string} key The key of the entry to check. 18120 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 18121 */ 18122 function listCacheHas(key) { 18123 return assocIndexOf(this.__data__, key) > -1; 18124 } 18125 18126 /** 18127 * Sets the list cache `key` to `value`. 18128 * 18129 * @private 18130 * @name set 18131 * @memberOf ListCache 18132 * @param {string} key The key of the value to set. 18133 * @param {*} value The value to set. 18134 * @returns {Object} Returns the list cache instance. 18135 */ 18136 function listCacheSet(key, value) { 18137 var data = this.__data__, 18138 index = assocIndexOf(data, key); 18139 18140 if (index < 0) { 18141 ++this.size; 18142 data.push([key, value]); 18143 } else { 18144 data[index][1] = value; 18145 } 18146 return this; 18147 } 18148 18149 // Add methods to `ListCache`. 18150 ListCache.prototype.clear = listCacheClear; 18151 ListCache.prototype['delete'] = listCacheDelete; 18152 ListCache.prototype.get = listCacheGet; 18153 ListCache.prototype.has = listCacheHas; 18154 ListCache.prototype.set = listCacheSet; 18155 18156 /*------------------------------------------------------------------------*/ 18157 18158 /** 18159 * Creates a map cache object to store key-value pairs. 18160 * 18161 * @private 18162 * @constructor 18163 * @param {Array} [entries] The key-value pairs to cache. 18164 */ 18165 function MapCache(entries) { 18166 var index = -1, 18167 length = entries == null ? 0 : entries.length; 18168 18169 this.clear(); 18170 while (++index < length) { 18171 var entry = entries[index]; 18172 this.set(entry[0], entry[1]); 18173 } 18174 } 18175 18176 /** 18177 * Removes all key-value entries from the map. 18178 * 18179 * @private 18180 * @name clear 18181 * @memberOf MapCache 18182 */ 18183 function mapCacheClear() { 18184 this.size = 0; 18185 this.__data__ = { 18186 'hash': new Hash, 18187 'map': new (Map || ListCache), 18188 'string': new Hash 18189 }; 18190 } 18191 18192 /** 18193 * Removes `key` and its value from the map. 18194 * 18195 * @private 18196 * @name delete 18197 * @memberOf MapCache 18198 * @param {string} key The key of the value to remove. 18199 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 18200 */ 18201 function mapCacheDelete(key) { 18202 var result = getMapData(this, key)['delete'](key); 18203 this.size -= result ? 1 : 0; 18204 return result; 18205 } 18206 18207 /** 18208 * Gets the map value for `key`. 18209 * 18210 * @private 18211 * @name get 18212 * @memberOf MapCache 18213 * @param {string} key The key of the value to get. 18214 * @returns {*} Returns the entry value. 18215 */ 18216 function mapCacheGet(key) { 18217 return getMapData(this, key).get(key); 18218 } 18219 18220 /** 18221 * Checks if a map value for `key` exists. 18222 * 18223 * @private 18224 * @name has 18225 * @memberOf MapCache 18226 * @param {string} key The key of the entry to check. 18227 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 18228 */ 18229 function mapCacheHas(key) { 18230 return getMapData(this, key).has(key); 18231 } 18232 18233 /** 18234 * Sets the map `key` to `value`. 18235 * 18236 * @private 18237 * @name set 18238 * @memberOf MapCache 18239 * @param {string} key The key of the value to set. 18240 * @param {*} value The value to set. 18241 * @returns {Object} Returns the map cache instance. 18242 */ 18243 function mapCacheSet(key, value) { 18244 var data = getMapData(this, key), 18245 size = data.size; 18246 18247 data.set(key, value); 18248 this.size += data.size == size ? 0 : 1; 18249 return this; 18250 } 18251 18252 // Add methods to `MapCache`. 18253 MapCache.prototype.clear = mapCacheClear; 18254 MapCache.prototype['delete'] = mapCacheDelete; 18255 MapCache.prototype.get = mapCacheGet; 18256 MapCache.prototype.has = mapCacheHas; 18257 MapCache.prototype.set = mapCacheSet; 18258 18259 /*------------------------------------------------------------------------*/ 18260 18261 /** 18262 * 18263 * Creates an array cache object to store unique values. 18264 * 18265 * @private 18266 * @constructor 18267 * @param {Array} [values] The values to cache. 18268 */ 18269 function SetCache(values) { 18270 var index = -1, 18271 length = values == null ? 0 : values.length; 18272 18273 this.__data__ = new MapCache; 18274 while (++index < length) { 18275 this.add(values[index]); 18276 } 18277 } 18278 18279 /** 18280 * Adds `value` to the array cache. 18281 * 18282 * @private 18283 * @name add 18284 * @memberOf SetCache 18285 * @alias push 18286 * @param {*} value The value to cache. 18287 * @returns {Object} Returns the cache instance. 18288 */ 18289 function setCacheAdd(value) { 18290 this.__data__.set(value, HASH_UNDEFINED); 18291 return this; 18292 } 18293 18294 /** 18295 * Checks if `value` is in the array cache. 18296 * 18297 * @private 18298 * @name has 18299 * @memberOf SetCache 18300 * @param {*} value The value to search for. 18301 * @returns {number} Returns `true` if `value` is found, else `false`. 18302 */ 18303 function setCacheHas(value) { 18304 return this.__data__.has(value); 18305 } 18306 18307 // Add methods to `SetCache`. 18308 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 18309 SetCache.prototype.has = setCacheHas; 18310 18311 /*------------------------------------------------------------------------*/ 18312 18313 /** 18314 * Creates a stack cache object to store key-value pairs. 18315 * 18316 * @private 18317 * @constructor 18318 * @param {Array} [entries] The key-value pairs to cache. 18319 */ 18320 function Stack(entries) { 18321 var data = this.__data__ = new ListCache(entries); 18322 this.size = data.size; 18323 } 18324 18325 /** 18326 * Removes all key-value entries from the stack. 18327 * 18328 * @private 18329 * @name clear 18330 * @memberOf Stack 18331 */ 18332 function stackClear() { 18333 this.__data__ = new ListCache; 18334 this.size = 0; 18335 } 18336 18337 /** 18338 * Removes `key` and its value from the stack. 18339 * 18340 * @private 18341 * @name delete 18342 * @memberOf Stack 18343 * @param {string} key The key of the value to remove. 18344 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 18345 */ 18346 function stackDelete(key) { 18347 var data = this.__data__, 18348 result = data['delete'](key); 18349 18350 this.size = data.size; 18351 return result; 18352 } 18353 18354 /** 18355 * Gets the stack value for `key`. 18356 * 18357 * @private 18358 * @name get 18359 * @memberOf Stack 18360 * @param {string} key The key of the value to get. 18361 * @returns {*} Returns the entry value. 18362 */ 18363 function stackGet(key) { 18364 return this.__data__.get(key); 18365 } 18366 18367 /** 18368 * Checks if a stack value for `key` exists. 18369 * 18370 * @private 18371 * @name has 18372 * @memberOf Stack 18373 * @param {string} key The key of the entry to check. 18374 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 18375 */ 18376 function stackHas(key) { 18377 return this.__data__.has(key); 18378 } 18379 18380 /** 18381 * Sets the stack `key` to `value`. 18382 * 18383 * @private 18384 * @name set 18385 * @memberOf Stack 18386 * @param {string} key The key of the value to set. 18387 * @param {*} value The value to set. 18388 * @returns {Object} Returns the stack cache instance. 18389 */ 18390 function stackSet(key, value) { 18391 var data = this.__data__; 18392 if (data instanceof ListCache) { 18393 var pairs = data.__data__; 18394 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 18395 pairs.push([key, value]); 18396 this.size = ++data.size; 18397 return this; 18398 } 18399 data = this.__data__ = new MapCache(pairs); 18400 } 18401 data.set(key, value); 18402 this.size = data.size; 18403 return this; 18404 } 18405 18406 // Add methods to `Stack`. 18407 Stack.prototype.clear = stackClear; 18408 Stack.prototype['delete'] = stackDelete; 18409 Stack.prototype.get = stackGet; 18410 Stack.prototype.has = stackHas; 18411 Stack.prototype.set = stackSet; 18412 18413 /*------------------------------------------------------------------------*/ 18414 18415 /** 18416 * Creates an array of the enumerable property names of the array-like `value`. 18417 * 18418 * @private 18419 * @param {*} value The value to query. 18420 * @param {boolean} inherited Specify returning inherited property names. 18421 * @returns {Array} Returns the array of property names. 18422 */ 18423 function arrayLikeKeys(value, inherited) { 18424 var isArr = isArray(value), 18425 isArg = !isArr && isArguments(value), 18426 isBuff = !isArr && !isArg && isBuffer(value), 18427 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 18428 skipIndexes = isArr || isArg || isBuff || isType, 18429 result = skipIndexes ? baseTimes(value.length, String) : [], 18430 length = result.length; 18431 18432 for (var key in value) { 18433 if ((inherited || hasOwnProperty.call(value, key)) && 18434 !(skipIndexes && ( 18435 // Safari 9 has enumerable `arguments.length` in strict mode. 18436 key == 'length' || 18437 // Node.js 0.10 has enumerable non-index properties on buffers. 18438 (isBuff && (key == 'offset' || key == 'parent')) || 18439 // PhantomJS 2 has enumerable non-index properties on typed arrays. 18440 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 18441 // Skip index properties. 18442 isIndex(key, length) 18443 ))) { 18444 result.push(key); 18445 } 18446 } 18447 return result; 18448 } 18449 18450 /** 18451 * A specialized version of `_.sample` for arrays. 18452 * 18453 * @private 18454 * @param {Array} array The array to sample. 18455 * @returns {*} Returns the random element. 18456 */ 18457 function arraySample(array) { 18458 var length = array.length; 18459 return length ? array[baseRandom(0, length - 1)] : undefined; 18460 } 18461 18462 /** 18463 * A specialized version of `_.sampleSize` for arrays. 18464 * 18465 * @private 18466 * @param {Array} array The array to sample. 18467 * @param {number} n The number of elements to sample. 18468 * @returns {Array} Returns the random elements. 18469 */ 18470 function arraySampleSize(array, n) { 18471 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 18472 } 18473 18474 /** 18475 * A specialized version of `_.shuffle` for arrays. 18476 * 18477 * @private 18478 * @param {Array} array The array to shuffle. 18479 * @returns {Array} Returns the new shuffled array. 18480 */ 18481 function arrayShuffle(array) { 18482 return shuffleSelf(copyArray(array)); 18483 } 18484 18485 /** 18486 * This function is like `assignValue` except that it doesn't assign 18487 * `undefined` values. 18488 * 18489 * @private 18490 * @param {Object} object The object to modify. 18491 * @param {string} key The key of the property to assign. 18492 * @param {*} value The value to assign. 18493 */ 18494 function assignMergeValue(object, key, value) { 18495 if ((value !== undefined && !eq(object[key], value)) || 18496 (value === undefined && !(key in object))) { 18497 baseAssignValue(object, key, value); 18498 } 18499 } 18500 18501 /** 18502 * Assigns `value` to `key` of `object` if the existing value is not equivalent 18503 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 18504 * for equality comparisons. 18505 * 18506 * @private 18507 * @param {Object} object The object to modify. 18508 * @param {string} key The key of the property to assign. 18509 * @param {*} value The value to assign. 18510 */ 18511 function assignValue(object, key, value) { 18512 var objValue = object[key]; 18513 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 18514 (value === undefined && !(key in object))) { 18515 baseAssignValue(object, key, value); 18516 } 18517 } 18518 18519 /** 18520 * Gets the index at which the `key` is found in `array` of key-value pairs. 18521 * 18522 * @private 18523 * @param {Array} array The array to inspect. 18524 * @param {*} key The key to search for. 18525 * @returns {number} Returns the index of the matched value, else `-1`. 18526 */ 18527 function assocIndexOf(array, key) { 18528 var length = array.length; 18529 while (length--) { 18530 if (eq(array[length][0], key)) { 18531 return length; 18532 } 18533 } 18534 return -1; 18535 } 18536 18537 /** 18538 * Aggregates elements of `collection` on `accumulator` with keys transformed 18539 * by `iteratee` and values set by `setter`. 18540 * 18541 * @private 18542 * @param {Array|Object} collection The collection to iterate over. 18543 * @param {Function} setter The function to set `accumulator` values. 18544 * @param {Function} iteratee The iteratee to transform keys. 18545 * @param {Object} accumulator The initial aggregated object. 18546 * @returns {Function} Returns `accumulator`. 18547 */ 18548 function baseAggregator(collection, setter, iteratee, accumulator) { 18549 baseEach(collection, function(value, key, collection) { 18550 setter(accumulator, value, iteratee(value), collection); 18551 }); 18552 return accumulator; 18553 } 18554 18555 /** 18556 * The base implementation of `_.assign` without support for multiple sources 18557 * or `customizer` functions. 18558 * 18559 * @private 18560 * @param {Object} object The destination object. 18561 * @param {Object} source The source object. 18562 * @returns {Object} Returns `object`. 18563 */ 18564 function baseAssign(object, source) { 18565 return object && copyObject(source, keys(source), object); 18566 } 18567 18568 /** 18569 * The base implementation of `_.assignIn` without support for multiple sources 18570 * or `customizer` functions. 18571 * 18572 * @private 18573 * @param {Object} object The destination object. 18574 * @param {Object} source The source object. 18575 * @returns {Object} Returns `object`. 18576 */ 18577 function baseAssignIn(object, source) { 18578 return object && copyObject(source, keysIn(source), object); 18579 } 18580 18581 /** 18582 * The base implementation of `assignValue` and `assignMergeValue` without 18583 * value checks. 18584 * 18585 * @private 18586 * @param {Object} object The object to modify. 18587 * @param {string} key The key of the property to assign. 18588 * @param {*} value The value to assign. 18589 */ 18590 function baseAssignValue(object, key, value) { 18591 if (key == '__proto__' && defineProperty) { 18592 defineProperty(object, key, { 18593 'configurable': true, 18594 'enumerable': true, 18595 'value': value, 18596 'writable': true 18597 }); 18598 } else { 18599 object[key] = value; 18600 } 18601 } 18602 18603 /** 18604 * The base implementation of `_.at` without support for individual paths. 18605 * 18606 * @private 18607 * @param {Object} object The object to iterate over. 18608 * @param {string[]} paths The property paths to pick. 18609 * @returns {Array} Returns the picked elements. 18610 */ 18611 function baseAt(object, paths) { 18612 var index = -1, 18613 length = paths.length, 18614 result = Array(length), 18615 skip = object == null; 18616 18617 while (++index < length) { 18618 result[index] = skip ? undefined : get(object, paths[index]); 18619 } 18620 return result; 18621 } 18622 18623 /** 18624 * The base implementation of `_.clamp` which doesn't coerce arguments. 18625 * 18626 * @private 18627 * @param {number} number The number to clamp. 18628 * @param {number} [lower] The lower bound. 18629 * @param {number} upper The upper bound. 18630 * @returns {number} Returns the clamped number. 18631 */ 18632 function baseClamp(number, lower, upper) { 18633 if (number === number) { 18634 if (upper !== undefined) { 18635 number = number <= upper ? number : upper; 18636 } 18637 if (lower !== undefined) { 18638 number = number >= lower ? number : lower; 18639 } 18640 } 18641 return number; 18642 } 18643 18644 /** 18645 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 18646 * traversed objects. 18647 * 18648 * @private 18649 * @param {*} value The value to clone. 18650 * @param {boolean} bitmask The bitmask flags. 18651 * 1 - Deep clone 18652 * 2 - Flatten inherited properties 18653 * 4 - Clone symbols 18654 * @param {Function} [customizer] The function to customize cloning. 18655 * @param {string} [key] The key of `value`. 18656 * @param {Object} [object] The parent object of `value`. 18657 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 18658 * @returns {*} Returns the cloned value. 18659 */ 18660 function baseClone(value, bitmask, customizer, key, object, stack) { 18661 var result, 18662 isDeep = bitmask & CLONE_DEEP_FLAG, 18663 isFlat = bitmask & CLONE_FLAT_FLAG, 18664 isFull = bitmask & CLONE_SYMBOLS_FLAG; 18665 18666 if (customizer) { 18667 result = object ? customizer(value, key, object, stack) : customizer(value); 18668 } 18669 if (result !== undefined) { 18670 return result; 18671 } 18672 if (!isObject(value)) { 18673 return value; 18674 } 18675 var isArr = isArray(value); 18676 if (isArr) { 18677 result = initCloneArray(value); 18678 if (!isDeep) { 18679 return copyArray(value, result); 18680 } 18681 } else { 18682 var tag = getTag(value), 18683 isFunc = tag == funcTag || tag == genTag; 18684 18685 if (isBuffer(value)) { 18686 return cloneBuffer(value, isDeep); 18687 } 18688 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 18689 result = (isFlat || isFunc) ? {} : initCloneObject(value); 18690 if (!isDeep) { 18691 return isFlat 18692 ? copySymbolsIn(value, baseAssignIn(result, value)) 18693 : copySymbols(value, baseAssign(result, value)); 18694 } 18695 } else { 18696 if (!cloneableTags[tag]) { 18697 return object ? value : {}; 18698 } 18699 result = initCloneByTag(value, tag, isDeep); 18700 } 18701 } 18702 // Check for circular references and return its corresponding clone. 18703 stack || (stack = new Stack); 18704 var stacked = stack.get(value); 18705 if (stacked) { 18706 return stacked; 18707 } 18708 stack.set(value, result); 18709 18710 if (isSet(value)) { 18711 value.forEach(function(subValue) { 18712 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 18713 }); 18714 } else if (isMap(value)) { 18715 value.forEach(function(subValue, key) { 18716 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 18717 }); 18718 } 18719 18720 var keysFunc = isFull 18721 ? (isFlat ? getAllKeysIn : getAllKeys) 18722 : (isFlat ? keysIn : keys); 18723 18724 var props = isArr ? undefined : keysFunc(value); 18725 arrayEach(props || value, function(subValue, key) { 18726 if (props) { 18727 key = subValue; 18728 subValue = value[key]; 18729 } 18730 // Recursively populate clone (susceptible to call stack limits). 18731 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 18732 }); 18733 return result; 18734 } 18735 18736 /** 18737 * The base implementation of `_.conforms` which doesn't clone `source`. 18738 * 18739 * @private 18740 * @param {Object} source The object of property predicates to conform to. 18741 * @returns {Function} Returns the new spec function. 18742 */ 18743 function baseConforms(source) { 18744 var props = keys(source); 18745 return function(object) { 18746 return baseConformsTo(object, source, props); 18747 }; 18748 } 18749 18750 /** 18751 * The base implementation of `_.conformsTo` which accepts `props` to check. 18752 * 18753 * @private 18754 * @param {Object} object The object to inspect. 18755 * @param {Object} source The object of property predicates to conform to. 18756 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 18757 */ 18758 function baseConformsTo(object, source, props) { 18759 var length = props.length; 18760 if (object == null) { 18761 return !length; 18762 } 18763 object = Object(object); 18764 while (length--) { 18765 var key = props[length], 18766 predicate = source[key], 18767 value = object[key]; 18768 18769 if ((value === undefined && !(key in object)) || !predicate(value)) { 18770 return false; 18771 } 18772 } 18773 return true; 18774 } 18775 18776 /** 18777 * The base implementation of `_.delay` and `_.defer` which accepts `args` 18778 * to provide to `func`. 18779 * 18780 * @private 18781 * @param {Function} func The function to delay. 18782 * @param {number} wait The number of milliseconds to delay invocation. 18783 * @param {Array} args The arguments to provide to `func`. 18784 * @returns {number|Object} Returns the timer id or timeout object. 18785 */ 18786 function baseDelay(func, wait, args) { 18787 if (typeof func != 'function') { 18788 throw new TypeError(FUNC_ERROR_TEXT); 18789 } 18790 return setTimeout(function() { func.apply(undefined, args); }, wait); 18791 } 18792 18793 /** 18794 * The base implementation of methods like `_.difference` without support 18795 * for excluding multiple arrays or iteratee shorthands. 18796 * 18797 * @private 18798 * @param {Array} array The array to inspect. 18799 * @param {Array} values The values to exclude. 18800 * @param {Function} [iteratee] The iteratee invoked per element. 18801 * @param {Function} [comparator] The comparator invoked per element. 18802 * @returns {Array} Returns the new array of filtered values. 18803 */ 18804 function baseDifference(array, values, iteratee, comparator) { 18805 var index = -1, 18806 includes = arrayIncludes, 18807 isCommon = true, 18808 length = array.length, 18809 result = [], 18810 valuesLength = values.length; 18811 18812 if (!length) { 18813 return result; 18814 } 18815 if (iteratee) { 18816 values = arrayMap(values, baseUnary(iteratee)); 18817 } 18818 if (comparator) { 18819 includes = arrayIncludesWith; 18820 isCommon = false; 18821 } 18822 else if (values.length >= LARGE_ARRAY_SIZE) { 18823 includes = cacheHas; 18824 isCommon = false; 18825 values = new SetCache(values); 18826 } 18827 outer: 18828 while (++index < length) { 18829 var value = array[index], 18830 computed = iteratee == null ? value : iteratee(value); 18831 18832 value = (comparator || value !== 0) ? value : 0; 18833 if (isCommon && computed === computed) { 18834 var valuesIndex = valuesLength; 18835 while (valuesIndex--) { 18836 if (values[valuesIndex] === computed) { 18837 continue outer; 18838 } 18839 } 18840 result.push(value); 18841 } 18842 else if (!includes(values, computed, comparator)) { 18843 result.push(value); 18844 } 18845 } 18846 return result; 18847 } 18848 18849 /** 18850 * The base implementation of `_.forEach` without support for iteratee shorthands. 18851 * 18852 * @private 18853 * @param {Array|Object} collection The collection to iterate over. 18854 * @param {Function} iteratee The function invoked per iteration. 18855 * @returns {Array|Object} Returns `collection`. 18856 */ 18857 var baseEach = createBaseEach(baseForOwn); 18858 18859 /** 18860 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 18861 * 18862 * @private 18863 * @param {Array|Object} collection The collection to iterate over. 18864 * @param {Function} iteratee The function invoked per iteration. 18865 * @returns {Array|Object} Returns `collection`. 18866 */ 18867 var baseEachRight = createBaseEach(baseForOwnRight, true); 18868 18869 /** 18870 * The base implementation of `_.every` without support for iteratee shorthands. 18871 * 18872 * @private 18873 * @param {Array|Object} collection The collection to iterate over. 18874 * @param {Function} predicate The function invoked per iteration. 18875 * @returns {boolean} Returns `true` if all elements pass the predicate check, 18876 * else `false` 18877 */ 18878 function baseEvery(collection, predicate) { 18879 var result = true; 18880 baseEach(collection, function(value, index, collection) { 18881 result = !!predicate(value, index, collection); 18882 return result; 18883 }); 18884 return result; 18885 } 18886 18887 /** 18888 * The base implementation of methods like `_.max` and `_.min` which accepts a 18889 * `comparator` to determine the extremum value. 18890 * 18891 * @private 18892 * @param {Array} array The array to iterate over. 18893 * @param {Function} iteratee The iteratee invoked per iteration. 18894 * @param {Function} comparator The comparator used to compare values. 18895 * @returns {*} Returns the extremum value. 18896 */ 18897 function baseExtremum(array, iteratee, comparator) { 18898 var index = -1, 18899 length = array.length; 18900 18901 while (++index < length) { 18902 var value = array[index], 18903 current = iteratee(value); 18904 18905 if (current != null && (computed === undefined 18906 ? (current === current && !isSymbol(current)) 18907 : comparator(current, computed) 18908 )) { 18909 var computed = current, 18910 result = value; 18911 } 18912 } 18913 return result; 18914 } 18915 18916 /** 18917 * The base implementation of `_.fill` without an iteratee call guard. 18918 * 18919 * @private 18920 * @param {Array} array The array to fill. 18921 * @param {*} value The value to fill `array` with. 18922 * @param {number} [start=0] The start position. 18923 * @param {number} [end=array.length] The end position. 18924 * @returns {Array} Returns `array`. 18925 */ 18926 function baseFill(array, value, start, end) { 18927 var length = array.length; 18928 18929 start = toInteger(start); 18930 if (start < 0) { 18931 start = -start > length ? 0 : (length + start); 18932 } 18933 end = (end === undefined || end > length) ? length : toInteger(end); 18934 if (end < 0) { 18935 end += length; 18936 } 18937 end = start > end ? 0 : toLength(end); 18938 while (start < end) { 18939 array[start++] = value; 18940 } 18941 return array; 18942 } 18943 18944 /** 18945 * The base implementation of `_.filter` without support for iteratee shorthands. 18946 * 18947 * @private 18948 * @param {Array|Object} collection The collection to iterate over. 18949 * @param {Function} predicate The function invoked per iteration. 18950 * @returns {Array} Returns the new filtered array. 18951 */ 18952 function baseFilter(collection, predicate) { 18953 var result = []; 18954 baseEach(collection, function(value, index, collection) { 18955 if (predicate(value, index, collection)) { 18956 result.push(value); 18957 } 18958 }); 18959 return result; 18960 } 18961 18962 /** 18963 * The base implementation of `_.flatten` with support for restricting flattening. 18964 * 18965 * @private 18966 * @param {Array} array The array to flatten. 18967 * @param {number} depth The maximum recursion depth. 18968 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 18969 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 18970 * @param {Array} [result=[]] The initial result value. 18971 * @returns {Array} Returns the new flattened array. 18972 */ 18973 function baseFlatten(array, depth, predicate, isStrict, result) { 18974 var index = -1, 18975 length = array.length; 18976 18977 predicate || (predicate = isFlattenable); 18978 result || (result = []); 18979 18980 while (++index < length) { 18981 var value = array[index]; 18982 if (depth > 0 && predicate(value)) { 18983 if (depth > 1) { 18984 // Recursively flatten arrays (susceptible to call stack limits). 18985 baseFlatten(value, depth - 1, predicate, isStrict, result); 18986 } else { 18987 arrayPush(result, value); 18988 } 18989 } else if (!isStrict) { 18990 result[result.length] = value; 18991 } 18992 } 18993 return result; 18994 } 18995 18996 /** 18997 * The base implementation of `baseForOwn` which iterates over `object` 18998 * properties returned by `keysFunc` and invokes `iteratee` for each property. 18999 * Iteratee functions may exit iteration early by explicitly returning `false`. 19000 * 19001 * @private 19002 * @param {Object} object The object to iterate over. 19003 * @param {Function} iteratee The function invoked per iteration. 19004 * @param {Function} keysFunc The function to get the keys of `object`. 19005 * @returns {Object} Returns `object`. 19006 */ 19007 var baseFor = createBaseFor(); 19008 19009 /** 19010 * This function is like `baseFor` except that it iterates over properties 19011 * in the opposite order. 19012 * 19013 * @private 19014 * @param {Object} object The object to iterate over. 19015 * @param {Function} iteratee The function invoked per iteration. 19016 * @param {Function} keysFunc The function to get the keys of `object`. 19017 * @returns {Object} Returns `object`. 19018 */ 19019 var baseForRight = createBaseFor(true); 19020 19021 /** 19022 * The base implementation of `_.forOwn` without support for iteratee shorthands. 19023 * 19024 * @private 19025 * @param {Object} object The object to iterate over. 19026 * @param {Function} iteratee The function invoked per iteration. 19027 * @returns {Object} Returns `object`. 19028 */ 19029 function baseForOwn(object, iteratee) { 19030 return object && baseFor(object, iteratee, keys); 19031 } 19032 19033 /** 19034 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 19035 * 19036 * @private 19037 * @param {Object} object The object to iterate over. 19038 * @param {Function} iteratee The function invoked per iteration. 19039 * @returns {Object} Returns `object`. 19040 */ 19041 function baseForOwnRight(object, iteratee) { 19042 return object && baseForRight(object, iteratee, keys); 19043 } 19044 19045 /** 19046 * The base implementation of `_.functions` which creates an array of 19047 * `object` function property names filtered from `props`. 19048 * 19049 * @private 19050 * @param {Object} object The object to inspect. 19051 * @param {Array} props The property names to filter. 19052 * @returns {Array} Returns the function names. 19053 */ 19054 function baseFunctions(object, props) { 19055 return arrayFilter(props, function(key) { 19056 return isFunction(object[key]); 19057 }); 19058 } 19059 19060 /** 19061 * The base implementation of `_.get` without support for default values. 19062 * 19063 * @private 19064 * @param {Object} object The object to query. 19065 * @param {Array|string} path The path of the property to get. 19066 * @returns {*} Returns the resolved value. 19067 */ 19068 function baseGet(object, path) { 19069 path = castPath(path, object); 19070 19071 var index = 0, 19072 length = path.length; 19073 19074 while (object != null && index < length) { 19075 object = object[toKey(path[index++])]; 19076 } 19077 return (index && index == length) ? object : undefined; 19078 } 19079 19080 /** 19081 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 19082 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 19083 * symbols of `object`. 19084 * 19085 * @private 19086 * @param {Object} object The object to query. 19087 * @param {Function} keysFunc The function to get the keys of `object`. 19088 * @param {Function} symbolsFunc The function to get the symbols of `object`. 19089 * @returns {Array} Returns the array of property names and symbols. 19090 */ 19091 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 19092 var result = keysFunc(object); 19093 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 19094 } 19095 19096 /** 19097 * The base implementation of `getTag` without fallbacks for buggy environments. 19098 * 19099 * @private 19100 * @param {*} value The value to query. 19101 * @returns {string} Returns the `toStringTag`. 19102 */ 19103 function baseGetTag(value) { 19104 if (value == null) { 19105 return value === undefined ? undefinedTag : nullTag; 19106 } 19107 return (symToStringTag && symToStringTag in Object(value)) 19108 ? getRawTag(value) 19109 : objectToString(value); 19110 } 19111 19112 /** 19113 * The base implementation of `_.gt` which doesn't coerce arguments. 19114 * 19115 * @private 19116 * @param {*} value The value to compare. 19117 * @param {*} other The other value to compare. 19118 * @returns {boolean} Returns `true` if `value` is greater than `other`, 19119 * else `false`. 19120 */ 19121 function baseGt(value, other) { 19122 return value > other; 19123 } 19124 19125 /** 19126 * The base implementation of `_.has` without support for deep paths. 19127 * 19128 * @private 19129 * @param {Object} [object] The object to query. 19130 * @param {Array|string} key The key to check. 19131 * @returns {boolean} Returns `true` if `key` exists, else `false`. 19132 */ 19133 function baseHas(object, key) { 19134 return object != null && hasOwnProperty.call(object, key); 19135 } 19136 19137 /** 19138 * The base implementation of `_.hasIn` without support for deep paths. 19139 * 19140 * @private 19141 * @param {Object} [object] The object to query. 19142 * @param {Array|string} key The key to check. 19143 * @returns {boolean} Returns `true` if `key` exists, else `false`. 19144 */ 19145 function baseHasIn(object, key) { 19146 return object != null && key in Object(object); 19147 } 19148 19149 /** 19150 * The base implementation of `_.inRange` which doesn't coerce arguments. 19151 * 19152 * @private 19153 * @param {number} number The number to check. 19154 * @param {number} start The start of the range. 19155 * @param {number} end The end of the range. 19156 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 19157 */ 19158 function baseInRange(number, start, end) { 19159 return number >= nativeMin(start, end) && number < nativeMax(start, end); 19160 } 19161 19162 /** 19163 * The base implementation of methods like `_.intersection`, without support 19164 * for iteratee shorthands, that accepts an array of arrays to inspect. 19165 * 19166 * @private 19167 * @param {Array} arrays The arrays to inspect. 19168 * @param {Function} [iteratee] The iteratee invoked per element. 19169 * @param {Function} [comparator] The comparator invoked per element. 19170 * @returns {Array} Returns the new array of shared values. 19171 */ 19172 function baseIntersection(arrays, iteratee, comparator) { 19173 var includes = comparator ? arrayIncludesWith : arrayIncludes, 19174 length = arrays[0].length, 19175 othLength = arrays.length, 19176 othIndex = othLength, 19177 caches = Array(othLength), 19178 maxLength = Infinity, 19179 result = []; 19180 19181 while (othIndex--) { 19182 var array = arrays[othIndex]; 19183 if (othIndex && iteratee) { 19184 array = arrayMap(array, baseUnary(iteratee)); 19185 } 19186 maxLength = nativeMin(array.length, maxLength); 19187 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) 19188 ? new SetCache(othIndex && array) 19189 : undefined; 19190 } 19191 array = arrays[0]; 19192 19193 var index = -1, 19194 seen = caches[0]; 19195 19196 outer: 19197 while (++index < length && result.length < maxLength) { 19198 var value = array[index], 19199 computed = iteratee ? iteratee(value) : value; 19200 19201 value = (comparator || value !== 0) ? value : 0; 19202 if (!(seen 19203 ? cacheHas(seen, computed) 19204 : includes(result, computed, comparator) 19205 )) { 19206 othIndex = othLength; 19207 while (--othIndex) { 19208 var cache = caches[othIndex]; 19209 if (!(cache 19210 ? cacheHas(cache, computed) 19211 : includes(arrays[othIndex], computed, comparator)) 19212 ) { 19213 continue outer; 19214 } 19215 } 19216 if (seen) { 19217 seen.push(computed); 19218 } 19219 result.push(value); 19220 } 19221 } 19222 return result; 19223 } 19224 19225 /** 19226 * The base implementation of `_.invert` and `_.invertBy` which inverts 19227 * `object` with values transformed by `iteratee` and set by `setter`. 19228 * 19229 * @private 19230 * @param {Object} object The object to iterate over. 19231 * @param {Function} setter The function to set `accumulator` values. 19232 * @param {Function} iteratee The iteratee to transform values. 19233 * @param {Object} accumulator The initial inverted object. 19234 * @returns {Function} Returns `accumulator`. 19235 */ 19236 function baseInverter(object, setter, iteratee, accumulator) { 19237 baseForOwn(object, function(value, key, object) { 19238 setter(accumulator, iteratee(value), key, object); 19239 }); 19240 return accumulator; 19241 } 19242 19243 /** 19244 * The base implementation of `_.invoke` without support for individual 19245 * method arguments. 19246 * 19247 * @private 19248 * @param {Object} object The object to query. 19249 * @param {Array|string} path The path of the method to invoke. 19250 * @param {Array} args The arguments to invoke the method with. 19251 * @returns {*} Returns the result of the invoked method. 19252 */ 19253 function baseInvoke(object, path, args) { 19254 path = castPath(path, object); 19255 object = parent(object, path); 19256 var func = object == null ? object : object[toKey(last(path))]; 19257 return func == null ? undefined : apply(func, object, args); 19258 } 19259 19260 /** 19261 * The base implementation of `_.isArguments`. 19262 * 19263 * @private 19264 * @param {*} value The value to check. 19265 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 19266 */ 19267 function baseIsArguments(value) { 19268 return isObjectLike(value) && baseGetTag(value) == argsTag; 19269 } 19270 19271 /** 19272 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 19273 * 19274 * @private 19275 * @param {*} value The value to check. 19276 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 19277 */ 19278 function baseIsArrayBuffer(value) { 19279 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 19280 } 19281 19282 /** 19283 * The base implementation of `_.isDate` without Node.js optimizations. 19284 * 19285 * @private 19286 * @param {*} value The value to check. 19287 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 19288 */ 19289 function baseIsDate(value) { 19290 return isObjectLike(value) && baseGetTag(value) == dateTag; 19291 } 19292 19293 /** 19294 * The base implementation of `_.isEqual` which supports partial comparisons 19295 * and tracks traversed objects. 19296 * 19297 * @private 19298 * @param {*} value The value to compare. 19299 * @param {*} other The other value to compare. 19300 * @param {boolean} bitmask The bitmask flags. 19301 * 1 - Unordered comparison 19302 * 2 - Partial comparison 19303 * @param {Function} [customizer] The function to customize comparisons. 19304 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 19305 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 19306 */ 19307 function baseIsEqual(value, other, bitmask, customizer, stack) { 19308 if (value === other) { 19309 return true; 19310 } 19311 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 19312 return value !== value && other !== other; 19313 } 19314 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 19315 } 19316 19317 /** 19318 * A specialized version of `baseIsEqual` for arrays and objects which performs 19319 * deep comparisons and tracks traversed objects enabling objects with circular 19320 * references to be compared. 19321 * 19322 * @private 19323 * @param {Object} object The object to compare. 19324 * @param {Object} other The other object to compare. 19325 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 19326 * @param {Function} customizer The function to customize comparisons. 19327 * @param {Function} equalFunc The function to determine equivalents of values. 19328 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 19329 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 19330 */ 19331 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 19332 var objIsArr = isArray(object), 19333 othIsArr = isArray(other), 19334 objTag = objIsArr ? arrayTag : getTag(object), 19335 othTag = othIsArr ? arrayTag : getTag(other); 19336 19337 objTag = objTag == argsTag ? objectTag : objTag; 19338 othTag = othTag == argsTag ? objectTag : othTag; 19339 19340 var objIsObj = objTag == objectTag, 19341 othIsObj = othTag == objectTag, 19342 isSameTag = objTag == othTag; 19343 19344 if (isSameTag && isBuffer(object)) { 19345 if (!isBuffer(other)) { 19346 return false; 19347 } 19348 objIsArr = true; 19349 objIsObj = false; 19350 } 19351 if (isSameTag && !objIsObj) { 19352 stack || (stack = new Stack); 19353 return (objIsArr || isTypedArray(object)) 19354 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 19355 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 19356 } 19357 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 19358 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 19359 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 19360 19361 if (objIsWrapped || othIsWrapped) { 19362 var objUnwrapped = objIsWrapped ? object.value() : object, 19363 othUnwrapped = othIsWrapped ? other.value() : other; 19364 19365 stack || (stack = new Stack); 19366 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 19367 } 19368 } 19369 if (!isSameTag) { 19370 return false; 19371 } 19372 stack || (stack = new Stack); 19373 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 19374 } 19375 19376 /** 19377 * The base implementation of `_.isMap` without Node.js optimizations. 19378 * 19379 * @private 19380 * @param {*} value The value to check. 19381 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 19382 */ 19383 function baseIsMap(value) { 19384 return isObjectLike(value) && getTag(value) == mapTag; 19385 } 19386 19387 /** 19388 * The base implementation of `_.isMatch` without support for iteratee shorthands. 19389 * 19390 * @private 19391 * @param {Object} object The object to inspect. 19392 * @param {Object} source The object of property values to match. 19393 * @param {Array} matchData The property names, values, and compare flags to match. 19394 * @param {Function} [customizer] The function to customize comparisons. 19395 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 19396 */ 19397 function baseIsMatch(object, source, matchData, customizer) { 19398 var index = matchData.length, 19399 length = index, 19400 noCustomizer = !customizer; 19401 19402 if (object == null) { 19403 return !length; 19404 } 19405 object = Object(object); 19406 while (index--) { 19407 var data = matchData[index]; 19408 if ((noCustomizer && data[2]) 19409 ? data[1] !== object[data[0]] 19410 : !(data[0] in object) 19411 ) { 19412 return false; 19413 } 19414 } 19415 while (++index < length) { 19416 data = matchData[index]; 19417 var key = data[0], 19418 objValue = object[key], 19419 srcValue = data[1]; 19420 19421 if (noCustomizer && data[2]) { 19422 if (objValue === undefined && !(key in object)) { 19423 return false; 19424 } 19425 } else { 19426 var stack = new Stack; 19427 if (customizer) { 19428 var result = customizer(objValue, srcValue, key, object, source, stack); 19429 } 19430 if (!(result === undefined 19431 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) 19432 : result 19433 )) { 19434 return false; 19435 } 19436 } 19437 } 19438 return true; 19439 } 19440 19441 /** 19442 * The base implementation of `_.isNative` without bad shim checks. 19443 * 19444 * @private 19445 * @param {*} value The value to check. 19446 * @returns {boolean} Returns `true` if `value` is a native function, 19447 * else `false`. 19448 */ 19449 function baseIsNative(value) { 19450 if (!isObject(value) || isMasked(value)) { 19451 return false; 19452 } 19453 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 19454 return pattern.test(toSource(value)); 19455 } 19456 19457 /** 19458 * The base implementation of `_.isRegExp` without Node.js optimizations. 19459 * 19460 * @private 19461 * @param {*} value The value to check. 19462 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 19463 */ 19464 function baseIsRegExp(value) { 19465 return isObjectLike(value) && baseGetTag(value) == regexpTag; 19466 } 19467 19468 /** 19469 * The base implementation of `_.isSet` without Node.js optimizations. 19470 * 19471 * @private 19472 * @param {*} value The value to check. 19473 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 19474 */ 19475 function baseIsSet(value) { 19476 return isObjectLike(value) && getTag(value) == setTag; 19477 } 19478 19479 /** 19480 * The base implementation of `_.isTypedArray` without Node.js optimizations. 19481 * 19482 * @private 19483 * @param {*} value The value to check. 19484 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 19485 */ 19486 function baseIsTypedArray(value) { 19487 return isObjectLike(value) && 19488 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 19489 } 19490 19491 /** 19492 * The base implementation of `_.iteratee`. 19493 * 19494 * @private 19495 * @param {*} [value=_.identity] The value to convert to an iteratee. 19496 * @returns {Function} Returns the iteratee. 19497 */ 19498 function baseIteratee(value) { 19499 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 19500 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 19501 if (typeof value == 'function') { 19502 return value; 19503 } 19504 if (value == null) { 19505 return identity; 19506 } 19507 if (typeof value == 'object') { 19508 return isArray(value) 19509 ? baseMatchesProperty(value[0], value[1]) 19510 : baseMatches(value); 19511 } 19512 return property(value); 19513 } 19514 19515 /** 19516 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 19517 * 19518 * @private 19519 * @param {Object} object The object to query. 19520 * @returns {Array} Returns the array of property names. 19521 */ 19522 function baseKeys(object) { 19523 if (!isPrototype(object)) { 19524 return nativeKeys(object); 19525 } 19526 var result = []; 19527 for (var key in Object(object)) { 19528 if (hasOwnProperty.call(object, key) && key != 'constructor') { 19529 result.push(key); 19530 } 19531 } 19532 return result; 19533 } 19534 19535 /** 19536 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 19537 * 19538 * @private 19539 * @param {Object} object The object to query. 19540 * @returns {Array} Returns the array of property names. 19541 */ 19542 function baseKeysIn(object) { 19543 if (!isObject(object)) { 19544 return nativeKeysIn(object); 19545 } 19546 var isProto = isPrototype(object), 19547 result = []; 19548 19549 for (var key in object) { 19550 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 19551 result.push(key); 19552 } 19553 } 19554 return result; 19555 } 19556 19557 /** 19558 * The base implementation of `_.lt` which doesn't coerce arguments. 19559 * 19560 * @private 19561 * @param {*} value The value to compare. 19562 * @param {*} other The other value to compare. 19563 * @returns {boolean} Returns `true` if `value` is less than `other`, 19564 * else `false`. 19565 */ 19566 function baseLt(value, other) { 19567 return value < other; 19568 } 19569 19570 /** 19571 * The base implementation of `_.map` without support for iteratee shorthands. 19572 * 19573 * @private 19574 * @param {Array|Object} collection The collection to iterate over. 19575 * @param {Function} iteratee The function invoked per iteration. 19576 * @returns {Array} Returns the new mapped array. 19577 */ 19578 function baseMap(collection, iteratee) { 19579 var index = -1, 19580 result = isArrayLike(collection) ? Array(collection.length) : []; 19581 19582 baseEach(collection, function(value, key, collection) { 19583 result[++index] = iteratee(value, key, collection); 19584 }); 19585 return result; 19586 } 19587 19588 /** 19589 * The base implementation of `_.matches` which doesn't clone `source`. 19590 * 19591 * @private 19592 * @param {Object} source The object of property values to match. 19593 * @returns {Function} Returns the new spec function. 19594 */ 19595 function baseMatches(source) { 19596 var matchData = getMatchData(source); 19597 if (matchData.length == 1 && matchData[0][2]) { 19598 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 19599 } 19600 return function(object) { 19601 return object === source || baseIsMatch(object, source, matchData); 19602 }; 19603 } 19604 19605 /** 19606 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 19607 * 19608 * @private 19609 * @param {string} path The path of the property to get. 19610 * @param {*} srcValue The value to match. 19611 * @returns {Function} Returns the new spec function. 19612 */ 19613 function baseMatchesProperty(path, srcValue) { 19614 if (isKey(path) && isStrictComparable(srcValue)) { 19615 return matchesStrictComparable(toKey(path), srcValue); 19616 } 19617 return function(object) { 19618 var objValue = get(object, path); 19619 return (objValue === undefined && objValue === srcValue) 19620 ? hasIn(object, path) 19621 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 19622 }; 19623 } 19624 19625 /** 19626 * The base implementation of `_.merge` without support for multiple sources. 19627 * 19628 * @private 19629 * @param {Object} object The destination object. 19630 * @param {Object} source The source object. 19631 * @param {number} srcIndex The index of `source`. 19632 * @param {Function} [customizer] The function to customize merged values. 19633 * @param {Object} [stack] Tracks traversed source values and their merged 19634 * counterparts. 19635 */ 19636 function baseMerge(object, source, srcIndex, customizer, stack) { 19637 if (object === source) { 19638 return; 19639 } 19640 baseFor(source, function(srcValue, key) { 19641 stack || (stack = new Stack); 19642 if (isObject(srcValue)) { 19643 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 19644 } 19645 else { 19646 var newValue = customizer 19647 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) 19648 : undefined; 19649 19650 if (newValue === undefined) { 19651 newValue = srcValue; 19652 } 19653 assignMergeValue(object, key, newValue); 19654 } 19655 }, keysIn); 19656 } 19657 19658 /** 19659 * A specialized version of `baseMerge` for arrays and objects which performs 19660 * deep merges and tracks traversed objects enabling objects with circular 19661 * references to be merged. 19662 * 19663 * @private 19664 * @param {Object} object The destination object. 19665 * @param {Object} source The source object. 19666 * @param {string} key The key of the value to merge. 19667 * @param {number} srcIndex The index of `source`. 19668 * @param {Function} mergeFunc The function to merge values. 19669 * @param {Function} [customizer] The function to customize assigned values. 19670 * @param {Object} [stack] Tracks traversed source values and their merged 19671 * counterparts. 19672 */ 19673 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 19674 var objValue = safeGet(object, key), 19675 srcValue = safeGet(source, key), 19676 stacked = stack.get(srcValue); 19677 19678 if (stacked) { 19679 assignMergeValue(object, key, stacked); 19680 return; 19681 } 19682 var newValue = customizer 19683 ? customizer(objValue, srcValue, (key + ''), object, source, stack) 19684 : undefined; 19685 19686 var isCommon = newValue === undefined; 19687 19688 if (isCommon) { 19689 var isArr = isArray(srcValue), 19690 isBuff = !isArr && isBuffer(srcValue), 19691 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 19692 19693 newValue = srcValue; 19694 if (isArr || isBuff || isTyped) { 19695 if (isArray(objValue)) { 19696 newValue = objValue; 19697 } 19698 else if (isArrayLikeObject(objValue)) { 19699 newValue = copyArray(objValue); 19700 } 19701 else if (isBuff) { 19702 isCommon = false; 19703 newValue = cloneBuffer(srcValue, true); 19704 } 19705 else if (isTyped) { 19706 isCommon = false; 19707 newValue = cloneTypedArray(srcValue, true); 19708 } 19709 else { 19710 newValue = []; 19711 } 19712 } 19713 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 19714 newValue = objValue; 19715 if (isArguments(objValue)) { 19716 newValue = toPlainObject(objValue); 19717 } 19718 else if (!isObject(objValue) || isFunction(objValue)) { 19719 newValue = initCloneObject(srcValue); 19720 } 19721 } 19722 else { 19723 isCommon = false; 19724 } 19725 } 19726 if (isCommon) { 19727 // Recursively merge objects and arrays (susceptible to call stack limits). 19728 stack.set(srcValue, newValue); 19729 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 19730 stack['delete'](srcValue); 19731 } 19732 assignMergeValue(object, key, newValue); 19733 } 19734 19735 /** 19736 * The base implementation of `_.nth` which doesn't coerce arguments. 19737 * 19738 * @private 19739 * @param {Array} array The array to query. 19740 * @param {number} n The index of the element to return. 19741 * @returns {*} Returns the nth element of `array`. 19742 */ 19743 function baseNth(array, n) { 19744 var length = array.length; 19745 if (!length) { 19746 return; 19747 } 19748 n += n < 0 ? length : 0; 19749 return isIndex(n, length) ? array[n] : undefined; 19750 } 19751 19752 /** 19753 * The base implementation of `_.orderBy` without param guards. 19754 * 19755 * @private 19756 * @param {Array|Object} collection The collection to iterate over. 19757 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 19758 * @param {string[]} orders The sort orders of `iteratees`. 19759 * @returns {Array} Returns the new sorted array. 19760 */ 19761 function baseOrderBy(collection, iteratees, orders) { 19762 if (iteratees.length) { 19763 iteratees = arrayMap(iteratees, function(iteratee) { 19764 if (isArray(iteratee)) { 19765 return function(value) { 19766 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); 19767 } 19768 } 19769 return iteratee; 19770 }); 19771 } else { 19772 iteratees = [identity]; 19773 } 19774 19775 var index = -1; 19776 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 19777 19778 var result = baseMap(collection, function(value, key, collection) { 19779 var criteria = arrayMap(iteratees, function(iteratee) { 19780 return iteratee(value); 19781 }); 19782 return { 'criteria': criteria, 'index': ++index, 'value': value }; 19783 }); 19784 19785 return baseSortBy(result, function(object, other) { 19786 return compareMultiple(object, other, orders); 19787 }); 19788 } 19789 19790 /** 19791 * The base implementation of `_.pick` without support for individual 19792 * property identifiers. 19793 * 19794 * @private 19795 * @param {Object} object The source object. 19796 * @param {string[]} paths The property paths to pick. 19797 * @returns {Object} Returns the new object. 19798 */ 19799 function basePick(object, paths) { 19800 return basePickBy(object, paths, function(value, path) { 19801 return hasIn(object, path); 19802 }); 19803 } 19804 19805 /** 19806 * The base implementation of `_.pickBy` without support for iteratee shorthands. 19807 * 19808 * @private 19809 * @param {Object} object The source object. 19810 * @param {string[]} paths The property paths to pick. 19811 * @param {Function} predicate The function invoked per property. 19812 * @returns {Object} Returns the new object. 19813 */ 19814 function basePickBy(object, paths, predicate) { 19815 var index = -1, 19816 length = paths.length, 19817 result = {}; 19818 19819 while (++index < length) { 19820 var path = paths[index], 19821 value = baseGet(object, path); 19822 19823 if (predicate(value, path)) { 19824 baseSet(result, castPath(path, object), value); 19825 } 19826 } 19827 return result; 19828 } 19829 19830 /** 19831 * A specialized version of `baseProperty` which supports deep paths. 19832 * 19833 * @private 19834 * @param {Array|string} path The path of the property to get. 19835 * @returns {Function} Returns the new accessor function. 19836 */ 19837 function basePropertyDeep(path) { 19838 return function(object) { 19839 return baseGet(object, path); 19840 }; 19841 } 19842 19843 /** 19844 * The base implementation of `_.pullAllBy` without support for iteratee 19845 * shorthands. 19846 * 19847 * @private 19848 * @param {Array} array The array to modify. 19849 * @param {Array} values The values to remove. 19850 * @param {Function} [iteratee] The iteratee invoked per element. 19851 * @param {Function} [comparator] The comparator invoked per element. 19852 * @returns {Array} Returns `array`. 19853 */ 19854 function basePullAll(array, values, iteratee, comparator) { 19855 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 19856 index = -1, 19857 length = values.length, 19858 seen = array; 19859 19860 if (array === values) { 19861 values = copyArray(values); 19862 } 19863 if (iteratee) { 19864 seen = arrayMap(array, baseUnary(iteratee)); 19865 } 19866 while (++index < length) { 19867 var fromIndex = 0, 19868 value = values[index], 19869 computed = iteratee ? iteratee(value) : value; 19870 19871 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 19872 if (seen !== array) { 19873 splice.call(seen, fromIndex, 1); 19874 } 19875 splice.call(array, fromIndex, 1); 19876 } 19877 } 19878 return array; 19879 } 19880 19881 /** 19882 * The base implementation of `_.pullAt` without support for individual 19883 * indexes or capturing the removed elements. 19884 * 19885 * @private 19886 * @param {Array} array The array to modify. 19887 * @param {number[]} indexes The indexes of elements to remove. 19888 * @returns {Array} Returns `array`. 19889 */ 19890 function basePullAt(array, indexes) { 19891 var length = array ? indexes.length : 0, 19892 lastIndex = length - 1; 19893 19894 while (length--) { 19895 var index = indexes[length]; 19896 if (length == lastIndex || index !== previous) { 19897 var previous = index; 19898 if (isIndex(index)) { 19899 splice.call(array, index, 1); 19900 } else { 19901 baseUnset(array, index); 19902 } 19903 } 19904 } 19905 return array; 19906 } 19907 19908 /** 19909 * The base implementation of `_.random` without support for returning 19910 * floating-point numbers. 19911 * 19912 * @private 19913 * @param {number} lower The lower bound. 19914 * @param {number} upper The upper bound. 19915 * @returns {number} Returns the random number. 19916 */ 19917 function baseRandom(lower, upper) { 19918 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 19919 } 19920 19921 /** 19922 * The base implementation of `_.range` and `_.rangeRight` which doesn't 19923 * coerce arguments. 19924 * 19925 * @private 19926 * @param {number} start The start of the range. 19927 * @param {number} end The end of the range. 19928 * @param {number} step The value to increment or decrement by. 19929 * @param {boolean} [fromRight] Specify iterating from right to left. 19930 * @returns {Array} Returns the range of numbers. 19931 */ 19932 function baseRange(start, end, step, fromRight) { 19933 var index = -1, 19934 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), 19935 result = Array(length); 19936 19937 while (length--) { 19938 result[fromRight ? length : ++index] = start; 19939 start += step; 19940 } 19941 return result; 19942 } 19943 19944 /** 19945 * The base implementation of `_.repeat` which doesn't coerce arguments. 19946 * 19947 * @private 19948 * @param {string} string The string to repeat. 19949 * @param {number} n The number of times to repeat the string. 19950 * @returns {string} Returns the repeated string. 19951 */ 19952 function baseRepeat(string, n) { 19953 var result = ''; 19954 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 19955 return result; 19956 } 19957 // Leverage the exponentiation by squaring algorithm for a faster repeat. 19958 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 19959 do { 19960 if (n % 2) { 19961 result += string; 19962 } 19963 n = nativeFloor(n / 2); 19964 if (n) { 19965 string += string; 19966 } 19967 } while (n); 19968 19969 return result; 19970 } 19971 19972 /** 19973 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 19974 * 19975 * @private 19976 * @param {Function} func The function to apply a rest parameter to. 19977 * @param {number} [start=func.length-1] The start position of the rest parameter. 19978 * @returns {Function} Returns the new function. 19979 */ 19980 function baseRest(func, start) { 19981 return setToString(overRest(func, start, identity), func + ''); 19982 } 19983 19984 /** 19985 * The base implementation of `_.sample`. 19986 * 19987 * @private 19988 * @param {Array|Object} collection The collection to sample. 19989 * @returns {*} Returns the random element. 19990 */ 19991 function baseSample(collection) { 19992 return arraySample(values(collection)); 19993 } 19994 19995 /** 19996 * The base implementation of `_.sampleSize` without param guards. 19997 * 19998 * @private 19999 * @param {Array|Object} collection The collection to sample. 20000 * @param {number} n The number of elements to sample. 20001 * @returns {Array} Returns the random elements. 20002 */ 20003 function baseSampleSize(collection, n) { 20004 var array = values(collection); 20005 return shuffleSelf(array, baseClamp(n, 0, array.length)); 20006 } 20007 20008 /** 20009 * The base implementation of `_.set`. 20010 * 20011 * @private 20012 * @param {Object} object The object to modify. 20013 * @param {Array|string} path The path of the property to set. 20014 * @param {*} value The value to set. 20015 * @param {Function} [customizer] The function to customize path creation. 20016 * @returns {Object} Returns `object`. 20017 */ 20018 function baseSet(object, path, value, customizer) { 20019 if (!isObject(object)) { 20020 return object; 20021 } 20022 path = castPath(path, object); 20023 20024 var index = -1, 20025 length = path.length, 20026 lastIndex = length - 1, 20027 nested = object; 20028 20029 while (nested != null && ++index < length) { 20030 var key = toKey(path[index]), 20031 newValue = value; 20032 20033 if (key === '__proto__' || key === 'constructor' || key === 'prototype') { 20034 return object; 20035 } 20036 20037 if (index != lastIndex) { 20038 var objValue = nested[key]; 20039 newValue = customizer ? customizer(objValue, key, nested) : undefined; 20040 if (newValue === undefined) { 20041 newValue = isObject(objValue) 20042 ? objValue 20043 : (isIndex(path[index + 1]) ? [] : {}); 20044 } 20045 } 20046 assignValue(nested, key, newValue); 20047 nested = nested[key]; 20048 } 20049 return object; 20050 } 20051 20052 /** 20053 * The base implementation of `setData` without support for hot loop shorting. 20054 * 20055 * @private 20056 * @param {Function} func The function to associate metadata with. 20057 * @param {*} data The metadata. 20058 * @returns {Function} Returns `func`. 20059 */ 20060 var baseSetData = !metaMap ? identity : function(func, data) { 20061 metaMap.set(func, data); 20062 return func; 20063 }; 20064 20065 /** 20066 * The base implementation of `setToString` without support for hot loop shorting. 20067 * 20068 * @private 20069 * @param {Function} func The function to modify. 20070 * @param {Function} string The `toString` result. 20071 * @returns {Function} Returns `func`. 20072 */ 20073 var baseSetToString = !defineProperty ? identity : function(func, string) { 20074 return defineProperty(func, 'toString', { 20075 'configurable': true, 20076 'enumerable': false, 20077 'value': constant(string), 20078 'writable': true 20079 }); 20080 }; 20081 20082 /** 20083 * The base implementation of `_.shuffle`. 20084 * 20085 * @private 20086 * @param {Array|Object} collection The collection to shuffle. 20087 * @returns {Array} Returns the new shuffled array. 20088 */ 20089 function baseShuffle(collection) { 20090 return shuffleSelf(values(collection)); 20091 } 20092 20093 /** 20094 * The base implementation of `_.slice` without an iteratee call guard. 20095 * 20096 * @private 20097 * @param {Array} array The array to slice. 20098 * @param {number} [start=0] The start position. 20099 * @param {number} [end=array.length] The end position. 20100 * @returns {Array} Returns the slice of `array`. 20101 */ 20102 function baseSlice(array, start, end) { 20103 var index = -1, 20104 length = array.length; 20105 20106 if (start < 0) { 20107 start = -start > length ? 0 : (length + start); 20108 } 20109 end = end > length ? length : end; 20110 if (end < 0) { 20111 end += length; 20112 } 20113 length = start > end ? 0 : ((end - start) >>> 0); 20114 start >>>= 0; 20115 20116 var result = Array(length); 20117 while (++index < length) { 20118 result[index] = array[index + start]; 20119 } 20120 return result; 20121 } 20122 20123 /** 20124 * The base implementation of `_.some` without support for iteratee shorthands. 20125 * 20126 * @private 20127 * @param {Array|Object} collection The collection to iterate over. 20128 * @param {Function} predicate The function invoked per iteration. 20129 * @returns {boolean} Returns `true` if any element passes the predicate check, 20130 * else `false`. 20131 */ 20132 function baseSome(collection, predicate) { 20133 var result; 20134 20135 baseEach(collection, function(value, index, collection) { 20136 result = predicate(value, index, collection); 20137 return !result; 20138 }); 20139 return !!result; 20140 } 20141 20142 /** 20143 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 20144 * performs a binary search of `array` to determine the index at which `value` 20145 * should be inserted into `array` in order to maintain its sort order. 20146 * 20147 * @private 20148 * @param {Array} array The sorted array to inspect. 20149 * @param {*} value The value to evaluate. 20150 * @param {boolean} [retHighest] Specify returning the highest qualified index. 20151 * @returns {number} Returns the index at which `value` should be inserted 20152 * into `array`. 20153 */ 20154 function baseSortedIndex(array, value, retHighest) { 20155 var low = 0, 20156 high = array == null ? low : array.length; 20157 20158 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 20159 while (low < high) { 20160 var mid = (low + high) >>> 1, 20161 computed = array[mid]; 20162 20163 if (computed !== null && !isSymbol(computed) && 20164 (retHighest ? (computed <= value) : (computed < value))) { 20165 low = mid + 1; 20166 } else { 20167 high = mid; 20168 } 20169 } 20170 return high; 20171 } 20172 return baseSortedIndexBy(array, value, identity, retHighest); 20173 } 20174 20175 /** 20176 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 20177 * which invokes `iteratee` for `value` and each element of `array` to compute 20178 * their sort ranking. The iteratee is invoked with one argument; (value). 20179 * 20180 * @private 20181 * @param {Array} array The sorted array to inspect. 20182 * @param {*} value The value to evaluate. 20183 * @param {Function} iteratee The iteratee invoked per element. 20184 * @param {boolean} [retHighest] Specify returning the highest qualified index. 20185 * @returns {number} Returns the index at which `value` should be inserted 20186 * into `array`. 20187 */ 20188 function baseSortedIndexBy(array, value, iteratee, retHighest) { 20189 var low = 0, 20190 high = array == null ? 0 : array.length; 20191 if (high === 0) { 20192 return 0; 20193 } 20194 20195 value = iteratee(value); 20196 var valIsNaN = value !== value, 20197 valIsNull = value === null, 20198 valIsSymbol = isSymbol(value), 20199 valIsUndefined = value === undefined; 20200 20201 while (low < high) { 20202 var mid = nativeFloor((low + high) / 2), 20203 computed = iteratee(array[mid]), 20204 othIsDefined = computed !== undefined, 20205 othIsNull = computed === null, 20206 othIsReflexive = computed === computed, 20207 othIsSymbol = isSymbol(computed); 20208 20209 if (valIsNaN) { 20210 var setLow = retHighest || othIsReflexive; 20211 } else if (valIsUndefined) { 20212 setLow = othIsReflexive && (retHighest || othIsDefined); 20213 } else if (valIsNull) { 20214 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 20215 } else if (valIsSymbol) { 20216 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 20217 } else if (othIsNull || othIsSymbol) { 20218 setLow = false; 20219 } else { 20220 setLow = retHighest ? (computed <= value) : (computed < value); 20221 } 20222 if (setLow) { 20223 low = mid + 1; 20224 } else { 20225 high = mid; 20226 } 20227 } 20228 return nativeMin(high, MAX_ARRAY_INDEX); 20229 } 20230 20231 /** 20232 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 20233 * support for iteratee shorthands. 20234 * 20235 * @private 20236 * @param {Array} array The array to inspect. 20237 * @param {Function} [iteratee] The iteratee invoked per element. 20238 * @returns {Array} Returns the new duplicate free array. 20239 */ 20240 function baseSortedUniq(array, iteratee) { 20241 var index = -1, 20242 length = array.length, 20243 resIndex = 0, 20244 result = []; 20245 20246 while (++index < length) { 20247 var value = array[index], 20248 computed = iteratee ? iteratee(value) : value; 20249 20250 if (!index || !eq(computed, seen)) { 20251 var seen = computed; 20252 result[resIndex++] = value === 0 ? 0 : value; 20253 } 20254 } 20255 return result; 20256 } 20257 20258 /** 20259 * The base implementation of `_.toNumber` which doesn't ensure correct 20260 * conversions of binary, hexadecimal, or octal string values. 20261 * 20262 * @private 20263 * @param {*} value The value to process. 20264 * @returns {number} Returns the number. 20265 */ 20266 function baseToNumber(value) { 20267 if (typeof value == 'number') { 20268 return value; 20269 } 20270 if (isSymbol(value)) { 20271 return NAN; 20272 } 20273 return +value; 20274 } 20275 20276 /** 20277 * The base implementation of `_.toString` which doesn't convert nullish 20278 * values to empty strings. 20279 * 20280 * @private 20281 * @param {*} value The value to process. 20282 * @returns {string} Returns the string. 20283 */ 20284 function baseToString(value) { 20285 // Exit early for strings to avoid a performance hit in some environments. 20286 if (typeof value == 'string') { 20287 return value; 20288 } 20289 if (isArray(value)) { 20290 // Recursively convert values (susceptible to call stack limits). 20291 return arrayMap(value, baseToString) + ''; 20292 } 20293 if (isSymbol(value)) { 20294 return symbolToString ? symbolToString.call(value) : ''; 20295 } 20296 var result = (value + ''); 20297 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 20298 } 20299 20300 /** 20301 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 20302 * 20303 * @private 20304 * @param {Array} array The array to inspect. 20305 * @param {Function} [iteratee] The iteratee invoked per element. 20306 * @param {Function} [comparator] The comparator invoked per element. 20307 * @returns {Array} Returns the new duplicate free array. 20308 */ 20309 function baseUniq(array, iteratee, comparator) { 20310 var index = -1, 20311 includes = arrayIncludes, 20312 length = array.length, 20313 isCommon = true, 20314 result = [], 20315 seen = result; 20316 20317 if (comparator) { 20318 isCommon = false; 20319 includes = arrayIncludesWith; 20320 } 20321 else if (length >= LARGE_ARRAY_SIZE) { 20322 var set = iteratee ? null : createSet(array); 20323 if (set) { 20324 return setToArray(set); 20325 } 20326 isCommon = false; 20327 includes = cacheHas; 20328 seen = new SetCache; 20329 } 20330 else { 20331 seen = iteratee ? [] : result; 20332 } 20333 outer: 20334 while (++index < length) { 20335 var value = array[index], 20336 computed = iteratee ? iteratee(value) : value; 20337 20338 value = (comparator || value !== 0) ? value : 0; 20339 if (isCommon && computed === computed) { 20340 var seenIndex = seen.length; 20341 while (seenIndex--) { 20342 if (seen[seenIndex] === computed) { 20343 continue outer; 20344 } 20345 } 20346 if (iteratee) { 20347 seen.push(computed); 20348 } 20349 result.push(value); 20350 } 20351 else if (!includes(seen, computed, comparator)) { 20352 if (seen !== result) { 20353 seen.push(computed); 20354 } 20355 result.push(value); 20356 } 20357 } 20358 return result; 20359 } 20360 20361 /** 20362 * The base implementation of `_.unset`. 20363 * 20364 * @private 20365 * @param {Object} object The object to modify. 20366 * @param {Array|string} path The property path to unset. 20367 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 20368 */ 20369 function baseUnset(object, path) { 20370 path = castPath(path, object); 20371 object = parent(object, path); 20372 return object == null || delete object[toKey(last(path))]; 20373 } 20374 20375 /** 20376 * The base implementation of `_.update`. 20377 * 20378 * @private 20379 * @param {Object} object The object to modify. 20380 * @param {Array|string} path The path of the property to update. 20381 * @param {Function} updater The function to produce the updated value. 20382 * @param {Function} [customizer] The function to customize path creation. 20383 * @returns {Object} Returns `object`. 20384 */ 20385 function baseUpdate(object, path, updater, customizer) { 20386 return baseSet(object, path, updater(baseGet(object, path)), customizer); 20387 } 20388 20389 /** 20390 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 20391 * without support for iteratee shorthands. 20392 * 20393 * @private 20394 * @param {Array} array The array to query. 20395 * @param {Function} predicate The function invoked per iteration. 20396 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 20397 * @param {boolean} [fromRight] Specify iterating from right to left. 20398 * @returns {Array} Returns the slice of `array`. 20399 */ 20400 function baseWhile(array, predicate, isDrop, fromRight) { 20401 var length = array.length, 20402 index = fromRight ? length : -1; 20403 20404 while ((fromRight ? index-- : ++index < length) && 20405 predicate(array[index], index, array)) {} 20406 20407 return isDrop 20408 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) 20409 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); 20410 } 20411 20412 /** 20413 * The base implementation of `wrapperValue` which returns the result of 20414 * performing a sequence of actions on the unwrapped `value`, where each 20415 * successive action is supplied the return value of the previous. 20416 * 20417 * @private 20418 * @param {*} value The unwrapped value. 20419 * @param {Array} actions Actions to perform to resolve the unwrapped value. 20420 * @returns {*} Returns the resolved value. 20421 */ 20422 function baseWrapperValue(value, actions) { 20423 var result = value; 20424 if (result instanceof LazyWrapper) { 20425 result = result.value(); 20426 } 20427 return arrayReduce(actions, function(result, action) { 20428 return action.func.apply(action.thisArg, arrayPush([result], action.args)); 20429 }, result); 20430 } 20431 20432 /** 20433 * The base implementation of methods like `_.xor`, without support for 20434 * iteratee shorthands, that accepts an array of arrays to inspect. 20435 * 20436 * @private 20437 * @param {Array} arrays The arrays to inspect. 20438 * @param {Function} [iteratee] The iteratee invoked per element. 20439 * @param {Function} [comparator] The comparator invoked per element. 20440 * @returns {Array} Returns the new array of values. 20441 */ 20442 function baseXor(arrays, iteratee, comparator) { 20443 var length = arrays.length; 20444 if (length < 2) { 20445 return length ? baseUniq(arrays[0]) : []; 20446 } 20447 var index = -1, 20448 result = Array(length); 20449 20450 while (++index < length) { 20451 var array = arrays[index], 20452 othIndex = -1; 20453 20454 while (++othIndex < length) { 20455 if (othIndex != index) { 20456 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); 20457 } 20458 } 20459 } 20460 return baseUniq(baseFlatten(result, 1), iteratee, comparator); 20461 } 20462 20463 /** 20464 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 20465 * 20466 * @private 20467 * @param {Array} props The property identifiers. 20468 * @param {Array} values The property values. 20469 * @param {Function} assignFunc The function to assign values. 20470 * @returns {Object} Returns the new object. 20471 */ 20472 function baseZipObject(props, values, assignFunc) { 20473 var index = -1, 20474 length = props.length, 20475 valsLength = values.length, 20476 result = {}; 20477 20478 while (++index < length) { 20479 var value = index < valsLength ? values[index] : undefined; 20480 assignFunc(result, props[index], value); 20481 } 20482 return result; 20483 } 20484 20485 /** 20486 * Casts `value` to an empty array if it's not an array like object. 20487 * 20488 * @private 20489 * @param {*} value The value to inspect. 20490 * @returns {Array|Object} Returns the cast array-like object. 20491 */ 20492 function castArrayLikeObject(value) { 20493 return isArrayLikeObject(value) ? value : []; 20494 } 20495 20496 /** 20497 * Casts `value` to `identity` if it's not a function. 20498 * 20499 * @private 20500 * @param {*} value The value to inspect. 20501 * @returns {Function} Returns cast function. 20502 */ 20503 function castFunction(value) { 20504 return typeof value == 'function' ? value : identity; 20505 } 20506 20507 /** 20508 * Casts `value` to a path array if it's not one. 20509 * 20510 * @private 20511 * @param {*} value The value to inspect. 20512 * @param {Object} [object] The object to query keys on. 20513 * @returns {Array} Returns the cast property path array. 20514 */ 20515 function castPath(value, object) { 20516 if (isArray(value)) { 20517 return value; 20518 } 20519 return isKey(value, object) ? [value] : stringToPath(toString(value)); 20520 } 20521 20522 /** 20523 * A `baseRest` alias which can be replaced with `identity` by module 20524 * replacement plugins. 20525 * 20526 * @private 20527 * @type {Function} 20528 * @param {Function} func The function to apply a rest parameter to. 20529 * @returns {Function} Returns the new function. 20530 */ 20531 var castRest = baseRest; 20532 20533 /** 20534 * Casts `array` to a slice if it's needed. 20535 * 20536 * @private 20537 * @param {Array} array The array to inspect. 20538 * @param {number} start The start position. 20539 * @param {number} [end=array.length] The end position. 20540 * @returns {Array} Returns the cast slice. 20541 */ 20542 function castSlice(array, start, end) { 20543 var length = array.length; 20544 end = end === undefined ? length : end; 20545 return (!start && end >= length) ? array : baseSlice(array, start, end); 20546 } 20547 20548 /** 20549 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 20550 * 20551 * @private 20552 * @param {number|Object} id The timer id or timeout object of the timer to clear. 20553 */ 20554 var clearTimeout = ctxClearTimeout || function(id) { 20555 return root.clearTimeout(id); 20556 }; 20557 20558 /** 20559 * Creates a clone of `buffer`. 20560 * 20561 * @private 20562 * @param {Buffer} buffer The buffer to clone. 20563 * @param {boolean} [isDeep] Specify a deep clone. 20564 * @returns {Buffer} Returns the cloned buffer. 20565 */ 20566 function cloneBuffer(buffer, isDeep) { 20567 if (isDeep) { 20568 return buffer.slice(); 20569 } 20570 var length = buffer.length, 20571 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 20572 20573 buffer.copy(result); 20574 return result; 20575 } 20576 20577 /** 20578 * Creates a clone of `arrayBuffer`. 20579 * 20580 * @private 20581 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 20582 * @returns {ArrayBuffer} Returns the cloned array buffer. 20583 */ 20584 function cloneArrayBuffer(arrayBuffer) { 20585 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 20586 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 20587 return result; 20588 } 20589 20590 /** 20591 * Creates a clone of `dataView`. 20592 * 20593 * @private 20594 * @param {Object} dataView The data view to clone. 20595 * @param {boolean} [isDeep] Specify a deep clone. 20596 * @returns {Object} Returns the cloned data view. 20597 */ 20598 function cloneDataView(dataView, isDeep) { 20599 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 20600 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 20601 } 20602 20603 /** 20604 * Creates a clone of `regexp`. 20605 * 20606 * @private 20607 * @param {Object} regexp The regexp to clone. 20608 * @returns {Object} Returns the cloned regexp. 20609 */ 20610 function cloneRegExp(regexp) { 20611 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 20612 result.lastIndex = regexp.lastIndex; 20613 return result; 20614 } 20615 20616 /** 20617 * Creates a clone of the `symbol` object. 20618 * 20619 * @private 20620 * @param {Object} symbol The symbol object to clone. 20621 * @returns {Object} Returns the cloned symbol object. 20622 */ 20623 function cloneSymbol(symbol) { 20624 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 20625 } 20626 20627 /** 20628 * Creates a clone of `typedArray`. 20629 * 20630 * @private 20631 * @param {Object} typedArray The typed array to clone. 20632 * @param {boolean} [isDeep] Specify a deep clone. 20633 * @returns {Object} Returns the cloned typed array. 20634 */ 20635 function cloneTypedArray(typedArray, isDeep) { 20636 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 20637 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 20638 } 20639 20640 /** 20641 * Compares values to sort them in ascending order. 20642 * 20643 * @private 20644 * @param {*} value The value to compare. 20645 * @param {*} other The other value to compare. 20646 * @returns {number} Returns the sort order indicator for `value`. 20647 */ 20648 function compareAscending(value, other) { 20649 if (value !== other) { 20650 var valIsDefined = value !== undefined, 20651 valIsNull = value === null, 20652 valIsReflexive = value === value, 20653 valIsSymbol = isSymbol(value); 20654 20655 var othIsDefined = other !== undefined, 20656 othIsNull = other === null, 20657 othIsReflexive = other === other, 20658 othIsSymbol = isSymbol(other); 20659 20660 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 20661 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 20662 (valIsNull && othIsDefined && othIsReflexive) || 20663 (!valIsDefined && othIsReflexive) || 20664 !valIsReflexive) { 20665 return 1; 20666 } 20667 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 20668 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 20669 (othIsNull && valIsDefined && valIsReflexive) || 20670 (!othIsDefined && valIsReflexive) || 20671 !othIsReflexive) { 20672 return -1; 20673 } 20674 } 20675 return 0; 20676 } 20677 20678 /** 20679 * Used by `_.orderBy` to compare multiple properties of a value to another 20680 * and stable sort them. 20681 * 20682 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 20683 * specify an order of "desc" for descending or "asc" for ascending sort order 20684 * of corresponding values. 20685 * 20686 * @private 20687 * @param {Object} object The object to compare. 20688 * @param {Object} other The other object to compare. 20689 * @param {boolean[]|string[]} orders The order to sort by for each property. 20690 * @returns {number} Returns the sort order indicator for `object`. 20691 */ 20692 function compareMultiple(object, other, orders) { 20693 var index = -1, 20694 objCriteria = object.criteria, 20695 othCriteria = other.criteria, 20696 length = objCriteria.length, 20697 ordersLength = orders.length; 20698 20699 while (++index < length) { 20700 var result = compareAscending(objCriteria[index], othCriteria[index]); 20701 if (result) { 20702 if (index >= ordersLength) { 20703 return result; 20704 } 20705 var order = orders[index]; 20706 return result * (order == 'desc' ? -1 : 1); 20707 } 20708 } 20709 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 20710 // that causes it, under certain circumstances, to provide the same value for 20711 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 20712 // for more details. 20713 // 20714 // This also ensures a stable sort in V8 and other engines. 20715 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 20716 return object.index - other.index; 20717 } 20718 20719 /** 20720 * Creates an array that is the composition of partially applied arguments, 20721 * placeholders, and provided arguments into a single array of arguments. 20722 * 20723 * @private 20724 * @param {Array} args The provided arguments. 20725 * @param {Array} partials The arguments to prepend to those provided. 20726 * @param {Array} holders The `partials` placeholder indexes. 20727 * @params {boolean} [isCurried] Specify composing for a curried function. 20728 * @returns {Array} Returns the new array of composed arguments. 20729 */ 20730 function composeArgs(args, partials, holders, isCurried) { 20731 var argsIndex = -1, 20732 argsLength = args.length, 20733 holdersLength = holders.length, 20734 leftIndex = -1, 20735 leftLength = partials.length, 20736 rangeLength = nativeMax(argsLength - holdersLength, 0), 20737 result = Array(leftLength + rangeLength), 20738 isUncurried = !isCurried; 20739 20740 while (++leftIndex < leftLength) { 20741 result[leftIndex] = partials[leftIndex]; 20742 } 20743 while (++argsIndex < holdersLength) { 20744 if (isUncurried || argsIndex < argsLength) { 20745 result[holders[argsIndex]] = args[argsIndex]; 20746 } 20747 } 20748 while (rangeLength--) { 20749 result[leftIndex++] = args[argsIndex++]; 20750 } 20751 return result; 20752 } 20753 20754 /** 20755 * This function is like `composeArgs` except that the arguments composition 20756 * is tailored for `_.partialRight`. 20757 * 20758 * @private 20759 * @param {Array} args The provided arguments. 20760 * @param {Array} partials The arguments to append to those provided. 20761 * @param {Array} holders The `partials` placeholder indexes. 20762 * @params {boolean} [isCurried] Specify composing for a curried function. 20763 * @returns {Array} Returns the new array of composed arguments. 20764 */ 20765 function composeArgsRight(args, partials, holders, isCurried) { 20766 var argsIndex = -1, 20767 argsLength = args.length, 20768 holdersIndex = -1, 20769 holdersLength = holders.length, 20770 rightIndex = -1, 20771 rightLength = partials.length, 20772 rangeLength = nativeMax(argsLength - holdersLength, 0), 20773 result = Array(rangeLength + rightLength), 20774 isUncurried = !isCurried; 20775 20776 while (++argsIndex < rangeLength) { 20777 result[argsIndex] = args[argsIndex]; 20778 } 20779 var offset = argsIndex; 20780 while (++rightIndex < rightLength) { 20781 result[offset + rightIndex] = partials[rightIndex]; 20782 } 20783 while (++holdersIndex < holdersLength) { 20784 if (isUncurried || argsIndex < argsLength) { 20785 result[offset + holders[holdersIndex]] = args[argsIndex++]; 20786 } 20787 } 20788 return result; 20789 } 20790 20791 /** 20792 * Copies the values of `source` to `array`. 20793 * 20794 * @private 20795 * @param {Array} source The array to copy values from. 20796 * @param {Array} [array=[]] The array to copy values to. 20797 * @returns {Array} Returns `array`. 20798 */ 20799 function copyArray(source, array) { 20800 var index = -1, 20801 length = source.length; 20802 20803 array || (array = Array(length)); 20804 while (++index < length) { 20805 array[index] = source[index]; 20806 } 20807 return array; 20808 } 20809 20810 /** 20811 * Copies properties of `source` to `object`. 20812 * 20813 * @private 20814 * @param {Object} source The object to copy properties from. 20815 * @param {Array} props The property identifiers to copy. 20816 * @param {Object} [object={}] The object to copy properties to. 20817 * @param {Function} [customizer] The function to customize copied values. 20818 * @returns {Object} Returns `object`. 20819 */ 20820 function copyObject(source, props, object, customizer) { 20821 var isNew = !object; 20822 object || (object = {}); 20823 20824 var index = -1, 20825 length = props.length; 20826 20827 while (++index < length) { 20828 var key = props[index]; 20829 20830 var newValue = customizer 20831 ? customizer(object[key], source[key], key, object, source) 20832 : undefined; 20833 20834 if (newValue === undefined) { 20835 newValue = source[key]; 20836 } 20837 if (isNew) { 20838 baseAssignValue(object, key, newValue); 20839 } else { 20840 assignValue(object, key, newValue); 20841 } 20842 } 20843 return object; 20844 } 20845 20846 /** 20847 * Copies own symbols of `source` to `object`. 20848 * 20849 * @private 20850 * @param {Object} source The object to copy symbols from. 20851 * @param {Object} [object={}] The object to copy symbols to. 20852 * @returns {Object} Returns `object`. 20853 */ 20854 function copySymbols(source, object) { 20855 return copyObject(source, getSymbols(source), object); 20856 } 20857 20858 /** 20859 * Copies own and inherited symbols of `source` to `object`. 20860 * 20861 * @private 20862 * @param {Object} source The object to copy symbols from. 20863 * @param {Object} [object={}] The object to copy symbols to. 20864 * @returns {Object} Returns `object`. 20865 */ 20866 function copySymbolsIn(source, object) { 20867 return copyObject(source, getSymbolsIn(source), object); 20868 } 20869 20870 /** 20871 * Creates a function like `_.groupBy`. 20872 * 20873 * @private 20874 * @param {Function} setter The function to set accumulator values. 20875 * @param {Function} [initializer] The accumulator object initializer. 20876 * @returns {Function} Returns the new aggregator function. 20877 */ 20878 function createAggregator(setter, initializer) { 20879 return function(collection, iteratee) { 20880 var func = isArray(collection) ? arrayAggregator : baseAggregator, 20881 accumulator = initializer ? initializer() : {}; 20882 20883 return func(collection, setter, getIteratee(iteratee, 2), accumulator); 20884 }; 20885 } 20886 20887 /** 20888 * Creates a function like `_.assign`. 20889 * 20890 * @private 20891 * @param {Function} assigner The function to assign values. 20892 * @returns {Function} Returns the new assigner function. 20893 */ 20894 function createAssigner(assigner) { 20895 return baseRest(function(object, sources) { 20896 var index = -1, 20897 length = sources.length, 20898 customizer = length > 1 ? sources[length - 1] : undefined, 20899 guard = length > 2 ? sources[2] : undefined; 20900 20901 customizer = (assigner.length > 3 && typeof customizer == 'function') 20902 ? (length--, customizer) 20903 : undefined; 20904 20905 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 20906 customizer = length < 3 ? undefined : customizer; 20907 length = 1; 20908 } 20909 object = Object(object); 20910 while (++index < length) { 20911 var source = sources[index]; 20912 if (source) { 20913 assigner(object, source, index, customizer); 20914 } 20915 } 20916 return object; 20917 }); 20918 } 20919 20920 /** 20921 * Creates a `baseEach` or `baseEachRight` function. 20922 * 20923 * @private 20924 * @param {Function} eachFunc The function to iterate over a collection. 20925 * @param {boolean} [fromRight] Specify iterating from right to left. 20926 * @returns {Function} Returns the new base function. 20927 */ 20928 function createBaseEach(eachFunc, fromRight) { 20929 return function(collection, iteratee) { 20930 if (collection == null) { 20931 return collection; 20932 } 20933 if (!isArrayLike(collection)) { 20934 return eachFunc(collection, iteratee); 20935 } 20936 var length = collection.length, 20937 index = fromRight ? length : -1, 20938 iterable = Object(collection); 20939 20940 while ((fromRight ? index-- : ++index < length)) { 20941 if (iteratee(iterable[index], index, iterable) === false) { 20942 break; 20943 } 20944 } 20945 return collection; 20946 }; 20947 } 20948 20949 /** 20950 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 20951 * 20952 * @private 20953 * @param {boolean} [fromRight] Specify iterating from right to left. 20954 * @returns {Function} Returns the new base function. 20955 */ 20956 function createBaseFor(fromRight) { 20957 return function(object, iteratee, keysFunc) { 20958 var index = -1, 20959 iterable = Object(object), 20960 props = keysFunc(object), 20961 length = props.length; 20962 20963 while (length--) { 20964 var key = props[fromRight ? length : ++index]; 20965 if (iteratee(iterable[key], key, iterable) === false) { 20966 break; 20967 } 20968 } 20969 return object; 20970 }; 20971 } 20972 20973 /** 20974 * Creates a function that wraps `func` to invoke it with the optional `this` 20975 * binding of `thisArg`. 20976 * 20977 * @private 20978 * @param {Function} func The function to wrap. 20979 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 20980 * @param {*} [thisArg] The `this` binding of `func`. 20981 * @returns {Function} Returns the new wrapped function. 20982 */ 20983 function createBind(func, bitmask, thisArg) { 20984 var isBind = bitmask & WRAP_BIND_FLAG, 20985 Ctor = createCtor(func); 20986 20987 function wrapper() { 20988 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 20989 return fn.apply(isBind ? thisArg : this, arguments); 20990 } 20991 return wrapper; 20992 } 20993 20994 /** 20995 * Creates a function like `_.lowerFirst`. 20996 * 20997 * @private 20998 * @param {string} methodName The name of the `String` case method to use. 20999 * @returns {Function} Returns the new case function. 21000 */ 21001 function createCaseFirst(methodName) { 21002 return function(string) { 21003 string = toString(string); 21004 21005 var strSymbols = hasUnicode(string) 21006 ? stringToArray(string) 21007 : undefined; 21008 21009 var chr = strSymbols 21010 ? strSymbols[0] 21011 : string.charAt(0); 21012 21013 var trailing = strSymbols 21014 ? castSlice(strSymbols, 1).join('') 21015 : string.slice(1); 21016 21017 return chr[methodName]() + trailing; 21018 }; 21019 } 21020 21021 /** 21022 * Creates a function like `_.camelCase`. 21023 * 21024 * @private 21025 * @param {Function} callback The function to combine each word. 21026 * @returns {Function} Returns the new compounder function. 21027 */ 21028 function createCompounder(callback) { 21029 return function(string) { 21030 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 21031 }; 21032 } 21033 21034 /** 21035 * Creates a function that produces an instance of `Ctor` regardless of 21036 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 21037 * 21038 * @private 21039 * @param {Function} Ctor The constructor to wrap. 21040 * @returns {Function} Returns the new wrapped function. 21041 */ 21042 function createCtor(Ctor) { 21043 return function() { 21044 // Use a `switch` statement to work with class constructors. See 21045 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 21046 // for more details. 21047 var args = arguments; 21048 switch (args.length) { 21049 case 0: return new Ctor; 21050 case 1: return new Ctor(args[0]); 21051 case 2: return new Ctor(args[0], args[1]); 21052 case 3: return new Ctor(args[0], args[1], args[2]); 21053 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 21054 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 21055 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 21056 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 21057 } 21058 var thisBinding = baseCreate(Ctor.prototype), 21059 result = Ctor.apply(thisBinding, args); 21060 21061 // Mimic the constructor's `return` behavior. 21062 // See https://es5.github.io/#x13.2.2 for more details. 21063 return isObject(result) ? result : thisBinding; 21064 }; 21065 } 21066 21067 /** 21068 * Creates a function that wraps `func` to enable currying. 21069 * 21070 * @private 21071 * @param {Function} func The function to wrap. 21072 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 21073 * @param {number} arity The arity of `func`. 21074 * @returns {Function} Returns the new wrapped function. 21075 */ 21076 function createCurry(func, bitmask, arity) { 21077 var Ctor = createCtor(func); 21078 21079 function wrapper() { 21080 var length = arguments.length, 21081 args = Array(length), 21082 index = length, 21083 placeholder = getHolder(wrapper); 21084 21085 while (index--) { 21086 args[index] = arguments[index]; 21087 } 21088 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 21089 ? [] 21090 : replaceHolders(args, placeholder); 21091 21092 length -= holders.length; 21093 if (length < arity) { 21094 return createRecurry( 21095 func, bitmask, createHybrid, wrapper.placeholder, undefined, 21096 args, holders, undefined, undefined, arity - length); 21097 } 21098 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 21099 return apply(fn, this, args); 21100 } 21101 return wrapper; 21102 } 21103 21104 /** 21105 * Creates a `_.find` or `_.findLast` function. 21106 * 21107 * @private 21108 * @param {Function} findIndexFunc The function to find the collection index. 21109 * @returns {Function} Returns the new find function. 21110 */ 21111 function createFind(findIndexFunc) { 21112 return function(collection, predicate, fromIndex) { 21113 var iterable = Object(collection); 21114 if (!isArrayLike(collection)) { 21115 var iteratee = getIteratee(predicate, 3); 21116 collection = keys(collection); 21117 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 21118 } 21119 var index = findIndexFunc(collection, predicate, fromIndex); 21120 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 21121 }; 21122 } 21123 21124 /** 21125 * Creates a `_.flow` or `_.flowRight` function. 21126 * 21127 * @private 21128 * @param {boolean} [fromRight] Specify iterating from right to left. 21129 * @returns {Function} Returns the new flow function. 21130 */ 21131 function createFlow(fromRight) { 21132 return flatRest(function(funcs) { 21133 var length = funcs.length, 21134 index = length, 21135 prereq = LodashWrapper.prototype.thru; 21136 21137 if (fromRight) { 21138 funcs.reverse(); 21139 } 21140 while (index--) { 21141 var func = funcs[index]; 21142 if (typeof func != 'function') { 21143 throw new TypeError(FUNC_ERROR_TEXT); 21144 } 21145 if (prereq && !wrapper && getFuncName(func) == 'wrapper') { 21146 var wrapper = new LodashWrapper([], true); 21147 } 21148 } 21149 index = wrapper ? index : length; 21150 while (++index < length) { 21151 func = funcs[index]; 21152 21153 var funcName = getFuncName(func), 21154 data = funcName == 'wrapper' ? getData(func) : undefined; 21155 21156 if (data && isLaziable(data[0]) && 21157 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && 21158 !data[4].length && data[9] == 1 21159 ) { 21160 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 21161 } else { 21162 wrapper = (func.length == 1 && isLaziable(func)) 21163 ? wrapper[funcName]() 21164 : wrapper.thru(func); 21165 } 21166 } 21167 return function() { 21168 var args = arguments, 21169 value = args[0]; 21170 21171 if (wrapper && args.length == 1 && isArray(value)) { 21172 return wrapper.plant(value).value(); 21173 } 21174 var index = 0, 21175 result = length ? funcs[index].apply(this, args) : value; 21176 21177 while (++index < length) { 21178 result = funcs[index].call(this, result); 21179 } 21180 return result; 21181 }; 21182 }); 21183 } 21184 21185 /** 21186 * Creates a function that wraps `func` to invoke it with optional `this` 21187 * binding of `thisArg`, partial application, and currying. 21188 * 21189 * @private 21190 * @param {Function|string} func The function or method name to wrap. 21191 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 21192 * @param {*} [thisArg] The `this` binding of `func`. 21193 * @param {Array} [partials] The arguments to prepend to those provided to 21194 * the new function. 21195 * @param {Array} [holders] The `partials` placeholder indexes. 21196 * @param {Array} [partialsRight] The arguments to append to those provided 21197 * to the new function. 21198 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 21199 * @param {Array} [argPos] The argument positions of the new function. 21200 * @param {number} [ary] The arity cap of `func`. 21201 * @param {number} [arity] The arity of `func`. 21202 * @returns {Function} Returns the new wrapped function. 21203 */ 21204 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 21205 var isAry = bitmask & WRAP_ARY_FLAG, 21206 isBind = bitmask & WRAP_BIND_FLAG, 21207 isBindKey = bitmask & WRAP_BIND_KEY_FLAG, 21208 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), 21209 isFlip = bitmask & WRAP_FLIP_FLAG, 21210 Ctor = isBindKey ? undefined : createCtor(func); 21211 21212 function wrapper() { 21213 var length = arguments.length, 21214 args = Array(length), 21215 index = length; 21216 21217 while (index--) { 21218 args[index] = arguments[index]; 21219 } 21220 if (isCurried) { 21221 var placeholder = getHolder(wrapper), 21222 holdersCount = countHolders(args, placeholder); 21223 } 21224 if (partials) { 21225 args = composeArgs(args, partials, holders, isCurried); 21226 } 21227 if (partialsRight) { 21228 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 21229 } 21230 length -= holdersCount; 21231 if (isCurried && length < arity) { 21232 var newHolders = replaceHolders(args, placeholder); 21233 return createRecurry( 21234 func, bitmask, createHybrid, wrapper.placeholder, thisArg, 21235 args, newHolders, argPos, ary, arity - length 21236 ); 21237 } 21238 var thisBinding = isBind ? thisArg : this, 21239 fn = isBindKey ? thisBinding[func] : func; 21240 21241 length = args.length; 21242 if (argPos) { 21243 args = reorder(args, argPos); 21244 } else if (isFlip && length > 1) { 21245 args.reverse(); 21246 } 21247 if (isAry && ary < length) { 21248 args.length = ary; 21249 } 21250 if (this && this !== root && this instanceof wrapper) { 21251 fn = Ctor || createCtor(fn); 21252 } 21253 return fn.apply(thisBinding, args); 21254 } 21255 return wrapper; 21256 } 21257 21258 /** 21259 * Creates a function like `_.invertBy`. 21260 * 21261 * @private 21262 * @param {Function} setter The function to set accumulator values. 21263 * @param {Function} toIteratee The function to resolve iteratees. 21264 * @returns {Function} Returns the new inverter function. 21265 */ 21266 function createInverter(setter, toIteratee) { 21267 return function(object, iteratee) { 21268 return baseInverter(object, setter, toIteratee(iteratee), {}); 21269 }; 21270 } 21271 21272 /** 21273 * Creates a function that performs a mathematical operation on two values. 21274 * 21275 * @private 21276 * @param {Function} operator The function to perform the operation. 21277 * @param {number} [defaultValue] The value used for `undefined` arguments. 21278 * @returns {Function} Returns the new mathematical operation function. 21279 */ 21280 function createMathOperation(operator, defaultValue) { 21281 return function(value, other) { 21282 var result; 21283 if (value === undefined && other === undefined) { 21284 return defaultValue; 21285 } 21286 if (value !== undefined) { 21287 result = value; 21288 } 21289 if (other !== undefined) { 21290 if (result === undefined) { 21291 return other; 21292 } 21293 if (typeof value == 'string' || typeof other == 'string') { 21294 value = baseToString(value); 21295 other = baseToString(other); 21296 } else { 21297 value = baseToNumber(value); 21298 other = baseToNumber(other); 21299 } 21300 result = operator(value, other); 21301 } 21302 return result; 21303 }; 21304 } 21305 21306 /** 21307 * Creates a function like `_.over`. 21308 * 21309 * @private 21310 * @param {Function} arrayFunc The function to iterate over iteratees. 21311 * @returns {Function} Returns the new over function. 21312 */ 21313 function createOver(arrayFunc) { 21314 return flatRest(function(iteratees) { 21315 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 21316 return baseRest(function(args) { 21317 var thisArg = this; 21318 return arrayFunc(iteratees, function(iteratee) { 21319 return apply(iteratee, thisArg, args); 21320 }); 21321 }); 21322 }); 21323 } 21324 21325 /** 21326 * Creates the padding for `string` based on `length`. The `chars` string 21327 * is truncated if the number of characters exceeds `length`. 21328 * 21329 * @private 21330 * @param {number} length The padding length. 21331 * @param {string} [chars=' '] The string used as padding. 21332 * @returns {string} Returns the padding for `string`. 21333 */ 21334 function createPadding(length, chars) { 21335 chars = chars === undefined ? ' ' : baseToString(chars); 21336 21337 var charsLength = chars.length; 21338 if (charsLength < 2) { 21339 return charsLength ? baseRepeat(chars, length) : chars; 21340 } 21341 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 21342 return hasUnicode(chars) 21343 ? castSlice(stringToArray(result), 0, length).join('') 21344 : result.slice(0, length); 21345 } 21346 21347 /** 21348 * Creates a function that wraps `func` to invoke it with the `this` binding 21349 * of `thisArg` and `partials` prepended to the arguments it receives. 21350 * 21351 * @private 21352 * @param {Function} func The function to wrap. 21353 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 21354 * @param {*} thisArg The `this` binding of `func`. 21355 * @param {Array} partials The arguments to prepend to those provided to 21356 * the new function. 21357 * @returns {Function} Returns the new wrapped function. 21358 */ 21359 function createPartial(func, bitmask, thisArg, partials) { 21360 var isBind = bitmask & WRAP_BIND_FLAG, 21361 Ctor = createCtor(func); 21362 21363 function wrapper() { 21364 var argsIndex = -1, 21365 argsLength = arguments.length, 21366 leftIndex = -1, 21367 leftLength = partials.length, 21368 args = Array(leftLength + argsLength), 21369 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 21370 21371 while (++leftIndex < leftLength) { 21372 args[leftIndex] = partials[leftIndex]; 21373 } 21374 while (argsLength--) { 21375 args[leftIndex++] = arguments[++argsIndex]; 21376 } 21377 return apply(fn, isBind ? thisArg : this, args); 21378 } 21379 return wrapper; 21380 } 21381 21382 /** 21383 * Creates a `_.range` or `_.rangeRight` function. 21384 * 21385 * @private 21386 * @param {boolean} [fromRight] Specify iterating from right to left. 21387 * @returns {Function} Returns the new range function. 21388 */ 21389 function createRange(fromRight) { 21390 return function(start, end, step) { 21391 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { 21392 end = step = undefined; 21393 } 21394 // Ensure the sign of `-0` is preserved. 21395 start = toFinite(start); 21396 if (end === undefined) { 21397 end = start; 21398 start = 0; 21399 } else { 21400 end = toFinite(end); 21401 } 21402 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); 21403 return baseRange(start, end, step, fromRight); 21404 }; 21405 } 21406 21407 /** 21408 * Creates a function that performs a relational operation on two values. 21409 * 21410 * @private 21411 * @param {Function} operator The function to perform the operation. 21412 * @returns {Function} Returns the new relational operation function. 21413 */ 21414 function createRelationalOperation(operator) { 21415 return function(value, other) { 21416 if (!(typeof value == 'string' && typeof other == 'string')) { 21417 value = toNumber(value); 21418 other = toNumber(other); 21419 } 21420 return operator(value, other); 21421 }; 21422 } 21423 21424 /** 21425 * Creates a function that wraps `func` to continue currying. 21426 * 21427 * @private 21428 * @param {Function} func The function to wrap. 21429 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 21430 * @param {Function} wrapFunc The function to create the `func` wrapper. 21431 * @param {*} placeholder The placeholder value. 21432 * @param {*} [thisArg] The `this` binding of `func`. 21433 * @param {Array} [partials] The arguments to prepend to those provided to 21434 * the new function. 21435 * @param {Array} [holders] The `partials` placeholder indexes. 21436 * @param {Array} [argPos] The argument positions of the new function. 21437 * @param {number} [ary] The arity cap of `func`. 21438 * @param {number} [arity] The arity of `func`. 21439 * @returns {Function} Returns the new wrapped function. 21440 */ 21441 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 21442 var isCurry = bitmask & WRAP_CURRY_FLAG, 21443 newHolders = isCurry ? holders : undefined, 21444 newHoldersRight = isCurry ? undefined : holders, 21445 newPartials = isCurry ? partials : undefined, 21446 newPartialsRight = isCurry ? undefined : partials; 21447 21448 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); 21449 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 21450 21451 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 21452 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); 21453 } 21454 var newData = [ 21455 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, 21456 newHoldersRight, argPos, ary, arity 21457 ]; 21458 21459 var result = wrapFunc.apply(undefined, newData); 21460 if (isLaziable(func)) { 21461 setData(result, newData); 21462 } 21463 result.placeholder = placeholder; 21464 return setWrapToString(result, func, bitmask); 21465 } 21466 21467 /** 21468 * Creates a function like `_.round`. 21469 * 21470 * @private 21471 * @param {string} methodName The name of the `Math` method to use when rounding. 21472 * @returns {Function} Returns the new round function. 21473 */ 21474 function createRound(methodName) { 21475 var func = Math[methodName]; 21476 return function(number, precision) { 21477 number = toNumber(number); 21478 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 21479 if (precision && nativeIsFinite(number)) { 21480 // Shift with exponential notation to avoid floating-point issues. 21481 // See [MDN](https://mdn.io/round#Examples) for more details. 21482 var pair = (toString(number) + 'e').split('e'), 21483 value = func(pair[0] + 'e' + (+pair[1] + precision)); 21484 21485 pair = (toString(value) + 'e').split('e'); 21486 return +(pair[0] + 'e' + (+pair[1] - precision)); 21487 } 21488 return func(number); 21489 }; 21490 } 21491 21492 /** 21493 * Creates a set object of `values`. 21494 * 21495 * @private 21496 * @param {Array} values The values to add to the set. 21497 * @returns {Object} Returns the new set. 21498 */ 21499 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 21500 return new Set(values); 21501 }; 21502 21503 /** 21504 * Creates a `_.toPairs` or `_.toPairsIn` function. 21505 * 21506 * @private 21507 * @param {Function} keysFunc The function to get the keys of a given object. 21508 * @returns {Function} Returns the new pairs function. 21509 */ 21510 function createToPairs(keysFunc) { 21511 return function(object) { 21512 var tag = getTag(object); 21513 if (tag == mapTag) { 21514 return mapToArray(object); 21515 } 21516 if (tag == setTag) { 21517 return setToPairs(object); 21518 } 21519 return baseToPairs(object, keysFunc(object)); 21520 }; 21521 } 21522 21523 /** 21524 * Creates a function that either curries or invokes `func` with optional 21525 * `this` binding and partially applied arguments. 21526 * 21527 * @private 21528 * @param {Function|string} func The function or method name to wrap. 21529 * @param {number} bitmask The bitmask flags. 21530 * 1 - `_.bind` 21531 * 2 - `_.bindKey` 21532 * 4 - `_.curry` or `_.curryRight` of a bound function 21533 * 8 - `_.curry` 21534 * 16 - `_.curryRight` 21535 * 32 - `_.partial` 21536 * 64 - `_.partialRight` 21537 * 128 - `_.rearg` 21538 * 256 - `_.ary` 21539 * 512 - `_.flip` 21540 * @param {*} [thisArg] The `this` binding of `func`. 21541 * @param {Array} [partials] The arguments to be partially applied. 21542 * @param {Array} [holders] The `partials` placeholder indexes. 21543 * @param {Array} [argPos] The argument positions of the new function. 21544 * @param {number} [ary] The arity cap of `func`. 21545 * @param {number} [arity] The arity of `func`. 21546 * @returns {Function} Returns the new wrapped function. 21547 */ 21548 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 21549 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 21550 if (!isBindKey && typeof func != 'function') { 21551 throw new TypeError(FUNC_ERROR_TEXT); 21552 } 21553 var length = partials ? partials.length : 0; 21554 if (!length) { 21555 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); 21556 partials = holders = undefined; 21557 } 21558 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 21559 arity = arity === undefined ? arity : toInteger(arity); 21560 length -= holders ? holders.length : 0; 21561 21562 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 21563 var partialsRight = partials, 21564 holdersRight = holders; 21565 21566 partials = holders = undefined; 21567 } 21568 var data = isBindKey ? undefined : getData(func); 21569 21570 var newData = [ 21571 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, 21572 argPos, ary, arity 21573 ]; 21574 21575 if (data) { 21576 mergeData(newData, data); 21577 } 21578 func = newData[0]; 21579 bitmask = newData[1]; 21580 thisArg = newData[2]; 21581 partials = newData[3]; 21582 holders = newData[4]; 21583 arity = newData[9] = newData[9] === undefined 21584 ? (isBindKey ? 0 : func.length) 21585 : nativeMax(newData[9] - length, 0); 21586 21587 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 21588 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); 21589 } 21590 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 21591 var result = createBind(func, bitmask, thisArg); 21592 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 21593 result = createCurry(func, bitmask, arity); 21594 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 21595 result = createPartial(func, bitmask, thisArg, partials); 21596 } else { 21597 result = createHybrid.apply(undefined, newData); 21598 } 21599 var setter = data ? baseSetData : setData; 21600 return setWrapToString(setter(result, newData), func, bitmask); 21601 } 21602 21603 /** 21604 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 21605 * of source objects to the destination object for all destination properties 21606 * that resolve to `undefined`. 21607 * 21608 * @private 21609 * @param {*} objValue The destination value. 21610 * @param {*} srcValue The source value. 21611 * @param {string} key The key of the property to assign. 21612 * @param {Object} object The parent object of `objValue`. 21613 * @returns {*} Returns the value to assign. 21614 */ 21615 function customDefaultsAssignIn(objValue, srcValue, key, object) { 21616 if (objValue === undefined || 21617 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { 21618 return srcValue; 21619 } 21620 return objValue; 21621 } 21622 21623 /** 21624 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 21625 * objects into destination objects that are passed thru. 21626 * 21627 * @private 21628 * @param {*} objValue The destination value. 21629 * @param {*} srcValue The source value. 21630 * @param {string} key The key of the property to merge. 21631 * @param {Object} object The parent object of `objValue`. 21632 * @param {Object} source The parent object of `srcValue`. 21633 * @param {Object} [stack] Tracks traversed source values and their merged 21634 * counterparts. 21635 * @returns {*} Returns the value to assign. 21636 */ 21637 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { 21638 if (isObject(objValue) && isObject(srcValue)) { 21639 // Recursively merge objects and arrays (susceptible to call stack limits). 21640 stack.set(srcValue, objValue); 21641 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); 21642 stack['delete'](srcValue); 21643 } 21644 return objValue; 21645 } 21646 21647 /** 21648 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 21649 * objects. 21650 * 21651 * @private 21652 * @param {*} value The value to inspect. 21653 * @param {string} key The key of the property to inspect. 21654 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 21655 */ 21656 function customOmitClone(value) { 21657 return isPlainObject(value) ? undefined : value; 21658 } 21659 21660 /** 21661 * A specialized version of `baseIsEqualDeep` for arrays with support for 21662 * partial deep comparisons. 21663 * 21664 * @private 21665 * @param {Array} array The array to compare. 21666 * @param {Array} other The other array to compare. 21667 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 21668 * @param {Function} customizer The function to customize comparisons. 21669 * @param {Function} equalFunc The function to determine equivalents of values. 21670 * @param {Object} stack Tracks traversed `array` and `other` objects. 21671 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 21672 */ 21673 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 21674 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 21675 arrLength = array.length, 21676 othLength = other.length; 21677 21678 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 21679 return false; 21680 } 21681 // Check that cyclic values are equal. 21682 var arrStacked = stack.get(array); 21683 var othStacked = stack.get(other); 21684 if (arrStacked && othStacked) { 21685 return arrStacked == other && othStacked == array; 21686 } 21687 var index = -1, 21688 result = true, 21689 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; 21690 21691 stack.set(array, other); 21692 stack.set(other, array); 21693 21694 // Ignore non-index properties. 21695 while (++index < arrLength) { 21696 var arrValue = array[index], 21697 othValue = other[index]; 21698 21699 if (customizer) { 21700 var compared = isPartial 21701 ? customizer(othValue, arrValue, index, other, array, stack) 21702 : customizer(arrValue, othValue, index, array, other, stack); 21703 } 21704 if (compared !== undefined) { 21705 if (compared) { 21706 continue; 21707 } 21708 result = false; 21709 break; 21710 } 21711 // Recursively compare arrays (susceptible to call stack limits). 21712 if (seen) { 21713 if (!arraySome(other, function(othValue, othIndex) { 21714 if (!cacheHas(seen, othIndex) && 21715 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 21716 return seen.push(othIndex); 21717 } 21718 })) { 21719 result = false; 21720 break; 21721 } 21722 } else if (!( 21723 arrValue === othValue || 21724 equalFunc(arrValue, othValue, bitmask, customizer, stack) 21725 )) { 21726 result = false; 21727 break; 21728 } 21729 } 21730 stack['delete'](array); 21731 stack['delete'](other); 21732 return result; 21733 } 21734 21735 /** 21736 * A specialized version of `baseIsEqualDeep` for comparing objects of 21737 * the same `toStringTag`. 21738 * 21739 * **Note:** This function only supports comparing values with tags of 21740 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 21741 * 21742 * @private 21743 * @param {Object} object The object to compare. 21744 * @param {Object} other The other object to compare. 21745 * @param {string} tag The `toStringTag` of the objects to compare. 21746 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 21747 * @param {Function} customizer The function to customize comparisons. 21748 * @param {Function} equalFunc The function to determine equivalents of values. 21749 * @param {Object} stack Tracks traversed `object` and `other` objects. 21750 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 21751 */ 21752 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 21753 switch (tag) { 21754 case dataViewTag: 21755 if ((object.byteLength != other.byteLength) || 21756 (object.byteOffset != other.byteOffset)) { 21757 return false; 21758 } 21759 object = object.buffer; 21760 other = other.buffer; 21761 21762 case arrayBufferTag: 21763 if ((object.byteLength != other.byteLength) || 21764 !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 21765 return false; 21766 } 21767 return true; 21768 21769 case boolTag: 21770 case dateTag: 21771 case numberTag: 21772 // Coerce booleans to `1` or `0` and dates to milliseconds. 21773 // Invalid dates are coerced to `NaN`. 21774 return eq(+object, +other); 21775 21776 case errorTag: 21777 return object.name == other.name && object.message == other.message; 21778 21779 case regexpTag: 21780 case stringTag: 21781 // Coerce regexes to strings and treat strings, primitives and objects, 21782 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 21783 // for more details. 21784 return object == (other + ''); 21785 21786 case mapTag: 21787 var convert = mapToArray; 21788 21789 case setTag: 21790 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 21791 convert || (convert = setToArray); 21792 21793 if (object.size != other.size && !isPartial) { 21794 return false; 21795 } 21796 // Assume cyclic values are equal. 21797 var stacked = stack.get(object); 21798 if (stacked) { 21799 return stacked == other; 21800 } 21801 bitmask |= COMPARE_UNORDERED_FLAG; 21802 21803 // Recursively compare objects (susceptible to call stack limits). 21804 stack.set(object, other); 21805 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 21806 stack['delete'](object); 21807 return result; 21808 21809 case symbolTag: 21810 if (symbolValueOf) { 21811 return symbolValueOf.call(object) == symbolValueOf.call(other); 21812 } 21813 } 21814 return false; 21815 } 21816 21817 /** 21818 * A specialized version of `baseIsEqualDeep` for objects with support for 21819 * partial deep comparisons. 21820 * 21821 * @private 21822 * @param {Object} object The object to compare. 21823 * @param {Object} other The other object to compare. 21824 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 21825 * @param {Function} customizer The function to customize comparisons. 21826 * @param {Function} equalFunc The function to determine equivalents of values. 21827 * @param {Object} stack Tracks traversed `object` and `other` objects. 21828 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 21829 */ 21830 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 21831 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 21832 objProps = getAllKeys(object), 21833 objLength = objProps.length, 21834 othProps = getAllKeys(other), 21835 othLength = othProps.length; 21836 21837 if (objLength != othLength && !isPartial) { 21838 return false; 21839 } 21840 var index = objLength; 21841 while (index--) { 21842 var key = objProps[index]; 21843 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 21844 return false; 21845 } 21846 } 21847 // Check that cyclic values are equal. 21848 var objStacked = stack.get(object); 21849 var othStacked = stack.get(other); 21850 if (objStacked && othStacked) { 21851 return objStacked == other && othStacked == object; 21852 } 21853 var result = true; 21854 stack.set(object, other); 21855 stack.set(other, object); 21856 21857 var skipCtor = isPartial; 21858 while (++index < objLength) { 21859 key = objProps[index]; 21860 var objValue = object[key], 21861 othValue = other[key]; 21862 21863 if (customizer) { 21864 var compared = isPartial 21865 ? customizer(othValue, objValue, key, other, object, stack) 21866 : customizer(objValue, othValue, key, object, other, stack); 21867 } 21868 // Recursively compare objects (susceptible to call stack limits). 21869 if (!(compared === undefined 21870 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 21871 : compared 21872 )) { 21873 result = false; 21874 break; 21875 } 21876 skipCtor || (skipCtor = key == 'constructor'); 21877 } 21878 if (result && !skipCtor) { 21879 var objCtor = object.constructor, 21880 othCtor = other.constructor; 21881 21882 // Non `Object` object instances with different constructors are not equal. 21883 if (objCtor != othCtor && 21884 ('constructor' in object && 'constructor' in other) && 21885 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 21886 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 21887 result = false; 21888 } 21889 } 21890 stack['delete'](object); 21891 stack['delete'](other); 21892 return result; 21893 } 21894 21895 /** 21896 * A specialized version of `baseRest` which flattens the rest array. 21897 * 21898 * @private 21899 * @param {Function} func The function to apply a rest parameter to. 21900 * @returns {Function} Returns the new function. 21901 */ 21902 function flatRest(func) { 21903 return setToString(overRest(func, undefined, flatten), func + ''); 21904 } 21905 21906 /** 21907 * Creates an array of own enumerable property names and symbols of `object`. 21908 * 21909 * @private 21910 * @param {Object} object The object to query. 21911 * @returns {Array} Returns the array of property names and symbols. 21912 */ 21913 function getAllKeys(object) { 21914 return baseGetAllKeys(object, keys, getSymbols); 21915 } 21916 21917 /** 21918 * Creates an array of own and inherited enumerable property names and 21919 * symbols of `object`. 21920 * 21921 * @private 21922 * @param {Object} object The object to query. 21923 * @returns {Array} Returns the array of property names and symbols. 21924 */ 21925 function getAllKeysIn(object) { 21926 return baseGetAllKeys(object, keysIn, getSymbolsIn); 21927 } 21928 21929 /** 21930 * Gets metadata for `func`. 21931 * 21932 * @private 21933 * @param {Function} func The function to query. 21934 * @returns {*} Returns the metadata for `func`. 21935 */ 21936 var getData = !metaMap ? noop : function(func) { 21937 return metaMap.get(func); 21938 }; 21939 21940 /** 21941 * Gets the name of `func`. 21942 * 21943 * @private 21944 * @param {Function} func The function to query. 21945 * @returns {string} Returns the function name. 21946 */ 21947 function getFuncName(func) { 21948 var result = (func.name + ''), 21949 array = realNames[result], 21950 length = hasOwnProperty.call(realNames, result) ? array.length : 0; 21951 21952 while (length--) { 21953 var data = array[length], 21954 otherFunc = data.func; 21955 if (otherFunc == null || otherFunc == func) { 21956 return data.name; 21957 } 21958 } 21959 return result; 21960 } 21961 21962 /** 21963 * Gets the argument placeholder value for `func`. 21964 * 21965 * @private 21966 * @param {Function} func The function to inspect. 21967 * @returns {*} Returns the placeholder value. 21968 */ 21969 function getHolder(func) { 21970 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; 21971 return object.placeholder; 21972 } 21973 21974 /** 21975 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 21976 * this function returns the custom method, otherwise it returns `baseIteratee`. 21977 * If arguments are provided, the chosen function is invoked with them and 21978 * its result is returned. 21979 * 21980 * @private 21981 * @param {*} [value] The value to convert to an iteratee. 21982 * @param {number} [arity] The arity of the created iteratee. 21983 * @returns {Function} Returns the chosen function or its result. 21984 */ 21985 function getIteratee() { 21986 var result = lodash.iteratee || iteratee; 21987 result = result === iteratee ? baseIteratee : result; 21988 return arguments.length ? result(arguments[0], arguments[1]) : result; 21989 } 21990 21991 /** 21992 * Gets the data for `map`. 21993 * 21994 * @private 21995 * @param {Object} map The map to query. 21996 * @param {string} key The reference key. 21997 * @returns {*} Returns the map data. 21998 */ 21999 function getMapData(map, key) { 22000 var data = map.__data__; 22001 return isKeyable(key) 22002 ? data[typeof key == 'string' ? 'string' : 'hash'] 22003 : data.map; 22004 } 22005 22006 /** 22007 * Gets the property names, values, and compare flags of `object`. 22008 * 22009 * @private 22010 * @param {Object} object The object to query. 22011 * @returns {Array} Returns the match data of `object`. 22012 */ 22013 function getMatchData(object) { 22014 var result = keys(object), 22015 length = result.length; 22016 22017 while (length--) { 22018 var key = result[length], 22019 value = object[key]; 22020 22021 result[length] = [key, value, isStrictComparable(value)]; 22022 } 22023 return result; 22024 } 22025 22026 /** 22027 * Gets the native function at `key` of `object`. 22028 * 22029 * @private 22030 * @param {Object} object The object to query. 22031 * @param {string} key The key of the method to get. 22032 * @returns {*} Returns the function if it's native, else `undefined`. 22033 */ 22034 function getNative(object, key) { 22035 var value = getValue(object, key); 22036 return baseIsNative(value) ? value : undefined; 22037 } 22038 22039 /** 22040 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 22041 * 22042 * @private 22043 * @param {*} value The value to query. 22044 * @returns {string} Returns the raw `toStringTag`. 22045 */ 22046 function getRawTag(value) { 22047 var isOwn = hasOwnProperty.call(value, symToStringTag), 22048 tag = value[symToStringTag]; 22049 22050 try { 22051 value[symToStringTag] = undefined; 22052 var unmasked = true; 22053 } catch (e) {} 22054 22055 var result = nativeObjectToString.call(value); 22056 if (unmasked) { 22057 if (isOwn) { 22058 value[symToStringTag] = tag; 22059 } else { 22060 delete value[symToStringTag]; 22061 } 22062 } 22063 return result; 22064 } 22065 22066 /** 22067 * Creates an array of the own enumerable symbols of `object`. 22068 * 22069 * @private 22070 * @param {Object} object The object to query. 22071 * @returns {Array} Returns the array of symbols. 22072 */ 22073 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 22074 if (object == null) { 22075 return []; 22076 } 22077 object = Object(object); 22078 return arrayFilter(nativeGetSymbols(object), function(symbol) { 22079 return propertyIsEnumerable.call(object, symbol); 22080 }); 22081 }; 22082 22083 /** 22084 * Creates an array of the own and inherited enumerable symbols of `object`. 22085 * 22086 * @private 22087 * @param {Object} object The object to query. 22088 * @returns {Array} Returns the array of symbols. 22089 */ 22090 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 22091 var result = []; 22092 while (object) { 22093 arrayPush(result, getSymbols(object)); 22094 object = getPrototype(object); 22095 } 22096 return result; 22097 }; 22098 22099 /** 22100 * Gets the `toStringTag` of `value`. 22101 * 22102 * @private 22103 * @param {*} value The value to query. 22104 * @returns {string} Returns the `toStringTag`. 22105 */ 22106 var getTag = baseGetTag; 22107 22108 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 22109 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 22110 (Map && getTag(new Map) != mapTag) || 22111 (Promise && getTag(Promise.resolve()) != promiseTag) || 22112 (Set && getTag(new Set) != setTag) || 22113 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 22114 getTag = function(value) { 22115 var result = baseGetTag(value), 22116 Ctor = result == objectTag ? value.constructor : undefined, 22117 ctorString = Ctor ? toSource(Ctor) : ''; 22118 22119 if (ctorString) { 22120 switch (ctorString) { 22121 case dataViewCtorString: return dataViewTag; 22122 case mapCtorString: return mapTag; 22123 case promiseCtorString: return promiseTag; 22124 case setCtorString: return setTag; 22125 case weakMapCtorString: return weakMapTag; 22126 } 22127 } 22128 return result; 22129 }; 22130 } 22131 22132 /** 22133 * Gets the view, applying any `transforms` to the `start` and `end` positions. 22134 * 22135 * @private 22136 * @param {number} start The start of the view. 22137 * @param {number} end The end of the view. 22138 * @param {Array} transforms The transformations to apply to the view. 22139 * @returns {Object} Returns an object containing the `start` and `end` 22140 * positions of the view. 22141 */ 22142 function getView(start, end, transforms) { 22143 var index = -1, 22144 length = transforms.length; 22145 22146 while (++index < length) { 22147 var data = transforms[index], 22148 size = data.size; 22149 22150 switch (data.type) { 22151 case 'drop': start += size; break; 22152 case 'dropRight': end -= size; break; 22153 case 'take': end = nativeMin(end, start + size); break; 22154 case 'takeRight': start = nativeMax(start, end - size); break; 22155 } 22156 } 22157 return { 'start': start, 'end': end }; 22158 } 22159 22160 /** 22161 * Extracts wrapper details from the `source` body comment. 22162 * 22163 * @private 22164 * @param {string} source The source to inspect. 22165 * @returns {Array} Returns the wrapper details. 22166 */ 22167 function getWrapDetails(source) { 22168 var match = source.match(reWrapDetails); 22169 return match ? match[1].split(reSplitDetails) : []; 22170 } 22171 22172 /** 22173 * Checks if `path` exists on `object`. 22174 * 22175 * @private 22176 * @param {Object} object The object to query. 22177 * @param {Array|string} path The path to check. 22178 * @param {Function} hasFunc The function to check properties. 22179 * @returns {boolean} Returns `true` if `path` exists, else `false`. 22180 */ 22181 function hasPath(object, path, hasFunc) { 22182 path = castPath(path, object); 22183 22184 var index = -1, 22185 length = path.length, 22186 result = false; 22187 22188 while (++index < length) { 22189 var key = toKey(path[index]); 22190 if (!(result = object != null && hasFunc(object, key))) { 22191 break; 22192 } 22193 object = object[key]; 22194 } 22195 if (result || ++index != length) { 22196 return result; 22197 } 22198 length = object == null ? 0 : object.length; 22199 return !!length && isLength(length) && isIndex(key, length) && 22200 (isArray(object) || isArguments(object)); 22201 } 22202 22203 /** 22204 * Initializes an array clone. 22205 * 22206 * @private 22207 * @param {Array} array The array to clone. 22208 * @returns {Array} Returns the initialized clone. 22209 */ 22210 function initCloneArray(array) { 22211 var length = array.length, 22212 result = new array.constructor(length); 22213 22214 // Add properties assigned by `RegExp#exec`. 22215 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 22216 result.index = array.index; 22217 result.input = array.input; 22218 } 22219 return result; 22220 } 22221 22222 /** 22223 * Initializes an object clone. 22224 * 22225 * @private 22226 * @param {Object} object The object to clone. 22227 * @returns {Object} Returns the initialized clone. 22228 */ 22229 function initCloneObject(object) { 22230 return (typeof object.constructor == 'function' && !isPrototype(object)) 22231 ? baseCreate(getPrototype(object)) 22232 : {}; 22233 } 22234 22235 /** 22236 * Initializes an object clone based on its `toStringTag`. 22237 * 22238 * **Note:** This function only supports cloning values with tags of 22239 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 22240 * 22241 * @private 22242 * @param {Object} object The object to clone. 22243 * @param {string} tag The `toStringTag` of the object to clone. 22244 * @param {boolean} [isDeep] Specify a deep clone. 22245 * @returns {Object} Returns the initialized clone. 22246 */ 22247 function initCloneByTag(object, tag, isDeep) { 22248 var Ctor = object.constructor; 22249 switch (tag) { 22250 case arrayBufferTag: 22251 return cloneArrayBuffer(object); 22252 22253 case boolTag: 22254 case dateTag: 22255 return new Ctor(+object); 22256 22257 case dataViewTag: 22258 return cloneDataView(object, isDeep); 22259 22260 case float32Tag: case float64Tag: 22261 case int8Tag: case int16Tag: case int32Tag: 22262 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 22263 return cloneTypedArray(object, isDeep); 22264 22265 case mapTag: 22266 return new Ctor; 22267 22268 case numberTag: 22269 case stringTag: 22270 return new Ctor(object); 22271 22272 case regexpTag: 22273 return cloneRegExp(object); 22274 22275 case setTag: 22276 return new Ctor; 22277 22278 case symbolTag: 22279 return cloneSymbol(object); 22280 } 22281 } 22282 22283 /** 22284 * Inserts wrapper `details` in a comment at the top of the `source` body. 22285 * 22286 * @private 22287 * @param {string} source The source to modify. 22288 * @returns {Array} details The details to insert. 22289 * @returns {string} Returns the modified source. 22290 */ 22291 function insertWrapDetails(source, details) { 22292 var length = details.length; 22293 if (!length) { 22294 return source; 22295 } 22296 var lastIndex = length - 1; 22297 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; 22298 details = details.join(length > 2 ? ', ' : ' '); 22299 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); 22300 } 22301 22302 /** 22303 * Checks if `value` is a flattenable `arguments` object or array. 22304 * 22305 * @private 22306 * @param {*} value The value to check. 22307 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 22308 */ 22309 function isFlattenable(value) { 22310 return isArray(value) || isArguments(value) || 22311 !!(spreadableSymbol && value && value[spreadableSymbol]); 22312 } 22313 22314 /** 22315 * Checks if `value` is a valid array-like index. 22316 * 22317 * @private 22318 * @param {*} value The value to check. 22319 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 22320 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 22321 */ 22322 function isIndex(value, length) { 22323 var type = typeof value; 22324 length = length == null ? MAX_SAFE_INTEGER : length; 22325 22326 return !!length && 22327 (type == 'number' || 22328 (type != 'symbol' && reIsUint.test(value))) && 22329 (value > -1 && value % 1 == 0 && value < length); 22330 } 22331 22332 /** 22333 * Checks if the given arguments are from an iteratee call. 22334 * 22335 * @private 22336 * @param {*} value The potential iteratee value argument. 22337 * @param {*} index The potential iteratee index or key argument. 22338 * @param {*} object The potential iteratee object argument. 22339 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 22340 * else `false`. 22341 */ 22342 function isIterateeCall(value, index, object) { 22343 if (!isObject(object)) { 22344 return false; 22345 } 22346 var type = typeof index; 22347 if (type == 'number' 22348 ? (isArrayLike(object) && isIndex(index, object.length)) 22349 : (type == 'string' && index in object) 22350 ) { 22351 return eq(object[index], value); 22352 } 22353 return false; 22354 } 22355 22356 /** 22357 * Checks if `value` is a property name and not a property path. 22358 * 22359 * @private 22360 * @param {*} value The value to check. 22361 * @param {Object} [object] The object to query keys on. 22362 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 22363 */ 22364 function isKey(value, object) { 22365 if (isArray(value)) { 22366 return false; 22367 } 22368 var type = typeof value; 22369 if (type == 'number' || type == 'symbol' || type == 'boolean' || 22370 value == null || isSymbol(value)) { 22371 return true; 22372 } 22373 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 22374 (object != null && value in Object(object)); 22375 } 22376 22377 /** 22378 * Checks if `value` is suitable for use as unique object key. 22379 * 22380 * @private 22381 * @param {*} value The value to check. 22382 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 22383 */ 22384 function isKeyable(value) { 22385 var type = typeof value; 22386 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 22387 ? (value !== '__proto__') 22388 : (value === null); 22389 } 22390 22391 /** 22392 * Checks if `func` has a lazy counterpart. 22393 * 22394 * @private 22395 * @param {Function} func The function to check. 22396 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 22397 * else `false`. 22398 */ 22399 function isLaziable(func) { 22400 var funcName = getFuncName(func), 22401 other = lodash[funcName]; 22402 22403 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { 22404 return false; 22405 } 22406 if (func === other) { 22407 return true; 22408 } 22409 var data = getData(other); 22410 return !!data && func === data[0]; 22411 } 22412 22413 /** 22414 * Checks if `func` has its source masked. 22415 * 22416 * @private 22417 * @param {Function} func The function to check. 22418 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 22419 */ 22420 function isMasked(func) { 22421 return !!maskSrcKey && (maskSrcKey in func); 22422 } 22423 22424 /** 22425 * Checks if `func` is capable of being masked. 22426 * 22427 * @private 22428 * @param {*} value The value to check. 22429 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 22430 */ 22431 var isMaskable = coreJsData ? isFunction : stubFalse; 22432 22433 /** 22434 * Checks if `value` is likely a prototype object. 22435 * 22436 * @private 22437 * @param {*} value The value to check. 22438 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 22439 */ 22440 function isPrototype(value) { 22441 var Ctor = value && value.constructor, 22442 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 22443 22444 return value === proto; 22445 } 22446 22447 /** 22448 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 22449 * 22450 * @private 22451 * @param {*} value The value to check. 22452 * @returns {boolean} Returns `true` if `value` if suitable for strict 22453 * equality comparisons, else `false`. 22454 */ 22455 function isStrictComparable(value) { 22456 return value === value && !isObject(value); 22457 } 22458 22459 /** 22460 * A specialized version of `matchesProperty` for source values suitable 22461 * for strict equality comparisons, i.e. `===`. 22462 * 22463 * @private 22464 * @param {string} key The key of the property to get. 22465 * @param {*} srcValue The value to match. 22466 * @returns {Function} Returns the new spec function. 22467 */ 22468 function matchesStrictComparable(key, srcValue) { 22469 return function(object) { 22470 if (object == null) { 22471 return false; 22472 } 22473 return object[key] === srcValue && 22474 (srcValue !== undefined || (key in Object(object))); 22475 }; 22476 } 22477 22478 /** 22479 * A specialized version of `_.memoize` which clears the memoized function's 22480 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 22481 * 22482 * @private 22483 * @param {Function} func The function to have its output memoized. 22484 * @returns {Function} Returns the new memoized function. 22485 */ 22486 function memoizeCapped(func) { 22487 var result = memoize(func, function(key) { 22488 if (cache.size === MAX_MEMOIZE_SIZE) { 22489 cache.clear(); 22490 } 22491 return key; 22492 }); 22493 22494 var cache = result.cache; 22495 return result; 22496 } 22497 22498 /** 22499 * Merges the function metadata of `source` into `data`. 22500 * 22501 * Merging metadata reduces the number of wrappers used to invoke a function. 22502 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 22503 * may be applied regardless of execution order. Methods like `_.ary` and 22504 * `_.rearg` modify function arguments, making the order in which they are 22505 * executed important, preventing the merging of metadata. However, we make 22506 * an exception for a safe combined case where curried functions have `_.ary` 22507 * and or `_.rearg` applied. 22508 * 22509 * @private 22510 * @param {Array} data The destination metadata. 22511 * @param {Array} source The source metadata. 22512 * @returns {Array} Returns `data`. 22513 */ 22514 function mergeData(data, source) { 22515 var bitmask = data[1], 22516 srcBitmask = source[1], 22517 newBitmask = bitmask | srcBitmask, 22518 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 22519 22520 var isCombo = 22521 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || 22522 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || 22523 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); 22524 22525 // Exit early if metadata can't be merged. 22526 if (!(isCommon || isCombo)) { 22527 return data; 22528 } 22529 // Use source `thisArg` if available. 22530 if (srcBitmask & WRAP_BIND_FLAG) { 22531 data[2] = source[2]; 22532 // Set when currying a bound function. 22533 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 22534 } 22535 // Compose partial arguments. 22536 var value = source[3]; 22537 if (value) { 22538 var partials = data[3]; 22539 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 22540 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 22541 } 22542 // Compose partial right arguments. 22543 value = source[5]; 22544 if (value) { 22545 partials = data[5]; 22546 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 22547 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 22548 } 22549 // Use source `argPos` if available. 22550 value = source[7]; 22551 if (value) { 22552 data[7] = value; 22553 } 22554 // Use source `ary` if it's smaller. 22555 if (srcBitmask & WRAP_ARY_FLAG) { 22556 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 22557 } 22558 // Use source `arity` if one is not provided. 22559 if (data[9] == null) { 22560 data[9] = source[9]; 22561 } 22562 // Use source `func` and merge bitmasks. 22563 data[0] = source[0]; 22564 data[1] = newBitmask; 22565 22566 return data; 22567 } 22568 22569 /** 22570 * This function is like 22571 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 22572 * except that it includes inherited enumerable properties. 22573 * 22574 * @private 22575 * @param {Object} object The object to query. 22576 * @returns {Array} Returns the array of property names. 22577 */ 22578 function nativeKeysIn(object) { 22579 var result = []; 22580 if (object != null) { 22581 for (var key in Object(object)) { 22582 result.push(key); 22583 } 22584 } 22585 return result; 22586 } 22587 22588 /** 22589 * Converts `value` to a string using `Object.prototype.toString`. 22590 * 22591 * @private 22592 * @param {*} value The value to convert. 22593 * @returns {string} Returns the converted string. 22594 */ 22595 function objectToString(value) { 22596 return nativeObjectToString.call(value); 22597 } 22598 22599 /** 22600 * A specialized version of `baseRest` which transforms the rest array. 22601 * 22602 * @private 22603 * @param {Function} func The function to apply a rest parameter to. 22604 * @param {number} [start=func.length-1] The start position of the rest parameter. 22605 * @param {Function} transform The rest array transform. 22606 * @returns {Function} Returns the new function. 22607 */ 22608 function overRest(func, start, transform) { 22609 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 22610 return function() { 22611 var args = arguments, 22612 index = -1, 22613 length = nativeMax(args.length - start, 0), 22614 array = Array(length); 22615 22616 while (++index < length) { 22617 array[index] = args[start + index]; 22618 } 22619 index = -1; 22620 var otherArgs = Array(start + 1); 22621 while (++index < start) { 22622 otherArgs[index] = args[index]; 22623 } 22624 otherArgs[start] = transform(array); 22625 return apply(func, this, otherArgs); 22626 }; 22627 } 22628 22629 /** 22630 * Gets the parent value at `path` of `object`. 22631 * 22632 * @private 22633 * @param {Object} object The object to query. 22634 * @param {Array} path The path to get the parent value of. 22635 * @returns {*} Returns the parent value. 22636 */ 22637 function parent(object, path) { 22638 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 22639 } 22640 22641 /** 22642 * Reorder `array` according to the specified indexes where the element at 22643 * the first index is assigned as the first element, the element at 22644 * the second index is assigned as the second element, and so on. 22645 * 22646 * @private 22647 * @param {Array} array The array to reorder. 22648 * @param {Array} indexes The arranged array indexes. 22649 * @returns {Array} Returns `array`. 22650 */ 22651 function reorder(array, indexes) { 22652 var arrLength = array.length, 22653 length = nativeMin(indexes.length, arrLength), 22654 oldArray = copyArray(array); 22655 22656 while (length--) { 22657 var index = indexes[length]; 22658 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 22659 } 22660 return array; 22661 } 22662 22663 /** 22664 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 22665 * 22666 * @private 22667 * @param {Object} object The object to query. 22668 * @param {string} key The key of the property to get. 22669 * @returns {*} Returns the property value. 22670 */ 22671 function safeGet(object, key) { 22672 if (key === 'constructor' && typeof object[key] === 'function') { 22673 return; 22674 } 22675 22676 if (key == '__proto__') { 22677 return; 22678 } 22679 22680 return object[key]; 22681 } 22682 22683 /** 22684 * Sets metadata for `func`. 22685 * 22686 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 22687 * period of time, it will trip its breaker and transition to an identity 22688 * function to avoid garbage collection pauses in V8. See 22689 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 22690 * for more details. 22691 * 22692 * @private 22693 * @param {Function} func The function to associate metadata with. 22694 * @param {*} data The metadata. 22695 * @returns {Function} Returns `func`. 22696 */ 22697 var setData = shortOut(baseSetData); 22698 22699 /** 22700 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 22701 * 22702 * @private 22703 * @param {Function} func The function to delay. 22704 * @param {number} wait The number of milliseconds to delay invocation. 22705 * @returns {number|Object} Returns the timer id or timeout object. 22706 */ 22707 var setTimeout = ctxSetTimeout || function(func, wait) { 22708 return root.setTimeout(func, wait); 22709 }; 22710 22711 /** 22712 * Sets the `toString` method of `func` to return `string`. 22713 * 22714 * @private 22715 * @param {Function} func The function to modify. 22716 * @param {Function} string The `toString` result. 22717 * @returns {Function} Returns `func`. 22718 */ 22719 var setToString = shortOut(baseSetToString); 22720 22721 /** 22722 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 22723 * with wrapper details in a comment at the top of the source body. 22724 * 22725 * @private 22726 * @param {Function} wrapper The function to modify. 22727 * @param {Function} reference The reference function. 22728 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 22729 * @returns {Function} Returns `wrapper`. 22730 */ 22731 function setWrapToString(wrapper, reference, bitmask) { 22732 var source = (reference + ''); 22733 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 22734 } 22735 22736 /** 22737 * Creates a function that'll short out and invoke `identity` instead 22738 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 22739 * milliseconds. 22740 * 22741 * @private 22742 * @param {Function} func The function to restrict. 22743 * @returns {Function} Returns the new shortable function. 22744 */ 22745 function shortOut(func) { 22746 var count = 0, 22747 lastCalled = 0; 22748 22749 return function() { 22750 var stamp = nativeNow(), 22751 remaining = HOT_SPAN - (stamp - lastCalled); 22752 22753 lastCalled = stamp; 22754 if (remaining > 0) { 22755 if (++count >= HOT_COUNT) { 22756 return arguments[0]; 22757 } 22758 } else { 22759 count = 0; 22760 } 22761 return func.apply(undefined, arguments); 22762 }; 22763 } 22764 22765 /** 22766 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 22767 * 22768 * @private 22769 * @param {Array} array The array to shuffle. 22770 * @param {number} [size=array.length] The size of `array`. 22771 * @returns {Array} Returns `array`. 22772 */ 22773 function shuffleSelf(array, size) { 22774 var index = -1, 22775 length = array.length, 22776 lastIndex = length - 1; 22777 22778 size = size === undefined ? length : size; 22779 while (++index < size) { 22780 var rand = baseRandom(index, lastIndex), 22781 value = array[rand]; 22782 22783 array[rand] = array[index]; 22784 array[index] = value; 22785 } 22786 array.length = size; 22787 return array; 22788 } 22789 22790 /** 22791 * Converts `string` to a property path array. 22792 * 22793 * @private 22794 * @param {string} string The string to convert. 22795 * @returns {Array} Returns the property path array. 22796 */ 22797 var stringToPath = memoizeCapped(function(string) { 22798 var result = []; 22799 if (string.charCodeAt(0) === 46 /* . */) { 22800 result.push(''); 22801 } 22802 string.replace(rePropName, function(match, number, quote, subString) { 22803 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); 22804 }); 22805 return result; 22806 }); 22807 22808 /** 22809 * Converts `value` to a string key if it's not a string or symbol. 22810 * 22811 * @private 22812 * @param {*} value The value to inspect. 22813 * @returns {string|symbol} Returns the key. 22814 */ 22815 function toKey(value) { 22816 if (typeof value == 'string' || isSymbol(value)) { 22817 return value; 22818 } 22819 var result = (value + ''); 22820 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 22821 } 22822 22823 /** 22824 * Converts `func` to its source code. 22825 * 22826 * @private 22827 * @param {Function} func The function to convert. 22828 * @returns {string} Returns the source code. 22829 */ 22830 function toSource(func) { 22831 if (func != null) { 22832 try { 22833 return funcToString.call(func); 22834 } catch (e) {} 22835 try { 22836 return (func + ''); 22837 } catch (e) {} 22838 } 22839 return ''; 22840 } 22841 22842 /** 22843 * Updates wrapper `details` based on `bitmask` flags. 22844 * 22845 * @private 22846 * @returns {Array} details The details to modify. 22847 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 22848 * @returns {Array} Returns `details`. 22849 */ 22850 function updateWrapDetails(details, bitmask) { 22851 arrayEach(wrapFlags, function(pair) { 22852 var value = '_.' + pair[0]; 22853 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { 22854 details.push(value); 22855 } 22856 }); 22857 return details.sort(); 22858 } 22859 22860 /** 22861 * Creates a clone of `wrapper`. 22862 * 22863 * @private 22864 * @param {Object} wrapper The wrapper to clone. 22865 * @returns {Object} Returns the cloned wrapper. 22866 */ 22867 function wrapperClone(wrapper) { 22868 if (wrapper instanceof LazyWrapper) { 22869 return wrapper.clone(); 22870 } 22871 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 22872 result.__actions__ = copyArray(wrapper.__actions__); 22873 result.__index__ = wrapper.__index__; 22874 result.__values__ = wrapper.__values__; 22875 return result; 22876 } 22877 22878 /*------------------------------------------------------------------------*/ 22879 22880 /** 22881 * Creates an array of elements split into groups the length of `size`. 22882 * If `array` can't be split evenly, the final chunk will be the remaining 22883 * elements. 22884 * 22885 * @static 22886 * @memberOf _ 22887 * @since 3.0.0 22888 * @category Array 22889 * @param {Array} array The array to process. 22890 * @param {number} [size=1] The length of each chunk 22891 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 22892 * @returns {Array} Returns the new array of chunks. 22893 * @example 22894 * 22895 * _.chunk(['a', 'b', 'c', 'd'], 2); 22896 * // => [['a', 'b'], ['c', 'd']] 22897 * 22898 * _.chunk(['a', 'b', 'c', 'd'], 3); 22899 * // => [['a', 'b', 'c'], ['d']] 22900 */ 22901 function chunk(array, size, guard) { 22902 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { 22903 size = 1; 22904 } else { 22905 size = nativeMax(toInteger(size), 0); 22906 } 22907 var length = array == null ? 0 : array.length; 22908 if (!length || size < 1) { 22909 return []; 22910 } 22911 var index = 0, 22912 resIndex = 0, 22913 result = Array(nativeCeil(length / size)); 22914 22915 while (index < length) { 22916 result[resIndex++] = baseSlice(array, index, (index += size)); 22917 } 22918 return result; 22919 } 22920 22921 /** 22922 * Creates an array with all falsey values removed. The values `false`, `null`, 22923 * `0`, `""`, `undefined`, and `NaN` are falsey. 22924 * 22925 * @static 22926 * @memberOf _ 22927 * @since 0.1.0 22928 * @category Array 22929 * @param {Array} array The array to compact. 22930 * @returns {Array} Returns the new array of filtered values. 22931 * @example 22932 * 22933 * _.compact([0, 1, false, 2, '', 3]); 22934 * // => [1, 2, 3] 22935 */ 22936 function compact(array) { 22937 var index = -1, 22938 length = array == null ? 0 : array.length, 22939 resIndex = 0, 22940 result = []; 22941 22942 while (++index < length) { 22943 var value = array[index]; 22944 if (value) { 22945 result[resIndex++] = value; 22946 } 22947 } 22948 return result; 22949 } 22950 22951 /** 22952 * Creates a new array concatenating `array` with any additional arrays 22953 * and/or values. 22954 * 22955 * @static 22956 * @memberOf _ 22957 * @since 4.0.0 22958 * @category Array 22959 * @param {Array} array The array to concatenate. 22960 * @param {...*} [values] The values to concatenate. 22961 * @returns {Array} Returns the new concatenated array. 22962 * @example 22963 * 22964 * var array = [1]; 22965 * var other = _.concat(array, 2, [3], [[4]]); 22966 * 22967 * console.log(other); 22968 * // => [1, 2, 3, [4]] 22969 * 22970 * console.log(array); 22971 * // => [1] 22972 */ 22973 function concat() { 22974 var length = arguments.length; 22975 if (!length) { 22976 return []; 22977 } 22978 var args = Array(length - 1), 22979 array = arguments[0], 22980 index = length; 22981 22982 while (index--) { 22983 args[index - 1] = arguments[index]; 22984 } 22985 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 22986 } 22987 22988 /** 22989 * Creates an array of `array` values not included in the other given arrays 22990 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 22991 * for equality comparisons. The order and references of result values are 22992 * determined by the first array. 22993 * 22994 * **Note:** Unlike `_.pullAll`, this method returns a new array. 22995 * 22996 * @static 22997 * @memberOf _ 22998 * @since 0.1.0 22999 * @category Array 23000 * @param {Array} array The array to inspect. 23001 * @param {...Array} [values] The values to exclude. 23002 * @returns {Array} Returns the new array of filtered values. 23003 * @see _.without, _.xor 23004 * @example 23005 * 23006 * _.difference([2, 1], [2, 3]); 23007 * // => [1] 23008 */ 23009 var difference = baseRest(function(array, values) { 23010 return isArrayLikeObject(array) 23011 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) 23012 : []; 23013 }); 23014 23015 /** 23016 * This method is like `_.difference` except that it accepts `iteratee` which 23017 * is invoked for each element of `array` and `values` to generate the criterion 23018 * by which they're compared. The order and references of result values are 23019 * determined by the first array. The iteratee is invoked with one argument: 23020 * (value). 23021 * 23022 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 23023 * 23024 * @static 23025 * @memberOf _ 23026 * @since 4.0.0 23027 * @category Array 23028 * @param {Array} array The array to inspect. 23029 * @param {...Array} [values] The values to exclude. 23030 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 23031 * @returns {Array} Returns the new array of filtered values. 23032 * @example 23033 * 23034 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 23035 * // => [1.2] 23036 * 23037 * // The `_.property` iteratee shorthand. 23038 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 23039 * // => [{ 'x': 2 }] 23040 */ 23041 var differenceBy = baseRest(function(array, values) { 23042 var iteratee = last(values); 23043 if (isArrayLikeObject(iteratee)) { 23044 iteratee = undefined; 23045 } 23046 return isArrayLikeObject(array) 23047 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) 23048 : []; 23049 }); 23050 23051 /** 23052 * This method is like `_.difference` except that it accepts `comparator` 23053 * which is invoked to compare elements of `array` to `values`. The order and 23054 * references of result values are determined by the first array. The comparator 23055 * is invoked with two arguments: (arrVal, othVal). 23056 * 23057 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 23058 * 23059 * @static 23060 * @memberOf _ 23061 * @since 4.0.0 23062 * @category Array 23063 * @param {Array} array The array to inspect. 23064 * @param {...Array} [values] The values to exclude. 23065 * @param {Function} [comparator] The comparator invoked per element. 23066 * @returns {Array} Returns the new array of filtered values. 23067 * @example 23068 * 23069 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 23070 * 23071 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 23072 * // => [{ 'x': 2, 'y': 1 }] 23073 */ 23074 var differenceWith = baseRest(function(array, values) { 23075 var comparator = last(values); 23076 if (isArrayLikeObject(comparator)) { 23077 comparator = undefined; 23078 } 23079 return isArrayLikeObject(array) 23080 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) 23081 : []; 23082 }); 23083 23084 /** 23085 * Creates a slice of `array` with `n` elements dropped from the beginning. 23086 * 23087 * @static 23088 * @memberOf _ 23089 * @since 0.5.0 23090 * @category Array 23091 * @param {Array} array The array to query. 23092 * @param {number} [n=1] The number of elements to drop. 23093 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 23094 * @returns {Array} Returns the slice of `array`. 23095 * @example 23096 * 23097 * _.drop([1, 2, 3]); 23098 * // => [2, 3] 23099 * 23100 * _.drop([1, 2, 3], 2); 23101 * // => [3] 23102 * 23103 * _.drop([1, 2, 3], 5); 23104 * // => [] 23105 * 23106 * _.drop([1, 2, 3], 0); 23107 * // => [1, 2, 3] 23108 */ 23109 function drop(array, n, guard) { 23110 var length = array == null ? 0 : array.length; 23111 if (!length) { 23112 return []; 23113 } 23114 n = (guard || n === undefined) ? 1 : toInteger(n); 23115 return baseSlice(array, n < 0 ? 0 : n, length); 23116 } 23117 23118 /** 23119 * Creates a slice of `array` with `n` elements dropped from the end. 23120 * 23121 * @static 23122 * @memberOf _ 23123 * @since 3.0.0 23124 * @category Array 23125 * @param {Array} array The array to query. 23126 * @param {number} [n=1] The number of elements to drop. 23127 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 23128 * @returns {Array} Returns the slice of `array`. 23129 * @example 23130 * 23131 * _.dropRight([1, 2, 3]); 23132 * // => [1, 2] 23133 * 23134 * _.dropRight([1, 2, 3], 2); 23135 * // => [1] 23136 * 23137 * _.dropRight([1, 2, 3], 5); 23138 * // => [] 23139 * 23140 * _.dropRight([1, 2, 3], 0); 23141 * // => [1, 2, 3] 23142 */ 23143 function dropRight(array, n, guard) { 23144 var length = array == null ? 0 : array.length; 23145 if (!length) { 23146 return []; 23147 } 23148 n = (guard || n === undefined) ? 1 : toInteger(n); 23149 n = length - n; 23150 return baseSlice(array, 0, n < 0 ? 0 : n); 23151 } 23152 23153 /** 23154 * Creates a slice of `array` excluding elements dropped from the end. 23155 * Elements are dropped until `predicate` returns falsey. The predicate is 23156 * invoked with three arguments: (value, index, array). 23157 * 23158 * @static 23159 * @memberOf _ 23160 * @since 3.0.0 23161 * @category Array 23162 * @param {Array} array The array to query. 23163 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23164 * @returns {Array} Returns the slice of `array`. 23165 * @example 23166 * 23167 * var users = [ 23168 * { 'user': 'barney', 'active': true }, 23169 * { 'user': 'fred', 'active': false }, 23170 * { 'user': 'pebbles', 'active': false } 23171 * ]; 23172 * 23173 * _.dropRightWhile(users, function(o) { return !o.active; }); 23174 * // => objects for ['barney'] 23175 * 23176 * // The `_.matches` iteratee shorthand. 23177 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 23178 * // => objects for ['barney', 'fred'] 23179 * 23180 * // The `_.matchesProperty` iteratee shorthand. 23181 * _.dropRightWhile(users, ['active', false]); 23182 * // => objects for ['barney'] 23183 * 23184 * // The `_.property` iteratee shorthand. 23185 * _.dropRightWhile(users, 'active'); 23186 * // => objects for ['barney', 'fred', 'pebbles'] 23187 */ 23188 function dropRightWhile(array, predicate) { 23189 return (array && array.length) 23190 ? baseWhile(array, getIteratee(predicate, 3), true, true) 23191 : []; 23192 } 23193 23194 /** 23195 * Creates a slice of `array` excluding elements dropped from the beginning. 23196 * Elements are dropped until `predicate` returns falsey. The predicate is 23197 * invoked with three arguments: (value, index, array). 23198 * 23199 * @static 23200 * @memberOf _ 23201 * @since 3.0.0 23202 * @category Array 23203 * @param {Array} array The array to query. 23204 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23205 * @returns {Array} Returns the slice of `array`. 23206 * @example 23207 * 23208 * var users = [ 23209 * { 'user': 'barney', 'active': false }, 23210 * { 'user': 'fred', 'active': false }, 23211 * { 'user': 'pebbles', 'active': true } 23212 * ]; 23213 * 23214 * _.dropWhile(users, function(o) { return !o.active; }); 23215 * // => objects for ['pebbles'] 23216 * 23217 * // The `_.matches` iteratee shorthand. 23218 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 23219 * // => objects for ['fred', 'pebbles'] 23220 * 23221 * // The `_.matchesProperty` iteratee shorthand. 23222 * _.dropWhile(users, ['active', false]); 23223 * // => objects for ['pebbles'] 23224 * 23225 * // The `_.property` iteratee shorthand. 23226 * _.dropWhile(users, 'active'); 23227 * // => objects for ['barney', 'fred', 'pebbles'] 23228 */ 23229 function dropWhile(array, predicate) { 23230 return (array && array.length) 23231 ? baseWhile(array, getIteratee(predicate, 3), true) 23232 : []; 23233 } 23234 23235 /** 23236 * Fills elements of `array` with `value` from `start` up to, but not 23237 * including, `end`. 23238 * 23239 * **Note:** This method mutates `array`. 23240 * 23241 * @static 23242 * @memberOf _ 23243 * @since 3.2.0 23244 * @category Array 23245 * @param {Array} array The array to fill. 23246 * @param {*} value The value to fill `array` with. 23247 * @param {number} [start=0] The start position. 23248 * @param {number} [end=array.length] The end position. 23249 * @returns {Array} Returns `array`. 23250 * @example 23251 * 23252 * var array = [1, 2, 3]; 23253 * 23254 * _.fill(array, 'a'); 23255 * console.log(array); 23256 * // => ['a', 'a', 'a'] 23257 * 23258 * _.fill(Array(3), 2); 23259 * // => [2, 2, 2] 23260 * 23261 * _.fill([4, 6, 8, 10], '*', 1, 3); 23262 * // => [4, '*', '*', 10] 23263 */ 23264 function fill(array, value, start, end) { 23265 var length = array == null ? 0 : array.length; 23266 if (!length) { 23267 return []; 23268 } 23269 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { 23270 start = 0; 23271 end = length; 23272 } 23273 return baseFill(array, value, start, end); 23274 } 23275 23276 /** 23277 * This method is like `_.find` except that it returns the index of the first 23278 * element `predicate` returns truthy for instead of the element itself. 23279 * 23280 * @static 23281 * @memberOf _ 23282 * @since 1.1.0 23283 * @category Array 23284 * @param {Array} array The array to inspect. 23285 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23286 * @param {number} [fromIndex=0] The index to search from. 23287 * @returns {number} Returns the index of the found element, else `-1`. 23288 * @example 23289 * 23290 * var users = [ 23291 * { 'user': 'barney', 'active': false }, 23292 * { 'user': 'fred', 'active': false }, 23293 * { 'user': 'pebbles', 'active': true } 23294 * ]; 23295 * 23296 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 23297 * // => 0 23298 * 23299 * // The `_.matches` iteratee shorthand. 23300 * _.findIndex(users, { 'user': 'fred', 'active': false }); 23301 * // => 1 23302 * 23303 * // The `_.matchesProperty` iteratee shorthand. 23304 * _.findIndex(users, ['active', false]); 23305 * // => 0 23306 * 23307 * // The `_.property` iteratee shorthand. 23308 * _.findIndex(users, 'active'); 23309 * // => 2 23310 */ 23311 function findIndex(array, predicate, fromIndex) { 23312 var length = array == null ? 0 : array.length; 23313 if (!length) { 23314 return -1; 23315 } 23316 var index = fromIndex == null ? 0 : toInteger(fromIndex); 23317 if (index < 0) { 23318 index = nativeMax(length + index, 0); 23319 } 23320 return baseFindIndex(array, getIteratee(predicate, 3), index); 23321 } 23322 23323 /** 23324 * This method is like `_.findIndex` except that it iterates over elements 23325 * of `collection` from right to left. 23326 * 23327 * @static 23328 * @memberOf _ 23329 * @since 2.0.0 23330 * @category Array 23331 * @param {Array} array The array to inspect. 23332 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23333 * @param {number} [fromIndex=array.length-1] The index to search from. 23334 * @returns {number} Returns the index of the found element, else `-1`. 23335 * @example 23336 * 23337 * var users = [ 23338 * { 'user': 'barney', 'active': true }, 23339 * { 'user': 'fred', 'active': false }, 23340 * { 'user': 'pebbles', 'active': false } 23341 * ]; 23342 * 23343 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 23344 * // => 2 23345 * 23346 * // The `_.matches` iteratee shorthand. 23347 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 23348 * // => 0 23349 * 23350 * // The `_.matchesProperty` iteratee shorthand. 23351 * _.findLastIndex(users, ['active', false]); 23352 * // => 2 23353 * 23354 * // The `_.property` iteratee shorthand. 23355 * _.findLastIndex(users, 'active'); 23356 * // => 0 23357 */ 23358 function findLastIndex(array, predicate, fromIndex) { 23359 var length = array == null ? 0 : array.length; 23360 if (!length) { 23361 return -1; 23362 } 23363 var index = length - 1; 23364 if (fromIndex !== undefined) { 23365 index = toInteger(fromIndex); 23366 index = fromIndex < 0 23367 ? nativeMax(length + index, 0) 23368 : nativeMin(index, length - 1); 23369 } 23370 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 23371 } 23372 23373 /** 23374 * Flattens `array` a single level deep. 23375 * 23376 * @static 23377 * @memberOf _ 23378 * @since 0.1.0 23379 * @category Array 23380 * @param {Array} array The array to flatten. 23381 * @returns {Array} Returns the new flattened array. 23382 * @example 23383 * 23384 * _.flatten([1, [2, [3, [4]], 5]]); 23385 * // => [1, 2, [3, [4]], 5] 23386 */ 23387 function flatten(array) { 23388 var length = array == null ? 0 : array.length; 23389 return length ? baseFlatten(array, 1) : []; 23390 } 23391 23392 /** 23393 * Recursively flattens `array`. 23394 * 23395 * @static 23396 * @memberOf _ 23397 * @since 3.0.0 23398 * @category Array 23399 * @param {Array} array The array to flatten. 23400 * @returns {Array} Returns the new flattened array. 23401 * @example 23402 * 23403 * _.flattenDeep([1, [2, [3, [4]], 5]]); 23404 * // => [1, 2, 3, 4, 5] 23405 */ 23406 function flattenDeep(array) { 23407 var length = array == null ? 0 : array.length; 23408 return length ? baseFlatten(array, INFINITY) : []; 23409 } 23410 23411 /** 23412 * Recursively flatten `array` up to `depth` times. 23413 * 23414 * @static 23415 * @memberOf _ 23416 * @since 4.4.0 23417 * @category Array 23418 * @param {Array} array The array to flatten. 23419 * @param {number} [depth=1] The maximum recursion depth. 23420 * @returns {Array} Returns the new flattened array. 23421 * @example 23422 * 23423 * var array = [1, [2, [3, [4]], 5]]; 23424 * 23425 * _.flattenDepth(array, 1); 23426 * // => [1, 2, [3, [4]], 5] 23427 * 23428 * _.flattenDepth(array, 2); 23429 * // => [1, 2, 3, [4], 5] 23430 */ 23431 function flattenDepth(array, depth) { 23432 var length = array == null ? 0 : array.length; 23433 if (!length) { 23434 return []; 23435 } 23436 depth = depth === undefined ? 1 : toInteger(depth); 23437 return baseFlatten(array, depth); 23438 } 23439 23440 /** 23441 * The inverse of `_.toPairs`; this method returns an object composed 23442 * from key-value `pairs`. 23443 * 23444 * @static 23445 * @memberOf _ 23446 * @since 4.0.0 23447 * @category Array 23448 * @param {Array} pairs The key-value pairs. 23449 * @returns {Object} Returns the new object. 23450 * @example 23451 * 23452 * _.fromPairs([['a', 1], ['b', 2]]); 23453 * // => { 'a': 1, 'b': 2 } 23454 */ 23455 function fromPairs(pairs) { 23456 var index = -1, 23457 length = pairs == null ? 0 : pairs.length, 23458 result = {}; 23459 23460 while (++index < length) { 23461 var pair = pairs[index]; 23462 result[pair[0]] = pair[1]; 23463 } 23464 return result; 23465 } 23466 23467 /** 23468 * Gets the first element of `array`. 23469 * 23470 * @static 23471 * @memberOf _ 23472 * @since 0.1.0 23473 * @alias first 23474 * @category Array 23475 * @param {Array} array The array to query. 23476 * @returns {*} Returns the first element of `array`. 23477 * @example 23478 * 23479 * _.head([1, 2, 3]); 23480 * // => 1 23481 * 23482 * _.head([]); 23483 * // => undefined 23484 */ 23485 function head(array) { 23486 return (array && array.length) ? array[0] : undefined; 23487 } 23488 23489 /** 23490 * Gets the index at which the first occurrence of `value` is found in `array` 23491 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 23492 * for equality comparisons. If `fromIndex` is negative, it's used as the 23493 * offset from the end of `array`. 23494 * 23495 * @static 23496 * @memberOf _ 23497 * @since 0.1.0 23498 * @category Array 23499 * @param {Array} array The array to inspect. 23500 * @param {*} value The value to search for. 23501 * @param {number} [fromIndex=0] The index to search from. 23502 * @returns {number} Returns the index of the matched value, else `-1`. 23503 * @example 23504 * 23505 * _.indexOf([1, 2, 1, 2], 2); 23506 * // => 1 23507 * 23508 * // Search from the `fromIndex`. 23509 * _.indexOf([1, 2, 1, 2], 2, 2); 23510 * // => 3 23511 */ 23512 function indexOf(array, value, fromIndex) { 23513 var length = array == null ? 0 : array.length; 23514 if (!length) { 23515 return -1; 23516 } 23517 var index = fromIndex == null ? 0 : toInteger(fromIndex); 23518 if (index < 0) { 23519 index = nativeMax(length + index, 0); 23520 } 23521 return baseIndexOf(array, value, index); 23522 } 23523 23524 /** 23525 * Gets all but the last element of `array`. 23526 * 23527 * @static 23528 * @memberOf _ 23529 * @since 0.1.0 23530 * @category Array 23531 * @param {Array} array The array to query. 23532 * @returns {Array} Returns the slice of `array`. 23533 * @example 23534 * 23535 * _.initial([1, 2, 3]); 23536 * // => [1, 2] 23537 */ 23538 function initial(array) { 23539 var length = array == null ? 0 : array.length; 23540 return length ? baseSlice(array, 0, -1) : []; 23541 } 23542 23543 /** 23544 * Creates an array of unique values that are included in all given arrays 23545 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 23546 * for equality comparisons. The order and references of result values are 23547 * determined by the first array. 23548 * 23549 * @static 23550 * @memberOf _ 23551 * @since 0.1.0 23552 * @category Array 23553 * @param {...Array} [arrays] The arrays to inspect. 23554 * @returns {Array} Returns the new array of intersecting values. 23555 * @example 23556 * 23557 * _.intersection([2, 1], [2, 3]); 23558 * // => [2] 23559 */ 23560 var intersection = baseRest(function(arrays) { 23561 var mapped = arrayMap(arrays, castArrayLikeObject); 23562 return (mapped.length && mapped[0] === arrays[0]) 23563 ? baseIntersection(mapped) 23564 : []; 23565 }); 23566 23567 /** 23568 * This method is like `_.intersection` except that it accepts `iteratee` 23569 * which is invoked for each element of each `arrays` to generate the criterion 23570 * by which they're compared. The order and references of result values are 23571 * determined by the first array. The iteratee is invoked with one argument: 23572 * (value). 23573 * 23574 * @static 23575 * @memberOf _ 23576 * @since 4.0.0 23577 * @category Array 23578 * @param {...Array} [arrays] The arrays to inspect. 23579 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 23580 * @returns {Array} Returns the new array of intersecting values. 23581 * @example 23582 * 23583 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 23584 * // => [2.1] 23585 * 23586 * // The `_.property` iteratee shorthand. 23587 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 23588 * // => [{ 'x': 1 }] 23589 */ 23590 var intersectionBy = baseRest(function(arrays) { 23591 var iteratee = last(arrays), 23592 mapped = arrayMap(arrays, castArrayLikeObject); 23593 23594 if (iteratee === last(mapped)) { 23595 iteratee = undefined; 23596 } else { 23597 mapped.pop(); 23598 } 23599 return (mapped.length && mapped[0] === arrays[0]) 23600 ? baseIntersection(mapped, getIteratee(iteratee, 2)) 23601 : []; 23602 }); 23603 23604 /** 23605 * This method is like `_.intersection` except that it accepts `comparator` 23606 * which is invoked to compare elements of `arrays`. The order and references 23607 * of result values are determined by the first array. The comparator is 23608 * invoked with two arguments: (arrVal, othVal). 23609 * 23610 * @static 23611 * @memberOf _ 23612 * @since 4.0.0 23613 * @category Array 23614 * @param {...Array} [arrays] The arrays to inspect. 23615 * @param {Function} [comparator] The comparator invoked per element. 23616 * @returns {Array} Returns the new array of intersecting values. 23617 * @example 23618 * 23619 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 23620 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 23621 * 23622 * _.intersectionWith(objects, others, _.isEqual); 23623 * // => [{ 'x': 1, 'y': 2 }] 23624 */ 23625 var intersectionWith = baseRest(function(arrays) { 23626 var comparator = last(arrays), 23627 mapped = arrayMap(arrays, castArrayLikeObject); 23628 23629 comparator = typeof comparator == 'function' ? comparator : undefined; 23630 if (comparator) { 23631 mapped.pop(); 23632 } 23633 return (mapped.length && mapped[0] === arrays[0]) 23634 ? baseIntersection(mapped, undefined, comparator) 23635 : []; 23636 }); 23637 23638 /** 23639 * Converts all elements in `array` into a string separated by `separator`. 23640 * 23641 * @static 23642 * @memberOf _ 23643 * @since 4.0.0 23644 * @category Array 23645 * @param {Array} array The array to convert. 23646 * @param {string} [separator=','] The element separator. 23647 * @returns {string} Returns the joined string. 23648 * @example 23649 * 23650 * _.join(['a', 'b', 'c'], '~'); 23651 * // => 'a~b~c' 23652 */ 23653 function join(array, separator) { 23654 return array == null ? '' : nativeJoin.call(array, separator); 23655 } 23656 23657 /** 23658 * Gets the last element of `array`. 23659 * 23660 * @static 23661 * @memberOf _ 23662 * @since 0.1.0 23663 * @category Array 23664 * @param {Array} array The array to query. 23665 * @returns {*} Returns the last element of `array`. 23666 * @example 23667 * 23668 * _.last([1, 2, 3]); 23669 * // => 3 23670 */ 23671 function last(array) { 23672 var length = array == null ? 0 : array.length; 23673 return length ? array[length - 1] : undefined; 23674 } 23675 23676 /** 23677 * This method is like `_.indexOf` except that it iterates over elements of 23678 * `array` from right to left. 23679 * 23680 * @static 23681 * @memberOf _ 23682 * @since 0.1.0 23683 * @category Array 23684 * @param {Array} array The array to inspect. 23685 * @param {*} value The value to search for. 23686 * @param {number} [fromIndex=array.length-1] The index to search from. 23687 * @returns {number} Returns the index of the matched value, else `-1`. 23688 * @example 23689 * 23690 * _.lastIndexOf([1, 2, 1, 2], 2); 23691 * // => 3 23692 * 23693 * // Search from the `fromIndex`. 23694 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 23695 * // => 1 23696 */ 23697 function lastIndexOf(array, value, fromIndex) { 23698 var length = array == null ? 0 : array.length; 23699 if (!length) { 23700 return -1; 23701 } 23702 var index = length; 23703 if (fromIndex !== undefined) { 23704 index = toInteger(fromIndex); 23705 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 23706 } 23707 return value === value 23708 ? strictLastIndexOf(array, value, index) 23709 : baseFindIndex(array, baseIsNaN, index, true); 23710 } 23711 23712 /** 23713 * Gets the element at index `n` of `array`. If `n` is negative, the nth 23714 * element from the end is returned. 23715 * 23716 * @static 23717 * @memberOf _ 23718 * @since 4.11.0 23719 * @category Array 23720 * @param {Array} array The array to query. 23721 * @param {number} [n=0] The index of the element to return. 23722 * @returns {*} Returns the nth element of `array`. 23723 * @example 23724 * 23725 * var array = ['a', 'b', 'c', 'd']; 23726 * 23727 * _.nth(array, 1); 23728 * // => 'b' 23729 * 23730 * _.nth(array, -2); 23731 * // => 'c'; 23732 */ 23733 function nth(array, n) { 23734 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; 23735 } 23736 23737 /** 23738 * Removes all given values from `array` using 23739 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 23740 * for equality comparisons. 23741 * 23742 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 23743 * to remove elements from an array by predicate. 23744 * 23745 * @static 23746 * @memberOf _ 23747 * @since 2.0.0 23748 * @category Array 23749 * @param {Array} array The array to modify. 23750 * @param {...*} [values] The values to remove. 23751 * @returns {Array} Returns `array`. 23752 * @example 23753 * 23754 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 23755 * 23756 * _.pull(array, 'a', 'c'); 23757 * console.log(array); 23758 * // => ['b', 'b'] 23759 */ 23760 var pull = baseRest(pullAll); 23761 23762 /** 23763 * This method is like `_.pull` except that it accepts an array of values to remove. 23764 * 23765 * **Note:** Unlike `_.difference`, this method mutates `array`. 23766 * 23767 * @static 23768 * @memberOf _ 23769 * @since 4.0.0 23770 * @category Array 23771 * @param {Array} array The array to modify. 23772 * @param {Array} values The values to remove. 23773 * @returns {Array} Returns `array`. 23774 * @example 23775 * 23776 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 23777 * 23778 * _.pullAll(array, ['a', 'c']); 23779 * console.log(array); 23780 * // => ['b', 'b'] 23781 */ 23782 function pullAll(array, values) { 23783 return (array && array.length && values && values.length) 23784 ? basePullAll(array, values) 23785 : array; 23786 } 23787 23788 /** 23789 * This method is like `_.pullAll` except that it accepts `iteratee` which is 23790 * invoked for each element of `array` and `values` to generate the criterion 23791 * by which they're compared. The iteratee is invoked with one argument: (value). 23792 * 23793 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 23794 * 23795 * @static 23796 * @memberOf _ 23797 * @since 4.0.0 23798 * @category Array 23799 * @param {Array} array The array to modify. 23800 * @param {Array} values The values to remove. 23801 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 23802 * @returns {Array} Returns `array`. 23803 * @example 23804 * 23805 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 23806 * 23807 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 23808 * console.log(array); 23809 * // => [{ 'x': 2 }] 23810 */ 23811 function pullAllBy(array, values, iteratee) { 23812 return (array && array.length && values && values.length) 23813 ? basePullAll(array, values, getIteratee(iteratee, 2)) 23814 : array; 23815 } 23816 23817 /** 23818 * This method is like `_.pullAll` except that it accepts `comparator` which 23819 * is invoked to compare elements of `array` to `values`. The comparator is 23820 * invoked with two arguments: (arrVal, othVal). 23821 * 23822 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 23823 * 23824 * @static 23825 * @memberOf _ 23826 * @since 4.6.0 23827 * @category Array 23828 * @param {Array} array The array to modify. 23829 * @param {Array} values The values to remove. 23830 * @param {Function} [comparator] The comparator invoked per element. 23831 * @returns {Array} Returns `array`. 23832 * @example 23833 * 23834 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 23835 * 23836 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 23837 * console.log(array); 23838 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 23839 */ 23840 function pullAllWith(array, values, comparator) { 23841 return (array && array.length && values && values.length) 23842 ? basePullAll(array, values, undefined, comparator) 23843 : array; 23844 } 23845 23846 /** 23847 * Removes elements from `array` corresponding to `indexes` and returns an 23848 * array of removed elements. 23849 * 23850 * **Note:** Unlike `_.at`, this method mutates `array`. 23851 * 23852 * @static 23853 * @memberOf _ 23854 * @since 3.0.0 23855 * @category Array 23856 * @param {Array} array The array to modify. 23857 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 23858 * @returns {Array} Returns the new array of removed elements. 23859 * @example 23860 * 23861 * var array = ['a', 'b', 'c', 'd']; 23862 * var pulled = _.pullAt(array, [1, 3]); 23863 * 23864 * console.log(array); 23865 * // => ['a', 'c'] 23866 * 23867 * console.log(pulled); 23868 * // => ['b', 'd'] 23869 */ 23870 var pullAt = flatRest(function(array, indexes) { 23871 var length = array == null ? 0 : array.length, 23872 result = baseAt(array, indexes); 23873 23874 basePullAt(array, arrayMap(indexes, function(index) { 23875 return isIndex(index, length) ? +index : index; 23876 }).sort(compareAscending)); 23877 23878 return result; 23879 }); 23880 23881 /** 23882 * Removes all elements from `array` that `predicate` returns truthy for 23883 * and returns an array of the removed elements. The predicate is invoked 23884 * with three arguments: (value, index, array). 23885 * 23886 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 23887 * to pull elements from an array by value. 23888 * 23889 * @static 23890 * @memberOf _ 23891 * @since 2.0.0 23892 * @category Array 23893 * @param {Array} array The array to modify. 23894 * @param {Function} [predicate=_.identity] The function invoked per iteration. 23895 * @returns {Array} Returns the new array of removed elements. 23896 * @example 23897 * 23898 * var array = [1, 2, 3, 4]; 23899 * var evens = _.remove(array, function(n) { 23900 * return n % 2 == 0; 23901 * }); 23902 * 23903 * console.log(array); 23904 * // => [1, 3] 23905 * 23906 * console.log(evens); 23907 * // => [2, 4] 23908 */ 23909 function remove(array, predicate) { 23910 var result = []; 23911 if (!(array && array.length)) { 23912 return result; 23913 } 23914 var index = -1, 23915 indexes = [], 23916 length = array.length; 23917 23918 predicate = getIteratee(predicate, 3); 23919 while (++index < length) { 23920 var value = array[index]; 23921 if (predicate(value, index, array)) { 23922 result.push(value); 23923 indexes.push(index); 23924 } 23925 } 23926 basePullAt(array, indexes); 23927 return result; 23928 } 23929 23930 /** 23931 * Reverses `array` so that the first element becomes the last, the second 23932 * element becomes the second to last, and so on. 23933 * 23934 * **Note:** This method mutates `array` and is based on 23935 * [`Array#reverse`](https://mdn.io/Array/reverse). 23936 * 23937 * @static 23938 * @memberOf _ 23939 * @since 4.0.0 23940 * @category Array 23941 * @param {Array} array The array to modify. 23942 * @returns {Array} Returns `array`. 23943 * @example 23944 * 23945 * var array = [1, 2, 3]; 23946 * 23947 * _.reverse(array); 23948 * // => [3, 2, 1] 23949 * 23950 * console.log(array); 23951 * // => [3, 2, 1] 23952 */ 23953 function reverse(array) { 23954 return array == null ? array : nativeReverse.call(array); 23955 } 23956 23957 /** 23958 * Creates a slice of `array` from `start` up to, but not including, `end`. 23959 * 23960 * **Note:** This method is used instead of 23961 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 23962 * returned. 23963 * 23964 * @static 23965 * @memberOf _ 23966 * @since 3.0.0 23967 * @category Array 23968 * @param {Array} array The array to slice. 23969 * @param {number} [start=0] The start position. 23970 * @param {number} [end=array.length] The end position. 23971 * @returns {Array} Returns the slice of `array`. 23972 */ 23973 function slice(array, start, end) { 23974 var length = array == null ? 0 : array.length; 23975 if (!length) { 23976 return []; 23977 } 23978 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 23979 start = 0; 23980 end = length; 23981 } 23982 else { 23983 start = start == null ? 0 : toInteger(start); 23984 end = end === undefined ? length : toInteger(end); 23985 } 23986 return baseSlice(array, start, end); 23987 } 23988 23989 /** 23990 * Uses a binary search to determine the lowest index at which `value` 23991 * should be inserted into `array` in order to maintain its sort order. 23992 * 23993 * @static 23994 * @memberOf _ 23995 * @since 0.1.0 23996 * @category Array 23997 * @param {Array} array The sorted array to inspect. 23998 * @param {*} value The value to evaluate. 23999 * @returns {number} Returns the index at which `value` should be inserted 24000 * into `array`. 24001 * @example 24002 * 24003 * _.sortedIndex([30, 50], 40); 24004 * // => 1 24005 */ 24006 function sortedIndex(array, value) { 24007 return baseSortedIndex(array, value); 24008 } 24009 24010 /** 24011 * This method is like `_.sortedIndex` except that it accepts `iteratee` 24012 * which is invoked for `value` and each element of `array` to compute their 24013 * sort ranking. The iteratee is invoked with one argument: (value). 24014 * 24015 * @static 24016 * @memberOf _ 24017 * @since 4.0.0 24018 * @category Array 24019 * @param {Array} array The sorted array to inspect. 24020 * @param {*} value The value to evaluate. 24021 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 24022 * @returns {number} Returns the index at which `value` should be inserted 24023 * into `array`. 24024 * @example 24025 * 24026 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 24027 * 24028 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 24029 * // => 0 24030 * 24031 * // The `_.property` iteratee shorthand. 24032 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 24033 * // => 0 24034 */ 24035 function sortedIndexBy(array, value, iteratee) { 24036 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); 24037 } 24038 24039 /** 24040 * This method is like `_.indexOf` except that it performs a binary 24041 * search on a sorted `array`. 24042 * 24043 * @static 24044 * @memberOf _ 24045 * @since 4.0.0 24046 * @category Array 24047 * @param {Array} array The array to inspect. 24048 * @param {*} value The value to search for. 24049 * @returns {number} Returns the index of the matched value, else `-1`. 24050 * @example 24051 * 24052 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 24053 * // => 1 24054 */ 24055 function sortedIndexOf(array, value) { 24056 var length = array == null ? 0 : array.length; 24057 if (length) { 24058 var index = baseSortedIndex(array, value); 24059 if (index < length && eq(array[index], value)) { 24060 return index; 24061 } 24062 } 24063 return -1; 24064 } 24065 24066 /** 24067 * This method is like `_.sortedIndex` except that it returns the highest 24068 * index at which `value` should be inserted into `array` in order to 24069 * maintain its sort order. 24070 * 24071 * @static 24072 * @memberOf _ 24073 * @since 3.0.0 24074 * @category Array 24075 * @param {Array} array The sorted array to inspect. 24076 * @param {*} value The value to evaluate. 24077 * @returns {number} Returns the index at which `value` should be inserted 24078 * into `array`. 24079 * @example 24080 * 24081 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 24082 * // => 4 24083 */ 24084 function sortedLastIndex(array, value) { 24085 return baseSortedIndex(array, value, true); 24086 } 24087 24088 /** 24089 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 24090 * which is invoked for `value` and each element of `array` to compute their 24091 * sort ranking. The iteratee is invoked with one argument: (value). 24092 * 24093 * @static 24094 * @memberOf _ 24095 * @since 4.0.0 24096 * @category Array 24097 * @param {Array} array The sorted array to inspect. 24098 * @param {*} value The value to evaluate. 24099 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 24100 * @returns {number} Returns the index at which `value` should be inserted 24101 * into `array`. 24102 * @example 24103 * 24104 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 24105 * 24106 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 24107 * // => 1 24108 * 24109 * // The `_.property` iteratee shorthand. 24110 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 24111 * // => 1 24112 */ 24113 function sortedLastIndexBy(array, value, iteratee) { 24114 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); 24115 } 24116 24117 /** 24118 * This method is like `_.lastIndexOf` except that it performs a binary 24119 * search on a sorted `array`. 24120 * 24121 * @static 24122 * @memberOf _ 24123 * @since 4.0.0 24124 * @category Array 24125 * @param {Array} array The array to inspect. 24126 * @param {*} value The value to search for. 24127 * @returns {number} Returns the index of the matched value, else `-1`. 24128 * @example 24129 * 24130 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 24131 * // => 3 24132 */ 24133 function sortedLastIndexOf(array, value) { 24134 var length = array == null ? 0 : array.length; 24135 if (length) { 24136 var index = baseSortedIndex(array, value, true) - 1; 24137 if (eq(array[index], value)) { 24138 return index; 24139 } 24140 } 24141 return -1; 24142 } 24143 24144 /** 24145 * This method is like `_.uniq` except that it's designed and optimized 24146 * for sorted arrays. 24147 * 24148 * @static 24149 * @memberOf _ 24150 * @since 4.0.0 24151 * @category Array 24152 * @param {Array} array The array to inspect. 24153 * @returns {Array} Returns the new duplicate free array. 24154 * @example 24155 * 24156 * _.sortedUniq([1, 1, 2]); 24157 * // => [1, 2] 24158 */ 24159 function sortedUniq(array) { 24160 return (array && array.length) 24161 ? baseSortedUniq(array) 24162 : []; 24163 } 24164 24165 /** 24166 * This method is like `_.uniqBy` except that it's designed and optimized 24167 * for sorted arrays. 24168 * 24169 * @static 24170 * @memberOf _ 24171 * @since 4.0.0 24172 * @category Array 24173 * @param {Array} array The array to inspect. 24174 * @param {Function} [iteratee] The iteratee invoked per element. 24175 * @returns {Array} Returns the new duplicate free array. 24176 * @example 24177 * 24178 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 24179 * // => [1.1, 2.3] 24180 */ 24181 function sortedUniqBy(array, iteratee) { 24182 return (array && array.length) 24183 ? baseSortedUniq(array, getIteratee(iteratee, 2)) 24184 : []; 24185 } 24186 24187 /** 24188 * Gets all but the first element of `array`. 24189 * 24190 * @static 24191 * @memberOf _ 24192 * @since 4.0.0 24193 * @category Array 24194 * @param {Array} array The array to query. 24195 * @returns {Array} Returns the slice of `array`. 24196 * @example 24197 * 24198 * _.tail([1, 2, 3]); 24199 * // => [2, 3] 24200 */ 24201 function tail(array) { 24202 var length = array == null ? 0 : array.length; 24203 return length ? baseSlice(array, 1, length) : []; 24204 } 24205 24206 /** 24207 * Creates a slice of `array` with `n` elements taken from the beginning. 24208 * 24209 * @static 24210 * @memberOf _ 24211 * @since 0.1.0 24212 * @category Array 24213 * @param {Array} array The array to query. 24214 * @param {number} [n=1] The number of elements to take. 24215 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 24216 * @returns {Array} Returns the slice of `array`. 24217 * @example 24218 * 24219 * _.take([1, 2, 3]); 24220 * // => [1] 24221 * 24222 * _.take([1, 2, 3], 2); 24223 * // => [1, 2] 24224 * 24225 * _.take([1, 2, 3], 5); 24226 * // => [1, 2, 3] 24227 * 24228 * _.take([1, 2, 3], 0); 24229 * // => [] 24230 */ 24231 function take(array, n, guard) { 24232 if (!(array && array.length)) { 24233 return []; 24234 } 24235 n = (guard || n === undefined) ? 1 : toInteger(n); 24236 return baseSlice(array, 0, n < 0 ? 0 : n); 24237 } 24238 24239 /** 24240 * Creates a slice of `array` with `n` elements taken from the end. 24241 * 24242 * @static 24243 * @memberOf _ 24244 * @since 3.0.0 24245 * @category Array 24246 * @param {Array} array The array to query. 24247 * @param {number} [n=1] The number of elements to take. 24248 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 24249 * @returns {Array} Returns the slice of `array`. 24250 * @example 24251 * 24252 * _.takeRight([1, 2, 3]); 24253 * // => [3] 24254 * 24255 * _.takeRight([1, 2, 3], 2); 24256 * // => [2, 3] 24257 * 24258 * _.takeRight([1, 2, 3], 5); 24259 * // => [1, 2, 3] 24260 * 24261 * _.takeRight([1, 2, 3], 0); 24262 * // => [] 24263 */ 24264 function takeRight(array, n, guard) { 24265 var length = array == null ? 0 : array.length; 24266 if (!length) { 24267 return []; 24268 } 24269 n = (guard || n === undefined) ? 1 : toInteger(n); 24270 n = length - n; 24271 return baseSlice(array, n < 0 ? 0 : n, length); 24272 } 24273 24274 /** 24275 * Creates a slice of `array` with elements taken from the end. Elements are 24276 * taken until `predicate` returns falsey. The predicate is invoked with 24277 * three arguments: (value, index, array). 24278 * 24279 * @static 24280 * @memberOf _ 24281 * @since 3.0.0 24282 * @category Array 24283 * @param {Array} array The array to query. 24284 * @param {Function} [predicate=_.identity] The function invoked per iteration. 24285 * @returns {Array} Returns the slice of `array`. 24286 * @example 24287 * 24288 * var users = [ 24289 * { 'user': 'barney', 'active': true }, 24290 * { 'user': 'fred', 'active': false }, 24291 * { 'user': 'pebbles', 'active': false } 24292 * ]; 24293 * 24294 * _.takeRightWhile(users, function(o) { return !o.active; }); 24295 * // => objects for ['fred', 'pebbles'] 24296 * 24297 * // The `_.matches` iteratee shorthand. 24298 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 24299 * // => objects for ['pebbles'] 24300 * 24301 * // The `_.matchesProperty` iteratee shorthand. 24302 * _.takeRightWhile(users, ['active', false]); 24303 * // => objects for ['fred', 'pebbles'] 24304 * 24305 * // The `_.property` iteratee shorthand. 24306 * _.takeRightWhile(users, 'active'); 24307 * // => [] 24308 */ 24309 function takeRightWhile(array, predicate) { 24310 return (array && array.length) 24311 ? baseWhile(array, getIteratee(predicate, 3), false, true) 24312 : []; 24313 } 24314 24315 /** 24316 * Creates a slice of `array` with elements taken from the beginning. Elements 24317 * are taken until `predicate` returns falsey. The predicate is invoked with 24318 * three arguments: (value, index, array). 24319 * 24320 * @static 24321 * @memberOf _ 24322 * @since 3.0.0 24323 * @category Array 24324 * @param {Array} array The array to query. 24325 * @param {Function} [predicate=_.identity] The function invoked per iteration. 24326 * @returns {Array} Returns the slice of `array`. 24327 * @example 24328 * 24329 * var users = [ 24330 * { 'user': 'barney', 'active': false }, 24331 * { 'user': 'fred', 'active': false }, 24332 * { 'user': 'pebbles', 'active': true } 24333 * ]; 24334 * 24335 * _.takeWhile(users, function(o) { return !o.active; }); 24336 * // => objects for ['barney', 'fred'] 24337 * 24338 * // The `_.matches` iteratee shorthand. 24339 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 24340 * // => objects for ['barney'] 24341 * 24342 * // The `_.matchesProperty` iteratee shorthand. 24343 * _.takeWhile(users, ['active', false]); 24344 * // => objects for ['barney', 'fred'] 24345 * 24346 * // The `_.property` iteratee shorthand. 24347 * _.takeWhile(users, 'active'); 24348 * // => [] 24349 */ 24350 function takeWhile(array, predicate) { 24351 return (array && array.length) 24352 ? baseWhile(array, getIteratee(predicate, 3)) 24353 : []; 24354 } 24355 24356 /** 24357 * Creates an array of unique values, in order, from all given arrays using 24358 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 24359 * for equality comparisons. 24360 * 24361 * @static 24362 * @memberOf _ 24363 * @since 0.1.0 24364 * @category Array 24365 * @param {...Array} [arrays] The arrays to inspect. 24366 * @returns {Array} Returns the new array of combined values. 24367 * @example 24368 * 24369 * _.union([2], [1, 2]); 24370 * // => [2, 1] 24371 */ 24372 var union = baseRest(function(arrays) { 24373 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 24374 }); 24375 24376 /** 24377 * This method is like `_.union` except that it accepts `iteratee` which is 24378 * invoked for each element of each `arrays` to generate the criterion by 24379 * which uniqueness is computed. Result values are chosen from the first 24380 * array in which the value occurs. The iteratee is invoked with one argument: 24381 * (value). 24382 * 24383 * @static 24384 * @memberOf _ 24385 * @since 4.0.0 24386 * @category Array 24387 * @param {...Array} [arrays] The arrays to inspect. 24388 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 24389 * @returns {Array} Returns the new array of combined values. 24390 * @example 24391 * 24392 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 24393 * // => [2.1, 1.2] 24394 * 24395 * // The `_.property` iteratee shorthand. 24396 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 24397 * // => [{ 'x': 1 }, { 'x': 2 }] 24398 */ 24399 var unionBy = baseRest(function(arrays) { 24400 var iteratee = last(arrays); 24401 if (isArrayLikeObject(iteratee)) { 24402 iteratee = undefined; 24403 } 24404 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); 24405 }); 24406 24407 /** 24408 * This method is like `_.union` except that it accepts `comparator` which 24409 * is invoked to compare elements of `arrays`. Result values are chosen from 24410 * the first array in which the value occurs. The comparator is invoked 24411 * with two arguments: (arrVal, othVal). 24412 * 24413 * @static 24414 * @memberOf _ 24415 * @since 4.0.0 24416 * @category Array 24417 * @param {...Array} [arrays] The arrays to inspect. 24418 * @param {Function} [comparator] The comparator invoked per element. 24419 * @returns {Array} Returns the new array of combined values. 24420 * @example 24421 * 24422 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 24423 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 24424 * 24425 * _.unionWith(objects, others, _.isEqual); 24426 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 24427 */ 24428 var unionWith = baseRest(function(arrays) { 24429 var comparator = last(arrays); 24430 comparator = typeof comparator == 'function' ? comparator : undefined; 24431 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); 24432 }); 24433 24434 /** 24435 * Creates a duplicate-free version of an array, using 24436 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 24437 * for equality comparisons, in which only the first occurrence of each element 24438 * is kept. The order of result values is determined by the order they occur 24439 * in the array. 24440 * 24441 * @static 24442 * @memberOf _ 24443 * @since 0.1.0 24444 * @category Array 24445 * @param {Array} array The array to inspect. 24446 * @returns {Array} Returns the new duplicate free array. 24447 * @example 24448 * 24449 * _.uniq([2, 1, 2]); 24450 * // => [2, 1] 24451 */ 24452 function uniq(array) { 24453 return (array && array.length) ? baseUniq(array) : []; 24454 } 24455 24456 /** 24457 * This method is like `_.uniq` except that it accepts `iteratee` which is 24458 * invoked for each element in `array` to generate the criterion by which 24459 * uniqueness is computed. The order of result values is determined by the 24460 * order they occur in the array. The iteratee is invoked with one argument: 24461 * (value). 24462 * 24463 * @static 24464 * @memberOf _ 24465 * @since 4.0.0 24466 * @category Array 24467 * @param {Array} array The array to inspect. 24468 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 24469 * @returns {Array} Returns the new duplicate free array. 24470 * @example 24471 * 24472 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 24473 * // => [2.1, 1.2] 24474 * 24475 * // The `_.property` iteratee shorthand. 24476 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 24477 * // => [{ 'x': 1 }, { 'x': 2 }] 24478 */ 24479 function uniqBy(array, iteratee) { 24480 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; 24481 } 24482 24483 /** 24484 * This method is like `_.uniq` except that it accepts `comparator` which 24485 * is invoked to compare elements of `array`. The order of result values is 24486 * determined by the order they occur in the array.The comparator is invoked 24487 * with two arguments: (arrVal, othVal). 24488 * 24489 * @static 24490 * @memberOf _ 24491 * @since 4.0.0 24492 * @category Array 24493 * @param {Array} array The array to inspect. 24494 * @param {Function} [comparator] The comparator invoked per element. 24495 * @returns {Array} Returns the new duplicate free array. 24496 * @example 24497 * 24498 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 24499 * 24500 * _.uniqWith(objects, _.isEqual); 24501 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 24502 */ 24503 function uniqWith(array, comparator) { 24504 comparator = typeof comparator == 'function' ? comparator : undefined; 24505 return (array && array.length) ? baseUniq(array, undefined, comparator) : []; 24506 } 24507 24508 /** 24509 * This method is like `_.zip` except that it accepts an array of grouped 24510 * elements and creates an array regrouping the elements to their pre-zip 24511 * configuration. 24512 * 24513 * @static 24514 * @memberOf _ 24515 * @since 1.2.0 24516 * @category Array 24517 * @param {Array} array The array of grouped elements to process. 24518 * @returns {Array} Returns the new array of regrouped elements. 24519 * @example 24520 * 24521 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 24522 * // => [['a', 1, true], ['b', 2, false]] 24523 * 24524 * _.unzip(zipped); 24525 * // => [['a', 'b'], [1, 2], [true, false]] 24526 */ 24527 function unzip(array) { 24528 if (!(array && array.length)) { 24529 return []; 24530 } 24531 var length = 0; 24532 array = arrayFilter(array, function(group) { 24533 if (isArrayLikeObject(group)) { 24534 length = nativeMax(group.length, length); 24535 return true; 24536 } 24537 }); 24538 return baseTimes(length, function(index) { 24539 return arrayMap(array, baseProperty(index)); 24540 }); 24541 } 24542 24543 /** 24544 * This method is like `_.unzip` except that it accepts `iteratee` to specify 24545 * how regrouped values should be combined. The iteratee is invoked with the 24546 * elements of each group: (...group). 24547 * 24548 * @static 24549 * @memberOf _ 24550 * @since 3.8.0 24551 * @category Array 24552 * @param {Array} array The array of grouped elements to process. 24553 * @param {Function} [iteratee=_.identity] The function to combine 24554 * regrouped values. 24555 * @returns {Array} Returns the new array of regrouped elements. 24556 * @example 24557 * 24558 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 24559 * // => [[1, 10, 100], [2, 20, 200]] 24560 * 24561 * _.unzipWith(zipped, _.add); 24562 * // => [3, 30, 300] 24563 */ 24564 function unzipWith(array, iteratee) { 24565 if (!(array && array.length)) { 24566 return []; 24567 } 24568 var result = unzip(array); 24569 if (iteratee == null) { 24570 return result; 24571 } 24572 return arrayMap(result, function(group) { 24573 return apply(iteratee, undefined, group); 24574 }); 24575 } 24576 24577 /** 24578 * Creates an array excluding all given values using 24579 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 24580 * for equality comparisons. 24581 * 24582 * **Note:** Unlike `_.pull`, this method returns a new array. 24583 * 24584 * @static 24585 * @memberOf _ 24586 * @since 0.1.0 24587 * @category Array 24588 * @param {Array} array The array to inspect. 24589 * @param {...*} [values] The values to exclude. 24590 * @returns {Array} Returns the new array of filtered values. 24591 * @see _.difference, _.xor 24592 * @example 24593 * 24594 * _.without([2, 1, 2, 3], 1, 2); 24595 * // => [3] 24596 */ 24597 var without = baseRest(function(array, values) { 24598 return isArrayLikeObject(array) 24599 ? baseDifference(array, values) 24600 : []; 24601 }); 24602 24603 /** 24604 * Creates an array of unique values that is the 24605 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 24606 * of the given arrays. The order of result values is determined by the order 24607 * they occur in the arrays. 24608 * 24609 * @static 24610 * @memberOf _ 24611 * @since 2.4.0 24612 * @category Array 24613 * @param {...Array} [arrays] The arrays to inspect. 24614 * @returns {Array} Returns the new array of filtered values. 24615 * @see _.difference, _.without 24616 * @example 24617 * 24618 * _.xor([2, 1], [2, 3]); 24619 * // => [1, 3] 24620 */ 24621 var xor = baseRest(function(arrays) { 24622 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 24623 }); 24624 24625 /** 24626 * This method is like `_.xor` except that it accepts `iteratee` which is 24627 * invoked for each element of each `arrays` to generate the criterion by 24628 * which by which they're compared. The order of result values is determined 24629 * by the order they occur in the arrays. The iteratee is invoked with one 24630 * argument: (value). 24631 * 24632 * @static 24633 * @memberOf _ 24634 * @since 4.0.0 24635 * @category Array 24636 * @param {...Array} [arrays] The arrays to inspect. 24637 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 24638 * @returns {Array} Returns the new array of filtered values. 24639 * @example 24640 * 24641 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 24642 * // => [1.2, 3.4] 24643 * 24644 * // The `_.property` iteratee shorthand. 24645 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 24646 * // => [{ 'x': 2 }] 24647 */ 24648 var xorBy = baseRest(function(arrays) { 24649 var iteratee = last(arrays); 24650 if (isArrayLikeObject(iteratee)) { 24651 iteratee = undefined; 24652 } 24653 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); 24654 }); 24655 24656 /** 24657 * This method is like `_.xor` except that it accepts `comparator` which is 24658 * invoked to compare elements of `arrays`. The order of result values is 24659 * determined by the order they occur in the arrays. The comparator is invoked 24660 * with two arguments: (arrVal, othVal). 24661 * 24662 * @static 24663 * @memberOf _ 24664 * @since 4.0.0 24665 * @category Array 24666 * @param {...Array} [arrays] The arrays to inspect. 24667 * @param {Function} [comparator] The comparator invoked per element. 24668 * @returns {Array} Returns the new array of filtered values. 24669 * @example 24670 * 24671 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 24672 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 24673 * 24674 * _.xorWith(objects, others, _.isEqual); 24675 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 24676 */ 24677 var xorWith = baseRest(function(arrays) { 24678 var comparator = last(arrays); 24679 comparator = typeof comparator == 'function' ? comparator : undefined; 24680 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); 24681 }); 24682 24683 /** 24684 * Creates an array of grouped elements, the first of which contains the 24685 * first elements of the given arrays, the second of which contains the 24686 * second elements of the given arrays, and so on. 24687 * 24688 * @static 24689 * @memberOf _ 24690 * @since 0.1.0 24691 * @category Array 24692 * @param {...Array} [arrays] The arrays to process. 24693 * @returns {Array} Returns the new array of grouped elements. 24694 * @example 24695 * 24696 * _.zip(['a', 'b'], [1, 2], [true, false]); 24697 * // => [['a', 1, true], ['b', 2, false]] 24698 */ 24699 var zip = baseRest(unzip); 24700 24701 /** 24702 * This method is like `_.fromPairs` except that it accepts two arrays, 24703 * one of property identifiers and one of corresponding values. 24704 * 24705 * @static 24706 * @memberOf _ 24707 * @since 0.4.0 24708 * @category Array 24709 * @param {Array} [props=[]] The property identifiers. 24710 * @param {Array} [values=[]] The property values. 24711 * @returns {Object} Returns the new object. 24712 * @example 24713 * 24714 * _.zipObject(['a', 'b'], [1, 2]); 24715 * // => { 'a': 1, 'b': 2 } 24716 */ 24717 function zipObject(props, values) { 24718 return baseZipObject(props || [], values || [], assignValue); 24719 } 24720 24721 /** 24722 * This method is like `_.zipObject` except that it supports property paths. 24723 * 24724 * @static 24725 * @memberOf _ 24726 * @since 4.1.0 24727 * @category Array 24728 * @param {Array} [props=[]] The property identifiers. 24729 * @param {Array} [values=[]] The property values. 24730 * @returns {Object} Returns the new object. 24731 * @example 24732 * 24733 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 24734 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 24735 */ 24736 function zipObjectDeep(props, values) { 24737 return baseZipObject(props || [], values || [], baseSet); 24738 } 24739 24740 /** 24741 * This method is like `_.zip` except that it accepts `iteratee` to specify 24742 * how grouped values should be combined. The iteratee is invoked with the 24743 * elements of each group: (...group). 24744 * 24745 * @static 24746 * @memberOf _ 24747 * @since 3.8.0 24748 * @category Array 24749 * @param {...Array} [arrays] The arrays to process. 24750 * @param {Function} [iteratee=_.identity] The function to combine 24751 * grouped values. 24752 * @returns {Array} Returns the new array of grouped elements. 24753 * @example 24754 * 24755 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 24756 * return a + b + c; 24757 * }); 24758 * // => [111, 222] 24759 */ 24760 var zipWith = baseRest(function(arrays) { 24761 var length = arrays.length, 24762 iteratee = length > 1 ? arrays[length - 1] : undefined; 24763 24764 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; 24765 return unzipWith(arrays, iteratee); 24766 }); 24767 24768 /*------------------------------------------------------------------------*/ 24769 24770 /** 24771 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 24772 * chain sequences enabled. The result of such sequences must be unwrapped 24773 * with `_#value`. 24774 * 24775 * @static 24776 * @memberOf _ 24777 * @since 1.3.0 24778 * @category Seq 24779 * @param {*} value The value to wrap. 24780 * @returns {Object} Returns the new `lodash` wrapper instance. 24781 * @example 24782 * 24783 * var users = [ 24784 * { 'user': 'barney', 'age': 36 }, 24785 * { 'user': 'fred', 'age': 40 }, 24786 * { 'user': 'pebbles', 'age': 1 } 24787 * ]; 24788 * 24789 * var youngest = _ 24790 * .chain(users) 24791 * .sortBy('age') 24792 * .map(function(o) { 24793 * return o.user + ' is ' + o.age; 24794 * }) 24795 * .head() 24796 * .value(); 24797 * // => 'pebbles is 1' 24798 */ 24799 function chain(value) { 24800 var result = lodash(value); 24801 result.__chain__ = true; 24802 return result; 24803 } 24804 24805 /** 24806 * This method invokes `interceptor` and returns `value`. The interceptor 24807 * is invoked with one argument; (value). The purpose of this method is to 24808 * "tap into" a method chain sequence in order to modify intermediate results. 24809 * 24810 * @static 24811 * @memberOf _ 24812 * @since 0.1.0 24813 * @category Seq 24814 * @param {*} value The value to provide to `interceptor`. 24815 * @param {Function} interceptor The function to invoke. 24816 * @returns {*} Returns `value`. 24817 * @example 24818 * 24819 * _([1, 2, 3]) 24820 * .tap(function(array) { 24821 * // Mutate input array. 24822 * array.pop(); 24823 * }) 24824 * .reverse() 24825 * .value(); 24826 * // => [2, 1] 24827 */ 24828 function tap(value, interceptor) { 24829 interceptor(value); 24830 return value; 24831 } 24832 24833 /** 24834 * This method is like `_.tap` except that it returns the result of `interceptor`. 24835 * The purpose of this method is to "pass thru" values replacing intermediate 24836 * results in a method chain sequence. 24837 * 24838 * @static 24839 * @memberOf _ 24840 * @since 3.0.0 24841 * @category Seq 24842 * @param {*} value The value to provide to `interceptor`. 24843 * @param {Function} interceptor The function to invoke. 24844 * @returns {*} Returns the result of `interceptor`. 24845 * @example 24846 * 24847 * _(' abc ') 24848 * .chain() 24849 * .trim() 24850 * .thru(function(value) { 24851 * return [value]; 24852 * }) 24853 * .value(); 24854 * // => ['abc'] 24855 */ 24856 function thru(value, interceptor) { 24857 return interceptor(value); 24858 } 24859 24860 /** 24861 * This method is the wrapper version of `_.at`. 24862 * 24863 * @name at 24864 * @memberOf _ 24865 * @since 1.0.0 24866 * @category Seq 24867 * @param {...(string|string[])} [paths] The property paths to pick. 24868 * @returns {Object} Returns the new `lodash` wrapper instance. 24869 * @example 24870 * 24871 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 24872 * 24873 * _(object).at(['a[0].b.c', 'a[1]']).value(); 24874 * // => [3, 4] 24875 */ 24876 var wrapperAt = flatRest(function(paths) { 24877 var length = paths.length, 24878 start = length ? paths[0] : 0, 24879 value = this.__wrapped__, 24880 interceptor = function(object) { return baseAt(object, paths); }; 24881 24882 if (length > 1 || this.__actions__.length || 24883 !(value instanceof LazyWrapper) || !isIndex(start)) { 24884 return this.thru(interceptor); 24885 } 24886 value = value.slice(start, +start + (length ? 1 : 0)); 24887 value.__actions__.push({ 24888 'func': thru, 24889 'args': [interceptor], 24890 'thisArg': undefined 24891 }); 24892 return new LodashWrapper(value, this.__chain__).thru(function(array) { 24893 if (length && !array.length) { 24894 array.push(undefined); 24895 } 24896 return array; 24897 }); 24898 }); 24899 24900 /** 24901 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 24902 * 24903 * @name chain 24904 * @memberOf _ 24905 * @since 0.1.0 24906 * @category Seq 24907 * @returns {Object} Returns the new `lodash` wrapper instance. 24908 * @example 24909 * 24910 * var users = [ 24911 * { 'user': 'barney', 'age': 36 }, 24912 * { 'user': 'fred', 'age': 40 } 24913 * ]; 24914 * 24915 * // A sequence without explicit chaining. 24916 * _(users).head(); 24917 * // => { 'user': 'barney', 'age': 36 } 24918 * 24919 * // A sequence with explicit chaining. 24920 * _(users) 24921 * .chain() 24922 * .head() 24923 * .pick('user') 24924 * .value(); 24925 * // => { 'user': 'barney' } 24926 */ 24927 function wrapperChain() { 24928 return chain(this); 24929 } 24930 24931 /** 24932 * Executes the chain sequence and returns the wrapped result. 24933 * 24934 * @name commit 24935 * @memberOf _ 24936 * @since 3.2.0 24937 * @category Seq 24938 * @returns {Object} Returns the new `lodash` wrapper instance. 24939 * @example 24940 * 24941 * var array = [1, 2]; 24942 * var wrapped = _(array).push(3); 24943 * 24944 * console.log(array); 24945 * // => [1, 2] 24946 * 24947 * wrapped = wrapped.commit(); 24948 * console.log(array); 24949 * // => [1, 2, 3] 24950 * 24951 * wrapped.last(); 24952 * // => 3 24953 * 24954 * console.log(array); 24955 * // => [1, 2, 3] 24956 */ 24957 function wrapperCommit() { 24958 return new LodashWrapper(this.value(), this.__chain__); 24959 } 24960 24961 /** 24962 * Gets the next value on a wrapped object following the 24963 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 24964 * 24965 * @name next 24966 * @memberOf _ 24967 * @since 4.0.0 24968 * @category Seq 24969 * @returns {Object} Returns the next iterator value. 24970 * @example 24971 * 24972 * var wrapped = _([1, 2]); 24973 * 24974 * wrapped.next(); 24975 * // => { 'done': false, 'value': 1 } 24976 * 24977 * wrapped.next(); 24978 * // => { 'done': false, 'value': 2 } 24979 * 24980 * wrapped.next(); 24981 * // => { 'done': true, 'value': undefined } 24982 */ 24983 function wrapperNext() { 24984 if (this.__values__ === undefined) { 24985 this.__values__ = toArray(this.value()); 24986 } 24987 var done = this.__index__ >= this.__values__.length, 24988 value = done ? undefined : this.__values__[this.__index__++]; 24989 24990 return { 'done': done, 'value': value }; 24991 } 24992 24993 /** 24994 * Enables the wrapper to be iterable. 24995 * 24996 * @name Symbol.iterator 24997 * @memberOf _ 24998 * @since 4.0.0 24999 * @category Seq 25000 * @returns {Object} Returns the wrapper object. 25001 * @example 25002 * 25003 * var wrapped = _([1, 2]); 25004 * 25005 * wrapped[Symbol.iterator]() === wrapped; 25006 * // => true 25007 * 25008 * Array.from(wrapped); 25009 * // => [1, 2] 25010 */ 25011 function wrapperToIterator() { 25012 return this; 25013 } 25014 25015 /** 25016 * Creates a clone of the chain sequence planting `value` as the wrapped value. 25017 * 25018 * @name plant 25019 * @memberOf _ 25020 * @since 3.2.0 25021 * @category Seq 25022 * @param {*} value The value to plant. 25023 * @returns {Object} Returns the new `lodash` wrapper instance. 25024 * @example 25025 * 25026 * function square(n) { 25027 * return n * n; 25028 * } 25029 * 25030 * var wrapped = _([1, 2]).map(square); 25031 * var other = wrapped.plant([3, 4]); 25032 * 25033 * other.value(); 25034 * // => [9, 16] 25035 * 25036 * wrapped.value(); 25037 * // => [1, 4] 25038 */ 25039 function wrapperPlant(value) { 25040 var result, 25041 parent = this; 25042 25043 while (parent instanceof baseLodash) { 25044 var clone = wrapperClone(parent); 25045 clone.__index__ = 0; 25046 clone.__values__ = undefined; 25047 if (result) { 25048 previous.__wrapped__ = clone; 25049 } else { 25050 result = clone; 25051 } 25052 var previous = clone; 25053 parent = parent.__wrapped__; 25054 } 25055 previous.__wrapped__ = value; 25056 return result; 25057 } 25058 25059 /** 25060 * This method is the wrapper version of `_.reverse`. 25061 * 25062 * **Note:** This method mutates the wrapped array. 25063 * 25064 * @name reverse 25065 * @memberOf _ 25066 * @since 0.1.0 25067 * @category Seq 25068 * @returns {Object} Returns the new `lodash` wrapper instance. 25069 * @example 25070 * 25071 * var array = [1, 2, 3]; 25072 * 25073 * _(array).reverse().value() 25074 * // => [3, 2, 1] 25075 * 25076 * console.log(array); 25077 * // => [3, 2, 1] 25078 */ 25079 function wrapperReverse() { 25080 var value = this.__wrapped__; 25081 if (value instanceof LazyWrapper) { 25082 var wrapped = value; 25083 if (this.__actions__.length) { 25084 wrapped = new LazyWrapper(this); 25085 } 25086 wrapped = wrapped.reverse(); 25087 wrapped.__actions__.push({ 25088 'func': thru, 25089 'args': [reverse], 25090 'thisArg': undefined 25091 }); 25092 return new LodashWrapper(wrapped, this.__chain__); 25093 } 25094 return this.thru(reverse); 25095 } 25096 25097 /** 25098 * Executes the chain sequence to resolve the unwrapped value. 25099 * 25100 * @name value 25101 * @memberOf _ 25102 * @since 0.1.0 25103 * @alias toJSON, valueOf 25104 * @category Seq 25105 * @returns {*} Returns the resolved unwrapped value. 25106 * @example 25107 * 25108 * _([1, 2, 3]).value(); 25109 * // => [1, 2, 3] 25110 */ 25111 function wrapperValue() { 25112 return baseWrapperValue(this.__wrapped__, this.__actions__); 25113 } 25114 25115 /*------------------------------------------------------------------------*/ 25116 25117 /** 25118 * Creates an object composed of keys generated from the results of running 25119 * each element of `collection` thru `iteratee`. The corresponding value of 25120 * each key is the number of times the key was returned by `iteratee`. The 25121 * iteratee is invoked with one argument: (value). 25122 * 25123 * @static 25124 * @memberOf _ 25125 * @since 0.5.0 25126 * @category Collection 25127 * @param {Array|Object} collection The collection to iterate over. 25128 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 25129 * @returns {Object} Returns the composed aggregate object. 25130 * @example 25131 * 25132 * _.countBy([6.1, 4.2, 6.3], Math.floor); 25133 * // => { '4': 1, '6': 2 } 25134 * 25135 * // The `_.property` iteratee shorthand. 25136 * _.countBy(['one', 'two', 'three'], 'length'); 25137 * // => { '3': 2, '5': 1 } 25138 */ 25139 var countBy = createAggregator(function(result, value, key) { 25140 if (hasOwnProperty.call(result, key)) { 25141 ++result[key]; 25142 } else { 25143 baseAssignValue(result, key, 1); 25144 } 25145 }); 25146 25147 /** 25148 * Checks if `predicate` returns truthy for **all** elements of `collection`. 25149 * Iteration is stopped once `predicate` returns falsey. The predicate is 25150 * invoked with three arguments: (value, index|key, collection). 25151 * 25152 * **Note:** This method returns `true` for 25153 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 25154 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 25155 * elements of empty collections. 25156 * 25157 * @static 25158 * @memberOf _ 25159 * @since 0.1.0 25160 * @category Collection 25161 * @param {Array|Object} collection The collection to iterate over. 25162 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25163 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 25164 * @returns {boolean} Returns `true` if all elements pass the predicate check, 25165 * else `false`. 25166 * @example 25167 * 25168 * _.every([true, 1, null, 'yes'], Boolean); 25169 * // => false 25170 * 25171 * var users = [ 25172 * { 'user': 'barney', 'age': 36, 'active': false }, 25173 * { 'user': 'fred', 'age': 40, 'active': false } 25174 * ]; 25175 * 25176 * // The `_.matches` iteratee shorthand. 25177 * _.every(users, { 'user': 'barney', 'active': false }); 25178 * // => false 25179 * 25180 * // The `_.matchesProperty` iteratee shorthand. 25181 * _.every(users, ['active', false]); 25182 * // => true 25183 * 25184 * // The `_.property` iteratee shorthand. 25185 * _.every(users, 'active'); 25186 * // => false 25187 */ 25188 function every(collection, predicate, guard) { 25189 var func = isArray(collection) ? arrayEvery : baseEvery; 25190 if (guard && isIterateeCall(collection, predicate, guard)) { 25191 predicate = undefined; 25192 } 25193 return func(collection, getIteratee(predicate, 3)); 25194 } 25195 25196 /** 25197 * Iterates over elements of `collection`, returning an array of all elements 25198 * `predicate` returns truthy for. The predicate is invoked with three 25199 * arguments: (value, index|key, collection). 25200 * 25201 * **Note:** Unlike `_.remove`, this method returns a new array. 25202 * 25203 * @static 25204 * @memberOf _ 25205 * @since 0.1.0 25206 * @category Collection 25207 * @param {Array|Object} collection The collection to iterate over. 25208 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25209 * @returns {Array} Returns the new filtered array. 25210 * @see _.reject 25211 * @example 25212 * 25213 * var users = [ 25214 * { 'user': 'barney', 'age': 36, 'active': true }, 25215 * { 'user': 'fred', 'age': 40, 'active': false } 25216 * ]; 25217 * 25218 * _.filter(users, function(o) { return !o.active; }); 25219 * // => objects for ['fred'] 25220 * 25221 * // The `_.matches` iteratee shorthand. 25222 * _.filter(users, { 'age': 36, 'active': true }); 25223 * // => objects for ['barney'] 25224 * 25225 * // The `_.matchesProperty` iteratee shorthand. 25226 * _.filter(users, ['active', false]); 25227 * // => objects for ['fred'] 25228 * 25229 * // The `_.property` iteratee shorthand. 25230 * _.filter(users, 'active'); 25231 * // => objects for ['barney'] 25232 * 25233 * // Combining several predicates using `_.overEvery` or `_.overSome`. 25234 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 25235 * // => objects for ['fred', 'barney'] 25236 */ 25237 function filter(collection, predicate) { 25238 var func = isArray(collection) ? arrayFilter : baseFilter; 25239 return func(collection, getIteratee(predicate, 3)); 25240 } 25241 25242 /** 25243 * Iterates over elements of `collection`, returning the first element 25244 * `predicate` returns truthy for. The predicate is invoked with three 25245 * arguments: (value, index|key, collection). 25246 * 25247 * @static 25248 * @memberOf _ 25249 * @since 0.1.0 25250 * @category Collection 25251 * @param {Array|Object} collection The collection to inspect. 25252 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25253 * @param {number} [fromIndex=0] The index to search from. 25254 * @returns {*} Returns the matched element, else `undefined`. 25255 * @example 25256 * 25257 * var users = [ 25258 * { 'user': 'barney', 'age': 36, 'active': true }, 25259 * { 'user': 'fred', 'age': 40, 'active': false }, 25260 * { 'user': 'pebbles', 'age': 1, 'active': true } 25261 * ]; 25262 * 25263 * _.find(users, function(o) { return o.age < 40; }); 25264 * // => object for 'barney' 25265 * 25266 * // The `_.matches` iteratee shorthand. 25267 * _.find(users, { 'age': 1, 'active': true }); 25268 * // => object for 'pebbles' 25269 * 25270 * // The `_.matchesProperty` iteratee shorthand. 25271 * _.find(users, ['active', false]); 25272 * // => object for 'fred' 25273 * 25274 * // The `_.property` iteratee shorthand. 25275 * _.find(users, 'active'); 25276 * // => object for 'barney' 25277 */ 25278 var find = createFind(findIndex); 25279 25280 /** 25281 * This method is like `_.find` except that it iterates over elements of 25282 * `collection` from right to left. 25283 * 25284 * @static 25285 * @memberOf _ 25286 * @since 2.0.0 25287 * @category Collection 25288 * @param {Array|Object} collection The collection to inspect. 25289 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25290 * @param {number} [fromIndex=collection.length-1] The index to search from. 25291 * @returns {*} Returns the matched element, else `undefined`. 25292 * @example 25293 * 25294 * _.findLast([1, 2, 3, 4], function(n) { 25295 * return n % 2 == 1; 25296 * }); 25297 * // => 3 25298 */ 25299 var findLast = createFind(findLastIndex); 25300 25301 /** 25302 * Creates a flattened array of values by running each element in `collection` 25303 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 25304 * with three arguments: (value, index|key, collection). 25305 * 25306 * @static 25307 * @memberOf _ 25308 * @since 4.0.0 25309 * @category Collection 25310 * @param {Array|Object} collection The collection to iterate over. 25311 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25312 * @returns {Array} Returns the new flattened array. 25313 * @example 25314 * 25315 * function duplicate(n) { 25316 * return [n, n]; 25317 * } 25318 * 25319 * _.flatMap([1, 2], duplicate); 25320 * // => [1, 1, 2, 2] 25321 */ 25322 function flatMap(collection, iteratee) { 25323 return baseFlatten(map(collection, iteratee), 1); 25324 } 25325 25326 /** 25327 * This method is like `_.flatMap` except that it recursively flattens the 25328 * mapped results. 25329 * 25330 * @static 25331 * @memberOf _ 25332 * @since 4.7.0 25333 * @category Collection 25334 * @param {Array|Object} collection The collection to iterate over. 25335 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25336 * @returns {Array} Returns the new flattened array. 25337 * @example 25338 * 25339 * function duplicate(n) { 25340 * return [[[n, n]]]; 25341 * } 25342 * 25343 * _.flatMapDeep([1, 2], duplicate); 25344 * // => [1, 1, 2, 2] 25345 */ 25346 function flatMapDeep(collection, iteratee) { 25347 return baseFlatten(map(collection, iteratee), INFINITY); 25348 } 25349 25350 /** 25351 * This method is like `_.flatMap` except that it recursively flattens the 25352 * mapped results up to `depth` times. 25353 * 25354 * @static 25355 * @memberOf _ 25356 * @since 4.7.0 25357 * @category Collection 25358 * @param {Array|Object} collection The collection to iterate over. 25359 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25360 * @param {number} [depth=1] The maximum recursion depth. 25361 * @returns {Array} Returns the new flattened array. 25362 * @example 25363 * 25364 * function duplicate(n) { 25365 * return [[[n, n]]]; 25366 * } 25367 * 25368 * _.flatMapDepth([1, 2], duplicate, 2); 25369 * // => [[1, 1], [2, 2]] 25370 */ 25371 function flatMapDepth(collection, iteratee, depth) { 25372 depth = depth === undefined ? 1 : toInteger(depth); 25373 return baseFlatten(map(collection, iteratee), depth); 25374 } 25375 25376 /** 25377 * Iterates over elements of `collection` and invokes `iteratee` for each element. 25378 * The iteratee is invoked with three arguments: (value, index|key, collection). 25379 * Iteratee functions may exit iteration early by explicitly returning `false`. 25380 * 25381 * **Note:** As with other "Collections" methods, objects with a "length" 25382 * property are iterated like arrays. To avoid this behavior use `_.forIn` 25383 * or `_.forOwn` for object iteration. 25384 * 25385 * @static 25386 * @memberOf _ 25387 * @since 0.1.0 25388 * @alias each 25389 * @category Collection 25390 * @param {Array|Object} collection The collection to iterate over. 25391 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25392 * @returns {Array|Object} Returns `collection`. 25393 * @see _.forEachRight 25394 * @example 25395 * 25396 * _.forEach([1, 2], function(value) { 25397 * console.log(value); 25398 * }); 25399 * // => Logs `1` then `2`. 25400 * 25401 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 25402 * console.log(key); 25403 * }); 25404 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 25405 */ 25406 function forEach(collection, iteratee) { 25407 var func = isArray(collection) ? arrayEach : baseEach; 25408 return func(collection, getIteratee(iteratee, 3)); 25409 } 25410 25411 /** 25412 * This method is like `_.forEach` except that it iterates over elements of 25413 * `collection` from right to left. 25414 * 25415 * @static 25416 * @memberOf _ 25417 * @since 2.0.0 25418 * @alias eachRight 25419 * @category Collection 25420 * @param {Array|Object} collection The collection to iterate over. 25421 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25422 * @returns {Array|Object} Returns `collection`. 25423 * @see _.forEach 25424 * @example 25425 * 25426 * _.forEachRight([1, 2], function(value) { 25427 * console.log(value); 25428 * }); 25429 * // => Logs `2` then `1`. 25430 */ 25431 function forEachRight(collection, iteratee) { 25432 var func = isArray(collection) ? arrayEachRight : baseEachRight; 25433 return func(collection, getIteratee(iteratee, 3)); 25434 } 25435 25436 /** 25437 * Creates an object composed of keys generated from the results of running 25438 * each element of `collection` thru `iteratee`. The order of grouped values 25439 * is determined by the order they occur in `collection`. The corresponding 25440 * value of each key is an array of elements responsible for generating the 25441 * key. The iteratee is invoked with one argument: (value). 25442 * 25443 * @static 25444 * @memberOf _ 25445 * @since 0.1.0 25446 * @category Collection 25447 * @param {Array|Object} collection The collection to iterate over. 25448 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 25449 * @returns {Object} Returns the composed aggregate object. 25450 * @example 25451 * 25452 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 25453 * // => { '4': [4.2], '6': [6.1, 6.3] } 25454 * 25455 * // The `_.property` iteratee shorthand. 25456 * _.groupBy(['one', 'two', 'three'], 'length'); 25457 * // => { '3': ['one', 'two'], '5': ['three'] } 25458 */ 25459 var groupBy = createAggregator(function(result, value, key) { 25460 if (hasOwnProperty.call(result, key)) { 25461 result[key].push(value); 25462 } else { 25463 baseAssignValue(result, key, [value]); 25464 } 25465 }); 25466 25467 /** 25468 * Checks if `value` is in `collection`. If `collection` is a string, it's 25469 * checked for a substring of `value`, otherwise 25470 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 25471 * is used for equality comparisons. If `fromIndex` is negative, it's used as 25472 * the offset from the end of `collection`. 25473 * 25474 * @static 25475 * @memberOf _ 25476 * @since 0.1.0 25477 * @category Collection 25478 * @param {Array|Object|string} collection The collection to inspect. 25479 * @param {*} value The value to search for. 25480 * @param {number} [fromIndex=0] The index to search from. 25481 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 25482 * @returns {boolean} Returns `true` if `value` is found, else `false`. 25483 * @example 25484 * 25485 * _.includes([1, 2, 3], 1); 25486 * // => true 25487 * 25488 * _.includes([1, 2, 3], 1, 2); 25489 * // => false 25490 * 25491 * _.includes({ 'a': 1, 'b': 2 }, 1); 25492 * // => true 25493 * 25494 * _.includes('abcd', 'bc'); 25495 * // => true 25496 */ 25497 function includes(collection, value, fromIndex, guard) { 25498 collection = isArrayLike(collection) ? collection : values(collection); 25499 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; 25500 25501 var length = collection.length; 25502 if (fromIndex < 0) { 25503 fromIndex = nativeMax(length + fromIndex, 0); 25504 } 25505 return isString(collection) 25506 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) 25507 : (!!length && baseIndexOf(collection, value, fromIndex) > -1); 25508 } 25509 25510 /** 25511 * Invokes the method at `path` of each element in `collection`, returning 25512 * an array of the results of each invoked method. Any additional arguments 25513 * are provided to each invoked method. If `path` is a function, it's invoked 25514 * for, and `this` bound to, each element in `collection`. 25515 * 25516 * @static 25517 * @memberOf _ 25518 * @since 4.0.0 25519 * @category Collection 25520 * @param {Array|Object} collection The collection to iterate over. 25521 * @param {Array|Function|string} path The path of the method to invoke or 25522 * the function invoked per iteration. 25523 * @param {...*} [args] The arguments to invoke each method with. 25524 * @returns {Array} Returns the array of results. 25525 * @example 25526 * 25527 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 25528 * // => [[1, 5, 7], [1, 2, 3]] 25529 * 25530 * _.invokeMap([123, 456], String.prototype.split, ''); 25531 * // => [['1', '2', '3'], ['4', '5', '6']] 25532 */ 25533 var invokeMap = baseRest(function(collection, path, args) { 25534 var index = -1, 25535 isFunc = typeof path == 'function', 25536 result = isArrayLike(collection) ? Array(collection.length) : []; 25537 25538 baseEach(collection, function(value) { 25539 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); 25540 }); 25541 return result; 25542 }); 25543 25544 /** 25545 * Creates an object composed of keys generated from the results of running 25546 * each element of `collection` thru `iteratee`. The corresponding value of 25547 * each key is the last element responsible for generating the key. The 25548 * iteratee is invoked with one argument: (value). 25549 * 25550 * @static 25551 * @memberOf _ 25552 * @since 4.0.0 25553 * @category Collection 25554 * @param {Array|Object} collection The collection to iterate over. 25555 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 25556 * @returns {Object} Returns the composed aggregate object. 25557 * @example 25558 * 25559 * var array = [ 25560 * { 'dir': 'left', 'code': 97 }, 25561 * { 'dir': 'right', 'code': 100 } 25562 * ]; 25563 * 25564 * _.keyBy(array, function(o) { 25565 * return String.fromCharCode(o.code); 25566 * }); 25567 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 25568 * 25569 * _.keyBy(array, 'dir'); 25570 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 25571 */ 25572 var keyBy = createAggregator(function(result, value, key) { 25573 baseAssignValue(result, key, value); 25574 }); 25575 25576 /** 25577 * Creates an array of values by running each element in `collection` thru 25578 * `iteratee`. The iteratee is invoked with three arguments: 25579 * (value, index|key, collection). 25580 * 25581 * Many lodash methods are guarded to work as iteratees for methods like 25582 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 25583 * 25584 * The guarded methods are: 25585 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 25586 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 25587 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 25588 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 25589 * 25590 * @static 25591 * @memberOf _ 25592 * @since 0.1.0 25593 * @category Collection 25594 * @param {Array|Object} collection The collection to iterate over. 25595 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25596 * @returns {Array} Returns the new mapped array. 25597 * @example 25598 * 25599 * function square(n) { 25600 * return n * n; 25601 * } 25602 * 25603 * _.map([4, 8], square); 25604 * // => [16, 64] 25605 * 25606 * _.map({ 'a': 4, 'b': 8 }, square); 25607 * // => [16, 64] (iteration order is not guaranteed) 25608 * 25609 * var users = [ 25610 * { 'user': 'barney' }, 25611 * { 'user': 'fred' } 25612 * ]; 25613 * 25614 * // The `_.property` iteratee shorthand. 25615 * _.map(users, 'user'); 25616 * // => ['barney', 'fred'] 25617 */ 25618 function map(collection, iteratee) { 25619 var func = isArray(collection) ? arrayMap : baseMap; 25620 return func(collection, getIteratee(iteratee, 3)); 25621 } 25622 25623 /** 25624 * This method is like `_.sortBy` except that it allows specifying the sort 25625 * orders of the iteratees to sort by. If `orders` is unspecified, all values 25626 * are sorted in ascending order. Otherwise, specify an order of "desc" for 25627 * descending or "asc" for ascending sort order of corresponding values. 25628 * 25629 * @static 25630 * @memberOf _ 25631 * @since 4.0.0 25632 * @category Collection 25633 * @param {Array|Object} collection The collection to iterate over. 25634 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 25635 * The iteratees to sort by. 25636 * @param {string[]} [orders] The sort orders of `iteratees`. 25637 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 25638 * @returns {Array} Returns the new sorted array. 25639 * @example 25640 * 25641 * var users = [ 25642 * { 'user': 'fred', 'age': 48 }, 25643 * { 'user': 'barney', 'age': 34 }, 25644 * { 'user': 'fred', 'age': 40 }, 25645 * { 'user': 'barney', 'age': 36 } 25646 * ]; 25647 * 25648 * // Sort by `user` in ascending order and by `age` in descending order. 25649 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 25650 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 25651 */ 25652 function orderBy(collection, iteratees, orders, guard) { 25653 if (collection == null) { 25654 return []; 25655 } 25656 if (!isArray(iteratees)) { 25657 iteratees = iteratees == null ? [] : [iteratees]; 25658 } 25659 orders = guard ? undefined : orders; 25660 if (!isArray(orders)) { 25661 orders = orders == null ? [] : [orders]; 25662 } 25663 return baseOrderBy(collection, iteratees, orders); 25664 } 25665 25666 /** 25667 * Creates an array of elements split into two groups, the first of which 25668 * contains elements `predicate` returns truthy for, the second of which 25669 * contains elements `predicate` returns falsey for. The predicate is 25670 * invoked with one argument: (value). 25671 * 25672 * @static 25673 * @memberOf _ 25674 * @since 3.0.0 25675 * @category Collection 25676 * @param {Array|Object} collection The collection to iterate over. 25677 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25678 * @returns {Array} Returns the array of grouped elements. 25679 * @example 25680 * 25681 * var users = [ 25682 * { 'user': 'barney', 'age': 36, 'active': false }, 25683 * { 'user': 'fred', 'age': 40, 'active': true }, 25684 * { 'user': 'pebbles', 'age': 1, 'active': false } 25685 * ]; 25686 * 25687 * _.partition(users, function(o) { return o.active; }); 25688 * // => objects for [['fred'], ['barney', 'pebbles']] 25689 * 25690 * // The `_.matches` iteratee shorthand. 25691 * _.partition(users, { 'age': 1, 'active': false }); 25692 * // => objects for [['pebbles'], ['barney', 'fred']] 25693 * 25694 * // The `_.matchesProperty` iteratee shorthand. 25695 * _.partition(users, ['active', false]); 25696 * // => objects for [['barney', 'pebbles'], ['fred']] 25697 * 25698 * // The `_.property` iteratee shorthand. 25699 * _.partition(users, 'active'); 25700 * // => objects for [['fred'], ['barney', 'pebbles']] 25701 */ 25702 var partition = createAggregator(function(result, value, key) { 25703 result[key ? 0 : 1].push(value); 25704 }, function() { return [[], []]; }); 25705 25706 /** 25707 * Reduces `collection` to a value which is the accumulated result of running 25708 * each element in `collection` thru `iteratee`, where each successive 25709 * invocation is supplied the return value of the previous. If `accumulator` 25710 * is not given, the first element of `collection` is used as the initial 25711 * value. The iteratee is invoked with four arguments: 25712 * (accumulator, value, index|key, collection). 25713 * 25714 * Many lodash methods are guarded to work as iteratees for methods like 25715 * `_.reduce`, `_.reduceRight`, and `_.transform`. 25716 * 25717 * The guarded methods are: 25718 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 25719 * and `sortBy` 25720 * 25721 * @static 25722 * @memberOf _ 25723 * @since 0.1.0 25724 * @category Collection 25725 * @param {Array|Object} collection The collection to iterate over. 25726 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25727 * @param {*} [accumulator] The initial value. 25728 * @returns {*} Returns the accumulated value. 25729 * @see _.reduceRight 25730 * @example 25731 * 25732 * _.reduce([1, 2], function(sum, n) { 25733 * return sum + n; 25734 * }, 0); 25735 * // => 3 25736 * 25737 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 25738 * (result[value] || (result[value] = [])).push(key); 25739 * return result; 25740 * }, {}); 25741 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 25742 */ 25743 function reduce(collection, iteratee, accumulator) { 25744 var func = isArray(collection) ? arrayReduce : baseReduce, 25745 initAccum = arguments.length < 3; 25746 25747 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); 25748 } 25749 25750 /** 25751 * This method is like `_.reduce` except that it iterates over elements of 25752 * `collection` from right to left. 25753 * 25754 * @static 25755 * @memberOf _ 25756 * @since 0.1.0 25757 * @category Collection 25758 * @param {Array|Object} collection The collection to iterate over. 25759 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 25760 * @param {*} [accumulator] The initial value. 25761 * @returns {*} Returns the accumulated value. 25762 * @see _.reduce 25763 * @example 25764 * 25765 * var array = [[0, 1], [2, 3], [4, 5]]; 25766 * 25767 * _.reduceRight(array, function(flattened, other) { 25768 * return flattened.concat(other); 25769 * }, []); 25770 * // => [4, 5, 2, 3, 0, 1] 25771 */ 25772 function reduceRight(collection, iteratee, accumulator) { 25773 var func = isArray(collection) ? arrayReduceRight : baseReduce, 25774 initAccum = arguments.length < 3; 25775 25776 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); 25777 } 25778 25779 /** 25780 * The opposite of `_.filter`; this method returns the elements of `collection` 25781 * that `predicate` does **not** return truthy for. 25782 * 25783 * @static 25784 * @memberOf _ 25785 * @since 0.1.0 25786 * @category Collection 25787 * @param {Array|Object} collection The collection to iterate over. 25788 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25789 * @returns {Array} Returns the new filtered array. 25790 * @see _.filter 25791 * @example 25792 * 25793 * var users = [ 25794 * { 'user': 'barney', 'age': 36, 'active': false }, 25795 * { 'user': 'fred', 'age': 40, 'active': true } 25796 * ]; 25797 * 25798 * _.reject(users, function(o) { return !o.active; }); 25799 * // => objects for ['fred'] 25800 * 25801 * // The `_.matches` iteratee shorthand. 25802 * _.reject(users, { 'age': 40, 'active': true }); 25803 * // => objects for ['barney'] 25804 * 25805 * // The `_.matchesProperty` iteratee shorthand. 25806 * _.reject(users, ['active', false]); 25807 * // => objects for ['fred'] 25808 * 25809 * // The `_.property` iteratee shorthand. 25810 * _.reject(users, 'active'); 25811 * // => objects for ['barney'] 25812 */ 25813 function reject(collection, predicate) { 25814 var func = isArray(collection) ? arrayFilter : baseFilter; 25815 return func(collection, negate(getIteratee(predicate, 3))); 25816 } 25817 25818 /** 25819 * Gets a random element from `collection`. 25820 * 25821 * @static 25822 * @memberOf _ 25823 * @since 2.0.0 25824 * @category Collection 25825 * @param {Array|Object} collection The collection to sample. 25826 * @returns {*} Returns the random element. 25827 * @example 25828 * 25829 * _.sample([1, 2, 3, 4]); 25830 * // => 2 25831 */ 25832 function sample(collection) { 25833 var func = isArray(collection) ? arraySample : baseSample; 25834 return func(collection); 25835 } 25836 25837 /** 25838 * Gets `n` random elements at unique keys from `collection` up to the 25839 * size of `collection`. 25840 * 25841 * @static 25842 * @memberOf _ 25843 * @since 4.0.0 25844 * @category Collection 25845 * @param {Array|Object} collection The collection to sample. 25846 * @param {number} [n=1] The number of elements to sample. 25847 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 25848 * @returns {Array} Returns the random elements. 25849 * @example 25850 * 25851 * _.sampleSize([1, 2, 3], 2); 25852 * // => [3, 1] 25853 * 25854 * _.sampleSize([1, 2, 3], 4); 25855 * // => [2, 3, 1] 25856 */ 25857 function sampleSize(collection, n, guard) { 25858 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { 25859 n = 1; 25860 } else { 25861 n = toInteger(n); 25862 } 25863 var func = isArray(collection) ? arraySampleSize : baseSampleSize; 25864 return func(collection, n); 25865 } 25866 25867 /** 25868 * Creates an array of shuffled values, using a version of the 25869 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 25870 * 25871 * @static 25872 * @memberOf _ 25873 * @since 0.1.0 25874 * @category Collection 25875 * @param {Array|Object} collection The collection to shuffle. 25876 * @returns {Array} Returns the new shuffled array. 25877 * @example 25878 * 25879 * _.shuffle([1, 2, 3, 4]); 25880 * // => [4, 1, 3, 2] 25881 */ 25882 function shuffle(collection) { 25883 var func = isArray(collection) ? arrayShuffle : baseShuffle; 25884 return func(collection); 25885 } 25886 25887 /** 25888 * Gets the size of `collection` by returning its length for array-like 25889 * values or the number of own enumerable string keyed properties for objects. 25890 * 25891 * @static 25892 * @memberOf _ 25893 * @since 0.1.0 25894 * @category Collection 25895 * @param {Array|Object|string} collection The collection to inspect. 25896 * @returns {number} Returns the collection size. 25897 * @example 25898 * 25899 * _.size([1, 2, 3]); 25900 * // => 3 25901 * 25902 * _.size({ 'a': 1, 'b': 2 }); 25903 * // => 2 25904 * 25905 * _.size('pebbles'); 25906 * // => 7 25907 */ 25908 function size(collection) { 25909 if (collection == null) { 25910 return 0; 25911 } 25912 if (isArrayLike(collection)) { 25913 return isString(collection) ? stringSize(collection) : collection.length; 25914 } 25915 var tag = getTag(collection); 25916 if (tag == mapTag || tag == setTag) { 25917 return collection.size; 25918 } 25919 return baseKeys(collection).length; 25920 } 25921 25922 /** 25923 * Checks if `predicate` returns truthy for **any** element of `collection`. 25924 * Iteration is stopped once `predicate` returns truthy. The predicate is 25925 * invoked with three arguments: (value, index|key, collection). 25926 * 25927 * @static 25928 * @memberOf _ 25929 * @since 0.1.0 25930 * @category Collection 25931 * @param {Array|Object} collection The collection to iterate over. 25932 * @param {Function} [predicate=_.identity] The function invoked per iteration. 25933 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 25934 * @returns {boolean} Returns `true` if any element passes the predicate check, 25935 * else `false`. 25936 * @example 25937 * 25938 * _.some([null, 0, 'yes', false], Boolean); 25939 * // => true 25940 * 25941 * var users = [ 25942 * { 'user': 'barney', 'active': true }, 25943 * { 'user': 'fred', 'active': false } 25944 * ]; 25945 * 25946 * // The `_.matches` iteratee shorthand. 25947 * _.some(users, { 'user': 'barney', 'active': false }); 25948 * // => false 25949 * 25950 * // The `_.matchesProperty` iteratee shorthand. 25951 * _.some(users, ['active', false]); 25952 * // => true 25953 * 25954 * // The `_.property` iteratee shorthand. 25955 * _.some(users, 'active'); 25956 * // => true 25957 */ 25958 function some(collection, predicate, guard) { 25959 var func = isArray(collection) ? arraySome : baseSome; 25960 if (guard && isIterateeCall(collection, predicate, guard)) { 25961 predicate = undefined; 25962 } 25963 return func(collection, getIteratee(predicate, 3)); 25964 } 25965 25966 /** 25967 * Creates an array of elements, sorted in ascending order by the results of 25968 * running each element in a collection thru each iteratee. This method 25969 * performs a stable sort, that is, it preserves the original sort order of 25970 * equal elements. The iteratees are invoked with one argument: (value). 25971 * 25972 * @static 25973 * @memberOf _ 25974 * @since 0.1.0 25975 * @category Collection 25976 * @param {Array|Object} collection The collection to iterate over. 25977 * @param {...(Function|Function[])} [iteratees=[_.identity]] 25978 * The iteratees to sort by. 25979 * @returns {Array} Returns the new sorted array. 25980 * @example 25981 * 25982 * var users = [ 25983 * { 'user': 'fred', 'age': 48 }, 25984 * { 'user': 'barney', 'age': 36 }, 25985 * { 'user': 'fred', 'age': 30 }, 25986 * { 'user': 'barney', 'age': 34 } 25987 * ]; 25988 * 25989 * _.sortBy(users, [function(o) { return o.user; }]); 25990 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 25991 * 25992 * _.sortBy(users, ['user', 'age']); 25993 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 25994 */ 25995 var sortBy = baseRest(function(collection, iteratees) { 25996 if (collection == null) { 25997 return []; 25998 } 25999 var length = iteratees.length; 26000 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 26001 iteratees = []; 26002 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 26003 iteratees = [iteratees[0]]; 26004 } 26005 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 26006 }); 26007 26008 /*------------------------------------------------------------------------*/ 26009 26010 /** 26011 * Gets the timestamp of the number of milliseconds that have elapsed since 26012 * the Unix epoch (1 January 1970 00:00:00 UTC). 26013 * 26014 * @static 26015 * @memberOf _ 26016 * @since 2.4.0 26017 * @category Date 26018 * @returns {number} Returns the timestamp. 26019 * @example 26020 * 26021 * _.defer(function(stamp) { 26022 * console.log(_.now() - stamp); 26023 * }, _.now()); 26024 * // => Logs the number of milliseconds it took for the deferred invocation. 26025 */ 26026 var now = ctxNow || function() { 26027 return root.Date.now(); 26028 }; 26029 26030 /*------------------------------------------------------------------------*/ 26031 26032 /** 26033 * The opposite of `_.before`; this method creates a function that invokes 26034 * `func` once it's called `n` or more times. 26035 * 26036 * @static 26037 * @memberOf _ 26038 * @since 0.1.0 26039 * @category Function 26040 * @param {number} n The number of calls before `func` is invoked. 26041 * @param {Function} func The function to restrict. 26042 * @returns {Function} Returns the new restricted function. 26043 * @example 26044 * 26045 * var saves = ['profile', 'settings']; 26046 * 26047 * var done = _.after(saves.length, function() { 26048 * console.log('done saving!'); 26049 * }); 26050 * 26051 * _.forEach(saves, function(type) { 26052 * asyncSave({ 'type': type, 'complete': done }); 26053 * }); 26054 * // => Logs 'done saving!' after the two async saves have completed. 26055 */ 26056 function after(n, func) { 26057 if (typeof func != 'function') { 26058 throw new TypeError(FUNC_ERROR_TEXT); 26059 } 26060 n = toInteger(n); 26061 return function() { 26062 if (--n < 1) { 26063 return func.apply(this, arguments); 26064 } 26065 }; 26066 } 26067 26068 /** 26069 * Creates a function that invokes `func`, with up to `n` arguments, 26070 * ignoring any additional arguments. 26071 * 26072 * @static 26073 * @memberOf _ 26074 * @since 3.0.0 26075 * @category Function 26076 * @param {Function} func The function to cap arguments for. 26077 * @param {number} [n=func.length] The arity cap. 26078 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 26079 * @returns {Function} Returns the new capped function. 26080 * @example 26081 * 26082 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 26083 * // => [6, 8, 10] 26084 */ 26085 function ary(func, n, guard) { 26086 n = guard ? undefined : n; 26087 n = (func && n == null) ? func.length : n; 26088 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); 26089 } 26090 26091 /** 26092 * Creates a function that invokes `func`, with the `this` binding and arguments 26093 * of the created function, while it's called less than `n` times. Subsequent 26094 * calls to the created function return the result of the last `func` invocation. 26095 * 26096 * @static 26097 * @memberOf _ 26098 * @since 3.0.0 26099 * @category Function 26100 * @param {number} n The number of calls at which `func` is no longer invoked. 26101 * @param {Function} func The function to restrict. 26102 * @returns {Function} Returns the new restricted function. 26103 * @example 26104 * 26105 * jQuery(element).on('click', _.before(5, addContactToList)); 26106 * // => Allows adding up to 4 contacts to the list. 26107 */ 26108 function before(n, func) { 26109 var result; 26110 if (typeof func != 'function') { 26111 throw new TypeError(FUNC_ERROR_TEXT); 26112 } 26113 n = toInteger(n); 26114 return function() { 26115 if (--n > 0) { 26116 result = func.apply(this, arguments); 26117 } 26118 if (n <= 1) { 26119 func = undefined; 26120 } 26121 return result; 26122 }; 26123 } 26124 26125 /** 26126 * Creates a function that invokes `func` with the `this` binding of `thisArg` 26127 * and `partials` prepended to the arguments it receives. 26128 * 26129 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 26130 * may be used as a placeholder for partially applied arguments. 26131 * 26132 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 26133 * property of bound functions. 26134 * 26135 * @static 26136 * @memberOf _ 26137 * @since 0.1.0 26138 * @category Function 26139 * @param {Function} func The function to bind. 26140 * @param {*} thisArg The `this` binding of `func`. 26141 * @param {...*} [partials] The arguments to be partially applied. 26142 * @returns {Function} Returns the new bound function. 26143 * @example 26144 * 26145 * function greet(greeting, punctuation) { 26146 * return greeting + ' ' + this.user + punctuation; 26147 * } 26148 * 26149 * var object = { 'user': 'fred' }; 26150 * 26151 * var bound = _.bind(greet, object, 'hi'); 26152 * bound('!'); 26153 * // => 'hi fred!' 26154 * 26155 * // Bound with placeholders. 26156 * var bound = _.bind(greet, object, _, '!'); 26157 * bound('hi'); 26158 * // => 'hi fred!' 26159 */ 26160 var bind = baseRest(function(func, thisArg, partials) { 26161 var bitmask = WRAP_BIND_FLAG; 26162 if (partials.length) { 26163 var holders = replaceHolders(partials, getHolder(bind)); 26164 bitmask |= WRAP_PARTIAL_FLAG; 26165 } 26166 return createWrap(func, bitmask, thisArg, partials, holders); 26167 }); 26168 26169 /** 26170 * Creates a function that invokes the method at `object[key]` with `partials` 26171 * prepended to the arguments it receives. 26172 * 26173 * This method differs from `_.bind` by allowing bound functions to reference 26174 * methods that may be redefined or don't yet exist. See 26175 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 26176 * for more details. 26177 * 26178 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 26179 * builds, may be used as a placeholder for partially applied arguments. 26180 * 26181 * @static 26182 * @memberOf _ 26183 * @since 0.10.0 26184 * @category Function 26185 * @param {Object} object The object to invoke the method on. 26186 * @param {string} key The key of the method. 26187 * @param {...*} [partials] The arguments to be partially applied. 26188 * @returns {Function} Returns the new bound function. 26189 * @example 26190 * 26191 * var object = { 26192 * 'user': 'fred', 26193 * 'greet': function(greeting, punctuation) { 26194 * return greeting + ' ' + this.user + punctuation; 26195 * } 26196 * }; 26197 * 26198 * var bound = _.bindKey(object, 'greet', 'hi'); 26199 * bound('!'); 26200 * // => 'hi fred!' 26201 * 26202 * object.greet = function(greeting, punctuation) { 26203 * return greeting + 'ya ' + this.user + punctuation; 26204 * }; 26205 * 26206 * bound('!'); 26207 * // => 'hiya fred!' 26208 * 26209 * // Bound with placeholders. 26210 * var bound = _.bindKey(object, 'greet', _, '!'); 26211 * bound('hi'); 26212 * // => 'hiya fred!' 26213 */ 26214 var bindKey = baseRest(function(object, key, partials) { 26215 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 26216 if (partials.length) { 26217 var holders = replaceHolders(partials, getHolder(bindKey)); 26218 bitmask |= WRAP_PARTIAL_FLAG; 26219 } 26220 return createWrap(key, bitmask, object, partials, holders); 26221 }); 26222 26223 /** 26224 * Creates a function that accepts arguments of `func` and either invokes 26225 * `func` returning its result, if at least `arity` number of arguments have 26226 * been provided, or returns a function that accepts the remaining `func` 26227 * arguments, and so on. The arity of `func` may be specified if `func.length` 26228 * is not sufficient. 26229 * 26230 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 26231 * may be used as a placeholder for provided arguments. 26232 * 26233 * **Note:** This method doesn't set the "length" property of curried functions. 26234 * 26235 * @static 26236 * @memberOf _ 26237 * @since 2.0.0 26238 * @category Function 26239 * @param {Function} func The function to curry. 26240 * @param {number} [arity=func.length] The arity of `func`. 26241 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 26242 * @returns {Function} Returns the new curried function. 26243 * @example 26244 * 26245 * var abc = function(a, b, c) { 26246 * return [a, b, c]; 26247 * }; 26248 * 26249 * var curried = _.curry(abc); 26250 * 26251 * curried(1)(2)(3); 26252 * // => [1, 2, 3] 26253 * 26254 * curried(1, 2)(3); 26255 * // => [1, 2, 3] 26256 * 26257 * curried(1, 2, 3); 26258 * // => [1, 2, 3] 26259 * 26260 * // Curried with placeholders. 26261 * curried(1)(_, 3)(2); 26262 * // => [1, 2, 3] 26263 */ 26264 function curry(func, arity, guard) { 26265 arity = guard ? undefined : arity; 26266 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 26267 result.placeholder = curry.placeholder; 26268 return result; 26269 } 26270 26271 /** 26272 * This method is like `_.curry` except that arguments are applied to `func` 26273 * in the manner of `_.partialRight` instead of `_.partial`. 26274 * 26275 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 26276 * builds, may be used as a placeholder for provided arguments. 26277 * 26278 * **Note:** This method doesn't set the "length" property of curried functions. 26279 * 26280 * @static 26281 * @memberOf _ 26282 * @since 3.0.0 26283 * @category Function 26284 * @param {Function} func The function to curry. 26285 * @param {number} [arity=func.length] The arity of `func`. 26286 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 26287 * @returns {Function} Returns the new curried function. 26288 * @example 26289 * 26290 * var abc = function(a, b, c) { 26291 * return [a, b, c]; 26292 * }; 26293 * 26294 * var curried = _.curryRight(abc); 26295 * 26296 * curried(3)(2)(1); 26297 * // => [1, 2, 3] 26298 * 26299 * curried(2, 3)(1); 26300 * // => [1, 2, 3] 26301 * 26302 * curried(1, 2, 3); 26303 * // => [1, 2, 3] 26304 * 26305 * // Curried with placeholders. 26306 * curried(3)(1, _)(2); 26307 * // => [1, 2, 3] 26308 */ 26309 function curryRight(func, arity, guard) { 26310 arity = guard ? undefined : arity; 26311 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 26312 result.placeholder = curryRight.placeholder; 26313 return result; 26314 } 26315 26316 /** 26317 * Creates a debounced function that delays invoking `func` until after `wait` 26318 * milliseconds have elapsed since the last time the debounced function was 26319 * invoked. The debounced function comes with a `cancel` method to cancel 26320 * delayed `func` invocations and a `flush` method to immediately invoke them. 26321 * Provide `options` to indicate whether `func` should be invoked on the 26322 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 26323 * with the last arguments provided to the debounced function. Subsequent 26324 * calls to the debounced function return the result of the last `func` 26325 * invocation. 26326 * 26327 * **Note:** If `leading` and `trailing` options are `true`, `func` is 26328 * invoked on the trailing edge of the timeout only if the debounced function 26329 * is invoked more than once during the `wait` timeout. 26330 * 26331 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 26332 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 26333 * 26334 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 26335 * for details over the differences between `_.debounce` and `_.throttle`. 26336 * 26337 * @static 26338 * @memberOf _ 26339 * @since 0.1.0 26340 * @category Function 26341 * @param {Function} func The function to debounce. 26342 * @param {number} [wait=0] The number of milliseconds to delay. 26343 * @param {Object} [options={}] The options object. 26344 * @param {boolean} [options.leading=false] 26345 * Specify invoking on the leading edge of the timeout. 26346 * @param {number} [options.maxWait] 26347 * The maximum time `func` is allowed to be delayed before it's invoked. 26348 * @param {boolean} [options.trailing=true] 26349 * Specify invoking on the trailing edge of the timeout. 26350 * @returns {Function} Returns the new debounced function. 26351 * @example 26352 * 26353 * // Avoid costly calculations while the window size is in flux. 26354 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 26355 * 26356 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 26357 * jQuery(element).on('click', _.debounce(sendMail, 300, { 26358 * 'leading': true, 26359 * 'trailing': false 26360 * })); 26361 * 26362 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 26363 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 26364 * var source = new EventSource('/stream'); 26365 * jQuery(source).on('message', debounced); 26366 * 26367 * // Cancel the trailing debounced invocation. 26368 * jQuery(window).on('popstate', debounced.cancel); 26369 */ 26370 function debounce(func, wait, options) { 26371 var lastArgs, 26372 lastThis, 26373 maxWait, 26374 result, 26375 timerId, 26376 lastCallTime, 26377 lastInvokeTime = 0, 26378 leading = false, 26379 maxing = false, 26380 trailing = true; 26381 26382 if (typeof func != 'function') { 26383 throw new TypeError(FUNC_ERROR_TEXT); 26384 } 26385 wait = toNumber(wait) || 0; 26386 if (isObject(options)) { 26387 leading = !!options.leading; 26388 maxing = 'maxWait' in options; 26389 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 26390 trailing = 'trailing' in options ? !!options.trailing : trailing; 26391 } 26392 26393 function invokeFunc(time) { 26394 var args = lastArgs, 26395 thisArg = lastThis; 26396 26397 lastArgs = lastThis = undefined; 26398 lastInvokeTime = time; 26399 result = func.apply(thisArg, args); 26400 return result; 26401 } 26402 26403 function leadingEdge(time) { 26404 // Reset any `maxWait` timer. 26405 lastInvokeTime = time; 26406 // Start the timer for the trailing edge. 26407 timerId = setTimeout(timerExpired, wait); 26408 // Invoke the leading edge. 26409 return leading ? invokeFunc(time) : result; 26410 } 26411 26412 function remainingWait(time) { 26413 var timeSinceLastCall = time - lastCallTime, 26414 timeSinceLastInvoke = time - lastInvokeTime, 26415 timeWaiting = wait - timeSinceLastCall; 26416 26417 return maxing 26418 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 26419 : timeWaiting; 26420 } 26421 26422 function shouldInvoke(time) { 26423 var timeSinceLastCall = time - lastCallTime, 26424 timeSinceLastInvoke = time - lastInvokeTime; 26425 26426 // Either this is the first call, activity has stopped and we're at the 26427 // trailing edge, the system time has gone backwards and we're treating 26428 // it as the trailing edge, or we've hit the `maxWait` limit. 26429 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 26430 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 26431 } 26432 26433 function timerExpired() { 26434 var time = now(); 26435 if (shouldInvoke(time)) { 26436 return trailingEdge(time); 26437 } 26438 // Restart the timer. 26439 timerId = setTimeout(timerExpired, remainingWait(time)); 26440 } 26441 26442 function trailingEdge(time) { 26443 timerId = undefined; 26444 26445 // Only invoke if we have `lastArgs` which means `func` has been 26446 // debounced at least once. 26447 if (trailing && lastArgs) { 26448 return invokeFunc(time); 26449 } 26450 lastArgs = lastThis = undefined; 26451 return result; 26452 } 26453 26454 function cancel() { 26455 if (timerId !== undefined) { 26456 clearTimeout(timerId); 26457 } 26458 lastInvokeTime = 0; 26459 lastArgs = lastCallTime = lastThis = timerId = undefined; 26460 } 26461 26462 function flush() { 26463 return timerId === undefined ? result : trailingEdge(now()); 26464 } 26465 26466 function debounced() { 26467 var time = now(), 26468 isInvoking = shouldInvoke(time); 26469 26470 lastArgs = arguments; 26471 lastThis = this; 26472 lastCallTime = time; 26473 26474 if (isInvoking) { 26475 if (timerId === undefined) { 26476 return leadingEdge(lastCallTime); 26477 } 26478 if (maxing) { 26479 // Handle invocations in a tight loop. 26480 clearTimeout(timerId); 26481 timerId = setTimeout(timerExpired, wait); 26482 return invokeFunc(lastCallTime); 26483 } 26484 } 26485 if (timerId === undefined) { 26486 timerId = setTimeout(timerExpired, wait); 26487 } 26488 return result; 26489 } 26490 debounced.cancel = cancel; 26491 debounced.flush = flush; 26492 return debounced; 26493 } 26494 26495 /** 26496 * Defers invoking the `func` until the current call stack has cleared. Any 26497 * additional arguments are provided to `func` when it's invoked. 26498 * 26499 * @static 26500 * @memberOf _ 26501 * @since 0.1.0 26502 * @category Function 26503 * @param {Function} func The function to defer. 26504 * @param {...*} [args] The arguments to invoke `func` with. 26505 * @returns {number} Returns the timer id. 26506 * @example 26507 * 26508 * _.defer(function(text) { 26509 * console.log(text); 26510 * }, 'deferred'); 26511 * // => Logs 'deferred' after one millisecond. 26512 */ 26513 var defer = baseRest(function(func, args) { 26514 return baseDelay(func, 1, args); 26515 }); 26516 26517 /** 26518 * Invokes `func` after `wait` milliseconds. Any additional arguments are 26519 * provided to `func` when it's invoked. 26520 * 26521 * @static 26522 * @memberOf _ 26523 * @since 0.1.0 26524 * @category Function 26525 * @param {Function} func The function to delay. 26526 * @param {number} wait The number of milliseconds to delay invocation. 26527 * @param {...*} [args] The arguments to invoke `func` with. 26528 * @returns {number} Returns the timer id. 26529 * @example 26530 * 26531 * _.delay(function(text) { 26532 * console.log(text); 26533 * }, 1000, 'later'); 26534 * // => Logs 'later' after one second. 26535 */ 26536 var delay = baseRest(function(func, wait, args) { 26537 return baseDelay(func, toNumber(wait) || 0, args); 26538 }); 26539 26540 /** 26541 * Creates a function that invokes `func` with arguments reversed. 26542 * 26543 * @static 26544 * @memberOf _ 26545 * @since 4.0.0 26546 * @category Function 26547 * @param {Function} func The function to flip arguments for. 26548 * @returns {Function} Returns the new flipped function. 26549 * @example 26550 * 26551 * var flipped = _.flip(function() { 26552 * return _.toArray(arguments); 26553 * }); 26554 * 26555 * flipped('a', 'b', 'c', 'd'); 26556 * // => ['d', 'c', 'b', 'a'] 26557 */ 26558 function flip(func) { 26559 return createWrap(func, WRAP_FLIP_FLAG); 26560 } 26561 26562 /** 26563 * Creates a function that memoizes the result of `func`. If `resolver` is 26564 * provided, it determines the cache key for storing the result based on the 26565 * arguments provided to the memoized function. By default, the first argument 26566 * provided to the memoized function is used as the map cache key. The `func` 26567 * is invoked with the `this` binding of the memoized function. 26568 * 26569 * **Note:** The cache is exposed as the `cache` property on the memoized 26570 * function. Its creation may be customized by replacing the `_.memoize.Cache` 26571 * constructor with one whose instances implement the 26572 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 26573 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 26574 * 26575 * @static 26576 * @memberOf _ 26577 * @since 0.1.0 26578 * @category Function 26579 * @param {Function} func The function to have its output memoized. 26580 * @param {Function} [resolver] The function to resolve the cache key. 26581 * @returns {Function} Returns the new memoized function. 26582 * @example 26583 * 26584 * var object = { 'a': 1, 'b': 2 }; 26585 * var other = { 'c': 3, 'd': 4 }; 26586 * 26587 * var values = _.memoize(_.values); 26588 * values(object); 26589 * // => [1, 2] 26590 * 26591 * values(other); 26592 * // => [3, 4] 26593 * 26594 * object.a = 2; 26595 * values(object); 26596 * // => [1, 2] 26597 * 26598 * // Modify the result cache. 26599 * values.cache.set(object, ['a', 'b']); 26600 * values(object); 26601 * // => ['a', 'b'] 26602 * 26603 * // Replace `_.memoize.Cache`. 26604 * _.memoize.Cache = WeakMap; 26605 */ 26606 function memoize(func, resolver) { 26607 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { 26608 throw new TypeError(FUNC_ERROR_TEXT); 26609 } 26610 var memoized = function() { 26611 var args = arguments, 26612 key = resolver ? resolver.apply(this, args) : args[0], 26613 cache = memoized.cache; 26614 26615 if (cache.has(key)) { 26616 return cache.get(key); 26617 } 26618 var result = func.apply(this, args); 26619 memoized.cache = cache.set(key, result) || cache; 26620 return result; 26621 }; 26622 memoized.cache = new (memoize.Cache || MapCache); 26623 return memoized; 26624 } 26625 26626 // Expose `MapCache`. 26627 memoize.Cache = MapCache; 26628 26629 /** 26630 * Creates a function that negates the result of the predicate `func`. The 26631 * `func` predicate is invoked with the `this` binding and arguments of the 26632 * created function. 26633 * 26634 * @static 26635 * @memberOf _ 26636 * @since 3.0.0 26637 * @category Function 26638 * @param {Function} predicate The predicate to negate. 26639 * @returns {Function} Returns the new negated function. 26640 * @example 26641 * 26642 * function isEven(n) { 26643 * return n % 2 == 0; 26644 * } 26645 * 26646 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 26647 * // => [1, 3, 5] 26648 */ 26649 function negate(predicate) { 26650 if (typeof predicate != 'function') { 26651 throw new TypeError(FUNC_ERROR_TEXT); 26652 } 26653 return function() { 26654 var args = arguments; 26655 switch (args.length) { 26656 case 0: return !predicate.call(this); 26657 case 1: return !predicate.call(this, args[0]); 26658 case 2: return !predicate.call(this, args[0], args[1]); 26659 case 3: return !predicate.call(this, args[0], args[1], args[2]); 26660 } 26661 return !predicate.apply(this, args); 26662 }; 26663 } 26664 26665 /** 26666 * Creates a function that is restricted to invoking `func` once. Repeat calls 26667 * to the function return the value of the first invocation. The `func` is 26668 * invoked with the `this` binding and arguments of the created function. 26669 * 26670 * @static 26671 * @memberOf _ 26672 * @since 0.1.0 26673 * @category Function 26674 * @param {Function} func The function to restrict. 26675 * @returns {Function} Returns the new restricted function. 26676 * @example 26677 * 26678 * var initialize = _.once(createApplication); 26679 * initialize(); 26680 * initialize(); 26681 * // => `createApplication` is invoked once 26682 */ 26683 function once(func) { 26684 return before(2, func); 26685 } 26686 26687 /** 26688 * Creates a function that invokes `func` with its arguments transformed. 26689 * 26690 * @static 26691 * @since 4.0.0 26692 * @memberOf _ 26693 * @category Function 26694 * @param {Function} func The function to wrap. 26695 * @param {...(Function|Function[])} [transforms=[_.identity]] 26696 * The argument transforms. 26697 * @returns {Function} Returns the new function. 26698 * @example 26699 * 26700 * function doubled(n) { 26701 * return n * 2; 26702 * } 26703 * 26704 * function square(n) { 26705 * return n * n; 26706 * } 26707 * 26708 * var func = _.overArgs(function(x, y) { 26709 * return [x, y]; 26710 * }, [square, doubled]); 26711 * 26712 * func(9, 3); 26713 * // => [81, 6] 26714 * 26715 * func(10, 5); 26716 * // => [100, 10] 26717 */ 26718 var overArgs = castRest(function(func, transforms) { 26719 transforms = (transforms.length == 1 && isArray(transforms[0])) 26720 ? arrayMap(transforms[0], baseUnary(getIteratee())) 26721 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 26722 26723 var funcsLength = transforms.length; 26724 return baseRest(function(args) { 26725 var index = -1, 26726 length = nativeMin(args.length, funcsLength); 26727 26728 while (++index < length) { 26729 args[index] = transforms[index].call(this, args[index]); 26730 } 26731 return apply(func, this, args); 26732 }); 26733 }); 26734 26735 /** 26736 * Creates a function that invokes `func` with `partials` prepended to the 26737 * arguments it receives. This method is like `_.bind` except it does **not** 26738 * alter the `this` binding. 26739 * 26740 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 26741 * builds, may be used as a placeholder for partially applied arguments. 26742 * 26743 * **Note:** This method doesn't set the "length" property of partially 26744 * applied functions. 26745 * 26746 * @static 26747 * @memberOf _ 26748 * @since 0.2.0 26749 * @category Function 26750 * @param {Function} func The function to partially apply arguments to. 26751 * @param {...*} [partials] The arguments to be partially applied. 26752 * @returns {Function} Returns the new partially applied function. 26753 * @example 26754 * 26755 * function greet(greeting, name) { 26756 * return greeting + ' ' + name; 26757 * } 26758 * 26759 * var sayHelloTo = _.partial(greet, 'hello'); 26760 * sayHelloTo('fred'); 26761 * // => 'hello fred' 26762 * 26763 * // Partially applied with placeholders. 26764 * var greetFred = _.partial(greet, _, 'fred'); 26765 * greetFred('hi'); 26766 * // => 'hi fred' 26767 */ 26768 var partial = baseRest(function(func, partials) { 26769 var holders = replaceHolders(partials, getHolder(partial)); 26770 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); 26771 }); 26772 26773 /** 26774 * This method is like `_.partial` except that partially applied arguments 26775 * are appended to the arguments it receives. 26776 * 26777 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 26778 * builds, may be used as a placeholder for partially applied arguments. 26779 * 26780 * **Note:** This method doesn't set the "length" property of partially 26781 * applied functions. 26782 * 26783 * @static 26784 * @memberOf _ 26785 * @since 1.0.0 26786 * @category Function 26787 * @param {Function} func The function to partially apply arguments to. 26788 * @param {...*} [partials] The arguments to be partially applied. 26789 * @returns {Function} Returns the new partially applied function. 26790 * @example 26791 * 26792 * function greet(greeting, name) { 26793 * return greeting + ' ' + name; 26794 * } 26795 * 26796 * var greetFred = _.partialRight(greet, 'fred'); 26797 * greetFred('hi'); 26798 * // => 'hi fred' 26799 * 26800 * // Partially applied with placeholders. 26801 * var sayHelloTo = _.partialRight(greet, 'hello', _); 26802 * sayHelloTo('fred'); 26803 * // => 'hello fred' 26804 */ 26805 var partialRight = baseRest(function(func, partials) { 26806 var holders = replaceHolders(partials, getHolder(partialRight)); 26807 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); 26808 }); 26809 26810 /** 26811 * Creates a function that invokes `func` with arguments arranged according 26812 * to the specified `indexes` where the argument value at the first index is 26813 * provided as the first argument, the argument value at the second index is 26814 * provided as the second argument, and so on. 26815 * 26816 * @static 26817 * @memberOf _ 26818 * @since 3.0.0 26819 * @category Function 26820 * @param {Function} func The function to rearrange arguments for. 26821 * @param {...(number|number[])} indexes The arranged argument indexes. 26822 * @returns {Function} Returns the new function. 26823 * @example 26824 * 26825 * var rearged = _.rearg(function(a, b, c) { 26826 * return [a, b, c]; 26827 * }, [2, 0, 1]); 26828 * 26829 * rearged('b', 'c', 'a') 26830 * // => ['a', 'b', 'c'] 26831 */ 26832 var rearg = flatRest(function(func, indexes) { 26833 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); 26834 }); 26835 26836 /** 26837 * Creates a function that invokes `func` with the `this` binding of the 26838 * created function and arguments from `start` and beyond provided as 26839 * an array. 26840 * 26841 * **Note:** This method is based on the 26842 * [rest parameter](https://mdn.io/rest_parameters). 26843 * 26844 * @static 26845 * @memberOf _ 26846 * @since 4.0.0 26847 * @category Function 26848 * @param {Function} func The function to apply a rest parameter to. 26849 * @param {number} [start=func.length-1] The start position of the rest parameter. 26850 * @returns {Function} Returns the new function. 26851 * @example 26852 * 26853 * var say = _.rest(function(what, names) { 26854 * return what + ' ' + _.initial(names).join(', ') + 26855 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 26856 * }); 26857 * 26858 * say('hello', 'fred', 'barney', 'pebbles'); 26859 * // => 'hello fred, barney, & pebbles' 26860 */ 26861 function rest(func, start) { 26862 if (typeof func != 'function') { 26863 throw new TypeError(FUNC_ERROR_TEXT); 26864 } 26865 start = start === undefined ? start : toInteger(start); 26866 return baseRest(func, start); 26867 } 26868 26869 /** 26870 * Creates a function that invokes `func` with the `this` binding of the 26871 * create function and an array of arguments much like 26872 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 26873 * 26874 * **Note:** This method is based on the 26875 * [spread operator](https://mdn.io/spread_operator). 26876 * 26877 * @static 26878 * @memberOf _ 26879 * @since 3.2.0 26880 * @category Function 26881 * @param {Function} func The function to spread arguments over. 26882 * @param {number} [start=0] The start position of the spread. 26883 * @returns {Function} Returns the new function. 26884 * @example 26885 * 26886 * var say = _.spread(function(who, what) { 26887 * return who + ' says ' + what; 26888 * }); 26889 * 26890 * say(['fred', 'hello']); 26891 * // => 'fred says hello' 26892 * 26893 * var numbers = Promise.all([ 26894 * Promise.resolve(40), 26895 * Promise.resolve(36) 26896 * ]); 26897 * 26898 * numbers.then(_.spread(function(x, y) { 26899 * return x + y; 26900 * })); 26901 * // => a Promise of 76 26902 */ 26903 function spread(func, start) { 26904 if (typeof func != 'function') { 26905 throw new TypeError(FUNC_ERROR_TEXT); 26906 } 26907 start = start == null ? 0 : nativeMax(toInteger(start), 0); 26908 return baseRest(function(args) { 26909 var array = args[start], 26910 otherArgs = castSlice(args, 0, start); 26911 26912 if (array) { 26913 arrayPush(otherArgs, array); 26914 } 26915 return apply(func, this, otherArgs); 26916 }); 26917 } 26918 26919 /** 26920 * Creates a throttled function that only invokes `func` at most once per 26921 * every `wait` milliseconds. The throttled function comes with a `cancel` 26922 * method to cancel delayed `func` invocations and a `flush` method to 26923 * immediately invoke them. Provide `options` to indicate whether `func` 26924 * should be invoked on the leading and/or trailing edge of the `wait` 26925 * timeout. The `func` is invoked with the last arguments provided to the 26926 * throttled function. Subsequent calls to the throttled function return the 26927 * result of the last `func` invocation. 26928 * 26929 * **Note:** If `leading` and `trailing` options are `true`, `func` is 26930 * invoked on the trailing edge of the timeout only if the throttled function 26931 * is invoked more than once during the `wait` timeout. 26932 * 26933 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 26934 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 26935 * 26936 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 26937 * for details over the differences between `_.throttle` and `_.debounce`. 26938 * 26939 * @static 26940 * @memberOf _ 26941 * @since 0.1.0 26942 * @category Function 26943 * @param {Function} func The function to throttle. 26944 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 26945 * @param {Object} [options={}] The options object. 26946 * @param {boolean} [options.leading=true] 26947 * Specify invoking on the leading edge of the timeout. 26948 * @param {boolean} [options.trailing=true] 26949 * Specify invoking on the trailing edge of the timeout. 26950 * @returns {Function} Returns the new throttled function. 26951 * @example 26952 * 26953 * // Avoid excessively updating the position while scrolling. 26954 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 26955 * 26956 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 26957 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 26958 * jQuery(element).on('click', throttled); 26959 * 26960 * // Cancel the trailing throttled invocation. 26961 * jQuery(window).on('popstate', throttled.cancel); 26962 */ 26963 function throttle(func, wait, options) { 26964 var leading = true, 26965 trailing = true; 26966 26967 if (typeof func != 'function') { 26968 throw new TypeError(FUNC_ERROR_TEXT); 26969 } 26970 if (isObject(options)) { 26971 leading = 'leading' in options ? !!options.leading : leading; 26972 trailing = 'trailing' in options ? !!options.trailing : trailing; 26973 } 26974 return debounce(func, wait, { 26975 'leading': leading, 26976 'maxWait': wait, 26977 'trailing': trailing 26978 }); 26979 } 26980 26981 /** 26982 * Creates a function that accepts up to one argument, ignoring any 26983 * additional arguments. 26984 * 26985 * @static 26986 * @memberOf _ 26987 * @since 4.0.0 26988 * @category Function 26989 * @param {Function} func The function to cap arguments for. 26990 * @returns {Function} Returns the new capped function. 26991 * @example 26992 * 26993 * _.map(['6', '8', '10'], _.unary(parseInt)); 26994 * // => [6, 8, 10] 26995 */ 26996 function unary(func) { 26997 return ary(func, 1); 26998 } 26999 27000 /** 27001 * Creates a function that provides `value` to `wrapper` as its first 27002 * argument. Any additional arguments provided to the function are appended 27003 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 27004 * binding of the created function. 27005 * 27006 * @static 27007 * @memberOf _ 27008 * @since 0.1.0 27009 * @category Function 27010 * @param {*} value The value to wrap. 27011 * @param {Function} [wrapper=identity] The wrapper function. 27012 * @returns {Function} Returns the new function. 27013 * @example 27014 * 27015 * var p = _.wrap(_.escape, function(func, text) { 27016 * return '<p>' + func(text) + '</p>'; 27017 * }); 27018 * 27019 * p('fred, barney, & pebbles'); 27020 * // => '<p>fred, barney, & pebbles</p>' 27021 */ 27022 function wrap(value, wrapper) { 27023 return partial(castFunction(wrapper), value); 27024 } 27025 27026 /*------------------------------------------------------------------------*/ 27027 27028 /** 27029 * Casts `value` as an array if it's not one. 27030 * 27031 * @static 27032 * @memberOf _ 27033 * @since 4.4.0 27034 * @category Lang 27035 * @param {*} value The value to inspect. 27036 * @returns {Array} Returns the cast array. 27037 * @example 27038 * 27039 * _.castArray(1); 27040 * // => [1] 27041 * 27042 * _.castArray({ 'a': 1 }); 27043 * // => [{ 'a': 1 }] 27044 * 27045 * _.castArray('abc'); 27046 * // => ['abc'] 27047 * 27048 * _.castArray(null); 27049 * // => [null] 27050 * 27051 * _.castArray(undefined); 27052 * // => [undefined] 27053 * 27054 * _.castArray(); 27055 * // => [] 27056 * 27057 * var array = [1, 2, 3]; 27058 * console.log(_.castArray(array) === array); 27059 * // => true 27060 */ 27061 function castArray() { 27062 if (!arguments.length) { 27063 return []; 27064 } 27065 var value = arguments[0]; 27066 return isArray(value) ? value : [value]; 27067 } 27068 27069 /** 27070 * Creates a shallow clone of `value`. 27071 * 27072 * **Note:** This method is loosely based on the 27073 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 27074 * and supports cloning arrays, array buffers, booleans, date objects, maps, 27075 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 27076 * arrays. The own enumerable properties of `arguments` objects are cloned 27077 * as plain objects. An empty object is returned for uncloneable values such 27078 * as error objects, functions, DOM nodes, and WeakMaps. 27079 * 27080 * @static 27081 * @memberOf _ 27082 * @since 0.1.0 27083 * @category Lang 27084 * @param {*} value The value to clone. 27085 * @returns {*} Returns the cloned value. 27086 * @see _.cloneDeep 27087 * @example 27088 * 27089 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 27090 * 27091 * var shallow = _.clone(objects); 27092 * console.log(shallow[0] === objects[0]); 27093 * // => true 27094 */ 27095 function clone(value) { 27096 return baseClone(value, CLONE_SYMBOLS_FLAG); 27097 } 27098 27099 /** 27100 * This method is like `_.clone` except that it accepts `customizer` which 27101 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 27102 * cloning is handled by the method instead. The `customizer` is invoked with 27103 * up to four arguments; (value [, index|key, object, stack]). 27104 * 27105 * @static 27106 * @memberOf _ 27107 * @since 4.0.0 27108 * @category Lang 27109 * @param {*} value The value to clone. 27110 * @param {Function} [customizer] The function to customize cloning. 27111 * @returns {*} Returns the cloned value. 27112 * @see _.cloneDeepWith 27113 * @example 27114 * 27115 * function customizer(value) { 27116 * if (_.isElement(value)) { 27117 * return value.cloneNode(false); 27118 * } 27119 * } 27120 * 27121 * var el = _.cloneWith(document.body, customizer); 27122 * 27123 * console.log(el === document.body); 27124 * // => false 27125 * console.log(el.nodeName); 27126 * // => 'BODY' 27127 * console.log(el.childNodes.length); 27128 * // => 0 27129 */ 27130 function cloneWith(value, customizer) { 27131 customizer = typeof customizer == 'function' ? customizer : undefined; 27132 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 27133 } 27134 27135 /** 27136 * This method is like `_.clone` except that it recursively clones `value`. 27137 * 27138 * @static 27139 * @memberOf _ 27140 * @since 1.0.0 27141 * @category Lang 27142 * @param {*} value The value to recursively clone. 27143 * @returns {*} Returns the deep cloned value. 27144 * @see _.clone 27145 * @example 27146 * 27147 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 27148 * 27149 * var deep = _.cloneDeep(objects); 27150 * console.log(deep[0] === objects[0]); 27151 * // => false 27152 */ 27153 function cloneDeep(value) { 27154 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 27155 } 27156 27157 /** 27158 * This method is like `_.cloneWith` except that it recursively clones `value`. 27159 * 27160 * @static 27161 * @memberOf _ 27162 * @since 4.0.0 27163 * @category Lang 27164 * @param {*} value The value to recursively clone. 27165 * @param {Function} [customizer] The function to customize cloning. 27166 * @returns {*} Returns the deep cloned value. 27167 * @see _.cloneWith 27168 * @example 27169 * 27170 * function customizer(value) { 27171 * if (_.isElement(value)) { 27172 * return value.cloneNode(true); 27173 * } 27174 * } 27175 * 27176 * var el = _.cloneDeepWith(document.body, customizer); 27177 * 27178 * console.log(el === document.body); 27179 * // => false 27180 * console.log(el.nodeName); 27181 * // => 'BODY' 27182 * console.log(el.childNodes.length); 27183 * // => 20 27184 */ 27185 function cloneDeepWith(value, customizer) { 27186 customizer = typeof customizer == 'function' ? customizer : undefined; 27187 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 27188 } 27189 27190 /** 27191 * Checks if `object` conforms to `source` by invoking the predicate 27192 * properties of `source` with the corresponding property values of `object`. 27193 * 27194 * **Note:** This method is equivalent to `_.conforms` when `source` is 27195 * partially applied. 27196 * 27197 * @static 27198 * @memberOf _ 27199 * @since 4.14.0 27200 * @category Lang 27201 * @param {Object} object The object to inspect. 27202 * @param {Object} source The object of property predicates to conform to. 27203 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 27204 * @example 27205 * 27206 * var object = { 'a': 1, 'b': 2 }; 27207 * 27208 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 27209 * // => true 27210 * 27211 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 27212 * // => false 27213 */ 27214 function conformsTo(object, source) { 27215 return source == null || baseConformsTo(object, source, keys(source)); 27216 } 27217 27218 /** 27219 * Performs a 27220 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 27221 * comparison between two values to determine if they are equivalent. 27222 * 27223 * @static 27224 * @memberOf _ 27225 * @since 4.0.0 27226 * @category Lang 27227 * @param {*} value The value to compare. 27228 * @param {*} other The other value to compare. 27229 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 27230 * @example 27231 * 27232 * var object = { 'a': 1 }; 27233 * var other = { 'a': 1 }; 27234 * 27235 * _.eq(object, object); 27236 * // => true 27237 * 27238 * _.eq(object, other); 27239 * // => false 27240 * 27241 * _.eq('a', 'a'); 27242 * // => true 27243 * 27244 * _.eq('a', Object('a')); 27245 * // => false 27246 * 27247 * _.eq(NaN, NaN); 27248 * // => true 27249 */ 27250 function eq(value, other) { 27251 return value === other || (value !== value && other !== other); 27252 } 27253 27254 /** 27255 * Checks if `value` is greater than `other`. 27256 * 27257 * @static 27258 * @memberOf _ 27259 * @since 3.9.0 27260 * @category Lang 27261 * @param {*} value The value to compare. 27262 * @param {*} other The other value to compare. 27263 * @returns {boolean} Returns `true` if `value` is greater than `other`, 27264 * else `false`. 27265 * @see _.lt 27266 * @example 27267 * 27268 * _.gt(3, 1); 27269 * // => true 27270 * 27271 * _.gt(3, 3); 27272 * // => false 27273 * 27274 * _.gt(1, 3); 27275 * // => false 27276 */ 27277 var gt = createRelationalOperation(baseGt); 27278 27279 /** 27280 * Checks if `value` is greater than or equal to `other`. 27281 * 27282 * @static 27283 * @memberOf _ 27284 * @since 3.9.0 27285 * @category Lang 27286 * @param {*} value The value to compare. 27287 * @param {*} other The other value to compare. 27288 * @returns {boolean} Returns `true` if `value` is greater than or equal to 27289 * `other`, else `false`. 27290 * @see _.lte 27291 * @example 27292 * 27293 * _.gte(3, 1); 27294 * // => true 27295 * 27296 * _.gte(3, 3); 27297 * // => true 27298 * 27299 * _.gte(1, 3); 27300 * // => false 27301 */ 27302 var gte = createRelationalOperation(function(value, other) { 27303 return value >= other; 27304 }); 27305 27306 /** 27307 * Checks if `value` is likely an `arguments` object. 27308 * 27309 * @static 27310 * @memberOf _ 27311 * @since 0.1.0 27312 * @category Lang 27313 * @param {*} value The value to check. 27314 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 27315 * else `false`. 27316 * @example 27317 * 27318 * _.isArguments(function() { return arguments; }()); 27319 * // => true 27320 * 27321 * _.isArguments([1, 2, 3]); 27322 * // => false 27323 */ 27324 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 27325 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 27326 !propertyIsEnumerable.call(value, 'callee'); 27327 }; 27328 27329 /** 27330 * Checks if `value` is classified as an `Array` object. 27331 * 27332 * @static 27333 * @memberOf _ 27334 * @since 0.1.0 27335 * @category Lang 27336 * @param {*} value The value to check. 27337 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 27338 * @example 27339 * 27340 * _.isArray([1, 2, 3]); 27341 * // => true 27342 * 27343 * _.isArray(document.body.children); 27344 * // => false 27345 * 27346 * _.isArray('abc'); 27347 * // => false 27348 * 27349 * _.isArray(_.noop); 27350 * // => false 27351 */ 27352 var isArray = Array.isArray; 27353 27354 /** 27355 * Checks if `value` is classified as an `ArrayBuffer` object. 27356 * 27357 * @static 27358 * @memberOf _ 27359 * @since 4.3.0 27360 * @category Lang 27361 * @param {*} value The value to check. 27362 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 27363 * @example 27364 * 27365 * _.isArrayBuffer(new ArrayBuffer(2)); 27366 * // => true 27367 * 27368 * _.isArrayBuffer(new Array(2)); 27369 * // => false 27370 */ 27371 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 27372 27373 /** 27374 * Checks if `value` is array-like. A value is considered array-like if it's 27375 * not a function and has a `value.length` that's an integer greater than or 27376 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 27377 * 27378 * @static 27379 * @memberOf _ 27380 * @since 4.0.0 27381 * @category Lang 27382 * @param {*} value The value to check. 27383 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 27384 * @example 27385 * 27386 * _.isArrayLike([1, 2, 3]); 27387 * // => true 27388 * 27389 * _.isArrayLike(document.body.children); 27390 * // => true 27391 * 27392 * _.isArrayLike('abc'); 27393 * // => true 27394 * 27395 * _.isArrayLike(_.noop); 27396 * // => false 27397 */ 27398 function isArrayLike(value) { 27399 return value != null && isLength(value.length) && !isFunction(value); 27400 } 27401 27402 /** 27403 * This method is like `_.isArrayLike` except that it also checks if `value` 27404 * is an object. 27405 * 27406 * @static 27407 * @memberOf _ 27408 * @since 4.0.0 27409 * @category Lang 27410 * @param {*} value The value to check. 27411 * @returns {boolean} Returns `true` if `value` is an array-like object, 27412 * else `false`. 27413 * @example 27414 * 27415 * _.isArrayLikeObject([1, 2, 3]); 27416 * // => true 27417 * 27418 * _.isArrayLikeObject(document.body.children); 27419 * // => true 27420 * 27421 * _.isArrayLikeObject('abc'); 27422 * // => false 27423 * 27424 * _.isArrayLikeObject(_.noop); 27425 * // => false 27426 */ 27427 function isArrayLikeObject(value) { 27428 return isObjectLike(value) && isArrayLike(value); 27429 } 27430 27431 /** 27432 * Checks if `value` is classified as a boolean primitive or object. 27433 * 27434 * @static 27435 * @memberOf _ 27436 * @since 0.1.0 27437 * @category Lang 27438 * @param {*} value The value to check. 27439 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 27440 * @example 27441 * 27442 * _.isBoolean(false); 27443 * // => true 27444 * 27445 * _.isBoolean(null); 27446 * // => false 27447 */ 27448 function isBoolean(value) { 27449 return value === true || value === false || 27450 (isObjectLike(value) && baseGetTag(value) == boolTag); 27451 } 27452 27453 /** 27454 * Checks if `value` is a buffer. 27455 * 27456 * @static 27457 * @memberOf _ 27458 * @since 4.3.0 27459 * @category Lang 27460 * @param {*} value The value to check. 27461 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 27462 * @example 27463 * 27464 * _.isBuffer(new Buffer(2)); 27465 * // => true 27466 * 27467 * _.isBuffer(new Uint8Array(2)); 27468 * // => false 27469 */ 27470 var isBuffer = nativeIsBuffer || stubFalse; 27471 27472 /** 27473 * Checks if `value` is classified as a `Date` object. 27474 * 27475 * @static 27476 * @memberOf _ 27477 * @since 0.1.0 27478 * @category Lang 27479 * @param {*} value The value to check. 27480 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 27481 * @example 27482 * 27483 * _.isDate(new Date); 27484 * // => true 27485 * 27486 * _.isDate('Mon April 23 2012'); 27487 * // => false 27488 */ 27489 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 27490 27491 /** 27492 * Checks if `value` is likely a DOM element. 27493 * 27494 * @static 27495 * @memberOf _ 27496 * @since 0.1.0 27497 * @category Lang 27498 * @param {*} value The value to check. 27499 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 27500 * @example 27501 * 27502 * _.isElement(document.body); 27503 * // => true 27504 * 27505 * _.isElement('<body>'); 27506 * // => false 27507 */ 27508 function isElement(value) { 27509 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); 27510 } 27511 27512 /** 27513 * Checks if `value` is an empty object, collection, map, or set. 27514 * 27515 * Objects are considered empty if they have no own enumerable string keyed 27516 * properties. 27517 * 27518 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 27519 * jQuery-like collections are considered empty if they have a `length` of `0`. 27520 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 27521 * 27522 * @static 27523 * @memberOf _ 27524 * @since 0.1.0 27525 * @category Lang 27526 * @param {*} value The value to check. 27527 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 27528 * @example 27529 * 27530 * _.isEmpty(null); 27531 * // => true 27532 * 27533 * _.isEmpty(true); 27534 * // => true 27535 * 27536 * _.isEmpty(1); 27537 * // => true 27538 * 27539 * _.isEmpty([1, 2, 3]); 27540 * // => false 27541 * 27542 * _.isEmpty({ 'a': 1 }); 27543 * // => false 27544 */ 27545 function isEmpty(value) { 27546 if (value == null) { 27547 return true; 27548 } 27549 if (isArrayLike(value) && 27550 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 27551 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 27552 return !value.length; 27553 } 27554 var tag = getTag(value); 27555 if (tag == mapTag || tag == setTag) { 27556 return !value.size; 27557 } 27558 if (isPrototype(value)) { 27559 return !baseKeys(value).length; 27560 } 27561 for (var key in value) { 27562 if (hasOwnProperty.call(value, key)) { 27563 return false; 27564 } 27565 } 27566 return true; 27567 } 27568 27569 /** 27570 * Performs a deep comparison between two values to determine if they are 27571 * equivalent. 27572 * 27573 * **Note:** This method supports comparing arrays, array buffers, booleans, 27574 * date objects, error objects, maps, numbers, `Object` objects, regexes, 27575 * sets, strings, symbols, and typed arrays. `Object` objects are compared 27576 * by their own, not inherited, enumerable properties. Functions and DOM 27577 * nodes are compared by strict equality, i.e. `===`. 27578 * 27579 * @static 27580 * @memberOf _ 27581 * @since 0.1.0 27582 * @category Lang 27583 * @param {*} value The value to compare. 27584 * @param {*} other The other value to compare. 27585 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 27586 * @example 27587 * 27588 * var object = { 'a': 1 }; 27589 * var other = { 'a': 1 }; 27590 * 27591 * _.isEqual(object, other); 27592 * // => true 27593 * 27594 * object === other; 27595 * // => false 27596 */ 27597 function isEqual(value, other) { 27598 return baseIsEqual(value, other); 27599 } 27600 27601 /** 27602 * This method is like `_.isEqual` except that it accepts `customizer` which 27603 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 27604 * are handled by the method instead. The `customizer` is invoked with up to 27605 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 27606 * 27607 * @static 27608 * @memberOf _ 27609 * @since 4.0.0 27610 * @category Lang 27611 * @param {*} value The value to compare. 27612 * @param {*} other The other value to compare. 27613 * @param {Function} [customizer] The function to customize comparisons. 27614 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 27615 * @example 27616 * 27617 * function isGreeting(value) { 27618 * return /^h(?:i|ello)$/.test(value); 27619 * } 27620 * 27621 * function customizer(objValue, othValue) { 27622 * if (isGreeting(objValue) && isGreeting(othValue)) { 27623 * return true; 27624 * } 27625 * } 27626 * 27627 * var array = ['hello', 'goodbye']; 27628 * var other = ['hi', 'goodbye']; 27629 * 27630 * _.isEqualWith(array, other, customizer); 27631 * // => true 27632 */ 27633 function isEqualWith(value, other, customizer) { 27634 customizer = typeof customizer == 'function' ? customizer : undefined; 27635 var result = customizer ? customizer(value, other) : undefined; 27636 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; 27637 } 27638 27639 /** 27640 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 27641 * `SyntaxError`, `TypeError`, or `URIError` object. 27642 * 27643 * @static 27644 * @memberOf _ 27645 * @since 3.0.0 27646 * @category Lang 27647 * @param {*} value The value to check. 27648 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 27649 * @example 27650 * 27651 * _.isError(new Error); 27652 * // => true 27653 * 27654 * _.isError(Error); 27655 * // => false 27656 */ 27657 function isError(value) { 27658 if (!isObjectLike(value)) { 27659 return false; 27660 } 27661 var tag = baseGetTag(value); 27662 return tag == errorTag || tag == domExcTag || 27663 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); 27664 } 27665 27666 /** 27667 * Checks if `value` is a finite primitive number. 27668 * 27669 * **Note:** This method is based on 27670 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 27671 * 27672 * @static 27673 * @memberOf _ 27674 * @since 0.1.0 27675 * @category Lang 27676 * @param {*} value The value to check. 27677 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 27678 * @example 27679 * 27680 * _.isFinite(3); 27681 * // => true 27682 * 27683 * _.isFinite(Number.MIN_VALUE); 27684 * // => true 27685 * 27686 * _.isFinite(Infinity); 27687 * // => false 27688 * 27689 * _.isFinite('3'); 27690 * // => false 27691 */ 27692 function isFinite(value) { 27693 return typeof value == 'number' && nativeIsFinite(value); 27694 } 27695 27696 /** 27697 * Checks if `value` is classified as a `Function` object. 27698 * 27699 * @static 27700 * @memberOf _ 27701 * @since 0.1.0 27702 * @category Lang 27703 * @param {*} value The value to check. 27704 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 27705 * @example 27706 * 27707 * _.isFunction(_); 27708 * // => true 27709 * 27710 * _.isFunction(/abc/); 27711 * // => false 27712 */ 27713 function isFunction(value) { 27714 if (!isObject(value)) { 27715 return false; 27716 } 27717 // The use of `Object#toString` avoids issues with the `typeof` operator 27718 // in Safari 9 which returns 'object' for typed arrays and other constructors. 27719 var tag = baseGetTag(value); 27720 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 27721 } 27722 27723 /** 27724 * Checks if `value` is an integer. 27725 * 27726 * **Note:** This method is based on 27727 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 27728 * 27729 * @static 27730 * @memberOf _ 27731 * @since 4.0.0 27732 * @category Lang 27733 * @param {*} value The value to check. 27734 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 27735 * @example 27736 * 27737 * _.isInteger(3); 27738 * // => true 27739 * 27740 * _.isInteger(Number.MIN_VALUE); 27741 * // => false 27742 * 27743 * _.isInteger(Infinity); 27744 * // => false 27745 * 27746 * _.isInteger('3'); 27747 * // => false 27748 */ 27749 function isInteger(value) { 27750 return typeof value == 'number' && value == toInteger(value); 27751 } 27752 27753 /** 27754 * Checks if `value` is a valid array-like length. 27755 * 27756 * **Note:** This method is loosely based on 27757 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 27758 * 27759 * @static 27760 * @memberOf _ 27761 * @since 4.0.0 27762 * @category Lang 27763 * @param {*} value The value to check. 27764 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 27765 * @example 27766 * 27767 * _.isLength(3); 27768 * // => true 27769 * 27770 * _.isLength(Number.MIN_VALUE); 27771 * // => false 27772 * 27773 * _.isLength(Infinity); 27774 * // => false 27775 * 27776 * _.isLength('3'); 27777 * // => false 27778 */ 27779 function isLength(value) { 27780 return typeof value == 'number' && 27781 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 27782 } 27783 27784 /** 27785 * Checks if `value` is the 27786 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 27787 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 27788 * 27789 * @static 27790 * @memberOf _ 27791 * @since 0.1.0 27792 * @category Lang 27793 * @param {*} value The value to check. 27794 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 27795 * @example 27796 * 27797 * _.isObject({}); 27798 * // => true 27799 * 27800 * _.isObject([1, 2, 3]); 27801 * // => true 27802 * 27803 * _.isObject(_.noop); 27804 * // => true 27805 * 27806 * _.isObject(null); 27807 * // => false 27808 */ 27809 function isObject(value) { 27810 var type = typeof value; 27811 return value != null && (type == 'object' || type == 'function'); 27812 } 27813 27814 /** 27815 * Checks if `value` is object-like. A value is object-like if it's not `null` 27816 * and has a `typeof` result of "object". 27817 * 27818 * @static 27819 * @memberOf _ 27820 * @since 4.0.0 27821 * @category Lang 27822 * @param {*} value The value to check. 27823 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 27824 * @example 27825 * 27826 * _.isObjectLike({}); 27827 * // => true 27828 * 27829 * _.isObjectLike([1, 2, 3]); 27830 * // => true 27831 * 27832 * _.isObjectLike(_.noop); 27833 * // => false 27834 * 27835 * _.isObjectLike(null); 27836 * // => false 27837 */ 27838 function isObjectLike(value) { 27839 return value != null && typeof value == 'object'; 27840 } 27841 27842 /** 27843 * Checks if `value` is classified as a `Map` object. 27844 * 27845 * @static 27846 * @memberOf _ 27847 * @since 4.3.0 27848 * @category Lang 27849 * @param {*} value The value to check. 27850 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 27851 * @example 27852 * 27853 * _.isMap(new Map); 27854 * // => true 27855 * 27856 * _.isMap(new WeakMap); 27857 * // => false 27858 */ 27859 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 27860 27861 /** 27862 * Performs a partial deep comparison between `object` and `source` to 27863 * determine if `object` contains equivalent property values. 27864 * 27865 * **Note:** This method is equivalent to `_.matches` when `source` is 27866 * partially applied. 27867 * 27868 * Partial comparisons will match empty array and empty object `source` 27869 * values against any array or object value, respectively. See `_.isEqual` 27870 * for a list of supported value comparisons. 27871 * 27872 * @static 27873 * @memberOf _ 27874 * @since 3.0.0 27875 * @category Lang 27876 * @param {Object} object The object to inspect. 27877 * @param {Object} source The object of property values to match. 27878 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 27879 * @example 27880 * 27881 * var object = { 'a': 1, 'b': 2 }; 27882 * 27883 * _.isMatch(object, { 'b': 2 }); 27884 * // => true 27885 * 27886 * _.isMatch(object, { 'b': 1 }); 27887 * // => false 27888 */ 27889 function isMatch(object, source) { 27890 return object === source || baseIsMatch(object, source, getMatchData(source)); 27891 } 27892 27893 /** 27894 * This method is like `_.isMatch` except that it accepts `customizer` which 27895 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 27896 * are handled by the method instead. The `customizer` is invoked with five 27897 * arguments: (objValue, srcValue, index|key, object, source). 27898 * 27899 * @static 27900 * @memberOf _ 27901 * @since 4.0.0 27902 * @category Lang 27903 * @param {Object} object The object to inspect. 27904 * @param {Object} source The object of property values to match. 27905 * @param {Function} [customizer] The function to customize comparisons. 27906 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 27907 * @example 27908 * 27909 * function isGreeting(value) { 27910 * return /^h(?:i|ello)$/.test(value); 27911 * } 27912 * 27913 * function customizer(objValue, srcValue) { 27914 * if (isGreeting(objValue) && isGreeting(srcValue)) { 27915 * return true; 27916 * } 27917 * } 27918 * 27919 * var object = { 'greeting': 'hello' }; 27920 * var source = { 'greeting': 'hi' }; 27921 * 27922 * _.isMatchWith(object, source, customizer); 27923 * // => true 27924 */ 27925 function isMatchWith(object, source, customizer) { 27926 customizer = typeof customizer == 'function' ? customizer : undefined; 27927 return baseIsMatch(object, source, getMatchData(source), customizer); 27928 } 27929 27930 /** 27931 * Checks if `value` is `NaN`. 27932 * 27933 * **Note:** This method is based on 27934 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 27935 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 27936 * `undefined` and other non-number values. 27937 * 27938 * @static 27939 * @memberOf _ 27940 * @since 0.1.0 27941 * @category Lang 27942 * @param {*} value The value to check. 27943 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 27944 * @example 27945 * 27946 * _.isNaN(NaN); 27947 * // => true 27948 * 27949 * _.isNaN(new Number(NaN)); 27950 * // => true 27951 * 27952 * isNaN(undefined); 27953 * // => true 27954 * 27955 * _.isNaN(undefined); 27956 * // => false 27957 */ 27958 function isNaN(value) { 27959 // An `NaN` primitive is the only value that is not equal to itself. 27960 // Perform the `toStringTag` check first to avoid errors with some 27961 // ActiveX objects in IE. 27962 return isNumber(value) && value != +value; 27963 } 27964 27965 /** 27966 * Checks if `value` is a pristine native function. 27967 * 27968 * **Note:** This method can't reliably detect native functions in the presence 27969 * of the core-js package because core-js circumvents this kind of detection. 27970 * Despite multiple requests, the core-js maintainer has made it clear: any 27971 * attempt to fix the detection will be obstructed. As a result, we're left 27972 * with little choice but to throw an error. Unfortunately, this also affects 27973 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 27974 * which rely on core-js. 27975 * 27976 * @static 27977 * @memberOf _ 27978 * @since 3.0.0 27979 * @category Lang 27980 * @param {*} value The value to check. 27981 * @returns {boolean} Returns `true` if `value` is a native function, 27982 * else `false`. 27983 * @example 27984 * 27985 * _.isNative(Array.prototype.push); 27986 * // => true 27987 * 27988 * _.isNative(_); 27989 * // => false 27990 */ 27991 function isNative(value) { 27992 if (isMaskable(value)) { 27993 throw new Error(CORE_ERROR_TEXT); 27994 } 27995 return baseIsNative(value); 27996 } 27997 27998 /** 27999 * Checks if `value` is `null`. 28000 * 28001 * @static 28002 * @memberOf _ 28003 * @since 0.1.0 28004 * @category Lang 28005 * @param {*} value The value to check. 28006 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 28007 * @example 28008 * 28009 * _.isNull(null); 28010 * // => true 28011 * 28012 * _.isNull(void 0); 28013 * // => false 28014 */ 28015 function isNull(value) { 28016 return value === null; 28017 } 28018 28019 /** 28020 * Checks if `value` is `null` or `undefined`. 28021 * 28022 * @static 28023 * @memberOf _ 28024 * @since 4.0.0 28025 * @category Lang 28026 * @param {*} value The value to check. 28027 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 28028 * @example 28029 * 28030 * _.isNil(null); 28031 * // => true 28032 * 28033 * _.isNil(void 0); 28034 * // => true 28035 * 28036 * _.isNil(NaN); 28037 * // => false 28038 */ 28039 function isNil(value) { 28040 return value == null; 28041 } 28042 28043 /** 28044 * Checks if `value` is classified as a `Number` primitive or object. 28045 * 28046 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 28047 * classified as numbers, use the `_.isFinite` method. 28048 * 28049 * @static 28050 * @memberOf _ 28051 * @since 0.1.0 28052 * @category Lang 28053 * @param {*} value The value to check. 28054 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 28055 * @example 28056 * 28057 * _.isNumber(3); 28058 * // => true 28059 * 28060 * _.isNumber(Number.MIN_VALUE); 28061 * // => true 28062 * 28063 * _.isNumber(Infinity); 28064 * // => true 28065 * 28066 * _.isNumber('3'); 28067 * // => false 28068 */ 28069 function isNumber(value) { 28070 return typeof value == 'number' || 28071 (isObjectLike(value) && baseGetTag(value) == numberTag); 28072 } 28073 28074 /** 28075 * Checks if `value` is a plain object, that is, an object created by the 28076 * `Object` constructor or one with a `[[Prototype]]` of `null`. 28077 * 28078 * @static 28079 * @memberOf _ 28080 * @since 0.8.0 28081 * @category Lang 28082 * @param {*} value The value to check. 28083 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 28084 * @example 28085 * 28086 * function Foo() { 28087 * this.a = 1; 28088 * } 28089 * 28090 * _.isPlainObject(new Foo); 28091 * // => false 28092 * 28093 * _.isPlainObject([1, 2, 3]); 28094 * // => false 28095 * 28096 * _.isPlainObject({ 'x': 0, 'y': 0 }); 28097 * // => true 28098 * 28099 * _.isPlainObject(Object.create(null)); 28100 * // => true 28101 */ 28102 function isPlainObject(value) { 28103 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 28104 return false; 28105 } 28106 var proto = getPrototype(value); 28107 if (proto === null) { 28108 return true; 28109 } 28110 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 28111 return typeof Ctor == 'function' && Ctor instanceof Ctor && 28112 funcToString.call(Ctor) == objectCtorString; 28113 } 28114 28115 /** 28116 * Checks if `value` is classified as a `RegExp` object. 28117 * 28118 * @static 28119 * @memberOf _ 28120 * @since 0.1.0 28121 * @category Lang 28122 * @param {*} value The value to check. 28123 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 28124 * @example 28125 * 28126 * _.isRegExp(/abc/); 28127 * // => true 28128 * 28129 * _.isRegExp('/abc/'); 28130 * // => false 28131 */ 28132 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 28133 28134 /** 28135 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 28136 * double precision number which isn't the result of a rounded unsafe integer. 28137 * 28138 * **Note:** This method is based on 28139 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 28140 * 28141 * @static 28142 * @memberOf _ 28143 * @since 4.0.0 28144 * @category Lang 28145 * @param {*} value The value to check. 28146 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 28147 * @example 28148 * 28149 * _.isSafeInteger(3); 28150 * // => true 28151 * 28152 * _.isSafeInteger(Number.MIN_VALUE); 28153 * // => false 28154 * 28155 * _.isSafeInteger(Infinity); 28156 * // => false 28157 * 28158 * _.isSafeInteger('3'); 28159 * // => false 28160 */ 28161 function isSafeInteger(value) { 28162 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 28163 } 28164 28165 /** 28166 * Checks if `value` is classified as a `Set` object. 28167 * 28168 * @static 28169 * @memberOf _ 28170 * @since 4.3.0 28171 * @category Lang 28172 * @param {*} value The value to check. 28173 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 28174 * @example 28175 * 28176 * _.isSet(new Set); 28177 * // => true 28178 * 28179 * _.isSet(new WeakSet); 28180 * // => false 28181 */ 28182 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 28183 28184 /** 28185 * Checks if `value` is classified as a `String` primitive or object. 28186 * 28187 * @static 28188 * @since 0.1.0 28189 * @memberOf _ 28190 * @category Lang 28191 * @param {*} value The value to check. 28192 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 28193 * @example 28194 * 28195 * _.isString('abc'); 28196 * // => true 28197 * 28198 * _.isString(1); 28199 * // => false 28200 */ 28201 function isString(value) { 28202 return typeof value == 'string' || 28203 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 28204 } 28205 28206 /** 28207 * Checks if `value` is classified as a `Symbol` primitive or object. 28208 * 28209 * @static 28210 * @memberOf _ 28211 * @since 4.0.0 28212 * @category Lang 28213 * @param {*} value The value to check. 28214 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 28215 * @example 28216 * 28217 * _.isSymbol(Symbol.iterator); 28218 * // => true 28219 * 28220 * _.isSymbol('abc'); 28221 * // => false 28222 */ 28223 function isSymbol(value) { 28224 return typeof value == 'symbol' || 28225 (isObjectLike(value) && baseGetTag(value) == symbolTag); 28226 } 28227 28228 /** 28229 * Checks if `value` is classified as a typed array. 28230 * 28231 * @static 28232 * @memberOf _ 28233 * @since 3.0.0 28234 * @category Lang 28235 * @param {*} value The value to check. 28236 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 28237 * @example 28238 * 28239 * _.isTypedArray(new Uint8Array); 28240 * // => true 28241 * 28242 * _.isTypedArray([]); 28243 * // => false 28244 */ 28245 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 28246 28247 /** 28248 * Checks if `value` is `undefined`. 28249 * 28250 * @static 28251 * @since 0.1.0 28252 * @memberOf _ 28253 * @category Lang 28254 * @param {*} value The value to check. 28255 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 28256 * @example 28257 * 28258 * _.isUndefined(void 0); 28259 * // => true 28260 * 28261 * _.isUndefined(null); 28262 * // => false 28263 */ 28264 function isUndefined(value) { 28265 return value === undefined; 28266 } 28267 28268 /** 28269 * Checks if `value` is classified as a `WeakMap` object. 28270 * 28271 * @static 28272 * @memberOf _ 28273 * @since 4.3.0 28274 * @category Lang 28275 * @param {*} value The value to check. 28276 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 28277 * @example 28278 * 28279 * _.isWeakMap(new WeakMap); 28280 * // => true 28281 * 28282 * _.isWeakMap(new Map); 28283 * // => false 28284 */ 28285 function isWeakMap(value) { 28286 return isObjectLike(value) && getTag(value) == weakMapTag; 28287 } 28288 28289 /** 28290 * Checks if `value` is classified as a `WeakSet` object. 28291 * 28292 * @static 28293 * @memberOf _ 28294 * @since 4.3.0 28295 * @category Lang 28296 * @param {*} value The value to check. 28297 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 28298 * @example 28299 * 28300 * _.isWeakSet(new WeakSet); 28301 * // => true 28302 * 28303 * _.isWeakSet(new Set); 28304 * // => false 28305 */ 28306 function isWeakSet(value) { 28307 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 28308 } 28309 28310 /** 28311 * Checks if `value` is less than `other`. 28312 * 28313 * @static 28314 * @memberOf _ 28315 * @since 3.9.0 28316 * @category Lang 28317 * @param {*} value The value to compare. 28318 * @param {*} other The other value to compare. 28319 * @returns {boolean} Returns `true` if `value` is less than `other`, 28320 * else `false`. 28321 * @see _.gt 28322 * @example 28323 * 28324 * _.lt(1, 3); 28325 * // => true 28326 * 28327 * _.lt(3, 3); 28328 * // => false 28329 * 28330 * _.lt(3, 1); 28331 * // => false 28332 */ 28333 var lt = createRelationalOperation(baseLt); 28334 28335 /** 28336 * Checks if `value` is less than or equal to `other`. 28337 * 28338 * @static 28339 * @memberOf _ 28340 * @since 3.9.0 28341 * @category Lang 28342 * @param {*} value The value to compare. 28343 * @param {*} other The other value to compare. 28344 * @returns {boolean} Returns `true` if `value` is less than or equal to 28345 * `other`, else `false`. 28346 * @see _.gte 28347 * @example 28348 * 28349 * _.lte(1, 3); 28350 * // => true 28351 * 28352 * _.lte(3, 3); 28353 * // => true 28354 * 28355 * _.lte(3, 1); 28356 * // => false 28357 */ 28358 var lte = createRelationalOperation(function(value, other) { 28359 return value <= other; 28360 }); 28361 28362 /** 28363 * Converts `value` to an array. 28364 * 28365 * @static 28366 * @since 0.1.0 28367 * @memberOf _ 28368 * @category Lang 28369 * @param {*} value The value to convert. 28370 * @returns {Array} Returns the converted array. 28371 * @example 28372 * 28373 * _.toArray({ 'a': 1, 'b': 2 }); 28374 * // => [1, 2] 28375 * 28376 * _.toArray('abc'); 28377 * // => ['a', 'b', 'c'] 28378 * 28379 * _.toArray(1); 28380 * // => [] 28381 * 28382 * _.toArray(null); 28383 * // => [] 28384 */ 28385 function toArray(value) { 28386 if (!value) { 28387 return []; 28388 } 28389 if (isArrayLike(value)) { 28390 return isString(value) ? stringToArray(value) : copyArray(value); 28391 } 28392 if (symIterator && value[symIterator]) { 28393 return iteratorToArray(value[symIterator]()); 28394 } 28395 var tag = getTag(value), 28396 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); 28397 28398 return func(value); 28399 } 28400 28401 /** 28402 * Converts `value` to a finite number. 28403 * 28404 * @static 28405 * @memberOf _ 28406 * @since 4.12.0 28407 * @category Lang 28408 * @param {*} value The value to convert. 28409 * @returns {number} Returns the converted number. 28410 * @example 28411 * 28412 * _.toFinite(3.2); 28413 * // => 3.2 28414 * 28415 * _.toFinite(Number.MIN_VALUE); 28416 * // => 5e-324 28417 * 28418 * _.toFinite(Infinity); 28419 * // => 1.7976931348623157e+308 28420 * 28421 * _.toFinite('3.2'); 28422 * // => 3.2 28423 */ 28424 function toFinite(value) { 28425 if (!value) { 28426 return value === 0 ? value : 0; 28427 } 28428 value = toNumber(value); 28429 if (value === INFINITY || value === -INFINITY) { 28430 var sign = (value < 0 ? -1 : 1); 28431 return sign * MAX_INTEGER; 28432 } 28433 return value === value ? value : 0; 28434 } 28435 28436 /** 28437 * Converts `value` to an integer. 28438 * 28439 * **Note:** This method is loosely based on 28440 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 28441 * 28442 * @static 28443 * @memberOf _ 28444 * @since 4.0.0 28445 * @category Lang 28446 * @param {*} value The value to convert. 28447 * @returns {number} Returns the converted integer. 28448 * @example 28449 * 28450 * _.toInteger(3.2); 28451 * // => 3 28452 * 28453 * _.toInteger(Number.MIN_VALUE); 28454 * // => 0 28455 * 28456 * _.toInteger(Infinity); 28457 * // => 1.7976931348623157e+308 28458 * 28459 * _.toInteger('3.2'); 28460 * // => 3 28461 */ 28462 function toInteger(value) { 28463 var result = toFinite(value), 28464 remainder = result % 1; 28465 28466 return result === result ? (remainder ? result - remainder : result) : 0; 28467 } 28468 28469 /** 28470 * Converts `value` to an integer suitable for use as the length of an 28471 * array-like object. 28472 * 28473 * **Note:** This method is based on 28474 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 28475 * 28476 * @static 28477 * @memberOf _ 28478 * @since 4.0.0 28479 * @category Lang 28480 * @param {*} value The value to convert. 28481 * @returns {number} Returns the converted integer. 28482 * @example 28483 * 28484 * _.toLength(3.2); 28485 * // => 3 28486 * 28487 * _.toLength(Number.MIN_VALUE); 28488 * // => 0 28489 * 28490 * _.toLength(Infinity); 28491 * // => 4294967295 28492 * 28493 * _.toLength('3.2'); 28494 * // => 3 28495 */ 28496 function toLength(value) { 28497 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 28498 } 28499 28500 /** 28501 * Converts `value` to a number. 28502 * 28503 * @static 28504 * @memberOf _ 28505 * @since 4.0.0 28506 * @category Lang 28507 * @param {*} value The value to process. 28508 * @returns {number} Returns the number. 28509 * @example 28510 * 28511 * _.toNumber(3.2); 28512 * // => 3.2 28513 * 28514 * _.toNumber(Number.MIN_VALUE); 28515 * // => 5e-324 28516 * 28517 * _.toNumber(Infinity); 28518 * // => Infinity 28519 * 28520 * _.toNumber('3.2'); 28521 * // => 3.2 28522 */ 28523 function toNumber(value) { 28524 if (typeof value == 'number') { 28525 return value; 28526 } 28527 if (isSymbol(value)) { 28528 return NAN; 28529 } 28530 if (isObject(value)) { 28531 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 28532 value = isObject(other) ? (other + '') : other; 28533 } 28534 if (typeof value != 'string') { 28535 return value === 0 ? value : +value; 28536 } 28537 value = baseTrim(value); 28538 var isBinary = reIsBinary.test(value); 28539 return (isBinary || reIsOctal.test(value)) 28540 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 28541 : (reIsBadHex.test(value) ? NAN : +value); 28542 } 28543 28544 /** 28545 * Converts `value` to a plain object flattening inherited enumerable string 28546 * keyed properties of `value` to own properties of the plain object. 28547 * 28548 * @static 28549 * @memberOf _ 28550 * @since 3.0.0 28551 * @category Lang 28552 * @param {*} value The value to convert. 28553 * @returns {Object} Returns the converted plain object. 28554 * @example 28555 * 28556 * function Foo() { 28557 * this.b = 2; 28558 * } 28559 * 28560 * Foo.prototype.c = 3; 28561 * 28562 * _.assign({ 'a': 1 }, new Foo); 28563 * // => { 'a': 1, 'b': 2 } 28564 * 28565 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 28566 * // => { 'a': 1, 'b': 2, 'c': 3 } 28567 */ 28568 function toPlainObject(value) { 28569 return copyObject(value, keysIn(value)); 28570 } 28571 28572 /** 28573 * Converts `value` to a safe integer. A safe integer can be compared and 28574 * represented correctly. 28575 * 28576 * @static 28577 * @memberOf _ 28578 * @since 4.0.0 28579 * @category Lang 28580 * @param {*} value The value to convert. 28581 * @returns {number} Returns the converted integer. 28582 * @example 28583 * 28584 * _.toSafeInteger(3.2); 28585 * // => 3 28586 * 28587 * _.toSafeInteger(Number.MIN_VALUE); 28588 * // => 0 28589 * 28590 * _.toSafeInteger(Infinity); 28591 * // => 9007199254740991 28592 * 28593 * _.toSafeInteger('3.2'); 28594 * // => 3 28595 */ 28596 function toSafeInteger(value) { 28597 return value 28598 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) 28599 : (value === 0 ? value : 0); 28600 } 28601 28602 /** 28603 * Converts `value` to a string. An empty string is returned for `null` 28604 * and `undefined` values. The sign of `-0` is preserved. 28605 * 28606 * @static 28607 * @memberOf _ 28608 * @since 4.0.0 28609 * @category Lang 28610 * @param {*} value The value to convert. 28611 * @returns {string} Returns the converted string. 28612 * @example 28613 * 28614 * _.toString(null); 28615 * // => '' 28616 * 28617 * _.toString(-0); 28618 * // => '-0' 28619 * 28620 * _.toString([1, 2, 3]); 28621 * // => '1,2,3' 28622 */ 28623 function toString(value) { 28624 return value == null ? '' : baseToString(value); 28625 } 28626 28627 /*------------------------------------------------------------------------*/ 28628 28629 /** 28630 * Assigns own enumerable string keyed properties of source objects to the 28631 * destination object. Source objects are applied from left to right. 28632 * Subsequent sources overwrite property assignments of previous sources. 28633 * 28634 * **Note:** This method mutates `object` and is loosely based on 28635 * [`Object.assign`](https://mdn.io/Object/assign). 28636 * 28637 * @static 28638 * @memberOf _ 28639 * @since 0.10.0 28640 * @category Object 28641 * @param {Object} object The destination object. 28642 * @param {...Object} [sources] The source objects. 28643 * @returns {Object} Returns `object`. 28644 * @see _.assignIn 28645 * @example 28646 * 28647 * function Foo() { 28648 * this.a = 1; 28649 * } 28650 * 28651 * function Bar() { 28652 * this.c = 3; 28653 * } 28654 * 28655 * Foo.prototype.b = 2; 28656 * Bar.prototype.d = 4; 28657 * 28658 * _.assign({ 'a': 0 }, new Foo, new Bar); 28659 * // => { 'a': 1, 'c': 3 } 28660 */ 28661 var assign = createAssigner(function(object, source) { 28662 if (isPrototype(source) || isArrayLike(source)) { 28663 copyObject(source, keys(source), object); 28664 return; 28665 } 28666 for (var key in source) { 28667 if (hasOwnProperty.call(source, key)) { 28668 assignValue(object, key, source[key]); 28669 } 28670 } 28671 }); 28672 28673 /** 28674 * This method is like `_.assign` except that it iterates over own and 28675 * inherited source properties. 28676 * 28677 * **Note:** This method mutates `object`. 28678 * 28679 * @static 28680 * @memberOf _ 28681 * @since 4.0.0 28682 * @alias extend 28683 * @category Object 28684 * @param {Object} object The destination object. 28685 * @param {...Object} [sources] The source objects. 28686 * @returns {Object} Returns `object`. 28687 * @see _.assign 28688 * @example 28689 * 28690 * function Foo() { 28691 * this.a = 1; 28692 * } 28693 * 28694 * function Bar() { 28695 * this.c = 3; 28696 * } 28697 * 28698 * Foo.prototype.b = 2; 28699 * Bar.prototype.d = 4; 28700 * 28701 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 28702 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 28703 */ 28704 var assignIn = createAssigner(function(object, source) { 28705 copyObject(source, keysIn(source), object); 28706 }); 28707 28708 /** 28709 * This method is like `_.assignIn` except that it accepts `customizer` 28710 * which is invoked to produce the assigned values. If `customizer` returns 28711 * `undefined`, assignment is handled by the method instead. The `customizer` 28712 * is invoked with five arguments: (objValue, srcValue, key, object, source). 28713 * 28714 * **Note:** This method mutates `object`. 28715 * 28716 * @static 28717 * @memberOf _ 28718 * @since 4.0.0 28719 * @alias extendWith 28720 * @category Object 28721 * @param {Object} object The destination object. 28722 * @param {...Object} sources The source objects. 28723 * @param {Function} [customizer] The function to customize assigned values. 28724 * @returns {Object} Returns `object`. 28725 * @see _.assignWith 28726 * @example 28727 * 28728 * function customizer(objValue, srcValue) { 28729 * return _.isUndefined(objValue) ? srcValue : objValue; 28730 * } 28731 * 28732 * var defaults = _.partialRight(_.assignInWith, customizer); 28733 * 28734 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 28735 * // => { 'a': 1, 'b': 2 } 28736 */ 28737 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 28738 copyObject(source, keysIn(source), object, customizer); 28739 }); 28740 28741 /** 28742 * This method is like `_.assign` except that it accepts `customizer` 28743 * which is invoked to produce the assigned values. If `customizer` returns 28744 * `undefined`, assignment is handled by the method instead. The `customizer` 28745 * is invoked with five arguments: (objValue, srcValue, key, object, source). 28746 * 28747 * **Note:** This method mutates `object`. 28748 * 28749 * @static 28750 * @memberOf _ 28751 * @since 4.0.0 28752 * @category Object 28753 * @param {Object} object The destination object. 28754 * @param {...Object} sources The source objects. 28755 * @param {Function} [customizer] The function to customize assigned values. 28756 * @returns {Object} Returns `object`. 28757 * @see _.assignInWith 28758 * @example 28759 * 28760 * function customizer(objValue, srcValue) { 28761 * return _.isUndefined(objValue) ? srcValue : objValue; 28762 * } 28763 * 28764 * var defaults = _.partialRight(_.assignWith, customizer); 28765 * 28766 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 28767 * // => { 'a': 1, 'b': 2 } 28768 */ 28769 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 28770 copyObject(source, keys(source), object, customizer); 28771 }); 28772 28773 /** 28774 * Creates an array of values corresponding to `paths` of `object`. 28775 * 28776 * @static 28777 * @memberOf _ 28778 * @since 1.0.0 28779 * @category Object 28780 * @param {Object} object The object to iterate over. 28781 * @param {...(string|string[])} [paths] The property paths to pick. 28782 * @returns {Array} Returns the picked values. 28783 * @example 28784 * 28785 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 28786 * 28787 * _.at(object, ['a[0].b.c', 'a[1]']); 28788 * // => [3, 4] 28789 */ 28790 var at = flatRest(baseAt); 28791 28792 /** 28793 * Creates an object that inherits from the `prototype` object. If a 28794 * `properties` object is given, its own enumerable string keyed properties 28795 * are assigned to the created object. 28796 * 28797 * @static 28798 * @memberOf _ 28799 * @since 2.3.0 28800 * @category Object 28801 * @param {Object} prototype The object to inherit from. 28802 * @param {Object} [properties] The properties to assign to the object. 28803 * @returns {Object} Returns the new object. 28804 * @example 28805 * 28806 * function Shape() { 28807 * this.x = 0; 28808 * this.y = 0; 28809 * } 28810 * 28811 * function Circle() { 28812 * Shape.call(this); 28813 * } 28814 * 28815 * Circle.prototype = _.create(Shape.prototype, { 28816 * 'constructor': Circle 28817 * }); 28818 * 28819 * var circle = new Circle; 28820 * circle instanceof Circle; 28821 * // => true 28822 * 28823 * circle instanceof Shape; 28824 * // => true 28825 */ 28826 function create(prototype, properties) { 28827 var result = baseCreate(prototype); 28828 return properties == null ? result : baseAssign(result, properties); 28829 } 28830 28831 /** 28832 * Assigns own and inherited enumerable string keyed properties of source 28833 * objects to the destination object for all destination properties that 28834 * resolve to `undefined`. Source objects are applied from left to right. 28835 * Once a property is set, additional values of the same property are ignored. 28836 * 28837 * **Note:** This method mutates `object`. 28838 * 28839 * @static 28840 * @since 0.1.0 28841 * @memberOf _ 28842 * @category Object 28843 * @param {Object} object The destination object. 28844 * @param {...Object} [sources] The source objects. 28845 * @returns {Object} Returns `object`. 28846 * @see _.defaultsDeep 28847 * @example 28848 * 28849 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 28850 * // => { 'a': 1, 'b': 2 } 28851 */ 28852 var defaults = baseRest(function(object, sources) { 28853 object = Object(object); 28854 28855 var index = -1; 28856 var length = sources.length; 28857 var guard = length > 2 ? sources[2] : undefined; 28858 28859 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 28860 length = 1; 28861 } 28862 28863 while (++index < length) { 28864 var source = sources[index]; 28865 var props = keysIn(source); 28866 var propsIndex = -1; 28867 var propsLength = props.length; 28868 28869 while (++propsIndex < propsLength) { 28870 var key = props[propsIndex]; 28871 var value = object[key]; 28872 28873 if (value === undefined || 28874 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 28875 object[key] = source[key]; 28876 } 28877 } 28878 } 28879 28880 return object; 28881 }); 28882 28883 /** 28884 * This method is like `_.defaults` except that it recursively assigns 28885 * default properties. 28886 * 28887 * **Note:** This method mutates `object`. 28888 * 28889 * @static 28890 * @memberOf _ 28891 * @since 3.10.0 28892 * @category Object 28893 * @param {Object} object The destination object. 28894 * @param {...Object} [sources] The source objects. 28895 * @returns {Object} Returns `object`. 28896 * @see _.defaults 28897 * @example 28898 * 28899 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 28900 * // => { 'a': { 'b': 2, 'c': 3 } } 28901 */ 28902 var defaultsDeep = baseRest(function(args) { 28903 args.push(undefined, customDefaultsMerge); 28904 return apply(mergeWith, undefined, args); 28905 }); 28906 28907 /** 28908 * This method is like `_.find` except that it returns the key of the first 28909 * element `predicate` returns truthy for instead of the element itself. 28910 * 28911 * @static 28912 * @memberOf _ 28913 * @since 1.1.0 28914 * @category Object 28915 * @param {Object} object The object to inspect. 28916 * @param {Function} [predicate=_.identity] The function invoked per iteration. 28917 * @returns {string|undefined} Returns the key of the matched element, 28918 * else `undefined`. 28919 * @example 28920 * 28921 * var users = { 28922 * 'barney': { 'age': 36, 'active': true }, 28923 * 'fred': { 'age': 40, 'active': false }, 28924 * 'pebbles': { 'age': 1, 'active': true } 28925 * }; 28926 * 28927 * _.findKey(users, function(o) { return o.age < 40; }); 28928 * // => 'barney' (iteration order is not guaranteed) 28929 * 28930 * // The `_.matches` iteratee shorthand. 28931 * _.findKey(users, { 'age': 1, 'active': true }); 28932 * // => 'pebbles' 28933 * 28934 * // The `_.matchesProperty` iteratee shorthand. 28935 * _.findKey(users, ['active', false]); 28936 * // => 'fred' 28937 * 28938 * // The `_.property` iteratee shorthand. 28939 * _.findKey(users, 'active'); 28940 * // => 'barney' 28941 */ 28942 function findKey(object, predicate) { 28943 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 28944 } 28945 28946 /** 28947 * This method is like `_.findKey` except that it iterates over elements of 28948 * a collection in the opposite order. 28949 * 28950 * @static 28951 * @memberOf _ 28952 * @since 2.0.0 28953 * @category Object 28954 * @param {Object} object The object to inspect. 28955 * @param {Function} [predicate=_.identity] The function invoked per iteration. 28956 * @returns {string|undefined} Returns the key of the matched element, 28957 * else `undefined`. 28958 * @example 28959 * 28960 * var users = { 28961 * 'barney': { 'age': 36, 'active': true }, 28962 * 'fred': { 'age': 40, 'active': false }, 28963 * 'pebbles': { 'age': 1, 'active': true } 28964 * }; 28965 * 28966 * _.findLastKey(users, function(o) { return o.age < 40; }); 28967 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 28968 * 28969 * // The `_.matches` iteratee shorthand. 28970 * _.findLastKey(users, { 'age': 36, 'active': true }); 28971 * // => 'barney' 28972 * 28973 * // The `_.matchesProperty` iteratee shorthand. 28974 * _.findLastKey(users, ['active', false]); 28975 * // => 'fred' 28976 * 28977 * // The `_.property` iteratee shorthand. 28978 * _.findLastKey(users, 'active'); 28979 * // => 'pebbles' 28980 */ 28981 function findLastKey(object, predicate) { 28982 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 28983 } 28984 28985 /** 28986 * Iterates over own and inherited enumerable string keyed properties of an 28987 * object and invokes `iteratee` for each property. The iteratee is invoked 28988 * with three arguments: (value, key, object). Iteratee functions may exit 28989 * iteration early by explicitly returning `false`. 28990 * 28991 * @static 28992 * @memberOf _ 28993 * @since 0.3.0 28994 * @category Object 28995 * @param {Object} object The object to iterate over. 28996 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 28997 * @returns {Object} Returns `object`. 28998 * @see _.forInRight 28999 * @example 29000 * 29001 * function Foo() { 29002 * this.a = 1; 29003 * this.b = 2; 29004 * } 29005 * 29006 * Foo.prototype.c = 3; 29007 * 29008 * _.forIn(new Foo, function(value, key) { 29009 * console.log(key); 29010 * }); 29011 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 29012 */ 29013 function forIn(object, iteratee) { 29014 return object == null 29015 ? object 29016 : baseFor(object, getIteratee(iteratee, 3), keysIn); 29017 } 29018 29019 /** 29020 * This method is like `_.forIn` except that it iterates over properties of 29021 * `object` in the opposite order. 29022 * 29023 * @static 29024 * @memberOf _ 29025 * @since 2.0.0 29026 * @category Object 29027 * @param {Object} object The object to iterate over. 29028 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29029 * @returns {Object} Returns `object`. 29030 * @see _.forIn 29031 * @example 29032 * 29033 * function Foo() { 29034 * this.a = 1; 29035 * this.b = 2; 29036 * } 29037 * 29038 * Foo.prototype.c = 3; 29039 * 29040 * _.forInRight(new Foo, function(value, key) { 29041 * console.log(key); 29042 * }); 29043 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 29044 */ 29045 function forInRight(object, iteratee) { 29046 return object == null 29047 ? object 29048 : baseForRight(object, getIteratee(iteratee, 3), keysIn); 29049 } 29050 29051 /** 29052 * Iterates over own enumerable string keyed properties of an object and 29053 * invokes `iteratee` for each property. The iteratee is invoked with three 29054 * arguments: (value, key, object). Iteratee functions may exit iteration 29055 * early by explicitly returning `false`. 29056 * 29057 * @static 29058 * @memberOf _ 29059 * @since 0.3.0 29060 * @category Object 29061 * @param {Object} object The object to iterate over. 29062 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29063 * @returns {Object} Returns `object`. 29064 * @see _.forOwnRight 29065 * @example 29066 * 29067 * function Foo() { 29068 * this.a = 1; 29069 * this.b = 2; 29070 * } 29071 * 29072 * Foo.prototype.c = 3; 29073 * 29074 * _.forOwn(new Foo, function(value, key) { 29075 * console.log(key); 29076 * }); 29077 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 29078 */ 29079 function forOwn(object, iteratee) { 29080 return object && baseForOwn(object, getIteratee(iteratee, 3)); 29081 } 29082 29083 /** 29084 * This method is like `_.forOwn` except that it iterates over properties of 29085 * `object` in the opposite order. 29086 * 29087 * @static 29088 * @memberOf _ 29089 * @since 2.0.0 29090 * @category Object 29091 * @param {Object} object The object to iterate over. 29092 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29093 * @returns {Object} Returns `object`. 29094 * @see _.forOwn 29095 * @example 29096 * 29097 * function Foo() { 29098 * this.a = 1; 29099 * this.b = 2; 29100 * } 29101 * 29102 * Foo.prototype.c = 3; 29103 * 29104 * _.forOwnRight(new Foo, function(value, key) { 29105 * console.log(key); 29106 * }); 29107 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 29108 */ 29109 function forOwnRight(object, iteratee) { 29110 return object && baseForOwnRight(object, getIteratee(iteratee, 3)); 29111 } 29112 29113 /** 29114 * Creates an array of function property names from own enumerable properties 29115 * of `object`. 29116 * 29117 * @static 29118 * @since 0.1.0 29119 * @memberOf _ 29120 * @category Object 29121 * @param {Object} object The object to inspect. 29122 * @returns {Array} Returns the function names. 29123 * @see _.functionsIn 29124 * @example 29125 * 29126 * function Foo() { 29127 * this.a = _.constant('a'); 29128 * this.b = _.constant('b'); 29129 * } 29130 * 29131 * Foo.prototype.c = _.constant('c'); 29132 * 29133 * _.functions(new Foo); 29134 * // => ['a', 'b'] 29135 */ 29136 function functions(object) { 29137 return object == null ? [] : baseFunctions(object, keys(object)); 29138 } 29139 29140 /** 29141 * Creates an array of function property names from own and inherited 29142 * enumerable properties of `object`. 29143 * 29144 * @static 29145 * @memberOf _ 29146 * @since 4.0.0 29147 * @category Object 29148 * @param {Object} object The object to inspect. 29149 * @returns {Array} Returns the function names. 29150 * @see _.functions 29151 * @example 29152 * 29153 * function Foo() { 29154 * this.a = _.constant('a'); 29155 * this.b = _.constant('b'); 29156 * } 29157 * 29158 * Foo.prototype.c = _.constant('c'); 29159 * 29160 * _.functionsIn(new Foo); 29161 * // => ['a', 'b', 'c'] 29162 */ 29163 function functionsIn(object) { 29164 return object == null ? [] : baseFunctions(object, keysIn(object)); 29165 } 29166 29167 /** 29168 * Gets the value at `path` of `object`. If the resolved value is 29169 * `undefined`, the `defaultValue` is returned in its place. 29170 * 29171 * @static 29172 * @memberOf _ 29173 * @since 3.7.0 29174 * @category Object 29175 * @param {Object} object The object to query. 29176 * @param {Array|string} path The path of the property to get. 29177 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 29178 * @returns {*} Returns the resolved value. 29179 * @example 29180 * 29181 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 29182 * 29183 * _.get(object, 'a[0].b.c'); 29184 * // => 3 29185 * 29186 * _.get(object, ['a', '0', 'b', 'c']); 29187 * // => 3 29188 * 29189 * _.get(object, 'a.b.c', 'default'); 29190 * // => 'default' 29191 */ 29192 function get(object, path, defaultValue) { 29193 var result = object == null ? undefined : baseGet(object, path); 29194 return result === undefined ? defaultValue : result; 29195 } 29196 29197 /** 29198 * Checks if `path` is a direct property of `object`. 29199 * 29200 * @static 29201 * @since 0.1.0 29202 * @memberOf _ 29203 * @category Object 29204 * @param {Object} object The object to query. 29205 * @param {Array|string} path The path to check. 29206 * @returns {boolean} Returns `true` if `path` exists, else `false`. 29207 * @example 29208 * 29209 * var object = { 'a': { 'b': 2 } }; 29210 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 29211 * 29212 * _.has(object, 'a'); 29213 * // => true 29214 * 29215 * _.has(object, 'a.b'); 29216 * // => true 29217 * 29218 * _.has(object, ['a', 'b']); 29219 * // => true 29220 * 29221 * _.has(other, 'a'); 29222 * // => false 29223 */ 29224 function has(object, path) { 29225 return object != null && hasPath(object, path, baseHas); 29226 } 29227 29228 /** 29229 * Checks if `path` is a direct or inherited property of `object`. 29230 * 29231 * @static 29232 * @memberOf _ 29233 * @since 4.0.0 29234 * @category Object 29235 * @param {Object} object The object to query. 29236 * @param {Array|string} path The path to check. 29237 * @returns {boolean} Returns `true` if `path` exists, else `false`. 29238 * @example 29239 * 29240 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 29241 * 29242 * _.hasIn(object, 'a'); 29243 * // => true 29244 * 29245 * _.hasIn(object, 'a.b'); 29246 * // => true 29247 * 29248 * _.hasIn(object, ['a', 'b']); 29249 * // => true 29250 * 29251 * _.hasIn(object, 'b'); 29252 * // => false 29253 */ 29254 function hasIn(object, path) { 29255 return object != null && hasPath(object, path, baseHasIn); 29256 } 29257 29258 /** 29259 * Creates an object composed of the inverted keys and values of `object`. 29260 * If `object` contains duplicate values, subsequent values overwrite 29261 * property assignments of previous values. 29262 * 29263 * @static 29264 * @memberOf _ 29265 * @since 0.7.0 29266 * @category Object 29267 * @param {Object} object The object to invert. 29268 * @returns {Object} Returns the new inverted object. 29269 * @example 29270 * 29271 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 29272 * 29273 * _.invert(object); 29274 * // => { '1': 'c', '2': 'b' } 29275 */ 29276 var invert = createInverter(function(result, value, key) { 29277 if (value != null && 29278 typeof value.toString != 'function') { 29279 value = nativeObjectToString.call(value); 29280 } 29281 29282 result[value] = key; 29283 }, constant(identity)); 29284 29285 /** 29286 * This method is like `_.invert` except that the inverted object is generated 29287 * from the results of running each element of `object` thru `iteratee`. The 29288 * corresponding inverted value of each inverted key is an array of keys 29289 * responsible for generating the inverted value. The iteratee is invoked 29290 * with one argument: (value). 29291 * 29292 * @static 29293 * @memberOf _ 29294 * @since 4.1.0 29295 * @category Object 29296 * @param {Object} object The object to invert. 29297 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 29298 * @returns {Object} Returns the new inverted object. 29299 * @example 29300 * 29301 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 29302 * 29303 * _.invertBy(object); 29304 * // => { '1': ['a', 'c'], '2': ['b'] } 29305 * 29306 * _.invertBy(object, function(value) { 29307 * return 'group' + value; 29308 * }); 29309 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 29310 */ 29311 var invertBy = createInverter(function(result, value, key) { 29312 if (value != null && 29313 typeof value.toString != 'function') { 29314 value = nativeObjectToString.call(value); 29315 } 29316 29317 if (hasOwnProperty.call(result, value)) { 29318 result[value].push(key); 29319 } else { 29320 result[value] = [key]; 29321 } 29322 }, getIteratee); 29323 29324 /** 29325 * Invokes the method at `path` of `object`. 29326 * 29327 * @static 29328 * @memberOf _ 29329 * @since 4.0.0 29330 * @category Object 29331 * @param {Object} object The object to query. 29332 * @param {Array|string} path The path of the method to invoke. 29333 * @param {...*} [args] The arguments to invoke the method with. 29334 * @returns {*} Returns the result of the invoked method. 29335 * @example 29336 * 29337 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 29338 * 29339 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 29340 * // => [2, 3] 29341 */ 29342 var invoke = baseRest(baseInvoke); 29343 29344 /** 29345 * Creates an array of the own enumerable property names of `object`. 29346 * 29347 * **Note:** Non-object values are coerced to objects. See the 29348 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 29349 * for more details. 29350 * 29351 * @static 29352 * @since 0.1.0 29353 * @memberOf _ 29354 * @category Object 29355 * @param {Object} object The object to query. 29356 * @returns {Array} Returns the array of property names. 29357 * @example 29358 * 29359 * function Foo() { 29360 * this.a = 1; 29361 * this.b = 2; 29362 * } 29363 * 29364 * Foo.prototype.c = 3; 29365 * 29366 * _.keys(new Foo); 29367 * // => ['a', 'b'] (iteration order is not guaranteed) 29368 * 29369 * _.keys('hi'); 29370 * // => ['0', '1'] 29371 */ 29372 function keys(object) { 29373 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 29374 } 29375 29376 /** 29377 * Creates an array of the own and inherited enumerable property names of `object`. 29378 * 29379 * **Note:** Non-object values are coerced to objects. 29380 * 29381 * @static 29382 * @memberOf _ 29383 * @since 3.0.0 29384 * @category Object 29385 * @param {Object} object The object to query. 29386 * @returns {Array} Returns the array of property names. 29387 * @example 29388 * 29389 * function Foo() { 29390 * this.a = 1; 29391 * this.b = 2; 29392 * } 29393 * 29394 * Foo.prototype.c = 3; 29395 * 29396 * _.keysIn(new Foo); 29397 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 29398 */ 29399 function keysIn(object) { 29400 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 29401 } 29402 29403 /** 29404 * The opposite of `_.mapValues`; this method creates an object with the 29405 * same values as `object` and keys generated by running each own enumerable 29406 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 29407 * with three arguments: (value, key, object). 29408 * 29409 * @static 29410 * @memberOf _ 29411 * @since 3.8.0 29412 * @category Object 29413 * @param {Object} object The object to iterate over. 29414 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29415 * @returns {Object} Returns the new mapped object. 29416 * @see _.mapValues 29417 * @example 29418 * 29419 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 29420 * return key + value; 29421 * }); 29422 * // => { 'a1': 1, 'b2': 2 } 29423 */ 29424 function mapKeys(object, iteratee) { 29425 var result = {}; 29426 iteratee = getIteratee(iteratee, 3); 29427 29428 baseForOwn(object, function(value, key, object) { 29429 baseAssignValue(result, iteratee(value, key, object), value); 29430 }); 29431 return result; 29432 } 29433 29434 /** 29435 * Creates an object with the same keys as `object` and values generated 29436 * by running each own enumerable string keyed property of `object` thru 29437 * `iteratee`. The iteratee is invoked with three arguments: 29438 * (value, key, object). 29439 * 29440 * @static 29441 * @memberOf _ 29442 * @since 2.4.0 29443 * @category Object 29444 * @param {Object} object The object to iterate over. 29445 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29446 * @returns {Object} Returns the new mapped object. 29447 * @see _.mapKeys 29448 * @example 29449 * 29450 * var users = { 29451 * 'fred': { 'user': 'fred', 'age': 40 }, 29452 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 29453 * }; 29454 * 29455 * _.mapValues(users, function(o) { return o.age; }); 29456 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 29457 * 29458 * // The `_.property` iteratee shorthand. 29459 * _.mapValues(users, 'age'); 29460 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 29461 */ 29462 function mapValues(object, iteratee) { 29463 var result = {}; 29464 iteratee = getIteratee(iteratee, 3); 29465 29466 baseForOwn(object, function(value, key, object) { 29467 baseAssignValue(result, key, iteratee(value, key, object)); 29468 }); 29469 return result; 29470 } 29471 29472 /** 29473 * This method is like `_.assign` except that it recursively merges own and 29474 * inherited enumerable string keyed properties of source objects into the 29475 * destination object. Source properties that resolve to `undefined` are 29476 * skipped if a destination value exists. Array and plain object properties 29477 * are merged recursively. Other objects and value types are overridden by 29478 * assignment. Source objects are applied from left to right. Subsequent 29479 * sources overwrite property assignments of previous sources. 29480 * 29481 * **Note:** This method mutates `object`. 29482 * 29483 * @static 29484 * @memberOf _ 29485 * @since 0.5.0 29486 * @category Object 29487 * @param {Object} object The destination object. 29488 * @param {...Object} [sources] The source objects. 29489 * @returns {Object} Returns `object`. 29490 * @example 29491 * 29492 * var object = { 29493 * 'a': [{ 'b': 2 }, { 'd': 4 }] 29494 * }; 29495 * 29496 * var other = { 29497 * 'a': [{ 'c': 3 }, { 'e': 5 }] 29498 * }; 29499 * 29500 * _.merge(object, other); 29501 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 29502 */ 29503 var merge = createAssigner(function(object, source, srcIndex) { 29504 baseMerge(object, source, srcIndex); 29505 }); 29506 29507 /** 29508 * This method is like `_.merge` except that it accepts `customizer` which 29509 * is invoked to produce the merged values of the destination and source 29510 * properties. If `customizer` returns `undefined`, merging is handled by the 29511 * method instead. The `customizer` is invoked with six arguments: 29512 * (objValue, srcValue, key, object, source, stack). 29513 * 29514 * **Note:** This method mutates `object`. 29515 * 29516 * @static 29517 * @memberOf _ 29518 * @since 4.0.0 29519 * @category Object 29520 * @param {Object} object The destination object. 29521 * @param {...Object} sources The source objects. 29522 * @param {Function} customizer The function to customize assigned values. 29523 * @returns {Object} Returns `object`. 29524 * @example 29525 * 29526 * function customizer(objValue, srcValue) { 29527 * if (_.isArray(objValue)) { 29528 * return objValue.concat(srcValue); 29529 * } 29530 * } 29531 * 29532 * var object = { 'a': [1], 'b': [2] }; 29533 * var other = { 'a': [3], 'b': [4] }; 29534 * 29535 * _.mergeWith(object, other, customizer); 29536 * // => { 'a': [1, 3], 'b': [2, 4] } 29537 */ 29538 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 29539 baseMerge(object, source, srcIndex, customizer); 29540 }); 29541 29542 /** 29543 * The opposite of `_.pick`; this method creates an object composed of the 29544 * own and inherited enumerable property paths of `object` that are not omitted. 29545 * 29546 * **Note:** This method is considerably slower than `_.pick`. 29547 * 29548 * @static 29549 * @since 0.1.0 29550 * @memberOf _ 29551 * @category Object 29552 * @param {Object} object The source object. 29553 * @param {...(string|string[])} [paths] The property paths to omit. 29554 * @returns {Object} Returns the new object. 29555 * @example 29556 * 29557 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 29558 * 29559 * _.omit(object, ['a', 'c']); 29560 * // => { 'b': '2' } 29561 */ 29562 var omit = flatRest(function(object, paths) { 29563 var result = {}; 29564 if (object == null) { 29565 return result; 29566 } 29567 var isDeep = false; 29568 paths = arrayMap(paths, function(path) { 29569 path = castPath(path, object); 29570 isDeep || (isDeep = path.length > 1); 29571 return path; 29572 }); 29573 copyObject(object, getAllKeysIn(object), result); 29574 if (isDeep) { 29575 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 29576 } 29577 var length = paths.length; 29578 while (length--) { 29579 baseUnset(result, paths[length]); 29580 } 29581 return result; 29582 }); 29583 29584 /** 29585 * The opposite of `_.pickBy`; this method creates an object composed of 29586 * the own and inherited enumerable string keyed properties of `object` that 29587 * `predicate` doesn't return truthy for. The predicate is invoked with two 29588 * arguments: (value, key). 29589 * 29590 * @static 29591 * @memberOf _ 29592 * @since 4.0.0 29593 * @category Object 29594 * @param {Object} object The source object. 29595 * @param {Function} [predicate=_.identity] The function invoked per property. 29596 * @returns {Object} Returns the new object. 29597 * @example 29598 * 29599 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 29600 * 29601 * _.omitBy(object, _.isNumber); 29602 * // => { 'b': '2' } 29603 */ 29604 function omitBy(object, predicate) { 29605 return pickBy(object, negate(getIteratee(predicate))); 29606 } 29607 29608 /** 29609 * Creates an object composed of the picked `object` properties. 29610 * 29611 * @static 29612 * @since 0.1.0 29613 * @memberOf _ 29614 * @category Object 29615 * @param {Object} object The source object. 29616 * @param {...(string|string[])} [paths] The property paths to pick. 29617 * @returns {Object} Returns the new object. 29618 * @example 29619 * 29620 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 29621 * 29622 * _.pick(object, ['a', 'c']); 29623 * // => { 'a': 1, 'c': 3 } 29624 */ 29625 var pick = flatRest(function(object, paths) { 29626 return object == null ? {} : basePick(object, paths); 29627 }); 29628 29629 /** 29630 * Creates an object composed of the `object` properties `predicate` returns 29631 * truthy for. The predicate is invoked with two arguments: (value, key). 29632 * 29633 * @static 29634 * @memberOf _ 29635 * @since 4.0.0 29636 * @category Object 29637 * @param {Object} object The source object. 29638 * @param {Function} [predicate=_.identity] The function invoked per property. 29639 * @returns {Object} Returns the new object. 29640 * @example 29641 * 29642 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 29643 * 29644 * _.pickBy(object, _.isNumber); 29645 * // => { 'a': 1, 'c': 3 } 29646 */ 29647 function pickBy(object, predicate) { 29648 if (object == null) { 29649 return {}; 29650 } 29651 var props = arrayMap(getAllKeysIn(object), function(prop) { 29652 return [prop]; 29653 }); 29654 predicate = getIteratee(predicate); 29655 return basePickBy(object, props, function(value, path) { 29656 return predicate(value, path[0]); 29657 }); 29658 } 29659 29660 /** 29661 * This method is like `_.get` except that if the resolved value is a 29662 * function it's invoked with the `this` binding of its parent object and 29663 * its result is returned. 29664 * 29665 * @static 29666 * @since 0.1.0 29667 * @memberOf _ 29668 * @category Object 29669 * @param {Object} object The object to query. 29670 * @param {Array|string} path The path of the property to resolve. 29671 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 29672 * @returns {*} Returns the resolved value. 29673 * @example 29674 * 29675 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 29676 * 29677 * _.result(object, 'a[0].b.c1'); 29678 * // => 3 29679 * 29680 * _.result(object, 'a[0].b.c2'); 29681 * // => 4 29682 * 29683 * _.result(object, 'a[0].b.c3', 'default'); 29684 * // => 'default' 29685 * 29686 * _.result(object, 'a[0].b.c3', _.constant('default')); 29687 * // => 'default' 29688 */ 29689 function result(object, path, defaultValue) { 29690 path = castPath(path, object); 29691 29692 var index = -1, 29693 length = path.length; 29694 29695 // Ensure the loop is entered when path is empty. 29696 if (!length) { 29697 length = 1; 29698 object = undefined; 29699 } 29700 while (++index < length) { 29701 var value = object == null ? undefined : object[toKey(path[index])]; 29702 if (value === undefined) { 29703 index = length; 29704 value = defaultValue; 29705 } 29706 object = isFunction(value) ? value.call(object) : value; 29707 } 29708 return object; 29709 } 29710 29711 /** 29712 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 29713 * it's created. Arrays are created for missing index properties while objects 29714 * are created for all other missing properties. Use `_.setWith` to customize 29715 * `path` creation. 29716 * 29717 * **Note:** This method mutates `object`. 29718 * 29719 * @static 29720 * @memberOf _ 29721 * @since 3.7.0 29722 * @category Object 29723 * @param {Object} object The object to modify. 29724 * @param {Array|string} path The path of the property to set. 29725 * @param {*} value The value to set. 29726 * @returns {Object} Returns `object`. 29727 * @example 29728 * 29729 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 29730 * 29731 * _.set(object, 'a[0].b.c', 4); 29732 * console.log(object.a[0].b.c); 29733 * // => 4 29734 * 29735 * _.set(object, ['x', '0', 'y', 'z'], 5); 29736 * console.log(object.x[0].y.z); 29737 * // => 5 29738 */ 29739 function set(object, path, value) { 29740 return object == null ? object : baseSet(object, path, value); 29741 } 29742 29743 /** 29744 * This method is like `_.set` except that it accepts `customizer` which is 29745 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 29746 * path creation is handled by the method instead. The `customizer` is invoked 29747 * with three arguments: (nsValue, key, nsObject). 29748 * 29749 * **Note:** This method mutates `object`. 29750 * 29751 * @static 29752 * @memberOf _ 29753 * @since 4.0.0 29754 * @category Object 29755 * @param {Object} object The object to modify. 29756 * @param {Array|string} path The path of the property to set. 29757 * @param {*} value The value to set. 29758 * @param {Function} [customizer] The function to customize assigned values. 29759 * @returns {Object} Returns `object`. 29760 * @example 29761 * 29762 * var object = {}; 29763 * 29764 * _.setWith(object, '[0][1]', 'a', Object); 29765 * // => { '0': { '1': 'a' } } 29766 */ 29767 function setWith(object, path, value, customizer) { 29768 customizer = typeof customizer == 'function' ? customizer : undefined; 29769 return object == null ? object : baseSet(object, path, value, customizer); 29770 } 29771 29772 /** 29773 * Creates an array of own enumerable string keyed-value pairs for `object` 29774 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 29775 * entries are returned. 29776 * 29777 * @static 29778 * @memberOf _ 29779 * @since 4.0.0 29780 * @alias entries 29781 * @category Object 29782 * @param {Object} object The object to query. 29783 * @returns {Array} Returns the key-value pairs. 29784 * @example 29785 * 29786 * function Foo() { 29787 * this.a = 1; 29788 * this.b = 2; 29789 * } 29790 * 29791 * Foo.prototype.c = 3; 29792 * 29793 * _.toPairs(new Foo); 29794 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 29795 */ 29796 var toPairs = createToPairs(keys); 29797 29798 /** 29799 * Creates an array of own and inherited enumerable string keyed-value pairs 29800 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 29801 * or set, its entries are returned. 29802 * 29803 * @static 29804 * @memberOf _ 29805 * @since 4.0.0 29806 * @alias entriesIn 29807 * @category Object 29808 * @param {Object} object The object to query. 29809 * @returns {Array} Returns the key-value pairs. 29810 * @example 29811 * 29812 * function Foo() { 29813 * this.a = 1; 29814 * this.b = 2; 29815 * } 29816 * 29817 * Foo.prototype.c = 3; 29818 * 29819 * _.toPairsIn(new Foo); 29820 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 29821 */ 29822 var toPairsIn = createToPairs(keysIn); 29823 29824 /** 29825 * An alternative to `_.reduce`; this method transforms `object` to a new 29826 * `accumulator` object which is the result of running each of its own 29827 * enumerable string keyed properties thru `iteratee`, with each invocation 29828 * potentially mutating the `accumulator` object. If `accumulator` is not 29829 * provided, a new object with the same `[[Prototype]]` will be used. The 29830 * iteratee is invoked with four arguments: (accumulator, value, key, object). 29831 * Iteratee functions may exit iteration early by explicitly returning `false`. 29832 * 29833 * @static 29834 * @memberOf _ 29835 * @since 1.3.0 29836 * @category Object 29837 * @param {Object} object The object to iterate over. 29838 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 29839 * @param {*} [accumulator] The custom accumulator value. 29840 * @returns {*} Returns the accumulated value. 29841 * @example 29842 * 29843 * _.transform([2, 3, 4], function(result, n) { 29844 * result.push(n *= n); 29845 * return n % 2 == 0; 29846 * }, []); 29847 * // => [4, 9] 29848 * 29849 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 29850 * (result[value] || (result[value] = [])).push(key); 29851 * }, {}); 29852 * // => { '1': ['a', 'c'], '2': ['b'] } 29853 */ 29854 function transform(object, iteratee, accumulator) { 29855 var isArr = isArray(object), 29856 isArrLike = isArr || isBuffer(object) || isTypedArray(object); 29857 29858 iteratee = getIteratee(iteratee, 4); 29859 if (accumulator == null) { 29860 var Ctor = object && object.constructor; 29861 if (isArrLike) { 29862 accumulator = isArr ? new Ctor : []; 29863 } 29864 else if (isObject(object)) { 29865 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; 29866 } 29867 else { 29868 accumulator = {}; 29869 } 29870 } 29871 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { 29872 return iteratee(accumulator, value, index, object); 29873 }); 29874 return accumulator; 29875 } 29876 29877 /** 29878 * Removes the property at `path` of `object`. 29879 * 29880 * **Note:** This method mutates `object`. 29881 * 29882 * @static 29883 * @memberOf _ 29884 * @since 4.0.0 29885 * @category Object 29886 * @param {Object} object The object to modify. 29887 * @param {Array|string} path The path of the property to unset. 29888 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 29889 * @example 29890 * 29891 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 29892 * _.unset(object, 'a[0].b.c'); 29893 * // => true 29894 * 29895 * console.log(object); 29896 * // => { 'a': [{ 'b': {} }] }; 29897 * 29898 * _.unset(object, ['a', '0', 'b', 'c']); 29899 * // => true 29900 * 29901 * console.log(object); 29902 * // => { 'a': [{ 'b': {} }] }; 29903 */ 29904 function unset(object, path) { 29905 return object == null ? true : baseUnset(object, path); 29906 } 29907 29908 /** 29909 * This method is like `_.set` except that accepts `updater` to produce the 29910 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 29911 * is invoked with one argument: (value). 29912 * 29913 * **Note:** This method mutates `object`. 29914 * 29915 * @static 29916 * @memberOf _ 29917 * @since 4.6.0 29918 * @category Object 29919 * @param {Object} object The object to modify. 29920 * @param {Array|string} path The path of the property to set. 29921 * @param {Function} updater The function to produce the updated value. 29922 * @returns {Object} Returns `object`. 29923 * @example 29924 * 29925 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 29926 * 29927 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 29928 * console.log(object.a[0].b.c); 29929 * // => 9 29930 * 29931 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 29932 * console.log(object.x[0].y.z); 29933 * // => 0 29934 */ 29935 function update(object, path, updater) { 29936 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 29937 } 29938 29939 /** 29940 * This method is like `_.update` except that it accepts `customizer` which is 29941 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 29942 * path creation is handled by the method instead. The `customizer` is invoked 29943 * with three arguments: (nsValue, key, nsObject). 29944 * 29945 * **Note:** This method mutates `object`. 29946 * 29947 * @static 29948 * @memberOf _ 29949 * @since 4.6.0 29950 * @category Object 29951 * @param {Object} object The object to modify. 29952 * @param {Array|string} path The path of the property to set. 29953 * @param {Function} updater The function to produce the updated value. 29954 * @param {Function} [customizer] The function to customize assigned values. 29955 * @returns {Object} Returns `object`. 29956 * @example 29957 * 29958 * var object = {}; 29959 * 29960 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 29961 * // => { '0': { '1': 'a' } } 29962 */ 29963 function updateWith(object, path, updater, customizer) { 29964 customizer = typeof customizer == 'function' ? customizer : undefined; 29965 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 29966 } 29967 29968 /** 29969 * Creates an array of the own enumerable string keyed property values of `object`. 29970 * 29971 * **Note:** Non-object values are coerced to objects. 29972 * 29973 * @static 29974 * @since 0.1.0 29975 * @memberOf _ 29976 * @category Object 29977 * @param {Object} object The object to query. 29978 * @returns {Array} Returns the array of property values. 29979 * @example 29980 * 29981 * function Foo() { 29982 * this.a = 1; 29983 * this.b = 2; 29984 * } 29985 * 29986 * Foo.prototype.c = 3; 29987 * 29988 * _.values(new Foo); 29989 * // => [1, 2] (iteration order is not guaranteed) 29990 * 29991 * _.values('hi'); 29992 * // => ['h', 'i'] 29993 */ 29994 function values(object) { 29995 return object == null ? [] : baseValues(object, keys(object)); 29996 } 29997 29998 /** 29999 * Creates an array of the own and inherited enumerable string keyed property 30000 * values of `object`. 30001 * 30002 * **Note:** Non-object values are coerced to objects. 30003 * 30004 * @static 30005 * @memberOf _ 30006 * @since 3.0.0 30007 * @category Object 30008 * @param {Object} object The object to query. 30009 * @returns {Array} Returns the array of property values. 30010 * @example 30011 * 30012 * function Foo() { 30013 * this.a = 1; 30014 * this.b = 2; 30015 * } 30016 * 30017 * Foo.prototype.c = 3; 30018 * 30019 * _.valuesIn(new Foo); 30020 * // => [1, 2, 3] (iteration order is not guaranteed) 30021 */ 30022 function valuesIn(object) { 30023 return object == null ? [] : baseValues(object, keysIn(object)); 30024 } 30025 30026 /*------------------------------------------------------------------------*/ 30027 30028 /** 30029 * Clamps `number` within the inclusive `lower` and `upper` bounds. 30030 * 30031 * @static 30032 * @memberOf _ 30033 * @since 4.0.0 30034 * @category Number 30035 * @param {number} number The number to clamp. 30036 * @param {number} [lower] The lower bound. 30037 * @param {number} upper The upper bound. 30038 * @returns {number} Returns the clamped number. 30039 * @example 30040 * 30041 * _.clamp(-10, -5, 5); 30042 * // => -5 30043 * 30044 * _.clamp(10, -5, 5); 30045 * // => 5 30046 */ 30047 function clamp(number, lower, upper) { 30048 if (upper === undefined) { 30049 upper = lower; 30050 lower = undefined; 30051 } 30052 if (upper !== undefined) { 30053 upper = toNumber(upper); 30054 upper = upper === upper ? upper : 0; 30055 } 30056 if (lower !== undefined) { 30057 lower = toNumber(lower); 30058 lower = lower === lower ? lower : 0; 30059 } 30060 return baseClamp(toNumber(number), lower, upper); 30061 } 30062 30063 /** 30064 * Checks if `n` is between `start` and up to, but not including, `end`. If 30065 * `end` is not specified, it's set to `start` with `start` then set to `0`. 30066 * If `start` is greater than `end` the params are swapped to support 30067 * negative ranges. 30068 * 30069 * @static 30070 * @memberOf _ 30071 * @since 3.3.0 30072 * @category Number 30073 * @param {number} number The number to check. 30074 * @param {number} [start=0] The start of the range. 30075 * @param {number} end The end of the range. 30076 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 30077 * @see _.range, _.rangeRight 30078 * @example 30079 * 30080 * _.inRange(3, 2, 4); 30081 * // => true 30082 * 30083 * _.inRange(4, 8); 30084 * // => true 30085 * 30086 * _.inRange(4, 2); 30087 * // => false 30088 * 30089 * _.inRange(2, 2); 30090 * // => false 30091 * 30092 * _.inRange(1.2, 2); 30093 * // => true 30094 * 30095 * _.inRange(5.2, 4); 30096 * // => false 30097 * 30098 * _.inRange(-3, -2, -6); 30099 * // => true 30100 */ 30101 function inRange(number, start, end) { 30102 start = toFinite(start); 30103 if (end === undefined) { 30104 end = start; 30105 start = 0; 30106 } else { 30107 end = toFinite(end); 30108 } 30109 number = toNumber(number); 30110 return baseInRange(number, start, end); 30111 } 30112 30113 /** 30114 * Produces a random number between the inclusive `lower` and `upper` bounds. 30115 * If only one argument is provided a number between `0` and the given number 30116 * is returned. If `floating` is `true`, or either `lower` or `upper` are 30117 * floats, a floating-point number is returned instead of an integer. 30118 * 30119 * **Note:** JavaScript follows the IEEE-754 standard for resolving 30120 * floating-point values which can produce unexpected results. 30121 * 30122 * @static 30123 * @memberOf _ 30124 * @since 0.7.0 30125 * @category Number 30126 * @param {number} [lower=0] The lower bound. 30127 * @param {number} [upper=1] The upper bound. 30128 * @param {boolean} [floating] Specify returning a floating-point number. 30129 * @returns {number} Returns the random number. 30130 * @example 30131 * 30132 * _.random(0, 5); 30133 * // => an integer between 0 and 5 30134 * 30135 * _.random(5); 30136 * // => also an integer between 0 and 5 30137 * 30138 * _.random(5, true); 30139 * // => a floating-point number between 0 and 5 30140 * 30141 * _.random(1.2, 5.2); 30142 * // => a floating-point number between 1.2 and 5.2 30143 */ 30144 function random(lower, upper, floating) { 30145 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { 30146 upper = floating = undefined; 30147 } 30148 if (floating === undefined) { 30149 if (typeof upper == 'boolean') { 30150 floating = upper; 30151 upper = undefined; 30152 } 30153 else if (typeof lower == 'boolean') { 30154 floating = lower; 30155 lower = undefined; 30156 } 30157 } 30158 if (lower === undefined && upper === undefined) { 30159 lower = 0; 30160 upper = 1; 30161 } 30162 else { 30163 lower = toFinite(lower); 30164 if (upper === undefined) { 30165 upper = lower; 30166 lower = 0; 30167 } else { 30168 upper = toFinite(upper); 30169 } 30170 } 30171 if (lower > upper) { 30172 var temp = lower; 30173 lower = upper; 30174 upper = temp; 30175 } 30176 if (floating || lower % 1 || upper % 1) { 30177 var rand = nativeRandom(); 30178 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); 30179 } 30180 return baseRandom(lower, upper); 30181 } 30182 30183 /*------------------------------------------------------------------------*/ 30184 30185 /** 30186 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 30187 * 30188 * @static 30189 * @memberOf _ 30190 * @since 3.0.0 30191 * @category String 30192 * @param {string} [string=''] The string to convert. 30193 * @returns {string} Returns the camel cased string. 30194 * @example 30195 * 30196 * _.camelCase('Foo Bar'); 30197 * // => 'fooBar' 30198 * 30199 * _.camelCase('--foo-bar--'); 30200 * // => 'fooBar' 30201 * 30202 * _.camelCase('__FOO_BAR__'); 30203 * // => 'fooBar' 30204 */ 30205 var camelCase = createCompounder(function(result, word, index) { 30206 word = word.toLowerCase(); 30207 return result + (index ? capitalize(word) : word); 30208 }); 30209 30210 /** 30211 * Converts the first character of `string` to upper case and the remaining 30212 * to lower case. 30213 * 30214 * @static 30215 * @memberOf _ 30216 * @since 3.0.0 30217 * @category String 30218 * @param {string} [string=''] The string to capitalize. 30219 * @returns {string} Returns the capitalized string. 30220 * @example 30221 * 30222 * _.capitalize('FRED'); 30223 * // => 'Fred' 30224 */ 30225 function capitalize(string) { 30226 return upperFirst(toString(string).toLowerCase()); 30227 } 30228 30229 /** 30230 * Deburrs `string` by converting 30231 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 30232 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 30233 * letters to basic Latin letters and removing 30234 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 30235 * 30236 * @static 30237 * @memberOf _ 30238 * @since 3.0.0 30239 * @category String 30240 * @param {string} [string=''] The string to deburr. 30241 * @returns {string} Returns the deburred string. 30242 * @example 30243 * 30244 * _.deburr('déjàvu'); 30245 * // => 'deja vu' 30246 */ 30247 function deburr(string) { 30248 string = toString(string); 30249 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); 30250 } 30251 30252 /** 30253 * Checks if `string` ends with the given target string. 30254 * 30255 * @static 30256 * @memberOf _ 30257 * @since 3.0.0 30258 * @category String 30259 * @param {string} [string=''] The string to inspect. 30260 * @param {string} [target] The string to search for. 30261 * @param {number} [position=string.length] The position to search up to. 30262 * @returns {boolean} Returns `true` if `string` ends with `target`, 30263 * else `false`. 30264 * @example 30265 * 30266 * _.endsWith('abc', 'c'); 30267 * // => true 30268 * 30269 * _.endsWith('abc', 'b'); 30270 * // => false 30271 * 30272 * _.endsWith('abc', 'b', 2); 30273 * // => true 30274 */ 30275 function endsWith(string, target, position) { 30276 string = toString(string); 30277 target = baseToString(target); 30278 30279 var length = string.length; 30280 position = position === undefined 30281 ? length 30282 : baseClamp(toInteger(position), 0, length); 30283 30284 var end = position; 30285 position -= target.length; 30286 return position >= 0 && string.slice(position, end) == target; 30287 } 30288 30289 /** 30290 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 30291 * corresponding HTML entities. 30292 * 30293 * **Note:** No other characters are escaped. To escape additional 30294 * characters use a third-party library like [_he_](https://mths.be/he). 30295 * 30296 * Though the ">" character is escaped for symmetry, characters like 30297 * ">" and "/" don't need escaping in HTML and have no special meaning 30298 * unless they're part of a tag or unquoted attribute value. See 30299 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 30300 * (under "semi-related fun fact") for more details. 30301 * 30302 * When working with HTML you should always 30303 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 30304 * XSS vectors. 30305 * 30306 * @static 30307 * @since 0.1.0 30308 * @memberOf _ 30309 * @category String 30310 * @param {string} [string=''] The string to escape. 30311 * @returns {string} Returns the escaped string. 30312 * @example 30313 * 30314 * _.escape('fred, barney, & pebbles'); 30315 * // => 'fred, barney, & pebbles' 30316 */ 30317 function escape(string) { 30318 string = toString(string); 30319 return (string && reHasUnescapedHtml.test(string)) 30320 ? string.replace(reUnescapedHtml, escapeHtmlChar) 30321 : string; 30322 } 30323 30324 /** 30325 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 30326 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 30327 * 30328 * @static 30329 * @memberOf _ 30330 * @since 3.0.0 30331 * @category String 30332 * @param {string} [string=''] The string to escape. 30333 * @returns {string} Returns the escaped string. 30334 * @example 30335 * 30336 * _.escapeRegExp('[lodash](https://lodash.com/)'); 30337 * // => '\[lodash\]\(https://lodash\.com/\)' 30338 */ 30339 function escapeRegExp(string) { 30340 string = toString(string); 30341 return (string && reHasRegExpChar.test(string)) 30342 ? string.replace(reRegExpChar, '\\$&') 30343 : string; 30344 } 30345 30346 /** 30347 * Converts `string` to 30348 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 30349 * 30350 * @static 30351 * @memberOf _ 30352 * @since 3.0.0 30353 * @category String 30354 * @param {string} [string=''] The string to convert. 30355 * @returns {string} Returns the kebab cased string. 30356 * @example 30357 * 30358 * _.kebabCase('Foo Bar'); 30359 * // => 'foo-bar' 30360 * 30361 * _.kebabCase('fooBar'); 30362 * // => 'foo-bar' 30363 * 30364 * _.kebabCase('__FOO_BAR__'); 30365 * // => 'foo-bar' 30366 */ 30367 var kebabCase = createCompounder(function(result, word, index) { 30368 return result + (index ? '-' : '') + word.toLowerCase(); 30369 }); 30370 30371 /** 30372 * Converts `string`, as space separated words, to lower case. 30373 * 30374 * @static 30375 * @memberOf _ 30376 * @since 4.0.0 30377 * @category String 30378 * @param {string} [string=''] The string to convert. 30379 * @returns {string} Returns the lower cased string. 30380 * @example 30381 * 30382 * _.lowerCase('--Foo-Bar--'); 30383 * // => 'foo bar' 30384 * 30385 * _.lowerCase('fooBar'); 30386 * // => 'foo bar' 30387 * 30388 * _.lowerCase('__FOO_BAR__'); 30389 * // => 'foo bar' 30390 */ 30391 var lowerCase = createCompounder(function(result, word, index) { 30392 return result + (index ? ' ' : '') + word.toLowerCase(); 30393 }); 30394 30395 /** 30396 * Converts the first character of `string` to lower case. 30397 * 30398 * @static 30399 * @memberOf _ 30400 * @since 4.0.0 30401 * @category String 30402 * @param {string} [string=''] The string to convert. 30403 * @returns {string} Returns the converted string. 30404 * @example 30405 * 30406 * _.lowerFirst('Fred'); 30407 * // => 'fred' 30408 * 30409 * _.lowerFirst('FRED'); 30410 * // => 'fRED' 30411 */ 30412 var lowerFirst = createCaseFirst('toLowerCase'); 30413 30414 /** 30415 * Pads `string` on the left and right sides if it's shorter than `length`. 30416 * Padding characters are truncated if they can't be evenly divided by `length`. 30417 * 30418 * @static 30419 * @memberOf _ 30420 * @since 3.0.0 30421 * @category String 30422 * @param {string} [string=''] The string to pad. 30423 * @param {number} [length=0] The padding length. 30424 * @param {string} [chars=' '] The string used as padding. 30425 * @returns {string} Returns the padded string. 30426 * @example 30427 * 30428 * _.pad('abc', 8); 30429 * // => ' abc ' 30430 * 30431 * _.pad('abc', 8, '_-'); 30432 * // => '_-abc_-_' 30433 * 30434 * _.pad('abc', 3); 30435 * // => 'abc' 30436 */ 30437 function pad(string, length, chars) { 30438 string = toString(string); 30439 length = toInteger(length); 30440 30441 var strLength = length ? stringSize(string) : 0; 30442 if (!length || strLength >= length) { 30443 return string; 30444 } 30445 var mid = (length - strLength) / 2; 30446 return ( 30447 createPadding(nativeFloor(mid), chars) + 30448 string + 30449 createPadding(nativeCeil(mid), chars) 30450 ); 30451 } 30452 30453 /** 30454 * Pads `string` on the right side if it's shorter than `length`. Padding 30455 * characters are truncated if they exceed `length`. 30456 * 30457 * @static 30458 * @memberOf _ 30459 * @since 4.0.0 30460 * @category String 30461 * @param {string} [string=''] The string to pad. 30462 * @param {number} [length=0] The padding length. 30463 * @param {string} [chars=' '] The string used as padding. 30464 * @returns {string} Returns the padded string. 30465 * @example 30466 * 30467 * _.padEnd('abc', 6); 30468 * // => 'abc ' 30469 * 30470 * _.padEnd('abc', 6, '_-'); 30471 * // => 'abc_-_' 30472 * 30473 * _.padEnd('abc', 3); 30474 * // => 'abc' 30475 */ 30476 function padEnd(string, length, chars) { 30477 string = toString(string); 30478 length = toInteger(length); 30479 30480 var strLength = length ? stringSize(string) : 0; 30481 return (length && strLength < length) 30482 ? (string + createPadding(length - strLength, chars)) 30483 : string; 30484 } 30485 30486 /** 30487 * Pads `string` on the left side if it's shorter than `length`. Padding 30488 * characters are truncated if they exceed `length`. 30489 * 30490 * @static 30491 * @memberOf _ 30492 * @since 4.0.0 30493 * @category String 30494 * @param {string} [string=''] The string to pad. 30495 * @param {number} [length=0] The padding length. 30496 * @param {string} [chars=' '] The string used as padding. 30497 * @returns {string} Returns the padded string. 30498 * @example 30499 * 30500 * _.padStart('abc', 6); 30501 * // => ' abc' 30502 * 30503 * _.padStart('abc', 6, '_-'); 30504 * // => '_-_abc' 30505 * 30506 * _.padStart('abc', 3); 30507 * // => 'abc' 30508 */ 30509 function padStart(string, length, chars) { 30510 string = toString(string); 30511 length = toInteger(length); 30512 30513 var strLength = length ? stringSize(string) : 0; 30514 return (length && strLength < length) 30515 ? (createPadding(length - strLength, chars) + string) 30516 : string; 30517 } 30518 30519 /** 30520 * Converts `string` to an integer of the specified radix. If `radix` is 30521 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 30522 * hexadecimal, in which case a `radix` of `16` is used. 30523 * 30524 * **Note:** This method aligns with the 30525 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 30526 * 30527 * @static 30528 * @memberOf _ 30529 * @since 1.1.0 30530 * @category String 30531 * @param {string} string The string to convert. 30532 * @param {number} [radix=10] The radix to interpret `value` by. 30533 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 30534 * @returns {number} Returns the converted integer. 30535 * @example 30536 * 30537 * _.parseInt('08'); 30538 * // => 8 30539 * 30540 * _.map(['6', '08', '10'], _.parseInt); 30541 * // => [6, 8, 10] 30542 */ 30543 function parseInt(string, radix, guard) { 30544 if (guard || radix == null) { 30545 radix = 0; 30546 } else if (radix) { 30547 radix = +radix; 30548 } 30549 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 30550 } 30551 30552 /** 30553 * Repeats the given string `n` times. 30554 * 30555 * @static 30556 * @memberOf _ 30557 * @since 3.0.0 30558 * @category String 30559 * @param {string} [string=''] The string to repeat. 30560 * @param {number} [n=1] The number of times to repeat the string. 30561 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 30562 * @returns {string} Returns the repeated string. 30563 * @example 30564 * 30565 * _.repeat('*', 3); 30566 * // => '***' 30567 * 30568 * _.repeat('abc', 2); 30569 * // => 'abcabc' 30570 * 30571 * _.repeat('abc', 0); 30572 * // => '' 30573 */ 30574 function repeat(string, n, guard) { 30575 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { 30576 n = 1; 30577 } else { 30578 n = toInteger(n); 30579 } 30580 return baseRepeat(toString(string), n); 30581 } 30582 30583 /** 30584 * Replaces matches for `pattern` in `string` with `replacement`. 30585 * 30586 * **Note:** This method is based on 30587 * [`String#replace`](https://mdn.io/String/replace). 30588 * 30589 * @static 30590 * @memberOf _ 30591 * @since 4.0.0 30592 * @category String 30593 * @param {string} [string=''] The string to modify. 30594 * @param {RegExp|string} pattern The pattern to replace. 30595 * @param {Function|string} replacement The match replacement. 30596 * @returns {string} Returns the modified string. 30597 * @example 30598 * 30599 * _.replace('Hi Fred', 'Fred', 'Barney'); 30600 * // => 'Hi Barney' 30601 */ 30602 function replace() { 30603 var args = arguments, 30604 string = toString(args[0]); 30605 30606 return args.length < 3 ? string : string.replace(args[1], args[2]); 30607 } 30608 30609 /** 30610 * Converts `string` to 30611 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 30612 * 30613 * @static 30614 * @memberOf _ 30615 * @since 3.0.0 30616 * @category String 30617 * @param {string} [string=''] The string to convert. 30618 * @returns {string} Returns the snake cased string. 30619 * @example 30620 * 30621 * _.snakeCase('Foo Bar'); 30622 * // => 'foo_bar' 30623 * 30624 * _.snakeCase('fooBar'); 30625 * // => 'foo_bar' 30626 * 30627 * _.snakeCase('--FOO-BAR--'); 30628 * // => 'foo_bar' 30629 */ 30630 var snakeCase = createCompounder(function(result, word, index) { 30631 return result + (index ? '_' : '') + word.toLowerCase(); 30632 }); 30633 30634 /** 30635 * Splits `string` by `separator`. 30636 * 30637 * **Note:** This method is based on 30638 * [`String#split`](https://mdn.io/String/split). 30639 * 30640 * @static 30641 * @memberOf _ 30642 * @since 4.0.0 30643 * @category String 30644 * @param {string} [string=''] The string to split. 30645 * @param {RegExp|string} separator The separator pattern to split by. 30646 * @param {number} [limit] The length to truncate results to. 30647 * @returns {Array} Returns the string segments. 30648 * @example 30649 * 30650 * _.split('a-b-c', '-', 2); 30651 * // => ['a', 'b'] 30652 */ 30653 function split(string, separator, limit) { 30654 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { 30655 separator = limit = undefined; 30656 } 30657 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; 30658 if (!limit) { 30659 return []; 30660 } 30661 string = toString(string); 30662 if (string && ( 30663 typeof separator == 'string' || 30664 (separator != null && !isRegExp(separator)) 30665 )) { 30666 separator = baseToString(separator); 30667 if (!separator && hasUnicode(string)) { 30668 return castSlice(stringToArray(string), 0, limit); 30669 } 30670 } 30671 return string.split(separator, limit); 30672 } 30673 30674 /** 30675 * Converts `string` to 30676 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 30677 * 30678 * @static 30679 * @memberOf _ 30680 * @since 3.1.0 30681 * @category String 30682 * @param {string} [string=''] The string to convert. 30683 * @returns {string} Returns the start cased string. 30684 * @example 30685 * 30686 * _.startCase('--foo-bar--'); 30687 * // => 'Foo Bar' 30688 * 30689 * _.startCase('fooBar'); 30690 * // => 'Foo Bar' 30691 * 30692 * _.startCase('__FOO_BAR__'); 30693 * // => 'FOO BAR' 30694 */ 30695 var startCase = createCompounder(function(result, word, index) { 30696 return result + (index ? ' ' : '') + upperFirst(word); 30697 }); 30698 30699 /** 30700 * Checks if `string` starts with the given target string. 30701 * 30702 * @static 30703 * @memberOf _ 30704 * @since 3.0.0 30705 * @category String 30706 * @param {string} [string=''] The string to inspect. 30707 * @param {string} [target] The string to search for. 30708 * @param {number} [position=0] The position to search from. 30709 * @returns {boolean} Returns `true` if `string` starts with `target`, 30710 * else `false`. 30711 * @example 30712 * 30713 * _.startsWith('abc', 'a'); 30714 * // => true 30715 * 30716 * _.startsWith('abc', 'b'); 30717 * // => false 30718 * 30719 * _.startsWith('abc', 'b', 1); 30720 * // => true 30721 */ 30722 function startsWith(string, target, position) { 30723 string = toString(string); 30724 position = position == null 30725 ? 0 30726 : baseClamp(toInteger(position), 0, string.length); 30727 30728 target = baseToString(target); 30729 return string.slice(position, position + target.length) == target; 30730 } 30731 30732 /** 30733 * Creates a compiled template function that can interpolate data properties 30734 * in "interpolate" delimiters, HTML-escape interpolated data properties in 30735 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 30736 * properties may be accessed as free variables in the template. If a setting 30737 * object is given, it takes precedence over `_.templateSettings` values. 30738 * 30739 * **Note:** In the development build `_.template` utilizes 30740 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 30741 * for easier debugging. 30742 * 30743 * For more information on precompiling templates see 30744 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 30745 * 30746 * For more information on Chrome extension sandboxes see 30747 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 30748 * 30749 * @static 30750 * @since 0.1.0 30751 * @memberOf _ 30752 * @category String 30753 * @param {string} [string=''] The template string. 30754 * @param {Object} [options={}] The options object. 30755 * @param {RegExp} [options.escape=_.templateSettings.escape] 30756 * The HTML "escape" delimiter. 30757 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 30758 * The "evaluate" delimiter. 30759 * @param {Object} [options.imports=_.templateSettings.imports] 30760 * An object to import into the template as free variables. 30761 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 30762 * The "interpolate" delimiter. 30763 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 30764 * The sourceURL of the compiled template. 30765 * @param {string} [options.variable='obj'] 30766 * The data object variable name. 30767 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 30768 * @returns {Function} Returns the compiled template function. 30769 * @example 30770 * 30771 * // Use the "interpolate" delimiter to create a compiled template. 30772 * var compiled = _.template('hello <%= user %>!'); 30773 * compiled({ 'user': 'fred' }); 30774 * // => 'hello fred!' 30775 * 30776 * // Use the HTML "escape" delimiter to escape data property values. 30777 * var compiled = _.template('<b><%- value %></b>'); 30778 * compiled({ 'value': '<script>' }); 30779 * // => '<b><script></b>' 30780 * 30781 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 30782 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 30783 * compiled({ 'users': ['fred', 'barney'] }); 30784 * // => '<li>fred</li><li>barney</li>' 30785 * 30786 * // Use the internal `print` function in "evaluate" delimiters. 30787 * var compiled = _.template('<% print("hello " + user); %>!'); 30788 * compiled({ 'user': 'barney' }); 30789 * // => 'hello barney!' 30790 * 30791 * // Use the ES template literal delimiter as an "interpolate" delimiter. 30792 * // Disable support by replacing the "interpolate" delimiter. 30793 * var compiled = _.template('hello ${ user }!'); 30794 * compiled({ 'user': 'pebbles' }); 30795 * // => 'hello pebbles!' 30796 * 30797 * // Use backslashes to treat delimiters as plain text. 30798 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 30799 * compiled({ 'value': 'ignored' }); 30800 * // => '<%- value %>' 30801 * 30802 * // Use the `imports` option to import `jQuery` as `jq`. 30803 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 30804 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 30805 * compiled({ 'users': ['fred', 'barney'] }); 30806 * // => '<li>fred</li><li>barney</li>' 30807 * 30808 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 30809 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 30810 * compiled(data); 30811 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 30812 * 30813 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 30814 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 30815 * compiled.source; 30816 * // => function(data) { 30817 * // var __t, __p = ''; 30818 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 30819 * // return __p; 30820 * // } 30821 * 30822 * // Use custom template delimiters. 30823 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 30824 * var compiled = _.template('hello {{ user }}!'); 30825 * compiled({ 'user': 'mustache' }); 30826 * // => 'hello mustache!' 30827 * 30828 * // Use the `source` property to inline compiled templates for meaningful 30829 * // line numbers in error messages and stack traces. 30830 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 30831 * var JST = {\ 30832 * "main": ' + _.template(mainText).source + '\ 30833 * };\ 30834 * '); 30835 */ 30836 function template(string, options, guard) { 30837 // Based on John Resig's `tmpl` implementation 30838 // (http://ejohn.org/blog/javascript-micro-templating/) 30839 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 30840 var settings = lodash.templateSettings; 30841 30842 if (guard && isIterateeCall(string, options, guard)) { 30843 options = undefined; 30844 } 30845 string = toString(string); 30846 options = assignInWith({}, options, settings, customDefaultsAssignIn); 30847 30848 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), 30849 importsKeys = keys(imports), 30850 importsValues = baseValues(imports, importsKeys); 30851 30852 var isEscaping, 30853 isEvaluating, 30854 index = 0, 30855 interpolate = options.interpolate || reNoMatch, 30856 source = "__p += '"; 30857 30858 // Compile the regexp to match each delimiter. 30859 var reDelimiters = RegExp( 30860 (options.escape || reNoMatch).source + '|' + 30861 interpolate.source + '|' + 30862 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 30863 (options.evaluate || reNoMatch).source + '|$' 30864 , 'g'); 30865 30866 // Use a sourceURL for easier debugging. 30867 // The sourceURL gets injected into the source that's eval-ed, so be careful 30868 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 30869 // and escape the comment, thus injecting code that gets evaled. 30870 var sourceURL = '//# sourceURL=' + 30871 (hasOwnProperty.call(options, 'sourceURL') 30872 ? (options.sourceURL + '').replace(/\s/g, ' ') 30873 : ('lodash.templateSources[' + (++templateCounter) + ']') 30874 ) + '\n'; 30875 30876 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 30877 interpolateValue || (interpolateValue = esTemplateValue); 30878 30879 // Escape characters that can't be included in string literals. 30880 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 30881 30882 // Replace delimiters with snippets. 30883 if (escapeValue) { 30884 isEscaping = true; 30885 source += "' +\n__e(" + escapeValue + ") +\n'"; 30886 } 30887 if (evaluateValue) { 30888 isEvaluating = true; 30889 source += "';\n" + evaluateValue + ";\n__p += '"; 30890 } 30891 if (interpolateValue) { 30892 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 30893 } 30894 index = offset + match.length; 30895 30896 // The JS engine embedded in Adobe products needs `match` returned in 30897 // order to produce the correct `offset` value. 30898 return match; 30899 }); 30900 30901 source += "';\n"; 30902 30903 // If `variable` is not specified wrap a with-statement around the generated 30904 // code to add the data object to the top of the scope chain. 30905 var variable = hasOwnProperty.call(options, 'variable') && options.variable; 30906 if (!variable) { 30907 source = 'with (obj) {\n' + source + '\n}\n'; 30908 } 30909 // Throw an error if a forbidden character was found in `variable`, to prevent 30910 // potential command injection attacks. 30911 else if (reForbiddenIdentifierChars.test(variable)) { 30912 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); 30913 } 30914 30915 // Cleanup code by stripping empty strings. 30916 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 30917 .replace(reEmptyStringMiddle, '$1') 30918 .replace(reEmptyStringTrailing, '$1;'); 30919 30920 // Frame code as the function body. 30921 source = 'function(' + (variable || 'obj') + ') {\n' + 30922 (variable 30923 ? '' 30924 : 'obj || (obj = {});\n' 30925 ) + 30926 "var __t, __p = ''" + 30927 (isEscaping 30928 ? ', __e = _.escape' 30929 : '' 30930 ) + 30931 (isEvaluating 30932 ? ', __j = Array.prototype.join;\n' + 30933 "function print() { __p += __j.call(arguments, '') }\n" 30934 : ';\n' 30935 ) + 30936 source + 30937 'return __p\n}'; 30938 30939 var result = attempt(function() { 30940 return Function(importsKeys, sourceURL + 'return ' + source) 30941 .apply(undefined, importsValues); 30942 }); 30943 30944 // Provide the compiled function's source by its `toString` method or 30945 // the `source` property as a convenience for inlining compiled templates. 30946 result.source = source; 30947 if (isError(result)) { 30948 throw result; 30949 } 30950 return result; 30951 } 30952 30953 /** 30954 * Converts `string`, as a whole, to lower case just like 30955 * [String#toLowerCase](https://mdn.io/toLowerCase). 30956 * 30957 * @static 30958 * @memberOf _ 30959 * @since 4.0.0 30960 * @category String 30961 * @param {string} [string=''] The string to convert. 30962 * @returns {string} Returns the lower cased string. 30963 * @example 30964 * 30965 * _.toLower('--Foo-Bar--'); 30966 * // => '--foo-bar--' 30967 * 30968 * _.toLower('fooBar'); 30969 * // => 'foobar' 30970 * 30971 * _.toLower('__FOO_BAR__'); 30972 * // => '__foo_bar__' 30973 */ 30974 function toLower(value) { 30975 return toString(value).toLowerCase(); 30976 } 30977 30978 /** 30979 * Converts `string`, as a whole, to upper case just like 30980 * [String#toUpperCase](https://mdn.io/toUpperCase). 30981 * 30982 * @static 30983 * @memberOf _ 30984 * @since 4.0.0 30985 * @category String 30986 * @param {string} [string=''] The string to convert. 30987 * @returns {string} Returns the upper cased string. 30988 * @example 30989 * 30990 * _.toUpper('--foo-bar--'); 30991 * // => '--FOO-BAR--' 30992 * 30993 * _.toUpper('fooBar'); 30994 * // => 'FOOBAR' 30995 * 30996 * _.toUpper('__foo_bar__'); 30997 * // => '__FOO_BAR__' 30998 */ 30999 function toUpper(value) { 31000 return toString(value).toUpperCase(); 31001 } 31002 31003 /** 31004 * Removes leading and trailing whitespace or specified characters from `string`. 31005 * 31006 * @static 31007 * @memberOf _ 31008 * @since 3.0.0 31009 * @category String 31010 * @param {string} [string=''] The string to trim. 31011 * @param {string} [chars=whitespace] The characters to trim. 31012 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 31013 * @returns {string} Returns the trimmed string. 31014 * @example 31015 * 31016 * _.trim(' abc '); 31017 * // => 'abc' 31018 * 31019 * _.trim('-_-abc-_-', '_-'); 31020 * // => 'abc' 31021 * 31022 * _.map([' foo ', ' bar '], _.trim); 31023 * // => ['foo', 'bar'] 31024 */ 31025 function trim(string, chars, guard) { 31026 string = toString(string); 31027 if (string && (guard || chars === undefined)) { 31028 return baseTrim(string); 31029 } 31030 if (!string || !(chars = baseToString(chars))) { 31031 return string; 31032 } 31033 var strSymbols = stringToArray(string), 31034 chrSymbols = stringToArray(chars), 31035 start = charsStartIndex(strSymbols, chrSymbols), 31036 end = charsEndIndex(strSymbols, chrSymbols) + 1; 31037 31038 return castSlice(strSymbols, start, end).join(''); 31039 } 31040 31041 /** 31042 * Removes trailing whitespace or specified characters from `string`. 31043 * 31044 * @static 31045 * @memberOf _ 31046 * @since 4.0.0 31047 * @category String 31048 * @param {string} [string=''] The string to trim. 31049 * @param {string} [chars=whitespace] The characters to trim. 31050 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 31051 * @returns {string} Returns the trimmed string. 31052 * @example 31053 * 31054 * _.trimEnd(' abc '); 31055 * // => ' abc' 31056 * 31057 * _.trimEnd('-_-abc-_-', '_-'); 31058 * // => '-_-abc' 31059 */ 31060 function trimEnd(string, chars, guard) { 31061 string = toString(string); 31062 if (string && (guard || chars === undefined)) { 31063 return string.slice(0, trimmedEndIndex(string) + 1); 31064 } 31065 if (!string || !(chars = baseToString(chars))) { 31066 return string; 31067 } 31068 var strSymbols = stringToArray(string), 31069 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 31070 31071 return castSlice(strSymbols, 0, end).join(''); 31072 } 31073 31074 /** 31075 * Removes leading whitespace or specified characters from `string`. 31076 * 31077 * @static 31078 * @memberOf _ 31079 * @since 4.0.0 31080 * @category String 31081 * @param {string} [string=''] The string to trim. 31082 * @param {string} [chars=whitespace] The characters to trim. 31083 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 31084 * @returns {string} Returns the trimmed string. 31085 * @example 31086 * 31087 * _.trimStart(' abc '); 31088 * // => 'abc ' 31089 * 31090 * _.trimStart('-_-abc-_-', '_-'); 31091 * // => 'abc-_-' 31092 */ 31093 function trimStart(string, chars, guard) { 31094 string = toString(string); 31095 if (string && (guard || chars === undefined)) { 31096 return string.replace(reTrimStart, ''); 31097 } 31098 if (!string || !(chars = baseToString(chars))) { 31099 return string; 31100 } 31101 var strSymbols = stringToArray(string), 31102 start = charsStartIndex(strSymbols, stringToArray(chars)); 31103 31104 return castSlice(strSymbols, start).join(''); 31105 } 31106 31107 /** 31108 * Truncates `string` if it's longer than the given maximum string length. 31109 * The last characters of the truncated string are replaced with the omission 31110 * string which defaults to "...". 31111 * 31112 * @static 31113 * @memberOf _ 31114 * @since 4.0.0 31115 * @category String 31116 * @param {string} [string=''] The string to truncate. 31117 * @param {Object} [options={}] The options object. 31118 * @param {number} [options.length=30] The maximum string length. 31119 * @param {string} [options.omission='...'] The string to indicate text is omitted. 31120 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 31121 * @returns {string} Returns the truncated string. 31122 * @example 31123 * 31124 * _.truncate('hi-diddly-ho there, neighborino'); 31125 * // => 'hi-diddly-ho there, neighbo...' 31126 * 31127 * _.truncate('hi-diddly-ho there, neighborino', { 31128 * 'length': 24, 31129 * 'separator': ' ' 31130 * }); 31131 * // => 'hi-diddly-ho there,...' 31132 * 31133 * _.truncate('hi-diddly-ho there, neighborino', { 31134 * 'length': 24, 31135 * 'separator': /,? +/ 31136 * }); 31137 * // => 'hi-diddly-ho there...' 31138 * 31139 * _.truncate('hi-diddly-ho there, neighborino', { 31140 * 'omission': ' [...]' 31141 * }); 31142 * // => 'hi-diddly-ho there, neig [...]' 31143 */ 31144 function truncate(string, options) { 31145 var length = DEFAULT_TRUNC_LENGTH, 31146 omission = DEFAULT_TRUNC_OMISSION; 31147 31148 if (isObject(options)) { 31149 var separator = 'separator' in options ? options.separator : separator; 31150 length = 'length' in options ? toInteger(options.length) : length; 31151 omission = 'omission' in options ? baseToString(options.omission) : omission; 31152 } 31153 string = toString(string); 31154 31155 var strLength = string.length; 31156 if (hasUnicode(string)) { 31157 var strSymbols = stringToArray(string); 31158 strLength = strSymbols.length; 31159 } 31160 if (length >= strLength) { 31161 return string; 31162 } 31163 var end = length - stringSize(omission); 31164 if (end < 1) { 31165 return omission; 31166 } 31167 var result = strSymbols 31168 ? castSlice(strSymbols, 0, end).join('') 31169 : string.slice(0, end); 31170 31171 if (separator === undefined) { 31172 return result + omission; 31173 } 31174 if (strSymbols) { 31175 end += (result.length - end); 31176 } 31177 if (isRegExp(separator)) { 31178 if (string.slice(end).search(separator)) { 31179 var match, 31180 substring = result; 31181 31182 if (!separator.global) { 31183 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); 31184 } 31185 separator.lastIndex = 0; 31186 while ((match = separator.exec(substring))) { 31187 var newEnd = match.index; 31188 } 31189 result = result.slice(0, newEnd === undefined ? end : newEnd); 31190 } 31191 } else if (string.indexOf(baseToString(separator), end) != end) { 31192 var index = result.lastIndexOf(separator); 31193 if (index > -1) { 31194 result = result.slice(0, index); 31195 } 31196 } 31197 return result + omission; 31198 } 31199 31200 /** 31201 * The inverse of `_.escape`; this method converts the HTML entities 31202 * `&`, `<`, `>`, `"`, and `'` in `string` to 31203 * their corresponding characters. 31204 * 31205 * **Note:** No other HTML entities are unescaped. To unescape additional 31206 * HTML entities use a third-party library like [_he_](https://mths.be/he). 31207 * 31208 * @static 31209 * @memberOf _ 31210 * @since 0.6.0 31211 * @category String 31212 * @param {string} [string=''] The string to unescape. 31213 * @returns {string} Returns the unescaped string. 31214 * @example 31215 * 31216 * _.unescape('fred, barney, & pebbles'); 31217 * // => 'fred, barney, & pebbles' 31218 */ 31219 function unescape(string) { 31220 string = toString(string); 31221 return (string && reHasEscapedHtml.test(string)) 31222 ? string.replace(reEscapedHtml, unescapeHtmlChar) 31223 : string; 31224 } 31225 31226 /** 31227 * Converts `string`, as space separated words, to upper case. 31228 * 31229 * @static 31230 * @memberOf _ 31231 * @since 4.0.0 31232 * @category String 31233 * @param {string} [string=''] The string to convert. 31234 * @returns {string} Returns the upper cased string. 31235 * @example 31236 * 31237 * _.upperCase('--foo-bar'); 31238 * // => 'FOO BAR' 31239 * 31240 * _.upperCase('fooBar'); 31241 * // => 'FOO BAR' 31242 * 31243 * _.upperCase('__foo_bar__'); 31244 * // => 'FOO BAR' 31245 */ 31246 var upperCase = createCompounder(function(result, word, index) { 31247 return result + (index ? ' ' : '') + word.toUpperCase(); 31248 }); 31249 31250 /** 31251 * Converts the first character of `string` to upper case. 31252 * 31253 * @static 31254 * @memberOf _ 31255 * @since 4.0.0 31256 * @category String 31257 * @param {string} [string=''] The string to convert. 31258 * @returns {string} Returns the converted string. 31259 * @example 31260 * 31261 * _.upperFirst('fred'); 31262 * // => 'Fred' 31263 * 31264 * _.upperFirst('FRED'); 31265 * // => 'FRED' 31266 */ 31267 var upperFirst = createCaseFirst('toUpperCase'); 31268 31269 /** 31270 * Splits `string` into an array of its words. 31271 * 31272 * @static 31273 * @memberOf _ 31274 * @since 3.0.0 31275 * @category String 31276 * @param {string} [string=''] The string to inspect. 31277 * @param {RegExp|string} [pattern] The pattern to match words. 31278 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 31279 * @returns {Array} Returns the words of `string`. 31280 * @example 31281 * 31282 * _.words('fred, barney, & pebbles'); 31283 * // => ['fred', 'barney', 'pebbles'] 31284 * 31285 * _.words('fred, barney, & pebbles', /[^, ]+/g); 31286 * // => ['fred', 'barney', '&', 'pebbles'] 31287 */ 31288 function words(string, pattern, guard) { 31289 string = toString(string); 31290 pattern = guard ? undefined : pattern; 31291 31292 if (pattern === undefined) { 31293 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 31294 } 31295 return string.match(pattern) || []; 31296 } 31297 31298 /*------------------------------------------------------------------------*/ 31299 31300 /** 31301 * Attempts to invoke `func`, returning either the result or the caught error 31302 * object. Any additional arguments are provided to `func` when it's invoked. 31303 * 31304 * @static 31305 * @memberOf _ 31306 * @since 3.0.0 31307 * @category Util 31308 * @param {Function} func The function to attempt. 31309 * @param {...*} [args] The arguments to invoke `func` with. 31310 * @returns {*} Returns the `func` result or error object. 31311 * @example 31312 * 31313 * // Avoid throwing errors for invalid selectors. 31314 * var elements = _.attempt(function(selector) { 31315 * return document.querySelectorAll(selector); 31316 * }, '>_>'); 31317 * 31318 * if (_.isError(elements)) { 31319 * elements = []; 31320 * } 31321 */ 31322 var attempt = baseRest(function(func, args) { 31323 try { 31324 return apply(func, undefined, args); 31325 } catch (e) { 31326 return isError(e) ? e : new Error(e); 31327 } 31328 }); 31329 31330 /** 31331 * Binds methods of an object to the object itself, overwriting the existing 31332 * method. 31333 * 31334 * **Note:** This method doesn't set the "length" property of bound functions. 31335 * 31336 * @static 31337 * @since 0.1.0 31338 * @memberOf _ 31339 * @category Util 31340 * @param {Object} object The object to bind and assign the bound methods to. 31341 * @param {...(string|string[])} methodNames The object method names to bind. 31342 * @returns {Object} Returns `object`. 31343 * @example 31344 * 31345 * var view = { 31346 * 'label': 'docs', 31347 * 'click': function() { 31348 * console.log('clicked ' + this.label); 31349 * } 31350 * }; 31351 * 31352 * _.bindAll(view, ['click']); 31353 * jQuery(element).on('click', view.click); 31354 * // => Logs 'clicked docs' when clicked. 31355 */ 31356 var bindAll = flatRest(function(object, methodNames) { 31357 arrayEach(methodNames, function(key) { 31358 key = toKey(key); 31359 baseAssignValue(object, key, bind(object[key], object)); 31360 }); 31361 return object; 31362 }); 31363 31364 /** 31365 * Creates a function that iterates over `pairs` and invokes the corresponding 31366 * function of the first predicate to return truthy. The predicate-function 31367 * pairs are invoked with the `this` binding and arguments of the created 31368 * function. 31369 * 31370 * @static 31371 * @memberOf _ 31372 * @since 4.0.0 31373 * @category Util 31374 * @param {Array} pairs The predicate-function pairs. 31375 * @returns {Function} Returns the new composite function. 31376 * @example 31377 * 31378 * var func = _.cond([ 31379 * [_.matches({ 'a': 1 }), _.constant('matches A')], 31380 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 31381 * [_.stubTrue, _.constant('no match')] 31382 * ]); 31383 * 31384 * func({ 'a': 1, 'b': 2 }); 31385 * // => 'matches A' 31386 * 31387 * func({ 'a': 0, 'b': 1 }); 31388 * // => 'matches B' 31389 * 31390 * func({ 'a': '1', 'b': '2' }); 31391 * // => 'no match' 31392 */ 31393 function cond(pairs) { 31394 var length = pairs == null ? 0 : pairs.length, 31395 toIteratee = getIteratee(); 31396 31397 pairs = !length ? [] : arrayMap(pairs, function(pair) { 31398 if (typeof pair[1] != 'function') { 31399 throw new TypeError(FUNC_ERROR_TEXT); 31400 } 31401 return [toIteratee(pair[0]), pair[1]]; 31402 }); 31403 31404 return baseRest(function(args) { 31405 var index = -1; 31406 while (++index < length) { 31407 var pair = pairs[index]; 31408 if (apply(pair[0], this, args)) { 31409 return apply(pair[1], this, args); 31410 } 31411 } 31412 }); 31413 } 31414 31415 /** 31416 * Creates a function that invokes the predicate properties of `source` with 31417 * the corresponding property values of a given object, returning `true` if 31418 * all predicates return truthy, else `false`. 31419 * 31420 * **Note:** The created function is equivalent to `_.conformsTo` with 31421 * `source` partially applied. 31422 * 31423 * @static 31424 * @memberOf _ 31425 * @since 4.0.0 31426 * @category Util 31427 * @param {Object} source The object of property predicates to conform to. 31428 * @returns {Function} Returns the new spec function. 31429 * @example 31430 * 31431 * var objects = [ 31432 * { 'a': 2, 'b': 1 }, 31433 * { 'a': 1, 'b': 2 } 31434 * ]; 31435 * 31436 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 31437 * // => [{ 'a': 1, 'b': 2 }] 31438 */ 31439 function conforms(source) { 31440 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 31441 } 31442 31443 /** 31444 * Creates a function that returns `value`. 31445 * 31446 * @static 31447 * @memberOf _ 31448 * @since 2.4.0 31449 * @category Util 31450 * @param {*} value The value to return from the new function. 31451 * @returns {Function} Returns the new constant function. 31452 * @example 31453 * 31454 * var objects = _.times(2, _.constant({ 'a': 1 })); 31455 * 31456 * console.log(objects); 31457 * // => [{ 'a': 1 }, { 'a': 1 }] 31458 * 31459 * console.log(objects[0] === objects[1]); 31460 * // => true 31461 */ 31462 function constant(value) { 31463 return function() { 31464 return value; 31465 }; 31466 } 31467 31468 /** 31469 * Checks `value` to determine whether a default value should be returned in 31470 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 31471 * or `undefined`. 31472 * 31473 * @static 31474 * @memberOf _ 31475 * @since 4.14.0 31476 * @category Util 31477 * @param {*} value The value to check. 31478 * @param {*} defaultValue The default value. 31479 * @returns {*} Returns the resolved value. 31480 * @example 31481 * 31482 * _.defaultTo(1, 10); 31483 * // => 1 31484 * 31485 * _.defaultTo(undefined, 10); 31486 * // => 10 31487 */ 31488 function defaultTo(value, defaultValue) { 31489 return (value == null || value !== value) ? defaultValue : value; 31490 } 31491 31492 /** 31493 * Creates a function that returns the result of invoking the given functions 31494 * with the `this` binding of the created function, where each successive 31495 * invocation is supplied the return value of the previous. 31496 * 31497 * @static 31498 * @memberOf _ 31499 * @since 3.0.0 31500 * @category Util 31501 * @param {...(Function|Function[])} [funcs] The functions to invoke. 31502 * @returns {Function} Returns the new composite function. 31503 * @see _.flowRight 31504 * @example 31505 * 31506 * function square(n) { 31507 * return n * n; 31508 * } 31509 * 31510 * var addSquare = _.flow([_.add, square]); 31511 * addSquare(1, 2); 31512 * // => 9 31513 */ 31514 var flow = createFlow(); 31515 31516 /** 31517 * This method is like `_.flow` except that it creates a function that 31518 * invokes the given functions from right to left. 31519 * 31520 * @static 31521 * @since 3.0.0 31522 * @memberOf _ 31523 * @category Util 31524 * @param {...(Function|Function[])} [funcs] The functions to invoke. 31525 * @returns {Function} Returns the new composite function. 31526 * @see _.flow 31527 * @example 31528 * 31529 * function square(n) { 31530 * return n * n; 31531 * } 31532 * 31533 * var addSquare = _.flowRight([square, _.add]); 31534 * addSquare(1, 2); 31535 * // => 9 31536 */ 31537 var flowRight = createFlow(true); 31538 31539 /** 31540 * This method returns the first argument it receives. 31541 * 31542 * @static 31543 * @since 0.1.0 31544 * @memberOf _ 31545 * @category Util 31546 * @param {*} value Any value. 31547 * @returns {*} Returns `value`. 31548 * @example 31549 * 31550 * var object = { 'a': 1 }; 31551 * 31552 * console.log(_.identity(object) === object); 31553 * // => true 31554 */ 31555 function identity(value) { 31556 return value; 31557 } 31558 31559 /** 31560 * Creates a function that invokes `func` with the arguments of the created 31561 * function. If `func` is a property name, the created function returns the 31562 * property value for a given element. If `func` is an array or object, the 31563 * created function returns `true` for elements that contain the equivalent 31564 * source properties, otherwise it returns `false`. 31565 * 31566 * @static 31567 * @since 4.0.0 31568 * @memberOf _ 31569 * @category Util 31570 * @param {*} [func=_.identity] The value to convert to a callback. 31571 * @returns {Function} Returns the callback. 31572 * @example 31573 * 31574 * var users = [ 31575 * { 'user': 'barney', 'age': 36, 'active': true }, 31576 * { 'user': 'fred', 'age': 40, 'active': false } 31577 * ]; 31578 * 31579 * // The `_.matches` iteratee shorthand. 31580 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 31581 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 31582 * 31583 * // The `_.matchesProperty` iteratee shorthand. 31584 * _.filter(users, _.iteratee(['user', 'fred'])); 31585 * // => [{ 'user': 'fred', 'age': 40 }] 31586 * 31587 * // The `_.property` iteratee shorthand. 31588 * _.map(users, _.iteratee('user')); 31589 * // => ['barney', 'fred'] 31590 * 31591 * // Create custom iteratee shorthands. 31592 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 31593 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 31594 * return func.test(string); 31595 * }; 31596 * }); 31597 * 31598 * _.filter(['abc', 'def'], /ef/); 31599 * // => ['def'] 31600 */ 31601 function iteratee(func) { 31602 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); 31603 } 31604 31605 /** 31606 * Creates a function that performs a partial deep comparison between a given 31607 * object and `source`, returning `true` if the given object has equivalent 31608 * property values, else `false`. 31609 * 31610 * **Note:** The created function is equivalent to `_.isMatch` with `source` 31611 * partially applied. 31612 * 31613 * Partial comparisons will match empty array and empty object `source` 31614 * values against any array or object value, respectively. See `_.isEqual` 31615 * for a list of supported value comparisons. 31616 * 31617 * **Note:** Multiple values can be checked by combining several matchers 31618 * using `_.overSome` 31619 * 31620 * @static 31621 * @memberOf _ 31622 * @since 3.0.0 31623 * @category Util 31624 * @param {Object} source The object of property values to match. 31625 * @returns {Function} Returns the new spec function. 31626 * @example 31627 * 31628 * var objects = [ 31629 * { 'a': 1, 'b': 2, 'c': 3 }, 31630 * { 'a': 4, 'b': 5, 'c': 6 } 31631 * ]; 31632 * 31633 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 31634 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 31635 * 31636 * // Checking for several possible values 31637 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 31638 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 31639 */ 31640 function matches(source) { 31641 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 31642 } 31643 31644 /** 31645 * Creates a function that performs a partial deep comparison between the 31646 * value at `path` of a given object to `srcValue`, returning `true` if the 31647 * object value is equivalent, else `false`. 31648 * 31649 * **Note:** Partial comparisons will match empty array and empty object 31650 * `srcValue` values against any array or object value, respectively. See 31651 * `_.isEqual` for a list of supported value comparisons. 31652 * 31653 * **Note:** Multiple values can be checked by combining several matchers 31654 * using `_.overSome` 31655 * 31656 * @static 31657 * @memberOf _ 31658 * @since 3.2.0 31659 * @category Util 31660 * @param {Array|string} path The path of the property to get. 31661 * @param {*} srcValue The value to match. 31662 * @returns {Function} Returns the new spec function. 31663 * @example 31664 * 31665 * var objects = [ 31666 * { 'a': 1, 'b': 2, 'c': 3 }, 31667 * { 'a': 4, 'b': 5, 'c': 6 } 31668 * ]; 31669 * 31670 * _.find(objects, _.matchesProperty('a', 4)); 31671 * // => { 'a': 4, 'b': 5, 'c': 6 } 31672 * 31673 * // Checking for several possible values 31674 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 31675 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 31676 */ 31677 function matchesProperty(path, srcValue) { 31678 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 31679 } 31680 31681 /** 31682 * Creates a function that invokes the method at `path` of a given object. 31683 * Any additional arguments are provided to the invoked method. 31684 * 31685 * @static 31686 * @memberOf _ 31687 * @since 3.7.0 31688 * @category Util 31689 * @param {Array|string} path The path of the method to invoke. 31690 * @param {...*} [args] The arguments to invoke the method with. 31691 * @returns {Function} Returns the new invoker function. 31692 * @example 31693 * 31694 * var objects = [ 31695 * { 'a': { 'b': _.constant(2) } }, 31696 * { 'a': { 'b': _.constant(1) } } 31697 * ]; 31698 * 31699 * _.map(objects, _.method('a.b')); 31700 * // => [2, 1] 31701 * 31702 * _.map(objects, _.method(['a', 'b'])); 31703 * // => [2, 1] 31704 */ 31705 var method = baseRest(function(path, args) { 31706 return function(object) { 31707 return baseInvoke(object, path, args); 31708 }; 31709 }); 31710 31711 /** 31712 * The opposite of `_.method`; this method creates a function that invokes 31713 * the method at a given path of `object`. Any additional arguments are 31714 * provided to the invoked method. 31715 * 31716 * @static 31717 * @memberOf _ 31718 * @since 3.7.0 31719 * @category Util 31720 * @param {Object} object The object to query. 31721 * @param {...*} [args] The arguments to invoke the method with. 31722 * @returns {Function} Returns the new invoker function. 31723 * @example 31724 * 31725 * var array = _.times(3, _.constant), 31726 * object = { 'a': array, 'b': array, 'c': array }; 31727 * 31728 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 31729 * // => [2, 0] 31730 * 31731 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 31732 * // => [2, 0] 31733 */ 31734 var methodOf = baseRest(function(object, args) { 31735 return function(path) { 31736 return baseInvoke(object, path, args); 31737 }; 31738 }); 31739 31740 /** 31741 * Adds all own enumerable string keyed function properties of a source 31742 * object to the destination object. If `object` is a function, then methods 31743 * are added to its prototype as well. 31744 * 31745 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 31746 * avoid conflicts caused by modifying the original. 31747 * 31748 * @static 31749 * @since 0.1.0 31750 * @memberOf _ 31751 * @category Util 31752 * @param {Function|Object} [object=lodash] The destination object. 31753 * @param {Object} source The object of functions to add. 31754 * @param {Object} [options={}] The options object. 31755 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 31756 * @returns {Function|Object} Returns `object`. 31757 * @example 31758 * 31759 * function vowels(string) { 31760 * return _.filter(string, function(v) { 31761 * return /[aeiou]/i.test(v); 31762 * }); 31763 * } 31764 * 31765 * _.mixin({ 'vowels': vowels }); 31766 * _.vowels('fred'); 31767 * // => ['e'] 31768 * 31769 * _('fred').vowels().value(); 31770 * // => ['e'] 31771 * 31772 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 31773 * _('fred').vowels(); 31774 * // => ['e'] 31775 */ 31776 function mixin(object, source, options) { 31777 var props = keys(source), 31778 methodNames = baseFunctions(source, props); 31779 31780 if (options == null && 31781 !(isObject(source) && (methodNames.length || !props.length))) { 31782 options = source; 31783 source = object; 31784 object = this; 31785 methodNames = baseFunctions(source, keys(source)); 31786 } 31787 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 31788 isFunc = isFunction(object); 31789 31790 arrayEach(methodNames, function(methodName) { 31791 var func = source[methodName]; 31792 object[methodName] = func; 31793 if (isFunc) { 31794 object.prototype[methodName] = function() { 31795 var chainAll = this.__chain__; 31796 if (chain || chainAll) { 31797 var result = object(this.__wrapped__), 31798 actions = result.__actions__ = copyArray(this.__actions__); 31799 31800 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 31801 result.__chain__ = chainAll; 31802 return result; 31803 } 31804 return func.apply(object, arrayPush([this.value()], arguments)); 31805 }; 31806 } 31807 }); 31808 31809 return object; 31810 } 31811 31812 /** 31813 * Reverts the `_` variable to its previous value and returns a reference to 31814 * the `lodash` function. 31815 * 31816 * @static 31817 * @since 0.1.0 31818 * @memberOf _ 31819 * @category Util 31820 * @returns {Function} Returns the `lodash` function. 31821 * @example 31822 * 31823 * var lodash = _.noConflict(); 31824 */ 31825 function noConflict() { 31826 if (root._ === this) { 31827 root._ = oldDash; 31828 } 31829 return this; 31830 } 31831 31832 /** 31833 * This method returns `undefined`. 31834 * 31835 * @static 31836 * @memberOf _ 31837 * @since 2.3.0 31838 * @category Util 31839 * @example 31840 * 31841 * _.times(2, _.noop); 31842 * // => [undefined, undefined] 31843 */ 31844 function noop() { 31845 // No operation performed. 31846 } 31847 31848 /** 31849 * Creates a function that gets the argument at index `n`. If `n` is negative, 31850 * the nth argument from the end is returned. 31851 * 31852 * @static 31853 * @memberOf _ 31854 * @since 4.0.0 31855 * @category Util 31856 * @param {number} [n=0] The index of the argument to return. 31857 * @returns {Function} Returns the new pass-thru function. 31858 * @example 31859 * 31860 * var func = _.nthArg(1); 31861 * func('a', 'b', 'c', 'd'); 31862 * // => 'b' 31863 * 31864 * var func = _.nthArg(-2); 31865 * func('a', 'b', 'c', 'd'); 31866 * // => 'c' 31867 */ 31868 function nthArg(n) { 31869 n = toInteger(n); 31870 return baseRest(function(args) { 31871 return baseNth(args, n); 31872 }); 31873 } 31874 31875 /** 31876 * Creates a function that invokes `iteratees` with the arguments it receives 31877 * and returns their results. 31878 * 31879 * @static 31880 * @memberOf _ 31881 * @since 4.0.0 31882 * @category Util 31883 * @param {...(Function|Function[])} [iteratees=[_.identity]] 31884 * The iteratees to invoke. 31885 * @returns {Function} Returns the new function. 31886 * @example 31887 * 31888 * var func = _.over([Math.max, Math.min]); 31889 * 31890 * func(1, 2, 3, 4); 31891 * // => [4, 1] 31892 */ 31893 var over = createOver(arrayMap); 31894 31895 /** 31896 * Creates a function that checks if **all** of the `predicates` return 31897 * truthy when invoked with the arguments it receives. 31898 * 31899 * Following shorthands are possible for providing predicates. 31900 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 31901 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 31902 * 31903 * @static 31904 * @memberOf _ 31905 * @since 4.0.0 31906 * @category Util 31907 * @param {...(Function|Function[])} [predicates=[_.identity]] 31908 * The predicates to check. 31909 * @returns {Function} Returns the new function. 31910 * @example 31911 * 31912 * var func = _.overEvery([Boolean, isFinite]); 31913 * 31914 * func('1'); 31915 * // => true 31916 * 31917 * func(null); 31918 * // => false 31919 * 31920 * func(NaN); 31921 * // => false 31922 */ 31923 var overEvery = createOver(arrayEvery); 31924 31925 /** 31926 * Creates a function that checks if **any** of the `predicates` return 31927 * truthy when invoked with the arguments it receives. 31928 * 31929 * Following shorthands are possible for providing predicates. 31930 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 31931 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 31932 * 31933 * @static 31934 * @memberOf _ 31935 * @since 4.0.0 31936 * @category Util 31937 * @param {...(Function|Function[])} [predicates=[_.identity]] 31938 * The predicates to check. 31939 * @returns {Function} Returns the new function. 31940 * @example 31941 * 31942 * var func = _.overSome([Boolean, isFinite]); 31943 * 31944 * func('1'); 31945 * // => true 31946 * 31947 * func(null); 31948 * // => true 31949 * 31950 * func(NaN); 31951 * // => false 31952 * 31953 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 31954 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 31955 */ 31956 var overSome = createOver(arraySome); 31957 31958 /** 31959 * Creates a function that returns the value at `path` of a given object. 31960 * 31961 * @static 31962 * @memberOf _ 31963 * @since 2.4.0 31964 * @category Util 31965 * @param {Array|string} path The path of the property to get. 31966 * @returns {Function} Returns the new accessor function. 31967 * @example 31968 * 31969 * var objects = [ 31970 * { 'a': { 'b': 2 } }, 31971 * { 'a': { 'b': 1 } } 31972 * ]; 31973 * 31974 * _.map(objects, _.property('a.b')); 31975 * // => [2, 1] 31976 * 31977 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 31978 * // => [1, 2] 31979 */ 31980 function property(path) { 31981 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 31982 } 31983 31984 /** 31985 * The opposite of `_.property`; this method creates a function that returns 31986 * the value at a given path of `object`. 31987 * 31988 * @static 31989 * @memberOf _ 31990 * @since 3.0.0 31991 * @category Util 31992 * @param {Object} object The object to query. 31993 * @returns {Function} Returns the new accessor function. 31994 * @example 31995 * 31996 * var array = [0, 1, 2], 31997 * object = { 'a': array, 'b': array, 'c': array }; 31998 * 31999 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 32000 * // => [2, 0] 32001 * 32002 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 32003 * // => [2, 0] 32004 */ 32005 function propertyOf(object) { 32006 return function(path) { 32007 return object == null ? undefined : baseGet(object, path); 32008 }; 32009 } 32010 32011 /** 32012 * Creates an array of numbers (positive and/or negative) progressing from 32013 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 32014 * `start` is specified without an `end` or `step`. If `end` is not specified, 32015 * it's set to `start` with `start` then set to `0`. 32016 * 32017 * **Note:** JavaScript follows the IEEE-754 standard for resolving 32018 * floating-point values which can produce unexpected results. 32019 * 32020 * @static 32021 * @since 0.1.0 32022 * @memberOf _ 32023 * @category Util 32024 * @param {number} [start=0] The start of the range. 32025 * @param {number} end The end of the range. 32026 * @param {number} [step=1] The value to increment or decrement by. 32027 * @returns {Array} Returns the range of numbers. 32028 * @see _.inRange, _.rangeRight 32029 * @example 32030 * 32031 * _.range(4); 32032 * // => [0, 1, 2, 3] 32033 * 32034 * _.range(-4); 32035 * // => [0, -1, -2, -3] 32036 * 32037 * _.range(1, 5); 32038 * // => [1, 2, 3, 4] 32039 * 32040 * _.range(0, 20, 5); 32041 * // => [0, 5, 10, 15] 32042 * 32043 * _.range(0, -4, -1); 32044 * // => [0, -1, -2, -3] 32045 * 32046 * _.range(1, 4, 0); 32047 * // => [1, 1, 1] 32048 * 32049 * _.range(0); 32050 * // => [] 32051 */ 32052 var range = createRange(); 32053 32054 /** 32055 * This method is like `_.range` except that it populates values in 32056 * descending order. 32057 * 32058 * @static 32059 * @memberOf _ 32060 * @since 4.0.0 32061 * @category Util 32062 * @param {number} [start=0] The start of the range. 32063 * @param {number} end The end of the range. 32064 * @param {number} [step=1] The value to increment or decrement by. 32065 * @returns {Array} Returns the range of numbers. 32066 * @see _.inRange, _.range 32067 * @example 32068 * 32069 * _.rangeRight(4); 32070 * // => [3, 2, 1, 0] 32071 * 32072 * _.rangeRight(-4); 32073 * // => [-3, -2, -1, 0] 32074 * 32075 * _.rangeRight(1, 5); 32076 * // => [4, 3, 2, 1] 32077 * 32078 * _.rangeRight(0, 20, 5); 32079 * // => [15, 10, 5, 0] 32080 * 32081 * _.rangeRight(0, -4, -1); 32082 * // => [-3, -2, -1, 0] 32083 * 32084 * _.rangeRight(1, 4, 0); 32085 * // => [1, 1, 1] 32086 * 32087 * _.rangeRight(0); 32088 * // => [] 32089 */ 32090 var rangeRight = createRange(true); 32091 32092 /** 32093 * This method returns a new empty array. 32094 * 32095 * @static 32096 * @memberOf _ 32097 * @since 4.13.0 32098 * @category Util 32099 * @returns {Array} Returns the new empty array. 32100 * @example 32101 * 32102 * var arrays = _.times(2, _.stubArray); 32103 * 32104 * console.log(arrays); 32105 * // => [[], []] 32106 * 32107 * console.log(arrays[0] === arrays[1]); 32108 * // => false 32109 */ 32110 function stubArray() { 32111 return []; 32112 } 32113 32114 /** 32115 * This method returns `false`. 32116 * 32117 * @static 32118 * @memberOf _ 32119 * @since 4.13.0 32120 * @category Util 32121 * @returns {boolean} Returns `false`. 32122 * @example 32123 * 32124 * _.times(2, _.stubFalse); 32125 * // => [false, false] 32126 */ 32127 function stubFalse() { 32128 return false; 32129 } 32130 32131 /** 32132 * This method returns a new empty object. 32133 * 32134 * @static 32135 * @memberOf _ 32136 * @since 4.13.0 32137 * @category Util 32138 * @returns {Object} Returns the new empty object. 32139 * @example 32140 * 32141 * var objects = _.times(2, _.stubObject); 32142 * 32143 * console.log(objects); 32144 * // => [{}, {}] 32145 * 32146 * console.log(objects[0] === objects[1]); 32147 * // => false 32148 */ 32149 function stubObject() { 32150 return {}; 32151 } 32152 32153 /** 32154 * This method returns an empty string. 32155 * 32156 * @static 32157 * @memberOf _ 32158 * @since 4.13.0 32159 * @category Util 32160 * @returns {string} Returns the empty string. 32161 * @example 32162 * 32163 * _.times(2, _.stubString); 32164 * // => ['', ''] 32165 */ 32166 function stubString() { 32167 return ''; 32168 } 32169 32170 /** 32171 * This method returns `true`. 32172 * 32173 * @static 32174 * @memberOf _ 32175 * @since 4.13.0 32176 * @category Util 32177 * @returns {boolean} Returns `true`. 32178 * @example 32179 * 32180 * _.times(2, _.stubTrue); 32181 * // => [true, true] 32182 */ 32183 function stubTrue() { 32184 return true; 32185 } 32186 32187 /** 32188 * Invokes the iteratee `n` times, returning an array of the results of 32189 * each invocation. The iteratee is invoked with one argument; (index). 32190 * 32191 * @static 32192 * @since 0.1.0 32193 * @memberOf _ 32194 * @category Util 32195 * @param {number} n The number of times to invoke `iteratee`. 32196 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 32197 * @returns {Array} Returns the array of results. 32198 * @example 32199 * 32200 * _.times(3, String); 32201 * // => ['0', '1', '2'] 32202 * 32203 * _.times(4, _.constant(0)); 32204 * // => [0, 0, 0, 0] 32205 */ 32206 function times(n, iteratee) { 32207 n = toInteger(n); 32208 if (n < 1 || n > MAX_SAFE_INTEGER) { 32209 return []; 32210 } 32211 var index = MAX_ARRAY_LENGTH, 32212 length = nativeMin(n, MAX_ARRAY_LENGTH); 32213 32214 iteratee = getIteratee(iteratee); 32215 n -= MAX_ARRAY_LENGTH; 32216 32217 var result = baseTimes(length, iteratee); 32218 while (++index < n) { 32219 iteratee(index); 32220 } 32221 return result; 32222 } 32223 32224 /** 32225 * Converts `value` to a property path array. 32226 * 32227 * @static 32228 * @memberOf _ 32229 * @since 4.0.0 32230 * @category Util 32231 * @param {*} value The value to convert. 32232 * @returns {Array} Returns the new property path array. 32233 * @example 32234 * 32235 * _.toPath('a.b.c'); 32236 * // => ['a', 'b', 'c'] 32237 * 32238 * _.toPath('a[0].b.c'); 32239 * // => ['a', '0', 'b', 'c'] 32240 */ 32241 function toPath(value) { 32242 if (isArray(value)) { 32243 return arrayMap(value, toKey); 32244 } 32245 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 32246 } 32247 32248 /** 32249 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 32250 * 32251 * @static 32252 * @since 0.1.0 32253 * @memberOf _ 32254 * @category Util 32255 * @param {string} [prefix=''] The value to prefix the ID with. 32256 * @returns {string} Returns the unique ID. 32257 * @example 32258 * 32259 * _.uniqueId('contact_'); 32260 * // => 'contact_104' 32261 * 32262 * _.uniqueId(); 32263 * // => '105' 32264 */ 32265 function uniqueId(prefix) { 32266 var id = ++idCounter; 32267 return toString(prefix) + id; 32268 } 32269 32270 /*------------------------------------------------------------------------*/ 32271 32272 /** 32273 * Adds two numbers. 32274 * 32275 * @static 32276 * @memberOf _ 32277 * @since 3.4.0 32278 * @category Math 32279 * @param {number} augend The first number in an addition. 32280 * @param {number} addend The second number in an addition. 32281 * @returns {number} Returns the total. 32282 * @example 32283 * 32284 * _.add(6, 4); 32285 * // => 10 32286 */ 32287 var add = createMathOperation(function(augend, addend) { 32288 return augend + addend; 32289 }, 0); 32290 32291 /** 32292 * Computes `number` rounded up to `precision`. 32293 * 32294 * @static 32295 * @memberOf _ 32296 * @since 3.10.0 32297 * @category Math 32298 * @param {number} number The number to round up. 32299 * @param {number} [precision=0] The precision to round up to. 32300 * @returns {number} Returns the rounded up number. 32301 * @example 32302 * 32303 * _.ceil(4.006); 32304 * // => 5 32305 * 32306 * _.ceil(6.004, 2); 32307 * // => 6.01 32308 * 32309 * _.ceil(6040, -2); 32310 * // => 6100 32311 */ 32312 var ceil = createRound('ceil'); 32313 32314 /** 32315 * Divide two numbers. 32316 * 32317 * @static 32318 * @memberOf _ 32319 * @since 4.7.0 32320 * @category Math 32321 * @param {number} dividend The first number in a division. 32322 * @param {number} divisor The second number in a division. 32323 * @returns {number} Returns the quotient. 32324 * @example 32325 * 32326 * _.divide(6, 4); 32327 * // => 1.5 32328 */ 32329 var divide = createMathOperation(function(dividend, divisor) { 32330 return dividend / divisor; 32331 }, 1); 32332 32333 /** 32334 * Computes `number` rounded down to `precision`. 32335 * 32336 * @static 32337 * @memberOf _ 32338 * @since 3.10.0 32339 * @category Math 32340 * @param {number} number The number to round down. 32341 * @param {number} [precision=0] The precision to round down to. 32342 * @returns {number} Returns the rounded down number. 32343 * @example 32344 * 32345 * _.floor(4.006); 32346 * // => 4 32347 * 32348 * _.floor(0.046, 2); 32349 * // => 0.04 32350 * 32351 * _.floor(4060, -2); 32352 * // => 4000 32353 */ 32354 var floor = createRound('floor'); 32355 32356 /** 32357 * Computes the maximum value of `array`. If `array` is empty or falsey, 32358 * `undefined` is returned. 32359 * 32360 * @static 32361 * @since 0.1.0 32362 * @memberOf _ 32363 * @category Math 32364 * @param {Array} array The array to iterate over. 32365 * @returns {*} Returns the maximum value. 32366 * @example 32367 * 32368 * _.max([4, 2, 8, 6]); 32369 * // => 8 32370 * 32371 * _.max([]); 32372 * // => undefined 32373 */ 32374 function max(array) { 32375 return (array && array.length) 32376 ? baseExtremum(array, identity, baseGt) 32377 : undefined; 32378 } 32379 32380 /** 32381 * This method is like `_.max` except that it accepts `iteratee` which is 32382 * invoked for each element in `array` to generate the criterion by which 32383 * the value is ranked. The iteratee is invoked with one argument: (value). 32384 * 32385 * @static 32386 * @memberOf _ 32387 * @since 4.0.0 32388 * @category Math 32389 * @param {Array} array The array to iterate over. 32390 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 32391 * @returns {*} Returns the maximum value. 32392 * @example 32393 * 32394 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 32395 * 32396 * _.maxBy(objects, function(o) { return o.n; }); 32397 * // => { 'n': 2 } 32398 * 32399 * // The `_.property` iteratee shorthand. 32400 * _.maxBy(objects, 'n'); 32401 * // => { 'n': 2 } 32402 */ 32403 function maxBy(array, iteratee) { 32404 return (array && array.length) 32405 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) 32406 : undefined; 32407 } 32408 32409 /** 32410 * Computes the mean of the values in `array`. 32411 * 32412 * @static 32413 * @memberOf _ 32414 * @since 4.0.0 32415 * @category Math 32416 * @param {Array} array The array to iterate over. 32417 * @returns {number} Returns the mean. 32418 * @example 32419 * 32420 * _.mean([4, 2, 8, 6]); 32421 * // => 5 32422 */ 32423 function mean(array) { 32424 return baseMean(array, identity); 32425 } 32426 32427 /** 32428 * This method is like `_.mean` except that it accepts `iteratee` which is 32429 * invoked for each element in `array` to generate the value to be averaged. 32430 * The iteratee is invoked with one argument: (value). 32431 * 32432 * @static 32433 * @memberOf _ 32434 * @since 4.7.0 32435 * @category Math 32436 * @param {Array} array The array to iterate over. 32437 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 32438 * @returns {number} Returns the mean. 32439 * @example 32440 * 32441 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 32442 * 32443 * _.meanBy(objects, function(o) { return o.n; }); 32444 * // => 5 32445 * 32446 * // The `_.property` iteratee shorthand. 32447 * _.meanBy(objects, 'n'); 32448 * // => 5 32449 */ 32450 function meanBy(array, iteratee) { 32451 return baseMean(array, getIteratee(iteratee, 2)); 32452 } 32453 32454 /** 32455 * Computes the minimum value of `array`. If `array` is empty or falsey, 32456 * `undefined` is returned. 32457 * 32458 * @static 32459 * @since 0.1.0 32460 * @memberOf _ 32461 * @category Math 32462 * @param {Array} array The array to iterate over. 32463 * @returns {*} Returns the minimum value. 32464 * @example 32465 * 32466 * _.min([4, 2, 8, 6]); 32467 * // => 2 32468 * 32469 * _.min([]); 32470 * // => undefined 32471 */ 32472 function min(array) { 32473 return (array && array.length) 32474 ? baseExtremum(array, identity, baseLt) 32475 : undefined; 32476 } 32477 32478 /** 32479 * This method is like `_.min` except that it accepts `iteratee` which is 32480 * invoked for each element in `array` to generate the criterion by which 32481 * the value is ranked. The iteratee is invoked with one argument: (value). 32482 * 32483 * @static 32484 * @memberOf _ 32485 * @since 4.0.0 32486 * @category Math 32487 * @param {Array} array The array to iterate over. 32488 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 32489 * @returns {*} Returns the minimum value. 32490 * @example 32491 * 32492 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 32493 * 32494 * _.minBy(objects, function(o) { return o.n; }); 32495 * // => { 'n': 1 } 32496 * 32497 * // The `_.property` iteratee shorthand. 32498 * _.minBy(objects, 'n'); 32499 * // => { 'n': 1 } 32500 */ 32501 function minBy(array, iteratee) { 32502 return (array && array.length) 32503 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) 32504 : undefined; 32505 } 32506 32507 /** 32508 * Multiply two numbers. 32509 * 32510 * @static 32511 * @memberOf _ 32512 * @since 4.7.0 32513 * @category Math 32514 * @param {number} multiplier The first number in a multiplication. 32515 * @param {number} multiplicand The second number in a multiplication. 32516 * @returns {number} Returns the product. 32517 * @example 32518 * 32519 * _.multiply(6, 4); 32520 * // => 24 32521 */ 32522 var multiply = createMathOperation(function(multiplier, multiplicand) { 32523 return multiplier * multiplicand; 32524 }, 1); 32525 32526 /** 32527 * Computes `number` rounded to `precision`. 32528 * 32529 * @static 32530 * @memberOf _ 32531 * @since 3.10.0 32532 * @category Math 32533 * @param {number} number The number to round. 32534 * @param {number} [precision=0] The precision to round to. 32535 * @returns {number} Returns the rounded number. 32536 * @example 32537 * 32538 * _.round(4.006); 32539 * // => 4 32540 * 32541 * _.round(4.006, 2); 32542 * // => 4.01 32543 * 32544 * _.round(4060, -2); 32545 * // => 4100 32546 */ 32547 var round = createRound('round'); 32548 32549 /** 32550 * Subtract two numbers. 32551 * 32552 * @static 32553 * @memberOf _ 32554 * @since 4.0.0 32555 * @category Math 32556 * @param {number} minuend The first number in a subtraction. 32557 * @param {number} subtrahend The second number in a subtraction. 32558 * @returns {number} Returns the difference. 32559 * @example 32560 * 32561 * _.subtract(6, 4); 32562 * // => 2 32563 */ 32564 var subtract = createMathOperation(function(minuend, subtrahend) { 32565 return minuend - subtrahend; 32566 }, 0); 32567 32568 /** 32569 * Computes the sum of the values in `array`. 32570 * 32571 * @static 32572 * @memberOf _ 32573 * @since 3.4.0 32574 * @category Math 32575 * @param {Array} array The array to iterate over. 32576 * @returns {number} Returns the sum. 32577 * @example 32578 * 32579 * _.sum([4, 2, 8, 6]); 32580 * // => 20 32581 */ 32582 function sum(array) { 32583 return (array && array.length) 32584 ? baseSum(array, identity) 32585 : 0; 32586 } 32587 32588 /** 32589 * This method is like `_.sum` except that it accepts `iteratee` which is 32590 * invoked for each element in `array` to generate the value to be summed. 32591 * The iteratee is invoked with one argument: (value). 32592 * 32593 * @static 32594 * @memberOf _ 32595 * @since 4.0.0 32596 * @category Math 32597 * @param {Array} array The array to iterate over. 32598 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 32599 * @returns {number} Returns the sum. 32600 * @example 32601 * 32602 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 32603 * 32604 * _.sumBy(objects, function(o) { return o.n; }); 32605 * // => 20 32606 * 32607 * // The `_.property` iteratee shorthand. 32608 * _.sumBy(objects, 'n'); 32609 * // => 20 32610 */ 32611 function sumBy(array, iteratee) { 32612 return (array && array.length) 32613 ? baseSum(array, getIteratee(iteratee, 2)) 32614 : 0; 32615 } 32616 32617 /*------------------------------------------------------------------------*/ 32618 32619 // Add methods that return wrapped values in chain sequences. 32620 lodash.after = after; 32621 lodash.ary = ary; 32622 lodash.assign = assign; 32623 lodash.assignIn = assignIn; 32624 lodash.assignInWith = assignInWith; 32625 lodash.assignWith = assignWith; 32626 lodash.at = at; 32627 lodash.before = before; 32628 lodash.bind = bind; 32629 lodash.bindAll = bindAll; 32630 lodash.bindKey = bindKey; 32631 lodash.castArray = castArray; 32632 lodash.chain = chain; 32633 lodash.chunk = chunk; 32634 lodash.compact = compact; 32635 lodash.concat = concat; 32636 lodash.cond = cond; 32637 lodash.conforms = conforms; 32638 lodash.constant = constant; 32639 lodash.countBy = countBy; 32640 lodash.create = create; 32641 lodash.curry = curry; 32642 lodash.curryRight = curryRight; 32643 lodash.debounce = debounce; 32644 lodash.defaults = defaults; 32645 lodash.defaultsDeep = defaultsDeep; 32646 lodash.defer = defer; 32647 lodash.delay = delay; 32648 lodash.difference = difference; 32649 lodash.differenceBy = differenceBy; 32650 lodash.differenceWith = differenceWith; 32651 lodash.drop = drop; 32652 lodash.dropRight = dropRight; 32653 lodash.dropRightWhile = dropRightWhile; 32654 lodash.dropWhile = dropWhile; 32655 lodash.fill = fill; 32656 lodash.filter = filter; 32657 lodash.flatMap = flatMap; 32658 lodash.flatMapDeep = flatMapDeep; 32659 lodash.flatMapDepth = flatMapDepth; 32660 lodash.flatten = flatten; 32661 lodash.flattenDeep = flattenDeep; 32662 lodash.flattenDepth = flattenDepth; 32663 lodash.flip = flip; 32664 lodash.flow = flow; 32665 lodash.flowRight = flowRight; 32666 lodash.fromPairs = fromPairs; 32667 lodash.functions = functions; 32668 lodash.functionsIn = functionsIn; 32669 lodash.groupBy = groupBy; 32670 lodash.initial = initial; 32671 lodash.intersection = intersection; 32672 lodash.intersectionBy = intersectionBy; 32673 lodash.intersectionWith = intersectionWith; 32674 lodash.invert = invert; 32675 lodash.invertBy = invertBy; 32676 lodash.invokeMap = invokeMap; 32677 lodash.iteratee = iteratee; 32678 lodash.keyBy = keyBy; 32679 lodash.keys = keys; 32680 lodash.keysIn = keysIn; 32681 lodash.map = map; 32682 lodash.mapKeys = mapKeys; 32683 lodash.mapValues = mapValues; 32684 lodash.matches = matches; 32685 lodash.matchesProperty = matchesProperty; 32686 lodash.memoize = memoize; 32687 lodash.merge = merge; 32688 lodash.mergeWith = mergeWith; 32689 lodash.method = method; 32690 lodash.methodOf = methodOf; 32691 lodash.mixin = mixin; 32692 lodash.negate = negate; 32693 lodash.nthArg = nthArg; 32694 lodash.omit = omit; 32695 lodash.omitBy = omitBy; 32696 lodash.once = once; 32697 lodash.orderBy = orderBy; 32698 lodash.over = over; 32699 lodash.overArgs = overArgs; 32700 lodash.overEvery = overEvery; 32701 lodash.overSome = overSome; 32702 lodash.partial = partial; 32703 lodash.partialRight = partialRight; 32704 lodash.partition = partition; 32705 lodash.pick = pick; 32706 lodash.pickBy = pickBy; 32707 lodash.property = property; 32708 lodash.propertyOf = propertyOf; 32709 lodash.pull = pull; 32710 lodash.pullAll = pullAll; 32711 lodash.pullAllBy = pullAllBy; 32712 lodash.pullAllWith = pullAllWith; 32713 lodash.pullAt = pullAt; 32714 lodash.range = range; 32715 lodash.rangeRight = rangeRight; 32716 lodash.rearg = rearg; 32717 lodash.reject = reject; 32718 lodash.remove = remove; 32719 lodash.rest = rest; 32720 lodash.reverse = reverse; 32721 lodash.sampleSize = sampleSize; 32722 lodash.set = set; 32723 lodash.setWith = setWith; 32724 lodash.shuffle = shuffle; 32725 lodash.slice = slice; 32726 lodash.sortBy = sortBy; 32727 lodash.sortedUniq = sortedUniq; 32728 lodash.sortedUniqBy = sortedUniqBy; 32729 lodash.split = split; 32730 lodash.spread = spread; 32731 lodash.tail = tail; 32732 lodash.take = take; 32733 lodash.takeRight = takeRight; 32734 lodash.takeRightWhile = takeRightWhile; 32735 lodash.takeWhile = takeWhile; 32736 lodash.tap = tap; 32737 lodash.throttle = throttle; 32738 lodash.thru = thru; 32739 lodash.toArray = toArray; 32740 lodash.toPairs = toPairs; 32741 lodash.toPairsIn = toPairsIn; 32742 lodash.toPath = toPath; 32743 lodash.toPlainObject = toPlainObject; 32744 lodash.transform = transform; 32745 lodash.unary = unary; 32746 lodash.union = union; 32747 lodash.unionBy = unionBy; 32748 lodash.unionWith = unionWith; 32749 lodash.uniq = uniq; 32750 lodash.uniqBy = uniqBy; 32751 lodash.uniqWith = uniqWith; 32752 lodash.unset = unset; 32753 lodash.unzip = unzip; 32754 lodash.unzipWith = unzipWith; 32755 lodash.update = update; 32756 lodash.updateWith = updateWith; 32757 lodash.values = values; 32758 lodash.valuesIn = valuesIn; 32759 lodash.without = without; 32760 lodash.words = words; 32761 lodash.wrap = wrap; 32762 lodash.xor = xor; 32763 lodash.xorBy = xorBy; 32764 lodash.xorWith = xorWith; 32765 lodash.zip = zip; 32766 lodash.zipObject = zipObject; 32767 lodash.zipObjectDeep = zipObjectDeep; 32768 lodash.zipWith = zipWith; 32769 32770 // Add aliases. 32771 lodash.entries = toPairs; 32772 lodash.entriesIn = toPairsIn; 32773 lodash.extend = assignIn; 32774 lodash.extendWith = assignInWith; 32775 32776 // Add methods to `lodash.prototype`. 32777 mixin(lodash, lodash); 32778 32779 /*------------------------------------------------------------------------*/ 32780 32781 // Add methods that return unwrapped values in chain sequences. 32782 lodash.add = add; 32783 lodash.attempt = attempt; 32784 lodash.camelCase = camelCase; 32785 lodash.capitalize = capitalize; 32786 lodash.ceil = ceil; 32787 lodash.clamp = clamp; 32788 lodash.clone = clone; 32789 lodash.cloneDeep = cloneDeep; 32790 lodash.cloneDeepWith = cloneDeepWith; 32791 lodash.cloneWith = cloneWith; 32792 lodash.conformsTo = conformsTo; 32793 lodash.deburr = deburr; 32794 lodash.defaultTo = defaultTo; 32795 lodash.divide = divide; 32796 lodash.endsWith = endsWith; 32797 lodash.eq = eq; 32798 lodash.escape = escape; 32799 lodash.escapeRegExp = escapeRegExp; 32800 lodash.every = every; 32801 lodash.find = find; 32802 lodash.findIndex = findIndex; 32803 lodash.findKey = findKey; 32804 lodash.findLast = findLast; 32805 lodash.findLastIndex = findLastIndex; 32806 lodash.findLastKey = findLastKey; 32807 lodash.floor = floor; 32808 lodash.forEach = forEach; 32809 lodash.forEachRight = forEachRight; 32810 lodash.forIn = forIn; 32811 lodash.forInRight = forInRight; 32812 lodash.forOwn = forOwn; 32813 lodash.forOwnRight = forOwnRight; 32814 lodash.get = get; 32815 lodash.gt = gt; 32816 lodash.gte = gte; 32817 lodash.has = has; 32818 lodash.hasIn = hasIn; 32819 lodash.head = head; 32820 lodash.identity = identity; 32821 lodash.includes = includes; 32822 lodash.indexOf = indexOf; 32823 lodash.inRange = inRange; 32824 lodash.invoke = invoke; 32825 lodash.isArguments = isArguments; 32826 lodash.isArray = isArray; 32827 lodash.isArrayBuffer = isArrayBuffer; 32828 lodash.isArrayLike = isArrayLike; 32829 lodash.isArrayLikeObject = isArrayLikeObject; 32830 lodash.isBoolean = isBoolean; 32831 lodash.isBuffer = isBuffer; 32832 lodash.isDate = isDate; 32833 lodash.isElement = isElement; 32834 lodash.isEmpty = isEmpty; 32835 lodash.isEqual = isEqual; 32836 lodash.isEqualWith = isEqualWith; 32837 lodash.isError = isError; 32838 lodash.isFinite = isFinite; 32839 lodash.isFunction = isFunction; 32840 lodash.isInteger = isInteger; 32841 lodash.isLength = isLength; 32842 lodash.isMap = isMap; 32843 lodash.isMatch = isMatch; 32844 lodash.isMatchWith = isMatchWith; 32845 lodash.isNaN = isNaN; 32846 lodash.isNative = isNative; 32847 lodash.isNil = isNil; 32848 lodash.isNull = isNull; 32849 lodash.isNumber = isNumber; 32850 lodash.isObject = isObject; 32851 lodash.isObjectLike = isObjectLike; 32852 lodash.isPlainObject = isPlainObject; 32853 lodash.isRegExp = isRegExp; 32854 lodash.isSafeInteger = isSafeInteger; 32855 lodash.isSet = isSet; 32856 lodash.isString = isString; 32857 lodash.isSymbol = isSymbol; 32858 lodash.isTypedArray = isTypedArray; 32859 lodash.isUndefined = isUndefined; 32860 lodash.isWeakMap = isWeakMap; 32861 lodash.isWeakSet = isWeakSet; 32862 lodash.join = join; 32863 lodash.kebabCase = kebabCase; 32864 lodash.last = last; 32865 lodash.lastIndexOf = lastIndexOf; 32866 lodash.lowerCase = lowerCase; 32867 lodash.lowerFirst = lowerFirst; 32868 lodash.lt = lt; 32869 lodash.lte = lte; 32870 lodash.max = max; 32871 lodash.maxBy = maxBy; 32872 lodash.mean = mean; 32873 lodash.meanBy = meanBy; 32874 lodash.min = min; 32875 lodash.minBy = minBy; 32876 lodash.stubArray = stubArray; 32877 lodash.stubFalse = stubFalse; 32878 lodash.stubObject = stubObject; 32879 lodash.stubString = stubString; 32880 lodash.stubTrue = stubTrue; 32881 lodash.multiply = multiply; 32882 lodash.nth = nth; 32883 lodash.noConflict = noConflict; 32884 lodash.noop = noop; 32885 lodash.now = now; 32886 lodash.pad = pad; 32887 lodash.padEnd = padEnd; 32888 lodash.padStart = padStart; 32889 lodash.parseInt = parseInt; 32890 lodash.random = random; 32891 lodash.reduce = reduce; 32892 lodash.reduceRight = reduceRight; 32893 lodash.repeat = repeat; 32894 lodash.replace = replace; 32895 lodash.result = result; 32896 lodash.round = round; 32897 lodash.runInContext = runInContext; 32898 lodash.sample = sample; 32899 lodash.size = size; 32900 lodash.snakeCase = snakeCase; 32901 lodash.some = some; 32902 lodash.sortedIndex = sortedIndex; 32903 lodash.sortedIndexBy = sortedIndexBy; 32904 lodash.sortedIndexOf = sortedIndexOf; 32905 lodash.sortedLastIndex = sortedLastIndex; 32906 lodash.sortedLastIndexBy = sortedLastIndexBy; 32907 lodash.sortedLastIndexOf = sortedLastIndexOf; 32908 lodash.startCase = startCase; 32909 lodash.startsWith = startsWith; 32910 lodash.subtract = subtract; 32911 lodash.sum = sum; 32912 lodash.sumBy = sumBy; 32913 lodash.template = template; 32914 lodash.times = times; 32915 lodash.toFinite = toFinite; 32916 lodash.toInteger = toInteger; 32917 lodash.toLength = toLength; 32918 lodash.toLower = toLower; 32919 lodash.toNumber = toNumber; 32920 lodash.toSafeInteger = toSafeInteger; 32921 lodash.toString = toString; 32922 lodash.toUpper = toUpper; 32923 lodash.trim = trim; 32924 lodash.trimEnd = trimEnd; 32925 lodash.trimStart = trimStart; 32926 lodash.truncate = truncate; 32927 lodash.unescape = unescape; 32928 lodash.uniqueId = uniqueId; 32929 lodash.upperCase = upperCase; 32930 lodash.upperFirst = upperFirst; 32931 32932 // Add aliases. 32933 lodash.each = forEach; 32934 lodash.eachRight = forEachRight; 32935 lodash.first = head; 32936 32937 mixin(lodash, (function() { 32938 var source = {}; 32939 baseForOwn(lodash, function(func, methodName) { 32940 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 32941 source[methodName] = func; 32942 } 32943 }); 32944 return source; 32945 }()), { 'chain': false }); 32946 32947 /*------------------------------------------------------------------------*/ 32948 32949 /** 32950 * The semantic version number. 32951 * 32952 * @static 32953 * @memberOf _ 32954 * @type {string} 32955 */ 32956 lodash.VERSION = VERSION; 32957 32958 // Assign default placeholders. 32959 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 32960 lodash[methodName].placeholder = lodash; 32961 }); 32962 32963 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 32964 arrayEach(['drop', 'take'], function(methodName, index) { 32965 LazyWrapper.prototype[methodName] = function(n) { 32966 n = n === undefined ? 1 : nativeMax(toInteger(n), 0); 32967 32968 var result = (this.__filtered__ && !index) 32969 ? new LazyWrapper(this) 32970 : this.clone(); 32971 32972 if (result.__filtered__) { 32973 result.__takeCount__ = nativeMin(n, result.__takeCount__); 32974 } else { 32975 result.__views__.push({ 32976 'size': nativeMin(n, MAX_ARRAY_LENGTH), 32977 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') 32978 }); 32979 } 32980 return result; 32981 }; 32982 32983 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 32984 return this.reverse()[methodName](n).reverse(); 32985 }; 32986 }); 32987 32988 // Add `LazyWrapper` methods that accept an `iteratee` value. 32989 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 32990 var type = index + 1, 32991 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 32992 32993 LazyWrapper.prototype[methodName] = function(iteratee) { 32994 var result = this.clone(); 32995 result.__iteratees__.push({ 32996 'iteratee': getIteratee(iteratee, 3), 32997 'type': type 32998 }); 32999 result.__filtered__ = result.__filtered__ || isFilter; 33000 return result; 33001 }; 33002 }); 33003 33004 // Add `LazyWrapper` methods for `_.head` and `_.last`. 33005 arrayEach(['head', 'last'], function(methodName, index) { 33006 var takeName = 'take' + (index ? 'Right' : ''); 33007 33008 LazyWrapper.prototype[methodName] = function() { 33009 return this[takeName](1).value()[0]; 33010 }; 33011 }); 33012 33013 // Add `LazyWrapper` methods for `_.initial` and `_.tail`. 33014 arrayEach(['initial', 'tail'], function(methodName, index) { 33015 var dropName = 'drop' + (index ? '' : 'Right'); 33016 33017 LazyWrapper.prototype[methodName] = function() { 33018 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 33019 }; 33020 }); 33021 33022 LazyWrapper.prototype.compact = function() { 33023 return this.filter(identity); 33024 }; 33025 33026 LazyWrapper.prototype.find = function(predicate) { 33027 return this.filter(predicate).head(); 33028 }; 33029 33030 LazyWrapper.prototype.findLast = function(predicate) { 33031 return this.reverse().find(predicate); 33032 }; 33033 33034 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 33035 if (typeof path == 'function') { 33036 return new LazyWrapper(this); 33037 } 33038 return this.map(function(value) { 33039 return baseInvoke(value, path, args); 33040 }); 33041 }); 33042 33043 LazyWrapper.prototype.reject = function(predicate) { 33044 return this.filter(negate(getIteratee(predicate))); 33045 }; 33046 33047 LazyWrapper.prototype.slice = function(start, end) { 33048 start = toInteger(start); 33049 33050 var result = this; 33051 if (result.__filtered__ && (start > 0 || end < 0)) { 33052 return new LazyWrapper(result); 33053 } 33054 if (start < 0) { 33055 result = result.takeRight(-start); 33056 } else if (start) { 33057 result = result.drop(start); 33058 } 33059 if (end !== undefined) { 33060 end = toInteger(end); 33061 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 33062 } 33063 return result; 33064 }; 33065 33066 LazyWrapper.prototype.takeRightWhile = function(predicate) { 33067 return this.reverse().takeWhile(predicate).reverse(); 33068 }; 33069 33070 LazyWrapper.prototype.toArray = function() { 33071 return this.take(MAX_ARRAY_LENGTH); 33072 }; 33073 33074 // Add `LazyWrapper` methods to `lodash.prototype`. 33075 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 33076 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), 33077 isTaker = /^(?:head|last)$/.test(methodName), 33078 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], 33079 retUnwrapped = isTaker || /^find/.test(methodName); 33080 33081 if (!lodashFunc) { 33082 return; 33083 } 33084 lodash.prototype[methodName] = function() { 33085 var value = this.__wrapped__, 33086 args = isTaker ? [1] : arguments, 33087 isLazy = value instanceof LazyWrapper, 33088 iteratee = args[0], 33089 useLazy = isLazy || isArray(value); 33090 33091 var interceptor = function(value) { 33092 var result = lodashFunc.apply(lodash, arrayPush([value], args)); 33093 return (isTaker && chainAll) ? result[0] : result; 33094 }; 33095 33096 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { 33097 // Avoid lazy use if the iteratee has a "length" value other than `1`. 33098 isLazy = useLazy = false; 33099 } 33100 var chainAll = this.__chain__, 33101 isHybrid = !!this.__actions__.length, 33102 isUnwrapped = retUnwrapped && !chainAll, 33103 onlyLazy = isLazy && !isHybrid; 33104 33105 if (!retUnwrapped && useLazy) { 33106 value = onlyLazy ? value : new LazyWrapper(this); 33107 var result = func.apply(value, args); 33108 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); 33109 return new LodashWrapper(result, chainAll); 33110 } 33111 if (isUnwrapped && onlyLazy) { 33112 return func.apply(this, args); 33113 } 33114 result = this.thru(interceptor); 33115 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; 33116 }; 33117 }); 33118 33119 // Add `Array` methods to `lodash.prototype`. 33120 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 33121 var func = arrayProto[methodName], 33122 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 33123 retUnwrapped = /^(?:pop|shift)$/.test(methodName); 33124 33125 lodash.prototype[methodName] = function() { 33126 var args = arguments; 33127 if (retUnwrapped && !this.__chain__) { 33128 var value = this.value(); 33129 return func.apply(isArray(value) ? value : [], args); 33130 } 33131 return this[chainName](function(value) { 33132 return func.apply(isArray(value) ? value : [], args); 33133 }); 33134 }; 33135 }); 33136 33137 // Map minified method names to their real names. 33138 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 33139 var lodashFunc = lodash[methodName]; 33140 if (lodashFunc) { 33141 var key = lodashFunc.name + ''; 33142 if (!hasOwnProperty.call(realNames, key)) { 33143 realNames[key] = []; 33144 } 33145 realNames[key].push({ 'name': methodName, 'func': lodashFunc }); 33146 } 33147 }); 33148 33149 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 33150 'name': 'wrapper', 33151 'func': undefined 33152 }]; 33153 33154 // Add methods to `LazyWrapper`. 33155 LazyWrapper.prototype.clone = lazyClone; 33156 LazyWrapper.prototype.reverse = lazyReverse; 33157 LazyWrapper.prototype.value = lazyValue; 33158 33159 // Add chain sequence methods to the `lodash` wrapper. 33160 lodash.prototype.at = wrapperAt; 33161 lodash.prototype.chain = wrapperChain; 33162 lodash.prototype.commit = wrapperCommit; 33163 lodash.prototype.next = wrapperNext; 33164 lodash.prototype.plant = wrapperPlant; 33165 lodash.prototype.reverse = wrapperReverse; 33166 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 33167 33168 // Add lazy aliases. 33169 lodash.prototype.first = lodash.prototype.head; 33170 33171 if (symIterator) { 33172 lodash.prototype[symIterator] = wrapperToIterator; 33173 } 33174 return lodash; 33175 }); 33176 33177 /*--------------------------------------------------------------------------*/ 33178 33179 // Export lodash. 33180 var _ = runInContext(); 33181 33182 // Some AMD build optimizers, like r.js, check for condition patterns like: 33183 if (true) { 33184 // Expose Lodash on the global object to prevent errors when Lodash is 33185 // loaded by a script tag in the presence of an AMD loader. 33186 // See http://requirejs.org/docs/errors.html#mismatch for more details. 33187 // Use `_.noConflict` to remove Lodash from the global object. 33188 root._ = _; 33189 33190 // Define as an anonymous module so, through path mapping, it can be 33191 // referenced as the "underscore" module. 33192 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 33193 return _; 33194 }).call(exports, __webpack_require__, exports, module), 33195 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 33196 } 33197 // Check for `exports` after `define` in case a build optimizer adds it. 33198 else {} 33199}.call(this)); 33200 33201 33202/***/ }), 33203
vendor: 10,707 bytes, lines 33204-33219
33204/***/ "./node_modules/medium-zoom/dist/medium-zoom.esm.js": 33205/*!**********************************************************!*\ 33206 !*** ./node_modules/medium-zoom/dist/medium-zoom.esm.js ***! 33207 \**********************************************************/ 33208/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 33209 33210"use strict"; 33211__webpack_require__.r(__webpack_exports__); 33212/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33213/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33214/* harmony export */ }); 33215/*! medium-zoom 1.0.3 | MIT License | https://github.com/francoischalifour/medium-zoom */var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},isSupported=function(a){return'IMG'===a.tagName},isNodeList=function(a){return NodeList.prototype.isPrototypeOf(a)},isNode=function(a){return a&&1===a.nodeType},isSvg=function(a){var b=a.currentSrc||a.src;return'.svg'===b.substr(-4).toLowerCase()},getImagesFromSelector=function(a){try{return Array.isArray(a)?a.filter(isSupported):isNodeList(a)?[].slice.call(a).filter(isSupported):isNode(a)?[a].filter(isSupported):'string'==typeof a?[].slice.call(document.querySelectorAll(a)).filter(isSupported):[]}catch(a){throw new TypeError('The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom')}},createOverlay=function(a){var b=document.createElement('div');return b.classList.add('medium-zoom-overlay'),b.style.background=a,b},cloneTarget=function(a){var b=a.getBoundingClientRect(),c=b.top,d=b.left,e=b.width,f=b.height,g=a.cloneNode(),h=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return g.removeAttribute('id'),g.style.position='absolute',g.style.top=c+h+'px',g.style.left=d+i+'px',g.style.width=e+'px',g.style.height=f+'px',g.style.transform='',g},createCustomEvent=function(a,b){var c=_extends({bubbles:!1,cancelable:!1,detail:void 0},b);if('function'==typeof window.CustomEvent)return new CustomEvent(a,c);var d=document.createEvent('CustomEvent');return d.initCustomEvent(a,c.bubbles,c.cancelable,c.detail),d},Promise$1=window.Promise||function(a){function b(){}a(b,b)},mediumZoom=function a(b){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},d=function(a){var b=a.target;return b===w?void m():void(-1===q.indexOf(b)||n({target:b}))},e=function(){if(!s&&v.original){var a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(t-a)>u.scrollOffset&&setTimeout(m,150)}},f=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=a;if(a.background&&(w.style.background=a.background),a.container&&a.container instanceof Object&&(b.container=_extends({},u.container,a.container)),a.template){var c=isNode(a.template)?a.template:document.querySelector(a.template);b.template=c}return u=_extends({},u,b),q.forEach(function(a){a.dispatchEvent(createCustomEvent('medium-zoom:update',{detail:{zoom:x}}))}),x},g=function(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return a(_extends({},u,b))},h=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];var d=b.reduce(function(a,b){return[].concat(a,getImagesFromSelector(b))},[]);return d.filter(function(a){return-1===q.indexOf(a)}).forEach(function(a){q.push(a),a.classList.add('medium-zoom-image')}),r.forEach(function(a){var b=a.type,c=a.listener,e=a.options;d.forEach(function(a){a.addEventListener(b,c,e)})}),x},i=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];v.zoomed&&m();var d=0<b.length?b.reduce(function(a,b){return[].concat(a,getImagesFromSelector(b))},[]):q;return d.forEach(function(a){a.classList.remove('medium-zoom-image'),a.dispatchEvent(createCustomEvent('medium-zoom:detach',{detail:{zoom:x}}))}),q=q.filter(function(a){return-1===d.indexOf(a)}),x},j=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return q.forEach(function(d){d.addEventListener('medium-zoom:'+a,b,c)}),r.push({type:'medium-zoom:'+a,listener:b,options:c}),x},k=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return q.forEach(function(d){d.removeEventListener('medium-zoom:'+a,b,c)}),r=r.filter(function(c){return c.type!=='medium-zoom:'+a||c.listener.toString()!==b.toString()}),x},l=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.target,c=function(){var a=Math.min,b={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},c=void 0,d=void 0;if(u.container)if(u.container instanceof Object)b=_extends({},b,u.container),c=b.width-b.left-b.right-2*u.margin,d=b.height-b.top-b.bottom-2*u.margin;else{var e=isNode(u.container)?u.container:document.querySelector(u.container),f=e.getBoundingClientRect(),g=f.width,h=f.height,i=f.left,j=f.top;b=_extends({},b,{width:g,height:h,left:i,top:j})}c=c||b.width-2*u.margin,d=d||b.height-2*u.margin;var k=v.zoomedHd||v.original,l=isSvg(k)?c:k.naturalWidth||c,m=isSvg(k)?d:k.naturalHeight||d,n=k.getBoundingClientRect(),o=n.top,p=n.left,q=n.width,r=n.height,s=a(l,c)/q,t=a(m,d)/r,w=a(s,t),x=(-p+(c-q)/2+u.margin+b.left)/w,y=(-o+(d-r)/2+u.margin+b.top)/w,z='scale('+w+') translate3d('+x+'px, '+y+'px, 0)';v.zoomed.style.transform=z,v.zoomedHd&&(v.zoomedHd.style.transform=z)};return new Promise$1(function(a){if(b&&-1===q.indexOf(b))return void a(x);if(v.zoomed)return void a(x);if(b)v.original=b;else if(0<q.length){var d=q;v.original=d[0]}else return void a(x);if(v.original.dispatchEvent(createCustomEvent('medium-zoom:open',{detail:{zoom:x}})),t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,s=!0,v.zoomed=cloneTarget(v.original),document.body.appendChild(w),u.template){var e=isNode(u.template)?u.template:document.querySelector(u.template);v.template=document.createElement('div'),v.template.appendChild(e.content.cloneNode(!0)),document.body.appendChild(v.template)}if(document.body.appendChild(v.zoomed),window.requestAnimationFrame(function(){document.body.classList.add('medium-zoom--opened')}),v.original.classList.add('medium-zoom-image--hidden'),v.zoomed.classList.add('medium-zoom-image--opened'),v.zoomed.addEventListener('click',m),v.zoomed.addEventListener('transitionend',function b(){s=!1,v.zoomed.removeEventListener('transitionend',b),v.original.dispatchEvent(createCustomEvent('medium-zoom:opened',{detail:{zoom:x}})),a(x)}),v.original.getAttribute('data-zoom-src')){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute('srcset'),v.zoomedHd.removeAttribute('sizes'),v.zoomedHd.src=v.zoomed.getAttribute('data-zoom-src'),v.zoomedHd.onerror=function(){clearInterval(f),console.warn('Unable to reach the zoom image target '+v.zoomedHd.src),v.zoomedHd=null,c()};var f=setInterval(function(){v.zoomedHd.complete&&(clearInterval(f),v.zoomedHd.classList.add('medium-zoom-image--opened'),v.zoomedHd.addEventListener('click',m),document.body.appendChild(v.zoomedHd),c())},10)}else if(v.original.hasAttribute('srcset')){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute('sizes');var g=v.zoomedHd.addEventListener('load',function(){v.zoomedHd.removeEventListener('load',g),v.zoomedHd.classList.add('medium-zoom-image--opened'),v.zoomedHd.addEventListener('click',m),document.body.appendChild(v.zoomedHd),c()})}else c()})},m=function(){return new Promise$1(function(a){if(s||!v.original)return void a(x);s=!0,document.body.classList.remove('medium-zoom--opened'),v.zoomed.style.transform='',v.zoomedHd&&(v.zoomedHd.style.transform=''),v.template&&(v.template.style.transition='opacity 150ms',v.template.style.opacity=0),v.original.dispatchEvent(createCustomEvent('medium-zoom:close',{detail:{zoom:x}})),v.zoomed.addEventListener('transitionend',function b(){v.original.classList.remove('medium-zoom-image--hidden'),document.body.removeChild(v.zoomed),v.zoomedHd&&document.body.removeChild(v.zoomedHd),document.body.removeChild(w),v.zoomed.classList.remove('medium-zoom-image--opened'),v.template&&document.body.removeChild(v.template),s=!1,v.zoomed.removeEventListener('transitionend',b),v.original.dispatchEvent(createCustomEvent('medium-zoom:closed',{detail:{zoom:x}})),v.original=null,v.zoomed=null,v.zoomedHd=null,v.template=null,a(x)})})},n=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.target;return v.original?m():l({target:b})},o=function(){return u},p=function(){return q},q=[],r=[],s=!1,t=0,u=c,v={original:null,zoomed:null,zoomedHd:null,template:null};'[object Object]'===Object.prototype.toString.call(b)?u=b:(b||'string'==typeof b)&&h(b),u=_extends({margin:0,background:'#fff',scrollOffset:40,container:null,template:null},u);var w=createOverlay(u.background);document.addEventListener('click',d),document.addEventListener('keyup',function(a){27===(a.keyCode||a.which)&&m()}),document.addEventListener('scroll',e),window.addEventListener('resize',m);var x={open:l,close:m,toggle:n,update:f,clone:g,attach:h,detach:i,on:j,off:k,getOptions:o,getImages:p,getZoomedImage:function(){return v.original}};return x};function styleInject(a,b){void 0===b&&(b={});var c=b.insertAt;if(a&&'undefined'!=typeof document){var d=document.head||document.getElementsByTagName('head')[0],e=document.createElement('style');e.type='text/css','top'===c?d.firstChild?d.insertBefore(e,d.firstChild):d.appendChild(e):d.appendChild(e),e.styleSheet?e.styleSheet.cssText=a:e.appendChild(document.createTextNode(a))}}var css='.medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}';styleInject('.medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}');/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mediumZoom); 33216 33217 33218/***/ }), 33219
33220/***/ "./user/themes/enormail/scss/main.scss": 33221/*!*********************************************!*\ 33222 !*** ./user/themes/enormail/scss/main.scss ***! 33223 \*********************************************/ 33224/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 33225 33226"use strict"; 33227__webpack_require__.r(__webpack_exports__); 33228// extracted by mini-css-extract-plugin 33229 33230 33231/***/ }), 33232
vendor: 5,636 bytes, lines 33233-33426
33233/***/ "./node_modules/process/browser.js": 33234/*!*****************************************!*\ 33235 !*** ./node_modules/process/browser.js ***! 33236 \*****************************************/ 33237/***/ ((module) => { 33238 33239// shim for using process in browser 33240var process = module.exports = {}; 33241 33242// cached from whatever global is present so that test runners that stub it 33243// don't break things. But we need to wrap it in a try catch in case it is 33244// wrapped in strict mode code which doesn't define any globals. It's inside a 33245// function because try/catches deoptimize in certain engines. 33246 33247var cachedSetTimeout; 33248var cachedClearTimeout; 33249 33250function defaultSetTimout() { 33251 throw new Error('setTimeout has not been defined'); 33252} 33253function defaultClearTimeout () { 33254 throw new Error('clearTimeout has not been defined'); 33255} 33256(function () { 33257 try { 33258 if (typeof setTimeout === 'function') { 33259 cachedSetTimeout = setTimeout; 33260 } else { 33261 cachedSetTimeout = defaultSetTimout; 33262 } 33263 } catch (e) { 33264 cachedSetTimeout = defaultSetTimout; 33265 } 33266 try { 33267 if (typeof clearTimeout === 'function') { 33268 cachedClearTimeout = clearTimeout; 33269 } else { 33270 cachedClearTimeout = defaultClearTimeout; 33271 } 33272 } catch (e) { 33273 cachedClearTimeout = defaultClearTimeout; 33274 } 33275} ()) 33276function runTimeout(fun) { 33277 if (cachedSetTimeout === setTimeout) { 33278 //normal enviroments in sane situations 33279 return setTimeout(fun, 0); 33280 } 33281 // if setTimeout wasn't available but was latter defined 33282 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 33283 cachedSetTimeout = setTimeout; 33284 return setTimeout(fun, 0); 33285 } 33286 try { 33287 // when when somebody has screwed with setTimeout but no I.E. maddness 33288 return cachedSetTimeout(fun, 0); 33289 } catch(e){ 33290 try { 33291 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 33292 return cachedSetTimeout.call(null, fun, 0); 33293 } catch(e){ 33294 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 33295 return cachedSetTimeout.call(this, fun, 0); 33296 } 33297 } 33298 33299 33300} 33301function runClearTimeout(marker) { 33302 if (cachedClearTimeout === clearTimeout) { 33303 //normal enviroments in sane situations 33304 return clearTimeout(marker); 33305 } 33306 // if clearTimeout wasn't available but was latter defined 33307 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 33308 cachedClearTimeout = clearTimeout; 33309 return clearTimeout(marker); 33310 } 33311 try { 33312 // when when somebody has screwed with setTimeout but no I.E. maddness 33313 return cachedClearTimeout(marker); 33314 } catch (e){ 33315 try { 33316 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 33317 return cachedClearTimeout.call(null, marker); 33318 } catch (e){ 33319 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 33320 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 33321 return cachedClearTimeout.call(this, marker); 33322 } 33323 } 33324 33325 33326 33327} 33328var queue = []; 33329var draining = false; 33330var currentQueue; 33331var queueIndex = -1; 33332 33333function cleanUpNextTick() { 33334 if (!draining || !currentQueue) { 33335 return; 33336 } 33337 draining = false; 33338 if (currentQueue.length) { 33339 queue = currentQueue.concat(queue); 33340 } else { 33341 queueIndex = -1; 33342 } 33343 if (queue.length) { 33344 drainQueue(); 33345 } 33346} 33347 33348function drainQueue() { 33349 if (draining) { 33350 return; 33351 } 33352 var timeout = runTimeout(cleanUpNextTick); 33353 draining = true; 33354 33355 var len = queue.length; 33356 while(len) { 33357 currentQueue = queue; 33358 queue = []; 33359 while (++queueIndex < len) { 33360 if (currentQueue) { 33361 currentQueue[queueIndex].run(); 33362 } 33363 } 33364 queueIndex = -1; 33365 len = queue.length; 33366 } 33367 currentQueue = null; 33368 draining = false; 33369 runClearTimeout(timeout); 33370} 33371 33372process.nextTick = function (fun) { 33373 var args = new Array(arguments.length - 1); 33374 if (arguments.length > 1) { 33375 for (var i = 1; i < arguments.length; i++) { 33376 args[i - 1] = arguments[i]; 33377 } 33378 } 33379 queue.push(new Item(fun, args)); 33380 if (queue.length === 1 && !draining) { 33381 runTimeout(drainQueue); 33382 } 33383}; 33384 33385// v8 likes predictible objects 33386function Item(fun, array) { 33387 this.fun = fun; 33388 this.array = array; 33389} 33390Item.prototype.run = function () { 33391 this.fun.apply(null, this.array); 33392}; 33393process.title = 'browser'; 33394process.browser = true; 33395process.env = {}; 33396process.argv = []; 33397process.version = ''; // empty string to avoid regexp issues 33398process.versions = {}; 33399 33400function noop() {} 33401 33402process.on = noop; 33403process.addListener = noop; 33404process.once = noop; 33405process.off = noop; 33406process.removeListener = noop; 33407process.removeAllListeners = noop; 33408process.emit = noop; 33409process.prependListener = noop; 33410process.prependOnceListener = noop; 33411 33412process.listeners = function (name) { return [] } 33413 33414process.binding = function (name) { 33415 throw new Error('process.binding is not supported'); 33416}; 33417 33418process.cwd = function () { return '/' }; 33419process.chdir = function (dir) { 33420 throw new Error('process.chdir is not supported'); 33421}; 33422process.umask = function() { return 0; }; 33423 33424 33425/***/ }), 33426
vendor: 18,609 bytes, lines 33427-33931
33427/***/ "./node_modules/rangeslider.js/dist/rangeslider.js": 33428/*!*********************************************************!*\ 33429 !*** ./node_modules/rangeslider.js/dist/rangeslider.js ***! 33430 \*********************************************************/ 33431/***/ ((module, exports, __webpack_require__) => { 33432 33433var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */ 33434(function(factory) { 33435 'use strict'; 33436 33437 if (true) { 33438 // AMD. Register as an anonymous module. 33439 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 33440 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 33441 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 33442 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 33443 } else {} 33444}(function($) { 33445 'use strict'; 33446 33447 // Polyfill Number.isNaN(value) 33448 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN 33449 Number.isNaN = Number.isNaN || function(value) { 33450 return typeof value === 'number' && value !== value; 33451 }; 33452 33453 /** 33454 * Range feature detection 33455 * @return {Boolean} 33456 */ 33457 function supportsRange() { 33458 var input = document.createElement('input'); 33459 input.setAttribute('type', 'range'); 33460 return input.type !== 'text'; 33461 } 33462 33463 var pluginName = 'rangeslider', 33464 pluginIdentifier = 0, 33465 hasInputRangeSupport = supportsRange(), 33466 defaults = { 33467 polyfill: true, 33468 orientation: 'horizontal', 33469 rangeClass: 'rangeslider', 33470 disabledClass: 'rangeslider--disabled', 33471 activeClass: 'rangeslider--active', 33472 horizontalClass: 'rangeslider--horizontal', 33473 verticalClass: 'rangeslider--vertical', 33474 fillClass: 'rangeslider__fill', 33475 handleClass: 'rangeslider__handle', 33476 startEvent: ['mousedown', 'touchstart', 'pointerdown'], 33477 moveEvent: ['mousemove', 'touchmove', 'pointermove'], 33478 endEvent: ['mouseup', 'touchend', 'pointerup'] 33479 }, 33480 constants = { 33481 orientation: { 33482 horizontal: { 33483 dimension: 'width', 33484 direction: 'left', 33485 directionStyle: 'left', 33486 coordinate: 'x' 33487 }, 33488 vertical: { 33489 dimension: 'height', 33490 direction: 'top', 33491 directionStyle: 'bottom', 33492 coordinate: 'y' 33493 } 33494 } 33495 }; 33496 33497 /** 33498 * Delays a function for the given number of milliseconds, and then calls 33499 * it with the arguments supplied. 33500 * 33501 * @param {Function} fn [description] 33502 * @param {Number} wait [description] 33503 * @return {Function} 33504 */ 33505 function delay(fn, wait) { 33506 var args = Array.prototype.slice.call(arguments, 2); 33507 return setTimeout(function(){ return fn.apply(null, args); }, wait); 33508 } 33509 33510 /** 33511 * Returns a debounced function that will make sure the given 33512 * function is not triggered too much. 33513 * 33514 * @param {Function} fn Function to debounce. 33515 * @param {Number} debounceDuration OPTIONAL. The amount of time in milliseconds for which we will debounce the function. (defaults to 100ms) 33516 * @return {Function} 33517 */ 33518 function debounce(fn, debounceDuration) { 33519 debounceDuration = debounceDuration || 100; 33520 return function() { 33521 if (!fn.debouncing) { 33522 var args = Array.prototype.slice.apply(arguments); 33523 fn.lastReturnVal = fn.apply(window, args); 33524 fn.debouncing = true; 33525 } 33526 clearTimeout(fn.debounceTimeout); 33527 fn.debounceTimeout = setTimeout(function(){ 33528 fn.debouncing = false; 33529 }, debounceDuration); 33530 return fn.lastReturnVal; 33531 }; 33532 } 33533 33534 /** 33535 * Check if a `element` is visible in the DOM 33536 * 33537 * @param {Element} element 33538 * @return {Boolean} 33539 */ 33540 function isHidden(element) { 33541 return ( 33542 element && ( 33543 element.offsetWidth === 0 || 33544 element.offsetHeight === 0 || 33545 // Also Consider native `<details>` elements. 33546 element.open === false 33547 ) 33548 ); 33549 } 33550 33551 /** 33552 * Get hidden parentNodes of an `element` 33553 * 33554 * @param {Element} element 33555 * @return {[type]} 33556 */ 33557 function getHiddenParentNodes(element) { 33558 var parents = [], 33559 node = element.parentNode; 33560 33561 while (isHidden(node)) { 33562 parents.push(node); 33563 node = node.parentNode; 33564 } 33565 return parents; 33566 } 33567 33568 /** 33569 * Returns dimensions for an element even if it is not visible in the DOM. 33570 * 33571 * @param {Element} element 33572 * @param {String} key (e.g. offsetWidth …) 33573 * @return {Number} 33574 */ 33575 function getDimension(element, key) { 33576 var hiddenParentNodes = getHiddenParentNodes(element), 33577 hiddenParentNodesLength = hiddenParentNodes.length, 33578 inlineStyle = [], 33579 dimension = element[key]; 33580 33581 // Used for native `<details>` elements 33582 function toggleOpenProperty(element) { 33583 if (typeof element.open !== 'undefined') { 33584 element.open = (element.open) ? false : true; 33585 } 33586 } 33587 33588 if (hiddenParentNodesLength) { 33589 for (var i = 0; i < hiddenParentNodesLength; i++) { 33590 33591 // Cache style attribute to restore it later. 33592 inlineStyle[i] = hiddenParentNodes[i].style.cssText; 33593 33594 // visually hide 33595 if (hiddenParentNodes[i].style.setProperty) { 33596 hiddenParentNodes[i].style.setProperty('display', 'block', 'important'); 33597 } else { 33598 hiddenParentNodes[i].style.cssText += ';display: block !important'; 33599 } 33600 hiddenParentNodes[i].style.height = '0'; 33601 hiddenParentNodes[i].style.overflow = 'hidden'; 33602 hiddenParentNodes[i].style.visibility = 'hidden'; 33603 toggleOpenProperty(hiddenParentNodes[i]); 33604 } 33605 33606 // Update dimension 33607 dimension = element[key]; 33608 33609 for (var j = 0; j < hiddenParentNodesLength; j++) { 33610 33611 // Restore the style attribute 33612 hiddenParentNodes[j].style.cssText = inlineStyle[j]; 33613 toggleOpenProperty(hiddenParentNodes[j]); 33614 } 33615 } 33616 return dimension; 33617 } 33618 33619 /** 33620 * Returns the parsed float or the default if it failed. 33621 * 33622 * @param {String} str 33623 * @param {Number} defaultValue 33624 * @return {Number} 33625 */ 33626 function tryParseFloat(str, defaultValue) { 33627 var value = parseFloat(str); 33628 return Number.isNaN(value) ? defaultValue : value; 33629 } 33630 33631 /** 33632 * Capitalize the first letter of string 33633 * 33634 * @param {String} str 33635 * @return {String} 33636 */ 33637 function ucfirst(str) { 33638 return str.charAt(0).toUpperCase() + str.substr(1); 33639 } 33640 33641 /** 33642 * Plugin 33643 * @param {String} element 33644 * @param {Object} options 33645 */ 33646 function Plugin(element, options) { 33647 this.$window = $(window); 33648 this.$document = $(document); 33649 this.$element = $(element); 33650 this.options = $.extend( {}, defaults, options ); 33651 this.polyfill = this.options.polyfill; 33652 this.orientation = this.$element[0].getAttribute('data-orientation') || this.options.orientation; 33653 this.onInit = this.options.onInit; 33654 this.onSlide = this.options.onSlide; 33655 this.onSlideEnd = this.options.onSlideEnd; 33656 this.DIMENSION = constants.orientation[this.orientation].dimension; 33657 this.DIRECTION = constants.orientation[this.orientation].direction; 33658 this.DIRECTION_STYLE = constants.orientation[this.orientation].directionStyle; 33659 this.COORDINATE = constants.orientation[this.orientation].coordinate; 33660 33661 // Plugin should only be used as a polyfill 33662 if (this.polyfill) { 33663 // Input range support? 33664 if (hasInputRangeSupport) { return false; } 33665 } 33666 33667 this.identifier = 'js-' + pluginName + '-' +(pluginIdentifier++); 33668 this.startEvent = this.options.startEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 33669 this.moveEvent = this.options.moveEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 33670 this.endEvent = this.options.endEvent.join('.' + this.identifier + ' ') + '.' + this.identifier; 33671 this.toFixed = (this.step + '').replace('.', '').length - 1; 33672 this.$fill = $('<div class="' + this.options.fillClass + '" />'); 33673 this.$handle = $('<div class="' + this.options.handleClass + '" />'); 33674 this.$range = $('<div class="' + this.options.rangeClass + ' ' + this.options[this.orientation + 'Class'] + '" id="' + this.identifier + '" />').insertAfter(this.$element).prepend(this.$fill, this.$handle); 33675 33676 // visually hide the input 33677 this.$element.css({ 33678 'position': 'absolute', 33679 'width': '1px', 33680 'height': '1px', 33681 'overflow': 'hidden', 33682 'opacity': '0' 33683 }); 33684 33685 // Store context 33686 this.handleDown = $.proxy(this.handleDown, this); 33687 this.handleMove = $.proxy(this.handleMove, this); 33688 this.handleEnd = $.proxy(this.handleEnd, this); 33689 33690 this.init(); 33691 33692 // Attach Events 33693 var _this = this; 33694 this.$window.on('resize.' + this.identifier, debounce(function() { 33695 // Simulate resizeEnd event. 33696 delay(function() { _this.update(false, false); }, 300); 33697 }, 20)); 33698 33699 this.$document.on(this.startEvent, '#' + this.identifier + ':not(.' + this.options.disabledClass + ')', this.handleDown); 33700 33701 // Listen to programmatic value changes 33702 this.$element.on('change.' + this.identifier, function(e, data) { 33703 if (data && data.origin === _this.identifier) { 33704 return; 33705 } 33706 33707 var value = e.target.value, 33708 pos = _this.getPositionFromValue(value); 33709 _this.setPosition(pos); 33710 }); 33711 } 33712 33713 Plugin.prototype.init = function() { 33714 this.update(true, false); 33715 33716 if (this.onInit && typeof this.onInit === 'function') { 33717 this.onInit(); 33718 } 33719 }; 33720 33721 Plugin.prototype.update = function(updateAttributes, triggerSlide) { 33722 updateAttributes = updateAttributes || false; 33723 33724 if (updateAttributes) { 33725 this.min = tryParseFloat(this.$element[0].getAttribute('min'), 0); 33726 this.max = tryParseFloat(this.$element[0].getAttribute('max'), 100); 33727 this.value = tryParseFloat(this.$element[0].value, Math.round(this.min + (this.max-this.min)/2)); 33728 this.step = tryParseFloat(this.$element[0].getAttribute('step'), 1); 33729 } 33730 33731 this.handleDimension = getDimension(this.$handle[0], 'offset' + ucfirst(this.DIMENSION)); 33732 this.rangeDimension = getDimension(this.$range[0], 'offset' + ucfirst(this.DIMENSION)); 33733 this.maxHandlePos = this.rangeDimension - this.handleDimension; 33734 this.grabPos = this.handleDimension / 2; 33735 this.position = this.getPositionFromValue(this.value); 33736 33737 // Consider disabled state 33738 if (this.$element[0].disabled) { 33739 this.$range.addClass(this.options.disabledClass); 33740 } else { 33741 this.$range.removeClass(this.options.disabledClass); 33742 } 33743 33744 this.setPosition(this.position, triggerSlide); 33745 }; 33746 33747 Plugin.prototype.handleDown = function(e) { 33748 e.preventDefault(); 33749 33750 // Only respond to mouse main button clicks (usually the left button) 33751 if (e.button && e.button !== 0) { return; } 33752 33753 this.$document.on(this.moveEvent, this.handleMove); 33754 this.$document.on(this.endEvent, this.handleEnd); 33755 33756 // add active class because Firefox is ignoring 33757 // the handle:active pseudo selector because of `e.preventDefault();` 33758 this.$range.addClass(this.options.activeClass); 33759 33760 // If we click on the handle don't set the new position 33761 if ((' ' + e.target.className + ' ').replace(/[\n\t]/g, ' ').indexOf(this.options.handleClass) > -1) { 33762 return; 33763 } 33764 33765 var pos = this.getRelativePosition(e), 33766 rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION], 33767 handlePos = this.getPositionFromNode(this.$handle[0]) - rangePos, 33768 setPos = (this.orientation === 'vertical') ? (this.maxHandlePos - (pos - this.grabPos)) : (pos - this.grabPos); 33769 33770 this.setPosition(setPos); 33771 33772 if (pos >= handlePos && pos < handlePos + this.handleDimension) { 33773 this.grabPos = pos - handlePos; 33774 } 33775 }; 33776 33777 Plugin.prototype.handleMove = function(e) { 33778 e.preventDefault(); 33779 var pos = this.getRelativePosition(e); 33780 var setPos = (this.orientation === 'vertical') ? (this.maxHandlePos - (pos - this.grabPos)) : (pos - this.grabPos); 33781 this.setPosition(setPos); 33782 }; 33783 33784 Plugin.prototype.handleEnd = function(e) { 33785 e.preventDefault(); 33786 this.$document.off(this.moveEvent, this.handleMove); 33787 this.$document.off(this.endEvent, this.handleEnd); 33788 33789 this.$range.removeClass(this.options.activeClass); 33790 33791 // Ok we're done fire the change event 33792 this.$element.trigger('change', { origin: this.identifier }); 33793 33794 if (this.onSlideEnd && typeof this.onSlideEnd === 'function') { 33795 this.onSlideEnd(this.position, this.value); 33796 } 33797 }; 33798 33799 Plugin.prototype.cap = function(pos, min, max) { 33800 if (pos < min) { return min; } 33801 if (pos > max) { return max; } 33802 return pos; 33803 }; 33804 33805 Plugin.prototype.setPosition = function(pos, triggerSlide) { 33806 var value, newPos; 33807 33808 if (triggerSlide === undefined) { 33809 triggerSlide = true; 33810 } 33811 33812 // Snapping steps 33813 value = this.getValueFromPosition(this.cap(pos, 0, this.maxHandlePos)); 33814 newPos = this.getPositionFromValue(value); 33815 33816 // Update ui 33817 this.$fill[0].style[this.DIMENSION] = (newPos + this.grabPos) + 'px'; 33818 this.$handle[0].style[this.DIRECTION_STYLE] = newPos + 'px'; 33819 this.setValue(value); 33820 33821 // Update globals 33822 this.position = newPos; 33823 this.value = value; 33824 33825 if (triggerSlide && this.onSlide && typeof this.onSlide === 'function') { 33826 this.onSlide(newPos, value); 33827 } 33828 }; 33829 33830 // Returns element position relative to the parent 33831 Plugin.prototype.getPositionFromNode = function(node) { 33832 var i = 0; 33833 while (node !== null) { 33834 i += node.offsetLeft; 33835 node = node.offsetParent; 33836 } 33837 return i; 33838 }; 33839 33840 Plugin.prototype.getRelativePosition = function(e) { 33841 // Get the offset DIRECTION relative to the viewport 33842 var ucCoordinate = ucfirst(this.COORDINATE), 33843 rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION], 33844 pageCoordinate = 0; 33845 33846 if (typeof e.originalEvent['client' + ucCoordinate] !== 'undefined') { 33847 pageCoordinate = e.originalEvent['client' + ucCoordinate]; 33848 } 33849 else if ( 33850 e.originalEvent.touches && 33851 e.originalEvent.touches[0] && 33852 typeof e.originalEvent.touches[0]['client' + ucCoordinate] !== 'undefined' 33853 ) { 33854 pageCoordinate = e.originalEvent.touches[0]['client' + ucCoordinate]; 33855 } 33856 else if(e.currentPoint && typeof e.currentPoint[this.COORDINATE] !== 'undefined') { 33857 pageCoordinate = e.currentPoint[this.COORDINATE]; 33858 } 33859 33860 return pageCoordinate - rangePos; 33861 }; 33862 33863 Plugin.prototype.getPositionFromValue = function(value) { 33864 var percentage, pos; 33865 percentage = (value - this.min)/(this.max - this.min); 33866 pos = (!Number.isNaN(percentage)) ? percentage * this.maxHandlePos : 0; 33867 return pos; 33868 }; 33869 33870 Plugin.prototype.getValueFromPosition = function(pos) { 33871 var percentage, value; 33872 percentage = ((pos) / (this.maxHandlePos || 1)); 33873 value = this.step * Math.round(percentage * (this.max - this.min) / this.step) + this.min; 33874 return Number((value).toFixed(this.toFixed)); 33875 }; 33876 33877 Plugin.prototype.setValue = function(value) { 33878 if (value === this.value && this.$element[0].value !== '') { 33879 return; 33880 } 33881 33882 // Set the new value and fire the `input` event 33883 this.$element 33884 .val(value) 33885 .trigger('input', { origin: this.identifier }); 33886 }; 33887 33888 Plugin.prototype.destroy = function() { 33889 this.$document.off('.' + this.identifier); 33890 this.$window.off('.' + this.identifier); 33891 33892 this.$element 33893 .off('.' + this.identifier) 33894 .removeAttr('style') 33895 .removeData('plugin_' + pluginName); 33896 33897 // Remove the generated markup 33898 if (this.$range && this.$range.length) { 33899 this.$range[0].parentNode.removeChild(this.$range[0]); 33900 } 33901 }; 33902 33903 // A really lightweight plugin wrapper around the constructor, 33904 // preventing against multiple instantiations 33905 $.fn[pluginName] = function(options) { 33906 var args = Array.prototype.slice.call(arguments, 1); 33907 33908 return this.each(function() { 33909 var $this = $(this), 33910 data = $this.data('plugin_' + pluginName); 33911 33912 // Create a new instance. 33913 if (!data) { 33914 $this.data('plugin_' + pluginName, (data = new Plugin(this, options))); 33915 } 33916 33917 // Make it possible to access methods from public. 33918 // e.g `$element.rangeslider('method');` 33919 if (typeof options === 'string') { 33920 data[options].apply(data, args); 33921 } 33922 }); 33923 }; 33924 33925 return 'rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);'; 33926 33927})); 33928 33929 33930/***/ }), 33931
33932/***/ "./user/themes/enormail/js/components/MiniSlider.vue": 33933/*!***********************************************************!*\ 33934 !*** ./user/themes/enormail/js/components/MiniSlider.vue ***! 33935 \***********************************************************/ 33936/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 33937 33938"use strict"; 33939__webpack_require__.r(__webpack_exports__); 33940/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33941/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33942/* harmony export */ }); 33943/* harmony import */ var _MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MiniSlider.vue?vue&type=template&id=2db91438& */ "./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438&"); 33944/* harmony import */ var _MiniSlider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MiniSlider.vue?vue&type=script&lang=js& */ "./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js&"); 33945/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 33946 33947 33948 33949 33950 33951/* normalize component */ 33952; 33953var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 33954 _MiniSlider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 33955 _MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__.render, 33956 _MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, 33957 false, 33958 null, 33959 null, 33960 null 33961 33962) 33963 33964/* hot reload */ 33965if (false) { var api; } 33966component.options.__file = "user/themes/enormail/js/components/MiniSlider.vue" 33967/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); 33968 33969/***/ }), 33970
33971/***/ "./user/themes/enormail/js/components/Pricing.vue": 33972/*!********************************************************!*\ 33973 !*** ./user/themes/enormail/js/components/Pricing.vue ***! 33974 \********************************************************/ 33975/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 33976 33977"use strict"; 33978__webpack_require__.r(__webpack_exports__); 33979/* harmony export */ __webpack_require__.d(__webpack_exports__, { 33980/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 33981/* harmony export */ }); 33982/* harmony import */ var _Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pricing.vue?vue&type=template&id=5dd62ad6& */ "./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6&"); 33983/* harmony import */ var _Pricing_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Pricing.vue?vue&type=script&lang=js& */ "./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js&"); 33984/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 33985 33986 33987 33988 33989 33990/* normalize component */ 33991; 33992var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 33993 _Pricing_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 33994 _Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__.render, 33995 _Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, 33996 false, 33997 null, 33998 null, 33999 null 34000 34001) 34002 34003/* hot reload */ 34004if (false) { var api; } 34005component.options.__file = "user/themes/enormail/js/components/Pricing.vue" 34006/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); 34007 34008/***/ }), 34009
34010/***/ "./user/themes/enormail/js/components/ScrollTrigger.vue": 34011/*!**************************************************************!*\ 34012 !*** ./user/themes/enormail/js/components/ScrollTrigger.vue ***! 34013 \**************************************************************/ 34014/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34015 34016"use strict"; 34017__webpack_require__.r(__webpack_exports__); 34018/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34019/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34020/* harmony export */ }); 34021/* harmony import */ var _ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ScrollTrigger.vue?vue&type=template&id=16798cbb& */ "./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb&"); 34022/* harmony import */ var _ScrollTrigger_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ScrollTrigger.vue?vue&type=script&lang=js& */ "./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js&"); 34023/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 34024 34025 34026 34027 34028 34029/* normalize component */ 34030; 34031var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 34032 _ScrollTrigger_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 34033 _ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__.render, 34034 _ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, 34035 false, 34036 null, 34037 null, 34038 null 34039 34040) 34041 34042/* hot reload */ 34043if (false) { var api; } 34044component.options.__file = "user/themes/enormail/js/components/ScrollTrigger.vue" 34045/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); 34046 34047/***/ }), 34048
34049/***/ "./user/themes/enormail/js/components/Slider.vue": 34050/*!*******************************************************!*\ 34051 !*** ./user/themes/enormail/js/components/Slider.vue ***! 34052 \*******************************************************/ 34053/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34054 34055"use strict"; 34056__webpack_require__.r(__webpack_exports__); 34057/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34058/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34059/* harmony export */ }); 34060/* harmony import */ var _Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Slider.vue?vue&type=template&id=41e65881& */ "./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881&"); 34061/* harmony import */ var _Slider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Slider.vue?vue&type=script&lang=js& */ "./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js&"); 34062/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 34063 34064 34065 34066 34067 34068/* normalize component */ 34069; 34070var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 34071 _Slider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 34072 _Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__.render, 34073 _Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, 34074 false, 34075 null, 34076 null, 34077 null 34078 34079) 34080 34081/* hot reload */ 34082if (false) { var api; } 34083component.options.__file = "user/themes/enormail/js/components/Slider.vue" 34084/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); 34085 34086/***/ }), 34087 34088/***/ "./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js&": 34089/*!************************************************************************************!*\ 34090 !*** ./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js& ***! 34091 \************************************************************************************/ 34092/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34093 34094"use strict"; 34095__webpack_require__.r(__webpack_exports__); 34096/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34097/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34098/* harmony export */ }); 34099/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniSlider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MiniSlider.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=script&lang=js&"); 34100 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniSlider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 34101 34102/***/ }), 34103 34104/***/ "./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js&": 34105/*!*********************************************************************************!*\ 34106 !*** ./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js& ***! 34107 \*********************************************************************************/ 34108/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34109 34110"use strict"; 34111__webpack_require__.r(__webpack_exports__); 34112/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34113/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34114/* harmony export */ }); 34115/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_
341150_node_modules_vue_loader_lib_index_js_vue_loader_options_Pricing_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Pricing.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=script&lang=js&"); 34116 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pricing_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 34117 34118/***/ }), 34119 34120/***/ "./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js&": 34121/*!***************************************************************************************!*\ 34122 !*** ./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js& ***! 34123 \***************************************************************************************/ 34124/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34125 34126"use strict"; 34127__webpack_require__.r(__webpack_exports__); 34128/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34129/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34130/* harmony export */ }); 34131/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScrollTrigger_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ScrollTrigger.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=script&lang=js&"); 34132 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScrollTrigger_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 34133 34134/***/ }), 34135 34136/***/ "./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js&": 34137/*!********************************************************************************!*\ 34138 !*** ./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js& ***! 34139 \********************************************************************************/ 34140/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34141 34142"use strict"; 34143__webpack_require__.r(__webpack_exports__); 34144/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34145/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34146/* harmony export */ }); 34147/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Slider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Slider.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=script&lang=js&"); 34148 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Slider_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 34149 34150/***/ }), 34151 34152/***/ "./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438&": 34153/*!******************************************************************************************!*\ 34154 !*** ./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438& ***! 34155 \******************************************************************************************/ 34156/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34157 34158"use strict"; 34159__webpack_require__.r(__webpack_exports__); 34160/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34161/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__.render), 34162/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) 34163/* harmony export */ }); 34164/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniSlider_vue_vue_type_template_id_2db91438___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MiniSlider.vue?vue&type=template&id=2db91438& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438&"); 34165 34166 34167/***/ }), 34168 34169/***/ "./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6&": 34170/*!***************************************************************************************!*\ 34171 !*** ./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6& ***! 34172 \***************************************************************************************/ 34173/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34174 34175"use strict"; 34176__webpack_require__.r(__webpack_exports__); 34177/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34178/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__.render), 34179/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) 34180/* harmony export */ }); 34181/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Pricing_vue_vue_type_template_id_5dd62ad6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Pricing.vue?vue&type=template&id=5dd62ad6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6&"); 34182 34183
34184/***/ }), 34185 34186/***/ "./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb&": 34187/*!*********************************************************************************************!*\ 34188 !*** ./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb& ***! 34189 \*********************************************************************************************/ 34190/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34191 34192"use strict"; 34193__webpack_require__.r(__webpack_exports__); 34194/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34195/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__.render), 34196/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) 34197/* harmony export */ }); 34198/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ScrollTrigger_vue_vue_type_template_id_16798cbb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ScrollTrigger.vue?vue&type=template&id=16798cbb& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb&"); 34199 34200 34201/***/ }), 34202 34203/***/ "./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881&": 34204/*!**************************************************************************************!*\ 34205 !*** ./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881& ***! 34206 \**************************************************************************************/ 34207/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34208 34209"use strict"; 34210__webpack_require__.r(__webpack_exports__); 34211/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34212/* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__.render), 34213/* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) 34214/* harmony export */ }); 34215/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Slider_vue_vue_type_template_id_41e65881___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Slider.vue?vue&type=template&id=41e65881& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881&"); 34216 34217
34218/***/ }), 34219 34220/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438&": 34221/*!*********************************************************************************************************************************************************************************************************************************!*\ 34222 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/MiniSlider.vue?vue&type=template&id=2db91438& ***! 34223 \*********************************************************************************************************************************************************************************************************************************/ 34224/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34225 34226"use strict"; 34227__webpack_require__.r(__webpack_exports__); 34228/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34229/* harmony export */ "render": () => (/* binding */ render), 34230/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) 34231/* harmony export */ }); 34232var render = function () { 34233 var _vm = this 34234 var _h = _vm.$createElement 34235 var _c = _vm._self._c || _h 34236 return _c("content") 34237} 34238var staticRenderFns = [] 34239render._withStripped = true 34240 34241 34242 34243/***/ }), 34244 34245/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6&": 34246/*!******************************************************************************************************************************************************************************************************************************!*\ 34247 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Pricing.vue?vue&type=template&id=5dd62ad6& ***! 34248 \******************************************************************************************************************************************************************************************************************************/ 34249/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34250 34251"use strict"; 34252__webpack_require__.r(__webpack_exports__); 34253/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34254/* harmony export */ "render": () => (/* binding */ render), 34255/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) 34256/* harmony export */ }); 34257var render = function () { 34258 var _vm = this 34259 var _h = _vm.$createElement 34260 var _c = _vm._self._c || _h 34261 return _c("content") 34262} 34263var staticRenderFns = [] 34264render._withStripped = true 34265 34266 34267 34268/***/ }), 34269 34270/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb&": 34271/*!************************************************************************************************************************************************************************************************************************************!*\ 34272 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/ScrollTrigger.vue?vue&type=template&id=16798cbb& ***! 34273 \************************************************************************************************************************************************************************************************************************************/ 34274/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34275 34276"use strict"; 34277__webpack_require__.r(__webpack_exports__); 34278/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34279/* harmony export */ "render": () => (/* binding */ render), 34280/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) 34281/* harmony export */ }); 34282var render = function () { 34283 var _vm = this 34284 var _h = _vm.$createElement 34285 var _c = _vm._self._c || _h 34286 return _c("content") 34287} 34288var staticRenderFns = [] 34289render._withStripped = true 34290 34291 34292 34293/***/ }), 34294 34295/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881&": 34296/*!*****************************************************************************************************************************************************************************************************************************!*\ 34297 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./user/themes/enormail/js/components/Slider.vue?vue&type=template&id=41e65881& ***! 34298 \*****************************************************************************************************************************************************************************************************************************/ 34299/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34300 34301"use strict"; 34302__webpack_require__.r(__webpack_exports__); 34303/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34304/* harmony export */ "render": () => (/* binding */ render), 34305/* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) 34306/* harmony export */ }); 34307var render = function () { 34308 var _vm = this 34309 var _h = _vm.$createElement 34310 var _c = _vm._self._c || _h 34311 return _c("input", { 34312 attrs: { 34313 type: "range", 34314 min: "2500", 34315 max: "150000", 34316 step: "2500", 34317 value: "2500", 34318 }, 34319 }) 34320} 34321var staticRenderFns = [] 34322render._withStripped = true 34323 34324 34325 34326/***/ }), 34327
vendor: 3,365 bytes, lines 34328-34440
34328/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js": 34329/*!********************************************************************!*\ 34330 !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***! 34331 \********************************************************************/ 34332/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34333 34334"use strict"; 34335__webpack_require__.r(__webpack_exports__); 34336/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34337/* harmony export */ "default": () => (/* binding */ normalizeComponent) 34338/* harmony export */ }); 34339/* globals __VUE_SSR_CONTEXT__ */ 34340 34341// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). 34342// This module is a runtime utility for cleaner component module output and will 34343// be included in the final webpack user bundle. 34344 34345function normalizeComponent ( 34346 scriptExports, 34347 render, 34348 staticRenderFns, 34349 functionalTemplate, 34350 injectStyles, 34351 scopeId, 34352 moduleIdentifier, /* server only */ 34353 shadowMode /* vue-cli only */ 34354) { 34355 // Vue.extend constructor export interop 34356 var options = typeof scriptExports === 'function' 34357 ? scriptExports.options 34358 : scriptExports 34359 34360 // render functions 34361 if (render) { 34362 options.render = render 34363 options.staticRenderFns = staticRenderFns 34364 options._compiled = true 34365 } 34366 34367 // functional template 34368 if (functionalTemplate) { 34369 options.functional = true 34370 } 34371 34372 // scopedId 34373 if (scopeId) { 34374 options._scopeId = 'data-v-' + scopeId 34375 } 34376 34377 var hook 34378 if (moduleIdentifier) { // server build 34379 hook = function (context) { 34380 // 2.3 injection 34381 context = 34382 context || // cached call 34383 (this.$vnode && this.$vnode.ssrContext) || // stateful 34384 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional 34385 // 2.2 with runInNewContext: true 34386 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { 34387 context = __VUE_SSR_CONTEXT__ 34388 } 34389 // inject component styles 34390 if (injectStyles) { 34391 injectStyles.call(this, context) 34392 } 34393 // register component module identifier for async chunk inferrence 34394 if (context && context._registeredComponents) { 34395 context._registeredComponents.add(moduleIdentifier) 34396 } 34397 } 34398 // used by ssr in case component is cached and beforeCreate 34399 // never gets called 34400 options._ssrRegister = hook 34401 } else if (injectStyles) { 34402 hook = shadowMode 34403 ? function () { 34404 injectStyles.call( 34405 this, 34406 (options.functional ? this.parent : this).$root.$options.shadowRoot 34407 ) 34408 } 34409 : injectStyles 34410 } 34411 34412 if (hook) { 34413 if (options.functional) { 34414 // for template-only hot-reload because in that case the render fn doesn't 34415 // go through the normalizer 34416 options._injectStyles = hook 34417 // register for functional component in vue file 34418 var originalRender = options.render 34419 options.render = function renderWithStyleInjection (h, context) { 34420 hook.call(context) 34421 return originalRender(h, context) 34422 } 34423 } else { 34424 // inject component registration as beforeCreate hook 34425 var existing = options.beforeCreate 34426 options.beforeCreate = existing 34427 ? [].concat(existing, hook) 34428 : [hook] 34429 } 34430 } 34431 34432 return { 34433 exports: scriptExports, 34434 options: options 34435 } 34436} 34437 34438 34439/***/ }), 34440
vendor: 324,061 bytes, lines 34441-46483
34441/***/ "./node_modules/vue/dist/vue.esm.js": 34442/*!******************************************!*\ 34443 !*** ./node_modules/vue/dist/vue.esm.js ***! 34444 \******************************************/ 34445/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 34446 34447"use strict"; 34448__webpack_require__.r(__webpack_exports__); 34449/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34450/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 34451/* harmony export */ }); 34452/*! 34453 * Vue.js v2.6.14 34454 * (c) 2014-2021 Evan You 34455 * Released under the MIT License. 34456 */ 34457/* */ 34458 34459var emptyObject = Object.freeze({}); 34460 34461// These helpers produce better VM code in JS engines due to their 34462// explicitness and function inlining. 34463function isUndef (v) { 34464 return v === undefined || v === null 34465} 34466 34467function isDef (v) { 34468 return v !== undefined && v !== null 34469} 34470 34471function isTrue (v) { 34472 return v === true 34473} 34474 34475function isFalse (v) { 34476 return v === false 34477} 34478 34479/** 34480 * Check if value is primitive. 34481 */ 34482function isPrimitive (value) { 34483 return ( 34484 typeof value === 'string' || 34485 typeof value === 'number' || 34486 // $flow-disable-line 34487 typeof value === 'symbol' || 34488 typeof value === 'boolean' 34489 ) 34490} 34491 34492/** 34493 * Quick object check - this is primarily used to tell 34494 * Objects from primitive values when we know the value 34495 * is a JSON-compliant type. 34496 */ 34497function isObject (obj) { 34498 return obj !== null && typeof obj === 'object' 34499} 34500 34501/** 34502 * Get the raw type string of a value, e.g., [object Object]. 34503 */ 34504var _toString = Object.prototype.toString; 34505 34506function toRawType (value) { 34507 return _toString.call(value).slice(8, -1) 34508} 34509 34510/** 34511 * Strict object type check. Only returns true 34512 * for plain JavaScript objects. 34513 */ 34514function isPlainObject (obj) { 34515 return _toString.call(obj) === '[object Object]' 34516} 34517 34518function isRegExp (v) { 34519 return _toString.call(v) === '[object RegExp]' 34520} 34521 34522/** 34523 * Check if val is a valid array index. 34524 */ 34525function isValidArrayIndex (val) { 34526 var n = parseFloat(String(val)); 34527 return n >= 0 && Math.floor(n) === n && isFinite(val) 34528} 34529 34530function isPromise (val) { 34531 return ( 34532 isDef(val) && 34533 typeof val.then === 'function' && 34534 typeof val.catch === 'function' 34535 ) 34536} 34537 34538/** 34539 * Convert a value to a string that is actually rendered. 34540 */ 34541function toString (val) { 34542 return val == null 34543 ? '' 34544 : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) 34545 ? JSON.stringify(val, null, 2) 34546 : String(val) 34547} 34548 34549/** 34550 * Convert an input value to a number for persistence. 34551 * If the conversion fails, return original string. 34552 */ 34553function toNumber (val) { 34554 var n = parseFloat(val); 34555 return isNaN(n) ? val : n 34556} 34557 34558/** 34559 * Make a map and return a function for checking if a key 34560 * is in that map. 34561 */ 34562function makeMap ( 34563 str, 34564 expectsLowerCase 34565) { 34566 var map = Object.create(null); 34567 var list = str.split(','); 34568 for (var i = 0; i < list.length; i++) { 34569 map[list[i]] = true; 34570 } 34571 return expectsLowerCase 34572 ? function (val) { return map[val.toLowerCase()]; } 34573 : function (val) { return map[val]; } 34574} 34575 34576/** 34577 * Check if a tag is a built-in tag. 34578 */ 34579var isBuiltInTag = makeMap('slot,component', true); 34580 34581/** 34582 * Check if an attribute is a reserved attribute. 34583 */ 34584var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); 34585 34586/** 34587 * Remove an item from an array. 34588 */ 34589function remove (arr, item) { 34590 if (arr.length) { 34591 var index = arr.indexOf(item); 34592 if (index > -1) { 34593 return arr.splice(index, 1) 34594 } 34595 } 34596} 34597 34598/** 34599 * Check whether an object has the property. 34600 */ 34601var hasOwnProperty = Object.prototype.hasOwnProperty; 34602function hasOwn (obj, key) { 34603 return hasOwnProperty.call(obj, key) 34604} 34605 34606/** 34607 * Create a cached version of a pure function. 34608 */ 34609function cached (fn) { 34610 var cache = Object.create(null); 34611 return (function cachedFn (str) { 34612 var hit = cache[str]; 34613 return hit || (cache[str] = fn(str)) 34614 }) 34615} 34616 34617/** 34618 * Camelize a hyphen-delimited string. 34619 */ 34620var camelizeRE = /-(\w)/g; 34621var camelize = cached(function (str) { 34622 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) 34623}); 34624 34625/** 34626 * Capitalize a string. 34627 */ 34628var capitalize = cached(function (str) { 34629 return str.charAt(0).toUpperCase() + str.slice(1) 34630}); 34631 34632/** 34633 * Hyphenate a camelCase string. 34634 */ 34635var hyphenateRE = /\B([A-Z])/g; 34636var hyphenate = cached(function (str) { 34637 return str.replace(hyphenateRE, '-$1').toLowerCase() 34638}); 34639 34640/** 34641 * Simple bind polyfill for environments that do not support it, 34642 * e.g., PhantomJS 1.x. Technically, we don't need this anymore 34643 * since native bind is now performant enough in most browsers. 34644 * But removing it would mean breaking code that was able to run in 34645 * PhantomJS 1.x, so this must be kept for backward compatibility. 34646 */ 34647 34648/* istanbul ignore next */ 34649function polyfillBind (fn, ctx) { 34650 function boundFn (a) { 34651 var l = arguments.length; 34652 return l 34653 ? l > 1 34654 ? fn.apply(ctx, arguments) 34655 : fn.call(ctx, a) 34656 : fn.call(ctx) 34657 } 34658 34659 boundFn._length = fn.length; 34660 return boundFn 34661} 34662 34663function nativeBind (fn, ctx) { 34664 return fn.bind(ctx) 34665} 34666 34667var bind = Function.prototype.bind 34668 ? nativeBind 34669 : polyfillBind; 34670 34671/** 34672 * Convert an Array-like object to a real Array. 34673 */ 34674function toArray (list, start) { 34675 start = start || 0; 34676 var i = list.length - start; 34677 var ret = new Array(i); 34678 while (i--) { 34679 ret[i] = list[i + start]; 34680 } 34681 return ret 34682} 34683 34684/** 34685 * Mix properties into target object. 34686 */ 34687function extend (to, _from) { 34688 for (var key in _from) { 34689 to[key] = _from[key]; 34690 } 34691 return to 34692} 34693 34694/** 34695 * Merge an Array of Objects into a single Object. 34696 */ 34697function toObject (arr) { 34698 var res = {}; 34699 for (var i = 0; i < arr.length; i++) { 34700 if (arr[i]) { 34701 extend(res, arr[i]); 34702 } 34703 } 34704 return res 34705} 34706 34707/* eslint-disable no-unused-vars */ 34708 34709/** 34710 * Perform no operation. 34711 * Stubbing args to make Flow happy without leaving useless transpiled code 34712 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). 34713 */ 34714function noop (a, b, c) {} 34715 34716/** 34717 * Always return false. 34718 */ 34719var no = function (a, b, c) { return false; }; 34720 34721/* eslint-enable no-unused-vars */ 34722 34723/** 34724 * Return the same value. 34725 */ 34726var identity = function (_) { return _; }; 34727 34728/** 34729 * Generate a string containing static keys from compiler modules. 34730 */ 34731function genStaticKeys (modules) { 34732 return modules.reduce(function (keys, m) { 34733 return keys.concat(m.staticKeys || []) 34734 }, []).join(',') 34735} 34736 34737/** 34738 * Check if two values are loosely equal - that is, 34739 * if they are plain objects, do they have the same shape? 34740 */ 34741function looseEqual (a, b) { 34742 if (a === b) { return true } 34743 var isObjectA = isObject(a); 34744 var isObjectB = isObject(b); 34745 if (isObjectA && isObjectB) { 34746 try { 34747 var isArrayA = Array.isArray(a); 34748 var isArrayB = Array.isArray(b); 34749 if (isArrayA && isArrayB) { 34750 return a.length === b.length && a.every(function (e, i) { 34751 return looseEqual(e, b[i]) 34752 }) 34753 } else if (a instanceof Date && b instanceof Date) { 34754 return a.getTime() === b.getTime() 34755 } else if (!isArrayA && !isArrayB) { 34756 var keysA = Object.keys(a); 34757 var keysB = Object.keys(b); 34758 return keysA.length === keysB.length && keysA.every(function (key) { 34759 return looseEqual(a[key], b[key]) 34760 }) 34761 } else { 34762 /* istanbul ignore next */ 34763 return false 34764 } 34765 } catch (e) { 34766 /* istanbul ignore next */ 34767 return false 34768 } 34769 } else if (!isObjectA && !isObjectB) { 34770 return String(a) === String(b) 34771 } else { 34772 return false 34773 } 34774} 34775 34776/** 34777 * Return the first index at which a loosely equal value can be 34778 * found in the array (if value is a plain object, the array must 34779 * contain an object of the same shape), or -1 if it is not present. 34780 */ 34781function looseIndexOf (arr, val) { 34782 for (var i = 0; i < arr.length; i++) { 34783 if (looseEqual(arr[i], val)) { return i } 34784 } 34785 return -1 34786} 34787 34788/** 34789 * Ensure a function is called only once. 34790 */ 34791function once (fn) { 34792 var called = false; 34793 return function () { 34794 if (!called) { 34795 called = true; 34796 fn.apply(this, arguments); 34797 } 34798 } 34799} 34800 34801var SSR_ATTR = 'data-server-rendered'; 34802 34803var ASSET_TYPES = [ 34804 'component', 34805 'directive', 34806 'filter' 34807]; 34808 34809var LIFECYCLE_HOOKS = [ 34810 'beforeCreate', 34811 'created', 34812 'beforeMount', 34813 'mounted', 34814 'beforeUpdate', 34815 'updated', 34816 'beforeDestroy', 34817 'destroyed', 34818 'activated', 34819 'deactivated', 34820 'errorCaptured', 34821 'serverPrefetch' 34822]; 34823 34824/* */ 34825 34826 34827 34828var config = ({ 34829 /** 34830 * Option merge strategies (used in core/util/options) 34831 */ 34832 // $flow-disable-line 34833 optionMergeStrategies: Object.create(null), 34834 34835 /** 34836 * Whether to suppress warnings. 34837 */ 34838 silent: false, 34839 34840 /** 34841 * Show production mode tip message on boot? 34842 */ 34843 productionTip: "development" !== 'production', 34844 34845 /** 34846 * Whether to enable devtools 34847 */ 34848 devtools: "development" !== 'production', 34849 34850 /** 34851 * Whether to record perf 34852 */ 34853 performance: false, 34854 34855 /** 34856 * Error handler for watcher errors 34857 */ 34858 errorHandler: null, 34859 34860 /** 34861 * Warn handler for watcher warns 34862 */ 34863 warnHandler: null, 34864 34865 /** 34866 * Ignore certain custom elements 34867 */ 34868 ignoredElements: [], 34869 34870 /** 34871 * Custom user key aliases for v-on 34872 */ 34873 // $flow-disable-line 34874 keyCodes: Object.create(null), 34875 34876 /** 34877 * Check if a tag is reserved so that it cannot be registered as a 34878 * component. This is platform-dependent and may be overwritten. 34879 */ 34880 isReservedTag: no, 34881 34882 /** 34883 * Check if an attribute is reserved so that it cannot be used as a component 34884 * prop. This is platform-dependent and may be overwritten. 34885 */ 34886 isReservedAttr: no, 34887 34888 /** 34889 * Check if a tag is an unknown element. 34890 * Platform-dependent. 34891 */ 34892 isUnknownElement: no, 34893 34894 /** 34895 * Get the namespace of an element 34896 */ 34897 getTagNamespace: noop, 34898 34899 /** 34900 * Parse the real tag name for the specific platform. 34901 */ 34902 parsePlatformTagName: identity, 34903 34904 /** 34905 * Check if an attribute must be bound using property, e.g. value 34906 * Platform-dependent. 34907 */ 34908 mustUseProp: no, 34909 34910 /** 34911 * Perform updates asynchronously. Intended to be used by Vue Test Utils 34912 * This will significantly reduce performance if set to false. 34913 */ 34914 async: true, 34915 34916 /** 34917 * Exposed for legacy reasons 34918 */ 34919 _lifecycleHooks: LIFECYCLE_HOOKS 34920}); 34921 34922/* */ 34923 34924/** 34925 * unicode letters used for parsing html tags, component names and property paths. 34926 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname 34927 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS 34928 */ 34929var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; 34930 34931/** 34932 * Check if a string starts with $ or _ 34933 */ 34934function isReserved (str) { 34935 var c = (str + '').charCodeAt(0); 34936 return c === 0x24 || c === 0x5F 34937} 34938 34939/** 34940 * Define a property. 34941 */ 34942function def (obj, key, val, enumerable) { 34943 Object.defineProperty(obj, key, { 34944 value: val, 34945 enumerable: !!enumerable, 34946 writable: true, 34947 configurable: true 34948 }); 34949} 34950 34951/** 34952 * Parse simple path. 34953 */ 34954var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); 34955function parsePath (path) { 34956 if (bailRE.test(path)) { 34957 return 34958 } 34959 var segments = path.split('.'); 34960 return function (obj) { 34961 for (var i = 0; i < segments.length; i++) { 34962 if (!obj) { return } 34963 obj = obj[segments[i]]; 34964 } 34965 return obj 34966 } 34967} 34968 34969/* */ 34970 34971// can we use __proto__? 34972var hasProto = '__proto__' in {}; 34973 34974// Browser environment sniffing 34975var inBrowser = typeof window !== 'undefined'; 34976var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; 34977var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); 34978var UA = inBrowser && window.navigator.userAgent.toLowerCase(); 34979var isIE = UA && /msie|trident/.test(UA); 34980var isIE9 = UA && UA.indexOf('msie 9.0') > 0; 34981var isEdge = UA && UA.indexOf('edge/') > 0; 34982var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); 34983var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); 34984var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; 34985var isPhantomJS = UA && /phantomjs/.test(UA); 34986var isFF = UA && UA.match(/firefox\/(\d+)/); 34987 34988// Firefox has a "watch" function on Object.prototype... 34989var nativeWatch = ({}).watch; 34990 34991var supportsPassive = false; 34992if (inBrowser) { 34993 try { 34994 var opts = {}; 34995 Object.defineProperty(opts, 'passive', ({ 34996 get: function get () { 34997 /* istanbul ignore next */ 34998 supportsPassive = true; 34999 } 35000 })); // https://github.com/facebook/flow/issues/285 35001 window.addEventListener('test-passive', null, opts); 35002 } catch (e) {} 35003} 35004 35005// this needs to be lazy-evaled because vue may be required before 35006// vue-server-renderer can set VUE_ENV 35007var _isServer; 35008var isServerRendering = function () { 35009 if (_isServer === undefined) { 35010 /* istanbul ignore if */ 35011 if (!inBrowser && !inWeex && typeof __webpack_require__.g !== 'undefined') { 35012 // detect presence of vue-server-renderer and avoid 35013 // Webpack shimming the process 35014 _isServer = __webpack_require__.g['process'] && __webpack_require__.g['process'].env.VUE_ENV === 'server'; 35015 } else { 35016 _isServer = false; 35017 } 35018 } 35019 return _isServer 35020}; 35021 35022// detect devtools 35023var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; 35024 35025/* istanbul ignore next */ 35026function isNative (Ctor) { 35027 return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) 35028} 35029 35030var hasSymbol = 35031 typeof Symbol !== 'undefined' && isNative(Symbol) && 35032 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); 35033 35034var _Set; 35035/* istanbul ignore if */ // $flow-disable-line 35036if (typeof Set !== 'undefined' && isNative(Set)) { 35037 // use native Set when available. 35038 _Set = Set; 35039} else { 35040 // a non-standard Set polyfill that only works with primitive keys. 35041 _Set = /*@__PURE__*/(function () { 35042 function Set () { 35043 this.set = Object.create(null); 35044 } 35045 Set.prototype.has = function has (key) { 35046 return this.set[key] === true 35047 }; 35048 Set.prototype.add = function add (key) { 35049 this.set[key] = true; 35050 }; 35051 Set.prototype.clear = function clear () { 35052 this.set = Object.create(null); 35053 }; 35054 35055 return Set; 35056 }()); 35057} 35058 35059/* */ 35060 35061var warn = noop; 35062var tip = noop; 35063var generateComponentTrace = (noop); // work around flow check 35064var formatComponentName = (noop); 35065 35066if (true) { 35067 var hasConsole = typeof console !== 'undefined'; 35068 var classifyRE = /(?:^|[-_])(\w)/g; 35069 var classify = function (str) { return str 35070 .replace(classifyRE, function (c) { return c.toUpperCase(); }) 35071 .replace(/[-_]/g, ''); }; 35072 35073 warn = function (msg, vm) { 35074 var trace = vm ? generateComponentTrace(vm) : ''; 35075 35076 if (config.warnHandler) { 35077 config.warnHandler.call(null, msg, vm, trace); 35078 } else if (hasConsole && (!config.silent)) { 35079 console.error(("[Vue warn]: " + msg + trace)); 35080 } 35081 }; 35082 35083 tip = function (msg, vm) { 35084 if (hasConsole && (!config.silent)) { 35085 console.warn("[Vue tip]: " + msg + ( 35086 vm ? generateComponentTrace(vm) : '' 35087 )); 35088 } 35089 }; 35090 35091 formatComponentName = function (vm, includeFile) { 35092 if (vm.$root === vm) { 35093 return '<Root>' 35094 } 35095 var options = typeof vm === 'function' && vm.cid != null 35096 ? vm.options 35097 : vm._isVue 35098 ? vm.$options || vm.constructor.options 35099 : vm; 35100 var name = options.name || options._componentTag; 35101 var file = options.__file; 35102 if (!name && file) { 35103 var match = file.match(/([^/\\]+)\.vue$/); 35104 name = match && match[1]; 35105 } 35106 35107 return ( 35108 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + 35109 (file && includeFile !== false ? (" at " + file) : '') 35110 ) 35111 }; 35112 35113 var repeat = function (str, n) { 35114 var res = ''; 35115 while (n) { 35116 if (n % 2 === 1) { res += str; } 35117 if (n > 1) { str += str; } 35118 n >>= 1; 35119 } 35120 return res 35121 }; 35122 35123 generateComponentTrace = function (vm) { 35124 if (vm._isVue && vm.$parent) { 35125 var tree = []; 35126 var currentRecursiveSequence = 0; 35127 while (vm) { 35128 if (tree.length > 0) { 35129 var last = tree[tree.length - 1]; 35130 if (last.constructor === vm.constructor) { 35131 currentRecursiveSequence++; 35132 vm = vm.$parent; 35133 continue 35134 } else if (currentRecursiveSequence > 0) { 35135 tree[tree.length - 1] = [last, currentRecursiveSequence]; 35136 currentRecursiveSequence = 0; 35137 } 35138 } 35139 tree.push(vm); 35140 vm = vm.$parent; 35141 } 35142 return '\n\nfound in\n\n' + tree 35143 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) 35144 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") 35145 : formatComponentName(vm))); }) 35146 .join('\n') 35147 } else { 35148 return ("\n\n(found in " + (formatComponentName(vm)) + ")") 35149 } 35150 }; 35151} 35152 35153/* */ 35154 35155var uid = 0; 35156 35157/** 35158 * A dep is an observable that can have multiple 35159 * directives subscribing to it. 35160 */ 35161var Dep = function Dep () { 35162 this.id = uid++; 35163 this.subs = []; 35164}; 35165 35166Dep.prototype.addSub = function addSub (sub) { 35167 this.subs.push(sub); 35168}; 35169 35170Dep.prototype.removeSub = function removeSub (sub) { 35171 remove(this.subs, sub); 35172}; 35173 35174Dep.prototype.depend = function depend () { 35175 if (Dep.target) { 35176 Dep.target.addDep(this); 35177 } 35178}; 35179 35180Dep.prototype.notify = function notify () { 35181 // stabilize the subscriber list first 35182 var subs = this.subs.slice(); 35183 if ( true && !config.async) { 35184 // subs aren't sorted in scheduler if not running async 35185 // we need to sort them now to make sure they fire in correct 35186 // order 35187 subs.sort(function (a, b) { return a.id - b.id; }); 35188 } 35189 for (var i = 0, l = subs.length; i < l; i++) { 35190 subs[i].update(); 35191 } 35192}; 35193 35194// The current target watcher being evaluated. 35195// This is globally unique because only one watcher 35196// can be evaluated at a time. 35197Dep.target = null; 35198var targetStack = []; 35199 35200function pushTarget (target) { 35201 targetStack.push(target); 35202 Dep.target = target; 35203} 35204 35205function popTarget () { 35206 targetStack.pop(); 35207 Dep.target = targetStack[targetStack.length - 1]; 35208} 35209 35210/* */ 35211 35212var VNode = function VNode ( 35213 tag, 35214 data, 35215 children, 35216 text, 35217 elm, 35218 context, 35219 componentOptions, 35220 asyncFactory 35221) { 35222 this.tag = tag; 35223 this.data = data; 35224 this.children = children; 35225 this.text = text; 35226 this.elm = elm; 35227 this.ns = undefined; 35228 this.context = context; 35229 this.fnContext = undefined; 35230 this.fnOptions = undefined; 35231 this.fnScopeId = undefined; 35232 this.key = data && data.key; 35233 this.componentOptions = componentOptions; 35234 this.componentInstance = undefined; 35235 this.parent = undefined; 35236 this.raw = false; 35237 this.isStatic = false; 35238 this.isRootInsert = true; 35239 this.isComment = false; 35240 this.isCloned = false; 35241 this.isOnce = false; 35242 this.asyncFactory = asyncFactory; 35243 this.asyncMeta = undefined; 35244 this.isAsyncPlaceholder = false; 35245}; 35246 35247var prototypeAccessors = { child: { configurable: true } }; 35248 35249// DEPRECATED: alias for componentInstance for backwards compat. 35250/* istanbul ignore next */ 35251prototypeAccessors.child.get = function () { 35252 return this.componentInstance 35253}; 35254 35255Object.defineProperties( VNode.prototype, prototypeAccessors ); 35256 35257var createEmptyVNode = function (text) { 35258 if ( text === void 0 ) text = ''; 35259 35260 var node = new VNode(); 35261 node.text = text; 35262 node.isComment = true; 35263 return node 35264}; 35265 35266function createTextVNode (val) { 35267 return new VNode(undefined, undefined, undefined, String(val)) 35268} 35269 35270// optimized shallow clone 35271// used for static nodes and slot nodes because they may be reused across 35272// multiple renders, cloning them avoids errors when DOM manipulations rely 35273// on their elm reference. 35274function cloneVNode (vnode) { 35275 var cloned = new VNode( 35276 vnode.tag, 35277 vnode.data, 35278 // #7975 35279 // clone children array to avoid mutating original in case of cloning 35280 // a child. 35281 vnode.children && vnode.children.slice(), 35282 vnode.text, 35283 vnode.elm, 35284 vnode.context, 35285 vnode.componentOptions, 35286 vnode.asyncFactory 35287 ); 35288 cloned.ns = vnode.ns; 35289 cloned.isStatic = vnode.isStatic; 35290 cloned.key = vnode.key; 35291 cloned.isComment = vnode.isComment; 35292 cloned.fnContext = vnode.fnContext; 35293 cloned.fnOptions = vnode.fnOptions; 35294 cloned.fnScopeId = vnode.fnScopeId; 35295 cloned.asyncMeta = vnode.asyncMeta; 35296 cloned.isCloned = true; 35297 return cloned 35298} 35299 35300/* 35301 * not type checking this file because flow doesn't play well with 35302 * dynamically accessing methods on Array prototype 35303 */ 35304 35305var arrayProto = Array.prototype; 35306var arrayMethods = Object.create(arrayProto); 35307 35308var methodsToPatch = [ 35309 'push', 35310 'pop', 35311 'shift', 35312 'unshift', 35313 'splice', 35314 'sort', 35315 'reverse' 35316]; 35317 35318/** 35319 * Intercept mutating methods and emit events 35320 */ 35321methodsToPatch.forEach(function (method) { 35322 // cache original method 35323 var original = arrayProto[method]; 35324 def(arrayMethods, method, function mutator () { 35325 var args = [], len = arguments.length; 35326 while ( len-- ) args[ len ] = arguments[ len ]; 35327 35328 var result = original.apply(this, args); 35329 var ob = this.__ob__; 35330 var inserted; 35331 switch (method) { 35332 case 'push': 35333 case 'unshift': 35334 inserted = args; 35335 break 35336 case 'splice': 35337 inserted = args.slice(2); 35338 break 35339 } 35340 if (inserted) { ob.observeArray(inserted); } 35341 // notify change 35342 ob.dep.notify(); 35343 return result 35344 }); 35345}); 35346 35347/* */ 35348 35349var arrayKeys = Object.getOwnPropertyNames(arrayMethods); 35350 35351/** 35352 * In some cases we may want to disable observation inside a component's 35353 * update computation. 35354 */ 35355var shouldObserve = true; 35356 35357function toggleObserving (value) { 35358 shouldObserve = value; 35359} 35360 35361/** 35362 * Observer class that is attached to each observed 35363 * object. Once attached, the observer converts the target 35364 * object's property keys into getter/setters that 35365 * collect dependencies and dispatch updates. 35366 */ 35367var Observer = function Observer (value) { 35368 this.value = value; 35369 this.dep = new Dep(); 35370 this.vmCount = 0; 35371 def(value, '__ob__', this); 35372 if (Array.isArray(value)) { 35373 if (hasProto) { 35374 protoAugment(value, arrayMethods); 35375 } else { 35376 copyAugment(value, arrayMethods, arrayKeys); 35377 } 35378 this.observeArray(value); 35379 } else { 35380 this.walk(value); 35381 } 35382}; 35383 35384/** 35385 * Walk through all properties and convert them into 35386 * getter/setters. This method should only be called when 35387 * value type is Object. 35388 */ 35389Observer.prototype.walk = function walk (obj) { 35390 var keys = Object.keys(obj); 35391 for (var i = 0; i < keys.length; i++) { 35392 defineReactive$$1(obj, keys[i]); 35393 } 35394}; 35395 35396/** 35397 * Observe a list of Array items. 35398 */ 35399Observer.prototype.observeArray = function observeArray (items) { 35400 for (var i = 0, l = items.length; i < l; i++) { 35401 observe(items[i]); 35402 } 35403}; 35404 35405// helpers 35406 35407/** 35408 * Augment a target Object or Array by intercepting 35409 * the prototype chain using __proto__ 35410 */ 35411function protoAugment (target, src) { 35412 /* eslint-disable no-proto */ 35413 target.__proto__ = src; 35414 /* eslint-enable no-proto */ 35415} 35416 35417/** 35418 * Augment a target Object or Array by defining 35419 * hidden properties. 35420 */ 35421/* istanbul ignore next */ 35422function copyAugment (target, src, keys) { 35423 for (var i = 0, l = keys.length; i < l; i++) { 35424 var key = keys[i]; 35425 def(target, key, src[key]); 35426 } 35427} 35428 35429/** 35430 * Attempt to create an observer instance for a value, 35431 * returns the new observer if successfully observed, 35432 * or the existing observer if the value already has one. 35433 */ 35434function observe (value, asRootData) { 35435 if (!isObject(value) || value instanceof VNode) { 35436 return 35437 } 35438 var ob; 35439 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { 35440 ob = value.__ob__; 35441 } else if ( 35442 shouldObserve && 35443 !isServerRendering() && 35444 (Array.isArray(value) || isPlainObject(value)) && 35445 Object.isExtensible(value) && 35446 !value._isVue 35447 ) { 35448 ob = new Observer(value); 35449 } 35450 if (asRootData && ob) { 35451 ob.vmCount++; 35452 } 35453 return ob 35454} 35455 35456/** 35457 * Define a reactive property on an Object. 35458 */ 35459function defineReactive$$1 ( 35460 obj, 35461 key, 35462 val, 35463 customSetter, 35464 shallow 35465) { 35466 var dep = new Dep(); 35467 35468 var property = Object.getOwnPropertyDescriptor(obj, key); 35469 if (property && property.configurable === false) { 35470 return 35471 } 35472 35473 // cater for pre-defined getter/setters 35474 var getter = property && property.get; 35475 var setter = property && property.set; 35476 if ((!getter || setter) && arguments.length === 2) { 35477 val = obj[key]; 35478 } 35479 35480 var childOb = !shallow && observe(val); 35481 Object.defineProperty(obj, key, { 35482 enumerable: true, 35483 configurable: true, 35484 get: function reactiveGetter () { 35485 var value = getter ? getter.call(obj) : val; 35486 if (Dep.target) { 35487 dep.depend(); 35488 if (childOb) { 35489 childOb.dep.depend(); 35490 if (Array.isArray(value)) { 35491 dependArray(value); 35492 } 35493 } 35494 } 35495 return value 35496 }, 35497 set: function reactiveSetter (newVal) { 35498 var value = getter ? getter.call(obj) : val; 35499 /* eslint-disable no-self-compare */ 35500 if (newVal === value || (newVal !== newVal && value !== value)) { 35501 return 35502 } 35503 /* eslint-enable no-self-compare */ 35504 if ( true && customSetter) { 35505 customSetter(); 35506 } 35507 // #7981: for accessor properties without setter 35508 if (getter && !setter) { return } 35509 if (setter) { 35510 setter.call(obj, newVal); 35511 } else { 35512 val = newVal; 35513 } 35514 childOb = !shallow && observe(newVal); 35515 dep.notify(); 35516 } 35517 }); 35518} 35519 35520/** 35521 * Set a property on an object. Adds the new property and 35522 * triggers change notification if the property doesn't 35523 * already exist. 35524 */ 35525function set (target, key, val) { 35526 if ( true && 35527 (isUndef(target) || isPrimitive(target)) 35528 ) { 35529 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); 35530 } 35531 if (Array.isArray(target) && isValidArrayIndex(key)) { 35532 target.length = Math.max(target.length, key); 35533 target.splice(key, 1, val); 35534 return val 35535 } 35536 if (key in target && !(key in Object.prototype)) { 35537 target[key] = val; 35538 return val 35539 } 35540 var ob = (target).__ob__; 35541 if (target._isVue || (ob && ob.vmCount)) { 35542 true && warn( 35543 'Avoid adding reactive properties to a Vue instance or its root $data ' + 35544 'at runtime - declare it upfront in the data option.' 35545 ); 35546 return val 35547 } 35548 if (!ob) { 35549 target[key] = val; 35550 return val 35551 } 35552 defineReactive$$1(ob.value, key, val); 35553 ob.dep.notify(); 35554 return val 35555} 35556 35557/** 35558 * Delete a property and trigger change if necessary. 35559 */ 35560function del (target, key) { 35561 if ( true && 35562 (isUndef(target) || isPrimitive(target)) 35563 ) { 35564 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); 35565 } 35566 if (Array.isArray(target) && isValidArrayIndex(key)) { 35567 target.splice(key, 1); 35568 return 35569 } 35570 var ob = (target).__ob__; 35571 if (target._isVue || (ob && ob.vmCount)) { 35572 true && warn( 35573 'Avoid deleting properties on a Vue instance or its root $data ' + 35574 '- just set it to null.' 35575 ); 35576 return 35577 } 35578 if (!hasOwn(target, key)) { 35579 return 35580 } 35581 delete target[key]; 35582 if (!ob) { 35583 return 35584 } 35585 ob.dep.notify(); 35586} 35587 35588/** 35589 * Collect dependencies on array elements when the array is touched, since 35590 * we cannot intercept array element access like property getters. 35591 */ 35592function dependArray (value) { 35593 for (var e = (void 0), i = 0, l = value.length; i < l; i++) { 35594 e = value[i]; 35595 e && e.__ob__ && e.__ob__.dep.depend(); 35596 if (Array.isArray(e)) { 35597 dependArray(e); 35598 } 35599 } 35600} 35601 35602/* */ 35603 35604/** 35605 * Option overwriting strategies are functions that handle 35606 * how to merge a parent option value and a child option 35607 * value into the final value. 35608 */ 35609var strats = config.optionMergeStrategies; 35610 35611/** 35612 * Options with restrictions 35613 */ 35614if (true) { 35615 strats.el = strats.propsData = function (parent, child, vm, key) { 35616 if (!vm) { 35617 warn( 35618 "option \"" + key + "\" can only be used during instance " + 35619 'creation with the `new` keyword.' 35620 ); 35621 } 35622 return defaultStrat(parent, child) 35623 }; 35624} 35625 35626/** 35627 * Helper that recursively merges two data objects together. 35628 */ 35629function mergeData (to, from) { 35630 if (!from) { return to } 35631 var key, toVal, fromVal; 35632 35633 var keys = hasSymbol 35634 ? Reflect.ownKeys(from) 35635 : Object.keys(from); 35636 35637 for (var i = 0; i < keys.length; i++) { 35638 key = keys[i]; 35639 // in case the object is already observed... 35640 if (key === '__ob__') { continue } 35641 toVal = to[key]; 35642 fromVal = from[key]; 35643 if (!hasOwn(to, key)) { 35644 set(to, key, fromVal); 35645 } else if ( 35646 toVal !== fromVal && 35647 isPlainObject(toVal) && 35648 isPlainObject(fromVal) 35649 ) { 35650 mergeData(toVal, fromVal); 35651 } 35652 } 35653 return to 35654} 35655 35656/** 35657 * Data 35658 */ 35659function mergeDataOrFn ( 35660 parentVal, 35661 childVal, 35662 vm 35663) { 35664 if (!vm) { 35665 // in a Vue.extend merge, both should be functions 35666 if (!childVal) { 35667 return parentVal 35668 } 35669 if (!parentVal) { 35670 return childVal 35671 } 35672 // when parentVal & childVal are both present, 35673 // we need to return a function that returns the 35674 // merged result of both functions... no need to 35675 // check if parentVal is a function here because 35676 // it has to be a function to pass previous merges. 35677 return function mergedDataFn () { 35678 return mergeData( 35679 typeof childVal === 'function' ? childVal.call(this, this) : childVal, 35680 typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal 35681 ) 35682 } 35683 } else { 35684 return function mergedInstanceDataFn () { 35685 // instance merge 35686 var instanceData = typeof childVal === 'function' 35687 ? childVal.call(vm, vm) 35688 : childVal; 35689 var defaultData = typeof parentVal === 'function' 35690 ? parentVal.call(vm, vm) 35691 : parentVal; 35692 if (instanceData) { 35693 return mergeData(instanceData, defaultData) 35694 } else { 35695 return defaultData 35696 } 35697 } 35698 } 35699} 35700 35701strats.data = function ( 35702 parentVal, 35703 childVal, 35704 vm 35705) { 35706 if (!vm) { 35707 if (childVal && typeof childVal !== 'function') { 35708 true && warn( 35709 'The "data" option should be a function ' + 35710 'that returns a per-instance value in component ' + 35711 'definitions.', 35712 vm 35713 ); 35714 35715 return parentVal 35716 } 35717 return mergeDataOrFn(parentVal, childVal) 35718 } 35719 35720 return mergeDataOrFn(parentVal, childVal, vm) 35721}; 35722 35723/** 35724 * Hooks and props are merged as arrays. 35725 */ 35726function mergeHook ( 35727 parentVal, 35728 childVal 35729) { 35730 var res = childVal 35731 ? parentVal 35732 ? parentVal.concat(childVal) 35733 : Array.isArray(childVal) 35734 ? childVal 35735 : [childVal] 35736 : parentVal; 35737 return res 35738 ? dedupeHooks(res) 35739 : res 35740} 35741 35742function dedupeHooks (hooks) { 35743 var res = []; 35744 for (var i = 0; i < hooks.length; i++) { 35745 if (res.indexOf(hooks[i]) === -1) { 35746 res.push(hooks[i]); 35747 } 35748 } 35749 return res 35750} 35751 35752LIFECYCLE_HOOKS.forEach(function (hook) { 35753 strats[hook] = mergeHook; 35754}); 35755 35756/** 35757 * Assets 35758 * 35759 * When a vm is present (instance creation), we need to do 35760 * a three-way merge between constructor options, instance 35761 * options and parent options. 35762 */ 35763function mergeAssets ( 35764 parentVal, 35765 childVal, 35766 vm, 35767 key 35768) { 35769 var res = Object.create(parentVal || null); 35770 if (childVal) { 35771 true && assertObjectType(key, childVal, vm); 35772 return extend(res, childVal) 35773 } else { 35774 return res 35775 } 35776} 35777 35778ASSET_TYPES.forEach(function (type) { 35779 strats[type + 's'] = mergeAssets; 35780}); 35781 35782/** 35783 * Watchers. 35784 * 35785 * Watchers hashes should not overwrite one 35786 * another, so we merge them as arrays. 35787 */ 35788strats.watch = function ( 35789 parentVal, 35790 childVal, 35791 vm, 35792 key 35793) { 35794 // work around Firefox's Object.prototype.watch... 35795 if (parentVal === nativeWatch) { parentVal = undefined; } 35796 if (childVal === nativeWatch) { childVal = undefined; } 35797 /* istanbul ignore if */ 35798 if (!childVal) { return Object.create(parentVal || null) } 35799 if (true) { 35800 assertObjectType(key, childVal, vm); 35801 } 35802 if (!parentVal) { return childVal } 35803 var ret = {}; 35804 extend(ret, parentVal); 35805 for (var key$1 in childVal) { 35806 var parent = ret[key$1]; 35807 var child = childVal[key$1]; 35808 if (parent && !Array.isArray(parent)) { 35809 parent = [parent]; 35810 } 35811 ret[key$1] = parent 35812 ? parent.concat(child) 35813 : Array.isArray(child) ? child : [child]; 35814 } 35815 return ret 35816}; 35817 35818/** 35819 * Other object hashes. 35820 */ 35821strats.props = 35822strats.methods = 35823strats.inject = 35824strats.computed = function ( 35825 parentVal, 35826 childVal, 35827 vm, 35828 key 35829) { 35830 if (childVal && "development" !== 'production') { 35831 assertObjectType(key, childVal, vm); 35832 } 35833 if (!parentVal) { return childVal } 35834 var ret = Object.create(null); 35835 extend(ret, parentVal); 35836 if (childVal) { extend(ret, childVal); } 35837 return ret 35838}; 35839strats.provide = mergeDataOrFn; 35840 35841/** 35842 * Default strategy. 35843 */ 35844var defaultStrat = function (parentVal, childVal) { 35845 return childVal === undefined 35846 ? parentVal 35847 : childVal 35848}; 35849 35850/** 35851 * Validate component names 35852 */ 35853function checkComponents (options) { 35854 for (var key in options.components) { 35855 validateComponentName(key); 35856 } 35857} 35858 35859function validateComponentName (name) { 35860 if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { 35861 warn( 35862 'Invalid component name: "' + name + '". Component names ' + 35863 'should conform to valid custom element name in html5 specification.' 35864 ); 35865 } 35866 if (isBuiltInTag(name) || config.isReservedTag(name)) { 35867 warn( 35868 'Do not use built-in or reserved HTML elements as component ' + 35869 'id: ' + name 35870 ); 35871 } 35872} 35873 35874/** 35875 * Ensure all props option syntax are normalized into the 35876 * Object-based format. 35877 */ 35878function normalizeProps (options, vm) { 35879 var props = options.props; 35880 if (!props) { return } 35881 var res = {}; 35882 var i, val, name; 35883 if (Array.isArray(props)) { 35884 i = props.length; 35885 while (i--) { 35886 val = props[i]; 35887 if (typeof val === 'string') { 35888 name = camelize(val); 35889 res[name] = { type: null }; 35890 } else if (true) { 35891 warn('props must be strings when using array syntax.'); 35892 } 35893 } 35894 } else if (isPlainObject(props)) { 35895 for (var key in props) { 35896 val = props[key]; 35897 name = camelize(key); 35898 res[name] = isPlainObject(val) 35899 ? val 35900 : { type: val }; 35901 } 35902 } else if (true) { 35903 warn( 35904 "Invalid value for option \"props\": expected an Array or an Object, " + 35905 "but got " + (toRawType(props)) + ".", 35906 vm 35907 ); 35908 } 35909 options.props = res; 35910} 35911 35912/** 35913 * Normalize all injections into Object-based format 35914 */ 35915function normalizeInject (options, vm) { 35916 var inject = options.inject; 35917 if (!inject) { return } 35918 var normalized = options.inject = {}; 35919 if (Array.isArray(inject)) { 35920 for (var i = 0; i < inject.length; i++) { 35921 normalized[inject[i]] = { from: inject[i] }; 35922 } 35923 } else if (isPlainObject(inject)) { 35924 for (var key in inject) { 35925 var val = inject[key]; 35926 normalized[key] = isPlainObject(val) 35927 ? extend({ from: key }, val) 35928 : { from: val }; 35929 } 35930 } else if (true) { 35931 warn( 35932 "Invalid value for option \"inject\": expected an Array or an Object, " + 35933 "but got " + (toRawType(inject)) + ".", 35934 vm 35935 ); 35936 } 35937} 35938 35939/** 35940 * Normalize raw function directives into object format. 35941 */ 35942function normalizeDirectives (options) { 35943 var dirs = options.directives; 35944 if (dirs) { 35945 for (var key in dirs) { 35946 var def$$1 = dirs[key]; 35947 if (typeof def$$1 === 'function') { 35948 dirs[key] = { bind: def$$1, update: def$$1 }; 35949 } 35950 } 35951 } 35952} 35953 35954function assertObjectType (name, value, vm) { 35955 if (!isPlainObject(value)) { 35956 warn( 35957 "Invalid value for option \"" + name + "\": expected an Object, " + 35958 "but got " + (toRawType(value)) + ".", 35959 vm 35960 ); 35961 } 35962} 35963 35964/** 35965 * Merge two option objects into a new one. 35966 * Core utility used in both instantiation and inheritance. 35967 */ 35968function mergeOptions ( 35969 parent, 35970 child, 35971 vm 35972) { 35973 if (true) { 35974 checkComponents(child); 35975 } 35976 35977 if (typeof child === 'function') { 35978 child = child.options; 35979 } 35980 35981 normalizeProps(child, vm); 35982 normalizeInject(child, vm); 35983 normalizeDirectives(child); 35984 35985 // Apply extends and mixins on the child options, 35986 // but only if it is a raw options object that isn't 35987 // the result of another mergeOptions call. 35988 // Only merged options has the _base property. 35989 if (!child._base) { 35990 if (child.extends) { 35991 parent = mergeOptions(parent, child.extends, vm); 35992 } 35993 if (child.mixins) { 35994 for (var i = 0, l = child.mixins.length; i < l; i++) { 35995 parent = mergeOptions(parent, child.mixins[i], vm); 35996 } 35997 } 35998 } 35999 36000 var options = {}; 36001 var key; 36002 for (key in parent) { 36003 mergeField(key); 36004 } 36005 for (key in child) { 36006 if (!hasOwn(parent, key)) { 36007 mergeField(key); 36008 } 36009 } 36010 function mergeField (key) { 36011 var strat = strats[key] || defaultStrat; 36012 options[key] = strat(parent[key], child[key], vm, key); 36013 } 36014 return options 36015} 36016 36017/** 36018 * Resolve an asset. 36019 * This function is used because child instances need access 36020 * to assets defined in its ancestor chain. 36021 */ 36022function resolveAsset ( 36023 options, 36024 type, 36025 id, 36026 warnMissing 36027) { 36028 /* istanbul ignore if */ 36029 if (typeof id !== 'string') { 36030 return 36031 } 36032 var assets = options[type]; 36033 // check local registration variations first 36034 if (hasOwn(assets, id)) { return assets[id] } 36035 var camelizedId = camelize(id); 36036 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } 36037 var PascalCaseId = capitalize(camelizedId); 36038 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } 36039 // fallback to prototype chain 36040 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; 36041 if ( true && warnMissing && !res) { 36042 warn( 36043 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, 36044 options 36045 ); 36046 } 36047 return res 36048} 36049 36050/* */ 36051 36052 36053 36054function validateProp ( 36055 key, 36056 propOptions, 36057 propsData, 36058 vm 36059) { 36060 var prop = propOptions[key]; 36061 var absent = !hasOwn(propsData, key); 36062 var value = propsData[key]; 36063 // boolean casting 36064 var booleanIndex = getTypeIndex(Boolean, prop.type); 36065 if (booleanIndex > -1) { 36066 if (absent && !hasOwn(prop, 'default')) { 36067 value = false; 36068 } else if (value === '' || value === hyphenate(key)) { 36069 // only cast empty string / same name to boolean if 36070 // boolean has higher priority 36071 var stringIndex = getTypeIndex(String, prop.type); 36072 if (stringIndex < 0 || booleanIndex < stringIndex) { 36073 value = true; 36074 } 36075 } 36076 } 36077 // check default value 36078 if (value === undefined) { 36079 value = getPropDefaultValue(vm, prop, key); 36080 // since the default value is a fresh copy, 36081 // make sure to observe it. 36082 var prevShouldObserve = shouldObserve; 36083 toggleObserving(true); 36084 observe(value); 36085 toggleObserving(prevShouldObserve); 36086 } 36087 if ( 36088 true 36089 ) { 36090 assertProp(prop, key, value, vm, absent); 36091 } 36092 return value 36093} 36094 36095/** 36096 * Get the default value of a prop. 36097 */ 36098function getPropDefaultValue (vm, prop, key) { 36099 // no default, return undefined 36100 if (!hasOwn(prop, 'default')) { 36101 return undefined 36102 } 36103 var def = prop.default; 36104 // warn against non-factory defaults for Object & Array 36105 if ( true && isObject(def)) { 36106 warn( 36107 'Invalid default value for prop "' + key + '": ' + 36108 'Props with type Object/Array must use a factory function ' + 36109 'to return the default value.', 36110 vm 36111 ); 36112 } 36113 // the raw prop value was also undefined from previous render, 36114 // return previous default value to avoid unnecessary watcher trigger 36115 if (vm && vm.$options.propsData && 36116 vm.$options.propsData[key] === undefined && 36117 vm._props[key] !== undefined 36118 ) { 36119 return vm._props[key] 36120 } 36121 // call factory function for non-Function types 36122 // a value is Function if its prototype is function even across different execution context 36123 return typeof def === 'function' && getType(prop.type) !== 'Function' 36124 ? def.call(vm) 36125 : def 36126} 36127 36128/** 36129 * Assert whether a prop is valid. 36130 */ 36131function assertProp ( 36132 prop, 36133 name, 36134 value, 36135 vm, 36136 absent 36137) { 36138 if (prop.required && absent) { 36139 warn( 36140 'Missing required prop: "' + name + '"', 36141 vm 36142 ); 36143 return 36144 } 36145 if (value == null && !prop.required) { 36146 return 36147 } 36148 var type = prop.type; 36149 var valid = !type || type === true; 36150 var expectedTypes = []; 36151 if (type) { 36152 if (!Array.isArray(type)) { 36153 type = [type]; 36154 } 36155 for (var i = 0; i < type.length && !valid; i++) { 36156 var assertedType = assertType(value, type[i], vm); 36157 expectedTypes.push(assertedType.expectedType || ''); 36158 valid = assertedType.valid; 36159 } 36160 } 36161 36162 var haveExpectedTypes = expectedTypes.some(function (t) { return t; }); 36163 if (!valid && haveExpectedTypes) { 36164 warn( 36165 getInvalidTypeMessage(name, value, expectedTypes), 36166 vm 36167 ); 36168 return 36169 } 36170 var validator = prop.validator; 36171 if (validator) { 36172 if (!validator(value)) { 36173 warn( 36174 'Invalid prop: custom validator check failed for prop "' + name + '".', 36175 vm 36176 ); 36177 } 36178 } 36179} 36180 36181var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/; 36182 36183function assertType (value, type, vm) { 36184 var valid; 36185 var expectedType = getType(type); 36186 if (simpleCheckRE.test(expectedType)) { 36187 var t = typeof value; 36188 valid = t === expectedType.toLowerCase(); 36189 // for primitive wrapper objects 36190 if (!valid && t === 'object') { 36191 valid = value instanceof type; 36192 } 36193 } else if (expectedType === 'Object') { 36194 valid = isPlainObject(value); 36195 } else if (expectedType === 'Array') { 36196 valid = Array.isArray(value); 36197 } else { 36198 try { 36199 valid = value instanceof type; 36200 } catch (e) { 36201 warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm); 36202 valid = false; 36203 } 36204 } 36205 return { 36206 valid: valid, 36207 expectedType: expectedType 36208 } 36209} 36210 36211var functionTypeCheckRE = /^\s*function (\w+)/; 36212 36213/** 36214 * Use function string name to check built-in types, 36215 * because a simple equality check will fail when running 36216 * across different vms / iframes. 36217 */ 36218function getType (fn) { 36219 var match = fn && fn.toString().match(functionTypeCheckRE); 36220 return match ? match[1] : '' 36221} 36222 36223function isSameType (a, b) { 36224 return getType(a) === getType(b) 36225} 36226 36227function getTypeIndex (type, expectedTypes) { 36228 if (!Array.isArray(expectedTypes)) { 36229 return isSameType(expectedTypes, type) ? 0 : -1 36230 } 36231 for (var i = 0, len = expectedTypes.length; i < len; i++) { 36232 if (isSameType(expectedTypes[i], type)) { 36233 return i 36234 } 36235 } 36236 return -1 36237} 36238 36239function getInvalidTypeMessage (name, value, expectedTypes) { 36240 var message = "Invalid prop: type check failed for prop \"" + name + "\"." + 36241 " Expected " + (expectedTypes.map(capitalize).join(', ')); 36242 var expectedType = expectedTypes[0]; 36243 var receivedType = toRawType(value); 36244 // check if we need to specify expected value 36245 if ( 36246 expectedTypes.length === 1 && 36247 isExplicable(expectedType) && 36248 isExplicable(typeof value) && 36249 !isBoolean(expectedType, receivedType) 36250 ) { 36251 message += " with value " + (styleValue(value, expectedType)); 36252 } 36253 message += ", got " + receivedType + " "; 36254 // check if we need to specify received value 36255 if (isExplicable(receivedType)) { 36256 message += "with value " + (styleValue(value, receivedType)) + "."; 36257 } 36258 return message 36259} 36260 36261function styleValue (value, type) { 36262 if (type === 'String') { 36263 return ("\"" + value + "\"") 36264 } else if (type === 'Number') { 36265 return ("" + (Number(value))) 36266 } else { 36267 return ("" + value) 36268 } 36269} 36270 36271var EXPLICABLE_TYPES = ['string', 'number', 'boolean']; 36272function isExplicable (value) { 36273 return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; }) 36274} 36275 36276function isBoolean () { 36277 var args = [], len = arguments.length; 36278 while ( len-- ) args[ len ] = arguments[ len ]; 36279 36280 return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) 36281} 36282 36283/* */ 36284 36285function handleError (err, vm, info) { 36286 // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. 36287 // See: https://github.com/vuejs/vuex/issues/1505 36288 pushTarget(); 36289 try { 36290 if (vm) { 36291 var cur = vm; 36292 while ((cur = cur.$parent)) { 36293 var hooks = cur.$options.errorCaptured; 36294 if (hooks) { 36295 for (var i = 0; i < hooks.length; i++) { 36296 try { 36297 var capture = hooks[i].call(cur, err, vm, info) === false; 36298 if (capture) { return } 36299 } catch (e) { 36300 globalHandleError(e, cur, 'errorCaptured hook'); 36301 } 36302 } 36303 } 36304 } 36305 } 36306 globalHandleError(err, vm, info); 36307 } finally { 36308 popTarget(); 36309 } 36310} 36311 36312function invokeWithErrorHandling ( 36313 handler, 36314 context, 36315 args, 36316 vm, 36317 info 36318) { 36319 var res; 36320 try { 36321 res = args ? handler.apply(context, args) : handler.call(context); 36322 if (res && !res._isVue && isPromise(res) && !res._handled) { 36323 res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); 36324 // issue #9511 36325 // avoid catch triggering multiple times when nested calls 36326 res._handled = true; 36327 } 36328 } catch (e) { 36329 handleError(e, vm, info); 36330 } 36331 return res 36332} 36333 36334function globalHandleError (err, vm, info) { 36335 if (config.errorHandler) { 36336 try { 36337 return config.errorHandler.call(null, err, vm, info) 36338 } catch (e) { 36339 // if the user intentionally throws the original error in the handler, 36340 // do not log it twice 36341 if (e !== err) { 36342 logError(e, null, 'config.errorHandler'); 36343 } 36344 } 36345 } 36346 logError(err, vm, info); 36347} 36348 36349function logError (err, vm, info) { 36350 if (true) { 36351 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); 36352 } 36353 /* istanbul ignore else */ 36354 if ((inBrowser || inWeex) && typeof console !== 'undefined') { 36355 console.error(err); 36356 } else { 36357 throw err 36358 } 36359} 36360 36361/* */ 36362 36363var isUsingMicroTask = false; 36364 36365var callbacks = []; 36366var pending = false; 36367 36368function flushCallbacks () { 36369 pending = false; 36370 var copies = callbacks.slice(0); 36371 callbacks.length = 0; 36372 for (var i = 0; i < copies.length; i++) { 36373 copies[i](); 36374 } 36375} 36376 36377// Here we have async deferring wrappers using microtasks. 36378// In 2.5 we used (macro) tasks (in combination with microtasks). 36379// However, it has subtle problems when state is changed right before repaint 36380// (e.g. #6813, out-in transitions). 36381// Also, using (macro) tasks in event handler would cause some weird behaviors 36382// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). 36383// So we now use microtasks everywhere, again. 36384// A major drawback of this tradeoff is that there are some scenarios 36385// where microtasks have too high a priority and fire in between supposedly 36386// sequential events (e.g. #4521, #6690, which have workarounds) 36387// or even between bubbling of the same event (#6566). 36388var timerFunc; 36389 36390// The nextTick behavior leverages the microtask queue, which can be accessed 36391// via either native Promise.then or MutationObserver. 36392// MutationObserver has wider support, however it is seriously bugged in 36393// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It 36394// completely stops working after triggering a few times... so, if native 36395// Promise is available, we will use it: 36396/* istanbul ignore next, $flow-disable-line */ 36397if (typeof Promise !== 'undefined' && isNative(Promise)) { 36398 var p = Promise.resolve(); 36399 timerFunc = function () { 36400 p.then(flushCallbacks); 36401 // In problematic UIWebViews, Promise.then doesn't completely break, but 36402 // it can get stuck in a weird state where callbacks are pushed into the 36403 // microtask queue but the queue isn't being flushed, until the browser 36404 // needs to do some other work, e.g. handle a timer. Therefore we can 36405 // "force" the microtask queue to be flushed by adding an empty timer. 36406 if (isIOS) { setTimeout(noop); } 36407 }; 36408 isUsingMicroTask = true; 36409} else if (!isIE && typeof MutationObserver !== 'undefined' && ( 36410 isNative(MutationObserver) || 36411 // PhantomJS and iOS 7.x 36412 MutationObserver.toString() === '[object MutationObserverConstructor]' 36413)) { 36414 // Use MutationObserver where native Promise is not available, 36415 // e.g. PhantomJS, iOS7, Android 4.4 36416 // (#6466 MutationObserver is unreliable in IE11) 36417 var counter = 1; 36418 var observer = new MutationObserver(flushCallbacks); 36419 var textNode = document.createTextNode(String(counter)); 36420 observer.observe(textNode, { 36421 characterData: true 36422 }); 36423 timerFunc = function () { 36424 counter = (counter + 1) % 2; 36425 textNode.data = String(counter); 36426 }; 36427 isUsingMicroTask = true; 36428} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { 36429 // Fallback to setImmediate. 36430 // Technically it leverages the (macro) task queue, 36431 // but it is still a better choice than setTimeout. 36432 timerFunc = function () { 36433 setImmediate(flushCallbacks); 36434 }; 36435} else { 36436 // Fallback to setTimeout. 36437 timerFunc = function () { 36438 setTimeout(flushCallbacks, 0); 36439 }; 36440} 36441 36442function nextTick (cb, ctx) { 36443 var _resolve; 36444 callbacks.push(function () { 36445 if (cb) { 36446 try { 36447 cb.call(ctx); 36448 } catch (e) { 36449 handleError(e, ctx, 'nextTick'); 36450 } 36451 } else if (_resolve) { 36452 _resolve(ctx); 36453 } 36454 }); 36455 if (!pending) { 36456 pending = true; 36457 timerFunc(); 36458 } 36459 // $flow-disable-line 36460 if (!cb && typeof Promise !== 'undefined') { 36461 return new Promise(function (resolve) { 36462 _resolve = resolve; 36463 }) 36464 } 36465} 36466 36467/* */ 36468 36469var mark; 36470var measure; 36471 36472if (true) { 36473 var perf = inBrowser && window.performance; 36474 /* istanbul ignore if */ 36475 if ( 36476 perf && 36477 perf.mark && 36478 perf.measure && 36479 perf.clearMarks && 36480 perf.clearMeasures 36481 ) { 36482 mark = function (tag) { return perf.mark(tag); }; 36483 measure = function (name, startTag, endTag) { 36484 perf.measure(name, startTag, endTag); 36485 perf.clearMarks(startTag); 36486 perf.clearMarks(endTag); 36487 // perf.clearMeasures(name) 36488 }; 36489 } 36490} 36491 36492/* not type checking this file because flow doesn't play well with Proxy */ 36493 36494var initProxy; 36495 36496if (true) { 36497 var allowedGlobals = makeMap( 36498 'Infinity,undefined,NaN,isFinite,isNaN,' + 36499 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 36500 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' + 36501 'require' // for Webpack/Browserify 36502 ); 36503 36504 var warnNonPresent = function (target, key) { 36505 warn( 36506 "Property or method \"" + key + "\" is not defined on the instance but " + 36507 'referenced during render. Make sure that this property is reactive, ' + 36508 'either in the data option, or for class-based components, by ' + 36509 'initializing the property. ' + 36510 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', 36511 target 36512 ); 36513 }; 36514 36515 var warnReservedPrefix = function (target, key) { 36516 warn( 36517 "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 36518 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 36519 'prevent conflicts with Vue internals. ' + 36520 'See: https://vuejs.org/v2/api/#data', 36521 target 36522 ); 36523 }; 36524 36525 var hasProxy = 36526 typeof Proxy !== 'undefined' && isNative(Proxy); 36527 36528 if (hasProxy) { 36529 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); 36530 config.keyCodes = new Proxy(config.keyCodes, { 36531 set: function set (target, key, value) { 36532 if (isBuiltInModifier(key)) { 36533 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); 36534 return false 36535 } else { 36536 target[key] = value; 36537 return true 36538 } 36539 } 36540 }); 36541 } 36542 36543 var hasHandler = { 36544 has: function has (target, key) { 36545 var has = key in target; 36546 var isAllowed = allowedGlobals(key) || 36547 (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); 36548 if (!has && !isAllowed) { 36549 if (key in target.$data) { warnReservedPrefix(target, key); } 36550 else { warnNonPresent(target, key); } 36551 } 36552 return has || !isAllowed 36553 } 36554 }; 36555 36556 var getHandler = { 36557 get: function get (target, key) { 36558 if (typeof key === 'string' && !(key in target)) { 36559 if (key in target.$data) { warnReservedPrefix(target, key); } 36560 else { warnNonPresent(target, key); } 36561 } 36562 return target[key] 36563 } 36564 }; 36565 36566 initProxy = function initProxy (vm) { 36567 if (hasProxy) { 36568 // determine which proxy handler to use 36569 var options = vm.$options; 36570 var handlers = options.render && options.render._withStripped 36571 ? getHandler 36572 : hasHandler; 36573 vm._renderProxy = new Proxy(vm, handlers); 36574 } else { 36575 vm._renderProxy = vm; 36576 } 36577 }; 36578} 36579 36580/* */ 36581 36582var seenObjects = new _Set(); 36583 36584/** 36585 * Recursively traverse an object to evoke all converted 36586 * getters, so that every nested property inside the object 36587 * is collected as a "deep" dependency. 36588 */ 36589function traverse (val) { 36590 _traverse(val, seenObjects); 36591 seenObjects.clear(); 36592} 36593 36594function _traverse (val, seen) { 36595 var i, keys; 36596 var isA = Array.isArray(val); 36597 if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { 36598 return 36599 } 36600 if (val.__ob__) { 36601 var depId = val.__ob__.dep.id; 36602 if (seen.has(depId)) { 36603 return 36604 } 36605 seen.add(depId); 36606 } 36607 if (isA) { 36608 i = val.length; 36609 while (i--) { _traverse(val[i], seen); } 36610 } else { 36611 keys = Object.keys(val); 36612 i = keys.length; 36613 while (i--) { _traverse(val[keys[i]], seen); } 36614 } 36615} 36616 36617/* */ 36618 36619var normalizeEvent = cached(function (name) { 36620 var passive = name.charAt(0) === '&'; 36621 name = passive ? name.slice(1) : name; 36622 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first 36623 name = once$$1 ? name.slice(1) : name; 36624 var capture = name.charAt(0) === '!'; 36625 name = capture ? name.slice(1) : name; 36626 return { 36627 name: name, 36628 once: once$$1, 36629 capture: capture, 36630 passive: passive 36631 } 36632}); 36633 36634function createFnInvoker (fns, vm) { 36635 function invoker () { 36636 var arguments$1 = arguments; 36637 36638 var fns = invoker.fns; 36639 if (Array.isArray(fns)) { 36640 var cloned = fns.slice(); 36641 for (var i = 0; i < cloned.length; i++) { 36642 invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); 36643 } 36644 } else { 36645 // return handler return value for single handlers 36646 return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") 36647 } 36648 } 36649 invoker.fns = fns; 36650 return invoker 36651} 36652 36653function updateListeners ( 36654 on, 36655 oldOn, 36656 add, 36657 remove$$1, 36658 createOnceHandler, 36659 vm 36660) { 36661 var name, def$$1, cur, old, event; 36662 for (name in on) { 36663 def$$1 = cur = on[name]; 36664 old = oldOn[name]; 36665 event = normalizeEvent(name); 36666 if (isUndef(cur)) { 36667 true && warn( 36668 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), 36669 vm 36670 ); 36671 } else if (isUndef(old)) { 36672 if (isUndef(cur.fns)) { 36673 cur = on[name] = createFnInvoker(cur, vm); 36674 } 36675 if (isTrue(event.once)) { 36676 cur = on[name] = createOnceHandler(event.name, cur, event.capture); 36677 } 36678 add(event.name, cur, event.capture, event.passive, event.params); 36679 } else if (cur !== old) { 36680 old.fns = cur; 36681 on[name] = old; 36682 } 36683 } 36684 for (name in oldOn) { 36685 if (isUndef(on[name])) { 36686 event = normalizeEvent(name); 36687 remove$$1(event.name, oldOn[name], event.capture); 36688 } 36689 } 36690} 36691 36692/* */ 36693 36694function mergeVNodeHook (def, hookKey, hook) { 36695 if (def instanceof VNode) { 36696 def = def.data.hook || (def.data.hook = {}); 36697 } 36698 var invoker; 36699 var oldHook = def[hookKey]; 36700 36701 function wrappedHook () { 36702 hook.apply(this, arguments); 36703 // important: remove merged hook to ensure it's called only once 36704 // and prevent memory leak 36705 remove(invoker.fns, wrappedHook); 36706 } 36707 36708 if (isUndef(oldHook)) { 36709 // no existing hook 36710 invoker = createFnInvoker([wrappedHook]); 36711 } else { 36712 /* istanbul ignore if */ 36713 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { 36714 // already a merged invoker 36715 invoker = oldHook; 36716 invoker.fns.push(wrappedHook); 36717 } else { 36718 // existing plain hook 36719 invoker = createFnInvoker([oldHook, wrappedHook]); 36720 } 36721 } 36722 36723 invoker.merged = true; 36724 def[hookKey] = invoker; 36725} 36726 36727/* */ 36728 36729function extractPropsFromVNodeData ( 36730 data, 36731 Ctor, 36732 tag 36733) { 36734 // we are only extracting raw values here. 36735 // validation and default values are handled in the child 36736 // component itself. 36737 var propOptions = Ctor.options.props; 36738 if (isUndef(propOptions)) { 36739 return 36740 } 36741 var res = {}; 36742 var attrs = data.attrs; 36743 var props = data.props; 36744 if (isDef(attrs) || isDef(props)) { 36745 for (var key in propOptions) { 36746 var altKey = hyphenate(key); 36747 if (true) { 36748 var keyInLowerCase = key.toLowerCase(); 36749 if ( 36750 key !== keyInLowerCase && 36751 attrs && hasOwn(attrs, keyInLowerCase) 36752 ) { 36753 tip( 36754 "Prop \"" + keyInLowerCase + "\" is passed to component " + 36755 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + 36756 " \"" + key + "\". " + 36757 "Note that HTML attributes are case-insensitive and camelCased " + 36758 "props need to use their kebab-case equivalents when using in-DOM " + 36759 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." 36760 ); 36761 } 36762 } 36763 checkProp(res, props, key, altKey, true) || 36764 checkProp(res, attrs, key, altKey, false); 36765 } 36766 } 36767 return res 36768} 36769 36770function checkProp ( 36771 res, 36772 hash, 36773 key, 36774 altKey, 36775 preserve 36776) { 36777 if (isDef(hash)) { 36778 if (hasOwn(hash, key)) { 36779 res[key] = hash[key]; 36780 if (!preserve) { 36781 delete hash[key]; 36782 } 36783 return true 36784 } else if (hasOwn(hash, altKey)) { 36785 res[key] = hash[altKey]; 36786 if (!preserve) { 36787 delete hash[altKey]; 36788 } 36789 return true 36790 } 36791 } 36792 return false 36793} 36794 36795/* */ 36796 36797// The template compiler attempts to minimize the need for normalization by 36798// statically analyzing the template at compile time. 36799// 36800// For plain HTML markup, normalization can be completely skipped because the 36801// generated render function is guaranteed to return Array<VNode>. There are 36802// two cases where extra normalization is needed: 36803 36804// 1. When the children contains components - because a functional component 36805// may return an Array instead of a single root. In this case, just a simple 36806// normalization is needed - if any child is an Array, we flatten the whole 36807// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep 36808// because functional components already normalize their own children. 36809function simpleNormalizeChildren (children) { 36810 for (var i = 0; i < children.length; i++) { 36811 if (Array.isArray(children[i])) { 36812 return Array.prototype.concat.apply([], children) 36813 } 36814 } 36815 return children 36816} 36817 36818// 2. When the children contains constructs that always generated nested Arrays, 36819// e.g. <template>, <slot>, v-for, or when the children is provided by user 36820// with hand-written render functions / JSX. In such cases a full normalization 36821// is needed to cater to all possible types of children values. 36822function normalizeChildren (children) { 36823 return isPrimitive(children) 36824 ? [createTextVNode(children)] 36825 : Array.isArray(children) 36826 ? normalizeArrayChildren(children) 36827 : undefined 36828} 36829 36830function isTextNode (node) { 36831 return isDef(node) && isDef(node.text) && isFalse(node.isComment) 36832} 36833 36834function normalizeArrayChildren (children, nestedIndex) { 36835 var res = []; 36836 var i, c, lastIndex, last; 36837 for (i = 0; i < children.length; i++) { 36838 c = children[i]; 36839 if (isUndef(c) || typeof c === 'boolean') { continue } 36840 lastIndex = res.length - 1; 36841 last = res[lastIndex]; 36842 // nested 36843 if (Array.isArray(c)) { 36844 if (c.length > 0) { 36845 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); 36846 // merge adjacent text nodes 36847 if (isTextNode(c[0]) && isTextNode(last)) { 36848 res[lastIndex] = createTextVNode(last.text + (c[0]).text); 36849 c.shift(); 36850 } 36851 res.push.apply(res, c); 36852 } 36853 } else if (isPrimitive(c)) { 36854 if (isTextNode(last)) { 36855 // merge adjacent text nodes 36856 // this is necessary for SSR hydration because text nodes are 36857 // essentially merged when rendered to HTML strings 36858 res[lastIndex] = createTextVNode(last.text + c); 36859 } else if (c !== '') { 36860 // convert primitive to vnode 36861 res.push(createTextVNode(c)); 36862 } 36863 } else { 36864 if (isTextNode(c) && isTextNode(last)) { 36865 // merge adjacent text nodes 36866 res[lastIndex] = createTextVNode(last.text + c.text); 36867 } else { 36868 // default key for nested array children (likely generated by v-for) 36869 if (isTrue(children._isVList) && 36870 isDef(c.tag) && 36871 isUndef(c.key) && 36872 isDef(nestedIndex)) { 36873 c.key = "__vlist" + nestedIndex + "_" + i + "__"; 36874 } 36875 res.push(c); 36876 } 36877 } 36878 } 36879 return res 36880} 36881 36882/* */ 36883 36884function initProvide (vm) { 36885 var provide = vm.$options.provide; 36886 if (provide) { 36887 vm._provided = typeof provide === 'function' 36888 ? provide.call(vm) 36889 : provide; 36890 } 36891} 36892 36893function initInjections (vm) { 36894 var result = resolveInject(vm.$options.inject, vm); 36895 if (result) { 36896 toggleObserving(false); 36897 Object.keys(result).forEach(function (key) { 36898 /* istanbul ignore else */ 36899 if (true) { 36900 defineReactive$$1(vm, key, result[key], function () { 36901 warn( 36902 "Avoid mutating an injected value directly since the changes will be " + 36903 "overwritten whenever the provided component re-renders. " + 36904 "injection being mutated: \"" + key + "\"", 36905 vm 36906 ); 36907 }); 36908 } else {} 36909 }); 36910 toggleObserving(true); 36911 } 36912} 36913 36914function resolveInject (inject, vm) { 36915 if (inject) { 36916 // inject is :any because flow is not smart enough to figure out cached 36917 var result = Object.create(null); 36918 var keys = hasSymbol 36919 ? Reflect.ownKeys(inject) 36920 : Object.keys(inject); 36921 36922 for (var i = 0; i < keys.length; i++) { 36923 var key = keys[i]; 36924 // #6574 in case the inject object is observed... 36925 if (key === '__ob__') { continue } 36926 var provideKey = inject[key].from; 36927 var source = vm; 36928 while (source) { 36929 if (source._provided && hasOwn(source._provided, provideKey)) { 36930 result[key] = source._provided[provideKey]; 36931 break 36932 } 36933 source = source.$parent; 36934 } 36935 if (!source) { 36936 if ('default' in inject[key]) { 36937 var provideDefault = inject[key].default; 36938 result[key] = typeof provideDefault === 'function' 36939 ? provideDefault.call(vm) 36940 : provideDefault; 36941 } else if (true) { 36942 warn(("Injection \"" + key + "\" not found"), vm); 36943 } 36944 } 36945 } 36946 return result 36947 } 36948} 36949 36950/* */ 36951 36952 36953 36954/** 36955 * Runtime helper for resolving raw children VNodes into a slot object. 36956 */ 36957function resolveSlots ( 36958 children, 36959 context 36960) { 36961 if (!children || !children.length) { 36962 return {} 36963 } 36964 var slots = {}; 36965 for (var i = 0, l = children.length; i < l; i++) { 36966 var child = children[i]; 36967 var data = child.data; 36968 // remove slot attribute if the node is resolved as a Vue slot node 36969 if (data && data.attrs && data.attrs.slot) { 36970 delete data.attrs.slot; 36971 } 36972 // named slots should only be respected if the vnode was rendered in the 36973 // same context. 36974 if ((child.context === context || child.fnContext === context) && 36975 data && data.slot != null 36976 ) { 36977 var name = data.slot; 36978 var slot = (slots[name] || (slots[name] = [])); 36979 if (child.tag === 'template') { 36980 slot.push.apply(slot, child.children || []); 36981 } else { 36982 slot.push(child); 36983 } 36984 } else { 36985 (slots.default || (slots.default = [])).push(child); 36986 } 36987 } 36988 // ignore slots that contains only whitespace 36989 for (var name$1 in slots) { 36990 if (slots[name$1].every(isWhitespace)) { 36991 delete slots[name$1]; 36992 } 36993 } 36994 return slots 36995} 36996 36997function isWhitespace (node) { 36998 return (node.isComment && !node.asyncFactory) || node.text === ' ' 36999} 37000 37001/* */ 37002 37003function isAsyncPlaceholder (node) { 37004 return node.isComment && node.asyncFactory 37005} 37006 37007/* */ 37008 37009function normalizeScopedSlots ( 37010 slots, 37011 normalSlots, 37012 prevSlots 37013) { 37014 var res; 37015 var hasNormalSlots = Object.keys(normalSlots).length > 0; 37016 var isStable = slots ? !!slots.$stable : !hasNormalSlots; 37017 var key = slots && slots.$key; 37018 if (!slots) { 37019 res = {}; 37020 } else if (slots._normalized) { 37021 // fast path 1: child component re-render only, parent did not change 37022 return slots._normalized 37023 } else if ( 37024 isStable && 37025 prevSlots && 37026 prevSlots !== emptyObject && 37027 key === prevSlots.$key && 37028 !hasNormalSlots && 37029 !prevSlots.$hasNormal 37030 ) { 37031 // fast path 2: stable scoped slots w/ no normal slots to proxy, 37032 // only need to normalize once 37033 return prevSlots 37034 } else { 37035 res = {}; 37036 for (var key$1 in slots) { 37037 if (slots[key$1] && key$1[0] !== '$') { 37038 res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]); 37039 } 37040 } 37041 } 37042 // expose normal slots on scopedSlots 37043 for (var key$2 in normalSlots) { 37044 if (!(key$2 in res)) { 37045 res[key$2] = proxyNormalSlot(normalSlots, key$2); 37046 } 37047 } 37048 // avoriaz seems to mock a non-extensible $scopedSlots object 37049 // and when that is passed down this would cause an error 37050 if (slots && Object.isExtensible(slots)) { 37051 (slots)._normalized = res; 37052 } 37053 def(res, '$stable', isStable); 37054 def(res, '$key', key); 37055 def(res, '$hasNormal', hasNormalSlots); 37056 return res 37057} 37058 37059function normalizeScopedSlot(normalSlots, key, fn) { 37060 var normalized = function () { 37061 var res = arguments.length ? fn.apply(null, arguments) : fn({}); 37062 res = res && typeof res === 'object' && !Array.isArray(res) 37063 ? [res] // single vnode 37064 : normalizeChildren(res); 37065 var vnode = res && res[0]; 37066 return res && ( 37067 !vnode || 37068 (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391 37069 ) ? undefined 37070 : res 37071 }; 37072 // this is a slot using the new v-slot syntax without scope. although it is 37073 // compiled as a scoped slot, render fn users would expect it to be present 37074 // on this.$slots because the usage is semantically a normal slot. 37075 if (fn.proxy) { 37076 Object.defineProperty(normalSlots, key, { 37077 get: normalized, 37078 enumerable: true, 37079 configurable: true 37080 }); 37081 } 37082 return normalized 37083} 37084 37085function proxyNormalSlot(slots, key) { 37086 return function () { return slots[key]; } 37087} 37088 37089/* */ 37090 37091/** 37092 * Runtime helper for rendering v-for lists. 37093 */ 37094function renderList ( 37095 val, 37096 render 37097) { 37098 var ret, i, l, keys, key; 37099 if (Array.isArray(val) || typeof val === 'string') { 37100 ret = new Array(val.length); 37101 for (i = 0, l = val.length; i < l; i++) { 37102 ret[i] = render(val[i], i); 37103 } 37104 } else if (typeof val === 'number') { 37105 ret = new Array(val); 37106 for (i = 0; i < val; i++) { 37107 ret[i] = render(i + 1, i); 37108 } 37109 } else if (isObject(val)) { 37110 if (hasSymbol && val[Symbol.iterator]) { 37111 ret = []; 37112 var iterator = val[Symbol.iterator](); 37113 var result = iterator.next(); 37114 while (!result.done) { 37115 ret.push(render(result.value, ret.length)); 37116 result = iterator.next(); 37117 } 37118 } else { 37119 keys = Object.keys(val); 37120 ret = new Array(keys.length); 37121 for (i = 0, l = keys.length; i < l; i++) { 37122 key = keys[i]; 37123 ret[i] = render(val[key], key, i); 37124 } 37125 } 37126 } 37127 if (!isDef(ret)) { 37128 ret = []; 37129 } 37130 (ret)._isVList = true; 37131 return ret 37132} 37133 37134/* */ 37135 37136/** 37137 * Runtime helper for rendering <slot> 37138 */ 37139function renderSlot ( 37140 name, 37141 fallbackRender, 37142 props, 37143 bindObject 37144) { 37145 var scopedSlotFn = this.$scopedSlots[name]; 37146 var nodes; 37147 if (scopedSlotFn) { 37148 // scoped slot 37149 props = props || {}; 37150 if (bindObject) { 37151 if ( true && !isObject(bindObject)) { 37152 warn('slot v-bind without argument expects an Object', this); 37153 } 37154 props = extend(extend({}, bindObject), props); 37155 } 37156 nodes = 37157 scopedSlotFn(props) || 37158 (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender); 37159 } else { 37160 nodes = 37161 this.$slots[name] || 37162 (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender); 37163 } 37164 37165 var target = props && props.slot; 37166 if (target) { 37167 return this.$createElement('template', { slot: target }, nodes) 37168 } else { 37169 return nodes 37170 } 37171} 37172 37173/* */ 37174 37175/** 37176 * Runtime helper for resolving filters 37177 */ 37178function resolveFilter (id) { 37179 return resolveAsset(this.$options, 'filters', id, true) || identity 37180} 37181 37182/* */ 37183 37184function isKeyNotMatch (expect, actual) { 37185 if (Array.isArray(expect)) { 37186 return expect.indexOf(actual) === -1 37187 } else { 37188 return expect !== actual 37189 } 37190} 37191 37192/** 37193 * Runtime helper for checking keyCodes from config. 37194 * exposed as Vue.prototype._k 37195 * passing in eventKeyName as last argument separately for backwards compat 37196 */ 37197function checkKeyCodes ( 37198 eventKeyCode, 37199 key, 37200 builtInKeyCode, 37201 eventKeyName, 37202 builtInKeyName 37203) { 37204 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; 37205 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { 37206 return isKeyNotMatch(builtInKeyName, eventKeyName) 37207 } else if (mappedKeyCode) { 37208 return isKeyNotMatch(mappedKeyCode, eventKeyCode) 37209 } else if (eventKeyName) { 37210 return hyphenate(eventKeyName) !== key 37211 } 37212 return eventKeyCode === undefined 37213} 37214 37215/* */ 37216 37217/** 37218 * Runtime helper for merging v-bind="object" into a VNode's data. 37219 */ 37220function bindObjectProps ( 37221 data, 37222 tag, 37223 value, 37224 asProp, 37225 isSync 37226) { 37227 if (value) { 37228 if (!isObject(value)) { 37229 true && warn( 37230 'v-bind without argument expects an Object or Array value', 37231 this 37232 ); 37233 } else { 37234 if (Array.isArray(value)) { 37235 value = toObject(value); 37236 } 37237 var hash; 37238 var loop = function ( key ) { 37239 if ( 37240 key === 'class' || 37241 key === 'style' || 37242 isReservedAttribute(key) 37243 ) { 37244 hash = data; 37245 } else { 37246 var type = data.attrs && data.attrs.type; 37247 hash = asProp || config.mustUseProp(tag, type, key) 37248 ? data.domProps || (data.domProps = {}) 37249 : data.attrs || (data.attrs = {}); 37250 } 37251 var camelizedKey = camelize(key); 37252 var hyphenatedKey = hyphenate(key); 37253 if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) { 37254 hash[key] = value[key]; 37255 37256 if (isSync) { 37257 var on = data.on || (data.on = {}); 37258 on[("update:" + key)] = function ($event) { 37259 value[key] = $event; 37260 }; 37261 } 37262 } 37263 }; 37264 37265 for (var key in value) loop( key ); 37266 } 37267 } 37268 return data 37269} 37270 37271/* */ 37272 37273/** 37274 * Runtime helper for rendering static trees. 37275 */ 37276function renderStatic ( 37277 index, 37278 isInFor 37279) { 37280 var cached = this._staticTrees || (this._staticTrees = []); 37281 var tree = cached[index]; 37282 // if has already-rendered static tree and not inside v-for, 37283 // we can reuse the same tree. 37284 if (tree && !isInFor) { 37285 return tree 37286 } 37287 // otherwise, render a fresh tree. 37288 tree = cached[index] = this.$options.staticRenderFns[index].call( 37289 this._renderProxy, 37290 null, 37291 this // for render fns generated for functional component templates 37292 ); 37293 markStatic(tree, ("__static__" + index), false); 37294 return tree 37295} 37296 37297/** 37298 * Runtime helper for v-once. 37299 * Effectively it means marking the node as static with a unique key. 37300 */ 37301function markOnce ( 37302 tree, 37303 index, 37304 key 37305) { 37306 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); 37307 return tree 37308} 37309 37310function markStatic ( 37311 tree, 37312 key, 37313 isOnce 37314) { 37315 if (Array.isArray(tree)) { 37316 for (var i = 0; i < tree.length; i++) { 37317 if (tree[i] && typeof tree[i] !== 'string') { 37318 markStaticNode(tree[i], (key + "_" + i), isOnce); 37319 } 37320 } 37321 } else { 37322 markStaticNode(tree, key, isOnce); 37323 } 37324} 37325 37326function markStaticNode (node, key, isOnce) { 37327 node.isStatic = true; 37328 node.key = key; 37329 node.isOnce = isOnce; 37330} 37331 37332/* */ 37333 37334function bindObjectListeners (data, value) { 37335 if (value) { 37336 if (!isPlainObject(value)) { 37337 true && warn( 37338 'v-on without argument expects an Object value', 37339 this 37340 ); 37341 } else { 37342 var on = data.on = data.on ? extend({}, data.on) : {}; 37343 for (var key in value) { 37344 var existing = on[key]; 37345 var ours = value[key]; 37346 on[key] = existing ? [].concat(existing, ours) : ours; 37347 } 37348 } 37349 } 37350 return data 37351} 37352 37353/* */ 37354 37355function resolveScopedSlots ( 37356 fns, // see flow/vnode 37357 res, 37358 // the following are added in 2.6 37359 hasDynamicKeys, 37360 contentHashKey 37361) { 37362 res = res || { $stable: !hasDynamicKeys }; 37363 for (var i = 0; i < fns.length; i++) { 37364 var slot = fns[i]; 37365 if (Array.isArray(slot)) { 37366 resolveScopedSlots(slot, res, hasDynamicKeys); 37367 } else if (slot) { 37368 // marker for reverse proxying v-slot without scope on this.$slots 37369 if (slot.proxy) { 37370 slot.fn.proxy = true; 37371 } 37372 res[slot.key] = slot.fn; 37373 } 37374 } 37375 if (contentHashKey) { 37376 (res).$key = contentHashKey; 37377 } 37378 return res 37379} 37380 37381/* */ 37382 37383function bindDynamicKeys (baseObj, values) { 37384 for (var i = 0; i < values.length; i += 2) { 37385 var key = values[i]; 37386 if (typeof key === 'string' && key) { 37387 baseObj[values[i]] = values[i + 1]; 37388 } else if ( true && key !== '' && key !== null) { 37389 // null is a special value for explicitly removing a binding 37390 warn( 37391 ("Invalid value for dynamic directive argument (expected string or null): " + key), 37392 this 37393 ); 37394 } 37395 } 37396 return baseObj 37397} 37398 37399// helper to dynamically append modifier runtime markers to event names. 37400// ensure only append when value is already string, otherwise it will be cast 37401// to string and cause the type check to miss. 37402function prependModifier (value, symbol) { 37403 return typeof value === 'string' ? symbol + value : value 37404} 37405 37406/* */ 37407 37408function installRenderHelpers (target) { 37409 target._o = markOnce; 37410 target._n = toNumber; 37411 target._s = toString; 37412 target._l = renderList; 37413 target._t = renderSlot; 37414 target._q = looseEqual; 37415 target._i = looseIndexOf; 37416 target._m = renderStatic; 37417 target._f = resolveFilter; 37418 target._k = checkKeyCodes; 37419 target._b = bindObjectProps; 37420 target._v = createTextVNode; 37421 target._e = createEmptyVNode; 37422 target._u = resolveScopedSlots; 37423 target._g = bindObjectListeners; 37424 target._d = bindDynamicKeys; 37425 target._p = prependModifier; 37426} 37427 37428/* */ 37429 37430function FunctionalRenderContext ( 37431 data, 37432 props, 37433 children, 37434 parent, 37435 Ctor 37436) { 37437 var this$1 = this; 37438 37439 var options = Ctor.options; 37440 // ensure the createElement function in functional components 37441 // gets a unique context - this is necessary for correct named slot check 37442 var contextVm; 37443 if (hasOwn(parent, '_uid')) { 37444 contextVm = Object.create(parent); 37445 // $flow-disable-line 37446 contextVm._original = parent; 37447 } else { 37448 // the context vm passed in is a functional context as well. 37449 // in this case we want to make sure we are able to get a hold to the 37450 // real context instance. 37451 contextVm = parent; 37452 // $flow-disable-line 37453 parent = parent._original; 37454 } 37455 var isCompiled = isTrue(options._compiled); 37456 var needNormalization = !isCompiled; 37457 37458 this.data = data; 37459 this.props = props; 37460 this.children = children; 37461 this.parent = parent; 37462 this.listeners = data.on || emptyObject; 37463 this.injections = resolveInject(options.inject, parent); 37464 this.slots = function () { 37465 if (!this$1.$slots) { 37466 normalizeScopedSlots( 37467 data.scopedSlots, 37468 this$1.$slots = resolveSlots(children, parent) 37469 ); 37470 } 37471 return this$1.$slots 37472 }; 37473 37474 Object.defineProperty(this, 'scopedSlots', ({ 37475 enumerable: true, 37476 get: function get () { 37477 return normalizeScopedSlots(data.scopedSlots, this.slots()) 37478 } 37479 })); 37480 37481 // support for compiled functional template 37482 if (isCompiled) { 37483 // exposing $options for renderStatic() 37484 this.$options = options; 37485 // pre-resolve slots for renderSlot() 37486 this.$slots = this.slots(); 37487 this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); 37488 } 37489 37490 if (options._scopeId) { 37491 this._c = function (a, b, c, d) { 37492 var vnode = createElement(contextVm, a, b, c, d, needNormalization); 37493 if (vnode && !Array.isArray(vnode)) { 37494 vnode.fnScopeId = options._scopeId; 37495 vnode.fnContext = parent; 37496 } 37497 return vnode 37498 }; 37499 } else { 37500 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; 37501 } 37502} 37503 37504installRenderHelpers(FunctionalRenderContext.prototype); 37505 37506function createFunctionalComponent ( 37507 Ctor, 37508 propsData, 37509 data, 37510 contextVm, 37511 children 37512) { 37513 var options = Ctor.options; 37514 var props = {}; 37515 var propOptions = options.props; 37516 if (isDef(propOptions)) { 37517 for (var key in propOptions) { 37518 props[key] = validateProp(key, propOptions, propsData || emptyObject); 37519 } 37520 } else { 37521 if (isDef(data.attrs)) { mergeProps(props, data.attrs); } 37522 if (isDef(data.props)) { mergeProps(props, data.props); } 37523 } 37524 37525 var renderContext = new FunctionalRenderContext( 37526 data, 37527 props, 37528 children, 37529 contextVm, 37530 Ctor 37531 ); 37532 37533 var vnode = options.render.call(null, renderContext._c, renderContext); 37534 37535 if (vnode instanceof VNode) { 37536 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) 37537 } else if (Array.isArray(vnode)) { 37538 var vnodes = normalizeChildren(vnode) || []; 37539 var res = new Array(vnodes.length); 37540 for (var i = 0; i < vnodes.length; i++) { 37541 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); 37542 } 37543 return res 37544 } 37545} 37546 37547function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { 37548 // #7817 clone node before setting fnContext, otherwise if the node is reused 37549 // (e.g. it was from a cached normal slot) the fnContext causes named slots 37550 // that should not be matched to match. 37551 var clone = cloneVNode(vnode); 37552 clone.fnContext = contextVm; 37553 clone.fnOptions = options; 37554 if (true) { 37555 (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; 37556 } 37557 if (data.slot) { 37558 (clone.data || (clone.data = {})).slot = data.slot; 37559 } 37560 return clone 37561} 37562 37563function mergeProps (to, from) { 37564 for (var key in from) { 37565 to[camelize(key)] = from[key]; 37566 } 37567} 37568 37569/* */ 37570 37571/* */ 37572 37573/* */ 37574 37575/* */ 37576 37577// inline hooks to be invoked on component VNodes during patch 37578var componentVNodeHooks = { 37579 init: function init (vnode, hydrating) { 37580 if ( 37581 vnode.componentInstance && 37582 !vnode.componentInstance._isDestroyed && 37583 vnode.data.keepAlive 37584 ) { 37585 // kept-alive components, treat as a patch 37586 var mountedNode = vnode; // work around flow 37587 componentVNodeHooks.prepatch(mountedNode, mountedNode); 37588 } else { 37589 var child = vnode.componentInstance = createComponentInstanceForVnode( 37590 vnode, 37591 activeInstance 37592 ); 37593 child.$mount(hydrating ? vnode.elm : undefined, hydrating); 37594 } 37595 }, 37596 37597 prepatch: function prepatch (oldVnode, vnode) { 37598 var options = vnode.componentOptions; 37599 var child = vnode.componentInstance = oldVnode.componentInstance; 37600 updateChildComponent( 37601 child, 37602 options.propsData, // updated props 37603 options.listeners, // updated listeners 37604 vnode, // new parent vnode 37605 options.children // new children 37606 ); 37607 }, 37608 37609 insert: function insert (vnode) { 37610 var context = vnode.context; 37611 var componentInstance = vnode.componentInstance; 37612 if (!componentInstance._isMounted) { 37613 componentInstance._isMounted = true; 37614 callHook(componentInstance, 'mounted'); 37615 } 37616 if (vnode.data.keepAlive) { 37617 if (context._isMounted) { 37618 // vue-router#1212 37619 // During updates, a kept-alive component's child components may 37620 // change, so directly walking the tree here may call activated hooks 37621 // on incorrect children. Instead we push them into a queue which will 37622 // be processed after the whole patch process ended. 37623 queueActivatedComponent(componentInstance); 37624 } else { 37625 activateChildComponent(componentInstance, true /* direct */); 37626 } 37627 } 37628 }, 37629 37630 destroy: function destroy (vnode) { 37631 var componentInstance = vnode.componentInstance; 37632 if (!componentInstance._isDestroyed) { 37633 if (!vnode.data.keepAlive) { 37634 componentInstance.$destroy(); 37635 } else { 37636 deactivateChildComponent(componentInstance, true /* direct */); 37637 } 37638 } 37639 } 37640}; 37641 37642var hooksToMerge = Object.keys(componentVNodeHooks); 37643 37644function createComponent ( 37645 Ctor, 37646 data, 37647 context, 37648 children, 37649 tag 37650) { 37651 if (isUndef(Ctor)) { 37652 return 37653 } 37654 37655 var baseCtor = context.$options._base; 37656 37657 // plain options object: turn it into a constructor 37658 if (isObject(Ctor)) { 37659 Ctor = baseCtor.extend(Ctor); 37660 } 37661 37662 // if at this stage it's not a constructor or an async component factory, 37663 // reject. 37664 if (typeof Ctor !== 'function') { 37665 if (true) { 37666 warn(("Invalid Component definition: " + (String(Ctor))), context); 37667 } 37668 return 37669 } 37670 37671 // async component 37672 var asyncFactory; 37673 if (isUndef(Ctor.cid)) { 37674 asyncFactory = Ctor; 37675 Ctor = resolveAsyncComponent(asyncFactory, baseCtor); 37676 if (Ctor === undefined) { 37677 // return a placeholder node for async component, which is rendered 37678 // as a comment node but preserves all the raw information for the node. 37679 // the information will be used for async server-rendering and hydration. 37680 return createAsyncPlaceholder( 37681 asyncFactory, 37682 data, 37683 context, 37684 children, 37685 tag 37686 ) 37687 } 37688 } 37689 37690 data = data || {}; 37691 37692 // resolve constructor options in case global mixins are applied after 37693 // component constructor creation 37694 resolveConstructorOptions(Ctor); 37695 37696 // transform component v-model data into props & events 37697 if (isDef(data.model)) { 37698 transformModel(Ctor.options, data); 37699 } 37700 37701 // extract props 37702 var propsData = extractPropsFromVNodeData(data, Ctor, tag); 37703 37704 // functional component 37705 if (isTrue(Ctor.options.functional)) { 37706 return createFunctionalComponent(Ctor, propsData, data, context, children) 37707 } 37708 37709 // extract listeners, since these needs to be treated as 37710 // child component listeners instead of DOM listeners 37711 var listeners = data.on; 37712 // replace with listeners with .native modifier 37713 // so it gets processed during parent component patch. 37714 data.on = data.nativeOn; 37715 37716 if (isTrue(Ctor.options.abstract)) { 37717 // abstract components do not keep anything 37718 // other than props & listeners & slot 37719 37720 // work around flow 37721 var slot = data.slot; 37722 data = {}; 37723 if (slot) { 37724 data.slot = slot; 37725 } 37726 } 37727 37728 // install component management hooks onto the placeholder node 37729 installComponentHooks(data); 37730 37731 // return a placeholder vnode 37732 var name = Ctor.options.name || tag; 37733 var vnode = new VNode( 37734 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), 37735 data, undefined, undefined, undefined, context, 37736 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, 37737 asyncFactory 37738 ); 37739 37740 return vnode 37741} 37742 37743function createComponentInstanceForVnode ( 37744 // we know it's MountedComponentVNode but flow doesn't 37745 vnode, 37746 // activeInstance in lifecycle state 37747 parent 37748) { 37749 var options = { 37750 _isComponent: true, 37751 _parentVnode: vnode, 37752 parent: parent 37753 }; 37754 // check inline-template render functions 37755 var inlineTemplate = vnode.data.inlineTemplate; 37756 if (isDef(inlineTemplate)) { 37757 options.render = inlineTemplate.render; 37758 options.staticRenderFns = inlineTemplate.staticRenderFns; 37759 } 37760 return new vnode.componentOptions.Ctor(options) 37761} 37762 37763function installComponentHooks (data) { 37764 var hooks = data.hook || (data.hook = {}); 37765 for (var i = 0; i < hooksToMerge.length; i++) { 37766 var key = hooksToMerge[i]; 37767 var existing = hooks[key]; 37768 var toMerge = componentVNodeHooks[key]; 37769 if (existing !== toMerge && !(existing && existing._merged)) { 37770 hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; 37771 } 37772 } 37773} 37774 37775function mergeHook$1 (f1, f2) { 37776 var merged = function (a, b) { 37777 // flow complains about extra args which is why we use any 37778 f1(a, b); 37779 f2(a, b); 37780 }; 37781 merged._merged = true; 37782 return merged 37783} 37784 37785// transform component v-model info (value and callback) into 37786// prop and event handler respectively. 37787function transformModel (options, data) { 37788 var prop = (options.model && options.model.prop) || 'value'; 37789 var event = (options.model && options.model.event) || 'input' 37790 ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; 37791 var on = data.on || (data.on = {}); 37792 var existing = on[event]; 37793 var callback = data.model.callback; 37794 if (isDef(existing)) { 37795 if ( 37796 Array.isArray(existing) 37797 ? existing.indexOf(callback) === -1 37798 : existing !== callback 37799 ) { 37800 on[event] = [callback].concat(existing); 37801 } 37802 } else { 37803 on[event] = callback; 37804 } 37805} 37806 37807/* */ 37808 37809var SIMPLE_NORMALIZE = 1; 37810var ALWAYS_NORMALIZE = 2; 37811 37812// wrapper function for providing a more flexible interface 37813// without getting yelled at by flow 37814function createElement ( 37815 context, 37816 tag, 37817 data, 37818 children, 37819 normalizationType, 37820 alwaysNormalize 37821) { 37822 if (Array.isArray(data) || isPrimitive(data)) { 37823 normalizationType = children; 37824 children = data; 37825 data = undefined; 37826 } 37827 if (isTrue(alwaysNormalize)) { 37828 normalizationType = ALWAYS_NORMALIZE; 37829 } 37830 return _createElement(context, tag, data, children, normalizationType) 37831} 37832 37833function _createElement ( 37834 context, 37835 tag, 37836 data, 37837 children, 37838 normalizationType 37839) { 37840 if (isDef(data) && isDef((data).__ob__)) { 37841 true && warn( 37842 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 37843 'Always create fresh vnode data objects in each render!', 37844 context 37845 ); 37846 return createEmptyVNode() 37847 } 37848 // object syntax in v-bind 37849 if (isDef(data) && isDef(data.is)) { 37850 tag = data.is; 37851 } 37852 if (!tag) { 37853 // in case of component :is set to falsy value 37854 return createEmptyVNode() 37855 } 37856 // warn against non-primitive key 37857 if ( true && 37858 isDef(data) && isDef(data.key) && !isPrimitive(data.key) 37859 ) { 37860 { 37861 warn( 37862 'Avoid using non-primitive value as key, ' + 37863 'use string/number value instead.', 37864 context 37865 ); 37866 } 37867 } 37868 // support single function children as default scoped slot 37869 if (Array.isArray(children) && 37870 typeof children[0] === 'function' 37871 ) { 37872 data = data || {}; 37873 data.scopedSlots = { default: children[0] }; 37874 children.length = 0; 37875 } 37876 if (normalizationType === ALWAYS_NORMALIZE) { 37877 children = normalizeChildren(children); 37878 } else if (normalizationType === SIMPLE_NORMALIZE) { 37879 children = simpleNormalizeChildren(children); 37880 } 37881 var vnode, ns; 37882 if (typeof tag === 'string') { 37883 var Ctor; 37884 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); 37885 if (config.isReservedTag(tag)) { 37886 // platform built-in elements 37887 if ( true && isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') { 37888 warn( 37889 ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."), 37890 context 37891 ); 37892 } 37893 vnode = new VNode( 37894 config.parsePlatformTagName(tag), data, children, 37895 undefined, undefined, context 37896 ); 37897 } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { 37898 // component 37899 vnode = createComponent(Ctor, data, context, children, tag); 37900 } else { 37901 // unknown or unlisted namespaced elements 37902 // check at runtime because it may get assigned a namespace when its 37903 // parent normalizes children 37904 vnode = new VNode( 37905 tag, data, children, 37906 undefined, undefined, context 37907 ); 37908 } 37909 } else { 37910 // direct component options / constructor 37911 vnode = createComponent(tag, data, context, children); 37912 } 37913 if (Array.isArray(vnode)) { 37914 return vnode 37915 } else if (isDef(vnode)) { 37916 if (isDef(ns)) { applyNS(vnode, ns); } 37917 if (isDef(data)) { registerDeepBindings(data); } 37918 return vnode 37919 } else { 37920 return createEmptyVNode() 37921 } 37922} 37923 37924function applyNS (vnode, ns, force) { 37925 vnode.ns = ns; 37926 if (vnode.tag === 'foreignObject') { 37927 // use default namespace inside foreignObject 37928 ns = undefined; 37929 force = true; 37930 } 37931 if (isDef(vnode.children)) { 37932 for (var i = 0, l = vnode.children.length; i < l; i++) { 37933 var child = vnode.children[i]; 37934 if (isDef(child.tag) && ( 37935 isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { 37936 applyNS(child, ns, force); 37937 } 37938 } 37939 } 37940} 37941 37942// ref #5318 37943// necessary to ensure parent re-render when deep bindings like :style and 37944// :class are used on slot nodes 37945function registerDeepBindings (data) { 37946 if (isObject(data.style)) { 37947 traverse(data.style); 37948 } 37949 if (isObject(data.class)) { 37950 traverse(data.class); 37951 } 37952} 37953 37954/* */ 37955 37956function initRender (vm) { 37957 vm._vnode = null; // the root of the child tree 37958 vm._staticTrees = null; // v-once cached trees 37959 var options = vm.$options; 37960 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree 37961 var renderContext = parentVnode && parentVnode.context; 37962 vm.$slots = resolveSlots(options._renderChildren, renderContext); 37963 vm.$scopedSlots = emptyObject; 37964 // bind the createElement fn to this instance 37965 // so that we get proper render context inside it. 37966 // args order: tag, data, children, normalizationType, alwaysNormalize 37967 // internal version is used by render functions compiled from templates 37968 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; 37969 // normalization is always applied for the public version, used in 37970 // user-written render functions. 37971 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; 37972 37973 // $attrs & $listeners are exposed for easier HOC creation. 37974 // they need to be reactive so that HOCs using them are always updated 37975 var parentData = parentVnode && parentVnode.data; 37976 37977 /* istanbul ignore else */ 37978 if (true) { 37979 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { 37980 !isUpdatingChildComponent && warn("$attrs is readonly.", vm); 37981 }, true); 37982 defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { 37983 !isUpdatingChildComponent && warn("$listeners is readonly.", vm); 37984 }, true); 37985 } else {} 37986} 37987 37988var currentRenderingInstance = null; 37989 37990function renderMixin (Vue) { 37991 // install runtime convenience helpers 37992 installRenderHelpers(Vue.prototype); 37993 37994 Vue.prototype.$nextTick = function (fn) { 37995 return nextTick(fn, this) 37996 }; 37997 37998 Vue.prototype._render = function () { 37999 var vm = this; 38000 var ref = vm.$options; 38001 var render = ref.render; 38002 var _parentVnode = ref._parentVnode; 38003 38004 if (_parentVnode) { 38005 vm.$scopedSlots = normalizeScopedSlots( 38006 _parentVnode.data.scopedSlots, 38007 vm.$slots, 38008 vm.$scopedSlots 38009 ); 38010 } 38011 38012 // set parent vnode. this allows render functions to have access 38013 // to the data on the placeholder node. 38014 vm.$vnode = _parentVnode; 38015 // render self 38016 var vnode; 38017 try { 38018 // There's no need to maintain a stack because all render fns are called 38019 // separately from one another. Nested component's render fns are called 38020 // when parent component is patched. 38021 currentRenderingInstance = vm; 38022 vnode = render.call(vm._renderProxy, vm.$createElement); 38023 } catch (e) { 38024 handleError(e, vm, "render"); 38025 // return error render result, 38026 // or previous vnode to prevent render error causing blank component 38027 /* istanbul ignore else */ 38028 if ( true && vm.$options.renderError) { 38029 try { 38030 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); 38031 } catch (e) { 38032 handleError(e, vm, "renderError"); 38033 vnode = vm._vnode; 38034 } 38035 } else { 38036 vnode = vm._vnode; 38037 } 38038 } finally { 38039 currentRenderingInstance = null; 38040 } 38041 // if the returned array contains only a single node, allow it 38042 if (Array.isArray(vnode) && vnode.length === 1) { 38043 vnode = vnode[0]; 38044 } 38045 // return empty vnode in case the render function errored out 38046 if (!(vnode instanceof VNode)) { 38047 if ( true && Array.isArray(vnode)) { 38048 warn( 38049 'Multiple root nodes returned from render function. Render function ' + 38050 'should return a single root node.', 38051 vm 38052 ); 38053 } 38054 vnode = createEmptyVNode(); 38055 } 38056 // set parent 38057 vnode.parent = _parentVnode; 38058 return vnode 38059 }; 38060} 38061 38062/* */ 38063 38064function ensureCtor (comp, base) { 38065 if ( 38066 comp.__esModule || 38067 (hasSymbol && comp[Symbol.toStringTag] === 'Module') 38068 ) { 38069 comp = comp.default; 38070 } 38071 return isObject(comp) 38072 ? base.extend(comp) 38073 : comp 38074} 38075 38076function createAsyncPlaceholder ( 38077 factory, 38078 data, 38079 context, 38080 children, 38081 tag 38082) { 38083 var node = createEmptyVNode(); 38084 node.asyncFactory = factory; 38085 node.asyncMeta = { data: data, context: context, children: children, tag: tag }; 38086 return node 38087} 38088 38089function resolveAsyncComponent ( 38090 factory, 38091 baseCtor 38092) { 38093 if (isTrue(factory.error) && isDef(factory.errorComp)) { 38094 return factory.errorComp 38095 } 38096 38097 if (isDef(factory.resolved)) { 38098 return factory.resolved 38099 } 38100 38101 var owner = currentRenderingInstance; 38102 if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) { 38103 // already pending 38104 factory.owners.push(owner); 38105 } 38106 38107 if (isTrue(factory.loading) && isDef(factory.loadingComp)) { 38108 return factory.loadingComp 38109 } 38110 38111 if (owner && !isDef(factory.owners)) { 38112 var owners = factory.owners = [owner]; 38113 var sync = true; 38114 var timerLoading = null; 38115 var timerTimeout = null 38116 38117 ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); }); 38118 38119 var forceRender = function (renderCompleted) { 38120 for (var i = 0, l = owners.length; i < l; i++) { 38121 (owners[i]).$forceUpdate(); 38122 } 38123 38124 if (renderCompleted) { 38125 owners.length = 0; 38126 if (timerLoading !== null) { 38127 clearTimeout(timerLoading); 38128 timerLoading = null; 38129 } 38130 if (timerTimeout !== null) { 38131 clearTimeout(timerTimeout); 38132 timerTimeout = null; 38133 } 38134 } 38135 }; 38136 38137 var resolve = once(function (res) { 38138 // cache resolved 38139 factory.resolved = ensureCtor(res, baseCtor); 38140 // invoke callbacks only if this is not a synchronous resolve 38141 // (async resolves are shimmed as synchronous during SSR) 38142 if (!sync) { 38143 forceRender(true); 38144 } else { 38145 owners.length = 0; 38146 } 38147 }); 38148 38149 var reject = once(function (reason) { 38150 true && warn( 38151 "Failed to resolve async component: " + (String(factory)) + 38152 (reason ? ("\nReason: " + reason) : '') 38153 ); 38154 if (isDef(factory.errorComp)) { 38155 factory.error = true; 38156 forceRender(true); 38157 } 38158 }); 38159 38160 var res = factory(resolve, reject); 38161 38162 if (isObject(res)) { 38163 if (isPromise(res)) { 38164 // () => Promise 38165 if (isUndef(factory.resolved)) { 38166 res.then(resolve, reject); 38167 } 38168 } else if (isPromise(res.component)) { 38169 res.component.then(resolve, reject); 38170 38171 if (isDef(res.error)) { 38172 factory.errorComp = ensureCtor(res.error, baseCtor); 38173 } 38174 38175 if (isDef(res.loading)) { 38176 factory.loadingComp = ensureCtor(res.loading, baseCtor); 38177 if (res.delay === 0) { 38178 factory.loading = true; 38179 } else { 38180 timerLoading = setTimeout(function () { 38181 timerLoading = null; 38182 if (isUndef(factory.resolved) && isUndef(factory.error)) { 38183 factory.loading = true; 38184 forceRender(false); 38185 } 38186 }, res.delay || 200); 38187 } 38188 } 38189 38190 if (isDef(res.timeout)) { 38191 timerTimeout = setTimeout(function () { 38192 timerTimeout = null; 38193 if (isUndef(factory.resolved)) { 38194 reject( 38195 true 38196 ? ("timeout (" + (res.timeout) + "ms)") 38197 : 0 38198 ); 38199 } 38200 }, res.timeout); 38201 } 38202 } 38203 } 38204 38205 sync = false; 38206 // return in case resolved synchronously 38207 return factory.loading 38208 ? factory.loadingComp 38209 : factory.resolved 38210 } 38211} 38212 38213/* */ 38214 38215function getFirstComponentChild (children) { 38216 if (Array.isArray(children)) { 38217 for (var i = 0; i < children.length; i++) { 38218 var c = children[i]; 38219 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { 38220 return c 38221 } 38222 } 38223 } 38224} 38225 38226/* */ 38227 38228/* */ 38229 38230function initEvents (vm) { 38231 vm._events = Object.create(null); 38232 vm._hasHookEvent = false; 38233 // init parent attached events 38234 var listeners = vm.$options._parentListeners; 38235 if (listeners) { 38236 updateComponentListeners(vm, listeners); 38237 } 38238} 38239 38240var target; 38241 38242function add (event, fn) { 38243 target.$on(event, fn); 38244} 38245 38246function remove$1 (event, fn) { 38247 target.$off(event, fn); 38248} 38249 38250function createOnceHandler (event, fn) { 38251 var _target = target; 38252 return function onceHandler () { 38253 var res = fn.apply(null, arguments); 38254 if (res !== null) { 38255 _target.$off(event, onceHandler); 38256 } 38257 } 38258} 38259 38260function updateComponentListeners ( 38261 vm, 38262 listeners, 38263 oldListeners 38264) { 38265 target = vm; 38266 updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); 38267 target = undefined; 38268} 38269 38270function eventsMixin (Vue) { 38271 var hookRE = /^hook:/; 38272 Vue.prototype.$on = function (event, fn) { 38273 var vm = this; 38274 if (Array.isArray(event)) { 38275 for (var i = 0, l = event.length; i < l; i++) { 38276 vm.$on(event[i], fn); 38277 } 38278 } else { 38279 (vm._events[event] || (vm._events[event] = [])).push(fn); 38280 // optimize hook:event cost by using a boolean flag marked at registration 38281 // instead of a hash lookup 38282 if (hookRE.test(event)) { 38283 vm._hasHookEvent = true; 38284 } 38285 } 38286 return vm 38287 }; 38288 38289 Vue.prototype.$once = function (event, fn) { 38290 var vm = this; 38291 function on () { 38292 vm.$off(event, on); 38293 fn.apply(vm, arguments); 38294 } 38295 on.fn = fn; 38296 vm.$on(event, on); 38297 return vm 38298 }; 38299 38300 Vue.prototype.$off = function (event, fn) { 38301 var vm = this; 38302 // all 38303 if (!arguments.length) { 38304 vm._events = Object.create(null); 38305 return vm 38306 } 38307 // array of events 38308 if (Array.isArray(event)) { 38309 for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { 38310 vm.$off(event[i$1], fn); 38311 } 38312 return vm 38313 } 38314 // specific event 38315 var cbs = vm._events[event]; 38316 if (!cbs) { 38317 return vm 38318 } 38319 if (!fn) { 38320 vm._events[event] = null; 38321 return vm 38322 } 38323 // specific handler 38324 var cb; 38325 var i = cbs.length; 38326 while (i--) { 38327 cb = cbs[i]; 38328 if (cb === fn || cb.fn === fn) { 38329 cbs.splice(i, 1); 38330 break 38331 } 38332 } 38333 return vm 38334 }; 38335 38336 Vue.prototype.$emit = function (event) { 38337 var vm = this; 38338 if (true) { 38339 var lowerCaseEvent = event.toLowerCase(); 38340 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { 38341 tip( 38342 "Event \"" + lowerCaseEvent + "\" is emitted in component " + 38343 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " + 38344 "Note that HTML attributes are case-insensitive and you cannot use " + 38345 "v-on to listen to camelCase events when using in-DOM templates. " + 38346 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." 38347 ); 38348 } 38349 } 38350 var cbs = vm._events[event]; 38351 if (cbs) { 38352 cbs = cbs.length > 1 ? toArray(cbs) : cbs; 38353 var args = toArray(arguments, 1); 38354 var info = "event handler for \"" + event + "\""; 38355 for (var i = 0, l = cbs.length; i < l; i++) { 38356 invokeWithErrorHandling(cbs[i], vm, args, vm, info); 38357 } 38358 } 38359 return vm 38360 }; 38361} 38362 38363/* */ 38364 38365var activeInstance = null; 38366var isUpdatingChildComponent = false; 38367 38368function setActiveInstance(vm) { 38369 var prevActiveInstance = activeInstance; 38370 activeInstance = vm; 38371 return function () { 38372 activeInstance = prevActiveInstance; 38373 } 38374} 38375 38376function initLifecycle (vm) { 38377 var options = vm.$options; 38378 38379 // locate first non-abstract parent 38380 var parent = options.parent; 38381 if (parent && !options.abstract) { 38382 while (parent.$options.abstract && parent.$parent) { 38383 parent = parent.$parent; 38384 } 38385 parent.$children.push(vm); 38386 } 38387 38388 vm.$parent = parent; 38389 vm.$root = parent ? parent.$root : vm; 38390 38391 vm.$children = []; 38392 vm.$refs = {}; 38393 38394 vm._watcher = null; 38395 vm._inactive = null; 38396 vm._directInactive = false; 38397 vm._isMounted = false; 38398 vm._isDestroyed = false; 38399 vm._isBeingDestroyed = false; 38400} 38401 38402function lifecycleMixin (Vue) { 38403 Vue.prototype._update = function (vnode, hydrating) { 38404 var vm = this; 38405 var prevEl = vm.$el; 38406 var prevVnode = vm._vnode; 38407 var restoreActiveInstance = setActiveInstance(vm); 38408 vm._vnode = vnode; 38409 // Vue.prototype.__patch__ is injected in entry points 38410 // based on the rendering backend used. 38411 if (!prevVnode) { 38412 // initial render 38413 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); 38414 } else { 38415 // updates 38416 vm.$el = vm.__patch__(prevVnode, vnode); 38417 } 38418 restoreActiveInstance(); 38419 // update __vue__ reference 38420 if (prevEl) { 38421 prevEl.__vue__ = null; 38422 } 38423 if (vm.$el) { 38424 vm.$el.__vue__ = vm; 38425 } 38426 // if parent is an HOC, update its $el as well 38427 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { 38428 vm.$parent.$el = vm.$el; 38429 } 38430 // updated hook is called by the scheduler to ensure that children are 38431 // updated in a parent's updated hook. 38432 }; 38433 38434 Vue.prototype.$forceUpdate = function () { 38435 var vm = this; 38436 if (vm._watcher) { 38437 vm._watcher.update(); 38438 } 38439 }; 38440 38441 Vue.prototype.$destroy = function () { 38442 var vm = this; 38443 if (vm._isBeingDestroyed) { 38444 return 38445 } 38446 callHook(vm, 'beforeDestroy'); 38447 vm._isBeingDestroyed = true; 38448 // remove self from parent 38449 var parent = vm.$parent; 38450 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { 38451 remove(parent.$children, vm); 38452 } 38453 // teardown watchers 38454 if (vm._watcher) { 38455 vm._watcher.teardown(); 38456 } 38457 var i = vm._watchers.length; 38458 while (i--) { 38459 vm._watchers[i].teardown(); 38460 } 38461 // remove reference from data ob 38462 // frozen object may not have observer. 38463 if (vm._data.__ob__) { 38464 vm._data.__ob__.vmCount--; 38465 } 38466 // call the last hook... 38467 vm._isDestroyed = true; 38468 // invoke destroy hooks on current rendered tree 38469 vm.__patch__(vm._vnode, null); 38470 // fire destroyed hook 38471 callHook(vm, 'destroyed'); 38472 // turn off all instance listeners. 38473 vm.$off(); 38474 // remove __vue__ reference 38475 if (vm.$el) { 38476 vm.$el.__vue__ = null; 38477 } 38478 // release circular reference (#6759) 38479 if (vm.$vnode) { 38480 vm.$vnode.parent = null; 38481 } 38482 }; 38483} 38484 38485function mountComponent ( 38486 vm, 38487 el, 38488 hydrating 38489) { 38490 vm.$el = el; 38491 if (!vm.$options.render) { 38492 vm.$options.render = createEmptyVNode; 38493 if (true) { 38494 /* istanbul ignore if */ 38495 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || 38496 vm.$options.el || el) { 38497 warn( 38498 'You are using the runtime-only build of Vue where the template ' + 38499 'compiler is not available. Either pre-compile the templates into ' + 38500 'render functions, or use the compiler-included build.', 38501 vm 38502 ); 38503 } else { 38504 warn( 38505 'Failed to mount component: template or render function not defined.', 38506 vm 38507 ); 38508 } 38509 } 38510 } 38511 callHook(vm, 'beforeMount'); 38512 38513 var updateComponent; 38514 /* istanbul ignore if */ 38515 if ( true && config.performance && mark) { 38516 updateComponent = function () { 38517 var name = vm._name; 38518 var id = vm._uid; 38519 var startTag = "vue-perf-start:" + id; 38520 var endTag = "vue-perf-end:" + id; 38521 38522 mark(startTag); 38523 var vnode = vm._render(); 38524 mark(endTag); 38525 measure(("vue " + name + " render"), startTag, endTag); 38526 38527 mark(startTag); 38528 vm._update(vnode, hydrating); 38529 mark(endTag); 38530 measure(("vue " + name + " patch"), startTag, endTag); 38531 }; 38532 } else { 38533 updateComponent = function () { 38534 vm._update(vm._render(), hydrating); 38535 }; 38536 } 38537 38538 // we set this to vm._watcher inside the watcher's constructor 38539 // since the watcher's initial patch may call $forceUpdate (e.g. inside child 38540 // component's mounted hook), which relies on vm._watcher being already defined 38541 new Watcher(vm, updateComponent, noop, { 38542 before: function before () { 38543 if (vm._isMounted && !vm._isDestroyed) { 38544 callHook(vm, 'beforeUpdate'); 38545 } 38546 } 38547 }, true /* isRenderWatcher */); 38548 hydrating = false; 38549 38550 // manually mounted instance, call mounted on self 38551 // mounted is called for render-created child components in its inserted hook 38552 if (vm.$vnode == null) { 38553 vm._isMounted = true; 38554 callHook(vm, 'mounted'); 38555 } 38556 return vm 38557} 38558 38559function updateChildComponent ( 38560 vm, 38561 propsData, 38562 listeners, 38563 parentVnode, 38564 renderChildren 38565) { 38566 if (true) { 38567 isUpdatingChildComponent = true; 38568 } 38569 38570 // determine whether component has slot children 38571 // we need to do this before overwriting $options._renderChildren. 38572 38573 // check if there are dynamic scopedSlots (hand-written or compiled but with 38574 // dynamic slot names). Static scoped slots compiled from template has the 38575 // "$stable" marker. 38576 var newScopedSlots = parentVnode.data.scopedSlots; 38577 var oldScopedSlots = vm.$scopedSlots; 38578 var hasDynamicScopedSlot = !!( 38579 (newScopedSlots && !newScopedSlots.$stable) || 38580 (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) || 38581 (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) || 38582 (!newScopedSlots && vm.$scopedSlots.$key) 38583 ); 38584 38585 // Any static slot children from the parent may have changed during parent's 38586 // update. Dynamic scoped slots may also have changed. In such cases, a forced 38587 // update is necessary to ensure correctness. 38588 var needsForceUpdate = !!( 38589 renderChildren || // has new static slots 38590 vm.$options._renderChildren || // has old static slots 38591 hasDynamicScopedSlot 38592 ); 38593 38594 vm.$options._parentVnode = parentVnode; 38595 vm.$vnode = parentVnode; // update vm's placeholder node without re-render 38596 38597 if (vm._vnode) { // update child tree's parent 38598 vm._vnode.parent = parentVnode; 38599 } 38600 vm.$options._renderChildren = renderChildren; 38601 38602 // update $attrs and $listeners hash 38603 // these are also reactive so they may trigger child update if the child 38604 // used them during render 38605 vm.$attrs = parentVnode.data.attrs || emptyObject; 38606 vm.$listeners = listeners || emptyObject; 38607 38608 // update props 38609 if (propsData && vm.$options.props) { 38610 toggleObserving(false); 38611 var props = vm._props; 38612 var propKeys = vm.$options._propKeys || []; 38613 for (var i = 0; i < propKeys.length; i++) { 38614 var key = propKeys[i]; 38615 var propOptions = vm.$options.props; // wtf flow? 38616 props[key] = validateProp(key, propOptions, propsData, vm); 38617 } 38618 toggleObserving(true); 38619 // keep a copy of raw propsData 38620 vm.$options.propsData = propsData; 38621 } 38622 38623 // update listeners 38624 listeners = listeners || emptyObject; 38625 var oldListeners = vm.$options._parentListeners; 38626 vm.$options._parentListeners = listeners; 38627 updateComponentListeners(vm, listeners, oldListeners); 38628 38629 // resolve slots + force update if has children 38630 if (needsForceUpdate) { 38631 vm.$slots = resolveSlots(renderChildren, parentVnode.context); 38632 vm.$forceUpdate(); 38633 } 38634 38635 if (true) { 38636 isUpdatingChildComponent = false; 38637 } 38638} 38639 38640function isInInactiveTree (vm) { 38641 while (vm && (vm = vm.$parent)) { 38642 if (vm._inactive) { return true } 38643 } 38644 return false 38645} 38646 38647function activateChildComponent (vm, direct) { 38648 if (direct) { 38649 vm._directInactive = false; 38650 if (isInInactiveTree(vm)) { 38651 return 38652 } 38653 } else if (vm._directInactive) { 38654 return 38655 } 38656 if (vm._inactive || vm._inactive === null) { 38657 vm._inactive = false; 38658 for (var i = 0; i < vm.$children.length; i++) { 38659 activateChildComponent(vm.$children[i]); 38660 } 38661 callHook(vm, 'activated'); 38662 } 38663} 38664 38665function deactivateChildComponent (vm, direct) { 38666 if (direct) { 38667 vm._directInactive = true; 38668 if (isInInactiveTree(vm)) { 38669 return 38670 } 38671 } 38672 if (!vm._inactive) { 38673 vm._inactive = true; 38674 for (var i = 0; i < vm.$children.length; i++) { 38675 deactivateChildComponent(vm.$children[i]); 38676 } 38677 callHook(vm, 'deactivated'); 38678 } 38679} 38680 38681function callHook (vm, hook) { 38682 // #7573 disable dep collection when invoking lifecycle hooks 38683 pushTarget(); 38684 var handlers = vm.$options[hook]; 38685 var info = hook + " hook"; 38686 if (handlers) { 38687 for (var i = 0, j = handlers.length; i < j; i++) { 38688 invokeWithErrorHandling(handlers[i], vm, null, vm, info); 38689 } 38690 } 38691 if (vm._hasHookEvent) { 38692 vm.$emit('hook:' + hook); 38693 } 38694 popTarget(); 38695} 38696 38697/* */ 38698 38699var MAX_UPDATE_COUNT = 100; 38700 38701var queue = []; 38702var activatedChildren = []; 38703var has = {}; 38704var circular = {}; 38705var waiting = false; 38706var flushing = false; 38707var index = 0; 38708 38709/** 38710 * Reset the scheduler's state. 38711 */ 38712function resetSchedulerState () { 38713 index = queue.length = activatedChildren.length = 0; 38714 has = {}; 38715 if (true) { 38716 circular = {}; 38717 } 38718 waiting = flushing = false; 38719} 38720 38721// Async edge case #6566 requires saving the timestamp when event listeners are 38722// attached. However, calling performance.now() has a perf overhead especially 38723// if the page has thousands of event listeners. Instead, we take a timestamp 38724// every time the scheduler flushes and use that for all event listeners 38725// attached during that flush. 38726var currentFlushTimestamp = 0; 38727 38728// Async edge case fix requires storing an event listener's attach timestamp. 38729var getNow = Date.now; 38730 38731// Determine what event timestamp the browser is using. Annoyingly, the 38732// timestamp can either be hi-res (relative to page load) or low-res 38733// (relative to UNIX epoch), so in order to compare time we have to use the 38734// same timestamp type when saving the flush timestamp. 38735// All IE versions use low-res event timestamps, and have problematic clock 38736// implementations (#9632) 38737if (inBrowser && !isIE) { 38738 var performance = window.performance; 38739 if ( 38740 performance && 38741 typeof performance.now === 'function' && 38742 getNow() > document.createEvent('Event').timeStamp 38743 ) { 38744 // if the event timestamp, although evaluated AFTER the Date.now(), is 38745 // smaller than it, it means the event is using a hi-res timestamp, 38746 // and we need to use the hi-res version for event listener timestamps as 38747 // well. 38748 getNow = function () { return performance.now(); }; 38749 } 38750} 38751 38752/** 38753 * Flush both queues and run the watchers. 38754 */ 38755function flushSchedulerQueue () { 38756 currentFlushTimestamp = getNow(); 38757 flushing = true; 38758 var watcher, id; 38759 38760 // Sort queue before flush. 38761 // This ensures that: 38762 // 1. Components are updated from parent to child. (because parent is always 38763 // created before the child) 38764 // 2. A component's user watchers are run before its render watcher (because 38765 // user watchers are created before the render watcher) 38766 // 3. If a component is destroyed during a parent component's watcher run, 38767 // its watchers can be skipped. 38768 queue.sort(function (a, b) { return a.id - b.id; }); 38769 38770 // do not cache length because more watchers might be pushed 38771 // as we run existing watchers 38772 for (index = 0; index < queue.length; index++) { 38773 watcher = queue[index]; 38774 if (watcher.before) { 38775 watcher.before(); 38776 } 38777 id = watcher.id; 38778 has[id] = null; 38779 watcher.run(); 38780 // in dev build, check and stop circular updates. 38781 if ( true && has[id] != null) { 38782 circular[id] = (circular[id] || 0) + 1; 38783 if (circular[id] > MAX_UPDATE_COUNT) { 38784 warn( 38785 'You may have an infinite update loop ' + ( 38786 watcher.user 38787 ? ("in watcher with expression \"" + (watcher.expression) + "\"") 38788 : "in a component render function." 38789 ), 38790 watcher.vm 38791 ); 38792 break 38793 } 38794 } 38795 } 38796 38797 // keep copies of post queues before resetting state 38798 var activatedQueue = activatedChildren.slice(); 38799 var updatedQueue = queue.slice(); 38800 38801 resetSchedulerState(); 38802 38803 // call component updated and activated hooks 38804 callActivatedHooks(activatedQueue); 38805 callUpdatedHooks(updatedQueue); 38806 38807 // devtool hook 38808 /* istanbul ignore if */ 38809 if (devtools && config.devtools) { 38810 devtools.emit('flush'); 38811 } 38812} 38813 38814function callUpdatedHooks (queue) { 38815 var i = queue.length; 38816 while (i--) { 38817 var watcher = queue[i]; 38818 var vm = watcher.vm; 38819 if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { 38820 callHook(vm, 'updated'); 38821 } 38822 } 38823} 38824 38825/** 38826 * Queue a kept-alive component that was activated during patch. 38827 * The queue will be processed after the entire tree has been patched. 38828 */ 38829function queueActivatedComponent (vm) { 38830 // setting _inactive to false here so that a render function can 38831 // rely on checking whether it's in an inactive tree (e.g. router-view) 38832 vm._inactive = false; 38833 activatedChildren.push(vm); 38834} 38835 38836function callActivatedHooks (queue) { 38837 for (var i = 0; i < queue.length; i++) { 38838 queue[i]._inactive = true; 38839 activateChildComponent(queue[i], true /* true */); 38840 } 38841} 38842 38843/** 38844 * Push a watcher into the watcher queue. 38845 * Jobs with duplicate IDs will be skipped unless it's 38846 * pushed when the queue is being flushed. 38847 */ 38848function queueWatcher (watcher) { 38849 var id = watcher.id; 38850 if (has[id] == null) { 38851 has[id] = true; 38852 if (!flushing) { 38853 queue.push(watcher); 38854 } else { 38855 // if already flushing, splice the watcher based on its id 38856 // if already past its id, it will be run next immediately. 38857 var i = queue.length - 1; 38858 while (i > index && queue[i].id > watcher.id) { 38859 i--; 38860 } 38861 queue.splice(i + 1, 0, watcher); 38862 } 38863 // queue the flush 38864 if (!waiting) { 38865 waiting = true; 38866 38867 if ( true && !config.async) { 38868 flushSchedulerQueue(); 38869 return 38870 } 38871 nextTick(flushSchedulerQueue); 38872 } 38873 } 38874} 38875 38876/* */ 38877 38878 38879 38880var uid$2 = 0; 38881 38882/** 38883 * A watcher parses an expression, collects dependencies, 38884 * and fires callback when the expression value changes. 38885 * This is used for both the $watch() api and directives. 38886 */ 38887var Watcher = function Watcher ( 38888 vm, 38889 expOrFn, 38890 cb, 38891 options, 38892 isRenderWatcher 38893) { 38894 this.vm = vm; 38895 if (isRenderWatcher) { 38896 vm._watcher = this; 38897 } 38898 vm._watchers.push(this); 38899 // options 38900 if (options) { 38901 this.deep = !!options.deep; 38902 this.user = !!options.user; 38903 this.lazy = !!options.lazy; 38904 this.sync = !!options.sync; 38905 this.before = options.before; 38906 } else { 38907 this.deep = this.user = this.lazy = this.sync = false; 38908 } 38909 this.cb = cb; 38910 this.id = ++uid$2; // uid for batching 38911 this.active = true; 38912 this.dirty = this.lazy; // for lazy watchers 38913 this.deps = []; 38914 this.newDeps = []; 38915 this.depIds = new _Set(); 38916 this.newDepIds = new _Set(); 38917 this.expression = true 38918 ? expOrFn.toString() 38919 : 0; 38920 // parse expression for getter 38921 if (typeof expOrFn === 'function') { 38922 this.getter = expOrFn; 38923 } else { 38924 this.getter = parsePath(expOrFn); 38925 if (!this.getter) { 38926 this.getter = noop; 38927 true && warn( 38928 "Failed watching path: \"" + expOrFn + "\" " + 38929 'Watcher only accepts simple dot-delimited paths. ' + 38930 'For full control, use a function instead.', 38931 vm 38932 ); 38933 } 38934 } 38935 this.value = this.lazy 38936 ? undefined 38937 : this.get(); 38938}; 38939 38940/** 38941 * Evaluate the getter, and re-collect dependencies. 38942 */ 38943Watcher.prototype.get = function get () { 38944 pushTarget(this); 38945 var value; 38946 var vm = this.vm; 38947 try { 38948 value = this.getter.call(vm, vm); 38949 } catch (e) { 38950 if (this.user) { 38951 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); 38952 } else { 38953 throw e 38954 } 38955 } finally { 38956 // "touch" every property so they are all tracked as 38957 // dependencies for deep watching 38958 if (this.deep) { 38959 traverse(value); 38960 } 38961 popTarget(); 38962 this.cleanupDeps(); 38963 } 38964 return value 38965}; 38966 38967/** 38968 * Add a dependency to this directive. 38969 */ 38970Watcher.prototype.addDep = function addDep (dep) { 38971 var id = dep.id; 38972 if (!this.newDepIds.has(id)) { 38973 this.newDepIds.add(id); 38974 this.newDeps.push(dep); 38975 if (!this.depIds.has(id)) { 38976 dep.addSub(this); 38977 } 38978 } 38979}; 38980 38981/** 38982 * Clean up for dependency collection. 38983 */ 38984Watcher.prototype.cleanupDeps = function cleanupDeps () { 38985 var i = this.deps.length; 38986 while (i--) { 38987 var dep = this.deps[i]; 38988 if (!this.newDepIds.has(dep.id)) { 38989 dep.removeSub(this); 38990 } 38991 } 38992 var tmp = this.depIds; 38993 this.depIds = this.newDepIds; 38994 this.newDepIds = tmp; 38995 this.newDepIds.clear(); 38996 tmp = this.deps; 38997 this.deps = this.newDeps; 38998 this.newDeps = tmp; 38999 this.newDeps.length = 0; 39000}; 39001 39002/** 39003 * Subscriber interface. 39004 * Will be called when a dependency changes. 39005 */ 39006Watcher.prototype.update = function update () { 39007 /* istanbul ignore else */ 39008 if (this.lazy) { 39009 this.dirty = true; 39010 } else if (this.sync) { 39011 this.run(); 39012 } else { 39013 queueWatcher(this); 39014 } 39015}; 39016 39017/** 39018 * Scheduler job interface. 39019 * Will be called by the scheduler. 39020 */ 39021Watcher.prototype.run = function run () { 39022 if (this.active) { 39023 var value = this.get(); 39024 if ( 39025 value !== this.value || 39026 // Deep watchers and watchers on Object/Arrays should fire even 39027 // when the value is the same, because the value may 39028 // have mutated. 39029 isObject(value) || 39030 this.deep 39031 ) { 39032 // set new value 39033 var oldValue = this.value; 39034 this.value = value; 39035 if (this.user) { 39036 var info = "callback for watcher \"" + (this.expression) + "\""; 39037 invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info); 39038 } else { 39039 this.cb.call(this.vm, value, oldValue); 39040 } 39041 } 39042 } 39043}; 39044 39045/** 39046 * Evaluate the value of the watcher. 39047 * This only gets called for lazy watchers. 39048 */ 39049Watcher.prototype.evaluate = function evaluate () { 39050 this.value = this.get(); 39051 this.dirty = false; 39052}; 39053 39054/** 39055 * Depend on all deps collected by this watcher. 39056 */ 39057Watcher.prototype.depend = function depend () { 39058 var i = this.deps.length; 39059 while (i--) { 39060 this.deps[i].depend(); 39061 } 39062}; 39063 39064/** 39065 * Remove self from all dependencies' subscriber list. 39066 */ 39067Watcher.prototype.teardown = function teardown () { 39068 if (this.active) { 39069 // remove self from vm's watcher list 39070 // this is a somewhat expensive operation so we skip it 39071 // if the vm is being destroyed. 39072 if (!this.vm._isBeingDestroyed) { 39073 remove(this.vm._watchers, this); 39074 } 39075 var i = this.deps.length; 39076 while (i--) { 39077 this.deps[i].removeSub(this); 39078 } 39079 this.active = false; 39080 } 39081}; 39082 39083/* */ 39084 39085var sharedPropertyDefinition = { 39086 enumerable: true, 39087 configurable: true, 39088 get: noop, 39089 set: noop 39090}; 39091 39092function proxy (target, sourceKey, key) { 39093 sharedPropertyDefinition.get = function proxyGetter () { 39094 return this[sourceKey][key] 39095 }; 39096 sharedPropertyDefinition.set = function proxySetter (val) { 39097 this[sourceKey][key] = val; 39098 }; 39099 Object.defineProperty(target, key, sharedPropertyDefinition); 39100} 39101 39102function initState (vm) { 39103 vm._watchers = []; 39104 var opts = vm.$options; 39105 if (opts.props) { initProps(vm, opts.props); } 39106 if (opts.methods) { initMethods(vm, opts.methods); } 39107 if (opts.data) { 39108 initData(vm); 39109 } else { 39110 observe(vm._data = {}, true /* asRootData */); 39111 } 39112 if (opts.computed) { initComputed(vm, opts.computed); } 39113 if (opts.watch && opts.watch !== nativeWatch) { 39114 initWatch(vm, opts.watch); 39115 } 39116} 39117 39118function initProps (vm, propsOptions) { 39119 var propsData = vm.$options.propsData || {}; 39120 var props = vm._props = {}; 39121 // cache prop keys so that future props updates can iterate using Array 39122 // instead of dynamic object key enumeration. 39123 var keys = vm.$options._propKeys = []; 39124 var isRoot = !vm.$parent; 39125 // root instance props should be converted 39126 if (!isRoot) { 39127 toggleObserving(false); 39128 } 39129 var loop = function ( key ) { 39130 keys.push(key); 39131 var value = validateProp(key, propsOptions, propsData, vm); 39132 /* istanbul ignore else */ 39133 if (true) { 39134 var hyphenatedKey = hyphenate(key); 39135 if (isReservedAttribute(hyphenatedKey) || 39136 config.isReservedAttr(hyphenatedKey)) { 39137 warn( 39138 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), 39139 vm 39140 ); 39141 } 39142 defineReactive$$1(props, key, value, function () { 39143 if (!isRoot && !isUpdatingChildComponent) { 39144 warn( 39145 "Avoid mutating a prop directly since the value will be " + 39146 "overwritten whenever the parent component re-renders. " + 39147 "Instead, use a data or computed property based on the prop's " + 39148 "value. Prop being mutated: \"" + key + "\"", 39149 vm 39150 ); 39151 } 39152 }); 39153 } else {} 39154 // static props are already proxied on the component's prototype 39155 // during Vue.extend(). We only need to proxy props defined at 39156 // instantiation here. 39157 if (!(key in vm)) { 39158 proxy(vm, "_props", key); 39159 } 39160 }; 39161 39162 for (var key in propsOptions) loop( key ); 39163 toggleObserving(true); 39164} 39165 39166function initData (vm) { 39167 var data = vm.$options.data; 39168 data = vm._data = typeof data === 'function' 39169 ? getData(data, vm) 39170 : data || {}; 39171 if (!isPlainObject(data)) { 39172 data = {}; 39173 true && warn( 39174 'data functions should return an object:\n' + 39175 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', 39176 vm 39177 ); 39178 } 39179 // proxy data on instance 39180 var keys = Object.keys(data); 39181 var props = vm.$options.props; 39182 var methods = vm.$options.methods; 39183 var i = keys.length; 39184 while (i--) { 39185 var key = keys[i]; 39186 if (true) { 39187 if (methods && hasOwn(methods, key)) { 39188 warn( 39189 ("Method \"" + key + "\" has already been defined as a data property."), 39190 vm 39191 ); 39192 } 39193 } 39194 if (props && hasOwn(props, key)) { 39195 true && warn( 39196 "The data property \"" + key + "\" is already declared as a prop. " + 39197 "Use prop default value instead.", 39198 vm 39199 ); 39200 } else if (!isReserved(key)) { 39201 proxy(vm, "_data", key); 39202 } 39203 } 39204 // observe data 39205 observe(data, true /* asRootData */); 39206} 39207 39208function getData (data, vm) { 39209 // #7573 disable dep collection when invoking data getters 39210 pushTarget(); 39211 try { 39212 return data.call(vm, vm) 39213 } catch (e) { 39214 handleError(e, vm, "data()"); 39215 return {} 39216 } finally { 39217 popTarget(); 39218 } 39219} 39220 39221var computedWatcherOptions = { lazy: true }; 39222 39223function initComputed (vm, computed) { 39224 // $flow-disable-line 39225 var watchers = vm._computedWatchers = Object.create(null); 39226 // computed properties are just getters during SSR 39227 var isSSR = isServerRendering(); 39228 39229 for (var key in computed) { 39230 var userDef = computed[key]; 39231 var getter = typeof userDef === 'function' ? userDef : userDef.get; 39232 if ( true && getter == null) { 39233 warn( 39234 ("Getter is missing for computed property \"" + key + "\"."), 39235 vm 39236 ); 39237 } 39238 39239 if (!isSSR) { 39240 // create internal watcher for the computed property. 39241 watchers[key] = new Watcher( 39242 vm, 39243 getter || noop, 39244 noop, 39245 computedWatcherOptions 39246 ); 39247 } 39248 39249 // component-defined computed properties are already defined on the 39250 // component prototype. We only need to define computed properties defined 39251 // at instantiation here. 39252 if (!(key in vm)) { 39253 defineComputed(vm, key, userDef); 39254 } else if (true) { 39255 if (key in vm.$data) { 39256 warn(("The computed property \"" + key + "\" is already defined in data."), vm); 39257 } else if (vm.$options.props && key in vm.$options.props) { 39258 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); 39259 } else if (vm.$options.methods && key in vm.$options.methods) { 39260 warn(("The computed property \"" + key + "\" is already defined as a method."), vm); 39261 } 39262 } 39263 } 39264} 39265 39266function defineComputed ( 39267 target, 39268 key, 39269 userDef 39270) { 39271 var shouldCache = !isServerRendering(); 39272 if (typeof userDef === 'function') { 39273 sharedPropertyDefinition.get = shouldCache 39274 ? createComputedGetter(key) 39275 : createGetterInvoker(userDef); 39276 sharedPropertyDefinition.set = noop; 39277 } else { 39278 sharedPropertyDefinition.get = userDef.get 39279 ? shouldCache && userDef.cache !== false 39280 ? createComputedGetter(key) 39281 : createGetterInvoker(userDef.get) 39282 : noop; 39283 sharedPropertyDefinition.set = userDef.set || noop; 39284 } 39285 if ( true && 39286 sharedPropertyDefinition.set === noop) { 39287 sharedPropertyDefinition.set = function () { 39288 warn( 39289 ("Computed property \"" + key + "\" was assigned to but it has no setter."), 39290 this 39291 ); 39292 }; 39293 } 39294 Object.defineProperty(target, key, sharedPropertyDefinition); 39295} 39296 39297function createComputedGetter (key) { 39298 return function computedGetter () { 39299 var watcher = this._computedWatchers && this._computedWatchers[key]; 39300 if (watcher) { 39301 if (watcher.dirty) { 39302 watcher.evaluate(); 39303 } 39304 if (Dep.target) { 39305 watcher.depend(); 39306 } 39307 return watcher.value 39308 } 39309 } 39310} 39311 39312function createGetterInvoker(fn) { 39313 return function computedGetter () { 39314 return fn.call(this, this) 39315 } 39316} 39317 39318function initMethods (vm, methods) { 39319 var props = vm.$options.props; 39320 for (var key in methods) { 39321 if (true) { 39322 if (typeof methods[key] !== 'function') { 39323 warn( 39324 "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + 39325 "Did you reference the function correctly?", 39326 vm 39327 ); 39328 } 39329 if (props && hasOwn(props, key)) { 39330 warn( 39331 ("Method \"" + key + "\" has already been defined as a prop."), 39332 vm 39333 ); 39334 } 39335 if ((key in vm) && isReserved(key)) { 39336 warn( 39337 "Method \"" + key + "\" conflicts with an existing Vue instance method. " + 39338 "Avoid defining component methods that start with _ or $." 39339 ); 39340 } 39341 } 39342 vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); 39343 } 39344} 39345 39346function initWatch (vm, watch) { 39347 for (var key in watch) { 39348 var handler = watch[key]; 39349 if (Array.isArray(handler)) { 39350 for (var i = 0; i < handler.length; i++) { 39351 createWatcher(vm, key, handler[i]); 39352 } 39353 } else { 39354 createWatcher(vm, key, handler); 39355 } 39356 } 39357} 39358 39359function createWatcher ( 39360 vm, 39361 expOrFn, 39362 handler, 39363 options 39364) { 39365 if (isPlainObject(handler)) { 39366 options = handler; 39367 handler = handler.handler; 39368 } 39369 if (typeof handler === 'string') { 39370 handler = vm[handler]; 39371 } 39372 return vm.$watch(expOrFn, handler, options) 39373} 39374 39375function stateMixin (Vue) { 39376 // flow somehow has problems with directly declared definition object 39377 // when using Object.defineProperty, so we have to procedurally build up 39378 // the object here. 39379 var dataDef = {}; 39380 dataDef.get = function () { return this._data }; 39381 var propsDef = {}; 39382 propsDef.get = function () { return this._props }; 39383 if (true) { 39384 dataDef.set = function () { 39385 warn( 39386 'Avoid replacing instance root $data. ' + 39387 'Use nested data properties instead.', 39388 this 39389 ); 39390 }; 39391 propsDef.set = function () { 39392 warn("$props is readonly.", this); 39393 }; 39394 } 39395 Object.defineProperty(Vue.prototype, '$data', dataDef); 39396 Object.defineProperty(Vue.prototype, '$props', propsDef); 39397 39398 Vue.prototype.$set = set; 39399 Vue.prototype.$delete = del; 39400 39401 Vue.prototype.$watch = function ( 39402 expOrFn, 39403 cb, 39404 options 39405 ) { 39406 var vm = this; 39407 if (isPlainObject(cb)) { 39408 return createWatcher(vm, expOrFn, cb, options) 39409 } 39410 options = options || {}; 39411 options.user = true; 39412 var watcher = new Watcher(vm, expOrFn, cb, options); 39413 if (options.immediate) { 39414 var info = "callback for immediate watcher \"" + (watcher.expression) + "\""; 39415 pushTarget(); 39416 invokeWithErrorHandling(cb, vm, [watcher.value], vm, info); 39417 popTarget(); 39418 } 39419 return function unwatchFn () { 39420 watcher.teardown(); 39421 } 39422 }; 39423} 39424 39425/* */ 39426 39427var uid$3 = 0; 39428 39429function initMixin (Vue) { 39430 Vue.prototype._init = function (options) { 39431 var vm = this; 39432 // a uid 39433 vm._uid = uid$3++; 39434 39435 var startTag, endTag; 39436 /* istanbul ignore if */ 39437 if ( true && config.performance && mark) { 39438 startTag = "vue-perf-start:" + (vm._uid); 39439 endTag = "vue-perf-end:" + (vm._uid); 39440 mark(startTag); 39441 } 39442 39443 // a flag to avoid this being observed 39444 vm._isVue = true; 39445 // merge options 39446 if (options && options._isComponent) { 39447 // optimize internal component instantiation 39448 // since dynamic options merging is pretty slow, and none of the 39449 // internal component options needs special treatment. 39450 initInternalComponent(vm, options); 39451 } else { 39452 vm.$options = mergeOptions( 39453 resolveConstructorOptions(vm.constructor), 39454 options || {}, 39455 vm 39456 ); 39457 } 39458 /* istanbul ignore else */ 39459 if (true) { 39460 initProxy(vm); 39461 } else {} 39462 // expose real self 39463 vm._self = vm; 39464 initLifecycle(vm); 39465 initEvents(vm); 39466 initRender(vm); 39467 callHook(vm, 'beforeCreate'); 39468 initInjections(vm); // resolve injections before data/props 39469 initState(vm); 39470 initProvide(vm); // resolve provide after data/props 39471 callHook(vm, 'created'); 39472 39473 /* istanbul ignore if */ 39474 if ( true && config.performance && mark) { 39475 vm._name = formatComponentName(vm, false); 39476 mark(endTag); 39477 measure(("vue " + (vm._name) + " init"), startTag, endTag); 39478 } 39479 39480 if (vm.$options.el) { 39481 vm.$mount(vm.$options.el); 39482 } 39483 }; 39484} 39485 39486function initInternalComponent (vm, options) { 39487 var opts = vm.$options = Object.create(vm.constructor.options); 39488 // doing this because it's faster than dynamic enumeration. 39489 var parentVnode = options._parentVnode; 39490 opts.parent = options.parent; 39491 opts._parentVnode = parentVnode; 39492 39493 var vnodeComponentOptions = parentVnode.componentOptions; 39494 opts.propsData = vnodeComponentOptions.propsData; 39495 opts._parentListeners = vnodeComponentOptions.listeners; 39496 opts._renderChildren = vnodeComponentOptions.children; 39497 opts._componentTag = vnodeComponentOptions.tag; 39498 39499 if (options.render) { 39500 opts.render = options.render; 39501 opts.staticRenderFns = options.staticRenderFns; 39502 } 39503} 39504 39505function resolveConstructorOptions (Ctor) { 39506 var options = Ctor.options; 39507 if (Ctor.super) { 39508 var superOptions = resolveConstructorOptions(Ctor.super); 39509 var cachedSuperOptions = Ctor.superOptions; 39510 if (superOptions !== cachedSuperOptions) { 39511 // super option changed, 39512 // need to resolve new options. 39513 Ctor.superOptions = superOptions; 39514 // check if there are any late-modified/attached options (#4976) 39515 var modifiedOptions = resolveModifiedOptions(Ctor); 39516 // update base extend options 39517 if (modifiedOptions) { 39518 extend(Ctor.extendOptions, modifiedOptions); 39519 } 39520 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions); 39521 if (options.name) { 39522 options.components[options.name] = Ctor; 39523 } 39524 } 39525 } 39526 return options 39527} 39528 39529function resolveModifiedOptions (Ctor) { 39530 var modified; 39531 var latest = Ctor.options; 39532 var sealed = Ctor.sealedOptions; 39533 for (var key in latest) { 39534 if (latest[key] !== sealed[key]) { 39535 if (!modified) { modified = {}; } 39536 modified[key] = latest[key]; 39537 } 39538 } 39539 return modified 39540} 39541 39542function Vue (options) { 39543 if ( true && 39544 !(this instanceof Vue) 39545 ) { 39546 warn('Vue is a constructor and should be called with the `new` keyword'); 39547 } 39548 this._init(options); 39549} 39550 39551initMixin(Vue); 39552stateMixin(Vue); 39553eventsMixin(Vue); 39554lifecycleMixin(Vue); 39555renderMixin(Vue); 39556 39557/* */ 39558 39559function initUse (Vue) { 39560 Vue.use = function (plugin) { 39561 var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); 39562 if (installedPlugins.indexOf(plugin) > -1) { 39563 return this 39564 } 39565 39566 // additional parameters 39567 var args = toArray(arguments, 1); 39568 args.unshift(this); 39569 if (typeof plugin.install === 'function') { 39570 plugin.install.apply(plugin, args); 39571 } else if (typeof plugin === 'function') { 39572 plugin.apply(null, args); 39573 } 39574 installedPlugins.push(plugin); 39575 return this 39576 }; 39577} 39578 39579/* */ 39580 39581function initMixin$1 (Vue) { 39582 Vue.mixin = function (mixin) { 39583 this.options = mergeOptions(this.options, mixin); 39584 return this 39585 }; 39586} 39587 39588/* */ 39589 39590function initExtend (Vue) { 39591 /** 39592 * Each instance constructor, including Vue, has a unique 39593 * cid. This enables us to create wrapped "child 39594 * constructors" for prototypal inheritance and cache them. 39595 */ 39596 Vue.cid = 0; 39597 var cid = 1; 39598 39599 /** 39600 * Class inheritance 39601 */ 39602 Vue.extend = function (extendOptions) { 39603 extendOptions = extendOptions || {}; 39604 var Super = this; 39605 var SuperId = Super.cid; 39606 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); 39607 if (cachedCtors[SuperId]) { 39608 return cachedCtors[SuperId] 39609 } 39610 39611 var name = extendOptions.name || Super.options.name; 39612 if ( true && name) { 39613 validateComponentName(name); 39614 } 39615 39616 var Sub = function VueComponent (options) { 39617 this._init(options); 39618 }; 39619 Sub.prototype = Object.create(Super.prototype); 39620 Sub.prototype.constructor = Sub; 39621 Sub.cid = cid++; 39622 Sub.options = mergeOptions( 39623 Super.options, 39624 extendOptions 39625 ); 39626 Sub['super'] = Super; 39627 39628 // For props and computed properties, we define the proxy getters on 39629 // the Vue instances at extension time, on the extended prototype. This 39630 // avoids Object.defineProperty calls for each instance created. 39631 if (Sub.options.props) { 39632 initProps$1(Sub); 39633 } 39634 if (Sub.options.computed) { 39635 initComputed$1(Sub); 39636 } 39637 39638 // allow further extension/mixin/plugin usage 39639 Sub.extend = Super.extend; 39640 Sub.mixin = Super.mixin; 39641 Sub.use = Super.use; 39642 39643 // create asset registers, so extended classes 39644 // can have their private assets too. 39645 ASSET_TYPES.forEach(function (type) { 39646 Sub[type] = Super[type]; 39647 }); 39648 // enable recursive self-lookup 39649 if (name) { 39650 Sub.options.components[name] = Sub; 39651 } 39652 39653 // keep a reference to the super options at extension time. 39654 // later at instantiation we can check if Super's options have 39655 // been updated. 39656 Sub.superOptions = Super.options; 39657 Sub.extendOptions = extendOptions; 39658 Sub.sealedOptions = extend({}, Sub.options); 39659 39660 // cache constructor 39661 cachedCtors[SuperId] = Sub; 39662 return Sub 39663 }; 39664} 39665 39666function initProps$1 (Comp) { 39667 var props = Comp.options.props; 39668 for (var key in props) { 39669 proxy(Comp.prototype, "_props", key); 39670 } 39671} 39672 39673function initComputed$1 (Comp) { 39674 var computed = Comp.options.computed; 39675 for (var key in computed) { 39676 defineComputed(Comp.prototype, key, computed[key]); 39677 } 39678} 39679 39680/* */ 39681 39682function initAssetRegisters (Vue) { 39683 /** 39684 * Create asset registration methods. 39685 */ 39686 ASSET_TYPES.forEach(function (type) { 39687 Vue[type] = function ( 39688 id, 39689 definition 39690 ) { 39691 if (!definition) { 39692 return this.options[type + 's'][id] 39693 } else { 39694 /* istanbul ignore if */ 39695 if ( true && type === 'component') { 39696 validateComponentName(id); 39697 } 39698 if (type === 'component' && isPlainObject(definition)) { 39699 definition.name = definition.name || id; 39700 definition = this.options._base.extend(definition); 39701 } 39702 if (type === 'directive' && typeof definition === 'function') { 39703 definition = { bind: definition, update: definition }; 39704 } 39705 this.options[type + 's'][id] = definition; 39706 return definition 39707 } 39708 }; 39709 }); 39710} 39711 39712/* */ 39713 39714 39715 39716 39717 39718function getComponentName (opts) { 39719 return opts && (opts.Ctor.options.name || opts.tag) 39720} 39721 39722function matches (pattern, name) { 39723 if (Array.isArray(pattern)) { 39724 return pattern.indexOf(name) > -1 39725 } else if (typeof pattern === 'string') { 39726 return pattern.split(',').indexOf(name) > -1 39727 } else if (isRegExp(pattern)) { 39728 return pattern.test(name) 39729 } 39730 /* istanbul ignore next */ 39731 return false 39732} 39733 39734function pruneCache (keepAliveInstance, filter) { 39735 var cache = keepAliveInstance.cache; 39736 var keys = keepAliveInstance.keys; 39737 var _vnode = keepAliveInstance._vnode; 39738 for (var key in cache) { 39739 var entry = cache[key]; 39740 if (entry) { 39741 var name = entry.name; 39742 if (name && !filter(name)) { 39743 pruneCacheEntry(cache, key, keys, _vnode); 39744 } 39745 } 39746 } 39747} 39748 39749function pruneCacheEntry ( 39750 cache, 39751 key, 39752 keys, 39753 current 39754) { 39755 var entry = cache[key]; 39756 if (entry && (!current || entry.tag !== current.tag)) { 39757 entry.componentInstance.$destroy(); 39758 } 39759 cache[key] = null; 39760 remove(keys, key); 39761} 39762 39763var patternTypes = [String, RegExp, Array]; 39764 39765var KeepAlive = { 39766 name: 'keep-alive', 39767 abstract: true, 39768 39769 props: { 39770 include: patternTypes, 39771 exclude: patternTypes, 39772 max: [String, Number] 39773 }, 39774 39775 methods: { 39776 cacheVNode: function cacheVNode() { 39777 var ref = this; 39778 var cache = ref.cache; 39779 var keys = ref.keys; 39780 var vnodeToCache = ref.vnodeToCache; 39781 var keyToCache = ref.keyToCache; 39782 if (vnodeToCache) { 39783 var tag = vnodeToCache.tag; 39784 var componentInstance = vnodeToCache.componentInstance; 39785 var componentOptions = vnodeToCache.componentOptions; 39786 cache[keyToCache] = { 39787 name: getComponentName(componentOptions), 39788 tag: tag, 39789 componentInstance: componentInstance, 39790 }; 39791 keys.push(keyToCache); 39792 // prune oldest entry 39793 if (this.max && keys.length > parseInt(this.max)) { 39794 pruneCacheEntry(cache, keys[0], keys, this._vnode); 39795 } 39796 this.vnodeToCache = null; 39797 } 39798 } 39799 }, 39800 39801 created: function created () { 39802 this.cache = Object.create(null); 39803 this.keys = []; 39804 }, 39805 39806 destroyed: function destroyed () { 39807 for (var key in this.cache) { 39808 pruneCacheEntry(this.cache, key, this.keys); 39809 } 39810 }, 39811 39812 mounted: function mounted () { 39813 var this$1 = this; 39814 39815 this.cacheVNode(); 39816 this.$watch('include', function (val) { 39817 pruneCache(this$1, function (name) { return matches(val, name); }); 39818 }); 39819 this.$watch('exclude', function (val) { 39820 pruneCache(this$1, function (name) { return !matches(val, name); }); 39821 }); 39822 }, 39823 39824 updated: function updated () { 39825 this.cacheVNode(); 39826 }, 39827 39828 render: function render () { 39829 var slot = this.$slots.default; 39830 var vnode = getFirstComponentChild(slot); 39831 var componentOptions = vnode && vnode.componentOptions; 39832 if (componentOptions) { 39833 // check pattern 39834 var name = getComponentName(componentOptions); 39835 var ref = this; 39836 var include = ref.include; 39837 var exclude = ref.exclude; 39838 if ( 39839 // not included 39840 (include && (!name || !matches(include, name))) || 39841 // excluded 39842 (exclude && name && matches(exclude, name)) 39843 ) { 39844 return vnode 39845 } 39846 39847 var ref$1 = this; 39848 var cache = ref$1.cache; 39849 var keys = ref$1.keys; 39850 var key = vnode.key == null 39851 // same constructor may get registered as different local components 39852 // so cid alone is not enough (#3269) 39853 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') 39854 : vnode.key; 39855 if (cache[key]) { 39856 vnode.componentInstance = cache[key].componentInstance; 39857 // make current key freshest 39858 remove(keys, key); 39859 keys.push(key); 39860 } else { 39861 // delay setting the cache until update 39862 this.vnodeToCache = vnode; 39863 this.keyToCache = key; 39864 } 39865 39866 vnode.data.keepAlive = true; 39867 } 39868 return vnode || (slot && slot[0]) 39869 } 39870}; 39871 39872var builtInComponents = { 39873 KeepAlive: KeepAlive 39874}; 39875 39876/* */ 39877 39878function initGlobalAPI (Vue) { 39879 // config 39880 var configDef = {}; 39881 configDef.get = function () { return config; }; 39882 if (true) { 39883 configDef.set = function () { 39884 warn( 39885 'Do not replace the Vue.config object, set individual fields instead.' 39886 ); 39887 }; 39888 } 39889 Object.defineProperty(Vue, 'config', configDef); 39890 39891 // exposed util methods. 39892 // NOTE: these are not considered part of the public API - avoid relying on 39893 // them unless you are aware of the risk. 39894 Vue.util = { 39895 warn: warn, 39896 extend: extend, 39897 mergeOptions: mergeOptions, 39898 defineReactive: defineReactive$$1 39899 }; 39900 39901 Vue.set = set; 39902 Vue.delete = del; 39903 Vue.nextTick = nextTick; 39904 39905 // 2.6 explicit observable API 39906 Vue.observable = function (obj) { 39907 observe(obj); 39908 return obj 39909 }; 39910 39911 Vue.options = Object.create(null); 39912 ASSET_TYPES.forEach(function (type) { 39913 Vue.options[type + 's'] = Object.create(null); 39914 }); 39915 39916 // this is used to identify the "base" constructor to extend all plain-object 39917 // components with in Weex's multi-instance scenarios. 39918 Vue.options._base = Vue; 39919 39920 extend(Vue.options.components, builtInComponents); 39921 39922 initUse(Vue); 39923 initMixin$1(Vue); 39924 initExtend(Vue); 39925 initAssetRegisters(Vue); 39926} 39927 39928initGlobalAPI(Vue); 39929 39930Object.defineProperty(Vue.prototype, '$isServer', { 39931 get: isServerRendering 39932}); 39933 39934Object.defineProperty(Vue.prototype, '$ssrContext', { 39935 get: function get () { 39936 /* istanbul ignore next */ 39937 return this.$vnode && this.$vnode.ssrContext 39938 } 39939}); 39940 39941// expose FunctionalRenderContext for ssr runtime helper installation 39942Object.defineProperty(Vue, 'FunctionalRenderContext', { 39943 value: FunctionalRenderContext 39944}); 39945 39946Vue.version = '2.6.14'; 39947 39948/* */ 39949 39950// these are reserved for web because they are directly compiled away 39951// during template compilation 39952var isReservedAttr = makeMap('style,class'); 39953 39954// attributes that should be using props for binding 39955var acceptValue = makeMap('input,textarea,option,select,progress'); 39956var mustUseProp = function (tag, type, attr) { 39957 return ( 39958 (attr === 'value' && acceptValue(tag)) && type !== 'button' || 39959 (attr === 'selected' && tag === 'option') || 39960 (attr === 'checked' && tag === 'input') || 39961 (attr === 'muted' && tag === 'video') 39962 ) 39963}; 39964 39965var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); 39966 39967var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only'); 39968 39969var convertEnumeratedValue = function (key, value) { 39970 return isFalsyAttrValue(value) || value === 'false' 39971 ? 'false' 39972 // allow arbitrary string value for contenteditable 39973 : key === 'contenteditable' && isValidContentEditableValue(value) 39974 ? value 39975 : 'true' 39976}; 39977 39978var isBooleanAttr = makeMap( 39979 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 39980 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 39981 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 39982 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 39983 'required,reversed,scoped,seamless,selected,sortable,' + 39984 'truespeed,typemustmatch,visible' 39985); 39986 39987var xlinkNS = 'http://www.w3.org/1999/xlink'; 39988 39989var isXlink = function (name) { 39990 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' 39991}; 39992 39993var getXlinkProp = function (name) { 39994 return isXlink(name) ? name.slice(6, name.length) : '' 39995}; 39996 39997var isFalsyAttrValue = function (val) { 39998 return val == null || val === false 39999}; 40000 40001/* */ 40002 40003function genClassForVnode (vnode) { 40004 var data = vnode.data; 40005 var parentNode = vnode; 40006 var childNode = vnode; 40007 while (isDef(childNode.componentInstance)) { 40008 childNode = childNode.componentInstance._vnode; 40009 if (childNode && childNode.data) { 40010 data = mergeClassData(childNode.data, data); 40011 } 40012 } 40013 while (isDef(parentNode = parentNode.parent)) { 40014 if (parentNode && parentNode.data) { 40015 data = mergeClassData(data, parentNode.data); 40016 } 40017 } 40018 return renderClass(data.staticClass, data.class) 40019} 40020 40021function mergeClassData (child, parent) { 40022 return { 40023 staticClass: concat(child.staticClass, parent.staticClass), 40024 class: isDef(child.class) 40025 ? [child.class, parent.class] 40026 : parent.class 40027 } 40028} 40029 40030function renderClass ( 40031 staticClass, 40032 dynamicClass 40033) { 40034 if (isDef(staticClass) || isDef(dynamicClass)) { 40035 return concat(staticClass, stringifyClass(dynamicClass)) 40036 } 40037 /* istanbul ignore next */ 40038 return '' 40039} 40040 40041function concat (a, b) { 40042 return a ? b ? (a + ' ' + b) : a : (b || '') 40043} 40044 40045function stringifyClass (value) { 40046 if (Array.isArray(value)) { 40047 return stringifyArray(value) 40048 } 40049 if (isObject(value)) { 40050 return stringifyObject(value) 40051 } 40052 if (typeof value === 'string') { 40053 return value 40054 } 40055 /* istanbul ignore next */ 40056 return '' 40057} 40058 40059function stringifyArray (value) { 40060 var res = ''; 40061 var stringified; 40062 for (var i = 0, l = value.length; i < l; i++) { 40063 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { 40064 if (res) { res += ' '; } 40065 res += stringified; 40066 } 40067 } 40068 return res 40069} 40070 40071function stringifyObject (value) { 40072 var res = ''; 40073 for (var key in value) { 40074 if (value[key]) { 40075 if (res) { res += ' '; } 40076 res += key; 40077 } 40078 } 40079 return res 40080} 40081 40082/* */ 40083 40084var namespaceMap = { 40085 svg: 'http://www.w3.org/2000/svg', 40086 math: 'http://www.w3.org/1998/Math/MathML' 40087}; 40088 40089var isHTMLTag = makeMap( 40090 'html,body,base,head,link,meta,style,title,' + 40091 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 40092 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 40093 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 40094 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 40095 'embed,object,param,source,canvas,script,noscript,del,ins,' + 40096 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 40097 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 40098 'output,progress,select,textarea,' + 40099 'details,dialog,menu,menuitem,summary,' + 40100 'content,element,shadow,template,blockquote,iframe,tfoot' 40101); 40102 40103// this map is intentionally selective, only covering SVG elements that may 40104// contain child elements. 40105var isSVG = makeMap( 40106 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 40107 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 40108 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', 40109 true 40110); 40111 40112var isPreTag = function (tag) { return tag === 'pre'; }; 40113 40114var isReservedTag = function (tag) { 40115 return isHTMLTag(tag) || isSVG(tag) 40116}; 40117 40118function getTagNamespace (tag) { 40119 if (isSVG(tag)) { 40120 return 'svg' 40121 } 40122 // basic support for MathML 40123 // note it doesn't support other MathML elements being component roots 40124 if (tag === 'math') { 40125 return 'math' 40126 } 40127} 40128 40129var unknownElementCache = Object.create(null); 40130function isUnknownElement (tag) { 40131 /* istanbul ignore if */ 40132 if (!inBrowser) { 40133 return true 40134 } 40135 if (isReservedTag(tag)) { 40136 return false 40137 } 40138 tag = tag.toLowerCase(); 40139 /* istanbul ignore if */ 40140 if (unknownElementCache[tag] != null) { 40141 return unknownElementCache[tag] 40142 } 40143 var el = document.createElement(tag); 40144 if (tag.indexOf('-') > -1) { 40145 // http://stackoverflow.com/a/28210364/1070244 40146 return (unknownElementCache[tag] = ( 40147 el.constructor === window.HTMLUnknownElement || 40148 el.constructor === window.HTMLElement 40149 )) 40150 } else { 40151 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) 40152 } 40153} 40154 40155var isTextInputType = makeMap('text,number,password,search,email,tel,url'); 40156 40157/* */ 40158 40159/** 40160 * Query an element selector if it's not an element already. 40161 */ 40162function query (el) { 40163 if (typeof el === 'string') { 40164 var selected = document.querySelector(el); 40165 if (!selected) { 40166 true && warn( 40167 'Cannot find element: ' + el 40168 ); 40169 return document.createElement('div') 40170 } 40171 return selected 40172 } else { 40173 return el 40174 } 40175} 40176 40177/* */ 40178 40179function createElement$1 (tagName, vnode) { 40180 var elm = document.createElement(tagName); 40181 if (tagName !== 'select') { 40182 return elm 40183 } 40184 // false or null will remove the attribute but undefined will not 40185 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { 40186 elm.setAttribute('multiple', 'multiple'); 40187 } 40188 return elm 40189} 40190 40191function createElementNS (namespace, tagName) { 40192 return document.createElementNS(namespaceMap[namespace], tagName) 40193} 40194 40195function createTextNode (text) { 40196 return document.createTextNode(text) 40197} 40198 40199function createComment (text) { 40200 return document.createComment(text) 40201} 40202 40203function insertBefore (parentNode, newNode, referenceNode) { 40204 parentNode.insertBefore(newNode, referenceNode); 40205} 40206 40207function removeChild (node, child) { 40208 node.removeChild(child); 40209} 40210 40211function appendChild (node, child) { 40212 node.appendChild(child); 40213} 40214 40215function parentNode (node) { 40216 return node.parentNode 40217} 40218 40219function nextSibling (node) { 40220 return node.nextSibling 40221} 40222 40223function tagName (node) { 40224 return node.tagName 40225} 40226 40227function setTextContent (node, text) { 40228 node.textContent = text; 40229} 40230 40231function setStyleScope (node, scopeId) { 40232 node.setAttribute(scopeId, ''); 40233} 40234 40235var nodeOps = /*#__PURE__*/Object.freeze({ 40236 createElement: createElement$1, 40237 createElementNS: createElementNS, 40238 createTextNode: createTextNode, 40239 createComment: createComment, 40240 insertBefore: insertBefore, 40241 removeChild: removeChild, 40242 appendChild: appendChild, 40243 parentNode: parentNode, 40244 nextSibling: nextSibling, 40245 tagName: tagName, 40246 setTextContent: setTextContent, 40247 setStyleScope: setStyleScope 40248}); 40249 40250/* */ 40251 40252var ref = { 40253 create: function create (_, vnode) { 40254 registerRef(vnode); 40255 }, 40256 update: function update (oldVnode, vnode) { 40257 if (oldVnode.data.ref !== vnode.data.ref) { 40258 registerRef(oldVnode, true); 40259 registerRef(vnode); 40260 } 40261 }, 40262 destroy: function destroy (vnode) { 40263 registerRef(vnode, true); 40264 } 40265}; 40266 40267function registerRef (vnode, isRemoval) { 40268 var key = vnode.data.ref; 40269 if (!isDef(key)) { return } 40270 40271 var vm = vnode.context; 40272 var ref = vnode.componentInstance || vnode.elm; 40273 var refs = vm.$refs; 40274 if (isRemoval) { 40275 if (Array.isArray(refs[key])) { 40276 remove(refs[key], ref); 40277 } else if (refs[key] === ref) { 40278 refs[key] = undefined; 40279 } 40280 } else { 40281 if (vnode.data.refInFor) { 40282 if (!Array.isArray(refs[key])) { 40283 refs[key] = [ref]; 40284 } else if (refs[key].indexOf(ref) < 0) { 40285 // $flow-disable-line 40286 refs[key].push(ref); 40287 } 40288 } else { 40289 refs[key] = ref; 40290 } 40291 } 40292} 40293 40294/** 40295 * Virtual DOM patching algorithm based on Snabbdom by 40296 * Simon Friis Vindum (@paldepind) 40297 * Licensed under the MIT License 40298 * https://github.com/paldepind/snabbdom/blob/master/LICENSE 40299 * 40300 * modified by Evan You (@yyx990803) 40301 * 40302 * Not type-checking this because this file is perf-critical and the cost 40303 * of making flow understand it is not worth it. 40304 */ 40305 40306var emptyNode = new VNode('', {}, []); 40307 40308var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; 40309 40310function sameVnode (a, b) { 40311 return ( 40312 a.key === b.key && 40313 a.asyncFactory === b.asyncFactory && ( 40314 ( 40315 a.tag === b.tag && 40316 a.isComment === b.isComment && 40317 isDef(a.data) === isDef(b.data) && 40318 sameInputType(a, b) 40319 ) || ( 40320 isTrue(a.isAsyncPlaceholder) && 40321 isUndef(b.asyncFactory.error) 40322 ) 40323 ) 40324 ) 40325} 40326 40327function sameInputType (a, b) { 40328 if (a.tag !== 'input') { return true } 40329 var i; 40330 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; 40331 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; 40332 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) 40333} 40334 40335function createKeyToOldIdx (children, beginIdx, endIdx) { 40336 var i, key; 40337 var map = {}; 40338 for (i = beginIdx; i <= endIdx; ++i) { 40339 key = children[i].key; 40340 if (isDef(key)) { map[key] = i; } 40341 } 40342 return map 40343} 40344 40345function createPatchFunction (backend) { 40346 var i, j; 40347 var cbs = {}; 40348 40349 var modules = backend.modules; 40350 var nodeOps = backend.nodeOps; 40351 40352 for (i = 0; i < hooks.length; ++i) { 40353 cbs[hooks[i]] = []; 40354 for (j = 0; j < modules.length; ++j) { 40355 if (isDef(modules[j][hooks[i]])) { 40356 cbs[hooks[i]].push(modules[j][hooks[i]]); 40357 } 40358 } 40359 } 40360 40361 function emptyNodeAt (elm) { 40362 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) 40363 } 40364 40365 function createRmCb (childElm, listeners) { 40366 function remove$$1 () { 40367 if (--remove$$1.listeners === 0) { 40368 removeNode(childElm); 40369 } 40370 } 40371 remove$$1.listeners = listeners; 40372 return remove$$1 40373 } 40374 40375 function removeNode (el) { 40376 var parent = nodeOps.parentNode(el); 40377 // element may have already been removed due to v-html / v-text 40378 if (isDef(parent)) { 40379 nodeOps.removeChild(parent, el); 40380 } 40381 } 40382 40383 function isUnknownElement$$1 (vnode, inVPre) { 40384 return ( 40385 !inVPre && 40386 !vnode.ns && 40387 !( 40388 config.ignoredElements.length && 40389 config.ignoredElements.some(function (ignore) { 40390 return isRegExp(ignore) 40391 ? ignore.test(vnode.tag) 40392 : ignore === vnode.tag 40393 }) 40394 ) && 40395 config.isUnknownElement(vnode.tag) 40396 ) 40397 } 40398 40399 var creatingElmInVPre = 0; 40400 40401 function createElm ( 40402 vnode, 40403 insertedVnodeQueue, 40404 parentElm, 40405 refElm, 40406 nested, 40407 ownerArray, 40408 index 40409 ) { 40410 if (isDef(vnode.elm) && isDef(ownerArray)) { 40411 // This vnode was used in a previous render! 40412 // now it's used as a new node, overwriting its elm would cause 40413 // potential patch errors down the road when it's used as an insertion 40414 // reference node. Instead, we clone the node on-demand before creating 40415 // associated DOM element for it. 40416 vnode = ownerArray[index] = cloneVNode(vnode); 40417 } 40418 40419 vnode.isRootInsert = !nested; // for transition enter check 40420 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { 40421 return 40422 } 40423 40424 var data = vnode.data; 40425 var children = vnode.children; 40426 var tag = vnode.tag; 40427 if (isDef(tag)) { 40428 if (true) { 40429 if (data && data.pre) { 40430 creatingElmInVPre++; 40431 } 40432 if (isUnknownElement$$1(vnode, creatingElmInVPre)) { 40433 warn( 40434 'Unknown custom element: <' + tag + '> - did you ' + 40435 'register the component correctly? For recursive components, ' + 40436 'make sure to provide the "name" option.', 40437 vnode.context 40438 ); 40439 } 40440 } 40441 40442 vnode.elm = vnode.ns 40443 ? nodeOps.createElementNS(vnode.ns, tag) 40444 : nodeOps.createElement(tag, vnode); 40445 setScope(vnode); 40446 40447 /* istanbul ignore if */ 40448 { 40449 createChildren(vnode, children, insertedVnodeQueue); 40450 if (isDef(data)) { 40451 invokeCreateHooks(vnode, insertedVnodeQueue); 40452 } 40453 insert(parentElm, vnode.elm, refElm); 40454 } 40455 40456 if ( true && data && data.pre) { 40457 creatingElmInVPre--; 40458 } 40459 } else if (isTrue(vnode.isComment)) { 40460 vnode.elm = nodeOps.createComment(vnode.text); 40461 insert(parentElm, vnode.elm, refElm); 40462 } else { 40463 vnode.elm = nodeOps.createTextNode(vnode.text); 40464 insert(parentElm, vnode.elm, refElm); 40465 } 40466 } 40467 40468 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 40469 var i = vnode.data; 40470 if (isDef(i)) { 40471 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; 40472 if (isDef(i = i.hook) && isDef(i = i.init)) { 40473 i(vnode, false /* hydrating */); 40474 } 40475 // after calling the init hook, if the vnode is a child component 40476 // it should've created a child instance and mounted it. the child 40477 // component also has set the placeholder vnode's elm. 40478 // in that case we can just return the element and be done. 40479 if (isDef(vnode.componentInstance)) { 40480 initComponent(vnode, insertedVnodeQueue); 40481 insert(parentElm, vnode.elm, refElm); 40482 if (isTrue(isReactivated)) { 40483 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); 40484 } 40485 return true 40486 } 40487 } 40488 } 40489 40490 function initComponent (vnode, insertedVnodeQueue) { 40491 if (isDef(vnode.data.pendingInsert)) { 40492 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); 40493 vnode.data.pendingInsert = null; 40494 } 40495 vnode.elm = vnode.componentInstance.$el; 40496 if (isPatchable(vnode)) { 40497 invokeCreateHooks(vnode, insertedVnodeQueue); 40498 setScope(vnode); 40499 } else { 40500 // empty component root. 40501 // skip all element-related modules except for ref (#3455) 40502 registerRef(vnode); 40503 // make sure to invoke the insert hook 40504 insertedVnodeQueue.push(vnode); 40505 } 40506 } 40507 40508 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 40509 var i; 40510 // hack for #4339: a reactivated component with inner transition 40511 // does not trigger because the inner node's created hooks are not called 40512 // again. It's not ideal to involve module-specific logic in here but 40513 // there doesn't seem to be a better way to do it. 40514 var innerNode = vnode; 40515 while (innerNode.componentInstance) { 40516 innerNode = innerNode.componentInstance._vnode; 40517 if (isDef(i = innerNode.data) && isDef(i = i.transition)) { 40518 for (i = 0; i < cbs.activate.length; ++i) { 40519 cbs.activate[i](emptyNode, innerNode); 40520 } 40521 insertedVnodeQueue.push(innerNode); 40522 break 40523 } 40524 } 40525 // unlike a newly created component, 40526 // a reactivated keep-alive component doesn't insert itself 40527 insert(parentElm, vnode.elm, refElm); 40528 } 40529 40530 function insert (parent, elm, ref$$1) { 40531 if (isDef(parent)) { 40532 if (isDef(ref$$1)) { 40533 if (nodeOps.parentNode(ref$$1) === parent) { 40534 nodeOps.insertBefore(parent, elm, ref$$1); 40535 } 40536 } else { 40537 nodeOps.appendChild(parent, elm); 40538 } 40539 } 40540 } 40541 40542 function createChildren (vnode, children, insertedVnodeQueue) { 40543 if (Array.isArray(children)) { 40544 if (true) { 40545 checkDuplicateKeys(children); 40546 } 40547 for (var i = 0; i < children.length; ++i) { 40548 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); 40549 } 40550 } else if (isPrimitive(vnode.text)) { 40551 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); 40552 } 40553 } 40554 40555 function isPatchable (vnode) { 40556 while (vnode.componentInstance) { 40557 vnode = vnode.componentInstance._vnode; 40558 } 40559 return isDef(vnode.tag) 40560 } 40561 40562 function invokeCreateHooks (vnode, insertedVnodeQueue) { 40563 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 40564 cbs.create[i$1](emptyNode, vnode); 40565 } 40566 i = vnode.data.hook; // Reuse variable 40567 if (isDef(i)) { 40568 if (isDef(i.create)) { i.create(emptyNode, vnode); } 40569 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } 40570 } 40571 } 40572 40573 // set scope id attribute for scoped CSS. 40574 // this is implemented as a special case to avoid the overhead 40575 // of going through the normal attribute patching process. 40576 function setScope (vnode) { 40577 var i; 40578 if (isDef(i = vnode.fnScopeId)) { 40579 nodeOps.setStyleScope(vnode.elm, i); 40580 } else { 40581 var ancestor = vnode; 40582 while (ancestor) { 40583 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { 40584 nodeOps.setStyleScope(vnode.elm, i); 40585 } 40586 ancestor = ancestor.parent; 40587 } 40588 } 40589 // for slot content they should also get the scopeId from the host instance. 40590 if (isDef(i = activeInstance) && 40591 i !== vnode.context && 40592 i !== vnode.fnContext && 40593 isDef(i = i.$options._scopeId) 40594 ) { 40595 nodeOps.setStyleScope(vnode.elm, i); 40596 } 40597 } 40598 40599 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { 40600 for (; startIdx <= endIdx; ++startIdx) { 40601 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); 40602 } 40603 } 40604 40605 function invokeDestroyHook (vnode) { 40606 var i, j; 40607 var data = vnode.data; 40608 if (isDef(data)) { 40609 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } 40610 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } 40611 } 40612 if (isDef(i = vnode.children)) { 40613 for (j = 0; j < vnode.children.length; ++j) { 40614 invokeDestroyHook(vnode.children[j]); 40615 } 40616 } 40617 } 40618 40619 function removeVnodes (vnodes, startIdx, endIdx) { 40620 for (; startIdx <= endIdx; ++startIdx) { 40621 var ch = vnodes[startIdx]; 40622 if (isDef(ch)) { 40623 if (isDef(ch.tag)) { 40624 removeAndInvokeRemoveHook(ch); 40625 invokeDestroyHook(ch); 40626 } else { // Text node 40627 removeNode(ch.elm); 40628 } 40629 } 40630 } 40631 } 40632 40633 function removeAndInvokeRemoveHook (vnode, rm) { 40634 if (isDef(rm) || isDef(vnode.data)) { 40635 var i; 40636 var listeners = cbs.remove.length + 1; 40637 if (isDef(rm)) { 40638 // we have a recursively passed down rm callback 40639 // increase the listeners count 40640 rm.listeners += listeners; 40641 } else { 40642 // directly removing 40643 rm = createRmCb(vnode.elm, listeners); 40644 } 40645 // recursively invoke hooks on child component root node 40646 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { 40647 removeAndInvokeRemoveHook(i, rm); 40648 } 40649 for (i = 0; i < cbs.remove.length; ++i) { 40650 cbs.remove[i](vnode, rm); 40651 } 40652 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { 40653 i(vnode, rm); 40654 } else { 40655 rm(); 40656 } 40657 } else { 40658 removeNode(vnode.elm); 40659 } 40660 } 40661 40662 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { 40663 var oldStartIdx = 0; 40664 var newStartIdx = 0; 40665 var oldEndIdx = oldCh.length - 1; 40666 var oldStartVnode = oldCh[0]; 40667 var oldEndVnode = oldCh[oldEndIdx]; 40668 var newEndIdx = newCh.length - 1; 40669 var newStartVnode = newCh[0]; 40670 var newEndVnode = newCh[newEndIdx]; 40671 var oldKeyToIdx, idxInOld, vnodeToMove, refElm; 40672 40673 // removeOnly is a special flag used only by <transition-group> 40674 // to ensure removed elements stay in correct relative positions 40675 // during leaving transitions 40676 var canMove = !removeOnly; 40677 40678 if (true) { 40679 checkDuplicateKeys(newCh); 40680 } 40681 40682 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { 40683 if (isUndef(oldStartVnode)) { 40684 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left 40685 } else if (isUndef(oldEndVnode)) { 40686 oldEndVnode = oldCh[--oldEndIdx]; 40687 } else if (sameVnode(oldStartVnode, newStartVnode)) { 40688 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 40689 oldStartVnode = oldCh[++oldStartIdx]; 40690 newStartVnode = newCh[++newStartIdx]; 40691 } else if (sameVnode(oldEndVnode, newEndVnode)) { 40692 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 40693 oldEndVnode = oldCh[--oldEndIdx]; 40694 newEndVnode = newCh[--newEndIdx]; 40695 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right 40696 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 40697 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); 40698 oldStartVnode = oldCh[++oldStartIdx]; 40699 newEndVnode = newCh[--newEndIdx]; 40700 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left 40701 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 40702 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); 40703 oldEndVnode = oldCh[--oldEndIdx]; 40704 newStartVnode = newCh[++newStartIdx]; 40705 } else { 40706 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } 40707 idxInOld = isDef(newStartVnode.key) 40708 ? oldKeyToIdx[newStartVnode.key] 40709 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); 40710 if (isUndef(idxInOld)) { // New element 40711 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 40712 } else { 40713 vnodeToMove = oldCh[idxInOld]; 40714 if (sameVnode(vnodeToMove, newStartVnode)) { 40715 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 40716 oldCh[idxInOld] = undefined; 40717 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); 40718 } else { 40719 // same key but different element. treat as new element 40720 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 40721 } 40722 } 40723 newStartVnode = newCh[++newStartIdx]; 40724 } 40725 } 40726 if (oldStartIdx > oldEndIdx) { 40727 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; 40728 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); 40729 } else if (newStartIdx > newEndIdx) { 40730 removeVnodes(oldCh, oldStartIdx, oldEndIdx); 40731 } 40732 } 40733 40734 function checkDuplicateKeys (children) { 40735 var seenKeys = {}; 40736 for (var i = 0; i < children.length; i++) { 40737 var vnode = children[i]; 40738 var key = vnode.key; 40739 if (isDef(key)) { 40740 if (seenKeys[key]) { 40741 warn( 40742 ("Duplicate keys detected: '" + key + "'. This may cause an update error."), 40743 vnode.context 40744 ); 40745 } else { 40746 seenKeys[key] = true; 40747 } 40748 } 40749 } 40750 } 40751 40752 function findIdxInOld (node, oldCh, start, end) { 40753 for (var i = start; i < end; i++) { 40754 var c = oldCh[i]; 40755 if (isDef(c) && sameVnode(node, c)) { return i } 40756 } 40757 } 40758 40759 function patchVnode ( 40760 oldVnode, 40761 vnode, 40762 insertedVnodeQueue, 40763 ownerArray, 40764 index, 40765 removeOnly 40766 ) { 40767 if (oldVnode === vnode) { 40768 return 40769 } 40770 40771 if (isDef(vnode.elm) && isDef(ownerArray)) { 40772 // clone reused vnode 40773 vnode = ownerArray[index] = cloneVNode(vnode); 40774 } 40775 40776 var elm = vnode.elm = oldVnode.elm; 40777 40778 if (isTrue(oldVnode.isAsyncPlaceholder)) { 40779 if (isDef(vnode.asyncFactory.resolved)) { 40780 hydrate(oldVnode.elm, vnode, insertedVnodeQueue); 40781 } else { 40782 vnode.isAsyncPlaceholder = true; 40783 } 40784 return 40785 } 40786 40787 // reuse element for static trees. 40788 // note we only do this if the vnode is cloned - 40789 // if the new node is not cloned it means the render functions have been 40790 // reset by the hot-reload-api and we need to do a proper re-render. 40791 if (isTrue(vnode.isStatic) && 40792 isTrue(oldVnode.isStatic) && 40793 vnode.key === oldVnode.key && 40794 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) 40795 ) { 40796 vnode.componentInstance = oldVnode.componentInstance; 40797 return 40798 } 40799 40800 var i; 40801 var data = vnode.data; 40802 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { 40803 i(oldVnode, vnode); 40804 } 40805 40806 var oldCh = oldVnode.children; 40807 var ch = vnode.children; 40808 if (isDef(data) && isPatchable(vnode)) { 40809 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } 40810 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } 40811 } 40812 if (isUndef(vnode.text)) { 40813 if (isDef(oldCh) && isDef(ch)) { 40814 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } 40815 } else if (isDef(ch)) { 40816 if (true) { 40817 checkDuplicateKeys(ch); 40818 } 40819 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } 40820 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); 40821 } else if (isDef(oldCh)) { 40822 removeVnodes(oldCh, 0, oldCh.length - 1); 40823 } else if (isDef(oldVnode.text)) { 40824 nodeOps.setTextContent(elm, ''); 40825 } 40826 } else if (oldVnode.text !== vnode.text) { 40827 nodeOps.setTextContent(elm, vnode.text); 40828 } 40829 if (isDef(data)) { 40830 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } 40831 } 40832 } 40833 40834 function invokeInsertHook (vnode, queue, initial) { 40835 // delay insert hooks for component root nodes, invoke them after the 40836 // element is really inserted 40837 if (isTrue(initial) && isDef(vnode.parent)) { 40838 vnode.parent.data.pendingInsert = queue; 40839 } else { 40840 for (var i = 0; i < queue.length; ++i) { 40841 queue[i].data.hook.insert(queue[i]); 40842 } 40843 } 40844 } 40845 40846 var hydrationBailed = false; 40847 // list of modules that can skip create hook during hydration because they 40848 // are already rendered on the client or has no need for initialization 40849 // Note: style is excluded because it relies on initial clone for future 40850 // deep updates (#7063). 40851 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); 40852 40853 // Note: this is a browser-only function so we can assume elms are DOM nodes. 40854 function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { 40855 var i; 40856 var tag = vnode.tag; 40857 var data = vnode.data; 40858 var children = vnode.children; 40859 inVPre = inVPre || (data && data.pre); 40860 vnode.elm = elm; 40861 40862 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { 40863 vnode.isAsyncPlaceholder = true; 40864 return true 40865 } 40866 // assert node match 40867 if (true) { 40868 if (!assertNodeMatch(elm, vnode, inVPre)) { 40869 return false 40870 } 40871 } 40872 if (isDef(data)) { 40873 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } 40874 if (isDef(i = vnode.componentInstance)) { 40875 // child component. it should have hydrated its own tree. 40876 initComponent(vnode, insertedVnodeQueue); 40877 return true 40878 } 40879 } 40880 if (isDef(tag)) { 40881 if (isDef(children)) { 40882 // empty element, allow client to pick up and populate children 40883 if (!elm.hasChildNodes()) { 40884 createChildren(vnode, children, insertedVnodeQueue); 40885 } else { 40886 // v-html and domProps: innerHTML 40887 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { 40888 if (i !== elm.innerHTML) { 40889 /* istanbul ignore if */ 40890 if ( true && 40891 typeof console !== 'undefined' && 40892 !hydrationBailed 40893 ) { 40894 hydrationBailed = true; 40895 console.warn('Parent: ', elm); 40896 console.warn('server innerHTML: ', i); 40897 console.warn('client innerHTML: ', elm.innerHTML); 40898 } 40899 return false 40900 } 40901 } else { 40902 // iterate and compare children lists 40903 var childrenMatch = true; 40904 var childNode = elm.firstChild; 40905 for (var i$1 = 0; i$1 < children.length; i$1++) { 40906 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { 40907 childrenMatch = false; 40908 break 40909 } 40910 childNode = childNode.nextSibling; 40911 } 40912 // if childNode is not null, it means the actual childNodes list is 40913 // longer than the virtual children list. 40914 if (!childrenMatch || childNode) { 40915 /* istanbul ignore if */ 40916 if ( true && 40917 typeof console !== 'undefined' && 40918 !hydrationBailed 40919 ) { 40920 hydrationBailed = true; 40921 console.warn('Parent: ', elm); 40922 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); 40923 } 40924 return false 40925 } 40926 } 40927 } 40928 } 40929 if (isDef(data)) { 40930 var fullInvoke = false; 40931 for (var key in data) { 40932 if (!isRenderedModule(key)) { 40933 fullInvoke = true; 40934 invokeCreateHooks(vnode, insertedVnodeQueue); 40935 break 40936 } 40937 } 40938 if (!fullInvoke && data['class']) { 40939 // ensure collecting deps for deep class bindings for future updates 40940 traverse(data['class']); 40941 } 40942 } 40943 } else if (elm.data !== vnode.text) { 40944 elm.data = vnode.text; 40945 } 40946 return true 40947 } 40948 40949 function assertNodeMatch (node, vnode, inVPre) { 40950 if (isDef(vnode.tag)) { 40951 return vnode.tag.indexOf('vue-component') === 0 || ( 40952 !isUnknownElement$$1(vnode, inVPre) && 40953 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) 40954 ) 40955 } else { 40956 return node.nodeType === (vnode.isComment ? 8 : 3) 40957 } 40958 } 40959 40960 return function patch (oldVnode, vnode, hydrating, removeOnly) { 40961 if (isUndef(vnode)) { 40962 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } 40963 return 40964 } 40965 40966 var isInitialPatch = false; 40967 var insertedVnodeQueue = []; 40968 40969 if (isUndef(oldVnode)) { 40970 // empty mount (likely as component), create new root element 40971 isInitialPatch = true; 40972 createElm(vnode, insertedVnodeQueue); 40973 } else { 40974 var isRealElement = isDef(oldVnode.nodeType); 40975 if (!isRealElement && sameVnode(oldVnode, vnode)) { 40976 // patch existing root node 40977 patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly); 40978 } else { 40979 if (isRealElement) { 40980 // mounting to a real element 40981 // check if this is server-rendered content and if we can perform 40982 // a successful hydration. 40983 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) { 40984 oldVnode.removeAttribute(SSR_ATTR); 40985 hydrating = true; 40986 } 40987 if (isTrue(hydrating)) { 40988 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { 40989 invokeInsertHook(vnode, insertedVnodeQueue, true); 40990 return oldVnode 40991 } else if (true) { 40992 warn( 40993 'The client-side rendered virtual DOM tree is not matching ' + 40994 'server-rendered content. This is likely caused by incorrect ' + 40995 'HTML markup, for example nesting block-level elements inside ' + 40996 '<p>, or missing <tbody>. Bailing hydration and performing ' + 40997 'full client-side render.' 40998 ); 40999 } 41000 } 41001 // either not server-rendered, or hydration failed. 41002 // create an empty node and replace it 41003 oldVnode = emptyNodeAt(oldVnode); 41004 } 41005 41006 // replacing existing element 41007 var oldElm = oldVnode.elm; 41008 var parentElm = nodeOps.parentNode(oldElm); 41009 41010 // create new node 41011 createElm( 41012 vnode, 41013 insertedVnodeQueue, 41014 // extremely rare edge case: do not insert if old element is in a 41015 // leaving transition. Only happens when combining transition + 41016 // keep-alive + HOCs. (#4590) 41017 oldElm._leaveCb ? null : parentElm, 41018 nodeOps.nextSibling(oldElm) 41019 ); 41020 41021 // update parent placeholder node element, recursively 41022 if (isDef(vnode.parent)) { 41023 var ancestor = vnode.parent; 41024 var patchable = isPatchable(vnode); 41025 while (ancestor) { 41026 for (var i = 0; i < cbs.destroy.length; ++i) { 41027 cbs.destroy[i](ancestor); 41028 } 41029 ancestor.elm = vnode.elm; 41030 if (patchable) { 41031 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 41032 cbs.create[i$1](emptyNode, ancestor); 41033 } 41034 // #6513 41035 // invoke insert hooks that may have been merged by create hooks. 41036 // e.g. for directives that uses the "inserted" hook. 41037 var insert = ancestor.data.hook.insert; 41038 if (insert.merged) { 41039 // start at index 1 to avoid re-invoking component mounted hook 41040 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) { 41041 insert.fns[i$2](); 41042 } 41043 } 41044 } else { 41045 registerRef(ancestor); 41046 } 41047 ancestor = ancestor.parent; 41048 } 41049 } 41050 41051 // destroy old node 41052 if (isDef(parentElm)) { 41053 removeVnodes([oldVnode], 0, 0); 41054 } else if (isDef(oldVnode.tag)) { 41055 invokeDestroyHook(oldVnode); 41056 } 41057 } 41058 } 41059 41060 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); 41061 return vnode.elm 41062 } 41063} 41064 41065/* */ 41066 41067var directives = { 41068 create: updateDirectives, 41069 update: updateDirectives, 41070 destroy: function unbindDirectives (vnode) { 41071 updateDirectives(vnode, emptyNode); 41072 } 41073}; 41074 41075function updateDirectives (oldVnode, vnode) { 41076 if (oldVnode.data.directives || vnode.data.directives) { 41077 _update(oldVnode, vnode); 41078 } 41079} 41080 41081function _update (oldVnode, vnode) { 41082 var isCreate = oldVnode === emptyNode; 41083 var isDestroy = vnode === emptyNode; 41084 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); 41085 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); 41086 41087 var dirsWithInsert = []; 41088 var dirsWithPostpatch = []; 41089 41090 var key, oldDir, dir; 41091 for (key in newDirs) { 41092 oldDir = oldDirs[key]; 41093 dir = newDirs[key]; 41094 if (!oldDir) { 41095 // new directive, bind 41096 callHook$1(dir, 'bind', vnode, oldVnode); 41097 if (dir.def && dir.def.inserted) { 41098 dirsWithInsert.push(dir); 41099 } 41100 } else { 41101 // existing directive, update 41102 dir.oldValue = oldDir.value; 41103 dir.oldArg = oldDir.arg; 41104 callHook$1(dir, 'update', vnode, oldVnode); 41105 if (dir.def && dir.def.componentUpdated) { 41106 dirsWithPostpatch.push(dir); 41107 } 41108 } 41109 } 41110 41111 if (dirsWithInsert.length) { 41112 var callInsert = function () { 41113 for (var i = 0; i < dirsWithInsert.length; i++) { 41114 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); 41115 } 41116 }; 41117 if (isCreate) { 41118 mergeVNodeHook(vnode, 'insert', callInsert); 41119 } else { 41120 callInsert(); 41121 } 41122 } 41123 41124 if (dirsWithPostpatch.length) { 41125 mergeVNodeHook(vnode, 'postpatch', function () { 41126 for (var i = 0; i < dirsWithPostpatch.length; i++) { 41127 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); 41128 } 41129 }); 41130 } 41131 41132 if (!isCreate) { 41133 for (key in oldDirs) { 41134 if (!newDirs[key]) { 41135 // no longer present, unbind 41136 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); 41137 } 41138 } 41139 } 41140} 41141 41142var emptyModifiers = Object.create(null); 41143 41144function normalizeDirectives$1 ( 41145 dirs, 41146 vm 41147) { 41148 var res = Object.create(null); 41149 if (!dirs) { 41150 // $flow-disable-line 41151 return res 41152 } 41153 var i, dir; 41154 for (i = 0; i < dirs.length; i++) { 41155 dir = dirs[i]; 41156 if (!dir.modifiers) { 41157 // $flow-disable-line 41158 dir.modifiers = emptyModifiers; 41159 } 41160 res[getRawDirName(dir)] = dir; 41161 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); 41162 } 41163 // $flow-disable-line 41164 return res 41165} 41166 41167function getRawDirName (dir) { 41168 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) 41169} 41170 41171function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { 41172 var fn = dir.def && dir.def[hook]; 41173 if (fn) { 41174 try { 41175 fn(vnode.elm, dir, vnode, oldVnode, isDestroy); 41176 } catch (e) { 41177 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); 41178 } 41179 } 41180} 41181 41182var baseModules = [ 41183 ref, 41184 directives 41185]; 41186 41187/* */ 41188 41189function updateAttrs (oldVnode, vnode) { 41190 var opts = vnode.componentOptions; 41191 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { 41192 return 41193 } 41194 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { 41195 return 41196 } 41197 var key, cur, old; 41198 var elm = vnode.elm; 41199 var oldAttrs = oldVnode.data.attrs || {}; 41200 var attrs = vnode.data.attrs || {}; 41201 // clone observed objects, as the user probably wants to mutate it 41202 if (isDef(attrs.__ob__)) { 41203 attrs = vnode.data.attrs = extend({}, attrs); 41204 } 41205 41206 for (key in attrs) { 41207 cur = attrs[key]; 41208 old = oldAttrs[key]; 41209 if (old !== cur) { 41210 setAttr(elm, key, cur, vnode.data.pre); 41211 } 41212 } 41213 // #4391: in IE9, setting type can reset value for input[type=radio] 41214 // #6666: IE/Edge forces progress value down to 1 before setting a max 41215 /* istanbul ignore if */ 41216 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { 41217 setAttr(elm, 'value', attrs.value); 41218 } 41219 for (key in oldAttrs) { 41220 if (isUndef(attrs[key])) { 41221 if (isXlink(key)) { 41222 elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); 41223 } else if (!isEnumeratedAttr(key)) { 41224 elm.removeAttribute(key); 41225 } 41226 } 41227 } 41228} 41229 41230function setAttr (el, key, value, isInPre) { 41231 if (isInPre || el.tagName.indexOf('-') > -1) { 41232 baseSetAttr(el, key, value); 41233 } else if (isBooleanAttr(key)) { 41234 // set attribute for blank value 41235 // e.g. <option disabled>Select one</option> 41236 if (isFalsyAttrValue(value)) { 41237 el.removeAttribute(key); 41238 } else { 41239 // technically allowfullscreen is a boolean attribute for <iframe>, 41240 // but Flash expects a value of "true" when used on <embed> tag 41241 value = key === 'allowfullscreen' && el.tagName === 'EMBED' 41242 ? 'true' 41243 : key; 41244 el.setAttribute(key, value); 41245 } 41246 } else if (isEnumeratedAttr(key)) { 41247 el.setAttribute(key, convertEnumeratedValue(key, value)); 41248 } else if (isXlink(key)) { 41249 if (isFalsyAttrValue(value)) { 41250 el.removeAttributeNS(xlinkNS, getXlinkProp(key)); 41251 } else { 41252 el.setAttributeNS(xlinkNS, key, value); 41253 } 41254 } else { 41255 baseSetAttr(el, key, value); 41256 } 41257} 41258 41259function baseSetAttr (el, key, value) { 41260 if (isFalsyAttrValue(value)) { 41261 el.removeAttribute(key); 41262 } else { 41263 // #7138: IE10 & 11 fires input event when setting placeholder on 41264 // <textarea>... block the first input event and remove the blocker 41265 // immediately. 41266 /* istanbul ignore if */ 41267 if ( 41268 isIE && !isIE9 && 41269 el.tagName === 'TEXTAREA' && 41270 key === 'placeholder' && value !== '' && !el.__ieph 41271 ) { 41272 var blocker = function (e) { 41273 e.stopImmediatePropagation(); 41274 el.removeEventListener('input', blocker); 41275 }; 41276 el.addEventListener('input', blocker); 41277 // $flow-disable-line 41278 el.__ieph = true; /* IE placeholder patched */ 41279 } 41280 el.setAttribute(key, value); 41281 } 41282} 41283 41284var attrs = { 41285 create: updateAttrs, 41286 update: updateAttrs 41287}; 41288 41289/* */ 41290 41291function updateClass (oldVnode, vnode) { 41292 var el = vnode.elm; 41293 var data = vnode.data; 41294 var oldData = oldVnode.data; 41295 if ( 41296 isUndef(data.staticClass) && 41297 isUndef(data.class) && ( 41298 isUndef(oldData) || ( 41299 isUndef(oldData.staticClass) && 41300 isUndef(oldData.class) 41301 ) 41302 ) 41303 ) { 41304 return 41305 } 41306 41307 var cls = genClassForVnode(vnode); 41308 41309 // handle transition classes 41310 var transitionClass = el._transitionClasses; 41311 if (isDef(transitionClass)) { 41312 cls = concat(cls, stringifyClass(transitionClass)); 41313 } 41314 41315 // set the class 41316 if (cls !== el._prevClass) { 41317 el.setAttribute('class', cls); 41318 el._prevClass = cls; 41319 } 41320} 41321 41322var klass = { 41323 create: updateClass, 41324 update: updateClass 41325}; 41326 41327/* */ 41328 41329var validDivisionCharRE = /[\w).+\-_$\]]/; 41330 41331function parseFilters (exp) { 41332 var inSingle = false; 41333 var inDouble = false; 41334 var inTemplateString = false; 41335 var inRegex = false; 41336 var curly = 0; 41337 var square = 0; 41338 var paren = 0; 41339 var lastFilterIndex = 0; 41340 var c, prev, i, expression, filters; 41341 41342 for (i = 0; i < exp.length; i++) { 41343 prev = c; 41344 c = exp.charCodeAt(i); 41345 if (inSingle) { 41346 if (c === 0x27 && prev !== 0x5C) { inSingle = false; } 41347 } else if (inDouble) { 41348 if (c === 0x22 && prev !== 0x5C) { inDouble = false; } 41349 } else if (inTemplateString) { 41350 if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } 41351 } else if (inRegex) { 41352 if (c === 0x2f && prev !== 0x5C) { inRegex = false; } 41353 } else if ( 41354 c === 0x7C && // pipe 41355 exp.charCodeAt(i + 1) !== 0x7C && 41356 exp.charCodeAt(i - 1) !== 0x7C && 41357 !curly && !square && !paren 41358 ) { 41359 if (expression === undefined) { 41360 // first filter, end of expression 41361 lastFilterIndex = i + 1; 41362 expression = exp.slice(0, i).trim(); 41363 } else { 41364 pushFilter(); 41365 } 41366 } else { 41367 switch (c) { 41368 case 0x22: inDouble = true; break // " 41369 case 0x27: inSingle = true; break // ' 41370 case 0x60: inTemplateString = true; break // ` 41371 case 0x28: paren++; break // ( 41372 case 0x29: paren--; break // ) 41373 case 0x5B: square++; break // [ 41374 case 0x5D: square--; break // ] 41375 case 0x7B: curly++; break // { 41376 case 0x7D: curly--; break // } 41377 } 41378 if (c === 0x2f) { // / 41379 var j = i - 1; 41380 var p = (void 0); 41381 // find first non-whitespace prev char 41382 for (; j >= 0; j--) { 41383 p = exp.charAt(j); 41384 if (p !== ' ') { break } 41385 } 41386 if (!p || !validDivisionCharRE.test(p)) { 41387 inRegex = true; 41388 } 41389 } 41390 } 41391 } 41392 41393 if (expression === undefined) { 41394 expression = exp.slice(0, i).trim(); 41395 } else if (lastFilterIndex !== 0) { 41396 pushFilter(); 41397 } 41398 41399 function pushFilter () { 41400 (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); 41401 lastFilterIndex = i + 1; 41402 } 41403 41404 if (filters) { 41405 for (i = 0; i < filters.length; i++) { 41406 expression = wrapFilter(expression, filters[i]); 41407 } 41408 } 41409 41410 return expression 41411} 41412 41413function wrapFilter (exp, filter) { 41414 var i = filter.indexOf('('); 41415 if (i < 0) { 41416 // _f: resolveFilter 41417 return ("_f(\"" + filter + "\")(" + exp + ")") 41418 } else { 41419 var name = filter.slice(0, i); 41420 var args = filter.slice(i + 1); 41421 return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) 41422 } 41423} 41424 41425/* */ 41426 41427 41428 41429/* eslint-disable no-unused-vars */ 41430function baseWarn (msg, range) { 41431 console.error(("[Vue compiler]: " + msg)); 41432} 41433/* eslint-enable no-unused-vars */ 41434 41435function pluckModuleFunction ( 41436 modules, 41437 key 41438) { 41439 return modules 41440 ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) 41441 : [] 41442} 41443 41444function addProp (el, name, value, range, dynamic) { 41445 (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 41446 el.plain = false; 41447} 41448 41449function addAttr (el, name, value, range, dynamic) { 41450 var attrs = dynamic 41451 ? (el.dynamicAttrs || (el.dynamicAttrs = [])) 41452 : (el.attrs || (el.attrs = [])); 41453 attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 41454 el.plain = false; 41455} 41456 41457// add a raw attr (use this in preTransforms) 41458function addRawAttr (el, name, value, range) { 41459 el.attrsMap[name] = value; 41460 el.attrsList.push(rangeSetItem({ name: name, value: value }, range)); 41461} 41462 41463function addDirective ( 41464 el, 41465 name, 41466 rawName, 41467 value, 41468 arg, 41469 isDynamicArg, 41470 modifiers, 41471 range 41472) { 41473 (el.directives || (el.directives = [])).push(rangeSetItem({ 41474 name: name, 41475 rawName: rawName, 41476 value: value, 41477 arg: arg, 41478 isDynamicArg: isDynamicArg, 41479 modifiers: modifiers 41480 }, range)); 41481 el.plain = false; 41482} 41483 41484function prependModifierMarker (symbol, name, dynamic) { 41485 return dynamic 41486 ? ("_p(" + name + ",\"" + symbol + "\")") 41487 : symbol + name // mark the event as captured 41488} 41489 41490function addHandler ( 41491 el, 41492 name, 41493 value, 41494 modifiers, 41495 important, 41496 warn, 41497 range, 41498 dynamic 41499) { 41500 modifiers = modifiers || emptyObject; 41501 // warn prevent and passive modifier 41502 /* istanbul ignore if */ 41503 if ( 41504 true && warn && 41505 modifiers.prevent && modifiers.passive 41506 ) { 41507 warn( 41508 'passive and prevent can\'t be used together. ' + 41509 'Passive handler can\'t prevent default event.', 41510 range 41511 ); 41512 } 41513 41514 // normalize click.right and click.middle since they don't actually fire 41515 // this is technically browser-specific, but at least for now browsers are 41516 // the only target envs that have right/middle clicks. 41517 if (modifiers.right) { 41518 if (dynamic) { 41519 name = "(" + name + ")==='click'?'contextmenu':(" + name + ")"; 41520 } else if (name === 'click') { 41521 name = 'contextmenu'; 41522 delete modifiers.right; 41523 } 41524 } else if (modifiers.middle) { 41525 if (dynamic) { 41526 name = "(" + name + ")==='click'?'mouseup':(" + name + ")"; 41527 } else if (name === 'click') { 41528 name = 'mouseup'; 41529 } 41530 } 41531 41532 // check capture modifier 41533 if (modifiers.capture) { 41534 delete modifiers.capture; 41535 name = prependModifierMarker('!', name, dynamic); 41536 } 41537 if (modifiers.once) { 41538 delete modifiers.once; 41539 name = prependModifierMarker('~', name, dynamic); 41540 } 41541 /* istanbul ignore if */ 41542 if (modifiers.passive) { 41543 delete modifiers.passive; 41544 name = prependModifierMarker('&', name, dynamic); 41545 } 41546 41547 var events; 41548 if (modifiers.native) { 41549 delete modifiers.native; 41550 events = el.nativeEvents || (el.nativeEvents = {}); 41551 } else { 41552 events = el.events || (el.events = {}); 41553 } 41554 41555 var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range); 41556 if (modifiers !== emptyObject) { 41557 newHandler.modifiers = modifiers; 41558 } 41559 41560 var handlers = events[name]; 41561 /* istanbul ignore if */ 41562 if (Array.isArray(handlers)) { 41563 important ? handlers.unshift(newHandler) : handlers.push(newHandler); 41564 } else if (handlers) { 41565 events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; 41566 } else { 41567 events[name] = newHandler; 41568 } 41569 41570 el.plain = false; 41571} 41572 41573function getRawBindingAttr ( 41574 el, 41575 name 41576) { 41577 return el.rawAttrsMap[':' + name] || 41578 el.rawAttrsMap['v-bind:' + name] || 41579 el.rawAttrsMap[name] 41580} 41581 41582function getBindingAttr ( 41583 el, 41584 name, 41585 getStatic 41586) { 41587 var dynamicValue = 41588 getAndRemoveAttr(el, ':' + name) || 41589 getAndRemoveAttr(el, 'v-bind:' + name); 41590 if (dynamicValue != null) { 41591 return parseFilters(dynamicValue) 41592 } else if (getStatic !== false) { 41593 var staticValue = getAndRemoveAttr(el, name); 41594 if (staticValue != null) { 41595 return JSON.stringify(staticValue) 41596 } 41597 } 41598} 41599 41600// note: this only removes the attr from the Array (attrsList) so that it 41601// doesn't get processed by processAttrs. 41602// By default it does NOT remove it from the map (attrsMap) because the map is 41603// needed during codegen. 41604function getAndRemoveAttr ( 41605 el, 41606 name, 41607 removeFromMap 41608) { 41609 var val; 41610 if ((val = el.attrsMap[name]) != null) { 41611 var list = el.attrsList; 41612 for (var i = 0, l = list.length; i < l; i++) { 41613 if (list[i].name === name) { 41614 list.splice(i, 1); 41615 break 41616 } 41617 } 41618 } 41619 if (removeFromMap) { 41620 delete el.attrsMap[name]; 41621 } 41622 return val 41623} 41624 41625function getAndRemoveAttrByRegex ( 41626 el, 41627 name 41628) { 41629 var list = el.attrsList; 41630 for (var i = 0, l = list.length; i < l; i++) { 41631 var attr = list[i]; 41632 if (name.test(attr.name)) { 41633 list.splice(i, 1); 41634 return attr 41635 } 41636 } 41637} 41638 41639function rangeSetItem ( 41640 item, 41641 range 41642) { 41643 if (range) { 41644 if (range.start != null) { 41645 item.start = range.start; 41646 } 41647 if (range.end != null) { 41648 item.end = range.end; 41649 } 41650 } 41651 return item 41652} 41653 41654/* */ 41655 41656/** 41657 * Cross-platform code generation for component v-model 41658 */ 41659function genComponentModel ( 41660 el, 41661 value, 41662 modifiers 41663) { 41664 var ref = modifiers || {}; 41665 var number = ref.number; 41666 var trim = ref.trim; 41667 41668 var baseValueExpression = '$$v'; 41669 var valueExpression = baseValueExpression; 41670 if (trim) { 41671 valueExpression = 41672 "(typeof " + baseValueExpression + " === 'string'" + 41673 "? " + baseValueExpression + ".trim()" + 41674 ": " + baseValueExpression + ")"; 41675 } 41676 if (number) { 41677 valueExpression = "_n(" + valueExpression + ")"; 41678 } 41679 var assignment = genAssignmentCode(value, valueExpression); 41680 41681 el.model = { 41682 value: ("(" + value + ")"), 41683 expression: JSON.stringify(value), 41684 callback: ("function (" + baseValueExpression + ") {" + assignment + "}") 41685 }; 41686} 41687 41688/** 41689 * Cross-platform codegen helper for generating v-model value assignment code. 41690 */ 41691function genAssignmentCode ( 41692 value, 41693 assignment 41694) { 41695 var res = parseModel(value); 41696 if (res.key === null) { 41697 return (value + "=" + assignment) 41698 } else { 41699 return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") 41700 } 41701} 41702 41703/** 41704 * Parse a v-model expression into a base path and a final key segment. 41705 * Handles both dot-path and possible square brackets. 41706 * 41707 * Possible cases: 41708 * 41709 * - test 41710 * - test[key] 41711 * - test[test1[key]] 41712 * - test["a"][key] 41713 * - xxx.test[a[a].test1[key]] 41714 * - test.xxx.a["asa"][test1[key]] 41715 * 41716 */ 41717 41718var len, str, chr, index$1, expressionPos, expressionEndPos; 41719 41720 41721 41722function parseModel (val) { 41723 // Fix https://github.com/vuejs/vue/pull/7730 41724 // allow v-model="obj.val " (trailing whitespace) 41725 val = val.trim(); 41726 len = val.length; 41727 41728 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { 41729 index$1 = val.lastIndexOf('.'); 41730 if (index$1 > -1) { 41731 return { 41732 exp: val.slice(0, index$1), 41733 key: '"' + val.slice(index$1 + 1) + '"' 41734 } 41735 } else { 41736 return { 41737 exp: val, 41738 key: null 41739 } 41740 } 41741 } 41742 41743 str = val; 41744 index$1 = expressionPos = expressionEndPos = 0; 41745 41746 while (!eof()) { 41747 chr = next(); 41748 /* istanbul ignore if */ 41749 if (isStringStart(chr)) { 41750 parseString(chr); 41751 } else if (chr === 0x5B) { 41752 parseBracket(chr); 41753 } 41754 } 41755 41756 return { 41757 exp: val.slice(0, expressionPos), 41758 key: val.slice(expressionPos + 1, expressionEndPos) 41759 } 41760} 41761 41762function next () { 41763 return str.charCodeAt(++index$1) 41764} 41765 41766function eof () { 41767 return index$1 >= len 41768} 41769 41770function isStringStart (chr) { 41771 return chr === 0x22 || chr === 0x27 41772} 41773 41774function parseBracket (chr) { 41775 var inBracket = 1; 41776 expressionPos = index$1; 41777 while (!eof()) { 41778 chr = next(); 41779 if (isStringStart(chr)) { 41780 parseString(chr); 41781 continue 41782 } 41783 if (chr === 0x5B) { inBracket++; } 41784 if (chr === 0x5D) { inBracket--; } 41785 if (inBracket === 0) { 41786 expressionEndPos = index$1; 41787 break 41788 } 41789 } 41790} 41791 41792function parseString (chr) { 41793 var stringQuote = chr; 41794 while (!eof()) { 41795 chr = next(); 41796 if (chr === stringQuote) { 41797 break 41798 } 41799 } 41800} 41801 41802/* */ 41803 41804var warn$1; 41805 41806// in some cases, the event used has to be determined at runtime 41807// so we used some reserved tokens during compile. 41808var RANGE_TOKEN = '__r'; 41809var CHECKBOX_RADIO_TOKEN = '__c'; 41810 41811function model ( 41812 el, 41813 dir, 41814 _warn 41815) { 41816 warn$1 = _warn; 41817 var value = dir.value; 41818 var modifiers = dir.modifiers; 41819 var tag = el.tag; 41820 var type = el.attrsMap.type; 41821 41822 if (true) { 41823 // inputs with type="file" are read only and setting the input's 41824 // value will throw an error. 41825 if (tag === 'input' && type === 'file') { 41826 warn$1( 41827 "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + 41828 "File inputs are read only. Use a v-on:change listener instead.", 41829 el.rawAttrsMap['v-model'] 41830 ); 41831 } 41832 } 41833 41834 if (el.component) { 41835 genComponentModel(el, value, modifiers); 41836 // component v-model doesn't need extra runtime 41837 return false 41838 } else if (tag === 'select') { 41839 genSelect(el, value, modifiers); 41840 } else if (tag === 'input' && type === 'checkbox') { 41841 genCheckboxModel(el, value, modifiers); 41842 } else if (tag === 'input' && type === 'radio') { 41843 genRadioModel(el, value, modifiers); 41844 } else if (tag === 'input' || tag === 'textarea') { 41845 genDefaultModel(el, value, modifiers); 41846 } else if (!config.isReservedTag(tag)) { 41847 genComponentModel(el, value, modifiers); 41848 // component v-model doesn't need extra runtime 41849 return false 41850 } else if (true) { 41851 warn$1( 41852 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 41853 "v-model is not supported on this element type. " + 41854 'If you are working with contenteditable, it\'s recommended to ' + 41855 'wrap a library dedicated for that purpose inside a custom component.', 41856 el.rawAttrsMap['v-model'] 41857 ); 41858 } 41859 41860 // ensure runtime directive metadata 41861 return true 41862} 41863 41864function genCheckboxModel ( 41865 el, 41866 value, 41867 modifiers 41868) { 41869 var number = modifiers && modifiers.number; 41870 var valueBinding = getBindingAttr(el, 'value') || 'null'; 41871 var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; 41872 var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; 41873 addProp(el, 'checked', 41874 "Array.isArray(" + value + ")" + 41875 "?_i(" + value + "," + valueBinding + ")>-1" + ( 41876 trueValueBinding === 'true' 41877 ? (":(" + value + ")") 41878 : (":_q(" + value + "," + trueValueBinding + ")") 41879 ) 41880 ); 41881 addHandler(el, 'change', 41882 "var $$a=" + value + "," + 41883 '$$el=$event.target,' + 41884 "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 41885 'if(Array.isArray($$a)){' + 41886 "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + 41887 '$$i=_i($$a,$$v);' + 41888 "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + 41889 "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + 41890 "}else{" + (genAssignmentCode(value, '$$c')) + "}", 41891 null, true 41892 ); 41893} 41894 41895function genRadioModel ( 41896 el, 41897 value, 41898 modifiers 41899) { 41900 var number = modifiers && modifiers.number; 41901 var valueBinding = getBindingAttr(el, 'value') || 'null'; 41902 valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; 41903 addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); 41904 addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); 41905} 41906 41907function genSelect ( 41908 el, 41909 value, 41910 modifiers 41911) { 41912 var number = modifiers && modifiers.number; 41913 var selectedVal = "Array.prototype.filter" + 41914 ".call($event.target.options,function(o){return o.selected})" + 41915 ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + 41916 "return " + (number ? '_n(val)' : 'val') + "})"; 41917 41918 var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; 41919 var code = "var $$selectedVal = " + selectedVal + ";"; 41920 code = code + " " + (genAssignmentCode(value, assignment)); 41921 addHandler(el, 'change', code, null, true); 41922} 41923 41924function genDefaultModel ( 41925 el, 41926 value, 41927 modifiers 41928) { 41929 var type = el.attrsMap.type; 41930 41931 // warn if v-bind:value conflicts with v-model 41932 // except for inputs with v-bind:type 41933 if (true) { 41934 var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; 41935 var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; 41936 if (value$1 && !typeBinding) { 41937 var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; 41938 warn$1( 41939 binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + 41940 'because the latter already expands to a value binding internally', 41941 el.rawAttrsMap[binding] 41942 ); 41943 } 41944 } 41945 41946 var ref = modifiers || {}; 41947 var lazy = ref.lazy; 41948 var number = ref.number; 41949 var trim = ref.trim; 41950 var needCompositionGuard = !lazy && type !== 'range'; 41951 var event = lazy 41952 ? 'change' 41953 : type === 'range' 41954 ? RANGE_TOKEN 41955 : 'input'; 41956 41957 var valueExpression = '$event.target.value'; 41958 if (trim) { 41959 valueExpression = "$event.target.value.trim()"; 41960 } 41961 if (number) { 41962 valueExpression = "_n(" + valueExpression + ")"; 41963 } 41964 41965 var code = genAssignmentCode(value, valueExpression); 41966 if (needCompositionGuard) { 41967 code = "if($event.target.composing)return;" + code; 41968 } 41969 41970 addProp(el, 'value', ("(" + value + ")")); 41971 addHandler(el, event, code, null, true); 41972 if (trim || number) { 41973 addHandler(el, 'blur', '$forceUpdate()'); 41974 } 41975} 41976 41977/* */ 41978 41979// normalize v-model event tokens that can only be determined at runtime. 41980// it's important to place the event as the first in the array because 41981// the whole point is ensuring the v-model callback gets called before 41982// user-attached handlers. 41983function normalizeEvents (on) { 41984 /* istanbul ignore if */ 41985 if (isDef(on[RANGE_TOKEN])) { 41986 // IE input[type=range] only supports `change` event 41987 var event = isIE ? 'change' : 'input'; 41988 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); 41989 delete on[RANGE_TOKEN]; 41990 } 41991 // This was originally intended to fix #4521 but no longer necessary 41992 // after 2.5. Keeping it for backwards compat with generated code from < 2.4 41993 /* istanbul ignore if */ 41994 if (isDef(on[CHECKBOX_RADIO_TOKEN])) { 41995 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); 41996 delete on[CHECKBOX_RADIO_TOKEN]; 41997 } 41998} 41999 42000var target$1; 42001 42002function createOnceHandler$1 (event, handler, capture) { 42003 var _target = target$1; // save current target element in closure 42004 return function onceHandler () { 42005 var res = handler.apply(null, arguments); 42006 if (res !== null) { 42007 remove$2(event, onceHandler, capture, _target); 42008 } 42009 } 42010} 42011 42012// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp 42013// implementation and does not fire microtasks in between event propagation, so 42014// safe to exclude. 42015var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53); 42016 42017function add$1 ( 42018 name, 42019 handler, 42020 capture, 42021 passive 42022) { 42023 // async edge case #6566: inner click event triggers patch, event handler 42024 // attached to outer element during patch, and triggered again. This 42025 // happens because browsers fire microtask ticks between event propagation. 42026 // the solution is simple: we save the timestamp when a handler is attached, 42027 // and the handler would only fire if the event passed to it was fired 42028 // AFTER it was attached. 42029 if (useMicrotaskFix) { 42030 var attachedTimestamp = currentFlushTimestamp; 42031 var original = handler; 42032 handler = original._wrapper = function (e) { 42033 if ( 42034 // no bubbling, should always fire. 42035 // this is just a safety net in case event.timeStamp is unreliable in 42036 // certain weird environments... 42037 e.target === e.currentTarget || 42038 // event is fired after handler attachment 42039 e.timeStamp >= attachedTimestamp || 42040 // bail for environments that have buggy event.timeStamp implementations 42041 // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState 42042 // #9681 QtWebEngine event.timeStamp is negative value 42043 e.timeStamp <= 0 || 42044 // #9448 bail if event is fired in another document in a multi-page 42045 // electron/nw.js app, since event.timeStamp will be using a different 42046 // starting reference 42047 e.target.ownerDocument !== document 42048 ) { 42049 return original.apply(this, arguments) 42050 } 42051 }; 42052 } 42053 target$1.addEventListener( 42054 name, 42055 handler, 42056 supportsPassive 42057 ? { capture: capture, passive: passive } 42058 : capture 42059 ); 42060} 42061 42062function remove$2 ( 42063 name, 42064 handler, 42065 capture, 42066 _target 42067) { 42068 (_target || target$1).removeEventListener( 42069 name, 42070 handler._wrapper || handler, 42071 capture 42072 ); 42073} 42074 42075function updateDOMListeners (oldVnode, vnode) { 42076 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { 42077 return 42078 } 42079 var on = vnode.data.on || {}; 42080 var oldOn = oldVnode.data.on || {}; 42081 target$1 = vnode.elm; 42082 normalizeEvents(on); 42083 updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context); 42084 target$1 = undefined; 42085} 42086 42087var events = { 42088 create: updateDOMListeners, 42089 update: updateDOMListeners 42090}; 42091 42092/* */ 42093 42094var svgContainer; 42095 42096function updateDOMProps (oldVnode, vnode) { 42097 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { 42098 return 42099 } 42100 var key, cur; 42101 var elm = vnode.elm; 42102 var oldProps = oldVnode.data.domProps || {}; 42103 var props = vnode.data.domProps || {}; 42104 // clone observed objects, as the user probably wants to mutate it 42105 if (isDef(props.__ob__)) { 42106 props = vnode.data.domProps = extend({}, props); 42107 } 42108 42109 for (key in oldProps) { 42110 if (!(key in props)) { 42111 elm[key] = ''; 42112 } 42113 } 42114 42115 for (key in props) { 42116 cur = props[key]; 42117 // ignore children if the node has textContent or innerHTML, 42118 // as these will throw away existing DOM nodes and cause removal errors 42119 // on subsequent patches (#3360) 42120 if (key === 'textContent' || key === 'innerHTML') { 42121 if (vnode.children) { vnode.children.length = 0; } 42122 if (cur === oldProps[key]) { continue } 42123 // #6601 work around Chrome version <= 55 bug where single textNode 42124 // replaced by innerHTML/textContent retains its parentNode property 42125 if (elm.childNodes.length === 1) { 42126 elm.removeChild(elm.childNodes[0]); 42127 } 42128 } 42129 42130 if (key === 'value' && elm.tagName !== 'PROGRESS') { 42131 // store value as _value as well since 42132 // non-string values will be stringified 42133 elm._value = cur; 42134 // avoid resetting cursor position when value is the same 42135 var strCur = isUndef(cur) ? '' : String(cur); 42136 if (shouldUpdateValue(elm, strCur)) { 42137 elm.value = strCur; 42138 } 42139 } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) { 42140 // IE doesn't support innerHTML for SVG elements 42141 svgContainer = svgContainer || document.createElement('div'); 42142 svgContainer.innerHTML = "<svg>" + cur + "</svg>"; 42143 var svg = svgContainer.firstChild; 42144 while (elm.firstChild) { 42145 elm.removeChild(elm.firstChild); 42146 } 42147 while (svg.firstChild) { 42148 elm.appendChild(svg.firstChild); 42149 } 42150 } else if ( 42151 // skip the update if old and new VDOM state is the same. 42152 // `value` is handled separately because the DOM value may be temporarily 42153 // out of sync with VDOM state due to focus, composition and modifiers. 42154 // This #4521 by skipping the unnecessary `checked` update. 42155 cur !== oldProps[key] 42156 ) { 42157 // some property updates can throw 42158 // e.g. `value` on <progress> w/ non-finite value 42159 try { 42160 elm[key] = cur; 42161 } catch (e) {} 42162 } 42163 } 42164} 42165 42166// check platforms/web/util/attrs.js acceptValue 42167 42168 42169function shouldUpdateValue (elm, checkVal) { 42170 return (!elm.composing && ( 42171 elm.tagName === 'OPTION' || 42172 isNotInFocusAndDirty(elm, checkVal) || 42173 isDirtyWithModifiers(elm, checkVal) 42174 )) 42175} 42176 42177function isNotInFocusAndDirty (elm, checkVal) { 42178 // return true when textbox (.number and .trim) loses focus and its value is 42179 // not equal to the updated value 42180 var notInFocus = true; 42181 // #6157 42182 // work around IE bug when accessing document.activeElement in an iframe 42183 try { notInFocus = document.activeElement !== elm; } catch (e) {} 42184 return notInFocus && elm.value !== checkVal 42185} 42186 42187function isDirtyWithModifiers (elm, newVal) { 42188 var value = elm.value; 42189 var modifiers = elm._vModifiers; // injected by v-model runtime 42190 if (isDef(modifiers)) { 42191 if (modifiers.number) { 42192 return toNumber(value) !== toNumber(newVal) 42193 } 42194 if (modifiers.trim) { 42195 return value.trim() !== newVal.trim() 42196 } 42197 } 42198 return value !== newVal 42199} 42200 42201var domProps = { 42202 create: updateDOMProps, 42203 update: updateDOMProps 42204}; 42205 42206/* */ 42207 42208var parseStyleText = cached(function (cssText) { 42209 var res = {}; 42210 var listDelimiter = /;(?![^(]*\))/g; 42211 var propertyDelimiter = /:(.+)/; 42212 cssText.split(listDelimiter).forEach(function (item) { 42213 if (item) { 42214 var tmp = item.split(propertyDelimiter); 42215 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); 42216 } 42217 }); 42218 return res 42219}); 42220 42221// merge static and dynamic style data on the same vnode 42222function normalizeStyleData (data) { 42223 var style = normalizeStyleBinding(data.style); 42224 // static style is pre-processed into an object during compilation 42225 // and is always a fresh object, so it's safe to merge into it 42226 return data.staticStyle 42227 ? extend(data.staticStyle, style) 42228 : style 42229} 42230 42231// normalize possible array / string values into Object 42232function normalizeStyleBinding (bindingStyle) { 42233 if (Array.isArray(bindingStyle)) { 42234 return toObject(bindingStyle) 42235 } 42236 if (typeof bindingStyle === 'string') { 42237 return parseStyleText(bindingStyle) 42238 } 42239 return bindingStyle 42240} 42241 42242/** 42243 * parent component style should be after child's 42244 * so that parent component's style could override it 42245 */ 42246function getStyle (vnode, checkChild) { 42247 var res = {}; 42248 var styleData; 42249 42250 if (checkChild) { 42251 var childNode = vnode; 42252 while (childNode.componentInstance) { 42253 childNode = childNode.componentInstance._vnode; 42254 if ( 42255 childNode && childNode.data && 42256 (styleData = normalizeStyleData(childNode.data)) 42257 ) { 42258 extend(res, styleData); 42259 } 42260 } 42261 } 42262 42263 if ((styleData = normalizeStyleData(vnode.data))) { 42264 extend(res, styleData); 42265 } 42266 42267 var parentNode = vnode; 42268 while ((parentNode = parentNode.parent)) { 42269 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { 42270 extend(res, styleData); 42271 } 42272 } 42273 return res 42274} 42275 42276/* */ 42277 42278var cssVarRE = /^--/; 42279var importantRE = /\s*!important$/; 42280var setProp = function (el, name, val) { 42281 /* istanbul ignore if */ 42282 if (cssVarRE.test(name)) { 42283 el.style.setProperty(name, val); 42284 } else if (importantRE.test(val)) { 42285 el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important'); 42286 } else { 42287 var normalizedName = normalize(name); 42288 if (Array.isArray(val)) { 42289 // Support values array created by autoprefixer, e.g. 42290 // {display: ["-webkit-box", "-ms-flexbox", "flex"]} 42291 // Set them one by one, and the browser will only set those it can recognize 42292 for (var i = 0, len = val.length; i < len; i++) { 42293 el.style[normalizedName] = val[i]; 42294 } 42295 } else { 42296 el.style[normalizedName] = val; 42297 } 42298 } 42299}; 42300 42301var vendorNames = ['Webkit', 'Moz', 'ms']; 42302 42303var emptyStyle; 42304var normalize = cached(function (prop) { 42305 emptyStyle = emptyStyle || document.createElement('div').style; 42306 prop = camelize(prop); 42307 if (prop !== 'filter' && (prop in emptyStyle)) { 42308 return prop 42309 } 42310 var capName = prop.charAt(0).toUpperCase() + prop.slice(1); 42311 for (var i = 0; i < vendorNames.length; i++) { 42312 var name = vendorNames[i] + capName; 42313 if (name in emptyStyle) { 42314 return name 42315 } 42316 } 42317}); 42318 42319function updateStyle (oldVnode, vnode) { 42320 var data = vnode.data; 42321 var oldData = oldVnode.data; 42322 42323 if (isUndef(data.staticStyle) && isUndef(data.style) && 42324 isUndef(oldData.staticStyle) && isUndef(oldData.style) 42325 ) { 42326 return 42327 } 42328 42329 var cur, name; 42330 var el = vnode.elm; 42331 var oldStaticStyle = oldData.staticStyle; 42332 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; 42333 42334 // if static style exists, stylebinding already merged into it when doing normalizeStyleData 42335 var oldStyle = oldStaticStyle || oldStyleBinding; 42336 42337 var style = normalizeStyleBinding(vnode.data.style) || {}; 42338 42339 // store normalized style under a different key for next diff 42340 // make sure to clone it if it's reactive, since the user likely wants 42341 // to mutate it. 42342 vnode.data.normalizedStyle = isDef(style.__ob__) 42343 ? extend({}, style) 42344 : style; 42345 42346 var newStyle = getStyle(vnode, true); 42347 42348 for (name in oldStyle) { 42349 if (isUndef(newStyle[name])) { 42350 setProp(el, name, ''); 42351 } 42352 } 42353 for (name in newStyle) { 42354 cur = newStyle[name]; 42355 if (cur !== oldStyle[name]) { 42356 // ie9 setting to null has no effect, must use empty string 42357 setProp(el, name, cur == null ? '' : cur); 42358 } 42359 } 42360} 42361 42362var style = { 42363 create: updateStyle, 42364 update: updateStyle 42365}; 42366 42367/* */ 42368 42369var whitespaceRE = /\s+/; 42370 42371/** 42372 * Add class with compatibility for SVG since classList is not supported on 42373 * SVG elements in IE 42374 */ 42375function addClass (el, cls) { 42376 /* istanbul ignore if */ 42377 if (!cls || !(cls = cls.trim())) { 42378 return 42379 } 42380 42381 /* istanbul ignore else */ 42382 if (el.classList) { 42383 if (cls.indexOf(' ') > -1) { 42384 cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); }); 42385 } else { 42386 el.classList.add(cls); 42387 } 42388 } else { 42389 var cur = " " + (el.getAttribute('class') || '') + " "; 42390 if (cur.indexOf(' ' + cls + ' ') < 0) { 42391 el.setAttribute('class', (cur + cls).trim()); 42392 } 42393 } 42394} 42395 42396/** 42397 * Remove class with compatibility for SVG since classList is not supported on 42398 * SVG elements in IE 42399 */ 42400function removeClass (el, cls) { 42401 /* istanbul ignore if */ 42402 if (!cls || !(cls = cls.trim())) { 42403 return 42404 } 42405 42406 /* istanbul ignore else */ 42407 if (el.classList) { 42408 if (cls.indexOf(' ') > -1) { 42409 cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); }); 42410 } else { 42411 el.classList.remove(cls); 42412 } 42413 if (!el.classList.length) { 42414 el.removeAttribute('class'); 42415 } 42416 } else { 42417 var cur = " " + (el.getAttribute('class') || '') + " "; 42418 var tar = ' ' + cls + ' '; 42419 while (cur.indexOf(tar) >= 0) { 42420 cur = cur.replace(tar, ' '); 42421 } 42422 cur = cur.trim(); 42423 if (cur) { 42424 el.setAttribute('class', cur); 42425 } else { 42426 el.removeAttribute('class'); 42427 } 42428 } 42429} 42430 42431/* */ 42432 42433function resolveTransition (def$$1) { 42434 if (!def$$1) { 42435 return 42436 } 42437 /* istanbul ignore else */ 42438 if (typeof def$$1 === 'object') { 42439 var res = {}; 42440 if (def$$1.css !== false) { 42441 extend(res, autoCssTransition(def$$1.name || 'v')); 42442 } 42443 extend(res, def$$1); 42444 return res 42445 } else if (typeof def$$1 === 'string') { 42446 return autoCssTransition(def$$1) 42447 } 42448} 42449 42450var autoCssTransition = cached(function (name) { 42451 return { 42452 enterClass: (name + "-enter"), 42453 enterToClass: (name + "-enter-to"), 42454 enterActiveClass: (name + "-enter-active"), 42455 leaveClass: (name + "-leave"), 42456 leaveToClass: (name + "-leave-to"), 42457 leaveActiveClass: (name + "-leave-active") 42458 } 42459}); 42460 42461var hasTransition = inBrowser && !isIE9; 42462var TRANSITION = 'transition'; 42463var ANIMATION = 'animation'; 42464 42465// Transition property/event sniffing 42466var transitionProp = 'transition'; 42467var transitionEndEvent = 'transitionend'; 42468var animationProp = 'animation'; 42469var animationEndEvent = 'animationend'; 42470if (hasTransition) { 42471 /* istanbul ignore if */ 42472 if (window.ontransitionend === undefined && 42473 window.onwebkittransitionend !== undefined 42474 ) { 42475 transitionProp = 'WebkitTransition'; 42476 transitionEndEvent = 'webkitTransitionEnd'; 42477 } 42478 if (window.onanimationend === undefined && 42479 window.onwebkitanimationend !== undefined 42480 ) { 42481 animationProp = 'WebkitAnimation'; 42482 animationEndEvent = 'webkitAnimationEnd'; 42483 } 42484} 42485 42486// binding to window is necessary to make hot reload work in IE in strict mode 42487var raf = inBrowser 42488 ? window.requestAnimationFrame 42489 ? window.requestAnimationFrame.bind(window) 42490 : setTimeout 42491 : /* istanbul ignore next */ function (fn) { return fn(); }; 42492 42493function nextFrame (fn) { 42494 raf(function () { 42495 raf(fn); 42496 }); 42497} 42498 42499function addTransitionClass (el, cls) { 42500 var transitionClasses = el._transitionClasses || (el._transitionClasses = []); 42501 if (transitionClasses.indexOf(cls) < 0) { 42502 transitionClasses.push(cls); 42503 addClass(el, cls); 42504 } 42505} 42506 42507function removeTransitionClass (el, cls) { 42508 if (el._transitionClasses) { 42509 remove(el._transitionClasses, cls); 42510 } 42511 removeClass(el, cls); 42512} 42513 42514function whenTransitionEnds ( 42515 el, 42516 expectedType, 42517 cb 42518) { 42519 var ref = getTransitionInfo(el, expectedType); 42520 var type = ref.type; 42521 var timeout = ref.timeout; 42522 var propCount = ref.propCount; 42523 if (!type) { return cb() } 42524 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; 42525 var ended = 0; 42526 var end = function () { 42527 el.removeEventListener(event, onEnd); 42528 cb(); 42529 }; 42530 var onEnd = function (e) { 42531 if (e.target === el) { 42532 if (++ended >= propCount) { 42533 end(); 42534 } 42535 } 42536 }; 42537 setTimeout(function () { 42538 if (ended < propCount) { 42539 end(); 42540 } 42541 }, timeout + 1); 42542 el.addEventListener(event, onEnd); 42543} 42544 42545var transformRE = /\b(transform|all)(,|$)/; 42546 42547function getTransitionInfo (el, expectedType) { 42548 var styles = window.getComputedStyle(el); 42549 // JSDOM may return undefined for transition properties 42550 var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', '); 42551 var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', '); 42552 var transitionTimeout = getTimeout(transitionDelays, transitionDurations); 42553 var animationDelays = (styles[animationProp + 'Delay'] || '').split(', '); 42554 var animationDurations = (styles[animationProp + 'Duration'] || '').split(', '); 42555 var animationTimeout = getTimeout(animationDelays, animationDurations); 42556 42557 var type; 42558 var timeout = 0; 42559 var propCount = 0; 42560 /* istanbul ignore if */ 42561 if (expectedType === TRANSITION) { 42562 if (transitionTimeout > 0) { 42563 type = TRANSITION; 42564 timeout = transitionTimeout; 42565 propCount = transitionDurations.length; 42566 } 42567 } else if (expectedType === ANIMATION) { 42568 if (animationTimeout > 0) { 42569 type = ANIMATION; 42570 timeout = animationTimeout; 42571 propCount = animationDurations.length; 42572 } 42573 } else { 42574 timeout = Math.max(transitionTimeout, animationTimeout); 42575 type = timeout > 0 42576 ? transitionTimeout > animationTimeout 42577 ? TRANSITION 42578 : ANIMATION 42579 : null; 42580 propCount = type 42581 ? type === TRANSITION 42582 ? transitionDurations.length 42583 : animationDurations.length 42584 : 0; 42585 } 42586 var hasTransform = 42587 type === TRANSITION && 42588 transformRE.test(styles[transitionProp + 'Property']); 42589 return { 42590 type: type, 42591 timeout: timeout, 42592 propCount: propCount, 42593 hasTransform: hasTransform 42594 } 42595} 42596 42597function getTimeout (delays, durations) { 42598 /* istanbul ignore next */ 42599 while (delays.length < durations.length) { 42600 delays = delays.concat(delays); 42601 } 42602 42603 return Math.max.apply(null, durations.map(function (d, i) { 42604 return toMs(d) + toMs(delays[i]) 42605 })) 42606} 42607 42608// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers 42609// in a locale-dependent way, using a comma instead of a dot. 42610// If comma is not replaced with a dot, the input will be rounded down (i.e. acting 42611// as a floor function) causing unexpected behaviors 42612function toMs (s) { 42613 return Number(s.slice(0, -1).replace(',', '.')) * 1000 42614} 42615 42616/* */ 42617 42618function enter (vnode, toggleDisplay) { 42619 var el = vnode.elm; 42620 42621 // call leave callback now 42622 if (isDef(el._leaveCb)) { 42623 el._leaveCb.cancelled = true; 42624 el._leaveCb(); 42625 } 42626 42627 var data = resolveTransition(vnode.data.transition); 42628 if (isUndef(data)) { 42629 return 42630 } 42631 42632 /* istanbul ignore if */ 42633 if (isDef(el._enterCb) || el.nodeType !== 1) { 42634 return 42635 } 42636 42637 var css = data.css; 42638 var type = data.type; 42639 var enterClass = data.enterClass; 42640 var enterToClass = data.enterToClass; 42641 var enterActiveClass = data.enterActiveClass; 42642 var appearClass = data.appearClass; 42643 var appearToClass = data.appearToClass; 42644 var appearActiveClass = data.appearActiveClass; 42645 var beforeEnter = data.beforeEnter; 42646 var enter = data.enter; 42647 var afterEnter = data.afterEnter; 42648 var enterCancelled = data.enterCancelled; 42649 var beforeAppear = data.beforeAppear; 42650 var appear = data.appear; 42651 var afterAppear = data.afterAppear; 42652 var appearCancelled = data.appearCancelled; 42653 var duration = data.duration; 42654 42655 // activeInstance will always be the <transition> component managing this 42656 // transition. One edge case to check is when the <transition> is placed 42657 // as the root node of a child component. In that case we need to check 42658 // <transition>'s parent for appear check. 42659 var context = activeInstance; 42660 var transitionNode = activeInstance.$vnode; 42661 while (transitionNode && transitionNode.parent) { 42662 context = transitionNode.context; 42663 transitionNode = transitionNode.parent; 42664 } 42665 42666 var isAppear = !context._isMounted || !vnode.isRootInsert; 42667 42668 if (isAppear && !appear && appear !== '') { 42669 return 42670 } 42671 42672 var startClass = isAppear && appearClass 42673 ? appearClass 42674 : enterClass; 42675 var activeClass = isAppear && appearActiveClass 42676 ? appearActiveClass 42677 : enterActiveClass; 42678 var toClass = isAppear && appearToClass 42679 ? appearToClass 42680 : enterToClass; 42681 42682 var beforeEnterHook = isAppear 42683 ? (beforeAppear || beforeEnter) 42684 : beforeEnter; 42685 var enterHook = isAppear 42686 ? (typeof appear === 'function' ? appear : enter) 42687 : enter; 42688 var afterEnterHook = isAppear 42689 ? (afterAppear || afterEnter) 42690 : afterEnter; 42691 var enterCancelledHook = isAppear 42692 ? (appearCancelled || enterCancelled) 42693 : enterCancelled; 42694 42695 var explicitEnterDuration = toNumber( 42696 isObject(duration) 42697 ? duration.enter 42698 : duration 42699 ); 42700 42701 if ( true && explicitEnterDuration != null) { 42702 checkDuration(explicitEnterDuration, 'enter', vnode); 42703 } 42704 42705 var expectsCSS = css !== false && !isIE9; 42706 var userWantsControl = getHookArgumentsLength(enterHook); 42707 42708 var cb = el._enterCb = once(function () { 42709 if (expectsCSS) { 42710 removeTransitionClass(el, toClass); 42711 removeTransitionClass(el, activeClass); 42712 } 42713 if (cb.cancelled) { 42714 if (expectsCSS) { 42715 removeTransitionClass(el, startClass); 42716 } 42717 enterCancelledHook && enterCancelledHook(el); 42718 } else { 42719 afterEnterHook && afterEnterHook(el); 42720 } 42721 el._enterCb = null; 42722 }); 42723 42724 if (!vnode.data.show) { 42725 // remove pending leave element on enter by injecting an insert hook 42726 mergeVNodeHook(vnode, 'insert', function () { 42727 var parent = el.parentNode; 42728 var pendingNode = parent && parent._pending && parent._pending[vnode.key]; 42729 if (pendingNode && 42730 pendingNode.tag === vnode.tag && 42731 pendingNode.elm._leaveCb 42732 ) { 42733 pendingNode.elm._leaveCb(); 42734 } 42735 enterHook && enterHook(el, cb); 42736 }); 42737 } 42738 42739 // start enter transition 42740 beforeEnterHook && beforeEnterHook(el); 42741 if (expectsCSS) { 42742 addTransitionClass(el, startClass); 42743 addTransitionClass(el, activeClass); 42744 nextFrame(function () { 42745 removeTransitionClass(el, startClass); 42746 if (!cb.cancelled) { 42747 addTransitionClass(el, toClass); 42748 if (!userWantsControl) { 42749 if (isValidDuration(explicitEnterDuration)) { 42750 setTimeout(cb, explicitEnterDuration); 42751 } else { 42752 whenTransitionEnds(el, type, cb); 42753 } 42754 } 42755 } 42756 }); 42757 } 42758 42759 if (vnode.data.show) { 42760 toggleDisplay && toggleDisplay(); 42761 enterHook && enterHook(el, cb); 42762 } 42763 42764 if (!expectsCSS && !userWantsControl) { 42765 cb(); 42766 } 42767} 42768 42769function leave (vnode, rm) { 42770 var el = vnode.elm; 42771 42772 // call enter callback now 42773 if (isDef(el._enterCb)) { 42774 el._enterCb.cancelled = true; 42775 el._enterCb(); 42776 } 42777 42778 var data = resolveTransition(vnode.data.transition); 42779 if (isUndef(data) || el.nodeType !== 1) { 42780 return rm() 42781 } 42782 42783 /* istanbul ignore if */ 42784 if (isDef(el._leaveCb)) { 42785 return 42786 } 42787 42788 var css = data.css; 42789 var type = data.type; 42790 var leaveClass = data.leaveClass; 42791 var leaveToClass = data.leaveToClass; 42792 var leaveActiveClass = data.leaveActiveClass; 42793 var beforeLeave = data.beforeLeave; 42794 var leave = data.leave; 42795 var afterLeave = data.afterLeave; 42796 var leaveCancelled = data.leaveCancelled; 42797 var delayLeave = data.delayLeave; 42798 var duration = data.duration; 42799 42800 var expectsCSS = css !== false && !isIE9; 42801 var userWantsControl = getHookArgumentsLength(leave); 42802 42803 var explicitLeaveDuration = toNumber( 42804 isObject(duration) 42805 ? duration.leave 42806 : duration 42807 ); 42808 42809 if ( true && isDef(explicitLeaveDuration)) { 42810 checkDuration(explicitLeaveDuration, 'leave', vnode); 42811 } 42812 42813 var cb = el._leaveCb = once(function () { 42814 if (el.parentNode && el.parentNode._pending) { 42815 el.parentNode._pending[vnode.key] = null; 42816 } 42817 if (expectsCSS) { 42818 removeTransitionClass(el, leaveToClass); 42819 removeTransitionClass(el, leaveActiveClass); 42820 } 42821 if (cb.cancelled) { 42822 if (expectsCSS) { 42823 removeTransitionClass(el, leaveClass); 42824 } 42825 leaveCancelled && leaveCancelled(el); 42826 } else { 42827 rm(); 42828 afterLeave && afterLeave(el); 42829 } 42830 el._leaveCb = null; 42831 }); 42832 42833 if (delayLeave) { 42834 delayLeave(performLeave); 42835 } else { 42836 performLeave(); 42837 } 42838 42839 function performLeave () { 42840 // the delayed leave may have already been cancelled 42841 if (cb.cancelled) { 42842 return 42843 } 42844 // record leaving element 42845 if (!vnode.data.show && el.parentNode) { 42846 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; 42847 } 42848 beforeLeave && beforeLeave(el); 42849 if (expectsCSS) { 42850 addTransitionClass(el, leaveClass); 42851 addTransitionClass(el, leaveActiveClass); 42852 nextFrame(function () { 42853 removeTransitionClass(el, leaveClass); 42854 if (!cb.cancelled) { 42855 addTransitionClass(el, leaveToClass); 42856 if (!userWantsControl) { 42857 if (isValidDuration(explicitLeaveDuration)) { 42858 setTimeout(cb, explicitLeaveDuration); 42859 } else { 42860 whenTransitionEnds(el, type, cb); 42861 } 42862 } 42863 } 42864 }); 42865 } 42866 leave && leave(el, cb); 42867 if (!expectsCSS && !userWantsControl) { 42868 cb(); 42869 } 42870 } 42871} 42872 42873// only used in dev mode 42874function checkDuration (val, name, vnode) { 42875 if (typeof val !== 'number') { 42876 warn( 42877 "<transition> explicit " + name + " duration is not a valid number - " + 42878 "got " + (JSON.stringify(val)) + ".", 42879 vnode.context 42880 ); 42881 } else if (isNaN(val)) { 42882 warn( 42883 "<transition> explicit " + name + " duration is NaN - " + 42884 'the duration expression might be incorrect.', 42885 vnode.context 42886 ); 42887 } 42888} 42889 42890function isValidDuration (val) { 42891 return typeof val === 'number' && !isNaN(val) 42892} 42893 42894/** 42895 * Normalize a transition hook's argument length. The hook may be: 42896 * - a merged hook (invoker) with the original in .fns 42897 * - a wrapped component method (check ._length) 42898 * - a plain function (.length) 42899 */ 42900function getHookArgumentsLength (fn) { 42901 if (isUndef(fn)) { 42902 return false 42903 } 42904 var invokerFns = fn.fns; 42905 if (isDef(invokerFns)) { 42906 // invoker 42907 return getHookArgumentsLength( 42908 Array.isArray(invokerFns) 42909 ? invokerFns[0] 42910 : invokerFns 42911 ) 42912 } else { 42913 return (fn._length || fn.length) > 1 42914 } 42915} 42916 42917function _enter (_, vnode) { 42918 if (vnode.data.show !== true) { 42919 enter(vnode); 42920 } 42921} 42922 42923var transition = inBrowser ? { 42924 create: _enter, 42925 activate: _enter, 42926 remove: function remove$$1 (vnode, rm) { 42927 /* istanbul ignore else */ 42928 if (vnode.data.show !== true) { 42929 leave(vnode, rm); 42930 } else { 42931 rm(); 42932 } 42933 } 42934} : {}; 42935 42936var platformModules = [ 42937 attrs, 42938 klass, 42939 events, 42940 domProps, 42941 style, 42942 transition 42943]; 42944 42945/* */ 42946 42947// the directive module should be applied last, after all 42948// built-in modules have been applied. 42949var modules = platformModules.concat(baseModules); 42950 42951var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules }); 42952 42953/** 42954 * Not type checking this file because flow doesn't like attaching 42955 * properties to Elements. 42956 */ 42957 42958/* istanbul ignore if */ 42959if (isIE9) { 42960 // http://www.matts411.com/post/internet-explorer-9-oninput/ 42961 document.addEventListener('selectionchange', function () { 42962 var el = document.activeElement; 42963 if (el && el.vmodel) { 42964 trigger(el, 'input'); 42965 } 42966 }); 42967} 42968 42969var directive = { 42970 inserted: function inserted (el, binding, vnode, oldVnode) { 42971 if (vnode.tag === 'select') { 42972 // #6903 42973 if (oldVnode.elm && !oldVnode.elm._vOptions) { 42974 mergeVNodeHook(vnode, 'postpatch', function () { 42975 directive.componentUpdated(el, binding, vnode); 42976 }); 42977 } else { 42978 setSelected(el, binding, vnode.context); 42979 } 42980 el._vOptions = [].map.call(el.options, getValue); 42981 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { 42982 el._vModifiers = binding.modifiers; 42983 if (!binding.modifiers.lazy) { 42984 el.addEventListener('compositionstart', onCompositionStart); 42985 el.addEventListener('compositionend', onCompositionEnd); 42986 // Safari < 10.2 & UIWebView doesn't fire compositionend when 42987 // switching focus before confirming composition choice 42988 // this also fixes the issue where some browsers e.g. iOS Chrome 42989 // fires "change" instead of "input" on autocomplete. 42990 el.addEventListener('change', onCompositionEnd); 42991 /* istanbul ignore if */ 42992 if (isIE9) { 42993 el.vmodel = true; 42994 } 42995 } 42996 } 42997 }, 42998 42999 componentUpdated: function componentUpdated (el, binding, vnode) { 43000 if (vnode.tag === 'select') { 43001 setSelected(el, binding, vnode.context); 43002 // in case the options rendered by v-for have changed, 43003 // it's possible that the value is out-of-sync with the rendered options. 43004 // detect such cases and filter out values that no longer has a matching 43005 // option in the DOM. 43006 var prevOptions = el._vOptions; 43007 var curOptions = el._vOptions = [].map.call(el.options, getValue); 43008 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { 43009 // trigger change event if 43010 // no matching option found for at least one value 43011 var needReset = el.multiple 43012 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) 43013 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); 43014 if (needReset) { 43015 trigger(el, 'change'); 43016 } 43017 } 43018 } 43019 } 43020}; 43021 43022function setSelected (el, binding, vm) { 43023 actuallySetSelected(el, binding, vm); 43024 /* istanbul ignore if */ 43025 if (isIE || isEdge) { 43026 setTimeout(function () { 43027 actuallySetSelected(el, binding, vm); 43028 }, 0); 43029 } 43030} 43031 43032function actuallySetSelected (el, binding, vm) { 43033 var value = binding.value; 43034 var isMultiple = el.multiple; 43035 if (isMultiple && !Array.isArray(value)) { 43036 true && warn( 43037 "<select multiple v-model=\"" + (binding.expression) + "\"> " + 43038 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), 43039 vm 43040 ); 43041 return 43042 } 43043 var selected, option; 43044 for (var i = 0, l = el.options.length; i < l; i++) { 43045 option = el.options[i]; 43046 if (isMultiple) { 43047 selected = looseIndexOf(value, getValue(option)) > -1; 43048 if (option.selected !== selected) { 43049 option.selected = selected; 43050 } 43051 } else { 43052 if (looseEqual(getValue(option), value)) { 43053 if (el.selectedIndex !== i) { 43054 el.selectedIndex = i; 43055 } 43056 return 43057 } 43058 } 43059 } 43060 if (!isMultiple) { 43061 el.selectedIndex = -1; 43062 } 43063} 43064 43065function hasNoMatchingOption (value, options) { 43066 return options.every(function (o) { return !looseEqual(o, value); }) 43067} 43068 43069function getValue (option) { 43070 return '_value' in option 43071 ? option._value 43072 : option.value 43073} 43074 43075function onCompositionStart (e) { 43076 e.target.composing = true; 43077} 43078 43079function onCompositionEnd (e) { 43080 // prevent triggering an input event for no reason 43081 if (!e.target.composing) { return } 43082 e.target.composing = false; 43083 trigger(e.target, 'input'); 43084} 43085 43086function trigger (el, type) { 43087 var e = document.createEvent('HTMLEvents'); 43088 e.initEvent(type, true, true); 43089 el.dispatchEvent(e); 43090} 43091 43092/* */ 43093 43094// recursively search for possible transition defined inside the component root 43095function locateNode (vnode) { 43096 return vnode.componentInstance && (!vnode.data || !vnode.data.transition) 43097 ? locateNode(vnode.componentInstance._vnode) 43098 : vnode 43099} 43100 43101var show = { 43102 bind: function bind (el, ref, vnode) { 43103 var value = ref.value; 43104 43105 vnode = locateNode(vnode); 43106 var transition$$1 = vnode.data && vnode.data.transition; 43107 var originalDisplay = el.__vOriginalDisplay = 43108 el.style.display === 'none' ? '' : el.style.display; 43109 if (value && transition$$1) { 43110 vnode.data.show = true; 43111 enter(vnode, function () { 43112 el.style.display = originalDisplay; 43113 }); 43114 } else { 43115 el.style.display = value ? originalDisplay : 'none'; 43116 } 43117 }, 43118 43119 update: function update (el, ref, vnode) { 43120 var value = ref.value; 43121 var oldValue = ref.oldValue; 43122 43123 /* istanbul ignore if */ 43124 if (!value === !oldValue) { return } 43125 vnode = locateNode(vnode); 43126 var transition$$1 = vnode.data && vnode.data.transition; 43127 if (transition$$1) { 43128 vnode.data.show = true; 43129 if (value) { 43130 enter(vnode, function () { 43131 el.style.display = el.__vOriginalDisplay; 43132 }); 43133 } else { 43134 leave(vnode, function () { 43135 el.style.display = 'none'; 43136 }); 43137 } 43138 } else { 43139 el.style.display = value ? el.__vOriginalDisplay : 'none'; 43140 } 43141 }, 43142 43143 unbind: function unbind ( 43144 el, 43145 binding, 43146 vnode, 43147 oldVnode, 43148 isDestroy 43149 ) { 43150 if (!isDestroy) { 43151 el.style.display = el.__vOriginalDisplay; 43152 } 43153 } 43154}; 43155 43156var platformDirectives = { 43157 model: directive, 43158 show: show 43159}; 43160 43161/* */ 43162 43163var transitionProps = { 43164 name: String, 43165 appear: Boolean, 43166 css: Boolean, 43167 mode: String, 43168 type: String, 43169 enterClass: String, 43170 leaveClass: String, 43171 enterToClass: String, 43172 leaveToClass: String, 43173 enterActiveClass: String, 43174 leaveActiveClass: String, 43175 appearClass: String, 43176 appearActiveClass: String, 43177 appearToClass: String, 43178 duration: [Number, String, Object] 43179}; 43180 43181// in case the child is also an abstract component, e.g. <keep-alive> 43182// we want to recursively retrieve the real component to be rendered 43183function getRealChild (vnode) { 43184 var compOptions = vnode && vnode.componentOptions; 43185 if (compOptions && compOptions.Ctor.options.abstract) { 43186 return getRealChild(getFirstComponentChild(compOptions.children)) 43187 } else { 43188 return vnode 43189 } 43190} 43191 43192function extractTransitionData (comp) { 43193 var data = {}; 43194 var options = comp.$options; 43195 // props 43196 for (var key in options.propsData) { 43197 data[key] = comp[key]; 43198 } 43199 // events. 43200 // extract listeners and pass them directly to the transition methods 43201 var listeners = options._parentListeners; 43202 for (var key$1 in listeners) { 43203 data[camelize(key$1)] = listeners[key$1]; 43204 } 43205 return data 43206} 43207 43208function placeholder (h, rawChild) { 43209 if (/\d-keep-alive$/.test(rawChild.tag)) { 43210 return h('keep-alive', { 43211 props: rawChild.componentOptions.propsData 43212 }) 43213 } 43214} 43215 43216function hasParentTransition (vnode) { 43217 while ((vnode = vnode.parent)) { 43218 if (vnode.data.transition) { 43219 return true 43220 } 43221 } 43222} 43223 43224function isSameChild (child, oldChild) { 43225 return oldChild.key === child.key && oldChild.tag === child.tag 43226} 43227 43228var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); }; 43229 43230var isVShowDirective = function (d) { return d.name === 'show'; }; 43231 43232var Transition = { 43233 name: 'transition', 43234 props: transitionProps, 43235 abstract: true, 43236 43237 render: function render (h) { 43238 var this$1 = this; 43239 43240 var children = this.$slots.default; 43241 if (!children) { 43242 return 43243 } 43244 43245 // filter out text nodes (possible whitespaces) 43246 children = children.filter(isNotTextNode); 43247 /* istanbul ignore if */ 43248 if (!children.length) { 43249 return 43250 } 43251 43252 // warn multiple elements 43253 if ( true && children.length > 1) { 43254 warn( 43255 '<transition> can only be used on a single element. Use ' + 43256 '<transition-group> for lists.', 43257 this.$parent 43258 ); 43259 } 43260 43261 var mode = this.mode; 43262 43263 // warn invalid mode 43264 if ( true && 43265 mode && mode !== 'in-out' && mode !== 'out-in' 43266 ) { 43267 warn( 43268 'invalid <transition> mode: ' + mode, 43269 this.$parent 43270 ); 43271 } 43272 43273 var rawChild = children[0]; 43274 43275 // if this is a component root node and the component's 43276 // parent container node also has transition, skip. 43277 if (hasParentTransition(this.$vnode)) { 43278 return rawChild 43279 } 43280 43281 // apply transition data to child 43282 // use getRealChild() to ignore abstract components e.g. keep-alive 43283 var child = getRealChild(rawChild); 43284 /* istanbul ignore if */ 43285 if (!child) { 43286 return rawChild 43287 } 43288 43289 if (this._leaving) { 43290 return placeholder(h, rawChild) 43291 } 43292 43293 // ensure a key that is unique to the vnode type and to this transition 43294 // component instance. This key will be used to remove pending leaving nodes 43295 // during entering. 43296 var id = "__transition-" + (this._uid) + "-"; 43297 child.key = child.key == null 43298 ? child.isComment 43299 ? id + 'comment' 43300 : id + child.tag 43301 : isPrimitive(child.key) 43302 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) 43303 : child.key; 43304 43305 var data = (child.data || (child.data = {})).transition = extractTransitionData(this); 43306 var oldRawChild = this._vnode; 43307 var oldChild = getRealChild(oldRawChild); 43308 43309 // mark v-show 43310 // so that the transition module can hand over the control to the directive 43311 if (child.data.directives && child.data.directives.some(isVShowDirective)) { 43312 child.data.show = true; 43313 } 43314 43315 if ( 43316 oldChild && 43317 oldChild.data && 43318 !isSameChild(child, oldChild) && 43319 !isAsyncPlaceholder(oldChild) && 43320 // #6687 component root is a comment node 43321 !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) 43322 ) { 43323 // replace old child transition data with fresh one 43324 // important for dynamic transitions! 43325 var oldData = oldChild.data.transition = extend({}, data); 43326 // handle transition mode 43327 if (mode === 'out-in') { 43328 // return placeholder node and queue update when leave finishes 43329 this._leaving = true; 43330 mergeVNodeHook(oldData, 'afterLeave', function () { 43331 this$1._leaving = false; 43332 this$1.$forceUpdate(); 43333 }); 43334 return placeholder(h, rawChild) 43335 } else if (mode === 'in-out') { 43336 if (isAsyncPlaceholder(child)) { 43337 return oldRawChild 43338 } 43339 var delayedLeave; 43340 var performLeave = function () { delayedLeave(); }; 43341 mergeVNodeHook(data, 'afterEnter', performLeave); 43342 mergeVNodeHook(data, 'enterCancelled', performLeave); 43343 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); 43344 } 43345 } 43346 43347 return rawChild 43348 } 43349}; 43350 43351/* */ 43352 43353var props = extend({ 43354 tag: String, 43355 moveClass: String 43356}, transitionProps); 43357 43358delete props.mode; 43359 43360var TransitionGroup = { 43361 props: props, 43362 43363 beforeMount: function beforeMount () { 43364 var this$1 = this; 43365 43366 var update = this._update; 43367 this._update = function (vnode, hydrating) { 43368 var restoreActiveInstance = setActiveInstance(this$1); 43369 // force removing pass 43370 this$1.__patch__( 43371 this$1._vnode, 43372 this$1.kept, 43373 false, // hydrating 43374 true // removeOnly (!important, avoids unnecessary moves) 43375 ); 43376 this$1._vnode = this$1.kept; 43377 restoreActiveInstance(); 43378 update.call(this$1, vnode, hydrating); 43379 }; 43380 }, 43381 43382 render: function render (h) { 43383 var tag = this.tag || this.$vnode.data.tag || 'span'; 43384 var map = Object.create(null); 43385 var prevChildren = this.prevChildren = this.children; 43386 var rawChildren = this.$slots.default || []; 43387 var children = this.children = []; 43388 var transitionData = extractTransitionData(this); 43389 43390 for (var i = 0; i < rawChildren.length; i++) { 43391 var c = rawChildren[i]; 43392 if (c.tag) { 43393 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { 43394 children.push(c); 43395 map[c.key] = c 43396 ;(c.data || (c.data = {})).transition = transitionData; 43397 } else if (true) { 43398 var opts = c.componentOptions; 43399 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; 43400 warn(("<transition-group> children must be keyed: <" + name + ">")); 43401 } 43402 } 43403 } 43404 43405 if (prevChildren) { 43406 var kept = []; 43407 var removed = []; 43408 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { 43409 var c$1 = prevChildren[i$1]; 43410 c$1.data.transition = transitionData; 43411 c$1.data.pos = c$1.elm.getBoundingClientRect(); 43412 if (map[c$1.key]) { 43413 kept.push(c$1); 43414 } else { 43415 removed.push(c$1); 43416 } 43417 } 43418 this.kept = h(tag, null, kept); 43419 this.removed = removed; 43420 } 43421 43422 return h(tag, null, children) 43423 }, 43424 43425 updated: function updated () { 43426 var children = this.prevChildren; 43427 var moveClass = this.moveClass || ((this.name || 'v') + '-move'); 43428 if (!children.length || !this.hasMove(children[0].elm, moveClass)) { 43429 return 43430 } 43431 43432 // we divide the work into three loops to avoid mixing DOM reads and writes 43433 // in each iteration - which helps prevent layout thrashing. 43434 children.forEach(callPendingCbs); 43435 children.forEach(recordPosition); 43436 children.forEach(applyTranslation); 43437 43438 // force reflow to put everything in position 43439 // assign to this to avoid being removed in tree-shaking 43440 // $flow-disable-line 43441 this._reflow = document.body.offsetHeight; 43442 43443 children.forEach(function (c) { 43444 if (c.data.moved) { 43445 var el = c.elm; 43446 var s = el.style; 43447 addTransitionClass(el, moveClass); 43448 s.transform = s.WebkitTransform = s.transitionDuration = ''; 43449 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { 43450 if (e && e.target !== el) { 43451 return 43452 } 43453 if (!e || /transform$/.test(e.propertyName)) { 43454 el.removeEventListener(transitionEndEvent, cb); 43455 el._moveCb = null; 43456 removeTransitionClass(el, moveClass); 43457 } 43458 }); 43459 } 43460 }); 43461 }, 43462 43463 methods: { 43464 hasMove: function hasMove (el, moveClass) { 43465 /* istanbul ignore if */ 43466 if (!hasTransition) { 43467 return false 43468 } 43469 /* istanbul ignore if */ 43470 if (this._hasMove) { 43471 return this._hasMove 43472 } 43473 // Detect whether an element with the move class applied has 43474 // CSS transitions. Since the element may be inside an entering 43475 // transition at this very moment, we make a clone of it and remove 43476 // all other transition classes applied to ensure only the move class 43477 // is applied. 43478 var clone = el.cloneNode(); 43479 if (el._transitionClasses) { 43480 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); 43481 } 43482 addClass(clone, moveClass); 43483 clone.style.display = 'none'; 43484 this.$el.appendChild(clone); 43485 var info = getTransitionInfo(clone); 43486 this.$el.removeChild(clone); 43487 return (this._hasMove = info.hasTransform) 43488 } 43489 } 43490}; 43491 43492function callPendingCbs (c) { 43493 /* istanbul ignore if */ 43494 if (c.elm._moveCb) { 43495 c.elm._moveCb(); 43496 } 43497 /* istanbul ignore if */ 43498 if (c.elm._enterCb) { 43499 c.elm._enterCb(); 43500 } 43501} 43502 43503function recordPosition (c) { 43504 c.data.newPos = c.elm.getBoundingClientRect(); 43505} 43506 43507function applyTranslation (c) { 43508 var oldPos = c.data.pos; 43509 var newPos = c.data.newPos; 43510 var dx = oldPos.left - newPos.left; 43511 var dy = oldPos.top - newPos.top; 43512 if (dx || dy) { 43513 c.data.moved = true; 43514 var s = c.elm.style; 43515 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; 43516 s.transitionDuration = '0s'; 43517 } 43518} 43519 43520var platformComponents = { 43521 Transition: Transition, 43522 TransitionGroup: TransitionGroup 43523}; 43524 43525/* */ 43526 43527// install platform specific utils 43528Vue.config.mustUseProp = mustUseProp; 43529Vue.config.isReservedTag = isReservedTag; 43530Vue.config.isReservedAttr = isReservedAttr; 43531Vue.config.getTagNamespace = getTagNamespace; 43532Vue.config.isUnknownElement = isUnknownElement; 43533 43534// install platform runtime directives & components 43535extend(Vue.options.directives, platformDirectives); 43536extend(Vue.options.components, platformComponents); 43537 43538// install platform patch function 43539Vue.prototype.__patch__ = inBrowser ? patch : noop; 43540 43541// public mount method 43542Vue.prototype.$mount = function ( 43543 el, 43544 hydrating 43545) { 43546 el = el && inBrowser ? query(el) : undefined; 43547 return mountComponent(this, el, hydrating) 43548}; 43549 43550// devtools global hook 43551/* istanbul ignore next */ 43552if (inBrowser) { 43553 setTimeout(function () { 43554 if (config.devtools) { 43555 if (devtools) { 43556 devtools.emit('init', Vue); 43557 } else if ( 43558 true 43559 ) { 43560 console[console.info ? 'info' : 'log']( 43561 'Download the Vue Devtools extension for a better development experience:\n' + 43562 'https://github.com/vuejs/vue-devtools' 43563 ); 43564 } 43565 } 43566 if ( true && 43567 config.productionTip !== false && 43568 typeof console !== 'undefined' 43569 ) { 43570 console[console.info ? 'info' : 'log']( 43571 "You are running Vue in development mode.\n" + 43572 "Make sure to turn on production mode when deploying for production.\n" + 43573 "See more tips at https://vuejs.org/guide/deployment.html" 43574 ); 43575 } 43576 }, 0); 43577} 43578 43579/* */ 43580 43581var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g; 43582var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; 43583 43584var buildRegex = cached(function (delimiters) { 43585 var open = delimiters[0].replace(regexEscapeRE, '\\$&'); 43586 var close = delimiters[1].replace(regexEscapeRE, '\\$&'); 43587 return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') 43588}); 43589 43590 43591 43592function parseText ( 43593 text, 43594 delimiters 43595) { 43596 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; 43597 if (!tagRE.test(text)) { 43598 return 43599 } 43600 var tokens = []; 43601 var rawTokens = []; 43602 var lastIndex = tagRE.lastIndex = 0; 43603 var match, index, tokenValue; 43604 while ((match = tagRE.exec(text))) { 43605 index = match.index; 43606 // push text token 43607 if (index > lastIndex) { 43608 rawTokens.push(tokenValue = text.slice(lastIndex, index)); 43609 tokens.push(JSON.stringify(tokenValue)); 43610 } 43611 // tag token 43612 var exp = parseFilters(match[1].trim()); 43613 tokens.push(("_s(" + exp + ")")); 43614 rawTokens.push({ '@binding': exp }); 43615 lastIndex = index + match[0].length; 43616 } 43617 if (lastIndex < text.length) { 43618 rawTokens.push(tokenValue = text.slice(lastIndex)); 43619 tokens.push(JSON.stringify(tokenValue)); 43620 } 43621 return { 43622 expression: tokens.join('+'), 43623 tokens: rawTokens 43624 } 43625} 43626 43627/* */ 43628 43629function transformNode (el, options) { 43630 var warn = options.warn || baseWarn; 43631 var staticClass = getAndRemoveAttr(el, 'class'); 43632 if ( true && staticClass) { 43633 var res = parseText(staticClass, options.delimiters); 43634 if (res) { 43635 warn( 43636 "class=\"" + staticClass + "\": " + 43637 'Interpolation inside attributes has been removed. ' + 43638 'Use v-bind or the colon shorthand instead. For example, ' + 43639 'instead of <div class="{{ val }}">, use <div :class="val">.', 43640 el.rawAttrsMap['class'] 43641 ); 43642 } 43643 } 43644 if (staticClass) { 43645 el.staticClass = JSON.stringify(staticClass); 43646 } 43647 var classBinding = getBindingAttr(el, 'class', false /* getStatic */); 43648 if (classBinding) { 43649 el.classBinding = classBinding; 43650 } 43651} 43652 43653function genData (el) { 43654 var data = ''; 43655 if (el.staticClass) { 43656 data += "staticClass:" + (el.staticClass) + ","; 43657 } 43658 if (el.classBinding) { 43659 data += "class:" + (el.classBinding) + ","; 43660 } 43661 return data 43662} 43663 43664var klass$1 = { 43665 staticKeys: ['staticClass'], 43666 transformNode: transformNode, 43667 genData: genData 43668}; 43669 43670/* */ 43671 43672function transformNode$1 (el, options) { 43673 var warn = options.warn || baseWarn; 43674 var staticStyle = getAndRemoveAttr(el, 'style'); 43675 if (staticStyle) { 43676 /* istanbul ignore if */ 43677 if (true) { 43678 var res = parseText(staticStyle, options.delimiters); 43679 if (res) { 43680 warn( 43681 "style=\"" + staticStyle + "\": " + 43682 'Interpolation inside attributes has been removed. ' + 43683 'Use v-bind or the colon shorthand instead. For example, ' + 43684 'instead of <div style="{{ val }}">, use <div :style="val">.', 43685 el.rawAttrsMap['style'] 43686 ); 43687 } 43688 } 43689 el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); 43690 } 43691 43692 var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); 43693 if (styleBinding) { 43694 el.styleBinding = styleBinding; 43695 } 43696} 43697 43698function genData$1 (el) { 43699 var data = ''; 43700 if (el.staticStyle) { 43701 data += "staticStyle:" + (el.staticStyle) + ","; 43702 } 43703 if (el.styleBinding) { 43704 data += "style:(" + (el.styleBinding) + "),"; 43705 } 43706 return data 43707} 43708 43709var style$1 = { 43710 staticKeys: ['staticStyle'], 43711 transformNode: transformNode$1, 43712 genData: genData$1 43713}; 43714 43715/* */ 43716 43717var decoder; 43718 43719var he = { 43720 decode: function decode (html) { 43721 decoder = decoder || document.createElement('div'); 43722 decoder.innerHTML = html; 43723 return decoder.textContent 43724 } 43725}; 43726 43727/* */ 43728 43729var isUnaryTag = makeMap( 43730 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 43731 'link,meta,param,source,track,wbr' 43732); 43733 43734// Elements that you can, intentionally, leave open 43735// (and which close themselves) 43736var canBeLeftOpenTag = makeMap( 43737 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' 43738); 43739 43740// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 43741// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content 43742var isNonPhrasingTag = makeMap( 43743 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + 43744 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + 43745 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + 43746 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + 43747 'title,tr,track' 43748); 43749 43750/** 43751 * Not type-checking this file because it's mostly vendor code. 43752 */ 43753 43754// Regular Expressions for parsing tags and attributes 43755var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 43756var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 43757var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*"; 43758var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; 43759var startTagOpen = new RegExp(("^<" + qnameCapture)); 43760var startTagClose = /^\s*(\/?)>/; 43761var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); 43762var doctype = /^<!DOCTYPE [^>]+>/i; 43763// #7298: escape - to avoid being passed as HTML comment when inlined in page 43764var comment = /^<!\--/; 43765var conditionalComment = /^<!\[/; 43766 43767// Special Elements (can contain anything) 43768var isPlainTextElement = makeMap('script,style,textarea', true); 43769var reCache = {}; 43770 43771var decodingMap = { 43772 '<': '<', 43773 '>': '>', 43774 '"': '"', 43775 '&': '&', 43776 ' ': '\n', 43777 '	': '\t', 43778 ''': "'" 43779}; 43780var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g; 43781var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g; 43782 43783// #5992 43784var isIgnoreNewlineTag = makeMap('pre,textarea', true); 43785var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; 43786 43787function decodeAttr (value, shouldDecodeNewlines) { 43788 var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; 43789 return value.replace(re, function (match) { return decodingMap[match]; }) 43790} 43791 43792function parseHTML (html, options) { 43793 var stack = []; 43794 var expectHTML = options.expectHTML; 43795 var isUnaryTag$$1 = options.isUnaryTag || no; 43796 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no; 43797 var index = 0; 43798 var last, lastTag; 43799 while (html) { 43800 last = html; 43801 // Make sure we're not in a plaintext content element like script/style 43802 if (!lastTag || !isPlainTextElement(lastTag)) { 43803 var textEnd = html.indexOf('<'); 43804 if (textEnd === 0) { 43805 // Comment: 43806 if (comment.test(html)) { 43807 var commentEnd = html.indexOf('-->'); 43808 43809 if (commentEnd >= 0) { 43810 if (options.shouldKeepComment) { 43811 options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3); 43812 } 43813 advance(commentEnd + 3); 43814 continue 43815 } 43816 } 43817 43818 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment 43819 if (conditionalComment.test(html)) { 43820 var conditionalEnd = html.indexOf(']>'); 43821 43822 if (conditionalEnd >= 0) { 43823 advance(conditionalEnd + 2); 43824 continue 43825 } 43826 } 43827 43828 // Doctype: 43829 var doctypeMatch = html.match(doctype); 43830 if (doctypeMatch) { 43831 advance(doctypeMatch[0].length); 43832 continue 43833 } 43834 43835 // End tag: 43836 var endTagMatch = html.match(endTag); 43837 if (endTagMatch) { 43838 var curIndex = index; 43839 advance(endTagMatch[0].length); 43840 parseEndTag(endTagMatch[1], curIndex, index); 43841 continue 43842 } 43843 43844 // Start tag: 43845 var startTagMatch = parseStartTag(); 43846 if (startTagMatch) { 43847 handleStartTag(startTagMatch); 43848 if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) { 43849 advance(1); 43850 } 43851 continue 43852 } 43853 } 43854 43855 var text = (void 0), rest = (void 0), next = (void 0); 43856 if (textEnd >= 0) { 43857 rest = html.slice(textEnd); 43858 while ( 43859 !endTag.test(rest) && 43860 !startTagOpen.test(rest) && 43861 !comment.test(rest) && 43862 !conditionalComment.test(rest) 43863 ) { 43864 // < in plain text, be forgiving and treat it as text 43865 next = rest.indexOf('<', 1); 43866 if (next < 0) { break } 43867 textEnd += next; 43868 rest = html.slice(textEnd); 43869 } 43870 text = html.substring(0, textEnd); 43871 } 43872 43873 if (textEnd < 0) { 43874 text = html; 43875 } 43876 43877 if (text) { 43878 advance(text.length); 43879 } 43880 43881 if (options.chars && text) { 43882 options.chars(text, index - text.length, index); 43883 } 43884 } else { 43885 var endTagLength = 0; 43886 var stackedTag = lastTag.toLowerCase(); 43887 var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); 43888 var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { 43889 endTagLength = endTag.length; 43890 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { 43891 text = text 43892 .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 43893 .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); 43894 } 43895 if (shouldIgnoreFirstNewline(stackedTag, text)) { 43896 text = text.slice(1); 43897 } 43898 if (options.chars) { 43899 options.chars(text); 43900 } 43901 return '' 43902 }); 43903 index += html.length - rest$1.length; 43904 html = rest$1; 43905 parseEndTag(stackedTag, index - endTagLength, index); 43906 } 43907 43908 if (html === last) { 43909 options.chars && options.chars(html); 43910 if ( true && !stack.length && options.warn) { 43911 options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length }); 43912 } 43913 break 43914 } 43915 } 43916 43917 // Clean up any remaining tags 43918 parseEndTag(); 43919 43920 function advance (n) { 43921 index += n; 43922 html = html.substring(n); 43923 } 43924 43925 function parseStartTag () { 43926 var start = html.match(startTagOpen); 43927 if (start) { 43928 var match = { 43929 tagName: start[1], 43930 attrs: [], 43931 start: index 43932 }; 43933 advance(start[0].length); 43934 var end, attr; 43935 while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) { 43936 attr.start = index; 43937 advance(attr[0].length); 43938 attr.end = index; 43939 match.attrs.push(attr); 43940 } 43941 if (end) { 43942 match.unarySlash = end[1]; 43943 advance(end[0].length); 43944 match.end = index; 43945 return match 43946 } 43947 } 43948 } 43949 43950 function handleStartTag (match) { 43951 var tagName = match.tagName; 43952 var unarySlash = match.unarySlash; 43953 43954 if (expectHTML) { 43955 if (lastTag === 'p' && isNonPhrasingTag(tagName)) { 43956 parseEndTag(lastTag); 43957 } 43958 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { 43959 parseEndTag(tagName); 43960 } 43961 } 43962 43963 var unary = isUnaryTag$$1(tagName) || !!unarySlash; 43964 43965 var l = match.attrs.length; 43966 var attrs = new Array(l); 43967 for (var i = 0; i < l; i++) { 43968 var args = match.attrs[i]; 43969 var value = args[3] || args[4] || args[5] || ''; 43970 var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' 43971 ? options.shouldDecodeNewlinesForHref 43972 : options.shouldDecodeNewlines; 43973 attrs[i] = { 43974 name: args[1], 43975 value: decodeAttr(value, shouldDecodeNewlines) 43976 }; 43977 if ( true && options.outputSourceRange) { 43978 attrs[i].start = args.start + args[0].match(/^\s*/).length; 43979 attrs[i].end = args.end; 43980 } 43981 } 43982 43983 if (!unary) { 43984 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end }); 43985 lastTag = tagName; 43986 } 43987 43988 if (options.start) { 43989 options.start(tagName, attrs, unary, match.start, match.end); 43990 } 43991 } 43992 43993 function parseEndTag (tagName, start, end) { 43994 var pos, lowerCasedTagName; 43995 if (start == null) { start = index; } 43996 if (end == null) { end = index; } 43997 43998 // Find the closest opened tag of the same type 43999 if (tagName) { 44000 lowerCasedTagName = tagName.toLowerCase(); 44001 for (pos = stack.length - 1; pos >= 0; pos--) { 44002 if (stack[pos].lowerCasedTag === lowerCasedTagName) { 44003 break 44004 } 44005 } 44006 } else { 44007 // If no tag name is provided, clean shop 44008 pos = 0; 44009 } 44010 44011 if (pos >= 0) { 44012 // Close all the open elements, up the stack 44013 for (var i = stack.length - 1; i >= pos; i--) { 44014 if ( true && 44015 (i > pos || !tagName) && 44016 options.warn 44017 ) { 44018 options.warn( 44019 ("tag <" + (stack[i].tag) + "> has no matching end tag."), 44020 { start: stack[i].start, end: stack[i].end } 44021 ); 44022 } 44023 if (options.end) { 44024 options.end(stack[i].tag, start, end); 44025 } 44026 } 44027 44028 // Remove the open elements from the stack 44029 stack.length = pos; 44030 lastTag = pos && stack[pos - 1].tag; 44031 } else if (lowerCasedTagName === 'br') { 44032 if (options.start) { 44033 options.start(tagName, [], true, start, end); 44034 } 44035 } else if (lowerCasedTagName === 'p') { 44036 if (options.start) { 44037 options.start(tagName, [], false, start, end); 44038 } 44039 if (options.end) { 44040 options.end(tagName, start, end); 44041 } 44042 } 44043 } 44044} 44045 44046/* */ 44047 44048var onRE = /^@|^v-on:/; 44049var dirRE = /^v-|^@|^:|^#/; 44050var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; 44051var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 44052var stripParensRE = /^\(|\)$/g; 44053var dynamicArgRE = /^\[.*\]$/; 44054 44055var argRE = /:(.*)$/; 44056var bindRE = /^:|^\.|^v-bind:/; 44057var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g; 44058 44059var slotRE = /^v-slot(:|$)|^#/; 44060 44061var lineBreakRE = /[\r\n]/; 44062var whitespaceRE$1 = /[ \f\t\r\n]+/g; 44063 44064var invalidAttributeRE = /[\s"'<>\/=]/; 44065 44066var decodeHTMLCached = cached(he.decode); 44067 44068var emptySlotScopeToken = "_empty_"; 44069 44070// configurable state 44071var warn$2; 44072var delimiters; 44073var transforms; 44074var preTransforms; 44075var postTransforms; 44076var platformIsPreTag; 44077var platformMustUseProp; 44078var platformGetTagNamespace; 44079var maybeComponent; 44080 44081function createASTElement ( 44082 tag, 44083 attrs, 44084 parent 44085) { 44086 return { 44087 type: 1, 44088 tag: tag, 44089 attrsList: attrs, 44090 attrsMap: makeAttrsMap(attrs), 44091 rawAttrsMap: {}, 44092 parent: parent, 44093 children: [] 44094 } 44095} 44096 44097/** 44098 * Convert HTML string to AST. 44099 */ 44100function parse ( 44101 template, 44102 options 44103) { 44104 warn$2 = options.warn || baseWarn; 44105 44106 platformIsPreTag = options.isPreTag || no; 44107 platformMustUseProp = options.mustUseProp || no; 44108 platformGetTagNamespace = options.getTagNamespace || no; 44109 var isReservedTag = options.isReservedTag || no; 44110 maybeComponent = function (el) { return !!( 44111 el.component || 44112 el.attrsMap[':is'] || 44113 el.attrsMap['v-bind:is'] || 44114 !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag)) 44115 ); }; 44116 transforms = pluckModuleFunction(options.modules, 'transformNode'); 44117 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); 44118 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); 44119 44120 delimiters = options.delimiters; 44121 44122 var stack = []; 44123 var preserveWhitespace = options.preserveWhitespace !== false; 44124 var whitespaceOption = options.whitespace; 44125 var root; 44126 var currentParent; 44127 var inVPre = false; 44128 var inPre = false; 44129 var warned = false; 44130 44131 function warnOnce (msg, range) { 44132 if (!warned) { 44133 warned = true; 44134 warn$2(msg, range); 44135 } 44136 } 44137 44138 function closeElement (element) { 44139 trimEndingWhitespace(element); 44140 if (!inVPre && !element.processed) { 44141 element = processElement(element, options); 44142 } 44143 // tree management 44144 if (!stack.length && element !== root) { 44145 // allow root elements with v-if, v-else-if and v-else 44146 if (root.if && (element.elseif || element.else)) { 44147 if (true) { 44148 checkRootConstraints(element); 44149 } 44150 addIfCondition(root, { 44151 exp: element.elseif, 44152 block: element 44153 }); 44154 } else if (true) { 44155 warnOnce( 44156 "Component template should contain exactly one root element. " + 44157 "If you are using v-if on multiple elements, " + 44158 "use v-else-if to chain them instead.", 44159 { start: element.start } 44160 ); 44161 } 44162 } 44163 if (currentParent && !element.forbidden) { 44164 if (element.elseif || element.else) { 44165 processIfConditions(element, currentParent); 44166 } else { 44167 if (element.slotScope) { 44168 // scoped slot 44169 // keep it in the children list so that v-else(-if) conditions can 44170 // find it as the prev node. 44171 var name = element.slotTarget || '"default"' 44172 ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; 44173 } 44174 currentParent.children.push(element); 44175 element.parent = currentParent; 44176 } 44177 } 44178 44179 // final children cleanup 44180 // filter out scoped slots 44181 element.children = element.children.filter(function (c) { return !(c).slotScope; }); 44182 // remove trailing whitespace node again 44183 trimEndingWhitespace(element); 44184 44185 // check pre state 44186 if (element.pre) { 44187 inVPre = false; 44188 } 44189 if (platformIsPreTag(element.tag)) { 44190 inPre = false; 44191 } 44192 // apply post-transforms 44193 for (var i = 0; i < postTransforms.length; i++) { 44194 postTransforms[i](element, options); 44195 } 44196 } 44197 44198 function trimEndingWhitespace (el) { 44199 // remove trailing whitespace node 44200 if (!inPre) { 44201 var lastNode; 44202 while ( 44203 (lastNode = el.children[el.children.length - 1]) && 44204 lastNode.type === 3 && 44205 lastNode.text === ' ' 44206 ) { 44207 el.children.pop(); 44208 } 44209 } 44210 } 44211 44212 function checkRootConstraints (el) { 44213 if (el.tag === 'slot' || el.tag === 'template') { 44214 warnOnce( 44215 "Cannot use <" + (el.tag) + "> as component root element because it may " + 44216 'contain multiple nodes.', 44217 { start: el.start } 44218 ); 44219 } 44220 if (el.attrsMap.hasOwnProperty('v-for')) { 44221 warnOnce( 44222 'Cannot use v-for on stateful component root element because ' + 44223 'it renders multiple elements.', 44224 el.rawAttrsMap['v-for'] 44225 ); 44226 } 44227 } 44228 44229 parseHTML(template, { 44230 warn: warn$2, 44231 expectHTML: options.expectHTML, 44232 isUnaryTag: options.isUnaryTag, 44233 canBeLeftOpenTag: options.canBeLeftOpenTag, 44234 shouldDecodeNewlines: options.shouldDecodeNewlines, 44235 shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, 44236 shouldKeepComment: options.comments, 44237 outputSourceRange: options.outputSourceRange, 44238 start: function start (tag, attrs, unary, start$1, end) { 44239 // check namespace. 44240 // inherit parent ns if there is one 44241 var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); 44242 44243 // handle IE svg bug 44244 /* istanbul ignore if */ 44245 if (isIE && ns === 'svg') { 44246 attrs = guardIESVGBug(attrs); 44247 } 44248 44249 var element = createASTElement(tag, attrs, currentParent); 44250 if (ns) { 44251 element.ns = ns; 44252 } 44253 44254 if (true) { 44255 if (options.outputSourceRange) { 44256 element.start = start$1; 44257 element.end = end; 44258 element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) { 44259 cumulated[attr.name] = attr; 44260 return cumulated 44261 }, {}); 44262 } 44263 attrs.forEach(function (attr) { 44264 if (invalidAttributeRE.test(attr.name)) { 44265 warn$2( 44266 "Invalid dynamic argument expression: attribute names cannot contain " + 44267 "spaces, quotes, <, >, / or =.", 44268 { 44269 start: attr.start + attr.name.indexOf("["), 44270 end: attr.start + attr.name.length 44271 } 44272 ); 44273 } 44274 }); 44275 } 44276 44277 if (isForbiddenTag(element) && !isServerRendering()) { 44278 element.forbidden = true; 44279 true && warn$2( 44280 'Templates should only be responsible for mapping the state to the ' + 44281 'UI. Avoid placing tags with side-effects in your templates, such as ' + 44282 "<" + tag + ">" + ', as they will not be parsed.', 44283 { start: element.start } 44284 ); 44285 } 44286 44287 // apply pre-transforms 44288 for (var i = 0; i < preTransforms.length; i++) { 44289 element = preTransforms[i](element, options) || element; 44290 } 44291 44292 if (!inVPre) { 44293 processPre(element); 44294 if (element.pre) { 44295 inVPre = true; 44296 } 44297 } 44298 if (platformIsPreTag(element.tag)) { 44299 inPre = true; 44300 } 44301 if (inVPre) { 44302 processRawAttrs(element); 44303 } else if (!element.processed) { 44304 // structural directives 44305 processFor(element); 44306 processIf(element); 44307 processOnce(element); 44308 } 44309 44310 if (!root) { 44311 root = element; 44312 if (true) { 44313 checkRootConstraints(root); 44314 } 44315 } 44316 44317 if (!unary) { 44318 currentParent = element; 44319 stack.push(element); 44320 } else { 44321 closeElement(element); 44322 } 44323 }, 44324 44325 end: function end (tag, start, end$1) { 44326 var element = stack[stack.length - 1]; 44327 // pop stack 44328 stack.length -= 1; 44329 currentParent = stack[stack.length - 1]; 44330 if ( true && options.outputSourceRange) { 44331 element.end = end$1; 44332 } 44333 closeElement(element); 44334 }, 44335 44336 chars: function chars (text, start, end) { 44337 if (!currentParent) { 44338 if (true) { 44339 if (text === template) { 44340 warnOnce( 44341 'Component template requires a root element, rather than just text.', 44342 { start: start } 44343 ); 44344 } else if ((text = text.trim())) { 44345 warnOnce( 44346 ("text \"" + text + "\" outside root element will be ignored."), 44347 { start: start } 44348 ); 44349 } 44350 } 44351 return 44352 } 44353 // IE textarea placeholder bug 44354 /* istanbul ignore if */ 44355 if (isIE && 44356 currentParent.tag === 'textarea' && 44357 currentParent.attrsMap.placeholder === text 44358 ) { 44359 return 44360 } 44361 var children = currentParent.children; 44362 if (inPre || text.trim()) { 44363 text = isTextTag(currentParent) ? text : decodeHTMLCached(text); 44364 } else if (!children.length) { 44365 // remove the whitespace-only node right after an opening tag 44366 text = ''; 44367 } else if (whitespaceOption) { 44368 if (whitespaceOption === 'condense') { 44369 // in condense mode, remove the whitespace node if it contains 44370 // line break, otherwise condense to a single space 44371 text = lineBreakRE.test(text) ? '' : ' '; 44372 } else { 44373 text = ' '; 44374 } 44375 } else { 44376 text = preserveWhitespace ? ' ' : ''; 44377 } 44378 if (text) { 44379 if (!inPre && whitespaceOption === 'condense') { 44380 // condense consecutive whitespaces into single space 44381 text = text.replace(whitespaceRE$1, ' '); 44382 } 44383 var res; 44384 var child; 44385 if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { 44386 child = { 44387 type: 2, 44388 expression: res.expression, 44389 tokens: res.tokens, 44390 text: text 44391 }; 44392 } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { 44393 child = { 44394 type: 3, 44395 text: text 44396 }; 44397 } 44398 if (child) { 44399 if ( true && options.outputSourceRange) { 44400 child.start = start; 44401 child.end = end; 44402 } 44403 children.push(child); 44404 } 44405 } 44406 }, 44407 comment: function comment (text, start, end) { 44408 // adding anything as a sibling to the root node is forbidden 44409 // comments should still be allowed, but ignored 44410 if (currentParent) { 44411 var child = { 44412 type: 3, 44413 text: text, 44414 isComment: true 44415 }; 44416 if ( true && options.outputSourceRange) { 44417 child.start = start; 44418 child.end = end; 44419 } 44420 currentParent.children.push(child); 44421 } 44422 } 44423 }); 44424 return root 44425} 44426 44427function processPre (el) { 44428 if (getAndRemoveAttr(el, 'v-pre') != null) { 44429 el.pre = true; 44430 } 44431} 44432 44433function processRawAttrs (el) { 44434 var list = el.attrsList; 44435 var len = list.length; 44436 if (len) { 44437 var attrs = el.attrs = new Array(len); 44438 for (var i = 0; i < len; i++) { 44439 attrs[i] = { 44440 name: list[i].name, 44441 value: JSON.stringify(list[i].value) 44442 }; 44443 if (list[i].start != null) { 44444 attrs[i].start = list[i].start; 44445 attrs[i].end = list[i].end; 44446 } 44447 } 44448 } else if (!el.pre) { 44449 // non root node in pre blocks with no attributes 44450 el.plain = true; 44451 } 44452} 44453 44454function processElement ( 44455 element, 44456 options 44457) { 44458 processKey(element); 44459 44460 // determine whether this is a plain element after 44461 // removing structural attributes 44462 element.plain = ( 44463 !element.key && 44464 !element.scopedSlots && 44465 !element.attrsList.length 44466 ); 44467 44468 processRef(element); 44469 processSlotContent(element); 44470 processSlotOutlet(element); 44471 processComponent(element); 44472 for (var i = 0; i < transforms.length; i++) { 44473 element = transforms[i](element, options) || element; 44474 } 44475 processAttrs(element); 44476 return element 44477} 44478 44479function processKey (el) { 44480 var exp = getBindingAttr(el, 'key'); 44481 if (exp) { 44482 if (true) { 44483 if (el.tag === 'template') { 44484 warn$2( 44485 "<template> cannot be keyed. Place the key on real elements instead.", 44486 getRawBindingAttr(el, 'key') 44487 ); 44488 } 44489 if (el.for) { 44490 var iterator = el.iterator2 || el.iterator1; 44491 var parent = el.parent; 44492 if (iterator && iterator === exp && parent && parent.tag === 'transition-group') { 44493 warn$2( 44494 "Do not use v-for index as key on <transition-group> children, " + 44495 "this is the same as not using keys.", 44496 getRawBindingAttr(el, 'key'), 44497 true /* tip */ 44498 ); 44499 } 44500 } 44501 } 44502 el.key = exp; 44503 } 44504} 44505 44506function processRef (el) { 44507 var ref = getBindingAttr(el, 'ref'); 44508 if (ref) { 44509 el.ref = ref; 44510 el.refInFor = checkInFor(el); 44511 } 44512} 44513 44514function processFor (el) { 44515 var exp; 44516 if ((exp = getAndRemoveAttr(el, 'v-for'))) { 44517 var res = parseFor(exp); 44518 if (res) { 44519 extend(el, res); 44520 } else if (true) { 44521 warn$2( 44522 ("Invalid v-for expression: " + exp), 44523 el.rawAttrsMap['v-for'] 44524 ); 44525 } 44526 } 44527} 44528 44529 44530 44531function parseFor (exp) { 44532 var inMatch = exp.match(forAliasRE); 44533 if (!inMatch) { return } 44534 var res = {}; 44535 res.for = inMatch[2].trim(); 44536 var alias = inMatch[1].trim().replace(stripParensRE, ''); 44537 var iteratorMatch = alias.match(forIteratorRE); 44538 if (iteratorMatch) { 44539 res.alias = alias.replace(forIteratorRE, '').trim(); 44540 res.iterator1 = iteratorMatch[1].trim(); 44541 if (iteratorMatch[2]) { 44542 res.iterator2 = iteratorMatch[2].trim(); 44543 } 44544 } else { 44545 res.alias = alias; 44546 } 44547 return res 44548} 44549 44550function processIf (el) { 44551 var exp = getAndRemoveAttr(el, 'v-if'); 44552 if (exp) { 44553 el.if = exp; 44554 addIfCondition(el, { 44555 exp: exp, 44556 block: el 44557 }); 44558 } else { 44559 if (getAndRemoveAttr(el, 'v-else') != null) { 44560 el.else = true; 44561 } 44562 var elseif = getAndRemoveAttr(el, 'v-else-if'); 44563 if (elseif) { 44564 el.elseif = elseif; 44565 } 44566 } 44567} 44568 44569function processIfConditions (el, parent) { 44570 var prev = findPrevElement(parent.children); 44571 if (prev && prev.if) { 44572 addIfCondition(prev, { 44573 exp: el.elseif, 44574 block: el 44575 }); 44576 } else if (true) { 44577 warn$2( 44578 "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + 44579 "used on element <" + (el.tag) + "> without corresponding v-if.", 44580 el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else'] 44581 ); 44582 } 44583} 44584 44585function findPrevElement (children) { 44586 var i = children.length; 44587 while (i--) { 44588 if (children[i].type === 1) { 44589 return children[i] 44590 } else { 44591 if ( true && children[i].text !== ' ') { 44592 warn$2( 44593 "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + 44594 "will be ignored.", 44595 children[i] 44596 ); 44597 } 44598 children.pop(); 44599 } 44600 } 44601} 44602 44603function addIfCondition (el, condition) { 44604 if (!el.ifConditions) { 44605 el.ifConditions = []; 44606 } 44607 el.ifConditions.push(condition); 44608} 44609 44610function processOnce (el) { 44611 var once$$1 = getAndRemoveAttr(el, 'v-once'); 44612 if (once$$1 != null) { 44613 el.once = true; 44614 } 44615} 44616 44617// handle content being passed to a component as slot, 44618// e.g. <template slot="xxx">, <div slot-scope="xxx"> 44619function processSlotContent (el) { 44620 var slotScope; 44621 if (el.tag === 'template') { 44622 slotScope = getAndRemoveAttr(el, 'scope'); 44623 /* istanbul ignore if */ 44624 if ( true && slotScope) { 44625 warn$2( 44626 "the \"scope\" attribute for scoped slots have been deprecated and " + 44627 "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + 44628 "can also be used on plain elements in addition to <template> to " + 44629 "denote scoped slots.", 44630 el.rawAttrsMap['scope'], 44631 true 44632 ); 44633 } 44634 el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); 44635 } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { 44636 /* istanbul ignore if */ 44637 if ( true && el.attrsMap['v-for']) { 44638 warn$2( 44639 "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + 44640 "(v-for takes higher priority). Use a wrapper <template> for the " + 44641 "scoped slot to make it clearer.", 44642 el.rawAttrsMap['slot-scope'], 44643 true 44644 ); 44645 } 44646 el.slotScope = slotScope; 44647 } 44648 44649 // slot="xxx" 44650 var slotTarget = getBindingAttr(el, 'slot'); 44651 if (slotTarget) { 44652 el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; 44653 el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']); 44654 // preserve slot as an attribute for native shadow DOM compat 44655 // only for non-scoped slots. 44656 if (el.tag !== 'template' && !el.slotScope) { 44657 addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot')); 44658 } 44659 } 44660 44661 // 2.6 v-slot syntax 44662 { 44663 if (el.tag === 'template') { 44664 // v-slot on <template> 44665 var slotBinding = getAndRemoveAttrByRegex(el, slotRE); 44666 if (slotBinding) { 44667 if (true) { 44668 if (el.slotTarget || el.slotScope) { 44669 warn$2( 44670 "Unexpected mixed usage of different slot syntaxes.", 44671 el 44672 ); 44673 } 44674 if (el.parent && !maybeComponent(el.parent)) { 44675 warn$2( 44676 "<template v-slot> can only appear at the root level inside " + 44677 "the receiving component", 44678 el 44679 ); 44680 } 44681 } 44682 var ref = getSlotName(slotBinding); 44683 var name = ref.name; 44684 var dynamic = ref.dynamic; 44685 el.slotTarget = name; 44686 el.slotTargetDynamic = dynamic; 44687 el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf 44688 } 44689 } else { 44690 // v-slot on component, denotes default slot 44691 var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE); 44692 if (slotBinding$1) { 44693 if (true) { 44694 if (!maybeComponent(el)) { 44695 warn$2( 44696 "v-slot can only be used on components or <template>.", 44697 slotBinding$1 44698 ); 44699 } 44700 if (el.slotScope || el.slotTarget) { 44701 warn$2( 44702 "Unexpected mixed usage of different slot syntaxes.", 44703 el 44704 ); 44705 } 44706 if (el.scopedSlots) { 44707 warn$2( 44708 "To avoid scope ambiguity, the default slot should also use " + 44709 "<template> syntax when there are other named slots.", 44710 slotBinding$1 44711 ); 44712 } 44713 } 44714 // add the component's children to its default slot 44715 var slots = el.scopedSlots || (el.scopedSlots = {}); 44716 var ref$1 = getSlotName(slotBinding$1); 44717 var name$1 = ref$1.name; 44718 var dynamic$1 = ref$1.dynamic; 44719 var slotContainer = slots[name$1] = createASTElement('template', [], el); 44720 slotContainer.slotTarget = name$1; 44721 slotContainer.slotTargetDynamic = dynamic$1; 44722 slotContainer.children = el.children.filter(function (c) { 44723 if (!c.slotScope) { 44724 c.parent = slotContainer; 44725 return true 44726 } 44727 }); 44728 slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; 44729 // remove children as they are returned from scopedSlots now 44730 el.children = []; 44731 // mark el non-plain so data gets generated 44732 el.plain = false; 44733 } 44734 } 44735 } 44736} 44737 44738function getSlotName (binding) { 44739 var name = binding.name.replace(slotRE, ''); 44740 if (!name) { 44741 if (binding.name[0] !== '#') { 44742 name = 'default'; 44743 } else if (true) { 44744 warn$2( 44745 "v-slot shorthand syntax requires a slot name.", 44746 binding 44747 ); 44748 } 44749 } 44750 return dynamicArgRE.test(name) 44751 // dynamic [name] 44752 ? { name: name.slice(1, -1), dynamic: true } 44753 // static name 44754 : { name: ("\"" + name + "\""), dynamic: false } 44755} 44756 44757// handle <slot/> outlets 44758function processSlotOutlet (el) { 44759 if (el.tag === 'slot') { 44760 el.slotName = getBindingAttr(el, 'name'); 44761 if ( true && el.key) { 44762 warn$2( 44763 "`key` does not work on <slot> because slots are abstract outlets " + 44764 "and can possibly expand into multiple elements. " + 44765 "Use the key on a wrapping element instead.", 44766 getRawBindingAttr(el, 'key') 44767 ); 44768 } 44769 } 44770} 44771 44772function processComponent (el) { 44773 var binding; 44774 if ((binding = getBindingAttr(el, 'is'))) { 44775 el.component = binding; 44776 } 44777 if (getAndRemoveAttr(el, 'inline-template') != null) { 44778 el.inlineTemplate = true; 44779 } 44780} 44781 44782function processAttrs (el) { 44783 var list = el.attrsList; 44784 var i, l, name, rawName, value, modifiers, syncGen, isDynamic; 44785 for (i = 0, l = list.length; i < l; i++) { 44786 name = rawName = list[i].name; 44787 value = list[i].value; 44788 if (dirRE.test(name)) { 44789 // mark element as dynamic 44790 el.hasBindings = true; 44791 // modifiers 44792 modifiers = parseModifiers(name.replace(dirRE, '')); 44793 // support .foo shorthand syntax for the .prop modifier 44794 if (modifiers) { 44795 name = name.replace(modifierRE, ''); 44796 } 44797 if (bindRE.test(name)) { // v-bind 44798 name = name.replace(bindRE, ''); 44799 value = parseFilters(value); 44800 isDynamic = dynamicArgRE.test(name); 44801 if (isDynamic) { 44802 name = name.slice(1, -1); 44803 } 44804 if ( 44805 true && 44806 value.trim().length === 0 44807 ) { 44808 warn$2( 44809 ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"") 44810 ); 44811 } 44812 if (modifiers) { 44813 if (modifiers.prop && !isDynamic) { 44814 name = camelize(name); 44815 if (name === 'innerHtml') { name = 'innerHTML'; } 44816 } 44817 if (modifiers.camel && !isDynamic) { 44818 name = camelize(name); 44819 } 44820 if (modifiers.sync) { 44821 syncGen = genAssignmentCode(value, "$event"); 44822 if (!isDynamic) { 44823 addHandler( 44824 el, 44825 ("update:" + (camelize(name))), 44826 syncGen, 44827 null, 44828 false, 44829 warn$2, 44830 list[i] 44831 ); 44832 if (hyphenate(name) !== camelize(name)) { 44833 addHandler( 44834 el, 44835 ("update:" + (hyphenate(name))), 44836 syncGen, 44837 null, 44838 false, 44839 warn$2, 44840 list[i] 44841 ); 44842 } 44843 } else { 44844 // handler w/ dynamic event name 44845 addHandler( 44846 el, 44847 ("\"update:\"+(" + name + ")"), 44848 syncGen, 44849 null, 44850 false, 44851 warn$2, 44852 list[i], 44853 true // dynamic 44854 ); 44855 } 44856 } 44857 } 44858 if ((modifiers && modifiers.prop) || ( 44859 !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) 44860 )) { 44861 addProp(el, name, value, list[i], isDynamic); 44862 } else { 44863 addAttr(el, name, value, list[i], isDynamic); 44864 } 44865 } else if (onRE.test(name)) { // v-on 44866 name = name.replace(onRE, ''); 44867 isDynamic = dynamicArgRE.test(name); 44868 if (isDynamic) { 44869 name = name.slice(1, -1); 44870 } 44871 addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic); 44872 } else { // normal directives 44873 name = name.replace(dirRE, ''); 44874 // parse arg 44875 var argMatch = name.match(argRE); 44876 var arg = argMatch && argMatch[1]; 44877 isDynamic = false; 44878 if (arg) { 44879 name = name.slice(0, -(arg.length + 1)); 44880 if (dynamicArgRE.test(arg)) { 44881 arg = arg.slice(1, -1); 44882 isDynamic = true; 44883 } 44884 } 44885 addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]); 44886 if ( true && name === 'model') { 44887 checkForAliasModel(el, value); 44888 } 44889 } 44890 } else { 44891 // literal attribute 44892 if (true) { 44893 var res = parseText(value, delimiters); 44894 if (res) { 44895 warn$2( 44896 name + "=\"" + value + "\": " + 44897 'Interpolation inside attributes has been removed. ' + 44898 'Use v-bind or the colon shorthand instead. For example, ' + 44899 'instead of <div id="{{ val }}">, use <div :id="val">.', 44900 list[i] 44901 ); 44902 } 44903 } 44904 addAttr(el, name, JSON.stringify(value), list[i]); 44905 // #6887 firefox doesn't update muted state if set via attribute 44906 // even immediately after element creation 44907 if (!el.component && 44908 name === 'muted' && 44909 platformMustUseProp(el.tag, el.attrsMap.type, name)) { 44910 addProp(el, name, 'true', list[i]); 44911 } 44912 } 44913 } 44914} 44915 44916function checkInFor (el) { 44917 var parent = el; 44918 while (parent) { 44919 if (parent.for !== undefined) { 44920 return true 44921 } 44922 parent = parent.parent; 44923 } 44924 return false 44925} 44926 44927function parseModifiers (name) { 44928 var match = name.match(modifierRE); 44929 if (match) { 44930 var ret = {}; 44931 match.forEach(function (m) { ret[m.slice(1)] = true; }); 44932 return ret 44933 } 44934} 44935 44936function makeAttrsMap (attrs) { 44937 var map = {}; 44938 for (var i = 0, l = attrs.length; i < l; i++) { 44939 if ( 44940 true && 44941 map[attrs[i].name] && !isIE && !isEdge 44942 ) { 44943 warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]); 44944 } 44945 map[attrs[i].name] = attrs[i].value; 44946 } 44947 return map 44948} 44949 44950// for script (e.g. type="x/template") or style, do not decode content 44951function isTextTag (el) { 44952 return el.tag === 'script' || el.tag === 'style' 44953} 44954 44955function isForbiddenTag (el) { 44956 return ( 44957 el.tag === 'style' || 44958 (el.tag === 'script' && ( 44959 !el.attrsMap.type || 44960 el.attrsMap.type === 'text/javascript' 44961 )) 44962 ) 44963} 44964 44965var ieNSBug = /^xmlns:NS\d+/; 44966var ieNSPrefix = /^NS\d+:/; 44967 44968/* istanbul ignore next */ 44969function guardIESVGBug (attrs) { 44970 var res = []; 44971 for (var i = 0; i < attrs.length; i++) { 44972 var attr = attrs[i]; 44973 if (!ieNSBug.test(attr.name)) { 44974 attr.name = attr.name.replace(ieNSPrefix, ''); 44975 res.push(attr); 44976 } 44977 } 44978 return res 44979} 44980 44981function checkForAliasModel (el, value) { 44982 var _el = el; 44983 while (_el) { 44984 if (_el.for && _el.alias === value) { 44985 warn$2( 44986 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 44987 "You are binding v-model directly to a v-for iteration alias. " + 44988 "This will not be able to modify the v-for source array because " + 44989 "writing to the alias is like modifying a function local variable. " + 44990 "Consider using an array of objects and use v-model on an object property instead.", 44991 el.rawAttrsMap['v-model'] 44992 ); 44993 } 44994 _el = _el.parent; 44995 } 44996} 44997 44998/* */ 44999 45000function preTransformNode (el, options) { 45001 if (el.tag === 'input') { 45002 var map = el.attrsMap; 45003 if (!map['v-model']) { 45004 return 45005 } 45006 45007 var typeBinding; 45008 if (map[':type'] || map['v-bind:type']) { 45009 typeBinding = getBindingAttr(el, 'type'); 45010 } 45011 if (!map.type && !typeBinding && map['v-bind']) { 45012 typeBinding = "(" + (map['v-bind']) + ").type"; 45013 } 45014 45015 if (typeBinding) { 45016 var ifCondition = getAndRemoveAttr(el, 'v-if', true); 45017 var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; 45018 var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; 45019 var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); 45020 // 1. checkbox 45021 var branch0 = cloneASTElement(el); 45022 // process for on the main node 45023 processFor(branch0); 45024 addRawAttr(branch0, 'type', 'checkbox'); 45025 processElement(branch0, options); 45026 branch0.processed = true; // prevent it from double-processed 45027 branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; 45028 addIfCondition(branch0, { 45029 exp: branch0.if, 45030 block: branch0 45031 }); 45032 // 2. add radio else-if condition 45033 var branch1 = cloneASTElement(el); 45034 getAndRemoveAttr(branch1, 'v-for', true); 45035 addRawAttr(branch1, 'type', 'radio'); 45036 processElement(branch1, options); 45037 addIfCondition(branch0, { 45038 exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, 45039 block: branch1 45040 }); 45041 // 3. other 45042 var branch2 = cloneASTElement(el); 45043 getAndRemoveAttr(branch2, 'v-for', true); 45044 addRawAttr(branch2, ':type', typeBinding); 45045 processElement(branch2, options); 45046 addIfCondition(branch0, { 45047 exp: ifCondition, 45048 block: branch2 45049 }); 45050 45051 if (hasElse) { 45052 branch0.else = true; 45053 } else if (elseIfCondition) { 45054 branch0.elseif = elseIfCondition; 45055 } 45056 45057 return branch0 45058 } 45059 } 45060} 45061 45062function cloneASTElement (el) { 45063 return createASTElement(el.tag, el.attrsList.slice(), el.parent) 45064} 45065 45066var model$1 = { 45067 preTransformNode: preTransformNode 45068}; 45069 45070var modules$1 = [ 45071 klass$1, 45072 style$1, 45073 model$1 45074]; 45075 45076/* */ 45077 45078function text (el, dir) { 45079 if (dir.value) { 45080 addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir); 45081 } 45082} 45083 45084/* */ 45085 45086function html (el, dir) { 45087 if (dir.value) { 45088 addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir); 45089 } 45090} 45091 45092var directives$1 = { 45093 model: model, 45094 text: text, 45095 html: html 45096}; 45097 45098/* */ 45099 45100var baseOptions = { 45101 expectHTML: true, 45102 modules: modules$1, 45103 directives: directives$1, 45104 isPreTag: isPreTag, 45105 isUnaryTag: isUnaryTag, 45106 mustUseProp: mustUseProp, 45107 canBeLeftOpenTag: canBeLeftOpenTag, 45108 isReservedTag: isReservedTag, 45109 getTagNamespace: getTagNamespace, 45110 staticKeys: genStaticKeys(modules$1) 45111}; 45112 45113/* */ 45114 45115var isStaticKey; 45116var isPlatformReservedTag; 45117 45118var genStaticKeysCached = cached(genStaticKeys$1); 45119 45120/** 45121 * Goal of the optimizer: walk the generated template AST tree 45122 * and detect sub-trees that are purely static, i.e. parts of 45123 * the DOM that never needs to change. 45124 * 45125 * Once we detect these sub-trees, we can: 45126 * 45127 * 1. Hoist them into constants, so that we no longer need to 45128 * create fresh nodes for them on each re-render; 45129 * 2. Completely skip them in the patching process. 45130 */ 45131function optimize (root, options) { 45132 if (!root) { return } 45133 isStaticKey = genStaticKeysCached(options.staticKeys || ''); 45134 isPlatformReservedTag = options.isReservedTag || no; 45135 // first pass: mark all non-static nodes. 45136 markStatic$1(root); 45137 // second pass: mark static roots. 45138 markStaticRoots(root, false); 45139} 45140 45141function genStaticKeys$1 (keys) { 45142 return makeMap( 45143 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' + 45144 (keys ? ',' + keys : '') 45145 ) 45146} 45147 45148function markStatic$1 (node) { 45149 node.static = isStatic(node); 45150 if (node.type === 1) { 45151 // do not make component slot content static. this avoids 45152 // 1. components not able to mutate slot nodes 45153 // 2. static slot content fails for hot-reloading 45154 if ( 45155 !isPlatformReservedTag(node.tag) && 45156 node.tag !== 'slot' && 45157 node.attrsMap['inline-template'] == null 45158 ) { 45159 return 45160 } 45161 for (var i = 0, l = node.children.length; i < l; i++) { 45162 var child = node.children[i]; 45163 markStatic$1(child); 45164 if (!child.static) { 45165 node.static = false; 45166 } 45167 } 45168 if (node.ifConditions) { 45169 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 45170 var block = node.ifConditions[i$1].block; 45171 markStatic$1(block); 45172 if (!block.static) { 45173 node.static = false; 45174 } 45175 } 45176 } 45177 } 45178} 45179 45180function markStaticRoots (node, isInFor) { 45181 if (node.type === 1) { 45182 if (node.static || node.once) { 45183 node.staticInFor = isInFor; 45184 } 45185 // For a node to qualify as a static root, it should have children that 45186 // are not just static text. Otherwise the cost of hoisting out will 45187 // outweigh the benefits and it's better off to just always render it fresh. 45188 if (node.static && node.children.length && !( 45189 node.children.length === 1 && 45190 node.children[0].type === 3 45191 )) { 45192 node.staticRoot = true; 45193 return 45194 } else { 45195 node.staticRoot = false; 45196 } 45197 if (node.children) { 45198 for (var i = 0, l = node.children.length; i < l; i++) { 45199 markStaticRoots(node.children[i], isInFor || !!node.for); 45200 } 45201 } 45202 if (node.ifConditions) { 45203 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 45204 markStaticRoots(node.ifConditions[i$1].block, isInFor); 45205 } 45206 } 45207 } 45208} 45209 45210function isStatic (node) { 45211 if (node.type === 2) { // expression 45212 return false 45213 } 45214 if (node.type === 3) { // text 45215 return true 45216 } 45217 return !!(node.pre || ( 45218 !node.hasBindings && // no dynamic bindings 45219 !node.if && !node.for && // not v-if or v-for or v-else 45220 !isBuiltInTag(node.tag) && // not a built-in 45221 isPlatformReservedTag(node.tag) && // not a component 45222 !isDirectChildOfTemplateFor(node) && 45223 Object.keys(node).every(isStaticKey) 45224 )) 45225} 45226 45227function isDirectChildOfTemplateFor (node) { 45228 while (node.parent) { 45229 node = node.parent; 45230 if (node.tag !== 'template') { 45231 return false 45232 } 45233 if (node.for) { 45234 return true 45235 } 45236 } 45237 return false 45238} 45239 45240/* */ 45241 45242var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/; 45243var fnInvokeRE = /\([^)]*?\);*$/; 45244var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; 45245 45246// KeyboardEvent.keyCode aliases 45247var keyCodes = { 45248 esc: 27, 45249 tab: 9, 45250 enter: 13, 45251 space: 32, 45252 up: 38, 45253 left: 37, 45254 right: 39, 45255 down: 40, 45256 'delete': [8, 46] 45257}; 45258 45259// KeyboardEvent.key aliases 45260var keyNames = { 45261 // #7880: IE11 and Edge use `Esc` for Escape key name. 45262 esc: ['Esc', 'Escape'], 45263 tab: 'Tab', 45264 enter: 'Enter', 45265 // #9112: IE11 uses `Spacebar` for Space key name. 45266 space: [' ', 'Spacebar'], 45267 // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. 45268 up: ['Up', 'ArrowUp'], 45269 left: ['Left', 'ArrowLeft'], 45270 right: ['Right', 'ArrowRight'], 45271 down: ['Down', 'ArrowDown'], 45272 // #9112: IE11 uses `Del` for Delete key name. 45273 'delete': ['Backspace', 'Delete', 'Del'] 45274}; 45275 45276// #4868: modifiers that prevent the execution of the listener 45277// need to explicitly return null so that we can determine whether to remove 45278// the listener for .once 45279var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; 45280 45281var modifierCode = { 45282 stop: '$event.stopPropagation();', 45283 prevent: '$event.preventDefault();', 45284 self: genGuard("$event.target !== $event.currentTarget"), 45285 ctrl: genGuard("!$event.ctrlKey"), 45286 shift: genGuard("!$event.shiftKey"), 45287 alt: genGuard("!$event.altKey"), 45288 meta: genGuard("!$event.metaKey"), 45289 left: genGuard("'button' in $event && $event.button !== 0"), 45290 middle: genGuard("'button' in $event && $event.button !== 1"), 45291 right: genGuard("'button' in $event && $event.button !== 2") 45292}; 45293 45294function genHandlers ( 45295 events, 45296 isNative 45297) { 45298 var prefix = isNative ? 'nativeOn:' : 'on:'; 45299 var staticHandlers = ""; 45300 var dynamicHandlers = ""; 45301 for (var name in events) { 45302 var handlerCode = genHandler(events[name]); 45303 if (events[name] && events[name].dynamic) { 45304 dynamicHandlers += name + "," + handlerCode + ","; 45305 } else { 45306 staticHandlers += "\"" + name + "\":" + handlerCode + ","; 45307 } 45308 } 45309 staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}"; 45310 if (dynamicHandlers) { 45311 return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])" 45312 } else { 45313 return prefix + staticHandlers 45314 } 45315} 45316 45317function genHandler (handler) { 45318 if (!handler) { 45319 return 'function(){}' 45320 } 45321 45322 if (Array.isArray(handler)) { 45323 return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]") 45324 } 45325 45326 var isMethodPath = simplePathRE.test(handler.value); 45327 var isFunctionExpression = fnExpRE.test(handler.value); 45328 var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, '')); 45329 45330 if (!handler.modifiers) { 45331 if (isMethodPath || isFunctionExpression) { 45332 return handler.value 45333 } 45334 return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement 45335 } else { 45336 var code = ''; 45337 var genModifierCode = ''; 45338 var keys = []; 45339 for (var key in handler.modifiers) { 45340 if (modifierCode[key]) { 45341 genModifierCode += modifierCode[key]; 45342 // left/right 45343 if (keyCodes[key]) { 45344 keys.push(key); 45345 } 45346 } else if (key === 'exact') { 45347 var modifiers = (handler.modifiers); 45348 genModifierCode += genGuard( 45349 ['ctrl', 'shift', 'alt', 'meta'] 45350 .filter(function (keyModifier) { return !modifiers[keyModifier]; }) 45351 .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) 45352 .join('||') 45353 ); 45354 } else { 45355 keys.push(key); 45356 } 45357 } 45358 if (keys.length) { 45359 code += genKeyFilter(keys); 45360 } 45361 // Make sure modifiers like prevent and stop get executed after key filtering 45362 if (genModifierCode) { 45363 code += genModifierCode; 45364 } 45365 var handlerCode = isMethodPath 45366 ? ("return " + (handler.value) + ".apply(null, arguments)") 45367 : isFunctionExpression 45368 ? ("return (" + (handler.value) + ").apply(null, arguments)") 45369 : isFunctionInvocation 45370 ? ("return " + (handler.value)) 45371 : handler.value; 45372 return ("function($event){" + code + handlerCode + "}") 45373 } 45374} 45375 45376function genKeyFilter (keys) { 45377 return ( 45378 // make sure the key filters only apply to KeyboardEvents 45379 // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake 45380 // key events that do not have keyCode property... 45381 "if(!$event.type.indexOf('key')&&" + 45382 (keys.map(genFilterCode).join('&&')) + ")return null;" 45383 ) 45384} 45385 45386function genFilterCode (key) { 45387 var keyVal = parseInt(key, 10); 45388 if (keyVal) { 45389 return ("$event.keyCode!==" + keyVal) 45390 } 45391 var keyCode = keyCodes[key]; 45392 var keyName = keyNames[key]; 45393 return ( 45394 "_k($event.keyCode," + 45395 (JSON.stringify(key)) + "," + 45396 (JSON.stringify(keyCode)) + "," + 45397 "$event.key," + 45398 "" + (JSON.stringify(keyName)) + 45399 ")" 45400 ) 45401} 45402 45403/* */ 45404 45405function on (el, dir) { 45406 if ( true && dir.modifiers) { 45407 warn("v-on without argument does not support modifiers."); 45408 } 45409 el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; 45410} 45411 45412/* */ 45413 45414function bind$1 (el, dir) { 45415 el.wrapData = function (code) { 45416 return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") 45417 }; 45418} 45419 45420/* */ 45421 45422var baseDirectives = { 45423 on: on, 45424 bind: bind$1, 45425 cloak: noop 45426}; 45427 45428/* */ 45429 45430 45431 45432 45433 45434var CodegenState = function CodegenState (options) { 45435 this.options = options; 45436 this.warn = options.warn || baseWarn; 45437 this.transforms = pluckModuleFunction(options.modules, 'transformCode'); 45438 this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); 45439 this.directives = extend(extend({}, baseDirectives), options.directives); 45440 var isReservedTag = options.isReservedTag || no; 45441 this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; 45442 this.onceId = 0; 45443 this.staticRenderFns = []; 45444 this.pre = false; 45445}; 45446 45447 45448 45449function generate ( 45450 ast, 45451 options 45452) { 45453 var state = new CodegenState(options); 45454 // fix #11483, Root level <script> tags should not be rendered. 45455 var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")'; 45456 return { 45457 render: ("with(this){return " + code + "}"), 45458 staticRenderFns: state.staticRenderFns 45459 } 45460} 45461 45462function genElement (el, state) { 45463 if (el.parent) { 45464 el.pre = el.pre || el.parent.pre; 45465 } 45466 45467 if (el.staticRoot && !el.staticProcessed) { 45468 return genStatic(el, state) 45469 } else if (el.once && !el.onceProcessed) { 45470 return genOnce(el, state) 45471 } else if (el.for && !el.forProcessed) { 45472 return genFor(el, state) 45473 } else if (el.if && !el.ifProcessed) { 45474 return genIf(el, state) 45475 } else if (el.tag === 'template' && !el.slotTarget && !state.pre) { 45476 return genChildren(el, state) || 'void 0' 45477 } else if (el.tag === 'slot') { 45478 return genSlot(el, state) 45479 } else { 45480 // component or element 45481 var code; 45482 if (el.component) { 45483 code = genComponent(el.component, el, state); 45484 } else { 45485 var data; 45486 if (!el.plain || (el.pre && state.maybeComponent(el))) { 45487 data = genData$2(el, state); 45488 } 45489 45490 var children = el.inlineTemplate ? null : genChildren(el, state, true); 45491 code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; 45492 } 45493 // module transforms 45494 for (var i = 0; i < state.transforms.length; i++) { 45495 code = state.transforms[i](el, code); 45496 } 45497 return code 45498 } 45499} 45500 45501// hoist static sub-trees out 45502function genStatic (el, state) { 45503 el.staticProcessed = true; 45504 // Some elements (templates) need to behave differently inside of a v-pre 45505 // node. All pre nodes are static roots, so we can use this as a location to 45506 // wrap a state change and reset it upon exiting the pre node. 45507 var originalPreState = state.pre; 45508 if (el.pre) { 45509 state.pre = el.pre; 45510 } 45511 state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); 45512 state.pre = originalPreState; 45513 return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") 45514} 45515 45516// v-once 45517function genOnce (el, state) { 45518 el.onceProcessed = true; 45519 if (el.if && !el.ifProcessed) { 45520 return genIf(el, state) 45521 } else if (el.staticInFor) { 45522 var key = ''; 45523 var parent = el.parent; 45524 while (parent) { 45525 if (parent.for) { 45526 key = parent.key; 45527 break 45528 } 45529 parent = parent.parent; 45530 } 45531 if (!key) { 45532 true && state.warn( 45533 "v-once can only be used inside v-for that is keyed. ", 45534 el.rawAttrsMap['v-once'] 45535 ); 45536 return genElement(el, state) 45537 } 45538 return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") 45539 } else { 45540 return genStatic(el, state) 45541 } 45542} 45543 45544function genIf ( 45545 el, 45546 state, 45547 altGen, 45548 altEmpty 45549) { 45550 el.ifProcessed = true; // avoid recursion 45551 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) 45552} 45553 45554function genIfConditions ( 45555 conditions, 45556 state, 45557 altGen, 45558 altEmpty 45559) { 45560 if (!conditions.length) { 45561 return altEmpty || '_e()' 45562 } 45563 45564 var condition = conditions.shift(); 45565 if (condition.exp) { 45566 return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) 45567 } else { 45568 return ("" + (genTernaryExp(condition.block))) 45569 } 45570 45571 // v-if with v-once should generate code like (a)?_m(0):_m(1) 45572 function genTernaryExp (el) { 45573 return altGen 45574 ? altGen(el, state) 45575 : el.once 45576 ? genOnce(el, state) 45577 : genElement(el, state) 45578 } 45579} 45580 45581function genFor ( 45582 el, 45583 state, 45584 altGen, 45585 altHelper 45586) { 45587 var exp = el.for; 45588 var alias = el.alias; 45589 var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; 45590 var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; 45591 45592 if ( true && 45593 state.maybeComponent(el) && 45594 el.tag !== 'slot' && 45595 el.tag !== 'template' && 45596 !el.key 45597 ) { 45598 state.warn( 45599 "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + 45600 "v-for should have explicit keys. " + 45601 "See https://vuejs.org/guide/list.html#key for more info.", 45602 el.rawAttrsMap['v-for'], 45603 true /* tip */ 45604 ); 45605 } 45606 45607 el.forProcessed = true; // avoid recursion 45608 return (altHelper || '_l') + "((" + exp + ")," + 45609 "function(" + alias + iterator1 + iterator2 + "){" + 45610 "return " + ((altGen || genElement)(el, state)) + 45611 '})' 45612} 45613 45614function genData$2 (el, state) { 45615 var data = '{'; 45616 45617 // directives first. 45618 // directives may mutate the el's other properties before they are generated. 45619 var dirs = genDirectives(el, state); 45620 if (dirs) { data += dirs + ','; } 45621 45622 // key 45623 if (el.key) { 45624 data += "key:" + (el.key) + ","; 45625 } 45626 // ref 45627 if (el.ref) { 45628 data += "ref:" + (el.ref) + ","; 45629 } 45630 if (el.refInFor) { 45631 data += "refInFor:true,"; 45632 } 45633 // pre 45634 if (el.pre) { 45635 data += "pre:true,"; 45636 } 45637 // record original tag name for components using "is" attribute 45638 if (el.component) { 45639 data += "tag:\"" + (el.tag) + "\","; 45640 } 45641 // module data generation functions 45642 for (var i = 0; i < state.dataGenFns.length; i++) { 45643 data += state.dataGenFns[i](el); 45644 } 45645 // attributes 45646 if (el.attrs) { 45647 data += "attrs:" + (genProps(el.attrs)) + ","; 45648 } 45649 // DOM props 45650 if (el.props) { 45651 data += "domProps:" + (genProps(el.props)) + ","; 45652 } 45653 // event handlers 45654 if (el.events) { 45655 data += (genHandlers(el.events, false)) + ","; 45656 } 45657 if (el.nativeEvents) { 45658 data += (genHandlers(el.nativeEvents, true)) + ","; 45659 } 45660 // slot target 45661 // only for non-scoped slots 45662 if (el.slotTarget && !el.slotScope) { 45663 data += "slot:" + (el.slotTarget) + ","; 45664 } 45665 // scoped slots 45666 if (el.scopedSlots) { 45667 data += (genScopedSlots(el, el.scopedSlots, state)) + ","; 45668 } 45669 // component v-model 45670 if (el.model) { 45671 data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; 45672 } 45673 // inline-template 45674 if (el.inlineTemplate) { 45675 var inlineTemplate = genInlineTemplate(el, state); 45676 if (inlineTemplate) { 45677 data += inlineTemplate + ","; 45678 } 45679 } 45680 data = data.replace(/,$/, '') + '}'; 45681 // v-bind dynamic argument wrap 45682 // v-bind with dynamic arguments must be applied using the same v-bind object 45683 // merge helper so that class/style/mustUseProp attrs are handled correctly. 45684 if (el.dynamicAttrs) { 45685 data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")"; 45686 } 45687 // v-bind data wrap 45688 if (el.wrapData) { 45689 data = el.wrapData(data); 45690 } 45691 // v-on data wrap 45692 if (el.wrapListeners) { 45693 data = el.wrapListeners(data); 45694 } 45695 return data 45696} 45697 45698function genDirectives (el, state) { 45699 var dirs = el.directives; 45700 if (!dirs) { return } 45701 var res = 'directives:['; 45702 var hasRuntime = false; 45703 var i, l, dir, needRuntime; 45704 for (i = 0, l = dirs.length; i < l; i++) { 45705 dir = dirs[i]; 45706 needRuntime = true; 45707 var gen = state.directives[dir.name]; 45708 if (gen) { 45709 // compile-time directive that manipulates AST. 45710 // returns true if it also needs a runtime counterpart. 45711 needRuntime = !!gen(el, dir, state.warn); 45712 } 45713 if (needRuntime) { 45714 hasRuntime = true; 45715 res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; 45716 } 45717 } 45718 if (hasRuntime) { 45719 return res.slice(0, -1) + ']' 45720 } 45721} 45722 45723function genInlineTemplate (el, state) { 45724 var ast = el.children[0]; 45725 if ( true && ( 45726 el.children.length !== 1 || ast.type !== 1 45727 )) { 45728 state.warn( 45729 'Inline-template components must have exactly one child element.', 45730 { start: el.start } 45731 ); 45732 } 45733 if (ast && ast.type === 1) { 45734 var inlineRenderFns = generate(ast, state.options); 45735 return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") 45736 } 45737} 45738 45739function genScopedSlots ( 45740 el, 45741 slots, 45742 state 45743) { 45744 // by default scoped slots are considered "stable", this allows child 45745 // components with only scoped slots to skip forced updates from parent. 45746 // but in some cases we have to bail-out of this optimization 45747 // for example if the slot contains dynamic names, has v-if or v-for on them... 45748 var needsForceUpdate = el.for || Object.keys(slots).some(function (key) { 45749 var slot = slots[key]; 45750 return ( 45751 slot.slotTargetDynamic || 45752 slot.if || 45753 slot.for || 45754 containsSlotChild(slot) // is passing down slot from parent which may be dynamic 45755 ) 45756 }); 45757 45758 // #9534: if a component with scoped slots is inside a conditional branch, 45759 // it's possible for the same component to be reused but with different 45760 // compiled slot content. To avoid that, we generate a unique key based on 45761 // the generated code of all the slot contents. 45762 var needsKey = !!el.if; 45763 45764 // OR when it is inside another scoped slot or v-for (the reactivity may be 45765 // disconnected due to the intermediate scope variable) 45766 // #9438, #9506 45767 // TODO: this can be further optimized by properly analyzing in-scope bindings 45768 // and skip force updating ones that do not actually use scope variables. 45769 if (!needsForceUpdate) { 45770 var parent = el.parent; 45771 while (parent) { 45772 if ( 45773 (parent.slotScope && parent.slotScope !== emptySlotScopeToken) || 45774 parent.for 45775 ) { 45776 needsForceUpdate = true; 45777 break 45778 } 45779 if (parent.if) { 45780 needsKey = true; 45781 } 45782 parent = parent.parent; 45783 } 45784 } 45785 45786 var generatedSlots = Object.keys(slots) 45787 .map(function (key) { return genScopedSlot(slots[key], state); }) 45788 .join(','); 45789 45790 return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")") 45791} 45792 45793function hash(str) { 45794 var hash = 5381; 45795 var i = str.length; 45796 while(i) { 45797 hash = (hash * 33) ^ str.charCodeAt(--i); 45798 } 45799 return hash >>> 0 45800} 45801 45802function containsSlotChild (el) { 45803 if (el.type === 1) { 45804 if (el.tag === 'slot') { 45805 return true 45806 } 45807 return el.children.some(containsSlotChild) 45808 } 45809 return false 45810} 45811 45812function genScopedSlot ( 45813 el, 45814 state 45815) { 45816 var isLegacySyntax = el.attrsMap['slot-scope']; 45817 if (el.if && !el.ifProcessed && !isLegacySyntax) { 45818 return genIf(el, state, genScopedSlot, "null") 45819 } 45820 if (el.for && !el.forProcessed) { 45821 return genFor(el, state, genScopedSlot) 45822 } 45823 var slotScope = el.slotScope === emptySlotScopeToken 45824 ? "" 45825 : String(el.slotScope); 45826 var fn = "function(" + slotScope + "){" + 45827 "return " + (el.tag === 'template' 45828 ? el.if && isLegacySyntax 45829 ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") 45830 : genChildren(el, state) || 'undefined' 45831 : genElement(el, state)) + "}"; 45832 // reverse proxy v-slot without scope on this.$slots 45833 var reverseProxy = slotScope ? "" : ",proxy:true"; 45834 return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}") 45835} 45836 45837function genChildren ( 45838 el, 45839 state, 45840 checkSkip, 45841 altGenElement, 45842 altGenNode 45843) { 45844 var children = el.children; 45845 if (children.length) { 45846 var el$1 = children[0]; 45847 // optimize single v-for 45848 if (children.length === 1 && 45849 el$1.for && 45850 el$1.tag !== 'template' && 45851 el$1.tag !== 'slot' 45852 ) { 45853 var normalizationType = checkSkip 45854 ? state.maybeComponent(el$1) ? ",1" : ",0" 45855 : ""; 45856 return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType) 45857 } 45858 var normalizationType$1 = checkSkip 45859 ? getNormalizationType(children, state.maybeComponent) 45860 : 0; 45861 var gen = altGenNode || genNode; 45862 return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : '')) 45863 } 45864} 45865 45866// determine the normalization needed for the children array. 45867// 0: no normalization needed 45868// 1: simple normalization needed (possible 1-level deep nested array) 45869// 2: full normalization needed 45870function getNormalizationType ( 45871 children, 45872 maybeComponent 45873) { 45874 var res = 0; 45875 for (var i = 0; i < children.length; i++) { 45876 var el = children[i]; 45877 if (el.type !== 1) { 45878 continue 45879 } 45880 if (needsNormalization(el) || 45881 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { 45882 res = 2; 45883 break 45884 } 45885 if (maybeComponent(el) || 45886 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { 45887 res = 1; 45888 } 45889 } 45890 return res 45891} 45892 45893function needsNormalization (el) { 45894 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' 45895} 45896 45897function genNode (node, state) { 45898 if (node.type === 1) { 45899 return genElement(node, state) 45900 } else if (node.type === 3 && node.isComment) { 45901 return genComment(node) 45902 } else { 45903 return genText(node) 45904 } 45905} 45906 45907function genText (text) { 45908 return ("_v(" + (text.type === 2 45909 ? text.expression // no need for () because already wrapped in _s() 45910 : transformSpecialNewlines(JSON.stringify(text.text))) + ")") 45911} 45912 45913function genComment (comment) { 45914 return ("_e(" + (JSON.stringify(comment.text)) + ")") 45915} 45916 45917function genSlot (el, state) { 45918 var slotName = el.slotName || '"default"'; 45919 var children = genChildren(el, state); 45920 var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : ''); 45921 var attrs = el.attrs || el.dynamicAttrs 45922 ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({ 45923 // slot props are camelized 45924 name: camelize(attr.name), 45925 value: attr.value, 45926 dynamic: attr.dynamic 45927 }); })) 45928 : null; 45929 var bind$$1 = el.attrsMap['v-bind']; 45930 if ((attrs || bind$$1) && !children) { 45931 res += ",null"; 45932 } 45933 if (attrs) { 45934 res += "," + attrs; 45935 } 45936 if (bind$$1) { 45937 res += (attrs ? '' : ',null') + "," + bind$$1; 45938 } 45939 return res + ')' 45940} 45941 45942// componentName is el.component, take it as argument to shun flow's pessimistic refinement 45943function genComponent ( 45944 componentName, 45945 el, 45946 state 45947) { 45948 var children = el.inlineTemplate ? null : genChildren(el, state, true); 45949 return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") 45950} 45951 45952function genProps (props) { 45953 var staticProps = ""; 45954 var dynamicProps = ""; 45955 for (var i = 0; i < props.length; i++) { 45956 var prop = props[i]; 45957 var value = transformSpecialNewlines(prop.value); 45958 if (prop.dynamic) { 45959 dynamicProps += (prop.name) + "," + value + ","; 45960 } else { 45961 staticProps += "\"" + (prop.name) + "\":" + value + ","; 45962 } 45963 } 45964 staticProps = "{" + (staticProps.slice(0, -1)) + "}"; 45965 if (dynamicProps) { 45966 return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])") 45967 } else { 45968 return staticProps 45969 } 45970} 45971 45972// #3895, #4268 45973function transformSpecialNewlines (text) { 45974 return text 45975 .replace(/\u2028/g, '\\u2028') 45976 .replace(/\u2029/g, '\\u2029') 45977} 45978 45979/* */ 45980 45981 45982 45983// these keywords should not appear inside expressions, but operators like 45984// typeof, instanceof and in are allowed 45985var prohibitedKeywordRE = new RegExp('\\b' + ( 45986 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 45987 'super,throw,while,yield,delete,export,import,return,switch,default,' + 45988 'extends,finally,continue,debugger,function,arguments' 45989).split(',').join('\\b|\\b') + '\\b'); 45990 45991// these unary operators should not be used as property/method names 45992var unaryOperatorsRE = new RegExp('\\b' + ( 45993 'delete,typeof,void' 45994).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); 45995 45996// strip strings in expressions 45997var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 45998 45999// detect problematic expressions in a template 46000function detectErrors (ast, warn) { 46001 if (ast) { 46002 checkNode(ast, warn); 46003 } 46004} 46005 46006function checkNode (node, warn) { 46007 if (node.type === 1) { 46008 for (var name in node.attrsMap) { 46009 if (dirRE.test(name)) { 46010 var value = node.attrsMap[name]; 46011 if (value) { 46012 var range = node.rawAttrsMap[name]; 46013 if (name === 'v-for') { 46014 checkFor(node, ("v-for=\"" + value + "\""), warn, range); 46015 } else if (name === 'v-slot' || name[0] === '#') { 46016 checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range); 46017 } else if (onRE.test(name)) { 46018 checkEvent(value, (name + "=\"" + value + "\""), warn, range); 46019 } else { 46020 checkExpression(value, (name + "=\"" + value + "\""), warn, range); 46021 } 46022 } 46023 } 46024 } 46025 if (node.children) { 46026 for (var i = 0; i < node.children.length; i++) { 46027 checkNode(node.children[i], warn); 46028 } 46029 } 46030 } else if (node.type === 2) { 46031 checkExpression(node.expression, node.text, warn, node); 46032 } 46033} 46034 46035function checkEvent (exp, text, warn, range) { 46036 var stripped = exp.replace(stripStringRE, ''); 46037 var keywordMatch = stripped.match(unaryOperatorsRE); 46038 if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') { 46039 warn( 46040 "avoid using JavaScript unary operator as property name: " + 46041 "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), 46042 range 46043 ); 46044 } 46045 checkExpression(exp, text, warn, range); 46046} 46047 46048function checkFor (node, text, warn, range) { 46049 checkExpression(node.for || '', text, warn, range); 46050 checkIdentifier(node.alias, 'v-for alias', text, warn, range); 46051 checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range); 46052 checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range); 46053} 46054 46055function checkIdentifier ( 46056 ident, 46057 type, 46058 text, 46059 warn, 46060 range 46061) { 46062 if (typeof ident === 'string') { 46063 try { 46064 new Function(("var " + ident + "=_")); 46065 } catch (e) { 46066 warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range); 46067 } 46068 } 46069} 46070 46071function checkExpression (exp, text, warn, range) { 46072 try { 46073 new Function(("return " + exp)); 46074 } catch (e) { 46075 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); 46076 if (keywordMatch) { 46077 warn( 46078 "avoid using JavaScript keyword as property name: " + 46079 "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()), 46080 range 46081 ); 46082 } else { 46083 warn( 46084 "invalid expression: " + (e.message) + " in\n\n" + 46085 " " + exp + "\n\n" + 46086 " Raw expression: " + (text.trim()) + "\n", 46087 range 46088 ); 46089 } 46090 } 46091} 46092 46093function checkFunctionParameterExpression (exp, text, warn, range) { 46094 try { 46095 new Function(exp, ''); 46096 } catch (e) { 46097 warn( 46098 "invalid function parameter expression: " + (e.message) + " in\n\n" + 46099 " " + exp + "\n\n" + 46100 " Raw expression: " + (text.trim()) + "\n", 46101 range 46102 ); 46103 } 46104} 46105 46106/* */ 46107 46108var range = 2; 46109 46110function generateCodeFrame ( 46111 source, 46112 start, 46113 end 46114) { 46115 if ( start === void 0 ) start = 0; 46116 if ( end === void 0 ) end = source.length; 46117 46118 var lines = source.split(/\r?\n/); 46119 var count = 0; 46120 var res = []; 46121 for (var i = 0; i < lines.length; i++) { 46122 count += lines[i].length + 1; 46123 if (count >= start) { 46124 for (var j = i - range; j <= i + range || end > count; j++) { 46125 if (j < 0 || j >= lines.length) { continue } 46126 res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j]))); 46127 var lineLength = lines[j].length; 46128 if (j === i) { 46129 // push underline 46130 var pad = start - (count - lineLength) + 1; 46131 var length = end > count ? lineLength - pad : end - start; 46132 res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length)); 46133 } else if (j > i) { 46134 if (end > count) { 46135 var length$1 = Math.min(end - count, lineLength); 46136 res.push(" | " + repeat$1("^", length$1)); 46137 } 46138 count += lineLength + 1; 46139 } 46140 } 46141 break 46142 } 46143 } 46144 return res.join('\n') 46145} 46146 46147function repeat$1 (str, n) { 46148 var result = ''; 46149 if (n > 0) { 46150 while (true) { // eslint-disable-line 46151 if (n & 1) { result += str; } 46152 n >>>= 1; 46153 if (n <= 0) { break } 46154 str += str; 46155 } 46156 } 46157 return result 46158} 46159 46160/* */ 46161 46162 46163 46164function createFunction (code, errors) { 46165 try { 46166 return new Function(code) 46167 } catch (err) { 46168 errors.push({ err: err, code: code }); 46169 return noop 46170 } 46171} 46172 46173function createCompileToFunctionFn (compile) { 46174 var cache = Object.create(null); 46175 46176 return function compileToFunctions ( 46177 template, 46178 options, 46179 vm 46180 ) { 46181 options = extend({}, options); 46182 var warn$$1 = options.warn || warn; 46183 delete options.warn; 46184 46185 /* istanbul ignore if */ 46186 if (true) { 46187 // detect possible CSP restriction 46188 try { 46189 new Function('return 1'); 46190 } catch (e) { 46191 if (e.toString().match(/unsafe-eval|CSP/)) { 46192 warn$$1( 46193 'It seems you are using the standalone build of Vue.js in an ' + 46194 'environment with Content Security Policy that prohibits unsafe-eval. ' + 46195 'The template compiler cannot work in this environment. Consider ' + 46196 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 46197 'templates into render functions.' 46198 ); 46199 } 46200 } 46201 } 46202 46203 // check cache 46204 var key = options.delimiters 46205 ? String(options.delimiters) + template 46206 : template; 46207 if (cache[key]) { 46208 return cache[key] 46209 } 46210 46211 // compile 46212 var compiled = compile(template, options); 46213 46214 // check compilation errors/tips 46215 if (true) { 46216 if (compiled.errors && compiled.errors.length) { 46217 if (options.outputSourceRange) { 46218 compiled.errors.forEach(function (e) { 46219 warn$$1( 46220 "Error compiling template:\n\n" + (e.msg) + "\n\n" + 46221 generateCodeFrame(template, e.start, e.end), 46222 vm 46223 ); 46224 }); 46225 } else { 46226 warn$$1( 46227 "Error compiling template:\n\n" + template + "\n\n" + 46228 compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', 46229 vm 46230 ); 46231 } 46232 } 46233 if (compiled.tips && compiled.tips.length) { 46234 if (options.outputSourceRange) { 46235 compiled.tips.forEach(function (e) { return tip(e.msg, vm); }); 46236 } else { 46237 compiled.tips.forEach(function (msg) { return tip(msg, vm); }); 46238 } 46239 } 46240 } 46241 46242 // turn code into functions 46243 var res = {}; 46244 var fnGenErrors = []; 46245 res.render = createFunction(compiled.render, fnGenErrors); 46246 res.staticRenderFns = compiled.staticRenderFns.map(function (code) { 46247 return createFunction(code, fnGenErrors) 46248 }); 46249 46250 // check function generation errors. 46251 // this should only happen if there is a bug in the compiler itself. 46252 // mostly for codegen development use 46253 /* istanbul ignore if */ 46254 if (true) { 46255 if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { 46256 warn$$1( 46257 "Failed to generate render function:\n\n" + 46258 fnGenErrors.map(function (ref) { 46259 var err = ref.err; 46260 var code = ref.code; 46261 46262 return ((err.toString()) + " in\n\n" + code + "\n"); 46263 }).join('\n'), 46264 vm 46265 ); 46266 } 46267 } 46268 46269 return (cache[key] = res) 46270 } 46271} 46272 46273/* */ 46274 46275function createCompilerCreator (baseCompile) { 46276 return function createCompiler (baseOptions) { 46277 function compile ( 46278 template, 46279 options 46280 ) { 46281 var finalOptions = Object.create(baseOptions); 46282 var errors = []; 46283 var tips = []; 46284 46285 var warn = function (msg, range, tip) { 46286 (tip ? tips : errors).push(msg); 46287 }; 46288 46289 if (options) { 46290 if ( true && options.outputSourceRange) { 46291 // $flow-disable-line 46292 var leadingSpaceLength = template.match(/^\s*/)[0].length; 46293 46294 warn = function (msg, range, tip) { 46295 var data = { msg: msg }; 46296 if (range) { 46297 if (range.start != null) { 46298 data.start = range.start + leadingSpaceLength; 46299 } 46300 if (range.end != null) { 46301 data.end = range.end + leadingSpaceLength; 46302 } 46303 } 46304 (tip ? tips : errors).push(data); 46305 }; 46306 } 46307 // merge custom modules 46308 if (options.modules) { 46309 finalOptions.modules = 46310 (baseOptions.modules || []).concat(options.modules); 46311 } 46312 // merge custom directives 46313 if (options.directives) { 46314 finalOptions.directives = extend( 46315 Object.create(baseOptions.directives || null), 46316 options.directives 46317 ); 46318 } 46319 // copy other options 46320 for (var key in options) { 46321 if (key !== 'modules' && key !== 'directives') { 46322 finalOptions[key] = options[key]; 46323 } 46324 } 46325 } 46326 46327 finalOptions.warn = warn; 46328 46329 var compiled = baseCompile(template.trim(), finalOptions); 46330 if (true) { 46331 detectErrors(compiled.ast, warn); 46332 } 46333 compiled.errors = errors; 46334 compiled.tips = tips; 46335 return compiled 46336 } 46337 46338 return { 46339 compile: compile, 46340 compileToFunctions: createCompileToFunctionFn(compile) 46341 } 46342 } 46343} 46344 46345/* */ 46346 46347// `createCompilerCreator` allows creating compilers that use alternative 46348// parser/optimizer/codegen, e.g the SSR optimizing compiler. 46349// Here we just export a default compiler using the default parts. 46350var createCompiler = createCompilerCreator(function baseCompile ( 46351 template, 46352 options 46353) { 46354 var ast = parse(template.trim(), options); 46355 if (options.optimize !== false) { 46356 optimize(ast, options); 46357 } 46358 var code = generate(ast, options); 46359 return { 46360 ast: ast, 46361 render: code.render, 46362 staticRenderFns: code.staticRenderFns 46363 } 46364}); 46365 46366/* */ 46367 46368var ref$1 = createCompiler(baseOptions); 46369var compile = ref$1.compile; 46370var compileToFunctions = ref$1.compileToFunctions; 46371 46372/* */ 46373 46374// check whether current browser encodes a char inside attribute values 46375var div; 46376function getShouldDecode (href) { 46377 div = div || document.createElement('div'); 46378 div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; 46379 return div.innerHTML.indexOf(' ') > 0 46380} 46381 46382// #3663: IE encodes newlines inside attribute values while other browsers don't 46383var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false; 46384// #6828: chrome encodes content in a[href] 46385var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false; 46386 46387/* */ 46388 46389var idToTemplate = cached(function (id) { 46390 var el = query(id); 46391 return el && el.innerHTML 46392}); 46393 46394var mount = Vue.prototype.$mount; 46395Vue.prototype.$mount = function ( 46396 el, 46397 hydrating 46398) { 46399 el = el && query(el); 46400 46401 /* istanbul ignore if */ 46402 if (el === document.body || el === document.documentElement) { 46403 true && warn( 46404 "Do not mount Vue to <html> or <body> - mount to normal elements instead." 46405 ); 46406 return this 46407 } 46408 46409 var options = this.$options; 46410 // resolve template/el and convert to render function 46411 if (!options.render) { 46412 var template = options.template; 46413 if (template) { 46414 if (typeof template === 'string') { 46415 if (template.charAt(0) === '#') { 46416 template = idToTemplate(template); 46417 /* istanbul ignore if */ 46418 if ( true && !template) { 46419 warn( 46420 ("Template element not found or is empty: " + (options.template)), 46421 this 46422 ); 46423 } 46424 } 46425 } else if (template.nodeType) { 46426 template = template.innerHTML; 46427 } else { 46428 if (true) { 46429 warn('invalid template option:' + template, this); 46430 } 46431 return this 46432 } 46433 } else if (el) { 46434 template = getOuterHTML(el); 46435 } 46436 if (template) { 46437 /* istanbul ignore if */ 46438 if ( true && config.performance && mark) { 46439 mark('compile'); 46440 } 46441 46442 var ref = compileToFunctions(template, { 46443 outputSourceRange: "development" !== 'production', 46444 shouldDecodeNewlines: shouldDecodeNewlines, 46445 shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, 46446 delimiters: options.delimiters, 46447 comments: options.comments 46448 }, this); 46449 var render = ref.render; 46450 var staticRenderFns = ref.staticRenderFns; 46451 options.render = render; 46452 options.staticRenderFns = staticRenderFns; 46453 46454 /* istanbul ignore if */ 46455 if ( true && config.performance && mark) { 46456 mark('compile end'); 46457 measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); 46458 } 46459 } 46460 } 46461 return mount.call(this, el, hydrating) 46462}; 46463 46464/** 46465 * Get outerHTML of elements, taking care 46466 * of SVG elements in IE as well. 46467 */ 46468function getOuterHTML (el) { 46469 if (el.outerHTML) { 46470 return el.outerHTML 46471 } else { 46472 var container = document.createElement('div'); 46473 container.appendChild(el.cloneNode(true)); 46474 return container.innerHTML 46475 } 46476} 46477 46478Vue.compile = compileToFunctions; 46479 46480/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Vue); 46481 46482 46483/***/ })
vendor: 7,719 bytes, lines 46483-46675
46483 46484 46485/******/ }); 46486/************************************************************************/ 46487/******/ // The module cache 46488/******/ var __webpack_module_cache__ = {}; 46489/******/ 46490/******/ // The require function 46491/******/ function __webpack_require__(moduleId) { 46492/******/ // Check if module is in cache 46493/******/ var cachedModule = __webpack_module_cache__[moduleId]; 46494/******/ if (cachedModule !== undefined) { 46495/******/ return cachedModule.exports; 46496/******/ } 46497/******/ // Create a new module (and put it into the cache) 46498/******/ var module = __webpack_module_cache__[moduleId] = { 46499/******/ id: moduleId, 46500/******/ loaded: false, 46501/******/ exports: {} 46502/******/ }; 46503/******/ 46504/******/ // Execute the module function 46505/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 46506/******/ 46507/******/ // Flag the module as loaded 46508/******/ module.loaded = true; 46509/******/ 46510/******/ // Return the exports of the module 46511/******/ return module.exports; 46512/******/ } 46513/******/ 46514/******/ // expose the modules object (__webpack_modules__) 46515/******/ __webpack_require__.m = __webpack_modules__; 46516/******/ 46517/************************************************************************/ 46518/******/ /* webpack/runtime/chunk loaded */ 46519/******/ (() => { 46520/******/ var deferred = []; 46521/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 46522/******/ if(chunkIds) { 46523/******/ priority = priority || 0; 46524/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 46525/******/ deferred[i] = [chunkIds, fn, priority]; 46526/******/ return; 46527/******/ } 46528/******/ var notFulfilled = Infinity; 46529/******/ for (var i = 0; i < deferred.length; i++) { 46530/******/ var [chunkIds, fn, priority] = deferred[i]; 46531/******/ var fulfilled = true; 46532/******/ for (var j = 0; j < chunkIds.length; j++) { 46533/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 46534/******/ chunkIds.splice(j--, 1); 46535/******/ } else { 46536/******/ fulfilled = false; 46537/******/ if(priority < notFulfilled) notFulfilled = priority; 46538/******/ } 46539/******/ } 46540/******/ if(fulfilled) { 46541/******/ deferred.splice(i--, 1) 46542/******/ var r = fn(); 46543/******/ if (r !== undefined) result = r; 46544/******/ } 46545/******/ } 46546/******/ return result; 46547/******/ }; 46548/******/ })(); 46549/******/ 46550/******/ /* webpack/runtime/compat get default export */ 46551/******/ (() => { 46552/******/ // getDefaultExport function for compatibility with non-harmony modules 46553/******/ __webpack_require__.n = (module) => { 46554/******/ var getter = module && module.__esModule ? 46555/******/ () => (module['default']) : 46556/******/ () => (module); 46557/******/ __webpack_require__.d(getter, { a: getter }); 46558/******/ return getter; 46559/******/ }; 46560/******/ })(); 46561/******/ 46562/******/ /* webpack/runtime/define property getters */ 46563/******/ (() => { 46564/******/ // define getter functions for harmony exports 46565/******/ __webpack_require__.d = (exports, definition) => { 46566/******/ for(var key in definition) { 46567/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 46568/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 46569/******/ } 46570/******/ } 46571/******/ }; 46572/******/ })(); 46573/******/ 46574/******/ /* webpack/runtime/global */ 46575/******/ (() => { 46576/******/ __webpack_require__.g = (function() { 46577/******/ if (typeof globalThis === 'object') return globalThis; 46578/******/ try { 46579/******/ return this || new Function('return this')(); 46580/******/ } catch (e) { 46581/******/ if (typeof window === 'object') return window; 46582/******/ } 46583/******/ })(); 46584/******/ })(); 46585/******/ 46586/******/ /* webpack/runtime/hasOwnProperty shorthand */ 46587/******/ (() => { 46588/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 46589/******/ })(); 46590/******/ 46591/******/ /* webpack/runtime/make namespace object */ 46592/******/ (() => { 46593/******/ // define __esModule on exports 46594/******/ __webpack_require__.r = (exports) => { 46595/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46596/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 46597/******/ } 46598/******/ Object.defineProperty(exports, '__esModule', { value: true }); 46599/******/ }; 46600/******/ })(); 46601/******/ 46602/******/ /* webpack/runtime/node module decorator */ 46603/******/ (() => { 46604/******/ __webpack_require__.nmd = (module) => { 46605/******/ module.paths = []; 46606/******/ if (!module.children) module.children = []; 46607/******/ return module; 46608/******/ }; 46609/******/ })(); 46610/******/ 46611/******/ /* webpack/runtime/jsonp chunk loading */ 46612/******/ (() => { 46613/******/ // no baseURI 46614/******/ 46615/******/ // object to store loaded and loading chunks 46616/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 46617/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 46618/******/ var installedChunks = { 46619/******/ "/assets/js/app": 0, 46620/******/ "assets/css/main": 0 46621/******/ }; 46622/******/ 46623/******/ // no chunk on demand loading 46624/******/ 46625/******/ // no prefetching 46626/******/ 46627/******/ // no preloaded 46628/******/ 46629/******/ // no HMR 46630/******/ 46631/******/ // no HMR manifest 46632/******/ 46633/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 46634/******/ 46635/******/ // install a JSONP callback for chunk loading 46636/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 46637/******/ var [chunkIds, moreModules, runtime] = data; 46638/******/ // add "moreModules" to the modules object, 46639/******/ // then flag all "chunkIds" as loaded and fire callback 46640/******/ var moduleId, chunkId, i = 0; 46641/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 46642/******/ for(moduleId in moreModules) { 46643/******/ if(__webpack_require__.o(moreModules, moduleId)) { 46644/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 46645/******/ } 46646/******/ } 46647/******/ if(runtime) var result = runtime(__webpack_require__); 46648/******/ } 46649/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 46650/******/ for(;i < chunkIds.length; i++) { 46651/******/ chunkId = chunkIds[i]; 46652/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 46653/******/ installedChunks[chunkId][0](); 46654/******/ } 46655/******/ installedChunks[chunkId] = 0; 46656/******/ } 46657/******/ return __webpack_require__.O(result); 46658/******/ } 46659/******/ 46660/******/ var chunkLoadingGlobal = self["webpackChunkenormail_website"] = self["webpackChunkenormail_website"] || []; 46661/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 46662/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 46663/******/ })(); 46664/******/ 46665/************************************************************************/ 46666/******/ 46667/******/ // startup 46668/******/ // Load entry module and return exports 46669/******/ // This entry module depends on other loaded chunks and execution need to be delayed 46670/******/ __webpack_require__.O(undefined, ["assets/css/main"], () => (__webpack_require__("./user/themes/enormail/js/app.js"))) 46671/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["assets/css/main"], () => (__webpack_require__("./user/themes/enormail/scss/main.scss"))) 46672/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 46673/******/ 46674/******/ })() 46675;
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.