1(self["webpackChunkwebpack_test"] = self["webpackChunkwebpack_test"] || []).push([["vendor"],{ 2
vendor: 4,636 bytes, lines 3-144
3/***/ "./node_modules/axios/lib/adapters/adapters.js": 4/*!*****************************************************!*\ 5 !*** ./node_modules/axios/lib/adapters/adapters.js ***! 6 \*****************************************************/ 7/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 8 9"use strict"; 10/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 11/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); 12/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); 13/* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fetch.js */ "./node_modules/axios/lib/adapters/fetch.js"); 14/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 15 16 17 18 19 20 21/** 22 * Known adapters mapping. 23 * Provides environment-specific adapters for Axios: 24 * - `http` for Node.js 25 * - `xhr` for browsers 26 * - `fetch` for fetch API-based requests 27 * 28 * @type {Object<string, Function|Object>} 29 */ 30const knownAdapters = { 31 http: _http_js__WEBPACK_IMPORTED_MODULE_1__["default"], 32 xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_2__["default"], 33 fetch: { 34 get: _fetch_js__WEBPACK_IMPORTED_MODULE_3__.getFetch, 35 } 36}; 37 38// Assign adapter names for easier debugging and identification 39_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(knownAdapters, (fn, value) => { 40 if (fn) { 41 try { 42 Object.defineProperty(fn, 'name', { value }); 43 } catch (e) { 44 // eslint-disable-next-line no-empty 45 } 46 Object.defineProperty(fn, 'adapterName', { value }); 47 } 48}); 49 50/** 51 * Render a rejection reason string for unknown or unsupported adapters 52 * 53 * @param {string} reason 54 * @returns {string} 55 */ 56const renderReason = (reason) => `- ${reason}`; 57 58/** 59 * Check if the adapter is resolved (function, null, or false) 60 * 61 * @param {Function|null|false} adapter 62 * @returns {boolean} 63 */ 64const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(adapter) || adapter === null || adapter === false; 65 66/** 67 * Get the first suitable adapter from the provided list. 68 * Tries each adapter in order until a supported one is found. 69 * Throws an AxiosError if no adapter is suitable. 70 * 71 * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function. 72 * @param {Object} config - Axios request configuration 73 * @throws {AxiosError} If no suitable adapter is available 74 * @returns {Function} The resolved adapter function 75 */ 76function getAdapter(adapters, config) { 77 adapters = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(adapters) ? adapters : [adapters]; 78 79 const { length } = adapters; 80 let nameOrAdapter; 81 let adapter; 82 83 const rejectedReasons = {}; 84 85 for (let i = 0; i < length; i++) { 86 nameOrAdapter = adapters[i]; 87 let id; 88 89 adapter = nameOrAdapter; 90 91 if (!isResolvedHandle(nameOrAdapter)) { 92 adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; 93 94 if (adapter === undefined) { 95 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"](`Unknown adapter '${id}'`); 96 } 97 } 98 99 if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(adapter) || (adapter = adapter.get(config)))) { 100 break; 101 } 102 103 rejectedReasons[id || '#' + i] = adapter; 104 } 105 106 if (!adapter) { 107 const reasons = Object.entries(rejectedReasons) 108 .map(([id, state]) => `adapter ${id} ` + 109 (state === false ? 'is not supported by the environment' : 'is not available in the build') 110 ); 111 112 let s = length ? 113 (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : 114 'as no adapter specified'; 115 116 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__["default"]( 117 `There is no suitable adapter to dispatch the request ` + s, 118 'ERR_NOT_SUPPORT' 119 ); 120 } 121 122 return adapter; 123} 124 125/** 126 * Exports Axios adapters and utility to resolve an adapter 127 */ 128/* harmony default export */ __webpack_exports__["default"] = ({ 129 /** 130 * Resolve an adapter from a list of adapter names or functions. 131 * @type {Function} 132 */ 133 getAdapter, 134 135 /** 136 * Exposes all known adapters 137 * @type {Object<string, Function|Object>} 138 */ 139 adapters: knownAdapters 140}); 141 142 143/***/ }), 144
vendor: 11,612 bytes, lines 145-455
145/***/ "./node_modules/axios/lib/adapters/fetch.js": 146/*!**************************************************!*\ 147 !*** ./node_modules/axios/lib/adapters/fetch.js ***! 148 \**************************************************/ 149/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 150 151"use strict"; 152/* harmony export */ __webpack_require__.d(__webpack_exports__, { 153/* harmony export */ getFetch: function() { return /* binding */ getFetch; } 154/* harmony export */ }); 155/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 156/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 157/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 158/* harmony import */ var _helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/composeSignals.js */ "./node_modules/axios/lib/helpers/composeSignals.js"); 159/* harmony import */ var _helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/trackStream.js */ "./node_modules/axios/lib/helpers/trackStream.js"); 160/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 161/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js"); 162/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js"); 163/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); 164 165 166 167 168 169 170 171 172 173 174const DEFAULT_CHUNK_SIZE = 64 * 1024; 175 176const {isFunction} = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"]; 177 178const globalFetchAPI = (({Request, Response}) => ({ 179 Request, Response 180}))(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global); 181 182const { 183 ReadableStream, TextEncoder 184} = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].global; 185 186 187const test = (fn, ...args) => { 188 try { 189 return !!fn(...args); 190 } catch (e) { 191 return false 192 } 193} 194 195const factory = (env) => { 196 env = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({ 197 skipUndefined: true 198 }, globalFetchAPI, env); 199 200 const {fetch: envFetch, Request, Response} = env; 201 const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; 202 const isRequestSupported = isFunction(Request); 203 const isResponseSupported = isFunction(Response); 204 205 if (!isFetchSupported) { 206 return false; 207 } 208 209 const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); 210 211 const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? 212 ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : 213 async (str) => new Uint8Array(await new Request(str).arrayBuffer()) 214 ); 215 216 const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { 217 let duplexAccessed = false; 218 219 const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, { 220 body: new ReadableStream(), 221 method: 'POST', 222 get duplex() { 223 duplexAccessed = true; 224 return 'half'; 225 }, 226 }).headers.has('Content-Type'); 227 228 return duplexAccessed && !hasContentType; 229 }); 230 231 const supportsResponseStream = isResponseSupported && isReadableStreamSupported && 232 test(() => _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isReadableStream(new Response('').body)); 233 234 const resolvers = { 235 stream: supportsResponseStream && ((res) => res.body) 236 }; 237 238 isFetchSupported && ((() => { 239 ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { 240 !resolvers[type] && (resolvers[type] = (res, config) => { 241 let method = res && res[type]; 242 243 if (method) { 244 return method.call(res); 245 } 246 247 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"](`Response type '${type}' is not supported`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NOT_SUPPORT, config); 248 }) 249 }); 250 })()); 251 252 const getBodyLength = async (body) => { 253 if (body == null) { 254 return 0; 255 } 256 257 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isBlob(body)) { 258 return body.size; 259 } 260 261 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isSpecCompliantForm(body)) { 262 const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin, { 263 method: 'POST', 264 body, 265 }); 266 return (await _request.arrayBuffer()).byteLength; 267 } 268 269 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArrayBuffer(body)) { 270 return body.byteLength; 271 } 272 273 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isURLSearchParams(body)) { 274 body = body + ''; 275 } 276 277 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(body)) { 278 return (await encodeText(body)).byteLength; 279 } 280 } 281 282 const resolveBodyLength = async (headers, body) => { 283 const length = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(headers.getContentLength()); 284 285 return length == null ? getBodyLength(body) : length; 286 } 287 288 return async (config) => { 289 let { 290 url, 291 method, 292 data, 293 signal, 294 cancelToken, 295 timeout, 296 onDownloadProgress, 297 onUploadProgress, 298 responseType, 299 headers, 300 withCredentials = 'same-origin', 301 fetchOptions 302 } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__["default"])(config); 303 304 let _fetch = envFetch || fetch; 305 306 responseType = responseType ? (responseType + '').toLowerCase() : 'text'; 307 308 let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_3__["default"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout); 309 310 let request = null; 311 312 const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { 313 composedSignal.unsubscribe(); 314 }); 315 316 let requestContentLength; 317 318 try { 319 if ( 320 onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && 321 (requestContentLength = await resolveBodyLength(headers, data)) !== 0 322 ) { 323 let _request = new Request(url, { 324 method: 'POST', 325 body: data, 326 duplex: "half" 327 }); 328 329 let contentTypeHeader; 330 331 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { 332 headers.setContentType(contentTypeHeader) 333 } 334 335 if (_request.body) { 336 const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventDecorator)( 337 requestContentLength, 338 (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.asyncDecorator)(onUploadProgress)) 339 ); 340 341 data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); 342 } 343 } 344 345 if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(withCredentials)) { 346 withCredentials = withCredentials ? 'include' : 'omit'; 347 } 348 349 // Cloudflare Workers throws when credentials are defined 350 // see https://github.com/cloudflare/workerd/issues/902 351 const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; 352 353 const resolvedOptions = { 354 ...fetchOptions, 355 signal: composedSignal, 356 method: method.toUpperCase(), 357 headers: headers.normalize().toJSON(), 358 body: data, 359 duplex: "half", 360 credentials: isCredentialsSupported ? withCredentials : undefined 361 }; 362 363 request = isRequestSupported && new Request(url, resolvedOptions); 364 365 let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); 366 367 const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); 368 369 if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { 370 const options = {}; 371 372 ['status', 'statusText', 'headers'].forEach(prop => { 373 options[prop] = response[prop]; 374 }); 375 376 const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].toFiniteNumber(response.headers.get('content-length')); 377 378 const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventDecorator)( 379 responseContentLength, 380 (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.asyncDecorator)(onDownloadProgress), true) 381 ) || []; 382 383 response = new Response( 384 (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_4__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { 385 flush && flush(); 386 unsubscribe && unsubscribe(); 387 }), 388 options 389 ); 390 } 391 392 responseType = responseType || 'text'; 393 394 let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].findKey(resolvers, responseType) || 'text'](response, config); 395 396 !isStreamResponse && unsubscribe && unsubscribe(); 397 398 return await new Promise((resolve, reject) => { 399 (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_8__["default"])(resolve, reject, { 400 data: responseData, 401 headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_5__["default"].from(response.headers), 402 status: response.status, 403 statusText: response.statusText, 404 config, 405 request 406 }) 407 }) 408 } catch (err) { 409 unsubscribe && unsubscribe(); 410 411 if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { 412 throw Object.assign( 413 new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].ERR_NETWORK, config, request), 414 { 415 cause: err.cause || err 416 } 417 ) 418 } 419 420 throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(err, err && err.code, config, request); 421 } 422 } 423} 424 425const seedCache = new Map(); 426 427const getFetch = (config) => { 428 let env = (config && config.env) || {}; 429 const {fetch, Request, Response} = env; 430 const seeds = [ 431 Request, Response, fetch 432 ]; 433 434 let len = seeds.length, i = len, 435 seed, target, map = seedCache; 436 437 while (i--) { 438 seed = seeds[i]; 439 target = map.get(seed); 440 441 target === undefined && map.set(seed, target = (i ? new Map() : factory(env))) 442 443 map = target; 444 } 445 446 return target; 447}; 448 449const adapter = getFetch(); 450 451/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (adapter); 452 453 454/***/ }), 455
vendor: 9,625 bytes, lines 456-676
456/***/ "./node_modules/axios/lib/adapters/xhr.js": 457/*!************************************************!*\ 458 !*** ./node_modules/axios/lib/adapters/xhr.js ***! 459 \************************************************/ 460/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 461 462"use strict"; 463/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 464/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); 465/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); 466/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 467/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); 468/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); 469/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 470/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 471/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ "./node_modules/axios/lib/helpers/progressEventReducer.js"); 472/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ "./node_modules/axios/lib/helpers/resolveConfig.js"); 473 474 475 476 477 478 479 480 481 482 483 484const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; 485 486/* harmony default export */ __webpack_exports__["default"] = (isXHRAdapterSupported && function (config) { 487 return new Promise(function dispatchXhrRequest(resolve, reject) { 488 const _config = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_9__["default"])(config); 489 let requestData = _config.data; 490 const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].from(_config.headers).normalize(); 491 let {responseType, onUploadProgress, onDownloadProgress} = _config; 492 let onCanceled; 493 let uploadThrottled, downloadThrottled; 494 let flushUpload, flushDownload; 495 496 function done() { 497 flushUpload && flushUpload(); // flush events 498 flushDownload && flushDownload(); // flush events 499 500 _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); 501 502 _config.signal && _config.signal.removeEventListener('abort', onCanceled); 503 } 504 505 let request = new XMLHttpRequest(); 506 507 request.open(_config.method.toUpperCase(), _config.url, true); 508 509 // Set the request timeout in MS 510 request.timeout = _config.timeout; 511 512 function onloadend() { 513 if (!request) { 514 return; 515 } 516 // Prepare the response 517 const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].from( 518 'getAllResponseHeaders' in request && request.getAllResponseHeaders() 519 ); 520 const responseData = !responseType || responseType === 'text' || responseType === 'json' ? 521 request.responseText : request.response; 522 const response = { 523 data: responseData, 524 status: request.status, 525 statusText: request.statusText, 526 headers: responseHeaders, 527 config, 528 request 529 }; 530 531 (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function _resolve(value) { 532 resolve(value); 533 done(); 534 }, function _reject(err) { 535 reject(err); 536 done(); 537 }, response); 538 539 // Clean up request 540 request = null; 541 } 542 543 if ('onloadend' in request) { 544 // Use onloadend if available 545 request.onloadend = onloadend; 546 } else { 547 // Listen for ready state to emulate onloadend 548 request.onreadystatechange = function handleLoad() { 549 if (!request || request.readyState !== 4) { 550 return; 551 } 552 553 // The request errored out and we didn't get a response, this will be 554 // handled by onerror instead 555 // With one exception: request that using file: protocol, most browsers 556 // will return status as 0 even though it's a successful request 557 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 558 return; 559 } 560 // readystate handler is calling before onerror or ontimeout handlers, 561 // so we should call onloadend on the next 'tick' 562 setTimeout(onloadend); 563 }; 564 } 565 566 // Handle browser request cancellation (as opposed to a manual cancellation) 567 request.onabort = function handleAbort() { 568 if (!request) { 569 return; 570 } 571 572 reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, config, request)); 573 574 // Clean up request 575 request = null; 576 }; 577 578 // Handle low level network errors 579 request.onerror = function handleError(event) { 580 // Browsers deliver a ProgressEvent in XHR onerror 581 // (message may be empty; when present, surface it) 582 // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event 583 const msg = event && event.message ? event.message : 'Network Error'; 584 const err = new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](msg, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_NETWORK, config, request); 585 // attach the underlying event for consumers who want details 586 err.event = event || null; 587 reject(err); 588 request = null; 589 }; 590 591 // Handle timeout 592 request.ontimeout = function handleTimeout() { 593 let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; 594 const transitional = _config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_2__["default"]; 595 if (_config.timeoutErrorMessage) { 596 timeoutErrorMessage = _config.timeoutErrorMessage; 597 } 598 reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( 599 timeoutErrorMessage, 600 transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ECONNABORTED, 601 config, 602 request)); 603 604 // Clean up request 605 request = null; 606 }; 607 608 // Remove Content-Type if data is undefined 609 requestData === undefined && requestHeaders.setContentType(null); 610 611 // Add headers to the request 612 if ('setRequestHeader' in request) { 613 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { 614 request.setRequestHeader(key, val); 615 }); 616 } 617 618 // Add withCredentials to request if needed 619 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(_config.withCredentials)) { 620 request.withCredentials = !!_config.withCredentials; 621 } 622 623 // Add responseType to request if needed 624 if (responseType && responseType !== 'json') { 625 request.responseType = _config.responseType; 626 } 627 628 // Handle progress if needed 629 if (onDownloadProgress) { 630 ([downloadThrottled, flushDownload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__.progressEventReducer)(onDownloadProgress, true)); 631 request.addEventListener('progress', downloadThrottled); 632 } 633 634 // Not all browsers support upload events 635 if (onUploadProgress && request.upload) { 636 ([uploadThrottled, flushUpload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_8__.progressEventReducer)(onUploadProgress)); 637 638 request.upload.addEventListener('progress', uploadThrottled); 639 640 request.upload.addEventListener('loadend', flushUpload); 641 } 642 643 if (_config.cancelToken || _config.signal) { 644 // Handle cancellation 645 // eslint-disable-next-line func-names 646 onCanceled = cancel => { 647 if (!request) { 648 return; 649 } 650 reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__["default"](null, config, request) : cancel); 651 request.abort(); 652 request = null; 653 }; 654 655 _config.cancelToken && _config.cancelToken.subscribe(onCanceled); 656 if (_config.signal) { 657 _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); 658 } 659 } 660 661 const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_config.url); 662 663 if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].protocols.indexOf(protocol) === -1) { 664 reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"].ERR_BAD_REQUEST, config)); 665 return; 666 } 667 668 669 // Send the request 670 request.send(requestData || null); 671 }); 672}); 673 674 675/***/ }), 676
vendor: 6,222 bytes, lines 677-793
677/***/ "./node_modules/axios/lib/axios.js": 678/*!*****************************************!*\ 679 !*** ./node_modules/axios/lib/axios.js ***! 680 \*****************************************/ 681/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 682 683"use strict"; 684/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); 685/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); 686/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); 687/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); 688/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); 689/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); 690/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); 691/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); 692/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); 693/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); 694/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); 695/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 696/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); 697/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); 698/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 699/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); 700/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721/** 722 * Create an instance of Axios 723 * 724 * @param {Object} defaultConfig The default config for the instance 725 * 726 * @returns {Axios} A new instance of Axios 727 */ 728function createInstance(defaultConfig) { 729 const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"](defaultConfig); 730 const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype.request, context); 731 732 // Copy axios.prototype to instance 733 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype, context, {allOwnKeys: true}); 734 735 // Copy context to instance 736 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, context, null, {allOwnKeys: true}); 737 738 // Factory for creating new instances 739 instance.create = function create(instanceConfig) { 740 return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); 741 }; 742 743 return instance; 744} 745 746// Create the default instance to be exported 747const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); 748 749// Expose Axios class to allow class inheritance 750axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"]; 751 752// Expose Cancel & CancelToken 753axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__["default"]; 754axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__["default"]; 755axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__["default"]; 756axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_9__.VERSION; 757axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__["default"]; 758 759// Expose AxiosError class 760axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__["default"]; 761 762// alias for CanceledError for backward compatibility 763axios.Cancel = axios.CanceledError; 764 765// Expose all/spread 766axios.all = function all(promises) { 767 return Promise.all(promises); 768}; 769 770axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__["default"]; 771 772// Expose isAxiosError 773axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__["default"]; 774 775// Expose mergeConfig 776axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; 777 778axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__["default"]; 779 780axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); 781 782axios.getAdapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__["default"].getAdapter; 783 784axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__["default"]; 785 786axios.default = axios; 787 788// this module should only have a default export 789/* harmony default export */ __webpack_exports__["default"] = (axios); 790 791 792/***/ }), 793
vendor: 3,355 bytes, lines 794-940
794/***/ "./node_modules/axios/lib/cancel/CancelToken.js": 795/*!******************************************************!*\ 796 !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! 797 \******************************************************/ 798/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 799 800"use strict"; 801/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); 802 803 804 805 806/** 807 * A `CancelToken` is an object that can be used to request cancellation of an operation. 808 * 809 * @param {Function} executor The executor function. 810 * 811 * @returns {CancelToken} 812 */ 813class CancelToken { 814 constructor(executor) { 815 if (typeof executor !== 'function') { 816 throw new TypeError('executor must be a function.'); 817 } 818 819 let resolvePromise; 820 821 this.promise = new Promise(function promiseExecutor(resolve) { 822 resolvePromise = resolve; 823 }); 824 825 const token = this; 826 827 // eslint-disable-next-line func-names 828 this.promise.then(cancel => { 829 if (!token._listeners) return; 830 831 let i = token._listeners.length; 832 833 while (i-- > 0) { 834 token._listeners[i](cancel); 835 } 836 token._listeners = null; 837 }); 838 839 // eslint-disable-next-line func-names 840 this.promise.then = onfulfilled => { 841 let _resolve; 842 // eslint-disable-next-line func-names 843 const promise = new Promise(resolve => { 844 token.subscribe(resolve); 845 _resolve = resolve; 846 }).then(onfulfilled); 847 848 promise.cancel = function reject() { 849 token.unsubscribe(_resolve); 850 }; 851 852 return promise; 853 }; 854 855 executor(function cancel(message, config, request) { 856 if (token.reason) { 857 // Cancellation has already been requested 858 return; 859 } 860 861 token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); 862 resolvePromise(token.reason); 863 }); 864 } 865 866 /** 867 * Throws a `CanceledError` if cancellation has been requested. 868 */ 869 throwIfRequested() { 870 if (this.reason) { 871 throw this.reason; 872 } 873 } 874 875 /** 876 * Subscribe to the cancel signal 877 */ 878 879 subscribe(listener) { 880 if (this.reason) { 881 listener(this.reason); 882 return; 883 } 884 885 if (this._listeners) { 886 this._listeners.push(listener); 887 } else { 888 this._listeners = [listener]; 889 } 890 } 891 892 /** 893 * Unsubscribe from the cancel signal 894 */ 895 896 unsubscribe(listener) { 897 if (!this._listeners) { 898 return; 899 } 900 const index = this._listeners.indexOf(listener); 901 if (index !== -1) { 902 this._listeners.splice(index, 1); 903 } 904 } 905 906 toAbortSignal() { 907 const controller = new AbortController(); 908 909 const abort = (err) => { 910 controller.abort(err); 911 }; 912 913 this.subscribe(abort); 914 915 controller.signal.unsubscribe = () => this.unsubscribe(abort); 916 917 return controller.signal; 918 } 919 920 /** 921 * Returns an object that contains a new `CancelToken` and a function that, when called, 922 * cancels the `CancelToken`. 923 */ 924 static source() { 925 let cancel; 926 const token = new CancelToken(function executor(c) { 927 cancel = c; 928 }); 929 return { 930 token, 931 cancel 932 }; 933 } 934} 935 936/* harmony default export */ __webpack_exports__["default"] = (CancelToken); 937 938 939/***/ }), 940
vendor: 1,529 bytes, lines 941-978
941/***/ "./node_modules/axios/lib/cancel/CanceledError.js": 942/*!********************************************************!*\ 943 !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! 944 \********************************************************/ 945/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 946 947"use strict"; 948/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 949/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 950 951 952 953 954 955/** 956 * A `CanceledError` is an object that is thrown when an operation is canceled. 957 * 958 * @param {string=} message The message. 959 * @param {Object=} config The config. 960 * @param {Object=} request The request. 961 * 962 * @returns {CanceledError} The created error. 963 */ 964function CanceledError(message, config, request) { 965 // eslint-disable-next-line no-eq-null,eqeqeq 966 _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); 967 this.name = 'CanceledError'; 968} 969 970_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { 971 __CANCEL__: true 972}); 973 974/* harmony default export */ __webpack_exports__["default"] = (CanceledError); 975 976 977/***/ }), 978
vendor: 590 bytes, lines 979-997
979/***/ "./node_modules/axios/lib/cancel/isCancel.js": 980/*!***************************************************!*\ 981 !*** ./node_modules/axios/lib/cancel/isCancel.js ***! 982 \***************************************************/ 983/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 984 985"use strict"; 986/* harmony export */ __webpack_require__.d(__webpack_exports__, { 987/* harmony export */ "default": function() { return /* binding */ isCancel; } 988/* harmony export */ }); 989 990 991function isCancel(value) { 992 return !!(value && value.__CANCEL__); 993} 994 995 996/***/ }), 997
vendor: 9,140 bytes, lines 998-1256
998/***/ "./node_modules/axios/lib/core/Axios.js": 999/*!**********************************************!*\ 1000 !*** ./node_modules/axios/lib/core/Axios.js ***! 1001 \**********************************************/ 1002/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1003 1004"use strict"; 1005/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 1006/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); 1007/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); 1008/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); 1009/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); 1010/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); 1011/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); 1012/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].validators; 1025 1026/** 1027 * Create a new instance of Axios 1028 * 1029 * @param {Object} instanceConfig The default config for the instance 1030 * 1031 * @return {Axios} A new instance of Axios 1032 */ 1033class Axios { 1034 constructor(instanceConfig) { 1035 this.defaults = instanceConfig || {}; 1036 this.interceptors = { 1037 request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"](), 1038 response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"]() 1039 }; 1040 } 1041 1042 /** 1043 * Dispatch a request 1044 * 1045 * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) 1046 * @param {?Object} config 1047 * 1048 * @returns {Promise} The Promise to be fulfilled 1049 */ 1050 async request(configOrUrl, config) { 1051 try { 1052 return await this._request(configOrUrl, config); 1053 } catch (err) { 1054 if (err instanceof Error) { 1055 let dummy = {}; 1056 1057 Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); 1058 1059 // slice off the Error: ... line 1060 const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; 1061 try { 1062 if (!err.stack) { 1063 err.stack = stack; 1064 // match without the 2 top stack lines 1065 } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { 1066 err.stack += '\n' + stack 1067 } 1068 } catch (e) { 1069 // ignore the case where "stack" is an un-writable property 1070 } 1071 } 1072 1073 throw err; 1074 } 1075 } 1076 1077 _request(configOrUrl, config) { 1078 /*eslint no-param-reassign:0*/ 1079 // Allow for axios('example/url'[, config]) a la fetch API 1080 if (typeof configOrUrl === 'string') { 1081 config = config || {}; 1082 config.url = configOrUrl; 1083 } else { 1084 config = configOrUrl || {}; 1085 } 1086 1087 config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config); 1088 1089 const {transitional, paramsSerializer, headers} = config; 1090 1091 if (transitional !== undefined) { 1092 _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(transitional, { 1093 silentJSONParsing: validators.transitional(validators.boolean), 1094 forcedJSONParsing: validators.transitional(validators.boolean), 1095 clarifyTimeoutError: validators.transitional(validators.boolean) 1096 }, false); 1097 } 1098 1099 if (paramsSerializer != null) { 1100 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(paramsSerializer)) { 1101 config.paramsSerializer = { 1102 serialize: paramsSerializer 1103 } 1104 } else { 1105 _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(paramsSerializer, { 1106 encode: validators.function, 1107 serialize: validators.function 1108 }, true); 1109 } 1110 } 1111 1112 // Set config.allowAbsoluteUrls 1113 if (config.allowAbsoluteUrls !== undefined) { 1114 // do nothing 1115 } else if (this.defaults.allowAbsoluteUrls !== undefined) { 1116 config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; 1117 } else { 1118 config.allowAbsoluteUrls = true; 1119 } 1120 1121 _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(config, { 1122 baseUrl: validators.spelling('baseURL'), 1123 withXsrfToken: validators.spelling('withXSRFToken') 1124 }, true); 1125 1126 // Set config.method 1127 config.method = (config.method || this.defaults.method || 'get').toLowerCase(); 1128 1129 // Flatten headers 1130 let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge( 1131 headers.common, 1132 headers[config.method] 1133 ); 1134 1135 headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach( 1136 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 1137 (method) => { 1138 delete headers[method]; 1139 } 1140 ); 1141 1142 config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].concat(contextHeaders, headers); 1143 1144 // filter out skipped interceptors 1145 const requestInterceptorChain = []; 1146 let synchronousRequestInterceptors = true; 1147 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 1148 if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { 1149 return; 1150 } 1151 1152 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 1153 1154 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 1155 }); 1156 1157 const responseInterceptorChain = []; 1158 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 1159 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 1160 }); 1161 1162 let promise; 1163 let i = 0; 1164 let len; 1165 1166 if (!synchronousRequestInterceptors) { 1167 const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind(this), undefined]; 1168 chain.unshift(...requestInterceptorChain); 1169 chain.push(...responseInterceptorChain); 1170 len = chain.length; 1171 1172 promise = Promise.resolve(config); 1173 1174 while (i < len) { 1175 promise = promise.then(chain[i++], chain[i++]); 1176 } 1177 1178 return promise; 1179 } 1180 1181 len = requestInterceptorChain.length; 1182 1183 let newConfig = config; 1184 1185 while (i < len) { 1186 const onFulfilled = requestInterceptorChain[i++]; 1187 const onRejected = requestInterceptorChain[i++]; 1188 try { 1189 newConfig = onFulfilled(newConfig); 1190 } catch (error) { 1191 onRejected.call(this, error); 1192 break; 1193 } 1194 } 1195 1196 try { 1197 promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, newConfig); 1198 } catch (error) { 1199 return Promise.reject(error); 1200 } 1201 1202 i = 0; 1203 len = responseInterceptorChain.length; 1204 1205 while (i < len) { 1206 promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); 1207 } 1208 1209 return promise; 1210 } 1211 1212 getUri(config) { 1213 config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config); 1214 const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__["default"])(config.baseURL, config.url, config.allowAbsoluteUrls); 1215 return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fullPath, config.params, config.paramsSerializer); 1216 } 1217} 1218 1219// Provide aliases for supported request methods 1220_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 1221 /*eslint func-names:0*/ 1222 Axios.prototype[method] = function(url, config) { 1223 return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, { 1224 method, 1225 url, 1226 data: (config || {}).data 1227 })); 1228 }; 1229}); 1230 1231_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 1232 /*eslint func-names:0*/ 1233 1234 function generateHTTPMethod(isForm) { 1235 return function httpMethod(url, data, config) { 1236 return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, { 1237 method, 1238 headers: isForm ? { 1239 'Content-Type': 'multipart/form-data' 1240 } : {}, 1241 url, 1242 data 1243 })); 1244 }; 1245 } 1246 1247 Axios.prototype[method] = generateHTTPMethod(); 1248 1249 Axios.prototype[method + 'Form'] = generateHTTPMethod(true); 1250}); 1251 1252/* harmony default export */ __webpack_exports__["default"] = (Axios); 1253 1254 1255/***/ }), 1256
vendor: 3,596 bytes, lines 1257-1378
1257/***/ "./node_modules/axios/lib/core/AxiosError.js": 1258/*!***************************************************!*\ 1259 !*** ./node_modules/axios/lib/core/AxiosError.js ***! 1260 \***************************************************/ 1261/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1262 1263"use strict"; 1264/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 1265 1266 1267 1268 1269/** 1270 * Create an Error with the specified message, config, error code, request and response. 1271 * 1272 * @param {string} message The error message. 1273 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 1274 * @param {Object} [config] The config. 1275 * @param {Object} [request] The request. 1276 * @param {Object} [response] The response. 1277 * 1278 * @returns {Error} The created error. 1279 */ 1280function AxiosError(message, code, config, request, response) { 1281 Error.call(this); 1282 1283 if (Error.captureStackTrace) { 1284 Error.captureStackTrace(this, this.constructor); 1285 } else { 1286 this.stack = (new Error()).stack; 1287 } 1288 1289 this.message = message; 1290 this.name = 'AxiosError'; 1291 code && (this.code = code); 1292 config && (this.config = config); 1293 request && (this.request = request); 1294 if (response) { 1295 this.response = response; 1296 this.status = response.status ? response.status : null; 1297 } 1298} 1299 1300_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { 1301 toJSON: function toJSON() { 1302 return { 1303 // Standard 1304 message: this.message, 1305 name: this.name, 1306 // Microsoft 1307 description: this.description, 1308 number: this.number, 1309 // Mozilla 1310 fileName: this.fileName, 1311 lineNumber: this.lineNumber, 1312 columnNumber: this.columnNumber, 1313 stack: this.stack, 1314 // Axios 1315 config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), 1316 code: this.code, 1317 status: this.status 1318 }; 1319 } 1320}); 1321 1322const prototype = AxiosError.prototype; 1323const descriptors = {}; 1324 1325[ 1326 'ERR_BAD_OPTION_VALUE', 1327 'ERR_BAD_OPTION', 1328 'ECONNABORTED', 1329 'ETIMEDOUT', 1330 'ERR_NETWORK', 1331 'ERR_FR_TOO_MANY_REDIRECTS', 1332 'ERR_DEPRECATED', 1333 'ERR_BAD_RESPONSE', 1334 'ERR_BAD_REQUEST', 1335 'ERR_CANCELED', 1336 'ERR_NOT_SUPPORT', 1337 'ERR_INVALID_URL' 1338// eslint-disable-next-line func-names 1339].forEach(code => { 1340 descriptors[code] = {value: code}; 1341}); 1342 1343Object.defineProperties(AxiosError, descriptors); 1344Object.defineProperty(prototype, 'isAxiosError', {value: true}); 1345 1346// eslint-disable-next-line func-names 1347AxiosError.from = (error, code, config, request, response, customProps) => { 1348 const axiosError = Object.create(prototype); 1349 1350 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { 1351 return obj !== Error.prototype; 1352 }, prop => { 1353 return prop !== 'isAxiosError'; 1354 }); 1355 1356 const msg = error && error.message ? error.message : 'Error'; 1357 1358 // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) 1359 const errCode = code == null && error ? error.code : code; 1360 AxiosError.call(axiosError, msg, errCode, config, request, response); 1361 1362 // Chain the original error on the standard field; non-enumerable to avoid JSON noise 1363 if (error && axiosError.cause == null) { 1364 Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); 1365 } 1366 1367 axiosError.name = (error && error.name) || 'Error'; 1368 1369 customProps && Object.assign(axiosError, customProps); 1370 1371 return axiosError; 1372}; 1373 1374/* harmony default export */ __webpack_exports__["default"] = (AxiosError); 1375 1376 1377/***/ }), 1378
vendor: 9,276 bytes, lines 1379-1705
1379/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": 1380/*!*****************************************************!*\ 1381 !*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! 1382 \*****************************************************/ 1383/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1384 1385"use strict"; 1386/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 1387/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); 1388 1389 1390 1391 1392 1393const $internals = Symbol('internals'); 1394 1395function normalizeHeader(header) { 1396 return header && String(header).trim().toLowerCase(); 1397} 1398 1399function normalizeValue(value) { 1400 if (value === false || value == null) { 1401 return value; 1402 } 1403 1404 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); 1405} 1406 1407function parseTokens(str) { 1408 const tokens = Object.create(null); 1409 const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; 1410 let match; 1411 1412 while ((match = tokensRE.exec(str))) { 1413 tokens[match[1]] = match[2]; 1414 } 1415 1416 return tokens; 1417} 1418 1419const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); 1420 1421function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { 1422 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { 1423 return filter.call(this, value, header); 1424 } 1425 1426 if (isHeaderNameFilter) { 1427 value = header; 1428 } 1429 1430 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; 1431 1432 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { 1433 return value.indexOf(filter) !== -1; 1434 } 1435 1436 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { 1437 return filter.test(value); 1438 } 1439} 1440 1441function formatHeader(header) { 1442 return header.trim() 1443 .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { 1444 return char.toUpperCase() + str; 1445 }); 1446} 1447 1448function buildAccessors(obj, header) { 1449 const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); 1450 1451 ['get', 'set', 'has'].forEach(methodName => { 1452 Object.defineProperty(obj, methodName + accessorName, { 1453 value: function(arg1, arg2, arg3) { 1454 return this[methodName].call(this, header, arg1, arg2, arg3); 1455 }, 1456 configurable: true 1457 }); 1458 }); 1459} 1460 1461class AxiosHeaders { 1462 constructor(headers) { 1463 headers && this.set(headers); 1464 } 1465 1466 set(header, valueOrRewrite, rewrite) { 1467 const self = this; 1468 1469 function setHeader(_value, _header, _rewrite) { 1470 const lHeader = normalizeHeader(_header); 1471 1472 if (!lHeader) { 1473 throw new Error('header name must be a non-empty string'); 1474 } 1475 1476 const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); 1477 1478 if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { 1479 self[key || _header] = normalizeValue(_value); 1480 } 1481 } 1482 1483 const setHeaders = (headers, _rewrite) => 1484 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); 1485 1486 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { 1487 setHeaders(header, valueOrRewrite) 1488 } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { 1489 setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); 1490 } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(header) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isIterable(header)) { 1491 let obj = {}, dest, key; 1492 for (const entry of header) { 1493 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(entry)) { 1494 throw TypeError('Object iterator must return a key-value pair'); 1495 } 1496 1497 obj[key = entry[0]] = (dest = obj[key]) ? 1498 (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; 1499 } 1500 1501 setHeaders(obj, valueOrRewrite) 1502 } else { 1503 header != null && setHeader(valueOrRewrite, header, rewrite); 1504 } 1505 1506 return this; 1507 } 1508 1509 get(header, parser) { 1510 header = normalizeHeader(header); 1511 1512 if (header) { 1513 const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); 1514 1515 if (key) { 1516 const value = this[key]; 1517 1518 if (!parser) { 1519 return value; 1520 } 1521 1522 if (parser === true) { 1523 return parseTokens(value); 1524 } 1525 1526 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { 1527 return parser.call(this, value, key); 1528 } 1529 1530 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { 1531 return parser.exec(value); 1532 } 1533 1534 throw new TypeError('parser must be boolean|regexp|function'); 1535 } 1536 } 1537 } 1538 1539 has(header, matcher) { 1540 header = normalizeHeader(header); 1541 1542 if (header) { 1543 const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); 1544 1545 return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); 1546 } 1547 1548 return false; 1549 } 1550 1551 delete(header, matcher) { 1552 const self = this; 1553 let deleted = false; 1554 1555 function deleteHeader(_header) { 1556 _header = normalizeHeader(_header); 1557 1558 if (_header) { 1559 const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); 1560 1561 if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { 1562 delete self[key]; 1563 1564 deleted = true; 1565 } 1566 } 1567 } 1568 1569 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { 1570 header.forEach(deleteHeader); 1571 } else { 1572 deleteHeader(header); 1573 } 1574 1575 return deleted; 1576 } 1577 1578 clear(matcher) { 1579 const keys = Object.keys(this); 1580 let i = keys.length; 1581 let deleted = false; 1582 1583 while (i--) { 1584 const key = keys[i]; 1585 if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { 1586 delete this[key]; 1587 deleted = true; 1588 } 1589 } 1590 1591 return deleted; 1592 } 1593 1594 normalize(format) { 1595 const self = this; 1596 const headers = {}; 1597 1598 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { 1599 const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); 1600 1601 if (key) { 1602 self[key] = normalizeValue(value); 1603 delete self[header]; 1604 return; 1605 } 1606 1607 const normalized = format ? formatHeader(header) : String(header).trim(); 1608 1609 if (normalized !== header) { 1610 delete self[header]; 1611 } 1612 1613 self[normalized] = normalizeValue(value); 1614 1615 headers[normalized] = true; 1616 }); 1617 1618 return this; 1619 } 1620 1621 concat(...targets) { 1622 return this.constructor.concat(this, ...targets); 1623 } 1624 1625 toJSON(asStrings) { 1626 const obj = Object.create(null); 1627 1628 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { 1629 value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); 1630 }); 1631 1632 return obj; 1633 } 1634 1635 [Symbol.iterator]() { 1636 return Object.entries(this.toJSON())[Symbol.iterator](); 1637 } 1638 1639 toString() { 1640 return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); 1641 } 1642 1643 getSetCookie() { 1644 return this.get("set-cookie") || []; 1645 } 1646 1647 get [Symbol.toStringTag]() { 1648 return 'AxiosHeaders'; 1649 } 1650 1651 static from(thing) { 1652 return thing instanceof this ? thing : new this(thing); 1653 } 1654 1655 static concat(first, ...targets) { 1656 const computed = new this(first); 1657 1658 targets.forEach((target) => computed.set(target)); 1659 1660 return computed; 1661 } 1662 1663 static accessor(header) { 1664 const internals = this[$internals] = (this[$internals] = { 1665 accessors: {} 1666 }); 1667 1668 const accessors = internals.accessors; 1669 const prototype = this.prototype; 1670 1671 function defineAccessor(_header) { 1672 const lHeader = normalizeHeader(_header); 1673 1674 if (!accessors[lHeader]) { 1675 buildAccessors(prototype, _header); 1676 accessors[lHeader] = true; 1677 } 1678 } 1679 1680 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); 1681 1682 return this; 1683 } 1684} 1685 1686AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); 1687 1688// reserved names hotfix 1689_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { 1690 let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` 1691 return { 1692 get: () => value, 1693 set(headerValue) { 1694 this[mapped] = headerValue; 1695 } 1696 } 1697}); 1698 1699_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); 1700 1701/* harmony default export */ __webpack_exports__["default"] = (AxiosHeaders); 1702 1703 1704/***/ }), 1705
vendor: 2,080 bytes, lines 1706-1788
1706/***/ "./node_modules/axios/lib/core/InterceptorManager.js": 1707/*!***********************************************************!*\ 1708 !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! 1709 \***********************************************************/ 1710/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1711 1712"use strict"; 1713/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 1714 1715 1716 1717 1718class InterceptorManager { 1719 constructor() { 1720 this.handlers = []; 1721 } 1722 1723 /** 1724 * Add a new interceptor to the stack 1725 * 1726 * @param {Function} fulfilled The function to handle `then` for a `Promise` 1727 * @param {Function} rejected The function to handle `reject` for a `Promise` 1728 * 1729 * @return {Number} An ID used to remove interceptor later 1730 */ 1731 use(fulfilled, rejected, options) { 1732 this.handlers.push({ 1733 fulfilled, 1734 rejected, 1735 synchronous: options ? options.synchronous : false, 1736 runWhen: options ? options.runWhen : null 1737 }); 1738 return this.handlers.length - 1; 1739 } 1740 1741 /** 1742 * Remove an interceptor from the stack 1743 * 1744 * @param {Number} id The ID that was returned by `use` 1745 * 1746 * @returns {void} 1747 */ 1748 eject(id) { 1749 if (this.handlers[id]) { 1750 this.handlers[id] = null; 1751 } 1752 } 1753 1754 /** 1755 * Clear all interceptors from the stack 1756 * 1757 * @returns {void} 1758 */ 1759 clear() { 1760 if (this.handlers) { 1761 this.handlers = []; 1762 } 1763 } 1764 1765 /** 1766 * Iterate over all the registered interceptors 1767 * 1768 * This method is particularly useful for skipping over any 1769 * interceptors that may have become `null` calling `eject`. 1770 * 1771 * @param {Function} fn The function to call for each interceptor 1772 * 1773 * @returns {void} 1774 */ 1775 forEach(fn) { 1776 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { 1777 if (h !== null) { 1778 fn(h); 1779 } 1780 }); 1781 } 1782} 1783 1784/* harmony default export */ __webpack_exports__["default"] = (InterceptorManager); 1785 1786 1787/***/ }), 1788
vendor: 1,671 bytes, lines 1789-1826
1789/***/ "./node_modules/axios/lib/core/buildFullPath.js": 1790/*!******************************************************!*\ 1791 !*** ./node_modules/axios/lib/core/buildFullPath.js ***! 1792 \******************************************************/ 1793/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1794 1795"use strict"; 1796/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1797/* harmony export */ "default": function() { return /* binding */ buildFullPath; } 1798/* harmony export */ }); 1799/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); 1800/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); 1801 1802 1803 1804 1805 1806/** 1807 * Creates a new URL by combining the baseURL with the requestedURL, 1808 * only when the requestedURL is not already an absolute URL. 1809 * If the requestURL is absolute, this function returns the requestedURL untouched. 1810 * 1811 * @param {string} baseURL The base URL 1812 * @param {string} requestedURL Absolute or relative URL to combine 1813 * 1814 * @returns {string} The combined full path 1815 */ 1816function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { 1817 let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL); 1818 if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { 1819 return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); 1820 } 1821 return requestedURL; 1822} 1823 1824 1825/***/ }), 1826
vendor: 3,972 bytes, lines 1827-1927
1827/***/ "./node_modules/axios/lib/core/dispatchRequest.js": 1828/*!********************************************************!*\ 1829 !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! 1830 \********************************************************/ 1831/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1832 1833"use strict"; 1834/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1835/* harmony export */ "default": function() { return /* binding */ dispatchRequest; } 1836/* harmony export */ }); 1837/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); 1838/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); 1839/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); 1840/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); 1841/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 1842/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852/** 1853 * Throws a `CanceledError` if cancellation has been requested. 1854 * 1855 * @param {Object} config The config that is to be used for the request 1856 * 1857 * @returns {void} 1858 */ 1859function throwIfCancellationRequested(config) { 1860 if (config.cancelToken) { 1861 config.cancelToken.throwIfRequested(); 1862 } 1863 1864 if (config.signal && config.signal.aborted) { 1865 throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__["default"](null, config); 1866 } 1867} 1868 1869/** 1870 * Dispatch a request to the server using the configured adapter. 1871 * 1872 * @param {object} config The config that is to be used for the request 1873 * 1874 * @returns {Promise} The Promise to be fulfilled 1875 */ 1876function dispatchRequest(config) { 1877 throwIfCancellationRequested(config); 1878 1879 config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(config.headers); 1880 1881 // Transform request data 1882 config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( 1883 config, 1884 config.transformRequest 1885 ); 1886 1887 if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { 1888 config.headers.setContentType('application/x-www-form-urlencoded', false); 1889 } 1890 1891 const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].adapter, config); 1892 1893 return adapter(config).then(function onAdapterResolution(response) { 1894 throwIfCancellationRequested(config); 1895 1896 // Transform response data 1897 response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( 1898 config, 1899 config.transformResponse, 1900 response 1901 ); 1902 1903 response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(response.headers); 1904 1905 return response; 1906 }, function onAdapterRejection(reason) { 1907 if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reason)) { 1908 throwIfCancellationRequested(config); 1909 1910 // Transform response data 1911 if (reason && reason.response) { 1912 reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( 1913 config, 1914 config.transformResponse, 1915 reason.response 1916 ); 1917 reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(reason.response.headers); 1918 } 1919 } 1920 1921 return Promise.reject(reason); 1922 }); 1923} 1924 1925 1926/***/ }), 1927
vendor: 4,749 bytes, lines 1928-2049
1928/***/ "./node_modules/axios/lib/core/mergeConfig.js": 1929/*!****************************************************!*\ 1930 !*** ./node_modules/axios/lib/core/mergeConfig.js ***! 1931 \****************************************************/ 1932/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 1933 1934"use strict"; 1935/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1936/* harmony export */ "default": function() { return /* binding */ mergeConfig; } 1937/* harmony export */ }); 1938/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 1939/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 1940 1941 1942 1943 1944 1945const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? { ...thing } : thing; 1946 1947/** 1948 * Config-specific merge-function which creates a new config-object 1949 * by merging two configuration objects together. 1950 * 1951 * @param {Object} config1 1952 * @param {Object} config2 1953 * 1954 * @returns {Object} New object resulting from merging config2 to config1 1955 */ 1956function mergeConfig(config1, config2) { 1957 // eslint-disable-next-line no-param-reassign 1958 config2 = config2 || {}; 1959 const config = {}; 1960 1961 function getMergedValue(target, source, prop, caseless) { 1962 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) { 1963 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge.call({caseless}, target, source); 1964 } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) { 1965 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge({}, source); 1966 } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(source)) { 1967 return source.slice(); 1968 } 1969 return source; 1970 } 1971 1972 // eslint-disable-next-line consistent-return 1973 function mergeDeepProperties(a, b, prop, caseless) { 1974 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { 1975 return getMergedValue(a, b, prop, caseless); 1976 } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) { 1977 return getMergedValue(undefined, a, prop, caseless); 1978 } 1979 } 1980 1981 // eslint-disable-next-line consistent-return 1982 function valueFromConfig2(a, b) { 1983 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { 1984 return getMergedValue(undefined, b); 1985 } 1986 } 1987 1988 // eslint-disable-next-line consistent-return 1989 function defaultToConfig2(a, b) { 1990 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { 1991 return getMergedValue(undefined, b); 1992 } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) { 1993 return getMergedValue(undefined, a); 1994 } 1995 } 1996 1997 // eslint-disable-next-line consistent-return 1998 function mergeDirectKeys(a, b, prop) { 1999 if (prop in config2) { 2000 return getMergedValue(a, b); 2001 } else if (prop in config1) { 2002 return getMergedValue(undefined, a); 2003 } 2004 } 2005 2006 const mergeMap = { 2007 url: valueFromConfig2, 2008 method: valueFromConfig2, 2009 data: valueFromConfig2, 2010 baseURL: defaultToConfig2, 2011 transformRequest: defaultToConfig2, 2012 transformResponse: defaultToConfig2, 2013 paramsSerializer: defaultToConfig2, 2014 timeout: defaultToConfig2, 2015 timeoutMessage: defaultToConfig2, 2016 withCredentials: defaultToConfig2, 2017 withXSRFToken: defaultToConfig2, 2018 adapter: defaultToConfig2, 2019 responseType: defaultToConfig2, 2020 xsrfCookieName: defaultToConfig2, 2021 xsrfHeaderName: defaultToConfig2, 2022 onUploadProgress: defaultToConfig2, 2023 onDownloadProgress: defaultToConfig2, 2024 decompress: defaultToConfig2, 2025 maxContentLength: defaultToConfig2, 2026 maxBodyLength: defaultToConfig2, 2027 beforeRedirect: defaultToConfig2, 2028 transport: defaultToConfig2, 2029 httpAgent: defaultToConfig2, 2030 httpsAgent: defaultToConfig2, 2031 cancelToken: defaultToConfig2, 2032 socketPath: defaultToConfig2, 2033 responseEncoding: defaultToConfig2, 2034 validateStatus: mergeDirectKeys, 2035 headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) 2036 }; 2037 2038 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { 2039 const merge = mergeMap[prop] || mergeDeepProperties; 2040 const configValue = merge(config1[prop], config2[prop], prop); 2041 (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); 2042 }); 2043 2044 return config; 2045} 2046 2047 2048/***/ }), 2049
vendor: 1,562 bytes, lines 2050-2091
2050/***/ "./node_modules/axios/lib/core/settle.js": 2051/*!***********************************************!*\ 2052 !*** ./node_modules/axios/lib/core/settle.js ***! 2053 \***********************************************/ 2054/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2055 2056"use strict"; 2057/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2058/* harmony export */ "default": function() { return /* binding */ settle; } 2059/* harmony export */ }); 2060/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 2061 2062 2063 2064 2065/** 2066 * Resolve or reject a Promise based on response status. 2067 * 2068 * @param {Function} resolve A function that resolves the promise. 2069 * @param {Function} reject A function that rejects the promise. 2070 * @param {object} response The response. 2071 * 2072 * @returns {object} The response. 2073 */ 2074function settle(resolve, reject, response) { 2075 const validateStatus = response.config.validateStatus; 2076 if (!response.status || !validateStatus || validateStatus(response.status)) { 2077 resolve(response); 2078 } else { 2079 reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( 2080 'Request failed with status code ' + response.status, 2081 [_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], 2082 response.config, 2083 response.request, 2084 response 2085 )); 2086 } 2087} 2088 2089 2090/***/ }), 2091
vendor: 1,794 bytes, lines 2092-2136
2092/***/ "./node_modules/axios/lib/core/transformData.js": 2093/*!******************************************************!*\ 2094 !*** ./node_modules/axios/lib/core/transformData.js ***! 2095 \******************************************************/ 2096/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2097 2098"use strict"; 2099/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2100/* harmony export */ "default": function() { return /* binding */ transformData; } 2101/* harmony export */ }); 2102/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 2103/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); 2104/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 2105 2106 2107 2108 2109 2110 2111/** 2112 * Transform the data for a request or a response 2113 * 2114 * @param {Array|Function} fns A single function or Array of functions 2115 * @param {?Object} response The response object 2116 * 2117 * @returns {*} The resulting transformed data 2118 */ 2119function transformData(fns, response) { 2120 const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__["default"]; 2121 const context = response || config; 2122 const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(context.headers); 2123 let data = context.data; 2124 2125 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(fns, function transform(fn) { 2126 data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); 2127 }); 2128 2129 headers.normalize(); 2130 2131 return data; 2132} 2133 2134 2135/***/ }), 2136
vendor: 6,960 bytes, lines 2137-2315
2137/***/ "./node_modules/axios/lib/defaults/index.js": 2138/*!**************************************************!*\ 2139 !*** ./node_modules/axios/lib/defaults/index.js ***! 2140 \**************************************************/ 2141/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2142 2143"use strict"; 2144/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 2145/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 2146/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); 2147/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); 2148/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); 2149/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 2150/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161/** 2162 * It takes a string, tries to parse it, and if it fails, it returns the stringified version 2163 * of the input 2164 * 2165 * @param {any} rawValue - The value to be stringified. 2166 * @param {Function} parser - A function that parses a string into a JavaScript object. 2167 * @param {Function} encoder - A function that takes a value and returns a string. 2168 * 2169 * @returns {string} A stringified version of the rawValue. 2170 */ 2171function stringifySafely(rawValue, parser, encoder) { 2172 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { 2173 try { 2174 (parser || JSON.parse)(rawValue); 2175 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); 2176 } catch (e) { 2177 if (e.name !== 'SyntaxError') { 2178 throw e; 2179 } 2180 } 2181 } 2182 2183 return (encoder || JSON.stringify)(rawValue); 2184} 2185 2186const defaults = { 2187 2188 transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_2__["default"], 2189 2190 adapter: ['xhr', 'http', 'fetch'], 2191 2192 transformRequest: [function transformRequest(data, headers) { 2193 const contentType = headers.getContentType() || ''; 2194 const hasJSONContentType = contentType.indexOf('application/json') > -1; 2195 const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); 2196 2197 if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { 2198 data = new FormData(data); 2199 } 2200 2201 const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); 2202 2203 if (isFormData) { 2204 return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__["default"])(data)) : data; 2205 } 2206 2207 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || 2208 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || 2209 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || 2210 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || 2211 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) || 2212 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data) 2213 ) { 2214 return data; 2215 } 2216 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { 2217 return data.buffer; 2218 } 2219 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { 2220 headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); 2221 return data.toString(); 2222 } 2223 2224 let isFileList; 2225 2226 if (isObjectPayload) { 2227 if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { 2228 return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__["default"])(data, this.formSerializer).toString(); 2229 } 2230 2231 if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { 2232 const _FormData = this.env && this.env.FormData; 2233 2234 return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__["default"])( 2235 isFileList ? {'files[]': data} : data, 2236 _FormData && new _FormData(), 2237 this.formSerializer 2238 ); 2239 } 2240 } 2241 2242 if (isObjectPayload || hasJSONContentType ) { 2243 headers.setContentType('application/json', false); 2244 return stringifySafely(data); 2245 } 2246 2247 return data; 2248 }], 2249 2250 transformResponse: [function transformResponse(data) { 2251 const transitional = this.transitional || defaults.transitional; 2252 const forcedJSONParsing = transitional && transitional.forcedJSONParsing; 2253 const JSONRequested = this.responseType === 'json'; 2254 2255 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isReadableStream(data)) { 2256 return data; 2257 } 2258 2259 if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { 2260 const silentJSONParsing = transitional && transitional.silentJSONParsing; 2261 const strictJSONParsing = !silentJSONParsing && JSONRequested; 2262 2263 try { 2264 return JSON.parse(data, this.parseReviver); 2265 } catch (e) { 2266 if (strictJSONParsing) { 2267 if (e.name === 'SyntaxError') { 2268 throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_RESPONSE, this, null, this.response); 2269 } 2270 throw e; 2271 } 2272 } 2273 } 2274 2275 return data; 2276 }], 2277 2278 /** 2279 * A timeout in milliseconds to abort a request. If set to 0 (default) a 2280 * timeout is not created. 2281 */ 2282 timeout: 0, 2283 2284 xsrfCookieName: 'XSRF-TOKEN', 2285 xsrfHeaderName: 'X-XSRF-TOKEN', 2286 2287 maxContentLength: -1, 2288 maxBodyLength: -1, 2289 2290 env: { 2291 FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.FormData, 2292 Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.Blob 2293 }, 2294 2295 validateStatus: function validateStatus(status) { 2296 return status >= 200 && status < 300; 2297 }, 2298 2299 headers: { 2300 common: { 2301 'Accept': 'application/json, text/plain, */*', 2302 'Content-Type': undefined 2303 } 2304 } 2305}; 2306 2307_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { 2308 defaults.headers[method] = {}; 2309}); 2310 2311/* harmony default export */ __webpack_exports__["default"] = (defaults); 2312 2313 2314/***/ }), 2315
vendor: 505 bytes, lines 2316-2333
2316/***/ "./node_modules/axios/lib/defaults/transitional.js": 2317/*!*********************************************************!*\ 2318 !*** ./node_modules/axios/lib/defaults/transitional.js ***! 2319 \*********************************************************/ 2320/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 2321 2322"use strict"; 2323 2324 2325/* harmony default export */ __webpack_exports__["default"] = ({ 2326 silentJSONParsing: true, 2327 forcedJSONParsing: true, 2328 clarifyTimeoutError: false 2329}); 2330 2331 2332/***/ }), 2333
vendor: 513 bytes, lines 2334-2347
2334/***/ "./node_modules/axios/lib/env/data.js": 2335/*!********************************************!*\ 2336 !*** ./node_modules/axios/lib/env/data.js ***! 2337 \********************************************/ 2338/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2339 2340"use strict"; 2341/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2342/* harmony export */ VERSION: function() { return /* binding */ VERSION; } 2343/* harmony export */ }); 2344const VERSION = "1.13.2"; 2345 2346/***/ }), 2347
vendor: 2,047 bytes, lines 2348-2417
2348/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": 2349/*!****************************************************************!*\ 2350 !*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! 2351 \****************************************************************/ 2352/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2353 2354"use strict"; 2355/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); 2356 2357 2358 2359 2360/** 2361 * It encodes a string by replacing all characters that are not in the unreserved set with 2362 * their percent-encoded equivalents 2363 * 2364 * @param {string} str - The string to encode. 2365 * 2366 * @returns {string} The encoded string. 2367 */ 2368function encode(str) { 2369 const charMap = { 2370 '!': '%21', 2371 "'": '%27', 2372 '(': '%28', 2373 ')': '%29', 2374 '~': '%7E', 2375 '%20': '+', 2376 '%00': '\x00' 2377 }; 2378 return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { 2379 return charMap[match]; 2380 }); 2381} 2382 2383/** 2384 * It takes a params object and converts it to a FormData object 2385 * 2386 * @param {Object<string, any>} params - The parameters to be converted to a FormData object. 2387 * @param {Object<string, any>} options - The options object passed to the Axios constructor. 2388 * 2389 * @returns {void} 2390 */ 2391function AxiosURLSearchParams(params, options) { 2392 this._pairs = []; 2393 2394 params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); 2395} 2396 2397const prototype = AxiosURLSearchParams.prototype; 2398 2399prototype.append = function append(name, value) { 2400 this._pairs.push([name, value]); 2401}; 2402 2403prototype.toString = function toString(encoder) { 2404 const _encode = encoder ? function(value) { 2405 return encoder.call(this, value, encode); 2406 } : encode; 2407 2408 return this._pairs.map(function each(pair) { 2409 return _encode(pair[0]) + '=' + _encode(pair[1]); 2410 }, '').join('&'); 2411}; 2412 2413/* harmony default export */ __webpack_exports__["default"] = (AxiosURLSearchParams); 2414 2415 2416/***/ }), 2417
vendor: 2,164 bytes, lines 2418-2505
2418/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": 2419/*!**********************************************************!*\ 2420 !*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! 2421 \**********************************************************/ 2422/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 2423 2424"use strict"; 2425const HttpStatusCode = { 2426 Continue: 100, 2427 SwitchingProtocols: 101, 2428 Processing: 102, 2429 EarlyHints: 103, 2430 Ok: 200, 2431 Created: 201, 2432 Accepted: 202, 2433 NonAuthoritativeInformation: 203, 2434 NoContent: 204, 2435 ResetContent: 205, 2436 PartialContent: 206, 2437 MultiStatus: 207, 2438 AlreadyReported: 208, 2439 ImUsed: 226, 2440 MultipleChoices: 300, 2441 MovedPermanently: 301, 2442 Found: 302, 2443 SeeOther: 303, 2444 NotModified: 304, 2445 UseProxy: 305, 2446 Unused: 306, 2447 TemporaryRedirect: 307, 2448 PermanentRedirect: 308, 2449 BadRequest: 400, 2450 Unauthorized: 401, 2451 PaymentRequired: 402, 2452 Forbidden: 403, 2453 NotFound: 404, 2454 MethodNotAllowed: 405, 2455 NotAcceptable: 406, 2456 ProxyAuthenticationRequired: 407, 2457 RequestTimeout: 408, 2458 Conflict: 409, 2459 Gone: 410, 2460 LengthRequired: 411, 2461 PreconditionFailed: 412, 2462 PayloadTooLarge: 413, 2463 UriTooLong: 414, 2464 UnsupportedMediaType: 415, 2465 RangeNotSatisfiable: 416, 2466 ExpectationFailed: 417, 2467 ImATeapot: 418, 2468 MisdirectedRequest: 421, 2469 UnprocessableEntity: 422, 2470 Locked: 423, 2471 FailedDependency: 424, 2472 TooEarly: 425, 2473 UpgradeRequired: 426, 2474 PreconditionRequired: 428, 2475 TooManyRequests: 429, 2476 RequestHeaderFieldsTooLarge: 431, 2477 UnavailableForLegalReasons: 451, 2478 InternalServerError: 500, 2479 NotImplemented: 501, 2480 BadGateway: 502, 2481 ServiceUnavailable: 503, 2482 GatewayTimeout: 504, 2483 HttpVersionNotSupported: 505, 2484 VariantAlsoNegotiates: 506, 2485 InsufficientStorage: 507, 2486 LoopDetected: 508, 2487 NotExtended: 510, 2488 NetworkAuthenticationRequired: 511, 2489 WebServerIsDown: 521, 2490 ConnectionTimedOut: 522, 2491 OriginIsUnreachable: 523, 2492 TimeoutOccurred: 524, 2493 SslHandshakeFailed: 525, 2494 InvalidSslCertificate: 526, 2495}; 2496 2497Object.entries(HttpStatusCode).forEach(([key, value]) => { 2498 HttpStatusCode[value] = key; 2499}); 2500 2501/* harmony default export */ __webpack_exports__["default"] = (HttpStatusCode); 2502 2503 2504/***/ }), 2505
vendor: 919 bytes, lines 2506-2533
2506/***/ "./node_modules/axios/lib/helpers/bind.js": 2507/*!************************************************!*\ 2508 !*** ./node_modules/axios/lib/helpers/bind.js ***! 2509 \************************************************/ 2510/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2511 2512"use strict"; 2513/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2514/* harmony export */ "default": function() { return /* binding */ bind; } 2515/* harmony export */ }); 2516 2517 2518/** 2519 * Create a bound version of a function with a specified `this` context 2520 * 2521 * @param {Function} fn - The function to bind 2522 * @param {*} thisArg - The value to be passed as the `this` parameter 2523 * @returns {Function} A new function that will call the original function with the specified `this` context 2524 */ 2525function bind(fn, thisArg) { 2526 return function wrap() { 2527 return fn.apply(thisArg, arguments); 2528 }; 2529} 2530 2531 2532/***/ }), 2533
vendor: 2,493 bytes, lines 2534-2616
2534/***/ "./node_modules/axios/lib/helpers/buildURL.js": 2535/*!****************************************************!*\ 2536 !*** ./node_modules/axios/lib/helpers/buildURL.js ***! 2537 \****************************************************/ 2538/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2539 2540"use strict"; 2541/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2542/* harmony export */ "default": function() { return /* binding */ buildURL; } 2543/* harmony export */ }); 2544/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 2545/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); 2546 2547 2548 2549 2550 2551/** 2552 * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their 2553 * URI encoded counterparts 2554 * 2555 * @param {string} val The value to be encoded. 2556 * 2557 * @returns {string} The encoded value. 2558 */ 2559function encode(val) { 2560 return encodeURIComponent(val). 2561 replace(/%3A/gi, ':'). 2562 replace(/%24/g, '$'). 2563 replace(/%2C/gi, ','). 2564 replace(/%20/g, '+'); 2565} 2566 2567/** 2568 * Build a URL by appending params to the end 2569 * 2570 * @param {string} url The base of the url (e.g., http://www.google.com) 2571 * @param {object} [params] The params to be appended 2572 * @param {?(object|Function)} options 2573 * 2574 * @returns {string} The formatted url 2575 */ 2576function buildURL(url, params, options) { 2577 /*eslint no-param-reassign:0*/ 2578 if (!params) { 2579 return url; 2580 } 2581 2582 const _encode = options && options.encode || encode; 2583 2584 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(options)) { 2585 options = { 2586 serialize: options 2587 }; 2588 } 2589 2590 const serializeFn = options && options.serialize; 2591 2592 let serializedParams; 2593 2594 if (serializeFn) { 2595 serializedParams = serializeFn(params, options); 2596 } else { 2597 serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? 2598 params.toString() : 2599 new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); 2600 } 2601 2602 if (serializedParams) { 2603 const hashmarkIndex = url.indexOf("#"); 2604 2605 if (hashmarkIndex !== -1) { 2606 url = url.slice(0, hashmarkIndex); 2607 } 2608 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 2609 } 2610 2611 return url; 2612} 2613 2614 2615/***/ }), 2616
vendor: 892 bytes, lines 2617-2645
2617/***/ "./node_modules/axios/lib/helpers/combineURLs.js": 2618/*!*******************************************************!*\ 2619 !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! 2620 \*******************************************************/ 2621/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2622 2623"use strict"; 2624/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2625/* harmony export */ "default": function() { return /* binding */ combineURLs; } 2626/* harmony export */ }); 2627 2628 2629/** 2630 * Creates a new URL by combining the specified URLs 2631 * 2632 * @param {string} baseURL The base URL 2633 * @param {string} relativeURL The relative URL 2634 * 2635 * @returns {string} The combined URL 2636 */ 2637function combineURLs(baseURL, relativeURL) { 2638 return relativeURL 2639 ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') 2640 : baseURL; 2641} 2642 2643 2644/***/ }), 2645
vendor: 2,401 bytes, lines 2646-2707
2646/***/ "./node_modules/axios/lib/helpers/composeSignals.js": 2647/*!**********************************************************!*\ 2648 !*** ./node_modules/axios/lib/helpers/composeSignals.js ***! 2649 \**********************************************************/ 2650/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2651 2652"use strict"; 2653/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); 2654/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 2655/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 2656 2657 2658 2659 2660const composeSignals = (signals, timeout) => { 2661 const {length} = (signals = signals ? signals.filter(Boolean) : []); 2662 2663 if (timeout || length) { 2664 let controller = new AbortController(); 2665 2666 let aborted; 2667 2668 const onabort = function (reason) { 2669 if (!aborted) { 2670 aborted = true; 2671 unsubscribe(); 2672 const err = reason instanceof Error ? reason : this.reason; 2673 controller.abort(err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? err : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](err instanceof Error ? err.message : err)); 2674 } 2675 } 2676 2677 let timer = timeout && setTimeout(() => { 2678 timer = null; 2679 onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"](`timeout ${timeout} of ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ETIMEDOUT)) 2680 }, timeout) 2681 2682 const unsubscribe = () => { 2683 if (signals) { 2684 timer && clearTimeout(timer); 2685 timer = null; 2686 signals.forEach(signal => { 2687 signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); 2688 }); 2689 signals = null; 2690 } 2691 } 2692 2693 signals.forEach((signal) => signal.addEventListener('abort', onabort)); 2694 2695 const {signal} = controller; 2696 2697 signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(unsubscribe); 2698 2699 return signal; 2700 } 2701} 2702 2703/* harmony default export */ __webpack_exports__["default"] = (composeSignals); 2704 2705 2706/***/ }), 2707
vendor: 2,191 bytes, lines 2708-2773
2708/***/ "./node_modules/axios/lib/helpers/cookies.js": 2709/*!***************************************************!*\ 2710 !*** ./node_modules/axios/lib/helpers/cookies.js ***! 2711 \***************************************************/ 2712/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2713 2714"use strict"; 2715/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 2716/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 2717 2718 2719 2720/* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hasStandardBrowserEnv ? 2721 2722 // Standard browser envs support document.cookie 2723 { 2724 write(name, value, expires, path, domain, secure, sameSite) { 2725 if (typeof document === 'undefined') return; 2726 2727 const cookie = [`${name}=${encodeURIComponent(value)}`]; 2728 2729 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isNumber(expires)) { 2730 cookie.push(`expires=${new Date(expires).toUTCString()}`); 2731 } 2732 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(path)) { 2733 cookie.push(`path=${path}`); 2734 } 2735 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(domain)) { 2736 cookie.push(`domain=${domain}`); 2737 } 2738 if (secure === true) { 2739 cookie.push('secure'); 2740 } 2741 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(sameSite)) { 2742 cookie.push(`SameSite=${sameSite}`); 2743 } 2744 2745 document.cookie = cookie.join('; '); 2746 }, 2747 2748 read(name) { 2749 if (typeof document === 'undefined') return null; 2750 const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); 2751 return match ? decodeURIComponent(match[1]) : null; 2752 }, 2753 2754 remove(name) { 2755 this.write(name, '', Date.now() - 86400000, '/'); 2756 } 2757 } 2758 2759 : 2760 2761 // Non-standard browser env (web workers, react-native) lack needed support. 2762 { 2763 write() {}, 2764 read() { 2765 return null; 2766 }, 2767 remove() {} 2768 }); 2769 2770 2771 2772/***/ }), 2773
vendor: 3,039 bytes, lines 2774-2880
2774/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": 2775/*!**********************************************************!*\ 2776 !*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! 2777 \**********************************************************/ 2778/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2779 2780"use strict"; 2781/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 2782 2783 2784 2785 2786/** 2787 * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] 2788 * 2789 * @param {string} name - The name of the property to get. 2790 * 2791 * @returns An array of strings. 2792 */ 2793function parsePropPath(name) { 2794 // foo[x][y][z] 2795 // foo.x.y.z 2796 // foo-x-y-z 2797 // foo x y z 2798 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { 2799 return match[0] === '[]' ? '' : match[1] || match[0]; 2800 }); 2801} 2802 2803/** 2804 * Convert an array to an object. 2805 * 2806 * @param {Array<any>} arr - The array to convert to an object. 2807 * 2808 * @returns An object with the same keys and values as the array. 2809 */ 2810function arrayToObject(arr) { 2811 const obj = {}; 2812 const keys = Object.keys(arr); 2813 let i; 2814 const len = keys.length; 2815 let key; 2816 for (i = 0; i < len; i++) { 2817 key = keys[i]; 2818 obj[key] = arr[key]; 2819 } 2820 return obj; 2821} 2822 2823/** 2824 * It takes a FormData object and returns a JavaScript object 2825 * 2826 * @param {string} formData The FormData object to convert to JSON. 2827 * 2828 * @returns {Object<string, any> | null} The converted object. 2829 */ 2830function formDataToJSON(formData) { 2831 function buildPath(path, value, target, index) { 2832 let name = path[index++]; 2833 2834 if (name === '__proto__') return true; 2835 2836 const isNumericKey = Number.isFinite(+name); 2837 const isLast = index >= path.length; 2838 name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; 2839 2840 if (isLast) { 2841 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { 2842 target[name] = [target[name], value]; 2843 } else { 2844 target[name] = value; 2845 } 2846 2847 return !isNumericKey; 2848 } 2849 2850 if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { 2851 target[name] = []; 2852 } 2853 2854 const result = buildPath(path, value, target[name], index); 2855 2856 if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { 2857 target[name] = arrayToObject(target[name]); 2858 } 2859 2860 return !isNumericKey; 2861 } 2862 2863 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { 2864 const obj = {}; 2865 2866 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { 2867 buildPath(parsePropPath(name), value, obj, 0); 2868 }); 2869 2870 return obj; 2871 } 2872 2873 return null; 2874} 2875 2876/* harmony default export */ __webpack_exports__["default"] = (formDataToJSON); 2877 2878 2879/***/ }), 2880
vendor: 1,081 bytes, lines 2881-2909
2881/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": 2882/*!*********************************************************!*\ 2883 !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! 2884 \*********************************************************/ 2885/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2886 2887"use strict"; 2888/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2889/* harmony export */ "default": function() { return /* binding */ isAbsoluteURL; } 2890/* harmony export */ }); 2891 2892 2893/** 2894 * Determines whether the specified URL is absolute 2895 * 2896 * @param {string} url The URL to test 2897 * 2898 * @returns {boolean} True if the specified URL is absolute, otherwise false 2899 */ 2900function isAbsoluteURL(url) { 2901 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 2902 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 2903 // by any combination of letters, digits, plus, period, or hyphen. 2904 return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 2905} 2906 2907 2908/***/ }), 2909
vendor: 1,043 bytes, lines 2910-2938
2910/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": 2911/*!********************************************************!*\ 2912 !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! 2913 \********************************************************/ 2914/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2915 2916"use strict"; 2917/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2918/* harmony export */ "default": function() { return /* binding */ isAxiosError; } 2919/* harmony export */ }); 2920/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 2921 2922 2923 2924 2925/** 2926 * Determines whether the payload is an error thrown by Axios 2927 * 2928 * @param {*} payload The value to test 2929 * 2930 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false 2931 */ 2932function isAxiosError(payload) { 2933 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); 2934} 2935 2936 2937/***/ }), 2938
vendor: 1,225 bytes, lines 2939-2964
2939/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": 2940/*!***********************************************************!*\ 2941 !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! 2942 \***********************************************************/ 2943/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2944 2945"use strict"; 2946/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 2947 2948 2949/* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { 2950 url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin); 2951 2952 return ( 2953 origin.protocol === url.protocol && 2954 origin.host === url.host && 2955 (isMSIE || origin.port === url.port) 2956 ); 2957})( 2958 new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].origin), 2959 _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].navigator.userAgent) 2960) : () => true); 2961 2962 2963/***/ }), 2964
vendor: 420 bytes, lines 2965-2977
2965/***/ "./node_modules/axios/lib/helpers/null.js": 2966/*!************************************************!*\ 2967 !*** ./node_modules/axios/lib/helpers/null.js ***! 2968 \************************************************/ 2969/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 2970 2971"use strict"; 2972// eslint-disable-next-line strict 2973/* harmony default export */ __webpack_exports__["default"] = (null); 2974 2975 2976/***/ }), 2977
vendor: 1,941 bytes, lines 2978-3044
2978/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": 2979/*!********************************************************!*\ 2980 !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! 2981 \********************************************************/ 2982/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 2983 2984"use strict"; 2985/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); 2986 2987 2988 2989 2990// RawAxiosHeaders whose duplicates are ignored by node 2991// c.f. https://nodejs.org/api/http.html#http_message_headers 2992const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ 2993 'age', 'authorization', 'content-length', 'content-type', 'etag', 2994 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 2995 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 2996 'referer', 'retry-after', 'user-agent' 2997]); 2998 2999/** 3000 * Parse headers into an object 3001 * 3002 * ``` 3003 * Date: Wed, 27 Aug 2014 08:58:49 GMT 3004 * Content-Type: application/json 3005 * Connection: keep-alive 3006 * Transfer-Encoding: chunked 3007 * ``` 3008 * 3009 * @param {String} rawHeaders Headers needing to be parsed 3010 * 3011 * @returns {Object} Headers parsed into an object 3012 */ 3013/* harmony default export */ __webpack_exports__["default"] = (rawHeaders => { 3014 const parsed = {}; 3015 let key; 3016 let val; 3017 let i; 3018 3019 rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { 3020 i = line.indexOf(':'); 3021 key = line.substring(0, i).trim().toLowerCase(); 3022 val = line.substring(i + 1).trim(); 3023 3024 if (!key || (parsed[key] && ignoreDuplicateOf[key])) { 3025 return; 3026 } 3027 3028 if (key === 'set-cookie') { 3029 if (parsed[key]) { 3030 parsed[key].push(val); 3031 } else { 3032 parsed[key] = [val]; 3033 } 3034 } else { 3035 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 3036 } 3037 }); 3038 3039 return parsed; 3040}); 3041 3042 3043/***/ }), 3044
vendor: 671 bytes, lines 3045-3064
3045/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": 3046/*!*********************************************************!*\ 3047 !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! 3048 \*********************************************************/ 3049/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3050 3051"use strict"; 3052/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3053/* harmony export */ "default": function() { return /* binding */ parseProtocol; } 3054/* harmony export */ }); 3055 3056 3057function parseProtocol(url) { 3058 const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); 3059 return match && match[1] || ''; 3060} 3061 3062 3063/***/ }), 3064
vendor: 2,506 bytes, lines 3065-3127
3065/***/ "./node_modules/axios/lib/helpers/progressEventReducer.js": 3066/*!****************************************************************!*\ 3067 !*** ./node_modules/axios/lib/helpers/progressEventReducer.js ***! 3068 \****************************************************************/ 3069/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3070 3071"use strict"; 3072/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3073/* harmony export */ asyncDecorator: function() { return /* binding */ asyncDecorator; }, 3074/* harmony export */ progressEventDecorator: function() { return /* binding */ progressEventDecorator; }, 3075/* harmony export */ progressEventReducer: function() { return /* binding */ progressEventReducer; } 3076/* harmony export */ }); 3077/* harmony import */ var _speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); 3078/* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/axios/lib/helpers/throttle.js"); 3079/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 3080 3081 3082 3083 3084const progressEventReducer = (listener, isDownloadStream, freq = 3) => { 3085 let bytesNotified = 0; 3086 const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); 3087 3088 return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e => { 3089 const loaded = e.loaded; 3090 const total = e.lengthComputable ? e.total : undefined; 3091 const progressBytes = loaded - bytesNotified; 3092 const rate = _speedometer(progressBytes); 3093 const inRange = loaded <= total; 3094 3095 bytesNotified = loaded; 3096 3097 const data = { 3098 loaded, 3099 total, 3100 progress: total ? (loaded / total) : undefined, 3101 bytes: progressBytes, 3102 rate: rate ? rate : undefined, 3103 estimated: rate && total && inRange ? (total - loaded) / rate : undefined, 3104 event: e, 3105 lengthComputable: total != null, 3106 [isDownloadStream ? 'download' : 'upload']: true 3107 }; 3108 3109 listener(data); 3110 }, freq); 3111} 3112 3113const progressEventDecorator = (total, throttled) => { 3114 const lengthComputable = total != null; 3115 3116 return [(loaded) => throttled[0]({ 3117 lengthComputable, 3118 total, 3119 loaded 3120 }), throttled[1]]; 3121} 3122 3123const asyncDecorator = (fn) => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].asap(() => fn(...args)); 3124 3125 3126/***/ }), 3127
vendor: 4,197 bytes, lines 3128-3207
3128/***/ "./node_modules/axios/lib/helpers/resolveConfig.js": 3129/*!*********************************************************!*\ 3130 !*** ./node_modules/axios/lib/helpers/resolveConfig.js ***! 3131 \*********************************************************/ 3132/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3133 3134"use strict"; 3135/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 3136/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 3137/* harmony import */ var _isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); 3138/* harmony import */ var _cookies_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); 3139/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); 3140/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); 3141/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); 3142/* harmony import */ var _buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152/* harmony default export */ __webpack_exports__["default"] = ((config) => { 3153 const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_5__["default"])({}, config); 3154 3155 let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; 3156 3157 newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_6__["default"].from(headers); 3158 3159 newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); 3160 3161 // HTTP basic authentication 3162 if (auth) { 3163 headers.set('Authorization', 'Basic ' + 3164 btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) 3165 ); 3166 } 3167 3168 if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFormData(data)) { 3169 if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserWebWorkerEnv) { 3170 headers.setContentType(undefined); // browser handles it 3171 } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(data.getHeaders)) { 3172 // Node.js FormData (like form-data package) 3173 const formHeaders = data.getHeaders(); 3174 // Only set safe headers to avoid overwriting security headers 3175 const allowedHeaders = ['content-type', 'content-length']; 3176 Object.entries(formHeaders).forEach(([key, val]) => { 3177 if (allowedHeaders.includes(key.toLowerCase())) { 3178 headers.set(key, val); 3179 } 3180 }); 3181 } 3182 } 3183 3184 // Add xsrf header 3185 // This is only done if running in a standard browser environment. 3186 // Specifically not if we're in a web worker, or react-native. 3187 3188 if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasStandardBrowserEnv) { 3189 withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); 3190 3191 if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(newConfig.url))) { 3192 // Add xsrf header 3193 const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_3__["default"].read(xsrfCookieName); 3194 3195 if (xsrfValue) { 3196 headers.set(xsrfHeaderName, xsrfValue); 3197 } 3198 } 3199 } 3200 3201 return newConfig; 3202}); 3203 3204 3205 3206/***/ }), 3207
vendor: 1,471 bytes, lines 3208-3273
3208/***/ "./node_modules/axios/lib/helpers/speedometer.js": 3209/*!*******************************************************!*\ 3210 !*** ./node_modules/axios/lib/helpers/speedometer.js ***! 3211 \*******************************************************/ 3212/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 3213 3214"use strict"; 3215 3216 3217/** 3218 * Calculate data maxRate 3219 * @param {Number} [samplesCount= 10] 3220 * @param {Number} [min= 1000] 3221 * @returns {Function} 3222 */ 3223function speedometer(samplesCount, min) { 3224 samplesCount = samplesCount || 10; 3225 const bytes = new Array(samplesCount); 3226 const timestamps = new Array(samplesCount); 3227 let head = 0; 3228 let tail = 0; 3229 let firstSampleTS; 3230 3231 min = min !== undefined ? min : 1000; 3232 3233 return function push(chunkLength) { 3234 const now = Date.now(); 3235 3236 const startedAt = timestamps[tail]; 3237 3238 if (!firstSampleTS) { 3239 firstSampleTS = now; 3240 } 3241 3242 bytes[head] = chunkLength; 3243 timestamps[head] = now; 3244 3245 let i = tail; 3246 let bytesCount = 0; 3247 3248 while (i !== head) { 3249 bytesCount += bytes[i++]; 3250 i = i % samplesCount; 3251 } 3252 3253 head = (head + 1) % samplesCount; 3254 3255 if (head === tail) { 3256 tail = (tail + 1) % samplesCount; 3257 } 3258 3259 if (now - firstSampleTS < min) { 3260 return; 3261 } 3262 3263 const passed = startedAt && now - startedAt; 3264 3265 return passed ? Math.round(bytesCount * 1000 / passed) : undefined; 3266 }; 3267} 3268 3269/* harmony default export */ __webpack_exports__["default"] = (speedometer); 3270 3271 3272/***/ }), 3273
vendor: 1,049 bytes, lines 3274-3315
3274/***/ "./node_modules/axios/lib/helpers/spread.js": 3275/*!**************************************************!*\ 3276 !*** ./node_modules/axios/lib/helpers/spread.js ***! 3277 \**************************************************/ 3278/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3279 3280"use strict"; 3281/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3282/* harmony export */ "default": function() { return /* binding */ spread; } 3283/* harmony export */ }); 3284 3285 3286/** 3287 * Syntactic sugar for invoking a function and expanding an array for arguments. 3288 * 3289 * Common use case would be to use `Function.prototype.apply`. 3290 * 3291 * ```js 3292 * function f(x, y, z) {} 3293 * var args = [1, 2, 3]; 3294 * f.apply(null, args); 3295 * ``` 3296 * 3297 * With `spread` this example can be re-written. 3298 * 3299 * ```js 3300 * spread(function(x, y, z) {})([1, 2, 3]); 3301 * ``` 3302 * 3303 * @param {Function} callback 3304 * 3305 * @returns {Function} 3306 */ 3307function spread(callback) { 3308 return function wrap(arr) { 3309 return callback.apply(null, arr); 3310 }; 3311} 3312 3313 3314/***/ }), 3315
vendor: 1,232 bytes, lines 3316-3370
3316/***/ "./node_modules/axios/lib/helpers/throttle.js": 3317/*!****************************************************!*\ 3318 !*** ./node_modules/axios/lib/helpers/throttle.js ***! 3319 \****************************************************/ 3320/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 3321 3322"use strict"; 3323/** 3324 * Throttle decorator 3325 * @param {Function} fn 3326 * @param {Number} freq 3327 * @return {Function} 3328 */ 3329function throttle(fn, freq) { 3330 let timestamp = 0; 3331 let threshold = 1000 / freq; 3332 let lastArgs; 3333 let timer; 3334 3335 const invoke = (args, now = Date.now()) => { 3336 timestamp = now; 3337 lastArgs = null; 3338 if (timer) { 3339 clearTimeout(timer); 3340 timer = null; 3341 } 3342 fn(...args); 3343 } 3344 3345 const throttled = (...args) => { 3346 const now = Date.now(); 3347 const passed = now - timestamp; 3348 if ( passed >= threshold) { 3349 invoke(args, now); 3350 } else { 3351 lastArgs = args; 3352 if (!timer) { 3353 timer = setTimeout(() => { 3354 timer = null; 3355 invoke(lastArgs) 3356 }, threshold - passed); 3357 } 3358 } 3359 } 3360 3361 const flush = () => lastArgs && invoke(lastArgs); 3362 3363 return [throttled, flush]; 3364} 3365 3366/* harmony default export */ __webpack_exports__["default"] = (throttle); 3367 3368 3369/***/ }), 3370
vendor: 8,176 bytes, lines 3371-3607
3371/***/ "./node_modules/axios/lib/helpers/toFormData.js": 3372/*!******************************************************!*\ 3373 !*** ./node_modules/axios/lib/helpers/toFormData.js ***! 3374 \******************************************************/ 3375/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3376 3377"use strict"; 3378/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 3379/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 3380/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); 3381 3382 3383 3384 3385// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored 3386 3387 3388/** 3389 * Determines if the given thing is a array or js object. 3390 * 3391 * @param {string} thing - The object or array to be visited. 3392 * 3393 * @returns {boolean} 3394 */ 3395function isVisitable(thing) { 3396 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); 3397} 3398 3399/** 3400 * It removes the brackets from the end of a string 3401 * 3402 * @param {string} key - The key of the parameter. 3403 * 3404 * @returns {string} the key without the brackets. 3405 */ 3406function removeBrackets(key) { 3407 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; 3408} 3409 3410/** 3411 * It takes a path, a key, and a boolean, and returns a string 3412 * 3413 * @param {string} path - The path to the current key. 3414 * @param {string} key - The key of the current object being iterated over. 3415 * @param {string} dots - If true, the key will be rendered with dots instead of brackets. 3416 * 3417 * @returns {string} The path to the current key. 3418 */ 3419function renderKey(path, key, dots) { 3420 if (!path) return key; 3421 return path.concat(key).map(function each(token, i) { 3422 // eslint-disable-next-line no-param-reassign 3423 token = removeBrackets(token); 3424 return !dots && i ? '[' + token + ']' : token; 3425 }).join(dots ? '.' : ''); 3426} 3427 3428/** 3429 * If the array is an array and none of its elements are visitable, then it's a flat array. 3430 * 3431 * @param {Array<any>} arr - The array to check 3432 * 3433 * @returns {boolean} 3434 */ 3435function isFlatArray(arr) { 3436 return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); 3437} 3438 3439const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { 3440 return /^is[A-Z]/.test(prop); 3441}); 3442 3443/** 3444 * Convert a data object to FormData 3445 * 3446 * @param {Object} obj 3447 * @param {?Object} [formData] 3448 * @param {?Object} [options] 3449 * @param {Function} [options.visitor] 3450 * @param {Boolean} [options.metaTokens = true] 3451 * @param {Boolean} [options.dots = false] 3452 * @param {?Boolean} [options.indexes = false] 3453 * 3454 * @returns {Object} 3455 **/ 3456 3457/** 3458 * It converts an object into a FormData object 3459 * 3460 * @param {Object<any, any>} obj - The object to convert to form data. 3461 * @param {string} formData - The FormData object to append to. 3462 * @param {Object<string, any>} options 3463 * 3464 * @returns 3465 */ 3466function toFormData(obj, formData, options) { 3467 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { 3468 throw new TypeError('target must be an object'); 3469 } 3470 3471 // eslint-disable-next-line no-param-reassign 3472 formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__["default"] || FormData)(); 3473 3474 // eslint-disable-next-line no-param-reassign 3475 options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { 3476 metaTokens: true, 3477 dots: false, 3478 indexes: false 3479 }, false, function defined(option, source) { 3480 // eslint-disable-next-line no-eq-null,eqeqeq 3481 return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); 3482 }); 3483 3484 const metaTokens = options.metaTokens; 3485 // eslint-disable-next-line no-use-before-define 3486 const visitor = options.visitor || defaultVisitor; 3487 const dots = options.dots; 3488 const indexes = options.indexes; 3489 const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; 3490 const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); 3491 3492 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { 3493 throw new TypeError('visitor must be a function'); 3494 } 3495 3496 function convertValue(value) { 3497 if (value === null) return ''; 3498 3499 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { 3500 return value.toISOString(); 3501 } 3502 3503 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBoolean(value)) { 3504 return value.toString(); 3505 } 3506 3507 if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { 3508 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Blob is not supported. Use a Buffer instead.'); 3509 } 3510 3511 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { 3512 return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); 3513 } 3514 3515 return value; 3516 } 3517 3518 /** 3519 * Default visitor. 3520 * 3521 * @param {*} value 3522 * @param {String|Number} key 3523 * @param {Array<String|Number>} path 3524 * @this {FormData} 3525 * 3526 * @returns {boolean} return true to visit the each prop of the value recursively 3527 */ 3528 function defaultVisitor(value, key, path) { 3529 let arr = value; 3530 3531 if (value && !path && typeof value === 'object') { 3532 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { 3533 // eslint-disable-next-line no-param-reassign 3534 key = metaTokens ? key : key.slice(0, -2); 3535 // eslint-disable-next-line no-param-reassign 3536 value = JSON.stringify(value); 3537 } else if ( 3538 (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || 3539 ((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) 3540 )) { 3541 // eslint-disable-next-line no-param-reassign 3542 key = removeBrackets(key); 3543 3544 arr.forEach(function each(el, index) { 3545 !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( 3546 // eslint-disable-next-line no-nested-ternary 3547 indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), 3548 convertValue(el) 3549 ); 3550 }); 3551 return false; 3552 } 3553 } 3554 3555 if (isVisitable(value)) { 3556 return true; 3557 } 3558 3559 formData.append(renderKey(path, key, dots), convertValue(value)); 3560 3561 return false; 3562 } 3563 3564 const stack = []; 3565 3566 const exposedHelpers = Object.assign(predicates, { 3567 defaultVisitor, 3568 convertValue, 3569 isVisitable 3570 }); 3571 3572 function build(value, path) { 3573 if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; 3574 3575 if (stack.indexOf(value) !== -1) { 3576 throw Error('Circular reference detected in ' + path.join('.')); 3577 } 3578 3579 stack.push(value); 3580 3581 _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { 3582 const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( 3583 formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers 3584 ); 3585 3586 if (result === true) { 3587 build(el, path ? path.concat(key) : [key]); 3588 } 3589 }); 3590 3591 stack.pop(); 3592 } 3593 3594 if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { 3595 throw new TypeError('data must be an object'); 3596 } 3597 3598 build(obj); 3599 3600 return formData; 3601} 3602 3603/* harmony default export */ __webpack_exports__["default"] = (toFormData); 3604 3605 3606/***/ }), 3607
vendor: 1,628 bytes, lines 3608-3643
3608/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": 3609/*!************************************************************!*\ 3610 !*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! 3611 \************************************************************/ 3612/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3613 3614"use strict"; 3615/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3616/* harmony export */ "default": function() { return /* binding */ toURLEncodedForm; } 3617/* harmony export */ }); 3618/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); 3619/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); 3620/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); 3621 3622 3623 3624 3625 3626 3627function toURLEncodedForm(data, options) { 3628 return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].classes.URLSearchParams(), { 3629 visitor: function(value, key, path, helpers) { 3630 if (_platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(value)) { 3631 this.append(key, value.toString('base64')); 3632 return false; 3633 } 3634 3635 return helpers.defaultVisitor.apply(this, arguments); 3636 }, 3637 ...options 3638 }); 3639} 3640 3641 3642/***/ }), 3643
vendor: 2,257 bytes, lines 3644-3745
3644/***/ "./node_modules/axios/lib/helpers/trackStream.js": 3645/*!*******************************************************!*\ 3646 !*** ./node_modules/axios/lib/helpers/trackStream.js ***! 3647 \*******************************************************/ 3648/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3649 3650"use strict"; 3651/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3652/* harmony export */ trackStream: function() { return /* binding */ trackStream; } 3653/* harmony export */ }); 3654/* unused harmony exports streamChunk, readBytes */ 3655 3656const streamChunk = function* (chunk, chunkSize) { 3657 let len = chunk.byteLength; 3658 3659 if (!chunkSize || len < chunkSize) { 3660 yield chunk; 3661 return; 3662 } 3663 3664 let pos = 0; 3665 let end; 3666 3667 while (pos < len) { 3668 end = pos + chunkSize; 3669 yield chunk.slice(pos, end); 3670 pos = end; 3671 } 3672} 3673 3674const readBytes = async function* (iterable, chunkSize) { 3675 for await (const chunk of readStream(iterable)) { 3676 yield* streamChunk(chunk, chunkSize); 3677 } 3678} 3679 3680const readStream = async function* (stream) { 3681 if (stream[Symbol.asyncIterator]) { 3682 yield* stream; 3683 return; 3684 } 3685 3686 const reader = stream.getReader(); 3687 try { 3688 for (;;) { 3689 const {done, value} = await reader.read(); 3690 if (done) { 3691 break; 3692 } 3693 yield value; 3694 } 3695 } finally { 3696 await reader.cancel(); 3697 } 3698} 3699 3700const trackStream = (stream, chunkSize, onProgress, onFinish) => { 3701 const iterator = readBytes(stream, chunkSize); 3702 3703 let bytes = 0; 3704 let done; 3705 let _onFinish = (e) => { 3706 if (!done) { 3707 done = true; 3708 onFinish && onFinish(e); 3709 } 3710 } 3711 3712 return new ReadableStream({ 3713 async pull(controller) { 3714 try { 3715 const {done, value} = await iterator.next(); 3716 3717 if (done) { 3718 _onFinish(); 3719 controller.close(); 3720 return; 3721 } 3722 3723 let len = value.byteLength; 3724 if (onProgress) { 3725 let loadedBytes = bytes += len; 3726 onProgress(loadedBytes); 3727 } 3728 controller.enqueue(new Uint8Array(value)); 3729 } catch (err) { 3730 _onFinish(err); 3731 throw err; 3732 } 3733 }, 3734 cancel(reason) { 3735 _onFinish(reason); 3736 return iterator.return(); 3737 } 3738 }, { 3739 highWaterMark: 2 3740 }) 3741} 3742 3743 3744/***/ }), 3745
vendor: 3,850 bytes, lines 3746-3857
3746/***/ "./node_modules/axios/lib/helpers/validator.js": 3747/*!*****************************************************!*\ 3748 !*** ./node_modules/axios/lib/helpers/validator.js ***! 3749 \*****************************************************/ 3750/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3751 3752"use strict"; 3753/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); 3754/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); 3755 3756 3757 3758 3759 3760const validators = {}; 3761 3762// eslint-disable-next-line func-names 3763['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { 3764 validators[type] = function validator(thing) { 3765 return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; 3766 }; 3767}); 3768 3769const deprecatedWarnings = {}; 3770 3771/** 3772 * Transitional option validator 3773 * 3774 * @param {function|boolean?} validator - set to false if the transitional option has been removed 3775 * @param {string?} version - deprecated version / removed since version 3776 * @param {string?} message - some message with additional info 3777 * 3778 * @returns {function} 3779 */ 3780validators.transitional = function transitional(validator, version, message) { 3781 function formatMessage(opt, desc) { 3782 return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); 3783 } 3784 3785 // eslint-disable-next-line func-names 3786 return (value, opt, opts) => { 3787 if (validator === false) { 3788 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( 3789 formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), 3790 _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED 3791 ); 3792 } 3793 3794 if (version && !deprecatedWarnings[opt]) { 3795 deprecatedWarnings[opt] = true; 3796 // eslint-disable-next-line no-console 3797 console.warn( 3798 formatMessage( 3799 opt, 3800 ' has been deprecated since v' + version + ' and will be removed in the near future' 3801 ) 3802 ); 3803 } 3804 3805 return validator ? validator(value, opt, opts) : true; 3806 }; 3807}; 3808 3809validators.spelling = function spelling(correctSpelling) { 3810 return (value, opt) => { 3811 // eslint-disable-next-line no-console 3812 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 3813 return true; 3814 } 3815}; 3816 3817/** 3818 * Assert object's properties type 3819 * 3820 * @param {object} options 3821 * @param {object} schema 3822 * @param {boolean?} allowUnknown 3823 * 3824 * @returns {object} 3825 */ 3826 3827function assertOptions(options, schema, allowUnknown) { 3828 if (typeof options !== 'object') { 3829 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); 3830 } 3831 const keys = Object.keys(options); 3832 let i = keys.length; 3833 while (i-- > 0) { 3834 const opt = keys[i]; 3835 const validator = schema[opt]; 3836 if (validator) { 3837 const value = options[opt]; 3838 const result = value === undefined || validator(value, opt, options); 3839 if (result !== true) { 3840 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); 3841 } 3842 continue; 3843 } 3844 if (allowUnknown !== true) { 3845 throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); 3846 } 3847 } 3848} 3849 3850/* harmony default export */ __webpack_exports__["default"] = ({ 3851 assertOptions, 3852 validators 3853}); 3854 3855 3856/***/ }), 3857
vendor: 492 bytes, lines 3858-3871
3858/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": 3859/*!*****************************************************************!*\ 3860 !*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! 3861 \*****************************************************************/ 3862/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 3863 3864"use strict"; 3865 3866 3867/* harmony default export */ __webpack_exports__["default"] = (typeof Blob !== 'undefined' ? Blob : null); 3868 3869 3870/***/ }), 3871
vendor: 516 bytes, lines 3872-3885
3872/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": 3873/*!*********************************************************************!*\ 3874 !*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! 3875 \*********************************************************************/ 3876/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 3877 3878"use strict"; 3879 3880 3881/* harmony default export */ __webpack_exports__["default"] = (typeof FormData !== 'undefined' ? FormData : null); 3882 3883 3884/***/ }), 3885
vendor: 866 bytes, lines 3886-3901
3886/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": 3887/*!****************************************************************************!*\ 3888 !*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! 3889 \****************************************************************************/ 3890/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3891 3892"use strict"; 3893/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); 3894 3895 3896 3897/* harmony default export */ __webpack_exports__["default"] = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); 3898 3899 3900/***/ }), 3901
vendor: 1,366 bytes, lines 3902-3928
3902/***/ "./node_modules/axios/lib/platform/browser/index.js": 3903/*!**********************************************************!*\ 3904 !*** ./node_modules/axios/lib/platform/browser/index.js ***! 3905 \**********************************************************/ 3906/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3907 3908"use strict"; 3909/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); 3910/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); 3911/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); 3912 3913 3914 3915 3916/* harmony default export */ __webpack_exports__["default"] = ({ 3917 isBrowser: true, 3918 classes: { 3919 URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], 3920 FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], 3921 Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] 3922 }, 3923 protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] 3924}); 3925 3926 3927/***/ }), 3928
vendor: 2,458 bytes, lines 3929-3992
3929/***/ "./node_modules/axios/lib/platform/common/utils.js": 3930/*!*********************************************************!*\ 3931 !*** ./node_modules/axios/lib/platform/common/utils.js ***! 3932 \*********************************************************/ 3933/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3934 3935"use strict"; 3936__webpack_require__.r(__webpack_exports__); 3937/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3938/* harmony export */ hasBrowserEnv: function() { return /* binding */ hasBrowserEnv; }, 3939/* harmony export */ hasStandardBrowserEnv: function() { return /* binding */ hasStandardBrowserEnv; }, 3940/* harmony export */ hasStandardBrowserWebWorkerEnv: function() { return /* binding */ hasStandardBrowserWebWorkerEnv; }, 3941/* harmony export */ navigator: function() { return /* binding */ _navigator; }, 3942/* harmony export */ origin: function() { return /* binding */ origin; } 3943/* harmony export */ }); 3944const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; 3945 3946const _navigator = typeof navigator === 'object' && navigator || undefined; 3947 3948/** 3949 * Determine if we're running in a standard browser environment 3950 * 3951 * This allows axios to run in a web worker, and react-native. 3952 * Both environments support XMLHttpRequest, but not fully standard globals. 3953 * 3954 * web workers: 3955 * typeof window -> undefined 3956 * typeof document -> undefined 3957 * 3958 * react-native: 3959 * navigator.product -> 'ReactNative' 3960 * nativescript 3961 * navigator.product -> 'NativeScript' or 'NS' 3962 * 3963 * @returns {boolean} 3964 */ 3965const hasStandardBrowserEnv = hasBrowserEnv && 3966 (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); 3967 3968/** 3969 * Determine if we're running in a standard browser webWorker environment 3970 * 3971 * Although the `isStandardBrowserEnv` method indicates that 3972 * `allows axios to run in a web worker`, the WebWorker will still be 3973 * filtered out due to its judgment standard 3974 * `typeof window !== 'undefined' && typeof document !== 'undefined'`. 3975 * This leads to a problem when axios post `FormData` in webWorker 3976 */ 3977const hasStandardBrowserWebWorkerEnv = (() => { 3978 return ( 3979 typeof WorkerGlobalScope !== 'undefined' && 3980 // eslint-disable-next-line no-undef 3981 self instanceof WorkerGlobalScope && 3982 typeof self.importScripts === 'function' 3983 ); 3984})(); 3985 3986const origin = hasBrowserEnv && window.location.href || 'http://localhost'; 3987 3988 3989 3990 3991/***/ }), 3992
vendor: 869 bytes, lines 3993-4012
3993/***/ "./node_modules/axios/lib/platform/index.js": 3994/*!**************************************************!*\ 3995 !*** ./node_modules/axios/lib/platform/index.js ***! 3996 \**************************************************/ 3997/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3998 3999"use strict"; 4000/* harmony import */ var _node_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); 4001/* harmony import */ var _common_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/utils.js */ "./node_modules/axios/lib/platform/common/utils.js"); 4002 4003 4004 4005/* harmony default export */ __webpack_exports__["default"] = ({ 4006 ..._common_utils_js__WEBPACK_IMPORTED_MODULE_1__, 4007 ..._node_index_js__WEBPACK_IMPORTED_MODULE_0__["default"] 4008}); 4009 4010 4011/***/ }), 4012
vendor: 19,755 bytes, lines 4013-4806
4013/***/ "./node_modules/axios/lib/utils.js": 4014/*!*****************************************!*\ 4015 !*** ./node_modules/axios/lib/utils.js ***! 4016 \*****************************************/ 4017/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 4018 4019"use strict"; 4020/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); 4021 4022 4023 4024 4025// utils is a library of generic helper functions non-specific to axios 4026 4027const {toString} = Object.prototype; 4028const {getPrototypeOf} = Object; 4029const {iterator, toStringTag} = Symbol; 4030 4031const kindOf = (cache => thing => { 4032 const str = toString.call(thing); 4033 return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); 4034})(Object.create(null)); 4035 4036const kindOfTest = (type) => { 4037 type = type.toLowerCase(); 4038 return (thing) => kindOf(thing) === type 4039} 4040 4041const typeOfTest = type => thing => typeof thing === type; 4042 4043/** 4044 * Determine if a value is an Array 4045 * 4046 * @param {Object} val The value to test 4047 * 4048 * @returns {boolean} True if value is an Array, otherwise false 4049 */ 4050const {isArray} = Array; 4051 4052/** 4053 * Determine if a value is undefined 4054 * 4055 * @param {*} val The value to test 4056 * 4057 * @returns {boolean} True if the value is undefined, otherwise false 4058 */ 4059const isUndefined = typeOfTest('undefined'); 4060 4061/** 4062 * Determine if a value is a Buffer 4063 * 4064 * @param {*} val The value to test 4065 * 4066 * @returns {boolean} True if value is a Buffer, otherwise false 4067 */ 4068function isBuffer(val) { 4069 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) 4070 && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); 4071} 4072 4073/** 4074 * Determine if a value is an ArrayBuffer 4075 * 4076 * @param {*} val The value to test 4077 * 4078 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 4079 */ 4080const isArrayBuffer = kindOfTest('ArrayBuffer'); 4081 4082 4083/** 4084 * Determine if a value is a view on an ArrayBuffer 4085 * 4086 * @param {*} val The value to test 4087 * 4088 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 4089 */ 4090function isArrayBufferView(val) { 4091 let result; 4092 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 4093 result = ArrayBuffer.isView(val); 4094 } else { 4095 result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); 4096 } 4097 return result; 4098} 4099 4100/** 4101 * Determine if a value is a String 4102 * 4103 * @param {*} val The value to test 4104 * 4105 * @returns {boolean} True if value is a String, otherwise false 4106 */ 4107const isString = typeOfTest('string'); 4108 4109/** 4110 * Determine if a value is a Function 4111 * 4112 * @param {*} val The value to test 4113 * @returns {boolean} True if value is a Function, otherwise false 4114 */ 4115const isFunction = typeOfTest('function'); 4116 4117/** 4118 * Determine if a value is a Number 4119 * 4120 * @param {*} val The value to test 4121 * 4122 * @returns {boolean} True if value is a Number, otherwise false 4123 */ 4124const isNumber = typeOfTest('number'); 4125 4126/** 4127 * Determine if a value is an Object 4128 * 4129 * @param {*} thing The value to test 4130 * 4131 * @returns {boolean} True if value is an Object, otherwise false 4132 */ 4133const isObject = (thing) => thing !== null && typeof thing === 'object'; 4134 4135/** 4136 * Determine if a value is a Boolean 4137 * 4138 * @param {*} thing The value to test 4139 * @returns {boolean} True if value is a Boolean, otherwise false 4140 */ 4141const isBoolean = thing => thing === true || thing === false; 4142 4143/** 4144 * Determine if a value is a plain Object 4145 * 4146 * @param {*} val The value to test 4147 * 4148 * @returns {boolean} True if value is a plain Object, otherwise false 4149 */ 4150const isPlainObject = (val) => { 4151 if (kindOf(val) !== 'object') { 4152 return false; 4153 } 4154 4155 const prototype = getPrototypeOf(val); 4156 return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); 4157} 4158 4159/** 4160 * Determine if a value is an empty object (safely handles Buffers) 4161 * 4162 * @param {*} val The value to test 4163 * 4164 * @returns {boolean} True if value is an empty object, otherwise false 4165 */ 4166const isEmptyObject = (val) => { 4167 // Early return for non-objects or Buffers to prevent RangeError 4168 if (!isObject(val) || isBuffer(val)) { 4169 return false; 4170 } 4171 4172 try { 4173 return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; 4174 } catch (e) { 4175 // Fallback for any other objects that might cause RangeError with Object.keys() 4176 return false; 4177 } 4178} 4179 4180/** 4181 * Determine if a value is a Date 4182 * 4183 * @param {*} val The value to test 4184 * 4185 * @returns {boolean} True if value is a Date, otherwise false 4186 */ 4187const isDate = kindOfTest('Date'); 4188 4189/** 4190 * Determine if a value is a File 4191 * 4192 * @param {*} val The value to test 4193 * 4194 * @returns {boolean} True if value is a File, otherwise false 4195 */ 4196const isFile = kindOfTest('File'); 4197 4198/** 4199 * Determine if a value is a Blob 4200 * 4201 * @param {*} val The value to test 4202 * 4203 * @returns {boolean} True if value is a Blob, otherwise false 4204 */ 4205const isBlob = kindOfTest('Blob'); 4206 4207/** 4208 * Determine if a value is a FileList 4209 * 4210 * @param {*} val The value to test 4211 * 4212 * @returns {boolean} True if value is a File, otherwise false 4213 */ 4214const isFileList = kindOfTest('FileList'); 4215 4216/** 4217 * Determine if a value is a Stream 4218 * 4219 * @param {*} val The value to test 4220 * 4221 * @returns {boolean} True if value is a Stream, otherwise false 4222 */ 4223const isStream = (val) => isObject(val) && isFunction(val.pipe); 4224 4225/** 4226 * Determine if a value is a FormData 4227 * 4228 * @param {*} thing The value to test 4229 * 4230 * @returns {boolean} True if value is an FormData, otherwise false 4231 */ 4232const isFormData = (thing) => { 4233 let kind; 4234 return thing && ( 4235 (typeof FormData === 'function' && thing instanceof FormData) || ( 4236 isFunction(thing.append) && ( 4237 (kind = kindOf(thing)) === 'formdata' || 4238 // detect form-data instance 4239 (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') 4240 ) 4241 ) 4242 ) 4243} 4244 4245/** 4246 * Determine if a value is a URLSearchParams object 4247 * 4248 * @param {*} val The value to test 4249 * 4250 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 4251 */ 4252const isURLSearchParams = kindOfTest('URLSearchParams'); 4253 4254const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); 4255 4256/** 4257 * Trim excess whitespace off the beginning and end of a string 4258 * 4259 * @param {String} str The String to trim 4260 * 4261 * @returns {String} The String freed of excess whitespace 4262 */ 4263const trim = (str) => str.trim ? 4264 str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); 4265 4266/** 4267 * Iterate over an Array or an Object invoking a function for each item. 4268 * 4269 * If `obj` is an Array callback will be called passing 4270 * the value, index, and complete array for each item. 4271 * 4272 * If 'obj' is an Object callback will be called passing 4273 * the value, key, and complete object for each property. 4274 * 4275 * @param {Object|Array} obj The object to iterate 4276 * @param {Function} fn The callback to invoke for each item 4277 * 4278 * @param {Boolean} [allOwnKeys = false] 4279 * @returns {any} 4280 */ 4281function forEach(obj, fn, {allOwnKeys = false} = {}) { 4282 // Don't bother if no value provided 4283 if (obj === null || typeof obj === 'undefined') { 4284 return; 4285 } 4286 4287 let i; 4288 let l; 4289 4290 // Force an array if not already something iterable 4291 if (typeof obj !== 'object') { 4292 /*eslint no-param-reassign:0*/ 4293 obj = [obj]; 4294 } 4295 4296 if (isArray(obj)) { 4297 // Iterate over array values 4298 for (i = 0, l = obj.length; i < l; i++) { 4299 fn.call(null, obj[i], i, obj); 4300 } 4301 } else { 4302 // Buffer check 4303 if (isBuffer(obj)) { 4304 return; 4305 } 4306 4307 // Iterate over object keys 4308 const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); 4309 const len = keys.length; 4310 let key; 4311 4312 for (i = 0; i < len; i++) { 4313 key = keys[i]; 4314 fn.call(null, obj[key], key, obj); 4315 } 4316 } 4317} 4318 4319function findKey(obj, key) { 4320 if (isBuffer(obj)){ 4321 return null; 4322 } 4323 4324 key = key.toLowerCase(); 4325 const keys = Object.keys(obj); 4326 let i = keys.length; 4327 let _key; 4328 while (i-- > 0) { 4329 _key = keys[i]; 4330 if (key === _key.toLowerCase()) { 4331 return _key; 4332 } 4333 } 4334 return null; 4335} 4336 4337const _global = (() => { 4338 /*eslint no-undef:0*/ 4339 if (typeof globalThis !== "undefined") return globalThis; 4340 return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g) 4341})(); 4342 4343const isContextDefined = (context) => !isUndefined(context) && context !== _global; 4344 4345/** 4346 * Accepts varargs expecting each argument to be an object, then 4347 * immutably merges the properties of each object and returns result. 4348 * 4349 * When multiple objects contain the same key the later object in 4350 * the arguments list will take precedence. 4351 * 4352 * Example: 4353 * 4354 * ```js 4355 * var result = merge({foo: 123}, {foo: 456}); 4356 * console.log(result.foo); // outputs 456 4357 * ``` 4358 * 4359 * @param {Object} obj1 Object to merge 4360 * 4361 * @returns {Object} Result of all merge properties 4362 */ 4363function merge(/* obj1, obj2, obj3, ... */) { 4364 const {caseless, skipUndefined} = isContextDefined(this) && this || {}; 4365 const result = {}; 4366 const assignValue = (val, key) => { 4367 const targetKey = caseless && findKey(result, key) || key; 4368 if (isPlainObject(result[targetKey]) && isPlainObject(val)) { 4369 result[targetKey] = merge(result[targetKey], val); 4370 } else if (isPlainObject(val)) { 4371 result[targetKey] = merge({}, val); 4372 } else if (isArray(val)) { 4373 result[targetKey] = val.slice(); 4374 } else if (!skipUndefined || !isUndefined(val)) { 4375 result[targetKey] = val; 4376 } 4377 } 4378 4379 for (let i = 0, l = arguments.length; i < l; i++) { 4380 arguments[i] && forEach(arguments[i], assignValue); 4381 } 4382 return result; 4383} 4384 4385/** 4386 * Extends object a by mutably adding to it the properties of object b. 4387 * 4388 * @param {Object} a The object to be extended 4389 * @param {Object} b The object to copy properties from 4390 * @param {Object} thisArg The object to bind function to 4391 * 4392 * @param {Boolean} [allOwnKeys] 4393 * @returns {Object} The resulting value of object a 4394 */ 4395const extend = (a, b, thisArg, {allOwnKeys}= {}) => { 4396 forEach(b, (val, key) => { 4397 if (thisArg && isFunction(val)) { 4398 a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); 4399 } else { 4400 a[key] = val; 4401 } 4402 }, {allOwnKeys}); 4403 return a; 4404} 4405 4406/** 4407 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 4408 * 4409 * @param {string} content with BOM 4410 * 4411 * @returns {string} content value without BOM 4412 */ 4413const stripBOM = (content) => { 4414 if (content.charCodeAt(0) === 0xFEFF) { 4415 content = content.slice(1); 4416 } 4417 return content; 4418} 4419 4420/** 4421 * Inherit the prototype methods from one constructor into another 4422 * @param {function} constructor 4423 * @param {function} superConstructor 4424 * @param {object} [props] 4425 * @param {object} [descriptors] 4426 * 4427 * @returns {void} 4428 */ 4429const inherits = (constructor, superConstructor, props, descriptors) => { 4430 constructor.prototype = Object.create(superConstructor.prototype, descriptors); 4431 constructor.prototype.constructor = constructor; 4432 Object.defineProperty(constructor, 'super', { 4433 value: superConstructor.prototype 4434 }); 4435 props && Object.assign(constructor.prototype, props); 4436} 4437 4438/** 4439 * Resolve object with deep prototype chain to a flat object 4440 * @param {Object} sourceObj source object 4441 * @param {Object} [destObj] 4442 * @param {Function|Boolean} [filter] 4443 * @param {Function} [propFilter] 4444 * 4445 * @returns {Object} 4446 */ 4447const toFlatObject = (sourceObj, destObj, filter, propFilter) => { 4448 let props; 4449 let i; 4450 let prop; 4451 const merged = {}; 4452 4453 destObj = destObj || {}; 4454 // eslint-disable-next-line no-eq-null,eqeqeq 4455 if (sourceObj == null) return destObj; 4456 4457 do { 4458 props = Object.getOwnPropertyNames(sourceObj); 4459 i = props.length; 4460 while (i-- > 0) { 4461 prop = props[i]; 4462 if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { 4463 destObj[prop] = sourceObj[prop]; 4464 merged[prop] = true; 4465 } 4466 } 4467 sourceObj = filter !== false && getPrototypeOf(sourceObj); 4468 } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); 4469 4470 return destObj; 4471} 4472 4473/** 4474 * Determines whether a string ends with the characters of a specified string 4475 * 4476 * @param {String} str 4477 * @param {String} searchString 4478 * @param {Number} [position= 0] 4479 * 4480 * @returns {boolean} 4481 */ 4482const endsWith = (str, searchString, position) => { 4483 str = String(str); 4484 if (position === undefined || position > str.length) { 4485 position = str.length; 4486 } 4487 position -= searchString.length; 4488 const lastIndex = str.indexOf(searchString, position); 4489 return lastIndex !== -1 && lastIndex === position; 4490} 4491 4492 4493/** 4494 * Returns new array from array like object or null if failed 4495 * 4496 * @param {*} [thing] 4497 * 4498 * @returns {?Array} 4499 */ 4500const toArray = (thing) => { 4501 if (!thing) return null; 4502 if (isArray(thing)) return thing; 4503 let i = thing.length; 4504 if (!isNumber(i)) return null; 4505 const arr = new Array(i); 4506 while (i-- > 0) { 4507 arr[i] = thing[i]; 4508 } 4509 return arr; 4510} 4511 4512/** 4513 * Checking if the Uint8Array exists and if it does, it returns a function that checks if the 4514 * thing passed in is an instance of Uint8Array 4515 * 4516 * @param {TypedArray} 4517 * 4518 * @returns {Array} 4519 */ 4520// eslint-disable-next-line func-names 4521const isTypedArray = (TypedArray => { 4522 // eslint-disable-next-line func-names 4523 return thing => { 4524 return TypedArray && thing instanceof TypedArray; 4525 }; 4526})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); 4527 4528/** 4529 * For each entry in the object, call the function with the key and value. 4530 * 4531 * @param {Object<any, any>} obj - The object to iterate over. 4532 * @param {Function} fn - The function to call for each entry. 4533 * 4534 * @returns {void} 4535 */ 4536const forEachEntry = (obj, fn) => { 4537 const generator = obj && obj[iterator]; 4538 4539 const _iterator = generator.call(obj); 4540 4541 let result; 4542 4543 while ((result = _iterator.next()) && !result.done) { 4544 const pair = result.value; 4545 fn.call(obj, pair[0], pair[1]); 4546 } 4547} 4548 4549/** 4550 * It takes a regular expression and a string, and returns an array of all the matches 4551 * 4552 * @param {string} regExp - The regular expression to match against. 4553 * @param {string} str - The string to search. 4554 * 4555 * @returns {Array<boolean>} 4556 */ 4557const matchAll = (regExp, str) => { 4558 let matches; 4559 const arr = []; 4560 4561 while ((matches = regExp.exec(str)) !== null) { 4562 arr.push(matches); 4563 } 4564 4565 return arr; 4566} 4567 4568/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ 4569const isHTMLForm = kindOfTest('HTMLFormElement'); 4570 4571const toCamelCase = str => { 4572 return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, 4573 function replacer(m, p1, p2) { 4574 return p1.toUpperCase() + p2; 4575 } 4576 ); 4577}; 4578 4579/* Creating a function that will check if an object has a property. */ 4580const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); 4581 4582/** 4583 * Determine if a value is a RegExp object 4584 * 4585 * @param {*} val The value to test 4586 * 4587 * @returns {boolean} True if value is a RegExp object, otherwise false 4588 */ 4589const isRegExp = kindOfTest('RegExp'); 4590 4591const reduceDescriptors = (obj, reducer) => { 4592 const descriptors = Object.getOwnPropertyDescriptors(obj); 4593 const reducedDescriptors = {}; 4594 4595 forEach(descriptors, (descriptor, name) => { 4596 let ret; 4597 if ((ret = reducer(descriptor, name, obj)) !== false) { 4598 reducedDescriptors[name] = ret || descriptor; 4599 } 4600 }); 4601 4602 Object.defineProperties(obj, reducedDescriptors); 4603} 4604 4605/** 4606 * Makes all methods read-only 4607 * @param {Object} obj 4608 */ 4609 4610const freezeMethods = (obj) => { 4611 reduceDescriptors(obj, (descriptor, name) => { 4612 // skip restricted props in strict mode 4613 if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { 4614 return false; 4615 } 4616 4617 const value = obj[name]; 4618 4619 if (!isFunction(value)) return; 4620 4621 descriptor.enumerable = false; 4622 4623 if ('writable' in descriptor) { 4624 descriptor.writable = false; 4625 return; 4626 } 4627 4628 if (!descriptor.set) { 4629 descriptor.set = () => { 4630 throw Error('Can not rewrite read-only method \'' + name + '\''); 4631 }; 4632 } 4633 }); 4634} 4635 4636const toObjectSet = (arrayOrString, delimiter) => { 4637 const obj = {}; 4638 4639 const define = (arr) => { 4640 arr.forEach(value => { 4641 obj[value] = true; 4642 }); 4643 } 4644 4645 isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); 4646 4647 return obj; 4648} 4649 4650const noop = () => {} 4651 4652const toFiniteNumber = (value, defaultValue) => { 4653 return value != null && Number.isFinite(value = +value) ? value : defaultValue; 4654} 4655 4656 4657 4658/** 4659 * If the thing is a FormData object, return true, otherwise return false. 4660 * 4661 * @param {unknown} thing - The thing to check. 4662 * 4663 * @returns {boolean} 4664 */ 4665function isSpecCompliantForm(thing) { 4666 return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); 4667} 4668 4669const toJSONObject = (obj) => { 4670 const stack = new Array(10); 4671 4672 const visit = (source, i) => { 4673 4674 if (isObject(source)) { 4675 if (stack.indexOf(source) >= 0) { 4676 return; 4677 } 4678 4679 //Buffer check 4680 if (isBuffer(source)) { 4681 return source; 4682 } 4683 4684 if(!('toJSON' in source)) { 4685 stack[i] = source; 4686 const target = isArray(source) ? [] : {}; 4687 4688 forEach(source, (value, key) => { 4689 const reducedValue = visit(value, i + 1); 4690 !isUndefined(reducedValue) && (target[key] = reducedValue); 4691 }); 4692 4693 stack[i] = undefined; 4694 4695 return target; 4696 } 4697 } 4698 4699 return source; 4700 } 4701 4702 return visit(obj, 0); 4703} 4704 4705const isAsyncFn = kindOfTest('AsyncFunction'); 4706 4707const isThenable = (thing) => 4708 thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); 4709 4710// original code 4711// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 4712 4713const _setImmediate = ((setImmediateSupported, postMessageSupported) => { 4714 if (setImmediateSupported) { 4715 return setImmediate; 4716 } 4717 4718 return postMessageSupported ? ((token, callbacks) => { 4719 _global.addEventListener("message", ({source, data}) => { 4720 if (source === _global && data === token) { 4721 callbacks.length && callbacks.shift()(); 4722 } 4723 }, false); 4724 4725 return (cb) => { 4726 callbacks.push(cb); 4727 _global.postMessage(token, "*"); 4728 } 4729 })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); 4730})( 4731 typeof setImmediate === 'function', 4732 isFunction(_global.postMessage) 4733); 4734 4735const asap = typeof queueMicrotask !== 'undefined' ? 4736 queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); 4737 4738// ********************* 4739 4740 4741const isIterable = (thing) => thing != null && isFunction(thing[iterator]); 4742 4743 4744/* harmony default export */ __webpack_exports__["default"] = ({ 4745 isArray, 4746 isArrayBuffer, 4747 isBuffer, 4748 isFormData, 4749 isArrayBufferView, 4750 isString, 4751 isNumber, 4752 isBoolean, 4753 isObject, 4754 isPlainObject, 4755 isEmptyObject, 4756 isReadableStream, 4757 isRequest, 4758 isResponse, 4759 isHeaders, 4760 isUndefined, 4761 isDate, 4762 isFile, 4763 isBlob, 4764 isRegExp, 4765 isFunction, 4766 isStream, 4767 isURLSearchParams, 4768 isTypedArray, 4769 isFileList, 4770 forEach, 4771 merge, 4772 extend, 4773 trim, 4774 stripBOM, 4775 inherits, 4776 toFlatObject, 4777 kindOf, 4778 kindOfTest, 4779 endsWith, 4780 toArray, 4781 forEachEntry, 4782 matchAll, 4783 isHTMLForm, 4784 hasOwnProperty, 4785 hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection 4786 reduceDescriptors, 4787 freezeMethods, 4788 toObjectSet, 4789 toCamelCase, 4790 noop, 4791 toFiniteNumber, 4792 findKey, 4793 global: _global, 4794 isContextDefined, 4795 isSpecCompliantForm, 4796 toJSONObject, 4797 isAsyncFn, 4798 isThenable, 4799 setImmediate: _setImmediate, 4800 asap, 4801 isIterable 4802}); 4803 4804 4805/***/ }), 4806
vendor: 39,314 bytes, lines 4807-6356
4807/***/ "./node_modules/dom7/dom7.esm.js": 4808/*!***************************************!*\ 4809 !*** ./node_modules/dom7/dom7.esm.js ***! 4810 \***************************************/ 4811/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 4812 4813"use strict"; 4814/* harmony export */ __webpack_require__.d(__webpack_exports__, { 4815/* harmony export */ $: function() { return /* binding */ $; }, 4816/* harmony export */ addClass: function() { return /* binding */ addClass; }, 4817/* harmony export */ append: function() { return /* binding */ append; }, 4818/* harmony export */ attr: function() { return /* binding */ attr; }, 4819/* harmony export */ children: function() { return /* binding */ children; }, 4820/* harmony export */ closest: function() { return /* binding */ closest; }, 4821/* harmony export */ css: function() { return /* binding */ css; }, 4822/* harmony export */ each: function() { return /* binding */ each; }, 4823/* harmony export */ eq: function() { return /* binding */ eq; }, 4824/* harmony export */ filter: function() { return /* binding */ filter; }, 4825/* harmony export */ find: function() { return /* binding */ find; }, 4826/* harmony export */ hasClass: function() { return /* binding */ hasClass; }, 4827/* harmony export */ html: function() { return /* binding */ html; }, 4828/* harmony export */ index: function() { return /* binding */ index; }, 4829/* harmony export */ is: function() { return /* binding */ is; }, 4830/* harmony export */ next: function() { return /* binding */ next; }, 4831/* harmony export */ nextAll: function() { return /* binding */ nextAll; }, 4832/* harmony export */ off: function() { return /* binding */ off; }, 4833/* harmony export */ offset: function() { return /* binding */ offset; }, 4834/* harmony export */ on: function() { return /* binding */ on; }, 4835/* harmony export */ outerHeight: function() { return /* binding */ outerHeight; }, 4836/* harmony export */ outerWidth: function() { return /* binding */ outerWidth; }, 4837/* harmony export */ parent: function() { return /* binding */ parent; }, 4838/* harmony export */ parents: function() { return /* binding */ parents; }, 4839/* harmony export */ prepend: function() { return /* binding */ prepend; }, 4840/* harmony export */ prev: function() { return /* binding */ prev; }, 4841/* harmony export */ prevAll: function() { return /* binding */ prevAll; }, 4842/* harmony export */ remove: function() { return /* binding */ remove; }, 4843/* harmony export */ removeAttr: function() { return /* binding */ removeAttr; }, 4844/* harmony export */ removeClass: function() { return /* binding */ removeClass; }, 4845/* harmony export */ styles: function() { return /* binding */ styles; }, 4846/* harmony export */ text: function() { return /* binding */ text; }, 4847/* harmony export */ toggleClass: function() { return /* binding */ toggleClass; }, 4848/* harmony export */ transform: function() { return /* binding */ transform; }, 4849/* harmony export */ transition: function() { return /* binding */ transition; }, 4850/* harmony export */ transitionEnd: function() { return /* binding */ transitionEnd; }, 4851/* harmony export */ trigger: function() { return /* binding */ trigger; } 4852/* harmony export */ }); 4853/* unused harmony exports add, animate, animationEnd, appendTo, blur, change, click, data, dataset, detach, empty, focus, focusin, focusout, height, hide, insertAfter, insertBefore, keydown, keypress, keyup, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, once, prependTo, prop, removeData, resize, scroll, scrollLeft, scrollTo, scrollTop, show, siblings, stop, submit, touchend, touchmove, touchstart, transitionStart, val, value, width */ 4854/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 4855/** 4856 * Dom7 4.0.6 4857 * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API 4858 * https://framework7.io/docs/dom7.html 4859 * 4860 * Copyright 2023, Vladimir Kharlampidi 4861 * 4862 * Licensed under MIT 4863 * 4864 * Released on: February 2, 2023 4865 */ 4866 4867 4868/* eslint-disable no-proto */ 4869function makeReactive(obj) { 4870 const proto = obj.__proto__; 4871 Object.defineProperty(obj, '__proto__', { 4872 get() { 4873 return proto; 4874 }, 4875 4876 set(value) { 4877 proto.__proto__ = value; 4878 } 4879 4880 }); 4881} 4882 4883class Dom7 extends Array { 4884 constructor(items) { 4885 if (typeof items === 'number') { 4886 super(items); 4887 } else { 4888 super(...(items || [])); 4889 makeReactive(this); 4890 } 4891 } 4892 4893} 4894 4895function arrayFlat(arr = []) { 4896 const res = []; 4897 arr.forEach(el => { 4898 if (Array.isArray(el)) { 4899 res.push(...arrayFlat(el)); 4900 } else { 4901 res.push(el); 4902 } 4903 }); 4904 return res; 4905} 4906function arrayFilter(arr, callback) { 4907 return Array.prototype.filter.call(arr, callback); 4908} 4909function arrayUnique(arr) { 4910 const uniqueArray = []; 4911 4912 for (let i = 0; i < arr.length; i += 1) { 4913 if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]); 4914 } 4915 4916 return uniqueArray; 4917} 4918function toCamelCase(string) { 4919 return string.toLowerCase().replace(/-(.)/g, (match, group) => group.toUpperCase()); 4920} 4921 4922// eslint-disable-next-line 4923 4924function qsa(selector, context) { 4925 if (typeof selector !== 'string') { 4926 return [selector]; 4927 } 4928 4929 const a = []; 4930 const res = context.querySelectorAll(selector); 4931 4932 for (let i = 0; i < res.length; i += 1) { 4933 a.push(res[i]); 4934 } 4935 4936 return a; 4937} 4938 4939function $(selector, context) { 4940 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 4941 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 4942 let arr = []; 4943 4944 if (!context && selector instanceof Dom7) { 4945 return selector; 4946 } 4947 4948 if (!selector) { 4949 return new Dom7(arr); 4950 } 4951 4952 if (typeof selector === 'string') { 4953 const html = selector.trim(); 4954 4955 if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { 4956 let toCreate = 'div'; 4957 if (html.indexOf('<li') === 0) toCreate = 'ul'; 4958 if (html.indexOf('<tr') === 0) toCreate = 'tbody'; 4959 if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr'; 4960 if (html.indexOf('<tbody') === 0) toCreate = 'table'; 4961 if (html.indexOf('<option') === 0) toCreate = 'select'; 4962 const tempParent = document.createElement(toCreate); 4963 tempParent.innerHTML = html; 4964 4965 for (let i = 0; i < tempParent.childNodes.length; i += 1) { 4966 arr.push(tempParent.childNodes[i]); 4967 } 4968 } else { 4969 arr = qsa(selector.trim(), context || document); 4970 } // arr = qsa(selector, document); 4971 4972 } else if (selector.nodeType || selector === window || selector === document) { 4973 arr.push(selector); 4974 } else if (Array.isArray(selector)) { 4975 if (selector instanceof Dom7) return selector; 4976 arr = selector; 4977 } 4978 4979 return new Dom7(arrayUnique(arr)); 4980} 4981 4982$.fn = Dom7.prototype; 4983 4984// eslint-disable-next-line 4985 4986function addClass(...classes) { 4987 const classNames = arrayFlat(classes.map(c => c.split(' '))); 4988 this.forEach(el => { 4989 el.classList.add(...classNames); 4990 }); 4991 return this; 4992} 4993 4994function removeClass(...classes) { 4995 const classNames = arrayFlat(classes.map(c => c.split(' '))); 4996 this.forEach(el => { 4997 el.classList.remove(...classNames); 4998 }); 4999 return this; 5000} 5001 5002function toggleClass(...classes) { 5003 const classNames = arrayFlat(classes.map(c => c.split(' '))); 5004 this.forEach(el => { 5005 classNames.forEach(className => { 5006 el.classList.toggle(className); 5007 }); 5008 }); 5009} 5010 5011function hasClass(...classes) { 5012 const classNames = arrayFlat(classes.map(c => c.split(' '))); 5013 return arrayFilter(this, el => { 5014 return classNames.filter(className => el.classList.contains(className)).length > 0; 5015 }).length > 0; 5016} 5017 5018function attr(attrs, value) { 5019 if (arguments.length === 1 && typeof attrs === 'string') { 5020 // Get attr 5021 if (this[0]) return this[0].getAttribute(attrs); 5022 return undefined; 5023 } // Set attrs 5024 5025 5026 for (let i = 0; i < this.length; i += 1) { 5027 if (arguments.length === 2) { 5028 // String 5029 this[i].setAttribute(attrs, value); 5030 } else { 5031 // Object 5032 for (const attrName in attrs) { 5033 this[i][attrName] = attrs[attrName]; 5034 this[i].setAttribute(attrName, attrs[attrName]); 5035 } 5036 } 5037 } 5038 5039 return this; 5040} 5041 5042function removeAttr(attr) { 5043 for (let i = 0; i < this.length; i += 1) { 5044 this[i].removeAttribute(attr); 5045 } 5046 5047 return this; 5048} 5049 5050function prop(props, value) { 5051 if (arguments.length === 1 && typeof props === 'string') { 5052 // Get prop 5053 if (this[0]) return this[0][props]; 5054 } else { 5055 // Set props 5056 for (let i = 0; i < this.length; i += 1) { 5057 if (arguments.length === 2) { 5058 // String 5059 this[i][props] = value; 5060 } else { 5061 // Object 5062 for (const propName in props) { 5063 this[i][propName] = props[propName]; 5064 } 5065 } 5066 } 5067 5068 return this; 5069 } 5070 5071 return this; 5072} 5073 5074function data(key, value) { 5075 let el; 5076 5077 if (typeof value === 'undefined') { 5078 el = this[0]; 5079 if (!el) return undefined; // Get value 5080 5081 if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) { 5082 return el.dom7ElementDataStorage[key]; 5083 } 5084 5085 const dataKey = el.getAttribute(`data-${key}`); 5086 5087 if (dataKey) { 5088 return dataKey; 5089 } 5090 5091 return undefined; 5092 } // Set value 5093 5094 5095 for (let i = 0; i < this.length; i += 1) { 5096 el = this[i]; 5097 if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {}; 5098 el.dom7ElementDataStorage[key] = value; 5099 } 5100 5101 return this; 5102} 5103 5104function removeData(key) { 5105 for (let i = 0; i < this.length; i += 1) { 5106 const el = this[i]; 5107 5108 if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) { 5109 el.dom7ElementDataStorage[key] = null; 5110 delete el.dom7ElementDataStorage[key]; 5111 } 5112 } 5113} 5114 5115function dataset() { 5116 const el = this[0]; 5117 if (!el) return undefined; 5118 const dataset = {}; // eslint-disable-line 5119 5120 if (el.dataset) { 5121 for (const dataKey in el.dataset) { 5122 dataset[dataKey] = el.dataset[dataKey]; 5123 } 5124 } else { 5125 for (let i = 0; i < el.attributes.length; i += 1) { 5126 const attr = el.attributes[i]; 5127 5128 if (attr.name.indexOf('data-') >= 0) { 5129 dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value; 5130 } 5131 } 5132 } 5133 5134 for (const key in dataset) { 5135 if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1; 5136 } 5137 5138 return dataset; 5139} 5140 5141function val(value) { 5142 if (typeof value === 'undefined') { 5143 // get value 5144 const el = this[0]; 5145 if (!el) return undefined; 5146 5147 if (el.multiple && el.nodeName.toLowerCase() === 'select') { 5148 const values = []; 5149 5150 for (let i = 0; i < el.selectedOptions.length; i += 1) { 5151 values.push(el.selectedOptions[i].value); 5152 } 5153 5154 return values; 5155 } 5156 5157 return el.value; 5158 } // set value 5159 5160 5161 for (let i = 0; i < this.length; i += 1) { 5162 const el = this[i]; 5163 5164 if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') { 5165 for (let j = 0; j < el.options.length; j += 1) { 5166 el.options[j].selected = value.indexOf(el.options[j].value) >= 0; 5167 } 5168 } else { 5169 el.value = value; 5170 } 5171 } 5172 5173 return this; 5174} 5175 5176function value(value) { 5177 return this.val(value); 5178} 5179 5180function transform(transform) { 5181 for (let i = 0; i < this.length; i += 1) { 5182 this[i].style.transform = transform; 5183 } 5184 5185 return this; 5186} 5187 5188function transition(duration) { 5189 for (let i = 0; i < this.length; i += 1) { 5190 this[i].style.transitionDuration = typeof duration !== 'string' ? `${duration}ms` : duration; 5191 } 5192 5193 return this; 5194} 5195 5196function on(...args) { 5197 let [eventType, targetSelector, listener, capture] = args; 5198 5199 if (typeof args[1] === 'function') { 5200 [eventType, listener, capture] = args; 5201 targetSelector = undefined; 5202 } 5203 5204 if (!capture) capture = false; 5205 5206 function handleLiveEvent(e) { 5207 const target = e.target; 5208 if (!target) return; 5209 const eventData = e.target.dom7EventData || []; 5210 5211 if (eventData.indexOf(e) < 0) { 5212 eventData.unshift(e); 5213 } 5214 5215 if ($(target).is(targetSelector)) listener.apply(target, eventData);else { 5216 const parents = $(target).parents(); // eslint-disable-line 5217 5218 for (let k = 0; k < parents.length; k += 1) { 5219 if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData); 5220 } 5221 } 5222 } 5223 5224 function handleEvent(e) { 5225 const eventData = e && e.target ? e.target.dom7EventData || [] : []; 5226 5227 if (eventData.indexOf(e) < 0) { 5228 eventData.unshift(e); 5229 } 5230 5231 listener.apply(this, eventData); 5232 } 5233 5234 const events = eventType.split(' '); 5235 let j; 5236 5237 for (let i = 0; i < this.length; i += 1) { 5238 const el = this[i]; 5239 5240 if (!targetSelector) { 5241 for (j = 0; j < events.length; j += 1) { 5242 const event = events[j]; 5243 if (!el.dom7Listeners) el.dom7Listeners = {}; 5244 if (!el.dom7Listeners[event]) el.dom7Listeners[event] = []; 5245 el.dom7Listeners[event].push({ 5246 listener, 5247 proxyListener: handleEvent 5248 }); 5249 el.addEventListener(event, handleEvent, capture); 5250 } 5251 } else { 5252 // Live events 5253 for (j = 0; j < events.length; j += 1) { 5254 const event = events[j]; 5255 if (!el.dom7LiveListeners) el.dom7LiveListeners = {}; 5256 if (!el.dom7LiveListeners[event]) el.dom7LiveListeners[event] = []; 5257 el.dom7LiveListeners[event].push({ 5258 listener, 5259 proxyListener: handleLiveEvent 5260 }); 5261 el.addEventListener(event, handleLiveEvent, capture); 5262 } 5263 } 5264 } 5265 5266 return this; 5267} 5268 5269function off(...args) { 5270 let [eventType, targetSelector, listener, capture] = args; 5271 5272 if (typeof args[1] === 'function') { 5273 [eventType, listener, capture] = args; 5274 targetSelector = undefined; 5275 } 5276 5277 if (!capture) capture = false; 5278 const events = eventType.split(' '); 5279 5280 for (let i = 0; i < events.length; i += 1) { 5281 const event = events[i]; 5282 5283 for (let j = 0; j < this.length; j += 1) { 5284 const el = this[j]; 5285 let handlers; 5286 5287 if (!targetSelector && el.dom7Listeners) { 5288 handlers = el.dom7Listeners[event]; 5289 } else if (targetSelector && el.dom7LiveListeners) { 5290 handlers = el.dom7LiveListeners[event]; 5291 } 5292 5293 if (handlers && handlers.length) { 5294 for (let k = handlers.length - 1; k >= 0; k -= 1) { 5295 const handler = handlers[k]; 5296 5297 if (listener && handler.listener === listener) { 5298 el.removeEventListener(event, handler.proxyListener, capture); 5299 handlers.splice(k, 1); 5300 } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) { 5301 el.removeEventListener(event, handler.proxyListener, capture); 5302 handlers.splice(k, 1); 5303 } else if (!listener) { 5304 el.removeEventListener(event, handler.proxyListener, capture); 5305 handlers.splice(k, 1); 5306 } 5307 } 5308 } 5309 } 5310 } 5311 5312 return this; 5313} 5314 5315function once(...args) { 5316 const dom = this; 5317 let [eventName, targetSelector, listener, capture] = args; 5318 5319 if (typeof args[1] === 'function') { 5320 [eventName, listener, capture] = args; 5321 targetSelector = undefined; 5322 } 5323 5324 function onceHandler(...eventArgs) { 5325 listener.apply(this, eventArgs); 5326 dom.off(eventName, targetSelector, onceHandler, capture); 5327 5328 if (onceHandler.dom7proxy) { 5329 delete onceHandler.dom7proxy; 5330 } 5331 } 5332 5333 onceHandler.dom7proxy = listener; 5334 return dom.on(eventName, targetSelector, onceHandler, capture); 5335} 5336 5337function trigger(...args) { 5338 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5339 const events = args[0].split(' '); 5340 const eventData = args[1]; 5341 5342 for (let i = 0; i < events.length; i += 1) { 5343 const event = events[i]; 5344 5345 for (let j = 0; j < this.length; j += 1) { 5346 const el = this[j]; 5347 5348 if (window.CustomEvent) { 5349 const evt = new window.CustomEvent(event, { 5350 detail: eventData, 5351 bubbles: true, 5352 cancelable: true 5353 }); 5354 el.dom7EventData = args.filter((data, dataIndex) => dataIndex > 0); 5355 el.dispatchEvent(evt); 5356 el.dom7EventData = []; 5357 delete el.dom7EventData; 5358 } 5359 } 5360 } 5361 5362 return this; 5363} 5364 5365function transitionStart(callback) { 5366 const dom = this; 5367 5368 function fireCallBack(e) { 5369 if (e.target !== this) return; 5370 callback.call(this, e); 5371 dom.off('transitionstart', fireCallBack); 5372 } 5373 5374 if (callback) { 5375 dom.on('transitionstart', fireCallBack); 5376 } 5377 5378 return this; 5379} 5380 5381function transitionEnd(callback) { 5382 const dom = this; 5383 5384 function fireCallBack(e) { 5385 if (e.target !== this) return; 5386 callback.call(this, e); 5387 dom.off('transitionend', fireCallBack); 5388 } 5389 5390 if (callback) { 5391 dom.on('transitionend', fireCallBack); 5392 } 5393 5394 return this; 5395} 5396 5397function animationEnd(callback) { 5398 const dom = this; 5399 5400 function fireCallBack(e) { 5401 if (e.target !== this) return; 5402 callback.call(this, e); 5403 dom.off('animationend', fireCallBack); 5404 } 5405 5406 if (callback) { 5407 dom.on('animationend', fireCallBack); 5408 } 5409 5410 return this; 5411} 5412 5413function width() { 5414 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5415 5416 if (this[0] === window) { 5417 return window.innerWidth; 5418 } 5419 5420 if (this.length > 0) { 5421 return parseFloat(this.css('width')); 5422 } 5423 5424 return null; 5425} 5426 5427function outerWidth(includeMargins) { 5428 if (this.length > 0) { 5429 if (includeMargins) { 5430 const styles = this.styles(); 5431 return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left')); 5432 } 5433 5434 return this[0].offsetWidth; 5435 } 5436 5437 return null; 5438} 5439 5440function height() { 5441 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5442 5443 if (this[0] === window) { 5444 return window.innerHeight; 5445 } 5446 5447 if (this.length > 0) { 5448 return parseFloat(this.css('height')); 5449 } 5450 5451 return null; 5452} 5453 5454function outerHeight(includeMargins) { 5455 if (this.length > 0) { 5456 if (includeMargins) { 5457 const styles = this.styles(); 5458 return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom')); 5459 } 5460 5461 return this[0].offsetHeight; 5462 } 5463 5464 return null; 5465} 5466 5467function offset() { 5468 if (this.length > 0) { 5469 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5470 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 5471 const el = this[0]; 5472 const box = el.getBoundingClientRect(); 5473 const body = document.body; 5474 const clientTop = el.clientTop || body.clientTop || 0; 5475 const clientLeft = el.clientLeft || body.clientLeft || 0; 5476 const scrollTop = el === window ? window.scrollY : el.scrollTop; 5477 const scrollLeft = el === window ? window.scrollX : el.scrollLeft; 5478 return { 5479 top: box.top + scrollTop - clientTop, 5480 left: box.left + scrollLeft - clientLeft 5481 }; 5482 } 5483 5484 return null; 5485} 5486 5487function hide() { 5488 for (let i = 0; i < this.length; i += 1) { 5489 this[i].style.display = 'none'; 5490 } 5491 5492 return this; 5493} 5494 5495function show() { 5496 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5497 5498 for (let i = 0; i < this.length; i += 1) { 5499 const el = this[i]; 5500 5501 if (el.style.display === 'none') { 5502 el.style.display = ''; 5503 } 5504 5505 if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') { 5506 // Still not visible 5507 el.style.display = 'block'; 5508 } 5509 } 5510 5511 return this; 5512} 5513 5514function styles() { 5515 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5516 if (this[0]) return window.getComputedStyle(this[0], null); 5517 return {}; 5518} 5519 5520function css(props, value) { 5521 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5522 let i; 5523 5524 if (arguments.length === 1) { 5525 if (typeof props === 'string') { 5526 // .css('width') 5527 if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props); 5528 } else { 5529 // .css({ width: '100px' }) 5530 for (i = 0; i < this.length; i += 1) { 5531 for (const prop in props) { 5532 this[i].style[prop] = props[prop]; 5533 } 5534 } 5535 5536 return this; 5537 } 5538 } 5539 5540 if (arguments.length === 2 && typeof props === 'string') { 5541 // .css('width', '100px') 5542 for (i = 0; i < this.length; i += 1) { 5543 this[i].style[props] = value; 5544 } 5545 5546 return this; 5547 } 5548 5549 return this; 5550} 5551 5552function each(callback) { 5553 if (!callback) return this; 5554 this.forEach((el, index) => { 5555 callback.apply(el, [el, index]); 5556 }); 5557 return this; 5558} 5559 5560function filter(callback) { 5561 const result = arrayFilter(this, callback); 5562 return $(result); 5563} 5564 5565function html(html) { 5566 if (typeof html === 'undefined') { 5567 return this[0] ? this[0].innerHTML : null; 5568 } 5569 5570 for (let i = 0; i < this.length; i += 1) { 5571 this[i].innerHTML = html; 5572 } 5573 5574 return this; 5575} 5576 5577function text(text) { 5578 if (typeof text === 'undefined') { 5579 return this[0] ? this[0].textContent.trim() : null; 5580 } 5581 5582 for (let i = 0; i < this.length; i += 1) { 5583 this[i].textContent = text; 5584 } 5585 5586 return this; 5587} 5588 5589function is(selector) { 5590 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5591 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 5592 const el = this[0]; 5593 let compareWith; 5594 let i; 5595 if (!el || typeof selector === 'undefined') return false; 5596 5597 if (typeof selector === 'string') { 5598 if (el.matches) return el.matches(selector); 5599 if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector); 5600 if (el.msMatchesSelector) return el.msMatchesSelector(selector); 5601 compareWith = $(selector); 5602 5603 for (i = 0; i < compareWith.length; i += 1) { 5604 if (compareWith[i] === el) return true; 5605 } 5606 5607 return false; 5608 } 5609 5610 if (selector === document) { 5611 return el === document; 5612 } 5613 5614 if (selector === window) { 5615 return el === window; 5616 } 5617 5618 if (selector.nodeType || selector instanceof Dom7) { 5619 compareWith = selector.nodeType ? [selector] : selector; 5620 5621 for (i = 0; i < compareWith.length; i += 1) { 5622 if (compareWith[i] === el) return true; 5623 } 5624 5625 return false; 5626 } 5627 5628 return false; 5629} 5630 5631function index() { 5632 let child = this[0]; 5633 let i; 5634 5635 if (child) { 5636 i = 0; // eslint-disable-next-line 5637 5638 while ((child = child.previousSibling) !== null) { 5639 if (child.nodeType === 1) i += 1; 5640 } 5641 5642 return i; 5643 } 5644 5645 return undefined; 5646} 5647 5648function eq(index) { 5649 if (typeof index === 'undefined') return this; 5650 const length = this.length; 5651 5652 if (index > length - 1) { 5653 return $([]); 5654 } 5655 5656 if (index < 0) { 5657 const returnIndex = length + index; 5658 if (returnIndex < 0) return $([]); 5659 return $([this[returnIndex]]); 5660 } 5661 5662 return $([this[index]]); 5663} 5664 5665function append(...els) { 5666 let newChild; 5667 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 5668 5669 for (let k = 0; k < els.length; k += 1) { 5670 newChild = els[k]; 5671 5672 for (let i = 0; i < this.length; i += 1) { 5673 if (typeof newChild === 'string') { 5674 const tempDiv = document.createElement('div'); 5675 tempDiv.innerHTML = newChild; 5676 5677 while (tempDiv.firstChild) { 5678 this[i].appendChild(tempDiv.firstChild); 5679 } 5680 } else if (newChild instanceof Dom7) { 5681 for (let j = 0; j < newChild.length; j += 1) { 5682 this[i].appendChild(newChild[j]); 5683 } 5684 } else { 5685 this[i].appendChild(newChild); 5686 } 5687 } 5688 } 5689 5690 return this; 5691} 5692 5693function appendTo(parent) { 5694 $(parent).append(this); 5695 return this; 5696} 5697 5698function prepend(newChild) { 5699 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 5700 let i; 5701 let j; 5702 5703 for (i = 0; i < this.length; i += 1) { 5704 if (typeof newChild === 'string') { 5705 const tempDiv = document.createElement('div'); 5706 tempDiv.innerHTML = newChild; 5707 5708 for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) { 5709 this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]); 5710 } 5711 } else if (newChild instanceof Dom7) { 5712 for (j = 0; j < newChild.length; j += 1) { 5713 this[i].insertBefore(newChild[j], this[i].childNodes[0]); 5714 } 5715 } else { 5716 this[i].insertBefore(newChild, this[i].childNodes[0]); 5717 } 5718 } 5719 5720 return this; 5721} 5722 5723function prependTo(parent) { 5724 $(parent).prepend(this); 5725 return this; 5726} 5727 5728function insertBefore(selector) { 5729 const before = $(selector); 5730 5731 for (let i = 0; i < this.length; i += 1) { 5732 if (before.length === 1) { 5733 before[0].parentNode.insertBefore(this[i], before[0]); 5734 } else if (before.length > 1) { 5735 for (let j = 0; j < before.length; j += 1) { 5736 before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]); 5737 } 5738 } 5739 } 5740} 5741 5742function insertAfter(selector) { 5743 const after = $(selector); 5744 5745 for (let i = 0; i < this.length; i += 1) { 5746 if (after.length === 1) { 5747 after[0].parentNode.insertBefore(this[i], after[0].nextSibling); 5748 } else if (after.length > 1) { 5749 for (let j = 0; j < after.length; j += 1) { 5750 after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling); 5751 } 5752 } 5753 } 5754} 5755 5756function next(selector) { 5757 if (this.length > 0) { 5758 if (selector) { 5759 if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) { 5760 return $([this[0].nextElementSibling]); 5761 } 5762 5763 return $([]); 5764 } 5765 5766 if (this[0].nextElementSibling) return $([this[0].nextElementSibling]); 5767 return $([]); 5768 } 5769 5770 return $([]); 5771} 5772 5773function nextAll(selector) { 5774 const nextEls = []; 5775 let el = this[0]; 5776 if (!el) return $([]); 5777 5778 while (el.nextElementSibling) { 5779 const next = el.nextElementSibling; // eslint-disable-line 5780 5781 if (selector) { 5782 if ($(next).is(selector)) nextEls.push(next); 5783 } else nextEls.push(next); 5784 5785 el = next; 5786 } 5787 5788 return $(nextEls); 5789} 5790 5791function prev(selector) { 5792 if (this.length > 0) { 5793 const el = this[0]; 5794 5795 if (selector) { 5796 if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) { 5797 return $([el.previousElementSibling]); 5798 } 5799 5800 return $([]); 5801 } 5802 5803 if (el.previousElementSibling) return $([el.previousElementSibling]); 5804 return $([]); 5805 } 5806 5807 return $([]); 5808} 5809 5810function prevAll(selector) { 5811 const prevEls = []; 5812 let el = this[0]; 5813 if (!el) return $([]); 5814 5815 while (el.previousElementSibling) { 5816 const prev = el.previousElementSibling; // eslint-disable-line 5817 5818 if (selector) { 5819 if ($(prev).is(selector)) prevEls.push(prev); 5820 } else prevEls.push(prev); 5821 5822 el = prev; 5823 } 5824 5825 return $(prevEls); 5826} 5827 5828function siblings(selector) { 5829 return this.nextAll(selector).add(this.prevAll(selector)); 5830} 5831 5832function parent(selector) { 5833 const parents = []; // eslint-disable-line 5834 5835 for (let i = 0; i < this.length; i += 1) { 5836 if (this[i].parentNode !== null) { 5837 if (selector) { 5838 if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); 5839 } else { 5840 parents.push(this[i].parentNode); 5841 } 5842 } 5843 } 5844 5845 return $(parents); 5846} 5847 5848function parents(selector) { 5849 const parents = []; // eslint-disable-line 5850 5851 for (let i = 0; i < this.length; i += 1) { 5852 let parent = this[i].parentNode; // eslint-disable-line 5853 5854 while (parent) { 5855 if (selector) { 5856 if ($(parent).is(selector)) parents.push(parent); 5857 } else { 5858 parents.push(parent); 5859 } 5860 5861 parent = parent.parentNode; 5862 } 5863 } 5864 5865 return $(parents); 5866} 5867 5868function closest(selector) { 5869 let closest = this; // eslint-disable-line 5870 5871 if (typeof selector === 'undefined') { 5872 return $([]); 5873 } 5874 5875 if (!closest.is(selector)) { 5876 closest = closest.parents(selector).eq(0); 5877 } 5878 5879 return closest; 5880} 5881 5882function find(selector) { 5883 const foundElements = []; 5884 5885 for (let i = 0; i < this.length; i += 1) { 5886 const found = this[i].querySelectorAll(selector); 5887 5888 for (let j = 0; j < found.length; j += 1) { 5889 foundElements.push(found[j]); 5890 } 5891 } 5892 5893 return $(foundElements); 5894} 5895 5896function children(selector) { 5897 const children = []; // eslint-disable-line 5898 5899 for (let i = 0; i < this.length; i += 1) { 5900 const childNodes = this[i].children; 5901 5902 for (let j = 0; j < childNodes.length; j += 1) { 5903 if (!selector || $(childNodes[j]).is(selector)) { 5904 children.push(childNodes[j]); 5905 } 5906 } 5907 } 5908 5909 return $(children); 5910} 5911 5912function remove() { 5913 for (let i = 0; i < this.length; i += 1) { 5914 if (this[i].parentNode) this[i].parentNode.removeChild(this[i]); 5915 } 5916 5917 return this; 5918} 5919 5920function detach() { 5921 return this.remove(); 5922} 5923 5924function add(...els) { 5925 const dom = this; 5926 let i; 5927 let j; 5928 5929 for (i = 0; i < els.length; i += 1) { 5930 const toAdd = $(els[i]); 5931 5932 for (j = 0; j < toAdd.length; j += 1) { 5933 dom.push(toAdd[j]); 5934 } 5935 } 5936 5937 return dom; 5938} 5939 5940function empty() { 5941 for (let i = 0; i < this.length; i += 1) { 5942 const el = this[i]; 5943 5944 if (el.nodeType === 1) { 5945 for (let j = 0; j < el.childNodes.length; j += 1) { 5946 if (el.childNodes[j].parentNode) { 5947 el.childNodes[j].parentNode.removeChild(el.childNodes[j]); 5948 } 5949 } 5950 5951 el.textContent = ''; 5952 } 5953 } 5954 5955 return this; 5956} 5957 5958// eslint-disable-next-line 5959 5960function scrollTo(...args) { 5961 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 5962 let [left, top, duration, easing, callback] = args; 5963 5964 if (args.length === 4 && typeof easing === 'function') { 5965 callback = easing; 5966 [left, top, duration, callback, easing] = args; 5967 } 5968 5969 if (typeof easing === 'undefined') easing = 'swing'; 5970 return this.each(function animate() { 5971 const el = this; 5972 let currentTop; 5973 let currentLeft; 5974 let maxTop; 5975 let maxLeft; 5976 let newTop; 5977 let newLeft; 5978 let scrollTop; // eslint-disable-line 5979 5980 let scrollLeft; // eslint-disable-line 5981 5982 let animateTop = top > 0 || top === 0; 5983 let animateLeft = left > 0 || left === 0; 5984 5985 if (typeof easing === 'undefined') { 5986 easing = 'swing'; 5987 } 5988 5989 if (animateTop) { 5990 currentTop = el.scrollTop; 5991 5992 if (!duration) { 5993 el.scrollTop = top; 5994 } 5995 } 5996 5997 if (animateLeft) { 5998 currentLeft = el.scrollLeft; 5999 6000 if (!duration) { 6001 el.scrollLeft = left; 6002 } 6003 } 6004 6005 if (!duration) return; 6006 6007 if (animateTop) { 6008 maxTop = el.scrollHeight - el.offsetHeight; 6009 newTop = Math.max(Math.min(top, maxTop), 0); 6010 } 6011 6012 if (animateLeft) { 6013 maxLeft = el.scrollWidth - el.offsetWidth; 6014 newLeft = Math.max(Math.min(left, maxLeft), 0); 6015 } 6016 6017 let startTime = null; 6018 if (animateTop && newTop === currentTop) animateTop = false; 6019 if (animateLeft && newLeft === currentLeft) animateLeft = false; 6020 6021 function render(time = new Date().getTime()) { 6022 if (startTime === null) { 6023 startTime = time; 6024 } 6025 6026 const progress = Math.max(Math.min((time - startTime) / duration, 1), 0); 6027 const easeProgress = easing === 'linear' ? progress : 0.5 - Math.cos(progress * Math.PI) / 2; 6028 let done; 6029 if (animateTop) scrollTop = currentTop + easeProgress * (newTop - currentTop); 6030 if (animateLeft) scrollLeft = currentLeft + easeProgress * (newLeft - currentLeft); 6031 6032 if (animateTop && newTop > currentTop && scrollTop >= newTop) { 6033 el.scrollTop = newTop; 6034 done = true; 6035 } 6036 6037 if (animateTop && newTop < currentTop && scrollTop <= newTop) { 6038 el.scrollTop = newTop; 6039 done = true; 6040 } 6041 6042 if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) { 6043 el.scrollLeft = newLeft; 6044 done = true; 6045 } 6046 6047 if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) { 6048 el.scrollLeft = newLeft; 6049 done = true; 6050 } 6051 6052 if (done) { 6053 if (callback) callback(); 6054 return; 6055 } 6056 6057 if (animateTop) el.scrollTop = scrollTop; 6058 if (animateLeft) el.scrollLeft = scrollLeft; 6059 window.requestAnimationFrame(render); 6060 } 6061 6062 window.requestAnimationFrame(render); 6063 }); 6064} // scrollTop(top, duration, easing, callback) { 6065 6066 6067function scrollTop(...args) { 6068 let [top, duration, easing, callback] = args; 6069 6070 if (args.length === 3 && typeof easing === 'function') { 6071 [top, duration, callback, easing] = args; 6072 } 6073 6074 const dom = this; 6075 6076 if (typeof top === 'undefined') { 6077 if (dom.length > 0) return dom[0].scrollTop; 6078 return null; 6079 } 6080 6081 return dom.scrollTo(undefined, top, duration, easing, callback); 6082} 6083 6084function scrollLeft(...args) { 6085 let [left, duration, easing, callback] = args; 6086 6087 if (args.length === 3 && typeof easing === 'function') { 6088 [left, duration, callback, easing] = args; 6089 } 6090 6091 const dom = this; 6092 6093 if (typeof left === 'undefined') { 6094 if (dom.length > 0) return dom[0].scrollLeft; 6095 return null; 6096 } 6097 6098 return dom.scrollTo(left, undefined, duration, easing, callback); 6099} 6100 6101// eslint-disable-next-line 6102 6103function animate(initialProps, initialParams) { 6104 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 6105 const els = this; 6106 const a = { 6107 props: Object.assign({}, initialProps), 6108 params: Object.assign({ 6109 duration: 300, 6110 easing: 'swing' // or 'linear' 6111 6112 /* Callbacks 6113 begin(elements) 6114 complete(elements) 6115 progress(elements, complete, remaining, start, tweenValue) 6116 */ 6117 6118 }, initialParams), 6119 elements: els, 6120 animating: false, 6121 que: [], 6122 6123 easingProgress(easing, progress) { 6124 if (easing === 'swing') { 6125 return 0.5 - Math.cos(progress * Math.PI) / 2; 6126 } 6127 6128 if (typeof easing === 'function') { 6129 return easing(progress); 6130 } 6131 6132 return progress; 6133 }, 6134 6135 stop() { 6136 if (a.frameId) { 6137 window.cancelAnimationFrame(a.frameId); 6138 } 6139 6140 a.animating = false; 6141 a.elements.each(el => { 6142 const element = el; 6143 delete element.dom7AnimateInstance; 6144 }); 6145 a.que = []; 6146 }, 6147 6148 done(complete) { 6149 a.animating = false; 6150 a.elements.each(el => { 6151 const element = el; 6152 delete element.dom7AnimateInstance; 6153 }); 6154 if (complete) complete(els); 6155 6156 if (a.que.length > 0) { 6157 const que = a.que.shift(); 6158 a.animate(que[0], que[1]); 6159 } 6160 }, 6161 6162 animate(props, params) { 6163 if (a.animating) { 6164 a.que.push([props, params]); 6165 return a; 6166 } 6167 6168 const elements = []; // Define & Cache Initials & Units 6169 6170 a.elements.each((el, index) => { 6171 let initialFullValue; 6172 let initialValue; 6173 let unit; 6174 let finalValue; 6175 let finalFullValue; 6176 if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a; 6177 elements[index] = { 6178 container: el 6179 }; 6180 Object.keys(props).forEach(prop => { 6181 initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.'); 6182 initialValue = parseFloat(initialFullValue); 6183 unit = initialFullValue.replace(initialValue, ''); 6184 finalValue = parseFloat(props[prop]); 6185 finalFullValue = props[prop] + unit; 6186 elements[index][prop] = { 6187 initialFullValue, 6188 initialValue, 6189 unit, 6190 finalValue, 6191 finalFullValue, 6192 currentValue: initialValue 6193 }; 6194 }); 6195 }); 6196 let startTime = null; 6197 let time; 6198 let elementsDone = 0; 6199 let propsDone = 0; 6200 let done; 6201 let began = false; 6202 a.animating = true; 6203 6204 function render() { 6205 time = new Date().getTime(); 6206 let progress; 6207 let easeProgress; // let el; 6208 6209 if (!began) { 6210 began = true; 6211 if (params.begin) params.begin(els); 6212 } 6213 6214 if (startTime === null) { 6215 startTime = time; 6216 } 6217 6218 if (params.progress) { 6219 // eslint-disable-next-line 6220 params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), startTime + params.duration - time < 0 ? 0 : startTime + params.duration - time, startTime); 6221 } 6222 6223 elements.forEach(element => { 6224 const el = element; 6225 if (done || el.done) return; 6226 Object.keys(props).forEach(prop => { 6227 if (done || el.done) return; 6228 progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0); 6229 easeProgress = a.easingProgress(params.easing, progress); 6230 const { 6231 initialValue, 6232 finalValue, 6233 unit 6234 } = el[prop]; 6235 el[prop].currentValue = initialValue + easeProgress * (finalValue - initialValue); 6236 const currentValue = el[prop].currentValue; 6237 6238 if (finalValue > initialValue && currentValue >= finalValue || finalValue < initialValue && currentValue <= finalValue) { 6239 el.container.style[prop] = finalValue + unit; 6240 propsDone += 1; 6241 6242 if (propsDone === Object.keys(props).length) { 6243 el.done = true; 6244 elementsDone += 1; 6245 } 6246 6247 if (elementsDone === elements.length) { 6248 done = true; 6249 } 6250 } 6251 6252 if (done) { 6253 a.done(params.complete); 6254 return; 6255 } 6256 6257 el.container.style[prop] = currentValue + unit; 6258 }); 6259 }); 6260 if (done) return; // Then call 6261 6262 a.frameId = window.requestAnimationFrame(render); 6263 } 6264 6265 a.frameId = window.requestAnimationFrame(render); 6266 return a; 6267 } 6268 6269 }; 6270 6271 if (a.elements.length === 0) { 6272 return els; 6273 } 6274 6275 let animateInstance; 6276 6277 for (let i = 0; i < a.elements.length; i += 1) { 6278 if (a.elements[i].dom7AnimateInstance) { 6279 animateInstance = a.elements[i].dom7AnimateInstance; 6280 } else a.elements[i].dom7AnimateInstance = a; 6281 } 6282 6283 if (!animateInstance) { 6284 animateInstance = a; 6285 } 6286 6287 if (initialProps === 'stop') { 6288 animateInstance.stop(); 6289 } else { 6290 animateInstance.animate(a.props, a.params); 6291 } 6292 6293 return els; 6294} 6295 6296function stop() { 6297 const els = this; 6298 6299 for (let i = 0; i < els.length; i += 1) { 6300 if (els[i].dom7AnimateInstance) { 6301 els[i].dom7AnimateInstance.stop(); 6302 } 6303 } 6304} 6305 6306const noTrigger = 'resize scroll'.split(' '); 6307 6308function shortcut(name) { 6309 function eventHandler(...args) { 6310 if (typeof args[0] === 'undefined') { 6311 for (let i = 0; i < this.length; i += 1) { 6312 if (noTrigger.indexOf(name) < 0) { 6313 if (name in this[i]) this[i][name]();else { 6314 $(this[i]).trigger(name); 6315 } 6316 } 6317 } 6318 6319 return this; 6320 } 6321 6322 return this.on(name, ...args); 6323 } 6324 6325 return eventHandler; 6326} 6327 6328const click = shortcut('click'); 6329const blur = shortcut('blur'); 6330const focus = shortcut('focus'); 6331const focusin = shortcut('focusin'); 6332const focusout = shortcut('focusout'); 6333const keyup = shortcut('keyup'); 6334const keydown = shortcut('keydown'); 6335const keypress = shortcut('keypress'); 6336const submit = shortcut('submit'); 6337const change = shortcut('change'); 6338const mousedown = shortcut('mousedown'); 6339const mousemove = shortcut('mousemove'); 6340const mouseup = shortcut('mouseup'); 6341const mouseenter = shortcut('mouseenter'); 6342const mouseleave = shortcut('mouseleave'); 6343const mouseout = shortcut('mouseout'); 6344const mouseover = shortcut('mouseover'); 6345const touchstart = shortcut('touchstart'); 6346const touchend = shortcut('touchend'); 6347const touchmove = shortcut('touchmove'); 6348const resize = shortcut('resize'); 6349const scroll = shortcut('scroll'); 6350 6351/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ($); 6352 6353 6354 6355/***/ }), 6356
vendor: 544,412 bytes, lines 6357-23569
6357/***/ "./node_modules/lodash/lodash.js": 6358/*!***************************************!*\ 6359 !*** ./node_modules/lodash/lodash.js ***! 6360 \***************************************/ 6361/***/ (function(module, exports, __webpack_require__) { 6362 6363/* module decorator */ module = __webpack_require__.nmd(module); 6364var __WEBPACK_AMD_DEFINE_RESULT__;/** 6365 * @license 6366 * Lodash <https://lodash.com/> 6367 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 6368 * Released under MIT license <https://lodash.com/license> 6369 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6370 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6371 */ 6372;(function() { 6373 6374 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 6375 var undefined; 6376 6377 /** Used as the semantic version number. */ 6378 var VERSION = '4.17.21'; 6379 6380 /** Used as the size to enable large array optimizations. */ 6381 var LARGE_ARRAY_SIZE = 200; 6382 6383 /** Error message constants. */ 6384 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', 6385 FUNC_ERROR_TEXT = 'Expected a function', 6386 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; 6387 6388 /** Used to stand-in for `undefined` hash values. */ 6389 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 6390 6391 /** Used as the maximum memoize cache size. */ 6392 var MAX_MEMOIZE_SIZE = 500; 6393 6394 /** Used as the internal argument placeholder. */ 6395 var PLACEHOLDER = '__lodash_placeholder__'; 6396 6397 /** Used to compose bitmasks for cloning. */ 6398 var CLONE_DEEP_FLAG = 1, 6399 CLONE_FLAT_FLAG = 2, 6400 CLONE_SYMBOLS_FLAG = 4; 6401 6402 /** Used to compose bitmasks for value comparisons. */ 6403 var COMPARE_PARTIAL_FLAG = 1, 6404 COMPARE_UNORDERED_FLAG = 2; 6405 6406 /** Used to compose bitmasks for function metadata. */ 6407 var WRAP_BIND_FLAG = 1, 6408 WRAP_BIND_KEY_FLAG = 2, 6409 WRAP_CURRY_BOUND_FLAG = 4, 6410 WRAP_CURRY_FLAG = 8, 6411 WRAP_CURRY_RIGHT_FLAG = 16, 6412 WRAP_PARTIAL_FLAG = 32, 6413 WRAP_PARTIAL_RIGHT_FLAG = 64, 6414 WRAP_ARY_FLAG = 128, 6415 WRAP_REARG_FLAG = 256, 6416 WRAP_FLIP_FLAG = 512; 6417 6418 /** Used as default options for `_.truncate`. */ 6419 var DEFAULT_TRUNC_LENGTH = 30, 6420 DEFAULT_TRUNC_OMISSION = '...'; 6421 6422 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 6423 var HOT_COUNT = 800, 6424 HOT_SPAN = 16; 6425 6426 /** Used to indicate the type of lazy iteratees. */ 6427 var LAZY_FILTER_FLAG = 1, 6428 LAZY_MAP_FLAG = 2, 6429 LAZY_WHILE_FLAG = 3; 6430 6431 /** Used as references for various `Number` constants. */ 6432 var INFINITY = 1 / 0, 6433 MAX_SAFE_INTEGER = 9007199254740991, 6434 MAX_INTEGER = 1.7976931348623157e+308, 6435 NAN = 0 / 0; 6436 6437 /** Used as references for the maximum length and index of an array. */ 6438 var MAX_ARRAY_LENGTH = 4294967295, 6439 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 6440 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 6441 6442 /** Used to associate wrap methods with their bit flags. */ 6443 var wrapFlags = [ 6444 ['ary', WRAP_ARY_FLAG], 6445 ['bind', WRAP_BIND_FLAG], 6446 ['bindKey', WRAP_BIND_KEY_FLAG], 6447 ['curry', WRAP_CURRY_FLAG], 6448 ['curryRight', WRAP_CURRY_RIGHT_FLAG], 6449 ['flip', WRAP_FLIP_FLAG], 6450 ['partial', WRAP_PARTIAL_FLAG], 6451 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], 6452 ['rearg', WRAP_REARG_FLAG] 6453 ]; 6454 6455 /** `Object#toString` result references. */ 6456 var argsTag = '[object Arguments]', 6457 arrayTag = '[object Array]', 6458 asyncTag = '[object AsyncFunction]', 6459 boolTag = '[object Boolean]', 6460 dateTag = '[object Date]', 6461 domExcTag = '[object DOMException]', 6462 errorTag = '[object Error]', 6463 funcTag = '[object Function]', 6464 genTag = '[object GeneratorFunction]', 6465 mapTag = '[object Map]', 6466 numberTag = '[object Number]', 6467 nullTag = '[object Null]', 6468 objectTag = '[object Object]', 6469 promiseTag = '[object Promise]', 6470 proxyTag = '[object Proxy]', 6471 regexpTag = '[object RegExp]', 6472 setTag = '[object Set]', 6473 stringTag = '[object String]', 6474 symbolTag = '[object Symbol]', 6475 undefinedTag = '[object Undefined]', 6476 weakMapTag = '[object WeakMap]', 6477 weakSetTag = '[object WeakSet]'; 6478 6479 var arrayBufferTag = '[object ArrayBuffer]', 6480 dataViewTag = '[object DataView]', 6481 float32Tag = '[object Float32Array]', 6482 float64Tag = '[object Float64Array]', 6483 int8Tag = '[object Int8Array]', 6484 int16Tag = '[object Int16Array]', 6485 int32Tag = '[object Int32Array]', 6486 uint8Tag = '[object Uint8Array]', 6487 uint8ClampedTag = '[object Uint8ClampedArray]', 6488 uint16Tag = '[object Uint16Array]', 6489 uint32Tag = '[object Uint32Array]'; 6490 6491 /** Used to match empty string literals in compiled template source. */ 6492 var reEmptyStringLeading = /\b__p \+= '';/g, 6493 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 6494 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 6495 6496 /** Used to match HTML entities and HTML characters. */ 6497 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, 6498 reUnescapedHtml = /[&<>"']/g, 6499 reHasEscapedHtml = RegExp(reEscapedHtml.source), 6500 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 6501 6502 /** Used to match template delimiters. */ 6503 var reEscape = /<%-([\s\S]+?)%>/g, 6504 reEvaluate = /<%([\s\S]+?)%>/g, 6505 reInterpolate = /<%=([\s\S]+?)%>/g; 6506 6507 /** Used to match property names within property paths. */ 6508 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 6509 reIsPlainProp = /^\w*$/, 6510 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 6511 6512 /** 6513 * Used to match `RegExp` 6514 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 6515 */ 6516 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 6517 reHasRegExpChar = RegExp(reRegExpChar.source); 6518 6519 /** Used to match leading whitespace. */ 6520 var reTrimStart = /^\s+/; 6521 6522 /** Used to match a single whitespace character. */ 6523 var reWhitespace = /\s/; 6524 6525 /** Used to match wrap detail comments. */ 6526 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, 6527 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 6528 reSplitDetails = /,? & /; 6529 6530 /** Used to match words composed of alphanumeric characters. */ 6531 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 6532 6533 /** 6534 * Used to validate the `validate` option in `_.template` variable. 6535 * 6536 * Forbids characters which could potentially change the meaning of the function argument definition: 6537 * - "()," (modification of function parameters) 6538 * - "=" (default value) 6539 * - "[]{}" (destructuring of function parameters) 6540 * - "/" (beginning of a comment) 6541 * - whitespace 6542 */ 6543 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 6544 6545 /** Used to match backslashes in property paths. */ 6546 var reEscapeChar = /\\(\\)?/g; 6547 6548 /** 6549 * Used to match 6550 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 6551 */ 6552 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 6553 6554 /** Used to match `RegExp` flags from their coerced string values. */ 6555 var reFlags = /\w*$/; 6556 6557 /** Used to detect bad signed hexadecimal string values. */ 6558 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 6559 6560 /** Used to detect binary string values. */ 6561 var reIsBinary = /^0b[01]+$/i; 6562 6563 /** Used to detect host constructors (Safari). */ 6564 var reIsHostCtor = /^\[object .+?Constructor\]$/; 6565 6566 /** Used to detect octal string values. */ 6567 var reIsOctal = /^0o[0-7]+$/i; 6568 6569 /** Used to detect unsigned integer values. */ 6570 var reIsUint = /^(?:0|[1-9]\d*)$/; 6571 6572 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 6573 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 6574 6575 /** Used to ensure capturing order of template delimiters. */ 6576 var reNoMatch = /($^)/; 6577 6578 /** Used to match unescaped characters in compiled string literals. */ 6579 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 6580 6581 /** Used to compose unicode character classes. */ 6582 var rsAstralRange = '\\ud800-\\udfff', 6583 rsComboMarksRange = '\\u0300-\\u036f', 6584 reComboHalfMarksRange = '\\ufe20-\\ufe2f', 6585 rsComboSymbolsRange = '\\u20d0-\\u20ff', 6586 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 6587 rsDingbatRange = '\\u2700-\\u27bf', 6588 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 6589 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 6590 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 6591 rsPunctuationRange = '\\u2000-\\u206f', 6592 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', 6593 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 6594 rsVarRange = '\\ufe0e\\ufe0f', 6595 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 6596 6597 /** Used to compose unicode capture groups. */ 6598 var rsApos = "['\u2019]", 6599 rsAstral = '[' + rsAstralRange + ']', 6600 rsBreak = '[' + rsBreakRange + ']', 6601 rsCombo = '[' + rsComboRange + ']', 6602 rsDigits = '\\d+', 6603 rsDingbat = '[' + rsDingbatRange + ']', 6604 rsLower = '[' + rsLowerRange + ']', 6605 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 6606 rsFitz = '\\ud83c[\\udffb-\\udfff]', 6607 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 6608 rsNonAstral = '[^' + rsAstralRange + ']', 6609 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', 6610 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', 6611 rsUpper = '[' + rsUpperRange + ']', 6612 rsZWJ = '\\u200d'; 6613 6614 /** Used to compose unicode regexes. */ 6615 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 6616 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 6617 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', 6618 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', 6619 reOptMod = rsModifier + '?', 6620 rsOptVar = '[' + rsVarRange + ']?', 6621 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 6622 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 6623 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 6624 rsSeq = rsOptVar + reOptMod + rsOptJoin, 6625 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, 6626 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; 6627 6628 /** Used to match apostrophes. */ 6629 var reApos = RegExp(rsApos, 'g'); 6630 6631 /** 6632 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 6633 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 6634 */ 6635 var reComboMark = RegExp(rsCombo, 'g'); 6636 6637 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ 6638 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); 6639 6640 /** Used to match complex or compound words. */ 6641 var reUnicodeWord = RegExp([ 6642 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', 6643 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', 6644 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, 6645 rsUpper + '+' + rsOptContrUpper, 6646 rsOrdUpper, 6647 rsOrdLower, 6648 rsDigits, 6649 rsEmoji 6650 ].join('|'), 'g'); 6651 6652 /** 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/). */ 6653 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); 6654 6655 /** Used to detect strings that need a more robust regexp to match words. */ 6656 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 ]/; 6657 6658 /** Used to assign default `context` object properties. */ 6659 var contextProps = [ 6660 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 6661 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 6662 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 6663 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 6664 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' 6665 ]; 6666 6667 /** Used to make template sourceURLs easier to identify. */ 6668 var templateCounter = -1; 6669 6670 /** Used to identify `toStringTag` values of typed arrays. */ 6671 var typedArrayTags = {}; 6672 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 6673 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 6674 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 6675 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 6676 typedArrayTags[uint32Tag] = true; 6677 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 6678 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 6679 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 6680 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 6681 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 6682 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 6683 typedArrayTags[setTag] = typedArrayTags[stringTag] = 6684 typedArrayTags[weakMapTag] = false; 6685 6686 /** Used to identify `toStringTag` values supported by `_.clone`. */ 6687 var cloneableTags = {}; 6688 cloneableTags[argsTag] = cloneableTags[arrayTag] = 6689 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 6690 cloneableTags[boolTag] = cloneableTags[dateTag] = 6691 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 6692 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 6693 cloneableTags[int32Tag] = cloneableTags[mapTag] = 6694 cloneableTags[numberTag] = cloneableTags[objectTag] = 6695 cloneableTags[regexpTag] = cloneableTags[setTag] = 6696 cloneableTags[stringTag] = cloneableTags[symbolTag] = 6697 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 6698 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 6699 cloneableTags[errorTag] = cloneableTags[funcTag] = 6700 cloneableTags[weakMapTag] = false; 6701 6702 /** Used to map Latin Unicode letters to basic Latin letters. */ 6703 var deburredLetters = { 6704 // Latin-1 Supplement block. 6705 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 6706 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 6707 '\xc7': 'C', '\xe7': 'c', 6708 '\xd0': 'D', '\xf0': 'd', 6709 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 6710 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 6711 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 6712 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 6713 '\xd1': 'N', '\xf1': 'n', 6714 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 6715 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 6716 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 6717 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 6718 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 6719 '\xc6': 'Ae', '\xe6': 'ae', 6720 '\xde': 'Th', '\xfe': 'th', 6721 '\xdf': 'ss', 6722 // Latin Extended-A block. 6723 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', 6724 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', 6725 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', 6726 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', 6727 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', 6728 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', 6729 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', 6730 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', 6731 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', 6732 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', 6733 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', 6734 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', 6735 '\u0134': 'J', '\u0135': 'j', 6736 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', 6737 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', 6738 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', 6739 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', 6740 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', 6741 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', 6742 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', 6743 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', 6744 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', 6745 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', 6746 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', 6747 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', 6748 '\u0163': 't', '\u0165': 't', '\u0167': 't', 6749 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', 6750 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', 6751 '\u0174': 'W', '\u0175': 'w', 6752 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', 6753 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', 6754 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', 6755 '\u0132': 'IJ', '\u0133': 'ij', 6756 '\u0152': 'Oe', '\u0153': 'oe', 6757 '\u0149': "'n", '\u017f': 's' 6758 }; 6759 6760 /** Used to map characters to HTML entities. */ 6761 var htmlEscapes = { 6762 '&': '&', 6763 '<': '<', 6764 '>': '>', 6765 '"': '"', 6766 "'": ''' 6767 }; 6768 6769 /** Used to map HTML entities to characters. */ 6770 var htmlUnescapes = { 6771 '&': '&', 6772 '<': '<', 6773 '>': '>', 6774 '"': '"', 6775 ''': "'" 6776 }; 6777 6778 /** Used to escape characters for inclusion in compiled string literals. */ 6779 var stringEscapes = { 6780 '\\': '\\', 6781 "'": "'", 6782 '\n': 'n', 6783 '\r': 'r', 6784 '\u2028': 'u2028', 6785 '\u2029': 'u2029' 6786 }; 6787 6788 /** Built-in method references without a dependency on `root`. */ 6789 var freeParseFloat = parseFloat, 6790 freeParseInt = parseInt; 6791 6792 /** Detect free variable `global` from Node.js. */ 6793 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 6794 6795 /** Detect free variable `self`. */ 6796 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 6797 6798 /** Used as a reference to the global object. */ 6799 var root = freeGlobal || freeSelf || Function('return this')(); 6800 6801 /** Detect free variable `exports`. */ 6802 var freeExports = true && exports && !exports.nodeType && exports; 6803 6804 /** Detect free variable `module`. */ 6805 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 6806 6807 /** Detect the popular CommonJS extension `module.exports`. */ 6808 var moduleExports = freeModule && freeModule.exports === freeExports; 6809 6810 /** Detect free variable `process` from Node.js. */ 6811 var freeProcess = moduleExports && freeGlobal.process; 6812 6813 /** Used to access faster Node.js helpers. */ 6814 var nodeUtil = (function() { 6815 try { 6816 // Use `util.types` for Node.js 10+. 6817 var types = freeModule && freeModule.require && freeModule.require('util').types; 6818 6819 if (types) { 6820 return types; 6821 } 6822 6823 // Legacy `process.binding('util')` for Node.js < 10. 6824 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 6825 } catch (e) {} 6826 }()); 6827 6828 /* Node.js helper references. */ 6829 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, 6830 nodeIsDate = nodeUtil && nodeUtil.isDate, 6831 nodeIsMap = nodeUtil && nodeUtil.isMap, 6832 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, 6833 nodeIsSet = nodeUtil && nodeUtil.isSet, 6834 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 6835 6836 /*--------------------------------------------------------------------------*/ 6837 6838 /** 6839 * A faster alternative to `Function#apply`, this function invokes `func` 6840 * with the `this` binding of `thisArg` and the arguments of `args`. 6841 * 6842 * @private 6843 * @param {Function} func The function to invoke. 6844 * @param {*} thisArg The `this` binding of `func`. 6845 * @param {Array} args The arguments to invoke `func` with. 6846 * @returns {*} Returns the result of `func`. 6847 */ 6848 function apply(func, thisArg, args) { 6849 switch (args.length) { 6850 case 0: return func.call(thisArg); 6851 case 1: return func.call(thisArg, args[0]); 6852 case 2: return func.call(thisArg, args[0], args[1]); 6853 case 3: return func.call(thisArg, args[0], args[1], args[2]); 6854 } 6855 return func.apply(thisArg, args); 6856 } 6857 6858 /** 6859 * A specialized version of `baseAggregator` for arrays. 6860 * 6861 * @private 6862 * @param {Array} [array] The array to iterate over. 6863 * @param {Function} setter The function to set `accumulator` values. 6864 * @param {Function} iteratee The iteratee to transform keys. 6865 * @param {Object} accumulator The initial aggregated object. 6866 * @returns {Function} Returns `accumulator`. 6867 */ 6868 function arrayAggregator(array, setter, iteratee, accumulator) { 6869 var index = -1, 6870 length = array == null ? 0 : array.length; 6871 6872 while (++index < length) { 6873 var value = array[index]; 6874 setter(accumulator, value, iteratee(value), array); 6875 } 6876 return accumulator; 6877 } 6878 6879 /** 6880 * A specialized version of `_.forEach` for arrays without support for 6881 * iteratee shorthands. 6882 * 6883 * @private 6884 * @param {Array} [array] The array to iterate over. 6885 * @param {Function} iteratee The function invoked per iteration. 6886 * @returns {Array} Returns `array`. 6887 */ 6888 function arrayEach(array, iteratee) { 6889 var index = -1, 6890 length = array == null ? 0 : array.length; 6891 6892 while (++index < length) { 6893 if (iteratee(array[index], index, array) === false) { 6894 break; 6895 } 6896 } 6897 return array; 6898 } 6899 6900 /** 6901 * A specialized version of `_.forEachRight` for arrays without support for 6902 * iteratee shorthands. 6903 * 6904 * @private 6905 * @param {Array} [array] The array to iterate over. 6906 * @param {Function} iteratee The function invoked per iteration. 6907 * @returns {Array} Returns `array`. 6908 */ 6909 function arrayEachRight(array, iteratee) { 6910 var length = array == null ? 0 : array.length; 6911 6912 while (length--) { 6913 if (iteratee(array[length], length, array) === false) { 6914 break; 6915 } 6916 } 6917 return array; 6918 } 6919 6920 /** 6921 * A specialized version of `_.every` for arrays without support for 6922 * iteratee shorthands. 6923 * 6924 * @private 6925 * @param {Array} [array] The array to iterate over. 6926 * @param {Function} predicate The function invoked per iteration. 6927 * @returns {boolean} Returns `true` if all elements pass the predicate check, 6928 * else `false`. 6929 */ 6930 function arrayEvery(array, predicate) { 6931 var index = -1, 6932 length = array == null ? 0 : array.length; 6933 6934 while (++index < length) { 6935 if (!predicate(array[index], index, array)) { 6936 return false; 6937 } 6938 } 6939 return true; 6940 } 6941 6942 /** 6943 * A specialized version of `_.filter` for arrays without support for 6944 * iteratee shorthands. 6945 * 6946 * @private 6947 * @param {Array} [array] The array to iterate over. 6948 * @param {Function} predicate The function invoked per iteration. 6949 * @returns {Array} Returns the new filtered array. 6950 */ 6951 function arrayFilter(array, predicate) { 6952 var index = -1, 6953 length = array == null ? 0 : array.length, 6954 resIndex = 0, 6955 result = []; 6956 6957 while (++index < length) { 6958 var value = array[index]; 6959 if (predicate(value, index, array)) { 6960 result[resIndex++] = value; 6961 } 6962 } 6963 return result; 6964 } 6965 6966 /** 6967 * A specialized version of `_.includes` for arrays without support for 6968 * specifying an index to search from. 6969 * 6970 * @private 6971 * @param {Array} [array] The array to inspect. 6972 * @param {*} target The value to search for. 6973 * @returns {boolean} Returns `true` if `target` is found, else `false`. 6974 */ 6975 function arrayIncludes(array, value) { 6976 var length = array == null ? 0 : array.length; 6977 return !!length && baseIndexOf(array, value, 0) > -1; 6978 } 6979 6980 /** 6981 * This function is like `arrayIncludes` except that it accepts a comparator. 6982 * 6983 * @private 6984 * @param {Array} [array] The array to inspect. 6985 * @param {*} target The value to search for. 6986 * @param {Function} comparator The comparator invoked per element. 6987 * @returns {boolean} Returns `true` if `target` is found, else `false`. 6988 */ 6989 function arrayIncludesWith(array, value, comparator) { 6990 var index = -1, 6991 length = array == null ? 0 : array.length; 6992 6993 while (++index < length) { 6994 if (comparator(value, array[index])) { 6995 return true; 6996 } 6997 } 6998 return false; 6999 } 7000 7001 /** 7002 * A specialized version of `_.map` for arrays without support for iteratee 7003 * shorthands. 7004 * 7005 * @private 7006 * @param {Array} [array] The array to iterate over. 7007 * @param {Function} iteratee The function invoked per iteration. 7008 * @returns {Array} Returns the new mapped array. 7009 */ 7010 function arrayMap(array, iteratee) { 7011 var index = -1, 7012 length = array == null ? 0 : array.length, 7013 result = Array(length); 7014 7015 while (++index < length) { 7016 result[index] = iteratee(array[index], index, array); 7017 } 7018 return result; 7019 } 7020 7021 /** 7022 * Appends the elements of `values` to `array`. 7023 * 7024 * @private 7025 * @param {Array} array The array to modify. 7026 * @param {Array} values The values to append. 7027 * @returns {Array} Returns `array`. 7028 */ 7029 function arrayPush(array, values) { 7030 var index = -1, 7031 length = values.length, 7032 offset = array.length; 7033 7034 while (++index < length) { 7035 array[offset + index] = values[index]; 7036 } 7037 return array; 7038 } 7039 7040 /** 7041 * A specialized version of `_.reduce` for arrays without support for 7042 * iteratee shorthands. 7043 * 7044 * @private 7045 * @param {Array} [array] The array to iterate over. 7046 * @param {Function} iteratee The function invoked per iteration. 7047 * @param {*} [accumulator] The initial value. 7048 * @param {boolean} [initAccum] Specify using the first element of `array` as 7049 * the initial value. 7050 * @returns {*} Returns the accumulated value. 7051 */ 7052 function arrayReduce(array, iteratee, accumulator, initAccum) { 7053 var index = -1, 7054 length = array == null ? 0 : array.length; 7055 7056 if (initAccum && length) { 7057 accumulator = array[++index]; 7058 } 7059 while (++index < length) { 7060 accumulator = iteratee(accumulator, array[index], index, array); 7061 } 7062 return accumulator; 7063 } 7064 7065 /** 7066 * A specialized version of `_.reduceRight` for arrays without support for 7067 * iteratee shorthands. 7068 * 7069 * @private 7070 * @param {Array} [array] The array to iterate over. 7071 * @param {Function} iteratee The function invoked per iteration. 7072 * @param {*} [accumulator] The initial value. 7073 * @param {boolean} [initAccum] Specify using the last element of `array` as 7074 * the initial value. 7075 * @returns {*} Returns the accumulated value. 7076 */ 7077 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 7078 var length = array == null ? 0 : array.length; 7079 if (initAccum && length) { 7080 accumulator = array[--length]; 7081 } 7082 while (length--) { 7083 accumulator = iteratee(accumulator, array[length], length, array); 7084 } 7085 return accumulator; 7086 } 7087 7088 /** 7089 * A specialized version of `_.some` for arrays without support for iteratee 7090 * shorthands. 7091 * 7092 * @private 7093 * @param {Array} [array] The array to iterate over. 7094 * @param {Function} predicate The function invoked per iteration. 7095 * @returns {boolean} Returns `true` if any element passes the predicate check, 7096 * else `false`. 7097 */ 7098 function arraySome(array, predicate) { 7099 var index = -1, 7100 length = array == null ? 0 : array.length; 7101 7102 while (++index < length) { 7103 if (predicate(array[index], index, array)) { 7104 return true; 7105 } 7106 } 7107 return false; 7108 } 7109 7110 /** 7111 * Gets the size of an ASCII `string`. 7112 * 7113 * @private 7114 * @param {string} string The string inspect. 7115 * @returns {number} Returns the string size. 7116 */ 7117 var asciiSize = baseProperty('length'); 7118 7119 /** 7120 * Converts an ASCII `string` to an array. 7121 * 7122 * @private 7123 * @param {string} string The string to convert. 7124 * @returns {Array} Returns the converted array. 7125 */ 7126 function asciiToArray(string) { 7127 return string.split(''); 7128 } 7129 7130 /** 7131 * Splits an ASCII `string` into an array of its words. 7132 * 7133 * @private 7134 * @param {string} The string to inspect. 7135 * @returns {Array} Returns the words of `string`. 7136 */ 7137 function asciiWords(string) { 7138 return string.match(reAsciiWord) || []; 7139 } 7140 7141 /** 7142 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 7143 * without support for iteratee shorthands, which iterates over `collection` 7144 * using `eachFunc`. 7145 * 7146 * @private 7147 * @param {Array|Object} collection The collection to inspect. 7148 * @param {Function} predicate The function invoked per iteration. 7149 * @param {Function} eachFunc The function to iterate over `collection`. 7150 * @returns {*} Returns the found element or its key, else `undefined`. 7151 */ 7152 function baseFindKey(collection, predicate, eachFunc) { 7153 var result; 7154 eachFunc(collection, function(value, key, collection) { 7155 if (predicate(value, key, collection)) { 7156 result = key; 7157 return false; 7158 } 7159 }); 7160 return result; 7161 } 7162 7163 /** 7164 * The base implementation of `_.findIndex` and `_.findLastIndex` without 7165 * support for iteratee shorthands. 7166 * 7167 * @private 7168 * @param {Array} array The array to inspect. 7169 * @param {Function} predicate The function invoked per iteration. 7170 * @param {number} fromIndex The index to search from. 7171 * @param {boolean} [fromRight] Specify iterating from right to left. 7172 * @returns {number} Returns the index of the matched value, else `-1`. 7173 */ 7174 function baseFindIndex(array, predicate, fromIndex, fromRight) { 7175 var length = array.length, 7176 index = fromIndex + (fromRight ? 1 : -1); 7177 7178 while ((fromRight ? index-- : ++index < length)) { 7179 if (predicate(array[index], index, array)) { 7180 return index; 7181 } 7182 } 7183 return -1; 7184 } 7185 7186 /** 7187 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 7188 * 7189 * @private 7190 * @param {Array} array The array to inspect. 7191 * @param {*} value The value to search for. 7192 * @param {number} fromIndex The index to search from. 7193 * @returns {number} Returns the index of the matched value, else `-1`. 7194 */ 7195 function baseIndexOf(array, value, fromIndex) { 7196 return value === value 7197 ? strictIndexOf(array, value, fromIndex) 7198 : baseFindIndex(array, baseIsNaN, fromIndex); 7199 } 7200 7201 /** 7202 * This function is like `baseIndexOf` except that it accepts a comparator. 7203 * 7204 * @private 7205 * @param {Array} array The array to inspect. 7206 * @param {*} value The value to search for. 7207 * @param {number} fromIndex The index to search from. 7208 * @param {Function} comparator The comparator invoked per element. 7209 * @returns {number} Returns the index of the matched value, else `-1`. 7210 */ 7211 function baseIndexOfWith(array, value, fromIndex, comparator) { 7212 var index = fromIndex - 1, 7213 length = array.length; 7214 7215 while (++index < length) { 7216 if (comparator(array[index], value)) { 7217 return index; 7218 } 7219 } 7220 return -1; 7221 } 7222 7223 /** 7224 * The base implementation of `_.isNaN` without support for number objects. 7225 * 7226 * @private 7227 * @param {*} value The value to check. 7228 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 7229 */ 7230 function baseIsNaN(value) { 7231 return value !== value; 7232 } 7233 7234 /** 7235 * The base implementation of `_.mean` and `_.meanBy` without support for 7236 * iteratee shorthands. 7237 * 7238 * @private 7239 * @param {Array} array The array to iterate over. 7240 * @param {Function} iteratee The function invoked per iteration. 7241 * @returns {number} Returns the mean. 7242 */ 7243 function baseMean(array, iteratee) { 7244 var length = array == null ? 0 : array.length; 7245 return length ? (baseSum(array, iteratee) / length) : NAN; 7246 } 7247 7248 /** 7249 * The base implementation of `_.property` without support for deep paths. 7250 * 7251 * @private 7252 * @param {string} key The key of the property to get. 7253 * @returns {Function} Returns the new accessor function. 7254 */ 7255 function baseProperty(key) { 7256 return function(object) { 7257 return object == null ? undefined : object[key]; 7258 }; 7259 } 7260 7261 /** 7262 * The base implementation of `_.propertyOf` without support for deep paths. 7263 * 7264 * @private 7265 * @param {Object} object The object to query. 7266 * @returns {Function} Returns the new accessor function. 7267 */ 7268 function basePropertyOf(object) { 7269 return function(key) { 7270 return object == null ? undefined : object[key]; 7271 }; 7272 } 7273 7274 /** 7275 * The base implementation of `_.reduce` and `_.reduceRight`, without support 7276 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 7277 * 7278 * @private 7279 * @param {Array|Object} collection The collection to iterate over. 7280 * @param {Function} iteratee The function invoked per iteration. 7281 * @param {*} accumulator The initial value. 7282 * @param {boolean} initAccum Specify using the first or last element of 7283 * `collection` as the initial value. 7284 * @param {Function} eachFunc The function to iterate over `collection`. 7285 * @returns {*} Returns the accumulated value. 7286 */ 7287 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 7288 eachFunc(collection, function(value, index, collection) { 7289 accumulator = initAccum 7290 ? (initAccum = false, value) 7291 : iteratee(accumulator, value, index, collection); 7292 }); 7293 return accumulator; 7294 } 7295 7296 /** 7297 * The base implementation of `_.sortBy` which uses `comparer` to define the 7298 * sort order of `array` and replaces criteria objects with their corresponding 7299 * values. 7300 * 7301 * @private 7302 * @param {Array} array The array to sort. 7303 * @param {Function} comparer The function to define sort order. 7304 * @returns {Array} Returns `array`. 7305 */ 7306 function baseSortBy(array, comparer) { 7307 var length = array.length; 7308 7309 array.sort(comparer); 7310 while (length--) { 7311 array[length] = array[length].value; 7312 } 7313 return array; 7314 } 7315 7316 /** 7317 * The base implementation of `_.sum` and `_.sumBy` without support for 7318 * iteratee shorthands. 7319 * 7320 * @private 7321 * @param {Array} array The array to iterate over. 7322 * @param {Function} iteratee The function invoked per iteration. 7323 * @returns {number} Returns the sum. 7324 */ 7325 function baseSum(array, iteratee) { 7326 var result, 7327 index = -1, 7328 length = array.length; 7329 7330 while (++index < length) { 7331 var current = iteratee(array[index]); 7332 if (current !== undefined) { 7333 result = result === undefined ? current : (result + current); 7334 } 7335 } 7336 return result; 7337 } 7338 7339 /** 7340 * The base implementation of `_.times` without support for iteratee shorthands 7341 * or max array length checks. 7342 * 7343 * @private 7344 * @param {number} n The number of times to invoke `iteratee`. 7345 * @param {Function} iteratee The function invoked per iteration. 7346 * @returns {Array} Returns the array of results. 7347 */ 7348 function baseTimes(n, iteratee) { 7349 var index = -1, 7350 result = Array(n); 7351 7352 while (++index < n) { 7353 result[index] = iteratee(index); 7354 } 7355 return result; 7356 } 7357 7358 /** 7359 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 7360 * of key-value pairs for `object` corresponding to the property names of `props`. 7361 * 7362 * @private 7363 * @param {Object} object The object to query. 7364 * @param {Array} props The property names to get values for. 7365 * @returns {Object} Returns the key-value pairs. 7366 */ 7367 function baseToPairs(object, props) { 7368 return arrayMap(props, function(key) { 7369 return [key, object[key]]; 7370 }); 7371 } 7372 7373 /** 7374 * The base implementation of `_.trim`. 7375 * 7376 * @private 7377 * @param {string} string The string to trim. 7378 * @returns {string} Returns the trimmed string. 7379 */ 7380 function baseTrim(string) { 7381 return string 7382 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 7383 : string; 7384 } 7385 7386 /** 7387 * The base implementation of `_.unary` without support for storing metadata. 7388 * 7389 * @private 7390 * @param {Function} func The function to cap arguments for. 7391 * @returns {Function} Returns the new capped function. 7392 */ 7393 function baseUnary(func) { 7394 return function(value) { 7395 return func(value); 7396 }; 7397 } 7398 7399 /** 7400 * The base implementation of `_.values` and `_.valuesIn` which creates an 7401 * array of `object` property values corresponding to the property names 7402 * of `props`. 7403 * 7404 * @private 7405 * @param {Object} object The object to query. 7406 * @param {Array} props The property names to get values for. 7407 * @returns {Object} Returns the array of property values. 7408 */ 7409 function baseValues(object, props) { 7410 return arrayMap(props, function(key) { 7411 return object[key]; 7412 }); 7413 } 7414 7415 /** 7416 * Checks if a `cache` value for `key` exists. 7417 * 7418 * @private 7419 * @param {Object} cache The cache to query. 7420 * @param {string} key The key of the entry to check. 7421 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 7422 */ 7423 function cacheHas(cache, key) { 7424 return cache.has(key); 7425 } 7426 7427 /** 7428 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 7429 * that is not found in the character symbols. 7430 * 7431 * @private 7432 * @param {Array} strSymbols The string symbols to inspect. 7433 * @param {Array} chrSymbols The character symbols to find. 7434 * @returns {number} Returns the index of the first unmatched string symbol. 7435 */ 7436 function charsStartIndex(strSymbols, chrSymbols) { 7437 var index = -1, 7438 length = strSymbols.length; 7439 7440 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 7441 return index; 7442 } 7443 7444 /** 7445 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 7446 * that is not found in the character symbols. 7447 * 7448 * @private 7449 * @param {Array} strSymbols The string symbols to inspect. 7450 * @param {Array} chrSymbols The character symbols to find. 7451 * @returns {number} Returns the index of the last unmatched string symbol. 7452 */ 7453 function charsEndIndex(strSymbols, chrSymbols) { 7454 var index = strSymbols.length; 7455 7456 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 7457 return index; 7458 } 7459 7460 /** 7461 * Gets the number of `placeholder` occurrences in `array`. 7462 * 7463 * @private 7464 * @param {Array} array The array to inspect. 7465 * @param {*} placeholder The placeholder to search for. 7466 * @returns {number} Returns the placeholder count. 7467 */ 7468 function countHolders(array, placeholder) { 7469 var length = array.length, 7470 result = 0; 7471 7472 while (length--) { 7473 if (array[length] === placeholder) { 7474 ++result; 7475 } 7476 } 7477 return result; 7478 } 7479 7480 /** 7481 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 7482 * letters to basic Latin letters. 7483 * 7484 * @private 7485 * @param {string} letter The matched letter to deburr. 7486 * @returns {string} Returns the deburred letter. 7487 */ 7488 var deburrLetter = basePropertyOf(deburredLetters); 7489 7490 /** 7491 * Used by `_.escape` to convert characters to HTML entities. 7492 * 7493 * @private 7494 * @param {string} chr The matched character to escape. 7495 * @returns {string} Returns the escaped character. 7496 */ 7497 var escapeHtmlChar = basePropertyOf(htmlEscapes); 7498 7499 /** 7500 * Used by `_.template` to escape characters for inclusion in compiled string literals. 7501 * 7502 * @private 7503 * @param {string} chr The matched character to escape. 7504 * @returns {string} Returns the escaped character. 7505 */ 7506 function escapeStringChar(chr) { 7507 return '\\' + stringEscapes[chr]; 7508 } 7509 7510 /** 7511 * Gets the value at `key` of `object`. 7512 * 7513 * @private 7514 * @param {Object} [object] The object to query. 7515 * @param {string} key The key of the property to get. 7516 * @returns {*} Returns the property value. 7517 */ 7518 function getValue(object, key) { 7519 return object == null ? undefined : object[key]; 7520 } 7521 7522 /** 7523 * Checks if `string` contains Unicode symbols. 7524 * 7525 * @private 7526 * @param {string} string The string to inspect. 7527 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 7528 */ 7529 function hasUnicode(string) { 7530 return reHasUnicode.test(string); 7531 } 7532 7533 /** 7534 * Checks if `string` contains a word composed of Unicode symbols. 7535 * 7536 * @private 7537 * @param {string} string The string to inspect. 7538 * @returns {boolean} Returns `true` if a word is found, else `false`. 7539 */ 7540 function hasUnicodeWord(string) { 7541 return reHasUnicodeWord.test(string); 7542 } 7543 7544 /** 7545 * Converts `iterator` to an array. 7546 * 7547 * @private 7548 * @param {Object} iterator The iterator to convert. 7549 * @returns {Array} Returns the converted array. 7550 */ 7551 function iteratorToArray(iterator) { 7552 var data, 7553 result = []; 7554 7555 while (!(data = iterator.next()).done) { 7556 result.push(data.value); 7557 } 7558 return result; 7559 } 7560 7561 /** 7562 * Converts `map` to its key-value pairs. 7563 * 7564 * @private 7565 * @param {Object} map The map to convert. 7566 * @returns {Array} Returns the key-value pairs. 7567 */ 7568 function mapToArray(map) { 7569 var index = -1, 7570 result = Array(map.size); 7571 7572 map.forEach(function(value, key) { 7573 result[++index] = [key, value]; 7574 }); 7575 return result; 7576 } 7577 7578 /** 7579 * Creates a unary function that invokes `func` with its argument transformed. 7580 * 7581 * @private 7582 * @param {Function} func The function to wrap. 7583 * @param {Function} transform The argument transform. 7584 * @returns {Function} Returns the new function. 7585 */ 7586 function overArg(func, transform) { 7587 return function(arg) { 7588 return func(transform(arg)); 7589 }; 7590 } 7591 7592 /** 7593 * Replaces all `placeholder` elements in `array` with an internal placeholder 7594 * and returns an array of their indexes. 7595 * 7596 * @private 7597 * @param {Array} array The array to modify. 7598 * @param {*} placeholder The placeholder to replace. 7599 * @returns {Array} Returns the new array of placeholder indexes. 7600 */ 7601 function replaceHolders(array, placeholder) { 7602 var index = -1, 7603 length = array.length, 7604 resIndex = 0, 7605 result = []; 7606 7607 while (++index < length) { 7608 var value = array[index]; 7609 if (value === placeholder || value === PLACEHOLDER) { 7610 array[index] = PLACEHOLDER; 7611 result[resIndex++] = index; 7612 } 7613 } 7614 return result; 7615 } 7616 7617 /** 7618 * Converts `set` to an array of its values. 7619 * 7620 * @private 7621 * @param {Object} set The set to convert. 7622 * @returns {Array} Returns the values. 7623 */ 7624 function setToArray(set) { 7625 var index = -1, 7626 result = Array(set.size); 7627 7628 set.forEach(function(value) { 7629 result[++index] = value; 7630 }); 7631 return result; 7632 } 7633 7634 /** 7635 * Converts `set` to its value-value pairs. 7636 * 7637 * @private 7638 * @param {Object} set The set to convert. 7639 * @returns {Array} Returns the value-value pairs. 7640 */ 7641 function setToPairs(set) { 7642 var index = -1, 7643 result = Array(set.size); 7644 7645 set.forEach(function(value) { 7646 result[++index] = [value, value]; 7647 }); 7648 return result; 7649 } 7650 7651 /** 7652 * A specialized version of `_.indexOf` which performs strict equality 7653 * comparisons of values, i.e. `===`. 7654 * 7655 * @private 7656 * @param {Array} array The array to inspect. 7657 * @param {*} value The value to search for. 7658 * @param {number} fromIndex The index to search from. 7659 * @returns {number} Returns the index of the matched value, else `-1`. 7660 */ 7661 function strictIndexOf(array, value, fromIndex) { 7662 var index = fromIndex - 1, 7663 length = array.length; 7664 7665 while (++index < length) { 7666 if (array[index] === value) { 7667 return index; 7668 } 7669 } 7670 return -1; 7671 } 7672 7673 /** 7674 * A specialized version of `_.lastIndexOf` which performs strict equality 7675 * comparisons of values, i.e. `===`. 7676 * 7677 * @private 7678 * @param {Array} array The array to inspect. 7679 * @param {*} value The value to search for. 7680 * @param {number} fromIndex The index to search from. 7681 * @returns {number} Returns the index of the matched value, else `-1`. 7682 */ 7683 function strictLastIndexOf(array, value, fromIndex) { 7684 var index = fromIndex + 1; 7685 while (index--) { 7686 if (array[index] === value) { 7687 return index; 7688 } 7689 } 7690 return index; 7691 } 7692 7693 /** 7694 * Gets the number of symbols in `string`. 7695 * 7696 * @private 7697 * @param {string} string The string to inspect. 7698 * @returns {number} Returns the string size. 7699 */ 7700 function stringSize(string) { 7701 return hasUnicode(string) 7702 ? unicodeSize(string) 7703 : asciiSize(string); 7704 } 7705 7706 /** 7707 * Converts `string` to an array. 7708 * 7709 * @private 7710 * @param {string} string The string to convert. 7711 * @returns {Array} Returns the converted array. 7712 */ 7713 function stringToArray(string) { 7714 return hasUnicode(string) 7715 ? unicodeToArray(string) 7716 : asciiToArray(string); 7717 } 7718 7719 /** 7720 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 7721 * character of `string`. 7722 * 7723 * @private 7724 * @param {string} string The string to inspect. 7725 * @returns {number} Returns the index of the last non-whitespace character. 7726 */ 7727 function trimmedEndIndex(string) { 7728 var index = string.length; 7729 7730 while (index-- && reWhitespace.test(string.charAt(index))) {} 7731 return index; 7732 } 7733 7734 /** 7735 * Used by `_.unescape` to convert HTML entities to characters. 7736 * 7737 * @private 7738 * @param {string} chr The matched character to unescape. 7739 * @returns {string} Returns the unescaped character. 7740 */ 7741 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 7742 7743 /** 7744 * Gets the size of a Unicode `string`. 7745 * 7746 * @private 7747 * @param {string} string The string inspect. 7748 * @returns {number} Returns the string size. 7749 */ 7750 function unicodeSize(string) { 7751 var result = reUnicode.lastIndex = 0; 7752 while (reUnicode.test(string)) { 7753 ++result; 7754 } 7755 return result; 7756 } 7757 7758 /** 7759 * Converts a Unicode `string` to an array. 7760 * 7761 * @private 7762 * @param {string} string The string to convert. 7763 * @returns {Array} Returns the converted array. 7764 */ 7765 function unicodeToArray(string) { 7766 return string.match(reUnicode) || []; 7767 } 7768 7769 /** 7770 * Splits a Unicode `string` into an array of its words. 7771 * 7772 * @private 7773 * @param {string} The string to inspect. 7774 * @returns {Array} Returns the words of `string`. 7775 */ 7776 function unicodeWords(string) { 7777 return string.match(reUnicodeWord) || []; 7778 } 7779 7780 /*--------------------------------------------------------------------------*/ 7781 7782 /** 7783 * Create a new pristine `lodash` function using the `context` object. 7784 * 7785 * @static 7786 * @memberOf _ 7787 * @since 1.1.0 7788 * @category Util 7789 * @param {Object} [context=root] The context object. 7790 * @returns {Function} Returns a new `lodash` function. 7791 * @example 7792 * 7793 * _.mixin({ 'foo': _.constant('foo') }); 7794 * 7795 * var lodash = _.runInContext(); 7796 * lodash.mixin({ 'bar': lodash.constant('bar') }); 7797 * 7798 * _.isFunction(_.foo); 7799 * // => true 7800 * _.isFunction(_.bar); 7801 * // => false 7802 * 7803 * lodash.isFunction(lodash.foo); 7804 * // => false 7805 * lodash.isFunction(lodash.bar); 7806 * // => true 7807 * 7808 * // Create a suped-up `defer` in Node.js. 7809 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 7810 */ 7811 var runInContext = (function runInContext(context) { 7812 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 7813 7814 /** Built-in constructor references. */ 7815 var Array = context.Array, 7816 Date = context.Date, 7817 Error = context.Error, 7818 Function = context.Function, 7819 Math = context.Math, 7820 Object = context.Object, 7821 RegExp = context.RegExp, 7822 String = context.String, 7823 TypeError = context.TypeError; 7824 7825 /** Used for built-in method references. */ 7826 var arrayProto = Array.prototype, 7827 funcProto = Function.prototype, 7828 objectProto = Object.prototype; 7829 7830 /** Used to detect overreaching core-js shims. */ 7831 var coreJsData = context['__core-js_shared__']; 7832 7833 /** Used to resolve the decompiled source of functions. */ 7834 var funcToString = funcProto.toString; 7835 7836 /** Used to check objects for own properties. */ 7837 var hasOwnProperty = objectProto.hasOwnProperty; 7838 7839 /** Used to generate unique IDs. */ 7840 var idCounter = 0; 7841 7842 /** Used to detect methods masquerading as native. */ 7843 var maskSrcKey = (function() { 7844 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 7845 return uid ? ('Symbol(src)_1.' + uid) : ''; 7846 }()); 7847 7848 /** 7849 * Used to resolve the 7850 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 7851 * of values. 7852 */ 7853 var nativeObjectToString = objectProto.toString; 7854 7855 /** Used to infer the `Object` constructor. */ 7856 var objectCtorString = funcToString.call(Object); 7857 7858 /** Used to restore the original `_` reference in `_.noConflict`. */ 7859 var oldDash = root._; 7860 7861 /** Used to detect if a method is native. */ 7862 var reIsNative = RegExp('^' + 7863 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 7864 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 7865 ); 7866 7867 /** Built-in value references. */ 7868 var Buffer = moduleExports ? context.Buffer : undefined, 7869 Symbol = context.Symbol, 7870 Uint8Array = context.Uint8Array, 7871 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, 7872 getPrototype = overArg(Object.getPrototypeOf, Object), 7873 objectCreate = Object.create, 7874 propertyIsEnumerable = objectProto.propertyIsEnumerable, 7875 splice = arrayProto.splice, 7876 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, 7877 symIterator = Symbol ? Symbol.iterator : undefined, 7878 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 7879 7880 var defineProperty = (function() { 7881 try { 7882 var func = getNative(Object, 'defineProperty'); 7883 func({}, '', {}); 7884 return func; 7885 } catch (e) {} 7886 }()); 7887 7888 /** Mocked built-ins. */ 7889 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, 7890 ctxNow = Date && Date.now !== root.Date.now && Date.now, 7891 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 7892 7893 /* Built-in method references for those with the same name as other `lodash` methods. */ 7894 var nativeCeil = Math.ceil, 7895 nativeFloor = Math.floor, 7896 nativeGetSymbols = Object.getOwnPropertySymbols, 7897 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 7898 nativeIsFinite = context.isFinite, 7899 nativeJoin = arrayProto.join, 7900 nativeKeys = overArg(Object.keys, Object), 7901 nativeMax = Math.max, 7902 nativeMin = Math.min, 7903 nativeNow = Date.now, 7904 nativeParseInt = context.parseInt, 7905 nativeRandom = Math.random, 7906 nativeReverse = arrayProto.reverse; 7907 7908 /* Built-in method references that are verified to be native. */ 7909 var DataView = getNative(context, 'DataView'), 7910 Map = getNative(context, 'Map'), 7911 Promise = getNative(context, 'Promise'), 7912 Set = getNative(context, 'Set'), 7913 WeakMap = getNative(context, 'WeakMap'), 7914 nativeCreate = getNative(Object, 'create'); 7915 7916 /** Used to store function metadata. */ 7917 var metaMap = WeakMap && new WeakMap; 7918 7919 /** Used to lookup unminified function names. */ 7920 var realNames = {}; 7921 7922 /** Used to detect maps, sets, and weakmaps. */ 7923 var dataViewCtorString = toSource(DataView), 7924 mapCtorString = toSource(Map), 7925 promiseCtorString = toSource(Promise), 7926 setCtorString = toSource(Set), 7927 weakMapCtorString = toSource(WeakMap); 7928 7929 /** Used to convert symbols to primitives and strings. */ 7930 var symbolProto = Symbol ? Symbol.prototype : undefined, 7931 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, 7932 symbolToString = symbolProto ? symbolProto.toString : undefined; 7933 7934 /*------------------------------------------------------------------------*/ 7935 7936 /** 7937 * Creates a `lodash` object which wraps `value` to enable implicit method 7938 * chain sequences. Methods that operate on and return arrays, collections, 7939 * and functions can be chained together. Methods that retrieve a single value 7940 * or may return a primitive value will automatically end the chain sequence 7941 * and return the unwrapped value. Otherwise, the value must be unwrapped 7942 * with `_#value`. 7943 * 7944 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 7945 * enabled using `_.chain`. 7946 * 7947 * The execution of chained methods is lazy, that is, it's deferred until 7948 * `_#value` is implicitly or explicitly called. 7949 * 7950 * Lazy evaluation allows several methods to support shortcut fusion. 7951 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 7952 * the creation of intermediate arrays and can greatly reduce the number of 7953 * iteratee executions. Sections of a chain sequence qualify for shortcut 7954 * fusion if the section is applied to an array and iteratees accept only 7955 * one argument. The heuristic for whether a section qualifies for shortcut 7956 * fusion is subject to change. 7957 * 7958 * Chaining is supported in custom builds as long as the `_#value` method is 7959 * directly or indirectly included in the build. 7960 * 7961 * In addition to lodash methods, wrappers have `Array` and `String` methods. 7962 * 7963 * The wrapper `Array` methods are: 7964 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 7965 * 7966 * The wrapper `String` methods are: 7967 * `replace` and `split` 7968 * 7969 * The wrapper methods that support shortcut fusion are: 7970 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 7971 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 7972 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 7973 * 7974 * The chainable wrapper methods are: 7975 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 7976 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 7977 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 7978 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 7979 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 7980 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 7981 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 7982 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 7983 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 7984 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 7985 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 7986 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 7987 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 7988 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 7989 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 7990 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 7991 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 7992 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 7993 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 7994 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 7995 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 7996 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 7997 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 7998 * `zipObject`, `zipObjectDeep`, and `zipWith` 7999 * 8000 * The wrapper methods that are **not** chainable by default are: 8001 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 8002 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 8003 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 8004 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 8005 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 8006 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 8007 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 8008 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 8009 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 8010 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 8011 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 8012 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 8013 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 8014 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 8015 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 8016 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 8017 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 8018 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 8019 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 8020 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 8021 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 8022 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 8023 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 8024 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 8025 * `upperFirst`, `value`, and `words` 8026 * 8027 * @name _ 8028 * @constructor 8029 * @category Seq 8030 * @param {*} value The value to wrap in a `lodash` instance. 8031 * @returns {Object} Returns the new `lodash` wrapper instance. 8032 * @example 8033 * 8034 * function square(n) { 8035 * return n * n; 8036 * } 8037 * 8038 * var wrapped = _([1, 2, 3]); 8039 * 8040 * // Returns an unwrapped value. 8041 * wrapped.reduce(_.add); 8042 * // => 6 8043 * 8044 * // Returns a wrapped value. 8045 * var squares = wrapped.map(square); 8046 * 8047 * _.isArray(squares); 8048 * // => false 8049 * 8050 * _.isArray(squares.value()); 8051 * // => true 8052 */ 8053 function lodash(value) { 8054 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { 8055 if (value instanceof LodashWrapper) { 8056 return value; 8057 } 8058 if (hasOwnProperty.call(value, '__wrapped__')) { 8059 return wrapperClone(value); 8060 } 8061 } 8062 return new LodashWrapper(value); 8063 } 8064 8065 /** 8066 * The base implementation of `_.create` without support for assigning 8067 * properties to the created object. 8068 * 8069 * @private 8070 * @param {Object} proto The object to inherit from. 8071 * @returns {Object} Returns the new object. 8072 */ 8073 var baseCreate = (function() { 8074 function object() {} 8075 return function(proto) { 8076 if (!isObject(proto)) { 8077 return {}; 8078 } 8079 if (objectCreate) { 8080 return objectCreate(proto); 8081 } 8082 object.prototype = proto; 8083 var result = new object; 8084 object.prototype = undefined; 8085 return result; 8086 }; 8087 }()); 8088 8089 /** 8090 * The function whose prototype chain sequence wrappers inherit from. 8091 * 8092 * @private 8093 */ 8094 function baseLodash() { 8095 // No operation performed. 8096 } 8097 8098 /** 8099 * The base constructor for creating `lodash` wrapper objects. 8100 * 8101 * @private 8102 * @param {*} value The value to wrap. 8103 * @param {boolean} [chainAll] Enable explicit method chain sequences. 8104 */ 8105 function LodashWrapper(value, chainAll) { 8106 this.__wrapped__ = value; 8107 this.__actions__ = []; 8108 this.__chain__ = !!chainAll; 8109 this.__index__ = 0; 8110 this.__values__ = undefined; 8111 } 8112 8113 /** 8114 * By default, the template delimiters used by lodash are like those in 8115 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 8116 * following template settings to use alternative delimiters. 8117 * 8118 * @static 8119 * @memberOf _ 8120 * @type {Object} 8121 */ 8122 lodash.templateSettings = { 8123 8124 /** 8125 * Used to detect `data` property values to be HTML-escaped. 8126 * 8127 * @memberOf _.templateSettings 8128 * @type {RegExp} 8129 */ 8130 'escape': reEscape, 8131 8132 /** 8133 * Used to detect code to be evaluated. 8134 * 8135 * @memberOf _.templateSettings 8136 * @type {RegExp} 8137 */ 8138 'evaluate': reEvaluate, 8139 8140 /** 8141 * Used to detect `data` property values to inject. 8142 * 8143 * @memberOf _.templateSettings 8144 * @type {RegExp} 8145 */ 8146 'interpolate': reInterpolate, 8147 8148 /** 8149 * Used to reference the data object in the template text. 8150 * 8151 * @memberOf _.templateSettings 8152 * @type {string} 8153 */ 8154 'variable': '', 8155 8156 /** 8157 * Used to import variables into the compiled template. 8158 * 8159 * @memberOf _.templateSettings 8160 * @type {Object} 8161 */ 8162 'imports': { 8163 8164 /** 8165 * A reference to the `lodash` function. 8166 * 8167 * @memberOf _.templateSettings.imports 8168 * @type {Function} 8169 */ 8170 '_': lodash 8171 } 8172 }; 8173 8174 // Ensure wrappers are instances of `baseLodash`. 8175 lodash.prototype = baseLodash.prototype; 8176 lodash.prototype.constructor = lodash; 8177 8178 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 8179 LodashWrapper.prototype.constructor = LodashWrapper; 8180 8181 /*------------------------------------------------------------------------*/ 8182 8183 /** 8184 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 8185 * 8186 * @private 8187 * @constructor 8188 * @param {*} value The value to wrap. 8189 */ 8190 function LazyWrapper(value) { 8191 this.__wrapped__ = value; 8192 this.__actions__ = []; 8193 this.__dir__ = 1; 8194 this.__filtered__ = false; 8195 this.__iteratees__ = []; 8196 this.__takeCount__ = MAX_ARRAY_LENGTH; 8197 this.__views__ = []; 8198 } 8199 8200 /** 8201 * Creates a clone of the lazy wrapper object. 8202 * 8203 * @private 8204 * @name clone 8205 * @memberOf LazyWrapper 8206 * @returns {Object} Returns the cloned `LazyWrapper` object. 8207 */ 8208 function lazyClone() { 8209 var result = new LazyWrapper(this.__wrapped__); 8210 result.__actions__ = copyArray(this.__actions__); 8211 result.__dir__ = this.__dir__; 8212 result.__filtered__ = this.__filtered__; 8213 result.__iteratees__ = copyArray(this.__iteratees__); 8214 result.__takeCount__ = this.__takeCount__; 8215 result.__views__ = copyArray(this.__views__); 8216 return result; 8217 } 8218 8219 /** 8220 * Reverses the direction of lazy iteration. 8221 * 8222 * @private 8223 * @name reverse 8224 * @memberOf LazyWrapper 8225 * @returns {Object} Returns the new reversed `LazyWrapper` object. 8226 */ 8227 function lazyReverse() { 8228 if (this.__filtered__) { 8229 var result = new LazyWrapper(this); 8230 result.__dir__ = -1; 8231 result.__filtered__ = true; 8232 } else { 8233 result = this.clone(); 8234 result.__dir__ *= -1; 8235 } 8236 return result; 8237 } 8238 8239 /** 8240 * Extracts the unwrapped value from its lazy wrapper. 8241 * 8242 * @private 8243 * @name value 8244 * @memberOf LazyWrapper 8245 * @returns {*} Returns the unwrapped value. 8246 */ 8247 function lazyValue() { 8248 var array = this.__wrapped__.value(), 8249 dir = this.__dir__, 8250 isArr = isArray(array), 8251 isRight = dir < 0, 8252 arrLength = isArr ? array.length : 0, 8253 view = getView(0, arrLength, this.__views__), 8254 start = view.start, 8255 end = view.end, 8256 length = end - start, 8257 index = isRight ? end : (start - 1), 8258 iteratees = this.__iteratees__, 8259 iterLength = iteratees.length, 8260 resIndex = 0, 8261 takeCount = nativeMin(length, this.__takeCount__); 8262 8263 if (!isArr || (!isRight && arrLength == length && takeCount == length)) { 8264 return baseWrapperValue(array, this.__actions__); 8265 } 8266 var result = []; 8267 8268 outer: 8269 while (length-- && resIndex < takeCount) { 8270 index += dir; 8271 8272 var iterIndex = -1, 8273 value = array[index]; 8274 8275 while (++iterIndex < iterLength) { 8276 var data = iteratees[iterIndex], 8277 iteratee = data.iteratee, 8278 type = data.type, 8279 computed = iteratee(value); 8280 8281 if (type == LAZY_MAP_FLAG) { 8282 value = computed; 8283 } else if (!computed) { 8284 if (type == LAZY_FILTER_FLAG) { 8285 continue outer; 8286 } else { 8287 break outer; 8288 } 8289 } 8290 } 8291 result[resIndex++] = value; 8292 } 8293 return result; 8294 } 8295 8296 // Ensure `LazyWrapper` is an instance of `baseLodash`. 8297 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 8298 LazyWrapper.prototype.constructor = LazyWrapper; 8299 8300 /*------------------------------------------------------------------------*/ 8301 8302 /** 8303 * Creates a hash object. 8304 * 8305 * @private 8306 * @constructor 8307 * @param {Array} [entries] The key-value pairs to cache. 8308 */ 8309 function Hash(entries) { 8310 var index = -1, 8311 length = entries == null ? 0 : entries.length; 8312 8313 this.clear(); 8314 while (++index < length) { 8315 var entry = entries[index]; 8316 this.set(entry[0], entry[1]); 8317 } 8318 } 8319 8320 /** 8321 * Removes all key-value entries from the hash. 8322 * 8323 * @private 8324 * @name clear 8325 * @memberOf Hash 8326 */ 8327 function hashClear() { 8328 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 8329 this.size = 0; 8330 } 8331 8332 /** 8333 * Removes `key` and its value from the hash. 8334 * 8335 * @private 8336 * @name delete 8337 * @memberOf Hash 8338 * @param {Object} hash The hash to modify. 8339 * @param {string} key The key of the value to remove. 8340 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 8341 */ 8342 function hashDelete(key) { 8343 var result = this.has(key) && delete this.__data__[key]; 8344 this.size -= result ? 1 : 0; 8345 return result; 8346 } 8347 8348 /** 8349 * Gets the hash value for `key`. 8350 * 8351 * @private 8352 * @name get 8353 * @memberOf Hash 8354 * @param {string} key The key of the value to get. 8355 * @returns {*} Returns the entry value. 8356 */ 8357 function hashGet(key) { 8358 var data = this.__data__; 8359 if (nativeCreate) { 8360 var result = data[key]; 8361 return result === HASH_UNDEFINED ? undefined : result; 8362 } 8363 return hasOwnProperty.call(data, key) ? data[key] : undefined; 8364 } 8365 8366 /** 8367 * Checks if a hash value for `key` exists. 8368 * 8369 * @private 8370 * @name has 8371 * @memberOf Hash 8372 * @param {string} key The key of the entry to check. 8373 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 8374 */ 8375 function hashHas(key) { 8376 var data = this.__data__; 8377 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 8378 } 8379 8380 /** 8381 * Sets the hash `key` to `value`. 8382 * 8383 * @private 8384 * @name set 8385 * @memberOf Hash 8386 * @param {string} key The key of the value to set. 8387 * @param {*} value The value to set. 8388 * @returns {Object} Returns the hash instance. 8389 */ 8390 function hashSet(key, value) { 8391 var data = this.__data__; 8392 this.size += this.has(key) ? 0 : 1; 8393 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 8394 return this; 8395 } 8396 8397 // Add methods to `Hash`. 8398 Hash.prototype.clear = hashClear; 8399 Hash.prototype['delete'] = hashDelete; 8400 Hash.prototype.get = hashGet; 8401 Hash.prototype.has = hashHas; 8402 Hash.prototype.set = hashSet; 8403 8404 /*------------------------------------------------------------------------*/ 8405 8406 /** 8407 * Creates an list cache object. 8408 * 8409 * @private 8410 * @constructor 8411 * @param {Array} [entries] The key-value pairs to cache. 8412 */ 8413 function ListCache(entries) { 8414 var index = -1, 8415 length = entries == null ? 0 : entries.length; 8416 8417 this.clear(); 8418 while (++index < length) { 8419 var entry = entries[index]; 8420 this.set(entry[0], entry[1]); 8421 } 8422 } 8423 8424 /** 8425 * Removes all key-value entries from the list cache. 8426 * 8427 * @private 8428 * @name clear 8429 * @memberOf ListCache 8430 */ 8431 function listCacheClear() { 8432 this.__data__ = []; 8433 this.size = 0; 8434 } 8435 8436 /** 8437 * Removes `key` and its value from the list cache. 8438 * 8439 * @private 8440 * @name delete 8441 * @memberOf ListCache 8442 * @param {string} key The key of the value to remove. 8443 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 8444 */ 8445 function listCacheDelete(key) { 8446 var data = this.__data__, 8447 index = assocIndexOf(data, key); 8448 8449 if (index < 0) { 8450 return false; 8451 } 8452 var lastIndex = data.length - 1; 8453 if (index == lastIndex) { 8454 data.pop(); 8455 } else { 8456 splice.call(data, index, 1); 8457 } 8458 --this.size; 8459 return true; 8460 } 8461 8462 /** 8463 * Gets the list cache value for `key`. 8464 * 8465 * @private 8466 * @name get 8467 * @memberOf ListCache 8468 * @param {string} key The key of the value to get. 8469 * @returns {*} Returns the entry value. 8470 */ 8471 function listCacheGet(key) { 8472 var data = this.__data__, 8473 index = assocIndexOf(data, key); 8474 8475 return index < 0 ? undefined : data[index][1]; 8476 } 8477 8478 /** 8479 * Checks if a list cache value for `key` exists. 8480 * 8481 * @private 8482 * @name has 8483 * @memberOf ListCache 8484 * @param {string} key The key of the entry to check. 8485 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 8486 */ 8487 function listCacheHas(key) { 8488 return assocIndexOf(this.__data__, key) > -1; 8489 } 8490 8491 /** 8492 * Sets the list cache `key` to `value`. 8493 * 8494 * @private 8495 * @name set 8496 * @memberOf ListCache 8497 * @param {string} key The key of the value to set. 8498 * @param {*} value The value to set. 8499 * @returns {Object} Returns the list cache instance. 8500 */ 8501 function listCacheSet(key, value) { 8502 var data = this.__data__, 8503 index = assocIndexOf(data, key); 8504 8505 if (index < 0) { 8506 ++this.size; 8507 data.push([key, value]); 8508 } else { 8509 data[index][1] = value; 8510 } 8511 return this; 8512 } 8513 8514 // Add methods to `ListCache`. 8515 ListCache.prototype.clear = listCacheClear; 8516 ListCache.prototype['delete'] = listCacheDelete; 8517 ListCache.prototype.get = listCacheGet; 8518 ListCache.prototype.has = listCacheHas; 8519 ListCache.prototype.set = listCacheSet; 8520 8521 /*------------------------------------------------------------------------*/ 8522 8523 /** 8524 * Creates a map cache object to store key-value pairs. 8525 * 8526 * @private 8527 * @constructor 8528 * @param {Array} [entries] The key-value pairs to cache. 8529 */ 8530 function MapCache(entries) { 8531 var index = -1, 8532 length = entries == null ? 0 : entries.length; 8533 8534 this.clear(); 8535 while (++index < length) { 8536 var entry = entries[index]; 8537 this.set(entry[0], entry[1]); 8538 } 8539 } 8540 8541 /** 8542 * Removes all key-value entries from the map. 8543 * 8544 * @private 8545 * @name clear 8546 * @memberOf MapCache 8547 */ 8548 function mapCacheClear() { 8549 this.size = 0; 8550 this.__data__ = { 8551 'hash': new Hash, 8552 'map': new (Map || ListCache), 8553 'string': new Hash 8554 }; 8555 } 8556 8557 /** 8558 * Removes `key` and its value from the map. 8559 * 8560 * @private 8561 * @name delete 8562 * @memberOf MapCache 8563 * @param {string} key The key of the value to remove. 8564 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 8565 */ 8566 function mapCacheDelete(key) { 8567 var result = getMapData(this, key)['delete'](key); 8568 this.size -= result ? 1 : 0; 8569 return result; 8570 } 8571 8572 /** 8573 * Gets the map value for `key`. 8574 * 8575 * @private 8576 * @name get 8577 * @memberOf MapCache 8578 * @param {string} key The key of the value to get. 8579 * @returns {*} Returns the entry value. 8580 */ 8581 function mapCacheGet(key) { 8582 return getMapData(this, key).get(key); 8583 } 8584 8585 /** 8586 * Checks if a map value for `key` exists. 8587 * 8588 * @private 8589 * @name has 8590 * @memberOf MapCache 8591 * @param {string} key The key of the entry to check. 8592 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 8593 */ 8594 function mapCacheHas(key) { 8595 return getMapData(this, key).has(key); 8596 } 8597 8598 /** 8599 * Sets the map `key` to `value`. 8600 * 8601 * @private 8602 * @name set 8603 * @memberOf MapCache 8604 * @param {string} key The key of the value to set. 8605 * @param {*} value The value to set. 8606 * @returns {Object} Returns the map cache instance. 8607 */ 8608 function mapCacheSet(key, value) { 8609 var data = getMapData(this, key), 8610 size = data.size; 8611 8612 data.set(key, value); 8613 this.size += data.size == size ? 0 : 1; 8614 return this; 8615 } 8616 8617 // Add methods to `MapCache`. 8618 MapCache.prototype.clear = mapCacheClear; 8619 MapCache.prototype['delete'] = mapCacheDelete; 8620 MapCache.prototype.get = mapCacheGet; 8621 MapCache.prototype.has = mapCacheHas; 8622 MapCache.prototype.set = mapCacheSet; 8623 8624 /*------------------------------------------------------------------------*/ 8625 8626 /** 8627 * 8628 * Creates an array cache object to store unique values. 8629 * 8630 * @private 8631 * @constructor 8632 * @param {Array} [values] The values to cache. 8633 */ 8634 function SetCache(values) { 8635 var index = -1, 8636 length = values == null ? 0 : values.length; 8637 8638 this.__data__ = new MapCache; 8639 while (++index < length) { 8640 this.add(values[index]); 8641 } 8642 } 8643 8644 /** 8645 * Adds `value` to the array cache. 8646 * 8647 * @private 8648 * @name add 8649 * @memberOf SetCache 8650 * @alias push 8651 * @param {*} value The value to cache. 8652 * @returns {Object} Returns the cache instance. 8653 */ 8654 function setCacheAdd(value) { 8655 this.__data__.set(value, HASH_UNDEFINED); 8656 return this; 8657 } 8658 8659 /** 8660 * Checks if `value` is in the array cache. 8661 * 8662 * @private 8663 * @name has 8664 * @memberOf SetCache 8665 * @param {*} value The value to search for. 8666 * @returns {number} Returns `true` if `value` is found, else `false`. 8667 */ 8668 function setCacheHas(value) { 8669 return this.__data__.has(value); 8670 } 8671 8672 // Add methods to `SetCache`. 8673 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 8674 SetCache.prototype.has = setCacheHas; 8675 8676 /*------------------------------------------------------------------------*/ 8677 8678 /** 8679 * Creates a stack cache object to store key-value pairs. 8680 * 8681 * @private 8682 * @constructor 8683 * @param {Array} [entries] The key-value pairs to cache. 8684 */ 8685 function Stack(entries) { 8686 var data = this.__data__ = new ListCache(entries); 8687 this.size = data.size; 8688 } 8689 8690 /** 8691 * Removes all key-value entries from the stack. 8692 * 8693 * @private 8694 * @name clear 8695 * @memberOf Stack 8696 */ 8697 function stackClear() { 8698 this.__data__ = new ListCache; 8699 this.size = 0; 8700 } 8701 8702 /** 8703 * Removes `key` and its value from the stack. 8704 * 8705 * @private 8706 * @name delete 8707 * @memberOf Stack 8708 * @param {string} key The key of the value to remove. 8709 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 8710 */ 8711 function stackDelete(key) { 8712 var data = this.__data__, 8713 result = data['delete'](key); 8714 8715 this.size = data.size; 8716 return result; 8717 } 8718 8719 /** 8720 * Gets the stack value for `key`. 8721 * 8722 * @private 8723 * @name get 8724 * @memberOf Stack 8725 * @param {string} key The key of the value to get. 8726 * @returns {*} Returns the entry value. 8727 */ 8728 function stackGet(key) { 8729 return this.__data__.get(key); 8730 } 8731 8732 /** 8733 * Checks if a stack value for `key` exists. 8734 * 8735 * @private 8736 * @name has 8737 * @memberOf Stack 8738 * @param {string} key The key of the entry to check. 8739 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 8740 */ 8741 function stackHas(key) { 8742 return this.__data__.has(key); 8743 } 8744 8745 /** 8746 * Sets the stack `key` to `value`. 8747 * 8748 * @private 8749 * @name set 8750 * @memberOf Stack 8751 * @param {string} key The key of the value to set. 8752 * @param {*} value The value to set. 8753 * @returns {Object} Returns the stack cache instance. 8754 */ 8755 function stackSet(key, value) { 8756 var data = this.__data__; 8757 if (data instanceof ListCache) { 8758 var pairs = data.__data__; 8759 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 8760 pairs.push([key, value]); 8761 this.size = ++data.size; 8762 return this; 8763 } 8764 data = this.__data__ = new MapCache(pairs); 8765 } 8766 data.set(key, value); 8767 this.size = data.size; 8768 return this; 8769 } 8770 8771 // Add methods to `Stack`. 8772 Stack.prototype.clear = stackClear; 8773 Stack.prototype['delete'] = stackDelete; 8774 Stack.prototype.get = stackGet; 8775 Stack.prototype.has = stackHas; 8776 Stack.prototype.set = stackSet; 8777 8778 /*------------------------------------------------------------------------*/ 8779 8780 /** 8781 * Creates an array of the enumerable property names of the array-like `value`. 8782 * 8783 * @private 8784 * @param {*} value The value to query. 8785 * @param {boolean} inherited Specify returning inherited property names. 8786 * @returns {Array} Returns the array of property names. 8787 */ 8788 function arrayLikeKeys(value, inherited) { 8789 var isArr = isArray(value), 8790 isArg = !isArr && isArguments(value), 8791 isBuff = !isArr && !isArg && isBuffer(value), 8792 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 8793 skipIndexes = isArr || isArg || isBuff || isType, 8794 result = skipIndexes ? baseTimes(value.length, String) : [], 8795 length = result.length; 8796 8797 for (var key in value) { 8798 if ((inherited || hasOwnProperty.call(value, key)) && 8799 !(skipIndexes && ( 8800 // Safari 9 has enumerable `arguments.length` in strict mode. 8801 key == 'length' || 8802 // Node.js 0.10 has enumerable non-index properties on buffers. 8803 (isBuff && (key == 'offset' || key == 'parent')) || 8804 // PhantomJS 2 has enumerable non-index properties on typed arrays. 8805 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 8806 // Skip index properties. 8807 isIndex(key, length) 8808 ))) { 8809 result.push(key); 8810 } 8811 } 8812 return result; 8813 } 8814 8815 /** 8816 * A specialized version of `_.sample` for arrays. 8817 * 8818 * @private 8819 * @param {Array} array The array to sample. 8820 * @returns {*} Returns the random element. 8821 */ 8822 function arraySample(array) { 8823 var length = array.length; 8824 return length ? array[baseRandom(0, length - 1)] : undefined; 8825 } 8826 8827 /** 8828 * A specialized version of `_.sampleSize` for arrays. 8829 * 8830 * @private 8831 * @param {Array} array The array to sample. 8832 * @param {number} n The number of elements to sample. 8833 * @returns {Array} Returns the random elements. 8834 */ 8835 function arraySampleSize(array, n) { 8836 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 8837 } 8838 8839 /** 8840 * A specialized version of `_.shuffle` for arrays. 8841 * 8842 * @private 8843 * @param {Array} array The array to shuffle. 8844 * @returns {Array} Returns the new shuffled array. 8845 */ 8846 function arrayShuffle(array) { 8847 return shuffleSelf(copyArray(array)); 8848 } 8849 8850 /** 8851 * This function is like `assignValue` except that it doesn't assign 8852 * `undefined` values. 8853 * 8854 * @private 8855 * @param {Object} object The object to modify. 8856 * @param {string} key The key of the property to assign. 8857 * @param {*} value The value to assign. 8858 */ 8859 function assignMergeValue(object, key, value) { 8860 if ((value !== undefined && !eq(object[key], value)) || 8861 (value === undefined && !(key in object))) { 8862 baseAssignValue(object, key, value); 8863 } 8864 } 8865 8866 /** 8867 * Assigns `value` to `key` of `object` if the existing value is not equivalent 8868 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 8869 * for equality comparisons. 8870 * 8871 * @private 8872 * @param {Object} object The object to modify. 8873 * @param {string} key The key of the property to assign. 8874 * @param {*} value The value to assign. 8875 */ 8876 function assignValue(object, key, value) { 8877 var objValue = object[key]; 8878 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 8879 (value === undefined && !(key in object))) { 8880 baseAssignValue(object, key, value); 8881 } 8882 } 8883 8884 /** 8885 * Gets the index at which the `key` is found in `array` of key-value pairs. 8886 * 8887 * @private 8888 * @param {Array} array The array to inspect. 8889 * @param {*} key The key to search for. 8890 * @returns {number} Returns the index of the matched value, else `-1`. 8891 */ 8892 function assocIndexOf(array, key) { 8893 var length = array.length; 8894 while (length--) { 8895 if (eq(array[length][0], key)) { 8896 return length; 8897 } 8898 } 8899 return -1; 8900 } 8901 8902 /** 8903 * Aggregates elements of `collection` on `accumulator` with keys transformed 8904 * by `iteratee` and values set by `setter`. 8905 * 8906 * @private 8907 * @param {Array|Object} collection The collection to iterate over. 8908 * @param {Function} setter The function to set `accumulator` values. 8909 * @param {Function} iteratee The iteratee to transform keys. 8910 * @param {Object} accumulator The initial aggregated object. 8911 * @returns {Function} Returns `accumulator`. 8912 */ 8913 function baseAggregator(collection, setter, iteratee, accumulator) { 8914 baseEach(collection, function(value, key, collection) { 8915 setter(accumulator, value, iteratee(value), collection); 8916 }); 8917 return accumulator; 8918 } 8919 8920 /** 8921 * The base implementation of `_.assign` without support for multiple sources 8922 * or `customizer` functions. 8923 * 8924 * @private 8925 * @param {Object} object The destination object. 8926 * @param {Object} source The source object. 8927 * @returns {Object} Returns `object`. 8928 */ 8929 function baseAssign(object, source) { 8930 return object && copyObject(source, keys(source), object); 8931 } 8932 8933 /** 8934 * The base implementation of `_.assignIn` without support for multiple sources 8935 * or `customizer` functions. 8936 * 8937 * @private 8938 * @param {Object} object The destination object. 8939 * @param {Object} source The source object. 8940 * @returns {Object} Returns `object`. 8941 */ 8942 function baseAssignIn(object, source) { 8943 return object && copyObject(source, keysIn(source), object); 8944 } 8945 8946 /** 8947 * The base implementation of `assignValue` and `assignMergeValue` without 8948 * value checks. 8949 * 8950 * @private 8951 * @param {Object} object The object to modify. 8952 * @param {string} key The key of the property to assign. 8953 * @param {*} value The value to assign. 8954 */ 8955 function baseAssignValue(object, key, value) { 8956 if (key == '__proto__' && defineProperty) { 8957 defineProperty(object, key, { 8958 'configurable': true, 8959 'enumerable': true, 8960 'value': value, 8961 'writable': true 8962 }); 8963 } else { 8964 object[key] = value; 8965 } 8966 } 8967 8968 /** 8969 * The base implementation of `_.at` without support for individual paths. 8970 * 8971 * @private 8972 * @param {Object} object The object to iterate over. 8973 * @param {string[]} paths The property paths to pick. 8974 * @returns {Array} Returns the picked elements. 8975 */ 8976 function baseAt(object, paths) { 8977 var index = -1, 8978 length = paths.length, 8979 result = Array(length), 8980 skip = object == null; 8981 8982 while (++index < length) { 8983 result[index] = skip ? undefined : get(object, paths[index]); 8984 } 8985 return result; 8986 } 8987 8988 /** 8989 * The base implementation of `_.clamp` which doesn't coerce arguments. 8990 * 8991 * @private 8992 * @param {number} number The number to clamp. 8993 * @param {number} [lower] The lower bound. 8994 * @param {number} upper The upper bound. 8995 * @returns {number} Returns the clamped number. 8996 */ 8997 function baseClamp(number, lower, upper) { 8998 if (number === number) { 8999 if (upper !== undefined) { 9000 number = number <= upper ? number : upper; 9001 } 9002 if (lower !== undefined) { 9003 number = number >= lower ? number : lower; 9004 } 9005 } 9006 return number; 9007 } 9008 9009 /** 9010 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 9011 * traversed objects. 9012 * 9013 * @private 9014 * @param {*} value The value to clone. 9015 * @param {boolean} bitmask The bitmask flags. 9016 * 1 - Deep clone 9017 * 2 - Flatten inherited properties 9018 * 4 - Clone symbols 9019 * @param {Function} [customizer] The function to customize cloning. 9020 * @param {string} [key] The key of `value`. 9021 * @param {Object} [object] The parent object of `value`. 9022 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 9023 * @returns {*} Returns the cloned value. 9024 */ 9025 function baseClone(value, bitmask, customizer, key, object, stack) { 9026 var result, 9027 isDeep = bitmask & CLONE_DEEP_FLAG, 9028 isFlat = bitmask & CLONE_FLAT_FLAG, 9029 isFull = bitmask & CLONE_SYMBOLS_FLAG; 9030 9031 if (customizer) { 9032 result = object ? customizer(value, key, object, stack) : customizer(value); 9033 } 9034 if (result !== undefined) { 9035 return result; 9036 } 9037 if (!isObject(value)) { 9038 return value; 9039 } 9040 var isArr = isArray(value); 9041 if (isArr) { 9042 result = initCloneArray(value); 9043 if (!isDeep) { 9044 return copyArray(value, result); 9045 } 9046 } else { 9047 var tag = getTag(value), 9048 isFunc = tag == funcTag || tag == genTag; 9049 9050 if (isBuffer(value)) { 9051 return cloneBuffer(value, isDeep); 9052 } 9053 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 9054 result = (isFlat || isFunc) ? {} : initCloneObject(value); 9055 if (!isDeep) { 9056 return isFlat 9057 ? copySymbolsIn(value, baseAssignIn(result, value)) 9058 : copySymbols(value, baseAssign(result, value)); 9059 } 9060 } else { 9061 if (!cloneableTags[tag]) { 9062 return object ? value : {}; 9063 } 9064 result = initCloneByTag(value, tag, isDeep); 9065 } 9066 } 9067 // Check for circular references and return its corresponding clone. 9068 stack || (stack = new Stack); 9069 var stacked = stack.get(value); 9070 if (stacked) { 9071 return stacked; 9072 } 9073 stack.set(value, result); 9074 9075 if (isSet(value)) { 9076 value.forEach(function(subValue) { 9077 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 9078 }); 9079 } else if (isMap(value)) { 9080 value.forEach(function(subValue, key) { 9081 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 9082 }); 9083 } 9084 9085 var keysFunc = isFull 9086 ? (isFlat ? getAllKeysIn : getAllKeys) 9087 : (isFlat ? keysIn : keys); 9088 9089 var props = isArr ? undefined : keysFunc(value); 9090 arrayEach(props || value, function(subValue, key) { 9091 if (props) { 9092 key = subValue; 9093 subValue = value[key]; 9094 } 9095 // Recursively populate clone (susceptible to call stack limits). 9096 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 9097 }); 9098 return result; 9099 } 9100 9101 /** 9102 * The base implementation of `_.conforms` which doesn't clone `source`. 9103 * 9104 * @private 9105 * @param {Object} source The object of property predicates to conform to. 9106 * @returns {Function} Returns the new spec function. 9107 */ 9108 function baseConforms(source) { 9109 var props = keys(source); 9110 return function(object) { 9111 return baseConformsTo(object, source, props); 9112 }; 9113 } 9114 9115 /** 9116 * The base implementation of `_.conformsTo` which accepts `props` to check. 9117 * 9118 * @private 9119 * @param {Object} object The object to inspect. 9120 * @param {Object} source The object of property predicates to conform to. 9121 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 9122 */ 9123 function baseConformsTo(object, source, props) { 9124 var length = props.length; 9125 if (object == null) { 9126 return !length; 9127 } 9128 object = Object(object); 9129 while (length--) { 9130 var key = props[length], 9131 predicate = source[key], 9132 value = object[key]; 9133 9134 if ((value === undefined && !(key in object)) || !predicate(value)) { 9135 return false; 9136 } 9137 } 9138 return true; 9139 } 9140 9141 /** 9142 * The base implementation of `_.delay` and `_.defer` which accepts `args` 9143 * to provide to `func`. 9144 * 9145 * @private 9146 * @param {Function} func The function to delay. 9147 * @param {number} wait The number of milliseconds to delay invocation. 9148 * @param {Array} args The arguments to provide to `func`. 9149 * @returns {number|Object} Returns the timer id or timeout object. 9150 */ 9151 function baseDelay(func, wait, args) { 9152 if (typeof func != 'function') { 9153 throw new TypeError(FUNC_ERROR_TEXT); 9154 } 9155 return setTimeout(function() { func.apply(undefined, args); }, wait); 9156 } 9157 9158 /** 9159 * The base implementation of methods like `_.difference` without support 9160 * for excluding multiple arrays or iteratee shorthands. 9161 * 9162 * @private 9163 * @param {Array} array The array to inspect. 9164 * @param {Array} values The values to exclude. 9165 * @param {Function} [iteratee] The iteratee invoked per element. 9166 * @param {Function} [comparator] The comparator invoked per element. 9167 * @returns {Array} Returns the new array of filtered values. 9168 */ 9169 function baseDifference(array, values, iteratee, comparator) { 9170 var index = -1, 9171 includes = arrayIncludes, 9172 isCommon = true, 9173 length = array.length, 9174 result = [], 9175 valuesLength = values.length; 9176 9177 if (!length) { 9178 return result; 9179 } 9180 if (iteratee) { 9181 values = arrayMap(values, baseUnary(iteratee)); 9182 } 9183 if (comparator) { 9184 includes = arrayIncludesWith; 9185 isCommon = false; 9186 } 9187 else if (values.length >= LARGE_ARRAY_SIZE) { 9188 includes = cacheHas; 9189 isCommon = false; 9190 values = new SetCache(values); 9191 } 9192 outer: 9193 while (++index < length) { 9194 var value = array[index], 9195 computed = iteratee == null ? value : iteratee(value); 9196 9197 value = (comparator || value !== 0) ? value : 0; 9198 if (isCommon && computed === computed) { 9199 var valuesIndex = valuesLength; 9200 while (valuesIndex--) { 9201 if (values[valuesIndex] === computed) { 9202 continue outer; 9203 } 9204 } 9205 result.push(value); 9206 } 9207 else if (!includes(values, computed, comparator)) { 9208 result.push(value); 9209 } 9210 } 9211 return result; 9212 } 9213 9214 /** 9215 * The base implementation of `_.forEach` without support for iteratee shorthands. 9216 * 9217 * @private 9218 * @param {Array|Object} collection The collection to iterate over. 9219 * @param {Function} iteratee The function invoked per iteration. 9220 * @returns {Array|Object} Returns `collection`. 9221 */ 9222 var baseEach = createBaseEach(baseForOwn); 9223 9224 /** 9225 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 9226 * 9227 * @private 9228 * @param {Array|Object} collection The collection to iterate over. 9229 * @param {Function} iteratee The function invoked per iteration. 9230 * @returns {Array|Object} Returns `collection`. 9231 */ 9232 var baseEachRight = createBaseEach(baseForOwnRight, true); 9233 9234 /** 9235 * The base implementation of `_.every` without support for iteratee shorthands. 9236 * 9237 * @private 9238 * @param {Array|Object} collection The collection to iterate over. 9239 * @param {Function} predicate The function invoked per iteration. 9240 * @returns {boolean} Returns `true` if all elements pass the predicate check, 9241 * else `false` 9242 */ 9243 function baseEvery(collection, predicate) { 9244 var result = true; 9245 baseEach(collection, function(value, index, collection) { 9246 result = !!predicate(value, index, collection); 9247 return result; 9248 }); 9249 return result; 9250 } 9251 9252 /** 9253 * The base implementation of methods like `_.max` and `_.min` which accepts a 9254 * `comparator` to determine the extremum value. 9255 * 9256 * @private 9257 * @param {Array} array The array to iterate over. 9258 * @param {Function} iteratee The iteratee invoked per iteration. 9259 * @param {Function} comparator The comparator used to compare values. 9260 * @returns {*} Returns the extremum value. 9261 */ 9262 function baseExtremum(array, iteratee, comparator) { 9263 var index = -1, 9264 length = array.length; 9265 9266 while (++index < length) { 9267 var value = array[index], 9268 current = iteratee(value); 9269 9270 if (current != null && (computed === undefined 9271 ? (current === current && !isSymbol(current)) 9272 : comparator(current, computed) 9273 )) { 9274 var computed = current, 9275 result = value; 9276 } 9277 } 9278 return result; 9279 } 9280 9281 /** 9282 * The base implementation of `_.fill` without an iteratee call guard. 9283 * 9284 * @private 9285 * @param {Array} array The array to fill. 9286 * @param {*} value The value to fill `array` with. 9287 * @param {number} [start=0] The start position. 9288 * @param {number} [end=array.length] The end position. 9289 * @returns {Array} Returns `array`. 9290 */ 9291 function baseFill(array, value, start, end) { 9292 var length = array.length; 9293 9294 start = toInteger(start); 9295 if (start < 0) { 9296 start = -start > length ? 0 : (length + start); 9297 } 9298 end = (end === undefined || end > length) ? length : toInteger(end); 9299 if (end < 0) { 9300 end += length; 9301 } 9302 end = start > end ? 0 : toLength(end); 9303 while (start < end) { 9304 array[start++] = value; 9305 } 9306 return array; 9307 } 9308 9309 /** 9310 * The base implementation of `_.filter` without support for iteratee shorthands. 9311 * 9312 * @private 9313 * @param {Array|Object} collection The collection to iterate over. 9314 * @param {Function} predicate The function invoked per iteration. 9315 * @returns {Array} Returns the new filtered array. 9316 */ 9317 function baseFilter(collection, predicate) { 9318 var result = []; 9319 baseEach(collection, function(value, index, collection) { 9320 if (predicate(value, index, collection)) { 9321 result.push(value); 9322 } 9323 }); 9324 return result; 9325 } 9326 9327 /** 9328 * The base implementation of `_.flatten` with support for restricting flattening. 9329 * 9330 * @private 9331 * @param {Array} array The array to flatten. 9332 * @param {number} depth The maximum recursion depth. 9333 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 9334 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 9335 * @param {Array} [result=[]] The initial result value. 9336 * @returns {Array} Returns the new flattened array. 9337 */ 9338 function baseFlatten(array, depth, predicate, isStrict, result) { 9339 var index = -1, 9340 length = array.length; 9341 9342 predicate || (predicate = isFlattenable); 9343 result || (result = []); 9344 9345 while (++index < length) { 9346 var value = array[index]; 9347 if (depth > 0 && predicate(value)) { 9348 if (depth > 1) { 9349 // Recursively flatten arrays (susceptible to call stack limits). 9350 baseFlatten(value, depth - 1, predicate, isStrict, result); 9351 } else { 9352 arrayPush(result, value); 9353 } 9354 } else if (!isStrict) { 9355 result[result.length] = value; 9356 } 9357 } 9358 return result; 9359 } 9360 9361 /** 9362 * The base implementation of `baseForOwn` which iterates over `object` 9363 * properties returned by `keysFunc` and invokes `iteratee` for each property. 9364 * Iteratee functions may exit iteration early by explicitly returning `false`. 9365 * 9366 * @private 9367 * @param {Object} object The object to iterate over. 9368 * @param {Function} iteratee The function invoked per iteration. 9369 * @param {Function} keysFunc The function to get the keys of `object`. 9370 * @returns {Object} Returns `object`. 9371 */ 9372 var baseFor = createBaseFor(); 9373 9374 /** 9375 * This function is like `baseFor` except that it iterates over properties 9376 * in the opposite order. 9377 * 9378 * @private 9379 * @param {Object} object The object to iterate over. 9380 * @param {Function} iteratee The function invoked per iteration. 9381 * @param {Function} keysFunc The function to get the keys of `object`. 9382 * @returns {Object} Returns `object`. 9383 */ 9384 var baseForRight = createBaseFor(true); 9385 9386 /** 9387 * The base implementation of `_.forOwn` without support for iteratee shorthands. 9388 * 9389 * @private 9390 * @param {Object} object The object to iterate over. 9391 * @param {Function} iteratee The function invoked per iteration. 9392 * @returns {Object} Returns `object`. 9393 */ 9394 function baseForOwn(object, iteratee) { 9395 return object && baseFor(object, iteratee, keys); 9396 } 9397 9398 /** 9399 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 9400 * 9401 * @private 9402 * @param {Object} object The object to iterate over. 9403 * @param {Function} iteratee The function invoked per iteration. 9404 * @returns {Object} Returns `object`. 9405 */ 9406 function baseForOwnRight(object, iteratee) { 9407 return object && baseForRight(object, iteratee, keys); 9408 } 9409 9410 /** 9411 * The base implementation of `_.functions` which creates an array of 9412 * `object` function property names filtered from `props`. 9413 * 9414 * @private 9415 * @param {Object} object The object to inspect. 9416 * @param {Array} props The property names to filter. 9417 * @returns {Array} Returns the function names. 9418 */ 9419 function baseFunctions(object, props) { 9420 return arrayFilter(props, function(key) { 9421 return isFunction(object[key]); 9422 }); 9423 } 9424 9425 /** 9426 * The base implementation of `_.get` without support for default values. 9427 * 9428 * @private 9429 * @param {Object} object The object to query. 9430 * @param {Array|string} path The path of the property to get. 9431 * @returns {*} Returns the resolved value. 9432 */ 9433 function baseGet(object, path) { 9434 path = castPath(path, object); 9435 9436 var index = 0, 9437 length = path.length; 9438 9439 while (object != null && index < length) { 9440 object = object[toKey(path[index++])]; 9441 } 9442 return (index && index == length) ? object : undefined; 9443 } 9444 9445 /** 9446 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 9447 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 9448 * symbols of `object`. 9449 * 9450 * @private 9451 * @param {Object} object The object to query. 9452 * @param {Function} keysFunc The function to get the keys of `object`. 9453 * @param {Function} symbolsFunc The function to get the symbols of `object`. 9454 * @returns {Array} Returns the array of property names and symbols. 9455 */ 9456 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 9457 var result = keysFunc(object); 9458 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 9459 } 9460 9461 /** 9462 * The base implementation of `getTag` without fallbacks for buggy environments. 9463 * 9464 * @private 9465 * @param {*} value The value to query. 9466 * @returns {string} Returns the `toStringTag`. 9467 */ 9468 function baseGetTag(value) { 9469 if (value == null) { 9470 return value === undefined ? undefinedTag : nullTag; 9471 } 9472 return (symToStringTag && symToStringTag in Object(value)) 9473 ? getRawTag(value) 9474 : objectToString(value); 9475 } 9476 9477 /** 9478 * The base implementation of `_.gt` which doesn't coerce arguments. 9479 * 9480 * @private 9481 * @param {*} value The value to compare. 9482 * @param {*} other The other value to compare. 9483 * @returns {boolean} Returns `true` if `value` is greater than `other`, 9484 * else `false`. 9485 */ 9486 function baseGt(value, other) { 9487 return value > other; 9488 } 9489 9490 /** 9491 * The base implementation of `_.has` without support for deep paths. 9492 * 9493 * @private 9494 * @param {Object} [object] The object to query. 9495 * @param {Array|string} key The key to check. 9496 * @returns {boolean} Returns `true` if `key` exists, else `false`. 9497 */ 9498 function baseHas(object, key) { 9499 return object != null && hasOwnProperty.call(object, key); 9500 } 9501 9502 /** 9503 * The base implementation of `_.hasIn` without support for deep paths. 9504 * 9505 * @private 9506 * @param {Object} [object] The object to query. 9507 * @param {Array|string} key The key to check. 9508 * @returns {boolean} Returns `true` if `key` exists, else `false`. 9509 */ 9510 function baseHasIn(object, key) { 9511 return object != null && key in Object(object); 9512 } 9513 9514 /** 9515 * The base implementation of `_.inRange` which doesn't coerce arguments. 9516 * 9517 * @private 9518 * @param {number} number The number to check. 9519 * @param {number} start The start of the range. 9520 * @param {number} end The end of the range. 9521 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 9522 */ 9523 function baseInRange(number, start, end) { 9524 return number >= nativeMin(start, end) && number < nativeMax(start, end); 9525 } 9526 9527 /** 9528 * The base implementation of methods like `_.intersection`, without support 9529 * for iteratee shorthands, that accepts an array of arrays to inspect. 9530 * 9531 * @private 9532 * @param {Array} arrays The arrays to inspect. 9533 * @param {Function} [iteratee] The iteratee invoked per element. 9534 * @param {Function} [comparator] The comparator invoked per element. 9535 * @returns {Array} Returns the new array of shared values. 9536 */ 9537 function baseIntersection(arrays, iteratee, comparator) { 9538 var includes = comparator ? arrayIncludesWith : arrayIncludes, 9539 length = arrays[0].length, 9540 othLength = arrays.length, 9541 othIndex = othLength, 9542 caches = Array(othLength), 9543 maxLength = Infinity, 9544 result = []; 9545 9546 while (othIndex--) { 9547 var array = arrays[othIndex]; 9548 if (othIndex && iteratee) { 9549 array = arrayMap(array, baseUnary(iteratee)); 9550 } 9551 maxLength = nativeMin(array.length, maxLength); 9552 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) 9553 ? new SetCache(othIndex && array) 9554 : undefined; 9555 } 9556 array = arrays[0]; 9557 9558 var index = -1, 9559 seen = caches[0]; 9560 9561 outer: 9562 while (++index < length && result.length < maxLength) { 9563 var value = array[index], 9564 computed = iteratee ? iteratee(value) : value; 9565 9566 value = (comparator || value !== 0) ? value : 0; 9567 if (!(seen 9568 ? cacheHas(seen, computed) 9569 : includes(result, computed, comparator) 9570 )) { 9571 othIndex = othLength; 9572 while (--othIndex) { 9573 var cache = caches[othIndex]; 9574 if (!(cache 9575 ? cacheHas(cache, computed) 9576 : includes(arrays[othIndex], computed, comparator)) 9577 ) { 9578 continue outer; 9579 } 9580 } 9581 if (seen) { 9582 seen.push(computed); 9583 } 9584 result.push(value); 9585 } 9586 } 9587 return result; 9588 } 9589 9590 /** 9591 * The base implementation of `_.invert` and `_.invertBy` which inverts 9592 * `object` with values transformed by `iteratee` and set by `setter`. 9593 * 9594 * @private 9595 * @param {Object} object The object to iterate over. 9596 * @param {Function} setter The function to set `accumulator` values. 9597 * @param {Function} iteratee The iteratee to transform values. 9598 * @param {Object} accumulator The initial inverted object. 9599 * @returns {Function} Returns `accumulator`. 9600 */ 9601 function baseInverter(object, setter, iteratee, accumulator) { 9602 baseForOwn(object, function(value, key, object) { 9603 setter(accumulator, iteratee(value), key, object); 9604 }); 9605 return accumulator; 9606 } 9607 9608 /** 9609 * The base implementation of `_.invoke` without support for individual 9610 * method arguments. 9611 * 9612 * @private 9613 * @param {Object} object The object to query. 9614 * @param {Array|string} path The path of the method to invoke. 9615 * @param {Array} args The arguments to invoke the method with. 9616 * @returns {*} Returns the result of the invoked method. 9617 */ 9618 function baseInvoke(object, path, args) { 9619 path = castPath(path, object); 9620 object = parent(object, path); 9621 var func = object == null ? object : object[toKey(last(path))]; 9622 return func == null ? undefined : apply(func, object, args); 9623 } 9624 9625 /** 9626 * The base implementation of `_.isArguments`. 9627 * 9628 * @private 9629 * @param {*} value The value to check. 9630 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 9631 */ 9632 function baseIsArguments(value) { 9633 return isObjectLike(value) && baseGetTag(value) == argsTag; 9634 } 9635 9636 /** 9637 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 9638 * 9639 * @private 9640 * @param {*} value The value to check. 9641 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 9642 */ 9643 function baseIsArrayBuffer(value) { 9644 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 9645 } 9646 9647 /** 9648 * The base implementation of `_.isDate` without Node.js optimizations. 9649 * 9650 * @private 9651 * @param {*} value The value to check. 9652 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 9653 */ 9654 function baseIsDate(value) { 9655 return isObjectLike(value) && baseGetTag(value) == dateTag; 9656 } 9657 9658 /** 9659 * The base implementation of `_.isEqual` which supports partial comparisons 9660 * and tracks traversed objects. 9661 * 9662 * @private 9663 * @param {*} value The value to compare. 9664 * @param {*} other The other value to compare. 9665 * @param {boolean} bitmask The bitmask flags. 9666 * 1 - Unordered comparison 9667 * 2 - Partial comparison 9668 * @param {Function} [customizer] The function to customize comparisons. 9669 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 9670 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 9671 */ 9672 function baseIsEqual(value, other, bitmask, customizer, stack) { 9673 if (value === other) { 9674 return true; 9675 } 9676 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 9677 return value !== value && other !== other; 9678 } 9679 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 9680 } 9681 9682 /** 9683 * A specialized version of `baseIsEqual` for arrays and objects which performs 9684 * deep comparisons and tracks traversed objects enabling objects with circular 9685 * references to be compared. 9686 * 9687 * @private 9688 * @param {Object} object The object to compare. 9689 * @param {Object} other The other object to compare. 9690 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 9691 * @param {Function} customizer The function to customize comparisons. 9692 * @param {Function} equalFunc The function to determine equivalents of values. 9693 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 9694 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 9695 */ 9696 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 9697 var objIsArr = isArray(object), 9698 othIsArr = isArray(other), 9699 objTag = objIsArr ? arrayTag : getTag(object), 9700 othTag = othIsArr ? arrayTag : getTag(other); 9701 9702 objTag = objTag == argsTag ? objectTag : objTag; 9703 othTag = othTag == argsTag ? objectTag : othTag; 9704 9705 var objIsObj = objTag == objectTag, 9706 othIsObj = othTag == objectTag, 9707 isSameTag = objTag == othTag; 9708 9709 if (isSameTag && isBuffer(object)) { 9710 if (!isBuffer(other)) { 9711 return false; 9712 } 9713 objIsArr = true; 9714 objIsObj = false; 9715 } 9716 if (isSameTag && !objIsObj) { 9717 stack || (stack = new Stack); 9718 return (objIsArr || isTypedArray(object)) 9719 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 9720 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 9721 } 9722 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 9723 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 9724 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 9725 9726 if (objIsWrapped || othIsWrapped) { 9727 var objUnwrapped = objIsWrapped ? object.value() : object, 9728 othUnwrapped = othIsWrapped ? other.value() : other; 9729 9730 stack || (stack = new Stack); 9731 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 9732 } 9733 } 9734 if (!isSameTag) { 9735 return false; 9736 } 9737 stack || (stack = new Stack); 9738 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 9739 } 9740 9741 /** 9742 * The base implementation of `_.isMap` without Node.js optimizations. 9743 * 9744 * @private 9745 * @param {*} value The value to check. 9746 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 9747 */ 9748 function baseIsMap(value) { 9749 return isObjectLike(value) && getTag(value) == mapTag; 9750 } 9751 9752 /** 9753 * The base implementation of `_.isMatch` without support for iteratee shorthands. 9754 * 9755 * @private 9756 * @param {Object} object The object to inspect. 9757 * @param {Object} source The object of property values to match. 9758 * @param {Array} matchData The property names, values, and compare flags to match. 9759 * @param {Function} [customizer] The function to customize comparisons. 9760 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 9761 */ 9762 function baseIsMatch(object, source, matchData, customizer) { 9763 var index = matchData.length, 9764 length = index, 9765 noCustomizer = !customizer; 9766 9767 if (object == null) { 9768 return !length; 9769 } 9770 object = Object(object); 9771 while (index--) { 9772 var data = matchData[index]; 9773 if ((noCustomizer && data[2]) 9774 ? data[1] !== object[data[0]] 9775 : !(data[0] in object) 9776 ) { 9777 return false; 9778 } 9779 } 9780 while (++index < length) { 9781 data = matchData[index]; 9782 var key = data[0], 9783 objValue = object[key], 9784 srcValue = data[1]; 9785 9786 if (noCustomizer && data[2]) { 9787 if (objValue === undefined && !(key in object)) { 9788 return false; 9789 } 9790 } else { 9791 var stack = new Stack; 9792 if (customizer) { 9793 var result = customizer(objValue, srcValue, key, object, source, stack); 9794 } 9795 if (!(result === undefined 9796 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) 9797 : result 9798 )) { 9799 return false; 9800 } 9801 } 9802 } 9803 return true; 9804 } 9805 9806 /** 9807 * The base implementation of `_.isNative` without bad shim checks. 9808 * 9809 * @private 9810 * @param {*} value The value to check. 9811 * @returns {boolean} Returns `true` if `value` is a native function, 9812 * else `false`. 9813 */ 9814 function baseIsNative(value) { 9815 if (!isObject(value) || isMasked(value)) { 9816 return false; 9817 } 9818 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 9819 return pattern.test(toSource(value)); 9820 } 9821 9822 /** 9823 * The base implementation of `_.isRegExp` without Node.js optimizations. 9824 * 9825 * @private 9826 * @param {*} value The value to check. 9827 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 9828 */ 9829 function baseIsRegExp(value) { 9830 return isObjectLike(value) && baseGetTag(value) == regexpTag; 9831 } 9832 9833 /** 9834 * The base implementation of `_.isSet` without Node.js optimizations. 9835 * 9836 * @private 9837 * @param {*} value The value to check. 9838 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 9839 */ 9840 function baseIsSet(value) { 9841 return isObjectLike(value) && getTag(value) == setTag; 9842 } 9843 9844 /** 9845 * The base implementation of `_.isTypedArray` without Node.js optimizations. 9846 * 9847 * @private 9848 * @param {*} value The value to check. 9849 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 9850 */ 9851 function baseIsTypedArray(value) { 9852 return isObjectLike(value) && 9853 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 9854 } 9855 9856 /** 9857 * The base implementation of `_.iteratee`. 9858 * 9859 * @private 9860 * @param {*} [value=_.identity] The value to convert to an iteratee. 9861 * @returns {Function} Returns the iteratee. 9862 */ 9863 function baseIteratee(value) { 9864 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 9865 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 9866 if (typeof value == 'function') { 9867 return value; 9868 } 9869 if (value == null) { 9870 return identity; 9871 } 9872 if (typeof value == 'object') { 9873 return isArray(value) 9874 ? baseMatchesProperty(value[0], value[1]) 9875 : baseMatches(value); 9876 } 9877 return property(value); 9878 } 9879 9880 /** 9881 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 9882 * 9883 * @private 9884 * @param {Object} object The object to query. 9885 * @returns {Array} Returns the array of property names. 9886 */ 9887 function baseKeys(object) { 9888 if (!isPrototype(object)) { 9889 return nativeKeys(object); 9890 } 9891 var result = []; 9892 for (var key in Object(object)) { 9893 if (hasOwnProperty.call(object, key) && key != 'constructor') { 9894 result.push(key); 9895 } 9896 } 9897 return result; 9898 } 9899 9900 /** 9901 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 9902 * 9903 * @private 9904 * @param {Object} object The object to query. 9905 * @returns {Array} Returns the array of property names. 9906 */ 9907 function baseKeysIn(object) { 9908 if (!isObject(object)) { 9909 return nativeKeysIn(object); 9910 } 9911 var isProto = isPrototype(object), 9912 result = []; 9913 9914 for (var key in object) { 9915 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 9916 result.push(key); 9917 } 9918 } 9919 return result; 9920 } 9921 9922 /** 9923 * The base implementation of `_.lt` which doesn't coerce arguments. 9924 * 9925 * @private 9926 * @param {*} value The value to compare. 9927 * @param {*} other The other value to compare. 9928 * @returns {boolean} Returns `true` if `value` is less than `other`, 9929 * else `false`. 9930 */ 9931 function baseLt(value, other) { 9932 return value < other; 9933 } 9934 9935 /** 9936 * The base implementation of `_.map` without support for iteratee shorthands. 9937 * 9938 * @private 9939 * @param {Array|Object} collection The collection to iterate over. 9940 * @param {Function} iteratee The function invoked per iteration. 9941 * @returns {Array} Returns the new mapped array. 9942 */ 9943 function baseMap(collection, iteratee) { 9944 var index = -1, 9945 result = isArrayLike(collection) ? Array(collection.length) : []; 9946 9947 baseEach(collection, function(value, key, collection) { 9948 result[++index] = iteratee(value, key, collection); 9949 }); 9950 return result; 9951 } 9952 9953 /** 9954 * The base implementation of `_.matches` which doesn't clone `source`. 9955 * 9956 * @private 9957 * @param {Object} source The object of property values to match. 9958 * @returns {Function} Returns the new spec function. 9959 */ 9960 function baseMatches(source) { 9961 var matchData = getMatchData(source); 9962 if (matchData.length == 1 && matchData[0][2]) { 9963 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 9964 } 9965 return function(object) { 9966 return object === source || baseIsMatch(object, source, matchData); 9967 }; 9968 } 9969 9970 /** 9971 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 9972 * 9973 * @private 9974 * @param {string} path The path of the property to get. 9975 * @param {*} srcValue The value to match. 9976 * @returns {Function} Returns the new spec function. 9977 */ 9978 function baseMatchesProperty(path, srcValue) { 9979 if (isKey(path) && isStrictComparable(srcValue)) { 9980 return matchesStrictComparable(toKey(path), srcValue); 9981 } 9982 return function(object) { 9983 var objValue = get(object, path); 9984 return (objValue === undefined && objValue === srcValue) 9985 ? hasIn(object, path) 9986 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 9987 }; 9988 } 9989 9990 /** 9991 * The base implementation of `_.merge` without support for multiple sources. 9992 * 9993 * @private 9994 * @param {Object} object The destination object. 9995 * @param {Object} source The source object. 9996 * @param {number} srcIndex The index of `source`. 9997 * @param {Function} [customizer] The function to customize merged values. 9998 * @param {Object} [stack] Tracks traversed source values and their merged 9999 * counterparts. 10000 */ 10001 function baseMerge(object, source, srcIndex, customizer, stack) { 10002 if (object === source) { 10003 return; 10004 } 10005 baseFor(source, function(srcValue, key) { 10006 stack || (stack = new Stack); 10007 if (isObject(srcValue)) { 10008 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 10009 } 10010 else { 10011 var newValue = customizer 10012 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) 10013 : undefined; 10014 10015 if (newValue === undefined) { 10016 newValue = srcValue; 10017 } 10018 assignMergeValue(object, key, newValue); 10019 } 10020 }, keysIn); 10021 } 10022 10023 /** 10024 * A specialized version of `baseMerge` for arrays and objects which performs 10025 * deep merges and tracks traversed objects enabling objects with circular 10026 * references to be merged. 10027 * 10028 * @private 10029 * @param {Object} object The destination object. 10030 * @param {Object} source The source object. 10031 * @param {string} key The key of the value to merge. 10032 * @param {number} srcIndex The index of `source`. 10033 * @param {Function} mergeFunc The function to merge values. 10034 * @param {Function} [customizer] The function to customize assigned values. 10035 * @param {Object} [stack] Tracks traversed source values and their merged 10036 * counterparts. 10037 */ 10038 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 10039 var objValue = safeGet(object, key), 10040 srcValue = safeGet(source, key), 10041 stacked = stack.get(srcValue); 10042 10043 if (stacked) { 10044 assignMergeValue(object, key, stacked); 10045 return; 10046 } 10047 var newValue = customizer 10048 ? customizer(objValue, srcValue, (key + ''), object, source, stack) 10049 : undefined; 10050 10051 var isCommon = newValue === undefined; 10052 10053 if (isCommon) { 10054 var isArr = isArray(srcValue), 10055 isBuff = !isArr && isBuffer(srcValue), 10056 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 10057 10058 newValue = srcValue; 10059 if (isArr || isBuff || isTyped) { 10060 if (isArray(objValue)) { 10061 newValue = objValue; 10062 } 10063 else if (isArrayLikeObject(objValue)) { 10064 newValue = copyArray(objValue); 10065 } 10066 else if (isBuff) { 10067 isCommon = false; 10068 newValue = cloneBuffer(srcValue, true); 10069 } 10070 else if (isTyped) { 10071 isCommon = false; 10072 newValue = cloneTypedArray(srcValue, true); 10073 } 10074 else { 10075 newValue = []; 10076 } 10077 } 10078 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 10079 newValue = objValue; 10080 if (isArguments(objValue)) { 10081 newValue = toPlainObject(objValue); 10082 } 10083 else if (!isObject(objValue) || isFunction(objValue)) { 10084 newValue = initCloneObject(srcValue); 10085 } 10086 } 10087 else { 10088 isCommon = false; 10089 } 10090 } 10091 if (isCommon) { 10092 // Recursively merge objects and arrays (susceptible to call stack limits). 10093 stack.set(srcValue, newValue); 10094 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 10095 stack['delete'](srcValue); 10096 } 10097 assignMergeValue(object, key, newValue); 10098 } 10099 10100 /** 10101 * The base implementation of `_.nth` which doesn't coerce arguments. 10102 * 10103 * @private 10104 * @param {Array} array The array to query. 10105 * @param {number} n The index of the element to return. 10106 * @returns {*} Returns the nth element of `array`. 10107 */ 10108 function baseNth(array, n) { 10109 var length = array.length; 10110 if (!length) { 10111 return; 10112 } 10113 n += n < 0 ? length : 0; 10114 return isIndex(n, length) ? array[n] : undefined; 10115 } 10116 10117 /** 10118 * The base implementation of `_.orderBy` without param guards. 10119 * 10120 * @private 10121 * @param {Array|Object} collection The collection to iterate over. 10122 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 10123 * @param {string[]} orders The sort orders of `iteratees`. 10124 * @returns {Array} Returns the new sorted array. 10125 */ 10126 function baseOrderBy(collection, iteratees, orders) { 10127 if (iteratees.length) { 10128 iteratees = arrayMap(iteratees, function(iteratee) { 10129 if (isArray(iteratee)) { 10130 return function(value) { 10131 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); 10132 } 10133 } 10134 return iteratee; 10135 }); 10136 } else { 10137 iteratees = [identity]; 10138 } 10139 10140 var index = -1; 10141 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 10142 10143 var result = baseMap(collection, function(value, key, collection) { 10144 var criteria = arrayMap(iteratees, function(iteratee) { 10145 return iteratee(value); 10146 }); 10147 return { 'criteria': criteria, 'index': ++index, 'value': value }; 10148 }); 10149 10150 return baseSortBy(result, function(object, other) { 10151 return compareMultiple(object, other, orders); 10152 }); 10153 } 10154 10155 /** 10156 * The base implementation of `_.pick` without support for individual 10157 * property identifiers. 10158 * 10159 * @private 10160 * @param {Object} object The source object. 10161 * @param {string[]} paths The property paths to pick. 10162 * @returns {Object} Returns the new object. 10163 */ 10164 function basePick(object, paths) { 10165 return basePickBy(object, paths, function(value, path) { 10166 return hasIn(object, path); 10167 }); 10168 } 10169 10170 /** 10171 * The base implementation of `_.pickBy` without support for iteratee shorthands. 10172 * 10173 * @private 10174 * @param {Object} object The source object. 10175 * @param {string[]} paths The property paths to pick. 10176 * @param {Function} predicate The function invoked per property. 10177 * @returns {Object} Returns the new object. 10178 */ 10179 function basePickBy(object, paths, predicate) { 10180 var index = -1, 10181 length = paths.length, 10182 result = {}; 10183 10184 while (++index < length) { 10185 var path = paths[index], 10186 value = baseGet(object, path); 10187 10188 if (predicate(value, path)) { 10189 baseSet(result, castPath(path, object), value); 10190 } 10191 } 10192 return result; 10193 } 10194 10195 /** 10196 * A specialized version of `baseProperty` which supports deep paths. 10197 * 10198 * @private 10199 * @param {Array|string} path The path of the property to get. 10200 * @returns {Function} Returns the new accessor function. 10201 */ 10202 function basePropertyDeep(path) { 10203 return function(object) { 10204 return baseGet(object, path); 10205 }; 10206 } 10207 10208 /** 10209 * The base implementation of `_.pullAllBy` without support for iteratee 10210 * shorthands. 10211 * 10212 * @private 10213 * @param {Array} array The array to modify. 10214 * @param {Array} values The values to remove. 10215 * @param {Function} [iteratee] The iteratee invoked per element. 10216 * @param {Function} [comparator] The comparator invoked per element. 10217 * @returns {Array} Returns `array`. 10218 */ 10219 function basePullAll(array, values, iteratee, comparator) { 10220 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 10221 index = -1, 10222 length = values.length, 10223 seen = array; 10224 10225 if (array === values) { 10226 values = copyArray(values); 10227 } 10228 if (iteratee) { 10229 seen = arrayMap(array, baseUnary(iteratee)); 10230 } 10231 while (++index < length) { 10232 var fromIndex = 0, 10233 value = values[index], 10234 computed = iteratee ? iteratee(value) : value; 10235 10236 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 10237 if (seen !== array) { 10238 splice.call(seen, fromIndex, 1); 10239 } 10240 splice.call(array, fromIndex, 1); 10241 } 10242 } 10243 return array; 10244 } 10245 10246 /** 10247 * The base implementation of `_.pullAt` without support for individual 10248 * indexes or capturing the removed elements. 10249 * 10250 * @private 10251 * @param {Array} array The array to modify. 10252 * @param {number[]} indexes The indexes of elements to remove. 10253 * @returns {Array} Returns `array`. 10254 */ 10255 function basePullAt(array, indexes) { 10256 var length = array ? indexes.length : 0, 10257 lastIndex = length - 1; 10258 10259 while (length--) { 10260 var index = indexes[length]; 10261 if (length == lastIndex || index !== previous) { 10262 var previous = index; 10263 if (isIndex(index)) { 10264 splice.call(array, index, 1); 10265 } else { 10266 baseUnset(array, index); 10267 } 10268 } 10269 } 10270 return array; 10271 } 10272 10273 /** 10274 * The base implementation of `_.random` without support for returning 10275 * floating-point numbers. 10276 * 10277 * @private 10278 * @param {number} lower The lower bound. 10279 * @param {number} upper The upper bound. 10280 * @returns {number} Returns the random number. 10281 */ 10282 function baseRandom(lower, upper) { 10283 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 10284 } 10285 10286 /** 10287 * The base implementation of `_.range` and `_.rangeRight` which doesn't 10288 * coerce arguments. 10289 * 10290 * @private 10291 * @param {number} start The start of the range. 10292 * @param {number} end The end of the range. 10293 * @param {number} step The value to increment or decrement by. 10294 * @param {boolean} [fromRight] Specify iterating from right to left. 10295 * @returns {Array} Returns the range of numbers. 10296 */ 10297 function baseRange(start, end, step, fromRight) { 10298 var index = -1, 10299 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), 10300 result = Array(length); 10301 10302 while (length--) { 10303 result[fromRight ? length : ++index] = start; 10304 start += step; 10305 } 10306 return result; 10307 } 10308 10309 /** 10310 * The base implementation of `_.repeat` which doesn't coerce arguments. 10311 * 10312 * @private 10313 * @param {string} string The string to repeat. 10314 * @param {number} n The number of times to repeat the string. 10315 * @returns {string} Returns the repeated string. 10316 */ 10317 function baseRepeat(string, n) { 10318 var result = ''; 10319 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 10320 return result; 10321 } 10322 // Leverage the exponentiation by squaring algorithm for a faster repeat. 10323 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 10324 do { 10325 if (n % 2) { 10326 result += string; 10327 } 10328 n = nativeFloor(n / 2); 10329 if (n) { 10330 string += string; 10331 } 10332 } while (n); 10333 10334 return result; 10335 } 10336 10337 /** 10338 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 10339 * 10340 * @private 10341 * @param {Function} func The function to apply a rest parameter to. 10342 * @param {number} [start=func.length-1] The start position of the rest parameter. 10343 * @returns {Function} Returns the new function. 10344 */ 10345 function baseRest(func, start) { 10346 return setToString(overRest(func, start, identity), func + ''); 10347 } 10348 10349 /** 10350 * The base implementation of `_.sample`. 10351 * 10352 * @private 10353 * @param {Array|Object} collection The collection to sample. 10354 * @returns {*} Returns the random element. 10355 */ 10356 function baseSample(collection) { 10357 return arraySample(values(collection)); 10358 } 10359 10360 /** 10361 * The base implementation of `_.sampleSize` without param guards. 10362 * 10363 * @private 10364 * @param {Array|Object} collection The collection to sample. 10365 * @param {number} n The number of elements to sample. 10366 * @returns {Array} Returns the random elements. 10367 */ 10368 function baseSampleSize(collection, n) { 10369 var array = values(collection); 10370 return shuffleSelf(array, baseClamp(n, 0, array.length)); 10371 } 10372 10373 /** 10374 * The base implementation of `_.set`. 10375 * 10376 * @private 10377 * @param {Object} object The object to modify. 10378 * @param {Array|string} path The path of the property to set. 10379 * @param {*} value The value to set. 10380 * @param {Function} [customizer] The function to customize path creation. 10381 * @returns {Object} Returns `object`. 10382 */ 10383 function baseSet(object, path, value, customizer) { 10384 if (!isObject(object)) { 10385 return object; 10386 } 10387 path = castPath(path, object); 10388 10389 var index = -1, 10390 length = path.length, 10391 lastIndex = length - 1, 10392 nested = object; 10393 10394 while (nested != null && ++index < length) { 10395 var key = toKey(path[index]), 10396 newValue = value; 10397 10398 if (key === '__proto__' || key === 'constructor' || key === 'prototype') { 10399 return object; 10400 } 10401 10402 if (index != lastIndex) { 10403 var objValue = nested[key]; 10404 newValue = customizer ? customizer(objValue, key, nested) : undefined; 10405 if (newValue === undefined) { 10406 newValue = isObject(objValue) 10407 ? objValue 10408 : (isIndex(path[index + 1]) ? [] : {}); 10409 } 10410 } 10411 assignValue(nested, key, newValue); 10412 nested = nested[key]; 10413 } 10414 return object; 10415 } 10416 10417 /** 10418 * The base implementation of `setData` without support for hot loop shorting. 10419 * 10420 * @private 10421 * @param {Function} func The function to associate metadata with. 10422 * @param {*} data The metadata. 10423 * @returns {Function} Returns `func`. 10424 */ 10425 var baseSetData = !metaMap ? identity : function(func, data) { 10426 metaMap.set(func, data); 10427 return func; 10428 }; 10429 10430 /** 10431 * The base implementation of `setToString` without support for hot loop shorting. 10432 * 10433 * @private 10434 * @param {Function} func The function to modify. 10435 * @param {Function} string The `toString` result. 10436 * @returns {Function} Returns `func`. 10437 */ 10438 var baseSetToString = !defineProperty ? identity : function(func, string) { 10439 return defineProperty(func, 'toString', { 10440 'configurable': true, 10441 'enumerable': false, 10442 'value': constant(string), 10443 'writable': true 10444 }); 10445 }; 10446 10447 /** 10448 * The base implementation of `_.shuffle`. 10449 * 10450 * @private 10451 * @param {Array|Object} collection The collection to shuffle. 10452 * @returns {Array} Returns the new shuffled array. 10453 */ 10454 function baseShuffle(collection) { 10455 return shuffleSelf(values(collection)); 10456 } 10457 10458 /** 10459 * The base implementation of `_.slice` without an iteratee call guard. 10460 * 10461 * @private 10462 * @param {Array} array The array to slice. 10463 * @param {number} [start=0] The start position. 10464 * @param {number} [end=array.length] The end position. 10465 * @returns {Array} Returns the slice of `array`. 10466 */ 10467 function baseSlice(array, start, end) { 10468 var index = -1, 10469 length = array.length; 10470 10471 if (start < 0) { 10472 start = -start > length ? 0 : (length + start); 10473 } 10474 end = end > length ? length : end; 10475 if (end < 0) { 10476 end += length; 10477 } 10478 length = start > end ? 0 : ((end - start) >>> 0); 10479 start >>>= 0; 10480 10481 var result = Array(length); 10482 while (++index < length) { 10483 result[index] = array[index + start]; 10484 } 10485 return result; 10486 } 10487 10488 /** 10489 * The base implementation of `_.some` without support for iteratee shorthands. 10490 * 10491 * @private 10492 * @param {Array|Object} collection The collection to iterate over. 10493 * @param {Function} predicate The function invoked per iteration. 10494 * @returns {boolean} Returns `true` if any element passes the predicate check, 10495 * else `false`. 10496 */ 10497 function baseSome(collection, predicate) { 10498 var result; 10499 10500 baseEach(collection, function(value, index, collection) { 10501 result = predicate(value, index, collection); 10502 return !result; 10503 }); 10504 return !!result; 10505 } 10506 10507 /** 10508 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 10509 * performs a binary search of `array` to determine the index at which `value` 10510 * should be inserted into `array` in order to maintain its sort order. 10511 * 10512 * @private 10513 * @param {Array} array The sorted array to inspect. 10514 * @param {*} value The value to evaluate. 10515 * @param {boolean} [retHighest] Specify returning the highest qualified index. 10516 * @returns {number} Returns the index at which `value` should be inserted 10517 * into `array`. 10518 */ 10519 function baseSortedIndex(array, value, retHighest) { 10520 var low = 0, 10521 high = array == null ? low : array.length; 10522 10523 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 10524 while (low < high) { 10525 var mid = (low + high) >>> 1, 10526 computed = array[mid]; 10527 10528 if (computed !== null && !isSymbol(computed) && 10529 (retHighest ? (computed <= value) : (computed < value))) { 10530 low = mid + 1; 10531 } else { 10532 high = mid; 10533 } 10534 } 10535 return high; 10536 } 10537 return baseSortedIndexBy(array, value, identity, retHighest); 10538 } 10539 10540 /** 10541 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 10542 * which invokes `iteratee` for `value` and each element of `array` to compute 10543 * their sort ranking. The iteratee is invoked with one argument; (value). 10544 * 10545 * @private 10546 * @param {Array} array The sorted array to inspect. 10547 * @param {*} value The value to evaluate. 10548 * @param {Function} iteratee The iteratee invoked per element. 10549 * @param {boolean} [retHighest] Specify returning the highest qualified index. 10550 * @returns {number} Returns the index at which `value` should be inserted 10551 * into `array`. 10552 */ 10553 function baseSortedIndexBy(array, value, iteratee, retHighest) { 10554 var low = 0, 10555 high = array == null ? 0 : array.length; 10556 if (high === 0) { 10557 return 0; 10558 } 10559 10560 value = iteratee(value); 10561 var valIsNaN = value !== value, 10562 valIsNull = value === null, 10563 valIsSymbol = isSymbol(value), 10564 valIsUndefined = value === undefined; 10565 10566 while (low < high) { 10567 var mid = nativeFloor((low + high) / 2), 10568 computed = iteratee(array[mid]), 10569 othIsDefined = computed !== undefined, 10570 othIsNull = computed === null, 10571 othIsReflexive = computed === computed, 10572 othIsSymbol = isSymbol(computed); 10573 10574 if (valIsNaN) { 10575 var setLow = retHighest || othIsReflexive; 10576 } else if (valIsUndefined) { 10577 setLow = othIsReflexive && (retHighest || othIsDefined); 10578 } else if (valIsNull) { 10579 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 10580 } else if (valIsSymbol) { 10581 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 10582 } else if (othIsNull || othIsSymbol) { 10583 setLow = false; 10584 } else { 10585 setLow = retHighest ? (computed <= value) : (computed < value); 10586 } 10587 if (setLow) { 10588 low = mid + 1; 10589 } else { 10590 high = mid; 10591 } 10592 } 10593 return nativeMin(high, MAX_ARRAY_INDEX); 10594 } 10595 10596 /** 10597 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 10598 * support for iteratee shorthands. 10599 * 10600 * @private 10601 * @param {Array} array The array to inspect. 10602 * @param {Function} [iteratee] The iteratee invoked per element. 10603 * @returns {Array} Returns the new duplicate free array. 10604 */ 10605 function baseSortedUniq(array, iteratee) { 10606 var index = -1, 10607 length = array.length, 10608 resIndex = 0, 10609 result = []; 10610 10611 while (++index < length) { 10612 var value = array[index], 10613 computed = iteratee ? iteratee(value) : value; 10614 10615 if (!index || !eq(computed, seen)) { 10616 var seen = computed; 10617 result[resIndex++] = value === 0 ? 0 : value; 10618 } 10619 } 10620 return result; 10621 } 10622 10623 /** 10624 * The base implementation of `_.toNumber` which doesn't ensure correct 10625 * conversions of binary, hexadecimal, or octal string values. 10626 * 10627 * @private 10628 * @param {*} value The value to process. 10629 * @returns {number} Returns the number. 10630 */ 10631 function baseToNumber(value) { 10632 if (typeof value == 'number') { 10633 return value; 10634 } 10635 if (isSymbol(value)) { 10636 return NAN; 10637 } 10638 return +value; 10639 } 10640 10641 /** 10642 * The base implementation of `_.toString` which doesn't convert nullish 10643 * values to empty strings. 10644 * 10645 * @private 10646 * @param {*} value The value to process. 10647 * @returns {string} Returns the string. 10648 */ 10649 function baseToString(value) { 10650 // Exit early for strings to avoid a performance hit in some environments. 10651 if (typeof value == 'string') { 10652 return value; 10653 } 10654 if (isArray(value)) { 10655 // Recursively convert values (susceptible to call stack limits). 10656 return arrayMap(value, baseToString) + ''; 10657 } 10658 if (isSymbol(value)) { 10659 return symbolToString ? symbolToString.call(value) : ''; 10660 } 10661 var result = (value + ''); 10662 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 10663 } 10664 10665 /** 10666 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 10667 * 10668 * @private 10669 * @param {Array} array The array to inspect. 10670 * @param {Function} [iteratee] The iteratee invoked per element. 10671 * @param {Function} [comparator] The comparator invoked per element. 10672 * @returns {Array} Returns the new duplicate free array. 10673 */ 10674 function baseUniq(array, iteratee, comparator) { 10675 var index = -1, 10676 includes = arrayIncludes, 10677 length = array.length, 10678 isCommon = true, 10679 result = [], 10680 seen = result; 10681 10682 if (comparator) { 10683 isCommon = false; 10684 includes = arrayIncludesWith; 10685 } 10686 else if (length >= LARGE_ARRAY_SIZE) { 10687 var set = iteratee ? null : createSet(array); 10688 if (set) { 10689 return setToArray(set); 10690 } 10691 isCommon = false; 10692 includes = cacheHas; 10693 seen = new SetCache; 10694 } 10695 else { 10696 seen = iteratee ? [] : result; 10697 } 10698 outer: 10699 while (++index < length) { 10700 var value = array[index], 10701 computed = iteratee ? iteratee(value) : value; 10702 10703 value = (comparator || value !== 0) ? value : 0; 10704 if (isCommon && computed === computed) { 10705 var seenIndex = seen.length; 10706 while (seenIndex--) { 10707 if (seen[seenIndex] === computed) { 10708 continue outer; 10709 } 10710 } 10711 if (iteratee) { 10712 seen.push(computed); 10713 } 10714 result.push(value); 10715 } 10716 else if (!includes(seen, computed, comparator)) { 10717 if (seen !== result) { 10718 seen.push(computed); 10719 } 10720 result.push(value); 10721 } 10722 } 10723 return result; 10724 } 10725 10726 /** 10727 * The base implementation of `_.unset`. 10728 * 10729 * @private 10730 * @param {Object} object The object to modify. 10731 * @param {Array|string} path The property path to unset. 10732 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 10733 */ 10734 function baseUnset(object, path) { 10735 path = castPath(path, object); 10736 object = parent(object, path); 10737 return object == null || delete object[toKey(last(path))]; 10738 } 10739 10740 /** 10741 * The base implementation of `_.update`. 10742 * 10743 * @private 10744 * @param {Object} object The object to modify. 10745 * @param {Array|string} path The path of the property to update. 10746 * @param {Function} updater The function to produce the updated value. 10747 * @param {Function} [customizer] The function to customize path creation. 10748 * @returns {Object} Returns `object`. 10749 */ 10750 function baseUpdate(object, path, updater, customizer) { 10751 return baseSet(object, path, updater(baseGet(object, path)), customizer); 10752 } 10753 10754 /** 10755 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 10756 * without support for iteratee shorthands. 10757 * 10758 * @private 10759 * @param {Array} array The array to query. 10760 * @param {Function} predicate The function invoked per iteration. 10761 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 10762 * @param {boolean} [fromRight] Specify iterating from right to left. 10763 * @returns {Array} Returns the slice of `array`. 10764 */ 10765 function baseWhile(array, predicate, isDrop, fromRight) { 10766 var length = array.length, 10767 index = fromRight ? length : -1; 10768 10769 while ((fromRight ? index-- : ++index < length) && 10770 predicate(array[index], index, array)) {} 10771 10772 return isDrop 10773 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) 10774 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); 10775 } 10776 10777 /** 10778 * The base implementation of `wrapperValue` which returns the result of 10779 * performing a sequence of actions on the unwrapped `value`, where each 10780 * successive action is supplied the return value of the previous. 10781 * 10782 * @private 10783 * @param {*} value The unwrapped value. 10784 * @param {Array} actions Actions to perform to resolve the unwrapped value. 10785 * @returns {*} Returns the resolved value. 10786 */ 10787 function baseWrapperValue(value, actions) { 10788 var result = value; 10789 if (result instanceof LazyWrapper) { 10790 result = result.value(); 10791 } 10792 return arrayReduce(actions, function(result, action) { 10793 return action.func.apply(action.thisArg, arrayPush([result], action.args)); 10794 }, result); 10795 } 10796 10797 /** 10798 * The base implementation of methods like `_.xor`, without support for 10799 * iteratee shorthands, that accepts an array of arrays to inspect. 10800 * 10801 * @private 10802 * @param {Array} arrays The arrays to inspect. 10803 * @param {Function} [iteratee] The iteratee invoked per element. 10804 * @param {Function} [comparator] The comparator invoked per element. 10805 * @returns {Array} Returns the new array of values. 10806 */ 10807 function baseXor(arrays, iteratee, comparator) { 10808 var length = arrays.length; 10809 if (length < 2) { 10810 return length ? baseUniq(arrays[0]) : []; 10811 } 10812 var index = -1, 10813 result = Array(length); 10814 10815 while (++index < length) { 10816 var array = arrays[index], 10817 othIndex = -1; 10818 10819 while (++othIndex < length) { 10820 if (othIndex != index) { 10821 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); 10822 } 10823 } 10824 } 10825 return baseUniq(baseFlatten(result, 1), iteratee, comparator); 10826 } 10827 10828 /** 10829 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 10830 * 10831 * @private 10832 * @param {Array} props The property identifiers. 10833 * @param {Array} values The property values. 10834 * @param {Function} assignFunc The function to assign values. 10835 * @returns {Object} Returns the new object. 10836 */ 10837 function baseZipObject(props, values, assignFunc) { 10838 var index = -1, 10839 length = props.length, 10840 valsLength = values.length, 10841 result = {}; 10842 10843 while (++index < length) { 10844 var value = index < valsLength ? values[index] : undefined; 10845 assignFunc(result, props[index], value); 10846 } 10847 return result; 10848 } 10849 10850 /** 10851 * Casts `value` to an empty array if it's not an array like object. 10852 * 10853 * @private 10854 * @param {*} value The value to inspect. 10855 * @returns {Array|Object} Returns the cast array-like object. 10856 */ 10857 function castArrayLikeObject(value) { 10858 return isArrayLikeObject(value) ? value : []; 10859 } 10860 10861 /** 10862 * Casts `value` to `identity` if it's not a function. 10863 * 10864 * @private 10865 * @param {*} value The value to inspect. 10866 * @returns {Function} Returns cast function. 10867 */ 10868 function castFunction(value) { 10869 return typeof value == 'function' ? value : identity; 10870 } 10871 10872 /** 10873 * Casts `value` to a path array if it's not one. 10874 * 10875 * @private 10876 * @param {*} value The value to inspect. 10877 * @param {Object} [object] The object to query keys on. 10878 * @returns {Array} Returns the cast property path array. 10879 */ 10880 function castPath(value, object) { 10881 if (isArray(value)) { 10882 return value; 10883 } 10884 return isKey(value, object) ? [value] : stringToPath(toString(value)); 10885 } 10886 10887 /** 10888 * A `baseRest` alias which can be replaced with `identity` by module 10889 * replacement plugins. 10890 * 10891 * @private 10892 * @type {Function} 10893 * @param {Function} func The function to apply a rest parameter to. 10894 * @returns {Function} Returns the new function. 10895 */ 10896 var castRest = baseRest; 10897 10898 /** 10899 * Casts `array` to a slice if it's needed. 10900 * 10901 * @private 10902 * @param {Array} array The array to inspect. 10903 * @param {number} start The start position. 10904 * @param {number} [end=array.length] The end position. 10905 * @returns {Array} Returns the cast slice. 10906 */ 10907 function castSlice(array, start, end) { 10908 var length = array.length; 10909 end = end === undefined ? length : end; 10910 return (!start && end >= length) ? array : baseSlice(array, start, end); 10911 } 10912 10913 /** 10914 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 10915 * 10916 * @private 10917 * @param {number|Object} id The timer id or timeout object of the timer to clear. 10918 */ 10919 var clearTimeout = ctxClearTimeout || function(id) { 10920 return root.clearTimeout(id); 10921 }; 10922 10923 /** 10924 * Creates a clone of `buffer`. 10925 * 10926 * @private 10927 * @param {Buffer} buffer The buffer to clone. 10928 * @param {boolean} [isDeep] Specify a deep clone. 10929 * @returns {Buffer} Returns the cloned buffer. 10930 */ 10931 function cloneBuffer(buffer, isDeep) { 10932 if (isDeep) { 10933 return buffer.slice(); 10934 } 10935 var length = buffer.length, 10936 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 10937 10938 buffer.copy(result); 10939 return result; 10940 } 10941 10942 /** 10943 * Creates a clone of `arrayBuffer`. 10944 * 10945 * @private 10946 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 10947 * @returns {ArrayBuffer} Returns the cloned array buffer. 10948 */ 10949 function cloneArrayBuffer(arrayBuffer) { 10950 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 10951 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 10952 return result; 10953 } 10954 10955 /** 10956 * Creates a clone of `dataView`. 10957 * 10958 * @private 10959 * @param {Object} dataView The data view to clone. 10960 * @param {boolean} [isDeep] Specify a deep clone. 10961 * @returns {Object} Returns the cloned data view. 10962 */ 10963 function cloneDataView(dataView, isDeep) { 10964 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 10965 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 10966 } 10967 10968 /** 10969 * Creates a clone of `regexp`. 10970 * 10971 * @private 10972 * @param {Object} regexp The regexp to clone. 10973 * @returns {Object} Returns the cloned regexp. 10974 */ 10975 function cloneRegExp(regexp) { 10976 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 10977 result.lastIndex = regexp.lastIndex; 10978 return result; 10979 } 10980 10981 /** 10982 * Creates a clone of the `symbol` object. 10983 * 10984 * @private 10985 * @param {Object} symbol The symbol object to clone. 10986 * @returns {Object} Returns the cloned symbol object. 10987 */ 10988 function cloneSymbol(symbol) { 10989 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 10990 } 10991 10992 /** 10993 * Creates a clone of `typedArray`. 10994 * 10995 * @private 10996 * @param {Object} typedArray The typed array to clone. 10997 * @param {boolean} [isDeep] Specify a deep clone. 10998 * @returns {Object} Returns the cloned typed array. 10999 */ 11000 function cloneTypedArray(typedArray, isDeep) { 11001 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 11002 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 11003 } 11004 11005 /** 11006 * Compares values to sort them in ascending order. 11007 * 11008 * @private 11009 * @param {*} value The value to compare. 11010 * @param {*} other The other value to compare. 11011 * @returns {number} Returns the sort order indicator for `value`. 11012 */ 11013 function compareAscending(value, other) { 11014 if (value !== other) { 11015 var valIsDefined = value !== undefined, 11016 valIsNull = value === null, 11017 valIsReflexive = value === value, 11018 valIsSymbol = isSymbol(value); 11019 11020 var othIsDefined = other !== undefined, 11021 othIsNull = other === null, 11022 othIsReflexive = other === other, 11023 othIsSymbol = isSymbol(other); 11024 11025 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 11026 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 11027 (valIsNull && othIsDefined && othIsReflexive) || 11028 (!valIsDefined && othIsReflexive) || 11029 !valIsReflexive) { 11030 return 1; 11031 } 11032 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 11033 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 11034 (othIsNull && valIsDefined && valIsReflexive) || 11035 (!othIsDefined && valIsReflexive) || 11036 !othIsReflexive) { 11037 return -1; 11038 } 11039 } 11040 return 0; 11041 } 11042 11043 /** 11044 * Used by `_.orderBy` to compare multiple properties of a value to another 11045 * and stable sort them. 11046 * 11047 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 11048 * specify an order of "desc" for descending or "asc" for ascending sort order 11049 * of corresponding values. 11050 * 11051 * @private 11052 * @param {Object} object The object to compare. 11053 * @param {Object} other The other object to compare. 11054 * @param {boolean[]|string[]} orders The order to sort by for each property. 11055 * @returns {number} Returns the sort order indicator for `object`. 11056 */ 11057 function compareMultiple(object, other, orders) { 11058 var index = -1, 11059 objCriteria = object.criteria, 11060 othCriteria = other.criteria, 11061 length = objCriteria.length, 11062 ordersLength = orders.length; 11063 11064 while (++index < length) { 11065 var result = compareAscending(objCriteria[index], othCriteria[index]); 11066 if (result) { 11067 if (index >= ordersLength) { 11068 return result; 11069 } 11070 var order = orders[index]; 11071 return result * (order == 'desc' ? -1 : 1); 11072 } 11073 } 11074 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 11075 // that causes it, under certain circumstances, to provide the same value for 11076 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 11077 // for more details. 11078 // 11079 // This also ensures a stable sort in V8 and other engines. 11080 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 11081 return object.index - other.index; 11082 } 11083 11084 /** 11085 * Creates an array that is the composition of partially applied arguments, 11086 * placeholders, and provided arguments into a single array of arguments. 11087 * 11088 * @private 11089 * @param {Array} args The provided arguments. 11090 * @param {Array} partials The arguments to prepend to those provided. 11091 * @param {Array} holders The `partials` placeholder indexes. 11092 * @params {boolean} [isCurried] Specify composing for a curried function. 11093 * @returns {Array} Returns the new array of composed arguments. 11094 */ 11095 function composeArgs(args, partials, holders, isCurried) { 11096 var argsIndex = -1, 11097 argsLength = args.length, 11098 holdersLength = holders.length, 11099 leftIndex = -1, 11100 leftLength = partials.length, 11101 rangeLength = nativeMax(argsLength - holdersLength, 0), 11102 result = Array(leftLength + rangeLength), 11103 isUncurried = !isCurried; 11104 11105 while (++leftIndex < leftLength) { 11106 result[leftIndex] = partials[leftIndex]; 11107 } 11108 while (++argsIndex < holdersLength) { 11109 if (isUncurried || argsIndex < argsLength) { 11110 result[holders[argsIndex]] = args[argsIndex]; 11111 } 11112 } 11113 while (rangeLength--) { 11114 result[leftIndex++] = args[argsIndex++]; 11115 } 11116 return result; 11117 } 11118 11119 /** 11120 * This function is like `composeArgs` except that the arguments composition 11121 * is tailored for `_.partialRight`. 11122 * 11123 * @private 11124 * @param {Array} args The provided arguments. 11125 * @param {Array} partials The arguments to append to those provided. 11126 * @param {Array} holders The `partials` placeholder indexes. 11127 * @params {boolean} [isCurried] Specify composing for a curried function. 11128 * @returns {Array} Returns the new array of composed arguments. 11129 */ 11130 function composeArgsRight(args, partials, holders, isCurried) { 11131 var argsIndex = -1, 11132 argsLength = args.length, 11133 holdersIndex = -1, 11134 holdersLength = holders.length, 11135 rightIndex = -1, 11136 rightLength = partials.length, 11137 rangeLength = nativeMax(argsLength - holdersLength, 0), 11138 result = Array(rangeLength + rightLength), 11139 isUncurried = !isCurried; 11140 11141 while (++argsIndex < rangeLength) { 11142 result[argsIndex] = args[argsIndex]; 11143 } 11144 var offset = argsIndex; 11145 while (++rightIndex < rightLength) { 11146 result[offset + rightIndex] = partials[rightIndex]; 11147 } 11148 while (++holdersIndex < holdersLength) { 11149 if (isUncurried || argsIndex < argsLength) { 11150 result[offset + holders[holdersIndex]] = args[argsIndex++]; 11151 } 11152 } 11153 return result; 11154 } 11155 11156 /** 11157 * Copies the values of `source` to `array`. 11158 * 11159 * @private 11160 * @param {Array} source The array to copy values from. 11161 * @param {Array} [array=[]] The array to copy values to. 11162 * @returns {Array} Returns `array`. 11163 */ 11164 function copyArray(source, array) { 11165 var index = -1, 11166 length = source.length; 11167 11168 array || (array = Array(length)); 11169 while (++index < length) { 11170 array[index] = source[index]; 11171 } 11172 return array; 11173 } 11174 11175 /** 11176 * Copies properties of `source` to `object`. 11177 * 11178 * @private 11179 * @param {Object} source The object to copy properties from. 11180 * @param {Array} props The property identifiers to copy. 11181 * @param {Object} [object={}] The object to copy properties to. 11182 * @param {Function} [customizer] The function to customize copied values. 11183 * @returns {Object} Returns `object`. 11184 */ 11185 function copyObject(source, props, object, customizer) { 11186 var isNew = !object; 11187 object || (object = {}); 11188 11189 var index = -1, 11190 length = props.length; 11191 11192 while (++index < length) { 11193 var key = props[index]; 11194 11195 var newValue = customizer 11196 ? customizer(object[key], source[key], key, object, source) 11197 : undefined; 11198 11199 if (newValue === undefined) { 11200 newValue = source[key]; 11201 } 11202 if (isNew) { 11203 baseAssignValue(object, key, newValue); 11204 } else { 11205 assignValue(object, key, newValue); 11206 } 11207 } 11208 return object; 11209 } 11210 11211 /** 11212 * Copies own symbols of `source` to `object`. 11213 * 11214 * @private 11215 * @param {Object} source The object to copy symbols from. 11216 * @param {Object} [object={}] The object to copy symbols to. 11217 * @returns {Object} Returns `object`. 11218 */ 11219 function copySymbols(source, object) { 11220 return copyObject(source, getSymbols(source), object); 11221 } 11222 11223 /** 11224 * Copies own and inherited symbols of `source` to `object`. 11225 * 11226 * @private 11227 * @param {Object} source The object to copy symbols from. 11228 * @param {Object} [object={}] The object to copy symbols to. 11229 * @returns {Object} Returns `object`. 11230 */ 11231 function copySymbolsIn(source, object) { 11232 return copyObject(source, getSymbolsIn(source), object); 11233 } 11234 11235 /** 11236 * Creates a function like `_.groupBy`. 11237 * 11238 * @private 11239 * @param {Function} setter The function to set accumulator values. 11240 * @param {Function} [initializer] The accumulator object initializer. 11241 * @returns {Function} Returns the new aggregator function. 11242 */ 11243 function createAggregator(setter, initializer) { 11244 return function(collection, iteratee) { 11245 var func = isArray(collection) ? arrayAggregator : baseAggregator, 11246 accumulator = initializer ? initializer() : {}; 11247 11248 return func(collection, setter, getIteratee(iteratee, 2), accumulator); 11249 }; 11250 } 11251 11252 /** 11253 * Creates a function like `_.assign`. 11254 * 11255 * @private 11256 * @param {Function} assigner The function to assign values. 11257 * @returns {Function} Returns the new assigner function. 11258 */ 11259 function createAssigner(assigner) { 11260 return baseRest(function(object, sources) { 11261 var index = -1, 11262 length = sources.length, 11263 customizer = length > 1 ? sources[length - 1] : undefined, 11264 guard = length > 2 ? sources[2] : undefined; 11265 11266 customizer = (assigner.length > 3 && typeof customizer == 'function') 11267 ? (length--, customizer) 11268 : undefined; 11269 11270 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 11271 customizer = length < 3 ? undefined : customizer; 11272 length = 1; 11273 } 11274 object = Object(object); 11275 while (++index < length) { 11276 var source = sources[index]; 11277 if (source) { 11278 assigner(object, source, index, customizer); 11279 } 11280 } 11281 return object; 11282 }); 11283 } 11284 11285 /** 11286 * Creates a `baseEach` or `baseEachRight` function. 11287 * 11288 * @private 11289 * @param {Function} eachFunc The function to iterate over a collection. 11290 * @param {boolean} [fromRight] Specify iterating from right to left. 11291 * @returns {Function} Returns the new base function. 11292 */ 11293 function createBaseEach(eachFunc, fromRight) { 11294 return function(collection, iteratee) { 11295 if (collection == null) { 11296 return collection; 11297 } 11298 if (!isArrayLike(collection)) { 11299 return eachFunc(collection, iteratee); 11300 } 11301 var length = collection.length, 11302 index = fromRight ? length : -1, 11303 iterable = Object(collection); 11304 11305 while ((fromRight ? index-- : ++index < length)) { 11306 if (iteratee(iterable[index], index, iterable) === false) { 11307 break; 11308 } 11309 } 11310 return collection; 11311 }; 11312 } 11313 11314 /** 11315 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 11316 * 11317 * @private 11318 * @param {boolean} [fromRight] Specify iterating from right to left. 11319 * @returns {Function} Returns the new base function. 11320 */ 11321 function createBaseFor(fromRight) { 11322 return function(object, iteratee, keysFunc) { 11323 var index = -1, 11324 iterable = Object(object), 11325 props = keysFunc(object), 11326 length = props.length; 11327 11328 while (length--) { 11329 var key = props[fromRight ? length : ++index]; 11330 if (iteratee(iterable[key], key, iterable) === false) { 11331 break; 11332 } 11333 } 11334 return object; 11335 }; 11336 } 11337 11338 /** 11339 * Creates a function that wraps `func` to invoke it with the optional `this` 11340 * binding of `thisArg`. 11341 * 11342 * @private 11343 * @param {Function} func The function to wrap. 11344 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 11345 * @param {*} [thisArg] The `this` binding of `func`. 11346 * @returns {Function} Returns the new wrapped function. 11347 */ 11348 function createBind(func, bitmask, thisArg) { 11349 var isBind = bitmask & WRAP_BIND_FLAG, 11350 Ctor = createCtor(func); 11351 11352 function wrapper() { 11353 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 11354 return fn.apply(isBind ? thisArg : this, arguments); 11355 } 11356 return wrapper; 11357 } 11358 11359 /** 11360 * Creates a function like `_.lowerFirst`. 11361 * 11362 * @private 11363 * @param {string} methodName The name of the `String` case method to use. 11364 * @returns {Function} Returns the new case function. 11365 */ 11366 function createCaseFirst(methodName) { 11367 return function(string) { 11368 string = toString(string); 11369 11370 var strSymbols = hasUnicode(string) 11371 ? stringToArray(string) 11372 : undefined; 11373 11374 var chr = strSymbols 11375 ? strSymbols[0] 11376 : string.charAt(0); 11377 11378 var trailing = strSymbols 11379 ? castSlice(strSymbols, 1).join('') 11380 : string.slice(1); 11381 11382 return chr[methodName]() + trailing; 11383 }; 11384 } 11385 11386 /** 11387 * Creates a function like `_.camelCase`. 11388 * 11389 * @private 11390 * @param {Function} callback The function to combine each word. 11391 * @returns {Function} Returns the new compounder function. 11392 */ 11393 function createCompounder(callback) { 11394 return function(string) { 11395 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 11396 }; 11397 } 11398 11399 /** 11400 * Creates a function that produces an instance of `Ctor` regardless of 11401 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 11402 * 11403 * @private 11404 * @param {Function} Ctor The constructor to wrap. 11405 * @returns {Function} Returns the new wrapped function. 11406 */ 11407 function createCtor(Ctor) { 11408 return function() { 11409 // Use a `switch` statement to work with class constructors. See 11410 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 11411 // for more details. 11412 var args = arguments; 11413 switch (args.length) { 11414 case 0: return new Ctor; 11415 case 1: return new Ctor(args[0]); 11416 case 2: return new Ctor(args[0], args[1]); 11417 case 3: return new Ctor(args[0], args[1], args[2]); 11418 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 11419 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 11420 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 11421 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 11422 } 11423 var thisBinding = baseCreate(Ctor.prototype), 11424 result = Ctor.apply(thisBinding, args); 11425 11426 // Mimic the constructor's `return` behavior. 11427 // See https://es5.github.io/#x13.2.2 for more details. 11428 return isObject(result) ? result : thisBinding; 11429 }; 11430 } 11431 11432 /** 11433 * Creates a function that wraps `func` to enable currying. 11434 * 11435 * @private 11436 * @param {Function} func The function to wrap. 11437 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 11438 * @param {number} arity The arity of `func`. 11439 * @returns {Function} Returns the new wrapped function. 11440 */ 11441 function createCurry(func, bitmask, arity) { 11442 var Ctor = createCtor(func); 11443 11444 function wrapper() { 11445 var length = arguments.length, 11446 args = Array(length), 11447 index = length, 11448 placeholder = getHolder(wrapper); 11449 11450 while (index--) { 11451 args[index] = arguments[index]; 11452 } 11453 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 11454 ? [] 11455 : replaceHolders(args, placeholder); 11456 11457 length -= holders.length; 11458 if (length < arity) { 11459 return createRecurry( 11460 func, bitmask, createHybrid, wrapper.placeholder, undefined, 11461 args, holders, undefined, undefined, arity - length); 11462 } 11463 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 11464 return apply(fn, this, args); 11465 } 11466 return wrapper; 11467 } 11468 11469 /** 11470 * Creates a `_.find` or `_.findLast` function. 11471 * 11472 * @private 11473 * @param {Function} findIndexFunc The function to find the collection index. 11474 * @returns {Function} Returns the new find function. 11475 */ 11476 function createFind(findIndexFunc) { 11477 return function(collection, predicate, fromIndex) { 11478 var iterable = Object(collection); 11479 if (!isArrayLike(collection)) { 11480 var iteratee = getIteratee(predicate, 3); 11481 collection = keys(collection); 11482 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 11483 } 11484 var index = findIndexFunc(collection, predicate, fromIndex); 11485 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 11486 }; 11487 } 11488 11489 /** 11490 * Creates a `_.flow` or `_.flowRight` function. 11491 * 11492 * @private 11493 * @param {boolean} [fromRight] Specify iterating from right to left. 11494 * @returns {Function} Returns the new flow function. 11495 */ 11496 function createFlow(fromRight) { 11497 return flatRest(function(funcs) { 11498 var length = funcs.length, 11499 index = length, 11500 prereq = LodashWrapper.prototype.thru; 11501 11502 if (fromRight) { 11503 funcs.reverse(); 11504 } 11505 while (index--) { 11506 var func = funcs[index]; 11507 if (typeof func != 'function') { 11508 throw new TypeError(FUNC_ERROR_TEXT); 11509 } 11510 if (prereq && !wrapper && getFuncName(func) == 'wrapper') { 11511 var wrapper = new LodashWrapper([], true); 11512 } 11513 } 11514 index = wrapper ? index : length; 11515 while (++index < length) { 11516 func = funcs[index]; 11517 11518 var funcName = getFuncName(func), 11519 data = funcName == 'wrapper' ? getData(func) : undefined; 11520 11521 if (data && isLaziable(data[0]) && 11522 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && 11523 !data[4].length && data[9] == 1 11524 ) { 11525 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 11526 } else { 11527 wrapper = (func.length == 1 && isLaziable(func)) 11528 ? wrapper[funcName]() 11529 : wrapper.thru(func); 11530 } 11531 } 11532 return function() { 11533 var args = arguments, 11534 value = args[0]; 11535 11536 if (wrapper && args.length == 1 && isArray(value)) { 11537 return wrapper.plant(value).value(); 11538 } 11539 var index = 0, 11540 result = length ? funcs[index].apply(this, args) : value; 11541 11542 while (++index < length) { 11543 result = funcs[index].call(this, result); 11544 } 11545 return result; 11546 }; 11547 }); 11548 } 11549 11550 /** 11551 * Creates a function that wraps `func` to invoke it with optional `this` 11552 * binding of `thisArg`, partial application, and currying. 11553 * 11554 * @private 11555 * @param {Function|string} func The function or method name to wrap. 11556 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 11557 * @param {*} [thisArg] The `this` binding of `func`. 11558 * @param {Array} [partials] The arguments to prepend to those provided to 11559 * the new function. 11560 * @param {Array} [holders] The `partials` placeholder indexes. 11561 * @param {Array} [partialsRight] The arguments to append to those provided 11562 * to the new function. 11563 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 11564 * @param {Array} [argPos] The argument positions of the new function. 11565 * @param {number} [ary] The arity cap of `func`. 11566 * @param {number} [arity] The arity of `func`. 11567 * @returns {Function} Returns the new wrapped function. 11568 */ 11569 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 11570 var isAry = bitmask & WRAP_ARY_FLAG, 11571 isBind = bitmask & WRAP_BIND_FLAG, 11572 isBindKey = bitmask & WRAP_BIND_KEY_FLAG, 11573 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), 11574 isFlip = bitmask & WRAP_FLIP_FLAG, 11575 Ctor = isBindKey ? undefined : createCtor(func); 11576 11577 function wrapper() { 11578 var length = arguments.length, 11579 args = Array(length), 11580 index = length; 11581 11582 while (index--) { 11583 args[index] = arguments[index]; 11584 } 11585 if (isCurried) { 11586 var placeholder = getHolder(wrapper), 11587 holdersCount = countHolders(args, placeholder); 11588 } 11589 if (partials) { 11590 args = composeArgs(args, partials, holders, isCurried); 11591 } 11592 if (partialsRight) { 11593 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 11594 } 11595 length -= holdersCount; 11596 if (isCurried && length < arity) { 11597 var newHolders = replaceHolders(args, placeholder); 11598 return createRecurry( 11599 func, bitmask, createHybrid, wrapper.placeholder, thisArg, 11600 args, newHolders, argPos, ary, arity - length 11601 ); 11602 } 11603 var thisBinding = isBind ? thisArg : this, 11604 fn = isBindKey ? thisBinding[func] : func; 11605 11606 length = args.length; 11607 if (argPos) { 11608 args = reorder(args, argPos); 11609 } else if (isFlip && length > 1) { 11610 args.reverse(); 11611 } 11612 if (isAry && ary < length) { 11613 args.length = ary; 11614 } 11615 if (this && this !== root && this instanceof wrapper) { 11616 fn = Ctor || createCtor(fn); 11617 } 11618 return fn.apply(thisBinding, args); 11619 } 11620 return wrapper; 11621 } 11622 11623 /** 11624 * Creates a function like `_.invertBy`. 11625 * 11626 * @private 11627 * @param {Function} setter The function to set accumulator values. 11628 * @param {Function} toIteratee The function to resolve iteratees. 11629 * @returns {Function} Returns the new inverter function. 11630 */ 11631 function createInverter(setter, toIteratee) { 11632 return function(object, iteratee) { 11633 return baseInverter(object, setter, toIteratee(iteratee), {}); 11634 }; 11635 } 11636 11637 /** 11638 * Creates a function that performs a mathematical operation on two values. 11639 * 11640 * @private 11641 * @param {Function} operator The function to perform the operation. 11642 * @param {number} [defaultValue] The value used for `undefined` arguments. 11643 * @returns {Function} Returns the new mathematical operation function. 11644 */ 11645 function createMathOperation(operator, defaultValue) { 11646 return function(value, other) { 11647 var result; 11648 if (value === undefined && other === undefined) { 11649 return defaultValue; 11650 } 11651 if (value !== undefined) { 11652 result = value; 11653 } 11654 if (other !== undefined) { 11655 if (result === undefined) { 11656 return other; 11657 } 11658 if (typeof value == 'string' || typeof other == 'string') { 11659 value = baseToString(value); 11660 other = baseToString(other); 11661 } else { 11662 value = baseToNumber(value); 11663 other = baseToNumber(other); 11664 } 11665 result = operator(value, other); 11666 } 11667 return result; 11668 }; 11669 } 11670 11671 /** 11672 * Creates a function like `_.over`. 11673 * 11674 * @private 11675 * @param {Function} arrayFunc The function to iterate over iteratees. 11676 * @returns {Function} Returns the new over function. 11677 */ 11678 function createOver(arrayFunc) { 11679 return flatRest(function(iteratees) { 11680 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 11681 return baseRest(function(args) { 11682 var thisArg = this; 11683 return arrayFunc(iteratees, function(iteratee) { 11684 return apply(iteratee, thisArg, args); 11685 }); 11686 }); 11687 }); 11688 } 11689 11690 /** 11691 * Creates the padding for `string` based on `length`. The `chars` string 11692 * is truncated if the number of characters exceeds `length`. 11693 * 11694 * @private 11695 * @param {number} length The padding length. 11696 * @param {string} [chars=' '] The string used as padding. 11697 * @returns {string} Returns the padding for `string`. 11698 */ 11699 function createPadding(length, chars) { 11700 chars = chars === undefined ? ' ' : baseToString(chars); 11701 11702 var charsLength = chars.length; 11703 if (charsLength < 2) { 11704 return charsLength ? baseRepeat(chars, length) : chars; 11705 } 11706 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 11707 return hasUnicode(chars) 11708 ? castSlice(stringToArray(result), 0, length).join('') 11709 : result.slice(0, length); 11710 } 11711 11712 /** 11713 * Creates a function that wraps `func` to invoke it with the `this` binding 11714 * of `thisArg` and `partials` prepended to the arguments it receives. 11715 * 11716 * @private 11717 * @param {Function} func The function to wrap. 11718 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 11719 * @param {*} thisArg The `this` binding of `func`. 11720 * @param {Array} partials The arguments to prepend to those provided to 11721 * the new function. 11722 * @returns {Function} Returns the new wrapped function. 11723 */ 11724 function createPartial(func, bitmask, thisArg, partials) { 11725 var isBind = bitmask & WRAP_BIND_FLAG, 11726 Ctor = createCtor(func); 11727 11728 function wrapper() { 11729 var argsIndex = -1, 11730 argsLength = arguments.length, 11731 leftIndex = -1, 11732 leftLength = partials.length, 11733 args = Array(leftLength + argsLength), 11734 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 11735 11736 while (++leftIndex < leftLength) { 11737 args[leftIndex] = partials[leftIndex]; 11738 } 11739 while (argsLength--) { 11740 args[leftIndex++] = arguments[++argsIndex]; 11741 } 11742 return apply(fn, isBind ? thisArg : this, args); 11743 } 11744 return wrapper; 11745 } 11746 11747 /** 11748 * Creates a `_.range` or `_.rangeRight` function. 11749 * 11750 * @private 11751 * @param {boolean} [fromRight] Specify iterating from right to left. 11752 * @returns {Function} Returns the new range function. 11753 */ 11754 function createRange(fromRight) { 11755 return function(start, end, step) { 11756 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { 11757 end = step = undefined; 11758 } 11759 // Ensure the sign of `-0` is preserved. 11760 start = toFinite(start); 11761 if (end === undefined) { 11762 end = start; 11763 start = 0; 11764 } else { 11765 end = toFinite(end); 11766 } 11767 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); 11768 return baseRange(start, end, step, fromRight); 11769 }; 11770 } 11771 11772 /** 11773 * Creates a function that performs a relational operation on two values. 11774 * 11775 * @private 11776 * @param {Function} operator The function to perform the operation. 11777 * @returns {Function} Returns the new relational operation function. 11778 */ 11779 function createRelationalOperation(operator) { 11780 return function(value, other) { 11781 if (!(typeof value == 'string' && typeof other == 'string')) { 11782 value = toNumber(value); 11783 other = toNumber(other); 11784 } 11785 return operator(value, other); 11786 }; 11787 } 11788 11789 /** 11790 * Creates a function that wraps `func` to continue currying. 11791 * 11792 * @private 11793 * @param {Function} func The function to wrap. 11794 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 11795 * @param {Function} wrapFunc The function to create the `func` wrapper. 11796 * @param {*} placeholder The placeholder value. 11797 * @param {*} [thisArg] The `this` binding of `func`. 11798 * @param {Array} [partials] The arguments to prepend to those provided to 11799 * the new function. 11800 * @param {Array} [holders] The `partials` placeholder indexes. 11801 * @param {Array} [argPos] The argument positions of the new function. 11802 * @param {number} [ary] The arity cap of `func`. 11803 * @param {number} [arity] The arity of `func`. 11804 * @returns {Function} Returns the new wrapped function. 11805 */ 11806 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 11807 var isCurry = bitmask & WRAP_CURRY_FLAG, 11808 newHolders = isCurry ? holders : undefined, 11809 newHoldersRight = isCurry ? undefined : holders, 11810 newPartials = isCurry ? partials : undefined, 11811 newPartialsRight = isCurry ? undefined : partials; 11812 11813 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); 11814 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 11815 11816 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 11817 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); 11818 } 11819 var newData = [ 11820 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, 11821 newHoldersRight, argPos, ary, arity 11822 ]; 11823 11824 var result = wrapFunc.apply(undefined, newData); 11825 if (isLaziable(func)) { 11826 setData(result, newData); 11827 } 11828 result.placeholder = placeholder; 11829 return setWrapToString(result, func, bitmask); 11830 } 11831 11832 /** 11833 * Creates a function like `_.round`. 11834 * 11835 * @private 11836 * @param {string} methodName The name of the `Math` method to use when rounding. 11837 * @returns {Function} Returns the new round function. 11838 */ 11839 function createRound(methodName) { 11840 var func = Math[methodName]; 11841 return function(number, precision) { 11842 number = toNumber(number); 11843 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 11844 if (precision && nativeIsFinite(number)) { 11845 // Shift with exponential notation to avoid floating-point issues. 11846 // See [MDN](https://mdn.io/round#Examples) for more details. 11847 var pair = (toString(number) + 'e').split('e'), 11848 value = func(pair[0] + 'e' + (+pair[1] + precision)); 11849 11850 pair = (toString(value) + 'e').split('e'); 11851 return +(pair[0] + 'e' + (+pair[1] - precision)); 11852 } 11853 return func(number); 11854 }; 11855 } 11856 11857 /** 11858 * Creates a set object of `values`. 11859 * 11860 * @private 11861 * @param {Array} values The values to add to the set. 11862 * @returns {Object} Returns the new set. 11863 */ 11864 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 11865 return new Set(values); 11866 }; 11867 11868 /** 11869 * Creates a `_.toPairs` or `_.toPairsIn` function. 11870 * 11871 * @private 11872 * @param {Function} keysFunc The function to get the keys of a given object. 11873 * @returns {Function} Returns the new pairs function. 11874 */ 11875 function createToPairs(keysFunc) { 11876 return function(object) { 11877 var tag = getTag(object); 11878 if (tag == mapTag) { 11879 return mapToArray(object); 11880 } 11881 if (tag == setTag) { 11882 return setToPairs(object); 11883 } 11884 return baseToPairs(object, keysFunc(object)); 11885 }; 11886 } 11887 11888 /** 11889 * Creates a function that either curries or invokes `func` with optional 11890 * `this` binding and partially applied arguments. 11891 * 11892 * @private 11893 * @param {Function|string} func The function or method name to wrap. 11894 * @param {number} bitmask The bitmask flags. 11895 * 1 - `_.bind` 11896 * 2 - `_.bindKey` 11897 * 4 - `_.curry` or `_.curryRight` of a bound function 11898 * 8 - `_.curry` 11899 * 16 - `_.curryRight` 11900 * 32 - `_.partial` 11901 * 64 - `_.partialRight` 11902 * 128 - `_.rearg` 11903 * 256 - `_.ary` 11904 * 512 - `_.flip` 11905 * @param {*} [thisArg] The `this` binding of `func`. 11906 * @param {Array} [partials] The arguments to be partially applied. 11907 * @param {Array} [holders] The `partials` placeholder indexes. 11908 * @param {Array} [argPos] The argument positions of the new function. 11909 * @param {number} [ary] The arity cap of `func`. 11910 * @param {number} [arity] The arity of `func`. 11911 * @returns {Function} Returns the new wrapped function. 11912 */ 11913 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 11914 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 11915 if (!isBindKey && typeof func != 'function') { 11916 throw new TypeError(FUNC_ERROR_TEXT); 11917 } 11918 var length = partials ? partials.length : 0; 11919 if (!length) { 11920 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); 11921 partials = holders = undefined; 11922 } 11923 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 11924 arity = arity === undefined ? arity : toInteger(arity); 11925 length -= holders ? holders.length : 0; 11926 11927 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 11928 var partialsRight = partials, 11929 holdersRight = holders; 11930 11931 partials = holders = undefined; 11932 } 11933 var data = isBindKey ? undefined : getData(func); 11934 11935 var newData = [ 11936 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, 11937 argPos, ary, arity 11938 ]; 11939 11940 if (data) { 11941 mergeData(newData, data); 11942 } 11943 func = newData[0]; 11944 bitmask = newData[1]; 11945 thisArg = newData[2]; 11946 partials = newData[3]; 11947 holders = newData[4]; 11948 arity = newData[9] = newData[9] === undefined 11949 ? (isBindKey ? 0 : func.length) 11950 : nativeMax(newData[9] - length, 0); 11951 11952 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 11953 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); 11954 } 11955 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 11956 var result = createBind(func, bitmask, thisArg); 11957 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 11958 result = createCurry(func, bitmask, arity); 11959 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 11960 result = createPartial(func, bitmask, thisArg, partials); 11961 } else { 11962 result = createHybrid.apply(undefined, newData); 11963 } 11964 var setter = data ? baseSetData : setData; 11965 return setWrapToString(setter(result, newData), func, bitmask); 11966 } 11967 11968 /** 11969 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 11970 * of source objects to the destination object for all destination properties 11971 * that resolve to `undefined`. 11972 * 11973 * @private 11974 * @param {*} objValue The destination value. 11975 * @param {*} srcValue The source value. 11976 * @param {string} key The key of the property to assign. 11977 * @param {Object} object The parent object of `objValue`. 11978 * @returns {*} Returns the value to assign. 11979 */ 11980 function customDefaultsAssignIn(objValue, srcValue, key, object) { 11981 if (objValue === undefined || 11982 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { 11983 return srcValue; 11984 } 11985 return objValue; 11986 } 11987 11988 /** 11989 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 11990 * objects into destination objects that are passed thru. 11991 * 11992 * @private 11993 * @param {*} objValue The destination value. 11994 * @param {*} srcValue The source value. 11995 * @param {string} key The key of the property to merge. 11996 * @param {Object} object The parent object of `objValue`. 11997 * @param {Object} source The parent object of `srcValue`. 11998 * @param {Object} [stack] Tracks traversed source values and their merged 11999 * counterparts. 12000 * @returns {*} Returns the value to assign. 12001 */ 12002 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { 12003 if (isObject(objValue) && isObject(srcValue)) { 12004 // Recursively merge objects and arrays (susceptible to call stack limits). 12005 stack.set(srcValue, objValue); 12006 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); 12007 stack['delete'](srcValue); 12008 } 12009 return objValue; 12010 } 12011 12012 /** 12013 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 12014 * objects. 12015 * 12016 * @private 12017 * @param {*} value The value to inspect. 12018 * @param {string} key The key of the property to inspect. 12019 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 12020 */ 12021 function customOmitClone(value) { 12022 return isPlainObject(value) ? undefined : value; 12023 } 12024 12025 /** 12026 * A specialized version of `baseIsEqualDeep` for arrays with support for 12027 * partial deep comparisons. 12028 * 12029 * @private 12030 * @param {Array} array The array to compare. 12031 * @param {Array} other The other array to compare. 12032 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 12033 * @param {Function} customizer The function to customize comparisons. 12034 * @param {Function} equalFunc The function to determine equivalents of values. 12035 * @param {Object} stack Tracks traversed `array` and `other` objects. 12036 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 12037 */ 12038 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 12039 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 12040 arrLength = array.length, 12041 othLength = other.length; 12042 12043 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 12044 return false; 12045 } 12046 // Check that cyclic values are equal. 12047 var arrStacked = stack.get(array); 12048 var othStacked = stack.get(other); 12049 if (arrStacked && othStacked) { 12050 return arrStacked == other && othStacked == array; 12051 } 12052 var index = -1, 12053 result = true, 12054 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; 12055 12056 stack.set(array, other); 12057 stack.set(other, array); 12058 12059 // Ignore non-index properties. 12060 while (++index < arrLength) { 12061 var arrValue = array[index], 12062 othValue = other[index]; 12063 12064 if (customizer) { 12065 var compared = isPartial 12066 ? customizer(othValue, arrValue, index, other, array, stack) 12067 : customizer(arrValue, othValue, index, array, other, stack); 12068 } 12069 if (compared !== undefined) { 12070 if (compared) { 12071 continue; 12072 } 12073 result = false; 12074 break; 12075 } 12076 // Recursively compare arrays (susceptible to call stack limits). 12077 if (seen) { 12078 if (!arraySome(other, function(othValue, othIndex) { 12079 if (!cacheHas(seen, othIndex) && 12080 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 12081 return seen.push(othIndex); 12082 } 12083 })) { 12084 result = false; 12085 break; 12086 } 12087 } else if (!( 12088 arrValue === othValue || 12089 equalFunc(arrValue, othValue, bitmask, customizer, stack) 12090 )) { 12091 result = false; 12092 break; 12093 } 12094 } 12095 stack['delete'](array); 12096 stack['delete'](other); 12097 return result; 12098 } 12099 12100 /** 12101 * A specialized version of `baseIsEqualDeep` for comparing objects of 12102 * the same `toStringTag`. 12103 * 12104 * **Note:** This function only supports comparing values with tags of 12105 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 12106 * 12107 * @private 12108 * @param {Object} object The object to compare. 12109 * @param {Object} other The other object to compare. 12110 * @param {string} tag The `toStringTag` of the objects to compare. 12111 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 12112 * @param {Function} customizer The function to customize comparisons. 12113 * @param {Function} equalFunc The function to determine equivalents of values. 12114 * @param {Object} stack Tracks traversed `object` and `other` objects. 12115 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 12116 */ 12117 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 12118 switch (tag) { 12119 case dataViewTag: 12120 if ((object.byteLength != other.byteLength) || 12121 (object.byteOffset != other.byteOffset)) { 12122 return false; 12123 } 12124 object = object.buffer; 12125 other = other.buffer; 12126 12127 case arrayBufferTag: 12128 if ((object.byteLength != other.byteLength) || 12129 !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 12130 return false; 12131 } 12132 return true; 12133 12134 case boolTag: 12135 case dateTag: 12136 case numberTag: 12137 // Coerce booleans to `1` or `0` and dates to milliseconds. 12138 // Invalid dates are coerced to `NaN`. 12139 return eq(+object, +other); 12140 12141 case errorTag: 12142 return object.name == other.name && object.message == other.message; 12143 12144 case regexpTag: 12145 case stringTag: 12146 // Coerce regexes to strings and treat strings, primitives and objects, 12147 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 12148 // for more details. 12149 return object == (other + ''); 12150 12151 case mapTag: 12152 var convert = mapToArray; 12153 12154 case setTag: 12155 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 12156 convert || (convert = setToArray); 12157 12158 if (object.size != other.size && !isPartial) { 12159 return false; 12160 } 12161 // Assume cyclic values are equal. 12162 var stacked = stack.get(object); 12163 if (stacked) { 12164 return stacked == other; 12165 } 12166 bitmask |= COMPARE_UNORDERED_FLAG; 12167 12168 // Recursively compare objects (susceptible to call stack limits). 12169 stack.set(object, other); 12170 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 12171 stack['delete'](object); 12172 return result; 12173 12174 case symbolTag: 12175 if (symbolValueOf) { 12176 return symbolValueOf.call(object) == symbolValueOf.call(other); 12177 } 12178 } 12179 return false; 12180 } 12181 12182 /** 12183 * A specialized version of `baseIsEqualDeep` for objects with support for 12184 * partial deep comparisons. 12185 * 12186 * @private 12187 * @param {Object} object The object to compare. 12188 * @param {Object} other The other object to compare. 12189 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 12190 * @param {Function} customizer The function to customize comparisons. 12191 * @param {Function} equalFunc The function to determine equivalents of values. 12192 * @param {Object} stack Tracks traversed `object` and `other` objects. 12193 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 12194 */ 12195 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 12196 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 12197 objProps = getAllKeys(object), 12198 objLength = objProps.length, 12199 othProps = getAllKeys(other), 12200 othLength = othProps.length; 12201 12202 if (objLength != othLength && !isPartial) { 12203 return false; 12204 } 12205 var index = objLength; 12206 while (index--) { 12207 var key = objProps[index]; 12208 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 12209 return false; 12210 } 12211 } 12212 // Check that cyclic values are equal. 12213 var objStacked = stack.get(object); 12214 var othStacked = stack.get(other); 12215 if (objStacked && othStacked) { 12216 return objStacked == other && othStacked == object; 12217 } 12218 var result = true; 12219 stack.set(object, other); 12220 stack.set(other, object); 12221 12222 var skipCtor = isPartial; 12223 while (++index < objLength) { 12224 key = objProps[index]; 12225 var objValue = object[key], 12226 othValue = other[key]; 12227 12228 if (customizer) { 12229 var compared = isPartial 12230 ? customizer(othValue, objValue, key, other, object, stack) 12231 : customizer(objValue, othValue, key, object, other, stack); 12232 } 12233 // Recursively compare objects (susceptible to call stack limits). 12234 if (!(compared === undefined 12235 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 12236 : compared 12237 )) { 12238 result = false; 12239 break; 12240 } 12241 skipCtor || (skipCtor = key == 'constructor'); 12242 } 12243 if (result && !skipCtor) { 12244 var objCtor = object.constructor, 12245 othCtor = other.constructor; 12246 12247 // Non `Object` object instances with different constructors are not equal. 12248 if (objCtor != othCtor && 12249 ('constructor' in object && 'constructor' in other) && 12250 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 12251 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 12252 result = false; 12253 } 12254 } 12255 stack['delete'](object); 12256 stack['delete'](other); 12257 return result; 12258 } 12259 12260 /** 12261 * A specialized version of `baseRest` which flattens the rest array. 12262 * 12263 * @private 12264 * @param {Function} func The function to apply a rest parameter to. 12265 * @returns {Function} Returns the new function. 12266 */ 12267 function flatRest(func) { 12268 return setToString(overRest(func, undefined, flatten), func + ''); 12269 } 12270 12271 /** 12272 * Creates an array of own enumerable property names and symbols of `object`. 12273 * 12274 * @private 12275 * @param {Object} object The object to query. 12276 * @returns {Array} Returns the array of property names and symbols. 12277 */ 12278 function getAllKeys(object) { 12279 return baseGetAllKeys(object, keys, getSymbols); 12280 } 12281 12282 /** 12283 * Creates an array of own and inherited enumerable property names and 12284 * symbols of `object`. 12285 * 12286 * @private 12287 * @param {Object} object The object to query. 12288 * @returns {Array} Returns the array of property names and symbols. 12289 */ 12290 function getAllKeysIn(object) { 12291 return baseGetAllKeys(object, keysIn, getSymbolsIn); 12292 } 12293 12294 /** 12295 * Gets metadata for `func`. 12296 * 12297 * @private 12298 * @param {Function} func The function to query. 12299 * @returns {*} Returns the metadata for `func`. 12300 */ 12301 var getData = !metaMap ? noop : function(func) { 12302 return metaMap.get(func); 12303 }; 12304 12305 /** 12306 * Gets the name of `func`. 12307 * 12308 * @private 12309 * @param {Function} func The function to query. 12310 * @returns {string} Returns the function name. 12311 */ 12312 function getFuncName(func) { 12313 var result = (func.name + ''), 12314 array = realNames[result], 12315 length = hasOwnProperty.call(realNames, result) ? array.length : 0; 12316 12317 while (length--) { 12318 var data = array[length], 12319 otherFunc = data.func; 12320 if (otherFunc == null || otherFunc == func) { 12321 return data.name; 12322 } 12323 } 12324 return result; 12325 } 12326 12327 /** 12328 * Gets the argument placeholder value for `func`. 12329 * 12330 * @private 12331 * @param {Function} func The function to inspect. 12332 * @returns {*} Returns the placeholder value. 12333 */ 12334 function getHolder(func) { 12335 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; 12336 return object.placeholder; 12337 } 12338 12339 /** 12340 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 12341 * this function returns the custom method, otherwise it returns `baseIteratee`. 12342 * If arguments are provided, the chosen function is invoked with them and 12343 * its result is returned. 12344 * 12345 * @private 12346 * @param {*} [value] The value to convert to an iteratee. 12347 * @param {number} [arity] The arity of the created iteratee. 12348 * @returns {Function} Returns the chosen function or its result. 12349 */ 12350 function getIteratee() { 12351 var result = lodash.iteratee || iteratee; 12352 result = result === iteratee ? baseIteratee : result; 12353 return arguments.length ? result(arguments[0], arguments[1]) : result; 12354 } 12355 12356 /** 12357 * Gets the data for `map`. 12358 * 12359 * @private 12360 * @param {Object} map The map to query. 12361 * @param {string} key The reference key. 12362 * @returns {*} Returns the map data. 12363 */ 12364 function getMapData(map, key) { 12365 var data = map.__data__; 12366 return isKeyable(key) 12367 ? data[typeof key == 'string' ? 'string' : 'hash'] 12368 : data.map; 12369 } 12370 12371 /** 12372 * Gets the property names, values, and compare flags of `object`. 12373 * 12374 * @private 12375 * @param {Object} object The object to query. 12376 * @returns {Array} Returns the match data of `object`. 12377 */ 12378 function getMatchData(object) { 12379 var result = keys(object), 12380 length = result.length; 12381 12382 while (length--) { 12383 var key = result[length], 12384 value = object[key]; 12385 12386 result[length] = [key, value, isStrictComparable(value)]; 12387 } 12388 return result; 12389 } 12390 12391 /** 12392 * Gets the native function at `key` of `object`. 12393 * 12394 * @private 12395 * @param {Object} object The object to query. 12396 * @param {string} key The key of the method to get. 12397 * @returns {*} Returns the function if it's native, else `undefined`. 12398 */ 12399 function getNative(object, key) { 12400 var value = getValue(object, key); 12401 return baseIsNative(value) ? value : undefined; 12402 } 12403 12404 /** 12405 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 12406 * 12407 * @private 12408 * @param {*} value The value to query. 12409 * @returns {string} Returns the raw `toStringTag`. 12410 */ 12411 function getRawTag(value) { 12412 var isOwn = hasOwnProperty.call(value, symToStringTag), 12413 tag = value[symToStringTag]; 12414 12415 try { 12416 value[symToStringTag] = undefined; 12417 var unmasked = true; 12418 } catch (e) {} 12419 12420 var result = nativeObjectToString.call(value); 12421 if (unmasked) { 12422 if (isOwn) { 12423 value[symToStringTag] = tag; 12424 } else { 12425 delete value[symToStringTag]; 12426 } 12427 } 12428 return result; 12429 } 12430 12431 /** 12432 * Creates an array of the own enumerable symbols of `object`. 12433 * 12434 * @private 12435 * @param {Object} object The object to query. 12436 * @returns {Array} Returns the array of symbols. 12437 */ 12438 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 12439 if (object == null) { 12440 return []; 12441 } 12442 object = Object(object); 12443 return arrayFilter(nativeGetSymbols(object), function(symbol) { 12444 return propertyIsEnumerable.call(object, symbol); 12445 }); 12446 }; 12447 12448 /** 12449 * Creates an array of the own and inherited enumerable symbols of `object`. 12450 * 12451 * @private 12452 * @param {Object} object The object to query. 12453 * @returns {Array} Returns the array of symbols. 12454 */ 12455 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 12456 var result = []; 12457 while (object) { 12458 arrayPush(result, getSymbols(object)); 12459 object = getPrototype(object); 12460 } 12461 return result; 12462 }; 12463 12464 /** 12465 * Gets the `toStringTag` of `value`. 12466 * 12467 * @private 12468 * @param {*} value The value to query. 12469 * @returns {string} Returns the `toStringTag`. 12470 */ 12471 var getTag = baseGetTag; 12472 12473 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 12474 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 12475 (Map && getTag(new Map) != mapTag) || 12476 (Promise && getTag(Promise.resolve()) != promiseTag) || 12477 (Set && getTag(new Set) != setTag) || 12478 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 12479 getTag = function(value) { 12480 var result = baseGetTag(value), 12481 Ctor = result == objectTag ? value.constructor : undefined, 12482 ctorString = Ctor ? toSource(Ctor) : ''; 12483 12484 if (ctorString) { 12485 switch (ctorString) { 12486 case dataViewCtorString: return dataViewTag; 12487 case mapCtorString: return mapTag; 12488 case promiseCtorString: return promiseTag; 12489 case setCtorString: return setTag; 12490 case weakMapCtorString: return weakMapTag; 12491 } 12492 } 12493 return result; 12494 }; 12495 } 12496 12497 /** 12498 * Gets the view, applying any `transforms` to the `start` and `end` positions. 12499 * 12500 * @private 12501 * @param {number} start The start of the view. 12502 * @param {number} end The end of the view. 12503 * @param {Array} transforms The transformations to apply to the view. 12504 * @returns {Object} Returns an object containing the `start` and `end` 12505 * positions of the view. 12506 */ 12507 function getView(start, end, transforms) { 12508 var index = -1, 12509 length = transforms.length; 12510 12511 while (++index < length) { 12512 var data = transforms[index], 12513 size = data.size; 12514 12515 switch (data.type) { 12516 case 'drop': start += size; break; 12517 case 'dropRight': end -= size; break; 12518 case 'take': end = nativeMin(end, start + size); break; 12519 case 'takeRight': start = nativeMax(start, end - size); break; 12520 } 12521 } 12522 return { 'start': start, 'end': end }; 12523 } 12524 12525 /** 12526 * Extracts wrapper details from the `source` body comment. 12527 * 12528 * @private 12529 * @param {string} source The source to inspect. 12530 * @returns {Array} Returns the wrapper details. 12531 */ 12532 function getWrapDetails(source) { 12533 var match = source.match(reWrapDetails); 12534 return match ? match[1].split(reSplitDetails) : []; 12535 } 12536 12537 /** 12538 * Checks if `path` exists on `object`. 12539 * 12540 * @private 12541 * @param {Object} object The object to query. 12542 * @param {Array|string} path The path to check. 12543 * @param {Function} hasFunc The function to check properties. 12544 * @returns {boolean} Returns `true` if `path` exists, else `false`. 12545 */ 12546 function hasPath(object, path, hasFunc) { 12547 path = castPath(path, object); 12548 12549 var index = -1, 12550 length = path.length, 12551 result = false; 12552 12553 while (++index < length) { 12554 var key = toKey(path[index]); 12555 if (!(result = object != null && hasFunc(object, key))) { 12556 break; 12557 } 12558 object = object[key]; 12559 } 12560 if (result || ++index != length) { 12561 return result; 12562 } 12563 length = object == null ? 0 : object.length; 12564 return !!length && isLength(length) && isIndex(key, length) && 12565 (isArray(object) || isArguments(object)); 12566 } 12567 12568 /** 12569 * Initializes an array clone. 12570 * 12571 * @private 12572 * @param {Array} array The array to clone. 12573 * @returns {Array} Returns the initialized clone. 12574 */ 12575 function initCloneArray(array) { 12576 var length = array.length, 12577 result = new array.constructor(length); 12578 12579 // Add properties assigned by `RegExp#exec`. 12580 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 12581 result.index = array.index; 12582 result.input = array.input; 12583 } 12584 return result; 12585 } 12586 12587 /** 12588 * Initializes an object clone. 12589 * 12590 * @private 12591 * @param {Object} object The object to clone. 12592 * @returns {Object} Returns the initialized clone. 12593 */ 12594 function initCloneObject(object) { 12595 return (typeof object.constructor == 'function' && !isPrototype(object)) 12596 ? baseCreate(getPrototype(object)) 12597 : {}; 12598 } 12599 12600 /** 12601 * Initializes an object clone based on its `toStringTag`. 12602 * 12603 * **Note:** This function only supports cloning values with tags of 12604 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 12605 * 12606 * @private 12607 * @param {Object} object The object to clone. 12608 * @param {string} tag The `toStringTag` of the object to clone. 12609 * @param {boolean} [isDeep] Specify a deep clone. 12610 * @returns {Object} Returns the initialized clone. 12611 */ 12612 function initCloneByTag(object, tag, isDeep) { 12613 var Ctor = object.constructor; 12614 switch (tag) { 12615 case arrayBufferTag: 12616 return cloneArrayBuffer(object); 12617 12618 case boolTag: 12619 case dateTag: 12620 return new Ctor(+object); 12621 12622 case dataViewTag: 12623 return cloneDataView(object, isDeep); 12624 12625 case float32Tag: case float64Tag: 12626 case int8Tag: case int16Tag: case int32Tag: 12627 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 12628 return cloneTypedArray(object, isDeep); 12629 12630 case mapTag: 12631 return new Ctor; 12632 12633 case numberTag: 12634 case stringTag: 12635 return new Ctor(object); 12636 12637 case regexpTag: 12638 return cloneRegExp(object); 12639 12640 case setTag: 12641 return new Ctor; 12642 12643 case symbolTag: 12644 return cloneSymbol(object); 12645 } 12646 } 12647 12648 /** 12649 * Inserts wrapper `details` in a comment at the top of the `source` body. 12650 * 12651 * @private 12652 * @param {string} source The source to modify. 12653 * @returns {Array} details The details to insert. 12654 * @returns {string} Returns the modified source. 12655 */ 12656 function insertWrapDetails(source, details) { 12657 var length = details.length; 12658 if (!length) { 12659 return source; 12660 } 12661 var lastIndex = length - 1; 12662 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; 12663 details = details.join(length > 2 ? ', ' : ' '); 12664 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); 12665 } 12666 12667 /** 12668 * Checks if `value` is a flattenable `arguments` object or array. 12669 * 12670 * @private 12671 * @param {*} value The value to check. 12672 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 12673 */ 12674 function isFlattenable(value) { 12675 return isArray(value) || isArguments(value) || 12676 !!(spreadableSymbol && value && value[spreadableSymbol]); 12677 } 12678 12679 /** 12680 * Checks if `value` is a valid array-like index. 12681 * 12682 * @private 12683 * @param {*} value The value to check. 12684 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 12685 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 12686 */ 12687 function isIndex(value, length) { 12688 var type = typeof value; 12689 length = length == null ? MAX_SAFE_INTEGER : length; 12690 12691 return !!length && 12692 (type == 'number' || 12693 (type != 'symbol' && reIsUint.test(value))) && 12694 (value > -1 && value % 1 == 0 && value < length); 12695 } 12696 12697 /** 12698 * Checks if the given arguments are from an iteratee call. 12699 * 12700 * @private 12701 * @param {*} value The potential iteratee value argument. 12702 * @param {*} index The potential iteratee index or key argument. 12703 * @param {*} object The potential iteratee object argument. 12704 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 12705 * else `false`. 12706 */ 12707 function isIterateeCall(value, index, object) { 12708 if (!isObject(object)) { 12709 return false; 12710 } 12711 var type = typeof index; 12712 if (type == 'number' 12713 ? (isArrayLike(object) && isIndex(index, object.length)) 12714 : (type == 'string' && index in object) 12715 ) { 12716 return eq(object[index], value); 12717 } 12718 return false; 12719 } 12720 12721 /** 12722 * Checks if `value` is a property name and not a property path. 12723 * 12724 * @private 12725 * @param {*} value The value to check. 12726 * @param {Object} [object] The object to query keys on. 12727 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 12728 */ 12729 function isKey(value, object) { 12730 if (isArray(value)) { 12731 return false; 12732 } 12733 var type = typeof value; 12734 if (type == 'number' || type == 'symbol' || type == 'boolean' || 12735 value == null || isSymbol(value)) { 12736 return true; 12737 } 12738 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 12739 (object != null && value in Object(object)); 12740 } 12741 12742 /** 12743 * Checks if `value` is suitable for use as unique object key. 12744 * 12745 * @private 12746 * @param {*} value The value to check. 12747 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 12748 */ 12749 function isKeyable(value) { 12750 var type = typeof value; 12751 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 12752 ? (value !== '__proto__') 12753 : (value === null); 12754 } 12755 12756 /** 12757 * Checks if `func` has a lazy counterpart. 12758 * 12759 * @private 12760 * @param {Function} func The function to check. 12761 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 12762 * else `false`. 12763 */ 12764 function isLaziable(func) { 12765 var funcName = getFuncName(func), 12766 other = lodash[funcName]; 12767 12768 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { 12769 return false; 12770 } 12771 if (func === other) { 12772 return true; 12773 } 12774 var data = getData(other); 12775 return !!data && func === data[0]; 12776 } 12777 12778 /** 12779 * Checks if `func` has its source masked. 12780 * 12781 * @private 12782 * @param {Function} func The function to check. 12783 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 12784 */ 12785 function isMasked(func) { 12786 return !!maskSrcKey && (maskSrcKey in func); 12787 } 12788 12789 /** 12790 * Checks if `func` is capable of being masked. 12791 * 12792 * @private 12793 * @param {*} value The value to check. 12794 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 12795 */ 12796 var isMaskable = coreJsData ? isFunction : stubFalse; 12797 12798 /** 12799 * Checks if `value` is likely a prototype object. 12800 * 12801 * @private 12802 * @param {*} value The value to check. 12803 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 12804 */ 12805 function isPrototype(value) { 12806 var Ctor = value && value.constructor, 12807 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 12808 12809 return value === proto; 12810 } 12811 12812 /** 12813 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 12814 * 12815 * @private 12816 * @param {*} value The value to check. 12817 * @returns {boolean} Returns `true` if `value` if suitable for strict 12818 * equality comparisons, else `false`. 12819 */ 12820 function isStrictComparable(value) { 12821 return value === value && !isObject(value); 12822 } 12823 12824 /** 12825 * A specialized version of `matchesProperty` for source values suitable 12826 * for strict equality comparisons, i.e. `===`. 12827 * 12828 * @private 12829 * @param {string} key The key of the property to get. 12830 * @param {*} srcValue The value to match. 12831 * @returns {Function} Returns the new spec function. 12832 */ 12833 function matchesStrictComparable(key, srcValue) { 12834 return function(object) { 12835 if (object == null) { 12836 return false; 12837 } 12838 return object[key] === srcValue && 12839 (srcValue !== undefined || (key in Object(object))); 12840 }; 12841 } 12842 12843 /** 12844 * A specialized version of `_.memoize` which clears the memoized function's 12845 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 12846 * 12847 * @private 12848 * @param {Function} func The function to have its output memoized. 12849 * @returns {Function} Returns the new memoized function. 12850 */ 12851 function memoizeCapped(func) { 12852 var result = memoize(func, function(key) { 12853 if (cache.size === MAX_MEMOIZE_SIZE) { 12854 cache.clear(); 12855 } 12856 return key; 12857 }); 12858 12859 var cache = result.cache; 12860 return result; 12861 } 12862 12863 /** 12864 * Merges the function metadata of `source` into `data`. 12865 * 12866 * Merging metadata reduces the number of wrappers used to invoke a function. 12867 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 12868 * may be applied regardless of execution order. Methods like `_.ary` and 12869 * `_.rearg` modify function arguments, making the order in which they are 12870 * executed important, preventing the merging of metadata. However, we make 12871 * an exception for a safe combined case where curried functions have `_.ary` 12872 * and or `_.rearg` applied. 12873 * 12874 * @private 12875 * @param {Array} data The destination metadata. 12876 * @param {Array} source The source metadata. 12877 * @returns {Array} Returns `data`. 12878 */ 12879 function mergeData(data, source) { 12880 var bitmask = data[1], 12881 srcBitmask = source[1], 12882 newBitmask = bitmask | srcBitmask, 12883 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 12884 12885 var isCombo = 12886 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || 12887 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || 12888 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); 12889 12890 // Exit early if metadata can't be merged. 12891 if (!(isCommon || isCombo)) { 12892 return data; 12893 } 12894 // Use source `thisArg` if available. 12895 if (srcBitmask & WRAP_BIND_FLAG) { 12896 data[2] = source[2]; 12897 // Set when currying a bound function. 12898 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 12899 } 12900 // Compose partial arguments. 12901 var value = source[3]; 12902 if (value) { 12903 var partials = data[3]; 12904 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 12905 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 12906 } 12907 // Compose partial right arguments. 12908 value = source[5]; 12909 if (value) { 12910 partials = data[5]; 12911 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 12912 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 12913 } 12914 // Use source `argPos` if available. 12915 value = source[7]; 12916 if (value) { 12917 data[7] = value; 12918 } 12919 // Use source `ary` if it's smaller. 12920 if (srcBitmask & WRAP_ARY_FLAG) { 12921 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 12922 } 12923 // Use source `arity` if one is not provided. 12924 if (data[9] == null) { 12925 data[9] = source[9]; 12926 } 12927 // Use source `func` and merge bitmasks. 12928 data[0] = source[0]; 12929 data[1] = newBitmask; 12930 12931 return data; 12932 } 12933 12934 /** 12935 * This function is like 12936 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 12937 * except that it includes inherited enumerable properties. 12938 * 12939 * @private 12940 * @param {Object} object The object to query. 12941 * @returns {Array} Returns the array of property names. 12942 */ 12943 function nativeKeysIn(object) { 12944 var result = []; 12945 if (object != null) { 12946 for (var key in Object(object)) { 12947 result.push(key); 12948 } 12949 } 12950 return result; 12951 } 12952 12953 /** 12954 * Converts `value` to a string using `Object.prototype.toString`. 12955 * 12956 * @private 12957 * @param {*} value The value to convert. 12958 * @returns {string} Returns the converted string. 12959 */ 12960 function objectToString(value) { 12961 return nativeObjectToString.call(value); 12962 } 12963 12964 /** 12965 * A specialized version of `baseRest` which transforms the rest array. 12966 * 12967 * @private 12968 * @param {Function} func The function to apply a rest parameter to. 12969 * @param {number} [start=func.length-1] The start position of the rest parameter. 12970 * @param {Function} transform The rest array transform. 12971 * @returns {Function} Returns the new function. 12972 */ 12973 function overRest(func, start, transform) { 12974 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 12975 return function() { 12976 var args = arguments, 12977 index = -1, 12978 length = nativeMax(args.length - start, 0), 12979 array = Array(length); 12980 12981 while (++index < length) { 12982 array[index] = args[start + index]; 12983 } 12984 index = -1; 12985 var otherArgs = Array(start + 1); 12986 while (++index < start) { 12987 otherArgs[index] = args[index]; 12988 } 12989 otherArgs[start] = transform(array); 12990 return apply(func, this, otherArgs); 12991 }; 12992 } 12993 12994 /** 12995 * Gets the parent value at `path` of `object`. 12996 * 12997 * @private 12998 * @param {Object} object The object to query. 12999 * @param {Array} path The path to get the parent value of. 13000 * @returns {*} Returns the parent value. 13001 */ 13002 function parent(object, path) { 13003 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 13004 } 13005 13006 /** 13007 * Reorder `array` according to the specified indexes where the element at 13008 * the first index is assigned as the first element, the element at 13009 * the second index is assigned as the second element, and so on. 13010 * 13011 * @private 13012 * @param {Array} array The array to reorder. 13013 * @param {Array} indexes The arranged array indexes. 13014 * @returns {Array} Returns `array`. 13015 */ 13016 function reorder(array, indexes) { 13017 var arrLength = array.length, 13018 length = nativeMin(indexes.length, arrLength), 13019 oldArray = copyArray(array); 13020 13021 while (length--) { 13022 var index = indexes[length]; 13023 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 13024 } 13025 return array; 13026 } 13027 13028 /** 13029 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 13030 * 13031 * @private 13032 * @param {Object} object The object to query. 13033 * @param {string} key The key of the property to get. 13034 * @returns {*} Returns the property value. 13035 */ 13036 function safeGet(object, key) { 13037 if (key === 'constructor' && typeof object[key] === 'function') { 13038 return; 13039 } 13040 13041 if (key == '__proto__') { 13042 return; 13043 } 13044 13045 return object[key]; 13046 } 13047 13048 /** 13049 * Sets metadata for `func`. 13050 * 13051 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 13052 * period of time, it will trip its breaker and transition to an identity 13053 * function to avoid garbage collection pauses in V8. See 13054 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 13055 * for more details. 13056 * 13057 * @private 13058 * @param {Function} func The function to associate metadata with. 13059 * @param {*} data The metadata. 13060 * @returns {Function} Returns `func`. 13061 */ 13062 var setData = shortOut(baseSetData); 13063 13064 /** 13065 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 13066 * 13067 * @private 13068 * @param {Function} func The function to delay. 13069 * @param {number} wait The number of milliseconds to delay invocation. 13070 * @returns {number|Object} Returns the timer id or timeout object. 13071 */ 13072 var setTimeout = ctxSetTimeout || function(func, wait) { 13073 return root.setTimeout(func, wait); 13074 }; 13075 13076 /** 13077 * Sets the `toString` method of `func` to return `string`. 13078 * 13079 * @private 13080 * @param {Function} func The function to modify. 13081 * @param {Function} string The `toString` result. 13082 * @returns {Function} Returns `func`. 13083 */ 13084 var setToString = shortOut(baseSetToString); 13085 13086 /** 13087 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 13088 * with wrapper details in a comment at the top of the source body. 13089 * 13090 * @private 13091 * @param {Function} wrapper The function to modify. 13092 * @param {Function} reference The reference function. 13093 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 13094 * @returns {Function} Returns `wrapper`. 13095 */ 13096 function setWrapToString(wrapper, reference, bitmask) { 13097 var source = (reference + ''); 13098 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 13099 } 13100 13101 /** 13102 * Creates a function that'll short out and invoke `identity` instead 13103 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 13104 * milliseconds. 13105 * 13106 * @private 13107 * @param {Function} func The function to restrict. 13108 * @returns {Function} Returns the new shortable function. 13109 */ 13110 function shortOut(func) { 13111 var count = 0, 13112 lastCalled = 0; 13113 13114 return function() { 13115 var stamp = nativeNow(), 13116 remaining = HOT_SPAN - (stamp - lastCalled); 13117 13118 lastCalled = stamp; 13119 if (remaining > 0) { 13120 if (++count >= HOT_COUNT) { 13121 return arguments[0]; 13122 } 13123 } else { 13124 count = 0; 13125 } 13126 return func.apply(undefined, arguments); 13127 }; 13128 } 13129 13130 /** 13131 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 13132 * 13133 * @private 13134 * @param {Array} array The array to shuffle. 13135 * @param {number} [size=array.length] The size of `array`. 13136 * @returns {Array} Returns `array`. 13137 */ 13138 function shuffleSelf(array, size) { 13139 var index = -1, 13140 length = array.length, 13141 lastIndex = length - 1; 13142 13143 size = size === undefined ? length : size; 13144 while (++index < size) { 13145 var rand = baseRandom(index, lastIndex), 13146 value = array[rand]; 13147 13148 array[rand] = array[index]; 13149 array[index] = value; 13150 } 13151 array.length = size; 13152 return array; 13153 } 13154 13155 /** 13156 * Converts `string` to a property path array. 13157 * 13158 * @private 13159 * @param {string} string The string to convert. 13160 * @returns {Array} Returns the property path array. 13161 */ 13162 var stringToPath = memoizeCapped(function(string) { 13163 var result = []; 13164 if (string.charCodeAt(0) === 46 /* . */) { 13165 result.push(''); 13166 } 13167 string.replace(rePropName, function(match, number, quote, subString) { 13168 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); 13169 }); 13170 return result; 13171 }); 13172 13173 /** 13174 * Converts `value` to a string key if it's not a string or symbol. 13175 * 13176 * @private 13177 * @param {*} value The value to inspect. 13178 * @returns {string|symbol} Returns the key. 13179 */ 13180 function toKey(value) { 13181 if (typeof value == 'string' || isSymbol(value)) { 13182 return value; 13183 } 13184 var result = (value + ''); 13185 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 13186 } 13187 13188 /** 13189 * Converts `func` to its source code. 13190 * 13191 * @private 13192 * @param {Function} func The function to convert. 13193 * @returns {string} Returns the source code. 13194 */ 13195 function toSource(func) { 13196 if (func != null) { 13197 try { 13198 return funcToString.call(func); 13199 } catch (e) {} 13200 try { 13201 return (func + ''); 13202 } catch (e) {} 13203 } 13204 return ''; 13205 } 13206 13207 /** 13208 * Updates wrapper `details` based on `bitmask` flags. 13209 * 13210 * @private 13211 * @returns {Array} details The details to modify. 13212 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 13213 * @returns {Array} Returns `details`. 13214 */ 13215 function updateWrapDetails(details, bitmask) { 13216 arrayEach(wrapFlags, function(pair) { 13217 var value = '_.' + pair[0]; 13218 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { 13219 details.push(value); 13220 } 13221 }); 13222 return details.sort(); 13223 } 13224 13225 /** 13226 * Creates a clone of `wrapper`. 13227 * 13228 * @private 13229 * @param {Object} wrapper The wrapper to clone. 13230 * @returns {Object} Returns the cloned wrapper. 13231 */ 13232 function wrapperClone(wrapper) { 13233 if (wrapper instanceof LazyWrapper) { 13234 return wrapper.clone(); 13235 } 13236 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 13237 result.__actions__ = copyArray(wrapper.__actions__); 13238 result.__index__ = wrapper.__index__; 13239 result.__values__ = wrapper.__values__; 13240 return result; 13241 } 13242 13243 /*------------------------------------------------------------------------*/ 13244 13245 /** 13246 * Creates an array of elements split into groups the length of `size`. 13247 * If `array` can't be split evenly, the final chunk will be the remaining 13248 * elements. 13249 * 13250 * @static 13251 * @memberOf _ 13252 * @since 3.0.0 13253 * @category Array 13254 * @param {Array} array The array to process. 13255 * @param {number} [size=1] The length of each chunk 13256 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 13257 * @returns {Array} Returns the new array of chunks. 13258 * @example 13259 * 13260 * _.chunk(['a', 'b', 'c', 'd'], 2); 13261 * // => [['a', 'b'], ['c', 'd']] 13262 * 13263 * _.chunk(['a', 'b', 'c', 'd'], 3); 13264 * // => [['a', 'b', 'c'], ['d']] 13265 */ 13266 function chunk(array, size, guard) { 13267 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { 13268 size = 1; 13269 } else { 13270 size = nativeMax(toInteger(size), 0); 13271 } 13272 var length = array == null ? 0 : array.length; 13273 if (!length || size < 1) { 13274 return []; 13275 } 13276 var index = 0, 13277 resIndex = 0, 13278 result = Array(nativeCeil(length / size)); 13279 13280 while (index < length) { 13281 result[resIndex++] = baseSlice(array, index, (index += size)); 13282 } 13283 return result; 13284 } 13285 13286 /** 13287 * Creates an array with all falsey values removed. The values `false`, `null`, 13288 * `0`, `""`, `undefined`, and `NaN` are falsey. 13289 * 13290 * @static 13291 * @memberOf _ 13292 * @since 0.1.0 13293 * @category Array 13294 * @param {Array} array The array to compact. 13295 * @returns {Array} Returns the new array of filtered values. 13296 * @example 13297 * 13298 * _.compact([0, 1, false, 2, '', 3]); 13299 * // => [1, 2, 3] 13300 */ 13301 function compact(array) { 13302 var index = -1, 13303 length = array == null ? 0 : array.length, 13304 resIndex = 0, 13305 result = []; 13306 13307 while (++index < length) { 13308 var value = array[index]; 13309 if (value) { 13310 result[resIndex++] = value; 13311 } 13312 } 13313 return result; 13314 } 13315 13316 /** 13317 * Creates a new array concatenating `array` with any additional arrays 13318 * and/or values. 13319 * 13320 * @static 13321 * @memberOf _ 13322 * @since 4.0.0 13323 * @category Array 13324 * @param {Array} array The array to concatenate. 13325 * @param {...*} [values] The values to concatenate. 13326 * @returns {Array} Returns the new concatenated array. 13327 * @example 13328 * 13329 * var array = [1]; 13330 * var other = _.concat(array, 2, [3], [[4]]); 13331 * 13332 * console.log(other); 13333 * // => [1, 2, 3, [4]] 13334 * 13335 * console.log(array); 13336 * // => [1] 13337 */ 13338 function concat() { 13339 var length = arguments.length; 13340 if (!length) { 13341 return []; 13342 } 13343 var args = Array(length - 1), 13344 array = arguments[0], 13345 index = length; 13346 13347 while (index--) { 13348 args[index - 1] = arguments[index]; 13349 } 13350 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 13351 } 13352 13353 /** 13354 * Creates an array of `array` values not included in the other given arrays 13355 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 13356 * for equality comparisons. The order and references of result values are 13357 * determined by the first array. 13358 * 13359 * **Note:** Unlike `_.pullAll`, this method returns a new array. 13360 * 13361 * @static 13362 * @memberOf _ 13363 * @since 0.1.0 13364 * @category Array 13365 * @param {Array} array The array to inspect. 13366 * @param {...Array} [values] The values to exclude. 13367 * @returns {Array} Returns the new array of filtered values. 13368 * @see _.without, _.xor 13369 * @example 13370 * 13371 * _.difference([2, 1], [2, 3]); 13372 * // => [1] 13373 */ 13374 var difference = baseRest(function(array, values) { 13375 return isArrayLikeObject(array) 13376 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) 13377 : []; 13378 }); 13379 13380 /** 13381 * This method is like `_.difference` except that it accepts `iteratee` which 13382 * is invoked for each element of `array` and `values` to generate the criterion 13383 * by which they're compared. The order and references of result values are 13384 * determined by the first array. The iteratee is invoked with one argument: 13385 * (value). 13386 * 13387 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 13388 * 13389 * @static 13390 * @memberOf _ 13391 * @since 4.0.0 13392 * @category Array 13393 * @param {Array} array The array to inspect. 13394 * @param {...Array} [values] The values to exclude. 13395 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 13396 * @returns {Array} Returns the new array of filtered values. 13397 * @example 13398 * 13399 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 13400 * // => [1.2] 13401 * 13402 * // The `_.property` iteratee shorthand. 13403 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 13404 * // => [{ 'x': 2 }] 13405 */ 13406 var differenceBy = baseRest(function(array, values) { 13407 var iteratee = last(values); 13408 if (isArrayLikeObject(iteratee)) { 13409 iteratee = undefined; 13410 } 13411 return isArrayLikeObject(array) 13412 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) 13413 : []; 13414 }); 13415 13416 /** 13417 * This method is like `_.difference` except that it accepts `comparator` 13418 * which is invoked to compare elements of `array` to `values`. The order and 13419 * references of result values are determined by the first array. The comparator 13420 * is invoked with two arguments: (arrVal, othVal). 13421 * 13422 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 13423 * 13424 * @static 13425 * @memberOf _ 13426 * @since 4.0.0 13427 * @category Array 13428 * @param {Array} array The array to inspect. 13429 * @param {...Array} [values] The values to exclude. 13430 * @param {Function} [comparator] The comparator invoked per element. 13431 * @returns {Array} Returns the new array of filtered values. 13432 * @example 13433 * 13434 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 13435 * 13436 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 13437 * // => [{ 'x': 2, 'y': 1 }] 13438 */ 13439 var differenceWith = baseRest(function(array, values) { 13440 var comparator = last(values); 13441 if (isArrayLikeObject(comparator)) { 13442 comparator = undefined; 13443 } 13444 return isArrayLikeObject(array) 13445 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) 13446 : []; 13447 }); 13448 13449 /** 13450 * Creates a slice of `array` with `n` elements dropped from the beginning. 13451 * 13452 * @static 13453 * @memberOf _ 13454 * @since 0.5.0 13455 * @category Array 13456 * @param {Array} array The array to query. 13457 * @param {number} [n=1] The number of elements to drop. 13458 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 13459 * @returns {Array} Returns the slice of `array`. 13460 * @example 13461 * 13462 * _.drop([1, 2, 3]); 13463 * // => [2, 3] 13464 * 13465 * _.drop([1, 2, 3], 2); 13466 * // => [3] 13467 * 13468 * _.drop([1, 2, 3], 5); 13469 * // => [] 13470 * 13471 * _.drop([1, 2, 3], 0); 13472 * // => [1, 2, 3] 13473 */ 13474 function drop(array, n, guard) { 13475 var length = array == null ? 0 : array.length; 13476 if (!length) { 13477 return []; 13478 } 13479 n = (guard || n === undefined) ? 1 : toInteger(n); 13480 return baseSlice(array, n < 0 ? 0 : n, length); 13481 } 13482 13483 /** 13484 * Creates a slice of `array` with `n` elements dropped from the end. 13485 * 13486 * @static 13487 * @memberOf _ 13488 * @since 3.0.0 13489 * @category Array 13490 * @param {Array} array The array to query. 13491 * @param {number} [n=1] The number of elements to drop. 13492 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 13493 * @returns {Array} Returns the slice of `array`. 13494 * @example 13495 * 13496 * _.dropRight([1, 2, 3]); 13497 * // => [1, 2] 13498 * 13499 * _.dropRight([1, 2, 3], 2); 13500 * // => [1] 13501 * 13502 * _.dropRight([1, 2, 3], 5); 13503 * // => [] 13504 * 13505 * _.dropRight([1, 2, 3], 0); 13506 * // => [1, 2, 3] 13507 */ 13508 function dropRight(array, n, guard) { 13509 var length = array == null ? 0 : array.length; 13510 if (!length) { 13511 return []; 13512 } 13513 n = (guard || n === undefined) ? 1 : toInteger(n); 13514 n = length - n; 13515 return baseSlice(array, 0, n < 0 ? 0 : n); 13516 } 13517 13518 /** 13519 * Creates a slice of `array` excluding elements dropped from the end. 13520 * Elements are dropped until `predicate` returns falsey. The predicate is 13521 * invoked with three arguments: (value, index, array). 13522 * 13523 * @static 13524 * @memberOf _ 13525 * @since 3.0.0 13526 * @category Array 13527 * @param {Array} array The array to query. 13528 * @param {Function} [predicate=_.identity] The function invoked per iteration. 13529 * @returns {Array} Returns the slice of `array`. 13530 * @example 13531 * 13532 * var users = [ 13533 * { 'user': 'barney', 'active': true }, 13534 * { 'user': 'fred', 'active': false }, 13535 * { 'user': 'pebbles', 'active': false } 13536 * ]; 13537 * 13538 * _.dropRightWhile(users, function(o) { return !o.active; }); 13539 * // => objects for ['barney'] 13540 * 13541 * // The `_.matches` iteratee shorthand. 13542 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 13543 * // => objects for ['barney', 'fred'] 13544 * 13545 * // The `_.matchesProperty` iteratee shorthand. 13546 * _.dropRightWhile(users, ['active', false]); 13547 * // => objects for ['barney'] 13548 * 13549 * // The `_.property` iteratee shorthand. 13550 * _.dropRightWhile(users, 'active'); 13551 * // => objects for ['barney', 'fred', 'pebbles'] 13552 */ 13553 function dropRightWhile(array, predicate) { 13554 return (array && array.length) 13555 ? baseWhile(array, getIteratee(predicate, 3), true, true) 13556 : []; 13557 } 13558 13559 /** 13560 * Creates a slice of `array` excluding elements dropped from the beginning. 13561 * Elements are dropped until `predicate` returns falsey. The predicate is 13562 * invoked with three arguments: (value, index, array). 13563 * 13564 * @static 13565 * @memberOf _ 13566 * @since 3.0.0 13567 * @category Array 13568 * @param {Array} array The array to query. 13569 * @param {Function} [predicate=_.identity] The function invoked per iteration. 13570 * @returns {Array} Returns the slice of `array`. 13571 * @example 13572 * 13573 * var users = [ 13574 * { 'user': 'barney', 'active': false }, 13575 * { 'user': 'fred', 'active': false }, 13576 * { 'user': 'pebbles', 'active': true } 13577 * ]; 13578 * 13579 * _.dropWhile(users, function(o) { return !o.active; }); 13580 * // => objects for ['pebbles'] 13581 * 13582 * // The `_.matches` iteratee shorthand. 13583 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 13584 * // => objects for ['fred', 'pebbles'] 13585 * 13586 * // The `_.matchesProperty` iteratee shorthand. 13587 * _.dropWhile(users, ['active', false]); 13588 * // => objects for ['pebbles'] 13589 * 13590 * // The `_.property` iteratee shorthand. 13591 * _.dropWhile(users, 'active'); 13592 * // => objects for ['barney', 'fred', 'pebbles'] 13593 */ 13594 function dropWhile(array, predicate) { 13595 return (array && array.length) 13596 ? baseWhile(array, getIteratee(predicate, 3), true) 13597 : []; 13598 } 13599 13600 /** 13601 * Fills elements of `array` with `value` from `start` up to, but not 13602 * including, `end`. 13603 * 13604 * **Note:** This method mutates `array`. 13605 * 13606 * @static 13607 * @memberOf _ 13608 * @since 3.2.0 13609 * @category Array 13610 * @param {Array} array The array to fill. 13611 * @param {*} value The value to fill `array` with. 13612 * @param {number} [start=0] The start position. 13613 * @param {number} [end=array.length] The end position. 13614 * @returns {Array} Returns `array`. 13615 * @example 13616 * 13617 * var array = [1, 2, 3]; 13618 * 13619 * _.fill(array, 'a'); 13620 * console.log(array); 13621 * // => ['a', 'a', 'a'] 13622 * 13623 * _.fill(Array(3), 2); 13624 * // => [2, 2, 2] 13625 * 13626 * _.fill([4, 6, 8, 10], '*', 1, 3); 13627 * // => [4, '*', '*', 10] 13628 */ 13629 function fill(array, value, start, end) { 13630 var length = array == null ? 0 : array.length; 13631 if (!length) { 13632 return []; 13633 } 13634 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { 13635 start = 0; 13636 end = length; 13637 } 13638 return baseFill(array, value, start, end); 13639 } 13640 13641 /** 13642 * This method is like `_.find` except that it returns the index of the first 13643 * element `predicate` returns truthy for instead of the element itself. 13644 * 13645 * @static 13646 * @memberOf _ 13647 * @since 1.1.0 13648 * @category Array 13649 * @param {Array} array The array to inspect. 13650 * @param {Function} [predicate=_.identity] The function invoked per iteration. 13651 * @param {number} [fromIndex=0] The index to search from. 13652 * @returns {number} Returns the index of the found element, else `-1`. 13653 * @example 13654 * 13655 * var users = [ 13656 * { 'user': 'barney', 'active': false }, 13657 * { 'user': 'fred', 'active': false }, 13658 * { 'user': 'pebbles', 'active': true } 13659 * ]; 13660 * 13661 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 13662 * // => 0 13663 * 13664 * // The `_.matches` iteratee shorthand. 13665 * _.findIndex(users, { 'user': 'fred', 'active': false }); 13666 * // => 1 13667 * 13668 * // The `_.matchesProperty` iteratee shorthand. 13669 * _.findIndex(users, ['active', false]); 13670 * // => 0 13671 * 13672 * // The `_.property` iteratee shorthand. 13673 * _.findIndex(users, 'active'); 13674 * // => 2 13675 */ 13676 function findIndex(array, predicate, fromIndex) { 13677 var length = array == null ? 0 : array.length; 13678 if (!length) { 13679 return -1; 13680 } 13681 var index = fromIndex == null ? 0 : toInteger(fromIndex); 13682 if (index < 0) { 13683 index = nativeMax(length + index, 0); 13684 } 13685 return baseFindIndex(array, getIteratee(predicate, 3), index); 13686 } 13687 13688 /** 13689 * This method is like `_.findIndex` except that it iterates over elements 13690 * of `collection` from right to left. 13691 * 13692 * @static 13693 * @memberOf _ 13694 * @since 2.0.0 13695 * @category Array 13696 * @param {Array} array The array to inspect. 13697 * @param {Function} [predicate=_.identity] The function invoked per iteration. 13698 * @param {number} [fromIndex=array.length-1] The index to search from. 13699 * @returns {number} Returns the index of the found element, else `-1`. 13700 * @example 13701 * 13702 * var users = [ 13703 * { 'user': 'barney', 'active': true }, 13704 * { 'user': 'fred', 'active': false }, 13705 * { 'user': 'pebbles', 'active': false } 13706 * ]; 13707 * 13708 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 13709 * // => 2 13710 * 13711 * // The `_.matches` iteratee shorthand. 13712 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 13713 * // => 0 13714 * 13715 * // The `_.matchesProperty` iteratee shorthand. 13716 * _.findLastIndex(users, ['active', false]); 13717 * // => 2 13718 * 13719 * // The `_.property` iteratee shorthand. 13720 * _.findLastIndex(users, 'active'); 13721 * // => 0 13722 */ 13723 function findLastIndex(array, predicate, fromIndex) { 13724 var length = array == null ? 0 : array.length; 13725 if (!length) { 13726 return -1; 13727 } 13728 var index = length - 1; 13729 if (fromIndex !== undefined) { 13730 index = toInteger(fromIndex); 13731 index = fromIndex < 0 13732 ? nativeMax(length + index, 0) 13733 : nativeMin(index, length - 1); 13734 } 13735 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 13736 } 13737 13738 /** 13739 * Flattens `array` a single level deep. 13740 * 13741 * @static 13742 * @memberOf _ 13743 * @since 0.1.0 13744 * @category Array 13745 * @param {Array} array The array to flatten. 13746 * @returns {Array} Returns the new flattened array. 13747 * @example 13748 * 13749 * _.flatten([1, [2, [3, [4]], 5]]); 13750 * // => [1, 2, [3, [4]], 5] 13751 */ 13752 function flatten(array) { 13753 var length = array == null ? 0 : array.length; 13754 return length ? baseFlatten(array, 1) : []; 13755 } 13756 13757 /** 13758 * Recursively flattens `array`. 13759 * 13760 * @static 13761 * @memberOf _ 13762 * @since 3.0.0 13763 * @category Array 13764 * @param {Array} array The array to flatten. 13765 * @returns {Array} Returns the new flattened array. 13766 * @example 13767 * 13768 * _.flattenDeep([1, [2, [3, [4]], 5]]); 13769 * // => [1, 2, 3, 4, 5] 13770 */ 13771 function flattenDeep(array) { 13772 var length = array == null ? 0 : array.length; 13773 return length ? baseFlatten(array, INFINITY) : []; 13774 } 13775 13776 /** 13777 * Recursively flatten `array` up to `depth` times. 13778 * 13779 * @static 13780 * @memberOf _ 13781 * @since 4.4.0 13782 * @category Array 13783 * @param {Array} array The array to flatten. 13784 * @param {number} [depth=1] The maximum recursion depth. 13785 * @returns {Array} Returns the new flattened array. 13786 * @example 13787 * 13788 * var array = [1, [2, [3, [4]], 5]]; 13789 * 13790 * _.flattenDepth(array, 1); 13791 * // => [1, 2, [3, [4]], 5] 13792 * 13793 * _.flattenDepth(array, 2); 13794 * // => [1, 2, 3, [4], 5] 13795 */ 13796 function flattenDepth(array, depth) { 13797 var length = array == null ? 0 : array.length; 13798 if (!length) { 13799 return []; 13800 } 13801 depth = depth === undefined ? 1 : toInteger(depth); 13802 return baseFlatten(array, depth); 13803 } 13804 13805 /** 13806 * The inverse of `_.toPairs`; this method returns an object composed 13807 * from key-value `pairs`. 13808 * 13809 * @static 13810 * @memberOf _ 13811 * @since 4.0.0 13812 * @category Array 13813 * @param {Array} pairs The key-value pairs. 13814 * @returns {Object} Returns the new object. 13815 * @example 13816 * 13817 * _.fromPairs([['a', 1], ['b', 2]]); 13818 * // => { 'a': 1, 'b': 2 } 13819 */ 13820 function fromPairs(pairs) { 13821 var index = -1, 13822 length = pairs == null ? 0 : pairs.length, 13823 result = {}; 13824 13825 while (++index < length) { 13826 var pair = pairs[index]; 13827 result[pair[0]] = pair[1]; 13828 } 13829 return result; 13830 } 13831 13832 /** 13833 * Gets the first element of `array`. 13834 * 13835 * @static 13836 * @memberOf _ 13837 * @since 0.1.0 13838 * @alias first 13839 * @category Array 13840 * @param {Array} array The array to query. 13841 * @returns {*} Returns the first element of `array`. 13842 * @example 13843 * 13844 * _.head([1, 2, 3]); 13845 * // => 1 13846 * 13847 * _.head([]); 13848 * // => undefined 13849 */ 13850 function head(array) { 13851 return (array && array.length) ? array[0] : undefined; 13852 } 13853 13854 /** 13855 * Gets the index at which the first occurrence of `value` is found in `array` 13856 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 13857 * for equality comparisons. If `fromIndex` is negative, it's used as the 13858 * offset from the end of `array`. 13859 * 13860 * @static 13861 * @memberOf _ 13862 * @since 0.1.0 13863 * @category Array 13864 * @param {Array} array The array to inspect. 13865 * @param {*} value The value to search for. 13866 * @param {number} [fromIndex=0] The index to search from. 13867 * @returns {number} Returns the index of the matched value, else `-1`. 13868 * @example 13869 * 13870 * _.indexOf([1, 2, 1, 2], 2); 13871 * // => 1 13872 * 13873 * // Search from the `fromIndex`. 13874 * _.indexOf([1, 2, 1, 2], 2, 2); 13875 * // => 3 13876 */ 13877 function indexOf(array, value, fromIndex) { 13878 var length = array == null ? 0 : array.length; 13879 if (!length) { 13880 return -1; 13881 } 13882 var index = fromIndex == null ? 0 : toInteger(fromIndex); 13883 if (index < 0) { 13884 index = nativeMax(length + index, 0); 13885 } 13886 return baseIndexOf(array, value, index); 13887 } 13888 13889 /** 13890 * Gets all but the last element of `array`. 13891 * 13892 * @static 13893 * @memberOf _ 13894 * @since 0.1.0 13895 * @category Array 13896 * @param {Array} array The array to query. 13897 * @returns {Array} Returns the slice of `array`. 13898 * @example 13899 * 13900 * _.initial([1, 2, 3]); 13901 * // => [1, 2] 13902 */ 13903 function initial(array) { 13904 var length = array == null ? 0 : array.length; 13905 return length ? baseSlice(array, 0, -1) : []; 13906 } 13907 13908 /** 13909 * Creates an array of unique values that are included in all given arrays 13910 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 13911 * for equality comparisons. The order and references of result values are 13912 * determined by the first array. 13913 * 13914 * @static 13915 * @memberOf _ 13916 * @since 0.1.0 13917 * @category Array 13918 * @param {...Array} [arrays] The arrays to inspect. 13919 * @returns {Array} Returns the new array of intersecting values. 13920 * @example 13921 * 13922 * _.intersection([2, 1], [2, 3]); 13923 * // => [2] 13924 */ 13925 var intersection = baseRest(function(arrays) { 13926 var mapped = arrayMap(arrays, castArrayLikeObject); 13927 return (mapped.length && mapped[0] === arrays[0]) 13928 ? baseIntersection(mapped) 13929 : []; 13930 }); 13931 13932 /** 13933 * This method is like `_.intersection` except that it accepts `iteratee` 13934 * which is invoked for each element of each `arrays` to generate the criterion 13935 * by which they're compared. The order and references of result values are 13936 * determined by the first array. The iteratee is invoked with one argument: 13937 * (value). 13938 * 13939 * @static 13940 * @memberOf _ 13941 * @since 4.0.0 13942 * @category Array 13943 * @param {...Array} [arrays] The arrays to inspect. 13944 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 13945 * @returns {Array} Returns the new array of intersecting values. 13946 * @example 13947 * 13948 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 13949 * // => [2.1] 13950 * 13951 * // The `_.property` iteratee shorthand. 13952 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 13953 * // => [{ 'x': 1 }] 13954 */ 13955 var intersectionBy = baseRest(function(arrays) { 13956 var iteratee = last(arrays), 13957 mapped = arrayMap(arrays, castArrayLikeObject); 13958 13959 if (iteratee === last(mapped)) { 13960 iteratee = undefined; 13961 } else { 13962 mapped.pop(); 13963 } 13964 return (mapped.length && mapped[0] === arrays[0]) 13965 ? baseIntersection(mapped, getIteratee(iteratee, 2)) 13966 : []; 13967 }); 13968 13969 /** 13970 * This method is like `_.intersection` except that it accepts `comparator` 13971 * which is invoked to compare elements of `arrays`. The order and references 13972 * of result values are determined by the first array. The comparator is 13973 * invoked with two arguments: (arrVal, othVal). 13974 * 13975 * @static 13976 * @memberOf _ 13977 * @since 4.0.0 13978 * @category Array 13979 * @param {...Array} [arrays] The arrays to inspect. 13980 * @param {Function} [comparator] The comparator invoked per element. 13981 * @returns {Array} Returns the new array of intersecting values. 13982 * @example 13983 * 13984 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 13985 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 13986 * 13987 * _.intersectionWith(objects, others, _.isEqual); 13988 * // => [{ 'x': 1, 'y': 2 }] 13989 */ 13990 var intersectionWith = baseRest(function(arrays) { 13991 var comparator = last(arrays), 13992 mapped = arrayMap(arrays, castArrayLikeObject); 13993 13994 comparator = typeof comparator == 'function' ? comparator : undefined; 13995 if (comparator) { 13996 mapped.pop(); 13997 } 13998 return (mapped.length && mapped[0] === arrays[0]) 13999 ? baseIntersection(mapped, undefined, comparator) 14000 : []; 14001 }); 14002 14003 /** 14004 * Converts all elements in `array` into a string separated by `separator`. 14005 * 14006 * @static 14007 * @memberOf _ 14008 * @since 4.0.0 14009 * @category Array 14010 * @param {Array} array The array to convert. 14011 * @param {string} [separator=','] The element separator. 14012 * @returns {string} Returns the joined string. 14013 * @example 14014 * 14015 * _.join(['a', 'b', 'c'], '~'); 14016 * // => 'a~b~c' 14017 */ 14018 function join(array, separator) { 14019 return array == null ? '' : nativeJoin.call(array, separator); 14020 } 14021 14022 /** 14023 * Gets the last element of `array`. 14024 * 14025 * @static 14026 * @memberOf _ 14027 * @since 0.1.0 14028 * @category Array 14029 * @param {Array} array The array to query. 14030 * @returns {*} Returns the last element of `array`. 14031 * @example 14032 * 14033 * _.last([1, 2, 3]); 14034 * // => 3 14035 */ 14036 function last(array) { 14037 var length = array == null ? 0 : array.length; 14038 return length ? array[length - 1] : undefined; 14039 } 14040 14041 /** 14042 * This method is like `_.indexOf` except that it iterates over elements of 14043 * `array` from right to left. 14044 * 14045 * @static 14046 * @memberOf _ 14047 * @since 0.1.0 14048 * @category Array 14049 * @param {Array} array The array to inspect. 14050 * @param {*} value The value to search for. 14051 * @param {number} [fromIndex=array.length-1] The index to search from. 14052 * @returns {number} Returns the index of the matched value, else `-1`. 14053 * @example 14054 * 14055 * _.lastIndexOf([1, 2, 1, 2], 2); 14056 * // => 3 14057 * 14058 * // Search from the `fromIndex`. 14059 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 14060 * // => 1 14061 */ 14062 function lastIndexOf(array, value, fromIndex) { 14063 var length = array == null ? 0 : array.length; 14064 if (!length) { 14065 return -1; 14066 } 14067 var index = length; 14068 if (fromIndex !== undefined) { 14069 index = toInteger(fromIndex); 14070 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 14071 } 14072 return value === value 14073 ? strictLastIndexOf(array, value, index) 14074 : baseFindIndex(array, baseIsNaN, index, true); 14075 } 14076 14077 /** 14078 * Gets the element at index `n` of `array`. If `n` is negative, the nth 14079 * element from the end is returned. 14080 * 14081 * @static 14082 * @memberOf _ 14083 * @since 4.11.0 14084 * @category Array 14085 * @param {Array} array The array to query. 14086 * @param {number} [n=0] The index of the element to return. 14087 * @returns {*} Returns the nth element of `array`. 14088 * @example 14089 * 14090 * var array = ['a', 'b', 'c', 'd']; 14091 * 14092 * _.nth(array, 1); 14093 * // => 'b' 14094 * 14095 * _.nth(array, -2); 14096 * // => 'c'; 14097 */ 14098 function nth(array, n) { 14099 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; 14100 } 14101 14102 /** 14103 * Removes all given values from `array` using 14104 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 14105 * for equality comparisons. 14106 * 14107 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 14108 * to remove elements from an array by predicate. 14109 * 14110 * @static 14111 * @memberOf _ 14112 * @since 2.0.0 14113 * @category Array 14114 * @param {Array} array The array to modify. 14115 * @param {...*} [values] The values to remove. 14116 * @returns {Array} Returns `array`. 14117 * @example 14118 * 14119 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 14120 * 14121 * _.pull(array, 'a', 'c'); 14122 * console.log(array); 14123 * // => ['b', 'b'] 14124 */ 14125 var pull = baseRest(pullAll); 14126 14127 /** 14128 * This method is like `_.pull` except that it accepts an array of values to remove. 14129 * 14130 * **Note:** Unlike `_.difference`, this method mutates `array`. 14131 * 14132 * @static 14133 * @memberOf _ 14134 * @since 4.0.0 14135 * @category Array 14136 * @param {Array} array The array to modify. 14137 * @param {Array} values The values to remove. 14138 * @returns {Array} Returns `array`. 14139 * @example 14140 * 14141 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 14142 * 14143 * _.pullAll(array, ['a', 'c']); 14144 * console.log(array); 14145 * // => ['b', 'b'] 14146 */ 14147 function pullAll(array, values) { 14148 return (array && array.length && values && values.length) 14149 ? basePullAll(array, values) 14150 : array; 14151 } 14152 14153 /** 14154 * This method is like `_.pullAll` except that it accepts `iteratee` which is 14155 * invoked for each element of `array` and `values` to generate the criterion 14156 * by which they're compared. The iteratee is invoked with one argument: (value). 14157 * 14158 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 14159 * 14160 * @static 14161 * @memberOf _ 14162 * @since 4.0.0 14163 * @category Array 14164 * @param {Array} array The array to modify. 14165 * @param {Array} values The values to remove. 14166 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 14167 * @returns {Array} Returns `array`. 14168 * @example 14169 * 14170 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 14171 * 14172 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 14173 * console.log(array); 14174 * // => [{ 'x': 2 }] 14175 */ 14176 function pullAllBy(array, values, iteratee) { 14177 return (array && array.length && values && values.length) 14178 ? basePullAll(array, values, getIteratee(iteratee, 2)) 14179 : array; 14180 } 14181 14182 /** 14183 * This method is like `_.pullAll` except that it accepts `comparator` which 14184 * is invoked to compare elements of `array` to `values`. The comparator is 14185 * invoked with two arguments: (arrVal, othVal). 14186 * 14187 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 14188 * 14189 * @static 14190 * @memberOf _ 14191 * @since 4.6.0 14192 * @category Array 14193 * @param {Array} array The array to modify. 14194 * @param {Array} values The values to remove. 14195 * @param {Function} [comparator] The comparator invoked per element. 14196 * @returns {Array} Returns `array`. 14197 * @example 14198 * 14199 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 14200 * 14201 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 14202 * console.log(array); 14203 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 14204 */ 14205 function pullAllWith(array, values, comparator) { 14206 return (array && array.length && values && values.length) 14207 ? basePullAll(array, values, undefined, comparator) 14208 : array; 14209 } 14210 14211 /** 14212 * Removes elements from `array` corresponding to `indexes` and returns an 14213 * array of removed elements. 14214 * 14215 * **Note:** Unlike `_.at`, this method mutates `array`. 14216 * 14217 * @static 14218 * @memberOf _ 14219 * @since 3.0.0 14220 * @category Array 14221 * @param {Array} array The array to modify. 14222 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 14223 * @returns {Array} Returns the new array of removed elements. 14224 * @example 14225 * 14226 * var array = ['a', 'b', 'c', 'd']; 14227 * var pulled = _.pullAt(array, [1, 3]); 14228 * 14229 * console.log(array); 14230 * // => ['a', 'c'] 14231 * 14232 * console.log(pulled); 14233 * // => ['b', 'd'] 14234 */ 14235 var pullAt = flatRest(function(array, indexes) { 14236 var length = array == null ? 0 : array.length, 14237 result = baseAt(array, indexes); 14238 14239 basePullAt(array, arrayMap(indexes, function(index) { 14240 return isIndex(index, length) ? +index : index; 14241 }).sort(compareAscending)); 14242 14243 return result; 14244 }); 14245 14246 /** 14247 * Removes all elements from `array` that `predicate` returns truthy for 14248 * and returns an array of the removed elements. The predicate is invoked 14249 * with three arguments: (value, index, array). 14250 * 14251 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 14252 * to pull elements from an array by value. 14253 * 14254 * @static 14255 * @memberOf _ 14256 * @since 2.0.0 14257 * @category Array 14258 * @param {Array} array The array to modify. 14259 * @param {Function} [predicate=_.identity] The function invoked per iteration. 14260 * @returns {Array} Returns the new array of removed elements. 14261 * @example 14262 * 14263 * var array = [1, 2, 3, 4]; 14264 * var evens = _.remove(array, function(n) { 14265 * return n % 2 == 0; 14266 * }); 14267 * 14268 * console.log(array); 14269 * // => [1, 3] 14270 * 14271 * console.log(evens); 14272 * // => [2, 4] 14273 */ 14274 function remove(array, predicate) { 14275 var result = []; 14276 if (!(array && array.length)) { 14277 return result; 14278 } 14279 var index = -1, 14280 indexes = [], 14281 length = array.length; 14282 14283 predicate = getIteratee(predicate, 3); 14284 while (++index < length) { 14285 var value = array[index]; 14286 if (predicate(value, index, array)) { 14287 result.push(value); 14288 indexes.push(index); 14289 } 14290 } 14291 basePullAt(array, indexes); 14292 return result; 14293 } 14294 14295 /** 14296 * Reverses `array` so that the first element becomes the last, the second 14297 * element becomes the second to last, and so on. 14298 * 14299 * **Note:** This method mutates `array` and is based on 14300 * [`Array#reverse`](https://mdn.io/Array/reverse). 14301 * 14302 * @static 14303 * @memberOf _ 14304 * @since 4.0.0 14305 * @category Array 14306 * @param {Array} array The array to modify. 14307 * @returns {Array} Returns `array`. 14308 * @example 14309 * 14310 * var array = [1, 2, 3]; 14311 * 14312 * _.reverse(array); 14313 * // => [3, 2, 1] 14314 * 14315 * console.log(array); 14316 * // => [3, 2, 1] 14317 */ 14318 function reverse(array) { 14319 return array == null ? array : nativeReverse.call(array); 14320 } 14321 14322 /** 14323 * Creates a slice of `array` from `start` up to, but not including, `end`. 14324 * 14325 * **Note:** This method is used instead of 14326 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 14327 * returned. 14328 * 14329 * @static 14330 * @memberOf _ 14331 * @since 3.0.0 14332 * @category Array 14333 * @param {Array} array The array to slice. 14334 * @param {number} [start=0] The start position. 14335 * @param {number} [end=array.length] The end position. 14336 * @returns {Array} Returns the slice of `array`. 14337 */ 14338 function slice(array, start, end) { 14339 var length = array == null ? 0 : array.length; 14340 if (!length) { 14341 return []; 14342 } 14343 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 14344 start = 0; 14345 end = length; 14346 } 14347 else { 14348 start = start == null ? 0 : toInteger(start); 14349 end = end === undefined ? length : toInteger(end); 14350 } 14351 return baseSlice(array, start, end); 14352 } 14353 14354 /** 14355 * Uses a binary search to determine the lowest index at which `value` 14356 * should be inserted into `array` in order to maintain its sort order. 14357 * 14358 * @static 14359 * @memberOf _ 14360 * @since 0.1.0 14361 * @category Array 14362 * @param {Array} array The sorted array to inspect. 14363 * @param {*} value The value to evaluate. 14364 * @returns {number} Returns the index at which `value` should be inserted 14365 * into `array`. 14366 * @example 14367 * 14368 * _.sortedIndex([30, 50], 40); 14369 * // => 1 14370 */ 14371 function sortedIndex(array, value) { 14372 return baseSortedIndex(array, value); 14373 } 14374 14375 /** 14376 * This method is like `_.sortedIndex` except that it accepts `iteratee` 14377 * which is invoked for `value` and each element of `array` to compute their 14378 * sort ranking. The iteratee is invoked with one argument: (value). 14379 * 14380 * @static 14381 * @memberOf _ 14382 * @since 4.0.0 14383 * @category Array 14384 * @param {Array} array The sorted array to inspect. 14385 * @param {*} value The value to evaluate. 14386 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 14387 * @returns {number} Returns the index at which `value` should be inserted 14388 * into `array`. 14389 * @example 14390 * 14391 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 14392 * 14393 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 14394 * // => 0 14395 * 14396 * // The `_.property` iteratee shorthand. 14397 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 14398 * // => 0 14399 */ 14400 function sortedIndexBy(array, value, iteratee) { 14401 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); 14402 } 14403 14404 /** 14405 * This method is like `_.indexOf` except that it performs a binary 14406 * search on a sorted `array`. 14407 * 14408 * @static 14409 * @memberOf _ 14410 * @since 4.0.0 14411 * @category Array 14412 * @param {Array} array The array to inspect. 14413 * @param {*} value The value to search for. 14414 * @returns {number} Returns the index of the matched value, else `-1`. 14415 * @example 14416 * 14417 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 14418 * // => 1 14419 */ 14420 function sortedIndexOf(array, value) { 14421 var length = array == null ? 0 : array.length; 14422 if (length) { 14423 var index = baseSortedIndex(array, value); 14424 if (index < length && eq(array[index], value)) { 14425 return index; 14426 } 14427 } 14428 return -1; 14429 } 14430 14431 /** 14432 * This method is like `_.sortedIndex` except that it returns the highest 14433 * index at which `value` should be inserted into `array` in order to 14434 * maintain its sort order. 14435 * 14436 * @static 14437 * @memberOf _ 14438 * @since 3.0.0 14439 * @category Array 14440 * @param {Array} array The sorted array to inspect. 14441 * @param {*} value The value to evaluate. 14442 * @returns {number} Returns the index at which `value` should be inserted 14443 * into `array`. 14444 * @example 14445 * 14446 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 14447 * // => 4 14448 */ 14449 function sortedLastIndex(array, value) { 14450 return baseSortedIndex(array, value, true); 14451 } 14452 14453 /** 14454 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 14455 * which is invoked for `value` and each element of `array` to compute their 14456 * sort ranking. The iteratee is invoked with one argument: (value). 14457 * 14458 * @static 14459 * @memberOf _ 14460 * @since 4.0.0 14461 * @category Array 14462 * @param {Array} array The sorted array to inspect. 14463 * @param {*} value The value to evaluate. 14464 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 14465 * @returns {number} Returns the index at which `value` should be inserted 14466 * into `array`. 14467 * @example 14468 * 14469 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 14470 * 14471 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 14472 * // => 1 14473 * 14474 * // The `_.property` iteratee shorthand. 14475 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 14476 * // => 1 14477 */ 14478 function sortedLastIndexBy(array, value, iteratee) { 14479 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); 14480 } 14481 14482 /** 14483 * This method is like `_.lastIndexOf` except that it performs a binary 14484 * search on a sorted `array`. 14485 * 14486 * @static 14487 * @memberOf _ 14488 * @since 4.0.0 14489 * @category Array 14490 * @param {Array} array The array to inspect. 14491 * @param {*} value The value to search for. 14492 * @returns {number} Returns the index of the matched value, else `-1`. 14493 * @example 14494 * 14495 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 14496 * // => 3 14497 */ 14498 function sortedLastIndexOf(array, value) { 14499 var length = array == null ? 0 : array.length; 14500 if (length) { 14501 var index = baseSortedIndex(array, value, true) - 1; 14502 if (eq(array[index], value)) { 14503 return index; 14504 } 14505 } 14506 return -1; 14507 } 14508 14509 /** 14510 * This method is like `_.uniq` except that it's designed and optimized 14511 * for sorted arrays. 14512 * 14513 * @static 14514 * @memberOf _ 14515 * @since 4.0.0 14516 * @category Array 14517 * @param {Array} array The array to inspect. 14518 * @returns {Array} Returns the new duplicate free array. 14519 * @example 14520 * 14521 * _.sortedUniq([1, 1, 2]); 14522 * // => [1, 2] 14523 */ 14524 function sortedUniq(array) { 14525 return (array && array.length) 14526 ? baseSortedUniq(array) 14527 : []; 14528 } 14529 14530 /** 14531 * This method is like `_.uniqBy` except that it's designed and optimized 14532 * for sorted arrays. 14533 * 14534 * @static 14535 * @memberOf _ 14536 * @since 4.0.0 14537 * @category Array 14538 * @param {Array} array The array to inspect. 14539 * @param {Function} [iteratee] The iteratee invoked per element. 14540 * @returns {Array} Returns the new duplicate free array. 14541 * @example 14542 * 14543 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 14544 * // => [1.1, 2.3] 14545 */ 14546 function sortedUniqBy(array, iteratee) { 14547 return (array && array.length) 14548 ? baseSortedUniq(array, getIteratee(iteratee, 2)) 14549 : []; 14550 } 14551 14552 /** 14553 * Gets all but the first element of `array`. 14554 * 14555 * @static 14556 * @memberOf _ 14557 * @since 4.0.0 14558 * @category Array 14559 * @param {Array} array The array to query. 14560 * @returns {Array} Returns the slice of `array`. 14561 * @example 14562 * 14563 * _.tail([1, 2, 3]); 14564 * // => [2, 3] 14565 */ 14566 function tail(array) { 14567 var length = array == null ? 0 : array.length; 14568 return length ? baseSlice(array, 1, length) : []; 14569 } 14570 14571 /** 14572 * Creates a slice of `array` with `n` elements taken from the beginning. 14573 * 14574 * @static 14575 * @memberOf _ 14576 * @since 0.1.0 14577 * @category Array 14578 * @param {Array} array The array to query. 14579 * @param {number} [n=1] The number of elements to take. 14580 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 14581 * @returns {Array} Returns the slice of `array`. 14582 * @example 14583 * 14584 * _.take([1, 2, 3]); 14585 * // => [1] 14586 * 14587 * _.take([1, 2, 3], 2); 14588 * // => [1, 2] 14589 * 14590 * _.take([1, 2, 3], 5); 14591 * // => [1, 2, 3] 14592 * 14593 * _.take([1, 2, 3], 0); 14594 * // => [] 14595 */ 14596 function take(array, n, guard) { 14597 if (!(array && array.length)) { 14598 return []; 14599 } 14600 n = (guard || n === undefined) ? 1 : toInteger(n); 14601 return baseSlice(array, 0, n < 0 ? 0 : n); 14602 } 14603 14604 /** 14605 * Creates a slice of `array` with `n` elements taken from the end. 14606 * 14607 * @static 14608 * @memberOf _ 14609 * @since 3.0.0 14610 * @category Array 14611 * @param {Array} array The array to query. 14612 * @param {number} [n=1] The number of elements to take. 14613 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 14614 * @returns {Array} Returns the slice of `array`. 14615 * @example 14616 * 14617 * _.takeRight([1, 2, 3]); 14618 * // => [3] 14619 * 14620 * _.takeRight([1, 2, 3], 2); 14621 * // => [2, 3] 14622 * 14623 * _.takeRight([1, 2, 3], 5); 14624 * // => [1, 2, 3] 14625 * 14626 * _.takeRight([1, 2, 3], 0); 14627 * // => [] 14628 */ 14629 function takeRight(array, n, guard) { 14630 var length = array == null ? 0 : array.length; 14631 if (!length) { 14632 return []; 14633 } 14634 n = (guard || n === undefined) ? 1 : toInteger(n); 14635 n = length - n; 14636 return baseSlice(array, n < 0 ? 0 : n, length); 14637 } 14638 14639 /** 14640 * Creates a slice of `array` with elements taken from the end. Elements are 14641 * taken until `predicate` returns falsey. The predicate is invoked with 14642 * three arguments: (value, index, array). 14643 * 14644 * @static 14645 * @memberOf _ 14646 * @since 3.0.0 14647 * @category Array 14648 * @param {Array} array The array to query. 14649 * @param {Function} [predicate=_.identity] The function invoked per iteration. 14650 * @returns {Array} Returns the slice of `array`. 14651 * @example 14652 * 14653 * var users = [ 14654 * { 'user': 'barney', 'active': true }, 14655 * { 'user': 'fred', 'active': false }, 14656 * { 'user': 'pebbles', 'active': false } 14657 * ]; 14658 * 14659 * _.takeRightWhile(users, function(o) { return !o.active; }); 14660 * // => objects for ['fred', 'pebbles'] 14661 * 14662 * // The `_.matches` iteratee shorthand. 14663 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 14664 * // => objects for ['pebbles'] 14665 * 14666 * // The `_.matchesProperty` iteratee shorthand. 14667 * _.takeRightWhile(users, ['active', false]); 14668 * // => objects for ['fred', 'pebbles'] 14669 * 14670 * // The `_.property` iteratee shorthand. 14671 * _.takeRightWhile(users, 'active'); 14672 * // => [] 14673 */ 14674 function takeRightWhile(array, predicate) { 14675 return (array && array.length) 14676 ? baseWhile(array, getIteratee(predicate, 3), false, true) 14677 : []; 14678 } 14679 14680 /** 14681 * Creates a slice of `array` with elements taken from the beginning. Elements 14682 * are taken until `predicate` returns falsey. The predicate is invoked with 14683 * three arguments: (value, index, array). 14684 * 14685 * @static 14686 * @memberOf _ 14687 * @since 3.0.0 14688 * @category Array 14689 * @param {Array} array The array to query. 14690 * @param {Function} [predicate=_.identity] The function invoked per iteration. 14691 * @returns {Array} Returns the slice of `array`. 14692 * @example 14693 * 14694 * var users = [ 14695 * { 'user': 'barney', 'active': false }, 14696 * { 'user': 'fred', 'active': false }, 14697 * { 'user': 'pebbles', 'active': true } 14698 * ]; 14699 * 14700 * _.takeWhile(users, function(o) { return !o.active; }); 14701 * // => objects for ['barney', 'fred'] 14702 * 14703 * // The `_.matches` iteratee shorthand. 14704 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 14705 * // => objects for ['barney'] 14706 * 14707 * // The `_.matchesProperty` iteratee shorthand. 14708 * _.takeWhile(users, ['active', false]); 14709 * // => objects for ['barney', 'fred'] 14710 * 14711 * // The `_.property` iteratee shorthand. 14712 * _.takeWhile(users, 'active'); 14713 * // => [] 14714 */ 14715 function takeWhile(array, predicate) { 14716 return (array && array.length) 14717 ? baseWhile(array, getIteratee(predicate, 3)) 14718 : []; 14719 } 14720 14721 /** 14722 * Creates an array of unique values, in order, from all given arrays using 14723 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 14724 * for equality comparisons. 14725 * 14726 * @static 14727 * @memberOf _ 14728 * @since 0.1.0 14729 * @category Array 14730 * @param {...Array} [arrays] The arrays to inspect. 14731 * @returns {Array} Returns the new array of combined values. 14732 * @example 14733 * 14734 * _.union([2], [1, 2]); 14735 * // => [2, 1] 14736 */ 14737 var union = baseRest(function(arrays) { 14738 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 14739 }); 14740 14741 /** 14742 * This method is like `_.union` except that it accepts `iteratee` which is 14743 * invoked for each element of each `arrays` to generate the criterion by 14744 * which uniqueness is computed. Result values are chosen from the first 14745 * array in which the value occurs. The iteratee is invoked with one argument: 14746 * (value). 14747 * 14748 * @static 14749 * @memberOf _ 14750 * @since 4.0.0 14751 * @category Array 14752 * @param {...Array} [arrays] The arrays to inspect. 14753 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 14754 * @returns {Array} Returns the new array of combined values. 14755 * @example 14756 * 14757 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 14758 * // => [2.1, 1.2] 14759 * 14760 * // The `_.property` iteratee shorthand. 14761 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 14762 * // => [{ 'x': 1 }, { 'x': 2 }] 14763 */ 14764 var unionBy = baseRest(function(arrays) { 14765 var iteratee = last(arrays); 14766 if (isArrayLikeObject(iteratee)) { 14767 iteratee = undefined; 14768 } 14769 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); 14770 }); 14771 14772 /** 14773 * This method is like `_.union` except that it accepts `comparator` which 14774 * is invoked to compare elements of `arrays`. Result values are chosen from 14775 * the first array in which the value occurs. The comparator is invoked 14776 * with two arguments: (arrVal, othVal). 14777 * 14778 * @static 14779 * @memberOf _ 14780 * @since 4.0.0 14781 * @category Array 14782 * @param {...Array} [arrays] The arrays to inspect. 14783 * @param {Function} [comparator] The comparator invoked per element. 14784 * @returns {Array} Returns the new array of combined values. 14785 * @example 14786 * 14787 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 14788 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 14789 * 14790 * _.unionWith(objects, others, _.isEqual); 14791 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 14792 */ 14793 var unionWith = baseRest(function(arrays) { 14794 var comparator = last(arrays); 14795 comparator = typeof comparator == 'function' ? comparator : undefined; 14796 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); 14797 }); 14798 14799 /** 14800 * Creates a duplicate-free version of an array, using 14801 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 14802 * for equality comparisons, in which only the first occurrence of each element 14803 * is kept. The order of result values is determined by the order they occur 14804 * in the array. 14805 * 14806 * @static 14807 * @memberOf _ 14808 * @since 0.1.0 14809 * @category Array 14810 * @param {Array} array The array to inspect. 14811 * @returns {Array} Returns the new duplicate free array. 14812 * @example 14813 * 14814 * _.uniq([2, 1, 2]); 14815 * // => [2, 1] 14816 */ 14817 function uniq(array) { 14818 return (array && array.length) ? baseUniq(array) : []; 14819 } 14820 14821 /** 14822 * This method is like `_.uniq` except that it accepts `iteratee` which is 14823 * invoked for each element in `array` to generate the criterion by which 14824 * uniqueness is computed. The order of result values is determined by the 14825 * order they occur in the array. The iteratee is invoked with one argument: 14826 * (value). 14827 * 14828 * @static 14829 * @memberOf _ 14830 * @since 4.0.0 14831 * @category Array 14832 * @param {Array} array The array to inspect. 14833 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 14834 * @returns {Array} Returns the new duplicate free array. 14835 * @example 14836 * 14837 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 14838 * // => [2.1, 1.2] 14839 * 14840 * // The `_.property` iteratee shorthand. 14841 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 14842 * // => [{ 'x': 1 }, { 'x': 2 }] 14843 */ 14844 function uniqBy(array, iteratee) { 14845 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; 14846 } 14847 14848 /** 14849 * This method is like `_.uniq` except that it accepts `comparator` which 14850 * is invoked to compare elements of `array`. The order of result values is 14851 * determined by the order they occur in the array.The comparator is invoked 14852 * with two arguments: (arrVal, othVal). 14853 * 14854 * @static 14855 * @memberOf _ 14856 * @since 4.0.0 14857 * @category Array 14858 * @param {Array} array The array to inspect. 14859 * @param {Function} [comparator] The comparator invoked per element. 14860 * @returns {Array} Returns the new duplicate free array. 14861 * @example 14862 * 14863 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 14864 * 14865 * _.uniqWith(objects, _.isEqual); 14866 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 14867 */ 14868 function uniqWith(array, comparator) { 14869 comparator = typeof comparator == 'function' ? comparator : undefined; 14870 return (array && array.length) ? baseUniq(array, undefined, comparator) : []; 14871 } 14872 14873 /** 14874 * This method is like `_.zip` except that it accepts an array of grouped 14875 * elements and creates an array regrouping the elements to their pre-zip 14876 * configuration. 14877 * 14878 * @static 14879 * @memberOf _ 14880 * @since 1.2.0 14881 * @category Array 14882 * @param {Array} array The array of grouped elements to process. 14883 * @returns {Array} Returns the new array of regrouped elements. 14884 * @example 14885 * 14886 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 14887 * // => [['a', 1, true], ['b', 2, false]] 14888 * 14889 * _.unzip(zipped); 14890 * // => [['a', 'b'], [1, 2], [true, false]] 14891 */ 14892 function unzip(array) { 14893 if (!(array && array.length)) { 14894 return []; 14895 } 14896 var length = 0; 14897 array = arrayFilter(array, function(group) { 14898 if (isArrayLikeObject(group)) { 14899 length = nativeMax(group.length, length); 14900 return true; 14901 } 14902 }); 14903 return baseTimes(length, function(index) { 14904 return arrayMap(array, baseProperty(index)); 14905 }); 14906 } 14907 14908 /** 14909 * This method is like `_.unzip` except that it accepts `iteratee` to specify 14910 * how regrouped values should be combined. The iteratee is invoked with the 14911 * elements of each group: (...group). 14912 * 14913 * @static 14914 * @memberOf _ 14915 * @since 3.8.0 14916 * @category Array 14917 * @param {Array} array The array of grouped elements to process. 14918 * @param {Function} [iteratee=_.identity] The function to combine 14919 * regrouped values. 14920 * @returns {Array} Returns the new array of regrouped elements. 14921 * @example 14922 * 14923 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 14924 * // => [[1, 10, 100], [2, 20, 200]] 14925 * 14926 * _.unzipWith(zipped, _.add); 14927 * // => [3, 30, 300] 14928 */ 14929 function unzipWith(array, iteratee) { 14930 if (!(array && array.length)) { 14931 return []; 14932 } 14933 var result = unzip(array); 14934 if (iteratee == null) { 14935 return result; 14936 } 14937 return arrayMap(result, function(group) { 14938 return apply(iteratee, undefined, group); 14939 }); 14940 } 14941 14942 /** 14943 * Creates an array excluding all given values using 14944 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 14945 * for equality comparisons. 14946 * 14947 * **Note:** Unlike `_.pull`, this method returns a new array. 14948 * 14949 * @static 14950 * @memberOf _ 14951 * @since 0.1.0 14952 * @category Array 14953 * @param {Array} array The array to inspect. 14954 * @param {...*} [values] The values to exclude. 14955 * @returns {Array} Returns the new array of filtered values. 14956 * @see _.difference, _.xor 14957 * @example 14958 * 14959 * _.without([2, 1, 2, 3], 1, 2); 14960 * // => [3] 14961 */ 14962 var without = baseRest(function(array, values) { 14963 return isArrayLikeObject(array) 14964 ? baseDifference(array, values) 14965 : []; 14966 }); 14967 14968 /** 14969 * Creates an array of unique values that is the 14970 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 14971 * of the given arrays. The order of result values is determined by the order 14972 * they occur in the arrays. 14973 * 14974 * @static 14975 * @memberOf _ 14976 * @since 2.4.0 14977 * @category Array 14978 * @param {...Array} [arrays] The arrays to inspect. 14979 * @returns {Array} Returns the new array of filtered values. 14980 * @see _.difference, _.without 14981 * @example 14982 * 14983 * _.xor([2, 1], [2, 3]); 14984 * // => [1, 3] 14985 */ 14986 var xor = baseRest(function(arrays) { 14987 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 14988 }); 14989 14990 /** 14991 * This method is like `_.xor` except that it accepts `iteratee` which is 14992 * invoked for each element of each `arrays` to generate the criterion by 14993 * which by which they're compared. The order of result values is determined 14994 * by the order they occur in the arrays. The iteratee is invoked with one 14995 * argument: (value). 14996 * 14997 * @static 14998 * @memberOf _ 14999 * @since 4.0.0 15000 * @category Array 15001 * @param {...Array} [arrays] The arrays to inspect. 15002 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 15003 * @returns {Array} Returns the new array of filtered values. 15004 * @example 15005 * 15006 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 15007 * // => [1.2, 3.4] 15008 * 15009 * // The `_.property` iteratee shorthand. 15010 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 15011 * // => [{ 'x': 2 }] 15012 */ 15013 var xorBy = baseRest(function(arrays) { 15014 var iteratee = last(arrays); 15015 if (isArrayLikeObject(iteratee)) { 15016 iteratee = undefined; 15017 } 15018 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); 15019 }); 15020 15021 /** 15022 * This method is like `_.xor` except that it accepts `comparator` which is 15023 * invoked to compare elements of `arrays`. The order of result values is 15024 * determined by the order they occur in the arrays. The comparator is invoked 15025 * with two arguments: (arrVal, othVal). 15026 * 15027 * @static 15028 * @memberOf _ 15029 * @since 4.0.0 15030 * @category Array 15031 * @param {...Array} [arrays] The arrays to inspect. 15032 * @param {Function} [comparator] The comparator invoked per element. 15033 * @returns {Array} Returns the new array of filtered values. 15034 * @example 15035 * 15036 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 15037 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 15038 * 15039 * _.xorWith(objects, others, _.isEqual); 15040 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 15041 */ 15042 var xorWith = baseRest(function(arrays) { 15043 var comparator = last(arrays); 15044 comparator = typeof comparator == 'function' ? comparator : undefined; 15045 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); 15046 }); 15047 15048 /** 15049 * Creates an array of grouped elements, the first of which contains the 15050 * first elements of the given arrays, the second of which contains the 15051 * second elements of the given arrays, and so on. 15052 * 15053 * @static 15054 * @memberOf _ 15055 * @since 0.1.0 15056 * @category Array 15057 * @param {...Array} [arrays] The arrays to process. 15058 * @returns {Array} Returns the new array of grouped elements. 15059 * @example 15060 * 15061 * _.zip(['a', 'b'], [1, 2], [true, false]); 15062 * // => [['a', 1, true], ['b', 2, false]] 15063 */ 15064 var zip = baseRest(unzip); 15065 15066 /** 15067 * This method is like `_.fromPairs` except that it accepts two arrays, 15068 * one of property identifiers and one of corresponding values. 15069 * 15070 * @static 15071 * @memberOf _ 15072 * @since 0.4.0 15073 * @category Array 15074 * @param {Array} [props=[]] The property identifiers. 15075 * @param {Array} [values=[]] The property values. 15076 * @returns {Object} Returns the new object. 15077 * @example 15078 * 15079 * _.zipObject(['a', 'b'], [1, 2]); 15080 * // => { 'a': 1, 'b': 2 } 15081 */ 15082 function zipObject(props, values) { 15083 return baseZipObject(props || [], values || [], assignValue); 15084 } 15085 15086 /** 15087 * This method is like `_.zipObject` except that it supports property paths. 15088 * 15089 * @static 15090 * @memberOf _ 15091 * @since 4.1.0 15092 * @category Array 15093 * @param {Array} [props=[]] The property identifiers. 15094 * @param {Array} [values=[]] The property values. 15095 * @returns {Object} Returns the new object. 15096 * @example 15097 * 15098 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 15099 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 15100 */ 15101 function zipObjectDeep(props, values) { 15102 return baseZipObject(props || [], values || [], baseSet); 15103 } 15104 15105 /** 15106 * This method is like `_.zip` except that it accepts `iteratee` to specify 15107 * how grouped values should be combined. The iteratee is invoked with the 15108 * elements of each group: (...group). 15109 * 15110 * @static 15111 * @memberOf _ 15112 * @since 3.8.0 15113 * @category Array 15114 * @param {...Array} [arrays] The arrays to process. 15115 * @param {Function} [iteratee=_.identity] The function to combine 15116 * grouped values. 15117 * @returns {Array} Returns the new array of grouped elements. 15118 * @example 15119 * 15120 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 15121 * return a + b + c; 15122 * }); 15123 * // => [111, 222] 15124 */ 15125 var zipWith = baseRest(function(arrays) { 15126 var length = arrays.length, 15127 iteratee = length > 1 ? arrays[length - 1] : undefined; 15128 15129 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; 15130 return unzipWith(arrays, iteratee); 15131 }); 15132 15133 /*------------------------------------------------------------------------*/ 15134 15135 /** 15136 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 15137 * chain sequences enabled. The result of such sequences must be unwrapped 15138 * with `_#value`. 15139 * 15140 * @static 15141 * @memberOf _ 15142 * @since 1.3.0 15143 * @category Seq 15144 * @param {*} value The value to wrap. 15145 * @returns {Object} Returns the new `lodash` wrapper instance. 15146 * @example 15147 * 15148 * var users = [ 15149 * { 'user': 'barney', 'age': 36 }, 15150 * { 'user': 'fred', 'age': 40 }, 15151 * { 'user': 'pebbles', 'age': 1 } 15152 * ]; 15153 * 15154 * var youngest = _ 15155 * .chain(users) 15156 * .sortBy('age') 15157 * .map(function(o) { 15158 * return o.user + ' is ' + o.age; 15159 * }) 15160 * .head() 15161 * .value(); 15162 * // => 'pebbles is 1' 15163 */ 15164 function chain(value) { 15165 var result = lodash(value); 15166 result.__chain__ = true; 15167 return result; 15168 } 15169 15170 /** 15171 * This method invokes `interceptor` and returns `value`. The interceptor 15172 * is invoked with one argument; (value). The purpose of this method is to 15173 * "tap into" a method chain sequence in order to modify intermediate results. 15174 * 15175 * @static 15176 * @memberOf _ 15177 * @since 0.1.0 15178 * @category Seq 15179 * @param {*} value The value to provide to `interceptor`. 15180 * @param {Function} interceptor The function to invoke. 15181 * @returns {*} Returns `value`. 15182 * @example 15183 * 15184 * _([1, 2, 3]) 15185 * .tap(function(array) { 15186 * // Mutate input array. 15187 * array.pop(); 15188 * }) 15189 * .reverse() 15190 * .value(); 15191 * // => [2, 1] 15192 */ 15193 function tap(value, interceptor) { 15194 interceptor(value); 15195 return value; 15196 } 15197 15198 /** 15199 * This method is like `_.tap` except that it returns the result of `interceptor`. 15200 * The purpose of this method is to "pass thru" values replacing intermediate 15201 * results in a method chain sequence. 15202 * 15203 * @static 15204 * @memberOf _ 15205 * @since 3.0.0 15206 * @category Seq 15207 * @param {*} value The value to provide to `interceptor`. 15208 * @param {Function} interceptor The function to invoke. 15209 * @returns {*} Returns the result of `interceptor`. 15210 * @example 15211 * 15212 * _(' abc ') 15213 * .chain() 15214 * .trim() 15215 * .thru(function(value) { 15216 * return [value]; 15217 * }) 15218 * .value(); 15219 * // => ['abc'] 15220 */ 15221 function thru(value, interceptor) { 15222 return interceptor(value); 15223 } 15224 15225 /** 15226 * This method is the wrapper version of `_.at`. 15227 * 15228 * @name at 15229 * @memberOf _ 15230 * @since 1.0.0 15231 * @category Seq 15232 * @param {...(string|string[])} [paths] The property paths to pick. 15233 * @returns {Object} Returns the new `lodash` wrapper instance. 15234 * @example 15235 * 15236 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 15237 * 15238 * _(object).at(['a[0].b.c', 'a[1]']).value(); 15239 * // => [3, 4] 15240 */ 15241 var wrapperAt = flatRest(function(paths) { 15242 var length = paths.length, 15243 start = length ? paths[0] : 0, 15244 value = this.__wrapped__, 15245 interceptor = function(object) { return baseAt(object, paths); }; 15246 15247 if (length > 1 || this.__actions__.length || 15248 !(value instanceof LazyWrapper) || !isIndex(start)) { 15249 return this.thru(interceptor); 15250 } 15251 value = value.slice(start, +start + (length ? 1 : 0)); 15252 value.__actions__.push({ 15253 'func': thru, 15254 'args': [interceptor], 15255 'thisArg': undefined 15256 }); 15257 return new LodashWrapper(value, this.__chain__).thru(function(array) { 15258 if (length && !array.length) { 15259 array.push(undefined); 15260 } 15261 return array; 15262 }); 15263 }); 15264 15265 /** 15266 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 15267 * 15268 * @name chain 15269 * @memberOf _ 15270 * @since 0.1.0 15271 * @category Seq 15272 * @returns {Object} Returns the new `lodash` wrapper instance. 15273 * @example 15274 * 15275 * var users = [ 15276 * { 'user': 'barney', 'age': 36 }, 15277 * { 'user': 'fred', 'age': 40 } 15278 * ]; 15279 * 15280 * // A sequence without explicit chaining. 15281 * _(users).head(); 15282 * // => { 'user': 'barney', 'age': 36 } 15283 * 15284 * // A sequence with explicit chaining. 15285 * _(users) 15286 * .chain() 15287 * .head() 15288 * .pick('user') 15289 * .value(); 15290 * // => { 'user': 'barney' } 15291 */ 15292 function wrapperChain() { 15293 return chain(this); 15294 } 15295 15296 /** 15297 * Executes the chain sequence and returns the wrapped result. 15298 * 15299 * @name commit 15300 * @memberOf _ 15301 * @since 3.2.0 15302 * @category Seq 15303 * @returns {Object} Returns the new `lodash` wrapper instance. 15304 * @example 15305 * 15306 * var array = [1, 2]; 15307 * var wrapped = _(array).push(3); 15308 * 15309 * console.log(array); 15310 * // => [1, 2] 15311 * 15312 * wrapped = wrapped.commit(); 15313 * console.log(array); 15314 * // => [1, 2, 3] 15315 * 15316 * wrapped.last(); 15317 * // => 3 15318 * 15319 * console.log(array); 15320 * // => [1, 2, 3] 15321 */ 15322 function wrapperCommit() { 15323 return new LodashWrapper(this.value(), this.__chain__); 15324 } 15325 15326 /** 15327 * Gets the next value on a wrapped object following the 15328 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 15329 * 15330 * @name next 15331 * @memberOf _ 15332 * @since 4.0.0 15333 * @category Seq 15334 * @returns {Object} Returns the next iterator value. 15335 * @example 15336 * 15337 * var wrapped = _([1, 2]); 15338 * 15339 * wrapped.next(); 15340 * // => { 'done': false, 'value': 1 } 15341 * 15342 * wrapped.next(); 15343 * // => { 'done': false, 'value': 2 } 15344 * 15345 * wrapped.next(); 15346 * // => { 'done': true, 'value': undefined } 15347 */ 15348 function wrapperNext() { 15349 if (this.__values__ === undefined) { 15350 this.__values__ = toArray(this.value()); 15351 } 15352 var done = this.__index__ >= this.__values__.length, 15353 value = done ? undefined : this.__values__[this.__index__++]; 15354 15355 return { 'done': done, 'value': value }; 15356 } 15357 15358 /** 15359 * Enables the wrapper to be iterable. 15360 * 15361 * @name Symbol.iterator 15362 * @memberOf _ 15363 * @since 4.0.0 15364 * @category Seq 15365 * @returns {Object} Returns the wrapper object. 15366 * @example 15367 * 15368 * var wrapped = _([1, 2]); 15369 * 15370 * wrapped[Symbol.iterator]() === wrapped; 15371 * // => true 15372 * 15373 * Array.from(wrapped); 15374 * // => [1, 2] 15375 */ 15376 function wrapperToIterator() { 15377 return this; 15378 } 15379 15380 /** 15381 * Creates a clone of the chain sequence planting `value` as the wrapped value. 15382 * 15383 * @name plant 15384 * @memberOf _ 15385 * @since 3.2.0 15386 * @category Seq 15387 * @param {*} value The value to plant. 15388 * @returns {Object} Returns the new `lodash` wrapper instance. 15389 * @example 15390 * 15391 * function square(n) { 15392 * return n * n; 15393 * } 15394 * 15395 * var wrapped = _([1, 2]).map(square); 15396 * var other = wrapped.plant([3, 4]); 15397 * 15398 * other.value(); 15399 * // => [9, 16] 15400 * 15401 * wrapped.value(); 15402 * // => [1, 4] 15403 */ 15404 function wrapperPlant(value) { 15405 var result, 15406 parent = this; 15407 15408 while (parent instanceof baseLodash) { 15409 var clone = wrapperClone(parent); 15410 clone.__index__ = 0; 15411 clone.__values__ = undefined; 15412 if (result) { 15413 previous.__wrapped__ = clone; 15414 } else { 15415 result = clone; 15416 } 15417 var previous = clone; 15418 parent = parent.__wrapped__; 15419 } 15420 previous.__wrapped__ = value; 15421 return result; 15422 } 15423 15424 /** 15425 * This method is the wrapper version of `_.reverse`. 15426 * 15427 * **Note:** This method mutates the wrapped array. 15428 * 15429 * @name reverse 15430 * @memberOf _ 15431 * @since 0.1.0 15432 * @category Seq 15433 * @returns {Object} Returns the new `lodash` wrapper instance. 15434 * @example 15435 * 15436 * var array = [1, 2, 3]; 15437 * 15438 * _(array).reverse().value() 15439 * // => [3, 2, 1] 15440 * 15441 * console.log(array); 15442 * // => [3, 2, 1] 15443 */ 15444 function wrapperReverse() { 15445 var value = this.__wrapped__; 15446 if (value instanceof LazyWrapper) { 15447 var wrapped = value; 15448 if (this.__actions__.length) { 15449 wrapped = new LazyWrapper(this); 15450 } 15451 wrapped = wrapped.reverse(); 15452 wrapped.__actions__.push({ 15453 'func': thru, 15454 'args': [reverse], 15455 'thisArg': undefined 15456 }); 15457 return new LodashWrapper(wrapped, this.__chain__); 15458 } 15459 return this.thru(reverse); 15460 } 15461 15462 /** 15463 * Executes the chain sequence to resolve the unwrapped value. 15464 * 15465 * @name value 15466 * @memberOf _ 15467 * @since 0.1.0 15468 * @alias toJSON, valueOf 15469 * @category Seq 15470 * @returns {*} Returns the resolved unwrapped value. 15471 * @example 15472 * 15473 * _([1, 2, 3]).value(); 15474 * // => [1, 2, 3] 15475 */ 15476 function wrapperValue() { 15477 return baseWrapperValue(this.__wrapped__, this.__actions__); 15478 } 15479 15480 /*------------------------------------------------------------------------*/ 15481 15482 /** 15483 * Creates an object composed of keys generated from the results of running 15484 * each element of `collection` thru `iteratee`. The corresponding value of 15485 * each key is the number of times the key was returned by `iteratee`. The 15486 * iteratee is invoked with one argument: (value). 15487 * 15488 * @static 15489 * @memberOf _ 15490 * @since 0.5.0 15491 * @category Collection 15492 * @param {Array|Object} collection The collection to iterate over. 15493 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 15494 * @returns {Object} Returns the composed aggregate object. 15495 * @example 15496 * 15497 * _.countBy([6.1, 4.2, 6.3], Math.floor); 15498 * // => { '4': 1, '6': 2 } 15499 * 15500 * // The `_.property` iteratee shorthand. 15501 * _.countBy(['one', 'two', 'three'], 'length'); 15502 * // => { '3': 2, '5': 1 } 15503 */ 15504 var countBy = createAggregator(function(result, value, key) { 15505 if (hasOwnProperty.call(result, key)) { 15506 ++result[key]; 15507 } else { 15508 baseAssignValue(result, key, 1); 15509 } 15510 }); 15511 15512 /** 15513 * Checks if `predicate` returns truthy for **all** elements of `collection`. 15514 * Iteration is stopped once `predicate` returns falsey. The predicate is 15515 * invoked with three arguments: (value, index|key, collection). 15516 * 15517 * **Note:** This method returns `true` for 15518 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 15519 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 15520 * elements of empty collections. 15521 * 15522 * @static 15523 * @memberOf _ 15524 * @since 0.1.0 15525 * @category Collection 15526 * @param {Array|Object} collection The collection to iterate over. 15527 * @param {Function} [predicate=_.identity] The function invoked per iteration. 15528 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 15529 * @returns {boolean} Returns `true` if all elements pass the predicate check, 15530 * else `false`. 15531 * @example 15532 * 15533 * _.every([true, 1, null, 'yes'], Boolean); 15534 * // => false 15535 * 15536 * var users = [ 15537 * { 'user': 'barney', 'age': 36, 'active': false }, 15538 * { 'user': 'fred', 'age': 40, 'active': false } 15539 * ]; 15540 * 15541 * // The `_.matches` iteratee shorthand. 15542 * _.every(users, { 'user': 'barney', 'active': false }); 15543 * // => false 15544 * 15545 * // The `_.matchesProperty` iteratee shorthand. 15546 * _.every(users, ['active', false]); 15547 * // => true 15548 * 15549 * // The `_.property` iteratee shorthand. 15550 * _.every(users, 'active'); 15551 * // => false 15552 */ 15553 function every(collection, predicate, guard) { 15554 var func = isArray(collection) ? arrayEvery : baseEvery; 15555 if (guard && isIterateeCall(collection, predicate, guard)) { 15556 predicate = undefined; 15557 } 15558 return func(collection, getIteratee(predicate, 3)); 15559 } 15560 15561 /** 15562 * Iterates over elements of `collection`, returning an array of all elements 15563 * `predicate` returns truthy for. The predicate is invoked with three 15564 * arguments: (value, index|key, collection). 15565 * 15566 * **Note:** Unlike `_.remove`, this method returns a new array. 15567 * 15568 * @static 15569 * @memberOf _ 15570 * @since 0.1.0 15571 * @category Collection 15572 * @param {Array|Object} collection The collection to iterate over. 15573 * @param {Function} [predicate=_.identity] The function invoked per iteration. 15574 * @returns {Array} Returns the new filtered array. 15575 * @see _.reject 15576 * @example 15577 * 15578 * var users = [ 15579 * { 'user': 'barney', 'age': 36, 'active': true }, 15580 * { 'user': 'fred', 'age': 40, 'active': false } 15581 * ]; 15582 * 15583 * _.filter(users, function(o) { return !o.active; }); 15584 * // => objects for ['fred'] 15585 * 15586 * // The `_.matches` iteratee shorthand. 15587 * _.filter(users, { 'age': 36, 'active': true }); 15588 * // => objects for ['barney'] 15589 * 15590 * // The `_.matchesProperty` iteratee shorthand. 15591 * _.filter(users, ['active', false]); 15592 * // => objects for ['fred'] 15593 * 15594 * // The `_.property` iteratee shorthand. 15595 * _.filter(users, 'active'); 15596 * // => objects for ['barney'] 15597 * 15598 * // Combining several predicates using `_.overEvery` or `_.overSome`. 15599 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 15600 * // => objects for ['fred', 'barney'] 15601 */ 15602 function filter(collection, predicate) { 15603 var func = isArray(collection) ? arrayFilter : baseFilter; 15604 return func(collection, getIteratee(predicate, 3)); 15605 } 15606 15607 /** 15608 * Iterates over elements of `collection`, returning the first element 15609 * `predicate` returns truthy for. The predicate is invoked with three 15610 * arguments: (value, index|key, collection). 15611 * 15612 * @static 15613 * @memberOf _ 15614 * @since 0.1.0 15615 * @category Collection 15616 * @param {Array|Object} collection The collection to inspect. 15617 * @param {Function} [predicate=_.identity] The function invoked per iteration. 15618 * @param {number} [fromIndex=0] The index to search from. 15619 * @returns {*} Returns the matched element, else `undefined`. 15620 * @example 15621 * 15622 * var users = [ 15623 * { 'user': 'barney', 'age': 36, 'active': true }, 15624 * { 'user': 'fred', 'age': 40, 'active': false }, 15625 * { 'user': 'pebbles', 'age': 1, 'active': true } 15626 * ]; 15627 * 15628 * _.find(users, function(o) { return o.age < 40; }); 15629 * // => object for 'barney' 15630 * 15631 * // The `_.matches` iteratee shorthand. 15632 * _.find(users, { 'age': 1, 'active': true }); 15633 * // => object for 'pebbles' 15634 * 15635 * // The `_.matchesProperty` iteratee shorthand. 15636 * _.find(users, ['active', false]); 15637 * // => object for 'fred' 15638 * 15639 * // The `_.property` iteratee shorthand. 15640 * _.find(users, 'active'); 15641 * // => object for 'barney' 15642 */ 15643 var find = createFind(findIndex); 15644 15645 /** 15646 * This method is like `_.find` except that it iterates over elements of 15647 * `collection` from right to left. 15648 * 15649 * @static 15650 * @memberOf _ 15651 * @since 2.0.0 15652 * @category Collection 15653 * @param {Array|Object} collection The collection to inspect. 15654 * @param {Function} [predicate=_.identity] The function invoked per iteration. 15655 * @param {number} [fromIndex=collection.length-1] The index to search from. 15656 * @returns {*} Returns the matched element, else `undefined`. 15657 * @example 15658 * 15659 * _.findLast([1, 2, 3, 4], function(n) { 15660 * return n % 2 == 1; 15661 * }); 15662 * // => 3 15663 */ 15664 var findLast = createFind(findLastIndex); 15665 15666 /** 15667 * Creates a flattened array of values by running each element in `collection` 15668 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 15669 * with three arguments: (value, index|key, collection). 15670 * 15671 * @static 15672 * @memberOf _ 15673 * @since 4.0.0 15674 * @category Collection 15675 * @param {Array|Object} collection The collection to iterate over. 15676 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15677 * @returns {Array} Returns the new flattened array. 15678 * @example 15679 * 15680 * function duplicate(n) { 15681 * return [n, n]; 15682 * } 15683 * 15684 * _.flatMap([1, 2], duplicate); 15685 * // => [1, 1, 2, 2] 15686 */ 15687 function flatMap(collection, iteratee) { 15688 return baseFlatten(map(collection, iteratee), 1); 15689 } 15690 15691 /** 15692 * This method is like `_.flatMap` except that it recursively flattens the 15693 * mapped results. 15694 * 15695 * @static 15696 * @memberOf _ 15697 * @since 4.7.0 15698 * @category Collection 15699 * @param {Array|Object} collection The collection to iterate over. 15700 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15701 * @returns {Array} Returns the new flattened array. 15702 * @example 15703 * 15704 * function duplicate(n) { 15705 * return [[[n, n]]]; 15706 * } 15707 * 15708 * _.flatMapDeep([1, 2], duplicate); 15709 * // => [1, 1, 2, 2] 15710 */ 15711 function flatMapDeep(collection, iteratee) { 15712 return baseFlatten(map(collection, iteratee), INFINITY); 15713 } 15714 15715 /** 15716 * This method is like `_.flatMap` except that it recursively flattens the 15717 * mapped results up to `depth` times. 15718 * 15719 * @static 15720 * @memberOf _ 15721 * @since 4.7.0 15722 * @category Collection 15723 * @param {Array|Object} collection The collection to iterate over. 15724 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15725 * @param {number} [depth=1] The maximum recursion depth. 15726 * @returns {Array} Returns the new flattened array. 15727 * @example 15728 * 15729 * function duplicate(n) { 15730 * return [[[n, n]]]; 15731 * } 15732 * 15733 * _.flatMapDepth([1, 2], duplicate, 2); 15734 * // => [[1, 1], [2, 2]] 15735 */ 15736 function flatMapDepth(collection, iteratee, depth) { 15737 depth = depth === undefined ? 1 : toInteger(depth); 15738 return baseFlatten(map(collection, iteratee), depth); 15739 } 15740 15741 /** 15742 * Iterates over elements of `collection` and invokes `iteratee` for each element. 15743 * The iteratee is invoked with three arguments: (value, index|key, collection). 15744 * Iteratee functions may exit iteration early by explicitly returning `false`. 15745 * 15746 * **Note:** As with other "Collections" methods, objects with a "length" 15747 * property are iterated like arrays. To avoid this behavior use `_.forIn` 15748 * or `_.forOwn` for object iteration. 15749 * 15750 * @static 15751 * @memberOf _ 15752 * @since 0.1.0 15753 * @alias each 15754 * @category Collection 15755 * @param {Array|Object} collection The collection to iterate over. 15756 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15757 * @returns {Array|Object} Returns `collection`. 15758 * @see _.forEachRight 15759 * @example 15760 * 15761 * _.forEach([1, 2], function(value) { 15762 * console.log(value); 15763 * }); 15764 * // => Logs `1` then `2`. 15765 * 15766 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 15767 * console.log(key); 15768 * }); 15769 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 15770 */ 15771 function forEach(collection, iteratee) { 15772 var func = isArray(collection) ? arrayEach : baseEach; 15773 return func(collection, getIteratee(iteratee, 3)); 15774 } 15775 15776 /** 15777 * This method is like `_.forEach` except that it iterates over elements of 15778 * `collection` from right to left. 15779 * 15780 * @static 15781 * @memberOf _ 15782 * @since 2.0.0 15783 * @alias eachRight 15784 * @category Collection 15785 * @param {Array|Object} collection The collection to iterate over. 15786 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15787 * @returns {Array|Object} Returns `collection`. 15788 * @see _.forEach 15789 * @example 15790 * 15791 * _.forEachRight([1, 2], function(value) { 15792 * console.log(value); 15793 * }); 15794 * // => Logs `2` then `1`. 15795 */ 15796 function forEachRight(collection, iteratee) { 15797 var func = isArray(collection) ? arrayEachRight : baseEachRight; 15798 return func(collection, getIteratee(iteratee, 3)); 15799 } 15800 15801 /** 15802 * Creates an object composed of keys generated from the results of running 15803 * each element of `collection` thru `iteratee`. The order of grouped values 15804 * is determined by the order they occur in `collection`. The corresponding 15805 * value of each key is an array of elements responsible for generating the 15806 * key. The iteratee is invoked with one argument: (value). 15807 * 15808 * @static 15809 * @memberOf _ 15810 * @since 0.1.0 15811 * @category Collection 15812 * @param {Array|Object} collection The collection to iterate over. 15813 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 15814 * @returns {Object} Returns the composed aggregate object. 15815 * @example 15816 * 15817 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 15818 * // => { '4': [4.2], '6': [6.1, 6.3] } 15819 * 15820 * // The `_.property` iteratee shorthand. 15821 * _.groupBy(['one', 'two', 'three'], 'length'); 15822 * // => { '3': ['one', 'two'], '5': ['three'] } 15823 */ 15824 var groupBy = createAggregator(function(result, value, key) { 15825 if (hasOwnProperty.call(result, key)) { 15826 result[key].push(value); 15827 } else { 15828 baseAssignValue(result, key, [value]); 15829 } 15830 }); 15831 15832 /** 15833 * Checks if `value` is in `collection`. If `collection` is a string, it's 15834 * checked for a substring of `value`, otherwise 15835 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 15836 * is used for equality comparisons. If `fromIndex` is negative, it's used as 15837 * the offset from the end of `collection`. 15838 * 15839 * @static 15840 * @memberOf _ 15841 * @since 0.1.0 15842 * @category Collection 15843 * @param {Array|Object|string} collection The collection to inspect. 15844 * @param {*} value The value to search for. 15845 * @param {number} [fromIndex=0] The index to search from. 15846 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 15847 * @returns {boolean} Returns `true` if `value` is found, else `false`. 15848 * @example 15849 * 15850 * _.includes([1, 2, 3], 1); 15851 * // => true 15852 * 15853 * _.includes([1, 2, 3], 1, 2); 15854 * // => false 15855 * 15856 * _.includes({ 'a': 1, 'b': 2 }, 1); 15857 * // => true 15858 * 15859 * _.includes('abcd', 'bc'); 15860 * // => true 15861 */ 15862 function includes(collection, value, fromIndex, guard) { 15863 collection = isArrayLike(collection) ? collection : values(collection); 15864 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; 15865 15866 var length = collection.length; 15867 if (fromIndex < 0) { 15868 fromIndex = nativeMax(length + fromIndex, 0); 15869 } 15870 return isString(collection) 15871 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) 15872 : (!!length && baseIndexOf(collection, value, fromIndex) > -1); 15873 } 15874 15875 /** 15876 * Invokes the method at `path` of each element in `collection`, returning 15877 * an array of the results of each invoked method. Any additional arguments 15878 * are provided to each invoked method. If `path` is a function, it's invoked 15879 * for, and `this` bound to, each element in `collection`. 15880 * 15881 * @static 15882 * @memberOf _ 15883 * @since 4.0.0 15884 * @category Collection 15885 * @param {Array|Object} collection The collection to iterate over. 15886 * @param {Array|Function|string} path The path of the method to invoke or 15887 * the function invoked per iteration. 15888 * @param {...*} [args] The arguments to invoke each method with. 15889 * @returns {Array} Returns the array of results. 15890 * @example 15891 * 15892 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 15893 * // => [[1, 5, 7], [1, 2, 3]] 15894 * 15895 * _.invokeMap([123, 456], String.prototype.split, ''); 15896 * // => [['1', '2', '3'], ['4', '5', '6']] 15897 */ 15898 var invokeMap = baseRest(function(collection, path, args) { 15899 var index = -1, 15900 isFunc = typeof path == 'function', 15901 result = isArrayLike(collection) ? Array(collection.length) : []; 15902 15903 baseEach(collection, function(value) { 15904 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); 15905 }); 15906 return result; 15907 }); 15908 15909 /** 15910 * Creates an object composed of keys generated from the results of running 15911 * each element of `collection` thru `iteratee`. The corresponding value of 15912 * each key is the last element responsible for generating the key. The 15913 * iteratee is invoked with one argument: (value). 15914 * 15915 * @static 15916 * @memberOf _ 15917 * @since 4.0.0 15918 * @category Collection 15919 * @param {Array|Object} collection The collection to iterate over. 15920 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 15921 * @returns {Object} Returns the composed aggregate object. 15922 * @example 15923 * 15924 * var array = [ 15925 * { 'dir': 'left', 'code': 97 }, 15926 * { 'dir': 'right', 'code': 100 } 15927 * ]; 15928 * 15929 * _.keyBy(array, function(o) { 15930 * return String.fromCharCode(o.code); 15931 * }); 15932 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 15933 * 15934 * _.keyBy(array, 'dir'); 15935 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 15936 */ 15937 var keyBy = createAggregator(function(result, value, key) { 15938 baseAssignValue(result, key, value); 15939 }); 15940 15941 /** 15942 * Creates an array of values by running each element in `collection` thru 15943 * `iteratee`. The iteratee is invoked with three arguments: 15944 * (value, index|key, collection). 15945 * 15946 * Many lodash methods are guarded to work as iteratees for methods like 15947 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 15948 * 15949 * The guarded methods are: 15950 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 15951 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 15952 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 15953 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 15954 * 15955 * @static 15956 * @memberOf _ 15957 * @since 0.1.0 15958 * @category Collection 15959 * @param {Array|Object} collection The collection to iterate over. 15960 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 15961 * @returns {Array} Returns the new mapped array. 15962 * @example 15963 * 15964 * function square(n) { 15965 * return n * n; 15966 * } 15967 * 15968 * _.map([4, 8], square); 15969 * // => [16, 64] 15970 * 15971 * _.map({ 'a': 4, 'b': 8 }, square); 15972 * // => [16, 64] (iteration order is not guaranteed) 15973 * 15974 * var users = [ 15975 * { 'user': 'barney' }, 15976 * { 'user': 'fred' } 15977 * ]; 15978 * 15979 * // The `_.property` iteratee shorthand. 15980 * _.map(users, 'user'); 15981 * // => ['barney', 'fred'] 15982 */ 15983 function map(collection, iteratee) { 15984 var func = isArray(collection) ? arrayMap : baseMap; 15985 return func(collection, getIteratee(iteratee, 3)); 15986 } 15987 15988 /** 15989 * This method is like `_.sortBy` except that it allows specifying the sort 15990 * orders of the iteratees to sort by. If `orders` is unspecified, all values 15991 * are sorted in ascending order. Otherwise, specify an order of "desc" for 15992 * descending or "asc" for ascending sort order of corresponding values. 15993 * 15994 * @static 15995 * @memberOf _ 15996 * @since 4.0.0 15997 * @category Collection 15998 * @param {Array|Object} collection The collection to iterate over. 15999 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 16000 * The iteratees to sort by. 16001 * @param {string[]} [orders] The sort orders of `iteratees`. 16002 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 16003 * @returns {Array} Returns the new sorted array. 16004 * @example 16005 * 16006 * var users = [ 16007 * { 'user': 'fred', 'age': 48 }, 16008 * { 'user': 'barney', 'age': 34 }, 16009 * { 'user': 'fred', 'age': 40 }, 16010 * { 'user': 'barney', 'age': 36 } 16011 * ]; 16012 * 16013 * // Sort by `user` in ascending order and by `age` in descending order. 16014 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 16015 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 16016 */ 16017 function orderBy(collection, iteratees, orders, guard) { 16018 if (collection == null) { 16019 return []; 16020 } 16021 if (!isArray(iteratees)) { 16022 iteratees = iteratees == null ? [] : [iteratees]; 16023 } 16024 orders = guard ? undefined : orders; 16025 if (!isArray(orders)) { 16026 orders = orders == null ? [] : [orders]; 16027 } 16028 return baseOrderBy(collection, iteratees, orders); 16029 } 16030 16031 /** 16032 * Creates an array of elements split into two groups, the first of which 16033 * contains elements `predicate` returns truthy for, the second of which 16034 * contains elements `predicate` returns falsey for. The predicate is 16035 * invoked with one argument: (value). 16036 * 16037 * @static 16038 * @memberOf _ 16039 * @since 3.0.0 16040 * @category Collection 16041 * @param {Array|Object} collection The collection to iterate over. 16042 * @param {Function} [predicate=_.identity] The function invoked per iteration. 16043 * @returns {Array} Returns the array of grouped elements. 16044 * @example 16045 * 16046 * var users = [ 16047 * { 'user': 'barney', 'age': 36, 'active': false }, 16048 * { 'user': 'fred', 'age': 40, 'active': true }, 16049 * { 'user': 'pebbles', 'age': 1, 'active': false } 16050 * ]; 16051 * 16052 * _.partition(users, function(o) { return o.active; }); 16053 * // => objects for [['fred'], ['barney', 'pebbles']] 16054 * 16055 * // The `_.matches` iteratee shorthand. 16056 * _.partition(users, { 'age': 1, 'active': false }); 16057 * // => objects for [['pebbles'], ['barney', 'fred']] 16058 * 16059 * // The `_.matchesProperty` iteratee shorthand. 16060 * _.partition(users, ['active', false]); 16061 * // => objects for [['barney', 'pebbles'], ['fred']] 16062 * 16063 * // The `_.property` iteratee shorthand. 16064 * _.partition(users, 'active'); 16065 * // => objects for [['fred'], ['barney', 'pebbles']] 16066 */ 16067 var partition = createAggregator(function(result, value, key) { 16068 result[key ? 0 : 1].push(value); 16069 }, function() { return [[], []]; }); 16070 16071 /** 16072 * Reduces `collection` to a value which is the accumulated result of running 16073 * each element in `collection` thru `iteratee`, where each successive 16074 * invocation is supplied the return value of the previous. If `accumulator` 16075 * is not given, the first element of `collection` is used as the initial 16076 * value. The iteratee is invoked with four arguments: 16077 * (accumulator, value, index|key, collection). 16078 * 16079 * Many lodash methods are guarded to work as iteratees for methods like 16080 * `_.reduce`, `_.reduceRight`, and `_.transform`. 16081 * 16082 * The guarded methods are: 16083 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 16084 * and `sortBy` 16085 * 16086 * @static 16087 * @memberOf _ 16088 * @since 0.1.0 16089 * @category Collection 16090 * @param {Array|Object} collection The collection to iterate over. 16091 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 16092 * @param {*} [accumulator] The initial value. 16093 * @returns {*} Returns the accumulated value. 16094 * @see _.reduceRight 16095 * @example 16096 * 16097 * _.reduce([1, 2], function(sum, n) { 16098 * return sum + n; 16099 * }, 0); 16100 * // => 3 16101 * 16102 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 16103 * (result[value] || (result[value] = [])).push(key); 16104 * return result; 16105 * }, {}); 16106 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 16107 */ 16108 function reduce(collection, iteratee, accumulator) { 16109 var func = isArray(collection) ? arrayReduce : baseReduce, 16110 initAccum = arguments.length < 3; 16111 16112 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); 16113 } 16114 16115 /** 16116 * This method is like `_.reduce` except that it iterates over elements of 16117 * `collection` from right to left. 16118 * 16119 * @static 16120 * @memberOf _ 16121 * @since 0.1.0 16122 * @category Collection 16123 * @param {Array|Object} collection The collection to iterate over. 16124 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 16125 * @param {*} [accumulator] The initial value. 16126 * @returns {*} Returns the accumulated value. 16127 * @see _.reduce 16128 * @example 16129 * 16130 * var array = [[0, 1], [2, 3], [4, 5]]; 16131 * 16132 * _.reduceRight(array, function(flattened, other) { 16133 * return flattened.concat(other); 16134 * }, []); 16135 * // => [4, 5, 2, 3, 0, 1] 16136 */ 16137 function reduceRight(collection, iteratee, accumulator) { 16138 var func = isArray(collection) ? arrayReduceRight : baseReduce, 16139 initAccum = arguments.length < 3; 16140 16141 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); 16142 } 16143 16144 /** 16145 * The opposite of `_.filter`; this method returns the elements of `collection` 16146 * that `predicate` does **not** return truthy for. 16147 * 16148 * @static 16149 * @memberOf _ 16150 * @since 0.1.0 16151 * @category Collection 16152 * @param {Array|Object} collection The collection to iterate over. 16153 * @param {Function} [predicate=_.identity] The function invoked per iteration. 16154 * @returns {Array} Returns the new filtered array. 16155 * @see _.filter 16156 * @example 16157 * 16158 * var users = [ 16159 * { 'user': 'barney', 'age': 36, 'active': false }, 16160 * { 'user': 'fred', 'age': 40, 'active': true } 16161 * ]; 16162 * 16163 * _.reject(users, function(o) { return !o.active; }); 16164 * // => objects for ['fred'] 16165 * 16166 * // The `_.matches` iteratee shorthand. 16167 * _.reject(users, { 'age': 40, 'active': true }); 16168 * // => objects for ['barney'] 16169 * 16170 * // The `_.matchesProperty` iteratee shorthand. 16171 * _.reject(users, ['active', false]); 16172 * // => objects for ['fred'] 16173 * 16174 * // The `_.property` iteratee shorthand. 16175 * _.reject(users, 'active'); 16176 * // => objects for ['barney'] 16177 */ 16178 function reject(collection, predicate) { 16179 var func = isArray(collection) ? arrayFilter : baseFilter; 16180 return func(collection, negate(getIteratee(predicate, 3))); 16181 } 16182 16183 /** 16184 * Gets a random element from `collection`. 16185 * 16186 * @static 16187 * @memberOf _ 16188 * @since 2.0.0 16189 * @category Collection 16190 * @param {Array|Object} collection The collection to sample. 16191 * @returns {*} Returns the random element. 16192 * @example 16193 * 16194 * _.sample([1, 2, 3, 4]); 16195 * // => 2 16196 */ 16197 function sample(collection) { 16198 var func = isArray(collection) ? arraySample : baseSample; 16199 return func(collection); 16200 } 16201 16202 /** 16203 * Gets `n` random elements at unique keys from `collection` up to the 16204 * size of `collection`. 16205 * 16206 * @static 16207 * @memberOf _ 16208 * @since 4.0.0 16209 * @category Collection 16210 * @param {Array|Object} collection The collection to sample. 16211 * @param {number} [n=1] The number of elements to sample. 16212 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 16213 * @returns {Array} Returns the random elements. 16214 * @example 16215 * 16216 * _.sampleSize([1, 2, 3], 2); 16217 * // => [3, 1] 16218 * 16219 * _.sampleSize([1, 2, 3], 4); 16220 * // => [2, 3, 1] 16221 */ 16222 function sampleSize(collection, n, guard) { 16223 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { 16224 n = 1; 16225 } else { 16226 n = toInteger(n); 16227 } 16228 var func = isArray(collection) ? arraySampleSize : baseSampleSize; 16229 return func(collection, n); 16230 } 16231 16232 /** 16233 * Creates an array of shuffled values, using a version of the 16234 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 16235 * 16236 * @static 16237 * @memberOf _ 16238 * @since 0.1.0 16239 * @category Collection 16240 * @param {Array|Object} collection The collection to shuffle. 16241 * @returns {Array} Returns the new shuffled array. 16242 * @example 16243 * 16244 * _.shuffle([1, 2, 3, 4]); 16245 * // => [4, 1, 3, 2] 16246 */ 16247 function shuffle(collection) { 16248 var func = isArray(collection) ? arrayShuffle : baseShuffle; 16249 return func(collection); 16250 } 16251 16252 /** 16253 * Gets the size of `collection` by returning its length for array-like 16254 * values or the number of own enumerable string keyed properties for objects. 16255 * 16256 * @static 16257 * @memberOf _ 16258 * @since 0.1.0 16259 * @category Collection 16260 * @param {Array|Object|string} collection The collection to inspect. 16261 * @returns {number} Returns the collection size. 16262 * @example 16263 * 16264 * _.size([1, 2, 3]); 16265 * // => 3 16266 * 16267 * _.size({ 'a': 1, 'b': 2 }); 16268 * // => 2 16269 * 16270 * _.size('pebbles'); 16271 * // => 7 16272 */ 16273 function size(collection) { 16274 if (collection == null) { 16275 return 0; 16276 } 16277 if (isArrayLike(collection)) { 16278 return isString(collection) ? stringSize(collection) : collection.length; 16279 } 16280 var tag = getTag(collection); 16281 if (tag == mapTag || tag == setTag) { 16282 return collection.size; 16283 } 16284 return baseKeys(collection).length; 16285 } 16286 16287 /** 16288 * Checks if `predicate` returns truthy for **any** element of `collection`. 16289 * Iteration is stopped once `predicate` returns truthy. The predicate is 16290 * invoked with three arguments: (value, index|key, collection). 16291 * 16292 * @static 16293 * @memberOf _ 16294 * @since 0.1.0 16295 * @category Collection 16296 * @param {Array|Object} collection The collection to iterate over. 16297 * @param {Function} [predicate=_.identity] The function invoked per iteration. 16298 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 16299 * @returns {boolean} Returns `true` if any element passes the predicate check, 16300 * else `false`. 16301 * @example 16302 * 16303 * _.some([null, 0, 'yes', false], Boolean); 16304 * // => true 16305 * 16306 * var users = [ 16307 * { 'user': 'barney', 'active': true }, 16308 * { 'user': 'fred', 'active': false } 16309 * ]; 16310 * 16311 * // The `_.matches` iteratee shorthand. 16312 * _.some(users, { 'user': 'barney', 'active': false }); 16313 * // => false 16314 * 16315 * // The `_.matchesProperty` iteratee shorthand. 16316 * _.some(users, ['active', false]); 16317 * // => true 16318 * 16319 * // The `_.property` iteratee shorthand. 16320 * _.some(users, 'active'); 16321 * // => true 16322 */ 16323 function some(collection, predicate, guard) { 16324 var func = isArray(collection) ? arraySome : baseSome; 16325 if (guard && isIterateeCall(collection, predicate, guard)) { 16326 predicate = undefined; 16327 } 16328 return func(collection, getIteratee(predicate, 3)); 16329 } 16330 16331 /** 16332 * Creates an array of elements, sorted in ascending order by the results of 16333 * running each element in a collection thru each iteratee. This method 16334 * performs a stable sort, that is, it preserves the original sort order of 16335 * equal elements. The iteratees are invoked with one argument: (value). 16336 * 16337 * @static 16338 * @memberOf _ 16339 * @since 0.1.0 16340 * @category Collection 16341 * @param {Array|Object} collection The collection to iterate over. 16342 * @param {...(Function|Function[])} [iteratees=[_.identity]] 16343 * The iteratees to sort by. 16344 * @returns {Array} Returns the new sorted array. 16345 * @example 16346 * 16347 * var users = [ 16348 * { 'user': 'fred', 'age': 48 }, 16349 * { 'user': 'barney', 'age': 36 }, 16350 * { 'user': 'fred', 'age': 30 }, 16351 * { 'user': 'barney', 'age': 34 } 16352 * ]; 16353 * 16354 * _.sortBy(users, [function(o) { return o.user; }]); 16355 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 16356 * 16357 * _.sortBy(users, ['user', 'age']); 16358 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 16359 */ 16360 var sortBy = baseRest(function(collection, iteratees) { 16361 if (collection == null) { 16362 return []; 16363 } 16364 var length = iteratees.length; 16365 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 16366 iteratees = []; 16367 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 16368 iteratees = [iteratees[0]]; 16369 } 16370 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 16371 }); 16372 16373 /*------------------------------------------------------------------------*/ 16374 16375 /** 16376 * Gets the timestamp of the number of milliseconds that have elapsed since 16377 * the Unix epoch (1 January 1970 00:00:00 UTC). 16378 * 16379 * @static 16380 * @memberOf _ 16381 * @since 2.4.0 16382 * @category Date 16383 * @returns {number} Returns the timestamp. 16384 * @example 16385 * 16386 * _.defer(function(stamp) { 16387 * console.log(_.now() - stamp); 16388 * }, _.now()); 16389 * // => Logs the number of milliseconds it took for the deferred invocation. 16390 */ 16391 var now = ctxNow || function() { 16392 return root.Date.now(); 16393 }; 16394 16395 /*------------------------------------------------------------------------*/ 16396 16397 /** 16398 * The opposite of `_.before`; this method creates a function that invokes 16399 * `func` once it's called `n` or more times. 16400 * 16401 * @static 16402 * @memberOf _ 16403 * @since 0.1.0 16404 * @category Function 16405 * @param {number} n The number of calls before `func` is invoked. 16406 * @param {Function} func The function to restrict. 16407 * @returns {Function} Returns the new restricted function. 16408 * @example 16409 * 16410 * var saves = ['profile', 'settings']; 16411 * 16412 * var done = _.after(saves.length, function() { 16413 * console.log('done saving!'); 16414 * }); 16415 * 16416 * _.forEach(saves, function(type) { 16417 * asyncSave({ 'type': type, 'complete': done }); 16418 * }); 16419 * // => Logs 'done saving!' after the two async saves have completed. 16420 */ 16421 function after(n, func) { 16422 if (typeof func != 'function') { 16423 throw new TypeError(FUNC_ERROR_TEXT); 16424 } 16425 n = toInteger(n); 16426 return function() { 16427 if (--n < 1) { 16428 return func.apply(this, arguments); 16429 } 16430 }; 16431 } 16432 16433 /** 16434 * Creates a function that invokes `func`, with up to `n` arguments, 16435 * ignoring any additional arguments. 16436 * 16437 * @static 16438 * @memberOf _ 16439 * @since 3.0.0 16440 * @category Function 16441 * @param {Function} func The function to cap arguments for. 16442 * @param {number} [n=func.length] The arity cap. 16443 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 16444 * @returns {Function} Returns the new capped function. 16445 * @example 16446 * 16447 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 16448 * // => [6, 8, 10] 16449 */ 16450 function ary(func, n, guard) { 16451 n = guard ? undefined : n; 16452 n = (func && n == null) ? func.length : n; 16453 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); 16454 } 16455 16456 /** 16457 * Creates a function that invokes `func`, with the `this` binding and arguments 16458 * of the created function, while it's called less than `n` times. Subsequent 16459 * calls to the created function return the result of the last `func` invocation. 16460 * 16461 * @static 16462 * @memberOf _ 16463 * @since 3.0.0 16464 * @category Function 16465 * @param {number} n The number of calls at which `func` is no longer invoked. 16466 * @param {Function} func The function to restrict. 16467 * @returns {Function} Returns the new restricted function. 16468 * @example 16469 * 16470 * jQuery(element).on('click', _.before(5, addContactToList)); 16471 * // => Allows adding up to 4 contacts to the list. 16472 */ 16473 function before(n, func) { 16474 var result; 16475 if (typeof func != 'function') { 16476 throw new TypeError(FUNC_ERROR_TEXT); 16477 } 16478 n = toInteger(n); 16479 return function() { 16480 if (--n > 0) { 16481 result = func.apply(this, arguments); 16482 } 16483 if (n <= 1) { 16484 func = undefined; 16485 } 16486 return result; 16487 }; 16488 } 16489 16490 /** 16491 * Creates a function that invokes `func` with the `this` binding of `thisArg` 16492 * and `partials` prepended to the arguments it receives. 16493 * 16494 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 16495 * may be used as a placeholder for partially applied arguments. 16496 * 16497 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 16498 * property of bound functions. 16499 * 16500 * @static 16501 * @memberOf _ 16502 * @since 0.1.0 16503 * @category Function 16504 * @param {Function} func The function to bind. 16505 * @param {*} thisArg The `this` binding of `func`. 16506 * @param {...*} [partials] The arguments to be partially applied. 16507 * @returns {Function} Returns the new bound function. 16508 * @example 16509 * 16510 * function greet(greeting, punctuation) { 16511 * return greeting + ' ' + this.user + punctuation; 16512 * } 16513 * 16514 * var object = { 'user': 'fred' }; 16515 * 16516 * var bound = _.bind(greet, object, 'hi'); 16517 * bound('!'); 16518 * // => 'hi fred!' 16519 * 16520 * // Bound with placeholders. 16521 * var bound = _.bind(greet, object, _, '!'); 16522 * bound('hi'); 16523 * // => 'hi fred!' 16524 */ 16525 var bind = baseRest(function(func, thisArg, partials) { 16526 var bitmask = WRAP_BIND_FLAG; 16527 if (partials.length) { 16528 var holders = replaceHolders(partials, getHolder(bind)); 16529 bitmask |= WRAP_PARTIAL_FLAG; 16530 } 16531 return createWrap(func, bitmask, thisArg, partials, holders); 16532 }); 16533 16534 /** 16535 * Creates a function that invokes the method at `object[key]` with `partials` 16536 * prepended to the arguments it receives. 16537 * 16538 * This method differs from `_.bind` by allowing bound functions to reference 16539 * methods that may be redefined or don't yet exist. See 16540 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 16541 * for more details. 16542 * 16543 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 16544 * builds, may be used as a placeholder for partially applied arguments. 16545 * 16546 * @static 16547 * @memberOf _ 16548 * @since 0.10.0 16549 * @category Function 16550 * @param {Object} object The object to invoke the method on. 16551 * @param {string} key The key of the method. 16552 * @param {...*} [partials] The arguments to be partially applied. 16553 * @returns {Function} Returns the new bound function. 16554 * @example 16555 * 16556 * var object = { 16557 * 'user': 'fred', 16558 * 'greet': function(greeting, punctuation) { 16559 * return greeting + ' ' + this.user + punctuation; 16560 * } 16561 * }; 16562 * 16563 * var bound = _.bindKey(object, 'greet', 'hi'); 16564 * bound('!'); 16565 * // => 'hi fred!' 16566 * 16567 * object.greet = function(greeting, punctuation) { 16568 * return greeting + 'ya ' + this.user + punctuation; 16569 * }; 16570 * 16571 * bound('!'); 16572 * // => 'hiya fred!' 16573 * 16574 * // Bound with placeholders. 16575 * var bound = _.bindKey(object, 'greet', _, '!'); 16576 * bound('hi'); 16577 * // => 'hiya fred!' 16578 */ 16579 var bindKey = baseRest(function(object, key, partials) { 16580 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 16581 if (partials.length) { 16582 var holders = replaceHolders(partials, getHolder(bindKey)); 16583 bitmask |= WRAP_PARTIAL_FLAG; 16584 } 16585 return createWrap(key, bitmask, object, partials, holders); 16586 }); 16587 16588 /** 16589 * Creates a function that accepts arguments of `func` and either invokes 16590 * `func` returning its result, if at least `arity` number of arguments have 16591 * been provided, or returns a function that accepts the remaining `func` 16592 * arguments, and so on. The arity of `func` may be specified if `func.length` 16593 * is not sufficient. 16594 * 16595 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 16596 * may be used as a placeholder for provided arguments. 16597 * 16598 * **Note:** This method doesn't set the "length" property of curried functions. 16599 * 16600 * @static 16601 * @memberOf _ 16602 * @since 2.0.0 16603 * @category Function 16604 * @param {Function} func The function to curry. 16605 * @param {number} [arity=func.length] The arity of `func`. 16606 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 16607 * @returns {Function} Returns the new curried function. 16608 * @example 16609 * 16610 * var abc = function(a, b, c) { 16611 * return [a, b, c]; 16612 * }; 16613 * 16614 * var curried = _.curry(abc); 16615 * 16616 * curried(1)(2)(3); 16617 * // => [1, 2, 3] 16618 * 16619 * curried(1, 2)(3); 16620 * // => [1, 2, 3] 16621 * 16622 * curried(1, 2, 3); 16623 * // => [1, 2, 3] 16624 * 16625 * // Curried with placeholders. 16626 * curried(1)(_, 3)(2); 16627 * // => [1, 2, 3] 16628 */ 16629 function curry(func, arity, guard) { 16630 arity = guard ? undefined : arity; 16631 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 16632 result.placeholder = curry.placeholder; 16633 return result; 16634 } 16635 16636 /** 16637 * This method is like `_.curry` except that arguments are applied to `func` 16638 * in the manner of `_.partialRight` instead of `_.partial`. 16639 * 16640 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 16641 * builds, may be used as a placeholder for provided arguments. 16642 * 16643 * **Note:** This method doesn't set the "length" property of curried functions. 16644 * 16645 * @static 16646 * @memberOf _ 16647 * @since 3.0.0 16648 * @category Function 16649 * @param {Function} func The function to curry. 16650 * @param {number} [arity=func.length] The arity of `func`. 16651 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 16652 * @returns {Function} Returns the new curried function. 16653 * @example 16654 * 16655 * var abc = function(a, b, c) { 16656 * return [a, b, c]; 16657 * }; 16658 * 16659 * var curried = _.curryRight(abc); 16660 * 16661 * curried(3)(2)(1); 16662 * // => [1, 2, 3] 16663 * 16664 * curried(2, 3)(1); 16665 * // => [1, 2, 3] 16666 * 16667 * curried(1, 2, 3); 16668 * // => [1, 2, 3] 16669 * 16670 * // Curried with placeholders. 16671 * curried(3)(1, _)(2); 16672 * // => [1, 2, 3] 16673 */ 16674 function curryRight(func, arity, guard) { 16675 arity = guard ? undefined : arity; 16676 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 16677 result.placeholder = curryRight.placeholder; 16678 return result; 16679 } 16680 16681 /** 16682 * Creates a debounced function that delays invoking `func` until after `wait` 16683 * milliseconds have elapsed since the last time the debounced function was 16684 * invoked. The debounced function comes with a `cancel` method to cancel 16685 * delayed `func` invocations and a `flush` method to immediately invoke them. 16686 * Provide `options` to indicate whether `func` should be invoked on the 16687 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 16688 * with the last arguments provided to the debounced function. Subsequent 16689 * calls to the debounced function return the result of the last `func` 16690 * invocation. 16691 * 16692 * **Note:** If `leading` and `trailing` options are `true`, `func` is 16693 * invoked on the trailing edge of the timeout only if the debounced function 16694 * is invoked more than once during the `wait` timeout. 16695 * 16696 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 16697 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 16698 * 16699 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 16700 * for details over the differences between `_.debounce` and `_.throttle`. 16701 * 16702 * @static 16703 * @memberOf _ 16704 * @since 0.1.0 16705 * @category Function 16706 * @param {Function} func The function to debounce. 16707 * @param {number} [wait=0] The number of milliseconds to delay. 16708 * @param {Object} [options={}] The options object. 16709 * @param {boolean} [options.leading=false] 16710 * Specify invoking on the leading edge of the timeout. 16711 * @param {number} [options.maxWait] 16712 * The maximum time `func` is allowed to be delayed before it's invoked. 16713 * @param {boolean} [options.trailing=true] 16714 * Specify invoking on the trailing edge of the timeout. 16715 * @returns {Function} Returns the new debounced function. 16716 * @example 16717 * 16718 * // Avoid costly calculations while the window size is in flux. 16719 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 16720 * 16721 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 16722 * jQuery(element).on('click', _.debounce(sendMail, 300, { 16723 * 'leading': true, 16724 * 'trailing': false 16725 * })); 16726 * 16727 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 16728 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 16729 * var source = new EventSource('/stream'); 16730 * jQuery(source).on('message', debounced); 16731 * 16732 * // Cancel the trailing debounced invocation. 16733 * jQuery(window).on('popstate', debounced.cancel); 16734 */ 16735 function debounce(func, wait, options) { 16736 var lastArgs, 16737 lastThis, 16738 maxWait, 16739 result, 16740 timerId, 16741 lastCallTime, 16742 lastInvokeTime = 0, 16743 leading = false, 16744 maxing = false, 16745 trailing = true; 16746 16747 if (typeof func != 'function') { 16748 throw new TypeError(FUNC_ERROR_TEXT); 16749 } 16750 wait = toNumber(wait) || 0; 16751 if (isObject(options)) { 16752 leading = !!options.leading; 16753 maxing = 'maxWait' in options; 16754 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 16755 trailing = 'trailing' in options ? !!options.trailing : trailing; 16756 } 16757 16758 function invokeFunc(time) { 16759 var args = lastArgs, 16760 thisArg = lastThis; 16761 16762 lastArgs = lastThis = undefined; 16763 lastInvokeTime = time; 16764 result = func.apply(thisArg, args); 16765 return result; 16766 } 16767 16768 function leadingEdge(time) { 16769 // Reset any `maxWait` timer. 16770 lastInvokeTime = time; 16771 // Start the timer for the trailing edge. 16772 timerId = setTimeout(timerExpired, wait); 16773 // Invoke the leading edge. 16774 return leading ? invokeFunc(time) : result; 16775 } 16776 16777 function remainingWait(time) { 16778 var timeSinceLastCall = time - lastCallTime, 16779 timeSinceLastInvoke = time - lastInvokeTime, 16780 timeWaiting = wait - timeSinceLastCall; 16781 16782 return maxing 16783 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 16784 : timeWaiting; 16785 } 16786 16787 function shouldInvoke(time) { 16788 var timeSinceLastCall = time - lastCallTime, 16789 timeSinceLastInvoke = time - lastInvokeTime; 16790 16791 // Either this is the first call, activity has stopped and we're at the 16792 // trailing edge, the system time has gone backwards and we're treating 16793 // it as the trailing edge, or we've hit the `maxWait` limit. 16794 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 16795 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 16796 } 16797 16798 function timerExpired() { 16799 var time = now(); 16800 if (shouldInvoke(time)) { 16801 return trailingEdge(time); 16802 } 16803 // Restart the timer. 16804 timerId = setTimeout(timerExpired, remainingWait(time)); 16805 } 16806 16807 function trailingEdge(time) { 16808 timerId = undefined; 16809 16810 // Only invoke if we have `lastArgs` which means `func` has been 16811 // debounced at least once. 16812 if (trailing && lastArgs) { 16813 return invokeFunc(time); 16814 } 16815 lastArgs = lastThis = undefined; 16816 return result; 16817 } 16818 16819 function cancel() { 16820 if (timerId !== undefined) { 16821 clearTimeout(timerId); 16822 } 16823 lastInvokeTime = 0; 16824 lastArgs = lastCallTime = lastThis = timerId = undefined; 16825 } 16826 16827 function flush() { 16828 return timerId === undefined ? result : trailingEdge(now()); 16829 } 16830 16831 function debounced() { 16832 var time = now(), 16833 isInvoking = shouldInvoke(time); 16834 16835 lastArgs = arguments; 16836 lastThis = this; 16837 lastCallTime = time; 16838 16839 if (isInvoking) { 16840 if (timerId === undefined) { 16841 return leadingEdge(lastCallTime); 16842 } 16843 if (maxing) { 16844 // Handle invocations in a tight loop. 16845 clearTimeout(timerId); 16846 timerId = setTimeout(timerExpired, wait); 16847 return invokeFunc(lastCallTime); 16848 } 16849 } 16850 if (timerId === undefined) { 16851 timerId = setTimeout(timerExpired, wait); 16852 } 16853 return result; 16854 } 16855 debounced.cancel = cancel; 16856 debounced.flush = flush; 16857 return debounced; 16858 } 16859 16860 /** 16861 * Defers invoking the `func` until the current call stack has cleared. Any 16862 * additional arguments are provided to `func` when it's invoked. 16863 * 16864 * @static 16865 * @memberOf _ 16866 * @since 0.1.0 16867 * @category Function 16868 * @param {Function} func The function to defer. 16869 * @param {...*} [args] The arguments to invoke `func` with. 16870 * @returns {number} Returns the timer id. 16871 * @example 16872 * 16873 * _.defer(function(text) { 16874 * console.log(text); 16875 * }, 'deferred'); 16876 * // => Logs 'deferred' after one millisecond. 16877 */ 16878 var defer = baseRest(function(func, args) { 16879 return baseDelay(func, 1, args); 16880 }); 16881 16882 /** 16883 * Invokes `func` after `wait` milliseconds. Any additional arguments are 16884 * provided to `func` when it's invoked. 16885 * 16886 * @static 16887 * @memberOf _ 16888 * @since 0.1.0 16889 * @category Function 16890 * @param {Function} func The function to delay. 16891 * @param {number} wait The number of milliseconds to delay invocation. 16892 * @param {...*} [args] The arguments to invoke `func` with. 16893 * @returns {number} Returns the timer id. 16894 * @example 16895 * 16896 * _.delay(function(text) { 16897 * console.log(text); 16898 * }, 1000, 'later'); 16899 * // => Logs 'later' after one second. 16900 */ 16901 var delay = baseRest(function(func, wait, args) { 16902 return baseDelay(func, toNumber(wait) || 0, args); 16903 }); 16904 16905 /** 16906 * Creates a function that invokes `func` with arguments reversed. 16907 * 16908 * @static 16909 * @memberOf _ 16910 * @since 4.0.0 16911 * @category Function 16912 * @param {Function} func The function to flip arguments for. 16913 * @returns {Function} Returns the new flipped function. 16914 * @example 16915 * 16916 * var flipped = _.flip(function() { 16917 * return _.toArray(arguments); 16918 * }); 16919 * 16920 * flipped('a', 'b', 'c', 'd'); 16921 * // => ['d', 'c', 'b', 'a'] 16922 */ 16923 function flip(func) { 16924 return createWrap(func, WRAP_FLIP_FLAG); 16925 } 16926 16927 /** 16928 * Creates a function that memoizes the result of `func`. If `resolver` is 16929 * provided, it determines the cache key for storing the result based on the 16930 * arguments provided to the memoized function. By default, the first argument 16931 * provided to the memoized function is used as the map cache key. The `func` 16932 * is invoked with the `this` binding of the memoized function. 16933 * 16934 * **Note:** The cache is exposed as the `cache` property on the memoized 16935 * function. Its creation may be customized by replacing the `_.memoize.Cache` 16936 * constructor with one whose instances implement the 16937 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 16938 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 16939 * 16940 * @static 16941 * @memberOf _ 16942 * @since 0.1.0 16943 * @category Function 16944 * @param {Function} func The function to have its output memoized. 16945 * @param {Function} [resolver] The function to resolve the cache key. 16946 * @returns {Function} Returns the new memoized function. 16947 * @example 16948 * 16949 * var object = { 'a': 1, 'b': 2 }; 16950 * var other = { 'c': 3, 'd': 4 }; 16951 * 16952 * var values = _.memoize(_.values); 16953 * values(object); 16954 * // => [1, 2] 16955 * 16956 * values(other); 16957 * // => [3, 4] 16958 * 16959 * object.a = 2; 16960 * values(object); 16961 * // => [1, 2] 16962 * 16963 * // Modify the result cache. 16964 * values.cache.set(object, ['a', 'b']); 16965 * values(object); 16966 * // => ['a', 'b'] 16967 * 16968 * // Replace `_.memoize.Cache`. 16969 * _.memoize.Cache = WeakMap; 16970 */ 16971 function memoize(func, resolver) { 16972 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { 16973 throw new TypeError(FUNC_ERROR_TEXT); 16974 } 16975 var memoized = function() { 16976 var args = arguments, 16977 key = resolver ? resolver.apply(this, args) : args[0], 16978 cache = memoized.cache; 16979 16980 if (cache.has(key)) { 16981 return cache.get(key); 16982 } 16983 var result = func.apply(this, args); 16984 memoized.cache = cache.set(key, result) || cache; 16985 return result; 16986 }; 16987 memoized.cache = new (memoize.Cache || MapCache); 16988 return memoized; 16989 } 16990 16991 // Expose `MapCache`. 16992 memoize.Cache = MapCache; 16993 16994 /** 16995 * Creates a function that negates the result of the predicate `func`. The 16996 * `func` predicate is invoked with the `this` binding and arguments of the 16997 * created function. 16998 * 16999 * @static 17000 * @memberOf _ 17001 * @since 3.0.0 17002 * @category Function 17003 * @param {Function} predicate The predicate to negate. 17004 * @returns {Function} Returns the new negated function. 17005 * @example 17006 * 17007 * function isEven(n) { 17008 * return n % 2 == 0; 17009 * } 17010 * 17011 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 17012 * // => [1, 3, 5] 17013 */ 17014 function negate(predicate) { 17015 if (typeof predicate != 'function') { 17016 throw new TypeError(FUNC_ERROR_TEXT); 17017 } 17018 return function() { 17019 var args = arguments; 17020 switch (args.length) { 17021 case 0: return !predicate.call(this); 17022 case 1: return !predicate.call(this, args[0]); 17023 case 2: return !predicate.call(this, args[0], args[1]); 17024 case 3: return !predicate.call(this, args[0], args[1], args[2]); 17025 } 17026 return !predicate.apply(this, args); 17027 }; 17028 } 17029 17030 /** 17031 * Creates a function that is restricted to invoking `func` once. Repeat calls 17032 * to the function return the value of the first invocation. The `func` is 17033 * invoked with the `this` binding and arguments of the created function. 17034 * 17035 * @static 17036 * @memberOf _ 17037 * @since 0.1.0 17038 * @category Function 17039 * @param {Function} func The function to restrict. 17040 * @returns {Function} Returns the new restricted function. 17041 * @example 17042 * 17043 * var initialize = _.once(createApplication); 17044 * initialize(); 17045 * initialize(); 17046 * // => `createApplication` is invoked once 17047 */ 17048 function once(func) { 17049 return before(2, func); 17050 } 17051 17052 /** 17053 * Creates a function that invokes `func` with its arguments transformed. 17054 * 17055 * @static 17056 * @since 4.0.0 17057 * @memberOf _ 17058 * @category Function 17059 * @param {Function} func The function to wrap. 17060 * @param {...(Function|Function[])} [transforms=[_.identity]] 17061 * The argument transforms. 17062 * @returns {Function} Returns the new function. 17063 * @example 17064 * 17065 * function doubled(n) { 17066 * return n * 2; 17067 * } 17068 * 17069 * function square(n) { 17070 * return n * n; 17071 * } 17072 * 17073 * var func = _.overArgs(function(x, y) { 17074 * return [x, y]; 17075 * }, [square, doubled]); 17076 * 17077 * func(9, 3); 17078 * // => [81, 6] 17079 * 17080 * func(10, 5); 17081 * // => [100, 10] 17082 */ 17083 var overArgs = castRest(function(func, transforms) { 17084 transforms = (transforms.length == 1 && isArray(transforms[0])) 17085 ? arrayMap(transforms[0], baseUnary(getIteratee())) 17086 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 17087 17088 var funcsLength = transforms.length; 17089 return baseRest(function(args) { 17090 var index = -1, 17091 length = nativeMin(args.length, funcsLength); 17092 17093 while (++index < length) { 17094 args[index] = transforms[index].call(this, args[index]); 17095 } 17096 return apply(func, this, args); 17097 }); 17098 }); 17099 17100 /** 17101 * Creates a function that invokes `func` with `partials` prepended to the 17102 * arguments it receives. This method is like `_.bind` except it does **not** 17103 * alter the `this` binding. 17104 * 17105 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 17106 * builds, may be used as a placeholder for partially applied arguments. 17107 * 17108 * **Note:** This method doesn't set the "length" property of partially 17109 * applied functions. 17110 * 17111 * @static 17112 * @memberOf _ 17113 * @since 0.2.0 17114 * @category Function 17115 * @param {Function} func The function to partially apply arguments to. 17116 * @param {...*} [partials] The arguments to be partially applied. 17117 * @returns {Function} Returns the new partially applied function. 17118 * @example 17119 * 17120 * function greet(greeting, name) { 17121 * return greeting + ' ' + name; 17122 * } 17123 * 17124 * var sayHelloTo = _.partial(greet, 'hello'); 17125 * sayHelloTo('fred'); 17126 * // => 'hello fred' 17127 * 17128 * // Partially applied with placeholders. 17129 * var greetFred = _.partial(greet, _, 'fred'); 17130 * greetFred('hi'); 17131 * // => 'hi fred' 17132 */ 17133 var partial = baseRest(function(func, partials) { 17134 var holders = replaceHolders(partials, getHolder(partial)); 17135 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); 17136 }); 17137 17138 /** 17139 * This method is like `_.partial` except that partially applied arguments 17140 * are appended to the arguments it receives. 17141 * 17142 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 17143 * builds, may be used as a placeholder for partially applied arguments. 17144 * 17145 * **Note:** This method doesn't set the "length" property of partially 17146 * applied functions. 17147 * 17148 * @static 17149 * @memberOf _ 17150 * @since 1.0.0 17151 * @category Function 17152 * @param {Function} func The function to partially apply arguments to. 17153 * @param {...*} [partials] The arguments to be partially applied. 17154 * @returns {Function} Returns the new partially applied function. 17155 * @example 17156 * 17157 * function greet(greeting, name) { 17158 * return greeting + ' ' + name; 17159 * } 17160 * 17161 * var greetFred = _.partialRight(greet, 'fred'); 17162 * greetFred('hi'); 17163 * // => 'hi fred' 17164 * 17165 * // Partially applied with placeholders. 17166 * var sayHelloTo = _.partialRight(greet, 'hello', _); 17167 * sayHelloTo('fred'); 17168 * // => 'hello fred' 17169 */ 17170 var partialRight = baseRest(function(func, partials) { 17171 var holders = replaceHolders(partials, getHolder(partialRight)); 17172 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); 17173 }); 17174 17175 /** 17176 * Creates a function that invokes `func` with arguments arranged according 17177 * to the specified `indexes` where the argument value at the first index is 17178 * provided as the first argument, the argument value at the second index is 17179 * provided as the second argument, and so on. 17180 * 17181 * @static 17182 * @memberOf _ 17183 * @since 3.0.0 17184 * @category Function 17185 * @param {Function} func The function to rearrange arguments for. 17186 * @param {...(number|number[])} indexes The arranged argument indexes. 17187 * @returns {Function} Returns the new function. 17188 * @example 17189 * 17190 * var rearged = _.rearg(function(a, b, c) { 17191 * return [a, b, c]; 17192 * }, [2, 0, 1]); 17193 * 17194 * rearged('b', 'c', 'a') 17195 * // => ['a', 'b', 'c'] 17196 */ 17197 var rearg = flatRest(function(func, indexes) { 17198 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); 17199 }); 17200 17201 /** 17202 * Creates a function that invokes `func` with the `this` binding of the 17203 * created function and arguments from `start` and beyond provided as 17204 * an array. 17205 * 17206 * **Note:** This method is based on the 17207 * [rest parameter](https://mdn.io/rest_parameters). 17208 * 17209 * @static 17210 * @memberOf _ 17211 * @since 4.0.0 17212 * @category Function 17213 * @param {Function} func The function to apply a rest parameter to. 17214 * @param {number} [start=func.length-1] The start position of the rest parameter. 17215 * @returns {Function} Returns the new function. 17216 * @example 17217 * 17218 * var say = _.rest(function(what, names) { 17219 * return what + ' ' + _.initial(names).join(', ') + 17220 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 17221 * }); 17222 * 17223 * say('hello', 'fred', 'barney', 'pebbles'); 17224 * // => 'hello fred, barney, & pebbles' 17225 */ 17226 function rest(func, start) { 17227 if (typeof func != 'function') { 17228 throw new TypeError(FUNC_ERROR_TEXT); 17229 } 17230 start = start === undefined ? start : toInteger(start); 17231 return baseRest(func, start); 17232 } 17233 17234 /** 17235 * Creates a function that invokes `func` with the `this` binding of the 17236 * create function and an array of arguments much like 17237 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 17238 * 17239 * **Note:** This method is based on the 17240 * [spread operator](https://mdn.io/spread_operator). 17241 * 17242 * @static 17243 * @memberOf _ 17244 * @since 3.2.0 17245 * @category Function 17246 * @param {Function} func The function to spread arguments over. 17247 * @param {number} [start=0] The start position of the spread. 17248 * @returns {Function} Returns the new function. 17249 * @example 17250 * 17251 * var say = _.spread(function(who, what) { 17252 * return who + ' says ' + what; 17253 * }); 17254 * 17255 * say(['fred', 'hello']); 17256 * // => 'fred says hello' 17257 * 17258 * var numbers = Promise.all([ 17259 * Promise.resolve(40), 17260 * Promise.resolve(36) 17261 * ]); 17262 * 17263 * numbers.then(_.spread(function(x, y) { 17264 * return x + y; 17265 * })); 17266 * // => a Promise of 76 17267 */ 17268 function spread(func, start) { 17269 if (typeof func != 'function') { 17270 throw new TypeError(FUNC_ERROR_TEXT); 17271 } 17272 start = start == null ? 0 : nativeMax(toInteger(start), 0); 17273 return baseRest(function(args) { 17274 var array = args[start], 17275 otherArgs = castSlice(args, 0, start); 17276 17277 if (array) { 17278 arrayPush(otherArgs, array); 17279 } 17280 return apply(func, this, otherArgs); 17281 }); 17282 } 17283 17284 /** 17285 * Creates a throttled function that only invokes `func` at most once per 17286 * every `wait` milliseconds. The throttled function comes with a `cancel` 17287 * method to cancel delayed `func` invocations and a `flush` method to 17288 * immediately invoke them. Provide `options` to indicate whether `func` 17289 * should be invoked on the leading and/or trailing edge of the `wait` 17290 * timeout. The `func` is invoked with the last arguments provided to the 17291 * throttled function. Subsequent calls to the throttled function return the 17292 * result of the last `func` invocation. 17293 * 17294 * **Note:** If `leading` and `trailing` options are `true`, `func` is 17295 * invoked on the trailing edge of the timeout only if the throttled function 17296 * is invoked more than once during the `wait` timeout. 17297 * 17298 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 17299 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 17300 * 17301 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 17302 * for details over the differences between `_.throttle` and `_.debounce`. 17303 * 17304 * @static 17305 * @memberOf _ 17306 * @since 0.1.0 17307 * @category Function 17308 * @param {Function} func The function to throttle. 17309 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 17310 * @param {Object} [options={}] The options object. 17311 * @param {boolean} [options.leading=true] 17312 * Specify invoking on the leading edge of the timeout. 17313 * @param {boolean} [options.trailing=true] 17314 * Specify invoking on the trailing edge of the timeout. 17315 * @returns {Function} Returns the new throttled function. 17316 * @example 17317 * 17318 * // Avoid excessively updating the position while scrolling. 17319 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 17320 * 17321 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 17322 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 17323 * jQuery(element).on('click', throttled); 17324 * 17325 * // Cancel the trailing throttled invocation. 17326 * jQuery(window).on('popstate', throttled.cancel); 17327 */ 17328 function throttle(func, wait, options) { 17329 var leading = true, 17330 trailing = true; 17331 17332 if (typeof func != 'function') { 17333 throw new TypeError(FUNC_ERROR_TEXT); 17334 } 17335 if (isObject(options)) { 17336 leading = 'leading' in options ? !!options.leading : leading; 17337 trailing = 'trailing' in options ? !!options.trailing : trailing; 17338 } 17339 return debounce(func, wait, { 17340 'leading': leading, 17341 'maxWait': wait, 17342 'trailing': trailing 17343 }); 17344 } 17345 17346 /** 17347 * Creates a function that accepts up to one argument, ignoring any 17348 * additional arguments. 17349 * 17350 * @static 17351 * @memberOf _ 17352 * @since 4.0.0 17353 * @category Function 17354 * @param {Function} func The function to cap arguments for. 17355 * @returns {Function} Returns the new capped function. 17356 * @example 17357 * 17358 * _.map(['6', '8', '10'], _.unary(parseInt)); 17359 * // => [6, 8, 10] 17360 */ 17361 function unary(func) { 17362 return ary(func, 1); 17363 } 17364 17365 /** 17366 * Creates a function that provides `value` to `wrapper` as its first 17367 * argument. Any additional arguments provided to the function are appended 17368 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 17369 * binding of the created function. 17370 * 17371 * @static 17372 * @memberOf _ 17373 * @since 0.1.0 17374 * @category Function 17375 * @param {*} value The value to wrap. 17376 * @param {Function} [wrapper=identity] The wrapper function. 17377 * @returns {Function} Returns the new function. 17378 * @example 17379 * 17380 * var p = _.wrap(_.escape, function(func, text) { 17381 * return '<p>' + func(text) + '</p>'; 17382 * }); 17383 * 17384 * p('fred, barney, & pebbles'); 17385 * // => '<p>fred, barney, & pebbles</p>' 17386 */ 17387 function wrap(value, wrapper) { 17388 return partial(castFunction(wrapper), value); 17389 } 17390 17391 /*------------------------------------------------------------------------*/ 17392 17393 /** 17394 * Casts `value` as an array if it's not one. 17395 * 17396 * @static 17397 * @memberOf _ 17398 * @since 4.4.0 17399 * @category Lang 17400 * @param {*} value The value to inspect. 17401 * @returns {Array} Returns the cast array. 17402 * @example 17403 * 17404 * _.castArray(1); 17405 * // => [1] 17406 * 17407 * _.castArray({ 'a': 1 }); 17408 * // => [{ 'a': 1 }] 17409 * 17410 * _.castArray('abc'); 17411 * // => ['abc'] 17412 * 17413 * _.castArray(null); 17414 * // => [null] 17415 * 17416 * _.castArray(undefined); 17417 * // => [undefined] 17418 * 17419 * _.castArray(); 17420 * // => [] 17421 * 17422 * var array = [1, 2, 3]; 17423 * console.log(_.castArray(array) === array); 17424 * // => true 17425 */ 17426 function castArray() { 17427 if (!arguments.length) { 17428 return []; 17429 } 17430 var value = arguments[0]; 17431 return isArray(value) ? value : [value]; 17432 } 17433 17434 /** 17435 * Creates a shallow clone of `value`. 17436 * 17437 * **Note:** This method is loosely based on the 17438 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 17439 * and supports cloning arrays, array buffers, booleans, date objects, maps, 17440 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 17441 * arrays. The own enumerable properties of `arguments` objects are cloned 17442 * as plain objects. An empty object is returned for uncloneable values such 17443 * as error objects, functions, DOM nodes, and WeakMaps. 17444 * 17445 * @static 17446 * @memberOf _ 17447 * @since 0.1.0 17448 * @category Lang 17449 * @param {*} value The value to clone. 17450 * @returns {*} Returns the cloned value. 17451 * @see _.cloneDeep 17452 * @example 17453 * 17454 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 17455 * 17456 * var shallow = _.clone(objects); 17457 * console.log(shallow[0] === objects[0]); 17458 * // => true 17459 */ 17460 function clone(value) { 17461 return baseClone(value, CLONE_SYMBOLS_FLAG); 17462 } 17463 17464 /** 17465 * This method is like `_.clone` except that it accepts `customizer` which 17466 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 17467 * cloning is handled by the method instead. The `customizer` is invoked with 17468 * up to four arguments; (value [, index|key, object, stack]). 17469 * 17470 * @static 17471 * @memberOf _ 17472 * @since 4.0.0 17473 * @category Lang 17474 * @param {*} value The value to clone. 17475 * @param {Function} [customizer] The function to customize cloning. 17476 * @returns {*} Returns the cloned value. 17477 * @see _.cloneDeepWith 17478 * @example 17479 * 17480 * function customizer(value) { 17481 * if (_.isElement(value)) { 17482 * return value.cloneNode(false); 17483 * } 17484 * } 17485 * 17486 * var el = _.cloneWith(document.body, customizer); 17487 * 17488 * console.log(el === document.body); 17489 * // => false 17490 * console.log(el.nodeName); 17491 * // => 'BODY' 17492 * console.log(el.childNodes.length); 17493 * // => 0 17494 */ 17495 function cloneWith(value, customizer) { 17496 customizer = typeof customizer == 'function' ? customizer : undefined; 17497 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 17498 } 17499 17500 /** 17501 * This method is like `_.clone` except that it recursively clones `value`. 17502 * 17503 * @static 17504 * @memberOf _ 17505 * @since 1.0.0 17506 * @category Lang 17507 * @param {*} value The value to recursively clone. 17508 * @returns {*} Returns the deep cloned value. 17509 * @see _.clone 17510 * @example 17511 * 17512 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 17513 * 17514 * var deep = _.cloneDeep(objects); 17515 * console.log(deep[0] === objects[0]); 17516 * // => false 17517 */ 17518 function cloneDeep(value) { 17519 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 17520 } 17521 17522 /** 17523 * This method is like `_.cloneWith` except that it recursively clones `value`. 17524 * 17525 * @static 17526 * @memberOf _ 17527 * @since 4.0.0 17528 * @category Lang 17529 * @param {*} value The value to recursively clone. 17530 * @param {Function} [customizer] The function to customize cloning. 17531 * @returns {*} Returns the deep cloned value. 17532 * @see _.cloneWith 17533 * @example 17534 * 17535 * function customizer(value) { 17536 * if (_.isElement(value)) { 17537 * return value.cloneNode(true); 17538 * } 17539 * } 17540 * 17541 * var el = _.cloneDeepWith(document.body, customizer); 17542 * 17543 * console.log(el === document.body); 17544 * // => false 17545 * console.log(el.nodeName); 17546 * // => 'BODY' 17547 * console.log(el.childNodes.length); 17548 * // => 20 17549 */ 17550 function cloneDeepWith(value, customizer) { 17551 customizer = typeof customizer == 'function' ? customizer : undefined; 17552 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 17553 } 17554 17555 /** 17556 * Checks if `object` conforms to `source` by invoking the predicate 17557 * properties of `source` with the corresponding property values of `object`. 17558 * 17559 * **Note:** This method is equivalent to `_.conforms` when `source` is 17560 * partially applied. 17561 * 17562 * @static 17563 * @memberOf _ 17564 * @since 4.14.0 17565 * @category Lang 17566 * @param {Object} object The object to inspect. 17567 * @param {Object} source The object of property predicates to conform to. 17568 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 17569 * @example 17570 * 17571 * var object = { 'a': 1, 'b': 2 }; 17572 * 17573 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 17574 * // => true 17575 * 17576 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 17577 * // => false 17578 */ 17579 function conformsTo(object, source) { 17580 return source == null || baseConformsTo(object, source, keys(source)); 17581 } 17582 17583 /** 17584 * Performs a 17585 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 17586 * comparison between two values to determine if they are equivalent. 17587 * 17588 * @static 17589 * @memberOf _ 17590 * @since 4.0.0 17591 * @category Lang 17592 * @param {*} value The value to compare. 17593 * @param {*} other The other value to compare. 17594 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 17595 * @example 17596 * 17597 * var object = { 'a': 1 }; 17598 * var other = { 'a': 1 }; 17599 * 17600 * _.eq(object, object); 17601 * // => true 17602 * 17603 * _.eq(object, other); 17604 * // => false 17605 * 17606 * _.eq('a', 'a'); 17607 * // => true 17608 * 17609 * _.eq('a', Object('a')); 17610 * // => false 17611 * 17612 * _.eq(NaN, NaN); 17613 * // => true 17614 */ 17615 function eq(value, other) { 17616 return value === other || (value !== value && other !== other); 17617 } 17618 17619 /** 17620 * Checks if `value` is greater than `other`. 17621 * 17622 * @static 17623 * @memberOf _ 17624 * @since 3.9.0 17625 * @category Lang 17626 * @param {*} value The value to compare. 17627 * @param {*} other The other value to compare. 17628 * @returns {boolean} Returns `true` if `value` is greater than `other`, 17629 * else `false`. 17630 * @see _.lt 17631 * @example 17632 * 17633 * _.gt(3, 1); 17634 * // => true 17635 * 17636 * _.gt(3, 3); 17637 * // => false 17638 * 17639 * _.gt(1, 3); 17640 * // => false 17641 */ 17642 var gt = createRelationalOperation(baseGt); 17643 17644 /** 17645 * Checks if `value` is greater than or equal to `other`. 17646 * 17647 * @static 17648 * @memberOf _ 17649 * @since 3.9.0 17650 * @category Lang 17651 * @param {*} value The value to compare. 17652 * @param {*} other The other value to compare. 17653 * @returns {boolean} Returns `true` if `value` is greater than or equal to 17654 * `other`, else `false`. 17655 * @see _.lte 17656 * @example 17657 * 17658 * _.gte(3, 1); 17659 * // => true 17660 * 17661 * _.gte(3, 3); 17662 * // => true 17663 * 17664 * _.gte(1, 3); 17665 * // => false 17666 */ 17667 var gte = createRelationalOperation(function(value, other) { 17668 return value >= other; 17669 }); 17670 17671 /** 17672 * Checks if `value` is likely an `arguments` object. 17673 * 17674 * @static 17675 * @memberOf _ 17676 * @since 0.1.0 17677 * @category Lang 17678 * @param {*} value The value to check. 17679 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 17680 * else `false`. 17681 * @example 17682 * 17683 * _.isArguments(function() { return arguments; }()); 17684 * // => true 17685 * 17686 * _.isArguments([1, 2, 3]); 17687 * // => false 17688 */ 17689 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 17690 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 17691 !propertyIsEnumerable.call(value, 'callee'); 17692 }; 17693 17694 /** 17695 * Checks if `value` is classified as an `Array` object. 17696 * 17697 * @static 17698 * @memberOf _ 17699 * @since 0.1.0 17700 * @category Lang 17701 * @param {*} value The value to check. 17702 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 17703 * @example 17704 * 17705 * _.isArray([1, 2, 3]); 17706 * // => true 17707 * 17708 * _.isArray(document.body.children); 17709 * // => false 17710 * 17711 * _.isArray('abc'); 17712 * // => false 17713 * 17714 * _.isArray(_.noop); 17715 * // => false 17716 */ 17717 var isArray = Array.isArray; 17718 17719 /** 17720 * Checks if `value` is classified as an `ArrayBuffer` object. 17721 * 17722 * @static 17723 * @memberOf _ 17724 * @since 4.3.0 17725 * @category Lang 17726 * @param {*} value The value to check. 17727 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 17728 * @example 17729 * 17730 * _.isArrayBuffer(new ArrayBuffer(2)); 17731 * // => true 17732 * 17733 * _.isArrayBuffer(new Array(2)); 17734 * // => false 17735 */ 17736 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 17737 17738 /** 17739 * Checks if `value` is array-like. A value is considered array-like if it's 17740 * not a function and has a `value.length` that's an integer greater than or 17741 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 17742 * 17743 * @static 17744 * @memberOf _ 17745 * @since 4.0.0 17746 * @category Lang 17747 * @param {*} value The value to check. 17748 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 17749 * @example 17750 * 17751 * _.isArrayLike([1, 2, 3]); 17752 * // => true 17753 * 17754 * _.isArrayLike(document.body.children); 17755 * // => true 17756 * 17757 * _.isArrayLike('abc'); 17758 * // => true 17759 * 17760 * _.isArrayLike(_.noop); 17761 * // => false 17762 */ 17763 function isArrayLike(value) { 17764 return value != null && isLength(value.length) && !isFunction(value); 17765 } 17766 17767 /** 17768 * This method is like `_.isArrayLike` except that it also checks if `value` 17769 * is an object. 17770 * 17771 * @static 17772 * @memberOf _ 17773 * @since 4.0.0 17774 * @category Lang 17775 * @param {*} value The value to check. 17776 * @returns {boolean} Returns `true` if `value` is an array-like object, 17777 * else `false`. 17778 * @example 17779 * 17780 * _.isArrayLikeObject([1, 2, 3]); 17781 * // => true 17782 * 17783 * _.isArrayLikeObject(document.body.children); 17784 * // => true 17785 * 17786 * _.isArrayLikeObject('abc'); 17787 * // => false 17788 * 17789 * _.isArrayLikeObject(_.noop); 17790 * // => false 17791 */ 17792 function isArrayLikeObject(value) { 17793 return isObjectLike(value) && isArrayLike(value); 17794 } 17795 17796 /** 17797 * Checks if `value` is classified as a boolean primitive or object. 17798 * 17799 * @static 17800 * @memberOf _ 17801 * @since 0.1.0 17802 * @category Lang 17803 * @param {*} value The value to check. 17804 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 17805 * @example 17806 * 17807 * _.isBoolean(false); 17808 * // => true 17809 * 17810 * _.isBoolean(null); 17811 * // => false 17812 */ 17813 function isBoolean(value) { 17814 return value === true || value === false || 17815 (isObjectLike(value) && baseGetTag(value) == boolTag); 17816 } 17817 17818 /** 17819 * Checks if `value` is a buffer. 17820 * 17821 * @static 17822 * @memberOf _ 17823 * @since 4.3.0 17824 * @category Lang 17825 * @param {*} value The value to check. 17826 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 17827 * @example 17828 * 17829 * _.isBuffer(new Buffer(2)); 17830 * // => true 17831 * 17832 * _.isBuffer(new Uint8Array(2)); 17833 * // => false 17834 */ 17835 var isBuffer = nativeIsBuffer || stubFalse; 17836 17837 /** 17838 * Checks if `value` is classified as a `Date` object. 17839 * 17840 * @static 17841 * @memberOf _ 17842 * @since 0.1.0 17843 * @category Lang 17844 * @param {*} value The value to check. 17845 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 17846 * @example 17847 * 17848 * _.isDate(new Date); 17849 * // => true 17850 * 17851 * _.isDate('Mon April 23 2012'); 17852 * // => false 17853 */ 17854 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 17855 17856 /** 17857 * Checks if `value` is likely a DOM element. 17858 * 17859 * @static 17860 * @memberOf _ 17861 * @since 0.1.0 17862 * @category Lang 17863 * @param {*} value The value to check. 17864 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 17865 * @example 17866 * 17867 * _.isElement(document.body); 17868 * // => true 17869 * 17870 * _.isElement('<body>'); 17871 * // => false 17872 */ 17873 function isElement(value) { 17874 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); 17875 } 17876 17877 /** 17878 * Checks if `value` is an empty object, collection, map, or set. 17879 * 17880 * Objects are considered empty if they have no own enumerable string keyed 17881 * properties. 17882 * 17883 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 17884 * jQuery-like collections are considered empty if they have a `length` of `0`. 17885 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 17886 * 17887 * @static 17888 * @memberOf _ 17889 * @since 0.1.0 17890 * @category Lang 17891 * @param {*} value The value to check. 17892 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 17893 * @example 17894 * 17895 * _.isEmpty(null); 17896 * // => true 17897 * 17898 * _.isEmpty(true); 17899 * // => true 17900 * 17901 * _.isEmpty(1); 17902 * // => true 17903 * 17904 * _.isEmpty([1, 2, 3]); 17905 * // => false 17906 * 17907 * _.isEmpty({ 'a': 1 }); 17908 * // => false 17909 */ 17910 function isEmpty(value) { 17911 if (value == null) { 17912 return true; 17913 } 17914 if (isArrayLike(value) && 17915 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 17916 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 17917 return !value.length; 17918 } 17919 var tag = getTag(value); 17920 if (tag == mapTag || tag == setTag) { 17921 return !value.size; 17922 } 17923 if (isPrototype(value)) { 17924 return !baseKeys(value).length; 17925 } 17926 for (var key in value) { 17927 if (hasOwnProperty.call(value, key)) { 17928 return false; 17929 } 17930 } 17931 return true; 17932 } 17933 17934 /** 17935 * Performs a deep comparison between two values to determine if they are 17936 * equivalent. 17937 * 17938 * **Note:** This method supports comparing arrays, array buffers, booleans, 17939 * date objects, error objects, maps, numbers, `Object` objects, regexes, 17940 * sets, strings, symbols, and typed arrays. `Object` objects are compared 17941 * by their own, not inherited, enumerable properties. Functions and DOM 17942 * nodes are compared by strict equality, i.e. `===`. 17943 * 17944 * @static 17945 * @memberOf _ 17946 * @since 0.1.0 17947 * @category Lang 17948 * @param {*} value The value to compare. 17949 * @param {*} other The other value to compare. 17950 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 17951 * @example 17952 * 17953 * var object = { 'a': 1 }; 17954 * var other = { 'a': 1 }; 17955 * 17956 * _.isEqual(object, other); 17957 * // => true 17958 * 17959 * object === other; 17960 * // => false 17961 */ 17962 function isEqual(value, other) { 17963 return baseIsEqual(value, other); 17964 } 17965 17966 /** 17967 * This method is like `_.isEqual` except that it accepts `customizer` which 17968 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 17969 * are handled by the method instead. The `customizer` is invoked with up to 17970 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 17971 * 17972 * @static 17973 * @memberOf _ 17974 * @since 4.0.0 17975 * @category Lang 17976 * @param {*} value The value to compare. 17977 * @param {*} other The other value to compare. 17978 * @param {Function} [customizer] The function to customize comparisons. 17979 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 17980 * @example 17981 * 17982 * function isGreeting(value) { 17983 * return /^h(?:i|ello)$/.test(value); 17984 * } 17985 * 17986 * function customizer(objValue, othValue) { 17987 * if (isGreeting(objValue) && isGreeting(othValue)) { 17988 * return true; 17989 * } 17990 * } 17991 * 17992 * var array = ['hello', 'goodbye']; 17993 * var other = ['hi', 'goodbye']; 17994 * 17995 * _.isEqualWith(array, other, customizer); 17996 * // => true 17997 */ 17998 function isEqualWith(value, other, customizer) { 17999 customizer = typeof customizer == 'function' ? customizer : undefined; 18000 var result = customizer ? customizer(value, other) : undefined; 18001 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; 18002 } 18003 18004 /** 18005 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 18006 * `SyntaxError`, `TypeError`, or `URIError` object. 18007 * 18008 * @static 18009 * @memberOf _ 18010 * @since 3.0.0 18011 * @category Lang 18012 * @param {*} value The value to check. 18013 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 18014 * @example 18015 * 18016 * _.isError(new Error); 18017 * // => true 18018 * 18019 * _.isError(Error); 18020 * // => false 18021 */ 18022 function isError(value) { 18023 if (!isObjectLike(value)) { 18024 return false; 18025 } 18026 var tag = baseGetTag(value); 18027 return tag == errorTag || tag == domExcTag || 18028 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); 18029 } 18030 18031 /** 18032 * Checks if `value` is a finite primitive number. 18033 * 18034 * **Note:** This method is based on 18035 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 18036 * 18037 * @static 18038 * @memberOf _ 18039 * @since 0.1.0 18040 * @category Lang 18041 * @param {*} value The value to check. 18042 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 18043 * @example 18044 * 18045 * _.isFinite(3); 18046 * // => true 18047 * 18048 * _.isFinite(Number.MIN_VALUE); 18049 * // => true 18050 * 18051 * _.isFinite(Infinity); 18052 * // => false 18053 * 18054 * _.isFinite('3'); 18055 * // => false 18056 */ 18057 function isFinite(value) { 18058 return typeof value == 'number' && nativeIsFinite(value); 18059 } 18060 18061 /** 18062 * Checks if `value` is classified as a `Function` object. 18063 * 18064 * @static 18065 * @memberOf _ 18066 * @since 0.1.0 18067 * @category Lang 18068 * @param {*} value The value to check. 18069 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 18070 * @example 18071 * 18072 * _.isFunction(_); 18073 * // => true 18074 * 18075 * _.isFunction(/abc/); 18076 * // => false 18077 */ 18078 function isFunction(value) { 18079 if (!isObject(value)) { 18080 return false; 18081 } 18082 // The use of `Object#toString` avoids issues with the `typeof` operator 18083 // in Safari 9 which returns 'object' for typed arrays and other constructors. 18084 var tag = baseGetTag(value); 18085 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 18086 } 18087 18088 /** 18089 * Checks if `value` is an integer. 18090 * 18091 * **Note:** This method is based on 18092 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 18093 * 18094 * @static 18095 * @memberOf _ 18096 * @since 4.0.0 18097 * @category Lang 18098 * @param {*} value The value to check. 18099 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 18100 * @example 18101 * 18102 * _.isInteger(3); 18103 * // => true 18104 * 18105 * _.isInteger(Number.MIN_VALUE); 18106 * // => false 18107 * 18108 * _.isInteger(Infinity); 18109 * // => false 18110 * 18111 * _.isInteger('3'); 18112 * // => false 18113 */ 18114 function isInteger(value) { 18115 return typeof value == 'number' && value == toInteger(value); 18116 } 18117 18118 /** 18119 * Checks if `value` is a valid array-like length. 18120 * 18121 * **Note:** This method is loosely based on 18122 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 18123 * 18124 * @static 18125 * @memberOf _ 18126 * @since 4.0.0 18127 * @category Lang 18128 * @param {*} value The value to check. 18129 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 18130 * @example 18131 * 18132 * _.isLength(3); 18133 * // => true 18134 * 18135 * _.isLength(Number.MIN_VALUE); 18136 * // => false 18137 * 18138 * _.isLength(Infinity); 18139 * // => false 18140 * 18141 * _.isLength('3'); 18142 * // => false 18143 */ 18144 function isLength(value) { 18145 return typeof value == 'number' && 18146 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 18147 } 18148 18149 /** 18150 * Checks if `value` is the 18151 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 18152 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 18153 * 18154 * @static 18155 * @memberOf _ 18156 * @since 0.1.0 18157 * @category Lang 18158 * @param {*} value The value to check. 18159 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 18160 * @example 18161 * 18162 * _.isObject({}); 18163 * // => true 18164 * 18165 * _.isObject([1, 2, 3]); 18166 * // => true 18167 * 18168 * _.isObject(_.noop); 18169 * // => true 18170 * 18171 * _.isObject(null); 18172 * // => false 18173 */ 18174 function isObject(value) { 18175 var type = typeof value; 18176 return value != null && (type == 'object' || type == 'function'); 18177 } 18178 18179 /** 18180 * Checks if `value` is object-like. A value is object-like if it's not `null` 18181 * and has a `typeof` result of "object". 18182 * 18183 * @static 18184 * @memberOf _ 18185 * @since 4.0.0 18186 * @category Lang 18187 * @param {*} value The value to check. 18188 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 18189 * @example 18190 * 18191 * _.isObjectLike({}); 18192 * // => true 18193 * 18194 * _.isObjectLike([1, 2, 3]); 18195 * // => true 18196 * 18197 * _.isObjectLike(_.noop); 18198 * // => false 18199 * 18200 * _.isObjectLike(null); 18201 * // => false 18202 */ 18203 function isObjectLike(value) { 18204 return value != null && typeof value == 'object'; 18205 } 18206 18207 /** 18208 * Checks if `value` is classified as a `Map` object. 18209 * 18210 * @static 18211 * @memberOf _ 18212 * @since 4.3.0 18213 * @category Lang 18214 * @param {*} value The value to check. 18215 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 18216 * @example 18217 * 18218 * _.isMap(new Map); 18219 * // => true 18220 * 18221 * _.isMap(new WeakMap); 18222 * // => false 18223 */ 18224 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 18225 18226 /** 18227 * Performs a partial deep comparison between `object` and `source` to 18228 * determine if `object` contains equivalent property values. 18229 * 18230 * **Note:** This method is equivalent to `_.matches` when `source` is 18231 * partially applied. 18232 * 18233 * Partial comparisons will match empty array and empty object `source` 18234 * values against any array or object value, respectively. See `_.isEqual` 18235 * for a list of supported value comparisons. 18236 * 18237 * @static 18238 * @memberOf _ 18239 * @since 3.0.0 18240 * @category Lang 18241 * @param {Object} object The object to inspect. 18242 * @param {Object} source The object of property values to match. 18243 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 18244 * @example 18245 * 18246 * var object = { 'a': 1, 'b': 2 }; 18247 * 18248 * _.isMatch(object, { 'b': 2 }); 18249 * // => true 18250 * 18251 * _.isMatch(object, { 'b': 1 }); 18252 * // => false 18253 */ 18254 function isMatch(object, source) { 18255 return object === source || baseIsMatch(object, source, getMatchData(source)); 18256 } 18257 18258 /** 18259 * This method is like `_.isMatch` except that it accepts `customizer` which 18260 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 18261 * are handled by the method instead. The `customizer` is invoked with five 18262 * arguments: (objValue, srcValue, index|key, object, source). 18263 * 18264 * @static 18265 * @memberOf _ 18266 * @since 4.0.0 18267 * @category Lang 18268 * @param {Object} object The object to inspect. 18269 * @param {Object} source The object of property values to match. 18270 * @param {Function} [customizer] The function to customize comparisons. 18271 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 18272 * @example 18273 * 18274 * function isGreeting(value) { 18275 * return /^h(?:i|ello)$/.test(value); 18276 * } 18277 * 18278 * function customizer(objValue, srcValue) { 18279 * if (isGreeting(objValue) && isGreeting(srcValue)) { 18280 * return true; 18281 * } 18282 * } 18283 * 18284 * var object = { 'greeting': 'hello' }; 18285 * var source = { 'greeting': 'hi' }; 18286 * 18287 * _.isMatchWith(object, source, customizer); 18288 * // => true 18289 */ 18290 function isMatchWith(object, source, customizer) { 18291 customizer = typeof customizer == 'function' ? customizer : undefined; 18292 return baseIsMatch(object, source, getMatchData(source), customizer); 18293 } 18294 18295 /** 18296 * Checks if `value` is `NaN`. 18297 * 18298 * **Note:** This method is based on 18299 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 18300 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 18301 * `undefined` and other non-number values. 18302 * 18303 * @static 18304 * @memberOf _ 18305 * @since 0.1.0 18306 * @category Lang 18307 * @param {*} value The value to check. 18308 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 18309 * @example 18310 * 18311 * _.isNaN(NaN); 18312 * // => true 18313 * 18314 * _.isNaN(new Number(NaN)); 18315 * // => true 18316 * 18317 * isNaN(undefined); 18318 * // => true 18319 * 18320 * _.isNaN(undefined); 18321 * // => false 18322 */ 18323 function isNaN(value) { 18324 // An `NaN` primitive is the only value that is not equal to itself. 18325 // Perform the `toStringTag` check first to avoid errors with some 18326 // ActiveX objects in IE. 18327 return isNumber(value) && value != +value; 18328 } 18329 18330 /** 18331 * Checks if `value` is a pristine native function. 18332 * 18333 * **Note:** This method can't reliably detect native functions in the presence 18334 * of the core-js package because core-js circumvents this kind of detection. 18335 * Despite multiple requests, the core-js maintainer has made it clear: any 18336 * attempt to fix the detection will be obstructed. As a result, we're left 18337 * with little choice but to throw an error. Unfortunately, this also affects 18338 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 18339 * which rely on core-js. 18340 * 18341 * @static 18342 * @memberOf _ 18343 * @since 3.0.0 18344 * @category Lang 18345 * @param {*} value The value to check. 18346 * @returns {boolean} Returns `true` if `value` is a native function, 18347 * else `false`. 18348 * @example 18349 * 18350 * _.isNative(Array.prototype.push); 18351 * // => true 18352 * 18353 * _.isNative(_); 18354 * // => false 18355 */ 18356 function isNative(value) { 18357 if (isMaskable(value)) { 18358 throw new Error(CORE_ERROR_TEXT); 18359 } 18360 return baseIsNative(value); 18361 } 18362 18363 /** 18364 * Checks if `value` is `null`. 18365 * 18366 * @static 18367 * @memberOf _ 18368 * @since 0.1.0 18369 * @category Lang 18370 * @param {*} value The value to check. 18371 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 18372 * @example 18373 * 18374 * _.isNull(null); 18375 * // => true 18376 * 18377 * _.isNull(void 0); 18378 * // => false 18379 */ 18380 function isNull(value) { 18381 return value === null; 18382 } 18383 18384 /** 18385 * Checks if `value` is `null` or `undefined`. 18386 * 18387 * @static 18388 * @memberOf _ 18389 * @since 4.0.0 18390 * @category Lang 18391 * @param {*} value The value to check. 18392 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 18393 * @example 18394 * 18395 * _.isNil(null); 18396 * // => true 18397 * 18398 * _.isNil(void 0); 18399 * // => true 18400 * 18401 * _.isNil(NaN); 18402 * // => false 18403 */ 18404 function isNil(value) { 18405 return value == null; 18406 } 18407 18408 /** 18409 * Checks if `value` is classified as a `Number` primitive or object. 18410 * 18411 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 18412 * classified as numbers, use the `_.isFinite` method. 18413 * 18414 * @static 18415 * @memberOf _ 18416 * @since 0.1.0 18417 * @category Lang 18418 * @param {*} value The value to check. 18419 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 18420 * @example 18421 * 18422 * _.isNumber(3); 18423 * // => true 18424 * 18425 * _.isNumber(Number.MIN_VALUE); 18426 * // => true 18427 * 18428 * _.isNumber(Infinity); 18429 * // => true 18430 * 18431 * _.isNumber('3'); 18432 * // => false 18433 */ 18434 function isNumber(value) { 18435 return typeof value == 'number' || 18436 (isObjectLike(value) && baseGetTag(value) == numberTag); 18437 } 18438 18439 /** 18440 * Checks if `value` is a plain object, that is, an object created by the 18441 * `Object` constructor or one with a `[[Prototype]]` of `null`. 18442 * 18443 * @static 18444 * @memberOf _ 18445 * @since 0.8.0 18446 * @category Lang 18447 * @param {*} value The value to check. 18448 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 18449 * @example 18450 * 18451 * function Foo() { 18452 * this.a = 1; 18453 * } 18454 * 18455 * _.isPlainObject(new Foo); 18456 * // => false 18457 * 18458 * _.isPlainObject([1, 2, 3]); 18459 * // => false 18460 * 18461 * _.isPlainObject({ 'x': 0, 'y': 0 }); 18462 * // => true 18463 * 18464 * _.isPlainObject(Object.create(null)); 18465 * // => true 18466 */ 18467 function isPlainObject(value) { 18468 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 18469 return false; 18470 } 18471 var proto = getPrototype(value); 18472 if (proto === null) { 18473 return true; 18474 } 18475 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 18476 return typeof Ctor == 'function' && Ctor instanceof Ctor && 18477 funcToString.call(Ctor) == objectCtorString; 18478 } 18479 18480 /** 18481 * Checks if `value` is classified as a `RegExp` object. 18482 * 18483 * @static 18484 * @memberOf _ 18485 * @since 0.1.0 18486 * @category Lang 18487 * @param {*} value The value to check. 18488 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 18489 * @example 18490 * 18491 * _.isRegExp(/abc/); 18492 * // => true 18493 * 18494 * _.isRegExp('/abc/'); 18495 * // => false 18496 */ 18497 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 18498 18499 /** 18500 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 18501 * double precision number which isn't the result of a rounded unsafe integer. 18502 * 18503 * **Note:** This method is based on 18504 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 18505 * 18506 * @static 18507 * @memberOf _ 18508 * @since 4.0.0 18509 * @category Lang 18510 * @param {*} value The value to check. 18511 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 18512 * @example 18513 * 18514 * _.isSafeInteger(3); 18515 * // => true 18516 * 18517 * _.isSafeInteger(Number.MIN_VALUE); 18518 * // => false 18519 * 18520 * _.isSafeInteger(Infinity); 18521 * // => false 18522 * 18523 * _.isSafeInteger('3'); 18524 * // => false 18525 */ 18526 function isSafeInteger(value) { 18527 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 18528 } 18529 18530 /** 18531 * Checks if `value` is classified as a `Set` object. 18532 * 18533 * @static 18534 * @memberOf _ 18535 * @since 4.3.0 18536 * @category Lang 18537 * @param {*} value The value to check. 18538 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 18539 * @example 18540 * 18541 * _.isSet(new Set); 18542 * // => true 18543 * 18544 * _.isSet(new WeakSet); 18545 * // => false 18546 */ 18547 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 18548 18549 /** 18550 * Checks if `value` is classified as a `String` primitive or object. 18551 * 18552 * @static 18553 * @since 0.1.0 18554 * @memberOf _ 18555 * @category Lang 18556 * @param {*} value The value to check. 18557 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 18558 * @example 18559 * 18560 * _.isString('abc'); 18561 * // => true 18562 * 18563 * _.isString(1); 18564 * // => false 18565 */ 18566 function isString(value) { 18567 return typeof value == 'string' || 18568 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 18569 } 18570 18571 /** 18572 * Checks if `value` is classified as a `Symbol` primitive or object. 18573 * 18574 * @static 18575 * @memberOf _ 18576 * @since 4.0.0 18577 * @category Lang 18578 * @param {*} value The value to check. 18579 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 18580 * @example 18581 * 18582 * _.isSymbol(Symbol.iterator); 18583 * // => true 18584 * 18585 * _.isSymbol('abc'); 18586 * // => false 18587 */ 18588 function isSymbol(value) { 18589 return typeof value == 'symbol' || 18590 (isObjectLike(value) && baseGetTag(value) == symbolTag); 18591 } 18592 18593 /** 18594 * Checks if `value` is classified as a typed array. 18595 * 18596 * @static 18597 * @memberOf _ 18598 * @since 3.0.0 18599 * @category Lang 18600 * @param {*} value The value to check. 18601 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 18602 * @example 18603 * 18604 * _.isTypedArray(new Uint8Array); 18605 * // => true 18606 * 18607 * _.isTypedArray([]); 18608 * // => false 18609 */ 18610 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 18611 18612 /** 18613 * Checks if `value` is `undefined`. 18614 * 18615 * @static 18616 * @since 0.1.0 18617 * @memberOf _ 18618 * @category Lang 18619 * @param {*} value The value to check. 18620 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 18621 * @example 18622 * 18623 * _.isUndefined(void 0); 18624 * // => true 18625 * 18626 * _.isUndefined(null); 18627 * // => false 18628 */ 18629 function isUndefined(value) { 18630 return value === undefined; 18631 } 18632 18633 /** 18634 * Checks if `value` is classified as a `WeakMap` object. 18635 * 18636 * @static 18637 * @memberOf _ 18638 * @since 4.3.0 18639 * @category Lang 18640 * @param {*} value The value to check. 18641 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 18642 * @example 18643 * 18644 * _.isWeakMap(new WeakMap); 18645 * // => true 18646 * 18647 * _.isWeakMap(new Map); 18648 * // => false 18649 */ 18650 function isWeakMap(value) { 18651 return isObjectLike(value) && getTag(value) == weakMapTag; 18652 } 18653 18654 /** 18655 * Checks if `value` is classified as a `WeakSet` object. 18656 * 18657 * @static 18658 * @memberOf _ 18659 * @since 4.3.0 18660 * @category Lang 18661 * @param {*} value The value to check. 18662 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 18663 * @example 18664 * 18665 * _.isWeakSet(new WeakSet); 18666 * // => true 18667 * 18668 * _.isWeakSet(new Set); 18669 * // => false 18670 */ 18671 function isWeakSet(value) { 18672 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 18673 } 18674 18675 /** 18676 * Checks if `value` is less than `other`. 18677 * 18678 * @static 18679 * @memberOf _ 18680 * @since 3.9.0 18681 * @category Lang 18682 * @param {*} value The value to compare. 18683 * @param {*} other The other value to compare. 18684 * @returns {boolean} Returns `true` if `value` is less than `other`, 18685 * else `false`. 18686 * @see _.gt 18687 * @example 18688 * 18689 * _.lt(1, 3); 18690 * // => true 18691 * 18692 * _.lt(3, 3); 18693 * // => false 18694 * 18695 * _.lt(3, 1); 18696 * // => false 18697 */ 18698 var lt = createRelationalOperation(baseLt); 18699 18700 /** 18701 * Checks if `value` is less than or equal to `other`. 18702 * 18703 * @static 18704 * @memberOf _ 18705 * @since 3.9.0 18706 * @category Lang 18707 * @param {*} value The value to compare. 18708 * @param {*} other The other value to compare. 18709 * @returns {boolean} Returns `true` if `value` is less than or equal to 18710 * `other`, else `false`. 18711 * @see _.gte 18712 * @example 18713 * 18714 * _.lte(1, 3); 18715 * // => true 18716 * 18717 * _.lte(3, 3); 18718 * // => true 18719 * 18720 * _.lte(3, 1); 18721 * // => false 18722 */ 18723 var lte = createRelationalOperation(function(value, other) { 18724 return value <= other; 18725 }); 18726 18727 /** 18728 * Converts `value` to an array. 18729 * 18730 * @static 18731 * @since 0.1.0 18732 * @memberOf _ 18733 * @category Lang 18734 * @param {*} value The value to convert. 18735 * @returns {Array} Returns the converted array. 18736 * @example 18737 * 18738 * _.toArray({ 'a': 1, 'b': 2 }); 18739 * // => [1, 2] 18740 * 18741 * _.toArray('abc'); 18742 * // => ['a', 'b', 'c'] 18743 * 18744 * _.toArray(1); 18745 * // => [] 18746 * 18747 * _.toArray(null); 18748 * // => [] 18749 */ 18750 function toArray(value) { 18751 if (!value) { 18752 return []; 18753 } 18754 if (isArrayLike(value)) { 18755 return isString(value) ? stringToArray(value) : copyArray(value); 18756 } 18757 if (symIterator && value[symIterator]) { 18758 return iteratorToArray(value[symIterator]()); 18759 } 18760 var tag = getTag(value), 18761 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); 18762 18763 return func(value); 18764 } 18765 18766 /** 18767 * Converts `value` to a finite number. 18768 * 18769 * @static 18770 * @memberOf _ 18771 * @since 4.12.0 18772 * @category Lang 18773 * @param {*} value The value to convert. 18774 * @returns {number} Returns the converted number. 18775 * @example 18776 * 18777 * _.toFinite(3.2); 18778 * // => 3.2 18779 * 18780 * _.toFinite(Number.MIN_VALUE); 18781 * // => 5e-324 18782 * 18783 * _.toFinite(Infinity); 18784 * // => 1.7976931348623157e+308 18785 * 18786 * _.toFinite('3.2'); 18787 * // => 3.2 18788 */ 18789 function toFinite(value) { 18790 if (!value) { 18791 return value === 0 ? value : 0; 18792 } 18793 value = toNumber(value); 18794 if (value === INFINITY || value === -INFINITY) { 18795 var sign = (value < 0 ? -1 : 1); 18796 return sign * MAX_INTEGER; 18797 } 18798 return value === value ? value : 0; 18799 } 18800 18801 /** 18802 * Converts `value` to an integer. 18803 * 18804 * **Note:** This method is loosely based on 18805 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 18806 * 18807 * @static 18808 * @memberOf _ 18809 * @since 4.0.0 18810 * @category Lang 18811 * @param {*} value The value to convert. 18812 * @returns {number} Returns the converted integer. 18813 * @example 18814 * 18815 * _.toInteger(3.2); 18816 * // => 3 18817 * 18818 * _.toInteger(Number.MIN_VALUE); 18819 * // => 0 18820 * 18821 * _.toInteger(Infinity); 18822 * // => 1.7976931348623157e+308 18823 * 18824 * _.toInteger('3.2'); 18825 * // => 3 18826 */ 18827 function toInteger(value) { 18828 var result = toFinite(value), 18829 remainder = result % 1; 18830 18831 return result === result ? (remainder ? result - remainder : result) : 0; 18832 } 18833 18834 /** 18835 * Converts `value` to an integer suitable for use as the length of an 18836 * array-like object. 18837 * 18838 * **Note:** This method is based on 18839 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 18840 * 18841 * @static 18842 * @memberOf _ 18843 * @since 4.0.0 18844 * @category Lang 18845 * @param {*} value The value to convert. 18846 * @returns {number} Returns the converted integer. 18847 * @example 18848 * 18849 * _.toLength(3.2); 18850 * // => 3 18851 * 18852 * _.toLength(Number.MIN_VALUE); 18853 * // => 0 18854 * 18855 * _.toLength(Infinity); 18856 * // => 4294967295 18857 * 18858 * _.toLength('3.2'); 18859 * // => 3 18860 */ 18861 function toLength(value) { 18862 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 18863 } 18864 18865 /** 18866 * Converts `value` to a number. 18867 * 18868 * @static 18869 * @memberOf _ 18870 * @since 4.0.0 18871 * @category Lang 18872 * @param {*} value The value to process. 18873 * @returns {number} Returns the number. 18874 * @example 18875 * 18876 * _.toNumber(3.2); 18877 * // => 3.2 18878 * 18879 * _.toNumber(Number.MIN_VALUE); 18880 * // => 5e-324 18881 * 18882 * _.toNumber(Infinity); 18883 * // => Infinity 18884 * 18885 * _.toNumber('3.2'); 18886 * // => 3.2 18887 */ 18888 function toNumber(value) { 18889 if (typeof value == 'number') { 18890 return value; 18891 } 18892 if (isSymbol(value)) { 18893 return NAN; 18894 } 18895 if (isObject(value)) { 18896 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 18897 value = isObject(other) ? (other + '') : other; 18898 } 18899 if (typeof value != 'string') { 18900 return value === 0 ? value : +value; 18901 } 18902 value = baseTrim(value); 18903 var isBinary = reIsBinary.test(value); 18904 return (isBinary || reIsOctal.test(value)) 18905 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 18906 : (reIsBadHex.test(value) ? NAN : +value); 18907 } 18908 18909 /** 18910 * Converts `value` to a plain object flattening inherited enumerable string 18911 * keyed properties of `value` to own properties of the plain object. 18912 * 18913 * @static 18914 * @memberOf _ 18915 * @since 3.0.0 18916 * @category Lang 18917 * @param {*} value The value to convert. 18918 * @returns {Object} Returns the converted plain object. 18919 * @example 18920 * 18921 * function Foo() { 18922 * this.b = 2; 18923 * } 18924 * 18925 * Foo.prototype.c = 3; 18926 * 18927 * _.assign({ 'a': 1 }, new Foo); 18928 * // => { 'a': 1, 'b': 2 } 18929 * 18930 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 18931 * // => { 'a': 1, 'b': 2, 'c': 3 } 18932 */ 18933 function toPlainObject(value) { 18934 return copyObject(value, keysIn(value)); 18935 } 18936 18937 /** 18938 * Converts `value` to a safe integer. A safe integer can be compared and 18939 * represented correctly. 18940 * 18941 * @static 18942 * @memberOf _ 18943 * @since 4.0.0 18944 * @category Lang 18945 * @param {*} value The value to convert. 18946 * @returns {number} Returns the converted integer. 18947 * @example 18948 * 18949 * _.toSafeInteger(3.2); 18950 * // => 3 18951 * 18952 * _.toSafeInteger(Number.MIN_VALUE); 18953 * // => 0 18954 * 18955 * _.toSafeInteger(Infinity); 18956 * // => 9007199254740991 18957 * 18958 * _.toSafeInteger('3.2'); 18959 * // => 3 18960 */ 18961 function toSafeInteger(value) { 18962 return value 18963 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) 18964 : (value === 0 ? value : 0); 18965 } 18966 18967 /** 18968 * Converts `value` to a string. An empty string is returned for `null` 18969 * and `undefined` values. The sign of `-0` is preserved. 18970 * 18971 * @static 18972 * @memberOf _ 18973 * @since 4.0.0 18974 * @category Lang 18975 * @param {*} value The value to convert. 18976 * @returns {string} Returns the converted string. 18977 * @example 18978 * 18979 * _.toString(null); 18980 * // => '' 18981 * 18982 * _.toString(-0); 18983 * // => '-0' 18984 * 18985 * _.toString([1, 2, 3]); 18986 * // => '1,2,3' 18987 */ 18988 function toString(value) { 18989 return value == null ? '' : baseToString(value); 18990 } 18991 18992 /*------------------------------------------------------------------------*/ 18993 18994 /** 18995 * Assigns own enumerable string keyed properties of source objects to the 18996 * destination object. Source objects are applied from left to right. 18997 * Subsequent sources overwrite property assignments of previous sources. 18998 * 18999 * **Note:** This method mutates `object` and is loosely based on 19000 * [`Object.assign`](https://mdn.io/Object/assign). 19001 * 19002 * @static 19003 * @memberOf _ 19004 * @since 0.10.0 19005 * @category Object 19006 * @param {Object} object The destination object. 19007 * @param {...Object} [sources] The source objects. 19008 * @returns {Object} Returns `object`. 19009 * @see _.assignIn 19010 * @example 19011 * 19012 * function Foo() { 19013 * this.a = 1; 19014 * } 19015 * 19016 * function Bar() { 19017 * this.c = 3; 19018 * } 19019 * 19020 * Foo.prototype.b = 2; 19021 * Bar.prototype.d = 4; 19022 * 19023 * _.assign({ 'a': 0 }, new Foo, new Bar); 19024 * // => { 'a': 1, 'c': 3 } 19025 */ 19026 var assign = createAssigner(function(object, source) { 19027 if (isPrototype(source) || isArrayLike(source)) { 19028 copyObject(source, keys(source), object); 19029 return; 19030 } 19031 for (var key in source) { 19032 if (hasOwnProperty.call(source, key)) { 19033 assignValue(object, key, source[key]); 19034 } 19035 } 19036 }); 19037 19038 /** 19039 * This method is like `_.assign` except that it iterates over own and 19040 * inherited source properties. 19041 * 19042 * **Note:** This method mutates `object`. 19043 * 19044 * @static 19045 * @memberOf _ 19046 * @since 4.0.0 19047 * @alias extend 19048 * @category Object 19049 * @param {Object} object The destination object. 19050 * @param {...Object} [sources] The source objects. 19051 * @returns {Object} Returns `object`. 19052 * @see _.assign 19053 * @example 19054 * 19055 * function Foo() { 19056 * this.a = 1; 19057 * } 19058 * 19059 * function Bar() { 19060 * this.c = 3; 19061 * } 19062 * 19063 * Foo.prototype.b = 2; 19064 * Bar.prototype.d = 4; 19065 * 19066 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 19067 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 19068 */ 19069 var assignIn = createAssigner(function(object, source) { 19070 copyObject(source, keysIn(source), object); 19071 }); 19072 19073 /** 19074 * This method is like `_.assignIn` except that it accepts `customizer` 19075 * which is invoked to produce the assigned values. If `customizer` returns 19076 * `undefined`, assignment is handled by the method instead. The `customizer` 19077 * is invoked with five arguments: (objValue, srcValue, key, object, source). 19078 * 19079 * **Note:** This method mutates `object`. 19080 * 19081 * @static 19082 * @memberOf _ 19083 * @since 4.0.0 19084 * @alias extendWith 19085 * @category Object 19086 * @param {Object} object The destination object. 19087 * @param {...Object} sources The source objects. 19088 * @param {Function} [customizer] The function to customize assigned values. 19089 * @returns {Object} Returns `object`. 19090 * @see _.assignWith 19091 * @example 19092 * 19093 * function customizer(objValue, srcValue) { 19094 * return _.isUndefined(objValue) ? srcValue : objValue; 19095 * } 19096 * 19097 * var defaults = _.partialRight(_.assignInWith, customizer); 19098 * 19099 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 19100 * // => { 'a': 1, 'b': 2 } 19101 */ 19102 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 19103 copyObject(source, keysIn(source), object, customizer); 19104 }); 19105 19106 /** 19107 * This method is like `_.assign` except that it accepts `customizer` 19108 * which is invoked to produce the assigned values. If `customizer` returns 19109 * `undefined`, assignment is handled by the method instead. The `customizer` 19110 * is invoked with five arguments: (objValue, srcValue, key, object, source). 19111 * 19112 * **Note:** This method mutates `object`. 19113 * 19114 * @static 19115 * @memberOf _ 19116 * @since 4.0.0 19117 * @category Object 19118 * @param {Object} object The destination object. 19119 * @param {...Object} sources The source objects. 19120 * @param {Function} [customizer] The function to customize assigned values. 19121 * @returns {Object} Returns `object`. 19122 * @see _.assignInWith 19123 * @example 19124 * 19125 * function customizer(objValue, srcValue) { 19126 * return _.isUndefined(objValue) ? srcValue : objValue; 19127 * } 19128 * 19129 * var defaults = _.partialRight(_.assignWith, customizer); 19130 * 19131 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 19132 * // => { 'a': 1, 'b': 2 } 19133 */ 19134 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 19135 copyObject(source, keys(source), object, customizer); 19136 }); 19137 19138 /** 19139 * Creates an array of values corresponding to `paths` of `object`. 19140 * 19141 * @static 19142 * @memberOf _ 19143 * @since 1.0.0 19144 * @category Object 19145 * @param {Object} object The object to iterate over. 19146 * @param {...(string|string[])} [paths] The property paths to pick. 19147 * @returns {Array} Returns the picked values. 19148 * @example 19149 * 19150 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 19151 * 19152 * _.at(object, ['a[0].b.c', 'a[1]']); 19153 * // => [3, 4] 19154 */ 19155 var at = flatRest(baseAt); 19156 19157 /** 19158 * Creates an object that inherits from the `prototype` object. If a 19159 * `properties` object is given, its own enumerable string keyed properties 19160 * are assigned to the created object. 19161 * 19162 * @static 19163 * @memberOf _ 19164 * @since 2.3.0 19165 * @category Object 19166 * @param {Object} prototype The object to inherit from. 19167 * @param {Object} [properties] The properties to assign to the object. 19168 * @returns {Object} Returns the new object. 19169 * @example 19170 * 19171 * function Shape() { 19172 * this.x = 0; 19173 * this.y = 0; 19174 * } 19175 * 19176 * function Circle() { 19177 * Shape.call(this); 19178 * } 19179 * 19180 * Circle.prototype = _.create(Shape.prototype, { 19181 * 'constructor': Circle 19182 * }); 19183 * 19184 * var circle = new Circle; 19185 * circle instanceof Circle; 19186 * // => true 19187 * 19188 * circle instanceof Shape; 19189 * // => true 19190 */ 19191 function create(prototype, properties) { 19192 var result = baseCreate(prototype); 19193 return properties == null ? result : baseAssign(result, properties); 19194 } 19195 19196 /** 19197 * Assigns own and inherited enumerable string keyed properties of source 19198 * objects to the destination object for all destination properties that 19199 * resolve to `undefined`. Source objects are applied from left to right. 19200 * Once a property is set, additional values of the same property are ignored. 19201 * 19202 * **Note:** This method mutates `object`. 19203 * 19204 * @static 19205 * @since 0.1.0 19206 * @memberOf _ 19207 * @category Object 19208 * @param {Object} object The destination object. 19209 * @param {...Object} [sources] The source objects. 19210 * @returns {Object} Returns `object`. 19211 * @see _.defaultsDeep 19212 * @example 19213 * 19214 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 19215 * // => { 'a': 1, 'b': 2 } 19216 */ 19217 var defaults = baseRest(function(object, sources) { 19218 object = Object(object); 19219 19220 var index = -1; 19221 var length = sources.length; 19222 var guard = length > 2 ? sources[2] : undefined; 19223 19224 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 19225 length = 1; 19226 } 19227 19228 while (++index < length) { 19229 var source = sources[index]; 19230 var props = keysIn(source); 19231 var propsIndex = -1; 19232 var propsLength = props.length; 19233 19234 while (++propsIndex < propsLength) { 19235 var key = props[propsIndex]; 19236 var value = object[key]; 19237 19238 if (value === undefined || 19239 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 19240 object[key] = source[key]; 19241 } 19242 } 19243 } 19244 19245 return object; 19246 }); 19247 19248 /** 19249 * This method is like `_.defaults` except that it recursively assigns 19250 * default properties. 19251 * 19252 * **Note:** This method mutates `object`. 19253 * 19254 * @static 19255 * @memberOf _ 19256 * @since 3.10.0 19257 * @category Object 19258 * @param {Object} object The destination object. 19259 * @param {...Object} [sources] The source objects. 19260 * @returns {Object} Returns `object`. 19261 * @see _.defaults 19262 * @example 19263 * 19264 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 19265 * // => { 'a': { 'b': 2, 'c': 3 } } 19266 */ 19267 var defaultsDeep = baseRest(function(args) { 19268 args.push(undefined, customDefaultsMerge); 19269 return apply(mergeWith, undefined, args); 19270 }); 19271 19272 /** 19273 * This method is like `_.find` except that it returns the key of the first 19274 * element `predicate` returns truthy for instead of the element itself. 19275 * 19276 * @static 19277 * @memberOf _ 19278 * @since 1.1.0 19279 * @category Object 19280 * @param {Object} object The object to inspect. 19281 * @param {Function} [predicate=_.identity] The function invoked per iteration. 19282 * @returns {string|undefined} Returns the key of the matched element, 19283 * else `undefined`. 19284 * @example 19285 * 19286 * var users = { 19287 * 'barney': { 'age': 36, 'active': true }, 19288 * 'fred': { 'age': 40, 'active': false }, 19289 * 'pebbles': { 'age': 1, 'active': true } 19290 * }; 19291 * 19292 * _.findKey(users, function(o) { return o.age < 40; }); 19293 * // => 'barney' (iteration order is not guaranteed) 19294 * 19295 * // The `_.matches` iteratee shorthand. 19296 * _.findKey(users, { 'age': 1, 'active': true }); 19297 * // => 'pebbles' 19298 * 19299 * // The `_.matchesProperty` iteratee shorthand. 19300 * _.findKey(users, ['active', false]); 19301 * // => 'fred' 19302 * 19303 * // The `_.property` iteratee shorthand. 19304 * _.findKey(users, 'active'); 19305 * // => 'barney' 19306 */ 19307 function findKey(object, predicate) { 19308 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 19309 } 19310 19311 /** 19312 * This method is like `_.findKey` except that it iterates over elements of 19313 * a collection in the opposite order. 19314 * 19315 * @static 19316 * @memberOf _ 19317 * @since 2.0.0 19318 * @category Object 19319 * @param {Object} object The object to inspect. 19320 * @param {Function} [predicate=_.identity] The function invoked per iteration. 19321 * @returns {string|undefined} Returns the key of the matched element, 19322 * else `undefined`. 19323 * @example 19324 * 19325 * var users = { 19326 * 'barney': { 'age': 36, 'active': true }, 19327 * 'fred': { 'age': 40, 'active': false }, 19328 * 'pebbles': { 'age': 1, 'active': true } 19329 * }; 19330 * 19331 * _.findLastKey(users, function(o) { return o.age < 40; }); 19332 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 19333 * 19334 * // The `_.matches` iteratee shorthand. 19335 * _.findLastKey(users, { 'age': 36, 'active': true }); 19336 * // => 'barney' 19337 * 19338 * // The `_.matchesProperty` iteratee shorthand. 19339 * _.findLastKey(users, ['active', false]); 19340 * // => 'fred' 19341 * 19342 * // The `_.property` iteratee shorthand. 19343 * _.findLastKey(users, 'active'); 19344 * // => 'pebbles' 19345 */ 19346 function findLastKey(object, predicate) { 19347 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 19348 } 19349 19350 /** 19351 * Iterates over own and inherited enumerable string keyed properties of an 19352 * object and invokes `iteratee` for each property. The iteratee is invoked 19353 * with three arguments: (value, key, object). Iteratee functions may exit 19354 * iteration early by explicitly returning `false`. 19355 * 19356 * @static 19357 * @memberOf _ 19358 * @since 0.3.0 19359 * @category Object 19360 * @param {Object} object The object to iterate over. 19361 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19362 * @returns {Object} Returns `object`. 19363 * @see _.forInRight 19364 * @example 19365 * 19366 * function Foo() { 19367 * this.a = 1; 19368 * this.b = 2; 19369 * } 19370 * 19371 * Foo.prototype.c = 3; 19372 * 19373 * _.forIn(new Foo, function(value, key) { 19374 * console.log(key); 19375 * }); 19376 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 19377 */ 19378 function forIn(object, iteratee) { 19379 return object == null 19380 ? object 19381 : baseFor(object, getIteratee(iteratee, 3), keysIn); 19382 } 19383 19384 /** 19385 * This method is like `_.forIn` except that it iterates over properties of 19386 * `object` in the opposite order. 19387 * 19388 * @static 19389 * @memberOf _ 19390 * @since 2.0.0 19391 * @category Object 19392 * @param {Object} object The object to iterate over. 19393 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19394 * @returns {Object} Returns `object`. 19395 * @see _.forIn 19396 * @example 19397 * 19398 * function Foo() { 19399 * this.a = 1; 19400 * this.b = 2; 19401 * } 19402 * 19403 * Foo.prototype.c = 3; 19404 * 19405 * _.forInRight(new Foo, function(value, key) { 19406 * console.log(key); 19407 * }); 19408 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 19409 */ 19410 function forInRight(object, iteratee) { 19411 return object == null 19412 ? object 19413 : baseForRight(object, getIteratee(iteratee, 3), keysIn); 19414 } 19415 19416 /** 19417 * Iterates over own enumerable string keyed properties of an object and 19418 * invokes `iteratee` for each property. The iteratee is invoked with three 19419 * arguments: (value, key, object). Iteratee functions may exit iteration 19420 * early by explicitly returning `false`. 19421 * 19422 * @static 19423 * @memberOf _ 19424 * @since 0.3.0 19425 * @category Object 19426 * @param {Object} object The object to iterate over. 19427 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19428 * @returns {Object} Returns `object`. 19429 * @see _.forOwnRight 19430 * @example 19431 * 19432 * function Foo() { 19433 * this.a = 1; 19434 * this.b = 2; 19435 * } 19436 * 19437 * Foo.prototype.c = 3; 19438 * 19439 * _.forOwn(new Foo, function(value, key) { 19440 * console.log(key); 19441 * }); 19442 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 19443 */ 19444 function forOwn(object, iteratee) { 19445 return object && baseForOwn(object, getIteratee(iteratee, 3)); 19446 } 19447 19448 /** 19449 * This method is like `_.forOwn` except that it iterates over properties of 19450 * `object` in the opposite order. 19451 * 19452 * @static 19453 * @memberOf _ 19454 * @since 2.0.0 19455 * @category Object 19456 * @param {Object} object The object to iterate over. 19457 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19458 * @returns {Object} Returns `object`. 19459 * @see _.forOwn 19460 * @example 19461 * 19462 * function Foo() { 19463 * this.a = 1; 19464 * this.b = 2; 19465 * } 19466 * 19467 * Foo.prototype.c = 3; 19468 * 19469 * _.forOwnRight(new Foo, function(value, key) { 19470 * console.log(key); 19471 * }); 19472 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 19473 */ 19474 function forOwnRight(object, iteratee) { 19475 return object && baseForOwnRight(object, getIteratee(iteratee, 3)); 19476 } 19477 19478 /** 19479 * Creates an array of function property names from own enumerable properties 19480 * of `object`. 19481 * 19482 * @static 19483 * @since 0.1.0 19484 * @memberOf _ 19485 * @category Object 19486 * @param {Object} object The object to inspect. 19487 * @returns {Array} Returns the function names. 19488 * @see _.functionsIn 19489 * @example 19490 * 19491 * function Foo() { 19492 * this.a = _.constant('a'); 19493 * this.b = _.constant('b'); 19494 * } 19495 * 19496 * Foo.prototype.c = _.constant('c'); 19497 * 19498 * _.functions(new Foo); 19499 * // => ['a', 'b'] 19500 */ 19501 function functions(object) { 19502 return object == null ? [] : baseFunctions(object, keys(object)); 19503 } 19504 19505 /** 19506 * Creates an array of function property names from own and inherited 19507 * enumerable properties of `object`. 19508 * 19509 * @static 19510 * @memberOf _ 19511 * @since 4.0.0 19512 * @category Object 19513 * @param {Object} object The object to inspect. 19514 * @returns {Array} Returns the function names. 19515 * @see _.functions 19516 * @example 19517 * 19518 * function Foo() { 19519 * this.a = _.constant('a'); 19520 * this.b = _.constant('b'); 19521 * } 19522 * 19523 * Foo.prototype.c = _.constant('c'); 19524 * 19525 * _.functionsIn(new Foo); 19526 * // => ['a', 'b', 'c'] 19527 */ 19528 function functionsIn(object) { 19529 return object == null ? [] : baseFunctions(object, keysIn(object)); 19530 } 19531 19532 /** 19533 * Gets the value at `path` of `object`. If the resolved value is 19534 * `undefined`, the `defaultValue` is returned in its place. 19535 * 19536 * @static 19537 * @memberOf _ 19538 * @since 3.7.0 19539 * @category Object 19540 * @param {Object} object The object to query. 19541 * @param {Array|string} path The path of the property to get. 19542 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 19543 * @returns {*} Returns the resolved value. 19544 * @example 19545 * 19546 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 19547 * 19548 * _.get(object, 'a[0].b.c'); 19549 * // => 3 19550 * 19551 * _.get(object, ['a', '0', 'b', 'c']); 19552 * // => 3 19553 * 19554 * _.get(object, 'a.b.c', 'default'); 19555 * // => 'default' 19556 */ 19557 function get(object, path, defaultValue) { 19558 var result = object == null ? undefined : baseGet(object, path); 19559 return result === undefined ? defaultValue : result; 19560 } 19561 19562 /** 19563 * Checks if `path` is a direct property of `object`. 19564 * 19565 * @static 19566 * @since 0.1.0 19567 * @memberOf _ 19568 * @category Object 19569 * @param {Object} object The object to query. 19570 * @param {Array|string} path The path to check. 19571 * @returns {boolean} Returns `true` if `path` exists, else `false`. 19572 * @example 19573 * 19574 * var object = { 'a': { 'b': 2 } }; 19575 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 19576 * 19577 * _.has(object, 'a'); 19578 * // => true 19579 * 19580 * _.has(object, 'a.b'); 19581 * // => true 19582 * 19583 * _.has(object, ['a', 'b']); 19584 * // => true 19585 * 19586 * _.has(other, 'a'); 19587 * // => false 19588 */ 19589 function has(object, path) { 19590 return object != null && hasPath(object, path, baseHas); 19591 } 19592 19593 /** 19594 * Checks if `path` is a direct or inherited property of `object`. 19595 * 19596 * @static 19597 * @memberOf _ 19598 * @since 4.0.0 19599 * @category Object 19600 * @param {Object} object The object to query. 19601 * @param {Array|string} path The path to check. 19602 * @returns {boolean} Returns `true` if `path` exists, else `false`. 19603 * @example 19604 * 19605 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 19606 * 19607 * _.hasIn(object, 'a'); 19608 * // => true 19609 * 19610 * _.hasIn(object, 'a.b'); 19611 * // => true 19612 * 19613 * _.hasIn(object, ['a', 'b']); 19614 * // => true 19615 * 19616 * _.hasIn(object, 'b'); 19617 * // => false 19618 */ 19619 function hasIn(object, path) { 19620 return object != null && hasPath(object, path, baseHasIn); 19621 } 19622 19623 /** 19624 * Creates an object composed of the inverted keys and values of `object`. 19625 * If `object` contains duplicate values, subsequent values overwrite 19626 * property assignments of previous values. 19627 * 19628 * @static 19629 * @memberOf _ 19630 * @since 0.7.0 19631 * @category Object 19632 * @param {Object} object The object to invert. 19633 * @returns {Object} Returns the new inverted object. 19634 * @example 19635 * 19636 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 19637 * 19638 * _.invert(object); 19639 * // => { '1': 'c', '2': 'b' } 19640 */ 19641 var invert = createInverter(function(result, value, key) { 19642 if (value != null && 19643 typeof value.toString != 'function') { 19644 value = nativeObjectToString.call(value); 19645 } 19646 19647 result[value] = key; 19648 }, constant(identity)); 19649 19650 /** 19651 * This method is like `_.invert` except that the inverted object is generated 19652 * from the results of running each element of `object` thru `iteratee`. The 19653 * corresponding inverted value of each inverted key is an array of keys 19654 * responsible for generating the inverted value. The iteratee is invoked 19655 * with one argument: (value). 19656 * 19657 * @static 19658 * @memberOf _ 19659 * @since 4.1.0 19660 * @category Object 19661 * @param {Object} object The object to invert. 19662 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 19663 * @returns {Object} Returns the new inverted object. 19664 * @example 19665 * 19666 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 19667 * 19668 * _.invertBy(object); 19669 * // => { '1': ['a', 'c'], '2': ['b'] } 19670 * 19671 * _.invertBy(object, function(value) { 19672 * return 'group' + value; 19673 * }); 19674 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 19675 */ 19676 var invertBy = createInverter(function(result, value, key) { 19677 if (value != null && 19678 typeof value.toString != 'function') { 19679 value = nativeObjectToString.call(value); 19680 } 19681 19682 if (hasOwnProperty.call(result, value)) { 19683 result[value].push(key); 19684 } else { 19685 result[value] = [key]; 19686 } 19687 }, getIteratee); 19688 19689 /** 19690 * Invokes the method at `path` of `object`. 19691 * 19692 * @static 19693 * @memberOf _ 19694 * @since 4.0.0 19695 * @category Object 19696 * @param {Object} object The object to query. 19697 * @param {Array|string} path The path of the method to invoke. 19698 * @param {...*} [args] The arguments to invoke the method with. 19699 * @returns {*} Returns the result of the invoked method. 19700 * @example 19701 * 19702 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 19703 * 19704 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 19705 * // => [2, 3] 19706 */ 19707 var invoke = baseRest(baseInvoke); 19708 19709 /** 19710 * Creates an array of the own enumerable property names of `object`. 19711 * 19712 * **Note:** Non-object values are coerced to objects. See the 19713 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 19714 * for more details. 19715 * 19716 * @static 19717 * @since 0.1.0 19718 * @memberOf _ 19719 * @category Object 19720 * @param {Object} object The object to query. 19721 * @returns {Array} Returns the array of property names. 19722 * @example 19723 * 19724 * function Foo() { 19725 * this.a = 1; 19726 * this.b = 2; 19727 * } 19728 * 19729 * Foo.prototype.c = 3; 19730 * 19731 * _.keys(new Foo); 19732 * // => ['a', 'b'] (iteration order is not guaranteed) 19733 * 19734 * _.keys('hi'); 19735 * // => ['0', '1'] 19736 */ 19737 function keys(object) { 19738 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 19739 } 19740 19741 /** 19742 * Creates an array of the own and inherited enumerable property names of `object`. 19743 * 19744 * **Note:** Non-object values are coerced to objects. 19745 * 19746 * @static 19747 * @memberOf _ 19748 * @since 3.0.0 19749 * @category Object 19750 * @param {Object} object The object to query. 19751 * @returns {Array} Returns the array of property names. 19752 * @example 19753 * 19754 * function Foo() { 19755 * this.a = 1; 19756 * this.b = 2; 19757 * } 19758 * 19759 * Foo.prototype.c = 3; 19760 * 19761 * _.keysIn(new Foo); 19762 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 19763 */ 19764 function keysIn(object) { 19765 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 19766 } 19767 19768 /** 19769 * The opposite of `_.mapValues`; this method creates an object with the 19770 * same values as `object` and keys generated by running each own enumerable 19771 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 19772 * with three arguments: (value, key, object). 19773 * 19774 * @static 19775 * @memberOf _ 19776 * @since 3.8.0 19777 * @category Object 19778 * @param {Object} object The object to iterate over. 19779 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19780 * @returns {Object} Returns the new mapped object. 19781 * @see _.mapValues 19782 * @example 19783 * 19784 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 19785 * return key + value; 19786 * }); 19787 * // => { 'a1': 1, 'b2': 2 } 19788 */ 19789 function mapKeys(object, iteratee) { 19790 var result = {}; 19791 iteratee = getIteratee(iteratee, 3); 19792 19793 baseForOwn(object, function(value, key, object) { 19794 baseAssignValue(result, iteratee(value, key, object), value); 19795 }); 19796 return result; 19797 } 19798 19799 /** 19800 * Creates an object with the same keys as `object` and values generated 19801 * by running each own enumerable string keyed property of `object` thru 19802 * `iteratee`. The iteratee is invoked with three arguments: 19803 * (value, key, object). 19804 * 19805 * @static 19806 * @memberOf _ 19807 * @since 2.4.0 19808 * @category Object 19809 * @param {Object} object The object to iterate over. 19810 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 19811 * @returns {Object} Returns the new mapped object. 19812 * @see _.mapKeys 19813 * @example 19814 * 19815 * var users = { 19816 * 'fred': { 'user': 'fred', 'age': 40 }, 19817 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 19818 * }; 19819 * 19820 * _.mapValues(users, function(o) { return o.age; }); 19821 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 19822 * 19823 * // The `_.property` iteratee shorthand. 19824 * _.mapValues(users, 'age'); 19825 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 19826 */ 19827 function mapValues(object, iteratee) { 19828 var result = {}; 19829 iteratee = getIteratee(iteratee, 3); 19830 19831 baseForOwn(object, function(value, key, object) { 19832 baseAssignValue(result, key, iteratee(value, key, object)); 19833 }); 19834 return result; 19835 } 19836 19837 /** 19838 * This method is like `_.assign` except that it recursively merges own and 19839 * inherited enumerable string keyed properties of source objects into the 19840 * destination object. Source properties that resolve to `undefined` are 19841 * skipped if a destination value exists. Array and plain object properties 19842 * are merged recursively. Other objects and value types are overridden by 19843 * assignment. Source objects are applied from left to right. Subsequent 19844 * sources overwrite property assignments of previous sources. 19845 * 19846 * **Note:** This method mutates `object`. 19847 * 19848 * @static 19849 * @memberOf _ 19850 * @since 0.5.0 19851 * @category Object 19852 * @param {Object} object The destination object. 19853 * @param {...Object} [sources] The source objects. 19854 * @returns {Object} Returns `object`. 19855 * @example 19856 * 19857 * var object = { 19858 * 'a': [{ 'b': 2 }, { 'd': 4 }] 19859 * }; 19860 * 19861 * var other = { 19862 * 'a': [{ 'c': 3 }, { 'e': 5 }] 19863 * }; 19864 * 19865 * _.merge(object, other); 19866 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 19867 */ 19868 var merge = createAssigner(function(object, source, srcIndex) { 19869 baseMerge(object, source, srcIndex); 19870 }); 19871 19872 /** 19873 * This method is like `_.merge` except that it accepts `customizer` which 19874 * is invoked to produce the merged values of the destination and source 19875 * properties. If `customizer` returns `undefined`, merging is handled by the 19876 * method instead. The `customizer` is invoked with six arguments: 19877 * (objValue, srcValue, key, object, source, stack). 19878 * 19879 * **Note:** This method mutates `object`. 19880 * 19881 * @static 19882 * @memberOf _ 19883 * @since 4.0.0 19884 * @category Object 19885 * @param {Object} object The destination object. 19886 * @param {...Object} sources The source objects. 19887 * @param {Function} customizer The function to customize assigned values. 19888 * @returns {Object} Returns `object`. 19889 * @example 19890 * 19891 * function customizer(objValue, srcValue) { 19892 * if (_.isArray(objValue)) { 19893 * return objValue.concat(srcValue); 19894 * } 19895 * } 19896 * 19897 * var object = { 'a': [1], 'b': [2] }; 19898 * var other = { 'a': [3], 'b': [4] }; 19899 * 19900 * _.mergeWith(object, other, customizer); 19901 * // => { 'a': [1, 3], 'b': [2, 4] } 19902 */ 19903 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 19904 baseMerge(object, source, srcIndex, customizer); 19905 }); 19906 19907 /** 19908 * The opposite of `_.pick`; this method creates an object composed of the 19909 * own and inherited enumerable property paths of `object` that are not omitted. 19910 * 19911 * **Note:** This method is considerably slower than `_.pick`. 19912 * 19913 * @static 19914 * @since 0.1.0 19915 * @memberOf _ 19916 * @category Object 19917 * @param {Object} object The source object. 19918 * @param {...(string|string[])} [paths] The property paths to omit. 19919 * @returns {Object} Returns the new object. 19920 * @example 19921 * 19922 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 19923 * 19924 * _.omit(object, ['a', 'c']); 19925 * // => { 'b': '2' } 19926 */ 19927 var omit = flatRest(function(object, paths) { 19928 var result = {}; 19929 if (object == null) { 19930 return result; 19931 } 19932 var isDeep = false; 19933 paths = arrayMap(paths, function(path) { 19934 path = castPath(path, object); 19935 isDeep || (isDeep = path.length > 1); 19936 return path; 19937 }); 19938 copyObject(object, getAllKeysIn(object), result); 19939 if (isDeep) { 19940 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 19941 } 19942 var length = paths.length; 19943 while (length--) { 19944 baseUnset(result, paths[length]); 19945 } 19946 return result; 19947 }); 19948 19949 /** 19950 * The opposite of `_.pickBy`; this method creates an object composed of 19951 * the own and inherited enumerable string keyed properties of `object` that 19952 * `predicate` doesn't return truthy for. The predicate is invoked with two 19953 * arguments: (value, key). 19954 * 19955 * @static 19956 * @memberOf _ 19957 * @since 4.0.0 19958 * @category Object 19959 * @param {Object} object The source object. 19960 * @param {Function} [predicate=_.identity] The function invoked per property. 19961 * @returns {Object} Returns the new object. 19962 * @example 19963 * 19964 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 19965 * 19966 * _.omitBy(object, _.isNumber); 19967 * // => { 'b': '2' } 19968 */ 19969 function omitBy(object, predicate) { 19970 return pickBy(object, negate(getIteratee(predicate))); 19971 } 19972 19973 /** 19974 * Creates an object composed of the picked `object` properties. 19975 * 19976 * @static 19977 * @since 0.1.0 19978 * @memberOf _ 19979 * @category Object 19980 * @param {Object} object The source object. 19981 * @param {...(string|string[])} [paths] The property paths to pick. 19982 * @returns {Object} Returns the new object. 19983 * @example 19984 * 19985 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 19986 * 19987 * _.pick(object, ['a', 'c']); 19988 * // => { 'a': 1, 'c': 3 } 19989 */ 19990 var pick = flatRest(function(object, paths) { 19991 return object == null ? {} : basePick(object, paths); 19992 }); 19993 19994 /** 19995 * Creates an object composed of the `object` properties `predicate` returns 19996 * truthy for. The predicate is invoked with two arguments: (value, key). 19997 * 19998 * @static 19999 * @memberOf _ 20000 * @since 4.0.0 20001 * @category Object 20002 * @param {Object} object The source object. 20003 * @param {Function} [predicate=_.identity] The function invoked per property. 20004 * @returns {Object} Returns the new object. 20005 * @example 20006 * 20007 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 20008 * 20009 * _.pickBy(object, _.isNumber); 20010 * // => { 'a': 1, 'c': 3 } 20011 */ 20012 function pickBy(object, predicate) { 20013 if (object == null) { 20014 return {}; 20015 } 20016 var props = arrayMap(getAllKeysIn(object), function(prop) { 20017 return [prop]; 20018 }); 20019 predicate = getIteratee(predicate); 20020 return basePickBy(object, props, function(value, path) { 20021 return predicate(value, path[0]); 20022 }); 20023 } 20024 20025 /** 20026 * This method is like `_.get` except that if the resolved value is a 20027 * function it's invoked with the `this` binding of its parent object and 20028 * its result is returned. 20029 * 20030 * @static 20031 * @since 0.1.0 20032 * @memberOf _ 20033 * @category Object 20034 * @param {Object} object The object to query. 20035 * @param {Array|string} path The path of the property to resolve. 20036 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 20037 * @returns {*} Returns the resolved value. 20038 * @example 20039 * 20040 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 20041 * 20042 * _.result(object, 'a[0].b.c1'); 20043 * // => 3 20044 * 20045 * _.result(object, 'a[0].b.c2'); 20046 * // => 4 20047 * 20048 * _.result(object, 'a[0].b.c3', 'default'); 20049 * // => 'default' 20050 * 20051 * _.result(object, 'a[0].b.c3', _.constant('default')); 20052 * // => 'default' 20053 */ 20054 function result(object, path, defaultValue) { 20055 path = castPath(path, object); 20056 20057 var index = -1, 20058 length = path.length; 20059 20060 // Ensure the loop is entered when path is empty. 20061 if (!length) { 20062 length = 1; 20063 object = undefined; 20064 } 20065 while (++index < length) { 20066 var value = object == null ? undefined : object[toKey(path[index])]; 20067 if (value === undefined) { 20068 index = length; 20069 value = defaultValue; 20070 } 20071 object = isFunction(value) ? value.call(object) : value; 20072 } 20073 return object; 20074 } 20075 20076 /** 20077 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 20078 * it's created. Arrays are created for missing index properties while objects 20079 * are created for all other missing properties. Use `_.setWith` to customize 20080 * `path` creation. 20081 * 20082 * **Note:** This method mutates `object`. 20083 * 20084 * @static 20085 * @memberOf _ 20086 * @since 3.7.0 20087 * @category Object 20088 * @param {Object} object The object to modify. 20089 * @param {Array|string} path The path of the property to set. 20090 * @param {*} value The value to set. 20091 * @returns {Object} Returns `object`. 20092 * @example 20093 * 20094 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 20095 * 20096 * _.set(object, 'a[0].b.c', 4); 20097 * console.log(object.a[0].b.c); 20098 * // => 4 20099 * 20100 * _.set(object, ['x', '0', 'y', 'z'], 5); 20101 * console.log(object.x[0].y.z); 20102 * // => 5 20103 */ 20104 function set(object, path, value) { 20105 return object == null ? object : baseSet(object, path, value); 20106 } 20107 20108 /** 20109 * This method is like `_.set` except that it accepts `customizer` which is 20110 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 20111 * path creation is handled by the method instead. The `customizer` is invoked 20112 * with three arguments: (nsValue, key, nsObject). 20113 * 20114 * **Note:** This method mutates `object`. 20115 * 20116 * @static 20117 * @memberOf _ 20118 * @since 4.0.0 20119 * @category Object 20120 * @param {Object} object The object to modify. 20121 * @param {Array|string} path The path of the property to set. 20122 * @param {*} value The value to set. 20123 * @param {Function} [customizer] The function to customize assigned values. 20124 * @returns {Object} Returns `object`. 20125 * @example 20126 * 20127 * var object = {}; 20128 * 20129 * _.setWith(object, '[0][1]', 'a', Object); 20130 * // => { '0': { '1': 'a' } } 20131 */ 20132 function setWith(object, path, value, customizer) { 20133 customizer = typeof customizer == 'function' ? customizer : undefined; 20134 return object == null ? object : baseSet(object, path, value, customizer); 20135 } 20136 20137 /** 20138 * Creates an array of own enumerable string keyed-value pairs for `object` 20139 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 20140 * entries are returned. 20141 * 20142 * @static 20143 * @memberOf _ 20144 * @since 4.0.0 20145 * @alias entries 20146 * @category Object 20147 * @param {Object} object The object to query. 20148 * @returns {Array} Returns the key-value pairs. 20149 * @example 20150 * 20151 * function Foo() { 20152 * this.a = 1; 20153 * this.b = 2; 20154 * } 20155 * 20156 * Foo.prototype.c = 3; 20157 * 20158 * _.toPairs(new Foo); 20159 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 20160 */ 20161 var toPairs = createToPairs(keys); 20162 20163 /** 20164 * Creates an array of own and inherited enumerable string keyed-value pairs 20165 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 20166 * or set, its entries are returned. 20167 * 20168 * @static 20169 * @memberOf _ 20170 * @since 4.0.0 20171 * @alias entriesIn 20172 * @category Object 20173 * @param {Object} object The object to query. 20174 * @returns {Array} Returns the key-value pairs. 20175 * @example 20176 * 20177 * function Foo() { 20178 * this.a = 1; 20179 * this.b = 2; 20180 * } 20181 * 20182 * Foo.prototype.c = 3; 20183 * 20184 * _.toPairsIn(new Foo); 20185 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 20186 */ 20187 var toPairsIn = createToPairs(keysIn); 20188 20189 /** 20190 * An alternative to `_.reduce`; this method transforms `object` to a new 20191 * `accumulator` object which is the result of running each of its own 20192 * enumerable string keyed properties thru `iteratee`, with each invocation 20193 * potentially mutating the `accumulator` object. If `accumulator` is not 20194 * provided, a new object with the same `[[Prototype]]` will be used. The 20195 * iteratee is invoked with four arguments: (accumulator, value, key, object). 20196 * Iteratee functions may exit iteration early by explicitly returning `false`. 20197 * 20198 * @static 20199 * @memberOf _ 20200 * @since 1.3.0 20201 * @category Object 20202 * @param {Object} object The object to iterate over. 20203 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 20204 * @param {*} [accumulator] The custom accumulator value. 20205 * @returns {*} Returns the accumulated value. 20206 * @example 20207 * 20208 * _.transform([2, 3, 4], function(result, n) { 20209 * result.push(n *= n); 20210 * return n % 2 == 0; 20211 * }, []); 20212 * // => [4, 9] 20213 * 20214 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 20215 * (result[value] || (result[value] = [])).push(key); 20216 * }, {}); 20217 * // => { '1': ['a', 'c'], '2': ['b'] } 20218 */ 20219 function transform(object, iteratee, accumulator) { 20220 var isArr = isArray(object), 20221 isArrLike = isArr || isBuffer(object) || isTypedArray(object); 20222 20223 iteratee = getIteratee(iteratee, 4); 20224 if (accumulator == null) { 20225 var Ctor = object && object.constructor; 20226 if (isArrLike) { 20227 accumulator = isArr ? new Ctor : []; 20228 } 20229 else if (isObject(object)) { 20230 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; 20231 } 20232 else { 20233 accumulator = {}; 20234 } 20235 } 20236 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { 20237 return iteratee(accumulator, value, index, object); 20238 }); 20239 return accumulator; 20240 } 20241 20242 /** 20243 * Removes the property at `path` of `object`. 20244 * 20245 * **Note:** This method mutates `object`. 20246 * 20247 * @static 20248 * @memberOf _ 20249 * @since 4.0.0 20250 * @category Object 20251 * @param {Object} object The object to modify. 20252 * @param {Array|string} path The path of the property to unset. 20253 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 20254 * @example 20255 * 20256 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 20257 * _.unset(object, 'a[0].b.c'); 20258 * // => true 20259 * 20260 * console.log(object); 20261 * // => { 'a': [{ 'b': {} }] }; 20262 * 20263 * _.unset(object, ['a', '0', 'b', 'c']); 20264 * // => true 20265 * 20266 * console.log(object); 20267 * // => { 'a': [{ 'b': {} }] }; 20268 */ 20269 function unset(object, path) { 20270 return object == null ? true : baseUnset(object, path); 20271 } 20272 20273 /** 20274 * This method is like `_.set` except that accepts `updater` to produce the 20275 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 20276 * is invoked with one argument: (value). 20277 * 20278 * **Note:** This method mutates `object`. 20279 * 20280 * @static 20281 * @memberOf _ 20282 * @since 4.6.0 20283 * @category Object 20284 * @param {Object} object The object to modify. 20285 * @param {Array|string} path The path of the property to set. 20286 * @param {Function} updater The function to produce the updated value. 20287 * @returns {Object} Returns `object`. 20288 * @example 20289 * 20290 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 20291 * 20292 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 20293 * console.log(object.a[0].b.c); 20294 * // => 9 20295 * 20296 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 20297 * console.log(object.x[0].y.z); 20298 * // => 0 20299 */ 20300 function update(object, path, updater) { 20301 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 20302 } 20303 20304 /** 20305 * This method is like `_.update` except that it accepts `customizer` which is 20306 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 20307 * path creation is handled by the method instead. The `customizer` is invoked 20308 * with three arguments: (nsValue, key, nsObject). 20309 * 20310 * **Note:** This method mutates `object`. 20311 * 20312 * @static 20313 * @memberOf _ 20314 * @since 4.6.0 20315 * @category Object 20316 * @param {Object} object The object to modify. 20317 * @param {Array|string} path The path of the property to set. 20318 * @param {Function} updater The function to produce the updated value. 20319 * @param {Function} [customizer] The function to customize assigned values. 20320 * @returns {Object} Returns `object`. 20321 * @example 20322 * 20323 * var object = {}; 20324 * 20325 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 20326 * // => { '0': { '1': 'a' } } 20327 */ 20328 function updateWith(object, path, updater, customizer) { 20329 customizer = typeof customizer == 'function' ? customizer : undefined; 20330 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 20331 } 20332 20333 /** 20334 * Creates an array of the own enumerable string keyed property values of `object`. 20335 * 20336 * **Note:** Non-object values are coerced to objects. 20337 * 20338 * @static 20339 * @since 0.1.0 20340 * @memberOf _ 20341 * @category Object 20342 * @param {Object} object The object to query. 20343 * @returns {Array} Returns the array of property values. 20344 * @example 20345 * 20346 * function Foo() { 20347 * this.a = 1; 20348 * this.b = 2; 20349 * } 20350 * 20351 * Foo.prototype.c = 3; 20352 * 20353 * _.values(new Foo); 20354 * // => [1, 2] (iteration order is not guaranteed) 20355 * 20356 * _.values('hi'); 20357 * // => ['h', 'i'] 20358 */ 20359 function values(object) { 20360 return object == null ? [] : baseValues(object, keys(object)); 20361 } 20362 20363 /** 20364 * Creates an array of the own and inherited enumerable string keyed property 20365 * values of `object`. 20366 * 20367 * **Note:** Non-object values are coerced to objects. 20368 * 20369 * @static 20370 * @memberOf _ 20371 * @since 3.0.0 20372 * @category Object 20373 * @param {Object} object The object to query. 20374 * @returns {Array} Returns the array of property values. 20375 * @example 20376 * 20377 * function Foo() { 20378 * this.a = 1; 20379 * this.b = 2; 20380 * } 20381 * 20382 * Foo.prototype.c = 3; 20383 * 20384 * _.valuesIn(new Foo); 20385 * // => [1, 2, 3] (iteration order is not guaranteed) 20386 */ 20387 function valuesIn(object) { 20388 return object == null ? [] : baseValues(object, keysIn(object)); 20389 } 20390 20391 /*------------------------------------------------------------------------*/ 20392 20393 /** 20394 * Clamps `number` within the inclusive `lower` and `upper` bounds. 20395 * 20396 * @static 20397 * @memberOf _ 20398 * @since 4.0.0 20399 * @category Number 20400 * @param {number} number The number to clamp. 20401 * @param {number} [lower] The lower bound. 20402 * @param {number} upper The upper bound. 20403 * @returns {number} Returns the clamped number. 20404 * @example 20405 * 20406 * _.clamp(-10, -5, 5); 20407 * // => -5 20408 * 20409 * _.clamp(10, -5, 5); 20410 * // => 5 20411 */ 20412 function clamp(number, lower, upper) { 20413 if (upper === undefined) { 20414 upper = lower; 20415 lower = undefined; 20416 } 20417 if (upper !== undefined) { 20418 upper = toNumber(upper); 20419 upper = upper === upper ? upper : 0; 20420 } 20421 if (lower !== undefined) { 20422 lower = toNumber(lower); 20423 lower = lower === lower ? lower : 0; 20424 } 20425 return baseClamp(toNumber(number), lower, upper); 20426 } 20427 20428 /** 20429 * Checks if `n` is between `start` and up to, but not including, `end`. If 20430 * `end` is not specified, it's set to `start` with `start` then set to `0`. 20431 * If `start` is greater than `end` the params are swapped to support 20432 * negative ranges. 20433 * 20434 * @static 20435 * @memberOf _ 20436 * @since 3.3.0 20437 * @category Number 20438 * @param {number} number The number to check. 20439 * @param {number} [start=0] The start of the range. 20440 * @param {number} end The end of the range. 20441 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 20442 * @see _.range, _.rangeRight 20443 * @example 20444 * 20445 * _.inRange(3, 2, 4); 20446 * // => true 20447 * 20448 * _.inRange(4, 8); 20449 * // => true 20450 * 20451 * _.inRange(4, 2); 20452 * // => false 20453 * 20454 * _.inRange(2, 2); 20455 * // => false 20456 * 20457 * _.inRange(1.2, 2); 20458 * // => true 20459 * 20460 * _.inRange(5.2, 4); 20461 * // => false 20462 * 20463 * _.inRange(-3, -2, -6); 20464 * // => true 20465 */ 20466 function inRange(number, start, end) { 20467 start = toFinite(start); 20468 if (end === undefined) { 20469 end = start; 20470 start = 0; 20471 } else { 20472 end = toFinite(end); 20473 } 20474 number = toNumber(number); 20475 return baseInRange(number, start, end); 20476 } 20477 20478 /** 20479 * Produces a random number between the inclusive `lower` and `upper` bounds. 20480 * If only one argument is provided a number between `0` and the given number 20481 * is returned. If `floating` is `true`, or either `lower` or `upper` are 20482 * floats, a floating-point number is returned instead of an integer. 20483 * 20484 * **Note:** JavaScript follows the IEEE-754 standard for resolving 20485 * floating-point values which can produce unexpected results. 20486 * 20487 * @static 20488 * @memberOf _ 20489 * @since 0.7.0 20490 * @category Number 20491 * @param {number} [lower=0] The lower bound. 20492 * @param {number} [upper=1] The upper bound. 20493 * @param {boolean} [floating] Specify returning a floating-point number. 20494 * @returns {number} Returns the random number. 20495 * @example 20496 * 20497 * _.random(0, 5); 20498 * // => an integer between 0 and 5 20499 * 20500 * _.random(5); 20501 * // => also an integer between 0 and 5 20502 * 20503 * _.random(5, true); 20504 * // => a floating-point number between 0 and 5 20505 * 20506 * _.random(1.2, 5.2); 20507 * // => a floating-point number between 1.2 and 5.2 20508 */ 20509 function random(lower, upper, floating) { 20510 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { 20511 upper = floating = undefined; 20512 } 20513 if (floating === undefined) { 20514 if (typeof upper == 'boolean') { 20515 floating = upper; 20516 upper = undefined; 20517 } 20518 else if (typeof lower == 'boolean') { 20519 floating = lower; 20520 lower = undefined; 20521 } 20522 } 20523 if (lower === undefined && upper === undefined) { 20524 lower = 0; 20525 upper = 1; 20526 } 20527 else { 20528 lower = toFinite(lower); 20529 if (upper === undefined) { 20530 upper = lower; 20531 lower = 0; 20532 } else { 20533 upper = toFinite(upper); 20534 } 20535 } 20536 if (lower > upper) { 20537 var temp = lower; 20538 lower = upper; 20539 upper = temp; 20540 } 20541 if (floating || lower % 1 || upper % 1) { 20542 var rand = nativeRandom(); 20543 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); 20544 } 20545 return baseRandom(lower, upper); 20546 } 20547 20548 /*------------------------------------------------------------------------*/ 20549 20550 /** 20551 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 20552 * 20553 * @static 20554 * @memberOf _ 20555 * @since 3.0.0 20556 * @category String 20557 * @param {string} [string=''] The string to convert. 20558 * @returns {string} Returns the camel cased string. 20559 * @example 20560 * 20561 * _.camelCase('Foo Bar'); 20562 * // => 'fooBar' 20563 * 20564 * _.camelCase('--foo-bar--'); 20565 * // => 'fooBar' 20566 * 20567 * _.camelCase('__FOO_BAR__'); 20568 * // => 'fooBar' 20569 */ 20570 var camelCase = createCompounder(function(result, word, index) { 20571 word = word.toLowerCase(); 20572 return result + (index ? capitalize(word) : word); 20573 }); 20574 20575 /** 20576 * Converts the first character of `string` to upper case and the remaining 20577 * to lower case. 20578 * 20579 * @static 20580 * @memberOf _ 20581 * @since 3.0.0 20582 * @category String 20583 * @param {string} [string=''] The string to capitalize. 20584 * @returns {string} Returns the capitalized string. 20585 * @example 20586 * 20587 * _.capitalize('FRED'); 20588 * // => 'Fred' 20589 */ 20590 function capitalize(string) { 20591 return upperFirst(toString(string).toLowerCase()); 20592 } 20593 20594 /** 20595 * Deburrs `string` by converting 20596 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 20597 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 20598 * letters to basic Latin letters and removing 20599 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 20600 * 20601 * @static 20602 * @memberOf _ 20603 * @since 3.0.0 20604 * @category String 20605 * @param {string} [string=''] The string to deburr. 20606 * @returns {string} Returns the deburred string. 20607 * @example 20608 * 20609 * _.deburr('déjàvu'); 20610 * // => 'deja vu' 20611 */ 20612 function deburr(string) { 20613 string = toString(string); 20614 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); 20615 } 20616 20617 /** 20618 * Checks if `string` ends with the given target string. 20619 * 20620 * @static 20621 * @memberOf _ 20622 * @since 3.0.0 20623 * @category String 20624 * @param {string} [string=''] The string to inspect. 20625 * @param {string} [target] The string to search for. 20626 * @param {number} [position=string.length] The position to search up to. 20627 * @returns {boolean} Returns `true` if `string` ends with `target`, 20628 * else `false`. 20629 * @example 20630 * 20631 * _.endsWith('abc', 'c'); 20632 * // => true 20633 * 20634 * _.endsWith('abc', 'b'); 20635 * // => false 20636 * 20637 * _.endsWith('abc', 'b', 2); 20638 * // => true 20639 */ 20640 function endsWith(string, target, position) { 20641 string = toString(string); 20642 target = baseToString(target); 20643 20644 var length = string.length; 20645 position = position === undefined 20646 ? length 20647 : baseClamp(toInteger(position), 0, length); 20648 20649 var end = position; 20650 position -= target.length; 20651 return position >= 0 && string.slice(position, end) == target; 20652 } 20653 20654 /** 20655 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 20656 * corresponding HTML entities. 20657 * 20658 * **Note:** No other characters are escaped. To escape additional 20659 * characters use a third-party library like [_he_](https://mths.be/he). 20660 * 20661 * Though the ">" character is escaped for symmetry, characters like 20662 * ">" and "/" don't need escaping in HTML and have no special meaning 20663 * unless they're part of a tag or unquoted attribute value. See 20664 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 20665 * (under "semi-related fun fact") for more details. 20666 * 20667 * When working with HTML you should always 20668 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 20669 * XSS vectors. 20670 * 20671 * @static 20672 * @since 0.1.0 20673 * @memberOf _ 20674 * @category String 20675 * @param {string} [string=''] The string to escape. 20676 * @returns {string} Returns the escaped string. 20677 * @example 20678 * 20679 * _.escape('fred, barney, & pebbles'); 20680 * // => 'fred, barney, & pebbles' 20681 */ 20682 function escape(string) { 20683 string = toString(string); 20684 return (string && reHasUnescapedHtml.test(string)) 20685 ? string.replace(reUnescapedHtml, escapeHtmlChar) 20686 : string; 20687 } 20688 20689 /** 20690 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 20691 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 20692 * 20693 * @static 20694 * @memberOf _ 20695 * @since 3.0.0 20696 * @category String 20697 * @param {string} [string=''] The string to escape. 20698 * @returns {string} Returns the escaped string. 20699 * @example 20700 * 20701 * _.escapeRegExp('[lodash](https://lodash.com/)'); 20702 * // => '\[lodash\]\(https://lodash\.com/\)' 20703 */ 20704 function escapeRegExp(string) { 20705 string = toString(string); 20706 return (string && reHasRegExpChar.test(string)) 20707 ? string.replace(reRegExpChar, '\\$&') 20708 : string; 20709 } 20710 20711 /** 20712 * Converts `string` to 20713 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 20714 * 20715 * @static 20716 * @memberOf _ 20717 * @since 3.0.0 20718 * @category String 20719 * @param {string} [string=''] The string to convert. 20720 * @returns {string} Returns the kebab cased string. 20721 * @example 20722 * 20723 * _.kebabCase('Foo Bar'); 20724 * // => 'foo-bar' 20725 * 20726 * _.kebabCase('fooBar'); 20727 * // => 'foo-bar' 20728 * 20729 * _.kebabCase('__FOO_BAR__'); 20730 * // => 'foo-bar' 20731 */ 20732 var kebabCase = createCompounder(function(result, word, index) { 20733 return result + (index ? '-' : '') + word.toLowerCase(); 20734 }); 20735 20736 /** 20737 * Converts `string`, as space separated words, to lower case. 20738 * 20739 * @static 20740 * @memberOf _ 20741 * @since 4.0.0 20742 * @category String 20743 * @param {string} [string=''] The string to convert. 20744 * @returns {string} Returns the lower cased string. 20745 * @example 20746 * 20747 * _.lowerCase('--Foo-Bar--'); 20748 * // => 'foo bar' 20749 * 20750 * _.lowerCase('fooBar'); 20751 * // => 'foo bar' 20752 * 20753 * _.lowerCase('__FOO_BAR__'); 20754 * // => 'foo bar' 20755 */ 20756 var lowerCase = createCompounder(function(result, word, index) { 20757 return result + (index ? ' ' : '') + word.toLowerCase(); 20758 }); 20759 20760 /** 20761 * Converts the first character of `string` to lower case. 20762 * 20763 * @static 20764 * @memberOf _ 20765 * @since 4.0.0 20766 * @category String 20767 * @param {string} [string=''] The string to convert. 20768 * @returns {string} Returns the converted string. 20769 * @example 20770 * 20771 * _.lowerFirst('Fred'); 20772 * // => 'fred' 20773 * 20774 * _.lowerFirst('FRED'); 20775 * // => 'fRED' 20776 */ 20777 var lowerFirst = createCaseFirst('toLowerCase'); 20778 20779 /** 20780 * Pads `string` on the left and right sides if it's shorter than `length`. 20781 * Padding characters are truncated if they can't be evenly divided by `length`. 20782 * 20783 * @static 20784 * @memberOf _ 20785 * @since 3.0.0 20786 * @category String 20787 * @param {string} [string=''] The string to pad. 20788 * @param {number} [length=0] The padding length. 20789 * @param {string} [chars=' '] The string used as padding. 20790 * @returns {string} Returns the padded string. 20791 * @example 20792 * 20793 * _.pad('abc', 8); 20794 * // => ' abc ' 20795 * 20796 * _.pad('abc', 8, '_-'); 20797 * // => '_-abc_-_' 20798 * 20799 * _.pad('abc', 3); 20800 * // => 'abc' 20801 */ 20802 function pad(string, length, chars) { 20803 string = toString(string); 20804 length = toInteger(length); 20805 20806 var strLength = length ? stringSize(string) : 0; 20807 if (!length || strLength >= length) { 20808 return string; 20809 } 20810 var mid = (length - strLength) / 2; 20811 return ( 20812 createPadding(nativeFloor(mid), chars) + 20813 string + 20814 createPadding(nativeCeil(mid), chars) 20815 ); 20816 } 20817 20818 /** 20819 * Pads `string` on the right side if it's shorter than `length`. Padding 20820 * characters are truncated if they exceed `length`. 20821 * 20822 * @static 20823 * @memberOf _ 20824 * @since 4.0.0 20825 * @category String 20826 * @param {string} [string=''] The string to pad. 20827 * @param {number} [length=0] The padding length. 20828 * @param {string} [chars=' '] The string used as padding. 20829 * @returns {string} Returns the padded string. 20830 * @example 20831 * 20832 * _.padEnd('abc', 6); 20833 * // => 'abc ' 20834 * 20835 * _.padEnd('abc', 6, '_-'); 20836 * // => 'abc_-_' 20837 * 20838 * _.padEnd('abc', 3); 20839 * // => 'abc' 20840 */ 20841 function padEnd(string, length, chars) { 20842 string = toString(string); 20843 length = toInteger(length); 20844 20845 var strLength = length ? stringSize(string) : 0; 20846 return (length && strLength < length) 20847 ? (string + createPadding(length - strLength, chars)) 20848 : string; 20849 } 20850 20851 /** 20852 * Pads `string` on the left side if it's shorter than `length`. Padding 20853 * characters are truncated if they exceed `length`. 20854 * 20855 * @static 20856 * @memberOf _ 20857 * @since 4.0.0 20858 * @category String 20859 * @param {string} [string=''] The string to pad. 20860 * @param {number} [length=0] The padding length. 20861 * @param {string} [chars=' '] The string used as padding. 20862 * @returns {string} Returns the padded string. 20863 * @example 20864 * 20865 * _.padStart('abc', 6); 20866 * // => ' abc' 20867 * 20868 * _.padStart('abc', 6, '_-'); 20869 * // => '_-_abc' 20870 * 20871 * _.padStart('abc', 3); 20872 * // => 'abc' 20873 */ 20874 function padStart(string, length, chars) { 20875 string = toString(string); 20876 length = toInteger(length); 20877 20878 var strLength = length ? stringSize(string) : 0; 20879 return (length && strLength < length) 20880 ? (createPadding(length - strLength, chars) + string) 20881 : string; 20882 } 20883 20884 /** 20885 * Converts `string` to an integer of the specified radix. If `radix` is 20886 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 20887 * hexadecimal, in which case a `radix` of `16` is used. 20888 * 20889 * **Note:** This method aligns with the 20890 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 20891 * 20892 * @static 20893 * @memberOf _ 20894 * @since 1.1.0 20895 * @category String 20896 * @param {string} string The string to convert. 20897 * @param {number} [radix=10] The radix to interpret `value` by. 20898 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 20899 * @returns {number} Returns the converted integer. 20900 * @example 20901 * 20902 * _.parseInt('08'); 20903 * // => 8 20904 * 20905 * _.map(['6', '08', '10'], _.parseInt); 20906 * // => [6, 8, 10] 20907 */ 20908 function parseInt(string, radix, guard) { 20909 if (guard || radix == null) { 20910 radix = 0; 20911 } else if (radix) { 20912 radix = +radix; 20913 } 20914 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 20915 } 20916 20917 /** 20918 * Repeats the given string `n` times. 20919 * 20920 * @static 20921 * @memberOf _ 20922 * @since 3.0.0 20923 * @category String 20924 * @param {string} [string=''] The string to repeat. 20925 * @param {number} [n=1] The number of times to repeat the string. 20926 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 20927 * @returns {string} Returns the repeated string. 20928 * @example 20929 * 20930 * _.repeat('*', 3); 20931 * // => '***' 20932 * 20933 * _.repeat('abc', 2); 20934 * // => 'abcabc' 20935 * 20936 * _.repeat('abc', 0); 20937 * // => '' 20938 */ 20939 function repeat(string, n, guard) { 20940 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { 20941 n = 1; 20942 } else { 20943 n = toInteger(n); 20944 } 20945 return baseRepeat(toString(string), n); 20946 } 20947 20948 /** 20949 * Replaces matches for `pattern` in `string` with `replacement`. 20950 * 20951 * **Note:** This method is based on 20952 * [`String#replace`](https://mdn.io/String/replace). 20953 * 20954 * @static 20955 * @memberOf _ 20956 * @since 4.0.0 20957 * @category String 20958 * @param {string} [string=''] The string to modify. 20959 * @param {RegExp|string} pattern The pattern to replace. 20960 * @param {Function|string} replacement The match replacement. 20961 * @returns {string} Returns the modified string. 20962 * @example 20963 * 20964 * _.replace('Hi Fred', 'Fred', 'Barney'); 20965 * // => 'Hi Barney' 20966 */ 20967 function replace() { 20968 var args = arguments, 20969 string = toString(args[0]); 20970 20971 return args.length < 3 ? string : string.replace(args[1], args[2]); 20972 } 20973 20974 /** 20975 * Converts `string` to 20976 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 20977 * 20978 * @static 20979 * @memberOf _ 20980 * @since 3.0.0 20981 * @category String 20982 * @param {string} [string=''] The string to convert. 20983 * @returns {string} Returns the snake cased string. 20984 * @example 20985 * 20986 * _.snakeCase('Foo Bar'); 20987 * // => 'foo_bar' 20988 * 20989 * _.snakeCase('fooBar'); 20990 * // => 'foo_bar' 20991 * 20992 * _.snakeCase('--FOO-BAR--'); 20993 * // => 'foo_bar' 20994 */ 20995 var snakeCase = createCompounder(function(result, word, index) { 20996 return result + (index ? '_' : '') + word.toLowerCase(); 20997 }); 20998 20999 /** 21000 * Splits `string` by `separator`. 21001 * 21002 * **Note:** This method is based on 21003 * [`String#split`](https://mdn.io/String/split). 21004 * 21005 * @static 21006 * @memberOf _ 21007 * @since 4.0.0 21008 * @category String 21009 * @param {string} [string=''] The string to split. 21010 * @param {RegExp|string} separator The separator pattern to split by. 21011 * @param {number} [limit] The length to truncate results to. 21012 * @returns {Array} Returns the string segments. 21013 * @example 21014 * 21015 * _.split('a-b-c', '-', 2); 21016 * // => ['a', 'b'] 21017 */ 21018 function split(string, separator, limit) { 21019 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { 21020 separator = limit = undefined; 21021 } 21022 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; 21023 if (!limit) { 21024 return []; 21025 } 21026 string = toString(string); 21027 if (string && ( 21028 typeof separator == 'string' || 21029 (separator != null && !isRegExp(separator)) 21030 )) { 21031 separator = baseToString(separator); 21032 if (!separator && hasUnicode(string)) { 21033 return castSlice(stringToArray(string), 0, limit); 21034 } 21035 } 21036 return string.split(separator, limit); 21037 } 21038 21039 /** 21040 * Converts `string` to 21041 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 21042 * 21043 * @static 21044 * @memberOf _ 21045 * @since 3.1.0 21046 * @category String 21047 * @param {string} [string=''] The string to convert. 21048 * @returns {string} Returns the start cased string. 21049 * @example 21050 * 21051 * _.startCase('--foo-bar--'); 21052 * // => 'Foo Bar' 21053 * 21054 * _.startCase('fooBar'); 21055 * // => 'Foo Bar' 21056 * 21057 * _.startCase('__FOO_BAR__'); 21058 * // => 'FOO BAR' 21059 */ 21060 var startCase = createCompounder(function(result, word, index) { 21061 return result + (index ? ' ' : '') + upperFirst(word); 21062 }); 21063 21064 /** 21065 * Checks if `string` starts with the given target string. 21066 * 21067 * @static 21068 * @memberOf _ 21069 * @since 3.0.0 21070 * @category String 21071 * @param {string} [string=''] The string to inspect. 21072 * @param {string} [target] The string to search for. 21073 * @param {number} [position=0] The position to search from. 21074 * @returns {boolean} Returns `true` if `string` starts with `target`, 21075 * else `false`. 21076 * @example 21077 * 21078 * _.startsWith('abc', 'a'); 21079 * // => true 21080 * 21081 * _.startsWith('abc', 'b'); 21082 * // => false 21083 * 21084 * _.startsWith('abc', 'b', 1); 21085 * // => true 21086 */ 21087 function startsWith(string, target, position) { 21088 string = toString(string); 21089 position = position == null 21090 ? 0 21091 : baseClamp(toInteger(position), 0, string.length); 21092 21093 target = baseToString(target); 21094 return string.slice(position, position + target.length) == target; 21095 } 21096 21097 /** 21098 * Creates a compiled template function that can interpolate data properties 21099 * in "interpolate" delimiters, HTML-escape interpolated data properties in 21100 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 21101 * properties may be accessed as free variables in the template. If a setting 21102 * object is given, it takes precedence over `_.templateSettings` values. 21103 * 21104 * **Note:** In the development build `_.template` utilizes 21105 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 21106 * for easier debugging. 21107 * 21108 * For more information on precompiling templates see 21109 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 21110 * 21111 * For more information on Chrome extension sandboxes see 21112 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 21113 * 21114 * @static 21115 * @since 0.1.0 21116 * @memberOf _ 21117 * @category String 21118 * @param {string} [string=''] The template string. 21119 * @param {Object} [options={}] The options object. 21120 * @param {RegExp} [options.escape=_.templateSettings.escape] 21121 * The HTML "escape" delimiter. 21122 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 21123 * The "evaluate" delimiter. 21124 * @param {Object} [options.imports=_.templateSettings.imports] 21125 * An object to import into the template as free variables. 21126 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 21127 * The "interpolate" delimiter. 21128 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 21129 * The sourceURL of the compiled template. 21130 * @param {string} [options.variable='obj'] 21131 * The data object variable name. 21132 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 21133 * @returns {Function} Returns the compiled template function. 21134 * @example 21135 * 21136 * // Use the "interpolate" delimiter to create a compiled template. 21137 * var compiled = _.template('hello <%= user %>!'); 21138 * compiled({ 'user': 'fred' }); 21139 * // => 'hello fred!' 21140 * 21141 * // Use the HTML "escape" delimiter to escape data property values. 21142 * var compiled = _.template('<b><%- value %></b>'); 21143 * compiled({ 'value': '<script>' }); 21144 * // => '<b><script></b>' 21145 * 21146 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 21147 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 21148 * compiled({ 'users': ['fred', 'barney'] }); 21149 * // => '<li>fred</li><li>barney</li>' 21150 * 21151 * // Use the internal `print` function in "evaluate" delimiters. 21152 * var compiled = _.template('<% print("hello " + user); %>!'); 21153 * compiled({ 'user': 'barney' }); 21154 * // => 'hello barney!' 21155 * 21156 * // Use the ES template literal delimiter as an "interpolate" delimiter. 21157 * // Disable support by replacing the "interpolate" delimiter. 21158 * var compiled = _.template('hello ${ user }!'); 21159 * compiled({ 'user': 'pebbles' }); 21160 * // => 'hello pebbles!' 21161 * 21162 * // Use backslashes to treat delimiters as plain text. 21163 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 21164 * compiled({ 'value': 'ignored' }); 21165 * // => '<%- value %>' 21166 * 21167 * // Use the `imports` option to import `jQuery` as `jq`. 21168 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 21169 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 21170 * compiled({ 'users': ['fred', 'barney'] }); 21171 * // => '<li>fred</li><li>barney</li>' 21172 * 21173 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 21174 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 21175 * compiled(data); 21176 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 21177 * 21178 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 21179 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 21180 * compiled.source; 21181 * // => function(data) { 21182 * // var __t, __p = ''; 21183 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 21184 * // return __p; 21185 * // } 21186 * 21187 * // Use custom template delimiters. 21188 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 21189 * var compiled = _.template('hello {{ user }}!'); 21190 * compiled({ 'user': 'mustache' }); 21191 * // => 'hello mustache!' 21192 * 21193 * // Use the `source` property to inline compiled templates for meaningful 21194 * // line numbers in error messages and stack traces. 21195 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 21196 * var JST = {\ 21197 * "main": ' + _.template(mainText).source + '\ 21198 * };\ 21199 * '); 21200 */ 21201 function template(string, options, guard) { 21202 // Based on John Resig's `tmpl` implementation 21203 // (http://ejohn.org/blog/javascript-micro-templating/) 21204 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 21205 var settings = lodash.templateSettings; 21206 21207 if (guard && isIterateeCall(string, options, guard)) { 21208 options = undefined; 21209 } 21210 string = toString(string); 21211 options = assignInWith({}, options, settings, customDefaultsAssignIn); 21212 21213 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), 21214 importsKeys = keys(imports), 21215 importsValues = baseValues(imports, importsKeys); 21216 21217 var isEscaping, 21218 isEvaluating, 21219 index = 0, 21220 interpolate = options.interpolate || reNoMatch, 21221 source = "__p += '"; 21222 21223 // Compile the regexp to match each delimiter. 21224 var reDelimiters = RegExp( 21225 (options.escape || reNoMatch).source + '|' + 21226 interpolate.source + '|' + 21227 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 21228 (options.evaluate || reNoMatch).source + '|$' 21229 , 'g'); 21230 21231 // Use a sourceURL for easier debugging. 21232 // The sourceURL gets injected into the source that's eval-ed, so be careful 21233 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 21234 // and escape the comment, thus injecting code that gets evaled. 21235 var sourceURL = '//# sourceURL=' + 21236 (hasOwnProperty.call(options, 'sourceURL') 21237 ? (options.sourceURL + '').replace(/\s/g, ' ') 21238 : ('lodash.templateSources[' + (++templateCounter) + ']') 21239 ) + '\n'; 21240 21241 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 21242 interpolateValue || (interpolateValue = esTemplateValue); 21243 21244 // Escape characters that can't be included in string literals. 21245 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 21246 21247 // Replace delimiters with snippets. 21248 if (escapeValue) { 21249 isEscaping = true; 21250 source += "' +\n__e(" + escapeValue + ") +\n'"; 21251 } 21252 if (evaluateValue) { 21253 isEvaluating = true; 21254 source += "';\n" + evaluateValue + ";\n__p += '"; 21255 } 21256 if (interpolateValue) { 21257 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 21258 } 21259 index = offset + match.length; 21260 21261 // The JS engine embedded in Adobe products needs `match` returned in 21262 // order to produce the correct `offset` value. 21263 return match; 21264 }); 21265 21266 source += "';\n"; 21267 21268 // If `variable` is not specified wrap a with-statement around the generated 21269 // code to add the data object to the top of the scope chain. 21270 var variable = hasOwnProperty.call(options, 'variable') && options.variable; 21271 if (!variable) { 21272 source = 'with (obj) {\n' + source + '\n}\n'; 21273 } 21274 // Throw an error if a forbidden character was found in `variable`, to prevent 21275 // potential command injection attacks. 21276 else if (reForbiddenIdentifierChars.test(variable)) { 21277 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); 21278 } 21279 21280 // Cleanup code by stripping empty strings. 21281 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 21282 .replace(reEmptyStringMiddle, '$1') 21283 .replace(reEmptyStringTrailing, '$1;'); 21284 21285 // Frame code as the function body. 21286 source = 'function(' + (variable || 'obj') + ') {\n' + 21287 (variable 21288 ? '' 21289 : 'obj || (obj = {});\n' 21290 ) + 21291 "var __t, __p = ''" + 21292 (isEscaping 21293 ? ', __e = _.escape' 21294 : '' 21295 ) + 21296 (isEvaluating 21297 ? ', __j = Array.prototype.join;\n' + 21298 "function print() { __p += __j.call(arguments, '') }\n" 21299 : ';\n' 21300 ) + 21301 source + 21302 'return __p\n}'; 21303 21304 var result = attempt(function() { 21305 return Function(importsKeys, sourceURL + 'return ' + source) 21306 .apply(undefined, importsValues); 21307 }); 21308 21309 // Provide the compiled function's source by its `toString` method or 21310 // the `source` property as a convenience for inlining compiled templates. 21311 result.source = source; 21312 if (isError(result)) { 21313 throw result; 21314 } 21315 return result; 21316 } 21317 21318 /** 21319 * Converts `string`, as a whole, to lower case just like 21320 * [String#toLowerCase](https://mdn.io/toLowerCase). 21321 * 21322 * @static 21323 * @memberOf _ 21324 * @since 4.0.0 21325 * @category String 21326 * @param {string} [string=''] The string to convert. 21327 * @returns {string} Returns the lower cased string. 21328 * @example 21329 * 21330 * _.toLower('--Foo-Bar--'); 21331 * // => '--foo-bar--' 21332 * 21333 * _.toLower('fooBar'); 21334 * // => 'foobar' 21335 * 21336 * _.toLower('__FOO_BAR__'); 21337 * // => '__foo_bar__' 21338 */ 21339 function toLower(value) { 21340 return toString(value).toLowerCase(); 21341 } 21342 21343 /** 21344 * Converts `string`, as a whole, to upper case just like 21345 * [String#toUpperCase](https://mdn.io/toUpperCase). 21346 * 21347 * @static 21348 * @memberOf _ 21349 * @since 4.0.0 21350 * @category String 21351 * @param {string} [string=''] The string to convert. 21352 * @returns {string} Returns the upper cased string. 21353 * @example 21354 * 21355 * _.toUpper('--foo-bar--'); 21356 * // => '--FOO-BAR--' 21357 * 21358 * _.toUpper('fooBar'); 21359 * // => 'FOOBAR' 21360 * 21361 * _.toUpper('__foo_bar__'); 21362 * // => '__FOO_BAR__' 21363 */ 21364 function toUpper(value) { 21365 return toString(value).toUpperCase(); 21366 } 21367 21368 /** 21369 * Removes leading and trailing whitespace or specified characters from `string`. 21370 * 21371 * @static 21372 * @memberOf _ 21373 * @since 3.0.0 21374 * @category String 21375 * @param {string} [string=''] The string to trim. 21376 * @param {string} [chars=whitespace] The characters to trim. 21377 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 21378 * @returns {string} Returns the trimmed string. 21379 * @example 21380 * 21381 * _.trim(' abc '); 21382 * // => 'abc' 21383 * 21384 * _.trim('-_-abc-_-', '_-'); 21385 * // => 'abc' 21386 * 21387 * _.map([' foo ', ' bar '], _.trim); 21388 * // => ['foo', 'bar'] 21389 */ 21390 function trim(string, chars, guard) { 21391 string = toString(string); 21392 if (string && (guard || chars === undefined)) { 21393 return baseTrim(string); 21394 } 21395 if (!string || !(chars = baseToString(chars))) { 21396 return string; 21397 } 21398 var strSymbols = stringToArray(string), 21399 chrSymbols = stringToArray(chars), 21400 start = charsStartIndex(strSymbols, chrSymbols), 21401 end = charsEndIndex(strSymbols, chrSymbols) + 1; 21402 21403 return castSlice(strSymbols, start, end).join(''); 21404 } 21405 21406 /** 21407 * Removes trailing whitespace or specified characters from `string`. 21408 * 21409 * @static 21410 * @memberOf _ 21411 * @since 4.0.0 21412 * @category String 21413 * @param {string} [string=''] The string to trim. 21414 * @param {string} [chars=whitespace] The characters to trim. 21415 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 21416 * @returns {string} Returns the trimmed string. 21417 * @example 21418 * 21419 * _.trimEnd(' abc '); 21420 * // => ' abc' 21421 * 21422 * _.trimEnd('-_-abc-_-', '_-'); 21423 * // => '-_-abc' 21424 */ 21425 function trimEnd(string, chars, guard) { 21426 string = toString(string); 21427 if (string && (guard || chars === undefined)) { 21428 return string.slice(0, trimmedEndIndex(string) + 1); 21429 } 21430 if (!string || !(chars = baseToString(chars))) { 21431 return string; 21432 } 21433 var strSymbols = stringToArray(string), 21434 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 21435 21436 return castSlice(strSymbols, 0, end).join(''); 21437 } 21438 21439 /** 21440 * Removes leading whitespace or specified characters from `string`. 21441 * 21442 * @static 21443 * @memberOf _ 21444 * @since 4.0.0 21445 * @category String 21446 * @param {string} [string=''] The string to trim. 21447 * @param {string} [chars=whitespace] The characters to trim. 21448 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 21449 * @returns {string} Returns the trimmed string. 21450 * @example 21451 * 21452 * _.trimStart(' abc '); 21453 * // => 'abc ' 21454 * 21455 * _.trimStart('-_-abc-_-', '_-'); 21456 * // => 'abc-_-' 21457 */ 21458 function trimStart(string, chars, guard) { 21459 string = toString(string); 21460 if (string && (guard || chars === undefined)) { 21461 return string.replace(reTrimStart, ''); 21462 } 21463 if (!string || !(chars = baseToString(chars))) { 21464 return string; 21465 } 21466 var strSymbols = stringToArray(string), 21467 start = charsStartIndex(strSymbols, stringToArray(chars)); 21468 21469 return castSlice(strSymbols, start).join(''); 21470 } 21471 21472 /** 21473 * Truncates `string` if it's longer than the given maximum string length. 21474 * The last characters of the truncated string are replaced with the omission 21475 * string which defaults to "...". 21476 * 21477 * @static 21478 * @memberOf _ 21479 * @since 4.0.0 21480 * @category String 21481 * @param {string} [string=''] The string to truncate. 21482 * @param {Object} [options={}] The options object. 21483 * @param {number} [options.length=30] The maximum string length. 21484 * @param {string} [options.omission='...'] The string to indicate text is omitted. 21485 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 21486 * @returns {string} Returns the truncated string. 21487 * @example 21488 * 21489 * _.truncate('hi-diddly-ho there, neighborino'); 21490 * // => 'hi-diddly-ho there, neighbo...' 21491 * 21492 * _.truncate('hi-diddly-ho there, neighborino', { 21493 * 'length': 24, 21494 * 'separator': ' ' 21495 * }); 21496 * // => 'hi-diddly-ho there,...' 21497 * 21498 * _.truncate('hi-diddly-ho there, neighborino', { 21499 * 'length': 24, 21500 * 'separator': /,? +/ 21501 * }); 21502 * // => 'hi-diddly-ho there...' 21503 * 21504 * _.truncate('hi-diddly-ho there, neighborino', { 21505 * 'omission': ' [...]' 21506 * }); 21507 * // => 'hi-diddly-ho there, neig [...]' 21508 */ 21509 function truncate(string, options) { 21510 var length = DEFAULT_TRUNC_LENGTH, 21511 omission = DEFAULT_TRUNC_OMISSION; 21512 21513 if (isObject(options)) { 21514 var separator = 'separator' in options ? options.separator : separator; 21515 length = 'length' in options ? toInteger(options.length) : length; 21516 omission = 'omission' in options ? baseToString(options.omission) : omission; 21517 } 21518 string = toString(string); 21519 21520 var strLength = string.length; 21521 if (hasUnicode(string)) { 21522 var strSymbols = stringToArray(string); 21523 strLength = strSymbols.length; 21524 } 21525 if (length >= strLength) { 21526 return string; 21527 } 21528 var end = length - stringSize(omission); 21529 if (end < 1) { 21530 return omission; 21531 } 21532 var result = strSymbols 21533 ? castSlice(strSymbols, 0, end).join('') 21534 : string.slice(0, end); 21535 21536 if (separator === undefined) { 21537 return result + omission; 21538 } 21539 if (strSymbols) { 21540 end += (result.length - end); 21541 } 21542 if (isRegExp(separator)) { 21543 if (string.slice(end).search(separator)) { 21544 var match, 21545 substring = result; 21546 21547 if (!separator.global) { 21548 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); 21549 } 21550 separator.lastIndex = 0; 21551 while ((match = separator.exec(substring))) { 21552 var newEnd = match.index; 21553 } 21554 result = result.slice(0, newEnd === undefined ? end : newEnd); 21555 } 21556 } else if (string.indexOf(baseToString(separator), end) != end) { 21557 var index = result.lastIndexOf(separator); 21558 if (index > -1) { 21559 result = result.slice(0, index); 21560 } 21561 } 21562 return result + omission; 21563 } 21564 21565 /** 21566 * The inverse of `_.escape`; this method converts the HTML entities 21567 * `&`, `<`, `>`, `"`, and `'` in `string` to 21568 * their corresponding characters. 21569 * 21570 * **Note:** No other HTML entities are unescaped. To unescape additional 21571 * HTML entities use a third-party library like [_he_](https://mths.be/he). 21572 * 21573 * @static 21574 * @memberOf _ 21575 * @since 0.6.0 21576 * @category String 21577 * @param {string} [string=''] The string to unescape. 21578 * @returns {string} Returns the unescaped string. 21579 * @example 21580 * 21581 * _.unescape('fred, barney, & pebbles'); 21582 * // => 'fred, barney, & pebbles' 21583 */ 21584 function unescape(string) { 21585 string = toString(string); 21586 return (string && reHasEscapedHtml.test(string)) 21587 ? string.replace(reEscapedHtml, unescapeHtmlChar) 21588 : string; 21589 } 21590 21591 /** 21592 * Converts `string`, as space separated words, to upper case. 21593 * 21594 * @static 21595 * @memberOf _ 21596 * @since 4.0.0 21597 * @category String 21598 * @param {string} [string=''] The string to convert. 21599 * @returns {string} Returns the upper cased string. 21600 * @example 21601 * 21602 * _.upperCase('--foo-bar'); 21603 * // => 'FOO BAR' 21604 * 21605 * _.upperCase('fooBar'); 21606 * // => 'FOO BAR' 21607 * 21608 * _.upperCase('__foo_bar__'); 21609 * // => 'FOO BAR' 21610 */ 21611 var upperCase = createCompounder(function(result, word, index) { 21612 return result + (index ? ' ' : '') + word.toUpperCase(); 21613 }); 21614 21615 /** 21616 * Converts the first character of `string` to upper case. 21617 * 21618 * @static 21619 * @memberOf _ 21620 * @since 4.0.0 21621 * @category String 21622 * @param {string} [string=''] The string to convert. 21623 * @returns {string} Returns the converted string. 21624 * @example 21625 * 21626 * _.upperFirst('fred'); 21627 * // => 'Fred' 21628 * 21629 * _.upperFirst('FRED'); 21630 * // => 'FRED' 21631 */ 21632 var upperFirst = createCaseFirst('toUpperCase'); 21633 21634 /** 21635 * Splits `string` into an array of its words. 21636 * 21637 * @static 21638 * @memberOf _ 21639 * @since 3.0.0 21640 * @category String 21641 * @param {string} [string=''] The string to inspect. 21642 * @param {RegExp|string} [pattern] The pattern to match words. 21643 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 21644 * @returns {Array} Returns the words of `string`. 21645 * @example 21646 * 21647 * _.words('fred, barney, & pebbles'); 21648 * // => ['fred', 'barney', 'pebbles'] 21649 * 21650 * _.words('fred, barney, & pebbles', /[^, ]+/g); 21651 * // => ['fred', 'barney', '&', 'pebbles'] 21652 */ 21653 function words(string, pattern, guard) { 21654 string = toString(string); 21655 pattern = guard ? undefined : pattern; 21656 21657 if (pattern === undefined) { 21658 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 21659 } 21660 return string.match(pattern) || []; 21661 } 21662 21663 /*------------------------------------------------------------------------*/ 21664 21665 /** 21666 * Attempts to invoke `func`, returning either the result or the caught error 21667 * object. Any additional arguments are provided to `func` when it's invoked. 21668 * 21669 * @static 21670 * @memberOf _ 21671 * @since 3.0.0 21672 * @category Util 21673 * @param {Function} func The function to attempt. 21674 * @param {...*} [args] The arguments to invoke `func` with. 21675 * @returns {*} Returns the `func` result or error object. 21676 * @example 21677 * 21678 * // Avoid throwing errors for invalid selectors. 21679 * var elements = _.attempt(function(selector) { 21680 * return document.querySelectorAll(selector); 21681 * }, '>_>'); 21682 * 21683 * if (_.isError(elements)) { 21684 * elements = []; 21685 * } 21686 */ 21687 var attempt = baseRest(function(func, args) { 21688 try { 21689 return apply(func, undefined, args); 21690 } catch (e) { 21691 return isError(e) ? e : new Error(e); 21692 } 21693 }); 21694 21695 /** 21696 * Binds methods of an object to the object itself, overwriting the existing 21697 * method. 21698 * 21699 * **Note:** This method doesn't set the "length" property of bound functions. 21700 * 21701 * @static 21702 * @since 0.1.0 21703 * @memberOf _ 21704 * @category Util 21705 * @param {Object} object The object to bind and assign the bound methods to. 21706 * @param {...(string|string[])} methodNames The object method names to bind. 21707 * @returns {Object} Returns `object`. 21708 * @example 21709 * 21710 * var view = { 21711 * 'label': 'docs', 21712 * 'click': function() { 21713 * console.log('clicked ' + this.label); 21714 * } 21715 * }; 21716 * 21717 * _.bindAll(view, ['click']); 21718 * jQuery(element).on('click', view.click); 21719 * // => Logs 'clicked docs' when clicked. 21720 */ 21721 var bindAll = flatRest(function(object, methodNames) { 21722 arrayEach(methodNames, function(key) { 21723 key = toKey(key); 21724 baseAssignValue(object, key, bind(object[key], object)); 21725 }); 21726 return object; 21727 }); 21728 21729 /** 21730 * Creates a function that iterates over `pairs` and invokes the corresponding 21731 * function of the first predicate to return truthy. The predicate-function 21732 * pairs are invoked with the `this` binding and arguments of the created 21733 * function. 21734 * 21735 * @static 21736 * @memberOf _ 21737 * @since 4.0.0 21738 * @category Util 21739 * @param {Array} pairs The predicate-function pairs. 21740 * @returns {Function} Returns the new composite function. 21741 * @example 21742 * 21743 * var func = _.cond([ 21744 * [_.matches({ 'a': 1 }), _.constant('matches A')], 21745 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 21746 * [_.stubTrue, _.constant('no match')] 21747 * ]); 21748 * 21749 * func({ 'a': 1, 'b': 2 }); 21750 * // => 'matches A' 21751 * 21752 * func({ 'a': 0, 'b': 1 }); 21753 * // => 'matches B' 21754 * 21755 * func({ 'a': '1', 'b': '2' }); 21756 * // => 'no match' 21757 */ 21758 function cond(pairs) { 21759 var length = pairs == null ? 0 : pairs.length, 21760 toIteratee = getIteratee(); 21761 21762 pairs = !length ? [] : arrayMap(pairs, function(pair) { 21763 if (typeof pair[1] != 'function') { 21764 throw new TypeError(FUNC_ERROR_TEXT); 21765 } 21766 return [toIteratee(pair[0]), pair[1]]; 21767 }); 21768 21769 return baseRest(function(args) { 21770 var index = -1; 21771 while (++index < length) { 21772 var pair = pairs[index]; 21773 if (apply(pair[0], this, args)) { 21774 return apply(pair[1], this, args); 21775 } 21776 } 21777 }); 21778 } 21779 21780 /** 21781 * Creates a function that invokes the predicate properties of `source` with 21782 * the corresponding property values of a given object, returning `true` if 21783 * all predicates return truthy, else `false`. 21784 * 21785 * **Note:** The created function is equivalent to `_.conformsTo` with 21786 * `source` partially applied. 21787 * 21788 * @static 21789 * @memberOf _ 21790 * @since 4.0.0 21791 * @category Util 21792 * @param {Object} source The object of property predicates to conform to. 21793 * @returns {Function} Returns the new spec function. 21794 * @example 21795 * 21796 * var objects = [ 21797 * { 'a': 2, 'b': 1 }, 21798 * { 'a': 1, 'b': 2 } 21799 * ]; 21800 * 21801 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 21802 * // => [{ 'a': 1, 'b': 2 }] 21803 */ 21804 function conforms(source) { 21805 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 21806 } 21807 21808 /** 21809 * Creates a function that returns `value`. 21810 * 21811 * @static 21812 * @memberOf _ 21813 * @since 2.4.0 21814 * @category Util 21815 * @param {*} value The value to return from the new function. 21816 * @returns {Function} Returns the new constant function. 21817 * @example 21818 * 21819 * var objects = _.times(2, _.constant({ 'a': 1 })); 21820 * 21821 * console.log(objects); 21822 * // => [{ 'a': 1 }, { 'a': 1 }] 21823 * 21824 * console.log(objects[0] === objects[1]); 21825 * // => true 21826 */ 21827 function constant(value) { 21828 return function() { 21829 return value; 21830 }; 21831 } 21832 21833 /** 21834 * Checks `value` to determine whether a default value should be returned in 21835 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 21836 * or `undefined`. 21837 * 21838 * @static 21839 * @memberOf _ 21840 * @since 4.14.0 21841 * @category Util 21842 * @param {*} value The value to check. 21843 * @param {*} defaultValue The default value. 21844 * @returns {*} Returns the resolved value. 21845 * @example 21846 * 21847 * _.defaultTo(1, 10); 21848 * // => 1 21849 * 21850 * _.defaultTo(undefined, 10); 21851 * // => 10 21852 */ 21853 function defaultTo(value, defaultValue) { 21854 return (value == null || value !== value) ? defaultValue : value; 21855 } 21856 21857 /** 21858 * Creates a function that returns the result of invoking the given functions 21859 * with the `this` binding of the created function, where each successive 21860 * invocation is supplied the return value of the previous. 21861 * 21862 * @static 21863 * @memberOf _ 21864 * @since 3.0.0 21865 * @category Util 21866 * @param {...(Function|Function[])} [funcs] The functions to invoke. 21867 * @returns {Function} Returns the new composite function. 21868 * @see _.flowRight 21869 * @example 21870 * 21871 * function square(n) { 21872 * return n * n; 21873 * } 21874 * 21875 * var addSquare = _.flow([_.add, square]); 21876 * addSquare(1, 2); 21877 * // => 9 21878 */ 21879 var flow = createFlow(); 21880 21881 /** 21882 * This method is like `_.flow` except that it creates a function that 21883 * invokes the given functions from right to left. 21884 * 21885 * @static 21886 * @since 3.0.0 21887 * @memberOf _ 21888 * @category Util 21889 * @param {...(Function|Function[])} [funcs] The functions to invoke. 21890 * @returns {Function} Returns the new composite function. 21891 * @see _.flow 21892 * @example 21893 * 21894 * function square(n) { 21895 * return n * n; 21896 * } 21897 * 21898 * var addSquare = _.flowRight([square, _.add]); 21899 * addSquare(1, 2); 21900 * // => 9 21901 */ 21902 var flowRight = createFlow(true); 21903 21904 /** 21905 * This method returns the first argument it receives. 21906 * 21907 * @static 21908 * @since 0.1.0 21909 * @memberOf _ 21910 * @category Util 21911 * @param {*} value Any value. 21912 * @returns {*} Returns `value`. 21913 * @example 21914 * 21915 * var object = { 'a': 1 }; 21916 * 21917 * console.log(_.identity(object) === object); 21918 * // => true 21919 */ 21920 function identity(value) { 21921 return value; 21922 } 21923 21924 /** 21925 * Creates a function that invokes `func` with the arguments of the created 21926 * function. If `func` is a property name, the created function returns the 21927 * property value for a given element. If `func` is an array or object, the 21928 * created function returns `true` for elements that contain the equivalent 21929 * source properties, otherwise it returns `false`. 21930 * 21931 * @static 21932 * @since 4.0.0 21933 * @memberOf _ 21934 * @category Util 21935 * @param {*} [func=_.identity] The value to convert to a callback. 21936 * @returns {Function} Returns the callback. 21937 * @example 21938 * 21939 * var users = [ 21940 * { 'user': 'barney', 'age': 36, 'active': true }, 21941 * { 'user': 'fred', 'age': 40, 'active': false } 21942 * ]; 21943 * 21944 * // The `_.matches` iteratee shorthand. 21945 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 21946 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 21947 * 21948 * // The `_.matchesProperty` iteratee shorthand. 21949 * _.filter(users, _.iteratee(['user', 'fred'])); 21950 * // => [{ 'user': 'fred', 'age': 40 }] 21951 * 21952 * // The `_.property` iteratee shorthand. 21953 * _.map(users, _.iteratee('user')); 21954 * // => ['barney', 'fred'] 21955 * 21956 * // Create custom iteratee shorthands. 21957 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 21958 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 21959 * return func.test(string); 21960 * }; 21961 * }); 21962 * 21963 * _.filter(['abc', 'def'], /ef/); 21964 * // => ['def'] 21965 */ 21966 function iteratee(func) { 21967 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); 21968 } 21969 21970 /** 21971 * Creates a function that performs a partial deep comparison between a given 21972 * object and `source`, returning `true` if the given object has equivalent 21973 * property values, else `false`. 21974 * 21975 * **Note:** The created function is equivalent to `_.isMatch` with `source` 21976 * partially applied. 21977 * 21978 * Partial comparisons will match empty array and empty object `source` 21979 * values against any array or object value, respectively. See `_.isEqual` 21980 * for a list of supported value comparisons. 21981 * 21982 * **Note:** Multiple values can be checked by combining several matchers 21983 * using `_.overSome` 21984 * 21985 * @static 21986 * @memberOf _ 21987 * @since 3.0.0 21988 * @category Util 21989 * @param {Object} source The object of property values to match. 21990 * @returns {Function} Returns the new spec function. 21991 * @example 21992 * 21993 * var objects = [ 21994 * { 'a': 1, 'b': 2, 'c': 3 }, 21995 * { 'a': 4, 'b': 5, 'c': 6 } 21996 * ]; 21997 * 21998 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 21999 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 22000 * 22001 * // Checking for several possible values 22002 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 22003 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 22004 */ 22005 function matches(source) { 22006 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 22007 } 22008 22009 /** 22010 * Creates a function that performs a partial deep comparison between the 22011 * value at `path` of a given object to `srcValue`, returning `true` if the 22012 * object value is equivalent, else `false`. 22013 * 22014 * **Note:** Partial comparisons will match empty array and empty object 22015 * `srcValue` values against any array or object value, respectively. See 22016 * `_.isEqual` for a list of supported value comparisons. 22017 * 22018 * **Note:** Multiple values can be checked by combining several matchers 22019 * using `_.overSome` 22020 * 22021 * @static 22022 * @memberOf _ 22023 * @since 3.2.0 22024 * @category Util 22025 * @param {Array|string} path The path of the property to get. 22026 * @param {*} srcValue The value to match. 22027 * @returns {Function} Returns the new spec function. 22028 * @example 22029 * 22030 * var objects = [ 22031 * { 'a': 1, 'b': 2, 'c': 3 }, 22032 * { 'a': 4, 'b': 5, 'c': 6 } 22033 * ]; 22034 * 22035 * _.find(objects, _.matchesProperty('a', 4)); 22036 * // => { 'a': 4, 'b': 5, 'c': 6 } 22037 * 22038 * // Checking for several possible values 22039 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 22040 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 22041 */ 22042 function matchesProperty(path, srcValue) { 22043 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 22044 } 22045 22046 /** 22047 * Creates a function that invokes the method at `path` of a given object. 22048 * Any additional arguments are provided to the invoked method. 22049 * 22050 * @static 22051 * @memberOf _ 22052 * @since 3.7.0 22053 * @category Util 22054 * @param {Array|string} path The path of the method to invoke. 22055 * @param {...*} [args] The arguments to invoke the method with. 22056 * @returns {Function} Returns the new invoker function. 22057 * @example 22058 * 22059 * var objects = [ 22060 * { 'a': { 'b': _.constant(2) } }, 22061 * { 'a': { 'b': _.constant(1) } } 22062 * ]; 22063 * 22064 * _.map(objects, _.method('a.b')); 22065 * // => [2, 1] 22066 * 22067 * _.map(objects, _.method(['a', 'b'])); 22068 * // => [2, 1] 22069 */ 22070 var method = baseRest(function(path, args) { 22071 return function(object) { 22072 return baseInvoke(object, path, args); 22073 }; 22074 }); 22075 22076 /** 22077 * The opposite of `_.method`; this method creates a function that invokes 22078 * the method at a given path of `object`. Any additional arguments are 22079 * provided to the invoked method. 22080 * 22081 * @static 22082 * @memberOf _ 22083 * @since 3.7.0 22084 * @category Util 22085 * @param {Object} object The object to query. 22086 * @param {...*} [args] The arguments to invoke the method with. 22087 * @returns {Function} Returns the new invoker function. 22088 * @example 22089 * 22090 * var array = _.times(3, _.constant), 22091 * object = { 'a': array, 'b': array, 'c': array }; 22092 * 22093 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 22094 * // => [2, 0] 22095 * 22096 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 22097 * // => [2, 0] 22098 */ 22099 var methodOf = baseRest(function(object, args) { 22100 return function(path) { 22101 return baseInvoke(object, path, args); 22102 }; 22103 }); 22104 22105 /** 22106 * Adds all own enumerable string keyed function properties of a source 22107 * object to the destination object. If `object` is a function, then methods 22108 * are added to its prototype as well. 22109 * 22110 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 22111 * avoid conflicts caused by modifying the original. 22112 * 22113 * @static 22114 * @since 0.1.0 22115 * @memberOf _ 22116 * @category Util 22117 * @param {Function|Object} [object=lodash] The destination object. 22118 * @param {Object} source The object of functions to add. 22119 * @param {Object} [options={}] The options object. 22120 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 22121 * @returns {Function|Object} Returns `object`. 22122 * @example 22123 * 22124 * function vowels(string) { 22125 * return _.filter(string, function(v) { 22126 * return /[aeiou]/i.test(v); 22127 * }); 22128 * } 22129 * 22130 * _.mixin({ 'vowels': vowels }); 22131 * _.vowels('fred'); 22132 * // => ['e'] 22133 * 22134 * _('fred').vowels().value(); 22135 * // => ['e'] 22136 * 22137 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 22138 * _('fred').vowels(); 22139 * // => ['e'] 22140 */ 22141 function mixin(object, source, options) { 22142 var props = keys(source), 22143 methodNames = baseFunctions(source, props); 22144 22145 if (options == null && 22146 !(isObject(source) && (methodNames.length || !props.length))) { 22147 options = source; 22148 source = object; 22149 object = this; 22150 methodNames = baseFunctions(source, keys(source)); 22151 } 22152 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 22153 isFunc = isFunction(object); 22154 22155 arrayEach(methodNames, function(methodName) { 22156 var func = source[methodName]; 22157 object[methodName] = func; 22158 if (isFunc) { 22159 object.prototype[methodName] = function() { 22160 var chainAll = this.__chain__; 22161 if (chain || chainAll) { 22162 var result = object(this.__wrapped__), 22163 actions = result.__actions__ = copyArray(this.__actions__); 22164 22165 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 22166 result.__chain__ = chainAll; 22167 return result; 22168 } 22169 return func.apply(object, arrayPush([this.value()], arguments)); 22170 }; 22171 } 22172 }); 22173 22174 return object; 22175 } 22176 22177 /** 22178 * Reverts the `_` variable to its previous value and returns a reference to 22179 * the `lodash` function. 22180 * 22181 * @static 22182 * @since 0.1.0 22183 * @memberOf _ 22184 * @category Util 22185 * @returns {Function} Returns the `lodash` function. 22186 * @example 22187 * 22188 * var lodash = _.noConflict(); 22189 */ 22190 function noConflict() { 22191 if (root._ === this) { 22192 root._ = oldDash; 22193 } 22194 return this; 22195 } 22196 22197 /** 22198 * This method returns `undefined`. 22199 * 22200 * @static 22201 * @memberOf _ 22202 * @since 2.3.0 22203 * @category Util 22204 * @example 22205 * 22206 * _.times(2, _.noop); 22207 * // => [undefined, undefined] 22208 */ 22209 function noop() { 22210 // No operation performed. 22211 } 22212 22213 /** 22214 * Creates a function that gets the argument at index `n`. If `n` is negative, 22215 * the nth argument from the end is returned. 22216 * 22217 * @static 22218 * @memberOf _ 22219 * @since 4.0.0 22220 * @category Util 22221 * @param {number} [n=0] The index of the argument to return. 22222 * @returns {Function} Returns the new pass-thru function. 22223 * @example 22224 * 22225 * var func = _.nthArg(1); 22226 * func('a', 'b', 'c', 'd'); 22227 * // => 'b' 22228 * 22229 * var func = _.nthArg(-2); 22230 * func('a', 'b', 'c', 'd'); 22231 * // => 'c' 22232 */ 22233 function nthArg(n) { 22234 n = toInteger(n); 22235 return baseRest(function(args) { 22236 return baseNth(args, n); 22237 }); 22238 } 22239 22240 /** 22241 * Creates a function that invokes `iteratees` with the arguments it receives 22242 * and returns their results. 22243 * 22244 * @static 22245 * @memberOf _ 22246 * @since 4.0.0 22247 * @category Util 22248 * @param {...(Function|Function[])} [iteratees=[_.identity]] 22249 * The iteratees to invoke. 22250 * @returns {Function} Returns the new function. 22251 * @example 22252 * 22253 * var func = _.over([Math.max, Math.min]); 22254 * 22255 * func(1, 2, 3, 4); 22256 * // => [4, 1] 22257 */ 22258 var over = createOver(arrayMap); 22259 22260 /** 22261 * Creates a function that checks if **all** of the `predicates` return 22262 * truthy when invoked with the arguments it receives. 22263 * 22264 * Following shorthands are possible for providing predicates. 22265 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 22266 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 22267 * 22268 * @static 22269 * @memberOf _ 22270 * @since 4.0.0 22271 * @category Util 22272 * @param {...(Function|Function[])} [predicates=[_.identity]] 22273 * The predicates to check. 22274 * @returns {Function} Returns the new function. 22275 * @example 22276 * 22277 * var func = _.overEvery([Boolean, isFinite]); 22278 * 22279 * func('1'); 22280 * // => true 22281 * 22282 * func(null); 22283 * // => false 22284 * 22285 * func(NaN); 22286 * // => false 22287 */ 22288 var overEvery = createOver(arrayEvery); 22289 22290 /** 22291 * Creates a function that checks if **any** of the `predicates` return 22292 * truthy when invoked with the arguments it receives. 22293 * 22294 * Following shorthands are possible for providing predicates. 22295 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 22296 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 22297 * 22298 * @static 22299 * @memberOf _ 22300 * @since 4.0.0 22301 * @category Util 22302 * @param {...(Function|Function[])} [predicates=[_.identity]] 22303 * The predicates to check. 22304 * @returns {Function} Returns the new function. 22305 * @example 22306 * 22307 * var func = _.overSome([Boolean, isFinite]); 22308 * 22309 * func('1'); 22310 * // => true 22311 * 22312 * func(null); 22313 * // => true 22314 * 22315 * func(NaN); 22316 * // => false 22317 * 22318 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 22319 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 22320 */ 22321 var overSome = createOver(arraySome); 22322 22323 /** 22324 * Creates a function that returns the value at `path` of a given object. 22325 * 22326 * @static 22327 * @memberOf _ 22328 * @since 2.4.0 22329 * @category Util 22330 * @param {Array|string} path The path of the property to get. 22331 * @returns {Function} Returns the new accessor function. 22332 * @example 22333 * 22334 * var objects = [ 22335 * { 'a': { 'b': 2 } }, 22336 * { 'a': { 'b': 1 } } 22337 * ]; 22338 * 22339 * _.map(objects, _.property('a.b')); 22340 * // => [2, 1] 22341 * 22342 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 22343 * // => [1, 2] 22344 */ 22345 function property(path) { 22346 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 22347 } 22348 22349 /** 22350 * The opposite of `_.property`; this method creates a function that returns 22351 * the value at a given path of `object`. 22352 * 22353 * @static 22354 * @memberOf _ 22355 * @since 3.0.0 22356 * @category Util 22357 * @param {Object} object The object to query. 22358 * @returns {Function} Returns the new accessor function. 22359 * @example 22360 * 22361 * var array = [0, 1, 2], 22362 * object = { 'a': array, 'b': array, 'c': array }; 22363 * 22364 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 22365 * // => [2, 0] 22366 * 22367 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 22368 * // => [2, 0] 22369 */ 22370 function propertyOf(object) { 22371 return function(path) { 22372 return object == null ? undefined : baseGet(object, path); 22373 }; 22374 } 22375 22376 /** 22377 * Creates an array of numbers (positive and/or negative) progressing from 22378 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 22379 * `start` is specified without an `end` or `step`. If `end` is not specified, 22380 * it's set to `start` with `start` then set to `0`. 22381 * 22382 * **Note:** JavaScript follows the IEEE-754 standard for resolving 22383 * floating-point values which can produce unexpected results. 22384 * 22385 * @static 22386 * @since 0.1.0 22387 * @memberOf _ 22388 * @category Util 22389 * @param {number} [start=0] The start of the range. 22390 * @param {number} end The end of the range. 22391 * @param {number} [step=1] The value to increment or decrement by. 22392 * @returns {Array} Returns the range of numbers. 22393 * @see _.inRange, _.rangeRight 22394 * @example 22395 * 22396 * _.range(4); 22397 * // => [0, 1, 2, 3] 22398 * 22399 * _.range(-4); 22400 * // => [0, -1, -2, -3] 22401 * 22402 * _.range(1, 5); 22403 * // => [1, 2, 3, 4] 22404 * 22405 * _.range(0, 20, 5); 22406 * // => [0, 5, 10, 15] 22407 * 22408 * _.range(0, -4, -1); 22409 * // => [0, -1, -2, -3] 22410 * 22411 * _.range(1, 4, 0); 22412 * // => [1, 1, 1] 22413 * 22414 * _.range(0); 22415 * // => [] 22416 */ 22417 var range = createRange(); 22418 22419 /** 22420 * This method is like `_.range` except that it populates values in 22421 * descending order. 22422 * 22423 * @static 22424 * @memberOf _ 22425 * @since 4.0.0 22426 * @category Util 22427 * @param {number} [start=0] The start of the range. 22428 * @param {number} end The end of the range. 22429 * @param {number} [step=1] The value to increment or decrement by. 22430 * @returns {Array} Returns the range of numbers. 22431 * @see _.inRange, _.range 22432 * @example 22433 * 22434 * _.rangeRight(4); 22435 * // => [3, 2, 1, 0] 22436 * 22437 * _.rangeRight(-4); 22438 * // => [-3, -2, -1, 0] 22439 * 22440 * _.rangeRight(1, 5); 22441 * // => [4, 3, 2, 1] 22442 * 22443 * _.rangeRight(0, 20, 5); 22444 * // => [15, 10, 5, 0] 22445 * 22446 * _.rangeRight(0, -4, -1); 22447 * // => [-3, -2, -1, 0] 22448 * 22449 * _.rangeRight(1, 4, 0); 22450 * // => [1, 1, 1] 22451 * 22452 * _.rangeRight(0); 22453 * // => [] 22454 */ 22455 var rangeRight = createRange(true); 22456 22457 /** 22458 * This method returns a new empty array. 22459 * 22460 * @static 22461 * @memberOf _ 22462 * @since 4.13.0 22463 * @category Util 22464 * @returns {Array} Returns the new empty array. 22465 * @example 22466 * 22467 * var arrays = _.times(2, _.stubArray); 22468 * 22469 * console.log(arrays); 22470 * // => [[], []] 22471 * 22472 * console.log(arrays[0] === arrays[1]); 22473 * // => false 22474 */ 22475 function stubArray() { 22476 return []; 22477 } 22478 22479 /** 22480 * This method returns `false`. 22481 * 22482 * @static 22483 * @memberOf _ 22484 * @since 4.13.0 22485 * @category Util 22486 * @returns {boolean} Returns `false`. 22487 * @example 22488 * 22489 * _.times(2, _.stubFalse); 22490 * // => [false, false] 22491 */ 22492 function stubFalse() { 22493 return false; 22494 } 22495 22496 /** 22497 * This method returns a new empty object. 22498 * 22499 * @static 22500 * @memberOf _ 22501 * @since 4.13.0 22502 * @category Util 22503 * @returns {Object} Returns the new empty object. 22504 * @example 22505 * 22506 * var objects = _.times(2, _.stubObject); 22507 * 22508 * console.log(objects); 22509 * // => [{}, {}] 22510 * 22511 * console.log(objects[0] === objects[1]); 22512 * // => false 22513 */ 22514 function stubObject() { 22515 return {}; 22516 } 22517 22518 /** 22519 * This method returns an empty string. 22520 * 22521 * @static 22522 * @memberOf _ 22523 * @since 4.13.0 22524 * @category Util 22525 * @returns {string} Returns the empty string. 22526 * @example 22527 * 22528 * _.times(2, _.stubString); 22529 * // => ['', ''] 22530 */ 22531 function stubString() { 22532 return ''; 22533 } 22534 22535 /** 22536 * This method returns `true`. 22537 * 22538 * @static 22539 * @memberOf _ 22540 * @since 4.13.0 22541 * @category Util 22542 * @returns {boolean} Returns `true`. 22543 * @example 22544 * 22545 * _.times(2, _.stubTrue); 22546 * // => [true, true] 22547 */ 22548 function stubTrue() { 22549 return true; 22550 } 22551 22552 /** 22553 * Invokes the iteratee `n` times, returning an array of the results of 22554 * each invocation. The iteratee is invoked with one argument; (index). 22555 * 22556 * @static 22557 * @since 0.1.0 22558 * @memberOf _ 22559 * @category Util 22560 * @param {number} n The number of times to invoke `iteratee`. 22561 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 22562 * @returns {Array} Returns the array of results. 22563 * @example 22564 * 22565 * _.times(3, String); 22566 * // => ['0', '1', '2'] 22567 * 22568 * _.times(4, _.constant(0)); 22569 * // => [0, 0, 0, 0] 22570 */ 22571 function times(n, iteratee) { 22572 n = toInteger(n); 22573 if (n < 1 || n > MAX_SAFE_INTEGER) { 22574 return []; 22575 } 22576 var index = MAX_ARRAY_LENGTH, 22577 length = nativeMin(n, MAX_ARRAY_LENGTH); 22578 22579 iteratee = getIteratee(iteratee); 22580 n -= MAX_ARRAY_LENGTH; 22581 22582 var result = baseTimes(length, iteratee); 22583 while (++index < n) { 22584 iteratee(index); 22585 } 22586 return result; 22587 } 22588 22589 /** 22590 * Converts `value` to a property path array. 22591 * 22592 * @static 22593 * @memberOf _ 22594 * @since 4.0.0 22595 * @category Util 22596 * @param {*} value The value to convert. 22597 * @returns {Array} Returns the new property path array. 22598 * @example 22599 * 22600 * _.toPath('a.b.c'); 22601 * // => ['a', 'b', 'c'] 22602 * 22603 * _.toPath('a[0].b.c'); 22604 * // => ['a', '0', 'b', 'c'] 22605 */ 22606 function toPath(value) { 22607 if (isArray(value)) { 22608 return arrayMap(value, toKey); 22609 } 22610 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 22611 } 22612 22613 /** 22614 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 22615 * 22616 * @static 22617 * @since 0.1.0 22618 * @memberOf _ 22619 * @category Util 22620 * @param {string} [prefix=''] The value to prefix the ID with. 22621 * @returns {string} Returns the unique ID. 22622 * @example 22623 * 22624 * _.uniqueId('contact_'); 22625 * // => 'contact_104' 22626 * 22627 * _.uniqueId(); 22628 * // => '105' 22629 */ 22630 function uniqueId(prefix) { 22631 var id = ++idCounter; 22632 return toString(prefix) + id; 22633 } 22634 22635 /*------------------------------------------------------------------------*/ 22636 22637 /** 22638 * Adds two numbers. 22639 * 22640 * @static 22641 * @memberOf _ 22642 * @since 3.4.0 22643 * @category Math 22644 * @param {number} augend The first number in an addition. 22645 * @param {number} addend The second number in an addition. 22646 * @returns {number} Returns the total. 22647 * @example 22648 * 22649 * _.add(6, 4); 22650 * // => 10 22651 */ 22652 var add = createMathOperation(function(augend, addend) { 22653 return augend + addend; 22654 }, 0); 22655 22656 /** 22657 * Computes `number` rounded up to `precision`. 22658 * 22659 * @static 22660 * @memberOf _ 22661 * @since 3.10.0 22662 * @category Math 22663 * @param {number} number The number to round up. 22664 * @param {number} [precision=0] The precision to round up to. 22665 * @returns {number} Returns the rounded up number. 22666 * @example 22667 * 22668 * _.ceil(4.006); 22669 * // => 5 22670 * 22671 * _.ceil(6.004, 2); 22672 * // => 6.01 22673 * 22674 * _.ceil(6040, -2); 22675 * // => 6100 22676 */ 22677 var ceil = createRound('ceil'); 22678 22679 /** 22680 * Divide two numbers. 22681 * 22682 * @static 22683 * @memberOf _ 22684 * @since 4.7.0 22685 * @category Math 22686 * @param {number} dividend The first number in a division. 22687 * @param {number} divisor The second number in a division. 22688 * @returns {number} Returns the quotient. 22689 * @example 22690 * 22691 * _.divide(6, 4); 22692 * // => 1.5 22693 */ 22694 var divide = createMathOperation(function(dividend, divisor) { 22695 return dividend / divisor; 22696 }, 1); 22697 22698 /** 22699 * Computes `number` rounded down to `precision`. 22700 * 22701 * @static 22702 * @memberOf _ 22703 * @since 3.10.0 22704 * @category Math 22705 * @param {number} number The number to round down. 22706 * @param {number} [precision=0] The precision to round down to. 22707 * @returns {number} Returns the rounded down number. 22708 * @example 22709 * 22710 * _.floor(4.006); 22711 * // => 4 22712 * 22713 * _.floor(0.046, 2); 22714 * // => 0.04 22715 * 22716 * _.floor(4060, -2); 22717 * // => 4000 22718 */ 22719 var floor = createRound('floor'); 22720 22721 /** 22722 * Computes the maximum value of `array`. If `array` is empty or falsey, 22723 * `undefined` is returned. 22724 * 22725 * @static 22726 * @since 0.1.0 22727 * @memberOf _ 22728 * @category Math 22729 * @param {Array} array The array to iterate over. 22730 * @returns {*} Returns the maximum value. 22731 * @example 22732 * 22733 * _.max([4, 2, 8, 6]); 22734 * // => 8 22735 * 22736 * _.max([]); 22737 * // => undefined 22738 */ 22739 function max(array) { 22740 return (array && array.length) 22741 ? baseExtremum(array, identity, baseGt) 22742 : undefined; 22743 } 22744 22745 /** 22746 * This method is like `_.max` except that it accepts `iteratee` which is 22747 * invoked for each element in `array` to generate the criterion by which 22748 * the value is ranked. The iteratee is invoked with one argument: (value). 22749 * 22750 * @static 22751 * @memberOf _ 22752 * @since 4.0.0 22753 * @category Math 22754 * @param {Array} array The array to iterate over. 22755 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22756 * @returns {*} Returns the maximum value. 22757 * @example 22758 * 22759 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 22760 * 22761 * _.maxBy(objects, function(o) { return o.n; }); 22762 * // => { 'n': 2 } 22763 * 22764 * // The `_.property` iteratee shorthand. 22765 * _.maxBy(objects, 'n'); 22766 * // => { 'n': 2 } 22767 */ 22768 function maxBy(array, iteratee) { 22769 return (array && array.length) 22770 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) 22771 : undefined; 22772 } 22773 22774 /** 22775 * Computes the mean of the values in `array`. 22776 * 22777 * @static 22778 * @memberOf _ 22779 * @since 4.0.0 22780 * @category Math 22781 * @param {Array} array The array to iterate over. 22782 * @returns {number} Returns the mean. 22783 * @example 22784 * 22785 * _.mean([4, 2, 8, 6]); 22786 * // => 5 22787 */ 22788 function mean(array) { 22789 return baseMean(array, identity); 22790 } 22791 22792 /** 22793 * This method is like `_.mean` except that it accepts `iteratee` which is 22794 * invoked for each element in `array` to generate the value to be averaged. 22795 * The iteratee is invoked with one argument: (value). 22796 * 22797 * @static 22798 * @memberOf _ 22799 * @since 4.7.0 22800 * @category Math 22801 * @param {Array} array The array to iterate over. 22802 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22803 * @returns {number} Returns the mean. 22804 * @example 22805 * 22806 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 22807 * 22808 * _.meanBy(objects, function(o) { return o.n; }); 22809 * // => 5 22810 * 22811 * // The `_.property` iteratee shorthand. 22812 * _.meanBy(objects, 'n'); 22813 * // => 5 22814 */ 22815 function meanBy(array, iteratee) { 22816 return baseMean(array, getIteratee(iteratee, 2)); 22817 } 22818 22819 /** 22820 * Computes the minimum value of `array`. If `array` is empty or falsey, 22821 * `undefined` is returned. 22822 * 22823 * @static 22824 * @since 0.1.0 22825 * @memberOf _ 22826 * @category Math 22827 * @param {Array} array The array to iterate over. 22828 * @returns {*} Returns the minimum value. 22829 * @example 22830 * 22831 * _.min([4, 2, 8, 6]); 22832 * // => 2 22833 * 22834 * _.min([]); 22835 * // => undefined 22836 */ 22837 function min(array) { 22838 return (array && array.length) 22839 ? baseExtremum(array, identity, baseLt) 22840 : undefined; 22841 } 22842 22843 /** 22844 * This method is like `_.min` except that it accepts `iteratee` which is 22845 * invoked for each element in `array` to generate the criterion by which 22846 * the value is ranked. The iteratee is invoked with one argument: (value). 22847 * 22848 * @static 22849 * @memberOf _ 22850 * @since 4.0.0 22851 * @category Math 22852 * @param {Array} array The array to iterate over. 22853 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22854 * @returns {*} Returns the minimum value. 22855 * @example 22856 * 22857 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 22858 * 22859 * _.minBy(objects, function(o) { return o.n; }); 22860 * // => { 'n': 1 } 22861 * 22862 * // The `_.property` iteratee shorthand. 22863 * _.minBy(objects, 'n'); 22864 * // => { 'n': 1 } 22865 */ 22866 function minBy(array, iteratee) { 22867 return (array && array.length) 22868 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) 22869 : undefined; 22870 } 22871 22872 /** 22873 * Multiply two numbers. 22874 * 22875 * @static 22876 * @memberOf _ 22877 * @since 4.7.0 22878 * @category Math 22879 * @param {number} multiplier The first number in a multiplication. 22880 * @param {number} multiplicand The second number in a multiplication. 22881 * @returns {number} Returns the product. 22882 * @example 22883 * 22884 * _.multiply(6, 4); 22885 * // => 24 22886 */ 22887 var multiply = createMathOperation(function(multiplier, multiplicand) { 22888 return multiplier * multiplicand; 22889 }, 1); 22890 22891 /** 22892 * Computes `number` rounded to `precision`. 22893 * 22894 * @static 22895 * @memberOf _ 22896 * @since 3.10.0 22897 * @category Math 22898 * @param {number} number The number to round. 22899 * @param {number} [precision=0] The precision to round to. 22900 * @returns {number} Returns the rounded number. 22901 * @example 22902 * 22903 * _.round(4.006); 22904 * // => 4 22905 * 22906 * _.round(4.006, 2); 22907 * // => 4.01 22908 * 22909 * _.round(4060, -2); 22910 * // => 4100 22911 */ 22912 var round = createRound('round'); 22913 22914 /** 22915 * Subtract two numbers. 22916 * 22917 * @static 22918 * @memberOf _ 22919 * @since 4.0.0 22920 * @category Math 22921 * @param {number} minuend The first number in a subtraction. 22922 * @param {number} subtrahend The second number in a subtraction. 22923 * @returns {number} Returns the difference. 22924 * @example 22925 * 22926 * _.subtract(6, 4); 22927 * // => 2 22928 */ 22929 var subtract = createMathOperation(function(minuend, subtrahend) { 22930 return minuend - subtrahend; 22931 }, 0); 22932 22933 /** 22934 * Computes the sum of the values in `array`. 22935 * 22936 * @static 22937 * @memberOf _ 22938 * @since 3.4.0 22939 * @category Math 22940 * @param {Array} array The array to iterate over. 22941 * @returns {number} Returns the sum. 22942 * @example 22943 * 22944 * _.sum([4, 2, 8, 6]); 22945 * // => 20 22946 */ 22947 function sum(array) { 22948 return (array && array.length) 22949 ? baseSum(array, identity) 22950 : 0; 22951 } 22952 22953 /** 22954 * This method is like `_.sum` except that it accepts `iteratee` which is 22955 * invoked for each element in `array` to generate the value to be summed. 22956 * The iteratee is invoked with one argument: (value). 22957 * 22958 * @static 22959 * @memberOf _ 22960 * @since 4.0.0 22961 * @category Math 22962 * @param {Array} array The array to iterate over. 22963 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 22964 * @returns {number} Returns the sum. 22965 * @example 22966 * 22967 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 22968 * 22969 * _.sumBy(objects, function(o) { return o.n; }); 22970 * // => 20 22971 * 22972 * // The `_.property` iteratee shorthand. 22973 * _.sumBy(objects, 'n'); 22974 * // => 20 22975 */ 22976 function sumBy(array, iteratee) { 22977 return (array && array.length) 22978 ? baseSum(array, getIteratee(iteratee, 2)) 22979 : 0; 22980 } 22981 22982 /*------------------------------------------------------------------------*/ 22983 22984 // Add methods that return wrapped values in chain sequences. 22985 lodash.after = after; 22986 lodash.ary = ary; 22987 lodash.assign = assign; 22988 lodash.assignIn = assignIn; 22989 lodash.assignInWith = assignInWith; 22990 lodash.assignWith = assignWith; 22991 lodash.at = at; 22992 lodash.before = before; 22993 lodash.bind = bind; 22994 lodash.bindAll = bindAll; 22995 lodash.bindKey = bindKey; 22996 lodash.castArray = castArray; 22997 lodash.chain = chain; 22998 lodash.chunk = chunk; 22999 lodash.compact = compact; 23000 lodash.concat = concat; 23001 lodash.cond = cond; 23002 lodash.conforms = conforms; 23003 lodash.constant = constant; 23004 lodash.countBy = countBy; 23005 lodash.create = create; 23006 lodash.curry = curry; 23007 lodash.curryRight = curryRight; 23008 lodash.debounce = debounce; 23009 lodash.defaults = defaults; 23010 lodash.defaultsDeep = defaultsDeep; 23011 lodash.defer = defer; 23012 lodash.delay = delay; 23013 lodash.difference = difference; 23014 lodash.differenceBy = differenceBy; 23015 lodash.differenceWith = differenceWith; 23016 lodash.drop = drop; 23017 lodash.dropRight = dropRight; 23018 lodash.dropRightWhile = dropRightWhile; 23019 lodash.dropWhile = dropWhile; 23020 lodash.fill = fill; 23021 lodash.filter = filter; 23022 lodash.flatMap = flatMap; 23023 lodash.flatMapDeep = flatMapDeep; 23024 lodash.flatMapDepth = flatMapDepth; 23025 lodash.flatten = flatten; 23026 lodash.flattenDeep = flattenDeep; 23027 lodash.flattenDepth = flattenDepth; 23028 lodash.flip = flip; 23029 lodash.flow = flow; 23030 lodash.flowRight = flowRight; 23031 lodash.fromPairs = fromPairs; 23032 lodash.functions = functions; 23033 lodash.functionsIn = functionsIn; 23034 lodash.groupBy = groupBy; 23035 lodash.initial = initial; 23036 lodash.intersection = intersection; 23037 lodash.intersectionBy = intersectionBy; 23038 lodash.intersectionWith = intersectionWith; 23039 lodash.invert = invert; 23040 lodash.invertBy = invertBy; 23041 lodash.invokeMap = invokeMap; 23042 lodash.iteratee = iteratee; 23043 lodash.keyBy = keyBy; 23044 lodash.keys = keys; 23045 lodash.keysIn = keysIn; 23046 lodash.map = map; 23047 lodash.mapKeys = mapKeys; 23048 lodash.mapValues = mapValues; 23049 lodash.matches = matches; 23050 lodash.matchesProperty = matchesProperty; 23051 lodash.memoize = memoize; 23052 lodash.merge = merge; 23053 lodash.mergeWith = mergeWith; 23054 lodash.method = method; 23055 lodash.methodOf = methodOf; 23056 lodash.mixin = mixin; 23057 lodash.negate = negate; 23058 lodash.nthArg = nthArg; 23059 lodash.omit = omit; 23060 lodash.omitBy = omitBy; 23061 lodash.once = once; 23062 lodash.orderBy = orderBy; 23063 lodash.over = over; 23064 lodash.overArgs = overArgs; 23065 lodash.overEvery = overEvery; 23066 lodash.overSome = overSome; 23067 lodash.partial = partial; 23068 lodash.partialRight = partialRight; 23069 lodash.partition = partition; 23070 lodash.pick = pick; 23071 lodash.pickBy = pickBy; 23072 lodash.property = property; 23073 lodash.propertyOf = propertyOf; 23074 lodash.pull = pull; 23075 lodash.pullAll = pullAll; 23076 lodash.pullAllBy = pullAllBy; 23077 lodash.pullAllWith = pullAllWith; 23078 lodash.pullAt = pullAt; 23079 lodash.range = range; 23080 lodash.rangeRight = rangeRight; 23081 lodash.rearg = rearg; 23082 lodash.reject = reject; 23083 lodash.remove = remove; 23084 lodash.rest = rest; 23085 lodash.reverse = reverse; 23086 lodash.sampleSize = sampleSize; 23087 lodash.set = set; 23088 lodash.setWith = setWith; 23089 lodash.shuffle = shuffle; 23090 lodash.slice = slice; 23091 lodash.sortBy = sortBy; 23092 lodash.sortedUniq = sortedUniq; 23093 lodash.sortedUniqBy = sortedUniqBy; 23094 lodash.split = split; 23095 lodash.spread = spread; 23096 lodash.tail = tail; 23097 lodash.take = take; 23098 lodash.takeRight = takeRight; 23099 lodash.takeRightWhile = takeRightWhile; 23100 lodash.takeWhile = takeWhile; 23101 lodash.tap = tap; 23102 lodash.throttle = throttle; 23103 lodash.thru = thru; 23104 lodash.toArray = toArray; 23105 lodash.toPairs = toPairs; 23106 lodash.toPairsIn = toPairsIn; 23107 lodash.toPath = toPath; 23108 lodash.toPlainObject = toPlainObject; 23109 lodash.transform = transform; 23110 lodash.unary = unary; 23111 lodash.union = union; 23112 lodash.unionBy = unionBy; 23113 lodash.unionWith = unionWith; 23114 lodash.uniq = uniq; 23115 lodash.uniqBy = uniqBy; 23116 lodash.uniqWith = uniqWith; 23117 lodash.unset = unset; 23118 lodash.unzip = unzip; 23119 lodash.unzipWith = unzipWith; 23120 lodash.update = update; 23121 lodash.updateWith = updateWith; 23122 lodash.values = values; 23123 lodash.valuesIn = valuesIn; 23124 lodash.without = without; 23125 lodash.words = words; 23126 lodash.wrap = wrap; 23127 lodash.xor = xor; 23128 lodash.xorBy = xorBy; 23129 lodash.xorWith = xorWith; 23130 lodash.zip = zip; 23131 lodash.zipObject = zipObject; 23132 lodash.zipObjectDeep = zipObjectDeep; 23133 lodash.zipWith = zipWith; 23134 23135 // Add aliases. 23136 lodash.entries = toPairs; 23137 lodash.entriesIn = toPairsIn; 23138 lodash.extend = assignIn; 23139 lodash.extendWith = assignInWith; 23140 23141 // Add methods to `lodash.prototype`. 23142 mixin(lodash, lodash); 23143 23144 /*------------------------------------------------------------------------*/ 23145 23146 // Add methods that return unwrapped values in chain sequences. 23147 lodash.add = add; 23148 lodash.attempt = attempt; 23149 lodash.camelCase = camelCase; 23150 lodash.capitalize = capitalize; 23151 lodash.ceil = ceil; 23152 lodash.clamp = clamp; 23153 lodash.clone = clone; 23154 lodash.cloneDeep = cloneDeep; 23155 lodash.cloneDeepWith = cloneDeepWith; 23156 lodash.cloneWith = cloneWith; 23157 lodash.conformsTo = conformsTo; 23158 lodash.deburr = deburr; 23159 lodash.defaultTo = defaultTo; 23160 lodash.divide = divide; 23161 lodash.endsWith = endsWith; 23162 lodash.eq = eq; 23163 lodash.escape = escape; 23164 lodash.escapeRegExp = escapeRegExp; 23165 lodash.every = every; 23166 lodash.find = find; 23167 lodash.findIndex = findIndex; 23168 lodash.findKey = findKey; 23169 lodash.findLast = findLast; 23170 lodash.findLastIndex = findLastIndex; 23171 lodash.findLastKey = findLastKey; 23172 lodash.floor = floor; 23173 lodash.forEach = forEach; 23174 lodash.forEachRight = forEachRight; 23175 lodash.forIn = forIn; 23176 lodash.forInRight = forInRight; 23177 lodash.forOwn = forOwn; 23178 lodash.forOwnRight = forOwnRight; 23179 lodash.get = get; 23180 lodash.gt = gt; 23181 lodash.gte = gte; 23182 lodash.has = has; 23183 lodash.hasIn = hasIn; 23184 lodash.head = head; 23185 lodash.identity = identity; 23186 lodash.includes = includes; 23187 lodash.indexOf = indexOf; 23188 lodash.inRange = inRange; 23189 lodash.invoke = invoke; 23190 lodash.isArguments = isArguments; 23191 lodash.isArray = isArray; 23192 lodash.isArrayBuffer = isArrayBuffer; 23193 lodash.isArrayLike = isArrayLike; 23194 lodash.isArrayLikeObject = isArrayLikeObject; 23195 lodash.isBoolean = isBoolean; 23196 lodash.isBuffer = isBuffer; 23197 lodash.isDate = isDate; 23198 lodash.isElement = isElement; 23199 lodash.isEmpty = isEmpty; 23200 lodash.isEqual = isEqual; 23201 lodash.isEqualWith = isEqualWith; 23202 lodash.isError = isError; 23203 lodash.isFinite = isFinite; 23204 lodash.isFunction = isFunction; 23205 lodash.isInteger = isInteger; 23206 lodash.isLength = isLength; 23207 lodash.isMap = isMap; 23208 lodash.isMatch = isMatch; 23209 lodash.isMatchWith = isMatchWith; 23210 lodash.isNaN = isNaN; 23211 lodash.isNative = isNative; 23212 lodash.isNil = isNil; 23213 lodash.isNull = isNull; 23214 lodash.isNumber = isNumber; 23215 lodash.isObject = isObject; 23216 lodash.isObjectLike = isObjectLike; 23217 lodash.isPlainObject = isPlainObject; 23218 lodash.isRegExp = isRegExp; 23219 lodash.isSafeInteger = isSafeInteger; 23220 lodash.isSet = isSet; 23221 lodash.isString = isString; 23222 lodash.isSymbol = isSymbol; 23223 lodash.isTypedArray = isTypedArray; 23224 lodash.isUndefined = isUndefined; 23225 lodash.isWeakMap = isWeakMap; 23226 lodash.isWeakSet = isWeakSet; 23227 lodash.join = join; 23228 lodash.kebabCase = kebabCase; 23229 lodash.last = last; 23230 lodash.lastIndexOf = lastIndexOf; 23231 lodash.lowerCase = lowerCase; 23232 lodash.lowerFirst = lowerFirst; 23233 lodash.lt = lt; 23234 lodash.lte = lte; 23235 lodash.max = max; 23236 lodash.maxBy = maxBy; 23237 lodash.mean = mean; 23238 lodash.meanBy = meanBy; 23239 lodash.min = min; 23240 lodash.minBy = minBy; 23241 lodash.stubArray = stubArray; 23242 lodash.stubFalse = stubFalse; 23243 lodash.stubObject = stubObject; 23244 lodash.stubString = stubString; 23245 lodash.stubTrue = stubTrue; 23246 lodash.multiply = multiply; 23247 lodash.nth = nth; 23248 lodash.noConflict = noConflict; 23249 lodash.noop = noop; 23250 lodash.now = now; 23251 lodash.pad = pad; 23252 lodash.padEnd = padEnd; 23253 lodash.padStart = padStart; 23254 lodash.parseInt = parseInt; 23255 lodash.random = random; 23256 lodash.reduce = reduce; 23257 lodash.reduceRight = reduceRight; 23258 lodash.repeat = repeat; 23259 lodash.replace = replace; 23260 lodash.result = result; 23261 lodash.round = round; 23262 lodash.runInContext = runInContext; 23263 lodash.sample = sample; 23264 lodash.size = size; 23265 lodash.snakeCase = snakeCase; 23266 lodash.some = some; 23267 lodash.sortedIndex = sortedIndex; 23268 lodash.sortedIndexBy = sortedIndexBy; 23269 lodash.sortedIndexOf = sortedIndexOf; 23270 lodash.sortedLastIndex = sortedLastIndex; 23271 lodash.sortedLastIndexBy = sortedLastIndexBy; 23272 lodash.sortedLastIndexOf = sortedLastIndexOf; 23273 lodash.startCase = startCase; 23274 lodash.startsWith = startsWith; 23275 lodash.subtract = subtract; 23276 lodash.sum = sum; 23277 lodash.sumBy = sumBy; 23278 lodash.template = template; 23279 lodash.times = times; 23280 lodash.toFinite = toFinite; 23281 lodash.toInteger = toInteger; 23282 lodash.toLength = toLength; 23283 lodash.toLower = toLower; 23284 lodash.toNumber = toNumber; 23285 lodash.toSafeInteger = toSafeInteger; 23286 lodash.toString = toString; 23287 lodash.toUpper = toUpper; 23288 lodash.trim = trim; 23289 lodash.trimEnd = trimEnd; 23290 lodash.trimStart = trimStart; 23291 lodash.truncate = truncate; 23292 lodash.unescape = unescape; 23293 lodash.uniqueId = uniqueId; 23294 lodash.upperCase = upperCase; 23295 lodash.upperFirst = upperFirst; 23296 23297 // Add aliases. 23298 lodash.each = forEach; 23299 lodash.eachRight = forEachRight; 23300 lodash.first = head; 23301 23302 mixin(lodash, (function() { 23303 var source = {}; 23304 baseForOwn(lodash, function(func, methodName) { 23305 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 23306 source[methodName] = func; 23307 } 23308 }); 23309 return source; 23310 }()), { 'chain': false }); 23311 23312 /*------------------------------------------------------------------------*/ 23313 23314 /** 23315 * The semantic version number. 23316 * 23317 * @static 23318 * @memberOf _ 23319 * @type {string} 23320 */ 23321 lodash.VERSION = VERSION; 23322 23323 // Assign default placeholders. 23324 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 23325 lodash[methodName].placeholder = lodash; 23326 }); 23327 23328 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 23329 arrayEach(['drop', 'take'], function(methodName, index) { 23330 LazyWrapper.prototype[methodName] = function(n) { 23331 n = n === undefined ? 1 : nativeMax(toInteger(n), 0); 23332 23333 var result = (this.__filtered__ && !index) 23334 ? new LazyWrapper(this) 23335 : this.clone(); 23336 23337 if (result.__filtered__) { 23338 result.__takeCount__ = nativeMin(n, result.__takeCount__); 23339 } else { 23340 result.__views__.push({ 23341 'size': nativeMin(n, MAX_ARRAY_LENGTH), 23342 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') 23343 }); 23344 } 23345 return result; 23346 }; 23347 23348 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 23349 return this.reverse()[methodName](n).reverse(); 23350 }; 23351 }); 23352 23353 // Add `LazyWrapper` methods that accept an `iteratee` value. 23354 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 23355 var type = index + 1, 23356 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 23357 23358 LazyWrapper.prototype[methodName] = function(iteratee) { 23359 var result = this.clone(); 23360 result.__iteratees__.push({ 23361 'iteratee': getIteratee(iteratee, 3), 23362 'type': type 23363 }); 23364 result.__filtered__ = result.__filtered__ || isFilter; 23365 return result; 23366 }; 23367 }); 23368 23369 // Add `LazyWrapper` methods for `_.head` and `_.last`. 23370 arrayEach(['head', 'last'], function(methodName, index) { 23371 var takeName = 'take' + (index ? 'Right' : ''); 23372 23373 LazyWrapper.prototype[methodName] = function() { 23374 return this[takeName](1).value()[0]; 23375 }; 23376 }); 23377 23378 // Add `LazyWrapper` methods for `_.initial` and `_.tail`. 23379 arrayEach(['initial', 'tail'], function(methodName, index) { 23380 var dropName = 'drop' + (index ? '' : 'Right'); 23381 23382 LazyWrapper.prototype[methodName] = function() { 23383 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 23384 }; 23385 }); 23386 23387 LazyWrapper.prototype.compact = function() { 23388 return this.filter(identity); 23389 }; 23390 23391 LazyWrapper.prototype.find = function(predicate) { 23392 return this.filter(predicate).head(); 23393 }; 23394 23395 LazyWrapper.prototype.findLast = function(predicate) { 23396 return this.reverse().find(predicate); 23397 }; 23398 23399 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 23400 if (typeof path == 'function') { 23401 return new LazyWrapper(this); 23402 } 23403 return this.map(function(value) { 23404 return baseInvoke(value, path, args); 23405 }); 23406 }); 23407 23408 LazyWrapper.prototype.reject = function(predicate) { 23409 return this.filter(negate(getIteratee(predicate))); 23410 }; 23411 23412 LazyWrapper.prototype.slice = function(start, end) { 23413 start = toInteger(start); 23414 23415 var result = this; 23416 if (result.__filtered__ && (start > 0 || end < 0)) { 23417 return new LazyWrapper(result); 23418 } 23419 if (start < 0) { 23420 result = result.takeRight(-start); 23421 } else if (start) { 23422 result = result.drop(start); 23423 } 23424 if (end !== undefined) { 23425 end = toInteger(end); 23426 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 23427 } 23428 return result; 23429 }; 23430 23431 LazyWrapper.prototype.takeRightWhile = function(predicate) { 23432 return this.reverse().takeWhile(predicate).reverse(); 23433 }; 23434 23435 LazyWrapper.prototype.toArray = function() { 23436 return this.take(MAX_ARRAY_LENGTH); 23437 }; 23438 23439 // Add `LazyWrapper` methods to `lodash.prototype`. 23440 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 23441 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), 23442 isTaker = /^(?:head|last)$/.test(methodName), 23443 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], 23444 retUnwrapped = isTaker || /^find/.test(methodName); 23445 23446 if (!lodashFunc) { 23447 return; 23448 } 23449 lodash.prototype[methodName] = function() { 23450 var value = this.__wrapped__, 23451 args = isTaker ? [1] : arguments, 23452 isLazy = value instanceof LazyWrapper, 23453 iteratee = args[0], 23454 useLazy = isLazy || isArray(value); 23455 23456 var interceptor = function(value) { 23457 var result = lodashFunc.apply(lodash, arrayPush([value], args)); 23458 return (isTaker && chainAll) ? result[0] : result; 23459 }; 23460 23461 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { 23462 // Avoid lazy use if the iteratee has a "length" value other than `1`. 23463 isLazy = useLazy = false; 23464 } 23465 var chainAll = this.__chain__, 23466 isHybrid = !!this.__actions__.length, 23467 isUnwrapped = retUnwrapped && !chainAll, 23468 onlyLazy = isLazy && !isHybrid; 23469 23470 if (!retUnwrapped && useLazy) { 23471 value = onlyLazy ? value : new LazyWrapper(this); 23472 var result = func.apply(value, args); 23473 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); 23474 return new LodashWrapper(result, chainAll); 23475 } 23476 if (isUnwrapped && onlyLazy) { 23477 return func.apply(this, args); 23478 } 23479 result = this.thru(interceptor); 23480 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; 23481 }; 23482 }); 23483 23484 // Add `Array` methods to `lodash.prototype`. 23485 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 23486 var func = arrayProto[methodName], 23487 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 23488 retUnwrapped = /^(?:pop|shift)$/.test(methodName); 23489 23490 lodash.prototype[methodName] = function() { 23491 var args = arguments; 23492 if (retUnwrapped && !this.__chain__) { 23493 var value = this.value(); 23494 return func.apply(isArray(value) ? value : [], args); 23495 } 23496 return this[chainName](function(value) { 23497 return func.apply(isArray(value) ? value : [], args); 23498 }); 23499 }; 23500 }); 23501 23502 // Map minified method names to their real names. 23503 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 23504 var lodashFunc = lodash[methodName]; 23505 if (lodashFunc) { 23506 var key = lodashFunc.name + ''; 23507 if (!hasOwnProperty.call(realNames, key)) { 23508 realNames[key] = []; 23509 } 23510 realNames[key].push({ 'name': methodName, 'func': lodashFunc }); 23511 } 23512 }); 23513 23514 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 23515 'name': 'wrapper', 23516 'func': undefined 23517 }]; 23518 23519 // Add methods to `LazyWrapper`. 23520 LazyWrapper.prototype.clone = lazyClone; 23521 LazyWrapper.prototype.reverse = lazyReverse; 23522 LazyWrapper.prototype.value = lazyValue; 23523 23524 // Add chain sequence methods to the `lodash` wrapper. 23525 lodash.prototype.at = wrapperAt; 23526 lodash.prototype.chain = wrapperChain; 23527 lodash.prototype.commit = wrapperCommit; 23528 lodash.prototype.next = wrapperNext; 23529 lodash.prototype.plant = wrapperPlant; 23530 lodash.prototype.reverse = wrapperReverse; 23531 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 23532 23533 // Add lazy aliases. 23534 lodash.prototype.first = lodash.prototype.head; 23535 23536 if (symIterator) { 23537 lodash.prototype[symIterator] = wrapperToIterator; 23538 } 23539 return lodash; 23540 }); 23541 23542 /*--------------------------------------------------------------------------*/ 23543 23544 // Export lodash. 23545 var _ = runInContext(); 23546 23547 // Some AMD build optimizers, like r.js, check for condition patterns like: 23548 if (true) { 23549 // Expose Lodash on the global object to prevent errors when Lodash is 23550 // loaded by a script tag in the presence of an AMD loader. 23551 // See http://requirejs.org/docs/errors.html#mismatch for more details. 23552 // Use `_.noConflict` to remove Lodash from the global object. 23553 root._ = _; 23554 23555 // Define as an anonymous module so, through path mapping, it can be 23556 // referenced as the "underscore" module. 23557 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 23558 return _; 23559 }).call(exports, __webpack_require__, exports, module), 23560 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 23561 } 23562 // Check for `exports` after `define` in case a build optimizer adds it. 23563 else // removed by dead control flow 23564{} 23565}.call(this)); 23566 23567 23568/***/ }), 23569
vendor: 3,785 bytes, lines 23570-23733
23570/***/ "./node_modules/ssr-window/ssr-window.esm.js": 23571/*!***************************************************!*\ 23572 !*** ./node_modules/ssr-window/ssr-window.esm.js ***! 23573 \***************************************************/ 23574/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 23575 23576"use strict"; 23577/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23578/* harmony export */ getDocument: function() { return /* binding */ getDocument; }, 23579/* harmony export */ getWindow: function() { return /* binding */ getWindow; } 23580/* harmony export */ }); 23581/* unused harmony exports extend, ssrDocument, ssrWindow */ 23582/** 23583 * SSR Window 4.0.2 23584 * Better handling for window object in SSR environment 23585 * https://github.com/nolimits4web/ssr-window 23586 * 23587 * Copyright 2021, Vladimir Kharlampidi 23588 * 23589 * Licensed under MIT 23590 * 23591 * Released on: December 13, 2021 23592 */ 23593/* eslint-disable no-param-reassign */ 23594function isObject(obj) { 23595 return (obj !== null && 23596 typeof obj === 'object' && 23597 'constructor' in obj && 23598 obj.constructor === Object); 23599} 23600function extend(target = {}, src = {}) { 23601 Object.keys(src).forEach((key) => { 23602 if (typeof target[key] === 'undefined') 23603 target[key] = src[key]; 23604 else if (isObject(src[key]) && 23605 isObject(target[key]) && 23606 Object.keys(src[key]).length > 0) { 23607 extend(target[key], src[key]); 23608 } 23609 }); 23610} 23611 23612const ssrDocument = { 23613 body: {}, 23614 addEventListener() { }, 23615 removeEventListener() { }, 23616 activeElement: { 23617 blur() { }, 23618 nodeName: '', 23619 }, 23620 querySelector() { 23621 return null; 23622 }, 23623 querySelectorAll() { 23624 return []; 23625 }, 23626 getElementById() { 23627 return null; 23628 }, 23629 createEvent() { 23630 return { 23631 initEvent() { }, 23632 }; 23633 }, 23634 createElement() { 23635 return { 23636 children: [], 23637 childNodes: [], 23638 style: {}, 23639 setAttribute() { }, 23640 getElementsByTagName() { 23641 return []; 23642 }, 23643 }; 23644 }, 23645 createElementNS() { 23646 return {}; 23647 }, 23648 importNode() { 23649 return null; 23650 }, 23651 location: { 23652 hash: '', 23653 host: '', 23654 hostname: '', 23655 href: '', 23656 origin: '', 23657 pathname: '', 23658 protocol: '', 23659 search: '', 23660 }, 23661}; 23662function getDocument() { 23663 const doc = typeof document !== 'undefined' ? document : {}; 23664 extend(doc, ssrDocument); 23665 return doc; 23666} 23667 23668const ssrWindow = { 23669 document: ssrDocument, 23670 navigator: { 23671 userAgent: '', 23672 }, 23673 location: { 23674 hash: '', 23675 host: '', 23676 hostname: '', 23677 href: '', 23678 origin: '', 23679 pathname: '', 23680 protocol: '', 23681 search: '', 23682 }, 23683 history: { 23684 replaceState() { }, 23685 pushState() { }, 23686 go() { }, 23687 back() { }, 23688 }, 23689 CustomEvent: function CustomEvent() { 23690 return this; 23691 }, 23692 addEventListener() { }, 23693 removeEventListener() { }, 23694 getComputedStyle() { 23695 return { 23696 getPropertyValue() { 23697 return ''; 23698 }, 23699 }; 23700 }, 23701 Image() { }, 23702 Date() { }, 23703 screen: {}, 23704 setTimeout() { }, 23705 clearTimeout() { }, 23706 matchMedia() { 23707 return {}; 23708 }, 23709 requestAnimationFrame(callback) { 23710 if (typeof setTimeout === 'undefined') { 23711 callback(); 23712 return null; 23713 } 23714 return setTimeout(callback, 0); 23715 }, 23716 cancelAnimationFrame(id) { 23717 if (typeof setTimeout === 'undefined') { 23718 return; 23719 } 23720 clearTimeout(id); 23721 }, 23722}; 23723function getWindow() { 23724 const win = typeof window !== 'undefined' ? window : {}; 23725 extend(win, ssrWindow); 23726 return win; 23727} 23728 23729 23730 23731 23732/***/ }), 23733
vendor: 1,828 bytes, lines 23734-23787
23734/***/ "./node_modules/swiper/core/breakpoints/getBreakpoint.js": 23735/*!***************************************************************!*\ 23736 !*** ./node_modules/swiper/core/breakpoints/getBreakpoint.js ***! 23737 \***************************************************************/ 23738/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 23739 23740"use strict"; 23741/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23742/* harmony export */ "default": function() { return /* binding */ getBreakpoint; } 23743/* harmony export */ }); 23744/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 23745 23746function getBreakpoint(breakpoints, base = 'window', containerEl) { 23747 if (!breakpoints || base === 'container' && !containerEl) return undefined; 23748 let breakpoint = false; 23749 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 23750 const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight; 23751 const points = Object.keys(breakpoints).map(point => { 23752 if (typeof point === 'string' && point.indexOf('@') === 0) { 23753 const minRatio = parseFloat(point.substr(1)); 23754 const value = currentHeight * minRatio; 23755 return { 23756 value, 23757 point 23758 }; 23759 } 23760 23761 return { 23762 value: point, 23763 point 23764 }; 23765 }); 23766 points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10)); 23767 23768 for (let i = 0; i < points.length; i += 1) { 23769 const { 23770 point, 23771 value 23772 } = points[i]; 23773 23774 if (base === 'window') { 23775 if (window.matchMedia(`(min-width: ${value}px)`).matches) { 23776 breakpoint = point; 23777 } 23778 } else if (value <= containerEl.clientWidth) { 23779 breakpoint = point; 23780 } 23781 } 23782 23783 return breakpoint || 'max'; 23784} 23785 23786/***/ }), 23787
vendor: 945 bytes, lines 23788-23805
23788/***/ "./node_modules/swiper/core/breakpoints/index.js": 23789/*!*******************************************************!*\ 23790 !*** ./node_modules/swiper/core/breakpoints/index.js ***! 23791 \*******************************************************/ 23792/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 23793 23794"use strict"; 23795/* harmony import */ var _setBreakpoint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setBreakpoint.js */ "./node_modules/swiper/core/breakpoints/setBreakpoint.js"); 23796/* harmony import */ var _getBreakpoint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getBreakpoint.js */ "./node_modules/swiper/core/breakpoints/getBreakpoint.js"); 23797 23798 23799/* harmony default export */ __webpack_exports__["default"] = ({ 23800 setBreakpoint: _setBreakpoint_js__WEBPACK_IMPORTED_MODULE_0__["default"], 23801 getBreakpoint: _getBreakpoint_js__WEBPACK_IMPORTED_MODULE_1__["default"] 23802}); 23803 23804/***/ }), 23805
vendor: 3,727 bytes, lines 23806-23904
23806/***/ "./node_modules/swiper/core/breakpoints/setBreakpoint.js": 23807/*!***************************************************************!*\ 23808 !*** ./node_modules/swiper/core/breakpoints/setBreakpoint.js ***! 23809 \***************************************************************/ 23810/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 23811 23812"use strict"; 23813/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23814/* harmony export */ "default": function() { return /* binding */ setBreakpoint; } 23815/* harmony export */ }); 23816/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 23817 23818 23819const isGridEnabled = (swiper, params) => { 23820 return swiper.grid && params.grid && params.grid.rows > 1; 23821}; 23822 23823function setBreakpoint() { 23824 const swiper = this; 23825 const { 23826 activeIndex, 23827 initialized, 23828 loopedSlides = 0, 23829 params, 23830 $el 23831 } = swiper; 23832 const breakpoints = params.breakpoints; 23833 if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters 23834 23835 const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el); 23836 if (!breakpoint || swiper.currentBreakpoint === breakpoint) return; 23837 const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined; 23838 const breakpointParams = breakpointOnlyParams || swiper.originalParams; 23839 const wasMultiRow = isGridEnabled(swiper, params); 23840 const isMultiRow = isGridEnabled(swiper, breakpointParams); 23841 const wasEnabled = params.enabled; 23842 23843 if (wasMultiRow && !isMultiRow) { 23844 $el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`); 23845 swiper.emitContainerClasses(); 23846 } else if (!wasMultiRow && isMultiRow) { 23847 $el.addClass(`${params.containerModifierClass}grid`); 23848 23849 if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') { 23850 $el.addClass(`${params.containerModifierClass}grid-column`); 23851 } 23852 23853 swiper.emitContainerClasses(); 23854 } // Toggle navigation, pagination, scrollbar 23855 23856 23857 ['navigation', 'pagination', 'scrollbar'].forEach(prop => { 23858 const wasModuleEnabled = params[prop] && params[prop].enabled; 23859 const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled; 23860 23861 if (wasModuleEnabled && !isModuleEnabled) { 23862 swiper[prop].disable(); 23863 } 23864 23865 if (!wasModuleEnabled && isModuleEnabled) { 23866 swiper[prop].enable(); 23867 } 23868 }); 23869 const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction; 23870 const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged); 23871 23872 if (directionChanged && initialized) { 23873 swiper.changeDirection(); 23874 } 23875 23876 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.extend)(swiper.params, breakpointParams); 23877 const isEnabled = swiper.params.enabled; 23878 Object.assign(swiper, { 23879 allowTouchMove: swiper.params.allowTouchMove, 23880 allowSlideNext: swiper.params.allowSlideNext, 23881 allowSlidePrev: swiper.params.allowSlidePrev 23882 }); 23883 23884 if (wasEnabled && !isEnabled) { 23885 swiper.disable(); 23886 } else if (!wasEnabled && isEnabled) { 23887 swiper.enable(); 23888 } 23889 23890 swiper.currentBreakpoint = breakpoint; 23891 swiper.emit('_beforeBreakpoint', breakpointParams); 23892 23893 if (needsReLoop && initialized) { 23894 swiper.loopDestroy(); 23895 swiper.loopCreate(); 23896 swiper.updateSlides(); 23897 swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false); 23898 } 23899 23900 swiper.emit('breakpoint', breakpointParams); 23901} 23902 23903/***/ }), 23904
vendor: 1,299 bytes, lines 23905-23952
23905/***/ "./node_modules/swiper/core/check-overflow/index.js": 23906/*!**********************************************************!*\ 23907 !*** ./node_modules/swiper/core/check-overflow/index.js ***! 23908 \**********************************************************/ 23909/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 23910 23911"use strict"; 23912function checkOverflow() { 23913 const swiper = this; 23914 const { 23915 isLocked: wasLocked, 23916 params 23917 } = swiper; 23918 const { 23919 slidesOffsetBefore 23920 } = params; 23921 23922 if (slidesOffsetBefore) { 23923 const lastSlideIndex = swiper.slides.length - 1; 23924 const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2; 23925 swiper.isLocked = swiper.size > lastSlideRightEdge; 23926 } else { 23927 swiper.isLocked = swiper.snapGrid.length === 1; 23928 } 23929 23930 if (params.allowSlideNext === true) { 23931 swiper.allowSlideNext = !swiper.isLocked; 23932 } 23933 23934 if (params.allowSlidePrev === true) { 23935 swiper.allowSlidePrev = !swiper.isLocked; 23936 } 23937 23938 if (wasLocked && wasLocked !== swiper.isLocked) { 23939 swiper.isEnd = false; 23940 } 23941 23942 if (wasLocked !== swiper.isLocked) { 23943 swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); 23944 } 23945} 23946 23947/* harmony default export */ __webpack_exports__["default"] = ({ 23948 checkOverflow 23949}); 23950 23951/***/ }), 23952
vendor: 1,877 bytes, lines 23953-24019
23953/***/ "./node_modules/swiper/core/classes/addClasses.js": 23954/*!********************************************************!*\ 23955 !*** ./node_modules/swiper/core/classes/addClasses.js ***! 23956 \********************************************************/ 23957/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 23958 23959"use strict"; 23960/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23961/* harmony export */ "default": function() { return /* binding */ addClasses; } 23962/* harmony export */ }); 23963function prepareClasses(entries, prefix) { 23964 const resultClasses = []; 23965 entries.forEach(item => { 23966 if (typeof item === 'object') { 23967 Object.keys(item).forEach(classNames => { 23968 if (item[classNames]) { 23969 resultClasses.push(prefix + classNames); 23970 } 23971 }); 23972 } else if (typeof item === 'string') { 23973 resultClasses.push(prefix + item); 23974 } 23975 }); 23976 return resultClasses; 23977} 23978 23979function addClasses() { 23980 const swiper = this; 23981 const { 23982 classNames, 23983 params, 23984 rtl, 23985 $el, 23986 device, 23987 support 23988 } = swiper; // prettier-ignore 23989 23990 const suffixes = prepareClasses(['initialized', params.direction, { 23991 'pointer-events': !support.touch 23992 }, { 23993 'free-mode': swiper.params.freeMode && params.freeMode.enabled 23994 }, { 23995 'autoheight': params.autoHeight 23996 }, { 23997 'rtl': rtl 23998 }, { 23999 'grid': params.grid && params.grid.rows > 1 24000 }, { 24001 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column' 24002 }, { 24003 'android': device.android 24004 }, { 24005 'ios': device.ios 24006 }, { 24007 'css-mode': params.cssMode 24008 }, { 24009 'centered': params.cssMode && params.centeredSlides 24010 }, { 24011 'watch-progress': params.watchSlidesProgress 24012 }], params.containerModifierClass); 24013 classNames.push(...suffixes); 24014 $el.addClass([...classNames].join(' ')); 24015 swiper.emitContainerClasses(); 24016} 24017 24018/***/ }), 24019
vendor: 906 bytes, lines 24020-24037
24020/***/ "./node_modules/swiper/core/classes/index.js": 24021/*!***************************************************!*\ 24022 !*** ./node_modules/swiper/core/classes/index.js ***! 24023 \***************************************************/ 24024/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 24025 24026"use strict"; 24027/* harmony import */ var _addClasses_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addClasses.js */ "./node_modules/swiper/core/classes/addClasses.js"); 24028/* harmony import */ var _removeClasses_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeClasses.js */ "./node_modules/swiper/core/classes/removeClasses.js"); 24029 24030 24031/* harmony default export */ __webpack_exports__["default"] = ({ 24032 addClasses: _addClasses_js__WEBPACK_IMPORTED_MODULE_0__["default"], 24033 removeClasses: _removeClasses_js__WEBPACK_IMPORTED_MODULE_1__["default"] 24034}); 24035 24036/***/ }), 24037
vendor: 729 bytes, lines 24038-24059
24038/***/ "./node_modules/swiper/core/classes/removeClasses.js": 24039/*!***********************************************************!*\ 24040 !*** ./node_modules/swiper/core/classes/removeClasses.js ***! 24041 \***********************************************************/ 24042/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 24043 24044"use strict"; 24045/* harmony export */ __webpack_require__.d(__webpack_exports__, { 24046/* harmony export */ "default": function() { return /* binding */ removeClasses; } 24047/* harmony export */ }); 24048function removeClasses() { 24049 const swiper = this; 24050 const { 24051 $el, 24052 classNames 24053 } = swiper; 24054 $el.removeClass(classNames.join(' ')); 24055 swiper.emitContainerClasses(); 24056} 24057 24058/***/ }), 24059
vendor: 22,446 bytes, lines 24060-24725
24060/***/ "./node_modules/swiper/core/core.js": 24061/*!******************************************!*\ 24062 !*** ./node_modules/swiper/core/core.js ***! 24063 \******************************************/ 24064/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 24065 24066"use strict"; 24067/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 24068/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 24069/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 24070/* harmony import */ var _shared_get_support_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/get-support.js */ "./node_modules/swiper/shared/get-support.js"); 24071/* harmony import */ var _shared_get_device_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shared/get-device.js */ "./node_modules/swiper/shared/get-device.js"); 24072/* harmony import */ var _shared_get_browser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/get-browser.js */ "./node_modules/swiper/shared/get-browser.js"); 24073/* harmony import */ var _modules_resize_resize_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/resize/resize.js */ "./node_modules/swiper/core/modules/resize/resize.js"); 24074/* harmony import */ var _modules_observer_observer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/observer/observer.js */ "./node_modules/swiper/core/modules/observer/observer.js"); 24075/* harmony import */ var _events_emitter_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./events-emitter.js */ "./node_modules/swiper/core/events-emitter.js"); 24076/* harmony import */ var _update_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./update/index.js */ "./node_modules/swiper/core/update/index.js"); 24077/* harmony import */ var _translate_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./translate/index.js */ "./node_modules/swiper/core/translate/index.js"); 24078/* harmony import */ var _transition_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./transition/index.js */ "./node_modules/swiper/core/transition/index.js"); 24079/* harmony import */ var _slide_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./slide/index.js */ "./node_modules/swiper/core/slide/index.js"); 24080/* harmony import */ var _loop_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./loop/index.js */ "./node_modules/swiper/core/loop/index.js"); 24081/* harmony import */ var _grab_cursor_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./grab-cursor/index.js */ "./node_modules/swiper/core/grab-cursor/index.js"); 24082/* harmony import */ var _events_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./events/index.js */ "./node_modules/swiper/core/events/index.js"); 24083/* harmony import */ var _breakpoints_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./breakpoints/index.js */ "./node_modules/swiper/core/breakpoints/index.js"); 24084/* harmony import */ var _classes_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./classes/index.js */ "./node_modules/swiper/core/classes/index.js"); 24085/* harmony import */ var _images_index_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./images/index.js */ "./node_modules/swiper/core/images/index.js"); 24086/* harmony import */ var _check_overflow_index_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./check-overflow/index.js */ "./node_modules/swiper/core/check-overflow/index.js"); 24087/* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/swiper/core/defaults.js"); 24088/* harmony import */ var _moduleExtendParams_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./moduleExtendParams.js */ "./node_modules/swiper/core/moduleExtendParams.js"); 24089/* eslint no-param-reassign: "off" */ 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112const prototypes = { 24113 eventsEmitter: _events_emitter_js__WEBPACK_IMPORTED_MODULE_8__["default"], 24114 update: _update_index_js__WEBPACK_IMPORTED_MODULE_9__["default"], 24115 translate: _translate_index_js__WEBPACK_IMPORTED_MODULE_10__["default"], 24116 transition: _transition_index_js__WEBPACK_IMPORTED_MODULE_11__["default"], 24117 slide: _slide_index_js__WEBPACK_IMPORTED_MODULE_12__["default"], 24118 loop: _loop_index_js__WEBPACK_IMPORTED_MODULE_13__["default"], 24119 grabCursor: _grab_cursor_index_js__WEBPACK_IMPORTED_MODULE_14__["default"], 24120 events: _events_index_js__WEBPACK_IMPORTED_MODULE_15__["default"], 24121 breakpoints: _breakpoints_index_js__WEBPACK_IMPORTED_MODULE_16__["default"], 24122 checkOverflow: _check_overflow_index_js__WEBPACK_IMPORTED_MODULE_19__["default"], 24123 classes: _classes_index_js__WEBPACK_IMPORTED_MODULE_17__["default"], 24124 images: _images_index_js__WEBPACK_IMPORTED_MODULE_18__["default"] 24125}; 24126const extendedDefaults = {}; 24127 24128class Swiper { 24129 constructor(...args) { 24130 let el; 24131 let params; 24132 24133 if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') { 24134 params = args[0]; 24135 } else { 24136 [el, params] = args; 24137 } 24138 24139 if (!params) params = {}; 24140 params = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, params); 24141 if (el && !params.el) params.el = el; 24142 24143 if (params.el && (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.el).length > 1) { 24144 const swipers = []; 24145 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.el).each(containerEl => { 24146 const newParams = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, params, { 24147 el: containerEl 24148 }); 24149 swipers.push(new Swiper(newParams)); 24150 }); // eslint-disable-next-line no-constructor-return 24151 24152 return swipers; 24153 } // Swiper Instance 24154 24155 24156 const swiper = this; 24157 swiper.__swiper__ = true; 24158 swiper.support = (0,_shared_get_support_js__WEBPACK_IMPORTED_MODULE_3__.getSupport)(); 24159 swiper.device = (0,_shared_get_device_js__WEBPACK_IMPORTED_MODULE_4__.getDevice)({ 24160 userAgent: params.userAgent 24161 }); 24162 swiper.browser = (0,_shared_get_browser_js__WEBPACK_IMPORTED_MODULE_5__.getBrowser)(); 24163 swiper.eventsListeners = {}; 24164 swiper.eventsAnyListeners = []; 24165 swiper.modules = [...swiper.__modules__]; 24166 24167 if (params.modules && Array.isArray(params.modules)) { 24168 swiper.modules.push(...params.modules); 24169 } 24170 24171 const allModulesParams = {}; 24172 swiper.modules.forEach(mod => { 24173 mod({ 24174 swiper, 24175 extendParams: (0,_moduleExtendParams_js__WEBPACK_IMPORTED_MODULE_21__["default"])(params, allModulesParams), 24176 on: swiper.on.bind(swiper), 24177 once: swiper.once.bind(swiper), 24178 off: swiper.off.bind(swiper), 24179 emit: swiper.emit.bind(swiper) 24180 }); 24181 }); // Extend defaults with modules params 24182 24183 const swiperParams = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, _defaults_js__WEBPACK_IMPORTED_MODULE_20__["default"], allModulesParams); // Extend defaults with passed params 24184 24185 swiper.params = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, swiperParams, extendedDefaults, params); 24186 swiper.originalParams = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, swiper.params); 24187 swiper.passedParams = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)({}, params); // add event listeners 24188 24189 if (swiper.params && swiper.params.on) { 24190 Object.keys(swiper.params.on).forEach(eventName => { 24191 swiper.on(eventName, swiper.params.on[eventName]); 24192 }); 24193 } 24194 24195 if (swiper.params && swiper.params.onAny) { 24196 swiper.onAny(swiper.params.onAny); 24197 } // Save Dom lib 24198 24199 24200 swiper.$ = _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"]; // Extend Swiper 24201 24202 Object.assign(swiper, { 24203 enabled: swiper.params.enabled, 24204 el, 24205 // Classes 24206 classNames: [], 24207 // Slides 24208 slides: (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(), 24209 slidesGrid: [], 24210 snapGrid: [], 24211 slidesSizesGrid: [], 24212 24213 // isDirection 24214 isHorizontal() { 24215 return swiper.params.direction === 'horizontal'; 24216 }, 24217 24218 isVertical() { 24219 return swiper.params.direction === 'vertical'; 24220 }, 24221 24222 // Indexes 24223 activeIndex: 0, 24224 realIndex: 0, 24225 // 24226 isBeginning: true, 24227 isEnd: false, 24228 // Props 24229 translate: 0, 24230 previousTranslate: 0, 24231 progress: 0, 24232 velocity: 0, 24233 animating: false, 24234 // Locks 24235 allowSlideNext: swiper.params.allowSlideNext, 24236 allowSlidePrev: swiper.params.allowSlidePrev, 24237 // Touch Events 24238 touchEvents: function touchEvents() { 24239 const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel']; 24240 const desktop = ['pointerdown', 'pointermove', 'pointerup']; 24241 swiper.touchEventsTouch = { 24242 start: touch[0], 24243 move: touch[1], 24244 end: touch[2], 24245 cancel: touch[3] 24246 }; 24247 swiper.touchEventsDesktop = { 24248 start: desktop[0], 24249 move: desktop[1], 24250 end: desktop[2] 24251 }; 24252 return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop; 24253 }(), 24254 touchEventsData: { 24255 isTouched: undefined, 24256 isMoved: undefined, 24257 allowTouchCallbacks: undefined, 24258 touchStartTime: undefined, 24259 isScrolling: undefined, 24260 currentTranslate: undefined, 24261 startTranslate: undefined, 24262 allowThresholdMove: undefined, 24263 // Form elements to match 24264 focusableElements: swiper.params.focusableElements, 24265 // Last click time 24266 lastClickTime: (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(), 24267 clickTimeout: undefined, 24268 // Velocities 24269 velocities: [], 24270 allowMomentumBounce: undefined, 24271 isTouchEvent: undefined, 24272 startMoving: undefined 24273 }, 24274 // Clicks 24275 allowClick: true, 24276 // Touches 24277 allowTouchMove: swiper.params.allowTouchMove, 24278 touches: { 24279 startX: 0, 24280 startY: 0, 24281 currentX: 0, 24282 currentY: 0, 24283 diff: 0 24284 }, 24285 // Images 24286 imagesToLoad: [], 24287 imagesLoaded: 0 24288 }); 24289 swiper.emit('_swiper'); // Init 24290 24291 if (swiper.params.init) { 24292 swiper.init(); 24293 } // Return app instance 24294 // eslint-disable-next-line no-constructor-return 24295 24296 24297 return swiper; 24298 } 24299 24300 enable() { 24301 const swiper = this; 24302 if (swiper.enabled) return; 24303 swiper.enabled = true; 24304 24305 if (swiper.params.grabCursor) { 24306 swiper.setGrabCursor(); 24307 } 24308 24309 swiper.emit('enable'); 24310 } 24311 24312 disable() { 24313 const swiper = this; 24314 if (!swiper.enabled) return; 24315 swiper.enabled = false; 24316 24317 if (swiper.params.grabCursor) { 24318 swiper.unsetGrabCursor(); 24319 } 24320 24321 swiper.emit('disable'); 24322 } 24323 24324 setProgress(progress, speed) { 24325 const swiper = this; 24326 progress = Math.min(Math.max(progress, 0), 1); 24327 const min = swiper.minTranslate(); 24328 const max = swiper.maxTranslate(); 24329 const current = (max - min) * progress + min; 24330 swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed); 24331 swiper.updateActiveIndex(); 24332 swiper.updateSlidesClasses(); 24333 } 24334 24335 emitContainerClasses() { 24336 const swiper = this; 24337 if (!swiper.params._emitClasses || !swiper.el) return; 24338 const cls = swiper.el.className.split(' ').filter(className => { 24339 return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0; 24340 }); 24341 swiper.emit('_containerClasses', cls.join(' ')); 24342 } 24343 24344 getSlideClasses(slideEl) { 24345 const swiper = this; 24346 if (swiper.destroyed) return ''; 24347 return slideEl.className.split(' ').filter(className => { 24348 return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0; 24349 }).join(' '); 24350 } 24351 24352 emitSlidesClasses() { 24353 const swiper = this; 24354 if (!swiper.params._emitClasses || !swiper.el) return; 24355 const updates = []; 24356 swiper.slides.each(slideEl => { 24357 const classNames = swiper.getSlideClasses(slideEl); 24358 updates.push({ 24359 slideEl, 24360 classNames 24361 }); 24362 swiper.emit('_slideClass', slideEl, classNames); 24363 }); 24364 swiper.emit('_slideClasses', updates); 24365 } 24366 24367 slidesPerViewDynamic(view = 'current', exact = false) { 24368 const swiper = this; 24369 const { 24370 params, 24371 slides, 24372 slidesGrid, 24373 slidesSizesGrid, 24374 size: swiperSize, 24375 activeIndex 24376 } = swiper; 24377 let spv = 1; 24378 24379 if (params.centeredSlides) { 24380 let slideSize = slides[activeIndex].swiperSlideSize; 24381 let breakLoop; 24382 24383 for (let i = activeIndex + 1; i < slides.length; i += 1) { 24384 if (slides[i] && !breakLoop) { 24385 slideSize += slides[i].swiperSlideSize; 24386 spv += 1; 24387 if (slideSize > swiperSize) breakLoop = true; 24388 } 24389 } 24390 24391 for (let i = activeIndex - 1; i >= 0; i -= 1) { 24392 if (slides[i] && !breakLoop) { 24393 slideSize += slides[i].swiperSlideSize; 24394 spv += 1; 24395 if (slideSize > swiperSize) breakLoop = true; 24396 } 24397 } 24398 } else { 24399 // eslint-disable-next-line 24400 if (view === 'current') { 24401 for (let i = activeIndex + 1; i < slides.length; i += 1) { 24402 const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize; 24403 24404 if (slideInView) { 24405 spv += 1; 24406 } 24407 } 24408 } else { 24409 // previous 24410 for (let i = activeIndex - 1; i >= 0; i -= 1) { 24411 const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize; 24412 24413 if (slideInView) { 24414 spv += 1; 24415 } 24416 } 24417 } 24418 } 24419 24420 return spv; 24421 } 24422 24423 update() { 24424 const swiper = this; 24425 if (!swiper || swiper.destroyed) return; 24426 const { 24427 snapGrid, 24428 params 24429 } = swiper; // Breakpoints 24430 24431 if (params.breakpoints) { 24432 swiper.setBreakpoint(); 24433 } 24434 24435 swiper.updateSize(); 24436 swiper.updateSlides(); 24437 swiper.updateProgress(); 24438 swiper.updateSlidesClasses(); 24439 24440 function setTranslate() { 24441 const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate; 24442 const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate()); 24443 swiper.setTranslate(newTranslate); 24444 swiper.updateActiveIndex(); 24445 swiper.updateSlidesClasses(); 24446 } 24447 24448 let translated; 24449 24450 if (swiper.params.freeMode && swiper.params.freeMode.enabled) { 24451 setTranslate(); 24452 24453 if (swiper.params.autoHeight) { 24454 swiper.updateAutoHeight(); 24455 } 24456 } else { 24457 if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) { 24458 translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true); 24459 } else { 24460 translated = swiper.slideTo(swiper.activeIndex, 0, false, true); 24461 } 24462 24463 if (!translated) { 24464 setTranslate(); 24465 } 24466 } 24467 24468 if (params.watchOverflow && snapGrid !== swiper.snapGrid) { 24469 swiper.checkOverflow(); 24470 } 24471 24472 swiper.emit('update'); 24473 } 24474 24475 changeDirection(newDirection, needUpdate = true) { 24476 const swiper = this; 24477 const currentDirection = swiper.params.direction; 24478 24479 if (!newDirection) { 24480 // eslint-disable-next-line 24481 newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal'; 24482 } 24483 24484 if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') { 24485 return swiper; 24486 } 24487 24488 swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`); 24489 swiper.emitContainerClasses(); 24490 swiper.params.direction = newDirection; 24491 swiper.slides.each(slideEl => { 24492 if (newDirection === 'vertical') { 24493 slideEl.style.width = ''; 24494 } else { 24495 slideEl.style.height = ''; 24496 } 24497 }); 24498 swiper.emit('changeDirection'); 24499 if (needUpdate) swiper.update(); 24500 return swiper; 24501 } 24502 24503 changeLanguageDirection(direction) { 24504 const swiper = this; 24505 if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return; 24506 swiper.rtl = direction === 'rtl'; 24507 swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl; 24508 24509 if (swiper.rtl) { 24510 swiper.$el.addClass(`${swiper.params.containerModifierClass}rtl`); 24511 swiper.el.dir = 'rtl'; 24512 } else { 24513 swiper.$el.removeClass(`${swiper.params.containerModifierClass}rtl`); 24514 swiper.el.dir = 'ltr'; 24515 } 24516 24517 swiper.update(); 24518 } 24519 24520 mount(el) { 24521 const swiper = this; 24522 if (swiper.mounted) return true; // Find el 24523 24524 const $el = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(el || swiper.params.el); 24525 el = $el[0]; 24526 24527 if (!el) { 24528 return false; 24529 } 24530 24531 el.swiper = swiper; 24532 24533 const getWrapperSelector = () => { 24534 return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`; 24535 }; 24536 24537 const getWrapper = () => { 24538 if (el && el.shadowRoot && el.shadowRoot.querySelector) { 24539 const res = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items 24540 24541 res.children = options => $el.children(options); 24542 24543 return res; 24544 } 24545 24546 if (!$el.children) { 24547 return (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])($el).children(getWrapperSelector()); 24548 } 24549 24550 return $el.children(getWrapperSelector()); 24551 }; // Find Wrapper 24552 24553 24554 let $wrapperEl = getWrapper(); 24555 24556 if ($wrapperEl.length === 0 && swiper.params.createElements) { 24557 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 24558 const wrapper = document.createElement('div'); 24559 $wrapperEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(wrapper); 24560 wrapper.className = swiper.params.wrapperClass; 24561 $el.append(wrapper); 24562 $el.children(`.${swiper.params.slideClass}`).each(slideEl => { 24563 $wrapperEl.append(slideEl); 24564 }); 24565 } 24566 24567 Object.assign(swiper, { 24568 $el, 24569 el, 24570 $wrapperEl, 24571 wrapperEl: $wrapperEl[0], 24572 mounted: true, 24573 // RTL 24574 rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl', 24575 rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'), 24576 wrongRTL: $wrapperEl.css('display') === '-webkit-box' 24577 }); 24578 return true; 24579 } 24580 24581 init(el) { 24582 const swiper = this; 24583 if (swiper.initialized) return swiper; 24584 const mounted = swiper.mount(el); 24585 if (mounted === false) return swiper; 24586 swiper.emit('beforeInit'); // Set breakpoint 24587 24588 if (swiper.params.breakpoints) { 24589 swiper.setBreakpoint(); 24590 } // Add Classes 24591 24592 24593 swiper.addClasses(); // Create loop 24594 24595 if (swiper.params.loop) { 24596 swiper.loopCreate(); 24597 } // Update size 24598 24599 24600 swiper.updateSize(); // Update slides 24601 24602 swiper.updateSlides(); 24603 24604 if (swiper.params.watchOverflow) { 24605 swiper.checkOverflow(); 24606 } // Set Grab Cursor 24607 24608 24609 if (swiper.params.grabCursor && swiper.enabled) { 24610 swiper.setGrabCursor(); 24611 } 24612 24613 if (swiper.params.preloadImages) { 24614 swiper.preloadImages(); 24615 } // Slide To Initial Slide 24616 24617 24618 if (swiper.params.loop) { 24619 swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true); 24620 } else { 24621 swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true); 24622 } // Attach events 24623 24624 24625 swiper.attachEvents(); // Init Flag 24626 24627 swiper.initialized = true; // Emit 24628 24629 swiper.emit('init'); 24630 swiper.emit('afterInit'); 24631 return swiper; 24632 } 24633 24634 destroy(deleteInstance = true, cleanStyles = true) { 24635 const swiper = this; 24636 const { 24637 params, 24638 $el, 24639 $wrapperEl, 24640 slides 24641 } = swiper; 24642 24643 if (typeof swiper.params === 'undefined' || swiper.destroyed) { 24644 return null; 24645 } 24646 24647 swiper.emit('beforeDestroy'); // Init Flag 24648 24649 swiper.initialized = false; // Detach events 24650 24651 swiper.detachEvents(); // Destroy loop 24652 24653 if (params.loop) { 24654 swiper.loopDestroy(); 24655 } // Cleanup styles 24656 24657 24658 if (cleanStyles) { 24659 swiper.removeClasses(); 24660 $el.removeAttr('style'); 24661 $wrapperEl.removeAttr('style'); 24662 24663 if (slides && slides.length) { 24664 slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index'); 24665 } 24666 } 24667 24668 swiper.emit('destroy'); // Detach emitter events 24669 24670 Object.keys(swiper.eventsListeners).forEach(eventName => { 24671 swiper.off(eventName); 24672 }); 24673 24674 if (deleteInstance !== false) { 24675 swiper.$el[0].swiper = null; 24676 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.deleteProps)(swiper); 24677 } 24678 24679 swiper.destroyed = true; 24680 return null; 24681 } 24682 24683 static extendDefaults(newDefaults) { 24684 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.extend)(extendedDefaults, newDefaults); 24685 } 24686 24687 static get extendedDefaults() { 24688 return extendedDefaults; 24689 } 24690 24691 static get defaults() { 24692 return _defaults_js__WEBPACK_IMPORTED_MODULE_20__["default"]; 24693 } 24694 24695 static installModule(mod) { 24696 if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = []; 24697 const modules = Swiper.prototype.__modules__; 24698 24699 if (typeof mod === 'function' && modules.indexOf(mod) < 0) { 24700 modules.push(mod); 24701 } 24702 } 24703 24704 static use(module) { 24705 if (Array.isArray(module)) { 24706 module.forEach(m => Swiper.installModule(m)); 24707 return Swiper; 24708 } 24709 24710 Swiper.installModule(module); 24711 return Swiper; 24712 } 24713 24714} 24715 24716Object.keys(prototypes).forEach(prototypeGroup => { 24717 Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => { 24718 Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod]; 24719 }); 24720}); 24721Swiper.use([_modules_resize_resize_js__WEBPACK_IMPORTED_MODULE_6__["default"], _modules_observer_observer_js__WEBPACK_IMPORTED_MODULE_7__["default"]]); 24722/* harmony default export */ __webpack_exports__["default"] = (Swiper); 24723 24724/***/ }), 24725
vendor: 3,534 bytes, lines 24726-24859
24726/***/ "./node_modules/swiper/core/defaults.js": 24727/*!**********************************************!*\ 24728 !*** ./node_modules/swiper/core/defaults.js ***! 24729 \**********************************************/ 24730/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 24731 24732"use strict"; 24733/* harmony default export */ __webpack_exports__["default"] = ({ 24734 init: true, 24735 direction: 'horizontal', 24736 touchEventsTarget: 'wrapper', 24737 initialSlide: 0, 24738 speed: 300, 24739 cssMode: false, 24740 updateOnWindowResize: true, 24741 resizeObserver: true, 24742 nested: false, 24743 createElements: false, 24744 enabled: true, 24745 focusableElements: 'input, select, option, textarea, button, video, label', 24746 // Overrides 24747 width: null, 24748 height: null, 24749 // 24750 preventInteractionOnTransition: false, 24751 // ssr 24752 userAgent: null, 24753 url: null, 24754 // To support iOS's swipe-to-go-back gesture (when being used in-app). 24755 edgeSwipeDetection: false, 24756 edgeSwipeThreshold: 20, 24757 // Autoheight 24758 autoHeight: false, 24759 // Set wrapper width 24760 setWrapperSize: false, 24761 // Virtual Translate 24762 virtualTranslate: false, 24763 // Effects 24764 effect: 'slide', 24765 // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' 24766 // Breakpoints 24767 breakpoints: undefined, 24768 breakpointsBase: 'window', 24769 // Slides grid 24770 spaceBetween: 0, 24771 slidesPerView: 1, 24772 slidesPerGroup: 1, 24773 slidesPerGroupSkip: 0, 24774 slidesPerGroupAuto: false, 24775 centeredSlides: false, 24776 centeredSlidesBounds: false, 24777 slidesOffsetBefore: 0, 24778 // in px 24779 slidesOffsetAfter: 0, 24780 // in px 24781 normalizeSlideIndex: true, 24782 centerInsufficientSlides: false, 24783 // Disable swiper and hide navigation when container not overflow 24784 watchOverflow: true, 24785 // Round length 24786 roundLengths: false, 24787 // Touches 24788 touchRatio: 1, 24789 touchAngle: 45, 24790 simulateTouch: true, 24791 shortSwipes: true, 24792 longSwipes: true, 24793 longSwipesRatio: 0.5, 24794 longSwipesMs: 300, 24795 followFinger: true, 24796 allowTouchMove: true, 24797 threshold: 0, 24798 touchMoveStopPropagation: false, 24799 touchStartPreventDefault: true, 24800 touchStartForcePreventDefault: false, 24801 touchReleaseOnEdges: false, 24802 // Unique Navigation Elements 24803 uniqueNavElements: true, 24804 // Resistance 24805 resistance: true, 24806 resistanceRatio: 0.85, 24807 // Progress 24808 watchSlidesProgress: false, 24809 // Cursor 24810 grabCursor: false, 24811 // Clicks 24812 preventClicks: true, 24813 preventClicksPropagation: true, 24814 slideToClickedSlide: false, 24815 // Images 24816 preloadImages: true, 24817 updateOnImagesReady: true, 24818 // loop 24819 loop: false, 24820 loopAdditionalSlides: 0, 24821 loopedSlides: null, 24822 loopedSlidesLimit: true, 24823 loopFillGroupWithBlank: false, 24824 loopPreventsSlide: true, 24825 // rewind 24826 rewind: false, 24827 // Swiping/no swiping 24828 allowSlidePrev: true, 24829 allowSlideNext: true, 24830 swipeHandler: null, 24831 // '.swipe-handler', 24832 noSwiping: true, 24833 noSwipingClass: 'swiper-no-swiping', 24834 noSwipingSelector: null, 24835 // Passive Listeners 24836 passiveListeners: true, 24837 maxBackfaceHiddenSlides: 10, 24838 // NS 24839 containerModifierClass: 'swiper-', 24840 // NEW 24841 slideClass: 'swiper-slide', 24842 slideBlankClass: 'swiper-slide-invisible-blank', 24843 slideActiveClass: 'swiper-slide-active', 24844 slideDuplicateActiveClass: 'swiper-slide-duplicate-active', 24845 slideVisibleClass: 'swiper-slide-visible', 24846 slideDuplicateClass: 'swiper-slide-duplicate', 24847 slideNextClass: 'swiper-slide-next', 24848 slideDuplicateNextClass: 'swiper-slide-duplicate-next', 24849 slidePrevClass: 'swiper-slide-prev', 24850 slideDuplicatePrevClass: 'swiper-slide-duplicate-prev', 24851 wrapperClass: 'swiper-wrapper', 24852 // Callbacks 24853 runCallbacksOnInit: true, 24854 // Internals 24855 _emitClasses: false 24856}); 24857 24858/***/ }), 24859
vendor: 3,673 bytes, lines 24860-24983
24860/***/ "./node_modules/swiper/core/events-emitter.js": 24861/*!****************************************************!*\ 24862 !*** ./node_modules/swiper/core/events-emitter.js ***! 24863 \****************************************************/ 24864/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__) { 24865 24866"use strict"; 24867/* eslint-disable no-underscore-dangle */ 24868/* harmony default export */ __webpack_exports__["default"] = ({ 24869 on(events, handler, priority) { 24870 const self = this; 24871 if (!self.eventsListeners || self.destroyed) return self; 24872 if (typeof handler !== 'function') return self; 24873 const method = priority ? 'unshift' : 'push'; 24874 events.split(' ').forEach(event => { 24875 if (!self.eventsListeners[event]) self.eventsListeners[event] = []; 24876 self.eventsListeners[event][method](handler); 24877 }); 24878 return self; 24879 }, 24880 24881 once(events, handler, priority) { 24882 const self = this; 24883 if (!self.eventsListeners || self.destroyed) return self; 24884 if (typeof handler !== 'function') return self; 24885 24886 function onceHandler(...args) { 24887 self.off(events, onceHandler); 24888 24889 if (onceHandler.__emitterProxy) { 24890 delete onceHandler.__emitterProxy; 24891 } 24892 24893 handler.apply(self, args); 24894 } 24895 24896 onceHandler.__emitterProxy = handler; 24897 return self.on(events, onceHandler, priority); 24898 }, 24899 24900 onAny(handler, priority) { 24901 const self = this; 24902 if (!self.eventsListeners || self.destroyed) return self; 24903 if (typeof handler !== 'function') return self; 24904 const method = priority ? 'unshift' : 'push'; 24905 24906 if (self.eventsAnyListeners.indexOf(handler) < 0) { 24907 self.eventsAnyListeners[method](handler); 24908 } 24909 24910 return self; 24911 }, 24912 24913 offAny(handler) { 24914 const self = this; 24915 if (!self.eventsListeners || self.destroyed) return self; 24916 if (!self.eventsAnyListeners) return self; 24917 const index = self.eventsAnyListeners.indexOf(handler); 24918 24919 if (index >= 0) { 24920 self.eventsAnyListeners.splice(index, 1); 24921 } 24922 24923 return self; 24924 }, 24925 24926 off(events, handler) { 24927 const self = this; 24928 if (!self.eventsListeners || self.destroyed) return self; 24929 if (!self.eventsListeners) return self; 24930 events.split(' ').forEach(event => { 24931 if (typeof handler === 'undefined') { 24932 self.eventsListeners[event] = []; 24933 } else if (self.eventsListeners[event]) { 24934 self.eventsListeners[event].forEach((eventHandler, index) => { 24935 if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) { 24936 self.eventsListeners[event].splice(index, 1); 24937 } 24938 }); 24939 } 24940 }); 24941 return self; 24942 }, 24943 24944 emit(...args) { 24945 const self = this; 24946 if (!self.eventsListeners || self.destroyed) return self; 24947 if (!self.eventsListeners) return self; 24948 let events; 24949 let data; 24950 let context; 24951 24952 if (typeof args[0] === 'string' || Array.isArray(args[0])) { 24953 events = args[0]; 24954 data = args.slice(1, args.length); 24955 context = self; 24956 } else { 24957 events = args[0].events; 24958 data = args[0].data; 24959 context = args[0].context || self; 24960 } 24961 24962 data.unshift(context); 24963 const eventsArray = Array.isArray(events) ? events : events.split(' '); 24964 eventsArray.forEach(event => { 24965 if (self.eventsAnyListeners && self.eventsAnyListeners.length) { 24966 self.eventsAnyListeners.forEach(eventHandler => { 24967 eventHandler.apply(context, [event, ...data]); 24968 }); 24969 } 24970 24971 if (self.eventsListeners && self.eventsListeners[event]) { 24972 self.eventsListeners[event].forEach(eventHandler => { 24973 eventHandler.apply(context, data); 24974 }); 24975 } 24976 }); 24977 return self; 24978 } 24979 24980}); 24981 24982/***/ }), 24983
vendor: 4,360 bytes, lines 24984-25097
24984/***/ "./node_modules/swiper/core/events/index.js": 24985/*!**************************************************!*\ 24986 !*** ./node_modules/swiper/core/events/index.js ***! 24987 \**************************************************/ 24988/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 24989 24990"use strict"; 24991/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 24992/* harmony import */ var _onTouchStart_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./onTouchStart.js */ "./node_modules/swiper/core/events/onTouchStart.js"); 24993/* harmony import */ var _onTouchMove_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./onTouchMove.js */ "./node_modules/swiper/core/events/onTouchMove.js"); 24994/* harmony import */ var _onTouchEnd_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./onTouchEnd.js */ "./node_modules/swiper/core/events/onTouchEnd.js"); 24995/* harmony import */ var _onResize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./onResize.js */ "./node_modules/swiper/core/events/onResize.js"); 24996/* harmony import */ var _onClick_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./onClick.js */ "./node_modules/swiper/core/events/onClick.js"); 24997/* harmony import */ var _onScroll_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./onScroll.js */ "./node_modules/swiper/core/events/onScroll.js"); 24998 24999 25000 25001 25002 25003 25004 25005let dummyEventAttached = false; 25006 25007function dummyEventListener() {} 25008 25009const events = (swiper, method) => { 25010 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 25011 const { 25012 params, 25013 touchEvents, 25014 el, 25015 wrapperEl, 25016 device, 25017 support 25018 } = swiper; 25019 const capture = !!params.nested; 25020 const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 25021 const swiperMethod = method; // Touch Events 25022 25023 if (!support.touch) { 25024 el[domMethod](touchEvents.start, swiper.onTouchStart, false); 25025 document[domMethod](touchEvents.move, swiper.onTouchMove, capture); 25026 document[domMethod](touchEvents.end, swiper.onTouchEnd, false); 25027 } else { 25028 const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? { 25029 passive: true, 25030 capture: false 25031 } : false; 25032 el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener); 25033 el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? { 25034 passive: false, 25035 capture 25036 } : capture); 25037 el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener); 25038 25039 if (touchEvents.cancel) { 25040 el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener); 25041 } 25042 } // Prevent Links Clicks 25043 25044 25045 if (params.preventClicks || params.preventClicksPropagation) { 25046 el[domMethod]('click', swiper.onClick, true); 25047 } 25048 25049 if (params.cssMode) { 25050 wrapperEl[domMethod]('scroll', swiper.onScroll); 25051 } // Resize handler 25052 25053 25054 if (params.updateOnWindowResize) { 25055 swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', _onResize_js__WEBPACK_IMPORTED_MODULE_4__["default"], true); 25056 } else { 25057 swiper[swiperMethod]('observerUpdate', _onResize_js__WEBPACK_IMPORTED_MODULE_4__["default"], true); 25058 } 25059}; 25060 25061function attachEvents() { 25062 const swiper = this; 25063 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 25064 const { 25065 params, 25066 support 25067 } = swiper; 25068 swiper.onTouchStart = _onTouchStart_js__WEBPACK_IMPORTED_MODULE_1__["default"].bind(swiper); 25069 swiper.onTouchMove = _onTouchMove_js__WEBPACK_IMPORTED_MODULE_2__["default"].bind(swiper); 25070 swiper.onTouchEnd = _onTouchEnd_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind(swiper); 25071 25072 if (params.cssMode) { 25073 swiper.onScroll = _onScroll_js__WEBPACK_IMPORTED_MODULE_6__["default"].bind(swiper); 25074 } 25075 25076 swiper.onClick = _onClick_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(swiper); 25077 25078 if (support.touch && !dummyEventAttached) { 25079 document.addEventListener('touchstart', dummyEventListener); 25080 dummyEventAttached = true; 25081 } 25082 25083 events(swiper, 'on'); 25084} 25085 25086function detachEvents() { 25087 const swiper = this; 25088 events(swiper, 'off'); 25089} 25090 25091/* harmony default export */ __webpack_exports__["default"] = ({ 25092 attachEvents, 25093 detachEvents 25094}); 25095 25096/***/ }), 25097
vendor: 829 bytes, lines 25098-25123
25098/***/ "./node_modules/swiper/core/events/onClick.js": 25099/*!****************************************************!*\ 25100 !*** ./node_modules/swiper/core/events/onClick.js ***! 25101 \****************************************************/ 25102/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25103 25104"use strict"; 25105/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25106/* harmony export */ "default": function() { return /* binding */ onClick; } 25107/* harmony export */ }); 25108function onClick(e) { 25109 const swiper = this; 25110 if (!swiper.enabled) return; 25111 25112 if (!swiper.allowClick) { 25113 if (swiper.params.preventClicks) e.preventDefault(); 25114 25115 if (swiper.params.preventClicksPropagation && swiper.animating) { 25116 e.stopPropagation(); 25117 e.stopImmediatePropagation(); 25118 } 25119 } 25120} 25121 25122/***/ }), 25123
vendor: 1,603 bytes, lines 25124-25179
25124/***/ "./node_modules/swiper/core/events/onResize.js": 25125/*!*****************************************************!*\ 25126 !*** ./node_modules/swiper/core/events/onResize.js ***! 25127 \*****************************************************/ 25128/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25129 25130"use strict"; 25131/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25132/* harmony export */ "default": function() { return /* binding */ onResize; } 25133/* harmony export */ }); 25134function onResize() { 25135 const swiper = this; 25136 const { 25137 params, 25138 el 25139 } = swiper; 25140 if (el && el.offsetWidth === 0) return; // Breakpoints 25141 25142 if (params.breakpoints) { 25143 swiper.setBreakpoint(); 25144 } // Save locks 25145 25146 25147 const { 25148 allowSlideNext, 25149 allowSlidePrev, 25150 snapGrid 25151 } = swiper; // Disable locks on resize 25152 25153 swiper.allowSlideNext = true; 25154 swiper.allowSlidePrev = true; 25155 swiper.updateSize(); 25156 swiper.updateSlides(); 25157 swiper.updateSlidesClasses(); 25158 25159 if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) { 25160 swiper.slideTo(swiper.slides.length - 1, 0, false, true); 25161 } else { 25162 swiper.slideTo(swiper.activeIndex, 0, false, true); 25163 } 25164 25165 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 25166 swiper.autoplay.run(); 25167 } // Return locks after resize 25168 25169 25170 swiper.allowSlidePrev = allowSlidePrev; 25171 swiper.allowSlideNext = allowSlideNext; 25172 25173 if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) { 25174 swiper.checkOverflow(); 25175 } 25176} 25177 25178/***/ }), 25179
vendor: 1,415 bytes, lines 25180-25227
25180/***/ "./node_modules/swiper/core/events/onScroll.js": 25181/*!*****************************************************!*\ 25182 !*** ./node_modules/swiper/core/events/onScroll.js ***! 25183 \*****************************************************/ 25184/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25185 25186"use strict"; 25187/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25188/* harmony export */ "default": function() { return /* binding */ onScroll; } 25189/* harmony export */ }); 25190function onScroll() { 25191 const swiper = this; 25192 const { 25193 wrapperEl, 25194 rtlTranslate, 25195 enabled 25196 } = swiper; 25197 if (!enabled) return; 25198 swiper.previousTranslate = swiper.translate; 25199 25200 if (swiper.isHorizontal()) { 25201 swiper.translate = -wrapperEl.scrollLeft; 25202 } else { 25203 swiper.translate = -wrapperEl.scrollTop; 25204 } // eslint-disable-next-line 25205 25206 25207 if (swiper.translate === 0) swiper.translate = 0; 25208 swiper.updateActiveIndex(); 25209 swiper.updateSlidesClasses(); 25210 let newProgress; 25211 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 25212 25213 if (translatesDiff === 0) { 25214 newProgress = 0; 25215 } else { 25216 newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff; 25217 } 25218 25219 if (newProgress !== swiper.progress) { 25220 swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate); 25221 } 25222 25223 swiper.emit('setTranslate', swiper.translate, false); 25224} 25225 25226/***/ }), 25227
vendor: 5,492 bytes, lines 25228-25402
25228/***/ "./node_modules/swiper/core/events/onTouchEnd.js": 25229/*!*******************************************************!*\ 25230 !*** ./node_modules/swiper/core/events/onTouchEnd.js ***! 25231 \*******************************************************/ 25232/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25233 25234"use strict"; 25235/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25236/* harmony export */ "default": function() { return /* binding */ onTouchEnd; } 25237/* harmony export */ }); 25238/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 25239 25240function onTouchEnd(event) { 25241 const swiper = this; 25242 const data = swiper.touchEventsData; 25243 const { 25244 params, 25245 touches, 25246 rtlTranslate: rtl, 25247 slidesGrid, 25248 enabled 25249 } = swiper; 25250 if (!enabled) return; 25251 let e = event; 25252 if (e.originalEvent) e = e.originalEvent; 25253 25254 if (data.allowTouchCallbacks) { 25255 swiper.emit('touchEnd', e); 25256 } 25257 25258 data.allowTouchCallbacks = false; 25259 25260 if (!data.isTouched) { 25261 if (data.isMoved && params.grabCursor) { 25262 swiper.setGrabCursor(false); 25263 } 25264 25265 data.isMoved = false; 25266 data.startMoving = false; 25267 return; 25268 } // Return Grab Cursor 25269 25270 25271 if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 25272 swiper.setGrabCursor(false); 25273 } // Time diff 25274 25275 25276 const touchEndTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.now)(); 25277 const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click 25278 25279 if (swiper.allowClick) { 25280 const pathTree = e.path || e.composedPath && e.composedPath(); 25281 swiper.updateClickedSlide(pathTree && pathTree[0] || e.target); 25282 swiper.emit('tap click', e); 25283 25284 if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) { 25285 swiper.emit('doubleTap doubleClick', e); 25286 } 25287 } 25288 25289 data.lastClickTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.now)(); 25290 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => { 25291 if (!swiper.destroyed) swiper.allowClick = true; 25292 }); 25293 25294 if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) { 25295 data.isTouched = false; 25296 data.isMoved = false; 25297 data.startMoving = false; 25298 return; 25299 } 25300 25301 data.isTouched = false; 25302 data.isMoved = false; 25303 data.startMoving = false; 25304 let currentPos; 25305 25306 if (params.followFinger) { 25307 currentPos = rtl ? swiper.translate : -swiper.translate; 25308 } else { 25309 currentPos = -data.currentTranslate; 25310 } 25311 25312 if (params.cssMode) { 25313 return; 25314 } 25315 25316 if (swiper.params.freeMode && params.freeMode.enabled) { 25317 swiper.freeMode.onTouchEnd({ 25318 currentPos 25319 }); 25320 return; 25321 } // Find current slide 25322 25323 25324 let stopIndex = 0; 25325 let groupSize = swiper.slidesSizesGrid[0]; 25326 25327 for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) { 25328 const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 25329 25330 if (typeof slidesGrid[i + increment] !== 'undefined') { 25331 if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) { 25332 stopIndex = i; 25333 groupSize = slidesGrid[i + increment] - slidesGrid[i]; 25334 } 25335 } else if (currentPos >= slidesGrid[i]) { 25336 stopIndex = i; 25337 groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2]; 25338 } 25339 } 25340 25341 let rewindFirstIndex = null; 25342 let rewindLastIndex = null; 25343 25344 if (params.rewind) { 25345 if (swiper.isBeginning) { 25346 rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 25347 } else if (swiper.isEnd) { 25348 rewindFirstIndex = 0; 25349 } 25350 } // Find current slide size 25351 25352 25353 const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize; 25354 const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 25355 25356 if (timeDiff > params.longSwipesMs) { 25357 // Long touches 25358 if (!params.longSwipes) { 25359 swiper.slideTo(swiper.activeIndex); 25360 return; 25361 } 25362 25363 if (swiper.swipeDirection === 'next') { 25364 if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex); 25365 } 25366 25367 if (swiper.swipeDirection === 'prev') { 25368 if (ratio > 1 - params.longSwipesRatio) { 25369 swiper.slideTo(stopIndex + increment); 25370 } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) { 25371 swiper.slideTo(rewindLastIndex); 25372 } else { 25373 swiper.slideTo(stopIndex); 25374 } 25375 } 25376 } else { 25377 // Short swipes 25378 if (!params.shortSwipes) { 25379 swiper.slideTo(swiper.activeIndex); 25380 return; 25381 } 25382 25383 const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl); 25384 25385 if (!isNavButtonTarget) { 25386 if (swiper.swipeDirection === 'next') { 25387 swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment); 25388 } 25389 25390 if (swiper.swipeDirection === 'prev') { 25391 swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex); 25392 } 25393 } else if (e.target === swiper.navigation.nextEl) { 25394 swiper.slideTo(stopIndex + increment); 25395 } else { 25396 swiper.slideTo(stopIndex); 25397 } 25398 } 25399} 25400 25401/***/ }), 25402
vendor: 7,800 bytes, lines 25403-25641
25403/***/ "./node_modules/swiper/core/events/onTouchMove.js": 25404/*!********************************************************!*\ 25405 !*** ./node_modules/swiper/core/events/onTouchMove.js ***! 25406 \********************************************************/ 25407/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25408 25409"use strict"; 25410/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25411/* harmony export */ "default": function() { return /* binding */ onTouchMove; } 25412/* harmony export */ }); 25413/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 25414/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 25415/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 25416 25417 25418 25419function onTouchMove(event) { 25420 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 25421 const swiper = this; 25422 const data = swiper.touchEventsData; 25423 const { 25424 params, 25425 touches, 25426 rtlTranslate: rtl, 25427 enabled 25428 } = swiper; 25429 if (!enabled) return; 25430 let e = event; 25431 if (e.originalEvent) e = e.originalEvent; 25432 25433 if (!data.isTouched) { 25434 if (data.startMoving && data.isScrolling) { 25435 swiper.emit('touchMoveOpposite', e); 25436 } 25437 25438 return; 25439 } 25440 25441 if (data.isTouchEvent && e.type !== 'touchmove') return; 25442 const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]); 25443 const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX; 25444 const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY; 25445 25446 if (e.preventedByNestedSwiper) { 25447 touches.startX = pageX; 25448 touches.startY = pageY; 25449 return; 25450 } 25451 25452 if (!swiper.allowTouchMove) { 25453 if (!(0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target).is(data.focusableElements)) { 25454 swiper.allowClick = false; 25455 } 25456 25457 if (data.isTouched) { 25458 Object.assign(touches, { 25459 startX: pageX, 25460 startY: pageY, 25461 currentX: pageX, 25462 currentY: pageY 25463 }); 25464 data.touchStartTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(); 25465 } 25466 25467 return; 25468 } 25469 25470 if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) { 25471 if (swiper.isVertical()) { 25472 // Vertical 25473 if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) { 25474 data.isTouched = false; 25475 data.isMoved = false; 25476 return; 25477 } 25478 } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) { 25479 return; 25480 } 25481 } 25482 25483 if (data.isTouchEvent && document.activeElement) { 25484 if (e.target === document.activeElement && (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target).is(data.focusableElements)) { 25485 data.isMoved = true; 25486 swiper.allowClick = false; 25487 return; 25488 } 25489 } 25490 25491 if (data.allowTouchCallbacks) { 25492 swiper.emit('touchMove', e); 25493 } 25494 25495 if (e.targetTouches && e.targetTouches.length > 1) return; 25496 touches.currentX = pageX; 25497 touches.currentY = pageY; 25498 const diffX = touches.currentX - touches.startX; 25499 const diffY = touches.currentY - touches.startY; 25500 if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return; 25501 25502 if (typeof data.isScrolling === 'undefined') { 25503 let touchAngle; 25504 25505 if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) { 25506 data.isScrolling = false; 25507 } else { 25508 // eslint-disable-next-line 25509 if (diffX * diffX + diffY * diffY >= 25) { 25510 touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI; 25511 data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle; 25512 } 25513 } 25514 } 25515 25516 if (data.isScrolling) { 25517 swiper.emit('touchMoveOpposite', e); 25518 } 25519 25520 if (typeof data.startMoving === 'undefined') { 25521 if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) { 25522 data.startMoving = true; 25523 } 25524 } 25525 25526 if (data.isScrolling) { 25527 data.isTouched = false; 25528 return; 25529 } 25530 25531 if (!data.startMoving) { 25532 return; 25533 } 25534 25535 swiper.allowClick = false; 25536 25537 if (!params.cssMode && e.cancelable) { 25538 e.preventDefault(); 25539 } 25540 25541 if (params.touchMoveStopPropagation && !params.nested) { 25542 e.stopPropagation(); 25543 } 25544 25545 if (!data.isMoved) { 25546 if (params.loop && !params.cssMode) { 25547 swiper.loopFix(); 25548 } 25549 25550 data.startTranslate = swiper.getTranslate(); 25551 swiper.setTransition(0); 25552 25553 if (swiper.animating) { 25554 swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend'); 25555 } 25556 25557 data.allowMomentumBounce = false; // Grab Cursor 25558 25559 if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 25560 swiper.setGrabCursor(true); 25561 } 25562 25563 swiper.emit('sliderFirstMove', e); 25564 } 25565 25566 swiper.emit('sliderMove', e); 25567 data.isMoved = true; 25568 let diff = swiper.isHorizontal() ? diffX : diffY; 25569 touches.diff = diff; 25570 diff *= params.touchRatio; 25571 if (rtl) diff = -diff; 25572 swiper.swipeDirection = diff > 0 ? 'prev' : 'next'; 25573 data.currentTranslate = diff + data.startTranslate; 25574 let disableParentSwiper = true; 25575 let resistanceRatio = params.resistanceRatio; 25576 25577 if (params.touchReleaseOnEdges) { 25578 resistanceRatio = 0; 25579 } 25580 25581 if (diff > 0 && data.currentTranslate > swiper.minTranslate()) { 25582 disableParentSwiper = false; 25583 if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio; 25584 } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) { 25585 disableParentSwiper = false; 25586 if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio; 25587 } 25588 25589 if (disableParentSwiper) { 25590 e.preventedByNestedSwiper = true; 25591 } // Directions locks 25592 25593 25594 if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) { 25595 data.currentTranslate = data.startTranslate; 25596 } 25597 25598 if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) { 25599 data.currentTranslate = data.startTranslate; 25600 } 25601 25602 if (!swiper.allowSlidePrev && !swiper.allowSlideNext) { 25603 data.currentTranslate = data.startTranslate; 25604 } // Threshold 25605 25606 25607 if (params.threshold > 0) { 25608 if (Math.abs(diff) > params.threshold || data.allowThresholdMove) { 25609 if (!data.allowThresholdMove) { 25610 data.allowThresholdMove = true; 25611 touches.startX = touches.currentX; 25612 touches.startY = touches.currentY; 25613 data.currentTranslate = data.startTranslate; 25614 touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY; 25615 return; 25616 } 25617 } else { 25618 data.currentTranslate = data.startTranslate; 25619 return; 25620 } 25621 } 25622 25623 if (!params.followFinger || params.cssMode) return; // Update active index in free mode 25624 25625 if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) { 25626 swiper.updateActiveIndex(); 25627 swiper.updateSlidesClasses(); 25628 } 25629 25630 if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) { 25631 swiper.freeMode.onTouchMove(); 25632 } // Update progress 25633 25634 25635 swiper.updateProgress(data.currentTranslate); // Update translate 25636 25637 swiper.setTranslate(data.currentTranslate); 25638} 25639 25640/***/ }), 25641
vendor: 5,721 bytes, lines 25642-25789
25642/***/ "./node_modules/swiper/core/events/onTouchStart.js": 25643/*!*********************************************************!*\ 25644 !*** ./node_modules/swiper/core/events/onTouchStart.js ***! 25645 \*********************************************************/ 25646/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25647 25648"use strict"; 25649/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25650/* harmony export */ "default": function() { return /* binding */ onTouchStart; } 25651/* harmony export */ }); 25652/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 25653/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 25654/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 25655 25656 25657 // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd 25658 25659function closestElement(selector, base = this) { 25660 function __closestFrom(el) { 25661 if (!el || el === (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)() || el === (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)()) return null; 25662 if (el.assignedSlot) el = el.assignedSlot; 25663 const found = el.closest(selector); 25664 25665 if (!found && !el.getRootNode) { 25666 return null; 25667 } 25668 25669 return found || __closestFrom(el.getRootNode().host); 25670 } 25671 25672 return __closestFrom(base); 25673} 25674 25675function onTouchStart(event) { 25676 const swiper = this; 25677 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 25678 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 25679 const data = swiper.touchEventsData; 25680 const { 25681 params, 25682 touches, 25683 enabled 25684 } = swiper; 25685 if (!enabled) return; 25686 25687 if (swiper.animating && params.preventInteractionOnTransition) { 25688 return; 25689 } 25690 25691 if (!swiper.animating && params.cssMode && params.loop) { 25692 swiper.loopFix(); 25693 } 25694 25695 let e = event; 25696 if (e.originalEvent) e = e.originalEvent; 25697 let $targetEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target); 25698 25699 if (params.touchEventsTarget === 'wrapper') { 25700 if (!$targetEl.closest(swiper.wrapperEl).length) return; 25701 } 25702 25703 data.isTouchEvent = e.type === 'touchstart'; 25704 if (!data.isTouchEvent && 'which' in e && e.which === 3) return; 25705 if (!data.isTouchEvent && 'button' in e && e.button > 0) return; 25706 if (data.isTouched && data.isMoved) return; // change target el for shadow root component 25707 25708 const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; // eslint-disable-next-line 25709 25710 const eventPath = event.composedPath ? event.composedPath() : event.path; 25711 25712 if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) { 25713 $targetEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(eventPath[0]); 25714 } 25715 25716 const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`; 25717 const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element 25718 25719 if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, $targetEl[0]) : $targetEl.closest(noSwipingSelector)[0])) { 25720 swiper.allowClick = true; 25721 return; 25722 } 25723 25724 if (params.swipeHandler) { 25725 if (!$targetEl.closest(params.swipeHandler)[0]) return; 25726 } 25727 25728 touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; 25729 touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; 25730 const startX = touches.currentX; 25731 const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore 25732 25733 const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection; 25734 const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold; 25735 25736 if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) { 25737 if (edgeSwipeDetection === 'prevent') { 25738 event.preventDefault(); 25739 } else { 25740 return; 25741 } 25742 } 25743 25744 Object.assign(data, { 25745 isTouched: true, 25746 isMoved: false, 25747 allowTouchCallbacks: true, 25748 isScrolling: undefined, 25749 startMoving: undefined 25750 }); 25751 touches.startX = startX; 25752 touches.startY = startY; 25753 data.touchStartTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(); 25754 swiper.allowClick = true; 25755 swiper.updateSize(); 25756 swiper.swipeDirection = undefined; 25757 if (params.threshold > 0) data.allowThresholdMove = false; 25758 25759 if (e.type !== 'touchstart') { 25760 let preventDefault = true; 25761 25762 if ($targetEl.is(data.focusableElements)) { 25763 preventDefault = false; 25764 25765 if ($targetEl[0].nodeName === 'SELECT') { 25766 data.isTouched = false; 25767 } 25768 } 25769 25770 if (document.activeElement && (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) { 25771 document.activeElement.blur(); 25772 } 25773 25774 const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault; 25775 25776 if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) { 25777 e.preventDefault(); 25778 } 25779 } 25780 25781 if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) { 25782 swiper.freeMode.onTouchStart(); 25783 } 25784 25785 swiper.emit('touchStart', e); 25786} 25787 25788/***/ }), 25789
vendor: 955 bytes, lines 25790-25807
25790/***/ "./node_modules/swiper/core/grab-cursor/index.js": 25791/*!*******************************************************!*\ 25792 !*** ./node_modules/swiper/core/grab-cursor/index.js ***! 25793 \*******************************************************/ 25794/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25795 25796"use strict"; 25797/* harmony import */ var _setGrabCursor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setGrabCursor.js */ "./node_modules/swiper/core/grab-cursor/setGrabCursor.js"); 25798/* harmony import */ var _unsetGrabCursor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unsetGrabCursor.js */ "./node_modules/swiper/core/grab-cursor/unsetGrabCursor.js"); 25799 25800 25801/* harmony default export */ __webpack_exports__["default"] = ({ 25802 setGrabCursor: _setGrabCursor_js__WEBPACK_IMPORTED_MODULE_0__["default"], 25803 unsetGrabCursor: _unsetGrabCursor_js__WEBPACK_IMPORTED_MODULE_1__["default"] 25804}); 25805 25806/***/ }), 25807
vendor: 943 bytes, lines 25808-25827
25808/***/ "./node_modules/swiper/core/grab-cursor/setGrabCursor.js": 25809/*!***************************************************************!*\ 25810 !*** ./node_modules/swiper/core/grab-cursor/setGrabCursor.js ***! 25811 \***************************************************************/ 25812/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25813 25814"use strict"; 25815/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25816/* harmony export */ "default": function() { return /* binding */ setGrabCursor; } 25817/* harmony export */ }); 25818function setGrabCursor(moving) { 25819 const swiper = this; 25820 if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; 25821 const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; 25822 el.style.cursor = 'move'; 25823 el.style.cursor = moving ? 'grabbing' : 'grab'; 25824} 25825 25826/***/ }), 25827
vendor: 856 bytes, lines 25828-25849
25828/***/ "./node_modules/swiper/core/grab-cursor/unsetGrabCursor.js": 25829/*!*****************************************************************!*\ 25830 !*** ./node_modules/swiper/core/grab-cursor/unsetGrabCursor.js ***! 25831 \*****************************************************************/ 25832/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25833 25834"use strict"; 25835/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25836/* harmony export */ "default": function() { return /* binding */ unsetGrabCursor; } 25837/* harmony export */ }); 25838function unsetGrabCursor() { 25839 const swiper = this; 25840 25841 if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { 25842 return; 25843 } 25844 25845 swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; 25846} 25847 25848/***/ }), 25849
vendor: 895 bytes, lines 25850-25867
25850/***/ "./node_modules/swiper/core/images/index.js": 25851/*!**************************************************!*\ 25852 !*** ./node_modules/swiper/core/images/index.js ***! 25853 \**************************************************/ 25854/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25855 25856"use strict"; 25857/* harmony import */ var _loadImage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loadImage.js */ "./node_modules/swiper/core/images/loadImage.js"); 25858/* harmony import */ var _preloadImages_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./preloadImages.js */ "./node_modules/swiper/core/images/preloadImages.js"); 25859 25860 25861/* harmony default export */ __webpack_exports__["default"] = ({ 25862 loadImage: _loadImage_js__WEBPACK_IMPORTED_MODULE_0__["default"], 25863 preloadImages: _preloadImages_js__WEBPACK_IMPORTED_MODULE_1__["default"] 25864}); 25865 25866/***/ }), 25867
vendor: 1,620 bytes, lines 25868-25919
25868/***/ "./node_modules/swiper/core/images/loadImage.js": 25869/*!******************************************************!*\ 25870 !*** ./node_modules/swiper/core/images/loadImage.js ***! 25871 \******************************************************/ 25872/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25873 25874"use strict"; 25875/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25876/* harmony export */ "default": function() { return /* binding */ loadImage; } 25877/* harmony export */ }); 25878/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 25879/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 25880 25881 25882function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) { 25883 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 25884 let image; 25885 25886 function onReady() { 25887 if (callback) callback(); 25888 } 25889 25890 const isPicture = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(imageEl).parent('picture')[0]; 25891 25892 if (!isPicture && (!imageEl.complete || !checkForComplete)) { 25893 if (src) { 25894 image = new window.Image(); 25895 image.onload = onReady; 25896 image.onerror = onReady; 25897 25898 if (sizes) { 25899 image.sizes = sizes; 25900 } 25901 25902 if (srcset) { 25903 image.srcset = srcset; 25904 } 25905 25906 if (src) { 25907 image.src = src; 25908 } 25909 } else { 25910 onReady(); 25911 } 25912 } else { 25913 // image already loaded... 25914 onReady(); 25915 } 25916} 25917 25918/***/ }), 25919
vendor: 1,314 bytes, lines 25920-25951
25920/***/ "./node_modules/swiper/core/images/preloadImages.js": 25921/*!**********************************************************!*\ 25922 !*** ./node_modules/swiper/core/images/preloadImages.js ***! 25923 \**********************************************************/ 25924/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25925 25926"use strict"; 25927/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25928/* harmony export */ "default": function() { return /* binding */ preloadImages; } 25929/* harmony export */ }); 25930function preloadImages() { 25931 const swiper = this; 25932 swiper.imagesToLoad = swiper.$el.find('img'); 25933 25934 function onReady() { 25935 if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return; 25936 if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1; 25937 25938 if (swiper.imagesLoaded === swiper.imagesToLoad.length) { 25939 if (swiper.params.updateOnImagesReady) swiper.update(); 25940 swiper.emit('imagesReady'); 25941 } 25942 } 25943 25944 for (let i = 0; i < swiper.imagesToLoad.length; i += 1) { 25945 const imageEl = swiper.imagesToLoad[i]; 25946 swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady); 25947 } 25948} 25949 25950/***/ }), 25951
vendor: 1,098 bytes, lines 25952-25972
25952/***/ "./node_modules/swiper/core/loop/index.js": 25953/*!************************************************!*\ 25954 !*** ./node_modules/swiper/core/loop/index.js ***! 25955 \************************************************/ 25956/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25957 25958"use strict"; 25959/* harmony import */ var _loopCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loopCreate.js */ "./node_modules/swiper/core/loop/loopCreate.js"); 25960/* harmony import */ var _loopFix_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loopFix.js */ "./node_modules/swiper/core/loop/loopFix.js"); 25961/* harmony import */ var _loopDestroy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loopDestroy.js */ "./node_modules/swiper/core/loop/loopDestroy.js"); 25962 25963 25964 25965/* harmony default export */ __webpack_exports__["default"] = ({ 25966 loopCreate: _loopCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"], 25967 loopFix: _loopFix_js__WEBPACK_IMPORTED_MODULE_1__["default"], 25968 loopDestroy: _loopDestroy_js__WEBPACK_IMPORTED_MODULE_2__["default"] 25969}); 25970 25971/***/ }), 25972
vendor: 3,155 bytes, lines 25973-26043
25973/***/ "./node_modules/swiper/core/loop/loopCreate.js": 25974/*!*****************************************************!*\ 25975 !*** ./node_modules/swiper/core/loop/loopCreate.js ***! 25976 \*****************************************************/ 25977/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 25978 25979"use strict"; 25980/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25981/* harmony export */ "default": function() { return /* binding */ loopCreate; } 25982/* harmony export */ }); 25983/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 25984/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 25985 25986 25987function loopCreate() { 25988 const swiper = this; 25989 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 25990 const { 25991 params, 25992 $wrapperEl 25993 } = swiper; // Remove duplicated slides 25994 25995 const $selector = $wrapperEl.children().length > 0 ? (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])($wrapperEl.children()[0].parentNode) : $wrapperEl; 25996 $selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove(); 25997 let slides = $selector.children(`.${params.slideClass}`); 25998 25999 if (params.loopFillGroupWithBlank) { 26000 const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup; 26001 26002 if (blankSlidesNum !== params.slidesPerGroup) { 26003 for (let i = 0; i < blankSlidesNum; i += 1) { 26004 const blankNode = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`); 26005 $selector.append(blankNode); 26006 } 26007 26008 slides = $selector.children(`.${params.slideClass}`); 26009 } 26010 } 26011 26012 if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length; 26013 swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10)); 26014 swiper.loopedSlides += params.loopAdditionalSlides; 26015 26016 if (swiper.loopedSlides > slides.length && swiper.params.loopedSlidesLimit) { 26017 swiper.loopedSlides = slides.length; 26018 } 26019 26020 const prependSlides = []; 26021 const appendSlides = []; 26022 slides.each((el, index) => { 26023 const slide = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(el); 26024 slide.attr('data-swiper-slide-index', index); 26025 }); 26026 26027 for (let i = 0; i < swiper.loopedSlides; i += 1) { 26028 const index = i - Math.floor(i / slides.length) * slides.length; 26029 appendSlides.push(slides.eq(index)[0]); 26030 prependSlides.unshift(slides.eq(slides.length - index - 1)[0]); 26031 } 26032 26033 for (let i = 0; i < appendSlides.length; i += 1) { 26034 $selector.append((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); 26035 } 26036 26037 for (let i = prependSlides.length - 1; i >= 0; i -= 1) { 26038 $selector.prepend((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass)); 26039 } 26040} 26041 26042/***/ }), 26043
vendor: 829 bytes, lines 26044-26066
26044/***/ "./node_modules/swiper/core/loop/loopDestroy.js": 26045/*!******************************************************!*\ 26046 !*** ./node_modules/swiper/core/loop/loopDestroy.js ***! 26047 \******************************************************/ 26048/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26049 26050"use strict"; 26051/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26052/* harmony export */ "default": function() { return /* binding */ loopDestroy; } 26053/* harmony export */ }); 26054function loopDestroy() { 26055 const swiper = this; 26056 const { 26057 $wrapperEl, 26058 params, 26059 slides 26060 } = swiper; 26061 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove(); 26062 slides.removeAttr('data-swiper-slide-index'); 26063} 26064 26065/***/ }), 26066
vendor: 1,767 bytes, lines 26067-26120
26067/***/ "./node_modules/swiper/core/loop/loopFix.js": 26068/*!**************************************************!*\ 26069 !*** ./node_modules/swiper/core/loop/loopFix.js ***! 26070 \**************************************************/ 26071/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26072 26073"use strict"; 26074/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26075/* harmony export */ "default": function() { return /* binding */ loopFix; } 26076/* harmony export */ }); 26077function loopFix() { 26078 const swiper = this; 26079 swiper.emit('beforeLoopFix'); 26080 const { 26081 activeIndex, 26082 slides, 26083 loopedSlides, 26084 allowSlidePrev, 26085 allowSlideNext, 26086 snapGrid, 26087 rtlTranslate: rtl 26088 } = swiper; 26089 let newIndex; 26090 swiper.allowSlidePrev = true; 26091 swiper.allowSlideNext = true; 26092 const snapTranslate = -snapGrid[activeIndex]; 26093 const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding 26094 26095 if (activeIndex < loopedSlides) { 26096 newIndex = slides.length - loopedSlides * 3 + activeIndex; 26097 newIndex += loopedSlides; 26098 const slideChanged = swiper.slideTo(newIndex, 0, false, true); 26099 26100 if (slideChanged && diff !== 0) { 26101 swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); 26102 } 26103 } else if (activeIndex >= slides.length - loopedSlides) { 26104 // Fix For Positive Oversliding 26105 newIndex = -slides.length + activeIndex + loopedSlides; 26106 newIndex += loopedSlides; 26107 const slideChanged = swiper.slideTo(newIndex, 0, false, true); 26108 26109 if (slideChanged && diff !== 0) { 26110 swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff); 26111 } 26112 } 26113 26114 swiper.allowSlidePrev = allowSlidePrev; 26115 swiper.allowSlideNext = allowSlideNext; 26116 swiper.emit('loopFix'); 26117} 26118 26119/***/ }), 26120
vendor: 1,897 bytes, lines 26121-26172
26121/***/ "./node_modules/swiper/core/moduleExtendParams.js": 26122/*!********************************************************!*\ 26123 !*** ./node_modules/swiper/core/moduleExtendParams.js ***! 26124 \********************************************************/ 26125/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26126 26127"use strict"; 26128/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26129/* harmony export */ "default": function() { return /* binding */ moduleExtendParams; } 26130/* harmony export */ }); 26131/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 26132 26133function moduleExtendParams(params, allModulesParams) { 26134 return function extendParams(obj = {}) { 26135 const moduleParamName = Object.keys(obj)[0]; 26136 const moduleParams = obj[moduleParamName]; 26137 26138 if (typeof moduleParams !== 'object' || moduleParams === null) { 26139 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.extend)(allModulesParams, obj); 26140 return; 26141 } 26142 26143 if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) { 26144 params[moduleParamName] = { 26145 auto: true 26146 }; 26147 } 26148 26149 if (!(moduleParamName in params && 'enabled' in moduleParams)) { 26150 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.extend)(allModulesParams, obj); 26151 return; 26152 } 26153 26154 if (params[moduleParamName] === true) { 26155 params[moduleParamName] = { 26156 enabled: true 26157 }; 26158 } 26159 26160 if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) { 26161 params[moduleParamName].enabled = true; 26162 } 26163 26164 if (!params[moduleParamName]) params[moduleParamName] = { 26165 enabled: false 26166 }; 26167 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.extend)(allModulesParams, obj); 26168 }; 26169} 26170 26171/***/ }), 26172
vendor: 2,748 bytes, lines 26173-26261
26173/***/ "./node_modules/swiper/core/modules/observer/observer.js": 26174/*!***************************************************************!*\ 26175 !*** ./node_modules/swiper/core/modules/observer/observer.js ***! 26176 \***************************************************************/ 26177/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26178 26179"use strict"; 26180/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26181/* harmony export */ "default": function() { return /* binding */ Observer; } 26182/* harmony export */ }); 26183/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 26184 26185function Observer({ 26186 swiper, 26187 extendParams, 26188 on, 26189 emit 26190}) { 26191 const observers = []; 26192 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 26193 26194 const attach = (target, options = {}) => { 26195 const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; 26196 const observer = new ObserverFunc(mutations => { 26197 // The observerUpdate event should only be triggered 26198 // once despite the number of mutations. Additional 26199 // triggers are redundant and are very costly 26200 if (mutations.length === 1) { 26201 emit('observerUpdate', mutations[0]); 26202 return; 26203 } 26204 26205 const observerUpdate = function observerUpdate() { 26206 emit('observerUpdate', mutations[0]); 26207 }; 26208 26209 if (window.requestAnimationFrame) { 26210 window.requestAnimationFrame(observerUpdate); 26211 } else { 26212 window.setTimeout(observerUpdate, 0); 26213 } 26214 }); 26215 observer.observe(target, { 26216 attributes: typeof options.attributes === 'undefined' ? true : options.attributes, 26217 childList: typeof options.childList === 'undefined' ? true : options.childList, 26218 characterData: typeof options.characterData === 'undefined' ? true : options.characterData 26219 }); 26220 observers.push(observer); 26221 }; 26222 26223 const init = () => { 26224 if (!swiper.params.observer) return; 26225 26226 if (swiper.params.observeParents) { 26227 const containerParents = swiper.$el.parents(); 26228 26229 for (let i = 0; i < containerParents.length; i += 1) { 26230 attach(containerParents[i]); 26231 } 26232 } // Observe container 26233 26234 26235 attach(swiper.$el[0], { 26236 childList: swiper.params.observeSlideChildren 26237 }); // Observe wrapper 26238 26239 attach(swiper.$wrapperEl[0], { 26240 attributes: false 26241 }); 26242 }; 26243 26244 const destroy = () => { 26245 observers.forEach(observer => { 26246 observer.disconnect(); 26247 }); 26248 observers.splice(0, observers.length); 26249 }; 26250 26251 extendParams({ 26252 observer: false, 26253 observeParents: false, 26254 observeSlideChildren: false 26255 }); 26256 on('init', init); 26257 on('destroy', destroy); 26258} 26259 26260/***/ }), 26261
vendor: 2,778 bytes, lines 26262-26350
26262/***/ "./node_modules/swiper/core/modules/resize/resize.js": 26263/*!***********************************************************!*\ 26264 !*** ./node_modules/swiper/core/modules/resize/resize.js ***! 26265 \***********************************************************/ 26266/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26267 26268"use strict"; 26269/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26270/* harmony export */ "default": function() { return /* binding */ Resize; } 26271/* harmony export */ }); 26272/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 26273 26274function Resize({ 26275 swiper, 26276 on, 26277 emit 26278}) { 26279 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 26280 let observer = null; 26281 let animationFrame = null; 26282 26283 const resizeHandler = () => { 26284 if (!swiper || swiper.destroyed || !swiper.initialized) return; 26285 emit('beforeResize'); 26286 emit('resize'); 26287 }; 26288 26289 const createObserver = () => { 26290 if (!swiper || swiper.destroyed || !swiper.initialized) return; 26291 observer = new ResizeObserver(entries => { 26292 animationFrame = window.requestAnimationFrame(() => { 26293 const { 26294 width, 26295 height 26296 } = swiper; 26297 let newWidth = width; 26298 let newHeight = height; 26299 entries.forEach(({ 26300 contentBoxSize, 26301 contentRect, 26302 target 26303 }) => { 26304 if (target && target !== swiper.el) return; 26305 newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize; 26306 newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize; 26307 }); 26308 26309 if (newWidth !== width || newHeight !== height) { 26310 resizeHandler(); 26311 } 26312 }); 26313 }); 26314 observer.observe(swiper.el); 26315 }; 26316 26317 const removeObserver = () => { 26318 if (animationFrame) { 26319 window.cancelAnimationFrame(animationFrame); 26320 } 26321 26322 if (observer && observer.unobserve && swiper.el) { 26323 observer.unobserve(swiper.el); 26324 observer = null; 26325 } 26326 }; 26327 26328 const orientationChangeHandler = () => { 26329 if (!swiper || swiper.destroyed || !swiper.initialized) return; 26330 emit('orientationchange'); 26331 }; 26332 26333 on('init', () => { 26334 if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') { 26335 createObserver(); 26336 return; 26337 } 26338 26339 window.addEventListener('resize', resizeHandler); 26340 window.addEventListener('orientationchange', orientationChangeHandler); 26341 }); 26342 on('destroy', () => { 26343 removeObserver(); 26344 window.removeEventListener('resize', resizeHandler); 26345 window.removeEventListener('orientationchange', orientationChangeHandler); 26346 }); 26347} 26348 26349/***/ }), 26350
vendor: 2,104 bytes, lines 26351-26383
26351/***/ "./node_modules/swiper/core/slide/index.js": 26352/*!*************************************************!*\ 26353 !*** ./node_modules/swiper/core/slide/index.js ***! 26354 \*************************************************/ 26355/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26356 26357"use strict"; 26358/* harmony import */ var _slideTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slideTo.js */ "./node_modules/swiper/core/slide/slideTo.js"); 26359/* harmony import */ var _slideToLoop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slideToLoop.js */ "./node_modules/swiper/core/slide/slideToLoop.js"); 26360/* harmony import */ var _slideNext_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./slideNext.js */ "./node_modules/swiper/core/slide/slideNext.js"); 26361/* harmony import */ var _slidePrev_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./slidePrev.js */ "./node_modules/swiper/core/slide/slidePrev.js"); 26362/* harmony import */ var _slideReset_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./slideReset.js */ "./node_modules/swiper/core/slide/slideReset.js"); 26363/* harmony import */ var _slideToClosest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./slideToClosest.js */ "./node_modules/swiper/core/slide/slideToClosest.js"); 26364/* harmony import */ var _slideToClickedSlide_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./slideToClickedSlide.js */ "./node_modules/swiper/core/slide/slideToClickedSlide.js"); 26365 26366 26367 26368 26369 26370 26371 26372/* harmony default export */ __webpack_exports__["default"] = ({ 26373 slideTo: _slideTo_js__WEBPACK_IMPORTED_MODULE_0__["default"], 26374 slideToLoop: _slideToLoop_js__WEBPACK_IMPORTED_MODULE_1__["default"], 26375 slideNext: _slideNext_js__WEBPACK_IMPORTED_MODULE_2__["default"], 26376 slidePrev: _slidePrev_js__WEBPACK_IMPORTED_MODULE_3__["default"], 26377 slideReset: _slideReset_js__WEBPACK_IMPORTED_MODULE_4__["default"], 26378 slideToClosest: _slideToClosest_js__WEBPACK_IMPORTED_MODULE_5__["default"], 26379 slideToClickedSlide: _slideToClickedSlide_js__WEBPACK_IMPORTED_MODULE_6__["default"] 26380}); 26381 26382/***/ }), 26383
vendor: 1,454 bytes, lines 26384-26426
26384/***/ "./node_modules/swiper/core/slide/slideNext.js": 26385/*!*****************************************************!*\ 26386 !*** ./node_modules/swiper/core/slide/slideNext.js ***! 26387 \*****************************************************/ 26388/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26389 26390"use strict"; 26391/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26392/* harmony export */ "default": function() { return /* binding */ slideNext; } 26393/* harmony export */ }); 26394/* eslint no-unused-vars: "off" */ 26395function slideNext(speed = this.params.speed, runCallbacks = true, internal) { 26396 const swiper = this; 26397 const { 26398 animating, 26399 enabled, 26400 params 26401 } = swiper; 26402 if (!enabled) return swiper; 26403 let perGroup = params.slidesPerGroup; 26404 26405 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 26406 perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1); 26407 } 26408 26409 const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup; 26410 26411 if (params.loop) { 26412 if (animating && params.loopPreventsSlide) return false; 26413 swiper.loopFix(); // eslint-disable-next-line 26414 26415 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 26416 } 26417 26418 if (params.rewind && swiper.isEnd) { 26419 return swiper.slideTo(0, speed, runCallbacks, internal); 26420 } 26421 26422 return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); 26423} 26424 26425/***/ }), 26426
vendor: 2,529 bytes, lines 26427-26503
26427/***/ "./node_modules/swiper/core/slide/slidePrev.js": 26428/*!*****************************************************!*\ 26429 !*** ./node_modules/swiper/core/slide/slidePrev.js ***! 26430 \*****************************************************/ 26431/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26432 26433"use strict"; 26434/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26435/* harmony export */ "default": function() { return /* binding */ slidePrev; } 26436/* harmony export */ }); 26437/* eslint no-unused-vars: "off" */ 26438function slidePrev(speed = this.params.speed, runCallbacks = true, internal) { 26439 const swiper = this; 26440 const { 26441 params, 26442 animating, 26443 snapGrid, 26444 slidesGrid, 26445 rtlTranslate, 26446 enabled 26447 } = swiper; 26448 if (!enabled) return swiper; 26449 26450 if (params.loop) { 26451 if (animating && params.loopPreventsSlide) return false; 26452 swiper.loopFix(); // eslint-disable-next-line 26453 26454 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 26455 } 26456 26457 const translate = rtlTranslate ? swiper.translate : -swiper.translate; 26458 26459 function normalize(val) { 26460 if (val < 0) return -Math.floor(Math.abs(val)); 26461 return Math.floor(val); 26462 } 26463 26464 const normalizedTranslate = normalize(translate); 26465 const normalizedSnapGrid = snapGrid.map(val => normalize(val)); 26466 let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1]; 26467 26468 if (typeof prevSnap === 'undefined' && params.cssMode) { 26469 let prevSnapIndex; 26470 snapGrid.forEach((snap, snapIndex) => { 26471 if (normalizedTranslate >= snap) { 26472 // prevSnap = snap; 26473 prevSnapIndex = snapIndex; 26474 } 26475 }); 26476 26477 if (typeof prevSnapIndex !== 'undefined') { 26478 prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex]; 26479 } 26480 } 26481 26482 let prevIndex = 0; 26483 26484 if (typeof prevSnap !== 'undefined') { 26485 prevIndex = slidesGrid.indexOf(prevSnap); 26486 if (prevIndex < 0) prevIndex = swiper.activeIndex - 1; 26487 26488 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 26489 prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1; 26490 prevIndex = Math.max(prevIndex, 0); 26491 } 26492 } 26493 26494 if (params.rewind && swiper.isBeginning) { 26495 const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 26496 return swiper.slideTo(lastIndex, speed, runCallbacks, internal); 26497 } 26498 26499 return swiper.slideTo(prevIndex, speed, runCallbacks, internal); 26500} 26501 26502/***/ }), 26503
vendor: 748 bytes, lines 26504-26521
26504/***/ "./node_modules/swiper/core/slide/slideReset.js": 26505/*!******************************************************!*\ 26506 !*** ./node_modules/swiper/core/slide/slideReset.js ***! 26507 \******************************************************/ 26508/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26509 26510"use strict"; 26511/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26512/* harmony export */ "default": function() { return /* binding */ slideReset; } 26513/* harmony export */ }); 26514/* eslint no-unused-vars: "off" */ 26515function slideReset(speed = this.params.speed, runCallbacks = true, internal) { 26516 const swiper = this; 26517 return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); 26518} 26519 26520/***/ }), 26521
vendor: 6,458 bytes, lines 26522-26715
26522/***/ "./node_modules/swiper/core/slide/slideTo.js": 26523/*!***************************************************!*\ 26524 !*** ./node_modules/swiper/core/slide/slideTo.js ***! 26525 \***************************************************/ 26526/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26527 26528"use strict"; 26529/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26530/* harmony export */ "default": function() { return /* binding */ slideTo; } 26531/* harmony export */ }); 26532/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 26533 26534function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) { 26535 if (typeof index !== 'number' && typeof index !== 'string') { 26536 throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`); 26537 } 26538 26539 if (typeof index === 'string') { 26540 /** 26541 * The `index` argument converted from `string` to `number`. 26542 * @type {number} 26543 */ 26544 const indexAsNumber = parseInt(index, 10); 26545 /** 26546 * Determines whether the `index` argument is a valid `number` 26547 * after being converted from the `string` type. 26548 * @type {boolean} 26549 */ 26550 26551 const isValidNumber = isFinite(indexAsNumber); 26552 26553 if (!isValidNumber) { 26554 throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`); 26555 } // Knowing that the converted `index` is a valid number, 26556 // we can update the original argument's value. 26557 26558 26559 index = indexAsNumber; 26560 } 26561 26562 const swiper = this; 26563 let slideIndex = index; 26564 if (slideIndex < 0) slideIndex = 0; 26565 const { 26566 params, 26567 snapGrid, 26568 slidesGrid, 26569 previousIndex, 26570 activeIndex, 26571 rtlTranslate: rtl, 26572 wrapperEl, 26573 enabled 26574 } = swiper; 26575 26576 if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) { 26577 return false; 26578 } 26579 26580 const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex); 26581 let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup); 26582 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 26583 const translate = -snapGrid[snapIndex]; // Normalize slideIndex 26584 26585 if (params.normalizeSlideIndex) { 26586 for (let i = 0; i < slidesGrid.length; i += 1) { 26587 const normalizedTranslate = -Math.floor(translate * 100); 26588 const normalizedGrid = Math.floor(slidesGrid[i] * 100); 26589 const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100); 26590 26591 if (typeof slidesGrid[i + 1] !== 'undefined') { 26592 if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) { 26593 slideIndex = i; 26594 } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) { 26595 slideIndex = i + 1; 26596 } 26597 } else if (normalizedTranslate >= normalizedGrid) { 26598 slideIndex = i; 26599 } 26600 } 26601 } // Directions locks 26602 26603 26604 if (swiper.initialized && slideIndex !== activeIndex) { 26605 if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) { 26606 return false; 26607 } 26608 26609 if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) { 26610 if ((activeIndex || 0) !== slideIndex) return false; 26611 } 26612 } 26613 26614 if (slideIndex !== (previousIndex || 0) && runCallbacks) { 26615 swiper.emit('beforeSlideChangeStart'); 26616 } // Update progress 26617 26618 26619 swiper.updateProgress(translate); 26620 let direction; 26621 if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index 26622 26623 if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) { 26624 swiper.updateActiveIndex(slideIndex); // Update Height 26625 26626 if (params.autoHeight) { 26627 swiper.updateAutoHeight(); 26628 } 26629 26630 swiper.updateSlidesClasses(); 26631 26632 if (params.effect !== 'slide') { 26633 swiper.setTranslate(translate); 26634 } 26635 26636 if (direction !== 'reset') { 26637 swiper.transitionStart(runCallbacks, direction); 26638 swiper.transitionEnd(runCallbacks, direction); 26639 } 26640 26641 return false; 26642 } 26643 26644 if (params.cssMode) { 26645 const isH = swiper.isHorizontal(); 26646 const t = rtl ? translate : -translate; 26647 26648 if (speed === 0) { 26649 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 26650 26651 if (isVirtual) { 26652 swiper.wrapperEl.style.scrollSnapType = 'none'; 26653 swiper._immediateVirtual = true; 26654 } 26655 26656 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 26657 26658 if (isVirtual) { 26659 requestAnimationFrame(() => { 26660 swiper.wrapperEl.style.scrollSnapType = ''; 26661 swiper._swiperImmediateVirtual = false; 26662 }); 26663 } 26664 } else { 26665 if (!swiper.support.smoothScroll) { 26666 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.animateCSSModeScroll)({ 26667 swiper, 26668 targetPosition: t, 26669 side: isH ? 'left' : 'top' 26670 }); 26671 return true; 26672 } 26673 26674 wrapperEl.scrollTo({ 26675 [isH ? 'left' : 'top']: t, 26676 behavior: 'smooth' 26677 }); 26678 } 26679 26680 return true; 26681 } 26682 26683 swiper.setTransition(speed); 26684 swiper.setTranslate(translate); 26685 swiper.updateActiveIndex(slideIndex); 26686 swiper.updateSlidesClasses(); 26687 swiper.emit('beforeTransitionStart', speed, internal); 26688 swiper.transitionStart(runCallbacks, direction); 26689 26690 if (speed === 0) { 26691 swiper.transitionEnd(runCallbacks, direction); 26692 } else if (!swiper.animating) { 26693 swiper.animating = true; 26694 26695 if (!swiper.onSlideToWrapperTransitionEnd) { 26696 swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) { 26697 if (!swiper || swiper.destroyed) return; 26698 if (e.target !== this) return; 26699 swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 26700 swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); 26701 swiper.onSlideToWrapperTransitionEnd = null; 26702 delete swiper.onSlideToWrapperTransitionEnd; 26703 swiper.transitionEnd(runCallbacks, direction); 26704 }; 26705 } 26706 26707 swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 26708 swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd); 26709 } 26710 26711 return true; 26712} 26713 26714/***/ }), 26715
vendor: 2,412 bytes, lines 26716-26769
26716/***/ "./node_modules/swiper/core/slide/slideToClickedSlide.js": 26717/*!***************************************************************!*\ 26718 !*** ./node_modules/swiper/core/slide/slideToClickedSlide.js ***! 26719 \***************************************************************/ 26720/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26721 26722"use strict"; 26723/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26724/* harmony export */ "default": function() { return /* binding */ slideToClickedSlide; } 26725/* harmony export */ }); 26726/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 26727/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 26728 26729 26730function slideToClickedSlide() { 26731 const swiper = this; 26732 const { 26733 params, 26734 $wrapperEl 26735 } = swiper; 26736 const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; 26737 let slideToIndex = swiper.clickedIndex; 26738 let realIndex; 26739 26740 if (params.loop) { 26741 if (swiper.animating) return; 26742 realIndex = parseInt((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper.clickedSlide).attr('data-swiper-slide-index'), 10); 26743 26744 if (params.centeredSlides) { 26745 if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) { 26746 swiper.loopFix(); 26747 slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); 26748 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_1__.nextTick)(() => { 26749 swiper.slideTo(slideToIndex); 26750 }); 26751 } else { 26752 swiper.slideTo(slideToIndex); 26753 } 26754 } else if (slideToIndex > swiper.slides.length - slidesPerView) { 26755 swiper.loopFix(); 26756 slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index(); 26757 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_1__.nextTick)(() => { 26758 swiper.slideTo(slideToIndex); 26759 }); 26760 } else { 26761 swiper.slideTo(slideToIndex); 26762 } 26763 } else { 26764 swiper.slideTo(slideToIndex); 26765 } 26766} 26767 26768/***/ }), 26769
vendor: 1,931 bytes, lines 26770-26814
26770/***/ "./node_modules/swiper/core/slide/slideToClosest.js": 26771/*!**********************************************************!*\ 26772 !*** ./node_modules/swiper/core/slide/slideToClosest.js ***! 26773 \**********************************************************/ 26774/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26775 26776"use strict"; 26777/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26778/* harmony export */ "default": function() { return /* binding */ slideToClosest; } 26779/* harmony export */ }); 26780/* eslint no-unused-vars: "off" */ 26781function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) { 26782 const swiper = this; 26783 let index = swiper.activeIndex; 26784 const skip = Math.min(swiper.params.slidesPerGroupSkip, index); 26785 const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup); 26786 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 26787 26788 if (translate >= swiper.snapGrid[snapIndex]) { 26789 // The current translate is on or after the current snap index, so the choice 26790 // is between the current index and the one after it. 26791 const currentSnap = swiper.snapGrid[snapIndex]; 26792 const nextSnap = swiper.snapGrid[snapIndex + 1]; 26793 26794 if (translate - currentSnap > (nextSnap - currentSnap) * threshold) { 26795 index += swiper.params.slidesPerGroup; 26796 } 26797 } else { 26798 // The current translate is before the current snap index, so the choice 26799 // is between the current index and the one before it. 26800 const prevSnap = swiper.snapGrid[snapIndex - 1]; 26801 const currentSnap = swiper.snapGrid[snapIndex]; 26802 26803 if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) { 26804 index -= swiper.params.slidesPerGroup; 26805 } 26806 } 26807 26808 index = Math.max(index, 0); 26809 index = Math.min(index, swiper.slidesGrid.length - 1); 26810 return swiper.slideTo(index, speed, runCallbacks, internal); 26811} 26812 26813/***/ }), 26814
vendor: 1,497 bytes, lines 26815-26860
26815/***/ "./node_modules/swiper/core/slide/slideToLoop.js": 26816/*!*******************************************************!*\ 26817 !*** ./node_modules/swiper/core/slide/slideToLoop.js ***! 26818 \*******************************************************/ 26819/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26820 26821"use strict"; 26822/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26823/* harmony export */ "default": function() { return /* binding */ slideToLoop; } 26824/* harmony export */ }); 26825function slideToLoop(index = 0, speed = this.params.speed, runCallbacks = true, internal) { 26826 if (typeof index === 'string') { 26827 /** 26828 * The `index` argument converted from `string` to `number`. 26829 * @type {number} 26830 */ 26831 const indexAsNumber = parseInt(index, 10); 26832 /** 26833 * Determines whether the `index` argument is a valid `number` 26834 * after being converted from the `string` type. 26835 * @type {boolean} 26836 */ 26837 26838 const isValidNumber = isFinite(indexAsNumber); 26839 26840 if (!isValidNumber) { 26841 throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`); 26842 } // Knowing that the converted `index` is a valid number, 26843 // we can update the original argument's value. 26844 26845 26846 index = indexAsNumber; 26847 } 26848 26849 const swiper = this; 26850 let newIndex = index; 26851 26852 if (swiper.params.loop) { 26853 newIndex += swiper.loopedSlides; 26854 } 26855 26856 return swiper.slideTo(newIndex, speed, runCallbacks, internal); 26857} 26858 26859/***/ }), 26860
vendor: 1,205 bytes, lines 26861-26881
26861/***/ "./node_modules/swiper/core/transition/index.js": 26862/*!******************************************************!*\ 26863 !*** ./node_modules/swiper/core/transition/index.js ***! 26864 \******************************************************/ 26865/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26866 26867"use strict"; 26868/* harmony import */ var _setTransition_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setTransition.js */ "./node_modules/swiper/core/transition/setTransition.js"); 26869/* harmony import */ var _transitionStart_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitionStart.js */ "./node_modules/swiper/core/transition/transitionStart.js"); 26870/* harmony import */ var _transitionEnd_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transitionEnd.js */ "./node_modules/swiper/core/transition/transitionEnd.js"); 26871 26872 26873 26874/* harmony default export */ __webpack_exports__["default"] = ({ 26875 setTransition: _setTransition_js__WEBPACK_IMPORTED_MODULE_0__["default"], 26876 transitionStart: _transitionStart_js__WEBPACK_IMPORTED_MODULE_1__["default"], 26877 transitionEnd: _transitionEnd_js__WEBPACK_IMPORTED_MODULE_2__["default"] 26878}); 26879 26880/***/ }), 26881
vendor: 779 bytes, lines 26882-26903
26882/***/ "./node_modules/swiper/core/transition/setTransition.js": 26883/*!**************************************************************!*\ 26884 !*** ./node_modules/swiper/core/transition/setTransition.js ***! 26885 \**************************************************************/ 26886/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26887 26888"use strict"; 26889/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26890/* harmony export */ "default": function() { return /* binding */ setTransition; } 26891/* harmony export */ }); 26892function setTransition(duration, byController) { 26893 const swiper = this; 26894 26895 if (!swiper.params.cssMode) { 26896 swiper.$wrapperEl.transition(duration); 26897 } 26898 26899 swiper.emit('setTransition', duration, byController); 26900} 26901 26902/***/ }), 26903
vendor: 1,261 bytes, lines 26904-26949
26904/***/ "./node_modules/swiper/core/transition/transitionEmit.js": 26905/*!***************************************************************!*\ 26906 !*** ./node_modules/swiper/core/transition/transitionEmit.js ***! 26907 \***************************************************************/ 26908/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26909 26910"use strict"; 26911/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26912/* harmony export */ "default": function() { return /* binding */ transitionEmit; } 26913/* harmony export */ }); 26914function transitionEmit({ 26915 swiper, 26916 runCallbacks, 26917 direction, 26918 step 26919}) { 26920 const { 26921 activeIndex, 26922 previousIndex 26923 } = swiper; 26924 let dir = direction; 26925 26926 if (!dir) { 26927 if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset'; 26928 } 26929 26930 swiper.emit(`transition${step}`); 26931 26932 if (runCallbacks && activeIndex !== previousIndex) { 26933 if (dir === 'reset') { 26934 swiper.emit(`slideResetTransition${step}`); 26935 return; 26936 } 26937 26938 swiper.emit(`slideChangeTransition${step}`); 26939 26940 if (dir === 'next') { 26941 swiper.emit(`slideNextTransition${step}`); 26942 } else { 26943 swiper.emit(`slidePrevTransition${step}`); 26944 } 26945 } 26946} 26947 26948/***/ }), 26949
vendor: 1,086 bytes, lines 26950-26979
26950/***/ "./node_modules/swiper/core/transition/transitionEnd.js": 26951/*!**************************************************************!*\ 26952 !*** ./node_modules/swiper/core/transition/transitionEnd.js ***! 26953 \**************************************************************/ 26954/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26955 26956"use strict"; 26957/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26958/* harmony export */ "default": function() { return /* binding */ transitionEnd; } 26959/* harmony export */ }); 26960/* harmony import */ var _transitionEmit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transitionEmit.js */ "./node_modules/swiper/core/transition/transitionEmit.js"); 26961 26962function transitionEnd(runCallbacks = true, direction) { 26963 const swiper = this; 26964 const { 26965 params 26966 } = swiper; 26967 swiper.animating = false; 26968 if (params.cssMode) return; 26969 swiper.setTransition(0); 26970 (0,_transitionEmit_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 26971 swiper, 26972 runCallbacks, 26973 direction, 26974 step: 'End' 26975 }); 26976} 26977 26978/***/ }), 26979
vendor: 1,109 bytes, lines 26980-27012
26980/***/ "./node_modules/swiper/core/transition/transitionStart.js": 26981/*!****************************************************************!*\ 26982 !*** ./node_modules/swiper/core/transition/transitionStart.js ***! 26983 \****************************************************************/ 26984/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 26985 26986"use strict"; 26987/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26988/* harmony export */ "default": function() { return /* binding */ transitionStart; } 26989/* harmony export */ }); 26990/* harmony import */ var _transitionEmit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transitionEmit.js */ "./node_modules/swiper/core/transition/transitionEmit.js"); 26991 26992function transitionStart(runCallbacks = true, direction) { 26993 const swiper = this; 26994 const { 26995 params 26996 } = swiper; 26997 if (params.cssMode) return; 26998 26999 if (params.autoHeight) { 27000 swiper.updateAutoHeight(); 27001 } 27002 27003 (0,_transitionEmit_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 27004 swiper, 27005 runCallbacks, 27006 direction, 27007 step: 'Start' 27008 }); 27009} 27010 27011/***/ }), 27012
vendor: 1,235 bytes, lines 27013-27048
27013/***/ "./node_modules/swiper/core/translate/getTranslate.js": 27014/*!************************************************************!*\ 27015 !*** ./node_modules/swiper/core/translate/getTranslate.js ***! 27016 \************************************************************/ 27017/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27018 27019"use strict"; 27020/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27021/* harmony export */ "default": function() { return /* binding */ getSwiperTranslate; } 27022/* harmony export */ }); 27023/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 27024 27025function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') { 27026 const swiper = this; 27027 const { 27028 params, 27029 rtlTranslate: rtl, 27030 translate, 27031 $wrapperEl 27032 } = swiper; 27033 27034 if (params.virtualTranslate) { 27035 return rtl ? -translate : translate; 27036 } 27037 27038 if (params.cssMode) { 27039 return translate; 27040 } 27041 27042 let currentTranslate = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.getTranslate)($wrapperEl[0], axis); 27043 if (rtl) currentTranslate = -currentTranslate; 27044 return currentTranslate || 0; 27045} 27046 27047/***/ }), 27048
vendor: 1,668 bytes, lines 27049-27075
27049/***/ "./node_modules/swiper/core/translate/index.js": 27050/*!*****************************************************!*\ 27051 !*** ./node_modules/swiper/core/translate/index.js ***! 27052 \*****************************************************/ 27053/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27054 27055"use strict"; 27056/* harmony import */ var _getTranslate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getTranslate.js */ "./node_modules/swiper/core/translate/getTranslate.js"); 27057/* harmony import */ var _setTranslate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setTranslate.js */ "./node_modules/swiper/core/translate/setTranslate.js"); 27058/* harmony import */ var _minTranslate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minTranslate.js */ "./node_modules/swiper/core/translate/minTranslate.js"); 27059/* harmony import */ var _maxTranslate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./maxTranslate.js */ "./node_modules/swiper/core/translate/maxTranslate.js"); 27060/* harmony import */ var _translateTo_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./translateTo.js */ "./node_modules/swiper/core/translate/translateTo.js"); 27061 27062 27063 27064 27065 27066/* harmony default export */ __webpack_exports__["default"] = ({ 27067 getTranslate: _getTranslate_js__WEBPACK_IMPORTED_MODULE_0__["default"], 27068 setTranslate: _setTranslate_js__WEBPACK_IMPORTED_MODULE_1__["default"], 27069 minTranslate: _minTranslate_js__WEBPACK_IMPORTED_MODULE_2__["default"], 27070 maxTranslate: _maxTranslate_js__WEBPACK_IMPORTED_MODULE_3__["default"], 27071 translateTo: _translateTo_js__WEBPACK_IMPORTED_MODULE_4__["default"] 27072}); 27073 27074/***/ }), 27075
vendor: 637 bytes, lines 27076-27091
27076/***/ "./node_modules/swiper/core/translate/maxTranslate.js": 27077/*!************************************************************!*\ 27078 !*** ./node_modules/swiper/core/translate/maxTranslate.js ***! 27079 \************************************************************/ 27080/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27081 27082"use strict"; 27083/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27084/* harmony export */ "default": function() { return /* binding */ maxTranslate; } 27085/* harmony export */ }); 27086function maxTranslate() { 27087 return -this.snapGrid[this.snapGrid.length - 1]; 27088} 27089 27090/***/ }), 27091
vendor: 614 bytes, lines 27092-27107
27092/***/ "./node_modules/swiper/core/translate/minTranslate.js": 27093/*!************************************************************!*\ 27094 !*** ./node_modules/swiper/core/translate/minTranslate.js ***! 27095 \************************************************************/ 27096/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27097 27098"use strict"; 27099/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27100/* harmony export */ "default": function() { return /* binding */ minTranslate; } 27101/* harmony export */ }); 27102function minTranslate() { 27103 return -this.snapGrid[0]; 27104} 27105 27106/***/ }), 27107
vendor: 1,707 bytes, lines 27108-27168
27108/***/ "./node_modules/swiper/core/translate/setTranslate.js": 27109/*!************************************************************!*\ 27110 !*** ./node_modules/swiper/core/translate/setTranslate.js ***! 27111 \************************************************************/ 27112/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27113 27114"use strict"; 27115/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27116/* harmony export */ "default": function() { return /* binding */ setTranslate; } 27117/* harmony export */ }); 27118function setTranslate(translate, byController) { 27119 const swiper = this; 27120 const { 27121 rtlTranslate: rtl, 27122 params, 27123 $wrapperEl, 27124 wrapperEl, 27125 progress 27126 } = swiper; 27127 let x = 0; 27128 let y = 0; 27129 const z = 0; 27130 27131 if (swiper.isHorizontal()) { 27132 x = rtl ? -translate : translate; 27133 } else { 27134 y = translate; 27135 } 27136 27137 if (params.roundLengths) { 27138 x = Math.floor(x); 27139 y = Math.floor(y); 27140 } 27141 27142 if (params.cssMode) { 27143 wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y; 27144 } else if (!params.virtualTranslate) { 27145 $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`); 27146 } 27147 27148 swiper.previousTranslate = swiper.translate; 27149 swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress 27150 27151 let newProgress; 27152 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 27153 27154 if (translatesDiff === 0) { 27155 newProgress = 0; 27156 } else { 27157 newProgress = (translate - swiper.minTranslate()) / translatesDiff; 27158 } 27159 27160 if (newProgress !== progress) { 27161 swiper.updateProgress(translate); 27162 } 27163 27164 swiper.emit('setTranslate', swiper.translate, byController); 27165} 27166 27167/***/ }), 27168
vendor: 3,345 bytes, lines 27169-27267
27169/***/ "./node_modules/swiper/core/translate/translateTo.js": 27170/*!***********************************************************!*\ 27171 !*** ./node_modules/swiper/core/translate/translateTo.js ***! 27172 \***********************************************************/ 27173/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27174 27175"use strict"; 27176/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27177/* harmony export */ "default": function() { return /* binding */ translateTo; } 27178/* harmony export */ }); 27179/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 27180 27181function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) { 27182 const swiper = this; 27183 const { 27184 params, 27185 wrapperEl 27186 } = swiper; 27187 27188 if (swiper.animating && params.preventInteractionOnTransition) { 27189 return false; 27190 } 27191 27192 const minTranslate = swiper.minTranslate(); 27193 const maxTranslate = swiper.maxTranslate(); 27194 let newTranslate; 27195 if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress 27196 27197 swiper.updateProgress(newTranslate); 27198 27199 if (params.cssMode) { 27200 const isH = swiper.isHorizontal(); 27201 27202 if (speed === 0) { 27203 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate; 27204 } else { 27205 if (!swiper.support.smoothScroll) { 27206 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.animateCSSModeScroll)({ 27207 swiper, 27208 targetPosition: -newTranslate, 27209 side: isH ? 'left' : 'top' 27210 }); 27211 return true; 27212 } 27213 27214 wrapperEl.scrollTo({ 27215 [isH ? 'left' : 'top']: -newTranslate, 27216 behavior: 'smooth' 27217 }); 27218 } 27219 27220 return true; 27221 } 27222 27223 if (speed === 0) { 27224 swiper.setTransition(0); 27225 swiper.setTranslate(newTranslate); 27226 27227 if (runCallbacks) { 27228 swiper.emit('beforeTransitionStart', speed, internal); 27229 swiper.emit('transitionEnd'); 27230 } 27231 } else { 27232 swiper.setTransition(speed); 27233 swiper.setTranslate(newTranslate); 27234 27235 if (runCallbacks) { 27236 swiper.emit('beforeTransitionStart', speed, internal); 27237 swiper.emit('transitionStart'); 27238 } 27239 27240 if (!swiper.animating) { 27241 swiper.animating = true; 27242 27243 if (!swiper.onTranslateToWrapperTransitionEnd) { 27244 swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) { 27245 if (!swiper || swiper.destroyed) return; 27246 if (e.target !== this) return; 27247 swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 27248 swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); 27249 swiper.onTranslateToWrapperTransitionEnd = null; 27250 delete swiper.onTranslateToWrapperTransitionEnd; 27251 27252 if (runCallbacks) { 27253 swiper.emit('transitionEnd'); 27254 } 27255 }; 27256 } 27257 27258 swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 27259 swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd); 27260 } 27261 } 27262 27263 return true; 27264} 27265 27266/***/ }), 27267
vendor: 2,814 bytes, lines 27268-27306
27268/***/ "./node_modules/swiper/core/update/index.js": 27269/*!**************************************************!*\ 27270 !*** ./node_modules/swiper/core/update/index.js ***! 27271 \**************************************************/ 27272/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27273 27274"use strict"; 27275/* harmony import */ var _updateSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./updateSize.js */ "./node_modules/swiper/core/update/updateSize.js"); 27276/* harmony import */ var _updateSlides_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./updateSlides.js */ "./node_modules/swiper/core/update/updateSlides.js"); 27277/* harmony import */ var _updateAutoHeight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./updateAutoHeight.js */ "./node_modules/swiper/core/update/updateAutoHeight.js"); 27278/* harmony import */ var _updateSlidesOffset_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./updateSlidesOffset.js */ "./node_modules/swiper/core/update/updateSlidesOffset.js"); 27279/* harmony import */ var _updateSlidesProgress_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./updateSlidesProgress.js */ "./node_modules/swiper/core/update/updateSlidesProgress.js"); 27280/* harmony import */ var _updateProgress_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./updateProgress.js */ "./node_modules/swiper/core/update/updateProgress.js"); 27281/* harmony import */ var _updateSlidesClasses_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./updateSlidesClasses.js */ "./node_modules/swiper/core/update/updateSlidesClasses.js"); 27282/* harmony import */ var _updateActiveIndex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./updateActiveIndex.js */ "./node_modules/swiper/core/update/updateActiveIndex.js"); 27283/* harmony import */ var _updateClickedSlide_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./updateClickedSlide.js */ "./node_modules/swiper/core/update/updateClickedSlide.js"); 27284 27285 27286 27287 27288 27289 27290 27291 27292 27293/* harmony default export */ __webpack_exports__["default"] = ({ 27294 updateSize: _updateSize_js__WEBPACK_IMPORTED_MODULE_0__["default"], 27295 updateSlides: _updateSlides_js__WEBPACK_IMPORTED_MODULE_1__["default"], 27296 updateAutoHeight: _updateAutoHeight_js__WEBPACK_IMPORTED_MODULE_2__["default"], 27297 updateSlidesOffset: _updateSlidesOffset_js__WEBPACK_IMPORTED_MODULE_3__["default"], 27298 updateSlidesProgress: _updateSlidesProgress_js__WEBPACK_IMPORTED_MODULE_4__["default"], 27299 updateProgress: _updateProgress_js__WEBPACK_IMPORTED_MODULE_5__["default"], 27300 updateSlidesClasses: _updateSlidesClasses_js__WEBPACK_IMPORTED_MODULE_6__["default"], 27301 updateActiveIndex: _updateActiveIndex_js__WEBPACK_IMPORTED_MODULE_7__["default"], 27302 updateClickedSlide: _updateClickedSlide_js__WEBPACK_IMPORTED_MODULE_8__["default"] 27303}); 27304 27305/***/ }), 27306
vendor: 2,583 bytes, lines 27307-27389
27307/***/ "./node_modules/swiper/core/update/updateActiveIndex.js": 27308/*!**************************************************************!*\ 27309 !*** ./node_modules/swiper/core/update/updateActiveIndex.js ***! 27310 \**************************************************************/ 27311/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27312 27313"use strict"; 27314/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27315/* harmony export */ "default": function() { return /* binding */ updateActiveIndex; } 27316/* harmony export */ }); 27317function updateActiveIndex(newActiveIndex) { 27318 const swiper = this; 27319 const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 27320 const { 27321 slidesGrid, 27322 snapGrid, 27323 params, 27324 activeIndex: previousIndex, 27325 realIndex: previousRealIndex, 27326 snapIndex: previousSnapIndex 27327 } = swiper; 27328 let activeIndex = newActiveIndex; 27329 let snapIndex; 27330 27331 if (typeof activeIndex === 'undefined') { 27332 for (let i = 0; i < slidesGrid.length; i += 1) { 27333 if (typeof slidesGrid[i + 1] !== 'undefined') { 27334 if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) { 27335 activeIndex = i; 27336 } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) { 27337 activeIndex = i + 1; 27338 } 27339 } else if (translate >= slidesGrid[i]) { 27340 activeIndex = i; 27341 } 27342 } // Normalize slideIndex 27343 27344 27345 if (params.normalizeSlideIndex) { 27346 if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0; 27347 } 27348 } 27349 27350 if (snapGrid.indexOf(translate) >= 0) { 27351 snapIndex = snapGrid.indexOf(translate); 27352 } else { 27353 const skip = Math.min(params.slidesPerGroupSkip, activeIndex); 27354 snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup); 27355 } 27356 27357 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 27358 27359 if (activeIndex === previousIndex) { 27360 if (snapIndex !== previousSnapIndex) { 27361 swiper.snapIndex = snapIndex; 27362 swiper.emit('snapIndexChange'); 27363 } 27364 27365 return; 27366 } // Get real index 27367 27368 27369 const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10); 27370 Object.assign(swiper, { 27371 snapIndex, 27372 realIndex, 27373 previousIndex, 27374 activeIndex 27375 }); 27376 swiper.emit('activeIndexChange'); 27377 swiper.emit('snapIndexChange'); 27378 27379 if (previousRealIndex !== realIndex) { 27380 swiper.emit('realIndexChange'); 27381 } 27382 27383 if (swiper.initialized || swiper.params.runCallbacksOnInit) { 27384 swiper.emit('slideChange'); 27385 } 27386} 27387 27388/***/ }), 27389
vendor: 2,304 bytes, lines 27390-27453
27390/***/ "./node_modules/swiper/core/update/updateAutoHeight.js": 27391/*!*************************************************************!*\ 27392 !*** ./node_modules/swiper/core/update/updateAutoHeight.js ***! 27393 \*************************************************************/ 27394/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27395 27396"use strict"; 27397/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27398/* harmony export */ "default": function() { return /* binding */ updateAutoHeight; } 27399/* harmony export */ }); 27400/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 27401 27402function updateAutoHeight(speed) { 27403 const swiper = this; 27404 const activeSlides = []; 27405 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 27406 let newHeight = 0; 27407 let i; 27408 27409 if (typeof speed === 'number') { 27410 swiper.setTransition(speed); 27411 } else if (speed === true) { 27412 swiper.setTransition(swiper.params.speed); 27413 } 27414 27415 const getSlideByIndex = index => { 27416 if (isVirtual) { 27417 return swiper.slides.filter(el => parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index)[0]; 27418 } 27419 27420 return swiper.slides.eq(index)[0]; 27421 }; // Find slides currently in view 27422 27423 27424 if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) { 27425 if (swiper.params.centeredSlides) { 27426 (swiper.visibleSlides || (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])([])).each(slide => { 27427 activeSlides.push(slide); 27428 }); 27429 } else { 27430 for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) { 27431 const index = swiper.activeIndex + i; 27432 if (index > swiper.slides.length && !isVirtual) break; 27433 activeSlides.push(getSlideByIndex(index)); 27434 } 27435 } 27436 } else { 27437 activeSlides.push(getSlideByIndex(swiper.activeIndex)); 27438 } // Find new height from highest slide in view 27439 27440 27441 for (i = 0; i < activeSlides.length; i += 1) { 27442 if (typeof activeSlides[i] !== 'undefined') { 27443 const height = activeSlides[i].offsetHeight; 27444 newHeight = height > newHeight ? height : newHeight; 27445 } 27446 } // Update Height 27447 27448 27449 if (newHeight || newHeight === 0) swiper.$wrapperEl.css('height', `${newHeight}px`); 27450} 27451 27452/***/ }), 27453
vendor: 1,762 bytes, lines 27454-27503
27454/***/ "./node_modules/swiper/core/update/updateClickedSlide.js": 27455/*!***************************************************************!*\ 27456 !*** ./node_modules/swiper/core/update/updateClickedSlide.js ***! 27457 \***************************************************************/ 27458/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27459 27460"use strict"; 27461/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27462/* harmony export */ "default": function() { return /* binding */ updateClickedSlide; } 27463/* harmony export */ }); 27464/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 27465 27466function updateClickedSlide(e) { 27467 const swiper = this; 27468 const params = swiper.params; 27469 const slide = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e).closest(`.${params.slideClass}`)[0]; 27470 let slideFound = false; 27471 let slideIndex; 27472 27473 if (slide) { 27474 for (let i = 0; i < swiper.slides.length; i += 1) { 27475 if (swiper.slides[i] === slide) { 27476 slideFound = true; 27477 slideIndex = i; 27478 break; 27479 } 27480 } 27481 } 27482 27483 if (slide && slideFound) { 27484 swiper.clickedSlide = slide; 27485 27486 if (swiper.virtual && swiper.params.virtual.enabled) { 27487 swiper.clickedIndex = parseInt((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(slide).attr('data-swiper-slide-index'), 10); 27488 } else { 27489 swiper.clickedIndex = slideIndex; 27490 } 27491 } else { 27492 swiper.clickedSlide = undefined; 27493 swiper.clickedIndex = undefined; 27494 return; 27495 } 27496 27497 if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) { 27498 swiper.slideToClickedSlide(); 27499 } 27500} 27501 27502/***/ }), 27503
vendor: 1,768 bytes, lines 27504-27566
27504/***/ "./node_modules/swiper/core/update/updateProgress.js": 27505/*!***********************************************************!*\ 27506 !*** ./node_modules/swiper/core/update/updateProgress.js ***! 27507 \***********************************************************/ 27508/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27509 27510"use strict"; 27511/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27512/* harmony export */ "default": function() { return /* binding */ updateProgress; } 27513/* harmony export */ }); 27514function updateProgress(translate) { 27515 const swiper = this; 27516 27517 if (typeof translate === 'undefined') { 27518 const multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line 27519 27520 translate = swiper && swiper.translate && swiper.translate * multiplier || 0; 27521 } 27522 27523 const params = swiper.params; 27524 const translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 27525 let { 27526 progress, 27527 isBeginning, 27528 isEnd 27529 } = swiper; 27530 const wasBeginning = isBeginning; 27531 const wasEnd = isEnd; 27532 27533 if (translatesDiff === 0) { 27534 progress = 0; 27535 isBeginning = true; 27536 isEnd = true; 27537 } else { 27538 progress = (translate - swiper.minTranslate()) / translatesDiff; 27539 isBeginning = progress <= 0; 27540 isEnd = progress >= 1; 27541 } 27542 27543 Object.assign(swiper, { 27544 progress, 27545 isBeginning, 27546 isEnd 27547 }); 27548 if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate); 27549 27550 if (isBeginning && !wasBeginning) { 27551 swiper.emit('reachBeginning toEdge'); 27552 } 27553 27554 if (isEnd && !wasEnd) { 27555 swiper.emit('reachEnd toEdge'); 27556 } 27557 27558 if (wasBeginning && !isBeginning || wasEnd && !isEnd) { 27559 swiper.emit('fromEdge'); 27560 } 27561 27562 swiper.emit('progress', progress); 27563} 27564 27565/***/ }), 27566
vendor: 1,499 bytes, lines 27567-27612
27567/***/ "./node_modules/swiper/core/update/updateSize.js": 27568/*!*******************************************************!*\ 27569 !*** ./node_modules/swiper/core/update/updateSize.js ***! 27570 \*******************************************************/ 27571/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27572 27573"use strict"; 27574/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27575/* harmony export */ "default": function() { return /* binding */ updateSize; } 27576/* harmony export */ }); 27577function updateSize() { 27578 const swiper = this; 27579 let width; 27580 let height; 27581 const $el = swiper.$el; 27582 27583 if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) { 27584 width = swiper.params.width; 27585 } else { 27586 width = $el[0].clientWidth; 27587 } 27588 27589 if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) { 27590 height = swiper.params.height; 27591 } else { 27592 height = $el[0].clientHeight; 27593 } 27594 27595 if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) { 27596 return; 27597 } // Subtract paddings 27598 27599 27600 width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10); 27601 height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10); 27602 if (Number.isNaN(width)) width = 0; 27603 if (Number.isNaN(height)) height = 0; 27604 Object.assign(swiper, { 27605 width, 27606 height, 27607 size: swiper.isHorizontal() ? width : height 27608 }); 27609} 27610 27611/***/ }), 27612
vendor: 11,355 bytes, lines 27613-27946
27613/***/ "./node_modules/swiper/core/update/updateSlides.js": 27614/*!*********************************************************!*\ 27615 !*** ./node_modules/swiper/core/update/updateSlides.js ***! 27616 \*********************************************************/ 27617/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27618 27619"use strict"; 27620/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27621/* harmony export */ "default": function() { return /* binding */ updateSlides; } 27622/* harmony export */ }); 27623/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 27624 27625function updateSlides() { 27626 const swiper = this; 27627 27628 function getDirectionLabel(property) { 27629 if (swiper.isHorizontal()) { 27630 return property; 27631 } // prettier-ignore 27632 27633 27634 return { 27635 'width': 'height', 27636 'margin-top': 'margin-left', 27637 'margin-bottom ': 'margin-right', 27638 'margin-left': 'margin-top', 27639 'margin-right': 'margin-bottom', 27640 'padding-left': 'padding-top', 27641 'padding-right': 'padding-bottom', 27642 'marginRight': 'marginBottom' 27643 }[property]; 27644 } 27645 27646 function getDirectionPropertyValue(node, label) { 27647 return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0); 27648 } 27649 27650 const params = swiper.params; 27651 const { 27652 $wrapperEl, 27653 size: swiperSize, 27654 rtlTranslate: rtl, 27655 wrongRTL 27656 } = swiper; 27657 const isVirtual = swiper.virtual && params.virtual.enabled; 27658 const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length; 27659 const slides = $wrapperEl.children(`.${swiper.params.slideClass}`); 27660 const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length; 27661 let snapGrid = []; 27662 const slidesGrid = []; 27663 const slidesSizesGrid = []; 27664 let offsetBefore = params.slidesOffsetBefore; 27665 27666 if (typeof offsetBefore === 'function') { 27667 offsetBefore = params.slidesOffsetBefore.call(swiper); 27668 } 27669 27670 let offsetAfter = params.slidesOffsetAfter; 27671 27672 if (typeof offsetAfter === 'function') { 27673 offsetAfter = params.slidesOffsetAfter.call(swiper); 27674 } 27675 27676 const previousSnapGridLength = swiper.snapGrid.length; 27677 const previousSlidesGridLength = swiper.slidesGrid.length; 27678 let spaceBetween = params.spaceBetween; 27679 let slidePosition = -offsetBefore; 27680 let prevSlideSize = 0; 27681 let index = 0; 27682 27683 if (typeof swiperSize === 'undefined') { 27684 return; 27685 } 27686 27687 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 27688 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize; 27689 } 27690 27691 swiper.virtualSize = -spaceBetween; // reset margins 27692 27693 if (rtl) slides.css({ 27694 marginLeft: '', 27695 marginBottom: '', 27696 marginTop: '' 27697 });else slides.css({ 27698 marginRight: '', 27699 marginBottom: '', 27700 marginTop: '' 27701 }); // reset cssMode offsets 27702 27703 if (params.centeredSlides && params.cssMode) { 27704 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.setCSSProperty)(swiper.wrapperEl, '--swiper-centered-offset-before', ''); 27705 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.setCSSProperty)(swiper.wrapperEl, '--swiper-centered-offset-after', ''); 27706 } 27707 27708 const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid; 27709 27710 if (gridEnabled) { 27711 swiper.grid.initSlides(slidesLength); 27712 } // Calc slides 27713 27714 27715 let slideSize; 27716 const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => { 27717 return typeof params.breakpoints[key].slidesPerView !== 'undefined'; 27718 }).length > 0; 27719 27720 for (let i = 0; i < slidesLength; i += 1) { 27721 slideSize = 0; 27722 const slide = slides.eq(i); 27723 27724 if (gridEnabled) { 27725 swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel); 27726 } 27727 27728 if (slide.css('display') === 'none') continue; // eslint-disable-line 27729 27730 if (params.slidesPerView === 'auto') { 27731 if (shouldResetSlideSize) { 27732 slides[i].style[getDirectionLabel('width')] = ``; 27733 } 27734 27735 const slideStyles = getComputedStyle(slide[0]); 27736 const currentTransform = slide[0].style.transform; 27737 const currentWebKitTransform = slide[0].style.webkitTransform; 27738 27739 if (currentTransform) { 27740 slide[0].style.transform = 'none'; 27741 } 27742 27743 if (currentWebKitTransform) { 27744 slide[0].style.webkitTransform = 'none'; 27745 } 27746 27747 if (params.roundLengths) { 27748 slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true); 27749 } else { 27750 // eslint-disable-next-line 27751 const width = getDirectionPropertyValue(slideStyles, 'width'); 27752 const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left'); 27753 const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right'); 27754 const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left'); 27755 const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right'); 27756 const boxSizing = slideStyles.getPropertyValue('box-sizing'); 27757 27758 if (boxSizing && boxSizing === 'border-box') { 27759 slideSize = width + marginLeft + marginRight; 27760 } else { 27761 const { 27762 clientWidth, 27763 offsetWidth 27764 } = slide[0]; 27765 slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth); 27766 } 27767 } 27768 27769 if (currentTransform) { 27770 slide[0].style.transform = currentTransform; 27771 } 27772 27773 if (currentWebKitTransform) { 27774 slide[0].style.webkitTransform = currentWebKitTransform; 27775 } 27776 27777 if (params.roundLengths) slideSize = Math.floor(slideSize); 27778 } else { 27779 slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView; 27780 if (params.roundLengths) slideSize = Math.floor(slideSize); 27781 27782 if (slides[i]) { 27783 slides[i].style[getDirectionLabel('width')] = `${slideSize}px`; 27784 } 27785 } 27786 27787 if (slides[i]) { 27788 slides[i].swiperSlideSize = slideSize; 27789 } 27790 27791 slidesSizesGrid.push(slideSize); 27792 27793 if (params.centeredSlides) { 27794 slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; 27795 if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 27796 if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 27797 if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; 27798 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 27799 if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition); 27800 slidesGrid.push(slidePosition); 27801 } else { 27802 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 27803 if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition); 27804 slidesGrid.push(slidePosition); 27805 slidePosition = slidePosition + slideSize + spaceBetween; 27806 } 27807 27808 swiper.virtualSize += slideSize + spaceBetween; 27809 prevSlideSize = slideSize; 27810 index += 1; 27811 } 27812 27813 swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter; 27814 27815 if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) { 27816 $wrapperEl.css({ 27817 width: `${swiper.virtualSize + params.spaceBetween}px` 27818 }); 27819 } 27820 27821 if (params.setWrapperSize) { 27822 $wrapperEl.css({ 27823 [getDirectionLabel('width')]: `${swiper.virtualSize + params.spaceBetween}px` 27824 }); 27825 } 27826 27827 if (gridEnabled) { 27828 swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel); 27829 } // Remove last grid elements depending on width 27830 27831 27832 if (!params.centeredSlides) { 27833 const newSlidesGrid = []; 27834 27835 for (let i = 0; i < snapGrid.length; i += 1) { 27836 let slidesGridItem = snapGrid[i]; 27837 if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem); 27838 27839 if (snapGrid[i] <= swiper.virtualSize - swiperSize) { 27840 newSlidesGrid.push(slidesGridItem); 27841 } 27842 } 27843 27844 snapGrid = newSlidesGrid; 27845 27846 if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) { 27847 snapGrid.push(swiper.virtualSize - swiperSize); 27848 } 27849 } 27850 27851 if (snapGrid.length === 0) snapGrid = [0]; 27852 27853 if (params.spaceBetween !== 0) { 27854 const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight'); 27855 slides.filter((_, slideIndex) => { 27856 if (!params.cssMode) return true; 27857 27858 if (slideIndex === slides.length - 1) { 27859 return false; 27860 } 27861 27862 return true; 27863 }).css({ 27864 [key]: `${spaceBetween}px` 27865 }); 27866 } 27867 27868 if (params.centeredSlides && params.centeredSlidesBounds) { 27869 let allSlidesSize = 0; 27870 slidesSizesGrid.forEach(slideSizeValue => { 27871 allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); 27872 }); 27873 allSlidesSize -= params.spaceBetween; 27874 const maxSnap = allSlidesSize - swiperSize; 27875 snapGrid = snapGrid.map(snap => { 27876 if (snap < 0) return -offsetBefore; 27877 if (snap > maxSnap) return maxSnap + offsetAfter; 27878 return snap; 27879 }); 27880 } 27881 27882 if (params.centerInsufficientSlides) { 27883 let allSlidesSize = 0; 27884 slidesSizesGrid.forEach(slideSizeValue => { 27885 allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0); 27886 }); 27887 allSlidesSize -= params.spaceBetween; 27888 27889 if (allSlidesSize < swiperSize) { 27890 const allSlidesOffset = (swiperSize - allSlidesSize) / 2; 27891 snapGrid.forEach((snap, snapIndex) => { 27892 snapGrid[snapIndex] = snap - allSlidesOffset; 27893 }); 27894 slidesGrid.forEach((snap, snapIndex) => { 27895 slidesGrid[snapIndex] = snap + allSlidesOffset; 27896 }); 27897 } 27898 } 27899 27900 Object.assign(swiper, { 27901 slides, 27902 snapGrid, 27903 slidesGrid, 27904 slidesSizesGrid 27905 }); 27906 27907 if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) { 27908 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.setCSSProperty)(swiper.wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`); 27909 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.setCSSProperty)(swiper.wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`); 27910 const addToSnapGrid = -swiper.snapGrid[0]; 27911 const addToSlidesGrid = -swiper.slidesGrid[0]; 27912 swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid); 27913 swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid); 27914 } 27915 27916 if (slidesLength !== previousSlidesLength) { 27917 swiper.emit('slidesLengthChange'); 27918 } 27919 27920 if (snapGrid.length !== previousSnapGridLength) { 27921 if (swiper.params.watchOverflow) swiper.checkOverflow(); 27922 swiper.emit('snapGridLengthChange'); 27923 } 27924 27925 if (slidesGrid.length !== previousSlidesGridLength) { 27926 swiper.emit('slidesGridLengthChange'); 27927 } 27928 27929 if (params.watchSlidesProgress) { 27930 swiper.updateSlidesOffset(); 27931 } 27932 27933 if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) { 27934 const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`; 27935 const hasClassBackfaceClassAdded = swiper.$el.hasClass(backFaceHiddenClass); 27936 27937 if (slidesLength <= params.maxBackfaceHiddenSlides) { 27938 if (!hasClassBackfaceClassAdded) swiper.$el.addClass(backFaceHiddenClass); 27939 } else if (hasClassBackfaceClassAdded) { 27940 swiper.$el.removeClass(backFaceHiddenClass); 27941 } 27942 } 27943} 27944 27945/***/ }), 27946
vendor: 3,292 bytes, lines 27947-28023
27947/***/ "./node_modules/swiper/core/update/updateSlidesClasses.js": 27948/*!****************************************************************!*\ 27949 !*** ./node_modules/swiper/core/update/updateSlidesClasses.js ***! 27950 \****************************************************************/ 27951/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 27952 27953"use strict"; 27954/* harmony export */ __webpack_require__.d(__webpack_exports__, { 27955/* harmony export */ "default": function() { return /* binding */ updateSlidesClasses; } 27956/* harmony export */ }); 27957function updateSlidesClasses() { 27958 const swiper = this; 27959 const { 27960 slides, 27961 params, 27962 $wrapperEl, 27963 activeIndex, 27964 realIndex 27965 } = swiper; 27966 const isVirtual = swiper.virtual && params.virtual.enabled; 27967 slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`); 27968 let activeSlide; 27969 27970 if (isVirtual) { 27971 activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`); 27972 } else { 27973 activeSlide = slides.eq(activeIndex); 27974 } // Active classes 27975 27976 27977 activeSlide.addClass(params.slideActiveClass); 27978 27979 if (params.loop) { 27980 // Duplicate to all looped slides 27981 if (activeSlide.hasClass(params.slideDuplicateClass)) { 27982 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); 27983 } else { 27984 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass); 27985 } 27986 } // Next Slide 27987 27988 27989 let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass); 27990 27991 if (params.loop && nextSlide.length === 0) { 27992 nextSlide = slides.eq(0); 27993 nextSlide.addClass(params.slideNextClass); 27994 } // Prev Slide 27995 27996 27997 let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass); 27998 27999 if (params.loop && prevSlide.length === 0) { 28000 prevSlide = slides.eq(-1); 28001 prevSlide.addClass(params.slidePrevClass); 28002 } 28003 28004 if (params.loop) { 28005 // Duplicate to all looped slides 28006 if (nextSlide.hasClass(params.slideDuplicateClass)) { 28007 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); 28008 } else { 28009 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass); 28010 } 28011 28012 if (prevSlide.hasClass(params.slideDuplicateClass)) { 28013 $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); 28014 } else { 28015 $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass); 28016 } 28017 } 28018 28019 swiper.emitSlidesClasses(); 28020} 28021 28022/***/ }), 28023
vendor: 819 bytes, lines 28024-28044
28024/***/ "./node_modules/swiper/core/update/updateSlidesOffset.js": 28025/*!***************************************************************!*\ 28026 !*** ./node_modules/swiper/core/update/updateSlidesOffset.js ***! 28027 \***************************************************************/ 28028/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28029 28030"use strict"; 28031/* harmony export */ __webpack_require__.d(__webpack_exports__, { 28032/* harmony export */ "default": function() { return /* binding */ updateSlidesOffset; } 28033/* harmony export */ }); 28034function updateSlidesOffset() { 28035 const swiper = this; 28036 const slides = swiper.slides; 28037 28038 for (let i = 0; i < slides.length; i += 1) { 28039 slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop; 28040 } 28041} 28042 28043/***/ }), 28044
vendor: 2,551 bytes, lines 28045-28102
28045/***/ "./node_modules/swiper/core/update/updateSlidesProgress.js": 28046/*!*****************************************************************!*\ 28047 !*** ./node_modules/swiper/core/update/updateSlidesProgress.js ***! 28048 \*****************************************************************/ 28049/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28050 28051"use strict"; 28052/* harmony export */ __webpack_require__.d(__webpack_exports__, { 28053/* harmony export */ "default": function() { return /* binding */ updateSlidesProgress; } 28054/* harmony export */ }); 28055/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 28056 28057function updateSlidesProgress(translate = this && this.translate || 0) { 28058 const swiper = this; 28059 const params = swiper.params; 28060 const { 28061 slides, 28062 rtlTranslate: rtl, 28063 snapGrid 28064 } = swiper; 28065 if (slides.length === 0) return; 28066 if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset(); 28067 let offsetCenter = -translate; 28068 if (rtl) offsetCenter = translate; // Visible Slides 28069 28070 slides.removeClass(params.slideVisibleClass); 28071 swiper.visibleSlidesIndexes = []; 28072 swiper.visibleSlides = []; 28073 28074 for (let i = 0; i < slides.length; i += 1) { 28075 const slide = slides[i]; 28076 let slideOffset = slide.swiperSlideOffset; 28077 28078 if (params.cssMode && params.centeredSlides) { 28079 slideOffset -= slides[0].swiperSlideOffset; 28080 } 28081 28082 const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); 28083 const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween); 28084 const slideBefore = -(offsetCenter - slideOffset); 28085 const slideAfter = slideBefore + swiper.slidesSizesGrid[i]; 28086 const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size; 28087 28088 if (isVisible) { 28089 swiper.visibleSlides.push(slide); 28090 swiper.visibleSlidesIndexes.push(i); 28091 slides.eq(i).addClass(params.slideVisibleClass); 28092 } 28093 28094 slide.progress = rtl ? -slideProgress : slideProgress; 28095 slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress; 28096 } 28097 28098 swiper.visibleSlides = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper.visibleSlides); 28099} 28100 28101/***/ }), 28102
vendor: 10,897 bytes, lines 28103-28466
28103/***/ "./node_modules/swiper/modules/a11y/a11y.js": 28104/*!**************************************************!*\ 28105 !*** ./node_modules/swiper/modules/a11y/a11y.js ***! 28106 \**************************************************/ 28107/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28108 28109"use strict"; 28110/* unused harmony export default */ 28111/* harmony import */ var _shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/classes-to-selector.js */ "./node_modules/swiper/shared/classes-to-selector.js"); 28112/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 28113 28114 28115function A11y({ 28116 swiper, 28117 extendParams, 28118 on 28119}) { 28120 extendParams({ 28121 a11y: { 28122 enabled: true, 28123 notificationClass: 'swiper-notification', 28124 prevSlideMessage: 'Previous slide', 28125 nextSlideMessage: 'Next slide', 28126 firstSlideMessage: 'This is the first slide', 28127 lastSlideMessage: 'This is the last slide', 28128 paginationBulletMessage: 'Go to slide {{index}}', 28129 slideLabelMessage: '{{index}} / {{slidesLength}}', 28130 containerMessage: null, 28131 containerRoleDescriptionMessage: null, 28132 itemRoleDescriptionMessage: null, 28133 slideRole: 'group', 28134 id: null 28135 } 28136 }); 28137 swiper.a11y = { 28138 clicked: false 28139 }; 28140 let liveRegion = null; 28141 28142 function notify(message) { 28143 const notification = liveRegion; 28144 if (notification.length === 0) return; 28145 notification.html(''); 28146 notification.html(message); 28147 } 28148 28149 function getRandomNumber(size = 16) { 28150 const randomChar = () => Math.round(16 * Math.random()).toString(16); 28151 28152 return 'x'.repeat(size).replace(/x/g, randomChar); 28153 } 28154 28155 function makeElFocusable($el) { 28156 $el.attr('tabIndex', '0'); 28157 } 28158 28159 function makeElNotFocusable($el) { 28160 $el.attr('tabIndex', '-1'); 28161 } 28162 28163 function addElRole($el, role) { 28164 $el.attr('role', role); 28165 } 28166 28167 function addElRoleDescription($el, description) { 28168 $el.attr('aria-roledescription', description); 28169 } 28170 28171 function addElControls($el, controls) { 28172 $el.attr('aria-controls', controls); 28173 } 28174 28175 function addElLabel($el, label) { 28176 $el.attr('aria-label', label); 28177 } 28178 28179 function addElId($el, id) { 28180 $el.attr('id', id); 28181 } 28182 28183 function addElLive($el, live) { 28184 $el.attr('aria-live', live); 28185 } 28186 28187 function disableEl($el) { 28188 $el.attr('aria-disabled', true); 28189 } 28190 28191 function enableEl($el) { 28192 $el.attr('aria-disabled', false); 28193 } 28194 28195 function onEnterOrSpaceKey(e) { 28196 if (e.keyCode !== 13 && e.keyCode !== 32) return; 28197 const params = swiper.params.a11y; 28198 const $targetEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target); 28199 28200 if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) { 28201 if (!(swiper.isEnd && !swiper.params.loop)) { 28202 swiper.slideNext(); 28203 } 28204 28205 if (swiper.isEnd) { 28206 notify(params.lastSlideMessage); 28207 } else { 28208 notify(params.nextSlideMessage); 28209 } 28210 } 28211 28212 if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) { 28213 if (!(swiper.isBeginning && !swiper.params.loop)) { 28214 swiper.slidePrev(); 28215 } 28216 28217 if (swiper.isBeginning) { 28218 notify(params.firstSlideMessage); 28219 } else { 28220 notify(params.prevSlideMessage); 28221 } 28222 } 28223 28224 if (swiper.pagination && $targetEl.is((0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper.params.pagination.bulletClass))) { 28225 $targetEl[0].click(); 28226 } 28227 } 28228 28229 function updateNavigation() { 28230 if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; 28231 const { 28232 $nextEl, 28233 $prevEl 28234 } = swiper.navigation; 28235 28236 if ($prevEl && $prevEl.length > 0) { 28237 if (swiper.isBeginning) { 28238 disableEl($prevEl); 28239 makeElNotFocusable($prevEl); 28240 } else { 28241 enableEl($prevEl); 28242 makeElFocusable($prevEl); 28243 } 28244 } 28245 28246 if ($nextEl && $nextEl.length > 0) { 28247 if (swiper.isEnd) { 28248 disableEl($nextEl); 28249 makeElNotFocusable($nextEl); 28250 } else { 28251 enableEl($nextEl); 28252 makeElFocusable($nextEl); 28253 } 28254 } 28255 } 28256 28257 function hasPagination() { 28258 return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; 28259 } 28260 28261 function hasClickablePagination() { 28262 return hasPagination() && swiper.params.pagination.clickable; 28263 } 28264 28265 function updatePagination() { 28266 const params = swiper.params.a11y; 28267 if (!hasPagination()) return; 28268 swiper.pagination.bullets.each(bulletEl => { 28269 const $bulletEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(bulletEl); 28270 28271 if (swiper.params.pagination.clickable) { 28272 makeElFocusable($bulletEl); 28273 28274 if (!swiper.params.pagination.renderBullet) { 28275 addElRole($bulletEl, 'button'); 28276 addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1)); 28277 } 28278 } 28279 28280 if ($bulletEl.is(`.${swiper.params.pagination.bulletActiveClass}`)) { 28281 $bulletEl.attr('aria-current', 'true'); 28282 } else { 28283 $bulletEl.removeAttr('aria-current'); 28284 } 28285 }); 28286 } 28287 28288 const initNavEl = ($el, wrapperId, message) => { 28289 makeElFocusable($el); 28290 28291 if ($el[0].tagName !== 'BUTTON') { 28292 addElRole($el, 'button'); 28293 $el.on('keydown', onEnterOrSpaceKey); 28294 } 28295 28296 addElLabel($el, message); 28297 addElControls($el, wrapperId); 28298 }; 28299 28300 const handlePointerDown = () => { 28301 swiper.a11y.clicked = true; 28302 }; 28303 28304 const handlePointerUp = () => { 28305 requestAnimationFrame(() => { 28306 requestAnimationFrame(() => { 28307 if (!swiper.destroyed) { 28308 swiper.a11y.clicked = false; 28309 } 28310 }); 28311 }); 28312 }; 28313 28314 const handleFocus = e => { 28315 if (swiper.a11y.clicked) return; 28316 const slideEl = e.target.closest(`.${swiper.params.slideClass}`); 28317 if (!slideEl || !swiper.slides.includes(slideEl)) return; 28318 const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex; 28319 const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl); 28320 if (isActive || isVisible) return; 28321 if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return; 28322 28323 if (swiper.isHorizontal()) { 28324 swiper.el.scrollLeft = 0; 28325 } else { 28326 swiper.el.scrollTop = 0; 28327 } 28328 28329 swiper.slideTo(swiper.slides.indexOf(slideEl), 0); 28330 }; 28331 28332 const initSlides = () => { 28333 const params = swiper.params.a11y; 28334 28335 if (params.itemRoleDescriptionMessage) { 28336 addElRoleDescription((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(swiper.slides), params.itemRoleDescriptionMessage); 28337 } 28338 28339 if (params.slideRole) { 28340 addElRole((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(swiper.slides), params.slideRole); 28341 } 28342 28343 const slidesLength = swiper.params.loop ? swiper.slides.filter(el => !el.classList.contains(swiper.params.slideDuplicateClass)).length : swiper.slides.length; 28344 28345 if (params.slideLabelMessage) { 28346 swiper.slides.each((slideEl, index) => { 28347 const $slideEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(slideEl); 28348 const slideIndex = swiper.params.loop ? parseInt($slideEl.attr('data-swiper-slide-index'), 10) : index; 28349 const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); 28350 addElLabel($slideEl, ariaLabelMessage); 28351 }); 28352 } 28353 }; 28354 28355 const init = () => { 28356 const params = swiper.params.a11y; 28357 swiper.$el.append(liveRegion); // Container 28358 28359 const $containerEl = swiper.$el; 28360 28361 if (params.containerRoleDescriptionMessage) { 28362 addElRoleDescription($containerEl, params.containerRoleDescriptionMessage); 28363 } 28364 28365 if (params.containerMessage) { 28366 addElLabel($containerEl, params.containerMessage); 28367 } // Wrapper 28368 28369 28370 const $wrapperEl = swiper.$wrapperEl; 28371 const wrapperId = params.id || $wrapperEl.attr('id') || `swiper-wrapper-${getRandomNumber(16)}`; 28372 const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; 28373 addElId($wrapperEl, wrapperId); 28374 addElLive($wrapperEl, live); // Slide 28375 28376 initSlides(); // Navigation 28377 28378 let $nextEl; 28379 let $prevEl; 28380 28381 if (swiper.navigation && swiper.navigation.$nextEl) { 28382 $nextEl = swiper.navigation.$nextEl; 28383 } 28384 28385 if (swiper.navigation && swiper.navigation.$prevEl) { 28386 $prevEl = swiper.navigation.$prevEl; 28387 } 28388 28389 if ($nextEl && $nextEl.length) { 28390 initNavEl($nextEl, wrapperId, params.nextSlideMessage); 28391 } 28392 28393 if ($prevEl && $prevEl.length) { 28394 initNavEl($prevEl, wrapperId, params.prevSlideMessage); 28395 } // Pagination 28396 28397 28398 if (hasClickablePagination()) { 28399 swiper.pagination.$el.on('keydown', (0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); 28400 } // Tab focus 28401 28402 28403 swiper.$el.on('focus', handleFocus, true); 28404 swiper.$el.on('pointerdown', handlePointerDown, true); 28405 swiper.$el.on('pointerup', handlePointerUp, true); 28406 }; 28407 28408 function destroy() { 28409 if (liveRegion && liveRegion.length > 0) liveRegion.remove(); 28410 let $nextEl; 28411 let $prevEl; 28412 28413 if (swiper.navigation && swiper.navigation.$nextEl) { 28414 $nextEl = swiper.navigation.$nextEl; 28415 } 28416 28417 if (swiper.navigation && swiper.navigation.$prevEl) { 28418 $prevEl = swiper.navigation.$prevEl; 28419 } 28420 28421 if ($nextEl) { 28422 $nextEl.off('keydown', onEnterOrSpaceKey); 28423 } 28424 28425 if ($prevEl) { 28426 $prevEl.off('keydown', onEnterOrSpaceKey); 28427 } // Pagination 28428 28429 28430 if (hasClickablePagination()) { 28431 swiper.pagination.$el.off('keydown', (0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); 28432 } // Tab focus 28433 28434 28435 swiper.$el.off('focus', handleFocus, true); 28436 swiper.$el.off('pointerdown', handlePointerDown, true); 28437 swiper.$el.off('pointerup', handlePointerUp, true); 28438 } 28439 28440 on('beforeInit', () => { 28441 liveRegion = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(`<span class="${swiper.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`); 28442 }); 28443 on('afterInit', () => { 28444 if (!swiper.params.a11y.enabled) return; 28445 init(); 28446 }); 28447 on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => { 28448 if (!swiper.params.a11y.enabled) return; 28449 initSlides(); 28450 }); 28451 on('fromEdge toEdge afterInit lock unlock', () => { 28452 if (!swiper.params.a11y.enabled) return; 28453 updateNavigation(); 28454 }); 28455 on('paginationUpdate', () => { 28456 if (!swiper.params.a11y.enabled) return; 28457 updatePagination(); 28458 }); 28459 on('destroy', () => { 28460 if (!swiper.params.a11y.enabled) return; 28461 destroy(); 28462 }); 28463} 28464 28465/***/ }), 28466
vendor: 6,929 bytes, lines 28467-28711
28467/***/ "./node_modules/swiper/modules/autoplay/autoplay.js": 28468/*!**********************************************************!*\ 28469 !*** ./node_modules/swiper/modules/autoplay/autoplay.js ***! 28470 \**********************************************************/ 28471/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28472 28473"use strict"; 28474/* harmony export */ __webpack_require__.d(__webpack_exports__, { 28475/* harmony export */ "default": function() { return /* binding */ Autoplay; } 28476/* harmony export */ }); 28477/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 28478/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 28479/* eslint no-underscore-dangle: "off" */ 28480 28481/* eslint no-use-before-define: "off" */ 28482 28483 28484function Autoplay({ 28485 swiper, 28486 extendParams, 28487 on, 28488 emit 28489}) { 28490 let timeout; 28491 swiper.autoplay = { 28492 running: false, 28493 paused: false 28494 }; 28495 extendParams({ 28496 autoplay: { 28497 enabled: false, 28498 delay: 3000, 28499 waitForTransition: true, 28500 disableOnInteraction: true, 28501 stopOnLastSlide: false, 28502 reverseDirection: false, 28503 pauseOnMouseEnter: false 28504 } 28505 }); 28506 28507 function run() { 28508 if (!swiper.size) { 28509 swiper.autoplay.running = false; 28510 swiper.autoplay.paused = false; 28511 return; 28512 } 28513 28514 const $activeSlideEl = swiper.slides.eq(swiper.activeIndex); 28515 let delay = swiper.params.autoplay.delay; 28516 28517 if ($activeSlideEl.attr('data-swiper-autoplay')) { 28518 delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay; 28519 } 28520 28521 clearTimeout(timeout); 28522 timeout = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_1__.nextTick)(() => { 28523 let autoplayResult; 28524 28525 if (swiper.params.autoplay.reverseDirection) { 28526 if (swiper.params.loop) { 28527 swiper.loopFix(); 28528 autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); 28529 emit('autoplay'); 28530 } else if (!swiper.isBeginning) { 28531 autoplayResult = swiper.slidePrev(swiper.params.speed, true, true); 28532 emit('autoplay'); 28533 } else if (!swiper.params.autoplay.stopOnLastSlide) { 28534 autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true); 28535 emit('autoplay'); 28536 } else { 28537 stop(); 28538 } 28539 } else if (swiper.params.loop) { 28540 swiper.loopFix(); 28541 autoplayResult = swiper.slideNext(swiper.params.speed, true, true); 28542 emit('autoplay'); 28543 } else if (!swiper.isEnd) { 28544 autoplayResult = swiper.slideNext(swiper.params.speed, true, true); 28545 emit('autoplay'); 28546 } else if (!swiper.params.autoplay.stopOnLastSlide) { 28547 autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true); 28548 emit('autoplay'); 28549 } else { 28550 stop(); 28551 } 28552 28553 if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) { 28554 run(); 28555 } 28556 }, delay); 28557 } 28558 28559 function start() { 28560 if (typeof timeout !== 'undefined') return false; 28561 if (swiper.autoplay.running) return false; 28562 swiper.autoplay.running = true; 28563 emit('autoplayStart'); 28564 run(); 28565 return true; 28566 } 28567 28568 function stop() { 28569 if (!swiper.autoplay.running) return false; 28570 if (typeof timeout === 'undefined') return false; 28571 28572 if (timeout) { 28573 clearTimeout(timeout); 28574 timeout = undefined; 28575 } 28576 28577 swiper.autoplay.running = false; 28578 emit('autoplayStop'); 28579 return true; 28580 } 28581 28582 function pause(speed) { 28583 if (!swiper.autoplay.running) return; 28584 if (swiper.autoplay.paused) return; 28585 if (timeout) clearTimeout(timeout); 28586 swiper.autoplay.paused = true; 28587 28588 if (speed === 0 || !swiper.params.autoplay.waitForTransition) { 28589 swiper.autoplay.paused = false; 28590 run(); 28591 } else { 28592 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 28593 swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd); 28594 }); 28595 } 28596 } 28597 28598 function onVisibilityChange() { 28599 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 28600 28601 if (document.visibilityState === 'hidden' && swiper.autoplay.running) { 28602 pause(); 28603 } 28604 28605 if (document.visibilityState === 'visible' && swiper.autoplay.paused) { 28606 run(); 28607 swiper.autoplay.paused = false; 28608 } 28609 } 28610 28611 function onTransitionEnd(e) { 28612 if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return; 28613 if (e.target !== swiper.$wrapperEl[0]) return; 28614 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 28615 swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); 28616 }); 28617 swiper.autoplay.paused = false; 28618 28619 if (!swiper.autoplay.running) { 28620 stop(); 28621 } else { 28622 run(); 28623 } 28624 } 28625 28626 function onMouseEnter() { 28627 if (swiper.params.autoplay.disableOnInteraction) { 28628 stop(); 28629 } else { 28630 emit('autoplayPause'); 28631 pause(); 28632 } 28633 28634 ['transitionend', 'webkitTransitionEnd'].forEach(event => { 28635 swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd); 28636 }); 28637 } 28638 28639 function onMouseLeave() { 28640 if (swiper.params.autoplay.disableOnInteraction) { 28641 return; 28642 } 28643 28644 swiper.autoplay.paused = false; 28645 emit('autoplayResume'); 28646 run(); 28647 } 28648 28649 function attachMouseEvents() { 28650 if (swiper.params.autoplay.pauseOnMouseEnter) { 28651 swiper.$el.on('mouseenter', onMouseEnter); 28652 swiper.$el.on('mouseleave', onMouseLeave); 28653 } 28654 } 28655 28656 function detachMouseEvents() { 28657 swiper.$el.off('mouseenter', onMouseEnter); 28658 swiper.$el.off('mouseleave', onMouseLeave); 28659 } 28660 28661 on('init', () => { 28662 if (swiper.params.autoplay.enabled) { 28663 start(); 28664 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 28665 document.addEventListener('visibilitychange', onVisibilityChange); 28666 attachMouseEvents(); 28667 } 28668 }); 28669 on('beforeTransitionStart', (_s, speed, internal) => { 28670 if (swiper.autoplay.running) { 28671 if (internal || !swiper.params.autoplay.disableOnInteraction) { 28672 swiper.autoplay.pause(speed); 28673 } else { 28674 stop(); 28675 } 28676 } 28677 }); 28678 on('sliderFirstMove', () => { 28679 if (swiper.autoplay.running) { 28680 if (swiper.params.autoplay.disableOnInteraction) { 28681 stop(); 28682 } else { 28683 pause(); 28684 } 28685 } 28686 }); 28687 on('touchEnd', () => { 28688 if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) { 28689 run(); 28690 } 28691 }); 28692 on('destroy', () => { 28693 detachMouseEvents(); 28694 28695 if (swiper.autoplay.running) { 28696 stop(); 28697 } 28698 28699 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 28700 document.removeEventListener('visibilitychange', onVisibilityChange); 28701 }); 28702 Object.assign(swiper.autoplay, { 28703 pause, 28704 run, 28705 start, 28706 stop 28707 }); 28708} 28709 28710/***/ }), 28711
vendor: 6,241 bytes, lines 28712-28914
28712/***/ "./node_modules/swiper/modules/controller/controller.js": 28713/*!**************************************************************!*\ 28714 !*** ./node_modules/swiper/modules/controller/controller.js ***! 28715 \**************************************************************/ 28716/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28717 28718"use strict"; 28719/* unused harmony export default */ 28720/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 28721/* eslint no-bitwise: ["error", { "allow": [">>"] }] */ 28722 28723function Controller({ 28724 swiper, 28725 extendParams, 28726 on 28727}) { 28728 extendParams({ 28729 controller: { 28730 control: undefined, 28731 inverse: false, 28732 by: 'slide' // or 'container' 28733 28734 } 28735 }); 28736 swiper.controller = { 28737 control: undefined 28738 }; 28739 28740 function LinearSpline(x, y) { 28741 const binarySearch = function search() { 28742 let maxIndex; 28743 let minIndex; 28744 let guess; 28745 return (array, val) => { 28746 minIndex = -1; 28747 maxIndex = array.length; 28748 28749 while (maxIndex - minIndex > 1) { 28750 guess = maxIndex + minIndex >> 1; 28751 28752 if (array[guess] <= val) { 28753 minIndex = guess; 28754 } else { 28755 maxIndex = guess; 28756 } 28757 } 28758 28759 return maxIndex; 28760 }; 28761 }(); 28762 28763 this.x = x; 28764 this.y = y; 28765 this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value: 28766 // (x1,y1) is the known point before given value, 28767 // (x3,y3) is the known point after given value. 28768 28769 let i1; 28770 let i3; 28771 28772 this.interpolate = function interpolate(x2) { 28773 if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2): 28774 28775 i3 = binarySearch(this.x, x2); 28776 i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already: 28777 // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1 28778 28779 return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1]; 28780 }; 28781 28782 return this; 28783 } // xxx: for now i will just save one spline function to to 28784 28785 28786 function getInterpolateFunction(c) { 28787 if (!swiper.controller.spline) { 28788 swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid); 28789 } 28790 } 28791 28792 function setTranslate(_t, byController) { 28793 const controlled = swiper.controller.control; 28794 let multiplier; 28795 let controlledTranslate; 28796 const Swiper = swiper.constructor; 28797 28798 function setControlledTranslate(c) { 28799 // this will create an Interpolate function based on the snapGrids 28800 // x is the Grid of the scrolled scroller and y will be the controlled scroller 28801 // it makes sense to create this only once and recall it for the interpolation 28802 // the function does a lot of value caching for performance 28803 const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate; 28804 28805 if (swiper.params.controller.by === 'slide') { 28806 getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid 28807 // but it did not work out 28808 28809 controlledTranslate = -swiper.controller.spline.interpolate(-translate); 28810 } 28811 28812 if (!controlledTranslate || swiper.params.controller.by === 'container') { 28813 multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate()); 28814 controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate(); 28815 } 28816 28817 if (swiper.params.controller.inverse) { 28818 controlledTranslate = c.maxTranslate() - controlledTranslate; 28819 } 28820 28821 c.updateProgress(controlledTranslate); 28822 c.setTranslate(controlledTranslate, swiper); 28823 c.updateActiveIndex(); 28824 c.updateSlidesClasses(); 28825 } 28826 28827 if (Array.isArray(controlled)) { 28828 for (let i = 0; i < controlled.length; i += 1) { 28829 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 28830 setControlledTranslate(controlled[i]); 28831 } 28832 } 28833 } else if (controlled instanceof Swiper && byController !== controlled) { 28834 setControlledTranslate(controlled); 28835 } 28836 } 28837 28838 function setTransition(duration, byController) { 28839 const Swiper = swiper.constructor; 28840 const controlled = swiper.controller.control; 28841 let i; 28842 28843 function setControlledTransition(c) { 28844 c.setTransition(duration, swiper); 28845 28846 if (duration !== 0) { 28847 c.transitionStart(); 28848 28849 if (c.params.autoHeight) { 28850 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => { 28851 c.updateAutoHeight(); 28852 }); 28853 } 28854 28855 c.$wrapperEl.transitionEnd(() => { 28856 if (!controlled) return; 28857 28858 if (c.params.loop && swiper.params.controller.by === 'slide') { 28859 c.loopFix(); 28860 } 28861 28862 c.transitionEnd(); 28863 }); 28864 } 28865 } 28866 28867 if (Array.isArray(controlled)) { 28868 for (i = 0; i < controlled.length; i += 1) { 28869 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 28870 setControlledTransition(controlled[i]); 28871 } 28872 } 28873 } else if (controlled instanceof Swiper && byController !== controlled) { 28874 setControlledTransition(controlled); 28875 } 28876 } 28877 28878 function removeSpline() { 28879 if (!swiper.controller.control) return; 28880 28881 if (swiper.controller.spline) { 28882 swiper.controller.spline = undefined; 28883 delete swiper.controller.spline; 28884 } 28885 } 28886 28887 on('beforeInit', () => { 28888 swiper.controller.control = swiper.params.controller.control; 28889 }); 28890 on('update', () => { 28891 removeSpline(); 28892 }); 28893 on('resize', () => { 28894 removeSpline(); 28895 }); 28896 on('observerUpdate', () => { 28897 removeSpline(); 28898 }); 28899 on('setTranslate', (_s, translate, byController) => { 28900 if (!swiper.controller.control) return; 28901 swiper.controller.setTranslate(translate, byController); 28902 }); 28903 on('setTransition', (_s, duration, byController) => { 28904 if (!swiper.controller.control) return; 28905 swiper.controller.setTransition(duration, byController); 28906 }); 28907 Object.assign(swiper.controller, { 28908 setTranslate, 28909 setTransition 28910 }); 28911} 28912 28913/***/ }), 28914
vendor: 5,426 bytes, lines 28915-29058
28915/***/ "./node_modules/swiper/modules/effect-cards/effect-cards.js": 28916/*!******************************************************************!*\ 28917 !*** ./node_modules/swiper/modules/effect-cards/effect-cards.js ***! 28918 \******************************************************************/ 28919/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 28920 28921"use strict"; 28922/* unused harmony export default */ 28923/* harmony import */ var _shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/create-shadow.js */ "./node_modules/swiper/shared/create-shadow.js"); 28924/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 28925/* harmony import */ var _shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/effect-target.js */ "./node_modules/swiper/shared/effect-target.js"); 28926/* harmony import */ var _shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/effect-virtual-transition-end.js */ "./node_modules/swiper/shared/effect-virtual-transition-end.js"); 28927 28928 28929 28930 28931function EffectCards({ 28932 swiper, 28933 extendParams, 28934 on 28935}) { 28936 extendParams({ 28937 cardsEffect: { 28938 slideShadows: true, 28939 transformEl: null, 28940 rotate: true, 28941 perSlideRotate: 2, 28942 perSlideOffset: 8 28943 } 28944 }); 28945 28946 const setTranslate = () => { 28947 const { 28948 slides, 28949 activeIndex 28950 } = swiper; 28951 const params = swiper.params.cardsEffect; 28952 const { 28953 startTranslate, 28954 isTouched 28955 } = swiper.touchEventsData; 28956 const currentTranslate = swiper.translate; 28957 28958 for (let i = 0; i < slides.length; i += 1) { 28959 const $slideEl = slides.eq(i); 28960 const slideProgress = $slideEl[0].progress; 28961 const progress = Math.min(Math.max(slideProgress, -4), 4); 28962 let offset = $slideEl[0].swiperSlideOffset; 28963 28964 if (swiper.params.centeredSlides && !swiper.params.cssMode) { 28965 swiper.$wrapperEl.transform(`translateX(${swiper.minTranslate()}px)`); 28966 } 28967 28968 if (swiper.params.centeredSlides && swiper.params.cssMode) { 28969 offset -= slides[0].swiperSlideOffset; 28970 } 28971 28972 let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset; 28973 let tY = 0; 28974 const tZ = -100 * Math.abs(progress); 28975 let scale = 1; 28976 let rotate = -params.perSlideRotate * progress; 28977 let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75; 28978 const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i; 28979 const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate; 28980 const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate; 28981 28982 if (isSwipeToNext || isSwipeToPrev) { 28983 const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5; 28984 rotate += -28 * progress * subProgress; 28985 scale += -0.5 * subProgress; 28986 tXAdd += 96 * subProgress; 28987 tY = `${-25 * subProgress * Math.abs(progress)}%`; 28988 } 28989 28990 if (progress < 0) { 28991 // next 28992 tX = `calc(${tX}px + (${tXAdd * Math.abs(progress)}%))`; 28993 } else if (progress > 0) { 28994 // prev 28995 tX = `calc(${tX}px + (-${tXAdd * Math.abs(progress)}%))`; 28996 } else { 28997 tX = `${tX}px`; 28998 } 28999 29000 if (!swiper.isHorizontal()) { 29001 const prevY = tY; 29002 tY = tX; 29003 tX = prevY; 29004 } 29005 29006 const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`; 29007 const transform = ` 29008 translate3d(${tX}, ${tY}, ${tZ}px) 29009 rotateZ(${params.rotate ? rotate : 0}deg) 29010 scale(${scaleString}) 29011 `; 29012 29013 if (params.slideShadows) { 29014 // Set shadows 29015 let $shadowEl = $slideEl.find('.swiper-slide-shadow'); 29016 29017 if ($shadowEl.length === 0) { 29018 $shadowEl = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, $slideEl); 29019 } 29020 29021 if ($shadowEl.length) $shadowEl[0].style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1); 29022 } 29023 29024 $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 29025 const $targetEl = (0,_shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__["default"])(params, $slideEl); 29026 $targetEl.transform(transform); 29027 } 29028 }; 29029 29030 const setTransition = duration => { 29031 const { 29032 transformEl 29033 } = swiper.params.cardsEffect; 29034 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 29035 $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); 29036 (0,_shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_3__["default"])({ 29037 swiper, 29038 duration, 29039 transformEl 29040 }); 29041 }; 29042 29043 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ 29044 effect: 'cards', 29045 swiper, 29046 on, 29047 setTranslate, 29048 setTransition, 29049 perspective: () => true, 29050 overwriteParams: () => ({ 29051 watchSlidesProgress: true, 29052 virtualTranslate: !swiper.params.cssMode 29053 }) 29054 }); 29055} 29056 29057/***/ }), 29058
vendor: 5,277 bytes, lines 29059-29176
29059/***/ "./node_modules/swiper/modules/effect-coverflow/effect-coverflow.js": 29060/*!**************************************************************************!*\ 29061 !*** ./node_modules/swiper/modules/effect-coverflow/effect-coverflow.js ***! 29062 \**************************************************************************/ 29063/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29064 29065"use strict"; 29066/* unused harmony export default */ 29067/* harmony import */ var _shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/create-shadow.js */ "./node_modules/swiper/shared/create-shadow.js"); 29068/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 29069/* harmony import */ var _shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/effect-target.js */ "./node_modules/swiper/shared/effect-target.js"); 29070 29071 29072 29073function EffectCoverflow({ 29074 swiper, 29075 extendParams, 29076 on 29077}) { 29078 extendParams({ 29079 coverflowEffect: { 29080 rotate: 50, 29081 stretch: 0, 29082 depth: 100, 29083 scale: 1, 29084 modifier: 1, 29085 slideShadows: true, 29086 transformEl: null 29087 } 29088 }); 29089 29090 const setTranslate = () => { 29091 const { 29092 width: swiperWidth, 29093 height: swiperHeight, 29094 slides, 29095 slidesSizesGrid 29096 } = swiper; 29097 const params = swiper.params.coverflowEffect; 29098 const isHorizontal = swiper.isHorizontal(); 29099 const transform = swiper.translate; 29100 const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2; 29101 const rotate = isHorizontal ? params.rotate : -params.rotate; 29102 const translate = params.depth; // Each slide offset from center 29103 29104 for (let i = 0, length = slides.length; i < length; i += 1) { 29105 const $slideEl = slides.eq(i); 29106 const slideSize = slidesSizesGrid[i]; 29107 const slideOffset = $slideEl[0].swiperSlideOffset; 29108 const centerOffset = (center - slideOffset - slideSize / 2) / slideSize; 29109 const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier; 29110 let rotateY = isHorizontal ? rotate * offsetMultiplier : 0; 29111 let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; // var rotateZ = 0 29112 29113 let translateZ = -translate * Math.abs(offsetMultiplier); 29114 let stretch = params.stretch; // Allow percentage to make a relative stretch for responsive sliders 29115 29116 if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) { 29117 stretch = parseFloat(params.stretch) / 100 * slideSize; 29118 } 29119 29120 let translateY = isHorizontal ? 0 : stretch * offsetMultiplier; 29121 let translateX = isHorizontal ? stretch * offsetMultiplier : 0; 29122 let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); // Fix for ultra small values 29123 29124 if (Math.abs(translateX) < 0.001) translateX = 0; 29125 if (Math.abs(translateY) < 0.001) translateY = 0; 29126 if (Math.abs(translateZ) < 0.001) translateZ = 0; 29127 if (Math.abs(rotateY) < 0.001) rotateY = 0; 29128 if (Math.abs(rotateX) < 0.001) rotateX = 0; 29129 if (Math.abs(scale) < 0.001) scale = 0; 29130 const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(${scale})`; 29131 const $targetEl = (0,_shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__["default"])(params, $slideEl); 29132 $targetEl.transform(slideTransform); 29133 $slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; 29134 29135 if (params.slideShadows) { 29136 // Set shadows 29137 let $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 29138 let $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 29139 29140 if ($shadowBeforeEl.length === 0) { 29141 $shadowBeforeEl = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, $slideEl, isHorizontal ? 'left' : 'top'); 29142 } 29143 29144 if ($shadowAfterEl.length === 0) { 29145 $shadowAfterEl = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, $slideEl, isHorizontal ? 'right' : 'bottom'); 29146 } 29147 29148 if ($shadowBeforeEl.length) $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; 29149 if ($shadowAfterEl.length) $shadowAfterEl[0].style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0; 29150 } 29151 } 29152 }; 29153 29154 const setTransition = duration => { 29155 const { 29156 transformEl 29157 } = swiper.params.coverflowEffect; 29158 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 29159 $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 29160 }; 29161 29162 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ 29163 effect: 'coverflow', 29164 swiper, 29165 on, 29166 setTranslate, 29167 setTransition, 29168 perspective: () => true, 29169 overwriteParams: () => ({ 29170 watchSlidesProgress: true 29171 }) 29172 }); 29173} 29174 29175/***/ }), 29176
vendor: 6,004 bytes, lines 29177-29345
29177/***/ "./node_modules/swiper/modules/effect-creative/effect-creative.js": 29178/*!************************************************************************!*\ 29179 !*** ./node_modules/swiper/modules/effect-creative/effect-creative.js ***! 29180 \************************************************************************/ 29181/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29182 29183"use strict"; 29184/* unused harmony export default */ 29185/* harmony import */ var _shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/create-shadow.js */ "./node_modules/swiper/shared/create-shadow.js"); 29186/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 29187/* harmony import */ var _shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/effect-target.js */ "./node_modules/swiper/shared/effect-target.js"); 29188/* harmony import */ var _shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/effect-virtual-transition-end.js */ "./node_modules/swiper/shared/effect-virtual-transition-end.js"); 29189 29190 29191 29192 29193function EffectCreative({ 29194 swiper, 29195 extendParams, 29196 on 29197}) { 29198 extendParams({ 29199 creativeEffect: { 29200 transformEl: null, 29201 limitProgress: 1, 29202 shadowPerProgress: false, 29203 progressMultiplier: 1, 29204 perspective: true, 29205 prev: { 29206 translate: [0, 0, 0], 29207 rotate: [0, 0, 0], 29208 opacity: 1, 29209 scale: 1 29210 }, 29211 next: { 29212 translate: [0, 0, 0], 29213 rotate: [0, 0, 0], 29214 opacity: 1, 29215 scale: 1 29216 } 29217 } 29218 }); 29219 29220 const getTranslateValue = value => { 29221 if (typeof value === 'string') return value; 29222 return `${value}px`; 29223 }; 29224 29225 const setTranslate = () => { 29226 const { 29227 slides, 29228 $wrapperEl, 29229 slidesSizesGrid 29230 } = swiper; 29231 const params = swiper.params.creativeEffect; 29232 const { 29233 progressMultiplier: multiplier 29234 } = params; 29235 const isCenteredSlides = swiper.params.centeredSlides; 29236 29237 if (isCenteredSlides) { 29238 const margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0; 29239 $wrapperEl.transform(`translateX(calc(50% - ${margin}px))`); 29240 } 29241 29242 for (let i = 0; i < slides.length; i += 1) { 29243 const $slideEl = slides.eq(i); 29244 const slideProgress = $slideEl[0].progress; 29245 const progress = Math.min(Math.max($slideEl[0].progress, -params.limitProgress), params.limitProgress); 29246 let originalProgress = progress; 29247 29248 if (!isCenteredSlides) { 29249 originalProgress = Math.min(Math.max($slideEl[0].originalProgress, -params.limitProgress), params.limitProgress); 29250 } 29251 29252 const offset = $slideEl[0].swiperSlideOffset; 29253 const t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0]; 29254 const r = [0, 0, 0]; 29255 let custom = false; 29256 29257 if (!swiper.isHorizontal()) { 29258 t[1] = t[0]; 29259 t[0] = 0; 29260 } 29261 29262 let data = { 29263 translate: [0, 0, 0], 29264 rotate: [0, 0, 0], 29265 scale: 1, 29266 opacity: 1 29267 }; 29268 29269 if (progress < 0) { 29270 data = params.next; 29271 custom = true; 29272 } else if (progress > 0) { 29273 data = params.prev; 29274 custom = true; 29275 } // set translate 29276 29277 29278 t.forEach((value, index) => { 29279 t[index] = `calc(${value}px + (${getTranslateValue(data.translate[index])} * ${Math.abs(progress * multiplier)}))`; 29280 }); // set rotates 29281 29282 r.forEach((value, index) => { 29283 r[index] = data.rotate[index] * Math.abs(progress * multiplier); 29284 }); 29285 $slideEl[0].style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 29286 const translateString = t.join(', '); 29287 const rotateString = `rotateX(${r[0]}deg) rotateY(${r[1]}deg) rotateZ(${r[2]}deg)`; 29288 const scaleString = originalProgress < 0 ? `scale(${1 + (1 - data.scale) * originalProgress * multiplier})` : `scale(${1 - (1 - data.scale) * originalProgress * multiplier})`; 29289 const opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier; 29290 const transform = `translate3d(${translateString}) ${rotateString} ${scaleString}`; // Set shadows 29291 29292 if (custom && data.shadow || !custom) { 29293 let $shadowEl = $slideEl.children('.swiper-slide-shadow'); 29294 29295 if ($shadowEl.length === 0 && data.shadow) { 29296 $shadowEl = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, $slideEl); 29297 } 29298 29299 if ($shadowEl.length) { 29300 const shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress; 29301 $shadowEl[0].style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1); 29302 } 29303 } 29304 29305 const $targetEl = (0,_shared_effect_target_js__WEBPACK_IMPORTED_MODULE_2__["default"])(params, $slideEl); 29306 $targetEl.transform(transform).css({ 29307 opacity: opacityString 29308 }); 29309 29310 if (data.origin) { 29311 $targetEl.css('transform-origin', data.origin); 29312 } 29313 } 29314 }; 29315 29316 const setTransition = duration => { 29317 const { 29318 transformEl 29319 } = swiper.params.creativeEffect; 29320 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 29321 $transitionElements.transition(duration).find('.swiper-slide-shadow').transition(duration); 29322 (0,_shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_3__["default"])({ 29323 swiper, 29324 duration, 29325 transformEl, 29326 allSlides: true 29327 }); 29328 }; 29329 29330 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ 29331 effect: 'creative', 29332 swiper, 29333 on, 29334 setTranslate, 29335 setTransition, 29336 perspective: () => swiper.params.creativeEffect.perspective, 29337 overwriteParams: () => ({ 29338 watchSlidesProgress: true, 29339 virtualTranslate: !swiper.params.cssMode 29340 }) 29341 }); 29342} 29343 29344/***/ }), 29345
vendor: 7,225 bytes, lines 29346-29553
29346/***/ "./node_modules/swiper/modules/effect-cube/effect-cube.js": 29347/*!****************************************************************!*\ 29348 !*** ./node_modules/swiper/modules/effect-cube/effect-cube.js ***! 29349 \****************************************************************/ 29350/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29351 29352"use strict"; 29353/* unused harmony export default */ 29354/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 29355/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 29356 29357 29358function EffectCube({ 29359 swiper, 29360 extendParams, 29361 on 29362}) { 29363 extendParams({ 29364 cubeEffect: { 29365 slideShadows: true, 29366 shadow: true, 29367 shadowOffset: 20, 29368 shadowScale: 0.94 29369 } 29370 }); 29371 29372 const createSlideShadows = ($slideEl, progress, isHorizontal) => { 29373 let shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 29374 let shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 29375 29376 if (shadowBefore.length === 0) { 29377 shadowBefore = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(`<div class="swiper-slide-shadow-${isHorizontal ? 'left' : 'top'}"></div>`); 29378 $slideEl.append(shadowBefore); 29379 } 29380 29381 if (shadowAfter.length === 0) { 29382 shadowAfter = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(`<div class="swiper-slide-shadow-${isHorizontal ? 'right' : 'bottom'}"></div>`); 29383 $slideEl.append(shadowAfter); 29384 } 29385 29386 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 29387 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 29388 }; 29389 29390 const recreateShadows = () => { 29391 // create new ones 29392 const isHorizontal = swiper.isHorizontal(); 29393 swiper.slides.each(slideEl => { 29394 const progress = Math.max(Math.min(slideEl.progress, 1), -1); 29395 createSlideShadows((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(slideEl), progress, isHorizontal); 29396 }); 29397 }; 29398 29399 const setTranslate = () => { 29400 const { 29401 $el, 29402 $wrapperEl, 29403 slides, 29404 width: swiperWidth, 29405 height: swiperHeight, 29406 rtlTranslate: rtl, 29407 size: swiperSize, 29408 browser 29409 } = swiper; 29410 const params = swiper.params.cubeEffect; 29411 const isHorizontal = swiper.isHorizontal(); 29412 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 29413 let wrapperRotate = 0; 29414 let $cubeShadowEl; 29415 29416 if (params.shadow) { 29417 if (isHorizontal) { 29418 $cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow'); 29419 29420 if ($cubeShadowEl.length === 0) { 29421 $cubeShadowEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])('<div class="swiper-cube-shadow"></div>'); 29422 $wrapperEl.append($cubeShadowEl); 29423 } 29424 29425 $cubeShadowEl.css({ 29426 height: `${swiperWidth}px` 29427 }); 29428 } else { 29429 $cubeShadowEl = $el.find('.swiper-cube-shadow'); 29430 29431 if ($cubeShadowEl.length === 0) { 29432 $cubeShadowEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])('<div class="swiper-cube-shadow"></div>'); 29433 $el.append($cubeShadowEl); 29434 } 29435 } 29436 } 29437 29438 for (let i = 0; i < slides.length; i += 1) { 29439 const $slideEl = slides.eq(i); 29440 let slideIndex = i; 29441 29442 if (isVirtual) { 29443 slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10); 29444 } 29445 29446 let slideAngle = slideIndex * 90; 29447 let round = Math.floor(slideAngle / 360); 29448 29449 if (rtl) { 29450 slideAngle = -slideAngle; 29451 round = Math.floor(-slideAngle / 360); 29452 } 29453 29454 const progress = Math.max(Math.min($slideEl[0].progress, 1), -1); 29455 let tx = 0; 29456 let ty = 0; 29457 let tz = 0; 29458 29459 if (slideIndex % 4 === 0) { 29460 tx = -round * 4 * swiperSize; 29461 tz = 0; 29462 } else if ((slideIndex - 1) % 4 === 0) { 29463 tx = 0; 29464 tz = -round * 4 * swiperSize; 29465 } else if ((slideIndex - 2) % 4 === 0) { 29466 tx = swiperSize + round * 4 * swiperSize; 29467 tz = swiperSize; 29468 } else if ((slideIndex - 3) % 4 === 0) { 29469 tx = -swiperSize; 29470 tz = 3 * swiperSize + swiperSize * 4 * round; 29471 } 29472 29473 if (rtl) { 29474 tx = -tx; 29475 } 29476 29477 if (!isHorizontal) { 29478 ty = tx; 29479 tx = 0; 29480 } 29481 29482 const transform = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`; 29483 29484 if (progress <= 1 && progress > -1) { 29485 wrapperRotate = slideIndex * 90 + progress * 90; 29486 if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90; 29487 } 29488 29489 $slideEl.transform(transform); 29490 29491 if (params.slideShadows) { 29492 createSlideShadows($slideEl, progress, isHorizontal); 29493 } 29494 } 29495 29496 $wrapperEl.css({ 29497 '-webkit-transform-origin': `50% 50% -${swiperSize / 2}px`, 29498 'transform-origin': `50% 50% -${swiperSize / 2}px` 29499 }); 29500 29501 if (params.shadow) { 29502 if (isHorizontal) { 29503 $cubeShadowEl.transform(`translate3d(0px, ${swiperWidth / 2 + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`); 29504 } else { 29505 const shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; 29506 const multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); 29507 const scale1 = params.shadowScale; 29508 const scale2 = params.shadowScale / multiplier; 29509 const offset = params.shadowOffset; 29510 $cubeShadowEl.transform(`scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${swiperHeight / 2 + offset}px, ${-swiperHeight / 2 / scale2}px) rotateX(-90deg)`); 29511 } 29512 } 29513 29514 const zFactor = browser.isSafari || browser.isWebView ? -swiperSize / 2 : 0; 29515 $wrapperEl.transform(`translate3d(0px,0,${zFactor}px) rotateX(${swiper.isHorizontal() ? 0 : wrapperRotate}deg) rotateY(${swiper.isHorizontal() ? -wrapperRotate : 0}deg)`); 29516 $wrapperEl[0].style.setProperty('--swiper-cube-translate-z', `${zFactor}px`); 29517 }; 29518 29519 const setTransition = duration => { 29520 const { 29521 $el, 29522 slides 29523 } = swiper; 29524 slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 29525 29526 if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) { 29527 $el.find('.swiper-cube-shadow').transition(duration); 29528 } 29529 }; 29530 29531 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ 29532 effect: 'cube', 29533 swiper, 29534 on, 29535 setTranslate, 29536 setTransition, 29537 recreateShadows, 29538 getEffectParams: () => swiper.params.cubeEffect, 29539 perspective: () => true, 29540 overwriteParams: () => ({ 29541 slidesPerView: 1, 29542 slidesPerGroup: 1, 29543 watchSlidesProgress: true, 29544 resistanceRatio: 0, 29545 spaceBetween: 0, 29546 centeredSlides: false, 29547 virtualTranslate: true 29548 }) 29549 }); 29550} 29551 29552/***/ }), 29553
vendor: 2,951 bytes, lines 29554-29639
29554/***/ "./node_modules/swiper/modules/effect-fade/effect-fade.js": 29555/*!****************************************************************!*\ 29556 !*** ./node_modules/swiper/modules/effect-fade/effect-fade.js ***! 29557 \****************************************************************/ 29558/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29559 29560"use strict"; 29561/* harmony export */ __webpack_require__.d(__webpack_exports__, { 29562/* harmony export */ "default": function() { return /* binding */ EffectFade; } 29563/* harmony export */ }); 29564/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 29565/* harmony import */ var _shared_effect_target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/effect-target.js */ "./node_modules/swiper/shared/effect-target.js"); 29566/* harmony import */ var _shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/effect-virtual-transition-end.js */ "./node_modules/swiper/shared/effect-virtual-transition-end.js"); 29567 29568 29569 29570function EffectFade({ 29571 swiper, 29572 extendParams, 29573 on 29574}) { 29575 extendParams({ 29576 fadeEffect: { 29577 crossFade: false, 29578 transformEl: null 29579 } 29580 }); 29581 29582 const setTranslate = () => { 29583 const { 29584 slides 29585 } = swiper; 29586 const params = swiper.params.fadeEffect; 29587 29588 for (let i = 0; i < slides.length; i += 1) { 29589 const $slideEl = swiper.slides.eq(i); 29590 const offset = $slideEl[0].swiperSlideOffset; 29591 let tx = -offset; 29592 if (!swiper.params.virtualTranslate) tx -= swiper.translate; 29593 let ty = 0; 29594 29595 if (!swiper.isHorizontal()) { 29596 ty = tx; 29597 tx = 0; 29598 } 29599 29600 const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0); 29601 const $targetEl = (0,_shared_effect_target_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params, $slideEl); 29602 $targetEl.css({ 29603 opacity: slideOpacity 29604 }).transform(`translate3d(${tx}px, ${ty}px, 0px)`); 29605 } 29606 }; 29607 29608 const setTransition = duration => { 29609 const { 29610 transformEl 29611 } = swiper.params.fadeEffect; 29612 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 29613 $transitionElements.transition(duration); 29614 (0,_shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_2__["default"])({ 29615 swiper, 29616 duration, 29617 transformEl, 29618 allSlides: true 29619 }); 29620 }; 29621 29622 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 29623 effect: 'fade', 29624 swiper, 29625 on, 29626 setTranslate, 29627 setTransition, 29628 overwriteParams: () => ({ 29629 slidesPerView: 1, 29630 slidesPerGroup: 1, 29631 watchSlidesProgress: true, 29632 spaceBetween: 0, 29633 virtualTranslate: !swiper.params.cssMode 29634 }) 29635 }); 29636} 29637 29638/***/ }), 29639
vendor: 383 bytes, lines 29640-29651
29640/***/ "./node_modules/swiper/modules/effect-fade/effect-fade.min.css": 29641/*!*********************************************************************!*\ 29642 !*** ./node_modules/swiper/modules/effect-fade/effect-fade.min.css ***! 29643 \*********************************************************************/ 29644/***/ (function() { 29645 29646"use strict"; 29647// extracted by mini-css-extract-plugin 29648 29649 29650/***/ }), 29651
vendor: 5,187 bytes, lines 29652-29790
29652/***/ "./node_modules/swiper/modules/effect-flip/effect-flip.js": 29653/*!****************************************************************!*\ 29654 !*** ./node_modules/swiper/modules/effect-flip/effect-flip.js ***! 29655 \****************************************************************/ 29656/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29657 29658"use strict"; 29659/* unused harmony export default */ 29660/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 29661/* harmony import */ var _shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/create-shadow.js */ "./node_modules/swiper/shared/create-shadow.js"); 29662/* harmony import */ var _shared_effect_init_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/effect-init.js */ "./node_modules/swiper/shared/effect-init.js"); 29663/* harmony import */ var _shared_effect_target_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/effect-target.js */ "./node_modules/swiper/shared/effect-target.js"); 29664/* harmony import */ var _shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/effect-virtual-transition-end.js */ "./node_modules/swiper/shared/effect-virtual-transition-end.js"); 29665 29666 29667 29668 29669 29670function EffectFlip({ 29671 swiper, 29672 extendParams, 29673 on 29674}) { 29675 extendParams({ 29676 flipEffect: { 29677 slideShadows: true, 29678 limitRotation: true, 29679 transformEl: null 29680 } 29681 }); 29682 29683 const createSlideShadows = ($slideEl, progress, params) => { 29684 let shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top'); 29685 let shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom'); 29686 29687 if (shadowBefore.length === 0) { 29688 shadowBefore = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params, $slideEl, swiper.isHorizontal() ? 'left' : 'top'); 29689 } 29690 29691 if (shadowAfter.length === 0) { 29692 shadowAfter = (0,_shared_create_shadow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params, $slideEl, swiper.isHorizontal() ? 'right' : 'bottom'); 29693 } 29694 29695 if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0); 29696 if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0); 29697 }; 29698 29699 const recreateShadows = () => { 29700 // Set shadows 29701 const params = swiper.params.flipEffect; 29702 swiper.slides.each(slideEl => { 29703 const $slideEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(slideEl); 29704 let progress = $slideEl[0].progress; 29705 29706 if (swiper.params.flipEffect.limitRotation) { 29707 progress = Math.max(Math.min(slideEl.progress, 1), -1); 29708 } 29709 29710 createSlideShadows($slideEl, progress, params); 29711 }); 29712 }; 29713 29714 const setTranslate = () => { 29715 const { 29716 slides, 29717 rtlTranslate: rtl 29718 } = swiper; 29719 const params = swiper.params.flipEffect; 29720 29721 for (let i = 0; i < slides.length; i += 1) { 29722 const $slideEl = slides.eq(i); 29723 let progress = $slideEl[0].progress; 29724 29725 if (swiper.params.flipEffect.limitRotation) { 29726 progress = Math.max(Math.min($slideEl[0].progress, 1), -1); 29727 } 29728 29729 const offset = $slideEl[0].swiperSlideOffset; 29730 const rotate = -180 * progress; 29731 let rotateY = rotate; 29732 let rotateX = 0; 29733 let tx = swiper.params.cssMode ? -offset - swiper.translate : -offset; 29734 let ty = 0; 29735 29736 if (!swiper.isHorizontal()) { 29737 ty = tx; 29738 tx = 0; 29739 rotateX = -rotateY; 29740 rotateY = 0; 29741 } else if (rtl) { 29742 rotateY = -rotateY; 29743 } 29744 29745 $slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length; 29746 29747 if (params.slideShadows) { 29748 createSlideShadows($slideEl, progress, params); 29749 } 29750 29751 const transform = `translate3d(${tx}px, ${ty}px, 0px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`; 29752 const $targetEl = (0,_shared_effect_target_js__WEBPACK_IMPORTED_MODULE_3__["default"])(params, $slideEl); 29753 $targetEl.transform(transform); 29754 } 29755 }; 29756 29757 const setTransition = duration => { 29758 const { 29759 transformEl 29760 } = swiper.params.flipEffect; 29761 const $transitionElements = transformEl ? swiper.slides.find(transformEl) : swiper.slides; 29762 $transitionElements.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration); 29763 (0,_shared_effect_virtual_transition_end_js__WEBPACK_IMPORTED_MODULE_4__["default"])({ 29764 swiper, 29765 duration, 29766 transformEl 29767 }); 29768 }; 29769 29770 (0,_shared_effect_init_js__WEBPACK_IMPORTED_MODULE_2__["default"])({ 29771 effect: 'flip', 29772 swiper, 29773 on, 29774 setTranslate, 29775 setTransition, 29776 recreateShadows, 29777 getEffectParams: () => swiper.params.flipEffect, 29778 perspective: () => true, 29779 overwriteParams: () => ({ 29780 slidesPerView: 1, 29781 slidesPerGroup: 1, 29782 watchSlidesProgress: true, 29783 spaceBetween: 0, 29784 virtualTranslate: !swiper.params.cssMode 29785 }) 29786 }); 29787} 29788 29789/***/ }), 29790
vendor: 8,800 bytes, lines 29791-30058
29791/***/ "./node_modules/swiper/modules/free-mode/free-mode.js": 29792/*!************************************************************!*\ 29793 !*** ./node_modules/swiper/modules/free-mode/free-mode.js ***! 29794 \************************************************************/ 29795/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 29796 29797"use strict"; 29798/* unused harmony export default */ 29799/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 29800 29801function freeMode({ 29802 swiper, 29803 extendParams, 29804 emit, 29805 once 29806}) { 29807 extendParams({ 29808 freeMode: { 29809 enabled: false, 29810 momentum: true, 29811 momentumRatio: 1, 29812 momentumBounce: true, 29813 momentumBounceRatio: 1, 29814 momentumVelocityRatio: 1, 29815 sticky: false, 29816 minimumVelocity: 0.02 29817 } 29818 }); 29819 29820 function onTouchStart() { 29821 const translate = swiper.getTranslate(); 29822 swiper.setTranslate(translate); 29823 swiper.setTransition(0); 29824 swiper.touchEventsData.velocities.length = 0; 29825 swiper.freeMode.onTouchEnd({ 29826 currentPos: swiper.rtl ? swiper.translate : -swiper.translate 29827 }); 29828 } 29829 29830 function onTouchMove() { 29831 const { 29832 touchEventsData: data, 29833 touches 29834 } = swiper; // Velocity 29835 29836 if (data.velocities.length === 0) { 29837 data.velocities.push({ 29838 position: touches[swiper.isHorizontal() ? 'startX' : 'startY'], 29839 time: data.touchStartTime 29840 }); 29841 } 29842 29843 data.velocities.push({ 29844 position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'], 29845 time: (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.now)() 29846 }); 29847 } 29848 29849 function onTouchEnd({ 29850 currentPos 29851 }) { 29852 const { 29853 params, 29854 $wrapperEl, 29855 rtlTranslate: rtl, 29856 snapGrid, 29857 touchEventsData: data 29858 } = swiper; // Time diff 29859 29860 const touchEndTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.now)(); 29861 const timeDiff = touchEndTime - data.touchStartTime; 29862 29863 if (currentPos < -swiper.minTranslate()) { 29864 swiper.slideTo(swiper.activeIndex); 29865 return; 29866 } 29867 29868 if (currentPos > -swiper.maxTranslate()) { 29869 if (swiper.slides.length < snapGrid.length) { 29870 swiper.slideTo(snapGrid.length - 1); 29871 } else { 29872 swiper.slideTo(swiper.slides.length - 1); 29873 } 29874 29875 return; 29876 } 29877 29878 if (params.freeMode.momentum) { 29879 if (data.velocities.length > 1) { 29880 const lastMoveEvent = data.velocities.pop(); 29881 const velocityEvent = data.velocities.pop(); 29882 const distance = lastMoveEvent.position - velocityEvent.position; 29883 const time = lastMoveEvent.time - velocityEvent.time; 29884 swiper.velocity = distance / time; 29885 swiper.velocity /= 2; 29886 29887 if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) { 29888 swiper.velocity = 0; 29889 } // this implies that the user stopped moving a finger then released. 29890 // There would be no events with distance zero, so the last event is stale. 29891 29892 29893 if (time > 150 || (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.now)() - lastMoveEvent.time > 300) { 29894 swiper.velocity = 0; 29895 } 29896 } else { 29897 swiper.velocity = 0; 29898 } 29899 29900 swiper.velocity *= params.freeMode.momentumVelocityRatio; 29901 data.velocities.length = 0; 29902 let momentumDuration = 1000 * params.freeMode.momentumRatio; 29903 const momentumDistance = swiper.velocity * momentumDuration; 29904 let newPosition = swiper.translate + momentumDistance; 29905 if (rtl) newPosition = -newPosition; 29906 let doBounce = false; 29907 let afterBouncePosition; 29908 const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio; 29909 let needsLoopFix; 29910 29911 if (newPosition < swiper.maxTranslate()) { 29912 if (params.freeMode.momentumBounce) { 29913 if (newPosition + swiper.maxTranslate() < -bounceAmount) { 29914 newPosition = swiper.maxTranslate() - bounceAmount; 29915 } 29916 29917 afterBouncePosition = swiper.maxTranslate(); 29918 doBounce = true; 29919 data.allowMomentumBounce = true; 29920 } else { 29921 newPosition = swiper.maxTranslate(); 29922 } 29923 29924 if (params.loop && params.centeredSlides) needsLoopFix = true; 29925 } else if (newPosition > swiper.minTranslate()) { 29926 if (params.freeMode.momentumBounce) { 29927 if (newPosition - swiper.minTranslate() > bounceAmount) { 29928 newPosition = swiper.minTranslate() + bounceAmount; 29929 } 29930 29931 afterBouncePosition = swiper.minTranslate(); 29932 doBounce = true; 29933 data.allowMomentumBounce = true; 29934 } else { 29935 newPosition = swiper.minTranslate(); 29936 } 29937 29938 if (params.loop && params.centeredSlides) needsLoopFix = true; 29939 } else if (params.freeMode.sticky) { 29940 let nextSlide; 29941 29942 for (let j = 0; j < snapGrid.length; j += 1) { 29943 if (snapGrid[j] > -newPosition) { 29944 nextSlide = j; 29945 break; 29946 } 29947 } 29948 29949 if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') { 29950 newPosition = snapGrid[nextSlide]; 29951 } else { 29952 newPosition = snapGrid[nextSlide - 1]; 29953 } 29954 29955 newPosition = -newPosition; 29956 } 29957 29958 if (needsLoopFix) { 29959 once('transitionEnd', () => { 29960 swiper.loopFix(); 29961 }); 29962 } // Fix duration 29963 29964 29965 if (swiper.velocity !== 0) { 29966 if (rtl) { 29967 momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity); 29968 } else { 29969 momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity); 29970 } 29971 29972 if (params.freeMode.sticky) { 29973 // If freeMode.sticky is active and the user ends a swipe with a slow-velocity 29974 // event, then durations can be 20+ seconds to slide one (or zero!) slides. 29975 // It's easy to see this when simulating touch with mouse events. To fix this, 29976 // limit single-slide swipes to the default slide duration. This also has the 29977 // nice side effect of matching slide speed if the user stopped moving before 29978 // lifting finger or mouse vs. moving slowly before lifting the finger/mouse. 29979 // For faster swipes, also apply limits (albeit higher ones). 29980 const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate); 29981 const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex]; 29982 29983 if (moveDistance < currentSlideSize) { 29984 momentumDuration = params.speed; 29985 } else if (moveDistance < 2 * currentSlideSize) { 29986 momentumDuration = params.speed * 1.5; 29987 } else { 29988 momentumDuration = params.speed * 2.5; 29989 } 29990 } 29991 } else if (params.freeMode.sticky) { 29992 swiper.slideToClosest(); 29993 return; 29994 } 29995 29996 if (params.freeMode.momentumBounce && doBounce) { 29997 swiper.updateProgress(afterBouncePosition); 29998 swiper.setTransition(momentumDuration); 29999 swiper.setTranslate(newPosition); 30000 swiper.transitionStart(true, swiper.swipeDirection); 30001 swiper.animating = true; 30002 $wrapperEl.transitionEnd(() => { 30003 if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return; 30004 emit('momentumBounce'); 30005 swiper.setTransition(params.speed); 30006 setTimeout(() => { 30007 swiper.setTranslate(afterBouncePosition); 30008 $wrapperEl.transitionEnd(() => { 30009 if (!swiper || swiper.destroyed) return; 30010 swiper.transitionEnd(); 30011 }); 30012 }, 0); 30013 }); 30014 } else if (swiper.velocity) { 30015 emit('_freeModeNoMomentumRelease'); 30016 swiper.updateProgress(newPosition); 30017 swiper.setTransition(momentumDuration); 30018 swiper.setTranslate(newPosition); 30019 swiper.transitionStart(true, swiper.swipeDirection); 30020 30021 if (!swiper.animating) { 30022 swiper.animating = true; 30023 $wrapperEl.transitionEnd(() => { 30024 if (!swiper || swiper.destroyed) return; 30025 swiper.transitionEnd(); 30026 }); 30027 } 30028 } else { 30029 swiper.updateProgress(newPosition); 30030 } 30031 30032 swiper.updateActiveIndex(); 30033 swiper.updateSlidesClasses(); 30034 } else if (params.freeMode.sticky) { 30035 swiper.slideToClosest(); 30036 return; 30037 } else if (params.freeMode) { 30038 emit('_freeModeNoMomentumRelease'); 30039 } 30040 30041 if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) { 30042 swiper.updateProgress(); 30043 swiper.updateActiveIndex(); 30044 swiper.updateSlidesClasses(); 30045 } 30046 } 30047 30048 Object.assign(swiper, { 30049 freeMode: { 30050 onTouchStart, 30051 onTouchMove, 30052 onTouchEnd 30053 } 30054 }); 30055} 30056 30057/***/ }), 30058
vendor: 3,657 bytes, lines 30059-30185
30059/***/ "./node_modules/swiper/modules/grid/grid.js": 30060/*!**************************************************!*\ 30061 !*** ./node_modules/swiper/modules/grid/grid.js ***! 30062 \**************************************************/ 30063/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30064 30065"use strict"; 30066/* unused harmony export default */ 30067function Grid({ 30068 swiper, 30069 extendParams 30070}) { 30071 extendParams({ 30072 grid: { 30073 rows: 1, 30074 fill: 'column' 30075 } 30076 }); 30077 let slidesNumberEvenToRows; 30078 let slidesPerRow; 30079 let numFullColumns; 30080 30081 const initSlides = slidesLength => { 30082 const { 30083 slidesPerView 30084 } = swiper.params; 30085 const { 30086 rows, 30087 fill 30088 } = swiper.params.grid; 30089 slidesPerRow = slidesNumberEvenToRows / rows; 30090 numFullColumns = Math.floor(slidesLength / rows); 30091 30092 if (Math.floor(slidesLength / rows) === slidesLength / rows) { 30093 slidesNumberEvenToRows = slidesLength; 30094 } else { 30095 slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows; 30096 } 30097 30098 if (slidesPerView !== 'auto' && fill === 'row') { 30099 slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows); 30100 } 30101 }; 30102 30103 const updateSlide = (i, slide, slidesLength, getDirectionLabel) => { 30104 const { 30105 slidesPerGroup, 30106 spaceBetween 30107 } = swiper.params; 30108 const { 30109 rows, 30110 fill 30111 } = swiper.params.grid; // Set slides order 30112 30113 let newSlideOrderIndex; 30114 let column; 30115 let row; 30116 30117 if (fill === 'row' && slidesPerGroup > 1) { 30118 const groupIndex = Math.floor(i / (slidesPerGroup * rows)); 30119 const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex; 30120 const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup); 30121 row = Math.floor(slideIndexInGroup / columnsInGroup); 30122 column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup; 30123 newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows; 30124 slide.css({ 30125 '-webkit-order': newSlideOrderIndex, 30126 order: newSlideOrderIndex 30127 }); 30128 } else if (fill === 'column') { 30129 column = Math.floor(i / rows); 30130 row = i - column * rows; 30131 30132 if (column > numFullColumns || column === numFullColumns && row === rows - 1) { 30133 row += 1; 30134 30135 if (row >= rows) { 30136 row = 0; 30137 column += 1; 30138 } 30139 } 30140 } else { 30141 row = Math.floor(i / slidesPerRow); 30142 column = i - row * slidesPerRow; 30143 } 30144 30145 slide.css(getDirectionLabel('margin-top'), row !== 0 ? spaceBetween && `${spaceBetween}px` : ''); 30146 }; 30147 30148 const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => { 30149 const { 30150 spaceBetween, 30151 centeredSlides, 30152 roundLengths 30153 } = swiper.params; 30154 const { 30155 rows 30156 } = swiper.params.grid; 30157 swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows; 30158 swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween; 30159 swiper.$wrapperEl.css({ 30160 [getDirectionLabel('width')]: `${swiper.virtualSize + spaceBetween}px` 30161 }); 30162 30163 if (centeredSlides) { 30164 snapGrid.splice(0, snapGrid.length); 30165 const newSlidesGrid = []; 30166 30167 for (let i = 0; i < snapGrid.length; i += 1) { 30168 let slidesGridItem = snapGrid[i]; 30169 if (roundLengths) slidesGridItem = Math.floor(slidesGridItem); 30170 if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem); 30171 } 30172 30173 snapGrid.push(...newSlidesGrid); 30174 } 30175 }; 30176 30177 swiper.grid = { 30178 initSlides, 30179 updateSlide, 30180 updateWrapperSize 30181 }; 30182} 30183 30184/***/ }), 30185
vendor: 3,631 bytes, lines 30186-30294
30186/***/ "./node_modules/swiper/modules/hash-navigation/hash-navigation.js": 30187/*!************************************************************************!*\ 30188 !*** ./node_modules/swiper/modules/hash-navigation/hash-navigation.js ***! 30189 \************************************************************************/ 30190/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30191 30192"use strict"; 30193/* unused harmony export default */ 30194/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 30195/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 30196 30197 30198function HashNavigation({ 30199 swiper, 30200 extendParams, 30201 emit, 30202 on 30203}) { 30204 let initialized = false; 30205 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 30206 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30207 extendParams({ 30208 hashNavigation: { 30209 enabled: false, 30210 replaceState: false, 30211 watchState: false 30212 } 30213 }); 30214 30215 const onHashChange = () => { 30216 emit('hashChange'); 30217 const newHash = document.location.hash.replace('#', ''); 30218 const activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash'); 30219 30220 if (newHash !== activeSlideHash) { 30221 const newIndex = swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-hash="${newHash}"]`).index(); 30222 if (typeof newIndex === 'undefined') return; 30223 swiper.slideTo(newIndex); 30224 } 30225 }; 30226 30227 const setHash = () => { 30228 if (!initialized || !swiper.params.hashNavigation.enabled) return; 30229 30230 if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) { 30231 window.history.replaceState(null, null, `#${swiper.slides.eq(swiper.activeIndex).attr('data-hash')}` || ''); 30232 emit('hashSet'); 30233 } else { 30234 const slide = swiper.slides.eq(swiper.activeIndex); 30235 const hash = slide.attr('data-hash') || slide.attr('data-history'); 30236 document.location.hash = hash || ''; 30237 emit('hashSet'); 30238 } 30239 }; 30240 30241 const init = () => { 30242 if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return; 30243 initialized = true; 30244 const hash = document.location.hash.replace('#', ''); 30245 30246 if (hash) { 30247 const speed = 0; 30248 30249 for (let i = 0, length = swiper.slides.length; i < length; i += 1) { 30250 const slide = swiper.slides.eq(i); 30251 const slideHash = slide.attr('data-hash') || slide.attr('data-history'); 30252 30253 if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) { 30254 const index = slide.index(); 30255 swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true); 30256 } 30257 } 30258 } 30259 30260 if (swiper.params.hashNavigation.watchState) { 30261 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(window).on('hashchange', onHashChange); 30262 } 30263 }; 30264 30265 const destroy = () => { 30266 if (swiper.params.hashNavigation.watchState) { 30267 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(window).off('hashchange', onHashChange); 30268 } 30269 }; 30270 30271 on('init', () => { 30272 if (swiper.params.hashNavigation.enabled) { 30273 init(); 30274 } 30275 }); 30276 on('destroy', () => { 30277 if (swiper.params.hashNavigation.enabled) { 30278 destroy(); 30279 } 30280 }); 30281 on('transitionEnd _freeModeNoMomentumRelease', () => { 30282 if (initialized) { 30283 setHash(); 30284 } 30285 }); 30286 on('slideChange', () => { 30287 if (initialized && swiper.params.cssMode) { 30288 setHash(); 30289 } 30290 }); 30291} 30292 30293/***/ }), 30294
vendor: 4,655 bytes, lines 30295-30461
30295/***/ "./node_modules/swiper/modules/history/history.js": 30296/*!********************************************************!*\ 30297 !*** ./node_modules/swiper/modules/history/history.js ***! 30298 \********************************************************/ 30299/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30300 30301"use strict"; 30302/* unused harmony export default */ 30303/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 30304 30305function History({ 30306 swiper, 30307 extendParams, 30308 on 30309}) { 30310 extendParams({ 30311 history: { 30312 enabled: false, 30313 root: '', 30314 replaceState: false, 30315 key: 'slides', 30316 keepQuery: false 30317 } 30318 }); 30319 let initialized = false; 30320 let paths = {}; 30321 30322 const slugify = text => { 30323 return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); 30324 }; 30325 30326 const getPathValues = urlOverride => { 30327 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30328 let location; 30329 30330 if (urlOverride) { 30331 location = new URL(urlOverride); 30332 } else { 30333 location = window.location; 30334 } 30335 30336 const pathArray = location.pathname.slice(1).split('/').filter(part => part !== ''); 30337 const total = pathArray.length; 30338 const key = pathArray[total - 2]; 30339 const value = pathArray[total - 1]; 30340 return { 30341 key, 30342 value 30343 }; 30344 }; 30345 30346 const setHistory = (key, index) => { 30347 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30348 if (!initialized || !swiper.params.history.enabled) return; 30349 let location; 30350 30351 if (swiper.params.url) { 30352 location = new URL(swiper.params.url); 30353 } else { 30354 location = window.location; 30355 } 30356 30357 const slide = swiper.slides.eq(index); 30358 let value = slugify(slide.attr('data-history')); 30359 30360 if (swiper.params.history.root.length > 0) { 30361 let root = swiper.params.history.root; 30362 if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1); 30363 value = `${root}/${key}/${value}`; 30364 } else if (!location.pathname.includes(key)) { 30365 value = `${key}/${value}`; 30366 } 30367 30368 if (swiper.params.history.keepQuery) { 30369 value += location.search; 30370 } 30371 30372 const currentState = window.history.state; 30373 30374 if (currentState && currentState.value === value) { 30375 return; 30376 } 30377 30378 if (swiper.params.history.replaceState) { 30379 window.history.replaceState({ 30380 value 30381 }, null, value); 30382 } else { 30383 window.history.pushState({ 30384 value 30385 }, null, value); 30386 } 30387 }; 30388 30389 const scrollToSlide = (speed, value, runCallbacks) => { 30390 if (value) { 30391 for (let i = 0, length = swiper.slides.length; i < length; i += 1) { 30392 const slide = swiper.slides.eq(i); 30393 const slideHistory = slugify(slide.attr('data-history')); 30394 30395 if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) { 30396 const index = slide.index(); 30397 swiper.slideTo(index, speed, runCallbacks); 30398 } 30399 } 30400 } else { 30401 swiper.slideTo(0, speed, runCallbacks); 30402 } 30403 }; 30404 30405 const setHistoryPopState = () => { 30406 paths = getPathValues(swiper.params.url); 30407 scrollToSlide(swiper.params.speed, paths.value, false); 30408 }; 30409 30410 const init = () => { 30411 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30412 if (!swiper.params.history) return; 30413 30414 if (!window.history || !window.history.pushState) { 30415 swiper.params.history.enabled = false; 30416 swiper.params.hashNavigation.enabled = true; 30417 return; 30418 } 30419 30420 initialized = true; 30421 paths = getPathValues(swiper.params.url); 30422 if (!paths.key && !paths.value) return; 30423 scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit); 30424 30425 if (!swiper.params.history.replaceState) { 30426 window.addEventListener('popstate', setHistoryPopState); 30427 } 30428 }; 30429 30430 const destroy = () => { 30431 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30432 30433 if (!swiper.params.history.replaceState) { 30434 window.removeEventListener('popstate', setHistoryPopState); 30435 } 30436 }; 30437 30438 on('init', () => { 30439 if (swiper.params.history.enabled) { 30440 init(); 30441 } 30442 }); 30443 on('destroy', () => { 30444 if (swiper.params.history.enabled) { 30445 destroy(); 30446 } 30447 }); 30448 on('transitionEnd _freeModeNoMomentumRelease', () => { 30449 if (initialized) { 30450 setHistory(swiper.params.history.key, swiper.activeIndex); 30451 } 30452 }); 30453 on('slideChange', () => { 30454 if (initialized && swiper.params.cssMode) { 30455 setHistory(swiper.params.history.key, swiper.activeIndex); 30456 } 30457 }); 30458} 30459 30460/***/ }), 30461
vendor: 5,035 bytes, lines 30462-30605
30462/***/ "./node_modules/swiper/modules/keyboard/keyboard.js": 30463/*!**********************************************************!*\ 30464 !*** ./node_modules/swiper/modules/keyboard/keyboard.js ***! 30465 \**********************************************************/ 30466/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30467 30468"use strict"; 30469/* unused harmony export default */ 30470/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 30471/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 30472/* eslint-disable consistent-return */ 30473 30474 30475function Keyboard({ 30476 swiper, 30477 extendParams, 30478 on, 30479 emit 30480}) { 30481 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 30482 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30483 swiper.keyboard = { 30484 enabled: false 30485 }; 30486 extendParams({ 30487 keyboard: { 30488 enabled: false, 30489 onlyInViewport: true, 30490 pageUpDown: true 30491 } 30492 }); 30493 30494 function handle(event) { 30495 if (!swiper.enabled) return; 30496 const { 30497 rtlTranslate: rtl 30498 } = swiper; 30499 let e = event; 30500 if (e.originalEvent) e = e.originalEvent; // jquery fix 30501 30502 const kc = e.keyCode || e.charCode; 30503 const pageUpDown = swiper.params.keyboard.pageUpDown; 30504 const isPageUp = pageUpDown && kc === 33; 30505 const isPageDown = pageUpDown && kc === 34; 30506 const isArrowLeft = kc === 37; 30507 const isArrowRight = kc === 39; 30508 const isArrowUp = kc === 38; 30509 const isArrowDown = kc === 40; // Directions locks 30510 30511 if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { 30512 return false; 30513 } 30514 30515 if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { 30516 return false; 30517 } 30518 30519 if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { 30520 return undefined; 30521 } 30522 30523 if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { 30524 return undefined; 30525 } 30526 30527 if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { 30528 let inView = false; // Check that swiper should be inside of visible area of window 30529 30530 if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) { 30531 return undefined; 30532 } 30533 30534 const $el = swiper.$el; 30535 const swiperWidth = $el[0].clientWidth; 30536 const swiperHeight = $el[0].clientHeight; 30537 const windowWidth = window.innerWidth; 30538 const windowHeight = window.innerHeight; 30539 const swiperOffset = swiper.$el.offset(); 30540 if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; 30541 const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; 30542 30543 for (let i = 0; i < swiperCoord.length; i += 1) { 30544 const point = swiperCoord[i]; 30545 30546 if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { 30547 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 30548 30549 inView = true; 30550 } 30551 } 30552 30553 if (!inView) return undefined; 30554 } 30555 30556 if (swiper.isHorizontal()) { 30557 if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { 30558 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 30559 } 30560 30561 if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); 30562 if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); 30563 } else { 30564 if (isPageUp || isPageDown || isArrowUp || isArrowDown) { 30565 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 30566 } 30567 30568 if (isPageDown || isArrowDown) swiper.slideNext(); 30569 if (isPageUp || isArrowUp) swiper.slidePrev(); 30570 } 30571 30572 emit('keyPress', kc); 30573 return undefined; 30574 } 30575 30576 function enable() { 30577 if (swiper.keyboard.enabled) return; 30578 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(document).on('keydown', handle); 30579 swiper.keyboard.enabled = true; 30580 } 30581 30582 function disable() { 30583 if (!swiper.keyboard.enabled) return; 30584 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(document).off('keydown', handle); 30585 swiper.keyboard.enabled = false; 30586 } 30587 30588 on('init', () => { 30589 if (swiper.params.keyboard.enabled) { 30590 enable(); 30591 } 30592 }); 30593 on('destroy', () => { 30594 if (swiper.keyboard.enabled) { 30595 disable(); 30596 } 30597 }); 30598 Object.assign(swiper.keyboard, { 30599 enable, 30600 disable 30601 }); 30602} 30603 30604/***/ }), 30605
vendor: 10,794 bytes, lines 30606-30905
30606/***/ "./node_modules/swiper/modules/lazy/lazy.js": 30607/*!**************************************************!*\ 30608 !*** ./node_modules/swiper/modules/lazy/lazy.js ***! 30609 \**************************************************/ 30610/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30611 30612"use strict"; 30613/* unused harmony export default */ 30614/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 30615/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 30616 30617 30618function Lazy({ 30619 swiper, 30620 extendParams, 30621 on, 30622 emit 30623}) { 30624 extendParams({ 30625 lazy: { 30626 checkInView: false, 30627 enabled: false, 30628 loadPrevNext: false, 30629 loadPrevNextAmount: 1, 30630 loadOnTransitionStart: false, 30631 scrollingElement: '', 30632 elementClass: 'swiper-lazy', 30633 loadingClass: 'swiper-lazy-loading', 30634 loadedClass: 'swiper-lazy-loaded', 30635 preloaderClass: 'swiper-lazy-preloader' 30636 } 30637 }); 30638 swiper.lazy = {}; 30639 let scrollHandlerAttached = false; 30640 let initialImageLoaded = false; 30641 30642 function loadInSlide(index, loadInDuplicate = true) { 30643 const params = swiper.params.lazy; 30644 if (typeof index === 'undefined') return; 30645 if (swiper.slides.length === 0) return; 30646 const isVirtual = swiper.virtual && swiper.params.virtual.enabled; 30647 const $slideEl = isVirtual ? swiper.$wrapperEl.children(`.${swiper.params.slideClass}[data-swiper-slide-index="${index}"]`) : swiper.slides.eq(index); 30648 const $images = $slideEl.find(`.${params.elementClass}:not(.${params.loadedClass}):not(.${params.loadingClass})`); 30649 30650 if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) { 30651 $images.push($slideEl[0]); 30652 } 30653 30654 if ($images.length === 0) return; 30655 $images.each(imageEl => { 30656 const $imageEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(imageEl); 30657 $imageEl.addClass(params.loadingClass); 30658 const background = $imageEl.attr('data-background'); 30659 const src = $imageEl.attr('data-src'); 30660 const srcset = $imageEl.attr('data-srcset'); 30661 const sizes = $imageEl.attr('data-sizes'); 30662 const $pictureEl = $imageEl.parent('picture'); 30663 swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, () => { 30664 if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) return; 30665 30666 if (background) { 30667 $imageEl.css('background-image', `url("${background}")`); 30668 $imageEl.removeAttr('data-background'); 30669 } else { 30670 if (srcset) { 30671 $imageEl.attr('srcset', srcset); 30672 $imageEl.removeAttr('data-srcset'); 30673 } 30674 30675 if (sizes) { 30676 $imageEl.attr('sizes', sizes); 30677 $imageEl.removeAttr('data-sizes'); 30678 } 30679 30680 if ($pictureEl.length) { 30681 $pictureEl.children('source').each(sourceEl => { 30682 const $source = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sourceEl); 30683 30684 if ($source.attr('data-srcset')) { 30685 $source.attr('srcset', $source.attr('data-srcset')); 30686 $source.removeAttr('data-srcset'); 30687 } 30688 }); 30689 } 30690 30691 if (src) { 30692 $imageEl.attr('src', src); 30693 $imageEl.removeAttr('data-src'); 30694 } 30695 } 30696 30697 $imageEl.addClass(params.loadedClass).removeClass(params.loadingClass); 30698 $slideEl.find(`.${params.preloaderClass}`).remove(); 30699 30700 if (swiper.params.loop && loadInDuplicate) { 30701 const slideOriginalIndex = $slideEl.attr('data-swiper-slide-index'); 30702 30703 if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) { 30704 const originalSlide = swiper.$wrapperEl.children(`[data-swiper-slide-index="${slideOriginalIndex}"]:not(.${swiper.params.slideDuplicateClass})`); 30705 loadInSlide(originalSlide.index(), false); 30706 } else { 30707 const duplicatedSlide = swiper.$wrapperEl.children(`.${swiper.params.slideDuplicateClass}[data-swiper-slide-index="${slideOriginalIndex}"]`); 30708 loadInSlide(duplicatedSlide.index(), false); 30709 } 30710 } 30711 30712 emit('lazyImageReady', $slideEl[0], $imageEl[0]); 30713 30714 if (swiper.params.autoHeight) { 30715 swiper.updateAutoHeight(); 30716 } 30717 }); 30718 emit('lazyImageLoad', $slideEl[0], $imageEl[0]); 30719 }); 30720 } 30721 30722 function load() { 30723 const { 30724 $wrapperEl, 30725 params: swiperParams, 30726 slides, 30727 activeIndex 30728 } = swiper; 30729 const isVirtual = swiper.virtual && swiperParams.virtual.enabled; 30730 const params = swiperParams.lazy; 30731 let slidesPerView = swiperParams.slidesPerView; 30732 30733 if (slidesPerView === 'auto') { 30734 slidesPerView = 0; 30735 } 30736 30737 function slideExist(index) { 30738 if (isVirtual) { 30739 if ($wrapperEl.children(`.${swiperParams.slideClass}[data-swiper-slide-index="${index}"]`).length) { 30740 return true; 30741 } 30742 } else if (slides[index]) return true; 30743 30744 return false; 30745 } 30746 30747 function slideIndex(slideEl) { 30748 if (isVirtual) { 30749 return (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(slideEl).attr('data-swiper-slide-index'); 30750 } 30751 30752 return (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(slideEl).index(); 30753 } 30754 30755 if (!initialImageLoaded) initialImageLoaded = true; 30756 30757 if (swiper.params.watchSlidesProgress) { 30758 $wrapperEl.children(`.${swiperParams.slideVisibleClass}`).each(slideEl => { 30759 const index = isVirtual ? (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(slideEl).attr('data-swiper-slide-index') : (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(slideEl).index(); 30760 loadInSlide(index); 30761 }); 30762 } else if (slidesPerView > 1) { 30763 for (let i = activeIndex; i < activeIndex + slidesPerView; i += 1) { 30764 if (slideExist(i)) loadInSlide(i); 30765 } 30766 } else { 30767 loadInSlide(activeIndex); 30768 } 30769 30770 if (params.loadPrevNext) { 30771 if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) { 30772 const amount = params.loadPrevNextAmount; 30773 const spv = Math.ceil(slidesPerView); 30774 const maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length); 30775 const minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides 30776 30777 for (let i = activeIndex + spv; i < maxIndex; i += 1) { 30778 if (slideExist(i)) loadInSlide(i); 30779 } // Prev Slides 30780 30781 30782 for (let i = minIndex; i < activeIndex; i += 1) { 30783 if (slideExist(i)) loadInSlide(i); 30784 } 30785 } else { 30786 const nextSlide = $wrapperEl.children(`.${swiperParams.slideNextClass}`); 30787 if (nextSlide.length > 0) loadInSlide(slideIndex(nextSlide)); 30788 const prevSlide = $wrapperEl.children(`.${swiperParams.slidePrevClass}`); 30789 if (prevSlide.length > 0) loadInSlide(slideIndex(prevSlide)); 30790 } 30791 } 30792 } 30793 30794 function checkInViewOnLoad() { 30795 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 30796 if (!swiper || swiper.destroyed) return; 30797 const $scrollElement = swiper.params.lazy.scrollingElement ? (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(swiper.params.lazy.scrollingElement) : (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(window); 30798 const isWindow = $scrollElement[0] === window; 30799 const scrollElementWidth = isWindow ? window.innerWidth : $scrollElement[0].offsetWidth; 30800 const scrollElementHeight = isWindow ? window.innerHeight : $scrollElement[0].offsetHeight; 30801 const swiperOffset = swiper.$el.offset(); 30802 const { 30803 rtlTranslate: rtl 30804 } = swiper; 30805 let inView = false; 30806 if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; 30807 const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]]; 30808 30809 for (let i = 0; i < swiperCoord.length; i += 1) { 30810 const point = swiperCoord[i]; 30811 30812 if (point[0] >= 0 && point[0] <= scrollElementWidth && point[1] >= 0 && point[1] <= scrollElementHeight) { 30813 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 30814 30815 inView = true; 30816 } 30817 } 30818 30819 const passiveListener = swiper.touchEvents.start === 'touchstart' && swiper.support.passiveListener && swiper.params.passiveListeners ? { 30820 passive: true, 30821 capture: false 30822 } : false; 30823 30824 if (inView) { 30825 load(); 30826 $scrollElement.off('scroll', checkInViewOnLoad, passiveListener); 30827 } else if (!scrollHandlerAttached) { 30828 scrollHandlerAttached = true; 30829 $scrollElement.on('scroll', checkInViewOnLoad, passiveListener); 30830 } 30831 } 30832 30833 on('beforeInit', () => { 30834 if (swiper.params.lazy.enabled && swiper.params.preloadImages) { 30835 swiper.params.preloadImages = false; 30836 } 30837 }); 30838 on('init', () => { 30839 if (swiper.params.lazy.enabled) { 30840 if (swiper.params.lazy.checkInView) { 30841 checkInViewOnLoad(); 30842 } else { 30843 load(); 30844 } 30845 } 30846 }); 30847 on('scroll', () => { 30848 if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.freeMode.sticky) { 30849 load(); 30850 } 30851 }); 30852 on('scrollbarDragMove resize _freeModeNoMomentumRelease', () => { 30853 if (swiper.params.lazy.enabled) { 30854 if (swiper.params.lazy.checkInView) { 30855 checkInViewOnLoad(); 30856 } else { 30857 load(); 30858 } 30859 } 30860 }); 30861 on('transitionStart', () => { 30862 if (swiper.params.lazy.enabled) { 30863 if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !initialImageLoaded) { 30864 if (swiper.params.lazy.checkInView) { 30865 checkInViewOnLoad(); 30866 } else { 30867 load(); 30868 } 30869 } 30870 } 30871 }); 30872 on('transitionEnd', () => { 30873 if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) { 30874 if (swiper.params.lazy.checkInView) { 30875 checkInViewOnLoad(); 30876 } else { 30877 load(); 30878 } 30879 } 30880 }); 30881 on('slideChange', () => { 30882 const { 30883 lazy, 30884 cssMode, 30885 watchSlidesProgress, 30886 touchReleaseOnEdges, 30887 resistanceRatio 30888 } = swiper.params; 30889 30890 if (lazy.enabled && (cssMode || watchSlidesProgress && (touchReleaseOnEdges || resistanceRatio === 0))) { 30891 load(); 30892 } 30893 }); 30894 on('destroy', () => { 30895 if (!swiper.$el) return; 30896 swiper.$el.find(`.${swiper.params.lazy.loadingClass}`).removeClass(swiper.params.lazy.loadingClass); 30897 }); 30898 Object.assign(swiper.lazy, { 30899 load, 30900 loadInSlide 30901 }); 30902} 30903 30904/***/ }), 30905
vendor: 2,014 bytes, lines 30906-30937
30906/***/ "./node_modules/swiper/modules/manipulation/manipulation.js": 30907/*!******************************************************************!*\ 30908 !*** ./node_modules/swiper/modules/manipulation/manipulation.js ***! 30909 \******************************************************************/ 30910/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30911 30912"use strict"; 30913/* unused harmony export default */ 30914/* harmony import */ var _methods_appendSlide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./methods/appendSlide.js */ "./node_modules/swiper/modules/manipulation/methods/appendSlide.js"); 30915/* harmony import */ var _methods_prependSlide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./methods/prependSlide.js */ "./node_modules/swiper/modules/manipulation/methods/prependSlide.js"); 30916/* harmony import */ var _methods_addSlide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./methods/addSlide.js */ "./node_modules/swiper/modules/manipulation/methods/addSlide.js"); 30917/* harmony import */ var _methods_removeSlide_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./methods/removeSlide.js */ "./node_modules/swiper/modules/manipulation/methods/removeSlide.js"); 30918/* harmony import */ var _methods_removeAllSlides_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./methods/removeAllSlides.js */ "./node_modules/swiper/modules/manipulation/methods/removeAllSlides.js"); 30919 30920 30921 30922 30923 30924function Manipulation({ 30925 swiper 30926}) { 30927 Object.assign(swiper, { 30928 appendSlide: _methods_appendSlide_js__WEBPACK_IMPORTED_MODULE_0__["default"].bind(swiper), 30929 prependSlide: _methods_prependSlide_js__WEBPACK_IMPORTED_MODULE_1__["default"].bind(swiper), 30930 addSlide: _methods_addSlide_js__WEBPACK_IMPORTED_MODULE_2__["default"].bind(swiper), 30931 removeSlide: _methods_removeSlide_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind(swiper), 30932 removeAllSlides: _methods_removeAllSlides_js__WEBPACK_IMPORTED_MODULE_4__["default"].bind(swiper) 30933 }); 30934} 30935 30936/***/ }), 30937
vendor: 2,078 bytes, lines 30938-31014
30938/***/ "./node_modules/swiper/modules/manipulation/methods/addSlide.js": 30939/*!**********************************************************************!*\ 30940 !*** ./node_modules/swiper/modules/manipulation/methods/addSlide.js ***! 30941 \**********************************************************************/ 30942/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30943 30944"use strict"; 30945/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30946/* harmony export */ "default": function() { return /* binding */ addSlide; } 30947/* harmony export */ }); 30948function addSlide(index, slides) { 30949 const swiper = this; 30950 const { 30951 $wrapperEl, 30952 params, 30953 activeIndex 30954 } = swiper; 30955 let activeIndexBuffer = activeIndex; 30956 30957 if (params.loop) { 30958 activeIndexBuffer -= swiper.loopedSlides; 30959 swiper.loopDestroy(); 30960 swiper.slides = $wrapperEl.children(`.${params.slideClass}`); 30961 } 30962 30963 const baseLength = swiper.slides.length; 30964 30965 if (index <= 0) { 30966 swiper.prependSlide(slides); 30967 return; 30968 } 30969 30970 if (index >= baseLength) { 30971 swiper.appendSlide(slides); 30972 return; 30973 } 30974 30975 let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer; 30976 const slidesBuffer = []; 30977 30978 for (let i = baseLength - 1; i >= index; i -= 1) { 30979 const currentSlide = swiper.slides.eq(i); 30980 currentSlide.remove(); 30981 slidesBuffer.unshift(currentSlide); 30982 } 30983 30984 if (typeof slides === 'object' && 'length' in slides) { 30985 for (let i = 0; i < slides.length; i += 1) { 30986 if (slides[i]) $wrapperEl.append(slides[i]); 30987 } 30988 30989 newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer; 30990 } else { 30991 $wrapperEl.append(slides); 30992 } 30993 30994 for (let i = 0; i < slidesBuffer.length; i += 1) { 30995 $wrapperEl.append(slidesBuffer[i]); 30996 } 30997 30998 if (params.loop) { 30999 swiper.loopCreate(); 31000 } 31001 31002 if (!params.observer) { 31003 swiper.update(); 31004 } 31005 31006 if (params.loop) { 31007 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 31008 } else { 31009 swiper.slideTo(newActiveIndex, 0, false); 31010 } 31011} 31012 31013/***/ }), 31014
vendor: 1,082 bytes, lines 31015-31054
31015/***/ "./node_modules/swiper/modules/manipulation/methods/appendSlide.js": 31016/*!*************************************************************************!*\ 31017 !*** ./node_modules/swiper/modules/manipulation/methods/appendSlide.js ***! 31018 \*************************************************************************/ 31019/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31020 31021"use strict"; 31022/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31023/* harmony export */ "default": function() { return /* binding */ appendSlide; } 31024/* harmony export */ }); 31025function appendSlide(slides) { 31026 const swiper = this; 31027 const { 31028 $wrapperEl, 31029 params 31030 } = swiper; 31031 31032 if (params.loop) { 31033 swiper.loopDestroy(); 31034 } 31035 31036 if (typeof slides === 'object' && 'length' in slides) { 31037 for (let i = 0; i < slides.length; i += 1) { 31038 if (slides[i]) $wrapperEl.append(slides[i]); 31039 } 31040 } else { 31041 $wrapperEl.append(slides); 31042 } 31043 31044 if (params.loop) { 31045 swiper.loopCreate(); 31046 } 31047 31048 if (!params.observer) { 31049 swiper.update(); 31050 } 31051} 31052 31053/***/ }), 31054
vendor: 1,244 bytes, lines 31055-31101
31055/***/ "./node_modules/swiper/modules/manipulation/methods/prependSlide.js": 31056/*!**************************************************************************!*\ 31057 !*** ./node_modules/swiper/modules/manipulation/methods/prependSlide.js ***! 31058 \**************************************************************************/ 31059/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31060 31061"use strict"; 31062/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31063/* harmony export */ "default": function() { return /* binding */ prependSlide; } 31064/* harmony export */ }); 31065function prependSlide(slides) { 31066 const swiper = this; 31067 const { 31068 params, 31069 $wrapperEl, 31070 activeIndex 31071 } = swiper; 31072 31073 if (params.loop) { 31074 swiper.loopDestroy(); 31075 } 31076 31077 let newActiveIndex = activeIndex + 1; 31078 31079 if (typeof slides === 'object' && 'length' in slides) { 31080 for (let i = 0; i < slides.length; i += 1) { 31081 if (slides[i]) $wrapperEl.prepend(slides[i]); 31082 } 31083 31084 newActiveIndex = activeIndex + slides.length; 31085 } else { 31086 $wrapperEl.prepend(slides); 31087 } 31088 31089 if (params.loop) { 31090 swiper.loopCreate(); 31091 } 31092 31093 if (!params.observer) { 31094 swiper.update(); 31095 } 31096 31097 swiper.slideTo(newActiveIndex, 0, false); 31098} 31099 31100/***/ }), 31101
vendor: 835 bytes, lines 31102-31124
31102/***/ "./node_modules/swiper/modules/manipulation/methods/removeAllSlides.js": 31103/*!*****************************************************************************!*\ 31104 !*** ./node_modules/swiper/modules/manipulation/methods/removeAllSlides.js ***! 31105 \*****************************************************************************/ 31106/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31107 31108"use strict"; 31109/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31110/* harmony export */ "default": function() { return /* binding */ removeAllSlides; } 31111/* harmony export */ }); 31112function removeAllSlides() { 31113 const swiper = this; 31114 const slidesIndexes = []; 31115 31116 for (let i = 0; i < swiper.slides.length; i += 1) { 31117 slidesIndexes.push(i); 31118 } 31119 31120 swiper.removeSlide(slidesIndexes); 31121} 31122 31123/***/ }), 31124
vendor: 1,873 bytes, lines 31125-31184
31125/***/ "./node_modules/swiper/modules/manipulation/methods/removeSlide.js": 31126/*!*************************************************************************!*\ 31127 !*** ./node_modules/swiper/modules/manipulation/methods/removeSlide.js ***! 31128 \*************************************************************************/ 31129/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31130 31131"use strict"; 31132/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31133/* harmony export */ "default": function() { return /* binding */ removeSlide; } 31134/* harmony export */ }); 31135function removeSlide(slidesIndexes) { 31136 const swiper = this; 31137 const { 31138 params, 31139 $wrapperEl, 31140 activeIndex 31141 } = swiper; 31142 let activeIndexBuffer = activeIndex; 31143 31144 if (params.loop) { 31145 activeIndexBuffer -= swiper.loopedSlides; 31146 swiper.loopDestroy(); 31147 swiper.slides = $wrapperEl.children(`.${params.slideClass}`); 31148 } 31149 31150 let newActiveIndex = activeIndexBuffer; 31151 let indexToRemove; 31152 31153 if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) { 31154 for (let i = 0; i < slidesIndexes.length; i += 1) { 31155 indexToRemove = slidesIndexes[i]; 31156 if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); 31157 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 31158 } 31159 31160 newActiveIndex = Math.max(newActiveIndex, 0); 31161 } else { 31162 indexToRemove = slidesIndexes; 31163 if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove(); 31164 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 31165 newActiveIndex = Math.max(newActiveIndex, 0); 31166 } 31167 31168 if (params.loop) { 31169 swiper.loopCreate(); 31170 } 31171 31172 if (!params.observer) { 31173 swiper.update(); 31174 } 31175 31176 if (params.loop) { 31177 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 31178 } else { 31179 swiper.slideTo(newActiveIndex, 0, false); 31180 } 31181} 31182 31183/***/ }), 31184
vendor: 15,421 bytes, lines 31185-31620
31185/***/ "./node_modules/swiper/modules/mousewheel/mousewheel.js": 31186/*!**************************************************************!*\ 31187 !*** ./node_modules/swiper/modules/mousewheel/mousewheel.js ***! 31188 \**************************************************************/ 31189/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31190 31191"use strict"; 31192/* unused harmony export default */ 31193/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 31194/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 31195/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 31196/* eslint-disable consistent-return */ 31197 31198 31199 31200function Mousewheel({ 31201 swiper, 31202 extendParams, 31203 on, 31204 emit 31205}) { 31206 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 31207 extendParams({ 31208 mousewheel: { 31209 enabled: false, 31210 releaseOnEdges: false, 31211 invert: false, 31212 forceToAxis: false, 31213 sensitivity: 1, 31214 eventsTarget: 'container', 31215 thresholdDelta: null, 31216 thresholdTime: null 31217 } 31218 }); 31219 swiper.mousewheel = { 31220 enabled: false 31221 }; 31222 let timeout; 31223 let lastScrollTime = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(); 31224 let lastEventBeforeSnap; 31225 const recentWheelEvents = []; 31226 31227 function normalize(e) { 31228 // Reasonable defaults 31229 const PIXEL_STEP = 10; 31230 const LINE_HEIGHT = 40; 31231 const PAGE_HEIGHT = 800; 31232 let sX = 0; 31233 let sY = 0; // spinX, spinY 31234 31235 let pX = 0; 31236 let pY = 0; // pixelX, pixelY 31237 // Legacy 31238 31239 if ('detail' in e) { 31240 sY = e.detail; 31241 } 31242 31243 if ('wheelDelta' in e) { 31244 sY = -e.wheelDelta / 120; 31245 } 31246 31247 if ('wheelDeltaY' in e) { 31248 sY = -e.wheelDeltaY / 120; 31249 } 31250 31251 if ('wheelDeltaX' in e) { 31252 sX = -e.wheelDeltaX / 120; 31253 } // side scrolling on FF with DOMMouseScroll 31254 31255 31256 if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { 31257 sX = sY; 31258 sY = 0; 31259 } 31260 31261 pX = sX * PIXEL_STEP; 31262 pY = sY * PIXEL_STEP; 31263 31264 if ('deltaY' in e) { 31265 pY = e.deltaY; 31266 } 31267 31268 if ('deltaX' in e) { 31269 pX = e.deltaX; 31270 } 31271 31272 if (e.shiftKey && !pX) { 31273 // if user scrolls with shift he wants horizontal scroll 31274 pX = pY; 31275 pY = 0; 31276 } 31277 31278 if ((pX || pY) && e.deltaMode) { 31279 if (e.deltaMode === 1) { 31280 // delta in LINE units 31281 pX *= LINE_HEIGHT; 31282 pY *= LINE_HEIGHT; 31283 } else { 31284 // delta in PAGE units 31285 pX *= PAGE_HEIGHT; 31286 pY *= PAGE_HEIGHT; 31287 } 31288 } // Fall-back if spin cannot be determined 31289 31290 31291 if (pX && !sX) { 31292 sX = pX < 1 ? -1 : 1; 31293 } 31294 31295 if (pY && !sY) { 31296 sY = pY < 1 ? -1 : 1; 31297 } 31298 31299 return { 31300 spinX: sX, 31301 spinY: sY, 31302 pixelX: pX, 31303 pixelY: pY 31304 }; 31305 } 31306 31307 function handleMouseEnter() { 31308 if (!swiper.enabled) return; 31309 swiper.mouseEntered = true; 31310 } 31311 31312 function handleMouseLeave() { 31313 if (!swiper.enabled) return; 31314 swiper.mouseEntered = false; 31315 } 31316 31317 function animateSlider(newEvent) { 31318 if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) { 31319 // Prevent if delta of wheel scroll delta is below configured threshold 31320 return false; 31321 } 31322 31323 if (swiper.params.mousewheel.thresholdTime && (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)() - lastScrollTime < swiper.params.mousewheel.thresholdTime) { 31324 // Prevent if time between scrolls is below configured threshold 31325 return false; 31326 } // If the movement is NOT big enough and 31327 // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider): 31328 // Don't go any further (avoid insignificant scroll movement). 31329 31330 31331 if (newEvent.delta >= 6 && (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)() - lastScrollTime < 60) { 31332 // Return false as a default 31333 return true; 31334 } // If user is scrolling towards the end: 31335 // If the slider hasn't hit the latest slide or 31336 // if the slider is a loop and 31337 // if the slider isn't moving right now: 31338 // Go to next slide and 31339 // emit a scroll event. 31340 // Else (the user is scrolling towards the beginning) and 31341 // if the slider hasn't hit the first slide or 31342 // if the slider is a loop and 31343 // if the slider isn't moving right now: 31344 // Go to prev slide and 31345 // emit a scroll event. 31346 31347 31348 if (newEvent.direction < 0) { 31349 if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) { 31350 swiper.slideNext(); 31351 emit('scroll', newEvent.raw); 31352 } 31353 } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) { 31354 swiper.slidePrev(); 31355 emit('scroll', newEvent.raw); 31356 } // If you got here is because an animation has been triggered so store the current time 31357 31358 31359 lastScrollTime = new window.Date().getTime(); // Return false as a default 31360 31361 return false; 31362 } 31363 31364 function releaseScroll(newEvent) { 31365 const params = swiper.params.mousewheel; 31366 31367 if (newEvent.direction < 0) { 31368 if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) { 31369 // Return true to animate scroll on edges 31370 return true; 31371 } 31372 } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) { 31373 // Return true to animate scroll on edges 31374 return true; 31375 } 31376 31377 return false; 31378 } 31379 31380 function handle(event) { 31381 let e = event; 31382 let disableParentSwiper = true; 31383 if (!swiper.enabled) return; 31384 const params = swiper.params.mousewheel; 31385 31386 if (swiper.params.cssMode) { 31387 e.preventDefault(); 31388 } 31389 31390 let target = swiper.$el; 31391 31392 if (swiper.params.mousewheel.eventsTarget !== 'container') { 31393 target = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(swiper.params.mousewheel.eventsTarget); 31394 } 31395 31396 if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true; 31397 if (e.originalEvent) e = e.originalEvent; // jquery fix 31398 31399 let delta = 0; 31400 const rtlFactor = swiper.rtlTranslate ? -1 : 1; 31401 const data = normalize(e); 31402 31403 if (params.forceToAxis) { 31404 if (swiper.isHorizontal()) { 31405 if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true; 31406 } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true; 31407 } else { 31408 delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY; 31409 } 31410 31411 if (delta === 0) return true; 31412 if (params.invert) delta = -delta; // Get the scroll positions 31413 31414 let positions = swiper.getTranslate() + delta * params.sensitivity; 31415 if (positions >= swiper.minTranslate()) positions = swiper.minTranslate(); 31416 if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); // When loop is true: 31417 // the disableParentSwiper will be true. 31418 // When loop is false: 31419 // if the scroll positions is not on edge, 31420 // then the disableParentSwiper will be true. 31421 // if the scroll on edge positions, 31422 // then the disableParentSwiper will be false. 31423 31424 disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate()); 31425 if (disableParentSwiper && swiper.params.nested) e.stopPropagation(); 31426 31427 if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) { 31428 // Register the new event in a variable which stores the relevant data 31429 const newEvent = { 31430 time: (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(), 31431 delta: Math.abs(delta), 31432 direction: Math.sign(delta), 31433 raw: event 31434 }; // Keep the most recent events 31435 31436 if (recentWheelEvents.length >= 2) { 31437 recentWheelEvents.shift(); // only store the last N events 31438 } 31439 31440 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 31441 recentWheelEvents.push(newEvent); // If there is at least one previous recorded event: 31442 // If direction has changed or 31443 // if the scroll is quicker than the previous one: 31444 // Animate the slider. 31445 // Else (this is the first time the wheel is moved): 31446 // Animate the slider. 31447 31448 if (prevEvent) { 31449 if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) { 31450 animateSlider(newEvent); 31451 } 31452 } else { 31453 animateSlider(newEvent); 31454 } // If it's time to release the scroll: 31455 // Return now so you don't hit the preventDefault. 31456 31457 31458 if (releaseScroll(newEvent)) { 31459 return true; 31460 } 31461 } else { 31462 // Freemode or scrollContainer: 31463 // If we recently snapped after a momentum scroll, then ignore wheel events 31464 // to give time for the deceleration to finish. Stop ignoring after 500 msecs 31465 // or if it's a new scroll (larger delta or inverse sign as last event before 31466 // an end-of-momentum snap). 31467 const newEvent = { 31468 time: (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.now)(), 31469 delta: Math.abs(delta), 31470 direction: Math.sign(delta) 31471 }; 31472 const ignoreWheelEvents = lastEventBeforeSnap && newEvent.time < lastEventBeforeSnap.time + 500 && newEvent.delta <= lastEventBeforeSnap.delta && newEvent.direction === lastEventBeforeSnap.direction; 31473 31474 if (!ignoreWheelEvents) { 31475 lastEventBeforeSnap = undefined; 31476 31477 if (swiper.params.loop) { 31478 swiper.loopFix(); 31479 } 31480 31481 let position = swiper.getTranslate() + delta * params.sensitivity; 31482 const wasBeginning = swiper.isBeginning; 31483 const wasEnd = swiper.isEnd; 31484 if (position >= swiper.minTranslate()) position = swiper.minTranslate(); 31485 if (position <= swiper.maxTranslate()) position = swiper.maxTranslate(); 31486 swiper.setTransition(0); 31487 swiper.setTranslate(position); 31488 swiper.updateProgress(); 31489 swiper.updateActiveIndex(); 31490 swiper.updateSlidesClasses(); 31491 31492 if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) { 31493 swiper.updateSlidesClasses(); 31494 } 31495 31496 if (swiper.params.freeMode.sticky) { 31497 // When wheel scrolling starts with sticky (aka snap) enabled, then detect 31498 // the end of a momentum scroll by storing recent (N=15?) wheel events. 31499 // 1. do all N events have decreasing or same (absolute value) delta? 31500 // 2. did all N events arrive in the last M (M=500?) msecs? 31501 // 3. does the earliest event have an (absolute value) delta that's 31502 // at least P (P=1?) larger than the most recent event's delta? 31503 // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels? 31504 // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration. 31505 // Snap immediately and ignore remaining wheel events in this scroll. 31506 // See comment above for "remaining wheel events in this scroll" determination. 31507 // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event. 31508 clearTimeout(timeout); 31509 timeout = undefined; 31510 31511 if (recentWheelEvents.length >= 15) { 31512 recentWheelEvents.shift(); // only store the last N events 31513 } 31514 31515 const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 31516 const firstEvent = recentWheelEvents[0]; 31517 recentWheelEvents.push(newEvent); 31518 31519 if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) { 31520 // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log. 31521 recentWheelEvents.splice(0); 31522 } else if (recentWheelEvents.length >= 15 && newEvent.time - firstEvent.time < 500 && firstEvent.delta - newEvent.delta >= 1 && newEvent.delta <= 6) { 31523 // We're at the end of the deceleration of a momentum scroll, so there's no need 31524 // to wait for more events. Snap ASAP on the next tick. 31525 // Also, because there's some remaining momentum we'll bias the snap in the 31526 // direction of the ongoing scroll because it's better UX for the scroll to snap 31527 // in the same direction as the scroll instead of reversing to snap. Therefore, 31528 // if it's already scrolled more than 20% in the current direction, keep going. 31529 const snapToThreshold = delta > 0 ? 0.8 : 0.2; 31530 lastEventBeforeSnap = newEvent; 31531 recentWheelEvents.splice(0); 31532 timeout = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.nextTick)(() => { 31533 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 31534 }, 0); // no delay; move on next tick 31535 } 31536 31537 if (!timeout) { 31538 // if we get here, then we haven't detected the end of a momentum scroll, so 31539 // we'll consider a scroll "complete" when there haven't been any wheel events 31540 // for 500ms. 31541 timeout = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.nextTick)(() => { 31542 const snapToThreshold = 0.5; 31543 lastEventBeforeSnap = newEvent; 31544 recentWheelEvents.splice(0); 31545 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 31546 }, 500); 31547 } 31548 } // Emit event 31549 31550 31551 if (!ignoreWheelEvents) emit('scroll', e); // Stop autoplay 31552 31553 if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); // Return page scroll on edge positions 31554 31555 if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true; 31556 } 31557 } 31558 31559 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 31560 return false; 31561 } 31562 31563 function events(method) { 31564 let target = swiper.$el; 31565 31566 if (swiper.params.mousewheel.eventsTarget !== 'container') { 31567 target = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(swiper.params.mousewheel.eventsTarget); 31568 } 31569 31570 target[method]('mouseenter', handleMouseEnter); 31571 target[method]('mouseleave', handleMouseLeave); 31572 target[method]('wheel', handle); 31573 } 31574 31575 function enable() { 31576 if (swiper.params.cssMode) { 31577 swiper.wrapperEl.removeEventListener('wheel', handle); 31578 return true; 31579 } 31580 31581 if (swiper.mousewheel.enabled) return false; 31582 events('on'); 31583 swiper.mousewheel.enabled = true; 31584 return true; 31585 } 31586 31587 function disable() { 31588 if (swiper.params.cssMode) { 31589 swiper.wrapperEl.addEventListener(event, handle); 31590 return true; 31591 } 31592 31593 if (!swiper.mousewheel.enabled) return false; 31594 events('off'); 31595 swiper.mousewheel.enabled = false; 31596 return true; 31597 } 31598 31599 on('init', () => { 31600 if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) { 31601 disable(); 31602 } 31603 31604 if (swiper.params.mousewheel.enabled) enable(); 31605 }); 31606 on('destroy', () => { 31607 if (swiper.params.cssMode) { 31608 enable(); 31609 } 31610 31611 if (swiper.mousewheel.enabled) disable(); 31612 }); 31613 Object.assign(swiper.mousewheel, { 31614 enable, 31615 disable 31616 }); 31617} 31618 31619/***/ }), 31620
vendor: 6,138 bytes, lines 31621-31840
31621/***/ "./node_modules/swiper/modules/navigation/navigation.js": 31622/*!**************************************************************!*\ 31623 !*** ./node_modules/swiper/modules/navigation/navigation.js ***! 31624 \**************************************************************/ 31625/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31626 31627"use strict"; 31628/* unused harmony export default */ 31629/* harmony import */ var _shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/create-element-if-not-defined.js */ "./node_modules/swiper/shared/create-element-if-not-defined.js"); 31630/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 31631 31632 31633function Navigation({ 31634 swiper, 31635 extendParams, 31636 on, 31637 emit 31638}) { 31639 extendParams({ 31640 navigation: { 31641 nextEl: null, 31642 prevEl: null, 31643 hideOnClick: false, 31644 disabledClass: 'swiper-button-disabled', 31645 hiddenClass: 'swiper-button-hidden', 31646 lockClass: 'swiper-button-lock', 31647 navigationDisabledClass: 'swiper-navigation-disabled' 31648 } 31649 }); 31650 swiper.navigation = { 31651 nextEl: null, 31652 $nextEl: null, 31653 prevEl: null, 31654 $prevEl: null 31655 }; 31656 31657 function getEl(el) { 31658 let $el; 31659 31660 if (el) { 31661 $el = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(el); 31662 31663 if (swiper.params.uniqueNavElements && typeof el === 'string' && $el.length > 1 && swiper.$el.find(el).length === 1) { 31664 $el = swiper.$el.find(el); 31665 } 31666 } 31667 31668 return $el; 31669 } 31670 31671 function toggleEl($el, disabled) { 31672 const params = swiper.params.navigation; 31673 31674 if ($el && $el.length > 0) { 31675 $el[disabled ? 'addClass' : 'removeClass'](params.disabledClass); 31676 if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled; 31677 31678 if (swiper.params.watchOverflow && swiper.enabled) { 31679 $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); 31680 } 31681 } 31682 } 31683 31684 function update() { 31685 // Update Navigation Buttons 31686 if (swiper.params.loop) return; 31687 const { 31688 $nextEl, 31689 $prevEl 31690 } = swiper.navigation; 31691 toggleEl($prevEl, swiper.isBeginning && !swiper.params.rewind); 31692 toggleEl($nextEl, swiper.isEnd && !swiper.params.rewind); 31693 } 31694 31695 function onPrevClick(e) { 31696 e.preventDefault(); 31697 if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return; 31698 swiper.slidePrev(); 31699 emit('navigationPrev'); 31700 } 31701 31702 function onNextClick(e) { 31703 e.preventDefault(); 31704 if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return; 31705 swiper.slideNext(); 31706 emit('navigationNext'); 31707 } 31708 31709 function init() { 31710 const params = swiper.params.navigation; 31711 swiper.params.navigation = (0,_shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_0__["default"])(swiper, swiper.originalParams.navigation, swiper.params.navigation, { 31712 nextEl: 'swiper-button-next', 31713 prevEl: 'swiper-button-prev' 31714 }); 31715 if (!(params.nextEl || params.prevEl)) return; 31716 const $nextEl = getEl(params.nextEl); 31717 const $prevEl = getEl(params.prevEl); 31718 31719 if ($nextEl && $nextEl.length > 0) { 31720 $nextEl.on('click', onNextClick); 31721 } 31722 31723 if ($prevEl && $prevEl.length > 0) { 31724 $prevEl.on('click', onPrevClick); 31725 } 31726 31727 Object.assign(swiper.navigation, { 31728 $nextEl, 31729 nextEl: $nextEl && $nextEl[0], 31730 $prevEl, 31731 prevEl: $prevEl && $prevEl[0] 31732 }); 31733 31734 if (!swiper.enabled) { 31735 if ($nextEl) $nextEl.addClass(params.lockClass); 31736 if ($prevEl) $prevEl.addClass(params.lockClass); 31737 } 31738 } 31739 31740 function destroy() { 31741 const { 31742 $nextEl, 31743 $prevEl 31744 } = swiper.navigation; 31745 31746 if ($nextEl && $nextEl.length) { 31747 $nextEl.off('click', onNextClick); 31748 $nextEl.removeClass(swiper.params.navigation.disabledClass); 31749 } 31750 31751 if ($prevEl && $prevEl.length) { 31752 $prevEl.off('click', onPrevClick); 31753 $prevEl.removeClass(swiper.params.navigation.disabledClass); 31754 } 31755 } 31756 31757 on('init', () => { 31758 if (swiper.params.navigation.enabled === false) { 31759 // eslint-disable-next-line 31760 disable(); 31761 } else { 31762 init(); 31763 update(); 31764 } 31765 }); 31766 on('toEdge fromEdge lock unlock', () => { 31767 update(); 31768 }); 31769 on('destroy', () => { 31770 destroy(); 31771 }); 31772 on('enable disable', () => { 31773 const { 31774 $nextEl, 31775 $prevEl 31776 } = swiper.navigation; 31777 31778 if ($nextEl) { 31779 $nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); 31780 } 31781 31782 if ($prevEl) { 31783 $prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass); 31784 } 31785 }); 31786 on('click', (_s, e) => { 31787 const { 31788 $nextEl, 31789 $prevEl 31790 } = swiper.navigation; 31791 const targetEl = e.target; 31792 31793 if (swiper.params.navigation.hideOnClick && !(0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(targetEl).is($prevEl) && !(0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(targetEl).is($nextEl)) { 31794 if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return; 31795 let isHidden; 31796 31797 if ($nextEl) { 31798 isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass); 31799 } else if ($prevEl) { 31800 isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass); 31801 } 31802 31803 if (isHidden === true) { 31804 emit('navigationShow'); 31805 } else { 31806 emit('navigationHide'); 31807 } 31808 31809 if ($nextEl) { 31810 $nextEl.toggleClass(swiper.params.navigation.hiddenClass); 31811 } 31812 31813 if ($prevEl) { 31814 $prevEl.toggleClass(swiper.params.navigation.hiddenClass); 31815 } 31816 } 31817 }); 31818 31819 const enable = () => { 31820 swiper.$el.removeClass(swiper.params.navigation.navigationDisabledClass); 31821 init(); 31822 update(); 31823 }; 31824 31825 const disable = () => { 31826 swiper.$el.addClass(swiper.params.navigation.navigationDisabledClass); 31827 destroy(); 31828 }; 31829 31830 Object.assign(swiper.navigation, { 31831 enable, 31832 disable, 31833 update, 31834 init, 31835 destroy 31836 }); 31837} 31838 31839/***/ }), 31840
vendor: 15,999 bytes, lines 31841-32295
31841/***/ "./node_modules/swiper/modules/pagination/pagination.js": 31842/*!**************************************************************!*\ 31843 !*** ./node_modules/swiper/modules/pagination/pagination.js ***! 31844 \**************************************************************/ 31845/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31846 31847"use strict"; 31848/* unused harmony export default */ 31849/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 31850/* harmony import */ var _shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/classes-to-selector.js */ "./node_modules/swiper/shared/classes-to-selector.js"); 31851/* harmony import */ var _shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/create-element-if-not-defined.js */ "./node_modules/swiper/shared/create-element-if-not-defined.js"); 31852 31853 31854 31855function Pagination({ 31856 swiper, 31857 extendParams, 31858 on, 31859 emit 31860}) { 31861 const pfx = 'swiper-pagination'; 31862 extendParams({ 31863 pagination: { 31864 el: null, 31865 bulletElement: 'span', 31866 clickable: false, 31867 hideOnClick: false, 31868 renderBullet: null, 31869 renderProgressbar: null, 31870 renderFraction: null, 31871 renderCustom: null, 31872 progressbarOpposite: false, 31873 type: 'bullets', 31874 // 'bullets' or 'progressbar' or 'fraction' or 'custom' 31875 dynamicBullets: false, 31876 dynamicMainBullets: 1, 31877 formatFractionCurrent: number => number, 31878 formatFractionTotal: number => number, 31879 bulletClass: `${pfx}-bullet`, 31880 bulletActiveClass: `${pfx}-bullet-active`, 31881 modifierClass: `${pfx}-`, 31882 currentClass: `${pfx}-current`, 31883 totalClass: `${pfx}-total`, 31884 hiddenClass: `${pfx}-hidden`, 31885 progressbarFillClass: `${pfx}-progressbar-fill`, 31886 progressbarOppositeClass: `${pfx}-progressbar-opposite`, 31887 clickableClass: `${pfx}-clickable`, 31888 lockClass: `${pfx}-lock`, 31889 horizontalClass: `${pfx}-horizontal`, 31890 verticalClass: `${pfx}-vertical`, 31891 paginationDisabledClass: `${pfx}-disabled` 31892 } 31893 }); 31894 swiper.pagination = { 31895 el: null, 31896 $el: null, 31897 bullets: [] 31898 }; 31899 let bulletSize; 31900 let dynamicBulletIndex = 0; 31901 31902 function isPaginationDisabled() { 31903 return !swiper.params.pagination.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0; 31904 } 31905 31906 function setSideBullets($bulletEl, position) { 31907 const { 31908 bulletActiveClass 31909 } = swiper.params.pagination; 31910 $bulletEl[position]().addClass(`${bulletActiveClass}-${position}`)[position]().addClass(`${bulletActiveClass}-${position}-${position}`); 31911 } 31912 31913 function update() { 31914 // Render || Update Pagination bullets/items 31915 const rtl = swiper.rtl; 31916 const params = swiper.params.pagination; 31917 if (isPaginationDisabled()) return; 31918 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 31919 const $el = swiper.pagination.$el; // Current/Total 31920 31921 let current; 31922 const total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 31923 31924 if (swiper.params.loop) { 31925 current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup); 31926 31927 if (current > slidesLength - 1 - swiper.loopedSlides * 2) { 31928 current -= slidesLength - swiper.loopedSlides * 2; 31929 } 31930 31931 if (current > total - 1) current -= total; 31932 if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current; 31933 } else if (typeof swiper.snapIndex !== 'undefined') { 31934 current = swiper.snapIndex; 31935 } else { 31936 current = swiper.activeIndex || 0; 31937 } // Types 31938 31939 31940 if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) { 31941 const bullets = swiper.pagination.bullets; 31942 let firstIndex; 31943 let lastIndex; 31944 let midIndex; 31945 31946 if (params.dynamicBullets) { 31947 bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true); 31948 $el.css(swiper.isHorizontal() ? 'width' : 'height', `${bulletSize * (params.dynamicMainBullets + 4)}px`); 31949 31950 if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) { 31951 dynamicBulletIndex += current - (swiper.previousIndex - swiper.loopedSlides || 0); 31952 31953 if (dynamicBulletIndex > params.dynamicMainBullets - 1) { 31954 dynamicBulletIndex = params.dynamicMainBullets - 1; 31955 } else if (dynamicBulletIndex < 0) { 31956 dynamicBulletIndex = 0; 31957 } 31958 } 31959 31960 firstIndex = Math.max(current - dynamicBulletIndex, 0); 31961 lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1); 31962 midIndex = (lastIndex + firstIndex) / 2; 31963 } 31964 31965 bullets.removeClass(['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`).join(' ')); 31966 31967 if ($el.length > 1) { 31968 bullets.each(bullet => { 31969 const $bullet = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(bullet); 31970 const bulletIndex = $bullet.index(); 31971 31972 if (bulletIndex === current) { 31973 $bullet.addClass(params.bulletActiveClass); 31974 } 31975 31976 if (params.dynamicBullets) { 31977 if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) { 31978 $bullet.addClass(`${params.bulletActiveClass}-main`); 31979 } 31980 31981 if (bulletIndex === firstIndex) { 31982 setSideBullets($bullet, 'prev'); 31983 } 31984 31985 if (bulletIndex === lastIndex) { 31986 setSideBullets($bullet, 'next'); 31987 } 31988 } 31989 }); 31990 } else { 31991 const $bullet = bullets.eq(current); 31992 const bulletIndex = $bullet.index(); 31993 $bullet.addClass(params.bulletActiveClass); 31994 31995 if (params.dynamicBullets) { 31996 const $firstDisplayedBullet = bullets.eq(firstIndex); 31997 const $lastDisplayedBullet = bullets.eq(lastIndex); 31998 31999 for (let i = firstIndex; i <= lastIndex; i += 1) { 32000 bullets.eq(i).addClass(`${params.bulletActiveClass}-main`); 32001 } 32002 32003 if (swiper.params.loop) { 32004 if (bulletIndex >= bullets.length) { 32005 for (let i = params.dynamicMainBullets; i >= 0; i -= 1) { 32006 bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`); 32007 } 32008 32009 bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(`${params.bulletActiveClass}-prev`); 32010 } else { 32011 setSideBullets($firstDisplayedBullet, 'prev'); 32012 setSideBullets($lastDisplayedBullet, 'next'); 32013 } 32014 } else { 32015 setSideBullets($firstDisplayedBullet, 'prev'); 32016 setSideBullets($lastDisplayedBullet, 'next'); 32017 } 32018 } 32019 } 32020 32021 if (params.dynamicBullets) { 32022 const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4); 32023 const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize; 32024 const offsetProp = rtl ? 'right' : 'left'; 32025 bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`); 32026 } 32027 } 32028 32029 if (params.type === 'fraction') { 32030 $el.find((0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.currentClass)).text(params.formatFractionCurrent(current + 1)); 32031 $el.find((0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.totalClass)).text(params.formatFractionTotal(total)); 32032 } 32033 32034 if (params.type === 'progressbar') { 32035 let progressbarDirection; 32036 32037 if (params.progressbarOpposite) { 32038 progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal'; 32039 } else { 32040 progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical'; 32041 } 32042 32043 const scale = (current + 1) / total; 32044 let scaleX = 1; 32045 let scaleY = 1; 32046 32047 if (progressbarDirection === 'horizontal') { 32048 scaleX = scale; 32049 } else { 32050 scaleY = scale; 32051 } 32052 32053 $el.find((0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.progressbarFillClass)).transform(`translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`).transition(swiper.params.speed); 32054 } 32055 32056 if (params.type === 'custom' && params.renderCustom) { 32057 $el.html(params.renderCustom(swiper, current + 1, total)); 32058 emit('paginationRender', $el[0]); 32059 } else { 32060 emit('paginationUpdate', $el[0]); 32061 } 32062 32063 if (swiper.params.watchOverflow && swiper.enabled) { 32064 $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass); 32065 } 32066 } 32067 32068 function render() { 32069 // Render Container 32070 const params = swiper.params.pagination; 32071 if (isPaginationDisabled()) return; 32072 const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 32073 const $el = swiper.pagination.$el; 32074 let paginationHTML = ''; 32075 32076 if (params.type === 'bullets') { 32077 let numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 32078 32079 if (swiper.params.freeMode && swiper.params.freeMode.enabled && !swiper.params.loop && numberOfBullets > slidesLength) { 32080 numberOfBullets = slidesLength; 32081 } 32082 32083 for (let i = 0; i < numberOfBullets; i += 1) { 32084 if (params.renderBullet) { 32085 paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass); 32086 } else { 32087 paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`; 32088 } 32089 } 32090 32091 $el.html(paginationHTML); 32092 swiper.pagination.bullets = $el.find((0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.bulletClass)); 32093 } 32094 32095 if (params.type === 'fraction') { 32096 if (params.renderFraction) { 32097 paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); 32098 } else { 32099 paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`; 32100 } 32101 32102 $el.html(paginationHTML); 32103 } 32104 32105 if (params.type === 'progressbar') { 32106 if (params.renderProgressbar) { 32107 paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass); 32108 } else { 32109 paginationHTML = `<span class="${params.progressbarFillClass}"></span>`; 32110 } 32111 32112 $el.html(paginationHTML); 32113 } 32114 32115 if (params.type !== 'custom') { 32116 emit('paginationRender', swiper.pagination.$el[0]); 32117 } 32118 } 32119 32120 function init() { 32121 swiper.params.pagination = (0,_shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_2__["default"])(swiper, swiper.originalParams.pagination, swiper.params.pagination, { 32122 el: 'swiper-pagination' 32123 }); 32124 const params = swiper.params.pagination; 32125 if (!params.el) return; 32126 let $el = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params.el); 32127 if ($el.length === 0) return; 32128 32129 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) { 32130 $el = swiper.$el.find(params.el); // check if it belongs to another nested Swiper 32131 32132 if ($el.length > 1) { 32133 $el = $el.filter(el => { 32134 if ((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(el).parents('.swiper')[0] !== swiper.el) return false; 32135 return true; 32136 }); 32137 } 32138 } 32139 32140 if (params.type === 'bullets' && params.clickable) { 32141 $el.addClass(params.clickableClass); 32142 } 32143 32144 $el.addClass(params.modifierClass + params.type); 32145 $el.addClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 32146 32147 if (params.type === 'bullets' && params.dynamicBullets) { 32148 $el.addClass(`${params.modifierClass}${params.type}-dynamic`); 32149 dynamicBulletIndex = 0; 32150 32151 if (params.dynamicMainBullets < 1) { 32152 params.dynamicMainBullets = 1; 32153 } 32154 } 32155 32156 if (params.type === 'progressbar' && params.progressbarOpposite) { 32157 $el.addClass(params.progressbarOppositeClass); 32158 } 32159 32160 if (params.clickable) { 32161 $el.on('click', (0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.bulletClass), function onClick(e) { 32162 e.preventDefault(); 32163 let index = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this).index() * swiper.params.slidesPerGroup; 32164 if (swiper.params.loop) index += swiper.loopedSlides; 32165 swiper.slideTo(index); 32166 }); 32167 } 32168 32169 Object.assign(swiper.pagination, { 32170 $el, 32171 el: $el[0] 32172 }); 32173 32174 if (!swiper.enabled) { 32175 $el.addClass(params.lockClass); 32176 } 32177 } 32178 32179 function destroy() { 32180 const params = swiper.params.pagination; 32181 if (isPaginationDisabled()) return; 32182 const $el = swiper.pagination.$el; 32183 $el.removeClass(params.hiddenClass); 32184 $el.removeClass(params.modifierClass + params.type); 32185 $el.removeClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 32186 if (swiper.pagination.bullets && swiper.pagination.bullets.removeClass) swiper.pagination.bullets.removeClass(params.bulletActiveClass); 32187 32188 if (params.clickable) { 32189 $el.off('click', (0,_shared_classes_to_selector_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.bulletClass)); 32190 } 32191 } 32192 32193 on('init', () => { 32194 if (swiper.params.pagination.enabled === false) { 32195 // eslint-disable-next-line 32196 disable(); 32197 } else { 32198 init(); 32199 render(); 32200 update(); 32201 } 32202 }); 32203 on('activeIndexChange', () => { 32204 if (swiper.params.loop) { 32205 update(); 32206 } else if (typeof swiper.snapIndex === 'undefined') { 32207 update(); 32208 } 32209 }); 32210 on('snapIndexChange', () => { 32211 if (!swiper.params.loop) { 32212 update(); 32213 } 32214 }); 32215 on('slidesLengthChange', () => { 32216 if (swiper.params.loop) { 32217 render(); 32218 update(); 32219 } 32220 }); 32221 on('snapGridLengthChange', () => { 32222 if (!swiper.params.loop) { 32223 render(); 32224 update(); 32225 } 32226 }); 32227 on('destroy', () => { 32228 destroy(); 32229 }); 32230 on('enable disable', () => { 32231 const { 32232 $el 32233 } = swiper.pagination; 32234 32235 if ($el) { 32236 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass); 32237 } 32238 }); 32239 on('lock unlock', () => { 32240 update(); 32241 }); 32242 on('click', (_s, e) => { 32243 const targetEl = e.target; 32244 const { 32245 $el 32246 } = swiper.pagination; 32247 32248 if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && $el && $el.length > 0 && !(0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(targetEl).hasClass(swiper.params.pagination.bulletClass)) { 32249 if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return; 32250 const isHidden = $el.hasClass(swiper.params.pagination.hiddenClass); 32251 32252 if (isHidden === true) { 32253 emit('paginationShow'); 32254 } else { 32255 emit('paginationHide'); 32256 } 32257 32258 $el.toggleClass(swiper.params.pagination.hiddenClass); 32259 } 32260 }); 32261 32262 const enable = () => { 32263 swiper.$el.removeClass(swiper.params.pagination.paginationDisabledClass); 32264 32265 if (swiper.pagination.$el) { 32266 swiper.pagination.$el.removeClass(swiper.params.pagination.paginationDisabledClass); 32267 } 32268 32269 init(); 32270 render(); 32271 update(); 32272 }; 32273 32274 const disable = () => { 32275 swiper.$el.addClass(swiper.params.pagination.paginationDisabledClass); 32276 32277 if (swiper.pagination.$el) { 32278 swiper.pagination.$el.addClass(swiper.params.pagination.paginationDisabledClass); 32279 } 32280 32281 destroy(); 32282 }; 32283 32284 Object.assign(swiper.pagination, { 32285 enable, 32286 disable, 32287 render, 32288 update, 32289 init, 32290 destroy 32291 }); 32292} 32293 32294/***/ }), 32295
vendor: 4,157 bytes, lines 32296-32421
32296/***/ "./node_modules/swiper/modules/parallax/parallax.js": 32297/*!**********************************************************!*\ 32298 !*** ./node_modules/swiper/modules/parallax/parallax.js ***! 32299 \**********************************************************/ 32300/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32301 32302"use strict"; 32303/* unused harmony export default */ 32304/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 32305 32306function Parallax({ 32307 swiper, 32308 extendParams, 32309 on 32310}) { 32311 extendParams({ 32312 parallax: { 32313 enabled: false 32314 } 32315 }); 32316 32317 const setTransform = (el, progress) => { 32318 const { 32319 rtl 32320 } = swiper; 32321 const $el = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(el); 32322 const rtlFactor = rtl ? -1 : 1; 32323 const p = $el.attr('data-swiper-parallax') || '0'; 32324 let x = $el.attr('data-swiper-parallax-x'); 32325 let y = $el.attr('data-swiper-parallax-y'); 32326 const scale = $el.attr('data-swiper-parallax-scale'); 32327 const opacity = $el.attr('data-swiper-parallax-opacity'); 32328 32329 if (x || y) { 32330 x = x || '0'; 32331 y = y || '0'; 32332 } else if (swiper.isHorizontal()) { 32333 x = p; 32334 y = '0'; 32335 } else { 32336 y = p; 32337 x = '0'; 32338 } 32339 32340 if (x.indexOf('%') >= 0) { 32341 x = `${parseInt(x, 10) * progress * rtlFactor}%`; 32342 } else { 32343 x = `${x * progress * rtlFactor}px`; 32344 } 32345 32346 if (y.indexOf('%') >= 0) { 32347 y = `${parseInt(y, 10) * progress}%`; 32348 } else { 32349 y = `${y * progress}px`; 32350 } 32351 32352 if (typeof opacity !== 'undefined' && opacity !== null) { 32353 const currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress)); 32354 $el[0].style.opacity = currentOpacity; 32355 } 32356 32357 if (typeof scale === 'undefined' || scale === null) { 32358 $el.transform(`translate3d(${x}, ${y}, 0px)`); 32359 } else { 32360 const currentScale = scale - (scale - 1) * (1 - Math.abs(progress)); 32361 $el.transform(`translate3d(${x}, ${y}, 0px) scale(${currentScale})`); 32362 } 32363 }; 32364 32365 const setTranslate = () => { 32366 const { 32367 $el, 32368 slides, 32369 progress, 32370 snapGrid 32371 } = swiper; 32372 $el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { 32373 setTransform(el, progress); 32374 }); 32375 slides.each((slideEl, slideIndex) => { 32376 let slideProgress = slideEl.progress; 32377 32378 if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') { 32379 slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1); 32380 } 32381 32382 slideProgress = Math.min(Math.max(slideProgress, -1), 1); 32383 (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(el => { 32384 setTransform(el, slideProgress); 32385 }); 32386 }); 32387 }; 32388 32389 const setTransition = (duration = swiper.params.speed) => { 32390 const { 32391 $el 32392 } = swiper; 32393 $el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(parallaxEl => { 32394 const $parallaxEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(parallaxEl); 32395 let parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration; 32396 if (duration === 0) parallaxDuration = 0; 32397 $parallaxEl.transition(parallaxDuration); 32398 }); 32399 }; 32400 32401 on('beforeInit', () => { 32402 if (!swiper.params.parallax.enabled) return; 32403 swiper.params.watchSlidesProgress = true; 32404 swiper.originalParams.watchSlidesProgress = true; 32405 }); 32406 on('init', () => { 32407 if (!swiper.params.parallax.enabled) return; 32408 setTranslate(); 32409 }); 32410 on('setTranslate', () => { 32411 if (!swiper.params.parallax.enabled) return; 32412 setTranslate(); 32413 }); 32414 on('setTransition', (_swiper, duration) => { 32415 if (!swiper.params.parallax.enabled) return; 32416 setTransition(duration); 32417 }); 32418} 32419 32420/***/ }), 32421
vendor: 11,606 bytes, lines 32422-32839
32422/***/ "./node_modules/swiper/modules/scrollbar/scrollbar.js": 32423/*!************************************************************!*\ 32424 !*** ./node_modules/swiper/modules/scrollbar/scrollbar.js ***! 32425 \************************************************************/ 32426/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32427 32428"use strict"; 32429/* unused harmony export default */ 32430/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 32431/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 32432/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 32433/* harmony import */ var _shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/create-element-if-not-defined.js */ "./node_modules/swiper/shared/create-element-if-not-defined.js"); 32434 32435 32436 32437 32438function Scrollbar({ 32439 swiper, 32440 extendParams, 32441 on, 32442 emit 32443}) { 32444 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 32445 let isTouched = false; 32446 let timeout = null; 32447 let dragTimeout = null; 32448 let dragStartPos; 32449 let dragSize; 32450 let trackSize; 32451 let divider; 32452 extendParams({ 32453 scrollbar: { 32454 el: null, 32455 dragSize: 'auto', 32456 hide: false, 32457 draggable: false, 32458 snapOnRelease: true, 32459 lockClass: 'swiper-scrollbar-lock', 32460 dragClass: 'swiper-scrollbar-drag', 32461 scrollbarDisabledClass: 'swiper-scrollbar-disabled', 32462 horizontalClass: `swiper-scrollbar-horizontal`, 32463 verticalClass: `swiper-scrollbar-vertical` 32464 } 32465 }); 32466 swiper.scrollbar = { 32467 el: null, 32468 dragEl: null, 32469 $el: null, 32470 $dragEl: null 32471 }; 32472 32473 function setTranslate() { 32474 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 32475 const { 32476 scrollbar, 32477 rtlTranslate: rtl, 32478 progress 32479 } = swiper; 32480 const { 32481 $dragEl, 32482 $el 32483 } = scrollbar; 32484 const params = swiper.params.scrollbar; 32485 let newSize = dragSize; 32486 let newPos = (trackSize - dragSize) * progress; 32487 32488 if (rtl) { 32489 newPos = -newPos; 32490 32491 if (newPos > 0) { 32492 newSize = dragSize - newPos; 32493 newPos = 0; 32494 } else if (-newPos + dragSize > trackSize) { 32495 newSize = trackSize + newPos; 32496 } 32497 } else if (newPos < 0) { 32498 newSize = dragSize + newPos; 32499 newPos = 0; 32500 } else if (newPos + dragSize > trackSize) { 32501 newSize = trackSize - newPos; 32502 } 32503 32504 if (swiper.isHorizontal()) { 32505 $dragEl.transform(`translate3d(${newPos}px, 0, 0)`); 32506 $dragEl[0].style.width = `${newSize}px`; 32507 } else { 32508 $dragEl.transform(`translate3d(0px, ${newPos}px, 0)`); 32509 $dragEl[0].style.height = `${newSize}px`; 32510 } 32511 32512 if (params.hide) { 32513 clearTimeout(timeout); 32514 $el[0].style.opacity = 1; 32515 timeout = setTimeout(() => { 32516 $el[0].style.opacity = 0; 32517 $el.transition(400); 32518 }, 1000); 32519 } 32520 } 32521 32522 function setTransition(duration) { 32523 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 32524 swiper.scrollbar.$dragEl.transition(duration); 32525 } 32526 32527 function updateSize() { 32528 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 32529 const { 32530 scrollbar 32531 } = swiper; 32532 const { 32533 $dragEl, 32534 $el 32535 } = scrollbar; 32536 $dragEl[0].style.width = ''; 32537 $dragEl[0].style.height = ''; 32538 trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight; 32539 divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0)); 32540 32541 if (swiper.params.scrollbar.dragSize === 'auto') { 32542 dragSize = trackSize * divider; 32543 } else { 32544 dragSize = parseInt(swiper.params.scrollbar.dragSize, 10); 32545 } 32546 32547 if (swiper.isHorizontal()) { 32548 $dragEl[0].style.width = `${dragSize}px`; 32549 } else { 32550 $dragEl[0].style.height = `${dragSize}px`; 32551 } 32552 32553 if (divider >= 1) { 32554 $el[0].style.display = 'none'; 32555 } else { 32556 $el[0].style.display = ''; 32557 } 32558 32559 if (swiper.params.scrollbar.hide) { 32560 $el[0].style.opacity = 0; 32561 } 32562 32563 if (swiper.params.watchOverflow && swiper.enabled) { 32564 scrollbar.$el[swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass); 32565 } 32566 } 32567 32568 function getPointerPosition(e) { 32569 if (swiper.isHorizontal()) { 32570 return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientX : e.clientX; 32571 } 32572 32573 return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientY : e.clientY; 32574 } 32575 32576 function setDragPosition(e) { 32577 const { 32578 scrollbar, 32579 rtlTranslate: rtl 32580 } = swiper; 32581 const { 32582 $el 32583 } = scrollbar; 32584 let positionRatio; 32585 positionRatio = (getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize); 32586 positionRatio = Math.max(Math.min(positionRatio, 1), 0); 32587 32588 if (rtl) { 32589 positionRatio = 1 - positionRatio; 32590 } 32591 32592 const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio; 32593 swiper.updateProgress(position); 32594 swiper.setTranslate(position); 32595 swiper.updateActiveIndex(); 32596 swiper.updateSlidesClasses(); 32597 } 32598 32599 function onDragStart(e) { 32600 const params = swiper.params.scrollbar; 32601 const { 32602 scrollbar, 32603 $wrapperEl 32604 } = swiper; 32605 const { 32606 $el, 32607 $dragEl 32608 } = scrollbar; 32609 isTouched = true; 32610 dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null; 32611 e.preventDefault(); 32612 e.stopPropagation(); 32613 $wrapperEl.transition(100); 32614 $dragEl.transition(100); 32615 setDragPosition(e); 32616 clearTimeout(dragTimeout); 32617 $el.transition(0); 32618 32619 if (params.hide) { 32620 $el.css('opacity', 1); 32621 } 32622 32623 if (swiper.params.cssMode) { 32624 swiper.$wrapperEl.css('scroll-snap-type', 'none'); 32625 } 32626 32627 emit('scrollbarDragStart', e); 32628 } 32629 32630 function onDragMove(e) { 32631 const { 32632 scrollbar, 32633 $wrapperEl 32634 } = swiper; 32635 const { 32636 $el, 32637 $dragEl 32638 } = scrollbar; 32639 if (!isTouched) return; 32640 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 32641 setDragPosition(e); 32642 $wrapperEl.transition(0); 32643 $el.transition(0); 32644 $dragEl.transition(0); 32645 emit('scrollbarDragMove', e); 32646 } 32647 32648 function onDragEnd(e) { 32649 const params = swiper.params.scrollbar; 32650 const { 32651 scrollbar, 32652 $wrapperEl 32653 } = swiper; 32654 const { 32655 $el 32656 } = scrollbar; 32657 if (!isTouched) return; 32658 isTouched = false; 32659 32660 if (swiper.params.cssMode) { 32661 swiper.$wrapperEl.css('scroll-snap-type', ''); 32662 $wrapperEl.transition(''); 32663 } 32664 32665 if (params.hide) { 32666 clearTimeout(dragTimeout); 32667 dragTimeout = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.nextTick)(() => { 32668 $el.css('opacity', 0); 32669 $el.transition(400); 32670 }, 1000); 32671 } 32672 32673 emit('scrollbarDragEnd', e); 32674 32675 if (params.snapOnRelease) { 32676 swiper.slideToClosest(); 32677 } 32678 } 32679 32680 function events(method) { 32681 const { 32682 scrollbar, 32683 touchEventsTouch, 32684 touchEventsDesktop, 32685 params, 32686 support 32687 } = swiper; 32688 const $el = scrollbar.$el; 32689 if (!$el) return; 32690 const target = $el[0]; 32691 const activeListener = support.passiveListener && params.passiveListeners ? { 32692 passive: false, 32693 capture: false 32694 } : false; 32695 const passiveListener = support.passiveListener && params.passiveListeners ? { 32696 passive: true, 32697 capture: false 32698 } : false; 32699 if (!target) return; 32700 const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 32701 32702 if (!support.touch) { 32703 target[eventMethod](touchEventsDesktop.start, onDragStart, activeListener); 32704 document[eventMethod](touchEventsDesktop.move, onDragMove, activeListener); 32705 document[eventMethod](touchEventsDesktop.end, onDragEnd, passiveListener); 32706 } else { 32707 target[eventMethod](touchEventsTouch.start, onDragStart, activeListener); 32708 target[eventMethod](touchEventsTouch.move, onDragMove, activeListener); 32709 target[eventMethod](touchEventsTouch.end, onDragEnd, passiveListener); 32710 } 32711 } 32712 32713 function enableDraggable() { 32714 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 32715 events('on'); 32716 } 32717 32718 function disableDraggable() { 32719 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 32720 events('off'); 32721 } 32722 32723 function init() { 32724 const { 32725 scrollbar, 32726 $el: $swiperEl 32727 } = swiper; 32728 swiper.params.scrollbar = (0,_shared_create_element_if_not_defined_js__WEBPACK_IMPORTED_MODULE_3__["default"])(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, { 32729 el: 'swiper-scrollbar' 32730 }); 32731 const params = swiper.params.scrollbar; 32732 if (!params.el) return; 32733 let $el = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(params.el); 32734 32735 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) { 32736 $el = $swiperEl.find(params.el); 32737 } 32738 32739 $el.addClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 32740 let $dragEl = $el.find(`.${swiper.params.scrollbar.dragClass}`); 32741 32742 if ($dragEl.length === 0) { 32743 $dragEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(`<div class="${swiper.params.scrollbar.dragClass}"></div>`); 32744 $el.append($dragEl); 32745 } 32746 32747 Object.assign(scrollbar, { 32748 $el, 32749 el: $el[0], 32750 $dragEl, 32751 dragEl: $dragEl[0] 32752 }); 32753 32754 if (params.draggable) { 32755 enableDraggable(); 32756 } 32757 32758 if ($el) { 32759 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); 32760 } 32761 } 32762 32763 function destroy() { 32764 const params = swiper.params.scrollbar; 32765 const $el = swiper.scrollbar.$el; 32766 32767 if ($el) { 32768 $el.removeClass(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 32769 } 32770 32771 disableDraggable(); 32772 } 32773 32774 on('init', () => { 32775 if (swiper.params.scrollbar.enabled === false) { 32776 // eslint-disable-next-line 32777 disable(); 32778 } else { 32779 init(); 32780 updateSize(); 32781 setTranslate(); 32782 } 32783 }); 32784 on('update resize observerUpdate lock unlock', () => { 32785 updateSize(); 32786 }); 32787 on('setTranslate', () => { 32788 setTranslate(); 32789 }); 32790 on('setTransition', (_s, duration) => { 32791 setTransition(duration); 32792 }); 32793 on('enable disable', () => { 32794 const { 32795 $el 32796 } = swiper.scrollbar; 32797 32798 if ($el) { 32799 $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass); 32800 } 32801 }); 32802 on('destroy', () => { 32803 destroy(); 32804 }); 32805 32806 const enable = () => { 32807 swiper.$el.removeClass(swiper.params.scrollbar.scrollbarDisabledClass); 32808 32809 if (swiper.scrollbar.$el) { 32810 swiper.scrollbar.$el.removeClass(swiper.params.scrollbar.scrollbarDisabledClass); 32811 } 32812 32813 init(); 32814 updateSize(); 32815 setTranslate(); 32816 }; 32817 32818 const disable = () => { 32819 swiper.$el.addClass(swiper.params.scrollbar.scrollbarDisabledClass); 32820 32821 if (swiper.scrollbar.$el) { 32822 swiper.scrollbar.$el.addClass(swiper.params.scrollbar.scrollbarDisabledClass); 32823 } 32824 32825 destroy(); 32826 }; 32827 32828 Object.assign(swiper.scrollbar, { 32829 enable, 32830 disable, 32831 updateSize, 32832 setTranslate, 32833 init, 32834 destroy 32835 }); 32836} 32837 32838/***/ }), 32839
vendor: 8,353 bytes, lines 32840-33055
32840/***/ "./node_modules/swiper/modules/thumbs/thumbs.js": 32841/*!******************************************************!*\ 32842 !*** ./node_modules/swiper/modules/thumbs/thumbs.js ***! 32843 \******************************************************/ 32844/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 32845 32846"use strict"; 32847/* unused harmony export default */ 32848/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 32849/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 32850 32851 32852function Thumb({ 32853 swiper, 32854 extendParams, 32855 on 32856}) { 32857 extendParams({ 32858 thumbs: { 32859 swiper: null, 32860 multipleActiveThumbs: true, 32861 autoScrollOffset: 0, 32862 slideThumbActiveClass: 'swiper-slide-thumb-active', 32863 thumbsContainerClass: 'swiper-thumbs' 32864 } 32865 }); 32866 let initialized = false; 32867 let swiperCreated = false; 32868 swiper.thumbs = { 32869 swiper: null 32870 }; 32871 32872 function onThumbClick() { 32873 const thumbsSwiper = swiper.thumbs.swiper; 32874 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 32875 const clickedIndex = thumbsSwiper.clickedIndex; 32876 const clickedSlide = thumbsSwiper.clickedSlide; 32877 if (clickedSlide && (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return; 32878 if (typeof clickedIndex === 'undefined' || clickedIndex === null) return; 32879 let slideToIndex; 32880 32881 if (thumbsSwiper.params.loop) { 32882 slideToIndex = parseInt((0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10); 32883 } else { 32884 slideToIndex = clickedIndex; 32885 } 32886 32887 if (swiper.params.loop) { 32888 let currentIndex = swiper.activeIndex; 32889 32890 if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) { 32891 swiper.loopFix(); // eslint-disable-next-line 32892 32893 swiper._clientLeft = swiper.$wrapperEl[0].clientLeft; 32894 currentIndex = swiper.activeIndex; 32895 } 32896 32897 const prevIndex = swiper.slides.eq(currentIndex).prevAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); 32898 const nextIndex = swiper.slides.eq(currentIndex).nextAll(`[data-swiper-slide-index="${slideToIndex}"]`).eq(0).index(); 32899 if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex; 32900 } 32901 32902 swiper.slideTo(slideToIndex); 32903 } 32904 32905 function init() { 32906 const { 32907 thumbs: thumbsParams 32908 } = swiper.params; 32909 if (initialized) return false; 32910 initialized = true; 32911 const SwiperClass = swiper.constructor; 32912 32913 if (thumbsParams.swiper instanceof SwiperClass) { 32914 swiper.thumbs.swiper = thumbsParams.swiper; 32915 Object.assign(swiper.thumbs.swiper.originalParams, { 32916 watchSlidesProgress: true, 32917 slideToClickedSlide: false 32918 }); 32919 Object.assign(swiper.thumbs.swiper.params, { 32920 watchSlidesProgress: true, 32921 slideToClickedSlide: false 32922 }); 32923 } else if ((0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(thumbsParams.swiper)) { 32924 const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper); 32925 Object.assign(thumbsSwiperParams, { 32926 watchSlidesProgress: true, 32927 slideToClickedSlide: false 32928 }); 32929 swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams); 32930 swiperCreated = true; 32931 } 32932 32933 swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass); 32934 swiper.thumbs.swiper.on('tap', onThumbClick); 32935 return true; 32936 } 32937 32938 function update(initial) { 32939 const thumbsSwiper = swiper.thumbs.swiper; 32940 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 32941 const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; // Activate thumbs 32942 32943 let thumbsToActivate = 1; 32944 const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass; 32945 32946 if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) { 32947 thumbsToActivate = swiper.params.slidesPerView; 32948 } 32949 32950 if (!swiper.params.thumbs.multipleActiveThumbs) { 32951 thumbsToActivate = 1; 32952 } 32953 32954 thumbsToActivate = Math.floor(thumbsToActivate); 32955 thumbsSwiper.slides.removeClass(thumbActiveClass); 32956 32957 if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) { 32958 for (let i = 0; i < thumbsToActivate; i += 1) { 32959 thumbsSwiper.$wrapperEl.children(`[data-swiper-slide-index="${swiper.realIndex + i}"]`).addClass(thumbActiveClass); 32960 } 32961 } else { 32962 for (let i = 0; i < thumbsToActivate; i += 1) { 32963 thumbsSwiper.slides.eq(swiper.realIndex + i).addClass(thumbActiveClass); 32964 } 32965 } 32966 32967 const autoScrollOffset = swiper.params.thumbs.autoScrollOffset; 32968 const useOffset = autoScrollOffset && !thumbsSwiper.params.loop; 32969 32970 if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) { 32971 let currentThumbsIndex = thumbsSwiper.activeIndex; 32972 let newThumbsIndex; 32973 let direction; 32974 32975 if (thumbsSwiper.params.loop) { 32976 if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) { 32977 thumbsSwiper.loopFix(); // eslint-disable-next-line 32978 32979 thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft; 32980 currentThumbsIndex = thumbsSwiper.activeIndex; 32981 } // Find actual thumbs index to slide to 32982 32983 32984 const prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); 32985 const nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(`[data-swiper-slide-index="${swiper.realIndex}"]`).eq(0).index(); 32986 32987 if (typeof prevThumbsIndex === 'undefined') { 32988 newThumbsIndex = nextThumbsIndex; 32989 } else if (typeof nextThumbsIndex === 'undefined') { 32990 newThumbsIndex = prevThumbsIndex; 32991 } else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) { 32992 newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex; 32993 } else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) { 32994 newThumbsIndex = nextThumbsIndex; 32995 } else { 32996 newThumbsIndex = prevThumbsIndex; 32997 } 32998 32999 direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev'; 33000 } else { 33001 newThumbsIndex = swiper.realIndex; 33002 direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev'; 33003 } 33004 33005 if (useOffset) { 33006 newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset; 33007 } 33008 33009 if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) { 33010 if (thumbsSwiper.params.centeredSlides) { 33011 if (newThumbsIndex > currentThumbsIndex) { 33012 newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1; 33013 } else { 33014 newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1; 33015 } 33016 } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) {// newThumbsIndex = newThumbsIndex - slidesPerView + 1; 33017 } 33018 33019 thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined); 33020 } 33021 } 33022 } 33023 33024 on('beforeInit', () => { 33025 const { 33026 thumbs 33027 } = swiper.params; 33028 if (!thumbs || !thumbs.swiper) return; 33029 init(); 33030 update(true); 33031 }); 33032 on('slideChange update resize observerUpdate', () => { 33033 update(); 33034 }); 33035 on('setTransition', (_s, duration) => { 33036 const thumbsSwiper = swiper.thumbs.swiper; 33037 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 33038 thumbsSwiper.setTransition(duration); 33039 }); 33040 on('beforeDestroy', () => { 33041 const thumbsSwiper = swiper.thumbs.swiper; 33042 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 33043 33044 if (swiperCreated) { 33045 thumbsSwiper.destroy(); 33046 } 33047 }); 33048 Object.assign(swiper.thumbs, { 33049 init, 33050 update 33051 }); 33052} 33053 33054/***/ }), 33055
vendor: 8,911 bytes, lines 33056-33365
33056/***/ "./node_modules/swiper/modules/virtual/virtual.js": 33057/*!********************************************************!*\ 33058 !*** ./node_modules/swiper/modules/virtual/virtual.js ***! 33059 \********************************************************/ 33060/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33061 33062"use strict"; 33063/* unused harmony export default */ 33064/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 33065/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 33066 33067 33068function Virtual({ 33069 swiper, 33070 extendParams, 33071 on, 33072 emit 33073}) { 33074 extendParams({ 33075 virtual: { 33076 enabled: false, 33077 slides: [], 33078 cache: true, 33079 renderSlide: null, 33080 renderExternal: null, 33081 renderExternalUpdate: true, 33082 addSlidesBefore: 0, 33083 addSlidesAfter: 0 33084 } 33085 }); 33086 let cssModeTimeout; 33087 swiper.virtual = { 33088 cache: {}, 33089 from: undefined, 33090 to: undefined, 33091 slides: [], 33092 offset: 0, 33093 slidesGrid: [] 33094 }; 33095 33096 function renderSlide(slide, index) { 33097 const params = swiper.params.virtual; 33098 33099 if (params.cache && swiper.virtual.cache[index]) { 33100 return swiper.virtual.cache[index]; 33101 } 33102 33103 const $slideEl = params.renderSlide ? (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params.renderSlide.call(swiper, slide, index)) : (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(`<div class="${swiper.params.slideClass}" data-swiper-slide-index="${index}">${slide}</div>`); 33104 if (!$slideEl.attr('data-swiper-slide-index')) $slideEl.attr('data-swiper-slide-index', index); 33105 if (params.cache) swiper.virtual.cache[index] = $slideEl; 33106 return $slideEl; 33107 } 33108 33109 function update(force) { 33110 const { 33111 slidesPerView, 33112 slidesPerGroup, 33113 centeredSlides 33114 } = swiper.params; 33115 const { 33116 addSlidesBefore, 33117 addSlidesAfter 33118 } = swiper.params.virtual; 33119 const { 33120 from: previousFrom, 33121 to: previousTo, 33122 slides, 33123 slidesGrid: previousSlidesGrid, 33124 offset: previousOffset 33125 } = swiper.virtual; 33126 33127 if (!swiper.params.cssMode) { 33128 swiper.updateActiveIndex(); 33129 } 33130 33131 const activeIndex = swiper.activeIndex || 0; 33132 let offsetProp; 33133 if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top'; 33134 let slidesAfter; 33135 let slidesBefore; 33136 33137 if (centeredSlides) { 33138 slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter; 33139 slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore; 33140 } else { 33141 slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter; 33142 slidesBefore = slidesPerGroup + addSlidesBefore; 33143 } 33144 33145 const from = Math.max((activeIndex || 0) - slidesBefore, 0); 33146 const to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1); 33147 const offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0); 33148 Object.assign(swiper.virtual, { 33149 from, 33150 to, 33151 offset, 33152 slidesGrid: swiper.slidesGrid 33153 }); 33154 33155 function onRendered() { 33156 swiper.updateSlides(); 33157 swiper.updateProgress(); 33158 swiper.updateSlidesClasses(); 33159 33160 if (swiper.lazy && swiper.params.lazy.enabled) { 33161 swiper.lazy.load(); 33162 } 33163 33164 emit('virtualUpdate'); 33165 } 33166 33167 if (previousFrom === from && previousTo === to && !force) { 33168 if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) { 33169 swiper.slides.css(offsetProp, `${offset}px`); 33170 } 33171 33172 swiper.updateProgress(); 33173 emit('virtualUpdate'); 33174 return; 33175 } 33176 33177 if (swiper.params.virtual.renderExternal) { 33178 swiper.params.virtual.renderExternal.call(swiper, { 33179 offset, 33180 from, 33181 to, 33182 slides: function getSlides() { 33183 const slidesToRender = []; 33184 33185 for (let i = from; i <= to; i += 1) { 33186 slidesToRender.push(slides[i]); 33187 } 33188 33189 return slidesToRender; 33190 }() 33191 }); 33192 33193 if (swiper.params.virtual.renderExternalUpdate) { 33194 onRendered(); 33195 } else { 33196 emit('virtualUpdate'); 33197 } 33198 33199 return; 33200 } 33201 33202 const prependIndexes = []; 33203 const appendIndexes = []; 33204 33205 if (force) { 33206 swiper.$wrapperEl.find(`.${swiper.params.slideClass}`).remove(); 33207 } else { 33208 for (let i = previousFrom; i <= previousTo; i += 1) { 33209 if (i < from || i > to) { 33210 swiper.$wrapperEl.find(`.${swiper.params.slideClass}[data-swiper-slide-index="${i}"]`).remove(); 33211 } 33212 } 33213 } 33214 33215 for (let i = 0; i < slides.length; i += 1) { 33216 if (i >= from && i <= to) { 33217 if (typeof previousTo === 'undefined' || force) { 33218 appendIndexes.push(i); 33219 } else { 33220 if (i > previousTo) appendIndexes.push(i); 33221 if (i < previousFrom) prependIndexes.push(i); 33222 } 33223 } 33224 } 33225 33226 appendIndexes.forEach(index => { 33227 swiper.$wrapperEl.append(renderSlide(slides[index], index)); 33228 }); 33229 prependIndexes.sort((a, b) => b - a).forEach(index => { 33230 swiper.$wrapperEl.prepend(renderSlide(slides[index], index)); 33231 }); 33232 swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, `${offset}px`); 33233 onRendered(); 33234 } 33235 33236 function appendSlide(slides) { 33237 if (typeof slides === 'object' && 'length' in slides) { 33238 for (let i = 0; i < slides.length; i += 1) { 33239 if (slides[i]) swiper.virtual.slides.push(slides[i]); 33240 } 33241 } else { 33242 swiper.virtual.slides.push(slides); 33243 } 33244 33245 update(true); 33246 } 33247 33248 function prependSlide(slides) { 33249 const activeIndex = swiper.activeIndex; 33250 let newActiveIndex = activeIndex + 1; 33251 let numberOfNewSlides = 1; 33252 33253 if (Array.isArray(slides)) { 33254 for (let i = 0; i < slides.length; i += 1) { 33255 if (slides[i]) swiper.virtual.slides.unshift(slides[i]); 33256 } 33257 33258 newActiveIndex = activeIndex + slides.length; 33259 numberOfNewSlides = slides.length; 33260 } else { 33261 swiper.virtual.slides.unshift(slides); 33262 } 33263 33264 if (swiper.params.virtual.cache) { 33265 const cache = swiper.virtual.cache; 33266 const newCache = {}; 33267 Object.keys(cache).forEach(cachedIndex => { 33268 const $cachedEl = cache[cachedIndex]; 33269 const cachedElIndex = $cachedEl.attr('data-swiper-slide-index'); 33270 33271 if (cachedElIndex) { 33272 $cachedEl.attr('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides); 33273 } 33274 33275 newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = $cachedEl; 33276 }); 33277 swiper.virtual.cache = newCache; 33278 } 33279 33280 update(true); 33281 swiper.slideTo(newActiveIndex, 0); 33282 } 33283 33284 function removeSlide(slidesIndexes) { 33285 if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return; 33286 let activeIndex = swiper.activeIndex; 33287 33288 if (Array.isArray(slidesIndexes)) { 33289 for (let i = slidesIndexes.length - 1; i >= 0; i -= 1) { 33290 swiper.virtual.slides.splice(slidesIndexes[i], 1); 33291 33292 if (swiper.params.virtual.cache) { 33293 delete swiper.virtual.cache[slidesIndexes[i]]; 33294 } 33295 33296 if (slidesIndexes[i] < activeIndex) activeIndex -= 1; 33297 activeIndex = Math.max(activeIndex, 0); 33298 } 33299 } else { 33300 swiper.virtual.slides.splice(slidesIndexes, 1); 33301 33302 if (swiper.params.virtual.cache) { 33303 delete swiper.virtual.cache[slidesIndexes]; 33304 } 33305 33306 if (slidesIndexes < activeIndex) activeIndex -= 1; 33307 activeIndex = Math.max(activeIndex, 0); 33308 } 33309 33310 update(true); 33311 swiper.slideTo(activeIndex, 0); 33312 } 33313 33314 function removeAllSlides() { 33315 swiper.virtual.slides = []; 33316 33317 if (swiper.params.virtual.cache) { 33318 swiper.virtual.cache = {}; 33319 } 33320 33321 update(true); 33322 swiper.slideTo(0, 0); 33323 } 33324 33325 on('beforeInit', () => { 33326 if (!swiper.params.virtual.enabled) return; 33327 swiper.virtual.slides = swiper.params.virtual.slides; 33328 swiper.classNames.push(`${swiper.params.containerModifierClass}virtual`); 33329 swiper.params.watchSlidesProgress = true; 33330 swiper.originalParams.watchSlidesProgress = true; 33331 33332 if (!swiper.params.initialSlide) { 33333 update(); 33334 } 33335 }); 33336 on('setTranslate', () => { 33337 if (!swiper.params.virtual.enabled) return; 33338 33339 if (swiper.params.cssMode && !swiper._immediateVirtual) { 33340 clearTimeout(cssModeTimeout); 33341 cssModeTimeout = setTimeout(() => { 33342 update(); 33343 }, 100); 33344 } else { 33345 update(); 33346 } 33347 }); 33348 on('init update resize', () => { 33349 if (!swiper.params.virtual.enabled) return; 33350 33351 if (swiper.params.cssMode) { 33352 (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_1__.setCSSProperty)(swiper.wrapperEl, '--swiper-virtual-size', `${swiper.virtualSize}px`); 33353 } 33354 }); 33355 Object.assign(swiper.virtual, { 33356 appendSlide, 33357 prependSlide, 33358 removeSlide, 33359 removeAllSlides, 33360 update 33361 }); 33362} 33363 33364/***/ }), 33365
vendor: 21,507 bytes, lines 33366-33991
33366/***/ "./node_modules/swiper/modules/zoom/zoom.js": 33367/*!**************************************************!*\ 33368 !*** ./node_modules/swiper/modules/zoom/zoom.js ***! 33369 \**************************************************/ 33370/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33371 33372"use strict"; 33373/* unused harmony export default */ 33374/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 33375/* harmony import */ var _shared_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/dom.js */ "./node_modules/swiper/shared/dom.js"); 33376/* harmony import */ var _shared_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/utils.js */ "./node_modules/swiper/shared/utils.js"); 33377 33378 33379 33380function Zoom({ 33381 swiper, 33382 extendParams, 33383 on, 33384 emit 33385}) { 33386 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 33387 extendParams({ 33388 zoom: { 33389 enabled: false, 33390 maxRatio: 3, 33391 minRatio: 1, 33392 toggle: true, 33393 containerClass: 'swiper-zoom-container', 33394 zoomedSlideClass: 'swiper-slide-zoomed' 33395 } 33396 }); 33397 swiper.zoom = { 33398 enabled: false 33399 }; 33400 let currentScale = 1; 33401 let isScaling = false; 33402 let gesturesEnabled; 33403 let fakeGestureTouched; 33404 let fakeGestureMoved; 33405 const gesture = { 33406 $slideEl: undefined, 33407 slideWidth: undefined, 33408 slideHeight: undefined, 33409 $imageEl: undefined, 33410 $imageWrapEl: undefined, 33411 maxRatio: 3 33412 }; 33413 const image = { 33414 isTouched: undefined, 33415 isMoved: undefined, 33416 currentX: undefined, 33417 currentY: undefined, 33418 minX: undefined, 33419 minY: undefined, 33420 maxX: undefined, 33421 maxY: undefined, 33422 width: undefined, 33423 height: undefined, 33424 startX: undefined, 33425 startY: undefined, 33426 touchesStart: {}, 33427 touchesCurrent: {} 33428 }; 33429 const velocity = { 33430 x: undefined, 33431 y: undefined, 33432 prevPositionX: undefined, 33433 prevPositionY: undefined, 33434 prevTime: undefined 33435 }; 33436 let scale = 1; 33437 Object.defineProperty(swiper.zoom, 'scale', { 33438 get() { 33439 return scale; 33440 }, 33441 33442 set(value) { 33443 if (scale !== value) { 33444 const imageEl = gesture.$imageEl ? gesture.$imageEl[0] : undefined; 33445 const slideEl = gesture.$slideEl ? gesture.$slideEl[0] : undefined; 33446 emit('zoomChange', value, imageEl, slideEl); 33447 } 33448 33449 scale = value; 33450 } 33451 33452 }); 33453 33454 function getDistanceBetweenTouches(e) { 33455 if (e.targetTouches.length < 2) return 1; 33456 const x1 = e.targetTouches[0].pageX; 33457 const y1 = e.targetTouches[0].pageY; 33458 const x2 = e.targetTouches[1].pageX; 33459 const y2 = e.targetTouches[1].pageY; 33460 const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2); 33461 return distance; 33462 } // Events 33463 33464 33465 function onGestureStart(e) { 33466 const support = swiper.support; 33467 const params = swiper.params.zoom; 33468 fakeGestureTouched = false; 33469 fakeGestureMoved = false; 33470 33471 if (!support.gestures) { 33472 if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) { 33473 return; 33474 } 33475 33476 fakeGestureTouched = true; 33477 gesture.scaleStart = getDistanceBetweenTouches(e); 33478 } 33479 33480 if (!gesture.$slideEl || !gesture.$slideEl.length) { 33481 gesture.$slideEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target).closest(`.${swiper.params.slideClass}`); 33482 if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 33483 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 33484 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 33485 gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 33486 33487 if (gesture.$imageWrapEl.length === 0) { 33488 gesture.$imageEl = undefined; 33489 return; 33490 } 33491 } 33492 33493 if (gesture.$imageEl) { 33494 gesture.$imageEl.transition(0); 33495 } 33496 33497 isScaling = true; 33498 } 33499 33500 function onGestureChange(e) { 33501 const support = swiper.support; 33502 const params = swiper.params.zoom; 33503 const zoom = swiper.zoom; 33504 33505 if (!support.gestures) { 33506 if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) { 33507 return; 33508 } 33509 33510 fakeGestureMoved = true; 33511 gesture.scaleMove = getDistanceBetweenTouches(e); 33512 } 33513 33514 if (!gesture.$imageEl || gesture.$imageEl.length === 0) { 33515 if (e.type === 'gesturechange') onGestureStart(e); 33516 return; 33517 } 33518 33519 if (support.gestures) { 33520 zoom.scale = e.scale * currentScale; 33521 } else { 33522 zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale; 33523 } 33524 33525 if (zoom.scale > gesture.maxRatio) { 33526 zoom.scale = gesture.maxRatio - 1 + (zoom.scale - gesture.maxRatio + 1) ** 0.5; 33527 } 33528 33529 if (zoom.scale < params.minRatio) { 33530 zoom.scale = params.minRatio + 1 - (params.minRatio - zoom.scale + 1) ** 0.5; 33531 } 33532 33533 gesture.$imageEl.transform(`translate3d(0,0,0) scale(${zoom.scale})`); 33534 } 33535 33536 function onGestureEnd(e) { 33537 const device = swiper.device; 33538 const support = swiper.support; 33539 const params = swiper.params.zoom; 33540 const zoom = swiper.zoom; 33541 33542 if (!support.gestures) { 33543 if (!fakeGestureTouched || !fakeGestureMoved) { 33544 return; 33545 } 33546 33547 if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2 && !device.android) { 33548 return; 33549 } 33550 33551 fakeGestureTouched = false; 33552 fakeGestureMoved = false; 33553 } 33554 33555 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 33556 zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio); 33557 gesture.$imageEl.transition(swiper.params.speed).transform(`translate3d(0,0,0) scale(${zoom.scale})`); 33558 currentScale = zoom.scale; 33559 isScaling = false; 33560 if (zoom.scale === 1) gesture.$slideEl = undefined; 33561 } 33562 33563 function onTouchStart(e) { 33564 const device = swiper.device; 33565 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 33566 if (image.isTouched) return; 33567 if (device.android && e.cancelable) e.preventDefault(); 33568 image.isTouched = true; 33569 image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX; 33570 image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY; 33571 } 33572 33573 function onTouchMove(e) { 33574 const zoom = swiper.zoom; 33575 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 33576 swiper.allowClick = false; 33577 if (!image.isTouched || !gesture.$slideEl) return; 33578 33579 if (!image.isMoved) { 33580 image.width = gesture.$imageEl[0].offsetWidth; 33581 image.height = gesture.$imageEl[0].offsetHeight; 33582 image.startX = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.getTranslate)(gesture.$imageWrapEl[0], 'x') || 0; 33583 image.startY = (0,_shared_utils_js__WEBPACK_IMPORTED_MODULE_2__.getTranslate)(gesture.$imageWrapEl[0], 'y') || 0; 33584 gesture.slideWidth = gesture.$slideEl[0].offsetWidth; 33585 gesture.slideHeight = gesture.$slideEl[0].offsetHeight; 33586 gesture.$imageWrapEl.transition(0); 33587 } // Define if we need image drag 33588 33589 33590 const scaledWidth = image.width * zoom.scale; 33591 const scaledHeight = image.height * zoom.scale; 33592 if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return; 33593 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 33594 image.maxX = -image.minX; 33595 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 33596 image.maxY = -image.minY; 33597 image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX; 33598 image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY; 33599 33600 if (!image.isMoved && !isScaling) { 33601 if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) { 33602 image.isTouched = false; 33603 return; 33604 } 33605 33606 if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) { 33607 image.isTouched = false; 33608 return; 33609 } 33610 } 33611 33612 if (e.cancelable) { 33613 e.preventDefault(); 33614 } 33615 33616 e.stopPropagation(); 33617 image.isMoved = true; 33618 image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX; 33619 image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY; 33620 33621 if (image.currentX < image.minX) { 33622 image.currentX = image.minX + 1 - (image.minX - image.currentX + 1) ** 0.8; 33623 } 33624 33625 if (image.currentX > image.maxX) { 33626 image.currentX = image.maxX - 1 + (image.currentX - image.maxX + 1) ** 0.8; 33627 } 33628 33629 if (image.currentY < image.minY) { 33630 image.currentY = image.minY + 1 - (image.minY - image.currentY + 1) ** 0.8; 33631 } 33632 33633 if (image.currentY > image.maxY) { 33634 image.currentY = image.maxY - 1 + (image.currentY - image.maxY + 1) ** 0.8; 33635 } // Velocity 33636 33637 33638 if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x; 33639 if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y; 33640 if (!velocity.prevTime) velocity.prevTime = Date.now(); 33641 velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2; 33642 velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2; 33643 if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0; 33644 if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0; 33645 velocity.prevPositionX = image.touchesCurrent.x; 33646 velocity.prevPositionY = image.touchesCurrent.y; 33647 velocity.prevTime = Date.now(); 33648 gesture.$imageWrapEl.transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); 33649 } 33650 33651 function onTouchEnd() { 33652 const zoom = swiper.zoom; 33653 if (!gesture.$imageEl || gesture.$imageEl.length === 0) return; 33654 33655 if (!image.isTouched || !image.isMoved) { 33656 image.isTouched = false; 33657 image.isMoved = false; 33658 return; 33659 } 33660 33661 image.isTouched = false; 33662 image.isMoved = false; 33663 let momentumDurationX = 300; 33664 let momentumDurationY = 300; 33665 const momentumDistanceX = velocity.x * momentumDurationX; 33666 const newPositionX = image.currentX + momentumDistanceX; 33667 const momentumDistanceY = velocity.y * momentumDurationY; 33668 const newPositionY = image.currentY + momentumDistanceY; // Fix duration 33669 33670 if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); 33671 if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); 33672 const momentumDuration = Math.max(momentumDurationX, momentumDurationY); 33673 image.currentX = newPositionX; 33674 image.currentY = newPositionY; // Define if we need image drag 33675 33676 const scaledWidth = image.width * zoom.scale; 33677 const scaledHeight = image.height * zoom.scale; 33678 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 33679 image.maxX = -image.minX; 33680 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 33681 image.maxY = -image.minY; 33682 image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX); 33683 image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY); 33684 gesture.$imageWrapEl.transition(momentumDuration).transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`); 33685 } 33686 33687 function onTransitionEnd() { 33688 const zoom = swiper.zoom; 33689 33690 if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) { 33691 if (gesture.$imageEl) { 33692 gesture.$imageEl.transform('translate3d(0,0,0) scale(1)'); 33693 } 33694 33695 if (gesture.$imageWrapEl) { 33696 gesture.$imageWrapEl.transform('translate3d(0,0,0)'); 33697 } 33698 33699 zoom.scale = 1; 33700 currentScale = 1; 33701 gesture.$slideEl = undefined; 33702 gesture.$imageEl = undefined; 33703 gesture.$imageWrapEl = undefined; 33704 } 33705 } 33706 33707 function zoomIn(e) { 33708 const zoom = swiper.zoom; 33709 const params = swiper.params.zoom; 33710 33711 if (!gesture.$slideEl) { 33712 if (e && e.target) { 33713 gesture.$slideEl = (0,_shared_dom_js__WEBPACK_IMPORTED_MODULE_1__["default"])(e.target).closest(`.${swiper.params.slideClass}`); 33714 } 33715 33716 if (!gesture.$slideEl) { 33717 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 33718 gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); 33719 } else { 33720 gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 33721 } 33722 } 33723 33724 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 33725 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 33726 } 33727 33728 if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; 33729 33730 if (swiper.params.cssMode) { 33731 swiper.wrapperEl.style.overflow = 'hidden'; 33732 swiper.wrapperEl.style.touchAction = 'none'; 33733 } 33734 33735 gesture.$slideEl.addClass(`${params.zoomedSlideClass}`); 33736 let touchX; 33737 let touchY; 33738 let offsetX; 33739 let offsetY; 33740 let diffX; 33741 let diffY; 33742 let translateX; 33743 let translateY; 33744 let imageWidth; 33745 let imageHeight; 33746 let scaledWidth; 33747 let scaledHeight; 33748 let translateMinX; 33749 let translateMinY; 33750 let translateMaxX; 33751 let translateMaxY; 33752 let slideWidth; 33753 let slideHeight; 33754 33755 if (typeof image.touchesStart.x === 'undefined' && e) { 33756 touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX; 33757 touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY; 33758 } else { 33759 touchX = image.touchesStart.x; 33760 touchY = image.touchesStart.y; 33761 } 33762 33763 zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 33764 currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio; 33765 33766 if (e) { 33767 slideWidth = gesture.$slideEl[0].offsetWidth; 33768 slideHeight = gesture.$slideEl[0].offsetHeight; 33769 offsetX = gesture.$slideEl.offset().left + window.scrollX; 33770 offsetY = gesture.$slideEl.offset().top + window.scrollY; 33771 diffX = offsetX + slideWidth / 2 - touchX; 33772 diffY = offsetY + slideHeight / 2 - touchY; 33773 imageWidth = gesture.$imageEl[0].offsetWidth; 33774 imageHeight = gesture.$imageEl[0].offsetHeight; 33775 scaledWidth = imageWidth * zoom.scale; 33776 scaledHeight = imageHeight * zoom.scale; 33777 translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0); 33778 translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0); 33779 translateMaxX = -translateMinX; 33780 translateMaxY = -translateMinY; 33781 translateX = diffX * zoom.scale; 33782 translateY = diffY * zoom.scale; 33783 33784 if (translateX < translateMinX) { 33785 translateX = translateMinX; 33786 } 33787 33788 if (translateX > translateMaxX) { 33789 translateX = translateMaxX; 33790 } 33791 33792 if (translateY < translateMinY) { 33793 translateY = translateMinY; 33794 } 33795 33796 if (translateY > translateMaxY) { 33797 translateY = translateMaxY; 33798 } 33799 } else { 33800 translateX = 0; 33801 translateY = 0; 33802 } 33803 33804 gesture.$imageWrapEl.transition(300).transform(`translate3d(${translateX}px, ${translateY}px,0)`); 33805 gesture.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${zoom.scale})`); 33806 } 33807 33808 function zoomOut() { 33809 const zoom = swiper.zoom; 33810 const params = swiper.params.zoom; 33811 33812 if (!gesture.$slideEl) { 33813 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 33814 gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`); 33815 } else { 33816 gesture.$slideEl = swiper.slides.eq(swiper.activeIndex); 33817 } 33818 33819 gesture.$imageEl = gesture.$slideEl.find(`.${params.containerClass}`).eq(0).find('picture, img, svg, canvas, .swiper-zoom-target').eq(0); 33820 gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`); 33821 } 33822 33823 if (!gesture.$imageEl || gesture.$imageEl.length === 0 || !gesture.$imageWrapEl || gesture.$imageWrapEl.length === 0) return; 33824 33825 if (swiper.params.cssMode) { 33826 swiper.wrapperEl.style.overflow = ''; 33827 swiper.wrapperEl.style.touchAction = ''; 33828 } 33829 33830 zoom.scale = 1; 33831 currentScale = 1; 33832 gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)'); 33833 gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)'); 33834 gesture.$slideEl.removeClass(`${params.zoomedSlideClass}`); 33835 gesture.$slideEl = undefined; 33836 } // Toggle Zoom 33837 33838 33839 function zoomToggle(e) { 33840 const zoom = swiper.zoom; 33841 33842 if (zoom.scale && zoom.scale !== 1) { 33843 // Zoom Out 33844 zoomOut(); 33845 } else { 33846 // Zoom In 33847 zoomIn(e); 33848 } 33849 } 33850 33851 function getListeners() { 33852 const support = swiper.support; 33853 const passiveListener = swiper.touchEvents.start === 'touchstart' && support.passiveListener && swiper.params.passiveListeners ? { 33854 passive: true, 33855 capture: false 33856 } : false; 33857 const activeListenerWithCapture = support.passiveListener ? { 33858 passive: false, 33859 capture: true 33860 } : true; 33861 return { 33862 passiveListener, 33863 activeListenerWithCapture 33864 }; 33865 } 33866 33867 function getSlideSelector() { 33868 return `.${swiper.params.slideClass}`; 33869 } 33870 33871 function toggleGestures(method) { 33872 const { 33873 passiveListener 33874 } = getListeners(); 33875 const slideSelector = getSlideSelector(); 33876 swiper.$wrapperEl[method]('gesturestart', slideSelector, onGestureStart, passiveListener); 33877 swiper.$wrapperEl[method]('gesturechange', slideSelector, onGestureChange, passiveListener); 33878 swiper.$wrapperEl[method]('gestureend', slideSelector, onGestureEnd, passiveListener); 33879 } 33880 33881 function enableGestures() { 33882 if (gesturesEnabled) return; 33883 gesturesEnabled = true; 33884 toggleGestures('on'); 33885 } 33886 33887 function disableGestures() { 33888 if (!gesturesEnabled) return; 33889 gesturesEnabled = false; 33890 toggleGestures('off'); 33891 } // Attach/Detach Events 33892 33893 33894 function enable() { 33895 const zoom = swiper.zoom; 33896 if (zoom.enabled) return; 33897 zoom.enabled = true; 33898 const support = swiper.support; 33899 const { 33900 passiveListener, 33901 activeListenerWithCapture 33902 } = getListeners(); 33903 const slideSelector = getSlideSelector(); // Scale image 33904 33905 if (support.gestures) { 33906 swiper.$wrapperEl.on(swiper.touchEvents.start, enableGestures, passiveListener); 33907 swiper.$wrapperEl.on(swiper.touchEvents.end, disableGestures, passiveListener); 33908 } else if (swiper.touchEvents.start === 'touchstart') { 33909 swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); 33910 swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); 33911 swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); 33912 33913 if (swiper.touchEvents.cancel) { 33914 swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); 33915 } 33916 } // Move image 33917 33918 33919 swiper.$wrapperEl.on(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); 33920 } 33921 33922 function disable() { 33923 const zoom = swiper.zoom; 33924 if (!zoom.enabled) return; 33925 const support = swiper.support; 33926 zoom.enabled = false; 33927 const { 33928 passiveListener, 33929 activeListenerWithCapture 33930 } = getListeners(); 33931 const slideSelector = getSlideSelector(); // Scale image 33932 33933 if (support.gestures) { 33934 swiper.$wrapperEl.off(swiper.touchEvents.start, enableGestures, passiveListener); 33935 swiper.$wrapperEl.off(swiper.touchEvents.end, disableGestures, passiveListener); 33936 } else if (swiper.touchEvents.start === 'touchstart') { 33937 swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, onGestureStart, passiveListener); 33938 swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, onGestureChange, activeListenerWithCapture); 33939 swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, onGestureEnd, passiveListener); 33940 33941 if (swiper.touchEvents.cancel) { 33942 swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, onGestureEnd, passiveListener); 33943 } 33944 } // Move image 33945 33946 33947 swiper.$wrapperEl.off(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, onTouchMove, activeListenerWithCapture); 33948 } 33949 33950 on('init', () => { 33951 if (swiper.params.zoom.enabled) { 33952 enable(); 33953 } 33954 }); 33955 on('destroy', () => { 33956 disable(); 33957 }); 33958 on('touchStart', (_s, e) => { 33959 if (!swiper.zoom.enabled) return; 33960 onTouchStart(e); 33961 }); 33962 on('touchEnd', (_s, e) => { 33963 if (!swiper.zoom.enabled) return; 33964 onTouchEnd(e); 33965 }); 33966 on('doubleTap', (_s, e) => { 33967 if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { 33968 zoomToggle(e); 33969 } 33970 }); 33971 on('transitionEnd', () => { 33972 if (swiper.zoom.enabled && swiper.params.zoom.enabled) { 33973 onTransitionEnd(); 33974 } 33975 }); 33976 on('slideChange', () => { 33977 if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) { 33978 onTransitionEnd(); 33979 } 33980 }); 33981 Object.assign(swiper.zoom, { 33982 enable, 33983 disable, 33984 in: zoomIn, 33985 out: zoomOut, 33986 toggle: zoomToggle 33987 }); 33988} 33989 33990/***/ }), 33991
vendor: 711 bytes, lines 33992-34008
33992/***/ "./node_modules/swiper/shared/classes-to-selector.js": 33993/*!***********************************************************!*\ 33994 !*** ./node_modules/swiper/shared/classes-to-selector.js ***! 33995 \***********************************************************/ 33996/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 33997 33998"use strict"; 33999/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34000/* harmony export */ "default": function() { return /* binding */ classesToSelector; } 34001/* harmony export */ }); 34002function classesToSelector(classes = '') { 34003 return `.${classes.trim().replace(/([\.:!\/])/g, '\\$1') // eslint-disable-line 34004 .replace(/ /g, '.')}`; 34005} 34006 34007/***/ }), 34008
vendor: 1,405 bytes, lines 34009-34045
34009/***/ "./node_modules/swiper/shared/create-element-if-not-defined.js": 34010/*!*********************************************************************!*\ 34011 !*** ./node_modules/swiper/shared/create-element-if-not-defined.js ***! 34012 \*********************************************************************/ 34013/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34014 34015"use strict"; 34016/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34017/* harmony export */ "default": function() { return /* binding */ createElementIfNotDefined; } 34018/* harmony export */ }); 34019/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 34020 34021function createElementIfNotDefined(swiper, originalParams, params, checkProps) { 34022 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 34023 34024 if (swiper.params.createElements) { 34025 Object.keys(checkProps).forEach(key => { 34026 if (!params[key] && params.auto === true) { 34027 let element = swiper.$el.children(`.${checkProps[key]}`)[0]; 34028 34029 if (!element) { 34030 element = document.createElement('div'); 34031 element.className = checkProps[key]; 34032 swiper.$el.append(element); 34033 } 34034 34035 params[key] = element; 34036 originalParams[key] = element; 34037 } 34038 }); 34039 } 34040 34041 return params; 34042} 34043 34044/***/ }), 34045
vendor: 1,179 bytes, lines 34046-34072
34046/***/ "./node_modules/swiper/shared/create-shadow.js": 34047/*!*****************************************************!*\ 34048 !*** ./node_modules/swiper/shared/create-shadow.js ***! 34049 \*****************************************************/ 34050/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34051 34052"use strict"; 34053/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34054/* harmony export */ "default": function() { return /* binding */ createShadow; } 34055/* harmony export */ }); 34056/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/swiper/shared/dom.js"); 34057 34058function createShadow(params, $slideEl, side) { 34059 const shadowClass = `swiper-slide-shadow${side ? `-${side}` : ''}`; 34060 const $shadowContainer = params.transformEl ? $slideEl.find(params.transformEl) : $slideEl; 34061 let $shadowEl = $shadowContainer.children(`.${shadowClass}`); 34062 34063 if (!$shadowEl.length) { 34064 $shadowEl = (0,_dom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(`<div class="swiper-slide-shadow${side ? `-${side}` : ''}"></div>`); 34065 $shadowContainer.append($shadowEl); 34066 } 34067 34068 return $shadowEl; 34069} 34070 34071/***/ }), 34072
vendor: 2,654 bytes, lines 34073-34129
34073/***/ "./node_modules/swiper/shared/dom.js": 34074/*!*******************************************!*\ 34075 !*** ./node_modules/swiper/shared/dom.js ***! 34076 \*******************************************/ 34077/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34078 34079"use strict"; 34080/* harmony import */ var dom7__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dom7 */ "./node_modules/dom7/dom7.esm.js"); 34081 34082const Methods = { 34083 addClass: dom7__WEBPACK_IMPORTED_MODULE_0__.addClass, 34084 removeClass: dom7__WEBPACK_IMPORTED_MODULE_0__.removeClass, 34085 hasClass: dom7__WEBPACK_IMPORTED_MODULE_0__.hasClass, 34086 toggleClass: dom7__WEBPACK_IMPORTED_MODULE_0__.toggleClass, 34087 attr: dom7__WEBPACK_IMPORTED_MODULE_0__.attr, 34088 removeAttr: dom7__WEBPACK_IMPORTED_MODULE_0__.removeAttr, 34089 transform: dom7__WEBPACK_IMPORTED_MODULE_0__.transform, 34090 transition: dom7__WEBPACK_IMPORTED_MODULE_0__.transition, 34091 on: dom7__WEBPACK_IMPORTED_MODULE_0__.on, 34092 off: dom7__WEBPACK_IMPORTED_MODULE_0__.off, 34093 trigger: dom7__WEBPACK_IMPORTED_MODULE_0__.trigger, 34094 transitionEnd: dom7__WEBPACK_IMPORTED_MODULE_0__.transitionEnd, 34095 outerWidth: dom7__WEBPACK_IMPORTED_MODULE_0__.outerWidth, 34096 outerHeight: dom7__WEBPACK_IMPORTED_MODULE_0__.outerHeight, 34097 styles: dom7__WEBPACK_IMPORTED_MODULE_0__.styles, 34098 offset: dom7__WEBPACK_IMPORTED_MODULE_0__.offset, 34099 css: dom7__WEBPACK_IMPORTED_MODULE_0__.css, 34100 each: dom7__WEBPACK_IMPORTED_MODULE_0__.each, 34101 html: dom7__WEBPACK_IMPORTED_MODULE_0__.html, 34102 text: dom7__WEBPACK_IMPORTED_MODULE_0__.text, 34103 is: dom7__WEBPACK_IMPORTED_MODULE_0__.is, 34104 index: dom7__WEBPACK_IMPORTED_MODULE_0__.index, 34105 eq: dom7__WEBPACK_IMPORTED_MODULE_0__.eq, 34106 append: dom7__WEBPACK_IMPORTED_MODULE_0__.append, 34107 prepend: dom7__WEBPACK_IMPORTED_MODULE_0__.prepend, 34108 next: dom7__WEBPACK_IMPORTED_MODULE_0__.next, 34109 nextAll: dom7__WEBPACK_IMPORTED_MODULE_0__.nextAll, 34110 prev: dom7__WEBPACK_IMPORTED_MODULE_0__.prev, 34111 prevAll: dom7__WEBPACK_IMPORTED_MODULE_0__.prevAll, 34112 parent: dom7__WEBPACK_IMPORTED_MODULE_0__.parent, 34113 parents: dom7__WEBPACK_IMPORTED_MODULE_0__.parents, 34114 closest: dom7__WEBPACK_IMPORTED_MODULE_0__.closest, 34115 find: dom7__WEBPACK_IMPORTED_MODULE_0__.find, 34116 children: dom7__WEBPACK_IMPORTED_MODULE_0__.children, 34117 filter: dom7__WEBPACK_IMPORTED_MODULE_0__.filter, 34118 remove: dom7__WEBPACK_IMPORTED_MODULE_0__.remove 34119}; 34120Object.keys(Methods).forEach(methodName => { 34121 Object.defineProperty(dom7__WEBPACK_IMPORTED_MODULE_0__.$.fn, methodName, { 34122 value: Methods[methodName], 34123 writable: true 34124 }); 34125}); 34126/* harmony default export */ __webpack_exports__["default"] = (dom7__WEBPACK_IMPORTED_MODULE_0__.$); 34127 34128/***/ }), 34129
vendor: 2,310 bytes, lines 34130-34204
34130/***/ "./node_modules/swiper/shared/effect-init.js": 34131/*!***************************************************!*\ 34132 !*** ./node_modules/swiper/shared/effect-init.js ***! 34133 \***************************************************/ 34134/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34135 34136"use strict"; 34137/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34138/* harmony export */ "default": function() { return /* binding */ effectInit; } 34139/* harmony export */ }); 34140function effectInit(params) { 34141 const { 34142 effect, 34143 swiper, 34144 on, 34145 setTranslate, 34146 setTransition, 34147 overwriteParams, 34148 perspective, 34149 recreateShadows, 34150 getEffectParams 34151 } = params; 34152 on('beforeInit', () => { 34153 if (swiper.params.effect !== effect) return; 34154 swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`); 34155 34156 if (perspective && perspective()) { 34157 swiper.classNames.push(`${swiper.params.containerModifierClass}3d`); 34158 } 34159 34160 const overwriteParamsResult = overwriteParams ? overwriteParams() : {}; 34161 Object.assign(swiper.params, overwriteParamsResult); 34162 Object.assign(swiper.originalParams, overwriteParamsResult); 34163 }); 34164 on('setTranslate', () => { 34165 if (swiper.params.effect !== effect) return; 34166 setTranslate(); 34167 }); 34168 on('setTransition', (_s, duration) => { 34169 if (swiper.params.effect !== effect) return; 34170 setTransition(duration); 34171 }); 34172 on('transitionEnd', () => { 34173 if (swiper.params.effect !== effect) return; 34174 34175 if (recreateShadows) { 34176 if (!getEffectParams || !getEffectParams().slideShadows) return; // remove shadows 34177 34178 swiper.slides.each(slideEl => { 34179 const $slideEl = swiper.$(slideEl); 34180 $slideEl.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').remove(); 34181 }); // create new one 34182 34183 recreateShadows(); 34184 } 34185 }); 34186 let requireUpdateOnVirtual; 34187 on('virtualUpdate', () => { 34188 if (swiper.params.effect !== effect) return; 34189 34190 if (!swiper.slides.length) { 34191 requireUpdateOnVirtual = true; 34192 } 34193 34194 requestAnimationFrame(() => { 34195 if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) { 34196 setTranslate(); 34197 requireUpdateOnVirtual = false; 34198 } 34199 }); 34200 }); 34201} 34202 34203/***/ }), 34204
vendor: 788 bytes, lines 34205-34227
34205/***/ "./node_modules/swiper/shared/effect-target.js": 34206/*!*****************************************************!*\ 34207 !*** ./node_modules/swiper/shared/effect-target.js ***! 34208 \*****************************************************/ 34209/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34210 34211"use strict"; 34212/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34213/* harmony export */ "default": function() { return /* binding */ effectTarget; } 34214/* harmony export */ }); 34215function effectTarget(effectParams, $slideEl) { 34216 if (effectParams.transformEl) { 34217 return $slideEl.find(effectParams.transformEl).css({ 34218 'backface-visibility': 'hidden', 34219 '-webkit-backface-visibility': 'hidden' 34220 }); 34221 } 34222 34223 return $slideEl; 34224} 34225 34226/***/ }), 34227
vendor: 1,505 bytes, lines 34228-34275
34228/***/ "./node_modules/swiper/shared/effect-virtual-transition-end.js": 34229/*!*********************************************************************!*\ 34230 !*** ./node_modules/swiper/shared/effect-virtual-transition-end.js ***! 34231 \*********************************************************************/ 34232/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34233 34234"use strict"; 34235/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34236/* harmony export */ "default": function() { return /* binding */ effectVirtualTransitionEnd; } 34237/* harmony export */ }); 34238function effectVirtualTransitionEnd({ 34239 swiper, 34240 duration, 34241 transformEl, 34242 allSlides 34243}) { 34244 const { 34245 slides, 34246 activeIndex, 34247 $wrapperEl 34248 } = swiper; 34249 34250 if (swiper.params.virtualTranslate && duration !== 0) { 34251 let eventTriggered = false; 34252 let $transitionEndTarget; 34253 34254 if (allSlides) { 34255 $transitionEndTarget = transformEl ? slides.find(transformEl) : slides; 34256 } else { 34257 $transitionEndTarget = transformEl ? slides.eq(activeIndex).find(transformEl) : slides.eq(activeIndex); 34258 } 34259 34260 $transitionEndTarget.transitionEnd(() => { 34261 if (eventTriggered) return; 34262 if (!swiper || swiper.destroyed) return; 34263 eventTriggered = true; 34264 swiper.animating = false; 34265 const triggerEvents = ['webkitTransitionEnd', 'transitionend']; 34266 34267 for (let i = 0; i < triggerEvents.length; i += 1) { 34268 $wrapperEl.trigger(triggerEvents[i]); 34269 } 34270 }); 34271 } 34272} 34273 34274/***/ }), 34275
vendor: 1,208 bytes, lines 34276-34315
34276/***/ "./node_modules/swiper/shared/get-browser.js": 34277/*!***************************************************!*\ 34278 !*** ./node_modules/swiper/shared/get-browser.js ***! 34279 \***************************************************/ 34280/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34281 34282"use strict"; 34283/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34284/* harmony export */ getBrowser: function() { return /* binding */ getBrowser; } 34285/* harmony export */ }); 34286/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 34287 34288let browser; 34289 34290function calcBrowser() { 34291 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34292 34293 function isSafari() { 34294 const ua = window.navigator.userAgent.toLowerCase(); 34295 return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0; 34296 } 34297 34298 return { 34299 isSafari: isSafari(), 34300 isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent) 34301 }; 34302} 34303 34304function getBrowser() { 34305 if (!browser) { 34306 browser = calcBrowser(); 34307 } 34308 34309 return browser; 34310} 34311 34312 34313 34314/***/ }), 34315
vendor: 2,381 bytes, lines 34316-34387
34316/***/ "./node_modules/swiper/shared/get-device.js": 34317/*!**************************************************!*\ 34318 !*** ./node_modules/swiper/shared/get-device.js ***! 34319 \**************************************************/ 34320/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34321 34322"use strict"; 34323/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34324/* harmony export */ getDevice: function() { return /* binding */ getDevice; } 34325/* harmony export */ }); 34326/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 34327/* harmony import */ var _get_support_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-support.js */ "./node_modules/swiper/shared/get-support.js"); 34328 34329 34330let deviceCached; 34331 34332function calcDevice({ 34333 userAgent 34334} = {}) { 34335 const support = (0,_get_support_js__WEBPACK_IMPORTED_MODULE_1__.getSupport)(); 34336 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34337 const platform = window.navigator.platform; 34338 const ua = userAgent || window.navigator.userAgent; 34339 const device = { 34340 ios: false, 34341 android: false 34342 }; 34343 const screenWidth = window.screen.width; 34344 const screenHeight = window.screen.height; 34345 const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line 34346 34347 let ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 34348 const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); 34349 const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); 34350 const windows = platform === 'Win32'; 34351 let macos = platform === 'MacIntel'; // iPadOs 13 fix 34352 34353 const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810']; 34354 34355 if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) { 34356 ipad = ua.match(/(Version)\/([\d.]+)/); 34357 if (!ipad) ipad = [0, 1, '13_0_0']; 34358 macos = false; 34359 } // Android 34360 34361 34362 if (android && !windows) { 34363 device.os = 'android'; 34364 device.android = true; 34365 } 34366 34367 if (ipad || iphone || ipod) { 34368 device.os = 'ios'; 34369 device.ios = true; 34370 } // Export object 34371 34372 34373 return device; 34374} 34375 34376function getDevice(overrides = {}) { 34377 if (!deviceCached) { 34378 deviceCached = calcDevice(overrides); 34379 } 34380 34381 return deviceCached; 34382} 34383 34384 34385 34386/***/ }), 34387
vendor: 1,709 bytes, lines 34388-34442
34388/***/ "./node_modules/swiper/shared/get-support.js": 34389/*!***************************************************!*\ 34390 !*** ./node_modules/swiper/shared/get-support.js ***! 34391 \***************************************************/ 34392/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34393 34394"use strict"; 34395/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34396/* harmony export */ getSupport: function() { return /* binding */ getSupport; } 34397/* harmony export */ }); 34398/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 34399 34400let support; 34401 34402function calcSupport() { 34403 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34404 const document = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getDocument)(); 34405 return { 34406 smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style, 34407 touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch), 34408 passiveListener: function checkPassiveListener() { 34409 let supportsPassive = false; 34410 34411 try { 34412 const opts = Object.defineProperty({}, 'passive', { 34413 // eslint-disable-next-line 34414 get() { 34415 supportsPassive = true; 34416 } 34417 34418 }); 34419 window.addEventListener('testPassiveListener', null, opts); 34420 } catch (e) {// No support 34421 } 34422 34423 return supportsPassive; 34424 }(), 34425 gestures: function checkGestures() { 34426 return 'ongesturestart' in window; 34427 }() 34428 }; 34429} 34430 34431function getSupport() { 34432 if (!support) { 34433 support = calcSupport(); 34434 } 34435 34436 return support; 34437} 34438 34439 34440 34441/***/ }), 34442
vendor: 7,002 bytes, lines 34443-34661
34443/***/ "./node_modules/swiper/shared/utils.js": 34444/*!*********************************************!*\ 34445 !*** ./node_modules/swiper/shared/utils.js ***! 34446 \*********************************************/ 34447/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34448 34449"use strict"; 34450/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34451/* harmony export */ animateCSSModeScroll: function() { return /* binding */ animateCSSModeScroll; }, 34452/* harmony export */ deleteProps: function() { return /* binding */ deleteProps; }, 34453/* harmony export */ extend: function() { return /* binding */ extend; }, 34454/* harmony export */ getTranslate: function() { return /* binding */ getTranslate; }, 34455/* harmony export */ isObject: function() { return /* binding */ isObject; }, 34456/* harmony export */ nextTick: function() { return /* binding */ nextTick; }, 34457/* harmony export */ now: function() { return /* binding */ now; }, 34458/* harmony export */ setCSSProperty: function() { return /* binding */ setCSSProperty; } 34459/* harmony export */ }); 34460/* unused harmony export getComputedStyle */ 34461/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ssr-window */ "./node_modules/ssr-window/ssr-window.esm.js"); 34462 34463 34464function deleteProps(obj) { 34465 const object = obj; 34466 Object.keys(object).forEach(key => { 34467 try { 34468 object[key] = null; 34469 } catch (e) {// no getter for object 34470 } 34471 34472 try { 34473 delete object[key]; 34474 } catch (e) {// something got wrong 34475 } 34476 }); 34477} 34478 34479function nextTick(callback, delay = 0) { 34480 return setTimeout(callback, delay); 34481} 34482 34483function now() { 34484 return Date.now(); 34485} 34486 34487function getComputedStyle(el) { 34488 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34489 let style; 34490 34491 if (window.getComputedStyle) { 34492 style = window.getComputedStyle(el, null); 34493 } 34494 34495 if (!style && el.currentStyle) { 34496 style = el.currentStyle; 34497 } 34498 34499 if (!style) { 34500 style = el.style; 34501 } 34502 34503 return style; 34504} 34505 34506function getTranslate(el, axis = 'x') { 34507 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34508 let matrix; 34509 let curTransform; 34510 let transformMatrix; 34511 const curStyle = getComputedStyle(el, null); 34512 34513 if (window.WebKitCSSMatrix) { 34514 curTransform = curStyle.transform || curStyle.webkitTransform; 34515 34516 if (curTransform.split(',').length > 6) { 34517 curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', '); 34518 } // Some old versions of Webkit choke when 'none' is passed; pass 34519 // empty string instead in this case 34520 34521 34522 transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); 34523 } else { 34524 transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); 34525 matrix = transformMatrix.toString().split(','); 34526 } 34527 34528 if (axis === 'x') { 34529 // Latest Chrome and webkits Fix 34530 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix 34531 else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers 34532 else curTransform = parseFloat(matrix[4]); 34533 } 34534 34535 if (axis === 'y') { 34536 // Latest Chrome and webkits Fix 34537 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix 34538 else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers 34539 else curTransform = parseFloat(matrix[5]); 34540 } 34541 34542 return curTransform || 0; 34543} 34544 34545function isObject(o) { 34546 return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object'; 34547} 34548 34549function isNode(node) { 34550 // eslint-disable-next-line 34551 if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { 34552 return node instanceof HTMLElement; 34553 } 34554 34555 return node && (node.nodeType === 1 || node.nodeType === 11); 34556} 34557 34558function extend(...args) { 34559 const to = Object(args[0]); 34560 const noExtend = ['__proto__', 'constructor', 'prototype']; 34561 34562 for (let i = 1; i < args.length; i += 1) { 34563 const nextSource = args[i]; 34564 34565 if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) { 34566 const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0); 34567 34568 for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { 34569 const nextKey = keysArray[nextIndex]; 34570 const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); 34571 34572 if (desc !== undefined && desc.enumerable) { 34573 if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 34574 if (nextSource[nextKey].__swiper__) { 34575 to[nextKey] = nextSource[nextKey]; 34576 } else { 34577 extend(to[nextKey], nextSource[nextKey]); 34578 } 34579 } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 34580 to[nextKey] = {}; 34581 34582 if (nextSource[nextKey].__swiper__) { 34583 to[nextKey] = nextSource[nextKey]; 34584 } else { 34585 extend(to[nextKey], nextSource[nextKey]); 34586 } 34587 } else { 34588 to[nextKey] = nextSource[nextKey]; 34589 } 34590 } 34591 } 34592 } 34593 } 34594 34595 return to; 34596} 34597 34598function setCSSProperty(el, varName, varValue) { 34599 el.style.setProperty(varName, varValue); 34600} 34601 34602function animateCSSModeScroll({ 34603 swiper, 34604 targetPosition, 34605 side 34606}) { 34607 const window = (0,ssr_window__WEBPACK_IMPORTED_MODULE_0__.getWindow)(); 34608 const startPosition = -swiper.translate; 34609 let startTime = null; 34610 let time; 34611 const duration = swiper.params.speed; 34612 swiper.wrapperEl.style.scrollSnapType = 'none'; 34613 window.cancelAnimationFrame(swiper.cssModeFrameID); 34614 const dir = targetPosition > startPosition ? 'next' : 'prev'; 34615 34616 const isOutOfBound = (current, target) => { 34617 return dir === 'next' && current >= target || dir === 'prev' && current <= target; 34618 }; 34619 34620 const animate = () => { 34621 time = new Date().getTime(); 34622 34623 if (startTime === null) { 34624 startTime = time; 34625 } 34626 34627 const progress = Math.max(Math.min((time - startTime) / duration, 1), 0); 34628 const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2; 34629 let currentPosition = startPosition + easeProgress * (targetPosition - startPosition); 34630 34631 if (isOutOfBound(currentPosition, targetPosition)) { 34632 currentPosition = targetPosition; 34633 } 34634 34635 swiper.wrapperEl.scrollTo({ 34636 [side]: currentPosition 34637 }); 34638 34639 if (isOutOfBound(currentPosition, targetPosition)) { 34640 swiper.wrapperEl.style.overflow = 'hidden'; 34641 swiper.wrapperEl.style.scrollSnapType = ''; 34642 setTimeout(() => { 34643 swiper.wrapperEl.style.overflow = ''; 34644 swiper.wrapperEl.scrollTo({ 34645 [side]: currentPosition 34646 }); 34647 }); 34648 window.cancelAnimationFrame(swiper.cssModeFrameID); 34649 return; 34650 } 34651 34652 swiper.cssModeFrameID = window.requestAnimationFrame(animate); 34653 }; 34654 34655 animate(); 34656} 34657 34658 34659 34660/***/ }), 34661
vendor: 6,238 bytes, lines 34662-34738
34662/***/ "./node_modules/swiper/swiper.esm.js": 34663/*!*******************************************!*\ 34664 !*** ./node_modules/swiper/swiper.esm.js ***! 34665 \*******************************************/ 34666/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 34667 34668"use strict"; 34669/* harmony export */ __webpack_require__.d(__webpack_exports__, { 34670/* harmony export */ Autoplay: function() { return /* reexport safe */ _modules_autoplay_autoplay_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }, 34671/* harmony export */ EffectFade: function() { return /* reexport safe */ _modules_effect_fade_effect_fade_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }, 34672/* harmony export */ "default": function() { return /* reexport safe */ _core_core_js__WEBPACK_IMPORTED_MODULE_0__["default"]; } 34673/* harmony export */ }); 34674/* harmony import */ var _core_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/core.js */ "./node_modules/swiper/core/core.js"); 34675/* harmony import */ var _modules_virtual_virtual_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modules/virtual/virtual.js */ "./node_modules/swiper/modules/virtual/virtual.js"); 34676/* harmony import */ var _modules_keyboard_keyboard_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/keyboard/keyboard.js */ "./node_modules/swiper/modules/keyboard/keyboard.js"); 34677/* harmony import */ var _modules_mousewheel_mousewheel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/mousewheel/mousewheel.js */ "./node_modules/swiper/modules/mousewheel/mousewheel.js"); 34678/* harmony import */ var _modules_navigation_navigation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/navigation/navigation.js */ "./node_modules/swiper/modules/navigation/navigation.js"); 34679/* harmony import */ var _modules_pagination_pagination_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/pagination/pagination.js */ "./node_modules/swiper/modules/pagination/pagination.js"); 34680/* harmony import */ var _modules_scrollbar_scrollbar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/scrollbar/scrollbar.js */ "./node_modules/swiper/modules/scrollbar/scrollbar.js"); 34681/* harmony import */ var _modules_parallax_parallax_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/parallax/parallax.js */ "./node_modules/swiper/modules/parallax/parallax.js"); 34682/* harmony import */ var _modules_zoom_zoom_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/zoom/zoom.js */ "./node_modules/swiper/modules/zoom/zoom.js"); 34683/* harmony import */ var _modules_lazy_lazy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/lazy/lazy.js */ "./node_modules/swiper/modules/lazy/lazy.js"); 34684/* harmony import */ var _modules_controller_controller_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/controller/controller.js */ "./node_modules/swiper/modules/controller/controller.js"); 34685/* harmony import */ var _modules_a11y_a11y_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/a11y/a11y.js */ "./node_modules/swiper/modules/a11y/a11y.js"); 34686/* harmony import */ var _modules_history_history_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/history/history.js */ "./node_modules/swiper/modules/history/history.js"); 34687/* harmony import */ var _modules_hash_navigation_hash_navigation_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./modules/hash-navigation/hash-navigation.js */ "./node_modules/swiper/modules/hash-navigation/hash-navigation.js"); 34688/* harmony import */ var _modules_autoplay_autoplay_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./modules/autoplay/autoplay.js */ "./node_modules/swiper/modules/autoplay/autoplay.js"); 34689/* harmony import */ var _modules_thumbs_thumbs_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./modules/thumbs/thumbs.js */ "./node_modules/swiper/modules/thumbs/thumbs.js"); 34690/* harmony import */ var _modules_free_mode_free_mode_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./modules/free-mode/free-mode.js */ "./node_modules/swiper/modules/free-mode/free-mode.js"); 34691/* harmony import */ var _modules_grid_grid_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./modules/grid/grid.js */ "./node_modules/swiper/modules/grid/grid.js"); 34692/* harmony import */ var _modules_manipulation_manipulation_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./modules/manipulation/manipulation.js */ "./node_modules/swiper/modules/manipulation/manipulation.js"); 34693/* harmony import */ var _modules_effect_fade_effect_fade_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./modules/effect-fade/effect-fade.js */ "./node_modules/swiper/modules/effect-fade/effect-fade.js"); 34694/* harmony import */ var _modules_effect_cube_effect_cube_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./modules/effect-cube/effect-cube.js */ "./node_modules/swiper/modules/effect-cube/effect-cube.js"); 34695/* harmony import */ var _modules_effect_flip_effect_flip_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./modules/effect-flip/effect-flip.js */ "./node_modules/swiper/modules/effect-flip/effect-flip.js"); 34696/* harmony import */ var _modules_effect_coverflow_effect_coverflow_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./modules/effect-coverflow/effect-coverflow.js */ "./node_modules/swiper/modules/effect-coverflow/effect-coverflow.js"); 34697/* harmony import */ var _modules_effect_creative_effect_creative_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./modules/effect-creative/effect-creative.js */ "./node_modules/swiper/modules/effect-creative/effect-creative.js"); 34698/* harmony import */ var _modules_effect_cards_effect_cards_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./modules/effect-cards/effect-cards.js */ "./node_modules/swiper/modules/effect-cards/effect-cards.js"); 34699/** 34700 * Swiper 8.4.7 34701 * Most modern mobile touch slider and framework with hardware accelerated transitions 34702 * https://swiperjs.com 34703 * 34704 * Copyright 2014-2023 Vladimir Kharlampidi 34705 * 34706 * Released under the MIT License 34707 * 34708 * Released on: January 30, 2023 34709 */ 34710 34711 34712 34713 34714 34715 34716 34717 34718 34719 34720 34721 34722 34723 34724 34725 34726 34727 34728 34729 34730 34731 34732 34733 34734 34735 34736 34737/***/ }), 34738
vendor: 280 bytes, lines 34739-34749
34739/***/ "./node_modules/swiper/swiper.min.css": 34740/*!********************************************!*\ 34741 !*** ./node_modules/swiper/swiper.min.css ***! 34742 \********************************************/ 34743/***/ (function() { 34744 34745"use strict"; 34746// extracted by mini-css-extract-plugin 34747 34748 34749/***/ })
34749 34750 34751}]); 34752//# sourceMappingURL=vendor.48961b93ffc4d090a278.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.