1/******/ (function() { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
vendor: 21,985 bytes, lines 4-548
4/***/ "./node_modules/aos/dist/aos.js": 5/*!**************************************!*\ 6 !*** ./node_modules/aos/dist/aos.js ***! 7 \**************************************/ 8/***/ (function(module, exports, __webpack_require__) { 9 10/* module decorator */ module = __webpack_require__.nmd(module); 11var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 12!function (e, t) { 13 "object" == ( false ? 0 : _typeof(exports)) && "object" == ( false ? 0 : _typeof(module)) ? module.exports = t() : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t), 14 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 15 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 16 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0; 17}(this, function () { 18 return function (e) { 19 function t(o) { 20 if (n[o]) return n[o].exports; 21 var i = n[o] = { 22 exports: {}, 23 id: o, 24 loaded: !1 25 }; 26 return e[o].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports; 27 } 28 var n = {}; 29 return t.m = e, t.c = n, t.p = "dist/", t(0); 30 }([function (e, t, n) { 31 "use strict"; 32 33 function o(e) { 34 return e && e.__esModule ? e : { 35 default: e 36 }; 37 } 38 var i = Object.assign || function (e) { 39 for (var t = 1; t < arguments.length; t++) { 40 var n = arguments[t]; 41 for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]); 42 } 43 return e; 44 }, 45 r = n(1), 46 a = (o(r), n(6)), 47 u = o(a), 48 c = n(7), 49 s = o(c), 50 f = n(8), 51 d = o(f), 52 l = n(9), 53 p = o(l), 54 m = n(10), 55 b = o(m), 56 v = n(11), 57 y = o(v), 58 g = n(14), 59 h = o(g), 60 w = [], 61 k = !1, 62 x = { 63 offset: 120, 64 delay: 0, 65 easing: "ease", 66 duration: 400, 67 disable: !1, 68 once: !1, 69 startEvent: "DOMContentLoaded", 70 throttleDelay: 99, 71 debounceDelay: 50, 72 disableMutationObserver: !1 73 }, 74 j = function j() { 75 var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; 76 if (e && (k = !0), k) return w = (0, y.default)(w, x), (0, b.default)(w, x.once), w; 77 }, 78 O = function O() { 79 w = (0, h.default)(), j(); 80 }, 81 M = function M() { 82 w.forEach(function (e, t) { 83 e.node.removeAttribute("data-aos"), e.node.removeAttribute("data-aos-easing"), e.node.removeAttribute("data-aos-duration"), e.node.removeAttribute("data-aos-delay"); 84 }); 85 }, 86 S = function S(e) { 87 return e === !0 || "mobile" === e && p.default.mobile() || "phone" === e && p.default.phone() || "tablet" === e && p.default.tablet() || "function" == typeof e && e() === !0; 88 }, 89 _ = function _(e) { 90 x = i(x, e), w = (0, h.default)(); 91 var t = document.all && !window.atob; 92 return S(x.disable) || t ? M() : (x.disableMutationObserver || d.default.isSupported() || (console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '), x.disableMutationObserver = !0), document.querySelector("body").setAttribute("data-aos-easing", x.easing), document.querySelector("body").setAttribute("data-aos-duration", x.duration), document.querySelector("body").setAttribute("data-aos-delay", x.delay), "DOMContentLoaded" === x.startEvent && ["complete", "interactive"].indexOf(document.readyState) > -1 ? j(!0) : "load" === x.startEvent ? window.addEventListener(x.startEvent, function () { 93 j(!0); 94 }) : document.addEventListener(x.startEvent, function () { 95 j(!0); 96 }), window.addEventListener("resize", (0, s.default)(j, x.debounceDelay, !0)), window.addEventListener("orientationchange", (0, s.default)(j, x.debounceDelay, !0)), window.addEventListener("scroll", (0, u.default)(function () { 97 (0, b.default)(w, x.once); 98 }, x.throttleDelay)), x.disableMutationObserver || d.default.ready("[data-aos]", O), w); 99 }; 100 e.exports = { 101 init: _, 102 refresh: j, 103 refreshHard: O 104 }; 105 }, function (e, t) {},,,,, function (e, t) { 106 (function (t) { 107 "use strict"; 108 109 function n(e, t, n) { 110 function o(t) { 111 var n = b, 112 o = v; 113 return b = v = void 0, k = t, g = e.apply(o, n); 114 } 115 function r(e) { 116 return k = e, h = setTimeout(f, t), M ? o(e) : g; 117 } 118 function a(e) { 119 var n = e - w, 120 o = e - k, 121 i = t - n; 122 return S ? j(i, y - o) : i; 123 } 124 function c(e) { 125 var n = e - w, 126 o = e - k; 127 return void 0 === w || n >= t || n < 0 || S && o >= y; 128 } 129 function f() { 130 var e = O(); 131 return c(e) ? d(e) : void (h = setTimeout(f, a(e))); 132 } 133 function d(e) { 134 return h = void 0, _ && b ? o(e) : (b = v = void 0, g); 135 } 136 function l() { 137 void 0 !== h && clearTimeout(h), k = 0, b = w = v = h = void 0; 138 } 139 function p() { 140 return void 0 === h ? g : d(O()); 141 } 142 function m() { 143 var e = O(), 144 n = c(e); 145 if (b = arguments, v = this, w = e, n) { 146 if (void 0 === h) return r(w); 147 if (S) return h = setTimeout(f, t), o(w); 148 } 149 return void 0 === h && (h = setTimeout(f, t)), g; 150 } 151 var b, 152 v, 153 y, 154 g, 155 h, 156 w, 157 k = 0, 158 M = !1, 159 S = !1, 160 _ = !0; 161 if ("function" != typeof e) throw new TypeError(s); 162 return t = u(t) || 0, i(n) && (M = !!n.leading, S = "maxWait" in n, y = S ? x(u(n.maxWait) || 0, t) : y, _ = "trailing" in n ? !!n.trailing : _), m.cancel = l, m.flush = p, m; 163 } 164 function o(e, t, o) { 165 var r = !0, 166 a = !0; 167 if ("function" != typeof e) throw new TypeError(s); 168 return i(o) && (r = "leading" in o ? !!o.leading : r, a = "trailing" in o ? !!o.trailing : a), n(e, t, { 169 leading: r, 170 maxWait: t, 171 trailing: a 172 }); 173 } 174 function i(e) { 175 var t = "undefined" == typeof e ? "undefined" : c(e); 176 return !!e && ("object" == t || "function" == t); 177 } 178 function r(e) { 179 return !!e && "object" == ("undefined" == typeof e ? "undefined" : c(e)); 180 } 181 function a(e) { 182 return "symbol" == ("undefined" == typeof e ? "undefined" : c(e)) || r(e) && k.call(e) == d; 183 } 184 function u(e) { 185 if ("number" == typeof e) return e; 186 if (a(e)) return f; 187 if (i(e)) { 188 var t = "function" == typeof e.valueOf ? e.valueOf() : e; 189 e = i(t) ? t + "" : t; 190 } 191 if ("string" != typeof e) return 0 === e ? e : +e; 192 e = e.replace(l, ""); 193 var n = m.test(e); 194 return n || b.test(e) ? v(e.slice(2), n ? 2 : 8) : p.test(e) ? f : +e; 195 } 196 var c = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) { 197 return _typeof(e); 198 } : function (e) { 199 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e); 200 }, 201 s = "Expected a function", 202 f = NaN, 203 d = "[object Symbol]", 204 l = /^\s+|\s+$/g, 205 p = /^[-+]0x[0-9a-f]+$/i, 206 m = /^0b[01]+$/i, 207 b = /^0o[0-7]+$/i, 208 v = parseInt, 209 y = "object" == ("undefined" == typeof t ? "undefined" : c(t)) && t && t.Object === Object && t, 210 g = "object" == ("undefined" == typeof self ? "undefined" : c(self)) && self && self.Object === Object && self, 211 h = y || g || Function("return this")(), 212 w = Object.prototype, 213 k = w.toString, 214 x = Math.max, 215 j = Math.min, 216 O = function O() { 217 return h.Date.now(); 218 }; 219 e.exports = o; 220 }).call(t, function () { 221 return this; 222 }()); 223 }, function (e, t) { 224 (function (t) { 225 "use strict"; 226 227 function n(e, t, n) { 228 function i(t) { 229 var n = b, 230 o = v; 231 return b = v = void 0, O = t, g = e.apply(o, n); 232 } 233 function r(e) { 234 return O = e, h = setTimeout(f, t), M ? i(e) : g; 235 } 236 function u(e) { 237 var n = e - w, 238 o = e - O, 239 i = t - n; 240 return S ? x(i, y - o) : i; 241 } 242 function s(e) { 243 var n = e - w, 244 o = e - O; 245 return void 0 === w || n >= t || n < 0 || S && o >= y; 246 } 247 function f() { 248 var e = j(); 249 return s(e) ? d(e) : void (h = setTimeout(f, u(e))); 250 } 251 function d(e) { 252 return h = void 0, _ && b ? i(e) : (b = v = void 0, g); 253 } 254 function l() { 255 void 0 !== h && clearTimeout(h), O = 0, b = w = v = h = void 0; 256 } 257 function p() { 258 return void 0 === h ? g : d(j()); 259 } 260 function m() { 261 var e = j(), 262 n = s(e); 263 if (b = arguments, v = this, w = e, n) { 264 if (void 0 === h) return r(w); 265 if (S) return h = setTimeout(f, t), i(w); 266 } 267 return void 0 === h && (h = setTimeout(f, t)), g; 268 } 269 var b, 270 v, 271 y, 272 g, 273 h, 274 w, 275 O = 0, 276 M = !1, 277 S = !1, 278 _ = !0; 279 if ("function" != typeof e) throw new TypeError(c); 280 return t = a(t) || 0, o(n) && (M = !!n.leading, S = "maxWait" in n, y = S ? k(a(n.maxWait) || 0, t) : y, _ = "trailing" in n ? !!n.trailing : _), m.cancel = l, m.flush = p, m; 281 } 282 function o(e) { 283 var t = "undefined" == typeof e ? "undefined" : u(e); 284 return !!e && ("object" == t || "function" == t); 285 } 286 function i(e) { 287 return !!e && "object" == ("undefined" == typeof e ? "undefined" : u(e)); 288 } 289 function r(e) { 290 return "symbol" == ("undefined" == typeof e ? "undefined" : u(e)) || i(e) && w.call(e) == f; 291 } 292 function a(e) { 293 if ("number" == typeof e) return e; 294 if (r(e)) return s; 295 if (o(e)) { 296 var t = "function" == typeof e.valueOf ? e.valueOf() : e; 297 e = o(t) ? t + "" : t; 298 } 299 if ("string" != typeof e) return 0 === e ? e : +e; 300 e = e.replace(d, ""); 301 var n = p.test(e); 302 return n || m.test(e) ? b(e.slice(2), n ? 2 : 8) : l.test(e) ? s : +e; 303 } 304 var u = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) { 305 return _typeof(e); 306 } : function (e) { 307 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e); 308 }, 309 c = "Expected a function", 310 s = NaN, 311 f = "[object Symbol]", 312 d = /^\s+|\s+$/g, 313 l = /^[-+]0x[0-9a-f]+$/i, 314 p = /^0b[01]+$/i, 315 m = /^0o[0-7]+$/i, 316 b = parseInt, 317 v = "object" == ("undefined" == typeof t ? "undefined" : u(t)) && t && t.Object === Object && t, 318 y = "object" == ("undefined" == typeof self ? "undefined" : u(self)) && self && self.Object === Object && self, 319 g = v || y || Function("return this")(), 320 h = Object.prototype, 321 w = h.toString, 322 k = Math.max, 323 x = Math.min, 324 j = function j() { 325 return g.Date.now(); 326 }; 327 e.exports = n; 328 }).call(t, function () { 329 return this; 330 }()); 331 }, function (e, t) { 332 "use strict"; 333 334 function n(e) { 335 var t = void 0, 336 o = void 0, 337 i = void 0; 338 for (t = 0; t < e.length; t += 1) { 339 if (o = e[t], o.dataset && o.dataset.aos) return !0; 340 if (i = o.children && n(o.children)) return !0; 341 } 342 return !1; 343 } 344 function o() { 345 return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 346 } 347 function i() { 348 return !!o(); 349 } 350 function r(e, t) { 351 var n = window.document, 352 i = o(), 353 r = new i(a); 354 u = t, r.observe(n.documentElement, { 355 childList: !0, 356 subtree: !0, 357 removedNodes: !0 358 }); 359 } 360 function a(e) { 361 e && e.forEach(function (e) { 362 var t = Array.prototype.slice.call(e.addedNodes), 363 o = Array.prototype.slice.call(e.removedNodes), 364 i = t.concat(o); 365 if (n(i)) return u(); 366 }); 367 } 368 Object.defineProperty(t, "__esModule", { 369 value: !0 370 }); 371 var u = function u() {}; 372 t.default = { 373 isSupported: i, 374 ready: r 375 }; 376 }, function (e, t) { 377 "use strict"; 378 379 function n(e, t) { 380 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); 381 } 382 function o() { 383 return navigator.userAgent || navigator.vendor || window.opera || ""; 384 } 385 Object.defineProperty(t, "__esModule", { 386 value: !0 387 }); 388 var i = function () { 389 function e(e, t) { 390 for (var n = 0; n < t.length; n++) { 391 var o = t[n]; 392 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o); 393 } 394 } 395 return function (t, n, o) { 396 return n && e(t.prototype, n), o && e(t, o), t; 397 }; 398 }(), 399 r = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, 400 a = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, 401 u = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i, 402 c = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, 403 s = function () { 404 function e() { 405 n(this, e); 406 } 407 return i(e, [{ 408 key: "phone", 409 value: function value() { 410 var e = o(); 411 return !(!r.test(e) && !a.test(e.substr(0, 4))); 412 } 413 }, { 414 key: "mobile", 415 value: function value() { 416 var e = o(); 417 return !(!u.test(e) && !c.test(e.substr(0, 4))); 418 } 419 }, { 420 key: "tablet", 421 value: function value() { 422 return this.mobile() && !this.phone(); 423 } 424 }]), e; 425 }(); 426 t.default = new s(); 427 }, function (e, t) { 428 "use strict"; 429 430 Object.defineProperty(t, "__esModule", { 431 value: !0 432 }); 433 var n = function n(e, t, _n) { 434 var o = e.node.getAttribute("data-aos-once"); 435 t > e.position ? e.node.classList.add("aos-animate") : "undefined" != typeof o && ("false" === o || !_n && "true" !== o) && e.node.classList.remove("aos-animate"); 436 }, 437 o = function o(e, t) { 438 var o = window.pageYOffset, 439 i = window.innerHeight; 440 e.forEach(function (e, r) { 441 n(e, i + o, t); 442 }); 443 }; 444 t.default = o; 445 }, function (e, t, n) { 446 "use strict"; 447 448 function o(e) { 449 return e && e.__esModule ? e : { 450 default: e 451 }; 452 } 453 Object.defineProperty(t, "__esModule", { 454 value: !0 455 }); 456 var i = n(12), 457 r = o(i), 458 a = function a(e, t) { 459 return e.forEach(function (e, n) { 460 e.node.classList.add("aos-init"), e.position = (0, r.default)(e.node, t.offset); 461 }), e; 462 }; 463 t.default = a; 464 }, function (e, t, n) { 465 "use strict"; 466 467 function o(e) { 468 return e && e.__esModule ? e : { 469 default: e 470 }; 471 } 472 Object.defineProperty(t, "__esModule", { 473 value: !0 474 }); 475 var i = n(13), 476 r = o(i), 477 a = function a(e, t) { 478 var n = 0, 479 o = 0, 480 i = window.innerHeight, 481 a = { 482 offset: e.getAttribute("data-aos-offset"), 483 anchor: e.getAttribute("data-aos-anchor"), 484 anchorPlacement: e.getAttribute("data-aos-anchor-placement") 485 }; 486 switch (a.offset && !isNaN(a.offset) && (o = parseInt(a.offset)), a.anchor && document.querySelectorAll(a.anchor) && (e = document.querySelectorAll(a.anchor)[0]), n = (0, r.default)(e).top, a.anchorPlacement) { 487 case "top-bottom": 488 break; 489 case "center-bottom": 490 n += e.offsetHeight / 2; 491 break; 492 case "bottom-bottom": 493 n += e.offsetHeight; 494 break; 495 case "top-center": 496 n += i / 2; 497 break; 498 case "bottom-center": 499 n += i / 2 + e.offsetHeight; 500 break; 501 case "center-center": 502 n += i / 2 + e.offsetHeight / 2; 503 break; 504 case "top-top": 505 n += i; 506 break; 507 case "bottom-top": 508 n += e.offsetHeight + i; 509 break; 510 case "center-top": 511 n += e.offsetHeight / 2 + i; 512 } 513 return a.anchorPlacement || a.offset || isNaN(t) || (o = t), n + o; 514 }; 515 t.default = a; 516 }, function (e, t) { 517 "use strict"; 518 519 Object.defineProperty(t, "__esModule", { 520 value: !0 521 }); 522 var n = function n(e) { 523 for (var t = 0, n = 0; e && !isNaN(e.offsetLeft) && !isNaN(e.offsetTop);) t += e.offsetLeft - ("BODY" != e.tagName ? e.scrollLeft : 0), n += e.offsetTop - ("BODY" != e.tagName ? e.scrollTop : 0), e = e.offsetParent; 524 return { 525 top: n, 526 left: t 527 }; 528 }; 529 t.default = n; 530 }, function (e, t) { 531 "use strict"; 532 533 Object.defineProperty(t, "__esModule", { 534 value: !0 535 }); 536 var n = function n(e) { 537 return e = e || document.querySelectorAll("[data-aos]"), Array.prototype.map.call(e, function (e) { 538 return { 539 node: e 540 }; 541 }); 542 }; 543 t.default = n; 544 }]); 545}); 546 547/***/ }), 548
vendor: 481,848 bytes, lines 549-10036
549/***/ "./node_modules/lodash/lodash.js": 550/*!***************************************!*\ 551 !*** ./node_modules/lodash/lodash.js ***! 552 \***************************************/ 553/***/ (function(module, exports, __webpack_require__) { 554 555/* module decorator */ module = __webpack_require__.nmd(module); 556var __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}/** 557 * @license 558 * Lodash <https://lodash.com/> 559 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 560 * Released under MIT license <https://lodash.com/license> 561 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 562 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 563 */;(function(){/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined;/** Used as the semantic version number. */var VERSION='4.17.21';/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** Error message constants. */var CORE_ERROR_TEXT='Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',FUNC_ERROR_TEXT='Expected a function',INVALID_TEMPL_VAR_ERROR_TEXT='Invalid `variable` option passed into `_.template`';/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED='__lodash_hash_undefined__';/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500;/** Used as the internal argument placeholder. */var PLACEHOLDER='__lodash_placeholder__';/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4;/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512;/** Used as default options for `_.truncate`. */var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION='...';/** Used to detect hot functions by number of calls within a span of milliseconds. */var HOT_COUNT=800,HOT_SPAN=16;/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3;/** Used as references for various `Number` constants. */var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e+308,NAN=0/0;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;/** Used to associate wrap methods with their bit flags. */var wrapFlags=[['ary',WRAP_ARY_FLAG],['bind',WRAP_BIND_FLAG],['bindKey',WRAP_BIND_KEY_FLAG],['curry',WRAP_CURRY_FLAG],['curryRight',WRAP_CURRY_RIGHT_FLAG],['flip',WRAP_FLIP_FLAG],['partial',WRAP_PARTIAL_FLAG],['partialRight',WRAP_PARTIAL_RIGHT_FLAG],['rearg',WRAP_REARG_FLAG]];/** `Object#toString` result references. */var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',domExcTag='[object DOMException]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',promiseTag='[object Promise]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',symbolTag='[object Symbol]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]',weakSetTag='[object WeakSet]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;/** Used to match HTML entities and HTML characters. */var reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);/** Used to match template delimiters. */var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;/** Used to match property names within property paths. */var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/** 564 * Used to match `RegExp` 565 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 566 */var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source);/** Used to match leading whitespace. */var reTrimStart=/^\s+/;/** Used to match a single whitespace character. */var reWhitespace=/\s/;/** Used to match wrap detail comments. */var reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /;/** Used to match words composed of alphanumeric characters. */var reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;/** 567 * Used to validate the `validate` option in `_.template` variable. 568 * 569 * Forbids characters which could potentially change the meaning of the function argument definition: 570 * - "()," (modification of function parameters) 571 * - "=" (default value) 572 * - "[]{}" (destructuring of function parameters) 573 * - "/" (beginning of a comment) 574 * - whitespace 575 */var reForbiddenIdentifierChars=/[()=,{}\[\]\/\s]/;/** Used to match backslashes in property paths. */var reEscapeChar=/\\(\\)?/g;/** 576 * Used to match 577 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 578 */var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags=/\w*$/;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary=/^0b[01]+$/i;/** Used to detect host constructors (Safari). */var reIsHostCtor=/^\[object .+?Constructor\]$/;/** Used to detect octal string values. */var reIsOctal=/^0o[0-7]+$/i;/** Used to detect unsigned integer values. */var reIsUint=/^(?:0|[1-9]\d*)$/;/** Used to match Latin Unicode letters (excluding mathematical operators). */var reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch=/($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString=/['\n\r\u2028\u2029\\]/g;/** Used to compose unicode character classes. */var rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange="\\u2700-\\u27bf",rsLowerRange='a-z\\xdf-\\xf6\\xf8-\\xff',rsMathOpRange='\\xac\\xb1\\xd7\\xf7',rsNonCharRange='\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',rsPunctuationRange="\\u2000-\\u206f",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",rsUpperRange='A-Z\\xc0-\\xd6\\xd8-\\xde',rsVarRange="\\ufe0e\\ufe0f",rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange;/** Used to compose unicode capture groups. */var rsApos="['\u2019]",rsAstral='['+rsAstralRange+']',rsBreak='['+rsBreakRange+']',rsCombo='['+rsComboRange+']',rsDigits='\\d+',rsDingbat='['+rsDingbatRange+']',rsLower='['+rsLowerRange+']',rsMisc='[^'+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+']',rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier='(?:'+rsCombo+'|'+rsFitz+')',rsNonAstral='[^'+rsAstralRange+']',rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper='['+rsUpperRange+']',rsZWJ="\\u200d";/** Used to compose unicode regexes. */var rsMiscLower='(?:'+rsLower+'|'+rsMisc+')',rsMiscUpper='(?:'+rsUpper+'|'+rsMisc+')',rsOptContrLower='(?:'+rsApos+'(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper='(?:'+rsApos+'(?:D|LL|M|RE|S|T|VE))?',reOptMod=rsModifier+'?',rsOptVar='['+rsVarRange+']?',rsOptJoin='(?:'+rsZWJ+'(?:'+[rsNonAstral,rsRegional,rsSurrPair].join('|')+')'+rsOptVar+reOptMod+')*',rsOrdLower='\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',rsOrdUpper='\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji='(?:'+[rsDingbat,rsRegional,rsSurrPair].join('|')+')'+rsSeq,rsSymbol='(?:'+[rsNonAstral+rsCombo+'?',rsCombo,rsRegional,rsSurrPair,rsAstral].join('|')+')';/** Used to match apostrophes. */var reApos=RegExp(rsApos,'g');/** 579 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 580 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 581 */var reComboMark=RegExp(rsCombo,'g');/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode=RegExp(rsFitz+'(?='+rsFitz+')|'+rsSymbol+rsSeq,'g');/** Used to match complex or compound words. */var reUnicodeWord=RegExp([rsUpper+'?'+rsLower+'+'+rsOptContrLower+'(?='+[rsBreak,rsUpper,'$'].join('|')+')',rsMiscUpper+'+'+rsOptContrUpper+'(?='+[rsBreak,rsUpper+rsMiscLower,'$'].join('|')+')',rsUpper+'?'+rsMiscLower+'+'+rsOptContrLower,rsUpper+'+'+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'),'g');/** 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/). */var reHasUnicode=RegExp('['+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+']');/** Used to detect strings that need a more robust regexp to match words. */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 ]/;/** Used to assign default `context` object properties. */var contextProps=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'];/** Used to make template sourceURLs easier to identify. */var templateCounter=-1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters={// Latin-1 Supplement block. 582'\xc0':'A','\xc1':'A','\xc2':'A','\xc3':'A','\xc4':'A','\xc5':'A','\xe0':'a','\xe1':'a','\xe2':'a','\xe3':'a','\xe4':'a','\xe5':'a','\xc7':'C','\xe7':'c','\xd0':'D','\xf0':'d','\xc8':'E','\xc9':'E','\xca':'E','\xcb':'E','\xe8':'e','\xe9':'e','\xea':'e','\xeb':'e','\xcc':'I','\xcd':'I','\xce':'I','\xcf':'I','\xec':'i','\xed':'i','\xee':'i','\xef':'i','\xd1':'N','\xf1':'n','\xd2':'O','\xd3':'O','\xd4':'O','\xd5':'O','\xd6':'O','\xd8':'O','\xf2':'o','\xf3':'o','\xf4':'o','\xf5':'o','\xf6':'o','\xf8':'o','\xd9':'U','\xda':'U','\xdb':'U','\xdc':'U','\xf9':'u','\xfa':'u','\xfb':'u','\xfc':'u','\xdd':'Y','\xfd':'y','\xff':'y','\xc6':'Ae','\xe6':'ae','\xde':'Th','\xfe':'th','\xdf':'ss',// Latin Extended-A block. 583"\u0100":'A',"\u0102":'A',"\u0104":'A',"\u0101":'a',"\u0103":'a',"\u0105":'a',"\u0106":'C',"\u0108":'C',"\u010A":'C',"\u010C":'C',"\u0107":'c',"\u0109":'c',"\u010B":'c',"\u010D":'c',"\u010E":'D',"\u0110":'D',"\u010F":'d',"\u0111":'d',"\u0112":'E',"\u0114":'E',"\u0116":'E',"\u0118":'E',"\u011A":'E',"\u0113":'e',"\u0115":'e',"\u0117":'e',"\u0119":'e',"\u011B":'e',"\u011C":'G',"\u011E":'G',"\u0120":'G',"\u0122":'G',"\u011D":'g',"\u011F":'g',"\u0121":'g',"\u0123":'g',"\u0124":'H',"\u0126":'H',"\u0125":'h',"\u0127":'h',"\u0128":'I',"\u012A":'I',"\u012C":'I',"\u012E":'I',"\u0130":'I',"\u0129":'i',"\u012B":'i',"\u012D":'i',"\u012F":'i',"\u0131":'i',"\u0134":'J',"\u0135":'j',"\u0136":'K',"\u0137":'k',"\u0138":'k',"\u0139":'L',"\u013B":'L',"\u013D":'L',"\u013F":'L',"\u0141":'L',"\u013A":'l',"\u013C":'l',"\u013E":'l',"\u0140":'l',"\u0142":'l',"\u0143":'N',"\u0145":'N',"\u0147":'N',"\u014A":'N',"\u0144":'n',"\u0146":'n',"\u0148":'n',"\u014B":'n',"\u014C":'O',"\u014E":'O',"\u0150":'O',"\u014D":'o',"\u014F":'o',"\u0151":'o',"\u0154":'R',"\u0156":'R',"\u0158":'R',"\u0155":'r',"\u0157":'r',"\u0159":'r',"\u015A":'S',"\u015C":'S',"\u015E":'S',"\u0160":'S',"\u015B":'s',"\u015D":'s',"\u015F":'s',"\u0161":'s',"\u0162":'T',"\u0164":'T',"\u0166":'T',"\u0163":'t',"\u0165":'t',"\u0167":'t',"\u0168":'U',"\u016A":'U',"\u016C":'U',"\u016E":'U',"\u0170":'U',"\u0172":'U',"\u0169":'u',"\u016B":'u',"\u016D":'u',"\u016F":'u',"\u0171":'u',"\u0173":'u',"\u0174":'W',"\u0175":'w',"\u0176":'Y',"\u0177":'y',"\u0178":'Y',"\u0179":'Z',"\u017B":'Z',"\u017D":'Z',"\u017A":'z',"\u017C":'z',"\u017E":'z',"\u0132":'IJ',"\u0133":'ij',"\u0152":'Oe',"\u0153":'oe',"\u0149":"'n","\u017F":'s'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":'''};/** Used to map HTML entities to characters. */var htmlUnescapes={'&':'&','<':'<','>':'>','"':'"',''':"'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r',"\u2028":'u2028',"\u2029":'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat=parseFloat,freeParseInt=parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal=(typeof __webpack_require__.g==="undefined"?"undefined":_typeof(__webpack_require__.g))=='object'&&__webpack_require__.g&&__webpack_require__.g.Object===Object&&__webpack_require__.g;/** Detect free variable `self`. */var freeSelf=(typeof self==="undefined"?"undefined":_typeof(self))=='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root=freeGlobal||freeSelf||Function('return this')();/** Detect free variable `exports`. */var freeExports=( false?0:_typeof(exports))=='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&( false?0:_typeof(module))=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+. 584var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10. 585return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();/* Node.js helper references. */var nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/*--------------------------------------------------------------------------*/ /** 586 * A faster alternative to `Function#apply`, this function invokes `func` 587 * with the `this` binding of `thisArg` and the arguments of `args`. 588 * 589 * @private 590 * @param {Function} func The function to invoke. 591 * @param {*} thisArg The `this` binding of `func`. 592 * @param {Array} args The arguments to invoke `func` with. 593 * @returns {*} Returns the result of `func`. 594 */function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}/** 595 * A specialized version of `baseAggregator` for arrays. 596 * 597 * @private 598 * @param {Array} [array] The array to iterate over. 599 * @param {Function} setter The function to set `accumulator` values. 600 * @param {Function} iteratee The iteratee to transform keys. 601 * @param {Object} accumulator The initial aggregated object. 602 * @returns {Function} Returns `accumulator`. 603 */function arrayAggregator(array,setter,iteratee,accumulator){var index=-1,length=array==null?0:array.length;while(++index<length){var value=array[index];setter(accumulator,value,iteratee(value),array);}return accumulator;}/** 604 * A specialized version of `_.forEach` for arrays without support for 605 * iteratee shorthands. 606 * 607 * @private 608 * @param {Array} [array] The array to iterate over. 609 * @param {Function} iteratee The function invoked per iteration. 610 * @returns {Array} Returns `array`. 611 */function arrayEach(array,iteratee){var index=-1,length=array==null?0:array.length;while(++index<length){if(iteratee(array[index],index,array)===false){break;}}return array;}/** 612 * A specialized version of `_.forEachRight` for arrays without support for 613 * iteratee shorthands. 614 * 615 * @private 616 * @param {Array} [array] The array to iterate over. 617 * @param {Function} iteratee The function invoked per iteration. 618 * @returns {Array} Returns `array`. 619 */function arrayEachRight(array,iteratee){var length=array==null?0:array.length;while(length--){if(iteratee(array[length],length,array)===false){break;}}return array;}/** 620 * A specialized version of `_.every` for arrays without support for 621 * iteratee shorthands. 622 * 623 * @private 624 * @param {Array} [array] The array to iterate over. 625 * @param {Function} predicate The function invoked per iteration. 626 * @returns {boolean} Returns `true` if all elements pass the predicate check, 627 * else `false`. 628 */function arrayEvery(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(!predicate(array[index],index,array)){return false;}}return true;}/** 629 * A specialized version of `_.filter` for arrays without support for 630 * iteratee shorthands. 631 * 632 * @private 633 * @param {Array} [array] The array to iterate over. 634 * @param {Function} predicate The function invoked per iteration. 635 * @returns {Array} Returns the new filtered array. 636 */function arrayFilter(array,predicate){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[resIndex++]=value;}}return result;}/** 637 * A specialized version of `_.includes` for arrays without support for 638 * specifying an index to search from. 639 * 640 * @private 641 * @param {Array} [array] The array to inspect. 642 * @param {*} target The value to search for. 643 * @returns {boolean} Returns `true` if `target` is found, else `false`. 644 */function arrayIncludes(array,value){var length=array==null?0:array.length;return!!length&&baseIndexOf(array,value,0)>-1;}/** 645 * This function is like `arrayIncludes` except that it accepts a comparator. 646 * 647 * @private 648 * @param {Array} [array] The array to inspect. 649 * @param {*} target The value to search for. 650 * @param {Function} comparator The comparator invoked per element. 651 * @returns {boolean} Returns `true` if `target` is found, else `false`. 652 */function arrayIncludesWith(array,value,comparator){var index=-1,length=array==null?0:array.length;while(++index<length){if(comparator(value,array[index])){return true;}}return false;}/** 653 * A specialized version of `_.map` for arrays without support for iteratee 654 * shorthands. 655 * 656 * @private 657 * @param {Array} [array] The array to iterate over. 658 * @param {Function} iteratee The function invoked per iteration. 659 * @returns {Array} Returns the new mapped array. 660 */function arrayMap(array,iteratee){var index=-1,length=array==null?0:array.length,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array);}return result;}/** 661 * Appends the elements of `values` to `array`. 662 * 663 * @private 664 * @param {Array} array The array to modify. 665 * @param {Array} values The values to append. 666 * @returns {Array} Returns `array`. 667 */function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index];}return array;}/** 668 * A specialized version of `_.reduce` for arrays without support for 669 * iteratee shorthands. 670 * 671 * @private 672 * @param {Array} [array] The array to iterate over. 673 * @param {Function} iteratee The function invoked per iteration. 674 * @param {*} [accumulator] The initial value. 675 * @param {boolean} [initAccum] Specify using the first element of `array` as 676 * the initial value. 677 * @returns {*} Returns the accumulated value. 678 */function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array==null?0:array.length;if(initAccum&&length){accumulator=array[++index];}while(++index<length){accumulator=iteratee(accumulator,array[index],index,array);}return accumulator;}/** 679 * A specialized version of `_.reduceRight` for arrays without support for 680 * iteratee shorthands. 681 * 682 * @private 683 * @param {Array} [array] The array to iterate over. 684 * @param {Function} iteratee The function invoked per iteration. 685 * @param {*} [accumulator] The initial value. 686 * @param {boolean} [initAccum] Specify using the last element of `array` as 687 * the initial value. 688 * @returns {*} Returns the accumulated value. 689 */function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=array==null?0:array.length;if(initAccum&&length){accumulator=array[--length];}while(length--){accumulator=iteratee(accumulator,array[length],length,array);}return accumulator;}/** 690 * A specialized version of `_.some` for arrays without support for iteratee 691 * shorthands. 692 * 693 * @private 694 * @param {Array} [array] The array to iterate over. 695 * @param {Function} predicate The function invoked per iteration. 696 * @returns {boolean} Returns `true` if any element passes the predicate check, 697 * else `false`. 698 */function arraySome(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(predicate(array[index],index,array)){return true;}}return false;}/** 699 * Gets the size of an ASCII `string`. 700 * 701 * @private 702 * @param {string} string The string inspect. 703 * @returns {number} Returns the string size. 704 */var asciiSize=baseProperty('length');/** 705 * Converts an ASCII `string` to an array. 706 * 707 * @private 708 * @param {string} string The string to convert. 709 * @returns {Array} Returns the converted array. 710 */function asciiToArray(string){return string.split('');}/** 711 * Splits an ASCII `string` into an array of its words. 712 * 713 * @private 714 * @param {string} The string to inspect. 715 * @returns {Array} Returns the words of `string`. 716 */function asciiWords(string){return string.match(reAsciiWord)||[];}/** 717 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 718 * without support for iteratee shorthands, which iterates over `collection` 719 * using `eachFunc`. 720 * 721 * @private 722 * @param {Array|Object} collection The collection to inspect. 723 * @param {Function} predicate The function invoked per iteration. 724 * @param {Function} eachFunc The function to iterate over `collection`. 725 * @returns {*} Returns the found element or its key, else `undefined`. 726 */function baseFindKey(collection,predicate,eachFunc){var result;eachFunc(collection,function(value,key,collection){if(predicate(value,key,collection)){result=key;return false;}});return result;}/** 727 * The base implementation of `_.findIndex` and `_.findLastIndex` without 728 * support for iteratee shorthands. 729 * 730 * @private 731 * @param {Array} array The array to inspect. 732 * @param {Function} predicate The function invoked per iteration. 733 * @param {number} fromIndex The index to search from. 734 * @param {boolean} [fromRight] Specify iterating from right to left. 735 * @returns {number} Returns the index of the matched value, else `-1`. 736 */function baseFindIndex(array,predicate,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?1:-1);while(fromRight?index--:++index<length){if(predicate(array[index],index,array)){return index;}}return-1;}/** 737 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 738 * 739 * @private 740 * @param {Array} array The array to inspect. 741 * @param {*} value The value to search for. 742 * @param {number} fromIndex The index to search from. 743 * @returns {number} Returns the index of the matched value, else `-1`. 744 */function baseIndexOf(array,value,fromIndex){return value===value?strictIndexOf(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex);}/** 745 * This function is like `baseIndexOf` except that it accepts a comparator. 746 * 747 * @private 748 * @param {Array} array The array to inspect. 749 * @param {*} value The value to search for. 750 * @param {number} fromIndex The index to search from. 751 * @param {Function} comparator The comparator invoked per element. 752 * @returns {number} Returns the index of the matched value, else `-1`. 753 */function baseIndexOfWith(array,value,fromIndex,comparator){var index=fromIndex-1,length=array.length;while(++index<length){if(comparator(array[index],value)){return index;}}return-1;}/** 754 * The base implementation of `_.isNaN` without support for number objects. 755 * 756 * @private 757 * @param {*} value The value to check. 758 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 759 */function baseIsNaN(value){return value!==value;}/** 760 * The base implementation of `_.mean` and `_.meanBy` without support for 761 * iteratee shorthands. 762 * 763 * @private 764 * @param {Array} array The array to iterate over. 765 * @param {Function} iteratee The function invoked per iteration. 766 * @returns {number} Returns the mean. 767 */function baseMean(array,iteratee){var length=array==null?0:array.length;return length?baseSum(array,iteratee)/length:NAN;}/** 768 * The base implementation of `_.property` without support for deep paths. 769 * 770 * @private 771 * @param {string} key The key of the property to get. 772 * @returns {Function} Returns the new accessor function. 773 */function baseProperty(key){return function(object){return object==null?undefined:object[key];};}/** 774 * The base implementation of `_.propertyOf` without support for deep paths. 775 * 776 * @private 777 * @param {Object} object The object to query. 778 * @returns {Function} Returns the new accessor function. 779 */function basePropertyOf(object){return function(key){return object==null?undefined:object[key];};}/** 780 * The base implementation of `_.reduce` and `_.reduceRight`, without support 781 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 782 * 783 * @private 784 * @param {Array|Object} collection The collection to iterate over. 785 * @param {Function} iteratee The function invoked per iteration. 786 * @param {*} accumulator The initial value. 787 * @param {boolean} initAccum Specify using the first or last element of 788 * `collection` as the initial value. 789 * @param {Function} eachFunc The function to iterate over `collection`. 790 * @returns {*} Returns the accumulated value. 791 */function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){eachFunc(collection,function(value,index,collection){accumulator=initAccum?(initAccum=false,value):iteratee(accumulator,value,index,collection);});return accumulator;}/** 792 * The base implementation of `_.sortBy` which uses `comparer` to define the 793 * sort order of `array` and replaces criteria objects with their corresponding 794 * values. 795 * 796 * @private 797 * @param {Array} array The array to sort. 798 * @param {Function} comparer The function to define sort order. 799 * @returns {Array} Returns `array`. 800 */function baseSortBy(array,comparer){var length=array.length;array.sort(comparer);while(length--){array[length]=array[length].value;}return array;}/** 801 * The base implementation of `_.sum` and `_.sumBy` without support for 802 * iteratee shorthands. 803 * 804 * @private 805 * @param {Array} array The array to iterate over. 806 * @param {Function} iteratee The function invoked per iteration. 807 * @returns {number} Returns the sum. 808 */function baseSum(array,iteratee){var result,index=-1,length=array.length;while(++index<length){var current=iteratee(array[index]);if(current!==undefined){result=result===undefined?current:result+current;}}return result;}/** 809 * The base implementation of `_.times` without support for iteratee shorthands 810 * or max array length checks. 811 * 812 * @private 813 * @param {number} n The number of times to invoke `iteratee`. 814 * @param {Function} iteratee The function invoked per iteration. 815 * @returns {Array} Returns the array of results. 816 */function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}/** 817 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 818 * of key-value pairs for `object` corresponding to the property names of `props`. 819 * 820 * @private 821 * @param {Object} object The object to query. 822 * @param {Array} props The property names to get values for. 823 * @returns {Object} Returns the key-value pairs. 824 */function baseToPairs(object,props){return arrayMap(props,function(key){return[key,object[key]];});}/** 825 * The base implementation of `_.trim`. 826 * 827 * @private 828 * @param {string} string The string to trim. 829 * @returns {string} Returns the trimmed string. 830 */function baseTrim(string){return string?string.slice(0,trimmedEndIndex(string)+1).replace(reTrimStart,''):string;}/** 831 * The base implementation of `_.unary` without support for storing metadata. 832 * 833 * @private 834 * @param {Function} func The function to cap arguments for. 835 * @returns {Function} Returns the new capped function. 836 */function baseUnary(func){return function(value){return func(value);};}/** 837 * The base implementation of `_.values` and `_.valuesIn` which creates an 838 * array of `object` property values corresponding to the property names 839 * of `props`. 840 * 841 * @private 842 * @param {Object} object The object to query. 843 * @param {Array} props The property names to get values for. 844 * @returns {Object} Returns the array of property values. 845 */function baseValues(object,props){return arrayMap(props,function(key){return object[key];});}/** 846 * Checks if a `cache` value for `key` exists. 847 * 848 * @private 849 * @param {Object} cache The cache to query. 850 * @param {string} key The key of the entry to check. 851 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 852 */function cacheHas(cache,key){return cache.has(key);}/** 853 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 854 * that is not found in the character symbols. 855 * 856 * @private 857 * @param {Array} strSymbols The string symbols to inspect. 858 * @param {Array} chrSymbols The character symbols to find. 859 * @returns {number} Returns the index of the first unmatched string symbol. 860 */function charsStartIndex(strSymbols,chrSymbols){var index=-1,length=strSymbols.length;while(++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}/** 861 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 862 * that is not found in the character symbols. 863 * 864 * @private 865 * @param {Array} strSymbols The string symbols to inspect. 866 * @param {Array} chrSymbols The character symbols to find. 867 * @returns {number} Returns the index of the last unmatched string symbol. 868 */function charsEndIndex(strSymbols,chrSymbols){var index=strSymbols.length;while(index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}/** 869 * Gets the number of `placeholder` occurrences in `array`. 870 * 871 * @private 872 * @param {Array} array The array to inspect. 873 * @param {*} placeholder The placeholder to search for. 874 * @returns {number} Returns the placeholder count. 875 */function countHolders(array,placeholder){var length=array.length,result=0;while(length--){if(array[length]===placeholder){++result;}}return result;}/** 876 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 877 * letters to basic Latin letters. 878 * 879 * @private 880 * @param {string} letter The matched letter to deburr. 881 * @returns {string} Returns the deburred letter. 882 */var deburrLetter=basePropertyOf(deburredLetters);/** 883 * Used by `_.escape` to convert characters to HTML entities. 884 * 885 * @private 886 * @param {string} chr The matched character to escape. 887 * @returns {string} Returns the escaped character. 888 */var escapeHtmlChar=basePropertyOf(htmlEscapes);/** 889 * Used by `_.template` to escape characters for inclusion in compiled string literals. 890 * 891 * @private 892 * @param {string} chr The matched character to escape. 893 * @returns {string} Returns the escaped character. 894 */function escapeStringChar(chr){return'\\'+stringEscapes[chr];}/** 895 * Gets the value at `key` of `object`. 896 * 897 * @private 898 * @param {Object} [object] The object to query. 899 * @param {string} key The key of the property to get. 900 * @returns {*} Returns the property value. 901 */function getValue(object,key){return object==null?undefined:object[key];}/** 902 * Checks if `string` contains Unicode symbols. 903 * 904 * @private 905 * @param {string} string The string to inspect. 906 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 907 */function hasUnicode(string){return reHasUnicode.test(string);}/** 908 * Checks if `string` contains a word composed of Unicode symbols. 909 * 910 * @private 911 * @param {string} string The string to inspect. 912 * @returns {boolean} Returns `true` if a word is found, else `false`. 913 */function hasUnicodeWord(string){return reHasUnicodeWord.test(string);}/** 914 * Converts `iterator` to an array. 915 * 916 * @private 917 * @param {Object} iterator The iterator to convert. 918 * @returns {Array} Returns the converted array. 919 */function iteratorToArray(iterator){var data,result=[];while(!(data=iterator.next()).done){result.push(data.value);}return result;}/** 920 * Converts `map` to its key-value pairs. 921 * 922 * @private 923 * @param {Object} map The map to convert. 924 * @returns {Array} Returns the key-value pairs. 925 */function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}/** 926 * Creates a unary function that invokes `func` with its argument transformed. 927 * 928 * @private 929 * @param {Function} func The function to wrap. 930 * @param {Function} transform The argument transform. 931 * @returns {Function} Returns the new function. 932 */function overArg(func,transform){return function(arg){return func(transform(arg));};}/** 933 * Replaces all `placeholder` elements in `array` with an internal placeholder 934 * and returns an array of their indexes. 935 * 936 * @private 937 * @param {Array} array The array to modify. 938 * @param {*} placeholder The placeholder to replace. 939 * @returns {Array} Returns the new array of placeholder indexes. 940 */function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(value===placeholder||value===PLACEHOLDER){array[index]=PLACEHOLDER;result[resIndex++]=index;}}return result;}/** 941 * Converts `set` to an array of its values. 942 * 943 * @private 944 * @param {Object} set The set to convert. 945 * @returns {Array} Returns the values. 946 */function setToArray(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}/** 947 * Converts `set` to its value-value pairs. 948 * 949 * @private 950 * @param {Object} set The set to convert. 951 * @returns {Array} Returns the value-value pairs. 952 */function setToPairs(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=[value,value];});return result;}/** 953 * A specialized version of `_.indexOf` which performs strict equality 954 * comparisons of values, i.e. `===`. 955 * 956 * @private 957 * @param {Array} array The array to inspect. 958 * @param {*} value The value to search for. 959 * @param {number} fromIndex The index to search from. 960 * @returns {number} Returns the index of the matched value, else `-1`. 961 */function strictIndexOf(array,value,fromIndex){var index=fromIndex-1,length=array.length;while(++index<length){if(array[index]===value){return index;}}return-1;}/** 962 * A specialized version of `_.lastIndexOf` which performs strict equality 963 * comparisons of values, i.e. `===`. 964 * 965 * @private 966 * @param {Array} array The array to inspect. 967 * @param {*} value The value to search for. 968 * @param {number} fromIndex The index to search from. 969 * @returns {number} Returns the index of the matched value, else `-1`. 970 */function strictLastIndexOf(array,value,fromIndex){var index=fromIndex+1;while(index--){if(array[index]===value){return index;}}return index;}/** 971 * Gets the number of symbols in `string`. 972 * 973 * @private 974 * @param {string} string The string to inspect. 975 * @returns {number} Returns the string size. 976 */function stringSize(string){return hasUnicode(string)?unicodeSize(string):asciiSize(string);}/** 977 * Converts `string` to an array. 978 * 979 * @private 980 * @param {string} string The string to convert. 981 * @returns {Array} Returns the converted array. 982 */function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string);}/** 983 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 984 * character of `string`. 985 * 986 * @private 987 * @param {string} string The string to inspect. 988 * @returns {number} Returns the index of the last non-whitespace character. 989 */function trimmedEndIndex(string){var index=string.length;while(index--&&reWhitespace.test(string.charAt(index))){}return index;}/** 990 * Used by `_.unescape` to convert HTML entities to characters. 991 * 992 * @private 993 * @param {string} chr The matched character to unescape. 994 * @returns {string} Returns the unescaped character. 995 */var unescapeHtmlChar=basePropertyOf(htmlUnescapes);/** 996 * Gets the size of a Unicode `string`. 997 * 998 * @private 999 * @param {string} string The string inspect. 1000 * @returns {number} Returns the string size. 1001 */function unicodeSize(string){var result=reUnicode.lastIndex=0;while(reUnicode.test(string)){++result;}return result;}/** 1002 * Converts a Unicode `string` to an array. 1003 * 1004 * @private 1005 * @param {string} string The string to convert. 1006 * @returns {Array} Returns the converted array. 1007 */function unicodeToArray(string){return string.match(reUnicode)||[];}/** 1008 * Splits a Unicode `string` into an array of its words. 1009 * 1010 * @private 1011 * @param {string} The string to inspect. 1012 * @returns {Array} Returns the words of `string`. 1013 */function unicodeWords(string){return string.match(reUnicodeWord)||[];}/*--------------------------------------------------------------------------*/ /** 1014 * Create a new pristine `lodash` function using the `context` object. 1015 * 1016 * @static 1017 * @memberOf _ 1018 * @since 1.1.0 1019 * @category Util 1020 * @param {Object} [context=root] The context object. 1021 * @returns {Function} Returns a new `lodash` function. 1022 * @example 1023 * 1024 * _.mixin({ 'foo': _.constant('foo') }); 1025 * 1026 * var lodash = _.runInContext(); 1027 * lodash.mixin({ 'bar': lodash.constant('bar') }); 1028 * 1029 * _.isFunction(_.foo); 1030 * // => true 1031 * _.isFunction(_.bar); 1032 * // => false 1033 * 1034 * lodash.isFunction(lodash.foo); 1035 * // => false 1036 * lodash.isFunction(lodash.bar); 1037 * // => true 1038 * 1039 * // Create a suped-up `defer` in Node.js. 1040 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 1041 */var runInContext=function runInContext(context){context=context==null?root:_.defaults(root.Object(),context,_.pick(root,contextProps));/** Built-in constructor references. */var Array=context.Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;/** Used for built-in method references. */var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype;/** Used to detect overreaching core-js shims. */var coreJsData=context['__core-js_shared__'];/** Used to resolve the decompiled source of functions. */var funcToString=funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** Used to generate unique IDs. */var idCounter=0;/** Used to detect methods masquerading as native. */var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||'');return uid?'Symbol(src)_1.'+uid:'';}();/** 1042 * Used to resolve the 1043 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 1044 * of values. 1045 */var nativeObjectToString=objectProto.toString;/** Used to infer the `Object` constructor. */var objectCtorString=funcToString.call(Object);/** Used to restore the original `_` reference in `_.noConflict`. */var oldDash=root._;/** Used to detect if a method is native. */var reIsNative=RegExp('^'+funcToString.call(hasOwnProperty).replace(reRegExpChar,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');/** Built-in value references. */var Buffer=moduleExports?context.Buffer:undefined,_Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=_Symbol?_Symbol.isConcatSpreadable:undefined,symIterator=_Symbol?_Symbol.iterator:undefined,symToStringTag=_Symbol?_Symbol.toStringTag:undefined;var defineProperty=function(){try{var func=getNative(Object,'defineProperty');func({},'',{});return func;}catch(e){}}();/** Mocked built-ins. */var ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse;/* Built-in method references that are verified to be native. */var DataView=getNative(context,'DataView'),Map=getNative(context,'Map'),Promise=getNative(context,'Promise'),Set=getNative(context,'Set'),WeakMap=getNative(context,'WeakMap'),nativeCreate=getNative(Object,'create');/** Used to store function metadata. */var metaMap=WeakMap&&new WeakMap();/** Used to lookup unminified function names. */var realNames={};/** Used to detect maps, sets, and weakmaps. */var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);/** Used to convert symbols to primitives and strings. */var symbolProto=_Symbol?_Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined;/*------------------------------------------------------------------------*/ /** 1046 * Creates a `lodash` object which wraps `value` to enable implicit method 1047 * chain sequences. Methods that operate on and return arrays, collections, 1048 * and functions can be chained together. Methods that retrieve a single value 1049 * or may return a primitive value will automatically end the chain sequence 1050 * and return the unwrapped value. Otherwise, the value must be unwrapped 1051 * with `_#value`. 1052 * 1053 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 1054 * enabled using `_.chain`. 1055 * 1056 * The execution of chained methods is lazy, that is, it's deferred until 1057 * `_#value` is implicitly or explicitly called. 1058 * 1059 * Lazy evaluation allows several methods to support shortcut fusion. 1060 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 1061 * the creation of intermediate arrays and can greatly reduce the number of 1062 * iteratee executions. Sections of a chain sequence qualify for shortcut 1063 * fusion if the section is applied to an array and iteratees accept only 1064 * one argument. The heuristic for whether a section qualifies for shortcut 1065 * fusion is subject to change. 1066 * 1067 * Chaining is supported in custom builds as long as the `_#value` method is 1068 * directly or indirectly included in the build. 1069 * 1070 * In addition to lodash methods, wrappers have `Array` and `String` methods. 1071 * 1072 * The wrapper `Array` methods are: 1073 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 1074 * 1075 * The wrapper `String` methods are: 1076 * `replace` and `split` 1077 * 1078 * The wrapper methods that support shortcut fusion are: 1079 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 1080 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 1081 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 1082 * 1083 * The chainable wrapper methods are: 1084 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 1085 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 1086 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 1087 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 1088 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 1089 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 1090 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 1091 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 1092 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 1093 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 1094 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 1095 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 1096 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 1097 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 1098 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 1099 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 1100 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 1101 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 1102 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 1103 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 1104 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 1105 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 1106 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 1107 * `zipObject`, `zipObjectDeep`, and `zipWith` 1108 * 1109 * The wrapper methods that are **not** chainable by default are: 1110 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 1111 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 1112 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 1113 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 1114 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 1115 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 1116 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 1117 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 1118 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 1119 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 1120 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 1121 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 1122 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 1123 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 1124 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 1125 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 1126 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 1127 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 1128 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 1129 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 1130 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 1131 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 1132 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 1133 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 1134 * `upperFirst`, `value`, and `words` 1135 * 1136 * @name _ 1137 * @constructor 1138 * @category Seq 1139 * @param {*} value The value to wrap in a `lodash` instance. 1140 * @returns {Object} Returns the new `lodash` wrapper instance. 1141 * @example 1142 * 1143 * function square(n) { 1144 * return n * n; 1145 * } 1146 * 1147 * var wrapped = _([1, 2, 3]); 1148 * 1149 * // Returns an unwrapped value. 1150 * wrapped.reduce(_.add); 1151 * // => 6 1152 * 1153 * // Returns a wrapped value. 1154 * var squares = wrapped.map(square); 1155 * 1156 * _.isArray(squares); 1157 * // => false 1158 * 1159 * _.isArray(squares.value()); 1160 * // => true 1161 */function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value;}if(hasOwnProperty.call(value,'__wrapped__')){return wrapperClone(value);}}return new LodashWrapper(value);}/** 1162 * The base implementation of `_.create` without support for assigning 1163 * properties to the created object. 1164 * 1165 * @private 1166 * @param {Object} proto The object to inherit from. 1167 * @returns {Object} Returns the new object. 1168 */var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto)){return{};}if(objectCreate){return objectCreate(proto);}object.prototype=proto;var result=new object();object.prototype=undefined;return result;};}();/** 1169 * The function whose prototype chain sequence wrappers inherit from. 1170 * 1171 * @private 1172 */function baseLodash(){// No operation performed. 1173}/** 1174 * The base constructor for creating `lodash` wrapper objects. 1175 * 1176 * @private 1177 * @param {*} value The value to wrap. 1178 * @param {boolean} [chainAll] Enable explicit method chain sequences. 1179 */function LodashWrapper(value,chainAll){this.__wrapped__=value;this.__actions__=[];this.__chain__=!!chainAll;this.__index__=0;this.__values__=undefined;}/** 1180 * By default, the template delimiters used by lodash are like those in 1181 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 1182 * following template settings to use alternative delimiters. 1183 * 1184 * @static 1185 * @memberOf _ 1186 * @type {Object} 1187 */lodash.templateSettings={/** 1188 * Used to detect `data` property values to be HTML-escaped. 1189 * 1190 * @memberOf _.templateSettings 1191 * @type {RegExp} 1192 */'escape':reEscape,/** 1193 * Used to detect code to be evaluated. 1194 * 1195 * @memberOf _.templateSettings 1196 * @type {RegExp} 1197 */'evaluate':reEvaluate,/** 1198 * Used to detect `data` property values to inject. 1199 * 1200 * @memberOf _.templateSettings 1201 * @type {RegExp} 1202 */'interpolate':reInterpolate,/** 1203 * Used to reference the data object in the template text. 1204 * 1205 * @memberOf _.templateSettings 1206 * @type {string} 1207 */'variable':'',/** 1208 * Used to import variables into the compiled template. 1209 * 1210 * @memberOf _.templateSettings 1211 * @type {Object} 1212 */'imports':{/** 1213 * A reference to the `lodash` function. 1214 * 1215 * @memberOf _.templateSettings.imports 1216 * @type {Function} 1217 */'_':lodash}};// Ensure wrappers are instances of `baseLodash`. 1218lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;LodashWrapper.prototype=baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;/*------------------------------------------------------------------------*/ /** 1219 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 1220 * 1221 * @private 1222 * @constructor 1223 * @param {*} value The value to wrap. 1224 */function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=MAX_ARRAY_LENGTH;this.__views__=[];}/** 1225 * Creates a clone of the lazy wrapper object. 1226 * 1227 * @private 1228 * @name clone 1229 * @memberOf LazyWrapper 1230 * @returns {Object} Returns the cloned `LazyWrapper` object. 1231 */function lazyClone(){var result=new LazyWrapper(this.__wrapped__);result.__actions__=copyArray(this.__actions__);result.__dir__=this.__dir__;result.__filtered__=this.__filtered__;result.__iteratees__=copyArray(this.__iteratees__);result.__takeCount__=this.__takeCount__;result.__views__=copyArray(this.__views__);return result;}/** 1232 * Reverses the direction of lazy iteration. 1233 * 1234 * @private 1235 * @name reverse 1236 * @memberOf LazyWrapper 1237 * @returns {Object} Returns the new reversed `LazyWrapper` object. 1238 */function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1;result.__filtered__=true;}else{result=this.clone();result.__dir__*=-1;}return result;}/** 1239 * Extracts the unwrapped value from its lazy wrapper. 1240 * 1241 * @private 1242 * @name value 1243 * @memberOf LazyWrapper 1244 * @returns {*} Returns the unwrapped value. 1245 */function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length){return baseWrapperValue(array,this.__actions__);}var result=[];outer:while(length--&&resIndex<takeCount){index+=dir;var iterIndex=-1,value=array[index];while(++iterIndex<iterLength){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(type==LAZY_MAP_FLAG){value=computed;}else if(!computed){if(type==LAZY_FILTER_FLAG){continue outer;}else{break outer;}}}result[resIndex++]=value;}return result;}// Ensure `LazyWrapper` is an instance of `baseLodash`. 1246LazyWrapper.prototype=baseCreate(baseLodash.prototype);LazyWrapper.prototype.constructor=LazyWrapper;/*------------------------------------------------------------------------*/ /** 1247 * Creates a hash object. 1248 * 1249 * @private 1250 * @constructor 1251 * @param {Array} [entries] The key-value pairs to cache. 1252 */function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/** 1253 * Removes all key-value entries from the hash. 1254 * 1255 * @private 1256 * @name clear 1257 * @memberOf Hash 1258 */function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};this.size=0;}/** 1259 * Removes `key` and its value from the hash. 1260 * 1261 * @private 1262 * @name delete 1263 * @memberOf Hash 1264 * @param {Object} hash The hash to modify. 1265 * @param {string} key The key of the value to remove. 1266 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 1267 */function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}/** 1268 * Gets the hash value for `key`. 1269 * 1270 * @private 1271 * @name get 1272 * @memberOf Hash 1273 * @param {string} key The key of the value to get. 1274 * @returns {*} Returns the entry value. 1275 */function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result;}return hasOwnProperty.call(data,key)?data[key]:undefined;}/** 1276 * Checks if a hash value for `key` exists. 1277 * 1278 * @private 1279 * @name has 1280 * @memberOf Hash 1281 * @param {string} key The key of the entry to check. 1282 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 1283 */function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key);}/** 1284 * Sets the hash `key` to `value`. 1285 * 1286 * @private 1287 * @name set 1288 * @memberOf Hash 1289 * @param {string} key The key of the value to set. 1290 * @param {*} value The value to set. 1291 * @returns {Object} Returns the hash instance. 1292 */function hashSet(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this;}// Add methods to `Hash`. 1293Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;/*------------------------------------------------------------------------*/ /** 1294 * Creates an list cache object. 1295 * 1296 * @private 1297 * @constructor 1298 * @param {Array} [entries] The key-value pairs to cache. 1299 */function ListCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/** 1300 * Removes all key-value entries from the list cache. 1301 * 1302 * @private 1303 * @name clear 1304 * @memberOf ListCache 1305 */function listCacheClear(){this.__data__=[];this.size=0;}/** 1306 * Removes `key` and its value from the list cache. 1307 * 1308 * @private 1309 * @name delete 1310 * @memberOf ListCache 1311 * @param {string} key The key of the value to remove. 1312 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 1313 */function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}/** 1314 * Gets the list cache value for `key`. 1315 * 1316 * @private 1317 * @name get 1318 * @memberOf ListCache 1319 * @param {string} key The key of the value to get. 1320 * @returns {*} Returns the entry value. 1321 */function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1];}/** 1322 * Checks if a list cache value for `key` exists. 1323 * 1324 * @private 1325 * @name has 1326 * @memberOf ListCache 1327 * @param {string} key The key of the entry to check. 1328 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 1329 */function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}/** 1330 * Sets the list cache `key` to `value`. 1331 * 1332 * @private 1333 * @name set 1334 * @memberOf ListCache 1335 * @param {string} key The key of the value to set. 1336 * @param {*} value The value to set. 1337 * @returns {Object} Returns the list cache instance. 1338 */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}// Add methods to `ListCache`. 1339ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;/*------------------------------------------------------------------------*/ /** 1340 * Creates a map cache object to store key-value pairs. 1341 * 1342 * @private 1343 * @constructor 1344 * @param {Array} [entries] The key-value pairs to cache. 1345 */function MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}/** 1346 * Removes all key-value entries from the map. 1347 * 1348 * @private 1349 * @name clear 1350 * @memberOf MapCache 1351 */function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}/** 1352 * Removes `key` and its value from the map. 1353 * 1354 * @private 1355 * @name delete 1356 * @memberOf MapCache 1357 * @param {string} key The key of the value to remove. 1358 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 1359 */function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}/** 1360 * Gets the map value for `key`. 1361 * 1362 * @private 1363 * @name get 1364 * @memberOf MapCache 1365 * @param {string} key The key of the value to get. 1366 * @returns {*} Returns the entry value. 1367 */function mapCacheGet(key){return getMapData(this,key).get(key);}/** 1368 * Checks if a map value for `key` exists. 1369 * 1370 * @private 1371 * @name has 1372 * @memberOf MapCache 1373 * @param {string} key The key of the entry to check. 1374 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 1375 */function mapCacheHas(key){return getMapData(this,key).has(key);}/** 1376 * Sets the map `key` to `value`. 1377 * 1378 * @private 1379 * @name set 1380 * @memberOf MapCache 1381 * @param {string} key The key of the value to set. 1382 * @param {*} value The value to set. 1383 * @returns {Object} Returns the map cache instance. 1384 */function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}// Add methods to `MapCache`. 1385MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;/*------------------------------------------------------------------------*/ /** 1386 * 1387 * Creates an array cache object to store unique values. 1388 * 1389 * @private 1390 * @constructor 1391 * @param {Array} [values] The values to cache. 1392 */function SetCache(values){var index=-1,length=values==null?0:values.length;this.__data__=new MapCache();while(++index<length){this.add(values[index]);}}/** 1393 * Adds `value` to the array cache. 1394 * 1395 * @private 1396 * @name add 1397 * @memberOf SetCache 1398 * @alias push 1399 * @param {*} value The value to cache. 1400 * @returns {Object} Returns the cache instance. 1401 */function setCacheAdd(value){this.__data__.set(value,HASH_UNDEFINED);return this;}/** 1402 * Checks if `value` is in the array cache. 1403 * 1404 * @private 1405 * @name has 1406 * @memberOf SetCache 1407 * @param {*} value The value to search for. 1408 * @returns {number} Returns `true` if `value` is found, else `false`. 1409 */function setCacheHas(value){return this.__data__.has(value);}// Add methods to `SetCache`. 1410SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;/*------------------------------------------------------------------------*/ /** 1411 * Creates a stack cache object to store key-value pairs. 1412 * 1413 * @private 1414 * @constructor 1415 * @param {Array} [entries] The key-value pairs to cache. 1416 */function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}/** 1417 * Removes all key-value entries from the stack. 1418 * 1419 * @private 1420 * @name clear 1421 * @memberOf Stack 1422 */function stackClear(){this.__data__=new ListCache();this.size=0;}/** 1423 * Removes `key` and its value from the stack. 1424 * 1425 * @private 1426 * @name delete 1427 * @memberOf Stack 1428 * @param {string} key The key of the value to remove. 1429 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 1430 */function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}/** 1431 * Gets the stack value for `key`. 1432 * 1433 * @private 1434 * @name get 1435 * @memberOf Stack 1436 * @param {string} key The key of the value to get. 1437 * @returns {*} Returns the entry value. 1438 */function stackGet(key){return this.__data__.get(key);}/** 1439 * Checks if a stack value for `key` exists. 1440 * 1441 * @private 1442 * @name has 1443 * @memberOf Stack 1444 * @param {string} key The key of the entry to check. 1445 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 1446 */function stackHas(key){return this.__data__.has(key);}/** 1447 * Sets the stack `key` to `value`. 1448 * 1449 * @private 1450 * @name set 1451 * @memberOf Stack 1452 * @param {string} key The key of the value to set. 1453 * @param {*} value The value to set. 1454 * @returns {Object} Returns the stack cache instance. 1455 */function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache(pairs);}data.set(key,value);this.size=data.size;return this;}// Add methods to `Stack`. 1456Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;/*------------------------------------------------------------------------*/ /** 1457 * Creates an array of the enumerable property names of the array-like `value`. 1458 * 1459 * @private 1460 * @param {*} value The value to query. 1461 * @param {boolean} inherited Specify returning inherited property names. 1462 * @returns {Array} Returns the array of property names. 1463 */function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if((inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&(// Safari 9 has enumerable `arguments.length` in strict mode. 1464key=='length'||// Node.js 0.10 has enumerable non-index properties on buffers. 1465isBuff&&(key=='offset'||key=='parent')||// PhantomJS 2 has enumerable non-index properties on typed arrays. 1466isType&&(key=='buffer'||key=='byteLength'||key=='byteOffset')||// Skip index properties. 1467isIndex(key,length)))){result.push(key);}}return result;}/** 1468 * A specialized version of `_.sample` for arrays. 1469 * 1470 * @private 1471 * @param {Array} array The array to sample. 1472 * @returns {*} Returns the random element. 1473 */function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:undefined;}/** 1474 * A specialized version of `_.sampleSize` for arrays. 1475 * 1476 * @private 1477 * @param {Array} array The array to sample. 1478 * @param {number} n The number of elements to sample. 1479 * @returns {Array} Returns the random elements. 1480 */function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length));}/** 1481 * A specialized version of `_.shuffle` for arrays. 1482 * 1483 * @private 1484 * @param {Array} array The array to shuffle. 1485 * @returns {Array} Returns the new shuffled array. 1486 */function arrayShuffle(array){return shuffleSelf(copyArray(array));}/** 1487 * This function is like `assignValue` except that it doesn't assign 1488 * `undefined` values. 1489 * 1490 * @private 1491 * @param {Object} object The object to modify. 1492 * @param {string} key The key of the property to assign. 1493 * @param {*} value The value to assign. 1494 */function assignMergeValue(object,key,value){if(value!==undefined&&!eq(object[key],value)||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}/** 1495 * Assigns `value` to `key` of `object` if the existing value is not equivalent 1496 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 1497 * for equality comparisons. 1498 * 1499 * @private 1500 * @param {Object} object The object to modify. 1501 * @param {string} key The key of the property to assign. 1502 * @param {*} value The value to assign. 1503 */function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}/** 1504 * Gets the index at which the `key` is found in `array` of key-value pairs. 1505 * 1506 * @private 1507 * @param {Array} array The array to inspect. 1508 * @param {*} key The key to search for. 1509 * @returns {number} Returns the index of the matched value, else `-1`. 1510 */function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length;}}return-1;}/** 1511 * Aggregates elements of `collection` on `accumulator` with keys transformed 1512 * by `iteratee` and values set by `setter`. 1513 * 1514 * @private 1515 * @param {Array|Object} collection The collection to iterate over. 1516 * @param {Function} setter The function to set `accumulator` values. 1517 * @param {Function} iteratee The iteratee to transform keys. 1518 * @param {Object} accumulator The initial aggregated object. 1519 * @returns {Function} Returns `accumulator`. 1520 */function baseAggregator(collection,setter,iteratee,accumulator){baseEach(collection,function(value,key,collection){setter(accumulator,value,iteratee(value),collection);});return accumulator;}/** 1521 * The base implementation of `_.assign` without support for multiple sources 1522 * or `customizer` functions. 1523 * 1524 * @private 1525 * @param {Object} object The destination object. 1526 * @param {Object} source The source object. 1527 * @returns {Object} Returns `object`. 1528 */function baseAssign(object,source){return object&©Object(source,keys(source),object);}/** 1529 * The base implementation of `_.assignIn` without support for multiple sources 1530 * or `customizer` functions. 1531 * 1532 * @private 1533 * @param {Object} object The destination object. 1534 * @param {Object} source The source object. 1535 * @returns {Object} Returns `object`. 1536 */function baseAssignIn(object,source){return object&©Object(source,keysIn(source),object);}/** 1537 * The base implementation of `assignValue` and `assignMergeValue` without 1538 * value checks. 1539 * 1540 * @private 1541 * @param {Object} object The object to modify. 1542 * @param {string} key The key of the property to assign. 1543 * @param {*} value The value to assign. 1544 */function baseAssignValue(object,key,value){if(key=='__proto__'&&defineProperty){defineProperty(object,key,{'configurable':true,'enumerable':true,'value':value,'writable':true});}else{object[key]=value;}}/** 1545 * The base implementation of `_.at` without support for individual paths. 1546 * 1547 * @private 1548 * @param {Object} object The object to iterate over. 1549 * @param {string[]} paths The property paths to pick. 1550 * @returns {Array} Returns the picked elements. 1551 */function baseAt(object,paths){var index=-1,length=paths.length,result=Array(length),skip=object==null;while(++index<length){result[index]=skip?undefined:get(object,paths[index]);}return result;}/** 1552 * The base implementation of `_.clamp` which doesn't coerce arguments. 1553 * 1554 * @private 1555 * @param {number} number The number to clamp. 1556 * @param {number} [lower] The lower bound. 1557 * @param {number} upper The upper bound. 1558 * @returns {number} Returns the clamped number. 1559 */function baseClamp(number,lower,upper){if(number===number){if(upper!==undefined){number=number<=upper?number:upper;}if(lower!==undefined){number=number>=lower?number:lower;}}return number;}/** 1560 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 1561 * traversed objects. 1562 * 1563 * @private 1564 * @param {*} value The value to clone. 1565 * @param {boolean} bitmask The bitmask flags. 1566 * 1 - Deep clone 1567 * 2 - Flatten inherited properties 1568 * 4 - Clone symbols 1569 * @param {Function} [customizer] The function to customize cloning. 1570 * @param {string} [key] The key of `value`. 1571 * @param {Object} [object] The parent object of `value`. 1572 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 1573 * @returns {*} Returns the cloned value. 1574 */function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer){result=object?customizer(value,key,object,stack):customizer(value);}if(result!==undefined){return result;}if(!isObject(value)){return value;}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return copyArray(value,result);}}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value)){return cloneBuffer(value,isDeep);}if(tag==objectTag||tag==argsTag||isFunc&&!object){result=isFlat||isFunc?{}:initCloneObject(value);if(!isDeep){return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value));}}else{if(!cloneableTags[tag]){return object?value:{};}result=initCloneByTag(value,tag,isDeep);}}// Check for circular references and return its corresponding clone. 1575stack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(isSet(value)){value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack));});}else if(isMap(value)){value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack));});}var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys;var props=isArr?undefined:keysFunc(value);arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}// Recursively populate clone (susceptible to call stack limits). 1576assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack));});return result;}/** 1577 * The base implementation of `_.conforms` which doesn't clone `source`. 1578 * 1579 * @private 1580 * @param {Object} source The object of property predicates to conform to. 1581 * @returns {Function} Returns the new spec function. 1582 */function baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props);};}/** 1583 * The base implementation of `_.conformsTo` which accepts `props` to check. 1584 * 1585 * @private 1586 * @param {Object} object The object to inspect. 1587 * @param {Object} source The object of property predicates to conform to. 1588 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 1589 */function baseConformsTo(object,source,props){var length=props.length;if(object==null){return!length;}object=Object(object);while(length--){var key=props[length],predicate=source[key],value=object[key];if(value===undefined&&!(key in object)||!predicate(value)){return false;}}return true;}/** 1590 * The base implementation of `_.delay` and `_.defer` which accepts `args` 1591 * to provide to `func`. 1592 * 1593 * @private 1594 * @param {Function} func The function to delay. 1595 * @param {number} wait The number of milliseconds to delay invocation. 1596 * @param {Array} args The arguments to provide to `func`. 1597 * @returns {number|Object} Returns the timer id or timeout object. 1598 */function baseDelay(func,wait,args){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function(){func.apply(undefined,args);},wait);}/** 1599 * The base implementation of methods like `_.difference` without support 1600 * for excluding multiple arrays or iteratee shorthands. 1601 * 1602 * @private 1603 * @param {Array} array The array to inspect. 1604 * @param {Array} values The values to exclude. 1605 * @param {Function} [iteratee] The iteratee invoked per element. 1606 * @param {Function} [comparator] The comparator invoked per element. 1607 * @returns {Array} Returns the new array of filtered values. 1608 */function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=true,length=array.length,result=[],valuesLength=values.length;if(!length){return result;}if(iteratee){values=arrayMap(values,baseUnary(iteratee));}if(comparator){includes=arrayIncludesWith;isCommon=false;}else if(values.length>=LARGE_ARRAY_SIZE){includes=cacheHas;isCommon=false;values=new SetCache(values);}outer:while(++index<length){var value=array[index],computed=iteratee==null?value:iteratee(value);value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===computed){continue outer;}}result.push(value);}else if(!includes(values,computed,comparator)){result.push(value);}}return result;}/** 1609 * The base implementation of `_.forEach` without support for iteratee shorthands. 1610 * 1611 * @private 1612 * @param {Array|Object} collection The collection to iterate over. 1613 * @param {Function} iteratee The function invoked per iteration. 1614 * @returns {Array|Object} Returns `collection`. 1615 */var baseEach=createBaseEach(baseForOwn);/** 1616 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 1617 * 1618 * @private 1619 * @param {Array|Object} collection The collection to iterate over. 1620 * @param {Function} iteratee The function invoked per iteration. 1621 * @returns {Array|Object} Returns `collection`. 1622 */var baseEachRight=createBaseEach(baseForOwnRight,true);/** 1623 * The base implementation of `_.every` without support for iteratee shorthands. 1624 * 1625 * @private 1626 * @param {Array|Object} collection The collection to iterate over. 1627 * @param {Function} predicate The function invoked per iteration. 1628 * @returns {boolean} Returns `true` if all elements pass the predicate check, 1629 * else `false` 1630 */function baseEvery(collection,predicate){var result=true;baseEach(collection,function(value,index,collection){result=!!predicate(value,index,collection);return result;});return result;}/** 1631 * The base implementation of methods like `_.max` and `_.min` which accepts a 1632 * `comparator` to determine the extremum value. 1633 * 1634 * @private 1635 * @param {Array} array The array to iterate over. 1636 * @param {Function} iteratee The iteratee invoked per iteration. 1637 * @param {Function} comparator The comparator used to compare values. 1638 * @returns {*} Returns the extremum value. 1639 */function baseExtremum(array,iteratee,comparator){var index=-1,length=array.length;while(++index<length){var value=array[index],current=iteratee(value);if(current!=null&&(computed===undefined?current===current&&!isSymbol(current):comparator(current,computed))){var computed=current,result=value;}}return result;}/** 1640 * The base implementation of `_.fill` without an iteratee call guard. 1641 * 1642 * @private 1643 * @param {Array} array The array to fill. 1644 * @param {*} value The value to fill `array` with. 1645 * @param {number} [start=0] The start position. 1646 * @param {number} [end=array.length] The end position. 1647 * @returns {Array} Returns `array`. 1648 */function baseFill(array,value,start,end){var length=array.length;start=toInteger(start);if(start<0){start=-start>length?0:length+start;}end=end===undefined||end>length?length:toInteger(end);if(end<0){end+=length;}end=start>end?0:toLength(end);while(start<end){array[start++]=value;}return array;}/** 1649 * The base implementation of `_.filter` without support for iteratee shorthands. 1650 * 1651 * @private 1652 * @param {Array|Object} collection The collection to iterate over. 1653 * @param {Function} predicate The function invoked per iteration. 1654 * @returns {Array} Returns the new filtered array. 1655 */function baseFilter(collection,predicate){var result=[];baseEach(collection,function(value,index,collection){if(predicate(value,index,collection)){result.push(value);}});return result;}/** 1656 * The base implementation of `_.flatten` with support for restricting flattening. 1657 * 1658 * @private 1659 * @param {Array} array The array to flatten. 1660 * @param {number} depth The maximum recursion depth. 1661 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 1662 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 1663 * @param {Array} [result=[]] The initial result value. 1664 * @returns {Array} Returns the new flattened array. 1665 */function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;predicate||(predicate=isFlattenable);result||(result=[]);while(++index<length){var value=array[index];if(depth>0&&predicate(value)){if(depth>1){// Recursively flatten arrays (susceptible to call stack limits). 1666baseFlatten(value,depth-1,predicate,isStrict,result);}else{arrayPush(result,value);}}else if(!isStrict){result[result.length]=value;}}return result;}/** 1667 * The base implementation of `baseForOwn` which iterates over `object` 1668 * properties returned by `keysFunc` and invokes `iteratee` for each property. 1669 * Iteratee functions may exit iteration early by explicitly returning `false`. 1670 * 1671 * @private 1672 * @param {Object} object The object to iterate over. 1673 * @param {Function} iteratee The function invoked per iteration. 1674 * @param {Function} keysFunc The function to get the keys of `object`. 1675 * @returns {Object} Returns `object`. 1676 */var baseFor=createBaseFor();/** 1677 * This function is like `baseFor` except that it iterates over properties 1678 * in the opposite order. 1679 * 1680 * @private 1681 * @param {Object} object The object to iterate over. 1682 * @param {Function} iteratee The function invoked per iteration. 1683 * @param {Function} keysFunc The function to get the keys of `object`. 1684 * @returns {Object} Returns `object`. 1685 */var baseForRight=createBaseFor(true);/** 1686 * The base implementation of `_.forOwn` without support for iteratee shorthands. 1687 * 1688 * @private 1689 * @param {Object} object The object to iterate over. 1690 * @param {Function} iteratee The function invoked per iteration. 1691 * @returns {Object} Returns `object`. 1692 */function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys);}/** 1693 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 1694 * 1695 * @private 1696 * @param {Object} object The object to iterate over. 1697 * @param {Function} iteratee The function invoked per iteration. 1698 * @returns {Object} Returns `object`. 1699 */function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys);}/** 1700 * The base implementation of `_.functions` which creates an array of 1701 * `object` function property names filtered from `props`. 1702 * 1703 * @private 1704 * @param {Object} object The object to inspect. 1705 * @param {Array} props The property names to filter. 1706 * @returns {Array} Returns the function names. 1707 */function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key]);});}/** 1708 * The base implementation of `_.get` without support for default values. 1709 * 1710 * @private 1711 * @param {Object} object The object to query. 1712 * @param {Array|string} path The path of the property to get. 1713 * @returns {*} Returns the resolved value. 1714 */function baseGet(object,path){path=castPath(path,object);var index=0,length=path.length;while(object!=null&&index<length){object=object[toKey(path[index++])];}return index&&index==length?object:undefined;}/** 1715 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 1716 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 1717 * symbols of `object`. 1718 * 1719 * @private 1720 * @param {Object} object The object to query. 1721 * @param {Function} keysFunc The function to get the keys of `object`. 1722 * @param {Function} symbolsFunc The function to get the symbols of `object`. 1723 * @returns {Array} Returns the array of property names and symbols. 1724 */function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object));}/** 1725 * The base implementation of `getTag` without fallbacks for buggy environments. 1726 * 1727 * @private 1728 * @param {*} value The value to query. 1729 * @returns {string} Returns the `toStringTag`. 1730 */function baseGetTag(value){if(value==null){return value===undefined?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}/** 1731 * The base implementation of `_.gt` which doesn't coerce arguments. 1732 * 1733 * @private 1734 * @param {*} value The value to compare. 1735 * @param {*} other The other value to compare. 1736 * @returns {boolean} Returns `true` if `value` is greater than `other`, 1737 * else `false`. 1738 */function baseGt(value,other){return value>other;}/** 1739 * The base implementation of `_.has` without support for deep paths. 1740 * 1741 * @private 1742 * @param {Object} [object] The object to query. 1743 * @param {Array|string} key The key to check. 1744 * @returns {boolean} Returns `true` if `key` exists, else `false`. 1745 */function baseHas(object,key){return object!=null&&hasOwnProperty.call(object,key);}/** 1746 * The base implementation of `_.hasIn` without support for deep paths. 1747 * 1748 * @private 1749 * @param {Object} [object] The object to query. 1750 * @param {Array|string} key The key to check. 1751 * @returns {boolean} Returns `true` if `key` exists, else `false`. 1752 */function baseHasIn(object,key){return object!=null&&key in Object(object);}/** 1753 * The base implementation of `_.inRange` which doesn't coerce arguments. 1754 * 1755 * @private 1756 * @param {number} number The number to check. 1757 * @param {number} start The start of the range. 1758 * @param {number} end The end of the range. 1759 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 1760 */function baseInRange(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end);}/** 1761 * The base implementation of methods like `_.intersection`, without support 1762 * for iteratee shorthands, that accepts an array of arrays to inspect. 1763 * 1764 * @private 1765 * @param {Array} arrays The arrays to inspect. 1766 * @param {Function} [iteratee] The iteratee invoked per element. 1767 * @param {Function} [comparator] The comparator invoked per element. 1768 * @returns {Array} Returns the new array of shared values. 1769 */function baseIntersection(arrays,iteratee,comparator){var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=Infinity,result=[];while(othIndex--){var array=arrays[othIndex];if(othIndex&&iteratee){array=arrayMap(array,baseUnary(iteratee));}maxLength=nativeMin(array.length,maxLength);caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined;}array=arrays[0];var index=-1,seen=caches[0];outer:while(++index<length&&result.length<maxLength){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){othIndex=othLength;while(--othIndex){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator))){continue outer;}}if(seen){seen.push(computed);}result.push(value);}}return result;}/** 1770 * The base implementation of `_.invert` and `_.invertBy` which inverts 1771 * `object` with values transformed by `iteratee` and set by `setter`. 1772 * 1773 * @private 1774 * @param {Object} object The object to iterate over. 1775 * @param {Function} setter The function to set `accumulator` values. 1776 * @param {Function} iteratee The iteratee to transform values. 1777 * @param {Object} accumulator The initial inverted object. 1778 * @returns {Function} Returns `accumulator`. 1779 */function baseInverter(object,setter,iteratee,accumulator){baseForOwn(object,function(value,key,object){setter(accumulator,iteratee(value),key,object);});return accumulator;}/** 1780 * The base implementation of `_.invoke` without support for individual 1781 * method arguments. 1782 * 1783 * @private 1784 * @param {Object} object The object to query. 1785 * @param {Array|string} path The path of the method to invoke. 1786 * @param {Array} args The arguments to invoke the method with. 1787 * @returns {*} Returns the result of the invoked method. 1788 */function baseInvoke(object,path,args){path=castPath(path,object);object=parent(object,path);var func=object==null?object:object[toKey(last(path))];return func==null?undefined:apply(func,object,args);}/** 1789 * The base implementation of `_.isArguments`. 1790 * 1791 * @private 1792 * @param {*} value The value to check. 1793 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 1794 */function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag;}/** 1795 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 1796 * 1797 * @private 1798 * @param {*} value The value to check. 1799 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 1800 */function baseIsArrayBuffer(value){return isObjectLike(value)&&baseGetTag(value)==arrayBufferTag;}/** 1801 * The base implementation of `_.isDate` without Node.js optimizations. 1802 * 1803 * @private 1804 * @param {*} value The value to check. 1805 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 1806 */function baseIsDate(value){return isObjectLike(value)&&baseGetTag(value)==dateTag;}/** 1807 * The base implementation of `_.isEqual` which supports partial comparisons 1808 * and tracks traversed objects. 1809 * 1810 * @private 1811 * @param {*} value The value to compare. 1812 * @param {*} other The other value to compare. 1813 * @param {boolean} bitmask The bitmask flags. 1814 * 1 - Unordered comparison 1815 * 2 - Partial comparison 1816 * @param {Function} [customizer] The function to customize comparisons. 1817 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 1818 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 1819 */function baseIsEqual(value,other,bitmask,customizer,stack){if(value===other){return true;}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other;}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack);}/** 1820 * A specialized version of `baseIsEqual` for arrays and objects which performs 1821 * deep comparisons and tracks traversed objects enabling objects with circular 1822 * references to be compared. 1823 * 1824 * @private 1825 * @param {Object} object The object to compare. 1826 * @param {Object} other The other object to compare. 1827 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1828 * @param {Function} customizer The function to customize comparisons. 1829 * @param {Function} equalFunc The function to determine equivalents of values. 1830 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 1831 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 1832 */function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false;}objIsArr=true;objIsObj=false;}if(isSameTag&&!objIsObj){stack||(stack=new Stack());return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,'__wrapped__'),othIsWrapped=othIsObj&&hasOwnProperty.call(other,'__wrapped__');if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack());return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack);}}if(!isSameTag){return false;}stack||(stack=new Stack());return equalObjects(object,other,bitmask,customizer,equalFunc,stack);}/** 1833 * The base implementation of `_.isMap` without Node.js optimizations. 1834 * 1835 * @private 1836 * @param {*} value The value to check. 1837 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 1838 */function baseIsMap(value){return isObjectLike(value)&&getTag(value)==mapTag;}/** 1839 * The base implementation of `_.isMatch` without support for iteratee shorthands. 1840 * 1841 * @private 1842 * @param {Object} object The object to inspect. 1843 * @param {Object} source The object of property values to match. 1844 * @param {Array} matchData The property names, values, and compare flags to match. 1845 * @param {Function} [customizer] The function to customize comparisons. 1846 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 1847 */function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(object==null){return!length;}object=Object(object);while(index--){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object)){return false;}}while(++index<length){data=matchData[index];var key=data[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object)){return false;}}else{var stack=new Stack();if(customizer){var result=customizer(objValue,srcValue,key,object,source,stack);}if(!(result===undefined?baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG,customizer,stack):result)){return false;}}}return true;}/** 1848 * The base implementation of `_.isNative` without bad shim checks. 1849 * 1850 * @private 1851 * @param {*} value The value to check. 1852 * @returns {boolean} Returns `true` if `value` is a native function, 1853 * else `false`. 1854 */function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value));}/** 1855 * The base implementation of `_.isRegExp` without Node.js optimizations. 1856 * 1857 * @private 1858 * @param {*} value The value to check. 1859 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 1860 */function baseIsRegExp(value){return isObjectLike(value)&&baseGetTag(value)==regexpTag;}/** 1861 * The base implementation of `_.isSet` without Node.js optimizations. 1862 * 1863 * @private 1864 * @param {*} value The value to check. 1865 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 1866 */function baseIsSet(value){return isObjectLike(value)&&getTag(value)==setTag;}/** 1867 * The base implementation of `_.isTypedArray` without Node.js optimizations. 1868 * 1869 * @private 1870 * @param {*} value The value to check. 1871 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 1872 */function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)];}/** 1873 * The base implementation of `_.iteratee`. 1874 * 1875 * @private 1876 * @param {*} [value=_.identity] The value to convert to an iteratee. 1877 * @returns {Function} Returns the iteratee. 1878 */function baseIteratee(value){// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 1879// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 1880if(typeof value=='function'){return value;}if(value==null){return identity;}if(_typeof(value)=='object'){return isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value);}return property(value);}/** 1881 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 1882 * 1883 * @private 1884 * @param {Object} object The object to query. 1885 * @returns {Array} Returns the array of property names. 1886 */function baseKeys(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty.call(object,key)&&key!='constructor'){result.push(key);}}return result;}/** 1887 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 1888 * 1889 * @private 1890 * @param {Object} object The object to query. 1891 * @returns {Array} Returns the array of property names. 1892 */function baseKeysIn(object){if(!isObject(object)){return nativeKeysIn(object);}var isProto=isPrototype(object),result=[];for(var key in object){if(!(key=='constructor'&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key);}}return result;}/** 1893 * The base implementation of `_.lt` which doesn't coerce arguments. 1894 * 1895 * @private 1896 * @param {*} value The value to compare. 1897 * @param {*} other The other value to compare. 1898 * @returns {boolean} Returns `true` if `value` is less than `other`, 1899 * else `false`. 1900 */function baseLt(value,other){return value<other;}/** 1901 * The base implementation of `_.map` without support for iteratee shorthands. 1902 * 1903 * @private 1904 * @param {Array|Object} collection The collection to iterate over. 1905 * @param {Function} iteratee The function invoked per iteration. 1906 * @returns {Array} Returns the new mapped array. 1907 */function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value,key,collection){result[++index]=iteratee(value,key,collection);});return result;}/** 1908 * The base implementation of `_.matches` which doesn't clone `source`. 1909 * 1910 * @private 1911 * @param {Object} source The object of property values to match. 1912 * @returns {Function} Returns the new spec function. 1913 */function baseMatches(source){var matchData=getMatchData(source);if(matchData.length==1&&matchData[0][2]){return matchesStrictComparable(matchData[0][0],matchData[0][1]);}return function(object){return object===source||baseIsMatch(object,source,matchData);};}/** 1914 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 1915 * 1916 * @private 1917 * @param {string} path The path of the property to get. 1918 * @param {*} srcValue The value to match. 1919 * @returns {Function} Returns the new spec function. 1920 */function baseMatchesProperty(path,srcValue){if(isKey(path)&&isStrictComparable(srcValue)){return matchesStrictComparable(toKey(path),srcValue);}return function(object){var objValue=get(object,path);return objValue===undefined&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG);};}/** 1921 * The base implementation of `_.merge` without support for multiple sources. 1922 * 1923 * @private 1924 * @param {Object} object The destination object. 1925 * @param {Object} source The source object. 1926 * @param {number} srcIndex The index of `source`. 1927 * @param {Function} [customizer] The function to customize merged values. 1928 * @param {Object} [stack] Tracks traversed source values and their merged 1929 * counterparts. 1930 */function baseMerge(object,source,srcIndex,customizer,stack){if(object===source){return;}baseFor(source,function(srcValue,key){stack||(stack=new Stack());if(isObject(srcValue)){baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);}else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+'',object,source,stack):undefined;if(newValue===undefined){newValue=srcValue;}assignMergeValue(object,key,newValue);}},keysIn);}/** 1931 * A specialized version of `baseMerge` for arrays and objects which performs 1932 * deep merges and tracks traversed objects enabling objects with circular 1933 * references to be merged. 1934 * 1935 * @private 1936 * @param {Object} object The destination object. 1937 * @param {Object} source The source object. 1938 * @param {string} key The key of the value to merge. 1939 * @param {number} srcIndex The index of `source`. 1940 * @param {Function} mergeFunc The function to merge values. 1941 * @param {Function} [customizer] The function to customize assigned values. 1942 * @param {Object} [stack] Tracks traversed source values and their merged 1943 * counterparts. 1944 */function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked){assignMergeValue(object,key,stacked);return;}var newValue=customizer?customizer(objValue,srcValue,key+'',object,source,stack):undefined;var isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue;if(isArr||isBuff||isTyped){if(isArray(objValue)){newValue=objValue;}else if(isArrayLikeObject(objValue)){newValue=copyArray(objValue);}else if(isBuff){isCommon=false;newValue=cloneBuffer(srcValue,true);}else if(isTyped){isCommon=false;newValue=cloneTypedArray(srcValue,true);}else{newValue=[];}}else if(isPlainObject(srcValue)||isArguments(srcValue)){newValue=objValue;if(isArguments(objValue)){newValue=toPlainObject(objValue);}else if(!isObject(objValue)||isFunction(objValue)){newValue=initCloneObject(srcValue);}}else{isCommon=false;}}if(isCommon){// Recursively merge objects and arrays (susceptible to call stack limits). 1945stack.set(srcValue,newValue);mergeFunc(newValue,srcValue,srcIndex,customizer,stack);stack['delete'](srcValue);}assignMergeValue(object,key,newValue);}/** 1946 * The base implementation of `_.nth` which doesn't coerce arguments. 1947 * 1948 * @private 1949 * @param {Array} array The array to query. 1950 * @param {number} n The index of the element to return. 1951 * @returns {*} Returns the nth element of `array`. 1952 */function baseNth(array,n){var length=array.length;if(!length){return;}n+=n<0?length:0;return isIndex(n,length)?array[n]:undefined;}/** 1953 * The base implementation of `_.orderBy` without param guards. 1954 * 1955 * @private 1956 * @param {Array|Object} collection The collection to iterate over. 1957 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 1958 * @param {string[]} orders The sort orders of `iteratees`. 1959 * @returns {Array} Returns the new sorted array. 1960 */function baseOrderBy(collection,iteratees,orders){if(iteratees.length){iteratees=arrayMap(iteratees,function(iteratee){if(isArray(iteratee)){return function(value){return baseGet(value,iteratee.length===1?iteratee[0]:iteratee);};}return iteratee;});}else{iteratees=[identity];}var index=-1;iteratees=arrayMap(iteratees,baseUnary(getIteratee()));var result=baseMap(collection,function(value,key,collection){var criteria=arrayMap(iteratees,function(iteratee){return iteratee(value);});return{'criteria':criteria,'index':++index,'value':value};});return baseSortBy(result,function(object,other){return compareMultiple(object,other,orders);});}/** 1961 * The base implementation of `_.pick` without support for individual 1962 * property identifiers. 1963 * 1964 * @private 1965 * @param {Object} object The source object. 1966 * @param {string[]} paths The property paths to pick. 1967 * @returns {Object} Returns the new object. 1968 */function basePick(object,paths){return basePickBy(object,paths,function(value,path){return hasIn(object,path);});}/** 1969 * The base implementation of `_.pickBy` without support for iteratee shorthands. 1970 * 1971 * @private 1972 * @param {Object} object The source object. 1973 * @param {string[]} paths The property paths to pick. 1974 * @param {Function} predicate The function invoked per property. 1975 * @returns {Object} Returns the new object. 1976 */function basePickBy(object,paths,predicate){var index=-1,length=paths.length,result={};while(++index<length){var path=paths[index],value=baseGet(object,path);if(predicate(value,path)){baseSet(result,castPath(path,object),value);}}return result;}/** 1977 * A specialized version of `baseProperty` which supports deep paths. 1978 * 1979 * @private 1980 * @param {Array|string} path The path of the property to get. 1981 * @returns {Function} Returns the new accessor function. 1982 */function basePropertyDeep(path){return function(object){return baseGet(object,path);};}/** 1983 * The base implementation of `_.pullAllBy` without support for iteratee 1984 * shorthands. 1985 * 1986 * @private 1987 * @param {Array} array The array to modify. 1988 * @param {Array} values The values to remove. 1989 * @param {Function} [iteratee] The iteratee invoked per element. 1990 * @param {Function} [comparator] The comparator invoked per element. 1991 * @returns {Array} Returns `array`. 1992 */function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;if(array===values){values=copyArray(values);}if(iteratee){seen=arrayMap(array,baseUnary(iteratee));}while(++index<length){var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;while((fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1){if(seen!==array){splice.call(seen,fromIndex,1);}splice.call(array,fromIndex,1);}}return array;}/** 1993 * The base implementation of `_.pullAt` without support for individual 1994 * indexes or capturing the removed elements. 1995 * 1996 * @private 1997 * @param {Array} array The array to modify. 1998 * @param {number[]} indexes The indexes of elements to remove. 1999 * @returns {Array} Returns `array`. 2000 */function basePullAt(array,indexes){var length=array?indexes.length:0,lastIndex=length-1;while(length--){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;if(isIndex(index)){splice.call(array,index,1);}else{baseUnset(array,index);}}}return array;}/** 2001 * The base implementation of `_.random` without support for returning 2002 * floating-point numbers. 2003 * 2004 * @private 2005 * @param {number} lower The lower bound. 2006 * @param {number} upper The upper bound. 2007 * @returns {number} Returns the random number. 2008 */function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1));}/** 2009 * The base implementation of `_.range` and `_.rangeRight` which doesn't 2010 * coerce arguments. 2011 * 2012 * @private 2013 * @param {number} start The start of the range. 2014 * @param {number} end The end of the range. 2015 * @param {number} step The value to increment or decrement by. 2016 * @param {boolean} [fromRight] Specify iterating from right to left. 2017 * @returns {Array} Returns the range of numbers. 2018 */function baseRange(start,end,step,fromRight){var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);while(length--){result[fromRight?length:++index]=start;start+=step;}return result;}/** 2019 * The base implementation of `_.repeat` which doesn't coerce arguments. 2020 * 2021 * @private 2022 * @param {string} string The string to repeat. 2023 * @param {number} n The number of times to repeat the string. 2024 * @returns {string} Returns the repeated string. 2025 */function baseRepeat(string,n){var result='';if(!string||n<1||n>MAX_SAFE_INTEGER){return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat. 2026// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 2027do{if(n%2){result+=string;}n=nativeFloor(n/2);if(n){string+=string;}}while(n);return result;}/** 2028 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 2029 * 2030 * @private 2031 * @param {Function} func The function to apply a rest parameter to. 2032 * @param {number} [start=func.length-1] The start position of the rest parameter. 2033 * @returns {Function} Returns the new function. 2034 */function baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}/** 2035 * The base implementation of `_.sample`. 2036 * 2037 * @private 2038 * @param {Array|Object} collection The collection to sample. 2039 * @returns {*} Returns the random element. 2040 */function baseSample(collection){return arraySample(values(collection));}/** 2041 * The base implementation of `_.sampleSize` without param guards. 2042 * 2043 * @private 2044 * @param {Array|Object} collection The collection to sample. 2045 * @param {number} n The number of elements to sample. 2046 * @returns {Array} Returns the random elements. 2047 */function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length));}/** 2048 * The base implementation of `_.set`. 2049 * 2050 * @private 2051 * @param {Object} object The object to modify. 2052 * @param {Array|string} path The path of the property to set. 2053 * @param {*} value The value to set. 2054 * @param {Function} [customizer] The function to customize path creation. 2055 * @returns {Object} Returns `object`. 2056 */function baseSet(object,path,value,customizer){if(!isObject(object)){return object;}path=castPath(path,object);var index=-1,length=path.length,lastIndex=length-1,nested=object;while(nested!=null&&++index<length){var key=toKey(path[index]),newValue=value;if(key==='__proto__'||key==='constructor'||key==='prototype'){return object;}if(index!=lastIndex){var objValue=nested[key];newValue=customizer?customizer(objValue,key,nested):undefined;if(newValue===undefined){newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{};}}assignValue(nested,key,newValue);nested=nested[key];}return object;}/** 2057 * The base implementation of `setData` without support for hot loop shorting. 2058 * 2059 * @private 2060 * @param {Function} func The function to associate metadata with. 2061 * @param {*} data The metadata. 2062 * @returns {Function} Returns `func`. 2063 */var baseSetData=!metaMap?identity:function(func,data){metaMap.set(func,data);return func;};/** 2064 * The base implementation of `setToString` without support for hot loop shorting. 2065 * 2066 * @private 2067 * @param {Function} func The function to modify. 2068 * @param {Function} string The `toString` result. 2069 * @returns {Function} Returns `func`. 2070 */var baseSetToString=!defineProperty?identity:function(func,string){return defineProperty(func,'toString',{'configurable':true,'enumerable':false,'value':constant(string),'writable':true});};/** 2071 * The base implementation of `_.shuffle`. 2072 * 2073 * @private 2074 * @param {Array|Object} collection The collection to shuffle. 2075 * @returns {Array} Returns the new shuffled array. 2076 */function baseShuffle(collection){return shuffleSelf(values(collection));}/** 2077 * The base implementation of `_.slice` without an iteratee call guard. 2078 * 2079 * @private 2080 * @param {Array} array The array to slice. 2081 * @param {number} [start=0] The start position. 2082 * @param {number} [end=array.length] The end position. 2083 * @returns {Array} Returns the slice of `array`. 2084 */function baseSlice(array,start,end){var index=-1,length=array.length;if(start<0){start=-start>length?0:length+start;}end=end>length?length:end;if(end<0){end+=length;}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index<length){result[index]=array[index+start];}return result;}/** 2085 * The base implementation of `_.some` without support for iteratee shorthands. 2086 * 2087 * @private 2088 * @param {Array|Object} collection The collection to iterate over. 2089 * @param {Function} predicate The function invoked per iteration. 2090 * @returns {boolean} Returns `true` if any element passes the predicate check, 2091 * else `false`. 2092 */function baseSome(collection,predicate){var result;baseEach(collection,function(value,index,collection){result=predicate(value,index,collection);return!result;});return!!result;}/** 2093 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 2094 * performs a binary search of `array` to determine the index at which `value` 2095 * should be inserted into `array` in order to maintain its sort order. 2096 * 2097 * @private 2098 * @param {Array} array The sorted array to inspect. 2099 * @param {*} value The value to evaluate. 2100 * @param {boolean} [retHighest] Specify returning the highest qualified index. 2101 * @returns {number} Returns the index at which `value` should be inserted 2102 * into `array`. 2103 */function baseSortedIndex(array,value,retHighest){var low=0,high=array==null?low:array.length;if(typeof value=='number'&&value===value&&high<=HALF_MAX_ARRAY_LENGTH){while(low<high){var mid=low+high>>>1,computed=array[mid];if(computed!==null&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)){low=mid+1;}else{high=mid;}}return high;}return baseSortedIndexBy(array,value,identity,retHighest);}/** 2104 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 2105 * which invokes `iteratee` for `value` and each element of `array` to compute 2106 * their sort ranking. The iteratee is invoked with one argument; (value). 2107 * 2108 * @private 2109 * @param {Array} array The sorted array to inspect. 2110 * @param {*} value The value to evaluate. 2111 * @param {Function} iteratee The iteratee invoked per element. 2112 * @param {boolean} [retHighest] Specify returning the highest qualified index. 2113 * @returns {number} Returns the index at which `value` should be inserted 2114 * into `array`. 2115 */function baseSortedIndexBy(array,value,iteratee,retHighest){var low=0,high=array==null?0:array.length;if(high===0){return 0;}value=iteratee(value);var valIsNaN=value!==value,valIsNull=value===null,valIsSymbol=isSymbol(value),valIsUndefined=value===undefined;while(low<high){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=computed!==undefined,othIsNull=computed===null,othIsReflexive=computed===computed,othIsSymbol=isSymbol(computed);if(valIsNaN){var setLow=retHighest||othIsReflexive;}else if(valIsUndefined){setLow=othIsReflexive&&(retHighest||othIsDefined);}else if(valIsNull){setLow=othIsReflexive&&othIsDefined&&(retHighest||!othIsNull);}else if(valIsSymbol){setLow=othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol);}else if(othIsNull||othIsSymbol){setLow=false;}else{setLow=retHighest?computed<=value:computed<value;}if(setLow){low=mid+1;}else{high=mid;}}return nativeMin(high,MAX_ARRAY_INDEX);}/** 2116 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 2117 * support for iteratee shorthands. 2118 * 2119 * @private 2120 * @param {Array} array The array to inspect. 2121 * @param {Function} [iteratee] The iteratee invoked per element. 2122 * @returns {Array} Returns the new duplicate free array. 2123 */function baseSortedUniq(array,iteratee){var index=-1,length=array.length,resIndex=0,result=[];while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=value===0?0:value;}}return result;}/** 2124 * The base implementation of `_.toNumber` which doesn't ensure correct 2125 * conversions of binary, hexadecimal, or octal string values. 2126 * 2127 * @private 2128 * @param {*} value The value to process. 2129 * @returns {number} Returns the number. 2130 */function baseToNumber(value){if(typeof value=='number'){return value;}if(isSymbol(value)){return NAN;}return+value;}/** 2131 * The base implementation of `_.toString` which doesn't convert nullish 2132 * values to empty strings. 2133 * 2134 * @private 2135 * @param {*} value The value to process. 2136 * @returns {string} Returns the string. 2137 */function baseToString(value){// Exit early for strings to avoid a performance hit in some environments. 2138if(typeof value=='string'){return value;}if(isArray(value)){// Recursively convert values (susceptible to call stack limits). 2139return arrayMap(value,baseToString)+'';}if(isSymbol(value)){return symbolToString?symbolToString.call(value):'';}var result=value+'';return result=='0'&&1/value==-INFINITY?'-0':result;}/** 2140 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 2141 * 2142 * @private 2143 * @param {Array} array The array to inspect. 2144 * @param {Function} [iteratee] The iteratee invoked per element. 2145 * @param {Function} [comparator] The comparator invoked per element. 2146 * @returns {Array} Returns the new duplicate free array. 2147 */function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=true,result=[],seen=result;if(comparator){isCommon=false;includes=arrayIncludesWith;}else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set);}isCommon=false;includes=cacheHas;seen=new SetCache();}else{seen=iteratee?[]:result;}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer;}}if(iteratee){seen.push(computed);}result.push(value);}else if(!includes(seen,computed,comparator)){if(seen!==result){seen.push(computed);}result.push(value);}}return result;}/** 2148 * The base implementation of `_.unset`. 2149 * 2150 * @private 2151 * @param {Object} object The object to modify. 2152 * @param {Array|string} path The property path to unset. 2153 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 2154 */function baseUnset(object,path){path=castPath(path,object);object=parent(object,path);return object==null||delete object[toKey(last(path))];}/** 2155 * The base implementation of `_.update`. 2156 * 2157 * @private 2158 * @param {Object} object The object to modify. 2159 * @param {Array|string} path The path of the property to update. 2160 * @param {Function} updater The function to produce the updated value. 2161 * @param {Function} [customizer] The function to customize path creation. 2162 * @returns {Object} Returns `object`. 2163 */function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer);}/** 2164 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 2165 * without support for iteratee shorthands. 2166 * 2167 * @private 2168 * @param {Array} array The array to query. 2169 * @param {Function} predicate The function invoked per iteration. 2170 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 2171 * @param {boolean} [fromRight] Specify iterating from right to left. 2172 * @returns {Array} Returns the slice of `array`. 2173 */function baseWhile(array,predicate,isDrop,fromRight){var length=array.length,index=fromRight?length:-1;while((fromRight?index--:++index<length)&&predicate(array[index],index,array)){}return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index);}/** 2174 * The base implementation of `wrapperValue` which returns the result of 2175 * performing a sequence of actions on the unwrapped `value`, where each 2176 * successive action is supplied the return value of the previous. 2177 * 2178 * @private 2179 * @param {*} value The unwrapped value. 2180 * @param {Array} actions Actions to perform to resolve the unwrapped value. 2181 * @returns {*} Returns the resolved value. 2182 */function baseWrapperValue(value,actions){var result=value;if(result instanceof LazyWrapper){result=result.value();}return arrayReduce(actions,function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args));},result);}/** 2183 * The base implementation of methods like `_.xor`, without support for 2184 * iteratee shorthands, that accepts an array of arrays to inspect. 2185 * 2186 * @private 2187 * @param {Array} arrays The arrays to inspect. 2188 * @param {Function} [iteratee] The iteratee invoked per element. 2189 * @param {Function} [comparator] The comparator invoked per element. 2190 * @returns {Array} Returns the new array of values. 2191 */function baseXor(arrays,iteratee,comparator){var length=arrays.length;if(length<2){return length?baseUniq(arrays[0]):[];}var index=-1,result=Array(length);while(++index<length){var array=arrays[index],othIndex=-1;while(++othIndex<length){if(othIndex!=index){result[index]=baseDifference(result[index]||array,arrays[othIndex],iteratee,comparator);}}}return baseUniq(baseFlatten(result,1),iteratee,comparator);}/** 2192 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 2193 * 2194 * @private 2195 * @param {Array} props The property identifiers. 2196 * @param {Array} values The property values. 2197 * @param {Function} assignFunc The function to assign values. 2198 * @returns {Object} Returns the new object. 2199 */function baseZipObject(props,values,assignFunc){var index=-1,length=props.length,valsLength=values.length,result={};while(++index<length){var value=index<valsLength?values[index]:undefined;assignFunc(result,props[index],value);}return result;}/** 2200 * Casts `value` to an empty array if it's not an array like object. 2201 * 2202 * @private 2203 * @param {*} value The value to inspect. 2204 * @returns {Array|Object} Returns the cast array-like object. 2205 */function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[];}/** 2206 * Casts `value` to `identity` if it's not a function. 2207 * 2208 * @private 2209 * @param {*} value The value to inspect. 2210 * @returns {Function} Returns cast function. 2211 */function castFunction(value){return typeof value=='function'?value:identity;}/** 2212 * Casts `value` to a path array if it's not one. 2213 * 2214 * @private 2215 * @param {*} value The value to inspect. 2216 * @param {Object} [object] The object to query keys on. 2217 * @returns {Array} Returns the cast property path array. 2218 */function castPath(value,object){if(isArray(value)){return value;}return isKey(value,object)?[value]:stringToPath(toString(value));}/** 2219 * A `baseRest` alias which can be replaced with `identity` by module 2220 * replacement plugins. 2221 * 2222 * @private 2223 * @type {Function} 2224 * @param {Function} func The function to apply a rest parameter to. 2225 * @returns {Function} Returns the new function. 2226 */var castRest=baseRest;/** 2227 * Casts `array` to a slice if it's needed. 2228 * 2229 * @private 2230 * @param {Array} array The array to inspect. 2231 * @param {number} start The start position. 2232 * @param {number} [end=array.length] The end position. 2233 * @returns {Array} Returns the cast slice. 2234 */function castSlice(array,start,end){var length=array.length;end=end===undefined?length:end;return!start&&end>=length?array:baseSlice(array,start,end);}/** 2235 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 2236 * 2237 * @private 2238 * @param {number|Object} id The timer id or timeout object of the timer to clear. 2239 */var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id);};/** 2240 * Creates a clone of `buffer`. 2241 * 2242 * @private 2243 * @param {Buffer} buffer The buffer to clone. 2244 * @param {boolean} [isDeep] Specify a deep clone. 2245 * @returns {Buffer} Returns the cloned buffer. 2246 */function cloneBuffer(buffer,isDeep){if(isDeep){return buffer.slice();}var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);buffer.copy(result);return result;}/** 2247 * Creates a clone of `arrayBuffer`. 2248 * 2249 * @private 2250 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 2251 * @returns {ArrayBuffer} Returns the cloned array buffer. 2252 */function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}/** 2253 * Creates a clone of `dataView`. 2254 * 2255 * @private 2256 * @param {Object} dataView The data view to clone. 2257 * @param {boolean} [isDeep] Specify a deep clone. 2258 * @returns {Object} Returns the cloned data view. 2259 */function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength);}/** 2260 * Creates a clone of `regexp`. 2261 * 2262 * @private 2263 * @param {Object} regexp The regexp to clone. 2264 * @returns {Object} Returns the cloned regexp. 2265 */function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));result.lastIndex=regexp.lastIndex;return result;}/** 2266 * Creates a clone of the `symbol` object. 2267 * 2268 * @private 2269 * @param {Object} symbol The symbol object to clone. 2270 * @returns {Object} Returns the cloned symbol object. 2271 */function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{};}/** 2272 * Creates a clone of `typedArray`. 2273 * 2274 * @private 2275 * @param {Object} typedArray The typed array to clone. 2276 * @param {boolean} [isDeep] Specify a deep clone. 2277 * @returns {Object} Returns the cloned typed array. 2278 */function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}/** 2279 * Compares values to sort them in ascending order. 2280 * 2281 * @private 2282 * @param {*} value The value to compare. 2283 * @param {*} other The other value to compare. 2284 * @returns {number} Returns the sort order indicator for `value`. 2285 */function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=value===null,valIsReflexive=value===value,valIsSymbol=isSymbol(value);var othIsDefined=other!==undefined,othIsNull=other===null,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive){return 1;}if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive){return-1;}}return 0;}/** 2286 * Used by `_.orderBy` to compare multiple properties of a value to another 2287 * and stable sort them. 2288 * 2289 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 2290 * specify an order of "desc" for descending or "asc" for ascending sort order 2291 * of corresponding values. 2292 * 2293 * @private 2294 * @param {Object} object The object to compare. 2295 * @param {Object} other The other object to compare. 2296 * @param {boolean[]|string[]} orders The order to sort by for each property. 2297 * @returns {number} Returns the sort order indicator for `object`. 2298 */function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;while(++index<length){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result){if(index>=ordersLength){return result;}var order=orders[index];return result*(order=='desc'?-1:1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 2299// that causes it, under certain circumstances, to provide the same value for 2300// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 2301// for more details. 2302// 2303// This also ensures a stable sort in V8 and other engines. 2304// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 2305return object.index-other.index;}/** 2306 * Creates an array that is the composition of partially applied arguments, 2307 * placeholders, and provided arguments into a single array of arguments. 2308 * 2309 * @private 2310 * @param {Array} args The provided arguments. 2311 * @param {Array} partials The arguments to prepend to those provided. 2312 * @param {Array} holders The `partials` placeholder indexes. 2313 * @params {boolean} [isCurried] Specify composing for a curried function. 2314 * @returns {Array} Returns the new array of composed arguments. 2315 */function composeArgs(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex];}while(++argsIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[holders[argsIndex]]=args[argsIndex];}}while(rangeLength--){result[leftIndex++]=args[argsIndex++];}return result;}/** 2316 * This function is like `composeArgs` except that the arguments composition 2317 * is tailored for `_.partialRight`. 2318 * 2319 * @private 2320 * @param {Array} args The provided arguments. 2321 * @param {Array} partials The arguments to append to those provided. 2322 * @param {Array} holders The `partials` placeholder indexes. 2323 * @params {boolean} [isCurried] Specify composing for a curried function. 2324 * @returns {Array} Returns the new array of composed arguments. 2325 */function composeArgsRight(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;while(++argsIndex<rangeLength){result[argsIndex]=args[argsIndex];}var offset=argsIndex;while(++rightIndex<rightLength){result[offset+rightIndex]=partials[rightIndex];}while(++holdersIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[offset+holders[holdersIndex]]=args[argsIndex++];}}return result;}/** 2326 * Copies the values of `source` to `array`. 2327 * 2328 * @private 2329 * @param {Array} source The array to copy values from. 2330 * @param {Array} [array=[]] The array to copy values to. 2331 * @returns {Array} Returns `array`. 2332 */function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index];}return array;}/** 2333 * Copies properties of `source` to `object`. 2334 * 2335 * @private 2336 * @param {Object} source The object to copy properties from. 2337 * @param {Array} props The property identifiers to copy. 2338 * @param {Object} [object={}] The object to copy properties to. 2339 * @param {Function} [customizer] The function to customize copied values. 2340 * @returns {Object} Returns `object`. 2341 */function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;if(newValue===undefined){newValue=source[key];}if(isNew){baseAssignValue(object,key,newValue);}else{assignValue(object,key,newValue);}}return object;}/** 2342 * Copies own symbols of `source` to `object`. 2343 * 2344 * @private 2345 * @param {Object} source The object to copy symbols from. 2346 * @param {Object} [object={}] The object to copy symbols to. 2347 * @returns {Object} Returns `object`. 2348 */function copySymbols(source,object){return copyObject(source,getSymbols(source),object);}/** 2349 * Copies own and inherited symbols of `source` to `object`. 2350 * 2351 * @private 2352 * @param {Object} source The object to copy symbols from. 2353 * @param {Object} [object={}] The object to copy symbols to. 2354 * @returns {Object} Returns `object`. 2355 */function copySymbolsIn(source,object){return copyObject(source,getSymbolsIn(source),object);}/** 2356 * Creates a function like `_.groupBy`. 2357 * 2358 * @private 2359 * @param {Function} setter The function to set accumulator values. 2360 * @param {Function} [initializer] The accumulator object initializer. 2361 * @returns {Function} Returns the new aggregator function. 2362 */function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator);};}/** 2363 * Creates a function like `_.assign`. 2364 * 2365 * @private 2366 * @param {Function} assigner The function to assign values. 2367 * @returns {Function} Returns the new assigner function. 2368 */function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++index<length){var source=sources[index];if(source){assigner(object,source,index,customizer);}}return object;});}/** 2369 * Creates a `baseEach` or `baseEachRight` function. 2370 * 2371 * @private 2372 * @param {Function} eachFunc The function to iterate over a collection. 2373 * @param {boolean} [fromRight] Specify iterating from right to left. 2374 * @returns {Function} Returns the new base function. 2375 */function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(collection==null){return collection;}if(!isArrayLike(collection)){return eachFunc(collection,iteratee);}var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);while(fromRight?index--:++index<length){if(iteratee(iterable[index],index,iterable)===false){break;}}return collection;};}/** 2376 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 2377 * 2378 * @private 2379 * @param {boolean} [fromRight] Specify iterating from right to left. 2380 * @returns {Function} Returns the new base function. 2381 */function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===false){break;}}return object;};}/** 2382 * Creates a function that wraps `func` to invoke it with the optional `this` 2383 * binding of `thisArg`. 2384 * 2385 * @private 2386 * @param {Function} func The function to wrap. 2387 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2388 * @param {*} [thisArg] The `this` binding of `func`. 2389 * @returns {Function} Returns the new wrapped function. 2390 */function createBind(func,bitmask,thisArg){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments);}return wrapper;}/** 2391 * Creates a function like `_.lowerFirst`. 2392 * 2393 * @private 2394 * @param {string} methodName The name of the `String` case method to use. 2395 * @returns {Function} Returns the new case function. 2396 */function createCaseFirst(methodName){return function(string){string=toString(string);var strSymbols=hasUnicode(string)?stringToArray(string):undefined;var chr=strSymbols?strSymbols[0]:string.charAt(0);var trailing=strSymbols?castSlice(strSymbols,1).join(''):string.slice(1);return chr[methodName]()+trailing;};}/** 2397 * Creates a function like `_.camelCase`. 2398 * 2399 * @private 2400 * @param {Function} callback The function to combine each word. 2401 * @returns {Function} Returns the new compounder function. 2402 */function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,'')),callback,'');};}/** 2403 * Creates a function that produces an instance of `Ctor` regardless of 2404 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 2405 * 2406 * @private 2407 * @param {Function} Ctor The constructor to wrap. 2408 * @returns {Function} Returns the new wrapped function. 2409 */function createCtor(Ctor){return function(){// Use a `switch` statement to work with class constructors. See 2410// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 2411// for more details. 2412var args=arguments;switch(args.length){case 0:return new Ctor();case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);// Mimic the constructor's `return` behavior. 2413// See https://es5.github.io/#x13.2.2 for more details. 2414return isObject(result)?result:thisBinding;};}/** 2415 * Creates a function that wraps `func` to enable currying. 2416 * 2417 * @private 2418 * @param {Function} func The function to wrap. 2419 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2420 * @param {number} arity The arity of `func`. 2421 * @returns {Function} Returns the new wrapped function. 2422 */function createCurry(func,bitmask,arity){var Ctor=createCtor(func);function wrapper(){var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);while(index--){args[index]=arguments[index];}var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);length-=holders.length;if(length<arity){return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,undefined,args,holders,undefined,undefined,arity-length);}var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return apply(fn,this,args);}return wrapper;}/** 2423 * Creates a `_.find` or `_.findLast` function. 2424 * 2425 * @private 2426 * @param {Function} findIndexFunc The function to find the collection index. 2427 * @returns {Function} Returns the new find function. 2428 */function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection);predicate=function predicate(key){return iteratee(iterable[key],key,iterable);};}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined;};}/** 2429 * Creates a `_.flow` or `_.flowRight` function. 2430 * 2431 * @private 2432 * @param {boolean} [fromRight] Specify iterating from right to left. 2433 * @returns {Function} Returns the new flow function. 2434 */function createFlow(fromRight){return flatRest(function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;if(fromRight){funcs.reverse();}while(index--){var func=funcs[index];if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(prereq&&!wrapper&&getFuncName(func)=='wrapper'){var wrapper=new LodashWrapper([],true);}}index=wrapper?index:length;while(++index<length){func=funcs[index];var funcName=getFuncName(func),data=funcName=='wrapper'?getData(func):undefined;if(data&&isLaziable(data[0])&&data[1]==(WRAP_ARY_FLAG|WRAP_CURRY_FLAG|WRAP_PARTIAL_FLAG|WRAP_REARG_FLAG)&&!data[4].length&&data[9]==1){wrapper=wrapper[getFuncName(data[0])].apply(wrapper,data[3]);}else{wrapper=func.length==1&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func);}}return function(){var args=arguments,value=args[0];if(wrapper&&args.length==1&&isArray(value)){return wrapper.plant(value).value();}var index=0,result=length?funcs[index].apply(this,args):value;while(++index<length){result=funcs[index].call(this,result);}return result;};});}/** 2435 * Creates a function that wraps `func` to invoke it with optional `this` 2436 * binding of `thisArg`, partial application, and currying. 2437 * 2438 * @private 2439 * @param {Function|string} func The function or method name to wrap. 2440 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2441 * @param {*} [thisArg] The `this` binding of `func`. 2442 * @param {Array} [partials] The arguments to prepend to those provided to 2443 * the new function. 2444 * @param {Array} [holders] The `partials` placeholder indexes. 2445 * @param {Array} [partialsRight] The arguments to append to those provided 2446 * to the new function. 2447 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 2448 * @param {Array} [argPos] The argument positions of the new function. 2449 * @param {number} [ary] The arity cap of `func`. 2450 * @param {number} [arity] The arity of `func`. 2451 * @returns {Function} Returns the new wrapped function. 2452 */function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&WRAP_ARY_FLAG,isBind=bitmask&WRAP_BIND_FLAG,isBindKey=bitmask&WRAP_BIND_KEY_FLAG,isCurried=bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG),isFlip=bitmask&WRAP_FLIP_FLAG,Ctor=isBindKey?undefined:createCtor(func);function wrapper(){var length=arguments.length,args=Array(length),index=length;while(index--){args[index]=arguments[index];}if(isCurried){var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);}if(partials){args=composeArgs(args,partials,holders,isCurried);}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight,isCurried);}length-=holdersCount;if(isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length);}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;length=args.length;if(argPos){args=reorder(args,argPos);}else if(isFlip&&length>1){args.reverse();}if(isAry&&ary<length){args.length=ary;}if(this&&this!==root&&this instanceof wrapper){fn=Ctor||createCtor(fn);}return fn.apply(thisBinding,args);}return wrapper;}/** 2453 * Creates a function like `_.invertBy`. 2454 * 2455 * @private 2456 * @param {Function} setter The function to set accumulator values. 2457 * @param {Function} toIteratee The function to resolve iteratees. 2458 * @returns {Function} Returns the new inverter function. 2459 */function createInverter(setter,toIteratee){return function(object,iteratee){return baseInverter(object,setter,toIteratee(iteratee),{});};}/** 2460 * Creates a function that performs a mathematical operation on two values. 2461 * 2462 * @private 2463 * @param {Function} operator The function to perform the operation. 2464 * @param {number} [defaultValue] The value used for `undefined` arguments. 2465 * @returns {Function} Returns the new mathematical operation function. 2466 */function createMathOperation(operator,defaultValue){return function(value,other){var result;if(value===undefined&&other===undefined){return defaultValue;}if(value!==undefined){result=value;}if(other!==undefined){if(result===undefined){return other;}if(typeof value=='string'||typeof other=='string'){value=baseToString(value);other=baseToString(other);}else{value=baseToNumber(value);other=baseToNumber(other);}result=operator(value,other);}return result;};}/** 2467 * Creates a function like `_.over`. 2468 * 2469 * @private 2470 * @param {Function} arrayFunc The function to iterate over iteratees. 2471 * @returns {Function} Returns the new over function. 2472 */function createOver(arrayFunc){return flatRest(function(iteratees){iteratees=arrayMap(iteratees,baseUnary(getIteratee()));return baseRest(function(args){var thisArg=this;return arrayFunc(iteratees,function(iteratee){return apply(iteratee,thisArg,args);});});});}/** 2473 * Creates the padding for `string` based on `length`. The `chars` string 2474 * is truncated if the number of characters exceeds `length`. 2475 * 2476 * @private 2477 * @param {number} length The padding length. 2478 * @param {string} [chars=' '] The string used as padding. 2479 * @returns {string} Returns the padding for `string`. 2480 */function createPadding(length,chars){chars=chars===undefined?' ':baseToString(chars);var charsLength=chars.length;if(charsLength<2){return charsLength?baseRepeat(chars,length):chars;}var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(''):result.slice(0,length);}/** 2481 * Creates a function that wraps `func` to invoke it with the `this` binding 2482 * of `thisArg` and `partials` prepended to the arguments it receives. 2483 * 2484 * @private 2485 * @param {Function} func The function to wrap. 2486 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2487 * @param {*} thisArg The `this` binding of `func`. 2488 * @param {Array} partials The arguments to prepend to those provided to 2489 * the new function. 2490 * @returns {Function} Returns the new wrapped function. 2491 */function createPartial(func,bitmask,thisArg,partials){var isBind=bitmask&WRAP_BIND_FLAG,Ctor=createCtor(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex];}while(argsLength--){args[leftIndex++]=arguments[++argsIndex];}return apply(fn,isBind?thisArg:this,args);}return wrapper;}/** 2492 * Creates a `_.range` or `_.rangeRight` function. 2493 * 2494 * @private 2495 * @param {boolean} [fromRight] Specify iterating from right to left. 2496 * @returns {Function} Returns the new range function. 2497 */function createRange(fromRight){return function(start,end,step){if(step&&typeof step!='number'&&isIterateeCall(start,end,step)){end=step=undefined;}// Ensure the sign of `-0` is preserved. 2498start=toFinite(start);if(end===undefined){end=start;start=0;}else{end=toFinite(end);}step=step===undefined?start<end?1:-1:toFinite(step);return baseRange(start,end,step,fromRight);};}/** 2499 * Creates a function that performs a relational operation on two values. 2500 * 2501 * @private 2502 * @param {Function} operator The function to perform the operation. 2503 * @returns {Function} Returns the new relational operation function. 2504 */function createRelationalOperation(operator){return function(value,other){if(!(typeof value=='string'&&typeof other=='string')){value=toNumber(value);other=toNumber(other);}return operator(value,other);};}/** 2505 * Creates a function that wraps `func` to continue currying. 2506 * 2507 * @private 2508 * @param {Function} func The function to wrap. 2509 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2510 * @param {Function} wrapFunc The function to create the `func` wrapper. 2511 * @param {*} placeholder The placeholder value. 2512 * @param {*} [thisArg] The `this` binding of `func`. 2513 * @param {Array} [partials] The arguments to prepend to those provided to 2514 * the new function. 2515 * @param {Array} [holders] The `partials` placeholder indexes. 2516 * @param {Array} [argPos] The argument positions of the new function. 2517 * @param {number} [ary] The arity cap of `func`. 2518 * @param {number} [arity] The arity of `func`. 2519 * @returns {Function} Returns the new wrapped function. 2520 */function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&WRAP_CURRY_FLAG,newHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?WRAP_PARTIAL_FLAG:WRAP_PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?WRAP_PARTIAL_RIGHT_FLAG:WRAP_PARTIAL_FLAG);if(!(bitmask&WRAP_CURRY_BOUND_FLAG)){bitmask&=~(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG);}var newData=[func,bitmask,thisArg,newPartials,newHolders,newPartialsRight,newHoldersRight,argPos,ary,arity];var result=wrapFunc.apply(undefined,newData);if(isLaziable(func)){setData(result,newData);}result.placeholder=placeholder;return setWrapToString(result,func,bitmask);}/** 2521 * Creates a function like `_.round`. 2522 * 2523 * @private 2524 * @param {string} methodName The name of the `Math` method to use when rounding. 2525 * @returns {Function} Returns the new round function. 2526 */function createRound(methodName){var func=Math[methodName];return function(number,precision){number=toNumber(number);precision=precision==null?0:nativeMin(toInteger(precision),292);if(precision&&nativeIsFinite(number)){// Shift with exponential notation to avoid floating-point issues. 2527// See [MDN](https://mdn.io/round#Examples) for more details. 2528var pair=(toString(number)+'e').split('e'),value=func(pair[0]+'e'+(+pair[1]+precision));pair=(toString(value)+'e').split('e');return+(pair[0]+'e'+(+pair[1]-precision));}return func(number);};}/** 2529 * Creates a set object of `values`. 2530 * 2531 * @private 2532 * @param {Array} values The values to add to the set. 2533 * @returns {Object} Returns the new set. 2534 */var createSet=!(Set&&1/setToArray(new Set([,-0]))[1]==INFINITY)?noop:function(values){return new Set(values);};/** 2535 * Creates a `_.toPairs` or `_.toPairsIn` function. 2536 * 2537 * @private 2538 * @param {Function} keysFunc The function to get the keys of a given object. 2539 * @returns {Function} Returns the new pairs function. 2540 */function createToPairs(keysFunc){return function(object){var tag=getTag(object);if(tag==mapTag){return mapToArray(object);}if(tag==setTag){return setToPairs(object);}return baseToPairs(object,keysFunc(object));};}/** 2541 * Creates a function that either curries or invokes `func` with optional 2542 * `this` binding and partially applied arguments. 2543 * 2544 * @private 2545 * @param {Function|string} func The function or method name to wrap. 2546 * @param {number} bitmask The bitmask flags. 2547 * 1 - `_.bind` 2548 * 2 - `_.bindKey` 2549 * 4 - `_.curry` or `_.curryRight` of a bound function 2550 * 8 - `_.curry` 2551 * 16 - `_.curryRight` 2552 * 32 - `_.partial` 2553 * 64 - `_.partialRight` 2554 * 128 - `_.rearg` 2555 * 256 - `_.ary` 2556 * 512 - `_.flip` 2557 * @param {*} [thisArg] The `this` binding of `func`. 2558 * @param {Array} [partials] The arguments to be partially applied. 2559 * @param {Array} [holders] The `partials` placeholder indexes. 2560 * @param {Array} [argPos] The argument positions of the new function. 2561 * @param {number} [ary] The arity cap of `func`. 2562 * @param {number} [arity] The arity of `func`. 2563 * @returns {Function} Returns the new wrapped function. 2564 */function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&WRAP_BIND_KEY_FLAG;if(!isBindKey&&typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var length=partials?partials.length:0;if(!length){bitmask&=~(WRAP_PARTIAL_FLAG|WRAP_PARTIAL_RIGHT_FLAG);partials=holders=undefined;}ary=ary===undefined?ary:nativeMax(toInteger(ary),0);arity=arity===undefined?arity:toInteger(arity);length-=holders?holders.length:0;if(bitmask&WRAP_PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined;}var data=isBindKey?undefined:getData(func);var newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data){mergeData(newData,data);}func=newData[0];bitmask=newData[1];thisArg=newData[2];partials=newData[3];holders=newData[4];arity=newData[9]=newData[9]===undefined?isBindKey?0:func.length:nativeMax(newData[9]-length,0);if(!arity&&bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)){bitmask&=~(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG);}if(!bitmask||bitmask==WRAP_BIND_FLAG){var result=createBind(func,bitmask,thisArg);}else if(bitmask==WRAP_CURRY_FLAG||bitmask==WRAP_CURRY_RIGHT_FLAG){result=createCurry(func,bitmask,arity);}else if((bitmask==WRAP_PARTIAL_FLAG||bitmask==(WRAP_BIND_FLAG|WRAP_PARTIAL_FLAG))&&!holders.length){result=createPartial(func,bitmask,thisArg,partials);}else{result=createHybrid.apply(undefined,newData);}var setter=data?baseSetData:setData;return setWrapToString(setter(result,newData),func,bitmask);}/** 2565 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 2566 * of source objects to the destination object for all destination properties 2567 * that resolve to `undefined`. 2568 * 2569 * @private 2570 * @param {*} objValue The destination value. 2571 * @param {*} srcValue The source value. 2572 * @param {string} key The key of the property to assign. 2573 * @param {Object} object The parent object of `objValue`. 2574 * @returns {*} Returns the value to assign. 2575 */function customDefaultsAssignIn(objValue,srcValue,key,object){if(objValue===undefined||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)){return srcValue;}return objValue;}/** 2576 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 2577 * objects into destination objects that are passed thru. 2578 * 2579 * @private 2580 * @param {*} objValue The destination value. 2581 * @param {*} srcValue The source value. 2582 * @param {string} key The key of the property to merge. 2583 * @param {Object} object The parent object of `objValue`. 2584 * @param {Object} source The parent object of `srcValue`. 2585 * @param {Object} [stack] Tracks traversed source values and their merged 2586 * counterparts. 2587 * @returns {*} Returns the value to assign. 2588 */function customDefaultsMerge(objValue,srcValue,key,object,source,stack){if(isObject(objValue)&&isObject(srcValue)){// Recursively merge objects and arrays (susceptible to call stack limits). 2589stack.set(srcValue,objValue);baseMerge(objValue,srcValue,undefined,customDefaultsMerge,stack);stack['delete'](srcValue);}return objValue;}/** 2590 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 2591 * objects. 2592 * 2593 * @private 2594 * @param {*} value The value to inspect. 2595 * @param {string} key The key of the property to inspect. 2596 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 2597 */function customOmitClone(value){return isPlainObject(value)?undefined:value;}/** 2598 * A specialized version of `baseIsEqualDeep` for arrays with support for 2599 * partial deep comparisons. 2600 * 2601 * @private 2602 * @param {Array} array The array to compare. 2603 * @param {Array} other The other array to compare. 2604 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 2605 * @param {Function} customizer The function to customize comparisons. 2606 * @param {Function} equalFunc The function to determine equivalents of values. 2607 * @param {Object} stack Tracks traversed `array` and `other` objects. 2608 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 2609 */function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}// Check that cyclic values are equal. 2610var arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined;stack.set(array,other);stack.set(other,array);// Ignore non-index properties. 2611while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);}if(compared!==undefined){if(compared){continue;}result=false;break;}// Recursively compare arrays (susceptible to call stack limits). 2612if(seen){if(!arraySome(other,function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){return seen.push(othIndex);}})){result=false;break;}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=false;break;}}stack['delete'](array);stack['delete'](other);return result;}/** 2613 * A specialized version of `baseIsEqualDeep` for comparing objects of 2614 * the same `toStringTag`. 2615 * 2616 * **Note:** This function only supports comparing values with tags of 2617 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 2618 * 2619 * @private 2620 * @param {Object} object The object to compare. 2621 * @param {Object} other The other object to compare. 2622 * @param {string} tag The `toStringTag` of the objects to compare. 2623 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 2624 * @param {Function} customizer The function to customize comparisons. 2625 * @param {Function} equalFunc The function to determine equivalents of values. 2626 * @param {Object} stack Tracks traversed `object` and `other` objects. 2627 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 2628 */function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false;}object=object.buffer;other=other.buffer;case arrayBufferTag:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other))){return false;}return true;case boolTag:case dateTag:case numberTag:// Coerce booleans to `1` or `0` and dates to milliseconds. 2629// Invalid dates are coerced to `NaN`. 2630return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:// Coerce regexes to strings and treat strings, primitives and objects, 2631// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 2632// for more details. 2633return object==other+'';case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&COMPARE_PARTIAL_FLAG;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false;}// Assume cyclic values are equal. 2634var stacked=stack.get(object);if(stacked){return stacked==other;}bitmask|=COMPARE_UNORDERED_FLAG;// Recursively compare objects (susceptible to call stack limits). 2635stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);stack['delete'](object);return result;case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other);}}return false;}/** 2636 * A specialized version of `baseIsEqualDeep` for objects with support for 2637 * partial deep comparisons. 2638 * 2639 * @private 2640 * @param {Object} object The object to compare. 2641 * @param {Object} other The other object to compare. 2642 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 2643 * @param {Function} customizer The function to customize comparisons. 2644 * @param {Function} equalFunc The function to determine equivalents of values. 2645 * @param {Object} stack Tracks traversed `object` and `other` objects. 2646 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 2647 */function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false;}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key))){return false;}}// Check that cyclic values are equal. 2648var objStacked=stack.get(object);var othStacked=stack.get(other);if(objStacked&&othStacked){return objStacked==other&&othStacked==object;}var result=true;stack.set(object,other);stack.set(other,object);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);}// Recursively compare objects (susceptible to call stack limits). 2649if(!(compared===undefined?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=false;break;}skipCtor||(skipCtor=key=='constructor');}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;// Non `Object` object instances with different constructors are not equal. 2650if(objCtor!=othCtor&&'constructor'in object&&'constructor'in other&&!(typeof objCtor=='function'&&objCtor instanceof objCtor&&typeof othCtor=='function'&&othCtor instanceof othCtor)){result=false;}}stack['delete'](object);stack['delete'](other);return result;}/** 2651 * A specialized version of `baseRest` which flattens the rest array. 2652 * 2653 * @private 2654 * @param {Function} func The function to apply a rest parameter to. 2655 * @returns {Function} Returns the new function. 2656 */function flatRest(func){return setToString(overRest(func,undefined,flatten),func+'');}/** 2657 * Creates an array of own enumerable property names and symbols of `object`. 2658 * 2659 * @private 2660 * @param {Object} object The object to query. 2661 * @returns {Array} Returns the array of property names and symbols. 2662 */function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols);}/** 2663 * Creates an array of own and inherited enumerable property names and 2664 * symbols of `object`. 2665 * 2666 * @private 2667 * @param {Object} object The object to query. 2668 * @returns {Array} Returns the array of property names and symbols. 2669 */function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn);}/** 2670 * Gets metadata for `func`. 2671 * 2672 * @private 2673 * @param {Function} func The function to query. 2674 * @returns {*} Returns the metadata for `func`. 2675 */var getData=!metaMap?noop:function(func){return metaMap.get(func);};/** 2676 * Gets the name of `func`. 2677 * 2678 * @private 2679 * @param {Function} func The function to query. 2680 * @returns {string} Returns the function name. 2681 */function getFuncName(func){var result=func.name+'',array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;while(length--){var data=array[length],otherFunc=data.func;if(otherFunc==null||otherFunc==func){return data.name;}}return result;}/** 2682 * Gets the argument placeholder value for `func`. 2683 * 2684 * @private 2685 * @param {Function} func The function to inspect. 2686 * @returns {*} Returns the placeholder value. 2687 */function getHolder(func){var object=hasOwnProperty.call(lodash,'placeholder')?lodash:func;return object.placeholder;}/** 2688 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 2689 * this function returns the custom method, otherwise it returns `baseIteratee`. 2690 * If arguments are provided, the chosen function is invoked with them and 2691 * its result is returned. 2692 * 2693 * @private 2694 * @param {*} [value] The value to convert to an iteratee. 2695 * @param {number} [arity] The arity of the created iteratee. 2696 * @returns {Function} Returns the chosen function or its result. 2697 */function getIteratee(){var result=lodash.iteratee||iteratee;result=result===iteratee?baseIteratee:result;return arguments.length?result(arguments[0],arguments[1]):result;}/** 2698 * Gets the data for `map`. 2699 * 2700 * @private 2701 * @param {Object} map The map to query. 2702 * @param {string} key The reference key. 2703 * @returns {*} Returns the map data. 2704 */function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=='string'?'string':'hash']:data.map;}/** 2705 * Gets the property names, values, and compare flags of `object`. 2706 * 2707 * @private 2708 * @param {Object} object The object to query. 2709 * @returns {Array} Returns the match data of `object`. 2710 */function getMatchData(object){var result=keys(object),length=result.length;while(length--){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)];}return result;}/** 2711 * Gets the native function at `key` of `object`. 2712 * 2713 * @private 2714 * @param {Object} object The object to query. 2715 * @param {string} key The key of the method to get. 2716 * @returns {*} Returns the function if it's native, else `undefined`. 2717 */function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined;}/** 2718 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 2719 * 2720 * @private 2721 * @param {*} value The value to query. 2722 * @returns {string} Returns the raw `toStringTag`. 2723 */function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=true;}catch(e){}var result=nativeObjectToString.call(value);if(unmasked){if(isOwn){value[symToStringTag]=tag;}else{delete value[symToStringTag];}}return result;}/** 2724 * Creates an array of the own enumerable symbols of `object`. 2725 * 2726 * @private 2727 * @param {Object} object The object to query. 2728 * @returns {Array} Returns the array of symbols. 2729 */var getSymbols=!nativeGetSymbols?stubArray:function(object){if(object==null){return[];}object=Object(object);return arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol);});};/** 2730 * Creates an array of the own and inherited enumerable symbols of `object`. 2731 * 2732 * @private 2733 * @param {Object} object The object to query. 2734 * @returns {Array} Returns the array of symbols. 2735 */var getSymbolsIn=!nativeGetSymbols?stubArray:function(object){var result=[];while(object){arrayPush(result,getSymbols(object));object=getPrototype(object);}return result;};/** 2736 * Gets the `toStringTag` of `value`. 2737 * 2738 * @private 2739 * @param {*} value The value to query. 2740 * @returns {string} Returns the `toStringTag`. 2741 */var getTag=baseGetTag;// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 2742if(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map())!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set())!=setTag||WeakMap&&getTag(new WeakMap())!=weakMapTag){getTag=function getTag(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):'';if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}/** 2743 * Gets the view, applying any `transforms` to the `start` and `end` positions. 2744 * 2745 * @private 2746 * @param {number} start The start of the view. 2747 * @param {number} end The end of the view. 2748 * @param {Array} transforms The transformations to apply to the view. 2749 * @returns {Object} Returns an object containing the `start` and `end` 2750 * positions of the view. 2751 */function getView(start,end,transforms){var index=-1,length=transforms.length;while(++index<length){var data=transforms[index],size=data.size;switch(data.type){case'drop':start+=size;break;case'dropRight':end-=size;break;case'take':end=nativeMin(end,start+size);break;case'takeRight':start=nativeMax(start,end-size);break;}}return{'start':start,'end':end};}/** 2752 * Extracts wrapper details from the `source` body comment. 2753 * 2754 * @private 2755 * @param {string} source The source to inspect. 2756 * @returns {Array} Returns the wrapper details. 2757 */function getWrapDetails(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[];}/** 2758 * Checks if `path` exists on `object`. 2759 * 2760 * @private 2761 * @param {Object} object The object to query. 2762 * @param {Array|string} path The path to check. 2763 * @param {Function} hasFunc The function to check properties. 2764 * @returns {boolean} Returns `true` if `path` exists, else `false`. 2765 */function hasPath(object,path,hasFunc){path=castPath(path,object);var index=-1,length=path.length,result=false;while(++index<length){var key=toKey(path[index]);if(!(result=object!=null&&hasFunc(object,key))){break;}object=object[key];}if(result||++index!=length){return result;}length=object==null?0:object.length;return!!length&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object));}/** 2766 * Initializes an array clone. 2767 * 2768 * @private 2769 * @param {Array} array The array to clone. 2770 * @returns {Array} Returns the initialized clone. 2771 */function initCloneArray(array){var length=array.length,result=new array.constructor(length);// Add properties assigned by `RegExp#exec`. 2772if(length&&typeof array[0]=='string'&&hasOwnProperty.call(array,'index')){result.index=array.index;result.input=array.input;}return result;}/** 2773 * Initializes an object clone. 2774 * 2775 * @private 2776 * @param {Object} object The object to clone. 2777 * @returns {Object} Returns the initialized clone. 2778 */function initCloneObject(object){return typeof object.constructor=='function'&&!isPrototype(object)?baseCreate(getPrototype(object)):{};}/** 2779 * Initializes an object clone based on its `toStringTag`. 2780 * 2781 * **Note:** This function only supports cloning values with tags of 2782 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 2783 * 2784 * @private 2785 * @param {Object} object The object to clone. 2786 * @param {string} tag The `toStringTag` of the object to clone. 2787 * @param {boolean} [isDeep] Specify a deep clone. 2788 * @returns {Object} Returns the initialized clone. 2789 */function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return new Ctor();case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return new Ctor();case symbolTag:return cloneSymbol(object);}}/** 2790 * Inserts wrapper `details` in a comment at the top of the `source` body. 2791 * 2792 * @private 2793 * @param {string} source The source to modify. 2794 * @returns {Array} details The details to insert. 2795 * @returns {string} Returns the modified source. 2796 */function insertWrapDetails(source,details){var length=details.length;if(!length){return source;}var lastIndex=length-1;details[lastIndex]=(length>1?'& ':'')+details[lastIndex];details=details.join(length>2?', ':' ');return source.replace(reWrapComment,'{\n/* [wrapped with '+details+'] */\n');}/** 2797 * Checks if `value` is a flattenable `arguments` object or array. 2798 * 2799 * @private 2800 * @param {*} value The value to check. 2801 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 2802 */function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol]);}/** 2803 * Checks if `value` is a valid array-like index. 2804 * 2805 * @private 2806 * @param {*} value The value to check. 2807 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 2808 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 2809 */function isIndex(value,length){var type=_typeof(value);length=length==null?MAX_SAFE_INTEGER:length;return!!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}/** 2810 * Checks if the given arguments are from an iteratee call. 2811 * 2812 * @private 2813 * @param {*} value The potential iteratee value argument. 2814 * @param {*} index The potential iteratee index or key argument. 2815 * @param {*} object The potential iteratee object argument. 2816 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 2817 * else `false`. 2818 */function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=_typeof(index);if(type=='number'?isArrayLike(object)&&isIndex(index,object.length):type=='string'&&index in object){return eq(object[index],value);}return false;}/** 2819 * Checks if `value` is a property name and not a property path. 2820 * 2821 * @private 2822 * @param {*} value The value to check. 2823 * @param {Object} [object] The object to query keys on. 2824 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 2825 */function isKey(value,object){if(isArray(value)){return false;}var type=_typeof(value);if(type=='number'||type=='symbol'||type=='boolean'||value==null||isSymbol(value)){return true;}return reIsPlainProp.test(value)||!reIsDeepProp.test(value)||object!=null&&value in Object(object);}/** 2826 * Checks if `value` is suitable for use as unique object key. 2827 * 2828 * @private 2829 * @param {*} value The value to check. 2830 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 2831 */function isKeyable(value){var type=_typeof(value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}/** 2832 * Checks if `func` has a lazy counterpart. 2833 * 2834 * @private 2835 * @param {Function} func The function to check. 2836 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 2837 * else `false`. 2838 */function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if(typeof other!='function'||!(funcName in LazyWrapper.prototype)){return false;}if(func===other){return true;}var data=getData(other);return!!data&&func===data[0];}/** 2839 * Checks if `func` has its source masked. 2840 * 2841 * @private 2842 * @param {Function} func The function to check. 2843 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 2844 */function isMasked(func){return!!maskSrcKey&&maskSrcKey in func;}/** 2845 * Checks if `func` is capable of being masked. 2846 * 2847 * @private 2848 * @param {*} value The value to check. 2849 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 2850 */var isMaskable=coreJsData?isFunction:stubFalse;/** 2851 * Checks if `value` is likely a prototype object. 2852 * 2853 * @private 2854 * @param {*} value The value to check. 2855 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 2856 */function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=='function'&&Ctor.prototype||objectProto;return value===proto;}/** 2857 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 2858 * 2859 * @private 2860 * @param {*} value The value to check. 2861 * @returns {boolean} Returns `true` if `value` if suitable for strict 2862 * equality comparisons, else `false`. 2863 */function isStrictComparable(value){return value===value&&!isObject(value);}/** 2864 * A specialized version of `matchesProperty` for source values suitable 2865 * for strict equality comparisons, i.e. `===`. 2866 * 2867 * @private 2868 * @param {string} key The key of the property to get. 2869 * @param {*} srcValue The value to match. 2870 * @returns {Function} Returns the new spec function. 2871 */function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false;}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object));};}/** 2872 * A specialized version of `_.memoize` which clears the memoized function's 2873 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 2874 * 2875 * @private 2876 * @param {Function} func The function to have its output memoized. 2877 * @returns {Function} Returns the new memoized function. 2878 */function memoizeCapped(func){var result=memoize(func,function(key){if(cache.size===MAX_MEMOIZE_SIZE){cache.clear();}return key;});var cache=result.cache;return result;}/** 2879 * Merges the function metadata of `source` into `data`. 2880 * 2881 * Merging metadata reduces the number of wrappers used to invoke a function. 2882 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 2883 * may be applied regardless of execution order. Methods like `_.ary` and 2884 * `_.rearg` modify function arguments, making the order in which they are 2885 * executed important, preventing the merging of metadata. However, we make 2886 * an exception for a safe combined case where curried functions have `_.ary` 2887 * and or `_.rearg` applied. 2888 * 2889 * @private 2890 * @param {Array} data The destination metadata. 2891 * @param {Array} source The source metadata. 2892 * @returns {Array} Returns `data`. 2893 */function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<(WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG|WRAP_ARY_FLAG);var isCombo=srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_CURRY_FLAG||srcBitmask==WRAP_ARY_FLAG&&bitmask==WRAP_REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(WRAP_ARY_FLAG|WRAP_REARG_FLAG)&&source[7].length<=source[8]&&bitmask==WRAP_CURRY_FLAG;// Exit early if metadata can't be merged. 2894if(!(isCommon||isCombo)){return data;}// Use source `thisArg` if available. 2895if(srcBitmask&WRAP_BIND_FLAG){data[2]=source[2];// Set when currying a bound function. 2896newBitmask|=bitmask&WRAP_BIND_FLAG?0:WRAP_CURRY_BOUND_FLAG;}// Compose partial arguments. 2897var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value;data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4];}// Compose partial right arguments. 2898value=source[5];if(value){partials=data[5];data[5]=partials?composeArgsRight(partials,value,source[6]):value;data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6];}// Use source `argPos` if available. 2899value=source[7];if(value){data[7]=value;}// Use source `ary` if it's smaller. 2900if(srcBitmask&WRAP_ARY_FLAG){data[8]=data[8]==null?source[8]:nativeMin(data[8],source[8]);}// Use source `arity` if one is not provided. 2901if(data[9]==null){data[9]=source[9];}// Use source `func` and merge bitmasks. 2902data[0]=source[0];data[1]=newBitmask;return data;}/** 2903 * This function is like 2904 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 2905 * except that it includes inherited enumerable properties. 2906 * 2907 * @private 2908 * @param {Object} object The object to query. 2909 * @returns {Array} Returns the array of property names. 2910 */function nativeKeysIn(object){var result=[];if(object!=null){for(var key in Object(object)){result.push(key);}}return result;}/** 2911 * Converts `value` to a string using `Object.prototype.toString`. 2912 * 2913 * @private 2914 * @param {*} value The value to convert. 2915 * @returns {string} Returns the converted string. 2916 */function objectToString(value){return nativeObjectToString.call(value);}/** 2917 * A specialized version of `baseRest` which transforms the rest array. 2918 * 2919 * @private 2920 * @param {Function} func The function to apply a rest parameter to. 2921 * @param {number} [start=func.length-1] The start position of the rest parameter. 2922 * @param {Function} transform The rest array transform. 2923 * @returns {Function} Returns the new function. 2924 */function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index<length){array[index]=args[start+index];}index=-1;var otherArgs=Array(start+1);while(++index<start){otherArgs[index]=args[index];}otherArgs[start]=transform(array);return apply(func,this,otherArgs);};}/** 2925 * Gets the parent value at `path` of `object`. 2926 * 2927 * @private 2928 * @param {Object} object The object to query. 2929 * @param {Array} path The path to get the parent value of. 2930 * @returns {*} Returns the parent value. 2931 */function parent(object,path){return path.length<2?object:baseGet(object,baseSlice(path,0,-1));}/** 2932 * Reorder `array` according to the specified indexes where the element at 2933 * the first index is assigned as the first element, the element at 2934 * the second index is assigned as the second element, and so on. 2935 * 2936 * @private 2937 * @param {Array} array The array to reorder. 2938 * @param {Array} indexes The arranged array indexes. 2939 * @returns {Array} Returns `array`. 2940 */function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined;}return array;}/** 2941 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 2942 * 2943 * @private 2944 * @param {Object} object The object to query. 2945 * @param {string} key The key of the property to get. 2946 * @returns {*} Returns the property value. 2947 */function safeGet(object,key){if(key==='constructor'&&typeof object[key]==='function'){return;}if(key=='__proto__'){return;}return object[key];}/** 2948 * Sets metadata for `func`. 2949 * 2950 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 2951 * period of time, it will trip its breaker and transition to an identity 2952 * function to avoid garbage collection pauses in V8. See 2953 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 2954 * for more details. 2955 * 2956 * @private 2957 * @param {Function} func The function to associate metadata with. 2958 * @param {*} data The metadata. 2959 * @returns {Function} Returns `func`. 2960 */var setData=shortOut(baseSetData);/** 2961 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 2962 * 2963 * @private 2964 * @param {Function} func The function to delay. 2965 * @param {number} wait The number of milliseconds to delay invocation. 2966 * @returns {number|Object} Returns the timer id or timeout object. 2967 */var setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait);};/** 2968 * Sets the `toString` method of `func` to return `string`. 2969 * 2970 * @private 2971 * @param {Function} func The function to modify. 2972 * @param {Function} string The `toString` result. 2973 * @returns {Function} Returns `func`. 2974 */var setToString=shortOut(baseSetToString);/** 2975 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 2976 * with wrapper details in a comment at the top of the source body. 2977 * 2978 * @private 2979 * @param {Function} wrapper The function to modify. 2980 * @param {Function} reference The reference function. 2981 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 2982 * @returns {Function} Returns `wrapper`. 2983 */function setWrapToString(wrapper,reference,bitmask){var source=reference+'';return setToString(wrapper,insertWrapDetails(source,updateWrapDetails(getWrapDetails(source),bitmask)));}/** 2984 * Creates a function that'll short out and invoke `identity` instead 2985 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 2986 * milliseconds. 2987 * 2988 * @private 2989 * @param {Function} func The function to restrict. 2990 * @returns {Function} Returns the new shortable function. 2991 */function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}/** 2992 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 2993 * 2994 * @private 2995 * @param {Array} array The array to shuffle. 2996 * @param {number} [size=array.length] The size of `array`. 2997 * @returns {Array} Returns `array`. 2998 */function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;size=size===undefined?length:size;while(++index<size){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index];array[index]=value;}array.length=size;return array;}/** 2999 * Converts `string` to a property path array. 3000 * 3001 * @private 3002 * @param {string} string The string to convert. 3003 * @returns {Array} Returns the property path array. 3004 */var stringToPath=memoizeCapped(function(string){var result=[];if(string.charCodeAt(0)===46/* . */){result.push('');}string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,'$1'):number||match);});return result;});/** 3005 * Converts `value` to a string key if it's not a string or symbol. 3006 * 3007 * @private 3008 * @param {*} value The value to inspect. 3009 * @returns {string|symbol} Returns the key. 3010 */function toKey(value){if(typeof value=='string'||isSymbol(value)){return value;}var result=value+'';return result=='0'&&1/value==-INFINITY?'-0':result;}/** 3011 * Converts `func` to its source code. 3012 * 3013 * @private 3014 * @param {Function} func The function to convert. 3015 * @returns {string} Returns the source code. 3016 */function toSource(func){if(func!=null){try{return funcToString.call(func);}catch(e){}try{return func+'';}catch(e){}}return'';}/** 3017 * Updates wrapper `details` based on `bitmask` flags. 3018 * 3019 * @private 3020 * @returns {Array} details The details to modify. 3021 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 3022 * @returns {Array} Returns `details`. 3023 */function updateWrapDetails(details,bitmask){arrayEach(wrapFlags,function(pair){var value='_.'+pair[0];if(bitmask&pair[1]&&!arrayIncludes(details,value)){details.push(value);}});return details.sort();}/** 3024 * Creates a clone of `wrapper`. 3025 * 3026 * @private 3027 * @param {Object} wrapper The wrapper to clone. 3028 * @returns {Object} Returns the cloned wrapper. 3029 */function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper){return wrapper.clone();}var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);result.__actions__=copyArray(wrapper.__actions__);result.__index__=wrapper.__index__;result.__values__=wrapper.__values__;return result;}/*------------------------------------------------------------------------*/ /** 3030 * Creates an array of elements split into groups the length of `size`. 3031 * If `array` can't be split evenly, the final chunk will be the remaining 3032 * elements. 3033 * 3034 * @static 3035 * @memberOf _ 3036 * @since 3.0.0 3037 * @category Array 3038 * @param {Array} array The array to process. 3039 * @param {number} [size=1] The length of each chunk 3040 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3041 * @returns {Array} Returns the new array of chunks. 3042 * @example 3043 * 3044 * _.chunk(['a', 'b', 'c', 'd'], 2); 3045 * // => [['a', 'b'], ['c', 'd']] 3046 * 3047 * _.chunk(['a', 'b', 'c', 'd'], 3); 3048 * // => [['a', 'b', 'c'], ['d']] 3049 */function chunk(array,size,guard){if(guard?isIterateeCall(array,size,guard):size===undefined){size=1;}else{size=nativeMax(toInteger(size),0);}var length=array==null?0:array.length;if(!length||size<1){return[];}var index=0,resIndex=0,result=Array(nativeCeil(length/size));while(index<length){result[resIndex++]=baseSlice(array,index,index+=size);}return result;}/** 3050 * Creates an array with all falsey values removed. The values `false`, `null`, 3051 * `0`, `""`, `undefined`, and `NaN` are falsey. 3052 * 3053 * @static 3054 * @memberOf _ 3055 * @since 0.1.0 3056 * @category Array 3057 * @param {Array} array The array to compact. 3058 * @returns {Array} Returns the new array of filtered values. 3059 * @example 3060 * 3061 * _.compact([0, 1, false, 2, '', 3]); 3062 * // => [1, 2, 3] 3063 */function compact(array){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(value){result[resIndex++]=value;}}return result;}/** 3064 * Creates a new array concatenating `array` with any additional arrays 3065 * and/or values. 3066 * 3067 * @static 3068 * @memberOf _ 3069 * @since 4.0.0 3070 * @category Array 3071 * @param {Array} array The array to concatenate. 3072 * @param {...*} [values] The values to concatenate. 3073 * @returns {Array} Returns the new concatenated array. 3074 * @example 3075 * 3076 * var array = [1]; 3077 * var other = _.concat(array, 2, [3], [[4]]); 3078 * 3079 * console.log(other); 3080 * // => [1, 2, 3, [4]] 3081 * 3082 * console.log(array); 3083 * // => [1] 3084 */function concat(){var length=arguments.length;if(!length){return[];}var args=Array(length-1),array=arguments[0],index=length;while(index--){args[index-1]=arguments[index];}return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1));}/** 3085 * Creates an array of `array` values not included in the other given arrays 3086 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3087 * for equality comparisons. The order and references of result values are 3088 * determined by the first array. 3089 * 3090 * **Note:** Unlike `_.pullAll`, this method returns a new array. 3091 * 3092 * @static 3093 * @memberOf _ 3094 * @since 0.1.0 3095 * @category Array 3096 * @param {Array} array The array to inspect. 3097 * @param {...Array} [values] The values to exclude. 3098 * @returns {Array} Returns the new array of filtered values. 3099 * @see _.without, _.xor 3100 * @example 3101 * 3102 * _.difference([2, 1], [2, 3]); 3103 * // => [1] 3104 */var difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true)):[];});/** 3105 * This method is like `_.difference` except that it accepts `iteratee` which 3106 * is invoked for each element of `array` and `values` to generate the criterion 3107 * by which they're compared. The order and references of result values are 3108 * determined by the first array. The iteratee is invoked with one argument: 3109 * (value). 3110 * 3111 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 3112 * 3113 * @static 3114 * @memberOf _ 3115 * @since 4.0.0 3116 * @category Array 3117 * @param {Array} array The array to inspect. 3118 * @param {...Array} [values] The values to exclude. 3119 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 3120 * @returns {Array} Returns the new array of filtered values. 3121 * @example 3122 * 3123 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 3124 * // => [1.2] 3125 * 3126 * // The `_.property` iteratee shorthand. 3127 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 3128 * // => [{ 'x': 2 }] 3129 */var differenceBy=baseRest(function(array,values){var iteratee=last(values);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),getIteratee(iteratee,2)):[];});/** 3130 * This method is like `_.difference` except that it accepts `comparator` 3131 * which is invoked to compare elements of `array` to `values`. The order and 3132 * references of result values are determined by the first array. The comparator 3133 * is invoked with two arguments: (arrVal, othVal). 3134 * 3135 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 3136 * 3137 * @static 3138 * @memberOf _ 3139 * @since 4.0.0 3140 * @category Array 3141 * @param {Array} array The array to inspect. 3142 * @param {...Array} [values] The values to exclude. 3143 * @param {Function} [comparator] The comparator invoked per element. 3144 * @returns {Array} Returns the new array of filtered values. 3145 * @example 3146 * 3147 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 3148 * 3149 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 3150 * // => [{ 'x': 2, 'y': 1 }] 3151 */var differenceWith=baseRest(function(array,values){var comparator=last(values);if(isArrayLikeObject(comparator)){comparator=undefined;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),undefined,comparator):[];});/** 3152 * Creates a slice of `array` with `n` elements dropped from the beginning. 3153 * 3154 * @static 3155 * @memberOf _ 3156 * @since 0.5.0 3157 * @category Array 3158 * @param {Array} array The array to query. 3159 * @param {number} [n=1] The number of elements to drop. 3160 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3161 * @returns {Array} Returns the slice of `array`. 3162 * @example 3163 * 3164 * _.drop([1, 2, 3]); 3165 * // => [2, 3] 3166 * 3167 * _.drop([1, 2, 3], 2); 3168 * // => [3] 3169 * 3170 * _.drop([1, 2, 3], 5); 3171 * // => [] 3172 * 3173 * _.drop([1, 2, 3], 0); 3174 * // => [1, 2, 3] 3175 */function drop(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);return baseSlice(array,n<0?0:n,length);}/** 3176 * Creates a slice of `array` with `n` elements dropped from the end. 3177 * 3178 * @static 3179 * @memberOf _ 3180 * @since 3.0.0 3181 * @category Array 3182 * @param {Array} array The array to query. 3183 * @param {number} [n=1] The number of elements to drop. 3184 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3185 * @returns {Array} Returns the slice of `array`. 3186 * @example 3187 * 3188 * _.dropRight([1, 2, 3]); 3189 * // => [1, 2] 3190 * 3191 * _.dropRight([1, 2, 3], 2); 3192 * // => [1] 3193 * 3194 * _.dropRight([1, 2, 3], 5); 3195 * // => [] 3196 * 3197 * _.dropRight([1, 2, 3], 0); 3198 * // => [1, 2, 3] 3199 */function dropRight(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);n=length-n;return baseSlice(array,0,n<0?0:n);}/** 3200 * Creates a slice of `array` excluding elements dropped from the end. 3201 * Elements are dropped until `predicate` returns falsey. The predicate is 3202 * invoked with three arguments: (value, index, array). 3203 * 3204 * @static 3205 * @memberOf _ 3206 * @since 3.0.0 3207 * @category Array 3208 * @param {Array} array The array to query. 3209 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3210 * @returns {Array} Returns the slice of `array`. 3211 * @example 3212 * 3213 * var users = [ 3214 * { 'user': 'barney', 'active': true }, 3215 * { 'user': 'fred', 'active': false }, 3216 * { 'user': 'pebbles', 'active': false } 3217 * ]; 3218 * 3219 * _.dropRightWhile(users, function(o) { return !o.active; }); 3220 * // => objects for ['barney'] 3221 * 3222 * // The `_.matches` iteratee shorthand. 3223 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 3224 * // => objects for ['barney', 'fred'] 3225 * 3226 * // The `_.matchesProperty` iteratee shorthand. 3227 * _.dropRightWhile(users, ['active', false]); 3228 * // => objects for ['barney'] 3229 * 3230 * // The `_.property` iteratee shorthand. 3231 * _.dropRightWhile(users, 'active'); 3232 * // => objects for ['barney', 'fred', 'pebbles'] 3233 */function dropRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true,true):[];}/** 3234 * Creates a slice of `array` excluding elements dropped from the beginning. 3235 * Elements are dropped until `predicate` returns falsey. The predicate is 3236 * invoked with three arguments: (value, index, array). 3237 * 3238 * @static 3239 * @memberOf _ 3240 * @since 3.0.0 3241 * @category Array 3242 * @param {Array} array The array to query. 3243 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3244 * @returns {Array} Returns the slice of `array`. 3245 * @example 3246 * 3247 * var users = [ 3248 * { 'user': 'barney', 'active': false }, 3249 * { 'user': 'fred', 'active': false }, 3250 * { 'user': 'pebbles', 'active': true } 3251 * ]; 3252 * 3253 * _.dropWhile(users, function(o) { return !o.active; }); 3254 * // => objects for ['pebbles'] 3255 * 3256 * // The `_.matches` iteratee shorthand. 3257 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 3258 * // => objects for ['fred', 'pebbles'] 3259 * 3260 * // The `_.matchesProperty` iteratee shorthand. 3261 * _.dropWhile(users, ['active', false]); 3262 * // => objects for ['pebbles'] 3263 * 3264 * // The `_.property` iteratee shorthand. 3265 * _.dropWhile(users, 'active'); 3266 * // => objects for ['barney', 'fred', 'pebbles'] 3267 */function dropWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true):[];}/** 3268 * Fills elements of `array` with `value` from `start` up to, but not 3269 * including, `end`. 3270 * 3271 * **Note:** This method mutates `array`. 3272 * 3273 * @static 3274 * @memberOf _ 3275 * @since 3.2.0 3276 * @category Array 3277 * @param {Array} array The array to fill. 3278 * @param {*} value The value to fill `array` with. 3279 * @param {number} [start=0] The start position. 3280 * @param {number} [end=array.length] The end position. 3281 * @returns {Array} Returns `array`. 3282 * @example 3283 * 3284 * var array = [1, 2, 3]; 3285 * 3286 * _.fill(array, 'a'); 3287 * console.log(array); 3288 * // => ['a', 'a', 'a'] 3289 * 3290 * _.fill(Array(3), 2); 3291 * // => [2, 2, 2] 3292 * 3293 * _.fill([4, 6, 8, 10], '*', 1, 3); 3294 * // => [4, '*', '*', 10] 3295 */function fill(array,value,start,end){var length=array==null?0:array.length;if(!length){return[];}if(start&&typeof start!='number'&&isIterateeCall(array,value,start)){start=0;end=length;}return baseFill(array,value,start,end);}/** 3296 * This method is like `_.find` except that it returns the index of the first 3297 * element `predicate` returns truthy for instead of the element itself. 3298 * 3299 * @static 3300 * @memberOf _ 3301 * @since 1.1.0 3302 * @category Array 3303 * @param {Array} array The array to inspect. 3304 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3305 * @param {number} [fromIndex=0] The index to search from. 3306 * @returns {number} Returns the index of the found element, else `-1`. 3307 * @example 3308 * 3309 * var users = [ 3310 * { 'user': 'barney', 'active': false }, 3311 * { 'user': 'fred', 'active': false }, 3312 * { 'user': 'pebbles', 'active': true } 3313 * ]; 3314 * 3315 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 3316 * // => 0 3317 * 3318 * // The `_.matches` iteratee shorthand. 3319 * _.findIndex(users, { 'user': 'fred', 'active': false }); 3320 * // => 1 3321 * 3322 * // The `_.matchesProperty` iteratee shorthand. 3323 * _.findIndex(users, ['active', false]); 3324 * // => 0 3325 * 3326 * // The `_.property` iteratee shorthand. 3327 * _.findIndex(users, 'active'); 3328 * // => 2 3329 */function findIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseFindIndex(array,getIteratee(predicate,3),index);}/** 3330 * This method is like `_.findIndex` except that it iterates over elements 3331 * of `collection` from right to left. 3332 * 3333 * @static 3334 * @memberOf _ 3335 * @since 2.0.0 3336 * @category Array 3337 * @param {Array} array The array to inspect. 3338 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3339 * @param {number} [fromIndex=array.length-1] The index to search from. 3340 * @returns {number} Returns the index of the found element, else `-1`. 3341 * @example 3342 * 3343 * var users = [ 3344 * { 'user': 'barney', 'active': true }, 3345 * { 'user': 'fred', 'active': false }, 3346 * { 'user': 'pebbles', 'active': false } 3347 * ]; 3348 * 3349 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 3350 * // => 2 3351 * 3352 * // The `_.matches` iteratee shorthand. 3353 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 3354 * // => 0 3355 * 3356 * // The `_.matchesProperty` iteratee shorthand. 3357 * _.findLastIndex(users, ['active', false]); 3358 * // => 2 3359 * 3360 * // The `_.property` iteratee shorthand. 3361 * _.findLastIndex(users, 'active'); 3362 * // => 0 3363 */function findLastIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=length-1;if(fromIndex!==undefined){index=toInteger(fromIndex);index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1);}return baseFindIndex(array,getIteratee(predicate,3),index,true);}/** 3364 * Flattens `array` a single level deep. 3365 * 3366 * @static 3367 * @memberOf _ 3368 * @since 0.1.0 3369 * @category Array 3370 * @param {Array} array The array to flatten. 3371 * @returns {Array} Returns the new flattened array. 3372 * @example 3373 * 3374 * _.flatten([1, [2, [3, [4]], 5]]); 3375 * // => [1, 2, [3, [4]], 5] 3376 */function flatten(array){var length=array==null?0:array.length;return length?baseFlatten(array,1):[];}/** 3377 * Recursively flattens `array`. 3378 * 3379 * @static 3380 * @memberOf _ 3381 * @since 3.0.0 3382 * @category Array 3383 * @param {Array} array The array to flatten. 3384 * @returns {Array} Returns the new flattened array. 3385 * @example 3386 * 3387 * _.flattenDeep([1, [2, [3, [4]], 5]]); 3388 * // => [1, 2, 3, 4, 5] 3389 */function flattenDeep(array){var length=array==null?0:array.length;return length?baseFlatten(array,INFINITY):[];}/** 3390 * Recursively flatten `array` up to `depth` times. 3391 * 3392 * @static 3393 * @memberOf _ 3394 * @since 4.4.0 3395 * @category Array 3396 * @param {Array} array The array to flatten. 3397 * @param {number} [depth=1] The maximum recursion depth. 3398 * @returns {Array} Returns the new flattened array. 3399 * @example 3400 * 3401 * var array = [1, [2, [3, [4]], 5]]; 3402 * 3403 * _.flattenDepth(array, 1); 3404 * // => [1, 2, [3, [4]], 5] 3405 * 3406 * _.flattenDepth(array, 2); 3407 * // => [1, 2, 3, [4], 5] 3408 */function flattenDepth(array,depth){var length=array==null?0:array.length;if(!length){return[];}depth=depth===undefined?1:toInteger(depth);return baseFlatten(array,depth);}/** 3409 * The inverse of `_.toPairs`; this method returns an object composed 3410 * from key-value `pairs`. 3411 * 3412 * @static 3413 * @memberOf _ 3414 * @since 4.0.0 3415 * @category Array 3416 * @param {Array} pairs The key-value pairs. 3417 * @returns {Object} Returns the new object. 3418 * @example 3419 * 3420 * _.fromPairs([['a', 1], ['b', 2]]); 3421 * // => { 'a': 1, 'b': 2 } 3422 */function fromPairs(pairs){var index=-1,length=pairs==null?0:pairs.length,result={};while(++index<length){var pair=pairs[index];result[pair[0]]=pair[1];}return result;}/** 3423 * Gets the first element of `array`. 3424 * 3425 * @static 3426 * @memberOf _ 3427 * @since 0.1.0 3428 * @alias first 3429 * @category Array 3430 * @param {Array} array The array to query. 3431 * @returns {*} Returns the first element of `array`. 3432 * @example 3433 * 3434 * _.head([1, 2, 3]); 3435 * // => 1 3436 * 3437 * _.head([]); 3438 * // => undefined 3439 */function head(array){return array&&array.length?array[0]:undefined;}/** 3440 * Gets the index at which the first occurrence of `value` is found in `array` 3441 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3442 * for equality comparisons. If `fromIndex` is negative, it's used as the 3443 * offset from the end of `array`. 3444 * 3445 * @static 3446 * @memberOf _ 3447 * @since 0.1.0 3448 * @category Array 3449 * @param {Array} array The array to inspect. 3450 * @param {*} value The value to search for. 3451 * @param {number} [fromIndex=0] The index to search from. 3452 * @returns {number} Returns the index of the matched value, else `-1`. 3453 * @example 3454 * 3455 * _.indexOf([1, 2, 1, 2], 2); 3456 * // => 1 3457 * 3458 * // Search from the `fromIndex`. 3459 * _.indexOf([1, 2, 1, 2], 2, 2); 3460 * // => 3 3461 */function indexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseIndexOf(array,value,index);}/** 3462 * Gets all but the last element of `array`. 3463 * 3464 * @static 3465 * @memberOf _ 3466 * @since 0.1.0 3467 * @category Array 3468 * @param {Array} array The array to query. 3469 * @returns {Array} Returns the slice of `array`. 3470 * @example 3471 * 3472 * _.initial([1, 2, 3]); 3473 * // => [1, 2] 3474 */function initial(array){var length=array==null?0:array.length;return length?baseSlice(array,0,-1):[];}/** 3475 * Creates an array of unique values that are included in all given arrays 3476 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3477 * for equality comparisons. The order and references of result values are 3478 * determined by the first array. 3479 * 3480 * @static 3481 * @memberOf _ 3482 * @since 0.1.0 3483 * @category Array 3484 * @param {...Array} [arrays] The arrays to inspect. 3485 * @returns {Array} Returns the new array of intersecting values. 3486 * @example 3487 * 3488 * _.intersection([2, 1], [2, 3]); 3489 * // => [2] 3490 */var intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[];});/** 3491 * This method is like `_.intersection` except that it accepts `iteratee` 3492 * which is invoked for each element of each `arrays` to generate the criterion 3493 * by which they're compared. The order and references of result values are 3494 * determined by the first array. The iteratee is invoked with one argument: 3495 * (value). 3496 * 3497 * @static 3498 * @memberOf _ 3499 * @since 4.0.0 3500 * @category Array 3501 * @param {...Array} [arrays] The arrays to inspect. 3502 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 3503 * @returns {Array} Returns the new array of intersecting values. 3504 * @example 3505 * 3506 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 3507 * // => [2.1] 3508 * 3509 * // The `_.property` iteratee shorthand. 3510 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 3511 * // => [{ 'x': 1 }] 3512 */var intersectionBy=baseRest(function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);if(iteratee===last(mapped)){iteratee=undefined;}else{mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[];});/** 3513 * This method is like `_.intersection` except that it accepts `comparator` 3514 * which is invoked to compare elements of `arrays`. The order and references 3515 * of result values are determined by the first array. The comparator is 3516 * invoked with two arguments: (arrVal, othVal). 3517 * 3518 * @static 3519 * @memberOf _ 3520 * @since 4.0.0 3521 * @category Array 3522 * @param {...Array} [arrays] The arrays to inspect. 3523 * @param {Function} [comparator] The comparator invoked per element. 3524 * @returns {Array} Returns the new array of intersecting values. 3525 * @example 3526 * 3527 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 3528 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 3529 * 3530 * _.intersectionWith(objects, others, _.isEqual); 3531 * // => [{ 'x': 1, 'y': 2 }] 3532 */var intersectionWith=baseRest(function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);comparator=typeof comparator=='function'?comparator:undefined;if(comparator){mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined,comparator):[];});/** 3533 * Converts all elements in `array` into a string separated by `separator`. 3534 * 3535 * @static 3536 * @memberOf _ 3537 * @since 4.0.0 3538 * @category Array 3539 * @param {Array} array The array to convert. 3540 * @param {string} [separator=','] The element separator. 3541 * @returns {string} Returns the joined string. 3542 * @example 3543 * 3544 * _.join(['a', 'b', 'c'], '~'); 3545 * // => 'a~b~c' 3546 */function join(array,separator){return array==null?'':nativeJoin.call(array,separator);}/** 3547 * Gets the last element of `array`. 3548 * 3549 * @static 3550 * @memberOf _ 3551 * @since 0.1.0 3552 * @category Array 3553 * @param {Array} array The array to query. 3554 * @returns {*} Returns the last element of `array`. 3555 * @example 3556 * 3557 * _.last([1, 2, 3]); 3558 * // => 3 3559 */function last(array){var length=array==null?0:array.length;return length?array[length-1]:undefined;}/** 3560 * This method is like `_.indexOf` except that it iterates over elements of 3561 * `array` from right to left. 3562 * 3563 * @static 3564 * @memberOf _ 3565 * @since 0.1.0 3566 * @category Array 3567 * @param {Array} array The array to inspect. 3568 * @param {*} value The value to search for. 3569 * @param {number} [fromIndex=array.length-1] The index to search from. 3570 * @returns {number} Returns the index of the matched value, else `-1`. 3571 * @example 3572 * 3573 * _.lastIndexOf([1, 2, 1, 2], 2); 3574 * // => 3 3575 * 3576 * // Search from the `fromIndex`. 3577 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 3578 * // => 1 3579 */function lastIndexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return-1;}var index=length;if(fromIndex!==undefined){index=toInteger(fromIndex);index=index<0?nativeMax(length+index,0):nativeMin(index,length-1);}return value===value?strictLastIndexOf(array,value,index):baseFindIndex(array,baseIsNaN,index,true);}/** 3580 * Gets the element at index `n` of `array`. If `n` is negative, the nth 3581 * element from the end is returned. 3582 * 3583 * @static 3584 * @memberOf _ 3585 * @since 4.11.0 3586 * @category Array 3587 * @param {Array} array The array to query. 3588 * @param {number} [n=0] The index of the element to return. 3589 * @returns {*} Returns the nth element of `array`. 3590 * @example 3591 * 3592 * var array = ['a', 'b', 'c', 'd']; 3593 * 3594 * _.nth(array, 1); 3595 * // => 'b' 3596 * 3597 * _.nth(array, -2); 3598 * // => 'c'; 3599 */function nth(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined;}/** 3600 * Removes all given values from `array` using 3601 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3602 * for equality comparisons. 3603 * 3604 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 3605 * to remove elements from an array by predicate. 3606 * 3607 * @static 3608 * @memberOf _ 3609 * @since 2.0.0 3610 * @category Array 3611 * @param {Array} array The array to modify. 3612 * @param {...*} [values] The values to remove. 3613 * @returns {Array} Returns `array`. 3614 * @example 3615 * 3616 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 3617 * 3618 * _.pull(array, 'a', 'c'); 3619 * console.log(array); 3620 * // => ['b', 'b'] 3621 */var pull=baseRest(pullAll);/** 3622 * This method is like `_.pull` except that it accepts an array of values to remove. 3623 * 3624 * **Note:** Unlike `_.difference`, this method mutates `array`. 3625 * 3626 * @static 3627 * @memberOf _ 3628 * @since 4.0.0 3629 * @category Array 3630 * @param {Array} array The array to modify. 3631 * @param {Array} values The values to remove. 3632 * @returns {Array} Returns `array`. 3633 * @example 3634 * 3635 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 3636 * 3637 * _.pullAll(array, ['a', 'c']); 3638 * console.log(array); 3639 * // => ['b', 'b'] 3640 */function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array;}/** 3641 * This method is like `_.pullAll` except that it accepts `iteratee` which is 3642 * invoked for each element of `array` and `values` to generate the criterion 3643 * by which they're compared. The iteratee is invoked with one argument: (value). 3644 * 3645 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 3646 * 3647 * @static 3648 * @memberOf _ 3649 * @since 4.0.0 3650 * @category Array 3651 * @param {Array} array The array to modify. 3652 * @param {Array} values The values to remove. 3653 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 3654 * @returns {Array} Returns `array`. 3655 * @example 3656 * 3657 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 3658 * 3659 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 3660 * console.log(array); 3661 * // => [{ 'x': 2 }] 3662 */function pullAllBy(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array;}/** 3663 * This method is like `_.pullAll` except that it accepts `comparator` which 3664 * is invoked to compare elements of `array` to `values`. The comparator is 3665 * invoked with two arguments: (arrVal, othVal). 3666 * 3667 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 3668 * 3669 * @static 3670 * @memberOf _ 3671 * @since 4.6.0 3672 * @category Array 3673 * @param {Array} array The array to modify. 3674 * @param {Array} values The values to remove. 3675 * @param {Function} [comparator] The comparator invoked per element. 3676 * @returns {Array} Returns `array`. 3677 * @example 3678 * 3679 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 3680 * 3681 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 3682 * console.log(array); 3683 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 3684 */function pullAllWith(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined,comparator):array;}/** 3685 * Removes elements from `array` corresponding to `indexes` and returns an 3686 * array of removed elements. 3687 * 3688 * **Note:** Unlike `_.at`, this method mutates `array`. 3689 * 3690 * @static 3691 * @memberOf _ 3692 * @since 3.0.0 3693 * @category Array 3694 * @param {Array} array The array to modify. 3695 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 3696 * @returns {Array} Returns the new array of removed elements. 3697 * @example 3698 * 3699 * var array = ['a', 'b', 'c', 'd']; 3700 * var pulled = _.pullAt(array, [1, 3]); 3701 * 3702 * console.log(array); 3703 * // => ['a', 'c'] 3704 * 3705 * console.log(pulled); 3706 * // => ['b', 'd'] 3707 */var pullAt=flatRest(function(array,indexes){var length=array==null?0:array.length,result=baseAt(array,indexes);basePullAt(array,arrayMap(indexes,function(index){return isIndex(index,length)?+index:index;}).sort(compareAscending));return result;});/** 3708 * Removes all elements from `array` that `predicate` returns truthy for 3709 * and returns an array of the removed elements. The predicate is invoked 3710 * with three arguments: (value, index, array). 3711 * 3712 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 3713 * to pull elements from an array by value. 3714 * 3715 * @static 3716 * @memberOf _ 3717 * @since 2.0.0 3718 * @category Array 3719 * @param {Array} array The array to modify. 3720 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3721 * @returns {Array} Returns the new array of removed elements. 3722 * @example 3723 * 3724 * var array = [1, 2, 3, 4]; 3725 * var evens = _.remove(array, function(n) { 3726 * return n % 2 == 0; 3727 * }); 3728 * 3729 * console.log(array); 3730 * // => [1, 3] 3731 * 3732 * console.log(evens); 3733 * // => [2, 4] 3734 */function remove(array,predicate){var result=[];if(!(array&&array.length)){return result;}var index=-1,indexes=[],length=array.length;predicate=getIteratee(predicate,3);while(++index<length){var value=array[index];if(predicate(value,index,array)){result.push(value);indexes.push(index);}}basePullAt(array,indexes);return result;}/** 3735 * Reverses `array` so that the first element becomes the last, the second 3736 * element becomes the second to last, and so on. 3737 * 3738 * **Note:** This method mutates `array` and is based on 3739 * [`Array#reverse`](https://mdn.io/Array/reverse). 3740 * 3741 * @static 3742 * @memberOf _ 3743 * @since 4.0.0 3744 * @category Array 3745 * @param {Array} array The array to modify. 3746 * @returns {Array} Returns `array`. 3747 * @example 3748 * 3749 * var array = [1, 2, 3]; 3750 * 3751 * _.reverse(array); 3752 * // => [3, 2, 1] 3753 * 3754 * console.log(array); 3755 * // => [3, 2, 1] 3756 */function reverse(array){return array==null?array:nativeReverse.call(array);}/** 3757 * Creates a slice of `array` from `start` up to, but not including, `end`. 3758 * 3759 * **Note:** This method is used instead of 3760 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 3761 * returned. 3762 * 3763 * @static 3764 * @memberOf _ 3765 * @since 3.0.0 3766 * @category Array 3767 * @param {Array} array The array to slice. 3768 * @param {number} [start=0] The start position. 3769 * @param {number} [end=array.length] The end position. 3770 * @returns {Array} Returns the slice of `array`. 3771 */function slice(array,start,end){var length=array==null?0:array.length;if(!length){return[];}if(end&&typeof end!='number'&&isIterateeCall(array,start,end)){start=0;end=length;}else{start=start==null?0:toInteger(start);end=end===undefined?length:toInteger(end);}return baseSlice(array,start,end);}/** 3772 * Uses a binary search to determine the lowest index at which `value` 3773 * should be inserted into `array` in order to maintain its sort order. 3774 * 3775 * @static 3776 * @memberOf _ 3777 * @since 0.1.0 3778 * @category Array 3779 * @param {Array} array The sorted array to inspect. 3780 * @param {*} value The value to evaluate. 3781 * @returns {number} Returns the index at which `value` should be inserted 3782 * into `array`. 3783 * @example 3784 * 3785 * _.sortedIndex([30, 50], 40); 3786 * // => 1 3787 */function sortedIndex(array,value){return baseSortedIndex(array,value);}/** 3788 * This method is like `_.sortedIndex` except that it accepts `iteratee` 3789 * which is invoked for `value` and each element of `array` to compute their 3790 * sort ranking. The iteratee is invoked with one argument: (value). 3791 * 3792 * @static 3793 * @memberOf _ 3794 * @since 4.0.0 3795 * @category Array 3796 * @param {Array} array The sorted array to inspect. 3797 * @param {*} value The value to evaluate. 3798 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 3799 * @returns {number} Returns the index at which `value` should be inserted 3800 * into `array`. 3801 * @example 3802 * 3803 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 3804 * 3805 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 3806 * // => 0 3807 * 3808 * // The `_.property` iteratee shorthand. 3809 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 3810 * // => 0 3811 */function sortedIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2));}/** 3812 * This method is like `_.indexOf` except that it performs a binary 3813 * search on a sorted `array`. 3814 * 3815 * @static 3816 * @memberOf _ 3817 * @since 4.0.0 3818 * @category Array 3819 * @param {Array} array The array to inspect. 3820 * @param {*} value The value to search for. 3821 * @returns {number} Returns the index of the matched value, else `-1`. 3822 * @example 3823 * 3824 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 3825 * // => 1 3826 */function sortedIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value)){return index;}}return-1;}/** 3827 * This method is like `_.sortedIndex` except that it returns the highest 3828 * index at which `value` should be inserted into `array` in order to 3829 * maintain its sort order. 3830 * 3831 * @static 3832 * @memberOf _ 3833 * @since 3.0.0 3834 * @category Array 3835 * @param {Array} array The sorted array to inspect. 3836 * @param {*} value The value to evaluate. 3837 * @returns {number} Returns the index at which `value` should be inserted 3838 * into `array`. 3839 * @example 3840 * 3841 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 3842 * // => 4 3843 */function sortedLastIndex(array,value){return baseSortedIndex(array,value,true);}/** 3844 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 3845 * which is invoked for `value` and each element of `array` to compute their 3846 * sort ranking. The iteratee is invoked with one argument: (value). 3847 * 3848 * @static 3849 * @memberOf _ 3850 * @since 4.0.0 3851 * @category Array 3852 * @param {Array} array The sorted array to inspect. 3853 * @param {*} value The value to evaluate. 3854 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 3855 * @returns {number} Returns the index at which `value` should be inserted 3856 * into `array`. 3857 * @example 3858 * 3859 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 3860 * 3861 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 3862 * // => 1 3863 * 3864 * // The `_.property` iteratee shorthand. 3865 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 3866 * // => 1 3867 */function sortedLastIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),true);}/** 3868 * This method is like `_.lastIndexOf` except that it performs a binary 3869 * search on a sorted `array`. 3870 * 3871 * @static 3872 * @memberOf _ 3873 * @since 4.0.0 3874 * @category Array 3875 * @param {Array} array The array to inspect. 3876 * @param {*} value The value to search for. 3877 * @returns {number} Returns the index of the matched value, else `-1`. 3878 * @example 3879 * 3880 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 3881 * // => 3 3882 */function sortedLastIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value,true)-1;if(eq(array[index],value)){return index;}}return-1;}/** 3883 * This method is like `_.uniq` except that it's designed and optimized 3884 * for sorted arrays. 3885 * 3886 * @static 3887 * @memberOf _ 3888 * @since 4.0.0 3889 * @category Array 3890 * @param {Array} array The array to inspect. 3891 * @returns {Array} Returns the new duplicate free array. 3892 * @example 3893 * 3894 * _.sortedUniq([1, 1, 2]); 3895 * // => [1, 2] 3896 */function sortedUniq(array){return array&&array.length?baseSortedUniq(array):[];}/** 3897 * This method is like `_.uniqBy` except that it's designed and optimized 3898 * for sorted arrays. 3899 * 3900 * @static 3901 * @memberOf _ 3902 * @since 4.0.0 3903 * @category Array 3904 * @param {Array} array The array to inspect. 3905 * @param {Function} [iteratee] The iteratee invoked per element. 3906 * @returns {Array} Returns the new duplicate free array. 3907 * @example 3908 * 3909 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 3910 * // => [1.1, 2.3] 3911 */function sortedUniqBy(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[];}/** 3912 * Gets all but the first element of `array`. 3913 * 3914 * @static 3915 * @memberOf _ 3916 * @since 4.0.0 3917 * @category Array 3918 * @param {Array} array The array to query. 3919 * @returns {Array} Returns the slice of `array`. 3920 * @example 3921 * 3922 * _.tail([1, 2, 3]); 3923 * // => [2, 3] 3924 */function tail(array){var length=array==null?0:array.length;return length?baseSlice(array,1,length):[];}/** 3925 * Creates a slice of `array` with `n` elements taken from the beginning. 3926 * 3927 * @static 3928 * @memberOf _ 3929 * @since 0.1.0 3930 * @category Array 3931 * @param {Array} array The array to query. 3932 * @param {number} [n=1] The number of elements to take. 3933 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3934 * @returns {Array} Returns the slice of `array`. 3935 * @example 3936 * 3937 * _.take([1, 2, 3]); 3938 * // => [1] 3939 * 3940 * _.take([1, 2, 3], 2); 3941 * // => [1, 2] 3942 * 3943 * _.take([1, 2, 3], 5); 3944 * // => [1, 2, 3] 3945 * 3946 * _.take([1, 2, 3], 0); 3947 * // => [] 3948 */function take(array,n,guard){if(!(array&&array.length)){return[];}n=guard||n===undefined?1:toInteger(n);return baseSlice(array,0,n<0?0:n);}/** 3949 * Creates a slice of `array` with `n` elements taken from the end. 3950 * 3951 * @static 3952 * @memberOf _ 3953 * @since 3.0.0 3954 * @category Array 3955 * @param {Array} array The array to query. 3956 * @param {number} [n=1] The number of elements to take. 3957 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 3958 * @returns {Array} Returns the slice of `array`. 3959 * @example 3960 * 3961 * _.takeRight([1, 2, 3]); 3962 * // => [3] 3963 * 3964 * _.takeRight([1, 2, 3], 2); 3965 * // => [2, 3] 3966 * 3967 * _.takeRight([1, 2, 3], 5); 3968 * // => [1, 2, 3] 3969 * 3970 * _.takeRight([1, 2, 3], 0); 3971 * // => [] 3972 */function takeRight(array,n,guard){var length=array==null?0:array.length;if(!length){return[];}n=guard||n===undefined?1:toInteger(n);n=length-n;return baseSlice(array,n<0?0:n,length);}/** 3973 * Creates a slice of `array` with elements taken from the end. Elements are 3974 * taken until `predicate` returns falsey. The predicate is invoked with 3975 * three arguments: (value, index, array). 3976 * 3977 * @static 3978 * @memberOf _ 3979 * @since 3.0.0 3980 * @category Array 3981 * @param {Array} array The array to query. 3982 * @param {Function} [predicate=_.identity] The function invoked per iteration. 3983 * @returns {Array} Returns the slice of `array`. 3984 * @example 3985 * 3986 * var users = [ 3987 * { 'user': 'barney', 'active': true }, 3988 * { 'user': 'fred', 'active': false }, 3989 * { 'user': 'pebbles', 'active': false } 3990 * ]; 3991 * 3992 * _.takeRightWhile(users, function(o) { return !o.active; }); 3993 * // => objects for ['fred', 'pebbles'] 3994 * 3995 * // The `_.matches` iteratee shorthand. 3996 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 3997 * // => objects for ['pebbles'] 3998 * 3999 * // The `_.matchesProperty` iteratee shorthand. 4000 * _.takeRightWhile(users, ['active', false]); 4001 * // => objects for ['fred', 'pebbles'] 4002 * 4003 * // The `_.property` iteratee shorthand. 4004 * _.takeRightWhile(users, 'active'); 4005 * // => [] 4006 */function takeRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),false,true):[];}/** 4007 * Creates a slice of `array` with elements taken from the beginning. Elements 4008 * are taken until `predicate` returns falsey. The predicate is invoked with 4009 * three arguments: (value, index, array). 4010 * 4011 * @static 4012 * @memberOf _ 4013 * @since 3.0.0 4014 * @category Array 4015 * @param {Array} array The array to query. 4016 * @param {Function} [predicate=_.identity] The function invoked per iteration. 4017 * @returns {Array} Returns the slice of `array`. 4018 * @example 4019 * 4020 * var users = [ 4021 * { 'user': 'barney', 'active': false }, 4022 * { 'user': 'fred', 'active': false }, 4023 * { 'user': 'pebbles', 'active': true } 4024 * ]; 4025 * 4026 * _.takeWhile(users, function(o) { return !o.active; }); 4027 * // => objects for ['barney', 'fred'] 4028 * 4029 * // The `_.matches` iteratee shorthand. 4030 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 4031 * // => objects for ['barney'] 4032 * 4033 * // The `_.matchesProperty` iteratee shorthand. 4034 * _.takeWhile(users, ['active', false]); 4035 * // => objects for ['barney', 'fred'] 4036 * 4037 * // The `_.property` iteratee shorthand. 4038 * _.takeWhile(users, 'active'); 4039 * // => [] 4040 */function takeWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[];}/** 4041 * Creates an array of unique values, in order, from all given arrays using 4042 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4043 * for equality comparisons. 4044 * 4045 * @static 4046 * @memberOf _ 4047 * @since 0.1.0 4048 * @category Array 4049 * @param {...Array} [arrays] The arrays to inspect. 4050 * @returns {Array} Returns the new array of combined values. 4051 * @example 4052 * 4053 * _.union([2], [1, 2]); 4054 * // => [2, 1] 4055 */var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true));});/** 4056 * This method is like `_.union` except that it accepts `iteratee` which is 4057 * invoked for each element of each `arrays` to generate the criterion by 4058 * which uniqueness is computed. Result values are chosen from the first 4059 * array in which the value occurs. The iteratee is invoked with one argument: 4060 * (value). 4061 * 4062 * @static 4063 * @memberOf _ 4064 * @since 4.0.0 4065 * @category Array 4066 * @param {...Array} [arrays] The arrays to inspect. 4067 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 4068 * @returns {Array} Returns the new array of combined values. 4069 * @example 4070 * 4071 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 4072 * // => [2.1, 1.2] 4073 * 4074 * // The `_.property` iteratee shorthand. 4075 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 4076 * // => [{ 'x': 1 }, { 'x': 2 }] 4077 */var unionBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),getIteratee(iteratee,2));});/** 4078 * This method is like `_.union` except that it accepts `comparator` which 4079 * is invoked to compare elements of `arrays`. Result values are chosen from 4080 * the first array in which the value occurs. The comparator is invoked 4081 * with two arguments: (arrVal, othVal). 4082 * 4083 * @static 4084 * @memberOf _ 4085 * @since 4.0.0 4086 * @category Array 4087 * @param {...Array} [arrays] The arrays to inspect. 4088 * @param {Function} [comparator] The comparator invoked per element. 4089 * @returns {Array} Returns the new array of combined values. 4090 * @example 4091 * 4092 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 4093 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 4094 * 4095 * _.unionWith(objects, others, _.isEqual); 4096 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 4097 */var unionWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator=='function'?comparator:undefined;return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),undefined,comparator);});/** 4098 * Creates a duplicate-free version of an array, using 4099 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4100 * for equality comparisons, in which only the first occurrence of each element 4101 * is kept. The order of result values is determined by the order they occur 4102 * in the array. 4103 * 4104 * @static 4105 * @memberOf _ 4106 * @since 0.1.0 4107 * @category Array 4108 * @param {Array} array The array to inspect. 4109 * @returns {Array} Returns the new duplicate free array. 4110 * @example 4111 * 4112 * _.uniq([2, 1, 2]); 4113 * // => [2, 1] 4114 */function uniq(array){return array&&array.length?baseUniq(array):[];}/** 4115 * This method is like `_.uniq` except that it accepts `iteratee` which is 4116 * invoked for each element in `array` to generate the criterion by which 4117 * uniqueness is computed. The order of result values is determined by the 4118 * order they occur in the array. The iteratee is invoked with one argument: 4119 * (value). 4120 * 4121 * @static 4122 * @memberOf _ 4123 * @since 4.0.0 4124 * @category Array 4125 * @param {Array} array The array to inspect. 4126 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 4127 * @returns {Array} Returns the new duplicate free array. 4128 * @example 4129 * 4130 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 4131 * // => [2.1, 1.2] 4132 * 4133 * // The `_.property` iteratee shorthand. 4134 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 4135 * // => [{ 'x': 1 }, { 'x': 2 }] 4136 */function uniqBy(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[];}/** 4137 * This method is like `_.uniq` except that it accepts `comparator` which 4138 * is invoked to compare elements of `array`. The order of result values is 4139 * determined by the order they occur in the array.The comparator is invoked 4140 * with two arguments: (arrVal, othVal). 4141 * 4142 * @static 4143 * @memberOf _ 4144 * @since 4.0.0 4145 * @category Array 4146 * @param {Array} array The array to inspect. 4147 * @param {Function} [comparator] The comparator invoked per element. 4148 * @returns {Array} Returns the new duplicate free array. 4149 * @example 4150 * 4151 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 4152 * 4153 * _.uniqWith(objects, _.isEqual); 4154 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 4155 */function uniqWith(array,comparator){comparator=typeof comparator=='function'?comparator:undefined;return array&&array.length?baseUniq(array,undefined,comparator):[];}/** 4156 * This method is like `_.zip` except that it accepts an array of grouped 4157 * elements and creates an array regrouping the elements to their pre-zip 4158 * configuration. 4159 * 4160 * @static 4161 * @memberOf _ 4162 * @since 1.2.0 4163 * @category Array 4164 * @param {Array} array The array of grouped elements to process. 4165 * @returns {Array} Returns the new array of regrouped elements. 4166 * @example 4167 * 4168 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 4169 * // => [['a', 1, true], ['b', 2, false]] 4170 * 4171 * _.unzip(zipped); 4172 * // => [['a', 'b'], [1, 2], [true, false]] 4173 */function unzip(array){if(!(array&&array.length)){return[];}var length=0;array=arrayFilter(array,function(group){if(isArrayLikeObject(group)){length=nativeMax(group.length,length);return true;}});return baseTimes(length,function(index){return arrayMap(array,baseProperty(index));});}/** 4174 * This method is like `_.unzip` except that it accepts `iteratee` to specify 4175 * how regrouped values should be combined. The iteratee is invoked with the 4176 * elements of each group: (...group). 4177 * 4178 * @static 4179 * @memberOf _ 4180 * @since 3.8.0 4181 * @category Array 4182 * @param {Array} array The array of grouped elements to process. 4183 * @param {Function} [iteratee=_.identity] The function to combine 4184 * regrouped values. 4185 * @returns {Array} Returns the new array of regrouped elements. 4186 * @example 4187 * 4188 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 4189 * // => [[1, 10, 100], [2, 20, 200]] 4190 * 4191 * _.unzipWith(zipped, _.add); 4192 * // => [3, 30, 300] 4193 */function unzipWith(array,iteratee){if(!(array&&array.length)){return[];}var result=unzip(array);if(iteratee==null){return result;}return arrayMap(result,function(group){return apply(iteratee,undefined,group);});}/** 4194 * Creates an array excluding all given values using 4195 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4196 * for equality comparisons. 4197 * 4198 * **Note:** Unlike `_.pull`, this method returns a new array. 4199 * 4200 * @static 4201 * @memberOf _ 4202 * @since 0.1.0 4203 * @category Array 4204 * @param {Array} array The array to inspect. 4205 * @param {...*} [values] The values to exclude. 4206 * @returns {Array} Returns the new array of filtered values. 4207 * @see _.difference, _.xor 4208 * @example 4209 * 4210 * _.without([2, 1, 2, 3], 1, 2); 4211 * // => [3] 4212 */var without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[];});/** 4213 * Creates an array of unique values that is the 4214 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 4215 * of the given arrays. The order of result values is determined by the order 4216 * they occur in the arrays. 4217 * 4218 * @static 4219 * @memberOf _ 4220 * @since 2.4.0 4221 * @category Array 4222 * @param {...Array} [arrays] The arrays to inspect. 4223 * @returns {Array} Returns the new array of filtered values. 4224 * @see _.difference, _.without 4225 * @example 4226 * 4227 * _.xor([2, 1], [2, 3]); 4228 * // => [1, 3] 4229 */var xor=baseRest(function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject));});/** 4230 * This method is like `_.xor` except that it accepts `iteratee` which is 4231 * invoked for each element of each `arrays` to generate the criterion by 4232 * which by which they're compared. The order of result values is determined 4233 * by the order they occur in the arrays. The iteratee is invoked with one 4234 * argument: (value). 4235 * 4236 * @static 4237 * @memberOf _ 4238 * @since 4.0.0 4239 * @category Array 4240 * @param {...Array} [arrays] The arrays to inspect. 4241 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 4242 * @returns {Array} Returns the new array of filtered values. 4243 * @example 4244 * 4245 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 4246 * // => [1.2, 3.4] 4247 * 4248 * // The `_.property` iteratee shorthand. 4249 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 4250 * // => [{ 'x': 2 }] 4251 */var xorBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined;}return baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2));});/** 4252 * This method is like `_.xor` except that it accepts `comparator` which is 4253 * invoked to compare elements of `arrays`. The order of result values is 4254 * determined by the order they occur in the arrays. The comparator is invoked 4255 * with two arguments: (arrVal, othVal). 4256 * 4257 * @static 4258 * @memberOf _ 4259 * @since 4.0.0 4260 * @category Array 4261 * @param {...Array} [arrays] The arrays to inspect. 4262 * @param {Function} [comparator] The comparator invoked per element. 4263 * @returns {Array} Returns the new array of filtered values. 4264 * @example 4265 * 4266 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 4267 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 4268 * 4269 * _.xorWith(objects, others, _.isEqual); 4270 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 4271 */var xorWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator=='function'?comparator:undefined;return baseXor(arrayFilter(arrays,isArrayLikeObject),undefined,comparator);});/** 4272 * Creates an array of grouped elements, the first of which contains the 4273 * first elements of the given arrays, the second of which contains the 4274 * second elements of the given arrays, and so on. 4275 * 4276 * @static 4277 * @memberOf _ 4278 * @since 0.1.0 4279 * @category Array 4280 * @param {...Array} [arrays] The arrays to process. 4281 * @returns {Array} Returns the new array of grouped elements. 4282 * @example 4283 * 4284 * _.zip(['a', 'b'], [1, 2], [true, false]); 4285 * // => [['a', 1, true], ['b', 2, false]] 4286 */var zip=baseRest(unzip);/** 4287 * This method is like `_.fromPairs` except that it accepts two arrays, 4288 * one of property identifiers and one of corresponding values. 4289 * 4290 * @static 4291 * @memberOf _ 4292 * @since 0.4.0 4293 * @category Array 4294 * @param {Array} [props=[]] The property identifiers. 4295 * @param {Array} [values=[]] The property values. 4296 * @returns {Object} Returns the new object. 4297 * @example 4298 * 4299 * _.zipObject(['a', 'b'], [1, 2]); 4300 * // => { 'a': 1, 'b': 2 } 4301 */function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue);}/** 4302 * This method is like `_.zipObject` except that it supports property paths. 4303 * 4304 * @static 4305 * @memberOf _ 4306 * @since 4.1.0 4307 * @category Array 4308 * @param {Array} [props=[]] The property identifiers. 4309 * @param {Array} [values=[]] The property values. 4310 * @returns {Object} Returns the new object. 4311 * @example 4312 * 4313 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 4314 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 4315 */function zipObjectDeep(props,values){return baseZipObject(props||[],values||[],baseSet);}/** 4316 * This method is like `_.zip` except that it accepts `iteratee` to specify 4317 * how grouped values should be combined. The iteratee is invoked with the 4318 * elements of each group: (...group). 4319 * 4320 * @static 4321 * @memberOf _ 4322 * @since 3.8.0 4323 * @category Array 4324 * @param {...Array} [arrays] The arrays to process. 4325 * @param {Function} [iteratee=_.identity] The function to combine 4326 * grouped values. 4327 * @returns {Array} Returns the new array of grouped elements. 4328 * @example 4329 * 4330 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 4331 * return a + b + c; 4332 * }); 4333 * // => [111, 222] 4334 */var zipWith=baseRest(function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined;iteratee=typeof iteratee=='function'?(arrays.pop(),iteratee):undefined;return unzipWith(arrays,iteratee);});/*------------------------------------------------------------------------*/ /** 4335 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 4336 * chain sequences enabled. The result of such sequences must be unwrapped 4337 * with `_#value`. 4338 * 4339 * @static 4340 * @memberOf _ 4341 * @since 1.3.0 4342 * @category Seq 4343 * @param {*} value The value to wrap. 4344 * @returns {Object} Returns the new `lodash` wrapper instance. 4345 * @example 4346 * 4347 * var users = [ 4348 * { 'user': 'barney', 'age': 36 }, 4349 * { 'user': 'fred', 'age': 40 }, 4350 * { 'user': 'pebbles', 'age': 1 } 4351 * ]; 4352 * 4353 * var youngest = _ 4354 * .chain(users) 4355 * .sortBy('age') 4356 * .map(function(o) { 4357 * return o.user + ' is ' + o.age; 4358 * }) 4359 * .head() 4360 * .value(); 4361 * // => 'pebbles is 1' 4362 */function chain(value){var result=lodash(value);result.__chain__=true;return result;}/** 4363 * This method invokes `interceptor` and returns `value`. The interceptor 4364 * is invoked with one argument; (value). The purpose of this method is to 4365 * "tap into" a method chain sequence in order to modify intermediate results. 4366 * 4367 * @static 4368 * @memberOf _ 4369 * @since 0.1.0 4370 * @category Seq 4371 * @param {*} value The value to provide to `interceptor`. 4372 * @param {Function} interceptor The function to invoke. 4373 * @returns {*} Returns `value`. 4374 * @example 4375 * 4376 * _([1, 2, 3]) 4377 * .tap(function(array) { 4378 * // Mutate input array. 4379 * array.pop(); 4380 * }) 4381 * .reverse() 4382 * .value(); 4383 * // => [2, 1] 4384 */function tap(value,interceptor){interceptor(value);return value;}/** 4385 * This method is like `_.tap` except that it returns the result of `interceptor`. 4386 * The purpose of this method is to "pass thru" values replacing intermediate 4387 * results in a method chain sequence. 4388 * 4389 * @static 4390 * @memberOf _ 4391 * @since 3.0.0 4392 * @category Seq 4393 * @param {*} value The value to provide to `interceptor`. 4394 * @param {Function} interceptor The function to invoke. 4395 * @returns {*} Returns the result of `interceptor`. 4396 * @example 4397 * 4398 * _(' abc ') 4399 * .chain() 4400 * .trim() 4401 * .thru(function(value) { 4402 * return [value]; 4403 * }) 4404 * .value(); 4405 * // => ['abc'] 4406 */function thru(value,interceptor){return interceptor(value);}/** 4407 * This method is the wrapper version of `_.at`. 4408 * 4409 * @name at 4410 * @memberOf _ 4411 * @since 1.0.0 4412 * @category Seq 4413 * @param {...(string|string[])} [paths] The property paths to pick. 4414 * @returns {Object} Returns the new `lodash` wrapper instance. 4415 * @example 4416 * 4417 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 4418 * 4419 * _(object).at(['a[0].b.c', 'a[1]']).value(); 4420 * // => [3, 4] 4421 */var wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function interceptor(object){return baseAt(object,paths);};if(length>1||this.__actions__.length||!(value instanceof LazyWrapper)||!isIndex(start)){return this.thru(interceptor);}value=value.slice(start,+start+(length?1:0));value.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined});return new LodashWrapper(value,this.__chain__).thru(function(array){if(length&&!array.length){array.push(undefined);}return array;});});/** 4422 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 4423 * 4424 * @name chain 4425 * @memberOf _ 4426 * @since 0.1.0 4427 * @category Seq 4428 * @returns {Object} Returns the new `lodash` wrapper instance. 4429 * @example 4430 * 4431 * var users = [ 4432 * { 'user': 'barney', 'age': 36 }, 4433 * { 'user': 'fred', 'age': 40 } 4434 * ]; 4435 * 4436 * // A sequence without explicit chaining. 4437 * _(users).head(); 4438 * // => { 'user': 'barney', 'age': 36 } 4439 * 4440 * // A sequence with explicit chaining. 4441 * _(users) 4442 * .chain() 4443 * .head() 4444 * .pick('user') 4445 * .value(); 4446 * // => { 'user': 'barney' } 4447 */function wrapperChain(){return chain(this);}/** 4448 * Executes the chain sequence and returns the wrapped result. 4449 * 4450 * @name commit 4451 * @memberOf _ 4452 * @since 3.2.0 4453 * @category Seq 4454 * @returns {Object} Returns the new `lodash` wrapper instance. 4455 * @example 4456 * 4457 * var array = [1, 2]; 4458 * var wrapped = _(array).push(3); 4459 * 4460 * console.log(array); 4461 * // => [1, 2] 4462 * 4463 * wrapped = wrapped.commit(); 4464 * console.log(array); 4465 * // => [1, 2, 3] 4466 * 4467 * wrapped.last(); 4468 * // => 3 4469 * 4470 * console.log(array); 4471 * // => [1, 2, 3] 4472 */function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__);}/** 4473 * Gets the next value on a wrapped object following the 4474 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 4475 * 4476 * @name next 4477 * @memberOf _ 4478 * @since 4.0.0 4479 * @category Seq 4480 * @returns {Object} Returns the next iterator value. 4481 * @example 4482 * 4483 * var wrapped = _([1, 2]); 4484 * 4485 * wrapped.next(); 4486 * // => { 'done': false, 'value': 1 } 4487 * 4488 * wrapped.next(); 4489 * // => { 'done': false, 'value': 2 } 4490 * 4491 * wrapped.next(); 4492 * // => { 'done': true, 'value': undefined } 4493 */function wrapperNext(){if(this.__values__===undefined){this.__values__=toArray(this.value());}var done=this.__index__>=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{'done':done,'value':value};}/** 4494 * Enables the wrapper to be iterable. 4495 * 4496 * @name Symbol.iterator 4497 * @memberOf _ 4498 * @since 4.0.0 4499 * @category Seq 4500 * @returns {Object} Returns the wrapper object. 4501 * @example 4502 * 4503 * var wrapped = _([1, 2]); 4504 * 4505 * wrapped[Symbol.iterator]() === wrapped; 4506 * // => true 4507 * 4508 * Array.from(wrapped); 4509 * // => [1, 2] 4510 */function wrapperToIterator(){return this;}/** 4511 * Creates a clone of the chain sequence planting `value` as the wrapped value. 4512 * 4513 * @name plant 4514 * @memberOf _ 4515 * @since 3.2.0 4516 * @category Seq 4517 * @param {*} value The value to plant. 4518 * @returns {Object} Returns the new `lodash` wrapper instance. 4519 * @example 4520 * 4521 * function square(n) { 4522 * return n * n; 4523 * } 4524 * 4525 * var wrapped = _([1, 2]).map(square); 4526 * var other = wrapped.plant([3, 4]); 4527 * 4528 * other.value(); 4529 * // => [9, 16] 4530 * 4531 * wrapped.value(); 4532 * // => [1, 4] 4533 */function wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);clone.__index__=0;clone.__values__=undefined;if(result){previous.__wrapped__=clone;}else{result=clone;}var previous=clone;parent=parent.__wrapped__;}previous.__wrapped__=value;return result;}/** 4534 * This method is the wrapper version of `_.reverse`. 4535 * 4536 * **Note:** This method mutates the wrapped array. 4537 * 4538 * @name reverse 4539 * @memberOf _ 4540 * @since 0.1.0 4541 * @category Seq 4542 * @returns {Object} Returns the new `lodash` wrapper instance. 4543 * @example 4544 * 4545 * var array = [1, 2, 3]; 4546 * 4547 * _(array).reverse().value() 4548 * // => [3, 2, 1] 4549 * 4550 * console.log(array); 4551 * // => [3, 2, 1] 4552 */function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this);}wrapped=wrapped.reverse();wrapped.__actions__.push({'func':thru,'args':[reverse],'thisArg':undefined});return new LodashWrapper(wrapped,this.__chain__);}return this.thru(reverse);}/** 4553 * Executes the chain sequence to resolve the unwrapped value. 4554 * 4555 * @name value 4556 * @memberOf _ 4557 * @since 0.1.0 4558 * @alias toJSON, valueOf 4559 * @category Seq 4560 * @returns {*} Returns the resolved unwrapped value. 4561 * @example 4562 * 4563 * _([1, 2, 3]).value(); 4564 * // => [1, 2, 3] 4565 */function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__);}/*------------------------------------------------------------------------*/ /** 4566 * Creates an object composed of keys generated from the results of running 4567 * each element of `collection` thru `iteratee`. The corresponding value of 4568 * each key is the number of times the key was returned by `iteratee`. The 4569 * iteratee is invoked with one argument: (value). 4570 * 4571 * @static 4572 * @memberOf _ 4573 * @since 0.5.0 4574 * @category Collection 4575 * @param {Array|Object} collection The collection to iterate over. 4576 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 4577 * @returns {Object} Returns the composed aggregate object. 4578 * @example 4579 * 4580 * _.countBy([6.1, 4.2, 6.3], Math.floor); 4581 * // => { '4': 1, '6': 2 } 4582 * 4583 * // The `_.property` iteratee shorthand. 4584 * _.countBy(['one', 'two', 'three'], 'length'); 4585 * // => { '3': 2, '5': 1 } 4586 */var countBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){++result[key];}else{baseAssignValue(result,key,1);}});/** 4587 * Checks if `predicate` returns truthy for **all** elements of `collection`. 4588 * Iteration is stopped once `predicate` returns falsey. The predicate is 4589 * invoked with three arguments: (value, index|key, collection). 4590 * 4591 * **Note:** This method returns `true` for 4592 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 4593 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 4594 * elements of empty collections. 4595 * 4596 * @static 4597 * @memberOf _ 4598 * @since 0.1.0 4599 * @category Collection 4600 * @param {Array|Object} collection The collection to iterate over. 4601 * @param {Function} [predicate=_.identity] The function invoked per iteration. 4602 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 4603 * @returns {boolean} Returns `true` if all elements pass the predicate check, 4604 * else `false`. 4605 * @example 4606 * 4607 * _.every([true, 1, null, 'yes'], Boolean); 4608 * // => false 4609 * 4610 * var users = [ 4611 * { 'user': 'barney', 'age': 36, 'active': false }, 4612 * { 'user': 'fred', 'age': 40, 'active': false } 4613 * ]; 4614 * 4615 * // The `_.matches` iteratee shorthand. 4616 * _.every(users, { 'user': 'barney', 'active': false }); 4617 * // => false 4618 * 4619 * // The `_.matchesProperty` iteratee shorthand. 4620 * _.every(users, ['active', false]); 4621 * // => true 4622 * 4623 * // The `_.property` iteratee shorthand. 4624 * _.every(users, 'active'); 4625 * // => false 4626 */function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,getIteratee(predicate,3));}/** 4627 * Iterates over elements of `collection`, returning an array of all elements 4628 * `predicate` returns truthy for. The predicate is invoked with three 4629 * arguments: (value, index|key, collection). 4630 * 4631 * **Note:** Unlike `_.remove`, this method returns a new array. 4632 * 4633 * @static 4634 * @memberOf _ 4635 * @since 0.1.0 4636 * @category Collection 4637 * @param {Array|Object} collection The collection to iterate over. 4638 * @param {Function} [predicate=_.identity] The function invoked per iteration. 4639 * @returns {Array} Returns the new filtered array. 4640 * @see _.reject 4641 * @example 4642 * 4643 * var users = [ 4644 * { 'user': 'barney', 'age': 36, 'active': true }, 4645 * { 'user': 'fred', 'age': 40, 'active': false } 4646 * ]; 4647 * 4648 * _.filter(users, function(o) { return !o.active; }); 4649 * // => objects for ['fred'] 4650 * 4651 * // The `_.matches` iteratee shorthand. 4652 * _.filter(users, { 'age': 36, 'active': true }); 4653 * // => objects for ['barney'] 4654 * 4655 * // The `_.matchesProperty` iteratee shorthand. 4656 * _.filter(users, ['active', false]); 4657 * // => objects for ['fred'] 4658 * 4659 * // The `_.property` iteratee shorthand. 4660 * _.filter(users, 'active'); 4661 * // => objects for ['barney'] 4662 * 4663 * // Combining several predicates using `_.overEvery` or `_.overSome`. 4664 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 4665 * // => objects for ['fred', 'barney'] 4666 */function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,getIteratee(predicate,3));}/** 4667 * Iterates over elements of `collection`, returning the first element 4668 * `predicate` returns truthy for. The predicate is invoked with three 4669 * arguments: (value, index|key, collection). 4670 * 4671 * @static 4672 * @memberOf _ 4673 * @since 0.1.0 4674 * @category Collection 4675 * @param {Array|Object} collection The collection to inspect. 4676 * @param {Function} [predicate=_.identity] The function invoked per iteration. 4677 * @param {number} [fromIndex=0] The index to search from. 4678 * @returns {*} Returns the matched element, else `undefined`. 4679 * @example 4680 * 4681 * var users = [ 4682 * { 'user': 'barney', 'age': 36, 'active': true }, 4683 * { 'user': 'fred', 'age': 40, 'active': false }, 4684 * { 'user': 'pebbles', 'age': 1, 'active': true } 4685 * ]; 4686 * 4687 * _.find(users, function(o) { return o.age < 40; }); 4688 * // => object for 'barney' 4689 * 4690 * // The `_.matches` iteratee shorthand. 4691 * _.find(users, { 'age': 1, 'active': true }); 4692 * // => object for 'pebbles' 4693 * 4694 * // The `_.matchesProperty` iteratee shorthand. 4695 * _.find(users, ['active', false]); 4696 * // => object for 'fred' 4697 * 4698 * // The `_.property` iteratee shorthand. 4699 * _.find(users, 'active'); 4700 * // => object for 'barney' 4701 */var find=createFind(findIndex);/** 4702 * This method is like `_.find` except that it iterates over elements of 4703 * `collection` from right to left. 4704 * 4705 * @static 4706 * @memberOf _ 4707 * @since 2.0.0 4708 * @category Collection 4709 * @param {Array|Object} collection The collection to inspect. 4710 * @param {Function} [predicate=_.identity] The function invoked per iteration. 4711 * @param {number} [fromIndex=collection.length-1] The index to search from. 4712 * @returns {*} Returns the matched element, else `undefined`. 4713 * @example 4714 * 4715 * _.findLast([1, 2, 3, 4], function(n) { 4716 * return n % 2 == 1; 4717 * }); 4718 * // => 3 4719 */var findLast=createFind(findLastIndex);/** 4720 * Creates a flattened array of values by running each element in `collection` 4721 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 4722 * with three arguments: (value, index|key, collection). 4723 * 4724 * @static 4725 * @memberOf _ 4726 * @since 4.0.0 4727 * @category Collection 4728 * @param {Array|Object} collection The collection to iterate over. 4729 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4730 * @returns {Array} Returns the new flattened array. 4731 * @example 4732 * 4733 * function duplicate(n) { 4734 * return [n, n]; 4735 * } 4736 * 4737 * _.flatMap([1, 2], duplicate); 4738 * // => [1, 1, 2, 2] 4739 */function flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1);}/** 4740 * This method is like `_.flatMap` except that it recursively flattens the 4741 * mapped results. 4742 * 4743 * @static 4744 * @memberOf _ 4745 * @since 4.7.0 4746 * @category Collection 4747 * @param {Array|Object} collection The collection to iterate over. 4748 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4749 * @returns {Array} Returns the new flattened array. 4750 * @example 4751 * 4752 * function duplicate(n) { 4753 * return [[[n, n]]]; 4754 * } 4755 * 4756 * _.flatMapDeep([1, 2], duplicate); 4757 * // => [1, 1, 2, 2] 4758 */function flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY);}/** 4759 * This method is like `_.flatMap` except that it recursively flattens the 4760 * mapped results up to `depth` times. 4761 * 4762 * @static 4763 * @memberOf _ 4764 * @since 4.7.0 4765 * @category Collection 4766 * @param {Array|Object} collection The collection to iterate over. 4767 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4768 * @param {number} [depth=1] The maximum recursion depth. 4769 * @returns {Array} Returns the new flattened array. 4770 * @example 4771 * 4772 * function duplicate(n) { 4773 * return [[[n, n]]]; 4774 * } 4775 * 4776 * _.flatMapDepth([1, 2], duplicate, 2); 4777 * // => [[1, 1], [2, 2]] 4778 */function flatMapDepth(collection,iteratee,depth){depth=depth===undefined?1:toInteger(depth);return baseFlatten(map(collection,iteratee),depth);}/** 4779 * Iterates over elements of `collection` and invokes `iteratee` for each element. 4780 * The iteratee is invoked with three arguments: (value, index|key, collection). 4781 * Iteratee functions may exit iteration early by explicitly returning `false`. 4782 * 4783 * **Note:** As with other "Collections" methods, objects with a "length" 4784 * property are iterated like arrays. To avoid this behavior use `_.forIn` 4785 * or `_.forOwn` for object iteration. 4786 * 4787 * @static 4788 * @memberOf _ 4789 * @since 0.1.0 4790 * @alias each 4791 * @category Collection 4792 * @param {Array|Object} collection The collection to iterate over. 4793 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4794 * @returns {Array|Object} Returns `collection`. 4795 * @see _.forEachRight 4796 * @example 4797 * 4798 * _.forEach([1, 2], function(value) { 4799 * console.log(value); 4800 * }); 4801 * // => Logs `1` then `2`. 4802 * 4803 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 4804 * console.log(key); 4805 * }); 4806 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 4807 */function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,getIteratee(iteratee,3));}/** 4808 * This method is like `_.forEach` except that it iterates over elements of 4809 * `collection` from right to left. 4810 * 4811 * @static 4812 * @memberOf _ 4813 * @since 2.0.0 4814 * @alias eachRight 4815 * @category Collection 4816 * @param {Array|Object} collection The collection to iterate over. 4817 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4818 * @returns {Array|Object} Returns `collection`. 4819 * @see _.forEach 4820 * @example 4821 * 4822 * _.forEachRight([1, 2], function(value) { 4823 * console.log(value); 4824 * }); 4825 * // => Logs `2` then `1`. 4826 */function forEachRight(collection,iteratee){var func=isArray(collection)?arrayEachRight:baseEachRight;return func(collection,getIteratee(iteratee,3));}/** 4827 * Creates an object composed of keys generated from the results of running 4828 * each element of `collection` thru `iteratee`. The order of grouped values 4829 * is determined by the order they occur in `collection`. The corresponding 4830 * value of each key is an array of elements responsible for generating the 4831 * key. The iteratee is invoked with one argument: (value). 4832 * 4833 * @static 4834 * @memberOf _ 4835 * @since 0.1.0 4836 * @category Collection 4837 * @param {Array|Object} collection The collection to iterate over. 4838 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 4839 * @returns {Object} Returns the composed aggregate object. 4840 * @example 4841 * 4842 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 4843 * // => { '4': [4.2], '6': [6.1, 6.3] } 4844 * 4845 * // The `_.property` iteratee shorthand. 4846 * _.groupBy(['one', 'two', 'three'], 'length'); 4847 * // => { '3': ['one', 'two'], '5': ['three'] } 4848 */var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value);}else{baseAssignValue(result,key,[value]);}});/** 4849 * Checks if `value` is in `collection`. If `collection` is a string, it's 4850 * checked for a substring of `value`, otherwise 4851 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4852 * is used for equality comparisons. If `fromIndex` is negative, it's used as 4853 * the offset from the end of `collection`. 4854 * 4855 * @static 4856 * @memberOf _ 4857 * @since 0.1.0 4858 * @category Collection 4859 * @param {Array|Object|string} collection The collection to inspect. 4860 * @param {*} value The value to search for. 4861 * @param {number} [fromIndex=0] The index to search from. 4862 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 4863 * @returns {boolean} Returns `true` if `value` is found, else `false`. 4864 * @example 4865 * 4866 * _.includes([1, 2, 3], 1); 4867 * // => true 4868 * 4869 * _.includes([1, 2, 3], 1, 2); 4870 * // => false 4871 * 4872 * _.includes({ 'a': 1, 'b': 2 }, 1); 4873 * // => true 4874 * 4875 * _.includes('abcd', 'bc'); 4876 * // => true 4877 */function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection);fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;if(fromIndex<0){fromIndex=nativeMax(length+fromIndex,0);}return isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1;}/** 4878 * Invokes the method at `path` of each element in `collection`, returning 4879 * an array of the results of each invoked method. Any additional arguments 4880 * are provided to each invoked method. If `path` is a function, it's invoked 4881 * for, and `this` bound to, each element in `collection`. 4882 * 4883 * @static 4884 * @memberOf _ 4885 * @since 4.0.0 4886 * @category Collection 4887 * @param {Array|Object} collection The collection to iterate over. 4888 * @param {Array|Function|string} path The path of the method to invoke or 4889 * the function invoked per iteration. 4890 * @param {...*} [args] The arguments to invoke each method with. 4891 * @returns {Array} Returns the array of results. 4892 * @example 4893 * 4894 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 4895 * // => [[1, 5, 7], [1, 2, 3]] 4896 * 4897 * _.invokeMap([123, 456], String.prototype.split, ''); 4898 * // => [['1', '2', '3'], ['4', '5', '6']] 4899 */var invokeMap=baseRest(function(collection,path,args){var index=-1,isFunc=typeof path=='function',result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args);});return result;});/** 4900 * Creates an object composed of keys generated from the results of running 4901 * each element of `collection` thru `iteratee`. The corresponding value of 4902 * each key is the last element responsible for generating the key. The 4903 * iteratee is invoked with one argument: (value). 4904 * 4905 * @static 4906 * @memberOf _ 4907 * @since 4.0.0 4908 * @category Collection 4909 * @param {Array|Object} collection The collection to iterate over. 4910 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 4911 * @returns {Object} Returns the composed aggregate object. 4912 * @example 4913 * 4914 * var array = [ 4915 * { 'dir': 'left', 'code': 97 }, 4916 * { 'dir': 'right', 'code': 100 } 4917 * ]; 4918 * 4919 * _.keyBy(array, function(o) { 4920 * return String.fromCharCode(o.code); 4921 * }); 4922 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 4923 * 4924 * _.keyBy(array, 'dir'); 4925 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 4926 */var keyBy=createAggregator(function(result,value,key){baseAssignValue(result,key,value);});/** 4927 * Creates an array of values by running each element in `collection` thru 4928 * `iteratee`. The iteratee is invoked with three arguments: 4929 * (value, index|key, collection). 4930 * 4931 * Many lodash methods are guarded to work as iteratees for methods like 4932 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 4933 * 4934 * The guarded methods are: 4935 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 4936 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 4937 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 4938 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 4939 * 4940 * @static 4941 * @memberOf _ 4942 * @since 0.1.0 4943 * @category Collection 4944 * @param {Array|Object} collection The collection to iterate over. 4945 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 4946 * @returns {Array} Returns the new mapped array. 4947 * @example 4948 * 4949 * function square(n) { 4950 * return n * n; 4951 * } 4952 * 4953 * _.map([4, 8], square); 4954 * // => [16, 64] 4955 * 4956 * _.map({ 'a': 4, 'b': 8 }, square); 4957 * // => [16, 64] (iteration order is not guaranteed) 4958 * 4959 * var users = [ 4960 * { 'user': 'barney' }, 4961 * { 'user': 'fred' } 4962 * ]; 4963 * 4964 * // The `_.property` iteratee shorthand. 4965 * _.map(users, 'user'); 4966 * // => ['barney', 'fred'] 4967 */function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,getIteratee(iteratee,3));}/** 4968 * This method is like `_.sortBy` except that it allows specifying the sort 4969 * orders of the iteratees to sort by. If `orders` is unspecified, all values 4970 * are sorted in ascending order. Otherwise, specify an order of "desc" for 4971 * descending or "asc" for ascending sort order of corresponding values. 4972 * 4973 * @static 4974 * @memberOf _ 4975 * @since 4.0.0 4976 * @category Collection 4977 * @param {Array|Object} collection The collection to iterate over. 4978 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 4979 * The iteratees to sort by. 4980 * @param {string[]} [orders] The sort orders of `iteratees`. 4981 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 4982 * @returns {Array} Returns the new sorted array. 4983 * @example 4984 * 4985 * var users = [ 4986 * { 'user': 'fred', 'age': 48 }, 4987 * { 'user': 'barney', 'age': 34 }, 4988 * { 'user': 'fred', 'age': 40 }, 4989 * { 'user': 'barney', 'age': 36 } 4990 * ]; 4991 * 4992 * // Sort by `user` in ascending order and by `age` in descending order. 4993 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 4994 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 4995 */function orderBy(collection,iteratees,orders,guard){if(collection==null){return[];}if(!isArray(iteratees)){iteratees=iteratees==null?[]:[iteratees];}orders=guard?undefined:orders;if(!isArray(orders)){orders=orders==null?[]:[orders];}return baseOrderBy(collection,iteratees,orders);}/** 4996 * Creates an array of elements split into two groups, the first of which 4997 * contains elements `predicate` returns truthy for, the second of which 4998 * contains elements `predicate` returns falsey for. The predicate is 4999 * invoked with one argument: (value). 5000 * 5001 * @static 5002 * @memberOf _ 5003 * @since 3.0.0 5004 * @category Collection 5005 * @param {Array|Object} collection The collection to iterate over. 5006 * @param {Function} [predicate=_.identity] The function invoked per iteration. 5007 * @returns {Array} Returns the array of grouped elements. 5008 * @example 5009 * 5010 * var users = [ 5011 * { 'user': 'barney', 'age': 36, 'active': false }, 5012 * { 'user': 'fred', 'age': 40, 'active': true }, 5013 * { 'user': 'pebbles', 'age': 1, 'active': false } 5014 * ]; 5015 * 5016 * _.partition(users, function(o) { return o.active; }); 5017 * // => objects for [['fred'], ['barney', 'pebbles']] 5018 * 5019 * // The `_.matches` iteratee shorthand. 5020 * _.partition(users, { 'age': 1, 'active': false }); 5021 * // => objects for [['pebbles'], ['barney', 'fred']] 5022 * 5023 * // The `_.matchesProperty` iteratee shorthand. 5024 * _.partition(users, ['active', false]); 5025 * // => objects for [['barney', 'pebbles'], ['fred']] 5026 * 5027 * // The `_.property` iteratee shorthand. 5028 * _.partition(users, 'active'); 5029 * // => objects for [['fred'], ['barney', 'pebbles']] 5030 */var partition=createAggregator(function(result,value,key){result[key?0:1].push(value);},function(){return[[],[]];});/** 5031 * Reduces `collection` to a value which is the accumulated result of running 5032 * each element in `collection` thru `iteratee`, where each successive 5033 * invocation is supplied the return value of the previous. If `accumulator` 5034 * is not given, the first element of `collection` is used as the initial 5035 * value. The iteratee is invoked with four arguments: 5036 * (accumulator, value, index|key, collection). 5037 * 5038 * Many lodash methods are guarded to work as iteratees for methods like 5039 * `_.reduce`, `_.reduceRight`, and `_.transform`. 5040 * 5041 * The guarded methods are: 5042 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 5043 * and `sortBy` 5044 * 5045 * @static 5046 * @memberOf _ 5047 * @since 0.1.0 5048 * @category Collection 5049 * @param {Array|Object} collection The collection to iterate over. 5050 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 5051 * @param {*} [accumulator] The initial value. 5052 * @returns {*} Returns the accumulated value. 5053 * @see _.reduceRight 5054 * @example 5055 * 5056 * _.reduce([1, 2], function(sum, n) { 5057 * return sum + n; 5058 * }, 0); 5059 * // => 3 5060 * 5061 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 5062 * (result[value] || (result[value] = [])).push(key); 5063 * return result; 5064 * }, {}); 5065 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 5066 */function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach);}/** 5067 * This method is like `_.reduce` except that it iterates over elements of 5068 * `collection` from right to left. 5069 * 5070 * @static 5071 * @memberOf _ 5072 * @since 0.1.0 5073 * @category Collection 5074 * @param {Array|Object} collection The collection to iterate over. 5075 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 5076 * @param {*} [accumulator] The initial value. 5077 * @returns {*} Returns the accumulated value. 5078 * @see _.reduce 5079 * @example 5080 * 5081 * var array = [[0, 1], [2, 3], [4, 5]]; 5082 * 5083 * _.reduceRight(array, function(flattened, other) { 5084 * return flattened.concat(other); 5085 * }, []); 5086 * // => [4, 5, 2, 3, 0, 1] 5087 */function reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight);}/** 5088 * The opposite of `_.filter`; this method returns the elements of `collection` 5089 * that `predicate` does **not** return truthy for. 5090 * 5091 * @static 5092 * @memberOf _ 5093 * @since 0.1.0 5094 * @category Collection 5095 * @param {Array|Object} collection The collection to iterate over. 5096 * @param {Function} [predicate=_.identity] The function invoked per iteration. 5097 * @returns {Array} Returns the new filtered array. 5098 * @see _.filter 5099 * @example 5100 * 5101 * var users = [ 5102 * { 'user': 'barney', 'age': 36, 'active': false }, 5103 * { 'user': 'fred', 'age': 40, 'active': true } 5104 * ]; 5105 * 5106 * _.reject(users, function(o) { return !o.active; }); 5107 * // => objects for ['fred'] 5108 * 5109 * // The `_.matches` iteratee shorthand. 5110 * _.reject(users, { 'age': 40, 'active': true }); 5111 * // => objects for ['barney'] 5112 * 5113 * // The `_.matchesProperty` iteratee shorthand. 5114 * _.reject(users, ['active', false]); 5115 * // => objects for ['fred'] 5116 * 5117 * // The `_.property` iteratee shorthand. 5118 * _.reject(users, 'active'); 5119 * // => objects for ['barney'] 5120 */function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(getIteratee(predicate,3)));}/** 5121 * Gets a random element from `collection`. 5122 * 5123 * @static 5124 * @memberOf _ 5125 * @since 2.0.0 5126 * @category Collection 5127 * @param {Array|Object} collection The collection to sample. 5128 * @returns {*} Returns the random element. 5129 * @example 5130 * 5131 * _.sample([1, 2, 3, 4]); 5132 * // => 2 5133 */function sample(collection){var func=isArray(collection)?arraySample:baseSample;return func(collection);}/** 5134 * Gets `n` random elements at unique keys from `collection` up to the 5135 * size of `collection`. 5136 * 5137 * @static 5138 * @memberOf _ 5139 * @since 4.0.0 5140 * @category Collection 5141 * @param {Array|Object} collection The collection to sample. 5142 * @param {number} [n=1] The number of elements to sample. 5143 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 5144 * @returns {Array} Returns the random elements. 5145 * @example 5146 * 5147 * _.sampleSize([1, 2, 3], 2); 5148 * // => [3, 1] 5149 * 5150 * _.sampleSize([1, 2, 3], 4); 5151 * // => [2, 3, 1] 5152 */function sampleSize(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n===undefined){n=1;}else{n=toInteger(n);}var func=isArray(collection)?arraySampleSize:baseSampleSize;return func(collection,n);}/** 5153 * Creates an array of shuffled values, using a version of the 5154 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 5155 * 5156 * @static 5157 * @memberOf _ 5158 * @since 0.1.0 5159 * @category Collection 5160 * @param {Array|Object} collection The collection to shuffle. 5161 * @returns {Array} Returns the new shuffled array. 5162 * @example 5163 * 5164 * _.shuffle([1, 2, 3, 4]); 5165 * // => [4, 1, 3, 2] 5166 */function shuffle(collection){var func=isArray(collection)?arrayShuffle:baseShuffle;return func(collection);}/** 5167 * Gets the size of `collection` by returning its length for array-like 5168 * values or the number of own enumerable string keyed properties for objects. 5169 * 5170 * @static 5171 * @memberOf _ 5172 * @since 0.1.0 5173 * @category Collection 5174 * @param {Array|Object|string} collection The collection to inspect. 5175 * @returns {number} Returns the collection size. 5176 * @example 5177 * 5178 * _.size([1, 2, 3]); 5179 * // => 3 5180 * 5181 * _.size({ 'a': 1, 'b': 2 }); 5182 * // => 2 5183 * 5184 * _.size('pebbles'); 5185 * // => 7 5186 */function size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}/** 5187 * Checks if `predicate` returns truthy for **any** element of `collection`. 5188 * Iteration is stopped once `predicate` returns truthy. The predicate is 5189 * invoked with three arguments: (value, index|key, collection). 5190 * 5191 * @static 5192 * @memberOf _ 5193 * @since 0.1.0 5194 * @category Collection 5195 * @param {Array|Object} collection The collection to iterate over. 5196 * @param {Function} [predicate=_.identity] The function invoked per iteration. 5197 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 5198 * @returns {boolean} Returns `true` if any element passes the predicate check, 5199 * else `false`. 5200 * @example 5201 * 5202 * _.some([null, 0, 'yes', false], Boolean); 5203 * // => true 5204 * 5205 * var users = [ 5206 * { 'user': 'barney', 'active': true }, 5207 * { 'user': 'fred', 'active': false } 5208 * ]; 5209 * 5210 * // The `_.matches` iteratee shorthand. 5211 * _.some(users, { 'user': 'barney', 'active': false }); 5212 * // => false 5213 * 5214 * // The `_.matchesProperty` iteratee shorthand. 5215 * _.some(users, ['active', false]); 5216 * // => true 5217 * 5218 * // The `_.property` iteratee shorthand. 5219 * _.some(users, 'active'); 5220 * // => true 5221 */function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,getIteratee(predicate,3));}/** 5222 * Creates an array of elements, sorted in ascending order by the results of 5223 * running each element in a collection thru each iteratee. This method 5224 * performs a stable sort, that is, it preserves the original sort order of 5225 * equal elements. The iteratees are invoked with one argument: (value). 5226 * 5227 * @static 5228 * @memberOf _ 5229 * @since 0.1.0 5230 * @category Collection 5231 * @param {Array|Object} collection The collection to iterate over. 5232 * @param {...(Function|Function[])} [iteratees=[_.identity]] 5233 * The iteratees to sort by. 5234 * @returns {Array} Returns the new sorted array. 5235 * @example 5236 * 5237 * var users = [ 5238 * { 'user': 'fred', 'age': 48 }, 5239 * { 'user': 'barney', 'age': 36 }, 5240 * { 'user': 'fred', 'age': 30 }, 5241 * { 'user': 'barney', 'age': 34 } 5242 * ]; 5243 * 5244 * _.sortBy(users, [function(o) { return o.user; }]); 5245 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 5246 * 5247 * _.sortBy(users, ['user', 'age']); 5248 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 5249 */var sortBy=baseRest(function(collection,iteratees){if(collection==null){return[];}var length=iteratees.length;if(length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])){iteratees=[];}else if(length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])){iteratees=[iteratees[0]];}return baseOrderBy(collection,baseFlatten(iteratees,1),[]);});/*------------------------------------------------------------------------*/ /** 5250 * Gets the timestamp of the number of milliseconds that have elapsed since 5251 * the Unix epoch (1 January 1970 00:00:00 UTC). 5252 * 5253 * @static 5254 * @memberOf _ 5255 * @since 2.4.0 5256 * @category Date 5257 * @returns {number} Returns the timestamp. 5258 * @example 5259 * 5260 * _.defer(function(stamp) { 5261 * console.log(_.now() - stamp); 5262 * }, _.now()); 5263 * // => Logs the number of milliseconds it took for the deferred invocation. 5264 */var now=ctxNow||function(){return root.Date.now();};/*------------------------------------------------------------------------*/ /** 5265 * The opposite of `_.before`; this method creates a function that invokes 5266 * `func` once it's called `n` or more times. 5267 * 5268 * @static 5269 * @memberOf _ 5270 * @since 0.1.0 5271 * @category Function 5272 * @param {number} n The number of calls before `func` is invoked. 5273 * @param {Function} func The function to restrict. 5274 * @returns {Function} Returns the new restricted function. 5275 * @example 5276 * 5277 * var saves = ['profile', 'settings']; 5278 * 5279 * var done = _.after(saves.length, function() { 5280 * console.log('done saving!'); 5281 * }); 5282 * 5283 * _.forEach(saves, function(type) { 5284 * asyncSave({ 'type': type, 'complete': done }); 5285 * }); 5286 * // => Logs 'done saving!' after the two async saves have completed. 5287 */function after(n,func){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n<1){return func.apply(this,arguments);}};}/** 5288 * Creates a function that invokes `func`, with up to `n` arguments, 5289 * ignoring any additional arguments. 5290 * 5291 * @static 5292 * @memberOf _ 5293 * @since 3.0.0 5294 * @category Function 5295 * @param {Function} func The function to cap arguments for. 5296 * @param {number} [n=func.length] The arity cap. 5297 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 5298 * @returns {Function} Returns the new capped function. 5299 * @example 5300 * 5301 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 5302 * // => [6, 8, 10] 5303 */function ary(func,n,guard){n=guard?undefined:n;n=func&&n==null?func.length:n;return createWrap(func,WRAP_ARY_FLAG,undefined,undefined,undefined,undefined,n);}/** 5304 * Creates a function that invokes `func`, with the `this` binding and arguments 5305 * of the created function, while it's called less than `n` times. Subsequent 5306 * calls to the created function return the result of the last `func` invocation. 5307 * 5308 * @static 5309 * @memberOf _ 5310 * @since 3.0.0 5311 * @category Function 5312 * @param {number} n The number of calls at which `func` is no longer invoked. 5313 * @param {Function} func The function to restrict. 5314 * @returns {Function} Returns the new restricted function. 5315 * @example 5316 * 5317 * jQuery(element).on('click', _.before(5, addContactToList)); 5318 * // => Allows adding up to 4 contacts to the list. 5319 */function before(n,func){var result;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n>0){result=func.apply(this,arguments);}if(n<=1){func=undefined;}return result;};}/** 5320 * Creates a function that invokes `func` with the `this` binding of `thisArg` 5321 * and `partials` prepended to the arguments it receives. 5322 * 5323 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 5324 * may be used as a placeholder for partially applied arguments. 5325 * 5326 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 5327 * property of bound functions. 5328 * 5329 * @static 5330 * @memberOf _ 5331 * @since 0.1.0 5332 * @category Function 5333 * @param {Function} func The function to bind. 5334 * @param {*} thisArg The `this` binding of `func`. 5335 * @param {...*} [partials] The arguments to be partially applied. 5336 * @returns {Function} Returns the new bound function. 5337 * @example 5338 * 5339 * function greet(greeting, punctuation) { 5340 * return greeting + ' ' + this.user + punctuation; 5341 * } 5342 * 5343 * var object = { 'user': 'fred' }; 5344 * 5345 * var bound = _.bind(greet, object, 'hi'); 5346 * bound('!'); 5347 * // => 'hi fred!' 5348 * 5349 * // Bound with placeholders. 5350 * var bound = _.bind(greet, object, _, '!'); 5351 * bound('hi'); 5352 * // => 'hi fred!' 5353 */var bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(func,bitmask,thisArg,partials,holders);});/** 5354 * Creates a function that invokes the method at `object[key]` with `partials` 5355 * prepended to the arguments it receives. 5356 * 5357 * This method differs from `_.bind` by allowing bound functions to reference 5358 * methods that may be redefined or don't yet exist. See 5359 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 5360 * for more details. 5361 * 5362 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 5363 * builds, may be used as a placeholder for partially applied arguments. 5364 * 5365 * @static 5366 * @memberOf _ 5367 * @since 0.10.0 5368 * @category Function 5369 * @param {Object} object The object to invoke the method on. 5370 * @param {string} key The key of the method. 5371 * @param {...*} [partials] The arguments to be partially applied. 5372 * @returns {Function} Returns the new bound function. 5373 * @example 5374 * 5375 * var object = { 5376 * 'user': 'fred', 5377 * 'greet': function(greeting, punctuation) { 5378 * return greeting + ' ' + this.user + punctuation; 5379 * } 5380 * }; 5381 * 5382 * var bound = _.bindKey(object, 'greet', 'hi'); 5383 * bound('!'); 5384 * // => 'hi fred!' 5385 * 5386 * object.greet = function(greeting, punctuation) { 5387 * return greeting + 'ya ' + this.user + punctuation; 5388 * }; 5389 * 5390 * bound('!'); 5391 * // => 'hiya fred!' 5392 * 5393 * // Bound with placeholders. 5394 * var bound = _.bindKey(object, 'greet', _, '!'); 5395 * bound('hi'); 5396 * // => 'hiya fred!' 5397 */var bindKey=baseRest(function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(key,bitmask,object,partials,holders);});/** 5398 * Creates a function that accepts arguments of `func` and either invokes 5399 * `func` returning its result, if at least `arity` number of arguments have 5400 * been provided, or returns a function that accepts the remaining `func` 5401 * arguments, and so on. The arity of `func` may be specified if `func.length` 5402 * is not sufficient. 5403 * 5404 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 5405 * may be used as a placeholder for provided arguments. 5406 * 5407 * **Note:** This method doesn't set the "length" property of curried functions. 5408 * 5409 * @static 5410 * @memberOf _ 5411 * @since 2.0.0 5412 * @category Function 5413 * @param {Function} func The function to curry. 5414 * @param {number} [arity=func.length] The arity of `func`. 5415 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 5416 * @returns {Function} Returns the new curried function. 5417 * @example 5418 * 5419 * var abc = function(a, b, c) { 5420 * return [a, b, c]; 5421 * }; 5422 * 5423 * var curried = _.curry(abc); 5424 * 5425 * curried(1)(2)(3); 5426 * // => [1, 2, 3] 5427 * 5428 * curried(1, 2)(3); 5429 * // => [1, 2, 3] 5430 * 5431 * curried(1, 2, 3); 5432 * // => [1, 2, 3] 5433 * 5434 * // Curried with placeholders. 5435 * curried(1)(_, 3)(2); 5436 * // => [1, 2, 3] 5437 */function curry(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,WRAP_CURRY_FLAG,undefined,undefined,undefined,undefined,undefined,arity);result.placeholder=curry.placeholder;return result;}/** 5438 * This method is like `_.curry` except that arguments are applied to `func` 5439 * in the manner of `_.partialRight` instead of `_.partial`. 5440 * 5441 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 5442 * builds, may be used as a placeholder for provided arguments. 5443 * 5444 * **Note:** This method doesn't set the "length" property of curried functions. 5445 * 5446 * @static 5447 * @memberOf _ 5448 * @since 3.0.0 5449 * @category Function 5450 * @param {Function} func The function to curry. 5451 * @param {number} [arity=func.length] The arity of `func`. 5452 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 5453 * @returns {Function} Returns the new curried function. 5454 * @example 5455 * 5456 * var abc = function(a, b, c) { 5457 * return [a, b, c]; 5458 * }; 5459 * 5460 * var curried = _.curryRight(abc); 5461 * 5462 * curried(3)(2)(1); 5463 * // => [1, 2, 3] 5464 * 5465 * curried(2, 3)(1); 5466 * // => [1, 2, 3] 5467 * 5468 * curried(1, 2, 3); 5469 * // => [1, 2, 3] 5470 * 5471 * // Curried with placeholders. 5472 * curried(3)(1, _)(2); 5473 * // => [1, 2, 3] 5474 */function curryRight(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,WRAP_CURRY_RIGHT_FLAG,undefined,undefined,undefined,undefined,undefined,arity);result.placeholder=curryRight.placeholder;return result;}/** 5475 * Creates a debounced function that delays invoking `func` until after `wait` 5476 * milliseconds have elapsed since the last time the debounced function was 5477 * invoked. The debounced function comes with a `cancel` method to cancel 5478 * delayed `func` invocations and a `flush` method to immediately invoke them. 5479 * Provide `options` to indicate whether `func` should be invoked on the 5480 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 5481 * with the last arguments provided to the debounced function. Subsequent 5482 * calls to the debounced function return the result of the last `func` 5483 * invocation. 5484 * 5485 * **Note:** If `leading` and `trailing` options are `true`, `func` is 5486 * invoked on the trailing edge of the timeout only if the debounced function 5487 * is invoked more than once during the `wait` timeout. 5488 * 5489 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 5490 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 5491 * 5492 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 5493 * for details over the differences between `_.debounce` and `_.throttle`. 5494 * 5495 * @static 5496 * @memberOf _ 5497 * @since 0.1.0 5498 * @category Function 5499 * @param {Function} func The function to debounce. 5500 * @param {number} [wait=0] The number of milliseconds to delay. 5501 * @param {Object} [options={}] The options object. 5502 * @param {boolean} [options.leading=false] 5503 * Specify invoking on the leading edge of the timeout. 5504 * @param {number} [options.maxWait] 5505 * The maximum time `func` is allowed to be delayed before it's invoked. 5506 * @param {boolean} [options.trailing=true] 5507 * Specify invoking on the trailing edge of the timeout. 5508 * @returns {Function} Returns the new debounced function. 5509 * @example 5510 * 5511 * // Avoid costly calculations while the window size is in flux. 5512 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 5513 * 5514 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 5515 * jQuery(element).on('click', _.debounce(sendMail, 300, { 5516 * 'leading': true, 5517 * 'trailing': false 5518 * })); 5519 * 5520 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 5521 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 5522 * var source = new EventSource('/stream'); 5523 * jQuery(source).on('message', debounced); 5524 * 5525 * // Cancel the trailing debounced invocation. 5526 * jQuery(window).on('popstate', debounced.cancel); 5527 */function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=false,maxing=false,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}wait=toNumber(wait)||0;if(isObject(options)){leading=!!options.leading;maxing='maxWait'in options;maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait;trailing='trailing'in options?!!options.trailing:trailing;}function invokeFunc(time){var args=lastArgs,thisArg=lastThis;lastArgs=lastThis=undefined;lastInvokeTime=time;result=func.apply(thisArg,args);return result;}function leadingEdge(time){// Reset any `maxWait` timer. 5528lastInvokeTime=time;// Start the timer for the trailing edge. 5529timerId=setTimeout(timerExpired,wait);// Invoke the leading edge. 5530return leading?invokeFunc(time):result;}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting;}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;// Either this is the first call, activity has stopped and we're at the 5531// trailing edge, the system time has gone backwards and we're treating 5532// it as the trailing edge, or we've hit the `maxWait` limit. 5533return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait;}function timerExpired(){var time=now();if(shouldInvoke(time)){return trailingEdge(time);}// Restart the timer. 5534timerId=setTimeout(timerExpired,remainingWait(time));}function trailingEdge(time){timerId=undefined;// Only invoke if we have `lastArgs` which means `func` has been 5535// debounced at least once. 5536if(trailing&&lastArgs){return invokeFunc(time);}lastArgs=lastThis=undefined;return result;}function cancel(){if(timerId!==undefined){clearTimeout(timerId);}lastInvokeTime=0;lastArgs=lastCallTime=lastThis=timerId=undefined;}function flush(){return timerId===undefined?result:trailingEdge(now());}function debounced(){var time=now(),isInvoking=shouldInvoke(time);lastArgs=arguments;lastThis=this;lastCallTime=time;if(isInvoking){if(timerId===undefined){return leadingEdge(lastCallTime);}if(maxing){// Handle invocations in a tight loop. 5537clearTimeout(timerId);timerId=setTimeout(timerExpired,wait);return invokeFunc(lastCallTime);}}if(timerId===undefined){timerId=setTimeout(timerExpired,wait);}return result;}debounced.cancel=cancel;debounced.flush=flush;return debounced;}/** 5538 * Defers invoking the `func` until the current call stack has cleared. Any 5539 * additional arguments are provided to `func` when it's invoked. 5540 * 5541 * @static 5542 * @memberOf _ 5543 * @since 0.1.0 5544 * @category Function 5545 * @param {Function} func The function to defer. 5546 * @param {...*} [args] The arguments to invoke `func` with. 5547 * @returns {number} Returns the timer id. 5548 * @example 5549 * 5550 * _.defer(function(text) { 5551 * console.log(text); 5552 * }, 'deferred'); 5553 * // => Logs 'deferred' after one millisecond. 5554 */var defer=baseRest(function(func,args){return baseDelay(func,1,args);});/** 5555 * Invokes `func` after `wait` milliseconds. Any additional arguments are 5556 * provided to `func` when it's invoked. 5557 * 5558 * @static 5559 * @memberOf _ 5560 * @since 0.1.0 5561 * @category Function 5562 * @param {Function} func The function to delay. 5563 * @param {number} wait The number of milliseconds to delay invocation. 5564 * @param {...*} [args] The arguments to invoke `func` with. 5565 * @returns {number} Returns the timer id. 5566 * @example 5567 * 5568 * _.delay(function(text) { 5569 * console.log(text); 5570 * }, 1000, 'later'); 5571 * // => Logs 'later' after one second. 5572 */var delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args);});/** 5573 * Creates a function that invokes `func` with arguments reversed. 5574 * 5575 * @static 5576 * @memberOf _ 5577 * @since 4.0.0 5578 * @category Function 5579 * @param {Function} func The function to flip arguments for. 5580 * @returns {Function} Returns the new flipped function. 5581 * @example 5582 * 5583 * var flipped = _.flip(function() { 5584 * return _.toArray(arguments); 5585 * }); 5586 * 5587 * flipped('a', 'b', 'c', 'd'); 5588 * // => ['d', 'c', 'b', 'a'] 5589 */function flip(func){return createWrap(func,WRAP_FLIP_FLAG);}/** 5590 * Creates a function that memoizes the result of `func`. If `resolver` is 5591 * provided, it determines the cache key for storing the result based on the 5592 * arguments provided to the memoized function. By default, the first argument 5593 * provided to the memoized function is used as the map cache key. The `func` 5594 * is invoked with the `this` binding of the memoized function. 5595 * 5596 * **Note:** The cache is exposed as the `cache` property on the memoized 5597 * function. Its creation may be customized by replacing the `_.memoize.Cache` 5598 * constructor with one whose instances implement the 5599 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 5600 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 5601 * 5602 * @static 5603 * @memberOf _ 5604 * @since 0.1.0 5605 * @category Function 5606 * @param {Function} func The function to have its output memoized. 5607 * @param {Function} [resolver] The function to resolve the cache key. 5608 * @returns {Function} Returns the new memoized function. 5609 * @example 5610 * 5611 * var object = { 'a': 1, 'b': 2 }; 5612 * var other = { 'c': 3, 'd': 4 }; 5613 * 5614 * var values = _.memoize(_.values); 5615 * values(object); 5616 * // => [1, 2] 5617 * 5618 * values(other); 5619 * // => [3, 4] 5620 * 5621 * object.a = 2; 5622 * values(object); 5623 * // => [1, 2] 5624 * 5625 * // Modify the result cache. 5626 * values.cache.set(object, ['a', 'b']); 5627 * values(object); 5628 * // => ['a', 'b'] 5629 * 5630 * // Replace `_.memoize.Cache`. 5631 * _.memoize.Cache = WeakMap; 5632 */function memoize(func,resolver){if(typeof func!='function'||resolver!=null&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function memoized(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}// Expose `MapCache`. 5633memoize.Cache=MapCache;/** 5634 * Creates a function that negates the result of the predicate `func`. The 5635 * `func` predicate is invoked with the `this` binding and arguments of the 5636 * created function. 5637 * 5638 * @static 5639 * @memberOf _ 5640 * @since 3.0.0 5641 * @category Function 5642 * @param {Function} predicate The predicate to negate. 5643 * @returns {Function} Returns the new negated function. 5644 * @example 5645 * 5646 * function isEven(n) { 5647 * return n % 2 == 0; 5648 * } 5649 * 5650 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 5651 * // => [1, 3, 5] 5652 */function negate(predicate){if(typeof predicate!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2]);}return!predicate.apply(this,args);};}/** 5653 * Creates a function that is restricted to invoking `func` once. Repeat calls 5654 * to the function return the value of the first invocation. The `func` is 5655 * invoked with the `this` binding and arguments of the created function. 5656 * 5657 * @static 5658 * @memberOf _ 5659 * @since 0.1.0 5660 * @category Function 5661 * @param {Function} func The function to restrict. 5662 * @returns {Function} Returns the new restricted function. 5663 * @example 5664 * 5665 * var initialize = _.once(createApplication); 5666 * initialize(); 5667 * initialize(); 5668 * // => `createApplication` is invoked once 5669 */function once(func){return before(2,func);}/** 5670 * Creates a function that invokes `func` with its arguments transformed. 5671 * 5672 * @static 5673 * @since 4.0.0 5674 * @memberOf _ 5675 * @category Function 5676 * @param {Function} func The function to wrap. 5677 * @param {...(Function|Function[])} [transforms=[_.identity]] 5678 * The argument transforms. 5679 * @returns {Function} Returns the new function. 5680 * @example 5681 * 5682 * function doubled(n) { 5683 * return n * 2; 5684 * } 5685 * 5686 * function square(n) { 5687 * return n * n; 5688 * } 5689 * 5690 * var func = _.overArgs(function(x, y) { 5691 * return [x, y]; 5692 * }, [square, doubled]); 5693 * 5694 * func(9, 3); 5695 * // => [81, 6] 5696 * 5697 * func(10, 5); 5698 * // => [100, 10] 5699 */var overArgs=castRest(function(func,transforms){transforms=transforms.length==1&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()));var funcsLength=transforms.length;return baseRest(function(args){var index=-1,length=nativeMin(args.length,funcsLength);while(++index<length){args[index]=transforms[index].call(this,args[index]);}return apply(func,this,args);});});/** 5700 * Creates a function that invokes `func` with `partials` prepended to the 5701 * arguments it receives. This method is like `_.bind` except it does **not** 5702 * alter the `this` binding. 5703 * 5704 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 5705 * builds, may be used as a placeholder for partially applied arguments. 5706 * 5707 * **Note:** This method doesn't set the "length" property of partially 5708 * applied functions. 5709 * 5710 * @static 5711 * @memberOf _ 5712 * @since 0.2.0 5713 * @category Function 5714 * @param {Function} func The function to partially apply arguments to. 5715 * @param {...*} [partials] The arguments to be partially applied. 5716 * @returns {Function} Returns the new partially applied function. 5717 * @example 5718 * 5719 * function greet(greeting, name) { 5720 * return greeting + ' ' + name; 5721 * } 5722 * 5723 * var sayHelloTo = _.partial(greet, 'hello'); 5724 * sayHelloTo('fred'); 5725 * // => 'hello fred' 5726 * 5727 * // Partially applied with placeholders. 5728 * var greetFred = _.partial(greet, _, 'fred'); 5729 * greetFred('hi'); 5730 * // => 'hi fred' 5731 */var partial=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partial));return createWrap(func,WRAP_PARTIAL_FLAG,undefined,partials,holders);});/** 5732 * This method is like `_.partial` except that partially applied arguments 5733 * are appended to the arguments it receives. 5734 * 5735 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 5736 * builds, may be used as a placeholder for partially applied arguments. 5737 * 5738 * **Note:** This method doesn't set the "length" property of partially 5739 * applied functions. 5740 * 5741 * @static 5742 * @memberOf _ 5743 * @since 1.0.0 5744 * @category Function 5745 * @param {Function} func The function to partially apply arguments to. 5746 * @param {...*} [partials] The arguments to be partially applied. 5747 * @returns {Function} Returns the new partially applied function. 5748 * @example 5749 * 5750 * function greet(greeting, name) { 5751 * return greeting + ' ' + name; 5752 * } 5753 * 5754 * var greetFred = _.partialRight(greet, 'fred'); 5755 * greetFred('hi'); 5756 * // => 'hi fred' 5757 * 5758 * // Partially applied with placeholders. 5759 * var sayHelloTo = _.partialRight(greet, 'hello', _); 5760 * sayHelloTo('fred'); 5761 * // => 'hello fred' 5762 */var partialRight=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partialRight));return createWrap(func,WRAP_PARTIAL_RIGHT_FLAG,undefined,partials,holders);});/** 5763 * Creates a function that invokes `func` with arguments arranged according 5764 * to the specified `indexes` where the argument value at the first index is 5765 * provided as the first argument, the argument value at the second index is 5766 * provided as the second argument, and so on. 5767 * 5768 * @static 5769 * @memberOf _ 5770 * @since 3.0.0 5771 * @category Function 5772 * @param {Function} func The function to rearrange arguments for. 5773 * @param {...(number|number[])} indexes The arranged argument indexes. 5774 * @returns {Function} Returns the new function. 5775 * @example 5776 * 5777 * var rearged = _.rearg(function(a, b, c) { 5778 * return [a, b, c]; 5779 * }, [2, 0, 1]); 5780 * 5781 * rearged('b', 'c', 'a') 5782 * // => ['a', 'b', 'c'] 5783 */var rearg=flatRest(function(func,indexes){return createWrap(func,WRAP_REARG_FLAG,undefined,undefined,undefined,indexes);});/** 5784 * Creates a function that invokes `func` with the `this` binding of the 5785 * created function and arguments from `start` and beyond provided as 5786 * an array. 5787 * 5788 * **Note:** This method is based on the 5789 * [rest parameter](https://mdn.io/rest_parameters). 5790 * 5791 * @static 5792 * @memberOf _ 5793 * @since 4.0.0 5794 * @category Function 5795 * @param {Function} func The function to apply a rest parameter to. 5796 * @param {number} [start=func.length-1] The start position of the rest parameter. 5797 * @returns {Function} Returns the new function. 5798 * @example 5799 * 5800 * var say = _.rest(function(what, names) { 5801 * return what + ' ' + _.initial(names).join(', ') + 5802 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 5803 * }); 5804 * 5805 * say('hello', 'fred', 'barney', 'pebbles'); 5806 * // => 'hello fred, barney, & pebbles' 5807 */function rest(func,start){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start===undefined?start:toInteger(start);return baseRest(func,start);}/** 5808 * Creates a function that invokes `func` with the `this` binding of the 5809 * create function and an array of arguments much like 5810 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 5811 * 5812 * **Note:** This method is based on the 5813 * [spread operator](https://mdn.io/spread_operator). 5814 * 5815 * @static 5816 * @memberOf _ 5817 * @since 3.2.0 5818 * @category Function 5819 * @param {Function} func The function to spread arguments over. 5820 * @param {number} [start=0] The start position of the spread. 5821 * @returns {Function} Returns the new function. 5822 * @example 5823 * 5824 * var say = _.spread(function(who, what) { 5825 * return who + ' says ' + what; 5826 * }); 5827 * 5828 * say(['fred', 'hello']); 5829 * // => 'fred says hello' 5830 * 5831 * var numbers = Promise.all([ 5832 * Promise.resolve(40), 5833 * Promise.resolve(36) 5834 * ]); 5835 * 5836 * numbers.then(_.spread(function(x, y) { 5837 * return x + y; 5838 * })); 5839 * // => a Promise of 76 5840 */function spread(func,start){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start==null?0:nativeMax(toInteger(start),0);return baseRest(function(args){var array=args[start],otherArgs=castSlice(args,0,start);if(array){arrayPush(otherArgs,array);}return apply(func,this,otherArgs);});}/** 5841 * Creates a throttled function that only invokes `func` at most once per 5842 * every `wait` milliseconds. The throttled function comes with a `cancel` 5843 * method to cancel delayed `func` invocations and a `flush` method to 5844 * immediately invoke them. Provide `options` to indicate whether `func` 5845 * should be invoked on the leading and/or trailing edge of the `wait` 5846 * timeout. The `func` is invoked with the last arguments provided to the 5847 * throttled function. Subsequent calls to the throttled function return the 5848 * result of the last `func` invocation. 5849 * 5850 * **Note:** If `leading` and `trailing` options are `true`, `func` is 5851 * invoked on the trailing edge of the timeout only if the throttled function 5852 * is invoked more than once during the `wait` timeout. 5853 * 5854 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 5855 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 5856 * 5857 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 5858 * for details over the differences between `_.throttle` and `_.debounce`. 5859 * 5860 * @static 5861 * @memberOf _ 5862 * @since 0.1.0 5863 * @category Function 5864 * @param {Function} func The function to throttle. 5865 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 5866 * @param {Object} [options={}] The options object. 5867 * @param {boolean} [options.leading=true] 5868 * Specify invoking on the leading edge of the timeout. 5869 * @param {boolean} [options.trailing=true] 5870 * Specify invoking on the trailing edge of the timeout. 5871 * @returns {Function} Returns the new throttled function. 5872 * @example 5873 * 5874 * // Avoid excessively updating the position while scrolling. 5875 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 5876 * 5877 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 5878 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 5879 * jQuery(element).on('click', throttled); 5880 * 5881 * // Cancel the trailing throttled invocation. 5882 * jQuery(window).on('popstate', throttled.cancel); 5883 */function throttle(func,wait,options){var leading=true,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(isObject(options)){leading='leading'in options?!!options.leading:leading;trailing='trailing'in options?!!options.trailing:trailing;}return debounce(func,wait,{'leading':leading,'maxWait':wait,'trailing':trailing});}/** 5884 * Creates a function that accepts up to one argument, ignoring any 5885 * additional arguments. 5886 * 5887 * @static 5888 * @memberOf _ 5889 * @since 4.0.0 5890 * @category Function 5891 * @param {Function} func The function to cap arguments for. 5892 * @returns {Function} Returns the new capped function. 5893 * @example 5894 * 5895 * _.map(['6', '8', '10'], _.unary(parseInt)); 5896 * // => [6, 8, 10] 5897 */function unary(func){return ary(func,1);}/** 5898 * Creates a function that provides `value` to `wrapper` as its first 5899 * argument. Any additional arguments provided to the function are appended 5900 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 5901 * binding of the created function. 5902 * 5903 * @static 5904 * @memberOf _ 5905 * @since 0.1.0 5906 * @category Function 5907 * @param {*} value The value to wrap. 5908 * @param {Function} [wrapper=identity] The wrapper function. 5909 * @returns {Function} Returns the new function. 5910 * @example 5911 * 5912 * var p = _.wrap(_.escape, function(func, text) { 5913 * return '<p>' + func(text) + '</p>'; 5914 * }); 5915 * 5916 * p('fred, barney, & pebbles'); 5917 * // => '<p>fred, barney, & pebbles</p>' 5918 */function wrap(value,wrapper){return partial(castFunction(wrapper),value);}/*------------------------------------------------------------------------*/ /** 5919 * Casts `value` as an array if it's not one. 5920 * 5921 * @static 5922 * @memberOf _ 5923 * @since 4.4.0 5924 * @category Lang 5925 * @param {*} value The value to inspect. 5926 * @returns {Array} Returns the cast array. 5927 * @example 5928 * 5929 * _.castArray(1); 5930 * // => [1] 5931 * 5932 * _.castArray({ 'a': 1 }); 5933 * // => [{ 'a': 1 }] 5934 * 5935 * _.castArray('abc'); 5936 * // => ['abc'] 5937 * 5938 * _.castArray(null); 5939 * // => [null] 5940 * 5941 * _.castArray(undefined); 5942 * // => [undefined] 5943 * 5944 * _.castArray(); 5945 * // => [] 5946 * 5947 * var array = [1, 2, 3]; 5948 * console.log(_.castArray(array) === array); 5949 * // => true 5950 */function castArray(){if(!arguments.length){return[];}var value=arguments[0];return isArray(value)?value:[value];}/** 5951 * Creates a shallow clone of `value`. 5952 * 5953 * **Note:** This method is loosely based on the 5954 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 5955 * and supports cloning arrays, array buffers, booleans, date objects, maps, 5956 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 5957 * arrays. The own enumerable properties of `arguments` objects are cloned 5958 * as plain objects. An empty object is returned for uncloneable values such 5959 * as error objects, functions, DOM nodes, and WeakMaps. 5960 * 5961 * @static 5962 * @memberOf _ 5963 * @since 0.1.0 5964 * @category Lang 5965 * @param {*} value The value to clone. 5966 * @returns {*} Returns the cloned value. 5967 * @see _.cloneDeep 5968 * @example 5969 * 5970 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 5971 * 5972 * var shallow = _.clone(objects); 5973 * console.log(shallow[0] === objects[0]); 5974 * // => true 5975 */function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG);}/** 5976 * This method is like `_.clone` except that it accepts `customizer` which 5977 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 5978 * cloning is handled by the method instead. The `customizer` is invoked with 5979 * up to four arguments; (value [, index|key, object, stack]). 5980 * 5981 * @static 5982 * @memberOf _ 5983 * @since 4.0.0 5984 * @category Lang 5985 * @param {*} value The value to clone. 5986 * @param {Function} [customizer] The function to customize cloning. 5987 * @returns {*} Returns the cloned value. 5988 * @see _.cloneDeepWith 5989 * @example 5990 * 5991 * function customizer(value) { 5992 * if (_.isElement(value)) { 5993 * return value.cloneNode(false); 5994 * } 5995 * } 5996 * 5997 * var el = _.cloneWith(document.body, customizer); 5998 * 5999 * console.log(el === document.body); 6000 * // => false 6001 * console.log(el.nodeName); 6002 * // => 'BODY' 6003 * console.log(el.childNodes.length); 6004 * // => 0 6005 */function cloneWith(value,customizer){customizer=typeof customizer=='function'?customizer:undefined;return baseClone(value,CLONE_SYMBOLS_FLAG,customizer);}/** 6006 * This method is like `_.clone` except that it recursively clones `value`. 6007 * 6008 * @static 6009 * @memberOf _ 6010 * @since 1.0.0 6011 * @category Lang 6012 * @param {*} value The value to recursively clone. 6013 * @returns {*} Returns the deep cloned value. 6014 * @see _.clone 6015 * @example 6016 * 6017 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 6018 * 6019 * var deep = _.cloneDeep(objects); 6020 * console.log(deep[0] === objects[0]); 6021 * // => false 6022 */function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG);}/** 6023 * This method is like `_.cloneWith` except that it recursively clones `value`. 6024 * 6025 * @static 6026 * @memberOf _ 6027 * @since 4.0.0 6028 * @category Lang 6029 * @param {*} value The value to recursively clone. 6030 * @param {Function} [customizer] The function to customize cloning. 6031 * @returns {*} Returns the deep cloned value. 6032 * @see _.cloneWith 6033 * @example 6034 * 6035 * function customizer(value) { 6036 * if (_.isElement(value)) { 6037 * return value.cloneNode(true); 6038 * } 6039 * } 6040 * 6041 * var el = _.cloneDeepWith(document.body, customizer); 6042 * 6043 * console.log(el === document.body); 6044 * // => false 6045 * console.log(el.nodeName); 6046 * // => 'BODY' 6047 * console.log(el.childNodes.length); 6048 * // => 20 6049 */function cloneDeepWith(value,customizer){customizer=typeof customizer=='function'?customizer:undefined;return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG,customizer);}/** 6050 * Checks if `object` conforms to `source` by invoking the predicate 6051 * properties of `source` with the corresponding property values of `object`. 6052 * 6053 * **Note:** This method is equivalent to `_.conforms` when `source` is 6054 * partially applied. 6055 * 6056 * @static 6057 * @memberOf _ 6058 * @since 4.14.0 6059 * @category Lang 6060 * @param {Object} object The object to inspect. 6061 * @param {Object} source The object of property predicates to conform to. 6062 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 6063 * @example 6064 * 6065 * var object = { 'a': 1, 'b': 2 }; 6066 * 6067 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 6068 * // => true 6069 * 6070 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 6071 * // => false 6072 */function conformsTo(object,source){return source==null||baseConformsTo(object,source,keys(source));}/** 6073 * Performs a 6074 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 6075 * comparison between two values to determine if they are equivalent. 6076 * 6077 * @static 6078 * @memberOf _ 6079 * @since 4.0.0 6080 * @category Lang 6081 * @param {*} value The value to compare. 6082 * @param {*} other The other value to compare. 6083 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 6084 * @example 6085 * 6086 * var object = { 'a': 1 }; 6087 * var other = { 'a': 1 }; 6088 * 6089 * _.eq(object, object); 6090 * // => true 6091 * 6092 * _.eq(object, other); 6093 * // => false 6094 * 6095 * _.eq('a', 'a'); 6096 * // => true 6097 * 6098 * _.eq('a', Object('a')); 6099 * // => false 6100 * 6101 * _.eq(NaN, NaN); 6102 * // => true 6103 */function eq(value,other){return value===other||value!==value&&other!==other;}/** 6104 * Checks if `value` is greater than `other`. 6105 * 6106 * @static 6107 * @memberOf _ 6108 * @since 3.9.0 6109 * @category Lang 6110 * @param {*} value The value to compare. 6111 * @param {*} other The other value to compare. 6112 * @returns {boolean} Returns `true` if `value` is greater than `other`, 6113 * else `false`. 6114 * @see _.lt 6115 * @example 6116 * 6117 * _.gt(3, 1); 6118 * // => true 6119 * 6120 * _.gt(3, 3); 6121 * // => false 6122 * 6123 * _.gt(1, 3); 6124 * // => false 6125 */var gt=createRelationalOperation(baseGt);/** 6126 * Checks if `value` is greater than or equal to `other`. 6127 * 6128 * @static 6129 * @memberOf _ 6130 * @since 3.9.0 6131 * @category Lang 6132 * @param {*} value The value to compare. 6133 * @param {*} other The other value to compare. 6134 * @returns {boolean} Returns `true` if `value` is greater than or equal to 6135 * `other`, else `false`. 6136 * @see _.lte 6137 * @example 6138 * 6139 * _.gte(3, 1); 6140 * // => true 6141 * 6142 * _.gte(3, 3); 6143 * // => true 6144 * 6145 * _.gte(1, 3); 6146 * // => false 6147 */var gte=createRelationalOperation(function(value,other){return value>=other;});/** 6148 * Checks if `value` is likely an `arguments` object. 6149 * 6150 * @static 6151 * @memberOf _ 6152 * @since 0.1.0 6153 * @category Lang 6154 * @param {*} value The value to check. 6155 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 6156 * else `false`. 6157 * @example 6158 * 6159 * _.isArguments(function() { return arguments; }()); 6160 * // => true 6161 * 6162 * _.isArguments([1, 2, 3]); 6163 * // => false 6164 */var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};/** 6165 * Checks if `value` is classified as an `Array` object. 6166 * 6167 * @static 6168 * @memberOf _ 6169 * @since 0.1.0 6170 * @category Lang 6171 * @param {*} value The value to check. 6172 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 6173 * @example 6174 * 6175 * _.isArray([1, 2, 3]); 6176 * // => true 6177 * 6178 * _.isArray(document.body.children); 6179 * // => false 6180 * 6181 * _.isArray('abc'); 6182 * // => false 6183 * 6184 * _.isArray(_.noop); 6185 * // => false 6186 */var isArray=Array.isArray;/** 6187 * Checks if `value` is classified as an `ArrayBuffer` object. 6188 * 6189 * @static 6190 * @memberOf _ 6191 * @since 4.3.0 6192 * @category Lang 6193 * @param {*} value The value to check. 6194 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 6195 * @example 6196 * 6197 * _.isArrayBuffer(new ArrayBuffer(2)); 6198 * // => true 6199 * 6200 * _.isArrayBuffer(new Array(2)); 6201 * // => false 6202 */var isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):baseIsArrayBuffer;/** 6203 * Checks if `value` is array-like. A value is considered array-like if it's 6204 * not a function and has a `value.length` that's an integer greater than or 6205 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 6206 * 6207 * @static 6208 * @memberOf _ 6209 * @since 4.0.0 6210 * @category Lang 6211 * @param {*} value The value to check. 6212 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 6213 * @example 6214 * 6215 * _.isArrayLike([1, 2, 3]); 6216 * // => true 6217 * 6218 * _.isArrayLike(document.body.children); 6219 * // => true 6220 * 6221 * _.isArrayLike('abc'); 6222 * // => true 6223 * 6224 * _.isArrayLike(_.noop); 6225 * // => false 6226 */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}/** 6227 * This method is like `_.isArrayLike` except that it also checks if `value` 6228 * is an object. 6229 * 6230 * @static 6231 * @memberOf _ 6232 * @since 4.0.0 6233 * @category Lang 6234 * @param {*} value The value to check. 6235 * @returns {boolean} Returns `true` if `value` is an array-like object, 6236 * else `false`. 6237 * @example 6238 * 6239 * _.isArrayLikeObject([1, 2, 3]); 6240 * // => true 6241 * 6242 * _.isArrayLikeObject(document.body.children); 6243 * // => true 6244 * 6245 * _.isArrayLikeObject('abc'); 6246 * // => false 6247 * 6248 * _.isArrayLikeObject(_.noop); 6249 * // => false 6250 */function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}/** 6251 * Checks if `value` is classified as a boolean primitive or object. 6252 * 6253 * @static 6254 * @memberOf _ 6255 * @since 0.1.0 6256 * @category Lang 6257 * @param {*} value The value to check. 6258 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 6259 * @example 6260 * 6261 * _.isBoolean(false); 6262 * // => true 6263 * 6264 * _.isBoolean(null); 6265 * // => false 6266 */function isBoolean(value){return value===true||value===false||isObjectLike(value)&&baseGetTag(value)==boolTag;}/** 6267 * Checks if `value` is a buffer. 6268 * 6269 * @static 6270 * @memberOf _ 6271 * @since 4.3.0 6272 * @category Lang 6273 * @param {*} value The value to check. 6274 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 6275 * @example 6276 * 6277 * _.isBuffer(new Buffer(2)); 6278 * // => true 6279 * 6280 * _.isBuffer(new Uint8Array(2)); 6281 * // => false 6282 */var isBuffer=nativeIsBuffer||stubFalse;/** 6283 * Checks if `value` is classified as a `Date` object. 6284 * 6285 * @static 6286 * @memberOf _ 6287 * @since 0.1.0 6288 * @category Lang 6289 * @param {*} value The value to check. 6290 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 6291 * @example 6292 * 6293 * _.isDate(new Date); 6294 * // => true 6295 * 6296 * _.isDate('Mon April 23 2012'); 6297 * // => false 6298 */var isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate;/** 6299 * Checks if `value` is likely a DOM element. 6300 * 6301 * @static 6302 * @memberOf _ 6303 * @since 0.1.0 6304 * @category Lang 6305 * @param {*} value The value to check. 6306 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 6307 * @example 6308 * 6309 * _.isElement(document.body); 6310 * // => true 6311 * 6312 * _.isElement('<body>'); 6313 * // => false 6314 */function isElement(value){return isObjectLike(value)&&value.nodeType===1&&!isPlainObject(value);}/** 6315 * Checks if `value` is an empty object, collection, map, or set. 6316 * 6317 * Objects are considered empty if they have no own enumerable string keyed 6318 * properties. 6319 * 6320 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 6321 * jQuery-like collections are considered empty if they have a `length` of `0`. 6322 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 6323 * 6324 * @static 6325 * @memberOf _ 6326 * @since 0.1.0 6327 * @category Lang 6328 * @param {*} value The value to check. 6329 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 6330 * @example 6331 * 6332 * _.isEmpty(null); 6333 * // => true 6334 * 6335 * _.isEmpty(true); 6336 * // => true 6337 * 6338 * _.isEmpty(1); 6339 * // => true 6340 * 6341 * _.isEmpty([1, 2, 3]); 6342 * // => false 6343 * 6344 * _.isEmpty({ 'a': 1 }); 6345 * // => false 6346 */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value=='string'||typeof value.splice=='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return!value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size;}if(isPrototype(value)){return!baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}/** 6347 * Performs a deep comparison between two values to determine if they are 6348 * equivalent. 6349 * 6350 * **Note:** This method supports comparing arrays, array buffers, booleans, 6351 * date objects, error objects, maps, numbers, `Object` objects, regexes, 6352 * sets, strings, symbols, and typed arrays. `Object` objects are compared 6353 * by their own, not inherited, enumerable properties. Functions and DOM 6354 * nodes are compared by strict equality, i.e. `===`. 6355 * 6356 * @static 6357 * @memberOf _ 6358 * @since 0.1.0 6359 * @category Lang 6360 * @param {*} value The value to compare. 6361 * @param {*} other The other value to compare. 6362 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 6363 * @example 6364 * 6365 * var object = { 'a': 1 }; 6366 * var other = { 'a': 1 }; 6367 * 6368 * _.isEqual(object, other); 6369 * // => true 6370 * 6371 * object === other; 6372 * // => false 6373 */function isEqual(value,other){return baseIsEqual(value,other);}/** 6374 * This method is like `_.isEqual` except that it accepts `customizer` which 6375 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 6376 * are handled by the method instead. The `customizer` is invoked with up to 6377 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 6378 * 6379 * @static 6380 * @memberOf _ 6381 * @since 4.0.0 6382 * @category Lang 6383 * @param {*} value The value to compare. 6384 * @param {*} other The other value to compare. 6385 * @param {Function} [customizer] The function to customize comparisons. 6386 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 6387 * @example 6388 * 6389 * function isGreeting(value) { 6390 * return /^h(?:i|ello)$/.test(value); 6391 * } 6392 * 6393 * function customizer(objValue, othValue) { 6394 * if (isGreeting(objValue) && isGreeting(othValue)) { 6395 * return true; 6396 * } 6397 * } 6398 * 6399 * var array = ['hello', 'goodbye']; 6400 * var other = ['hi', 'goodbye']; 6401 * 6402 * _.isEqualWith(array, other, customizer); 6403 * // => true 6404 */function isEqualWith(value,other,customizer){customizer=typeof customizer=='function'?customizer:undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,undefined,customizer):!!result;}/** 6405 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 6406 * `SyntaxError`, `TypeError`, or `URIError` object. 6407 * 6408 * @static 6409 * @memberOf _ 6410 * @since 3.0.0 6411 * @category Lang 6412 * @param {*} value The value to check. 6413 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 6414 * @example 6415 * 6416 * _.isError(new Error); 6417 * // => true 6418 * 6419 * _.isError(Error); 6420 * // => false 6421 */function isError(value){if(!isObjectLike(value)){return false;}var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||typeof value.message=='string'&&typeof value.name=='string'&&!isPlainObject(value);}/** 6422 * Checks if `value` is a finite primitive number. 6423 * 6424 * **Note:** This method is based on 6425 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 6426 * 6427 * @static 6428 * @memberOf _ 6429 * @since 0.1.0 6430 * @category Lang 6431 * @param {*} value The value to check. 6432 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 6433 * @example 6434 * 6435 * _.isFinite(3); 6436 * // => true 6437 * 6438 * _.isFinite(Number.MIN_VALUE); 6439 * // => true 6440 * 6441 * _.isFinite(Infinity); 6442 * // => false 6443 * 6444 * _.isFinite('3'); 6445 * // => false 6446 */function isFinite(value){return typeof value=='number'&&nativeIsFinite(value);}/** 6447 * Checks if `value` is classified as a `Function` object. 6448 * 6449 * @static 6450 * @memberOf _ 6451 * @since 0.1.0 6452 * @category Lang 6453 * @param {*} value The value to check. 6454 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 6455 * @example 6456 * 6457 * _.isFunction(_); 6458 * // => true 6459 * 6460 * _.isFunction(/abc/); 6461 * // => false 6462 */function isFunction(value){if(!isObject(value)){return false;}// The use of `Object#toString` avoids issues with the `typeof` operator 6463// in Safari 9 which returns 'object' for typed arrays and other constructors. 6464var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}/** 6465 * Checks if `value` is an integer. 6466 * 6467 * **Note:** This method is based on 6468 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 6469 * 6470 * @static 6471 * @memberOf _ 6472 * @since 4.0.0 6473 * @category Lang 6474 * @param {*} value The value to check. 6475 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 6476 * @example 6477 * 6478 * _.isInteger(3); 6479 * // => true 6480 * 6481 * _.isInteger(Number.MIN_VALUE); 6482 * // => false 6483 * 6484 * _.isInteger(Infinity); 6485 * // => false 6486 * 6487 * _.isInteger('3'); 6488 * // => false 6489 */function isInteger(value){return typeof value=='number'&&value==toInteger(value);}/** 6490 * Checks if `value` is a valid array-like length. 6491 * 6492 * **Note:** This method is loosely based on 6493 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 6494 * 6495 * @static 6496 * @memberOf _ 6497 * @since 4.0.0 6498 * @category Lang 6499 * @param {*} value The value to check. 6500 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6501 * @example 6502 * 6503 * _.isLength(3); 6504 * // => true 6505 * 6506 * _.isLength(Number.MIN_VALUE); 6507 * // => false 6508 * 6509 * _.isLength(Infinity); 6510 * // => false 6511 * 6512 * _.isLength('3'); 6513 * // => false 6514 */function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}/** 6515 * Checks if `value` is the 6516 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 6517 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6518 * 6519 * @static 6520 * @memberOf _ 6521 * @since 0.1.0 6522 * @category Lang 6523 * @param {*} value The value to check. 6524 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6525 * @example 6526 * 6527 * _.isObject({}); 6528 * // => true 6529 * 6530 * _.isObject([1, 2, 3]); 6531 * // => true 6532 * 6533 * _.isObject(_.noop); 6534 * // => true 6535 * 6536 * _.isObject(null); 6537 * // => false 6538 */function isObject(value){var type=_typeof(value);return value!=null&&(type=='object'||type=='function');}/** 6539 * Checks if `value` is object-like. A value is object-like if it's not `null` 6540 * and has a `typeof` result of "object". 6541 * 6542 * @static 6543 * @memberOf _ 6544 * @since 4.0.0 6545 * @category Lang 6546 * @param {*} value The value to check. 6547 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6548 * @example 6549 * 6550 * _.isObjectLike({}); 6551 * // => true 6552 * 6553 * _.isObjectLike([1, 2, 3]); 6554 * // => true 6555 * 6556 * _.isObjectLike(_.noop); 6557 * // => false 6558 * 6559 * _.isObjectLike(null); 6560 * // => false 6561 */function isObjectLike(value){return value!=null&&_typeof(value)=='object';}/** 6562 * Checks if `value` is classified as a `Map` object. 6563 * 6564 * @static 6565 * @memberOf _ 6566 * @since 4.3.0 6567 * @category Lang 6568 * @param {*} value The value to check. 6569 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 6570 * @example 6571 * 6572 * _.isMap(new Map); 6573 * // => true 6574 * 6575 * _.isMap(new WeakMap); 6576 * // => false 6577 */var isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;/** 6578 * Performs a partial deep comparison between `object` and `source` to 6579 * determine if `object` contains equivalent property values. 6580 * 6581 * **Note:** This method is equivalent to `_.matches` when `source` is 6582 * partially applied. 6583 * 6584 * Partial comparisons will match empty array and empty object `source` 6585 * values against any array or object value, respectively. See `_.isEqual` 6586 * for a list of supported value comparisons. 6587 * 6588 * @static 6589 * @memberOf _ 6590 * @since 3.0.0 6591 * @category Lang 6592 * @param {Object} object The object to inspect. 6593 * @param {Object} source The object of property values to match. 6594 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 6595 * @example 6596 * 6597 * var object = { 'a': 1, 'b': 2 }; 6598 * 6599 * _.isMatch(object, { 'b': 2 }); 6600 * // => true 6601 * 6602 * _.isMatch(object, { 'b': 1 }); 6603 * // => false 6604 */function isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source));}/** 6605 * This method is like `_.isMatch` except that it accepts `customizer` which 6606 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 6607 * are handled by the method instead. The `customizer` is invoked with five 6608 * arguments: (objValue, srcValue, index|key, object, source). 6609 * 6610 * @static 6611 * @memberOf _ 6612 * @since 4.0.0 6613 * @category Lang 6614 * @param {Object} object The object to inspect. 6615 * @param {Object} source The object of property values to match. 6616 * @param {Function} [customizer] The function to customize comparisons. 6617 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 6618 * @example 6619 * 6620 * function isGreeting(value) { 6621 * return /^h(?:i|ello)$/.test(value); 6622 * } 6623 * 6624 * function customizer(objValue, srcValue) { 6625 * if (isGreeting(objValue) && isGreeting(srcValue)) { 6626 * return true; 6627 * } 6628 * } 6629 * 6630 * var object = { 'greeting': 'hello' }; 6631 * var source = { 'greeting': 'hi' }; 6632 * 6633 * _.isMatchWith(object, source, customizer); 6634 * // => true 6635 */function isMatchWith(object,source,customizer){customizer=typeof customizer=='function'?customizer:undefined;return baseIsMatch(object,source,getMatchData(source),customizer);}/** 6636 * Checks if `value` is `NaN`. 6637 * 6638 * **Note:** This method is based on 6639 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 6640 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 6641 * `undefined` and other non-number values. 6642 * 6643 * @static 6644 * @memberOf _ 6645 * @since 0.1.0 6646 * @category Lang 6647 * @param {*} value The value to check. 6648 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 6649 * @example 6650 * 6651 * _.isNaN(NaN); 6652 * // => true 6653 * 6654 * _.isNaN(new Number(NaN)); 6655 * // => true 6656 * 6657 * isNaN(undefined); 6658 * // => true 6659 * 6660 * _.isNaN(undefined); 6661 * // => false 6662 */function isNaN(value){// An `NaN` primitive is the only value that is not equal to itself. 6663// Perform the `toStringTag` check first to avoid errors with some 6664// ActiveX objects in IE. 6665return isNumber(value)&&value!=+value;}/** 6666 * Checks if `value` is a pristine native function. 6667 * 6668 * **Note:** This method can't reliably detect native functions in the presence 6669 * of the core-js package because core-js circumvents this kind of detection. 6670 * Despite multiple requests, the core-js maintainer has made it clear: any 6671 * attempt to fix the detection will be obstructed. As a result, we're left 6672 * with little choice but to throw an error. Unfortunately, this also affects 6673 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 6674 * which rely on core-js. 6675 * 6676 * @static 6677 * @memberOf _ 6678 * @since 3.0.0 6679 * @category Lang 6680 * @param {*} value The value to check. 6681 * @returns {boolean} Returns `true` if `value` is a native function, 6682 * else `false`. 6683 * @example 6684 * 6685 * _.isNative(Array.prototype.push); 6686 * // => true 6687 * 6688 * _.isNative(_); 6689 * // => false 6690 */function isNative(value){if(isMaskable(value)){throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}/** 6691 * Checks if `value` is `null`. 6692 * 6693 * @static 6694 * @memberOf _ 6695 * @since 0.1.0 6696 * @category Lang 6697 * @param {*} value The value to check. 6698 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 6699 * @example 6700 * 6701 * _.isNull(null); 6702 * // => true 6703 * 6704 * _.isNull(void 0); 6705 * // => false 6706 */function isNull(value){return value===null;}/** 6707 * Checks if `value` is `null` or `undefined`. 6708 * 6709 * @static 6710 * @memberOf _ 6711 * @since 4.0.0 6712 * @category Lang 6713 * @param {*} value The value to check. 6714 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 6715 * @example 6716 * 6717 * _.isNil(null); 6718 * // => true 6719 * 6720 * _.isNil(void 0); 6721 * // => true 6722 * 6723 * _.isNil(NaN); 6724 * // => false 6725 */function isNil(value){return value==null;}/** 6726 * Checks if `value` is classified as a `Number` primitive or object. 6727 * 6728 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 6729 * classified as numbers, use the `_.isFinite` method. 6730 * 6731 * @static 6732 * @memberOf _ 6733 * @since 0.1.0 6734 * @category Lang 6735 * @param {*} value The value to check. 6736 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 6737 * @example 6738 * 6739 * _.isNumber(3); 6740 * // => true 6741 * 6742 * _.isNumber(Number.MIN_VALUE); 6743 * // => true 6744 * 6745 * _.isNumber(Infinity); 6746 * // => true 6747 * 6748 * _.isNumber('3'); 6749 * // => false 6750 */function isNumber(value){return typeof value=='number'||isObjectLike(value)&&baseGetTag(value)==numberTag;}/** 6751 * Checks if `value` is a plain object, that is, an object created by the 6752 * `Object` constructor or one with a `[[Prototype]]` of `null`. 6753 * 6754 * @static 6755 * @memberOf _ 6756 * @since 0.8.0 6757 * @category Lang 6758 * @param {*} value The value to check. 6759 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 6760 * @example 6761 * 6762 * function Foo() { 6763 * this.a = 1; 6764 * } 6765 * 6766 * _.isPlainObject(new Foo); 6767 * // => false 6768 * 6769 * _.isPlainObject([1, 2, 3]); 6770 * // => false 6771 * 6772 * _.isPlainObject({ 'x': 0, 'y': 0 }); 6773 * // => true 6774 * 6775 * _.isPlainObject(Object.create(null)); 6776 * // => true 6777 */function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor=='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}/** 6778 * Checks if `value` is classified as a `RegExp` object. 6779 * 6780 * @static 6781 * @memberOf _ 6782 * @since 0.1.0 6783 * @category Lang 6784 * @param {*} value The value to check. 6785 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 6786 * @example 6787 * 6788 * _.isRegExp(/abc/); 6789 * // => true 6790 * 6791 * _.isRegExp('/abc/'); 6792 * // => false 6793 */var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp;/** 6794 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 6795 * double precision number which isn't the result of a rounded unsafe integer. 6796 * 6797 * **Note:** This method is based on 6798 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 6799 * 6800 * @static 6801 * @memberOf _ 6802 * @since 4.0.0 6803 * @category Lang 6804 * @param {*} value The value to check. 6805 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 6806 * @example 6807 * 6808 * _.isSafeInteger(3); 6809 * // => true 6810 * 6811 * _.isSafeInteger(Number.MIN_VALUE); 6812 * // => false 6813 * 6814 * _.isSafeInteger(Infinity); 6815 * // => false 6816 * 6817 * _.isSafeInteger('3'); 6818 * // => false 6819 */function isSafeInteger(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&value<=MAX_SAFE_INTEGER;}/** 6820 * Checks if `value` is classified as a `Set` object. 6821 * 6822 * @static 6823 * @memberOf _ 6824 * @since 4.3.0 6825 * @category Lang 6826 * @param {*} value The value to check. 6827 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 6828 * @example 6829 * 6830 * _.isSet(new Set); 6831 * // => true 6832 * 6833 * _.isSet(new WeakSet); 6834 * // => false 6835 */var isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;/** 6836 * Checks if `value` is classified as a `String` primitive or object. 6837 * 6838 * @static 6839 * @since 0.1.0 6840 * @memberOf _ 6841 * @category Lang 6842 * @param {*} value The value to check. 6843 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 6844 * @example 6845 * 6846 * _.isString('abc'); 6847 * // => true 6848 * 6849 * _.isString(1); 6850 * // => false 6851 */function isString(value){return typeof value=='string'||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag;}/** 6852 * Checks if `value` is classified as a `Symbol` primitive or object. 6853 * 6854 * @static 6855 * @memberOf _ 6856 * @since 4.0.0 6857 * @category Lang 6858 * @param {*} value The value to check. 6859 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 6860 * @example 6861 * 6862 * _.isSymbol(Symbol.iterator); 6863 * // => true 6864 * 6865 * _.isSymbol('abc'); 6866 * // => false 6867 */function isSymbol(value){return _typeof(value)=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}/** 6868 * Checks if `value` is classified as a typed array. 6869 * 6870 * @static 6871 * @memberOf _ 6872 * @since 3.0.0 6873 * @category Lang 6874 * @param {*} value The value to check. 6875 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 6876 * @example 6877 * 6878 * _.isTypedArray(new Uint8Array); 6879 * // => true 6880 * 6881 * _.isTypedArray([]); 6882 * // => false 6883 */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;/** 6884 * Checks if `value` is `undefined`. 6885 * 6886 * @static 6887 * @since 0.1.0 6888 * @memberOf _ 6889 * @category Lang 6890 * @param {*} value The value to check. 6891 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 6892 * @example 6893 * 6894 * _.isUndefined(void 0); 6895 * // => true 6896 * 6897 * _.isUndefined(null); 6898 * // => false 6899 */function isUndefined(value){return value===undefined;}/** 6900 * Checks if `value` is classified as a `WeakMap` object. 6901 * 6902 * @static 6903 * @memberOf _ 6904 * @since 4.3.0 6905 * @category Lang 6906 * @param {*} value The value to check. 6907 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 6908 * @example 6909 * 6910 * _.isWeakMap(new WeakMap); 6911 * // => true 6912 * 6913 * _.isWeakMap(new Map); 6914 * // => false 6915 */function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag;}/** 6916 * Checks if `value` is classified as a `WeakSet` object. 6917 * 6918 * @static 6919 * @memberOf _ 6920 * @since 4.3.0 6921 * @category Lang 6922 * @param {*} value The value to check. 6923 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 6924 * @example 6925 * 6926 * _.isWeakSet(new WeakSet); 6927 * // => true 6928 * 6929 * _.isWeakSet(new Set); 6930 * // => false 6931 */function isWeakSet(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag;}/** 6932 * Checks if `value` is less than `other`. 6933 * 6934 * @static 6935 * @memberOf _ 6936 * @since 3.9.0 6937 * @category Lang 6938 * @param {*} value The value to compare. 6939 * @param {*} other The other value to compare. 6940 * @returns {boolean} Returns `true` if `value` is less than `other`, 6941 * else `false`. 6942 * @see _.gt 6943 * @example 6944 * 6945 * _.lt(1, 3); 6946 * // => true 6947 * 6948 * _.lt(3, 3); 6949 * // => false 6950 * 6951 * _.lt(3, 1); 6952 * // => false 6953 */var lt=createRelationalOperation(baseLt);/** 6954 * Checks if `value` is less than or equal to `other`. 6955 * 6956 * @static 6957 * @memberOf _ 6958 * @since 3.9.0 6959 * @category Lang 6960 * @param {*} value The value to compare. 6961 * @param {*} other The other value to compare. 6962 * @returns {boolean} Returns `true` if `value` is less than or equal to 6963 * `other`, else `false`. 6964 * @see _.gte 6965 * @example 6966 * 6967 * _.lte(1, 3); 6968 * // => true 6969 * 6970 * _.lte(3, 3); 6971 * // => true 6972 * 6973 * _.lte(3, 1); 6974 * // => false 6975 */var lte=createRelationalOperation(function(value,other){return value<=other;});/** 6976 * Converts `value` to an array. 6977 * 6978 * @static 6979 * @since 0.1.0 6980 * @memberOf _ 6981 * @category Lang 6982 * @param {*} value The value to convert. 6983 * @returns {Array} Returns the converted array. 6984 * @example 6985 * 6986 * _.toArray({ 'a': 1, 'b': 2 }); 6987 * // => [1, 2] 6988 * 6989 * _.toArray('abc'); 6990 * // => ['a', 'b', 'c'] 6991 * 6992 * _.toArray(1); 6993 * // => [] 6994 * 6995 * _.toArray(null); 6996 * // => [] 6997 */function toArray(value){if(!value){return[];}if(isArrayLike(value)){return isString(value)?stringToArray(value):copyArray(value);}if(symIterator&&value[symIterator]){return iteratorToArray(value[symIterator]());}var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value);}/** 6998 * Converts `value` to a finite number. 6999 * 7000 * @static 7001 * @memberOf _ 7002 * @since 4.12.0 7003 * @category Lang 7004 * @param {*} value The value to convert. 7005 * @returns {number} Returns the converted number. 7006 * @example 7007 * 7008 * _.toFinite(3.2); 7009 * // => 3.2 7010 * 7011 * _.toFinite(Number.MIN_VALUE); 7012 * // => 5e-324 7013 * 7014 * _.toFinite(Infinity); 7015 * // => 1.7976931348623157e+308 7016 * 7017 * _.toFinite('3.2'); 7018 * // => 3.2 7019 */function toFinite(value){if(!value){return value===0?value:0;}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER;}return value===value?value:0;}/** 7020 * Converts `value` to an integer. 7021 * 7022 * **Note:** This method is loosely based on 7023 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 7024 * 7025 * @static 7026 * @memberOf _ 7027 * @since 4.0.0 7028 * @category Lang 7029 * @param {*} value The value to convert. 7030 * @returns {number} Returns the converted integer. 7031 * @example 7032 * 7033 * _.toInteger(3.2); 7034 * // => 3 7035 * 7036 * _.toInteger(Number.MIN_VALUE); 7037 * // => 0 7038 * 7039 * _.toInteger(Infinity); 7040 * // => 1.7976931348623157e+308 7041 * 7042 * _.toInteger('3.2'); 7043 * // => 3 7044 */function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0;}/** 7045 * Converts `value` to an integer suitable for use as the length of an 7046 * array-like object. 7047 * 7048 * **Note:** This method is based on 7049 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 7050 * 7051 * @static 7052 * @memberOf _ 7053 * @since 4.0.0 7054 * @category Lang 7055 * @param {*} value The value to convert. 7056 * @returns {number} Returns the converted integer. 7057 * @example 7058 * 7059 * _.toLength(3.2); 7060 * // => 3 7061 * 7062 * _.toLength(Number.MIN_VALUE); 7063 * // => 0 7064 * 7065 * _.toLength(Infinity); 7066 * // => 4294967295 7067 * 7068 * _.toLength('3.2'); 7069 * // => 3 7070 */function toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0;}/** 7071 * Converts `value` to a number. 7072 * 7073 * @static 7074 * @memberOf _ 7075 * @since 4.0.0 7076 * @category Lang 7077 * @param {*} value The value to process. 7078 * @returns {number} Returns the number. 7079 * @example 7080 * 7081 * _.toNumber(3.2); 7082 * // => 3.2 7083 * 7084 * _.toNumber(Number.MIN_VALUE); 7085 * // => 5e-324 7086 * 7087 * _.toNumber(Infinity); 7088 * // => Infinity 7089 * 7090 * _.toNumber('3.2'); 7091 * // => 3.2 7092 */function toNumber(value){if(typeof value=='number'){return value;}if(isSymbol(value)){return NAN;}if(isObject(value)){var other=typeof value.valueOf=='function'?value.valueOf():value;value=isObject(other)?other+'':other;}if(typeof value!='string'){return value===0?value:+value;}value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value;}/** 7093 * Converts `value` to a plain object flattening inherited enumerable string 7094 * keyed properties of `value` to own properties of the plain object. 7095 * 7096 * @static 7097 * @memberOf _ 7098 * @since 3.0.0 7099 * @category Lang 7100 * @param {*} value The value to convert. 7101 * @returns {Object} Returns the converted plain object. 7102 * @example 7103 * 7104 * function Foo() { 7105 * this.b = 2; 7106 * } 7107 * 7108 * Foo.prototype.c = 3; 7109 * 7110 * _.assign({ 'a': 1 }, new Foo); 7111 * // => { 'a': 1, 'b': 2 } 7112 * 7113 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 7114 * // => { 'a': 1, 'b': 2, 'c': 3 } 7115 */function toPlainObject(value){return copyObject(value,keysIn(value));}/** 7116 * Converts `value` to a safe integer. A safe integer can be compared and 7117 * represented correctly. 7118 * 7119 * @static 7120 * @memberOf _ 7121 * @since 4.0.0 7122 * @category Lang 7123 * @param {*} value The value to convert. 7124 * @returns {number} Returns the converted integer. 7125 * @example 7126 * 7127 * _.toSafeInteger(3.2); 7128 * // => 3 7129 * 7130 * _.toSafeInteger(Number.MIN_VALUE); 7131 * // => 0 7132 * 7133 * _.toSafeInteger(Infinity); 7134 * // => 9007199254740991 7135 * 7136 * _.toSafeInteger('3.2'); 7137 * // => 3 7138 */function toSafeInteger(value){return value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):value===0?value:0;}/** 7139 * Converts `value` to a string. An empty string is returned for `null` 7140 * and `undefined` values. The sign of `-0` is preserved. 7141 * 7142 * @static 7143 * @memberOf _ 7144 * @since 4.0.0 7145 * @category Lang 7146 * @param {*} value The value to convert. 7147 * @returns {string} Returns the converted string. 7148 * @example 7149 * 7150 * _.toString(null); 7151 * // => '' 7152 * 7153 * _.toString(-0); 7154 * // => '-0' 7155 * 7156 * _.toString([1, 2, 3]); 7157 * // => '1,2,3' 7158 */function toString(value){return value==null?'':baseToString(value);}/*------------------------------------------------------------------------*/ /** 7159 * Assigns own enumerable string keyed properties of source objects to the 7160 * destination object. Source objects are applied from left to right. 7161 * Subsequent sources overwrite property assignments of previous sources. 7162 * 7163 * **Note:** This method mutates `object` and is loosely based on 7164 * [`Object.assign`](https://mdn.io/Object/assign). 7165 * 7166 * @static 7167 * @memberOf _ 7168 * @since 0.10.0 7169 * @category Object 7170 * @param {Object} object The destination object. 7171 * @param {...Object} [sources] The source objects. 7172 * @returns {Object} Returns `object`. 7173 * @see _.assignIn 7174 * @example 7175 * 7176 * function Foo() { 7177 * this.a = 1; 7178 * } 7179 * 7180 * function Bar() { 7181 * this.c = 3; 7182 * } 7183 * 7184 * Foo.prototype.b = 2; 7185 * Bar.prototype.d = 4; 7186 * 7187 * _.assign({ 'a': 0 }, new Foo, new Bar); 7188 * // => { 'a': 1, 'c': 3 } 7189 */var assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});/** 7190 * This method is like `_.assign` except that it iterates over own and 7191 * inherited source properties. 7192 * 7193 * **Note:** This method mutates `object`. 7194 * 7195 * @static 7196 * @memberOf _ 7197 * @since 4.0.0 7198 * @alias extend 7199 * @category Object 7200 * @param {Object} object The destination object. 7201 * @param {...Object} [sources] The source objects. 7202 * @returns {Object} Returns `object`. 7203 * @see _.assign 7204 * @example 7205 * 7206 * function Foo() { 7207 * this.a = 1; 7208 * } 7209 * 7210 * function Bar() { 7211 * this.c = 3; 7212 * } 7213 * 7214 * Foo.prototype.b = 2; 7215 * Bar.prototype.d = 4; 7216 * 7217 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 7218 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 7219 */var assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object);});/** 7220 * This method is like `_.assignIn` except that it accepts `customizer` 7221 * which is invoked to produce the assigned values. If `customizer` returns 7222 * `undefined`, assignment is handled by the method instead. The `customizer` 7223 * is invoked with five arguments: (objValue, srcValue, key, object, source). 7224 * 7225 * **Note:** This method mutates `object`. 7226 * 7227 * @static 7228 * @memberOf _ 7229 * @since 4.0.0 7230 * @alias extendWith 7231 * @category Object 7232 * @param {Object} object The destination object. 7233 * @param {...Object} sources The source objects. 7234 * @param {Function} [customizer] The function to customize assigned values. 7235 * @returns {Object} Returns `object`. 7236 * @see _.assignWith 7237 * @example 7238 * 7239 * function customizer(objValue, srcValue) { 7240 * return _.isUndefined(objValue) ? srcValue : objValue; 7241 * } 7242 * 7243 * var defaults = _.partialRight(_.assignInWith, customizer); 7244 * 7245 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 7246 * // => { 'a': 1, 'b': 2 } 7247 */var assignInWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer);});/** 7248 * This method is like `_.assign` except that it accepts `customizer` 7249 * which is invoked to produce the assigned values. If `customizer` returns 7250 * `undefined`, assignment is handled by the method instead. The `customizer` 7251 * is invoked with five arguments: (objValue, srcValue, key, object, source). 7252 * 7253 * **Note:** This method mutates `object`. 7254 * 7255 * @static 7256 * @memberOf _ 7257 * @since 4.0.0 7258 * @category Object 7259 * @param {Object} object The destination object. 7260 * @param {...Object} sources The source objects. 7261 * @param {Function} [customizer] The function to customize assigned values. 7262 * @returns {Object} Returns `object`. 7263 * @see _.assignInWith 7264 * @example 7265 * 7266 * function customizer(objValue, srcValue) { 7267 * return _.isUndefined(objValue) ? srcValue : objValue; 7268 * } 7269 * 7270 * var defaults = _.partialRight(_.assignWith, customizer); 7271 * 7272 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 7273 * // => { 'a': 1, 'b': 2 } 7274 */var assignWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer);});/** 7275 * Creates an array of values corresponding to `paths` of `object`. 7276 * 7277 * @static 7278 * @memberOf _ 7279 * @since 1.0.0 7280 * @category Object 7281 * @param {Object} object The object to iterate over. 7282 * @param {...(string|string[])} [paths] The property paths to pick. 7283 * @returns {Array} Returns the picked values. 7284 * @example 7285 * 7286 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 7287 * 7288 * _.at(object, ['a[0].b.c', 'a[1]']); 7289 * // => [3, 4] 7290 */var at=flatRest(baseAt);/** 7291 * Creates an object that inherits from the `prototype` object. If a 7292 * `properties` object is given, its own enumerable string keyed properties 7293 * are assigned to the created object. 7294 * 7295 * @static 7296 * @memberOf _ 7297 * @since 2.3.0 7298 * @category Object 7299 * @param {Object} prototype The object to inherit from. 7300 * @param {Object} [properties] The properties to assign to the object. 7301 * @returns {Object} Returns the new object. 7302 * @example 7303 * 7304 * function Shape() { 7305 * this.x = 0; 7306 * this.y = 0; 7307 * } 7308 * 7309 * function Circle() { 7310 * Shape.call(this); 7311 * } 7312 * 7313 * Circle.prototype = _.create(Shape.prototype, { 7314 * 'constructor': Circle 7315 * }); 7316 * 7317 * var circle = new Circle; 7318 * circle instanceof Circle; 7319 * // => true 7320 * 7321 * circle instanceof Shape; 7322 * // => true 7323 */function create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}/** 7324 * Assigns own and inherited enumerable string keyed properties of source 7325 * objects to the destination object for all destination properties that 7326 * resolve to `undefined`. Source objects are applied from left to right. 7327 * Once a property is set, additional values of the same property are ignored. 7328 * 7329 * **Note:** This method mutates `object`. 7330 * 7331 * @static 7332 * @since 0.1.0 7333 * @memberOf _ 7334 * @category Object 7335 * @param {Object} object The destination object. 7336 * @param {...Object} [sources] The source objects. 7337 * @returns {Object} Returns `object`. 7338 * @see _.defaultsDeep 7339 * @example 7340 * 7341 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 7342 * // => { 'a': 1, 'b': 2 } 7343 */var defaults=baseRest(function(object,sources){object=Object(object);var index=-1;var length=sources.length;var guard=length>2?sources[2]:undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){length=1;}while(++index<length){var source=sources[index];var props=keysIn(source);var propsIndex=-1;var propsLength=props.length;while(++propsIndex<propsLength){var key=props[propsIndex];var value=object[key];if(value===undefined||eq(value,objectProto[key])&&!hasOwnProperty.call(object,key)){object[key]=source[key];}}}return object;});/** 7344 * This method is like `_.defaults` except that it recursively assigns 7345 * default properties. 7346 * 7347 * **Note:** This method mutates `object`. 7348 * 7349 * @static 7350 * @memberOf _ 7351 * @since 3.10.0 7352 * @category Object 7353 * @param {Object} object The destination object. 7354 * @param {...Object} [sources] The source objects. 7355 * @returns {Object} Returns `object`. 7356 * @see _.defaults 7357 * @example 7358 * 7359 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 7360 * // => { 'a': { 'b': 2, 'c': 3 } } 7361 */var defaultsDeep=baseRest(function(args){args.push(undefined,customDefaultsMerge);return apply(mergeWith,undefined,args);});/** 7362 * This method is like `_.find` except that it returns the key of the first 7363 * element `predicate` returns truthy for instead of the element itself. 7364 * 7365 * @static 7366 * @memberOf _ 7367 * @since 1.1.0 7368 * @category Object 7369 * @param {Object} object The object to inspect. 7370 * @param {Function} [predicate=_.identity] The function invoked per iteration. 7371 * @returns {string|undefined} Returns the key of the matched element, 7372 * else `undefined`. 7373 * @example 7374 * 7375 * var users = { 7376 * 'barney': { 'age': 36, 'active': true }, 7377 * 'fred': { 'age': 40, 'active': false }, 7378 * 'pebbles': { 'age': 1, 'active': true } 7379 * }; 7380 * 7381 * _.findKey(users, function(o) { return o.age < 40; }); 7382 * // => 'barney' (iteration order is not guaranteed) 7383 * 7384 * // The `_.matches` iteratee shorthand. 7385 * _.findKey(users, { 'age': 1, 'active': true }); 7386 * // => 'pebbles' 7387 * 7388 * // The `_.matchesProperty` iteratee shorthand. 7389 * _.findKey(users, ['active', false]); 7390 * // => 'fred' 7391 * 7392 * // The `_.property` iteratee shorthand. 7393 * _.findKey(users, 'active'); 7394 * // => 'barney' 7395 */function findKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn);}/** 7396 * This method is like `_.findKey` except that it iterates over elements of 7397 * a collection in the opposite order. 7398 * 7399 * @static 7400 * @memberOf _ 7401 * @since 2.0.0 7402 * @category Object 7403 * @param {Object} object The object to inspect. 7404 * @param {Function} [predicate=_.identity] The function invoked per iteration. 7405 * @returns {string|undefined} Returns the key of the matched element, 7406 * else `undefined`. 7407 * @example 7408 * 7409 * var users = { 7410 * 'barney': { 'age': 36, 'active': true }, 7411 * 'fred': { 'age': 40, 'active': false }, 7412 * 'pebbles': { 'age': 1, 'active': true } 7413 * }; 7414 * 7415 * _.findLastKey(users, function(o) { return o.age < 40; }); 7416 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 7417 * 7418 * // The `_.matches` iteratee shorthand. 7419 * _.findLastKey(users, { 'age': 36, 'active': true }); 7420 * // => 'barney' 7421 * 7422 * // The `_.matchesProperty` iteratee shorthand. 7423 * _.findLastKey(users, ['active', false]); 7424 * // => 'fred' 7425 * 7426 * // The `_.property` iteratee shorthand. 7427 * _.findLastKey(users, 'active'); 7428 * // => 'pebbles' 7429 */function findLastKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight);}/** 7430 * Iterates over own and inherited enumerable string keyed properties of an 7431 * object and invokes `iteratee` for each property. The iteratee is invoked 7432 * with three arguments: (value, key, object). Iteratee functions may exit 7433 * iteration early by explicitly returning `false`. 7434 * 7435 * @static 7436 * @memberOf _ 7437 * @since 0.3.0 7438 * @category Object 7439 * @param {Object} object The object to iterate over. 7440 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7441 * @returns {Object} Returns `object`. 7442 * @see _.forInRight 7443 * @example 7444 * 7445 * function Foo() { 7446 * this.a = 1; 7447 * this.b = 2; 7448 * } 7449 * 7450 * Foo.prototype.c = 3; 7451 * 7452 * _.forIn(new Foo, function(value, key) { 7453 * console.log(key); 7454 * }); 7455 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 7456 */function forIn(object,iteratee){return object==null?object:baseFor(object,getIteratee(iteratee,3),keysIn);}/** 7457 * This method is like `_.forIn` except that it iterates over properties of 7458 * `object` in the opposite order. 7459 * 7460 * @static 7461 * @memberOf _ 7462 * @since 2.0.0 7463 * @category Object 7464 * @param {Object} object The object to iterate over. 7465 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7466 * @returns {Object} Returns `object`. 7467 * @see _.forIn 7468 * @example 7469 * 7470 * function Foo() { 7471 * this.a = 1; 7472 * this.b = 2; 7473 * } 7474 * 7475 * Foo.prototype.c = 3; 7476 * 7477 * _.forInRight(new Foo, function(value, key) { 7478 * console.log(key); 7479 * }); 7480 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 7481 */function forInRight(object,iteratee){return object==null?object:baseForRight(object,getIteratee(iteratee,3),keysIn);}/** 7482 * Iterates over own enumerable string keyed properties of an object and 7483 * invokes `iteratee` for each property. The iteratee is invoked with three 7484 * arguments: (value, key, object). Iteratee functions may exit iteration 7485 * early by explicitly returning `false`. 7486 * 7487 * @static 7488 * @memberOf _ 7489 * @since 0.3.0 7490 * @category Object 7491 * @param {Object} object The object to iterate over. 7492 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7493 * @returns {Object} Returns `object`. 7494 * @see _.forOwnRight 7495 * @example 7496 * 7497 * function Foo() { 7498 * this.a = 1; 7499 * this.b = 2; 7500 * } 7501 * 7502 * Foo.prototype.c = 3; 7503 * 7504 * _.forOwn(new Foo, function(value, key) { 7505 * console.log(key); 7506 * }); 7507 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 7508 */function forOwn(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3));}/** 7509 * This method is like `_.forOwn` except that it iterates over properties of 7510 * `object` in the opposite order. 7511 * 7512 * @static 7513 * @memberOf _ 7514 * @since 2.0.0 7515 * @category Object 7516 * @param {Object} object The object to iterate over. 7517 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7518 * @returns {Object} Returns `object`. 7519 * @see _.forOwn 7520 * @example 7521 * 7522 * function Foo() { 7523 * this.a = 1; 7524 * this.b = 2; 7525 * } 7526 * 7527 * Foo.prototype.c = 3; 7528 * 7529 * _.forOwnRight(new Foo, function(value, key) { 7530 * console.log(key); 7531 * }); 7532 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 7533 */function forOwnRight(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3));}/** 7534 * Creates an array of function property names from own enumerable properties 7535 * of `object`. 7536 * 7537 * @static 7538 * @since 0.1.0 7539 * @memberOf _ 7540 * @category Object 7541 * @param {Object} object The object to inspect. 7542 * @returns {Array} Returns the function names. 7543 * @see _.functionsIn 7544 * @example 7545 * 7546 * function Foo() { 7547 * this.a = _.constant('a'); 7548 * this.b = _.constant('b'); 7549 * } 7550 * 7551 * Foo.prototype.c = _.constant('c'); 7552 * 7553 * _.functions(new Foo); 7554 * // => ['a', 'b'] 7555 */function functions(object){return object==null?[]:baseFunctions(object,keys(object));}/** 7556 * Creates an array of function property names from own and inherited 7557 * enumerable properties of `object`. 7558 * 7559 * @static 7560 * @memberOf _ 7561 * @since 4.0.0 7562 * @category Object 7563 * @param {Object} object The object to inspect. 7564 * @returns {Array} Returns the function names. 7565 * @see _.functions 7566 * @example 7567 * 7568 * function Foo() { 7569 * this.a = _.constant('a'); 7570 * this.b = _.constant('b'); 7571 * } 7572 * 7573 * Foo.prototype.c = _.constant('c'); 7574 * 7575 * _.functionsIn(new Foo); 7576 * // => ['a', 'b', 'c'] 7577 */function functionsIn(object){return object==null?[]:baseFunctions(object,keysIn(object));}/** 7578 * Gets the value at `path` of `object`. If the resolved value is 7579 * `undefined`, the `defaultValue` is returned in its place. 7580 * 7581 * @static 7582 * @memberOf _ 7583 * @since 3.7.0 7584 * @category Object 7585 * @param {Object} object The object to query. 7586 * @param {Array|string} path The path of the property to get. 7587 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 7588 * @returns {*} Returns the resolved value. 7589 * @example 7590 * 7591 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 7592 * 7593 * _.get(object, 'a[0].b.c'); 7594 * // => 3 7595 * 7596 * _.get(object, ['a', '0', 'b', 'c']); 7597 * // => 3 7598 * 7599 * _.get(object, 'a.b.c', 'default'); 7600 * // => 'default' 7601 */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result;}/** 7602 * Checks if `path` is a direct property of `object`. 7603 * 7604 * @static 7605 * @since 0.1.0 7606 * @memberOf _ 7607 * @category Object 7608 * @param {Object} object The object to query. 7609 * @param {Array|string} path The path to check. 7610 * @returns {boolean} Returns `true` if `path` exists, else `false`. 7611 * @example 7612 * 7613 * var object = { 'a': { 'b': 2 } }; 7614 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 7615 * 7616 * _.has(object, 'a'); 7617 * // => true 7618 * 7619 * _.has(object, 'a.b'); 7620 * // => true 7621 * 7622 * _.has(object, ['a', 'b']); 7623 * // => true 7624 * 7625 * _.has(other, 'a'); 7626 * // => false 7627 */function has(object,path){return object!=null&&hasPath(object,path,baseHas);}/** 7628 * Checks if `path` is a direct or inherited property of `object`. 7629 * 7630 * @static 7631 * @memberOf _ 7632 * @since 4.0.0 7633 * @category Object 7634 * @param {Object} object The object to query. 7635 * @param {Array|string} path The path to check. 7636 * @returns {boolean} Returns `true` if `path` exists, else `false`. 7637 * @example 7638 * 7639 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 7640 * 7641 * _.hasIn(object, 'a'); 7642 * // => true 7643 * 7644 * _.hasIn(object, 'a.b'); 7645 * // => true 7646 * 7647 * _.hasIn(object, ['a', 'b']); 7648 * // => true 7649 * 7650 * _.hasIn(object, 'b'); 7651 * // => false 7652 */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn);}/** 7653 * Creates an object composed of the inverted keys and values of `object`. 7654 * If `object` contains duplicate values, subsequent values overwrite 7655 * property assignments of previous values. 7656 * 7657 * @static 7658 * @memberOf _ 7659 * @since 0.7.0 7660 * @category Object 7661 * @param {Object} object The object to invert. 7662 * @returns {Object} Returns the new inverted object. 7663 * @example 7664 * 7665 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 7666 * 7667 * _.invert(object); 7668 * // => { '1': 'c', '2': 'b' } 7669 */var invert=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!='function'){value=nativeObjectToString.call(value);}result[value]=key;},constant(identity));/** 7670 * This method is like `_.invert` except that the inverted object is generated 7671 * from the results of running each element of `object` thru `iteratee`. The 7672 * corresponding inverted value of each inverted key is an array of keys 7673 * responsible for generating the inverted value. The iteratee is invoked 7674 * with one argument: (value). 7675 * 7676 * @static 7677 * @memberOf _ 7678 * @since 4.1.0 7679 * @category Object 7680 * @param {Object} object The object to invert. 7681 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 7682 * @returns {Object} Returns the new inverted object. 7683 * @example 7684 * 7685 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 7686 * 7687 * _.invertBy(object); 7688 * // => { '1': ['a', 'c'], '2': ['b'] } 7689 * 7690 * _.invertBy(object, function(value) { 7691 * return 'group' + value; 7692 * }); 7693 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 7694 */var invertBy=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!='function'){value=nativeObjectToString.call(value);}if(hasOwnProperty.call(result,value)){result[value].push(key);}else{result[value]=[key];}},getIteratee);/** 7695 * Invokes the method at `path` of `object`. 7696 * 7697 * @static 7698 * @memberOf _ 7699 * @since 4.0.0 7700 * @category Object 7701 * @param {Object} object The object to query. 7702 * @param {Array|string} path The path of the method to invoke. 7703 * @param {...*} [args] The arguments to invoke the method with. 7704 * @returns {*} Returns the result of the invoked method. 7705 * @example 7706 * 7707 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 7708 * 7709 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 7710 * // => [2, 3] 7711 */var invoke=baseRest(baseInvoke);/** 7712 * Creates an array of the own enumerable property names of `object`. 7713 * 7714 * **Note:** Non-object values are coerced to objects. See the 7715 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 7716 * for more details. 7717 * 7718 * @static 7719 * @since 0.1.0 7720 * @memberOf _ 7721 * @category Object 7722 * @param {Object} object The object to query. 7723 * @returns {Array} Returns the array of property names. 7724 * @example 7725 * 7726 * function Foo() { 7727 * this.a = 1; 7728 * this.b = 2; 7729 * } 7730 * 7731 * Foo.prototype.c = 3; 7732 * 7733 * _.keys(new Foo); 7734 * // => ['a', 'b'] (iteration order is not guaranteed) 7735 * 7736 * _.keys('hi'); 7737 * // => ['0', '1'] 7738 */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}/** 7739 * Creates an array of the own and inherited enumerable property names of `object`. 7740 * 7741 * **Note:** Non-object values are coerced to objects. 7742 * 7743 * @static 7744 * @memberOf _ 7745 * @since 3.0.0 7746 * @category Object 7747 * @param {Object} object The object to query. 7748 * @returns {Array} Returns the array of property names. 7749 * @example 7750 * 7751 * function Foo() { 7752 * this.a = 1; 7753 * this.b = 2; 7754 * } 7755 * 7756 * Foo.prototype.c = 3; 7757 * 7758 * _.keysIn(new Foo); 7759 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 7760 */function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,true):baseKeysIn(object);}/** 7761 * The opposite of `_.mapValues`; this method creates an object with the 7762 * same values as `object` and keys generated by running each own enumerable 7763 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 7764 * with three arguments: (value, key, object). 7765 * 7766 * @static 7767 * @memberOf _ 7768 * @since 3.8.0 7769 * @category Object 7770 * @param {Object} object The object to iterate over. 7771 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7772 * @returns {Object} Returns the new mapped object. 7773 * @see _.mapValues 7774 * @example 7775 * 7776 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 7777 * return key + value; 7778 * }); 7779 * // => { 'a1': 1, 'b2': 2 } 7780 */function mapKeys(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value);});return result;}/** 7781 * Creates an object with the same keys as `object` and values generated 7782 * by running each own enumerable string keyed property of `object` thru 7783 * `iteratee`. The iteratee is invoked with three arguments: 7784 * (value, key, object). 7785 * 7786 * @static 7787 * @memberOf _ 7788 * @since 2.4.0 7789 * @category Object 7790 * @param {Object} object The object to iterate over. 7791 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 7792 * @returns {Object} Returns the new mapped object. 7793 * @see _.mapKeys 7794 * @example 7795 * 7796 * var users = { 7797 * 'fred': { 'user': 'fred', 'age': 40 }, 7798 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 7799 * }; 7800 * 7801 * _.mapValues(users, function(o) { return o.age; }); 7802 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 7803 * 7804 * // The `_.property` iteratee shorthand. 7805 * _.mapValues(users, 'age'); 7806 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 7807 */function mapValues(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object));});return result;}/** 7808 * This method is like `_.assign` except that it recursively merges own and 7809 * inherited enumerable string keyed properties of source objects into the 7810 * destination object. Source properties that resolve to `undefined` are 7811 * skipped if a destination value exists. Array and plain object properties 7812 * are merged recursively. Other objects and value types are overridden by 7813 * assignment. Source objects are applied from left to right. Subsequent 7814 * sources overwrite property assignments of previous sources. 7815 * 7816 * **Note:** This method mutates `object`. 7817 * 7818 * @static 7819 * @memberOf _ 7820 * @since 0.5.0 7821 * @category Object 7822 * @param {Object} object The destination object. 7823 * @param {...Object} [sources] The source objects. 7824 * @returns {Object} Returns `object`. 7825 * @example 7826 * 7827 * var object = { 7828 * 'a': [{ 'b': 2 }, { 'd': 4 }] 7829 * }; 7830 * 7831 * var other = { 7832 * 'a': [{ 'c': 3 }, { 'e': 5 }] 7833 * }; 7834 * 7835 * _.merge(object, other); 7836 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 7837 */var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex);});/** 7838 * This method is like `_.merge` except that it accepts `customizer` which 7839 * is invoked to produce the merged values of the destination and source 7840 * properties. If `customizer` returns `undefined`, merging is handled by the 7841 * method instead. The `customizer` is invoked with six arguments: 7842 * (objValue, srcValue, key, object, source, stack). 7843 * 7844 * **Note:** This method mutates `object`. 7845 * 7846 * @static 7847 * @memberOf _ 7848 * @since 4.0.0 7849 * @category Object 7850 * @param {Object} object The destination object. 7851 * @param {...Object} sources The source objects. 7852 * @param {Function} customizer The function to customize assigned values. 7853 * @returns {Object} Returns `object`. 7854 * @example 7855 * 7856 * function customizer(objValue, srcValue) { 7857 * if (_.isArray(objValue)) { 7858 * return objValue.concat(srcValue); 7859 * } 7860 * } 7861 * 7862 * var object = { 'a': [1], 'b': [2] }; 7863 * var other = { 'a': [3], 'b': [4] }; 7864 * 7865 * _.mergeWith(object, other, customizer); 7866 * // => { 'a': [1, 3], 'b': [2, 4] } 7867 */var mergeWith=createAssigner(function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer);});/** 7868 * The opposite of `_.pick`; this method creates an object composed of the 7869 * own and inherited enumerable property paths of `object` that are not omitted. 7870 * 7871 * **Note:** This method is considerably slower than `_.pick`. 7872 * 7873 * @static 7874 * @since 0.1.0 7875 * @memberOf _ 7876 * @category Object 7877 * @param {Object} object The source object. 7878 * @param {...(string|string[])} [paths] The property paths to omit. 7879 * @returns {Object} Returns the new object. 7880 * @example 7881 * 7882 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 7883 * 7884 * _.omit(object, ['a', 'c']); 7885 * // => { 'b': '2' } 7886 */var omit=flatRest(function(object,paths){var result={};if(object==null){return result;}var isDeep=false;paths=arrayMap(paths,function(path){path=castPath(path,object);isDeep||(isDeep=path.length>1);return path;});copyObject(object,getAllKeysIn(object),result);if(isDeep){result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone);}var length=paths.length;while(length--){baseUnset(result,paths[length]);}return result;});/** 7887 * The opposite of `_.pickBy`; this method creates an object composed of 7888 * the own and inherited enumerable string keyed properties of `object` that 7889 * `predicate` doesn't return truthy for. The predicate is invoked with two 7890 * arguments: (value, key). 7891 * 7892 * @static 7893 * @memberOf _ 7894 * @since 4.0.0 7895 * @category Object 7896 * @param {Object} object The source object. 7897 * @param {Function} [predicate=_.identity] The function invoked per property. 7898 * @returns {Object} Returns the new object. 7899 * @example 7900 * 7901 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 7902 * 7903 * _.omitBy(object, _.isNumber); 7904 * // => { 'b': '2' } 7905 */function omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)));}/** 7906 * Creates an object composed of the picked `object` properties. 7907 * 7908 * @static 7909 * @since 0.1.0 7910 * @memberOf _ 7911 * @category Object 7912 * @param {Object} object The source object. 7913 * @param {...(string|string[])} [paths] The property paths to pick. 7914 * @returns {Object} Returns the new object. 7915 * @example 7916 * 7917 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 7918 * 7919 * _.pick(object, ['a', 'c']); 7920 * // => { 'a': 1, 'c': 3 } 7921 */var pick=flatRest(function(object,paths){return object==null?{}:basePick(object,paths);});/** 7922 * Creates an object composed of the `object` properties `predicate` returns 7923 * truthy for. The predicate is invoked with two arguments: (value, key). 7924 * 7925 * @static 7926 * @memberOf _ 7927 * @since 4.0.0 7928 * @category Object 7929 * @param {Object} object The source object. 7930 * @param {Function} [predicate=_.identity] The function invoked per property. 7931 * @returns {Object} Returns the new object. 7932 * @example 7933 * 7934 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 7935 * 7936 * _.pickBy(object, _.isNumber); 7937 * // => { 'a': 1, 'c': 3 } 7938 */function pickBy(object,predicate){if(object==null){return{};}var props=arrayMap(getAllKeysIn(object),function(prop){return[prop];});predicate=getIteratee(predicate);return basePickBy(object,props,function(value,path){return predicate(value,path[0]);});}/** 7939 * This method is like `_.get` except that if the resolved value is a 7940 * function it's invoked with the `this` binding of its parent object and 7941 * its result is returned. 7942 * 7943 * @static 7944 * @since 0.1.0 7945 * @memberOf _ 7946 * @category Object 7947 * @param {Object} object The object to query. 7948 * @param {Array|string} path The path of the property to resolve. 7949 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 7950 * @returns {*} Returns the resolved value. 7951 * @example 7952 * 7953 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 7954 * 7955 * _.result(object, 'a[0].b.c1'); 7956 * // => 3 7957 * 7958 * _.result(object, 'a[0].b.c2'); 7959 * // => 4 7960 * 7961 * _.result(object, 'a[0].b.c3', 'default'); 7962 * // => 'default' 7963 * 7964 * _.result(object, 'a[0].b.c3', _.constant('default')); 7965 * // => 'default' 7966 */function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;// Ensure the loop is entered when path is empty. 7967if(!length){length=1;object=undefined;}while(++index<length){var value=object==null?undefined:object[toKey(path[index])];if(value===undefined){index=length;value=defaultValue;}object=isFunction(value)?value.call(object):value;}return object;}/** 7968 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 7969 * it's created. Arrays are created for missing index properties while objects 7970 * are created for all other missing properties. Use `_.setWith` to customize 7971 * `path` creation. 7972 * 7973 * **Note:** This method mutates `object`. 7974 * 7975 * @static 7976 * @memberOf _ 7977 * @since 3.7.0 7978 * @category Object 7979 * @param {Object} object The object to modify. 7980 * @param {Array|string} path The path of the property to set. 7981 * @param {*} value The value to set. 7982 * @returns {Object} Returns `object`. 7983 * @example 7984 * 7985 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 7986 * 7987 * _.set(object, 'a[0].b.c', 4); 7988 * console.log(object.a[0].b.c); 7989 * // => 4 7990 * 7991 * _.set(object, ['x', '0', 'y', 'z'], 5); 7992 * console.log(object.x[0].y.z); 7993 * // => 5 7994 */function set(object,path,value){return object==null?object:baseSet(object,path,value);}/** 7995 * This method is like `_.set` except that it accepts `customizer` which is 7996 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 7997 * path creation is handled by the method instead. The `customizer` is invoked 7998 * with three arguments: (nsValue, key, nsObject). 7999 * 8000 * **Note:** This method mutates `object`. 8001 * 8002 * @static 8003 * @memberOf _ 8004 * @since 4.0.0 8005 * @category Object 8006 * @param {Object} object The object to modify. 8007 * @param {Array|string} path The path of the property to set. 8008 * @param {*} value The value to set. 8009 * @param {Function} [customizer] The function to customize assigned values. 8010 * @returns {Object} Returns `object`. 8011 * @example 8012 * 8013 * var object = {}; 8014 * 8015 * _.setWith(object, '[0][1]', 'a', Object); 8016 * // => { '0': { '1': 'a' } } 8017 */function setWith(object,path,value,customizer){customizer=typeof customizer=='function'?customizer:undefined;return object==null?object:baseSet(object,path,value,customizer);}/** 8018 * Creates an array of own enumerable string keyed-value pairs for `object` 8019 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 8020 * entries are returned. 8021 * 8022 * @static 8023 * @memberOf _ 8024 * @since 4.0.0 8025 * @alias entries 8026 * @category Object 8027 * @param {Object} object The object to query. 8028 * @returns {Array} Returns the key-value pairs. 8029 * @example 8030 * 8031 * function Foo() { 8032 * this.a = 1; 8033 * this.b = 2; 8034 * } 8035 * 8036 * Foo.prototype.c = 3; 8037 * 8038 * _.toPairs(new Foo); 8039 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 8040 */var toPairs=createToPairs(keys);/** 8041 * Creates an array of own and inherited enumerable string keyed-value pairs 8042 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 8043 * or set, its entries are returned. 8044 * 8045 * @static 8046 * @memberOf _ 8047 * @since 4.0.0 8048 * @alias entriesIn 8049 * @category Object 8050 * @param {Object} object The object to query. 8051 * @returns {Array} Returns the key-value pairs. 8052 * @example 8053 * 8054 * function Foo() { 8055 * this.a = 1; 8056 * this.b = 2; 8057 * } 8058 * 8059 * Foo.prototype.c = 3; 8060 * 8061 * _.toPairsIn(new Foo); 8062 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 8063 */var toPairsIn=createToPairs(keysIn);/** 8064 * An alternative to `_.reduce`; this method transforms `object` to a new 8065 * `accumulator` object which is the result of running each of its own 8066 * enumerable string keyed properties thru `iteratee`, with each invocation 8067 * potentially mutating the `accumulator` object. If `accumulator` is not 8068 * provided, a new object with the same `[[Prototype]]` will be used. The 8069 * iteratee is invoked with four arguments: (accumulator, value, key, object). 8070 * Iteratee functions may exit iteration early by explicitly returning `false`. 8071 * 8072 * @static 8073 * @memberOf _ 8074 * @since 1.3.0 8075 * @category Object 8076 * @param {Object} object The object to iterate over. 8077 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 8078 * @param {*} [accumulator] The custom accumulator value. 8079 * @returns {*} Returns the accumulated value. 8080 * @example 8081 * 8082 * _.transform([2, 3, 4], function(result, n) { 8083 * result.push(n *= n); 8084 * return n % 2 == 0; 8085 * }, []); 8086 * // => [4, 9] 8087 * 8088 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 8089 * (result[value] || (result[value] = [])).push(key); 8090 * }, {}); 8091 * // => { '1': ['a', 'c'], '2': ['b'] } 8092 */function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);iteratee=getIteratee(iteratee,4);if(accumulator==null){var Ctor=object&&object.constructor;if(isArrLike){accumulator=isArr?new Ctor():[];}else if(isObject(object)){accumulator=isFunction(Ctor)?baseCreate(getPrototype(object)):{};}else{accumulator={};}}(isArrLike?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object);});return accumulator;}/** 8093 * Removes the property at `path` of `object`. 8094 * 8095 * **Note:** This method mutates `object`. 8096 * 8097 * @static 8098 * @memberOf _ 8099 * @since 4.0.0 8100 * @category Object 8101 * @param {Object} object The object to modify. 8102 * @param {Array|string} path The path of the property to unset. 8103 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 8104 * @example 8105 * 8106 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 8107 * _.unset(object, 'a[0].b.c'); 8108 * // => true 8109 * 8110 * console.log(object); 8111 * // => { 'a': [{ 'b': {} }] }; 8112 * 8113 * _.unset(object, ['a', '0', 'b', 'c']); 8114 * // => true 8115 * 8116 * console.log(object); 8117 * // => { 'a': [{ 'b': {} }] }; 8118 */function unset(object,path){return object==null?true:baseUnset(object,path);}/** 8119 * This method is like `_.set` except that accepts `updater` to produce the 8120 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 8121 * is invoked with one argument: (value). 8122 * 8123 * **Note:** This method mutates `object`. 8124 * 8125 * @static 8126 * @memberOf _ 8127 * @since 4.6.0 8128 * @category Object 8129 * @param {Object} object The object to modify. 8130 * @param {Array|string} path The path of the property to set. 8131 * @param {Function} updater The function to produce the updated value. 8132 * @returns {Object} Returns `object`. 8133 * @example 8134 * 8135 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 8136 * 8137 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 8138 * console.log(object.a[0].b.c); 8139 * // => 9 8140 * 8141 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 8142 * console.log(object.x[0].y.z); 8143 * // => 0 8144 */function update(object,path,updater){return object==null?object:baseUpdate(object,path,castFunction(updater));}/** 8145 * This method is like `_.update` except that it accepts `customizer` which is 8146 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 8147 * path creation is handled by the method instead. The `customizer` is invoked 8148 * with three arguments: (nsValue, key, nsObject). 8149 * 8150 * **Note:** This method mutates `object`. 8151 * 8152 * @static 8153 * @memberOf _ 8154 * @since 4.6.0 8155 * @category Object 8156 * @param {Object} object The object to modify. 8157 * @param {Array|string} path The path of the property to set. 8158 * @param {Function} updater The function to produce the updated value. 8159 * @param {Function} [customizer] The function to customize assigned values. 8160 * @returns {Object} Returns `object`. 8161 * @example 8162 * 8163 * var object = {}; 8164 * 8165 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 8166 * // => { '0': { '1': 'a' } } 8167 */function updateWith(object,path,updater,customizer){customizer=typeof customizer=='function'?customizer:undefined;return object==null?object:baseUpdate(object,path,castFunction(updater),customizer);}/** 8168 * Creates an array of the own enumerable string keyed property values of `object`. 8169 * 8170 * **Note:** Non-object values are coerced to objects. 8171 * 8172 * @static 8173 * @since 0.1.0 8174 * @memberOf _ 8175 * @category Object 8176 * @param {Object} object The object to query. 8177 * @returns {Array} Returns the array of property values. 8178 * @example 8179 * 8180 * function Foo() { 8181 * this.a = 1; 8182 * this.b = 2; 8183 * } 8184 * 8185 * Foo.prototype.c = 3; 8186 * 8187 * _.values(new Foo); 8188 * // => [1, 2] (iteration order is not guaranteed) 8189 * 8190 * _.values('hi'); 8191 * // => ['h', 'i'] 8192 */function values(object){return object==null?[]:baseValues(object,keys(object));}/** 8193 * Creates an array of the own and inherited enumerable string keyed property 8194 * values of `object`. 8195 * 8196 * **Note:** Non-object values are coerced to objects. 8197 * 8198 * @static 8199 * @memberOf _ 8200 * @since 3.0.0 8201 * @category Object 8202 * @param {Object} object The object to query. 8203 * @returns {Array} Returns the array of property values. 8204 * @example 8205 * 8206 * function Foo() { 8207 * this.a = 1; 8208 * this.b = 2; 8209 * } 8210 * 8211 * Foo.prototype.c = 3; 8212 * 8213 * _.valuesIn(new Foo); 8214 * // => [1, 2, 3] (iteration order is not guaranteed) 8215 */function valuesIn(object){return object==null?[]:baseValues(object,keysIn(object));}/*------------------------------------------------------------------------*/ /** 8216 * Clamps `number` within the inclusive `lower` and `upper` bounds. 8217 * 8218 * @static 8219 * @memberOf _ 8220 * @since 4.0.0 8221 * @category Number 8222 * @param {number} number The number to clamp. 8223 * @param {number} [lower] The lower bound. 8224 * @param {number} upper The upper bound. 8225 * @returns {number} Returns the clamped number. 8226 * @example 8227 * 8228 * _.clamp(-10, -5, 5); 8229 * // => -5 8230 * 8231 * _.clamp(10, -5, 5); 8232 * // => 5 8233 */function clamp(number,lower,upper){if(upper===undefined){upper=lower;lower=undefined;}if(upper!==undefined){upper=toNumber(upper);upper=upper===upper?upper:0;}if(lower!==undefined){lower=toNumber(lower);lower=lower===lower?lower:0;}return baseClamp(toNumber(number),lower,upper);}/** 8234 * Checks if `n` is between `start` and up to, but not including, `end`. If 8235 * `end` is not specified, it's set to `start` with `start` then set to `0`. 8236 * If `start` is greater than `end` the params are swapped to support 8237 * negative ranges. 8238 * 8239 * @static 8240 * @memberOf _ 8241 * @since 3.3.0 8242 * @category Number 8243 * @param {number} number The number to check. 8244 * @param {number} [start=0] The start of the range. 8245 * @param {number} end The end of the range. 8246 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 8247 * @see _.range, _.rangeRight 8248 * @example 8249 * 8250 * _.inRange(3, 2, 4); 8251 * // => true 8252 * 8253 * _.inRange(4, 8); 8254 * // => true 8255 * 8256 * _.inRange(4, 2); 8257 * // => false 8258 * 8259 * _.inRange(2, 2); 8260 * // => false 8261 * 8262 * _.inRange(1.2, 2); 8263 * // => true 8264 * 8265 * _.inRange(5.2, 4); 8266 * // => false 8267 * 8268 * _.inRange(-3, -2, -6); 8269 * // => true 8270 */function inRange(number,start,end){start=toFinite(start);if(end===undefined){end=start;start=0;}else{end=toFinite(end);}number=toNumber(number);return baseInRange(number,start,end);}/** 8271 * Produces a random number between the inclusive `lower` and `upper` bounds. 8272 * If only one argument is provided a number between `0` and the given number 8273 * is returned. If `floating` is `true`, or either `lower` or `upper` are 8274 * floats, a floating-point number is returned instead of an integer. 8275 * 8276 * **Note:** JavaScript follows the IEEE-754 standard for resolving 8277 * floating-point values which can produce unexpected results. 8278 * 8279 * @static 8280 * @memberOf _ 8281 * @since 0.7.0 8282 * @category Number 8283 * @param {number} [lower=0] The lower bound. 8284 * @param {number} [upper=1] The upper bound. 8285 * @param {boolean} [floating] Specify returning a floating-point number. 8286 * @returns {number} Returns the random number. 8287 * @example 8288 * 8289 * _.random(0, 5); 8290 * // => an integer between 0 and 5 8291 * 8292 * _.random(5); 8293 * // => also an integer between 0 and 5 8294 * 8295 * _.random(5, true); 8296 * // => a floating-point number between 0 and 5 8297 * 8298 * _.random(1.2, 5.2); 8299 * // => a floating-point number between 1.2 and 5.2 8300 */function random(lower,upper,floating){if(floating&&typeof floating!='boolean'&&isIterateeCall(lower,upper,floating)){upper=floating=undefined;}if(floating===undefined){if(typeof upper=='boolean'){floating=upper;upper=undefined;}else if(typeof lower=='boolean'){floating=lower;lower=undefined;}}if(lower===undefined&&upper===undefined){lower=0;upper=1;}else{lower=toFinite(lower);if(upper===undefined){upper=lower;lower=0;}else{upper=toFinite(upper);}}if(lower>upper){var temp=lower;lower=upper;upper=temp;}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat('1e-'+((rand+'').length-1))),upper);}return baseRandom(lower,upper);}/*------------------------------------------------------------------------*/ /** 8301 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 8302 * 8303 * @static 8304 * @memberOf _ 8305 * @since 3.0.0 8306 * @category String 8307 * @param {string} [string=''] The string to convert. 8308 * @returns {string} Returns the camel cased string. 8309 * @example 8310 * 8311 * _.camelCase('Foo Bar'); 8312 * // => 'fooBar' 8313 * 8314 * _.camelCase('--foo-bar--'); 8315 * // => 'fooBar' 8316 * 8317 * _.camelCase('__FOO_BAR__'); 8318 * // => 'fooBar' 8319 */var camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return result+(index?capitalize(word):word);});/** 8320 * Converts the first character of `string` to upper case and the remaining 8321 * to lower case. 8322 * 8323 * @static 8324 * @memberOf _ 8325 * @since 3.0.0 8326 * @category String 8327 * @param {string} [string=''] The string to capitalize. 8328 * @returns {string} Returns the capitalized string. 8329 * @example 8330 * 8331 * _.capitalize('FRED'); 8332 * // => 'Fred' 8333 */function capitalize(string){return upperFirst(toString(string).toLowerCase());}/** 8334 * Deburrs `string` by converting 8335 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 8336 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 8337 * letters to basic Latin letters and removing 8338 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 8339 * 8340 * @static 8341 * @memberOf _ 8342 * @since 3.0.0 8343 * @category String 8344 * @param {string} [string=''] The string to deburr. 8345 * @returns {string} Returns the deburred string. 8346 * @example 8347 * 8348 * _.deburr('déjàvu'); 8349 * // => 'deja vu' 8350 */function deburr(string){string=toString(string);return string&&string.replace(reLatin,deburrLetter).replace(reComboMark,'');}/** 8351 * Checks if `string` ends with the given target string. 8352 * 8353 * @static 8354 * @memberOf _ 8355 * @since 3.0.0 8356 * @category String 8357 * @param {string} [string=''] The string to inspect. 8358 * @param {string} [target] The string to search for. 8359 * @param {number} [position=string.length] The position to search up to. 8360 * @returns {boolean} Returns `true` if `string` ends with `target`, 8361 * else `false`. 8362 * @example 8363 * 8364 * _.endsWith('abc', 'c'); 8365 * // => true 8366 * 8367 * _.endsWith('abc', 'b'); 8368 * // => false 8369 * 8370 * _.endsWith('abc', 'b', 2); 8371 * // => true 8372 */function endsWith(string,target,position){string=toString(string);target=baseToString(target);var length=string.length;position=position===undefined?length:baseClamp(toInteger(position),0,length);var end=position;position-=target.length;return position>=0&&string.slice(position,end)==target;}/** 8373 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 8374 * corresponding HTML entities. 8375 * 8376 * **Note:** No other characters are escaped. To escape additional 8377 * characters use a third-party library like [_he_](https://mths.be/he). 8378 * 8379 * Though the ">" character is escaped for symmetry, characters like 8380 * ">" and "/" don't need escaping in HTML and have no special meaning 8381 * unless they're part of a tag or unquoted attribute value. See 8382 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 8383 * (under "semi-related fun fact") for more details. 8384 * 8385 * When working with HTML you should always 8386 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 8387 * XSS vectors. 8388 * 8389 * @static 8390 * @since 0.1.0 8391 * @memberOf _ 8392 * @category String 8393 * @param {string} [string=''] The string to escape. 8394 * @returns {string} Returns the escaped string. 8395 * @example 8396 * 8397 * _.escape('fred, barney, & pebbles'); 8398 * // => 'fred, barney, & pebbles' 8399 */function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string;}/** 8400 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 8401 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 8402 * 8403 * @static 8404 * @memberOf _ 8405 * @since 3.0.0 8406 * @category String 8407 * @param {string} [string=''] The string to escape. 8408 * @returns {string} Returns the escaped string. 8409 * @example 8410 * 8411 * _.escapeRegExp('[lodash](https://lodash.com/)'); 8412 * // => '\[lodash\]\(https://lodash\.com/\)' 8413 */function escapeRegExp(string){string=toString(string);return string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,'\\$&'):string;}/** 8414 * Converts `string` to 8415 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 8416 * 8417 * @static 8418 * @memberOf _ 8419 * @since 3.0.0 8420 * @category String 8421 * @param {string} [string=''] The string to convert. 8422 * @returns {string} Returns the kebab cased string. 8423 * @example 8424 * 8425 * _.kebabCase('Foo Bar'); 8426 * // => 'foo-bar' 8427 * 8428 * _.kebabCase('fooBar'); 8429 * // => 'foo-bar' 8430 * 8431 * _.kebabCase('__FOO_BAR__'); 8432 * // => 'foo-bar' 8433 */var kebabCase=createCompounder(function(result,word,index){return result+(index?'-':'')+word.toLowerCase();});/** 8434 * Converts `string`, as space separated words, to lower case. 8435 * 8436 * @static 8437 * @memberOf _ 8438 * @since 4.0.0 8439 * @category String 8440 * @param {string} [string=''] The string to convert. 8441 * @returns {string} Returns the lower cased string. 8442 * @example 8443 * 8444 * _.lowerCase('--Foo-Bar--'); 8445 * // => 'foo bar' 8446 * 8447 * _.lowerCase('fooBar'); 8448 * // => 'foo bar' 8449 * 8450 * _.lowerCase('__FOO_BAR__'); 8451 * // => 'foo bar' 8452 */var lowerCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toLowerCase();});/** 8453 * Converts the first character of `string` to lower case. 8454 * 8455 * @static 8456 * @memberOf _ 8457 * @since 4.0.0 8458 * @category String 8459 * @param {string} [string=''] The string to convert. 8460 * @returns {string} Returns the converted string. 8461 * @example 8462 * 8463 * _.lowerFirst('Fred'); 8464 * // => 'fred' 8465 * 8466 * _.lowerFirst('FRED'); 8467 * // => 'fRED' 8468 */var lowerFirst=createCaseFirst('toLowerCase');/** 8469 * Pads `string` on the left and right sides if it's shorter than `length`. 8470 * Padding characters are truncated if they can't be evenly divided by `length`. 8471 * 8472 * @static 8473 * @memberOf _ 8474 * @since 3.0.0 8475 * @category String 8476 * @param {string} [string=''] The string to pad. 8477 * @param {number} [length=0] The padding length. 8478 * @param {string} [chars=' '] The string used as padding. 8479 * @returns {string} Returns the padded string. 8480 * @example 8481 * 8482 * _.pad('abc', 8); 8483 * // => ' abc ' 8484 * 8485 * _.pad('abc', 8, '_-'); 8486 * // => '_-abc_-_' 8487 * 8488 * _.pad('abc', 3); 8489 * // => 'abc' 8490 */function pad(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;if(!length||strLength>=length){return string;}var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars);}/** 8491 * Pads `string` on the right side if it's shorter than `length`. Padding 8492 * characters are truncated if they exceed `length`. 8493 * 8494 * @static 8495 * @memberOf _ 8496 * @since 4.0.0 8497 * @category String 8498 * @param {string} [string=''] The string to pad. 8499 * @param {number} [length=0] The padding length. 8500 * @param {string} [chars=' '] The string used as padding. 8501 * @returns {string} Returns the padded string. 8502 * @example 8503 * 8504 * _.padEnd('abc', 6); 8505 * // => 'abc ' 8506 * 8507 * _.padEnd('abc', 6, '_-'); 8508 * // => 'abc_-_' 8509 * 8510 * _.padEnd('abc', 3); 8511 * // => 'abc' 8512 */function padEnd(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength<length?string+createPadding(length-strLength,chars):string;}/** 8513 * Pads `string` on the left side if it's shorter than `length`. Padding 8514 * characters are truncated if they exceed `length`. 8515 * 8516 * @static 8517 * @memberOf _ 8518 * @since 4.0.0 8519 * @category String 8520 * @param {string} [string=''] The string to pad. 8521 * @param {number} [length=0] The padding length. 8522 * @param {string} [chars=' '] The string used as padding. 8523 * @returns {string} Returns the padded string. 8524 * @example 8525 * 8526 * _.padStart('abc', 6); 8527 * // => ' abc' 8528 * 8529 * _.padStart('abc', 6, '_-'); 8530 * // => '_-_abc' 8531 * 8532 * _.padStart('abc', 3); 8533 * // => 'abc' 8534 */function padStart(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength<length?createPadding(length-strLength,chars)+string:string;}/** 8535 * Converts `string` to an integer of the specified radix. If `radix` is 8536 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 8537 * hexadecimal, in which case a `radix` of `16` is used. 8538 * 8539 * **Note:** This method aligns with the 8540 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 8541 * 8542 * @static 8543 * @memberOf _ 8544 * @since 1.1.0 8545 * @category String 8546 * @param {string} string The string to convert. 8547 * @param {number} [radix=10] The radix to interpret `value` by. 8548 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8549 * @returns {number} Returns the converted integer. 8550 * @example 8551 * 8552 * _.parseInt('08'); 8553 * // => 8 8554 * 8555 * _.map(['6', '08', '10'], _.parseInt); 8556 * // => [6, 8, 10] 8557 */function parseInt(string,radix,guard){if(guard||radix==null){radix=0;}else if(radix){radix=+radix;}return nativeParseInt(toString(string).replace(reTrimStart,''),radix||0);}/** 8558 * Repeats the given string `n` times. 8559 * 8560 * @static 8561 * @memberOf _ 8562 * @since 3.0.0 8563 * @category String 8564 * @param {string} [string=''] The string to repeat. 8565 * @param {number} [n=1] The number of times to repeat the string. 8566 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8567 * @returns {string} Returns the repeated string. 8568 * @example 8569 * 8570 * _.repeat('*', 3); 8571 * // => '***' 8572 * 8573 * _.repeat('abc', 2); 8574 * // => 'abcabc' 8575 * 8576 * _.repeat('abc', 0); 8577 * // => '' 8578 */function repeat(string,n,guard){if(guard?isIterateeCall(string,n,guard):n===undefined){n=1;}else{n=toInteger(n);}return baseRepeat(toString(string),n);}/** 8579 * Replaces matches for `pattern` in `string` with `replacement`. 8580 * 8581 * **Note:** This method is based on 8582 * [`String#replace`](https://mdn.io/String/replace). 8583 * 8584 * @static 8585 * @memberOf _ 8586 * @since 4.0.0 8587 * @category String 8588 * @param {string} [string=''] The string to modify. 8589 * @param {RegExp|string} pattern The pattern to replace. 8590 * @param {Function|string} replacement The match replacement. 8591 * @returns {string} Returns the modified string. 8592 * @example 8593 * 8594 * _.replace('Hi Fred', 'Fred', 'Barney'); 8595 * // => 'Hi Barney' 8596 */function replace(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2]);}/** 8597 * Converts `string` to 8598 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 8599 * 8600 * @static 8601 * @memberOf _ 8602 * @since 3.0.0 8603 * @category String 8604 * @param {string} [string=''] The string to convert. 8605 * @returns {string} Returns the snake cased string. 8606 * @example 8607 * 8608 * _.snakeCase('Foo Bar'); 8609 * // => 'foo_bar' 8610 * 8611 * _.snakeCase('fooBar'); 8612 * // => 'foo_bar' 8613 * 8614 * _.snakeCase('--FOO-BAR--'); 8615 * // => 'foo_bar' 8616 */var snakeCase=createCompounder(function(result,word,index){return result+(index?'_':'')+word.toLowerCase();});/** 8617 * Splits `string` by `separator`. 8618 * 8619 * **Note:** This method is based on 8620 * [`String#split`](https://mdn.io/String/split). 8621 * 8622 * @static 8623 * @memberOf _ 8624 * @since 4.0.0 8625 * @category String 8626 * @param {string} [string=''] The string to split. 8627 * @param {RegExp|string} separator The separator pattern to split by. 8628 * @param {number} [limit] The length to truncate results to. 8629 * @returns {Array} Returns the string segments. 8630 * @example 8631 * 8632 * _.split('a-b-c', '-', 2); 8633 * // => ['a', 'b'] 8634 */function split(string,separator,limit){if(limit&&typeof limit!='number'&&isIterateeCall(string,separator,limit)){separator=limit=undefined;}limit=limit===undefined?MAX_ARRAY_LENGTH:limit>>>0;if(!limit){return[];}string=toString(string);if(string&&(typeof separator=='string'||separator!=null&&!isRegExp(separator))){separator=baseToString(separator);if(!separator&&hasUnicode(string)){return castSlice(stringToArray(string),0,limit);}}return string.split(separator,limit);}/** 8635 * Converts `string` to 8636 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 8637 * 8638 * @static 8639 * @memberOf _ 8640 * @since 3.1.0 8641 * @category String 8642 * @param {string} [string=''] The string to convert. 8643 * @returns {string} Returns the start cased string. 8644 * @example 8645 * 8646 * _.startCase('--foo-bar--'); 8647 * // => 'Foo Bar' 8648 * 8649 * _.startCase('fooBar'); 8650 * // => 'Foo Bar' 8651 * 8652 * _.startCase('__FOO_BAR__'); 8653 * // => 'FOO BAR' 8654 */var startCase=createCompounder(function(result,word,index){return result+(index?' ':'')+upperFirst(word);});/** 8655 * Checks if `string` starts with the given target string. 8656 * 8657 * @static 8658 * @memberOf _ 8659 * @since 3.0.0 8660 * @category String 8661 * @param {string} [string=''] The string to inspect. 8662 * @param {string} [target] The string to search for. 8663 * @param {number} [position=0] The position to search from. 8664 * @returns {boolean} Returns `true` if `string` starts with `target`, 8665 * else `false`. 8666 * @example 8667 * 8668 * _.startsWith('abc', 'a'); 8669 * // => true 8670 * 8671 * _.startsWith('abc', 'b'); 8672 * // => false 8673 * 8674 * _.startsWith('abc', 'b', 1); 8675 * // => true 8676 */function startsWith(string,target,position){string=toString(string);position=position==null?0:baseClamp(toInteger(position),0,string.length);target=baseToString(target);return string.slice(position,position+target.length)==target;}/** 8677 * Creates a compiled template function that can interpolate data properties 8678 * in "interpolate" delimiters, HTML-escape interpolated data properties in 8679 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 8680 * properties may be accessed as free variables in the template. If a setting 8681 * object is given, it takes precedence over `_.templateSettings` values. 8682 * 8683 * **Note:** In the development build `_.template` utilizes 8684 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 8685 * for easier debugging. 8686 * 8687 * For more information on precompiling templates see 8688 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 8689 * 8690 * For more information on Chrome extension sandboxes see 8691 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 8692 * 8693 * @static 8694 * @since 0.1.0 8695 * @memberOf _ 8696 * @category String 8697 * @param {string} [string=''] The template string. 8698 * @param {Object} [options={}] The options object. 8699 * @param {RegExp} [options.escape=_.templateSettings.escape] 8700 * The HTML "escape" delimiter. 8701 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 8702 * The "evaluate" delimiter. 8703 * @param {Object} [options.imports=_.templateSettings.imports] 8704 * An object to import into the template as free variables. 8705 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 8706 * The "interpolate" delimiter. 8707 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 8708 * The sourceURL of the compiled template. 8709 * @param {string} [options.variable='obj'] 8710 * The data object variable name. 8711 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8712 * @returns {Function} Returns the compiled template function. 8713 * @example 8714 * 8715 * // Use the "interpolate" delimiter to create a compiled template. 8716 * var compiled = _.template('hello <%= user %>!'); 8717 * compiled({ 'user': 'fred' }); 8718 * // => 'hello fred!' 8719 * 8720 * // Use the HTML "escape" delimiter to escape data property values. 8721 * var compiled = _.template('<b><%- value %></b>'); 8722 * compiled({ 'value': '<script>' }); 8723 * // => '<b><script></b>' 8724 * 8725 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 8726 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 8727 * compiled({ 'users': ['fred', 'barney'] }); 8728 * // => '<li>fred</li><li>barney</li>' 8729 * 8730 * // Use the internal `print` function in "evaluate" delimiters. 8731 * var compiled = _.template('<% print("hello " + user); %>!'); 8732 * compiled({ 'user': 'barney' }); 8733 * // => 'hello barney!' 8734 * 8735 * // Use the ES template literal delimiter as an "interpolate" delimiter. 8736 * // Disable support by replacing the "interpolate" delimiter. 8737 * var compiled = _.template('hello ${ user }!'); 8738 * compiled({ 'user': 'pebbles' }); 8739 * // => 'hello pebbles!' 8740 * 8741 * // Use backslashes to treat delimiters as plain text. 8742 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 8743 * compiled({ 'value': 'ignored' }); 8744 * // => '<%- value %>' 8745 * 8746 * // Use the `imports` option to import `jQuery` as `jq`. 8747 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 8748 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 8749 * compiled({ 'users': ['fred', 'barney'] }); 8750 * // => '<li>fred</li><li>barney</li>' 8751 * 8752 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 8753 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 8754 * compiled(data); 8755 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 8756 * 8757 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 8758 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 8759 * compiled.source; 8760 * // => function(data) { 8761 * // var __t, __p = ''; 8762 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 8763 * // return __p; 8764 * // } 8765 * 8766 * // Use custom template delimiters. 8767 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 8768 * var compiled = _.template('hello {{ user }}!'); 8769 * compiled({ 'user': 'mustache' }); 8770 * // => 'hello mustache!' 8771 * 8772 * // Use the `source` property to inline compiled templates for meaningful 8773 * // line numbers in error messages and stack traces. 8774 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 8775 * var JST = {\ 8776 * "main": ' + _.template(mainText).source + '\ 8777 * };\ 8778 * '); 8779 */function template(string,options,guard){// Based on John Resig's `tmpl` implementation 8780// (http://ejohn.org/blog/javascript-micro-templating/) 8781// and Laura Doktorova's doT.js (https://github.com/olado/doT). 8782var settings=lodash.templateSettings;if(guard&&isIterateeCall(string,options,guard)){options=undefined;}string=toString(string);options=assignInWith({},options,settings,customDefaultsAssignIn);var imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";// Compile the regexp to match each delimiter. 8783var reDelimiters=RegExp((options.escape||reNoMatch).source+'|'+interpolate.source+'|'+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+'|'+(options.evaluate||reNoMatch).source+'|$','g');// Use a sourceURL for easier debugging. 8784// The sourceURL gets injected into the source that's eval-ed, so be careful 8785// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 8786// and escape the comment, thus injecting code that gets evaled. 8787var sourceURL='//# sourceURL='+(hasOwnProperty.call(options,'sourceURL')?(options.sourceURL+'').replace(/\s/g,' '):'lodash.templateSources['+ ++templateCounter+']')+'\n';string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);// Escape characters that can't be included in string literals. 8788source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);// Replace delimiters with snippets. 8789if(escapeValue){isEscaping=true;source+="' +\n__e("+escapeValue+") +\n'";}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '";}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'";}index=offset+match.length;// The JS engine embedded in Adobe products needs `match` returned in 8790// order to produce the correct `offset` value. 8791return match;});source+="';\n";// If `variable` is not specified wrap a with-statement around the generated 8792// code to add the data object to the top of the scope chain. 8793var variable=hasOwnProperty.call(options,'variable')&&options.variable;if(!variable){source='with (obj) {\n'+source+'\n}\n';}// Throw an error if a forbidden character was found in `variable`, to prevent 8794// potential command injection attacks. 8795else if(reForbiddenIdentifierChars.test(variable)){throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);}// Cleanup code by stripping empty strings. 8796source=(isEvaluating?source.replace(reEmptyStringLeading,''):source).replace(reEmptyStringMiddle,'$1').replace(reEmptyStringTrailing,'$1;');// Frame code as the function body. 8797source='function('+(variable||'obj')+') {\n'+(variable?'':'obj || (obj = {});\n')+"var __t, __p = ''"+(isEscaping?', __e = _.escape':'')+(isEvaluating?', __j = Array.prototype.join;\n'+"function print() { __p += __j.call(arguments, '') }\n":';\n')+source+'return __p\n}';var result=attempt(function(){return Function(importsKeys,sourceURL+'return '+source).apply(undefined,importsValues);});// Provide the compiled function's source by its `toString` method or 8798// the `source` property as a convenience for inlining compiled templates. 8799result.source=source;if(isError(result)){throw result;}return result;}/** 8800 * Converts `string`, as a whole, to lower case just like 8801 * [String#toLowerCase](https://mdn.io/toLowerCase). 8802 * 8803 * @static 8804 * @memberOf _ 8805 * @since 4.0.0 8806 * @category String 8807 * @param {string} [string=''] The string to convert. 8808 * @returns {string} Returns the lower cased string. 8809 * @example 8810 * 8811 * _.toLower('--Foo-Bar--'); 8812 * // => '--foo-bar--' 8813 * 8814 * _.toLower('fooBar'); 8815 * // => 'foobar' 8816 * 8817 * _.toLower('__FOO_BAR__'); 8818 * // => '__foo_bar__' 8819 */function toLower(value){return toString(value).toLowerCase();}/** 8820 * Converts `string`, as a whole, to upper case just like 8821 * [String#toUpperCase](https://mdn.io/toUpperCase). 8822 * 8823 * @static 8824 * @memberOf _ 8825 * @since 4.0.0 8826 * @category String 8827 * @param {string} [string=''] The string to convert. 8828 * @returns {string} Returns the upper cased string. 8829 * @example 8830 * 8831 * _.toUpper('--foo-bar--'); 8832 * // => '--FOO-BAR--' 8833 * 8834 * _.toUpper('fooBar'); 8835 * // => 'FOOBAR' 8836 * 8837 * _.toUpper('__foo_bar__'); 8838 * // => '__FOO_BAR__' 8839 */function toUpper(value){return toString(value).toUpperCase();}/** 8840 * Removes leading and trailing whitespace or specified characters from `string`. 8841 * 8842 * @static 8843 * @memberOf _ 8844 * @since 3.0.0 8845 * @category String 8846 * @param {string} [string=''] The string to trim. 8847 * @param {string} [chars=whitespace] The characters to trim. 8848 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8849 * @returns {string} Returns the trimmed string. 8850 * @example 8851 * 8852 * _.trim(' abc '); 8853 * // => 'abc' 8854 * 8855 * _.trim('-_-abc-_-', '_-'); 8856 * // => 'abc' 8857 * 8858 * _.map([' foo ', ' bar '], _.trim); 8859 * // => ['foo', 'bar'] 8860 */function trim(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return baseTrim(string);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join('');}/** 8861 * Removes trailing whitespace or specified characters from `string`. 8862 * 8863 * @static 8864 * @memberOf _ 8865 * @since 4.0.0 8866 * @category String 8867 * @param {string} [string=''] The string to trim. 8868 * @param {string} [chars=whitespace] The characters to trim. 8869 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8870 * @returns {string} Returns the trimmed string. 8871 * @example 8872 * 8873 * _.trimEnd(' abc '); 8874 * // => ' abc' 8875 * 8876 * _.trimEnd('-_-abc-_-', '_-'); 8877 * // => '-_-abc' 8878 */function trimEnd(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return string.slice(0,trimmedEndIndex(string)+1);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),end=charsEndIndex(strSymbols,stringToArray(chars))+1;return castSlice(strSymbols,0,end).join('');}/** 8879 * Removes leading whitespace or specified characters from `string`. 8880 * 8881 * @static 8882 * @memberOf _ 8883 * @since 4.0.0 8884 * @category String 8885 * @param {string} [string=''] The string to trim. 8886 * @param {string} [chars=whitespace] The characters to trim. 8887 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8888 * @returns {string} Returns the trimmed string. 8889 * @example 8890 * 8891 * _.trimStart(' abc '); 8892 * // => 'abc ' 8893 * 8894 * _.trimStart('-_-abc-_-', '_-'); 8895 * // => 'abc-_-' 8896 */function trimStart(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined)){return string.replace(reTrimStart,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),start=charsStartIndex(strSymbols,stringToArray(chars));return castSlice(strSymbols,start).join('');}/** 8897 * Truncates `string` if it's longer than the given maximum string length. 8898 * The last characters of the truncated string are replaced with the omission 8899 * string which defaults to "...". 8900 * 8901 * @static 8902 * @memberOf _ 8903 * @since 4.0.0 8904 * @category String 8905 * @param {string} [string=''] The string to truncate. 8906 * @param {Object} [options={}] The options object. 8907 * @param {number} [options.length=30] The maximum string length. 8908 * @param {string} [options.omission='...'] The string to indicate text is omitted. 8909 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 8910 * @returns {string} Returns the truncated string. 8911 * @example 8912 * 8913 * _.truncate('hi-diddly-ho there, neighborino'); 8914 * // => 'hi-diddly-ho there, neighbo...' 8915 * 8916 * _.truncate('hi-diddly-ho there, neighborino', { 8917 * 'length': 24, 8918 * 'separator': ' ' 8919 * }); 8920 * // => 'hi-diddly-ho there,...' 8921 * 8922 * _.truncate('hi-diddly-ho there, neighborino', { 8923 * 'length': 24, 8924 * 'separator': /,? +/ 8925 * }); 8926 * // => 'hi-diddly-ho there...' 8927 * 8928 * _.truncate('hi-diddly-ho there, neighborino', { 8929 * 'omission': ' [...]' 8930 * }); 8931 * // => 'hi-diddly-ho there, neig [...]' 8932 */function truncate(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator='separator'in options?options.separator:separator;length='length'in options?toInteger(options.length):length;omission='omission'in options?baseToString(options.omission):omission;}string=toString(string);var strLength=string.length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length;}if(length>=strLength){return string;}var end=length-stringSize(omission);if(end<1){return omission;}var result=strSymbols?castSlice(strSymbols,0,end).join(''):string.slice(0,end);if(separator===undefined){return result+omission;}if(strSymbols){end+=result.length-end;}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;if(!separator.global){separator=RegExp(separator.source,toString(reFlags.exec(separator))+'g');}separator.lastIndex=0;while(match=separator.exec(substring)){var newEnd=match.index;}result=result.slice(0,newEnd===undefined?end:newEnd);}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index);}}return result+omission;}/** 8933 * The inverse of `_.escape`; this method converts the HTML entities 8934 * `&`, `<`, `>`, `"`, and `'` in `string` to 8935 * their corresponding characters. 8936 * 8937 * **Note:** No other HTML entities are unescaped. To unescape additional 8938 * HTML entities use a third-party library like [_he_](https://mths.be/he). 8939 * 8940 * @static 8941 * @memberOf _ 8942 * @since 0.6.0 8943 * @category String 8944 * @param {string} [string=''] The string to unescape. 8945 * @returns {string} Returns the unescaped string. 8946 * @example 8947 * 8948 * _.unescape('fred, barney, & pebbles'); 8949 * // => 'fred, barney, & pebbles' 8950 */function unescape(string){string=toString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string;}/** 8951 * Converts `string`, as space separated words, to upper case. 8952 * 8953 * @static 8954 * @memberOf _ 8955 * @since 4.0.0 8956 * @category String 8957 * @param {string} [string=''] The string to convert. 8958 * @returns {string} Returns the upper cased string. 8959 * @example 8960 * 8961 * _.upperCase('--foo-bar'); 8962 * // => 'FOO BAR' 8963 * 8964 * _.upperCase('fooBar'); 8965 * // => 'FOO BAR' 8966 * 8967 * _.upperCase('__foo_bar__'); 8968 * // => 'FOO BAR' 8969 */var upperCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toUpperCase();});/** 8970 * Converts the first character of `string` to upper case. 8971 * 8972 * @static 8973 * @memberOf _ 8974 * @since 4.0.0 8975 * @category String 8976 * @param {string} [string=''] The string to convert. 8977 * @returns {string} Returns the converted string. 8978 * @example 8979 * 8980 * _.upperFirst('fred'); 8981 * // => 'Fred' 8982 * 8983 * _.upperFirst('FRED'); 8984 * // => 'FRED' 8985 */var upperFirst=createCaseFirst('toUpperCase');/** 8986 * Splits `string` into an array of its words. 8987 * 8988 * @static 8989 * @memberOf _ 8990 * @since 3.0.0 8991 * @category String 8992 * @param {string} [string=''] The string to inspect. 8993 * @param {RegExp|string} [pattern] The pattern to match words. 8994 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 8995 * @returns {Array} Returns the words of `string`. 8996 * @example 8997 * 8998 * _.words('fred, barney, & pebbles'); 8999 * // => ['fred', 'barney', 'pebbles'] 9000 * 9001 * _.words('fred, barney, & pebbles', /[^, ]+/g); 9002 * // => ['fred', 'barney', '&', 'pebbles'] 9003 */function words(string,pattern,guard){string=toString(string);pattern=guard?undefined:pattern;if(pattern===undefined){return hasUnicodeWord(string)?unicodeWords(string):asciiWords(string);}return string.match(pattern)||[];}/*------------------------------------------------------------------------*/ /** 9004 * Attempts to invoke `func`, returning either the result or the caught error 9005 * object. Any additional arguments are provided to `func` when it's invoked. 9006 * 9007 * @static 9008 * @memberOf _ 9009 * @since 3.0.0 9010 * @category Util 9011 * @param {Function} func The function to attempt. 9012 * @param {...*} [args] The arguments to invoke `func` with. 9013 * @returns {*} Returns the `func` result or error object. 9014 * @example 9015 * 9016 * // Avoid throwing errors for invalid selectors. 9017 * var elements = _.attempt(function(selector) { 9018 * return document.querySelectorAll(selector); 9019 * }, '>_>'); 9020 * 9021 * if (_.isError(elements)) { 9022 * elements = []; 9023 * } 9024 */var attempt=baseRest(function(func,args){try{return apply(func,undefined,args);}catch(e){return isError(e)?e:new Error(e);}});/** 9025 * Binds methods of an object to the object itself, overwriting the existing 9026 * method. 9027 * 9028 * **Note:** This method doesn't set the "length" property of bound functions. 9029 * 9030 * @static 9031 * @since 0.1.0 9032 * @memberOf _ 9033 * @category Util 9034 * @param {Object} object The object to bind and assign the bound methods to. 9035 * @param {...(string|string[])} methodNames The object method names to bind. 9036 * @returns {Object} Returns `object`. 9037 * @example 9038 * 9039 * var view = { 9040 * 'label': 'docs', 9041 * 'click': function() { 9042 * console.log('clicked ' + this.label); 9043 * } 9044 * }; 9045 * 9046 * _.bindAll(view, ['click']); 9047 * jQuery(element).on('click', view.click); 9048 * // => Logs 'clicked docs' when clicked. 9049 */var bindAll=flatRest(function(object,methodNames){arrayEach(methodNames,function(key){key=toKey(key);baseAssignValue(object,key,bind(object[key],object));});return object;});/** 9050 * Creates a function that iterates over `pairs` and invokes the corresponding 9051 * function of the first predicate to return truthy. The predicate-function 9052 * pairs are invoked with the `this` binding and arguments of the created 9053 * function. 9054 * 9055 * @static 9056 * @memberOf _ 9057 * @since 4.0.0 9058 * @category Util 9059 * @param {Array} pairs The predicate-function pairs. 9060 * @returns {Function} Returns the new composite function. 9061 * @example 9062 * 9063 * var func = _.cond([ 9064 * [_.matches({ 'a': 1 }), _.constant('matches A')], 9065 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 9066 * [_.stubTrue, _.constant('no match')] 9067 * ]); 9068 * 9069 * func({ 'a': 1, 'b': 2 }); 9070 * // => 'matches A' 9071 * 9072 * func({ 'a': 0, 'b': 1 }); 9073 * // => 'matches B' 9074 * 9075 * func({ 'a': '1', 'b': '2' }); 9076 * // => 'no match' 9077 */function cond(pairs){var length=pairs==null?0:pairs.length,toIteratee=getIteratee();pairs=!length?[]:arrayMap(pairs,function(pair){if(typeof pair[1]!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return[toIteratee(pair[0]),pair[1]];});return baseRest(function(args){var index=-1;while(++index<length){var pair=pairs[index];if(apply(pair[0],this,args)){return apply(pair[1],this,args);}}});}/** 9078 * Creates a function that invokes the predicate properties of `source` with 9079 * the corresponding property values of a given object, returning `true` if 9080 * all predicates return truthy, else `false`. 9081 * 9082 * **Note:** The created function is equivalent to `_.conformsTo` with 9083 * `source` partially applied. 9084 * 9085 * @static 9086 * @memberOf _ 9087 * @since 4.0.0 9088 * @category Util 9089 * @param {Object} source The object of property predicates to conform to. 9090 * @returns {Function} Returns the new spec function. 9091 * @example 9092 * 9093 * var objects = [ 9094 * { 'a': 2, 'b': 1 }, 9095 * { 'a': 1, 'b': 2 } 9096 * ]; 9097 * 9098 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 9099 * // => [{ 'a': 1, 'b': 2 }] 9100 */function conforms(source){return baseConforms(baseClone(source,CLONE_DEEP_FLAG));}/** 9101 * Creates a function that returns `value`. 9102 * 9103 * @static 9104 * @memberOf _ 9105 * @since 2.4.0 9106 * @category Util 9107 * @param {*} value The value to return from the new function. 9108 * @returns {Function} Returns the new constant function. 9109 * @example 9110 * 9111 * var objects = _.times(2, _.constant({ 'a': 1 })); 9112 * 9113 * console.log(objects); 9114 * // => [{ 'a': 1 }, { 'a': 1 }] 9115 * 9116 * console.log(objects[0] === objects[1]); 9117 * // => true 9118 */function constant(value){return function(){return value;};}/** 9119 * Checks `value` to determine whether a default value should be returned in 9120 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 9121 * or `undefined`. 9122 * 9123 * @static 9124 * @memberOf _ 9125 * @since 4.14.0 9126 * @category Util 9127 * @param {*} value The value to check. 9128 * @param {*} defaultValue The default value. 9129 * @returns {*} Returns the resolved value. 9130 * @example 9131 * 9132 * _.defaultTo(1, 10); 9133 * // => 1 9134 * 9135 * _.defaultTo(undefined, 10); 9136 * // => 10 9137 */function defaultTo(value,defaultValue){return value==null||value!==value?defaultValue:value;}/** 9138 * Creates a function that returns the result of invoking the given functions 9139 * with the `this` binding of the created function, where each successive 9140 * invocation is supplied the return value of the previous. 9141 * 9142 * @static 9143 * @memberOf _ 9144 * @since 3.0.0 9145 * @category Util 9146 * @param {...(Function|Function[])} [funcs] The functions to invoke. 9147 * @returns {Function} Returns the new composite function. 9148 * @see _.flowRight 9149 * @example 9150 * 9151 * function square(n) { 9152 * return n * n; 9153 * } 9154 * 9155 * var addSquare = _.flow([_.add, square]); 9156 * addSquare(1, 2); 9157 * // => 9 9158 */var flow=createFlow();/** 9159 * This method is like `_.flow` except that it creates a function that 9160 * invokes the given functions from right to left. 9161 * 9162 * @static 9163 * @since 3.0.0 9164 * @memberOf _ 9165 * @category Util 9166 * @param {...(Function|Function[])} [funcs] The functions to invoke. 9167 * @returns {Function} Returns the new composite function. 9168 * @see _.flow 9169 * @example 9170 * 9171 * function square(n) { 9172 * return n * n; 9173 * } 9174 * 9175 * var addSquare = _.flowRight([square, _.add]); 9176 * addSquare(1, 2); 9177 * // => 9 9178 */var flowRight=createFlow(true);/** 9179 * This method returns the first argument it receives. 9180 * 9181 * @static 9182 * @since 0.1.0 9183 * @memberOf _ 9184 * @category Util 9185 * @param {*} value Any value. 9186 * @returns {*} Returns `value`. 9187 * @example 9188 * 9189 * var object = { 'a': 1 }; 9190 * 9191 * console.log(_.identity(object) === object); 9192 * // => true 9193 */function identity(value){return value;}/** 9194 * Creates a function that invokes `func` with the arguments of the created 9195 * function. If `func` is a property name, the created function returns the 9196 * property value for a given element. If `func` is an array or object, the 9197 * created function returns `true` for elements that contain the equivalent 9198 * source properties, otherwise it returns `false`. 9199 * 9200 * @static 9201 * @since 4.0.0 9202 * @memberOf _ 9203 * @category Util 9204 * @param {*} [func=_.identity] The value to convert to a callback. 9205 * @returns {Function} Returns the callback. 9206 * @example 9207 * 9208 * var users = [ 9209 * { 'user': 'barney', 'age': 36, 'active': true }, 9210 * { 'user': 'fred', 'age': 40, 'active': false } 9211 * ]; 9212 * 9213 * // The `_.matches` iteratee shorthand. 9214 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 9215 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 9216 * 9217 * // The `_.matchesProperty` iteratee shorthand. 9218 * _.filter(users, _.iteratee(['user', 'fred'])); 9219 * // => [{ 'user': 'fred', 'age': 40 }] 9220 * 9221 * // The `_.property` iteratee shorthand. 9222 * _.map(users, _.iteratee('user')); 9223 * // => ['barney', 'fred'] 9224 * 9225 * // Create custom iteratee shorthands. 9226 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 9227 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 9228 * return func.test(string); 9229 * }; 9230 * }); 9231 * 9232 * _.filter(['abc', 'def'], /ef/); 9233 * // => ['def'] 9234 */function iteratee(func){return baseIteratee(typeof func=='function'?func:baseClone(func,CLONE_DEEP_FLAG));}/** 9235 * Creates a function that performs a partial deep comparison between a given 9236 * object and `source`, returning `true` if the given object has equivalent 9237 * property values, else `false`. 9238 * 9239 * **Note:** The created function is equivalent to `_.isMatch` with `source` 9240 * partially applied. 9241 * 9242 * Partial comparisons will match empty array and empty object `source` 9243 * values against any array or object value, respectively. See `_.isEqual` 9244 * for a list of supported value comparisons. 9245 * 9246 * **Note:** Multiple values can be checked by combining several matchers 9247 * using `_.overSome` 9248 * 9249 * @static 9250 * @memberOf _ 9251 * @since 3.0.0 9252 * @category Util 9253 * @param {Object} source The object of property values to match. 9254 * @returns {Function} Returns the new spec function. 9255 * @example 9256 * 9257 * var objects = [ 9258 * { 'a': 1, 'b': 2, 'c': 3 }, 9259 * { 'a': 4, 'b': 5, 'c': 6 } 9260 * ]; 9261 * 9262 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 9263 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 9264 * 9265 * // Checking for several possible values 9266 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 9267 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 9268 */function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG));}/** 9269 * Creates a function that performs a partial deep comparison between the 9270 * value at `path` of a given object to `srcValue`, returning `true` if the 9271 * object value is equivalent, else `false`. 9272 * 9273 * **Note:** Partial comparisons will match empty array and empty object 9274 * `srcValue` values against any array or object value, respectively. See 9275 * `_.isEqual` for a list of supported value comparisons. 9276 * 9277 * **Note:** Multiple values can be checked by combining several matchers 9278 * using `_.overSome` 9279 * 9280 * @static 9281 * @memberOf _ 9282 * @since 3.2.0 9283 * @category Util 9284 * @param {Array|string} path The path of the property to get. 9285 * @param {*} srcValue The value to match. 9286 * @returns {Function} Returns the new spec function. 9287 * @example 9288 * 9289 * var objects = [ 9290 * { 'a': 1, 'b': 2, 'c': 3 }, 9291 * { 'a': 4, 'b': 5, 'c': 6 } 9292 * ]; 9293 * 9294 * _.find(objects, _.matchesProperty('a', 4)); 9295 * // => { 'a': 4, 'b': 5, 'c': 6 } 9296 * 9297 * // Checking for several possible values 9298 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 9299 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 9300 */function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,CLONE_DEEP_FLAG));}/** 9301 * Creates a function that invokes the method at `path` of a given object. 9302 * Any additional arguments are provided to the invoked method. 9303 * 9304 * @static 9305 * @memberOf _ 9306 * @since 3.7.0 9307 * @category Util 9308 * @param {Array|string} path The path of the method to invoke. 9309 * @param {...*} [args] The arguments to invoke the method with. 9310 * @returns {Function} Returns the new invoker function. 9311 * @example 9312 * 9313 * var objects = [ 9314 * { 'a': { 'b': _.constant(2) } }, 9315 * { 'a': { 'b': _.constant(1) } } 9316 * ]; 9317 * 9318 * _.map(objects, _.method('a.b')); 9319 * // => [2, 1] 9320 * 9321 * _.map(objects, _.method(['a', 'b'])); 9322 * // => [2, 1] 9323 */var method=baseRest(function(path,args){return function(object){return baseInvoke(object,path,args);};});/** 9324 * The opposite of `_.method`; this method creates a function that invokes 9325 * the method at a given path of `object`. Any additional arguments are 9326 * provided to the invoked method. 9327 * 9328 * @static 9329 * @memberOf _ 9330 * @since 3.7.0 9331 * @category Util 9332 * @param {Object} object The object to query. 9333 * @param {...*} [args] The arguments to invoke the method with. 9334 * @returns {Function} Returns the new invoker function. 9335 * @example 9336 * 9337 * var array = _.times(3, _.constant), 9338 * object = { 'a': array, 'b': array, 'c': array }; 9339 * 9340 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 9341 * // => [2, 0] 9342 * 9343 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 9344 * // => [2, 0] 9345 */var methodOf=baseRest(function(object,args){return function(path){return baseInvoke(object,path,args);};});/** 9346 * Adds all own enumerable string keyed function properties of a source 9347 * object to the destination object. If `object` is a function, then methods 9348 * are added to its prototype as well. 9349 * 9350 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 9351 * avoid conflicts caused by modifying the original. 9352 * 9353 * @static 9354 * @since 0.1.0 9355 * @memberOf _ 9356 * @category Util 9357 * @param {Function|Object} [object=lodash] The destination object. 9358 * @param {Object} source The object of functions to add. 9359 * @param {Object} [options={}] The options object. 9360 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 9361 * @returns {Function|Object} Returns `object`. 9362 * @example 9363 * 9364 * function vowels(string) { 9365 * return _.filter(string, function(v) { 9366 * return /[aeiou]/i.test(v); 9367 * }); 9368 * } 9369 * 9370 * _.mixin({ 'vowels': vowels }); 9371 * _.vowels('fred'); 9372 * // => ['e'] 9373 * 9374 * _('fred').vowels().value(); 9375 * // => ['e'] 9376 * 9377 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 9378 * _('fred').vowels(); 9379 * // => ['e'] 9380 */function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);if(options==null&&!(isObject(source)&&(methodNames.length||!props.length))){options=source;source=object;object=this;methodNames=baseFunctions(source,keys(source));}var chain=!(isObject(options)&&'chain'in options)||!!options.chain,isFunc=isFunction(object);arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func;if(isFunc){object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);actions.push({'func':func,'args':arguments,'thisArg':object});result.__chain__=chainAll;return result;}return func.apply(object,arrayPush([this.value()],arguments));};}});return object;}/** 9381 * Reverts the `_` variable to its previous value and returns a reference to 9382 * the `lodash` function. 9383 * 9384 * @static 9385 * @since 0.1.0 9386 * @memberOf _ 9387 * @category Util 9388 * @returns {Function} Returns the `lodash` function. 9389 * @example 9390 * 9391 * var lodash = _.noConflict(); 9392 */function noConflict(){if(root._===this){root._=oldDash;}return this;}/** 9393 * This method returns `undefined`. 9394 * 9395 * @static 9396 * @memberOf _ 9397 * @since 2.3.0 9398 * @category Util 9399 * @example 9400 * 9401 * _.times(2, _.noop); 9402 * // => [undefined, undefined] 9403 */function noop(){// No operation performed. 9404}/** 9405 * Creates a function that gets the argument at index `n`. If `n` is negative, 9406 * the nth argument from the end is returned. 9407 * 9408 * @static 9409 * @memberOf _ 9410 * @since 4.0.0 9411 * @category Util 9412 * @param {number} [n=0] The index of the argument to return. 9413 * @returns {Function} Returns the new pass-thru function. 9414 * @example 9415 * 9416 * var func = _.nthArg(1); 9417 * func('a', 'b', 'c', 'd'); 9418 * // => 'b' 9419 * 9420 * var func = _.nthArg(-2); 9421 * func('a', 'b', 'c', 'd'); 9422 * // => 'c' 9423 */function nthArg(n){n=toInteger(n);return baseRest(function(args){return baseNth(args,n);});}/** 9424 * Creates a function that invokes `iteratees` with the arguments it receives 9425 * and returns their results. 9426 * 9427 * @static 9428 * @memberOf _ 9429 * @since 4.0.0 9430 * @category Util 9431 * @param {...(Function|Function[])} [iteratees=[_.identity]] 9432 * The iteratees to invoke. 9433 * @returns {Function} Returns the new function. 9434 * @example 9435 * 9436 * var func = _.over([Math.max, Math.min]); 9437 * 9438 * func(1, 2, 3, 4); 9439 * // => [4, 1] 9440 */var over=createOver(arrayMap);/** 9441 * Creates a function that checks if **all** of the `predicates` return 9442 * truthy when invoked with the arguments it receives. 9443 * 9444 * Following shorthands are possible for providing predicates. 9445 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 9446 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 9447 * 9448 * @static 9449 * @memberOf _ 9450 * @since 4.0.0 9451 * @category Util 9452 * @param {...(Function|Function[])} [predicates=[_.identity]] 9453 * The predicates to check. 9454 * @returns {Function} Returns the new function. 9455 * @example 9456 * 9457 * var func = _.overEvery([Boolean, isFinite]); 9458 * 9459 * func('1'); 9460 * // => true 9461 * 9462 * func(null); 9463 * // => false 9464 * 9465 * func(NaN); 9466 * // => false 9467 */var overEvery=createOver(arrayEvery);/** 9468 * Creates a function that checks if **any** of the `predicates` return 9469 * truthy when invoked with the arguments it receives. 9470 * 9471 * Following shorthands are possible for providing predicates. 9472 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 9473 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 9474 * 9475 * @static 9476 * @memberOf _ 9477 * @since 4.0.0 9478 * @category Util 9479 * @param {...(Function|Function[])} [predicates=[_.identity]] 9480 * The predicates to check. 9481 * @returns {Function} Returns the new function. 9482 * @example 9483 * 9484 * var func = _.overSome([Boolean, isFinite]); 9485 * 9486 * func('1'); 9487 * // => true 9488 * 9489 * func(null); 9490 * // => true 9491 * 9492 * func(NaN); 9493 * // => false 9494 * 9495 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 9496 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 9497 */var overSome=createOver(arraySome);/** 9498 * Creates a function that returns the value at `path` of a given object. 9499 * 9500 * @static 9501 * @memberOf _ 9502 * @since 2.4.0 9503 * @category Util 9504 * @param {Array|string} path The path of the property to get. 9505 * @returns {Function} Returns the new accessor function. 9506 * @example 9507 * 9508 * var objects = [ 9509 * { 'a': { 'b': 2 } }, 9510 * { 'a': { 'b': 1 } } 9511 * ]; 9512 * 9513 * _.map(objects, _.property('a.b')); 9514 * // => [2, 1] 9515 * 9516 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 9517 * // => [1, 2] 9518 */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path);}/** 9519 * The opposite of `_.property`; this method creates a function that returns 9520 * the value at a given path of `object`. 9521 * 9522 * @static 9523 * @memberOf _ 9524 * @since 3.0.0 9525 * @category Util 9526 * @param {Object} object The object to query. 9527 * @returns {Function} Returns the new accessor function. 9528 * @example 9529 * 9530 * var array = [0, 1, 2], 9531 * object = { 'a': array, 'b': array, 'c': array }; 9532 * 9533 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 9534 * // => [2, 0] 9535 * 9536 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 9537 * // => [2, 0] 9538 */function propertyOf(object){return function(path){return object==null?undefined:baseGet(object,path);};}/** 9539 * Creates an array of numbers (positive and/or negative) progressing from 9540 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 9541 * `start` is specified without an `end` or `step`. If `end` is not specified, 9542 * it's set to `start` with `start` then set to `0`. 9543 * 9544 * **Note:** JavaScript follows the IEEE-754 standard for resolving 9545 * floating-point values which can produce unexpected results. 9546 * 9547 * @static 9548 * @since 0.1.0 9549 * @memberOf _ 9550 * @category Util 9551 * @param {number} [start=0] The start of the range. 9552 * @param {number} end The end of the range. 9553 * @param {number} [step=1] The value to increment or decrement by. 9554 * @returns {Array} Returns the range of numbers. 9555 * @see _.inRange, _.rangeRight 9556 * @example 9557 * 9558 * _.range(4); 9559 * // => [0, 1, 2, 3] 9560 * 9561 * _.range(-4); 9562 * // => [0, -1, -2, -3] 9563 * 9564 * _.range(1, 5); 9565 * // => [1, 2, 3, 4] 9566 * 9567 * _.range(0, 20, 5); 9568 * // => [0, 5, 10, 15] 9569 * 9570 * _.range(0, -4, -1); 9571 * // => [0, -1, -2, -3] 9572 * 9573 * _.range(1, 4, 0); 9574 * // => [1, 1, 1] 9575 * 9576 * _.range(0); 9577 * // => [] 9578 */var range=createRange();/** 9579 * This method is like `_.range` except that it populates values in 9580 * descending order. 9581 * 9582 * @static 9583 * @memberOf _ 9584 * @since 4.0.0 9585 * @category Util 9586 * @param {number} [start=0] The start of the range. 9587 * @param {number} end The end of the range. 9588 * @param {number} [step=1] The value to increment or decrement by. 9589 * @returns {Array} Returns the range of numbers. 9590 * @see _.inRange, _.range 9591 * @example 9592 * 9593 * _.rangeRight(4); 9594 * // => [3, 2, 1, 0] 9595 * 9596 * _.rangeRight(-4); 9597 * // => [-3, -2, -1, 0] 9598 * 9599 * _.rangeRight(1, 5); 9600 * // => [4, 3, 2, 1] 9601 * 9602 * _.rangeRight(0, 20, 5); 9603 * // => [15, 10, 5, 0] 9604 * 9605 * _.rangeRight(0, -4, -1); 9606 * // => [-3, -2, -1, 0] 9607 * 9608 * _.rangeRight(1, 4, 0); 9609 * // => [1, 1, 1] 9610 * 9611 * _.rangeRight(0); 9612 * // => [] 9613 */var rangeRight=createRange(true);/** 9614 * This method returns a new empty array. 9615 * 9616 * @static 9617 * @memberOf _ 9618 * @since 4.13.0 9619 * @category Util 9620 * @returns {Array} Returns the new empty array. 9621 * @example 9622 * 9623 * var arrays = _.times(2, _.stubArray); 9624 * 9625 * console.log(arrays); 9626 * // => [[], []] 9627 * 9628 * console.log(arrays[0] === arrays[1]); 9629 * // => false 9630 */function stubArray(){return[];}/** 9631 * This method returns `false`. 9632 * 9633 * @static 9634 * @memberOf _ 9635 * @since 4.13.0 9636 * @category Util 9637 * @returns {boolean} Returns `false`. 9638 * @example 9639 * 9640 * _.times(2, _.stubFalse); 9641 * // => [false, false] 9642 */function stubFalse(){return false;}/** 9643 * This method returns a new empty object. 9644 * 9645 * @static 9646 * @memberOf _ 9647 * @since 4.13.0 9648 * @category Util 9649 * @returns {Object} Returns the new empty object. 9650 * @example 9651 * 9652 * var objects = _.times(2, _.stubObject); 9653 * 9654 * console.log(objects); 9655 * // => [{}, {}] 9656 * 9657 * console.log(objects[0] === objects[1]); 9658 * // => false 9659 */function stubObject(){return{};}/** 9660 * This method returns an empty string. 9661 * 9662 * @static 9663 * @memberOf _ 9664 * @since 4.13.0 9665 * @category Util 9666 * @returns {string} Returns the empty string. 9667 * @example 9668 * 9669 * _.times(2, _.stubString); 9670 * // => ['', ''] 9671 */function stubString(){return'';}/** 9672 * This method returns `true`. 9673 * 9674 * @static 9675 * @memberOf _ 9676 * @since 4.13.0 9677 * @category Util 9678 * @returns {boolean} Returns `true`. 9679 * @example 9680 * 9681 * _.times(2, _.stubTrue); 9682 * // => [true, true] 9683 */function stubTrue(){return true;}/** 9684 * Invokes the iteratee `n` times, returning an array of the results of 9685 * each invocation. The iteratee is invoked with one argument; (index). 9686 * 9687 * @static 9688 * @since 0.1.0 9689 * @memberOf _ 9690 * @category Util 9691 * @param {number} n The number of times to invoke `iteratee`. 9692 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 9693 * @returns {Array} Returns the array of results. 9694 * @example 9695 * 9696 * _.times(3, String); 9697 * // => ['0', '1', '2'] 9698 * 9699 * _.times(4, _.constant(0)); 9700 * // => [0, 0, 0, 0] 9701 */function times(n,iteratee){n=toInteger(n);if(n<1||n>MAX_SAFE_INTEGER){return[];}var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee);n-=MAX_ARRAY_LENGTH;var result=baseTimes(length,iteratee);while(++index<n){iteratee(index);}return result;}/** 9702 * Converts `value` to a property path array. 9703 * 9704 * @static 9705 * @memberOf _ 9706 * @since 4.0.0 9707 * @category Util 9708 * @param {*} value The value to convert. 9709 * @returns {Array} Returns the new property path array. 9710 * @example 9711 * 9712 * _.toPath('a.b.c'); 9713 * // => ['a', 'b', 'c'] 9714 * 9715 * _.toPath('a[0].b.c'); 9716 * // => ['a', '0', 'b', 'c'] 9717 */function toPath(value){if(isArray(value)){return arrayMap(value,toKey);}return isSymbol(value)?[value]:copyArray(stringToPath(toString(value)));}/** 9718 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 9719 * 9720 * @static 9721 * @since 0.1.0 9722 * @memberOf _ 9723 * @category Util 9724 * @param {string} [prefix=''] The value to prefix the ID with. 9725 * @returns {string} Returns the unique ID. 9726 * @example 9727 * 9728 * _.uniqueId('contact_'); 9729 * // => 'contact_104' 9730 * 9731 * _.uniqueId(); 9732 * // => '105' 9733 */function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id;}/*------------------------------------------------------------------------*/ /** 9734 * Adds two numbers. 9735 * 9736 * @static 9737 * @memberOf _ 9738 * @since 3.4.0 9739 * @category Math 9740 * @param {number} augend The first number in an addition. 9741 * @param {number} addend The second number in an addition. 9742 * @returns {number} Returns the total. 9743 * @example 9744 * 9745 * _.add(6, 4); 9746 * // => 10 9747 */var add=createMathOperation(function(augend,addend){return augend+addend;},0);/** 9748 * Computes `number` rounded up to `precision`. 9749 * 9750 * @static 9751 * @memberOf _ 9752 * @since 3.10.0 9753 * @category Math 9754 * @param {number} number The number to round up. 9755 * @param {number} [precision=0] The precision to round up to. 9756 * @returns {number} Returns the rounded up number. 9757 * @example 9758 * 9759 * _.ceil(4.006); 9760 * // => 5 9761 * 9762 * _.ceil(6.004, 2); 9763 * // => 6.01 9764 * 9765 * _.ceil(6040, -2); 9766 * // => 6100 9767 */var ceil=createRound('ceil');/** 9768 * Divide two numbers. 9769 * 9770 * @static 9771 * @memberOf _ 9772 * @since 4.7.0 9773 * @category Math 9774 * @param {number} dividend The first number in a division. 9775 * @param {number} divisor The second number in a division. 9776 * @returns {number} Returns the quotient. 9777 * @example 9778 * 9779 * _.divide(6, 4); 9780 * // => 1.5 9781 */var divide=createMathOperation(function(dividend,divisor){return dividend/divisor;},1);/** 9782 * Computes `number` rounded down to `precision`. 9783 * 9784 * @static 9785 * @memberOf _ 9786 * @since 3.10.0 9787 * @category Math 9788 * @param {number} number The number to round down. 9789 * @param {number} [precision=0] The precision to round down to. 9790 * @returns {number} Returns the rounded down number. 9791 * @example 9792 * 9793 * _.floor(4.006); 9794 * // => 4 9795 * 9796 * _.floor(0.046, 2); 9797 * // => 0.04 9798 * 9799 * _.floor(4060, -2); 9800 * // => 4000 9801 */var floor=createRound('floor');/** 9802 * Computes the maximum value of `array`. If `array` is empty or falsey, 9803 * `undefined` is returned. 9804 * 9805 * @static 9806 * @since 0.1.0 9807 * @memberOf _ 9808 * @category Math 9809 * @param {Array} array The array to iterate over. 9810 * @returns {*} Returns the maximum value. 9811 * @example 9812 * 9813 * _.max([4, 2, 8, 6]); 9814 * // => 8 9815 * 9816 * _.max([]); 9817 * // => undefined 9818 */function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined;}/** 9819 * This method is like `_.max` except that it accepts `iteratee` which is 9820 * invoked for each element in `array` to generate the criterion by which 9821 * the value is ranked. The iteratee is invoked with one argument: (value). 9822 * 9823 * @static 9824 * @memberOf _ 9825 * @since 4.0.0 9826 * @category Math 9827 * @param {Array} array The array to iterate over. 9828 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 9829 * @returns {*} Returns the maximum value. 9830 * @example 9831 * 9832 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 9833 * 9834 * _.maxBy(objects, function(o) { return o.n; }); 9835 * // => { 'n': 2 } 9836 * 9837 * // The `_.property` iteratee shorthand. 9838 * _.maxBy(objects, 'n'); 9839 * // => { 'n': 2 } 9840 */function maxBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined;}/** 9841 * Computes the mean of the values in `array`. 9842 * 9843 * @static 9844 * @memberOf _ 9845 * @since 4.0.0 9846 * @category Math 9847 * @param {Array} array The array to iterate over. 9848 * @returns {number} Returns the mean. 9849 * @example 9850 * 9851 * _.mean([4, 2, 8, 6]); 9852 * // => 5 9853 */function mean(array){return baseMean(array,identity);}/** 9854 * This method is like `_.mean` except that it accepts `iteratee` which is 9855 * invoked for each element in `array` to generate the value to be averaged. 9856 * The iteratee is invoked with one argument: (value). 9857 * 9858 * @static 9859 * @memberOf _ 9860 * @since 4.7.0 9861 * @category Math 9862 * @param {Array} array The array to iterate over. 9863 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 9864 * @returns {number} Returns the mean. 9865 * @example 9866 * 9867 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 9868 * 9869 * _.meanBy(objects, function(o) { return o.n; }); 9870 * // => 5 9871 * 9872 * // The `_.property` iteratee shorthand. 9873 * _.meanBy(objects, 'n'); 9874 * // => 5 9875 */function meanBy(array,iteratee){return baseMean(array,getIteratee(iteratee,2));}/** 9876 * Computes the minimum value of `array`. If `array` is empty or falsey, 9877 * `undefined` is returned. 9878 * 9879 * @static 9880 * @since 0.1.0 9881 * @memberOf _ 9882 * @category Math 9883 * @param {Array} array The array to iterate over. 9884 * @returns {*} Returns the minimum value. 9885 * @example 9886 * 9887 * _.min([4, 2, 8, 6]); 9888 * // => 2 9889 * 9890 * _.min([]); 9891 * // => undefined 9892 */function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined;}/** 9893 * This method is like `_.min` except that it accepts `iteratee` which is 9894 * invoked for each element in `array` to generate the criterion by which 9895 * the value is ranked. The iteratee is invoked with one argument: (value). 9896 * 9897 * @static 9898 * @memberOf _ 9899 * @since 4.0.0 9900 * @category Math 9901 * @param {Array} array The array to iterate over. 9902 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 9903 * @returns {*} Returns the minimum value. 9904 * @example 9905 * 9906 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 9907 * 9908 * _.minBy(objects, function(o) { return o.n; }); 9909 * // => { 'n': 1 } 9910 * 9911 * // The `_.property` iteratee shorthand. 9912 * _.minBy(objects, 'n'); 9913 * // => { 'n': 1 } 9914 */function minBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined;}/** 9915 * Multiply two numbers. 9916 * 9917 * @static 9918 * @memberOf _ 9919 * @since 4.7.0 9920 * @category Math 9921 * @param {number} multiplier The first number in a multiplication. 9922 * @param {number} multiplicand The second number in a multiplication. 9923 * @returns {number} Returns the product. 9924 * @example 9925 * 9926 * _.multiply(6, 4); 9927 * // => 24 9928 */var multiply=createMathOperation(function(multiplier,multiplicand){return multiplier*multiplicand;},1);/** 9929 * Computes `number` rounded to `precision`. 9930 * 9931 * @static 9932 * @memberOf _ 9933 * @since 3.10.0 9934 * @category Math 9935 * @param {number} number The number to round. 9936 * @param {number} [precision=0] The precision to round to. 9937 * @returns {number} Returns the rounded number. 9938 * @example 9939 * 9940 * _.round(4.006); 9941 * // => 4 9942 * 9943 * _.round(4.006, 2); 9944 * // => 4.01 9945 * 9946 * _.round(4060, -2); 9947 * // => 4100 9948 */var round=createRound('round');/** 9949 * Subtract two numbers. 9950 * 9951 * @static 9952 * @memberOf _ 9953 * @since 4.0.0 9954 * @category Math 9955 * @param {number} minuend The first number in a subtraction. 9956 * @param {number} subtrahend The second number in a subtraction. 9957 * @returns {number} Returns the difference. 9958 * @example 9959 * 9960 * _.subtract(6, 4); 9961 * // => 2 9962 */var subtract=createMathOperation(function(minuend,subtrahend){return minuend-subtrahend;},0);/** 9963 * Computes the sum of the values in `array`. 9964 * 9965 * @static 9966 * @memberOf _ 9967 * @since 3.4.0 9968 * @category Math 9969 * @param {Array} array The array to iterate over. 9970 * @returns {number} Returns the sum. 9971 * @example 9972 * 9973 * _.sum([4, 2, 8, 6]); 9974 * // => 20 9975 */function sum(array){return array&&array.length?baseSum(array,identity):0;}/** 9976 * This method is like `_.sum` except that it accepts `iteratee` which is 9977 * invoked for each element in `array` to generate the value to be summed. 9978 * The iteratee is invoked with one argument: (value). 9979 * 9980 * @static 9981 * @memberOf _ 9982 * @since 4.0.0 9983 * @category Math 9984 * @param {Array} array The array to iterate over. 9985 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 9986 * @returns {number} Returns the sum. 9987 * @example 9988 * 9989 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 9990 * 9991 * _.sumBy(objects, function(o) { return o.n; }); 9992 * // => 20 9993 * 9994 * // The `_.property` iteratee shorthand. 9995 * _.sumBy(objects, 'n'); 9996 * // => 20 9997 */function sumBy(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0;}/*------------------------------------------------------------------------*/ // Add methods that return wrapped values in chain sequences. 9998lodash.after=after;lodash.ary=ary;lodash.assign=assign;lodash.assignIn=assignIn;lodash.assignInWith=assignInWith;lodash.assignWith=assignWith;lodash.at=at;lodash.before=before;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.castArray=castArray;lodash.chain=chain;lodash.chunk=chunk;lodash.compact=compact;lodash.concat=concat;lodash.cond=cond;lodash.conforms=conforms;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.curry=curry;lodash.curryRight=curryRight;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defaultsDeep=defaultsDeep;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.differenceBy=differenceBy;lodash.differenceWith=differenceWith;lodash.drop=drop;lodash.dropRight=dropRight;lodash.dropRightWhile=dropRightWhile;lodash.dropWhile=dropWhile;lodash.fill=fill;lodash.filter=filter;lodash.flatMap=flatMap;lodash.flatMapDeep=flatMapDeep;lodash.flatMapDepth=flatMapDepth;lodash.flatten=flatten;lodash.flattenDeep=flattenDeep;lodash.flattenDepth=flattenDepth;lodash.flip=flip;lodash.flow=flow;lodash.flowRight=flowRight;lodash.fromPairs=fromPairs;lodash.functions=functions;lodash.functionsIn=functionsIn;lodash.groupBy=groupBy;lodash.initial=initial;lodash.intersection=intersection;lodash.intersectionBy=intersectionBy;lodash.intersectionWith=intersectionWith;lodash.invert=invert;lodash.invertBy=invertBy;lodash.invokeMap=invokeMap;lodash.iteratee=iteratee;lodash.keyBy=keyBy;lodash.keys=keys;lodash.keysIn=keysIn;lodash.map=map;lodash.mapKeys=mapKeys;lodash.mapValues=mapValues;lodash.matches=matches;lodash.matchesProperty=matchesProperty;lodash.memoize=memoize;lodash.merge=merge;lodash.mergeWith=mergeWith;lodash.method=method;lodash.methodOf=methodOf;lodash.mixin=mixin;lodash.negate=negate;lodash.nthArg=nthArg;lodash.omit=omit;lodash.omitBy=omitBy;lodash.once=once;lodash.orderBy=orderBy;lodash.over=over;lodash.overArgs=overArgs;lodash.overEvery=overEvery;lodash.overSome=overSome;lodash.partial=partial;lodash.partialRight=partialRight;lodash.partition=partition;lodash.pick=pick;lodash.pickBy=pickBy;lodash.property=property;lodash.propertyOf=propertyOf;lodash.pull=pull;lodash.pullAll=pullAll;lodash.pullAllBy=pullAllBy;lodash.pullAllWith=pullAllWith;lodash.pullAt=pullAt;lodash.range=range;lodash.rangeRight=rangeRight;lodash.rearg=rearg;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.reverse=reverse;lodash.sampleSize=sampleSize;lodash.set=set;lodash.setWith=setWith;lodash.shuffle=shuffle;lodash.slice=slice;lodash.sortBy=sortBy;lodash.sortedUniq=sortedUniq;lodash.sortedUniqBy=sortedUniqBy;lodash.split=split;lodash.spread=spread;lodash.tail=tail;lodash.take=take;lodash.takeRight=takeRight;lodash.takeRightWhile=takeRightWhile;lodash.takeWhile=takeWhile;lodash.tap=tap;lodash.throttle=throttle;lodash.thru=thru;lodash.toArray=toArray;lodash.toPairs=toPairs;lodash.toPairsIn=toPairsIn;lodash.toPath=toPath;lodash.toPlainObject=toPlainObject;lodash.transform=transform;lodash.unary=unary;lodash.union=union;lodash.unionBy=unionBy;lodash.unionWith=unionWith;lodash.uniq=uniq;lodash.uniqBy=uniqBy;lodash.uniqWith=uniqWith;lodash.unset=unset;lodash.unzip=unzip;lodash.unzipWith=unzipWith;lodash.update=update;lodash.updateWith=updateWith;lodash.values=values;lodash.valuesIn=valuesIn;lodash.without=without;lodash.words=words;lodash.wrap=wrap;lodash.xor=xor;lodash.xorBy=xorBy;lodash.xorWith=xorWith;lodash.zip=zip;lodash.zipObject=zipObject;lodash.zipObjectDeep=zipObjectDeep;lodash.zipWith=zipWith;// Add aliases. 9999lodash.entries=toPairs;lodash.entriesIn=toPairsIn;lodash.extend=assignIn;lodash.extendWith=assignInWith;// Add methods to `lodash.prototype`. 10000mixin(lodash,lodash);/*------------------------------------------------------------------------*/ // Add methods that return unwrapped values in chain sequences. 10001lodash.add=add;lodash.attempt=attempt;lodash.camelCase=camelCase;lodash.capitalize=capitalize;lodash.ceil=ceil;lodash.clamp=clamp;lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.cloneDeepWith=cloneDeepWith;lodash.cloneWith=cloneWith;lodash.conformsTo=conformsTo;lodash.deburr=deburr;lodash.defaultTo=defaultTo;lodash.divide=divide;lodash.endsWith=endsWith;lodash.eq=eq;lodash.escape=escape;lodash.escapeRegExp=escapeRegExp;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.floor=floor;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.get=get;lodash.gt=gt;lodash.gte=gte;lodash.has=has;lodash.hasIn=hasIn;lodash.head=head;lodash.identity=identity;lodash.includes=includes;lodash.indexOf=indexOf;lodash.inRange=inRange;lodash.invoke=invoke;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isArrayBuffer=isArrayBuffer;lodash.isArrayLike=isArrayLike;lodash.isArrayLikeObject=isArrayLikeObject;lodash.isBoolean=isBoolean;lodash.isBuffer=isBuffer;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isEqualWith=isEqualWith;lodash.isError=isError;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isInteger=isInteger;lodash.isLength=isLength;lodash.isMap=isMap;lodash.isMatch=isMatch;lodash.isMatchWith=isMatchWith;lodash.isNaN=isNaN;lodash.isNative=isNative;lodash.isNil=isNil;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isObjectLike=isObjectLike;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isSafeInteger=isSafeInteger;lodash.isSet=isSet;lodash.isString=isString;lodash.isSymbol=isSymbol;lodash.isTypedArray=isTypedArray;lodash.isUndefined=isUndefined;lodash.isWeakMap=isWeakMap;lodash.isWeakSet=isWeakSet;lodash.join=join;lodash.kebabCase=kebabCase;lodash.last=last;lodash.lastIndexOf=lastIndexOf;lodash.lowerCase=lowerCase;lodash.lowerFirst=lowerFirst;lodash.lt=lt;lodash.lte=lte;lodash.max=max;lodash.maxBy=maxBy;lodash.mean=mean;lodash.meanBy=meanBy;lodash.min=min;lodash.minBy=minBy;lodash.stubArray=stubArray;lodash.stubFalse=stubFalse;lodash.stubObject=stubObject;lodash.stubString=stubString;lodash.stubTrue=stubTrue;lodash.multiply=multiply;lodash.nth=nth;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.pad=pad;lodash.padEnd=padEnd;lodash.padStart=padStart;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.repeat=repeat;lodash.replace=replace;lodash.result=result;lodash.round=round;lodash.runInContext=runInContext;lodash.sample=sample;lodash.size=size;lodash.snakeCase=snakeCase;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.sortedIndexBy=sortedIndexBy;lodash.sortedIndexOf=sortedIndexOf;lodash.sortedLastIndex=sortedLastIndex;lodash.sortedLastIndexBy=sortedLastIndexBy;lodash.sortedLastIndexOf=sortedLastIndexOf;lodash.startCase=startCase;lodash.startsWith=startsWith;lodash.subtract=subtract;lodash.sum=sum;lodash.sumBy=sumBy;lodash.template=template;lodash.times=times;lodash.toFinite=toFinite;lodash.toInteger=toInteger;lodash.toLength=toLength;lodash.toLower=toLower;lodash.toNumber=toNumber;lodash.toSafeInteger=toSafeInteger;lodash.toString=toString;lodash.toUpper=toUpper;lodash.trim=trim;lodash.trimEnd=trimEnd;lodash.trimStart=trimStart;lodash.truncate=truncate;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.upperCase=upperCase;lodash.upperFirst=upperFirst;// Add aliases. 10002lodash.each=forEach;lodash.eachRight=forEachRight;lodash.first=head;mixin(lodash,function(){var source={};baseForOwn(lodash,function(func,methodName){if(!hasOwnProperty.call(lodash.prototype,methodName)){source[methodName]=func;}});return source;}(),{'chain':false});/*------------------------------------------------------------------------*/ /** 10003 * The semantic version number. 10004 * 10005 * @static 10006 * @memberOf _ 10007 * @type {string} 10008 */lodash.VERSION=VERSION;// Assign default placeholders. 10009arrayEach(['bind','bindKey','curry','curryRight','partial','partialRight'],function(methodName){lodash[methodName].placeholder=lodash;});// Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 10010arrayEach(['drop','take'],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();if(result.__filtered__){result.__takeCount__=nativeMin(n,result.__takeCount__);}else{result.__views__.push({'size':nativeMin(n,MAX_ARRAY_LENGTH),'type':methodName+(result.__dir__<0?'Right':'')});}return result;};LazyWrapper.prototype[methodName+'Right']=function(n){return this.reverse()[methodName](n).reverse();};});// Add `LazyWrapper` methods that accept an `iteratee` value. 10011arrayEach(['filter','map','takeWhile'],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();result.__iteratees__.push({'iteratee':getIteratee(iteratee,3),'type':type});result.__filtered__=result.__filtered__||isFilter;return result;};});// Add `LazyWrapper` methods for `_.head` and `_.last`. 10012arrayEach(['head','last'],function(methodName,index){var takeName='take'+(index?'Right':'');LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0];};});// Add `LazyWrapper` methods for `_.initial` and `_.tail`. 10013arrayEach(['initial','tail'],function(methodName,index){var dropName='drop'+(index?'':'Right');LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1);};});LazyWrapper.prototype.compact=function(){return this.filter(identity);};LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head();};LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate);};LazyWrapper.prototype.invokeMap=baseRest(function(path,args){if(typeof path=='function'){return new LazyWrapper(this);}return this.map(function(value){return baseInvoke(value,path,args);});});LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)));};LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;if(result.__filtered__&&(start>0||end<0)){return new LazyWrapper(result);}if(start<0){result=result.takeRight(-start);}else if(start){result=result.drop(start);}if(end!==undefined){end=toInteger(end);result=end<0?result.dropRight(-end):result.take(end-start);}return result;};LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse();};LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH);};// Add `LazyWrapper` methods to `lodash.prototype`. 10014baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?'take'+(methodName=='last'?'Right':''):methodName],retUnwrapped=isTaker||/^find/.test(methodName);if(!lodashFunc){return;}lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value);var interceptor=function interceptor(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result;};if(useLazy&&checkIteratee&&typeof iteratee=='function'&&iteratee.length!=1){// Avoid lazy use if the iteratee has a "length" value other than `1`. 10015isLazy=useLazy=false;}var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);result.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined});return new LodashWrapper(result,chainAll);}if(isUnwrapped&&onlyLazy){return func.apply(this,args);}result=this.thru(interceptor);return isUnwrapped?isTaker?result.value()[0]:result.value():result;};});// Add `Array` methods to `lodash.prototype`. 10016arrayEach(['pop','push','shift','sort','splice','unshift'],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?'tap':'thru',retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args);}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args);});};});// Map minified method names to their real names. 10017baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+'';if(!hasOwnProperty.call(realNames,key)){realNames[key]=[];}realNames[key].push({'name':methodName,'func':lodashFunc});}});realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{'name':'wrapper','func':undefined}];// Add methods to `LazyWrapper`. 10018LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;// Add chain sequence methods to the `lodash` wrapper. 10019lodash.prototype.at=wrapperAt;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;// Add lazy aliases. 10020lodash.prototype.first=lodash.prototype.head;if(symIterator){lodash.prototype[symIterator]=wrapperToIterator;}return lodash;};/*--------------------------------------------------------------------------*/ // Export lodash. 10021var _=runInContext();// Some AMD build optimizers, like r.js, check for condition patterns like: 10022if( true&&_typeof(__webpack_require__.amdO)=='object'&&__webpack_require__.amdO){// Expose Lodash on the global object to prevent errors when Lodash is 10023// loaded by a script tag in the presence of an AMD loader. 10024// See http://requirejs.org/docs/errors.html#mismatch for more details. 10025// Use `_.noConflict` to remove Lodash from the global object. 10026root._=_;// Define as an anonymous module so, through path mapping, it can be 10027// referenced as the "underscore" module. 10028!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return _;}).call(exports, __webpack_require__, exports, module), 10029 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}// Check for `exports` after `define` in case a build optimizer adds it. 10030else if(freeModule){// Export for Node.js. 10031(freeModule.exports=_)._=_;// Export for CommonJS support. 10032freeExports._=_;}else{// Export to the global object. 10033root._=_;}}).call(this); 10034 10035/***/ }), 10036
vendor: 19,934 bytes, lines 10037-10516
10037/***/ "./node_modules/rellax/rellax.js": 10038/*!***************************************!*\ 10039 !*** ./node_modules/rellax/rellax.js ***! 10040 \***************************************/ 10041/***/ (function(module, exports, __webpack_require__) { 10042 10043var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 10044// ------------------------------------------ 10045// Rellax.js 10046// Buttery smooth parallax library 10047// Copyright (c) 2016 Moe Amaya (@moeamaya) 10048// MIT license 10049// 10050// Thanks to Paraxify.js and Jaime Cabllero 10051// for parallax concepts 10052// ------------------------------------------ 10053 10054(function (root, factory) { 10055 if (true) { 10056 // AMD. Register as an anonymous module. 10057 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 10058 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 10059 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 10060 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 10061 } else {} 10062})(typeof window !== "undefined" ? window : __webpack_require__.g, function () { 10063 var Rellax = function Rellax(el, options) { 10064 "use strict"; 10065 10066 var self = Object.create(Rellax.prototype); 10067 var posY = 0; 10068 var screenY = 0; 10069 var posX = 0; 10070 var screenX = 0; 10071 var blocks = []; 10072 var pause = true; 10073 10074 // check what requestAnimationFrame to use, and if 10075 // it's not supported, use the onscroll event 10076 var loop = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function (callback) { 10077 return setTimeout(callback, 1000 / 60); 10078 }; 10079 10080 // store the id for later use 10081 var loopId = null; 10082 10083 // Test via a getter in the options object to see if the passive property is accessed 10084 var supportsPassive = false; 10085 try { 10086 var opts = Object.defineProperty({}, 'passive', { 10087 get: function get() { 10088 supportsPassive = true; 10089 } 10090 }); 10091 window.addEventListener("testPassive", null, opts); 10092 window.removeEventListener("testPassive", null, opts); 10093 } catch (e) {} 10094 10095 // check what cancelAnimation method to use 10096 var clearLoop = window.cancelAnimationFrame || window.mozCancelAnimationFrame || clearTimeout; 10097 10098 // check which transform property to use 10099 var transformProp = window.transformProp || function () { 10100 var testEl = document.createElement('div'); 10101 if (testEl.style.transform === null) { 10102 var vendors = ['Webkit', 'Moz', 'ms']; 10103 for (var vendor in vendors) { 10104 if (testEl.style[vendors[vendor] + 'Transform'] !== undefined) { 10105 return vendors[vendor] + 'Transform'; 10106 } 10107 } 10108 } 10109 return 'transform'; 10110 }(); 10111 10112 // Default Settings 10113 self.options = { 10114 speed: -2, 10115 verticalSpeed: null, 10116 horizontalSpeed: null, 10117 breakpoints: [576, 768, 1201], 10118 center: false, 10119 wrapper: null, 10120 relativeToWrapper: false, 10121 round: true, 10122 vertical: true, 10123 horizontal: false, 10124 verticalScrollAxis: "y", 10125 horizontalScrollAxis: "x", 10126 callback: function callback() {} 10127 }; 10128 10129 // User defined options (might have more in the future) 10130 if (options) { 10131 Object.keys(options).forEach(function (key) { 10132 self.options[key] = options[key]; 10133 }); 10134 } 10135 function validateCustomBreakpoints() { 10136 if (self.options.breakpoints.length === 3 && Array.isArray(self.options.breakpoints)) { 10137 var isAscending = true; 10138 var isNumerical = true; 10139 var lastVal; 10140 self.options.breakpoints.forEach(function (i) { 10141 if (typeof i !== 'number') isNumerical = false; 10142 if (lastVal !== null) { 10143 if (i < lastVal) isAscending = false; 10144 } 10145 lastVal = i; 10146 }); 10147 if (isAscending && isNumerical) return; 10148 } 10149 // revert defaults if set incorrectly 10150 self.options.breakpoints = [576, 768, 1201]; 10151 console.warn("Rellax: You must pass an array of 3 numbers in ascending order to the breakpoints option. Defaults reverted"); 10152 } 10153 if (options && options.breakpoints) { 10154 validateCustomBreakpoints(); 10155 } 10156 10157 // By default, rellax class 10158 if (!el) { 10159 el = '.rellax'; 10160 } 10161 10162 // check if el is a className or a node 10163 var elements = typeof el === 'string' ? document.querySelectorAll(el) : [el]; 10164 10165 // Now query selector 10166 if (elements.length > 0) { 10167 self.elems = elements; 10168 } 10169 10170 // The elements don't exist 10171 else { 10172 console.warn("Rellax: The elements you're trying to select don't exist."); 10173 return; 10174 } 10175 10176 // Has a wrapper and it exists 10177 if (self.options.wrapper) { 10178 if (!self.options.wrapper.nodeType) { 10179 var wrapper = document.querySelector(self.options.wrapper); 10180 if (wrapper) { 10181 self.options.wrapper = wrapper; 10182 } else { 10183 console.warn("Rellax: The wrapper you're trying to use doesn't exist."); 10184 return; 10185 } 10186 } 10187 } 10188 10189 // set a placeholder for the current breakpoint 10190 var currentBreakpoint; 10191 10192 // helper to determine current breakpoint 10193 var getCurrentBreakpoint = function getCurrentBreakpoint(w) { 10194 var bp = self.options.breakpoints; 10195 if (w < bp[0]) return 'xs'; 10196 if (w >= bp[0] && w < bp[1]) return 'sm'; 10197 if (w >= bp[1] && w < bp[2]) return 'md'; 10198 return 'lg'; 10199 }; 10200 10201 // Get and cache initial position of all elements 10202 var cacheBlocks = function cacheBlocks() { 10203 for (var i = 0; i < self.elems.length; i++) { 10204 var block = createBlock(self.elems[i]); 10205 blocks.push(block); 10206 } 10207 }; 10208 10209 // Let's kick this script off 10210 // Build array for cached element values 10211 var init = function init() { 10212 for (var i = 0; i < blocks.length; i++) { 10213 self.elems[i].style.cssText = blocks[i].style; 10214 } 10215 blocks = []; 10216 screenY = window.innerHeight; 10217 screenX = window.innerWidth; 10218 currentBreakpoint = getCurrentBreakpoint(screenX); 10219 setPosition(); 10220 cacheBlocks(); 10221 animate(); 10222 10223 // If paused, unpause and set listener for window resizing events 10224 if (pause) { 10225 window.addEventListener('resize', init); 10226 pause = false; 10227 // Start the loop 10228 update(); 10229 } 10230 }; 10231 10232 // We want to cache the parallax blocks' 10233 // values: base, top, height, speed 10234 // el: is dom object, return: el cache values 10235 var createBlock = function createBlock(el) { 10236 var dataPercentage = el.getAttribute('data-rellax-percentage'); 10237 var dataSpeed = el.getAttribute('data-rellax-speed'); 10238 var dataXsSpeed = el.getAttribute('data-rellax-xs-speed'); 10239 var dataMobileSpeed = el.getAttribute('data-rellax-mobile-speed'); 10240 var dataTabletSpeed = el.getAttribute('data-rellax-tablet-speed'); 10241 var dataDesktopSpeed = el.getAttribute('data-rellax-desktop-speed'); 10242 var dataVerticalSpeed = el.getAttribute('data-rellax-vertical-speed'); 10243 var dataHorizontalSpeed = el.getAttribute('data-rellax-horizontal-speed'); 10244 var dataVericalScrollAxis = el.getAttribute('data-rellax-vertical-scroll-axis'); 10245 var dataHorizontalScrollAxis = el.getAttribute('data-rellax-horizontal-scroll-axis'); 10246 var dataZindex = el.getAttribute('data-rellax-zindex') || 0; 10247 var dataMin = el.getAttribute('data-rellax-min'); 10248 var dataMax = el.getAttribute('data-rellax-max'); 10249 var dataMinX = el.getAttribute('data-rellax-min-x'); 10250 var dataMaxX = el.getAttribute('data-rellax-max-x'); 10251 var dataMinY = el.getAttribute('data-rellax-min-y'); 10252 var dataMaxY = el.getAttribute('data-rellax-max-y'); 10253 var mapBreakpoints; 10254 var breakpoints = true; 10255 if (!dataXsSpeed && !dataMobileSpeed && !dataTabletSpeed && !dataDesktopSpeed) { 10256 breakpoints = false; 10257 } else { 10258 mapBreakpoints = { 10259 'xs': dataXsSpeed, 10260 'sm': dataMobileSpeed, 10261 'md': dataTabletSpeed, 10262 'lg': dataDesktopSpeed 10263 }; 10264 } 10265 10266 // initializing at scrollY = 0 (top of browser), scrollX = 0 (left of browser) 10267 // ensures elements are positioned based on HTML layout. 10268 // 10269 // If the element has the percentage attribute, the posY and posX needs to be 10270 // the current scroll position's value, so that the elements are still positioned based on HTML layout 10271 var wrapperPosY = self.options.wrapper ? self.options.wrapper.scrollTop : window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; 10272 // If the option relativeToWrapper is true, use the wrappers offset to top, subtracted from the current page scroll. 10273 if (self.options.relativeToWrapper) { 10274 var scrollPosY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; 10275 wrapperPosY = scrollPosY - self.options.wrapper.offsetTop; 10276 } 10277 var posY = self.options.vertical ? dataPercentage || self.options.center ? wrapperPosY : 0 : 0; 10278 var posX = self.options.horizontal ? dataPercentage || self.options.center ? self.options.wrapper ? self.options.wrapper.scrollLeft : window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft : 0 : 0; 10279 var blockTop = posY + el.getBoundingClientRect().top; 10280 var blockHeight = el.clientHeight || el.offsetHeight || el.scrollHeight; 10281 var blockLeft = posX + el.getBoundingClientRect().left; 10282 var blockWidth = el.clientWidth || el.offsetWidth || el.scrollWidth; 10283 10284 // apparently parallax equation everyone uses 10285 var percentageY = dataPercentage ? dataPercentage : (posY - blockTop + screenY) / (blockHeight + screenY); 10286 var percentageX = dataPercentage ? dataPercentage : (posX - blockLeft + screenX) / (blockWidth + screenX); 10287 if (self.options.center) { 10288 percentageX = 0.5; 10289 percentageY = 0.5; 10290 } 10291 10292 // Optional individual block speed as data attr, otherwise global speed 10293 var speed = breakpoints && mapBreakpoints[currentBreakpoint] !== null ? Number(mapBreakpoints[currentBreakpoint]) : dataSpeed ? dataSpeed : self.options.speed; 10294 var verticalSpeed = dataVerticalSpeed ? dataVerticalSpeed : self.options.verticalSpeed; 10295 var horizontalSpeed = dataHorizontalSpeed ? dataHorizontalSpeed : self.options.horizontalSpeed; 10296 10297 // Optional individual block movement axis direction as data attr, otherwise gobal movement direction 10298 var verticalScrollAxis = dataVericalScrollAxis ? dataVericalScrollAxis : self.options.verticalScrollAxis; 10299 var horizontalScrollAxis = dataHorizontalScrollAxis ? dataHorizontalScrollAxis : self.options.horizontalScrollAxis; 10300 var bases = updatePosition(percentageX, percentageY, speed, verticalSpeed, horizontalSpeed); 10301 10302 // ~~Store non-translate3d transforms~~ 10303 // Store inline styles and extract transforms 10304 var style = el.style.cssText; 10305 var transform = ''; 10306 10307 // Check if there's an inline styled transform 10308 var searchResult = /transform\s*:/i.exec(style); 10309 if (searchResult) { 10310 // Get the index of the transform 10311 var index = searchResult.index; 10312 10313 // Trim the style to the transform point and get the following semi-colon index 10314 var trimmedStyle = style.slice(index); 10315 var delimiter = trimmedStyle.indexOf(';'); 10316 10317 // Remove "transform" string and save the attribute 10318 if (delimiter) { 10319 transform = " " + trimmedStyle.slice(11, delimiter).replace(/\s/g, ''); 10320 } else { 10321 transform = " " + trimmedStyle.slice(11).replace(/\s/g, ''); 10322 } 10323 } 10324 return { 10325 baseX: bases.x, 10326 baseY: bases.y, 10327 top: blockTop, 10328 left: blockLeft, 10329 height: blockHeight, 10330 width: blockWidth, 10331 speed: speed, 10332 verticalSpeed: verticalSpeed, 10333 horizontalSpeed: horizontalSpeed, 10334 verticalScrollAxis: verticalScrollAxis, 10335 horizontalScrollAxis: horizontalScrollAxis, 10336 style: style, 10337 transform: transform, 10338 zindex: dataZindex, 10339 min: dataMin, 10340 max: dataMax, 10341 minX: dataMinX, 10342 maxX: dataMaxX, 10343 minY: dataMinY, 10344 maxY: dataMaxY 10345 }; 10346 }; 10347 10348 // set scroll position (posY, posX) 10349 // side effect method is not ideal, but okay for now 10350 // returns true if the scroll changed, false if nothing happened 10351 var setPosition = function setPosition() { 10352 var oldY = posY; 10353 var oldX = posX; 10354 posY = self.options.wrapper ? self.options.wrapper.scrollTop : (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset; 10355 posX = self.options.wrapper ? self.options.wrapper.scrollLeft : (document.documentElement || document.body.parentNode || document.body).scrollLeft || window.pageXOffset; 10356 // If option relativeToWrapper is true, use relative wrapper value instead. 10357 if (self.options.relativeToWrapper) { 10358 var scrollPosY = (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset; 10359 posY = scrollPosY - self.options.wrapper.offsetTop; 10360 } 10361 if (oldY != posY && self.options.vertical) { 10362 // scroll changed, return true 10363 return true; 10364 } 10365 if (oldX != posX && self.options.horizontal) { 10366 // scroll changed, return true 10367 return true; 10368 } 10369 10370 // scroll did not change 10371 return false; 10372 }; 10373 10374 // Ahh a pure function, gets new transform value 10375 // based on scrollPosition and speed 10376 // Allow for decimal pixel values 10377 var updatePosition = function updatePosition(percentageX, percentageY, speed, verticalSpeed, horizontalSpeed) { 10378 var result = {}; 10379 var valueX = (horizontalSpeed ? horizontalSpeed : speed) * (100 * (1 - percentageX)); 10380 var valueY = (verticalSpeed ? verticalSpeed : speed) * (100 * (1 - percentageY)); 10381 result.x = self.options.round ? Math.round(valueX) : Math.round(valueX * 100) / 100; 10382 result.y = self.options.round ? Math.round(valueY) : Math.round(valueY * 100) / 100; 10383 return result; 10384 }; 10385 10386 // Remove event listeners and loop again 10387 var deferredUpdate = function deferredUpdate() { 10388 window.removeEventListener('resize', deferredUpdate); 10389 window.removeEventListener('orientationchange', deferredUpdate); 10390 (self.options.wrapper ? self.options.wrapper : window).removeEventListener('scroll', deferredUpdate); 10391 (self.options.wrapper ? self.options.wrapper : document).removeEventListener('touchmove', deferredUpdate); 10392 10393 // loop again 10394 loopId = loop(update); 10395 }; 10396 10397 // Loop 10398 var update = function update() { 10399 if (setPosition() && pause === false) { 10400 animate(); 10401 10402 // loop again 10403 loopId = loop(update); 10404 } else { 10405 loopId = null; 10406 10407 // Don't animate until we get a position updating event 10408 window.addEventListener('resize', deferredUpdate); 10409 window.addEventListener('orientationchange', deferredUpdate); 10410 (self.options.wrapper ? self.options.wrapper : window).addEventListener('scroll', deferredUpdate, supportsPassive ? { 10411 passive: true 10412 } : false); 10413 (self.options.wrapper ? self.options.wrapper : document).addEventListener('touchmove', deferredUpdate, supportsPassive ? { 10414 passive: true 10415 } : false); 10416 } 10417 }; 10418 10419 // Transform3d on parallax element 10420 var animate = function animate() { 10421 var positions; 10422 for (var i = 0; i < self.elems.length; i++) { 10423 // Determine relevant movement directions 10424 var verticalScrollAxis = blocks[i].verticalScrollAxis.toLowerCase(); 10425 var horizontalScrollAxis = blocks[i].horizontalScrollAxis.toLowerCase(); 10426 var verticalScrollX = verticalScrollAxis.indexOf("x") != -1 ? posY : 0; 10427 var verticalScrollY = verticalScrollAxis.indexOf("y") != -1 ? posY : 0; 10428 var horizontalScrollX = horizontalScrollAxis.indexOf("x") != -1 ? posX : 0; 10429 var horizontalScrollY = horizontalScrollAxis.indexOf("y") != -1 ? posX : 0; 10430 var percentageY = (verticalScrollY + horizontalScrollY - blocks[i].top + screenY) / (blocks[i].height + screenY); 10431 var percentageX = (verticalScrollX + horizontalScrollX - blocks[i].left + screenX) / (blocks[i].width + screenX); 10432 10433 // Subtracting initialize value, so element stays in same spot as HTML 10434 positions = updatePosition(percentageX, percentageY, blocks[i].speed, blocks[i].verticalSpeed, blocks[i].horizontalSpeed); 10435 var positionY = positions.y - blocks[i].baseY; 10436 var positionX = positions.x - blocks[i].baseX; 10437 10438 // The next two "if" blocks go like this: 10439 // Check if a limit is defined (first "min", then "max"); 10440 // Check if we need to change the Y or the X 10441 // (Currently working only if just one of the axes is enabled) 10442 // Then, check if the new position is inside the allowed limit 10443 // If so, use new position. If not, set position to limit. 10444 10445 // Check if a min limit is defined 10446 if (blocks[i].min !== null) { 10447 if (self.options.vertical && !self.options.horizontal) { 10448 positionY = positionY <= blocks[i].min ? blocks[i].min : positionY; 10449 } 10450 if (self.options.horizontal && !self.options.vertical) { 10451 positionX = positionX <= blocks[i].min ? blocks[i].min : positionX; 10452 } 10453 } 10454 10455 // Check if directional min limits are defined 10456 if (blocks[i].minY != null) { 10457 positionY = positionY <= blocks[i].minY ? blocks[i].minY : positionY; 10458 } 10459 if (blocks[i].minX != null) { 10460 positionX = positionX <= blocks[i].minX ? blocks[i].minX : positionX; 10461 } 10462 10463 // Check if a max limit is defined 10464 if (blocks[i].max !== null) { 10465 if (self.options.vertical && !self.options.horizontal) { 10466 positionY = positionY >= blocks[i].max ? blocks[i].max : positionY; 10467 } 10468 if (self.options.horizontal && !self.options.vertical) { 10469 positionX = positionX >= blocks[i].max ? blocks[i].max : positionX; 10470 } 10471 } 10472 10473 // Check if directional max limits are defined 10474 if (blocks[i].maxY != null) { 10475 positionY = positionY >= blocks[i].maxY ? blocks[i].maxY : positionY; 10476 } 10477 if (blocks[i].maxX != null) { 10478 positionX = positionX >= blocks[i].maxX ? blocks[i].maxX : positionX; 10479 } 10480 var zindex = blocks[i].zindex; 10481 10482 // Move that element 10483 // (Set the new translation and append initial inline transforms.) 10484 var translate = 'translate3d(' + (self.options.horizontal ? positionX : '0') + 'px,' + (self.options.vertical ? positionY : '0') + 'px,' + zindex + 'px) ' + blocks[i].transform; 10485 self.elems[i].style[transformProp] = translate; 10486 } 10487 self.options.callback(positions); 10488 }; 10489 self.destroy = function () { 10490 for (var i = 0; i < self.elems.length; i++) { 10491 self.elems[i].style.cssText = blocks[i].style; 10492 } 10493 10494 // Remove resize event listener if not pause, and pause 10495 if (!pause) { 10496 window.removeEventListener('resize', init); 10497 pause = true; 10498 } 10499 10500 // Clear the animation loop to prevent possible memory leak 10501 clearLoop(loopId); 10502 loopId = null; 10503 }; 10504 10505 // Init 10506 init(); 10507 10508 // Allow to recalculate the initial values whenever we want 10509 self.refresh = init; 10510 return self; 10511 }; 10512 return Rellax; 10513}); 10514 10515/***/ }), 10516
vendor: 116,622 bytes, lines 10517-13320
10517/***/ "./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js": 10518/*!**************************************************************************!*\ 10519 !*** ./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js ***! 10520 \**************************************************************************/ 10521/***/ (function(module, exports, __webpack_require__) { 10522 10523var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 10524/*! 10525 * ScrollMagic v2.0.8 (2020-08-14) 10526 * The javascript library for magical scroll interactions. 10527 * (c) 2020 Jan Paepke (@janpaepke) 10528 * Project Website: http://scrollmagic.io 10529 * 10530 * @version 2.0.8 10531 * @license Dual licensed under MIT license and GPL. 10532 * @author Jan Paepke - [email protected] 10533 * 10534 * @file ScrollMagic main library. 10535 */ 10536/** 10537 * @namespace ScrollMagic 10538 */ 10539(function (root, factory) { 10540 if (true) { 10541 // AMD. Register as an anonymous module. 10542 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 10543 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 10544 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 10545 __WEBPACK_AMD_DEFINE_FACTORY__), 10546 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 10547 } else {} 10548})(this, function () { 10549 "use strict"; 10550 10551 var ScrollMagic = function ScrollMagic() { 10552 _util.log(2, '(COMPATIBILITY NOTICE) -> As of ScrollMagic 2.0.0 you need to use \'new ScrollMagic.Controller()\' to create a new controller instance. Use \'new ScrollMagic.Scene()\' to instance a scene.'); 10553 }; 10554 ScrollMagic.version = "2.0.8"; 10555 10556 // TODO: temporary workaround for chrome's scroll jitter bug 10557 if (typeof window !== 'undefined') { 10558 window.addEventListener("mousewheel", void 0); 10559 } 10560 10561 // global const 10562 var PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer"; 10563 10564 /** 10565 * The main class that is needed once per scroll container. 10566 * 10567 * @class 10568 * 10569 * @example 10570 * // basic initialization 10571 * var controller = new ScrollMagic.Controller(); 10572 * 10573 * // passing options 10574 * var controller = new ScrollMagic.Controller({container: "#myContainer", loglevel: 3}); 10575 * 10576 * @param {object} [options] - An object containing one or more options for the controller. 10577 * @param {(string|object)} [options.container=window] - A selector, DOM object that references the main container for scrolling. 10578 * @param {boolean} [options.vertical=true] - Sets the scroll mode to vertical (`true`) or horizontal (`false`) scrolling. 10579 * @param {object} [options.globalSceneOptions={}] - These options will be passed to every Scene that is added to the controller using the addScene method. For more information on Scene options see {@link ScrollMagic.Scene}. 10580 * @param {number} [options.loglevel=2] Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. 10581 ** `0` => silent 10582 ** `1` => errors 10583 ** `2` => errors, warnings 10584 ** `3` => errors, warnings, debuginfo 10585 * @param {boolean} [options.refreshInterval=100] - Some changes don't call events by default, like changing the container size or moving a scene trigger element. 10586 This interval polls these parameters to fire the necessary events. 10587 If you don't use custom containers, trigger elements or have static layouts, where the positions of the trigger elements don't change, you can set this to 0 disable interval checking and improve performance. 10588 * 10589 */ 10590 ScrollMagic.Controller = function (options) { 10591 /* 10592 * ---------------------------------------------------------------- 10593 * settings 10594 * ---------------------------------------------------------------- 10595 */ 10596 var NAMESPACE = 'ScrollMagic.Controller', 10597 SCROLL_DIRECTION_FORWARD = 'FORWARD', 10598 SCROLL_DIRECTION_REVERSE = 'REVERSE', 10599 SCROLL_DIRECTION_PAUSED = 'PAUSED', 10600 DEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults; 10601 10602 /* 10603 * ---------------------------------------------------------------- 10604 * private vars 10605 * ---------------------------------------------------------------- 10606 */ 10607 var Controller = this, 10608 _options = _util.extend({}, DEFAULT_OPTIONS, options), 10609 _sceneObjects = [], 10610 _updateScenesOnNextCycle = false, 10611 // can be boolean (true => all scenes) or an array of scenes to be updated 10612 _scrollPos = 0, 10613 _scrollDirection = SCROLL_DIRECTION_PAUSED, 10614 _isDocument = true, 10615 _viewPortSize = 0, 10616 _enabled = true, 10617 _updateTimeout, 10618 _refreshTimeout; 10619 10620 /* 10621 * ---------------------------------------------------------------- 10622 * private functions 10623 * ---------------------------------------------------------------- 10624 */ 10625 10626 /** 10627 * Internal constructor function of the ScrollMagic Controller 10628 * @private 10629 */ 10630 var construct = function construct() { 10631 for (var key in _options) { 10632 if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { 10633 log(2, "WARNING: Unknown option \"" + key + "\""); 10634 delete _options[key]; 10635 } 10636 } 10637 _options.container = _util.get.elements(_options.container)[0]; 10638 // check ScrollContainer 10639 if (!_options.container) { 10640 log(1, "ERROR creating object " + NAMESPACE + ": No valid scroll container supplied"); 10641 throw NAMESPACE + " init failed."; // cancel 10642 } 10643 10644 _isDocument = _options.container === window || _options.container === document.body || !document.body.contains(_options.container); 10645 // normalize to window 10646 if (_isDocument) { 10647 _options.container = window; 10648 } 10649 // update container size immediately 10650 _viewPortSize = getViewportSize(); 10651 // set event handlers 10652 _options.container.addEventListener("resize", onChange); 10653 _options.container.addEventListener("scroll", onChange); 10654 var ri = parseInt(_options.refreshInterval, 10); 10655 _options.refreshInterval = _util.type.Number(ri) ? ri : DEFAULT_OPTIONS.refreshInterval; 10656 scheduleRefresh(); 10657 log(3, "added new " + NAMESPACE + " controller (v" + ScrollMagic.version + ")"); 10658 }; 10659 10660 /** 10661 * Schedule the next execution of the refresh function 10662 * @private 10663 */ 10664 var scheduleRefresh = function scheduleRefresh() { 10665 if (_options.refreshInterval > 0) { 10666 _refreshTimeout = window.setTimeout(refresh, _options.refreshInterval); 10667 } 10668 }; 10669 10670 /** 10671 * Default function to get scroll pos - overwriteable using `Controller.scrollPos(newFunction)` 10672 * @private 10673 */ 10674 var getScrollPos = function getScrollPos() { 10675 return _options.vertical ? _util.get.scrollTop(_options.container) : _util.get.scrollLeft(_options.container); 10676 }; 10677 10678 /** 10679 * Returns the current viewport Size (width vor horizontal, height for vertical) 10680 * @private 10681 */ 10682 var getViewportSize = function getViewportSize() { 10683 return _options.vertical ? _util.get.height(_options.container) : _util.get.width(_options.container); 10684 }; 10685 10686 /** 10687 * Default function to set scroll pos - overwriteable using `Controller.scrollTo(newFunction)` 10688 * Make available publicly for pinned mousewheel workaround. 10689 * @private 10690 */ 10691 var setScrollPos = this._setScrollPos = function (pos) { 10692 if (_options.vertical) { 10693 if (_isDocument) { 10694 window.scrollTo(_util.get.scrollLeft(), pos); 10695 } else { 10696 _options.container.scrollTop = pos; 10697 } 10698 } else { 10699 if (_isDocument) { 10700 window.scrollTo(pos, _util.get.scrollTop()); 10701 } else { 10702 _options.container.scrollLeft = pos; 10703 } 10704 } 10705 }; 10706 10707 /** 10708 * Handle updates in cycles instead of on scroll (performance) 10709 * @private 10710 */ 10711 var updateScenes = function updateScenes() { 10712 if (_enabled && _updateScenesOnNextCycle) { 10713 // determine scenes to update 10714 var scenesToUpdate = _util.type.Array(_updateScenesOnNextCycle) ? _updateScenesOnNextCycle : _sceneObjects.slice(0); 10715 // reset scenes 10716 _updateScenesOnNextCycle = false; 10717 var oldScrollPos = _scrollPos; 10718 // update scroll pos now instead of onChange, as it might have changed since scheduling (i.e. in-browser smooth scroll) 10719 _scrollPos = Controller.scrollPos(); 10720 var deltaScroll = _scrollPos - oldScrollPos; 10721 if (deltaScroll !== 0) { 10722 // scroll position changed? 10723 _scrollDirection = deltaScroll > 0 ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_REVERSE; 10724 } 10725 // reverse order of scenes if scrolling reverse 10726 if (_scrollDirection === SCROLL_DIRECTION_REVERSE) { 10727 scenesToUpdate.reverse(); 10728 } 10729 // update scenes 10730 scenesToUpdate.forEach(function (scene, index) { 10731 log(3, "updating Scene " + (index + 1) + "/" + scenesToUpdate.length + " (" + _sceneObjects.length + " total)"); 10732 scene.update(true); 10733 }); 10734 if (scenesToUpdate.length === 0 && _options.loglevel >= 3) { 10735 log(3, "updating 0 Scenes (nothing added to controller)"); 10736 } 10737 } 10738 }; 10739 10740 /** 10741 * Initializes rAF callback 10742 * @private 10743 */ 10744 var debounceUpdate = function debounceUpdate() { 10745 _updateTimeout = _util.rAF(updateScenes); 10746 }; 10747 10748 /** 10749 * Handles Container changes 10750 * @private 10751 */ 10752 var onChange = function onChange(e) { 10753 log(3, "event fired causing an update:", e.type); 10754 if (e.type == "resize") { 10755 // resize 10756 _viewPortSize = getViewportSize(); 10757 _scrollDirection = SCROLL_DIRECTION_PAUSED; 10758 } 10759 // schedule update 10760 if (_updateScenesOnNextCycle !== true) { 10761 _updateScenesOnNextCycle = true; 10762 debounceUpdate(); 10763 } 10764 }; 10765 var refresh = function refresh() { 10766 if (!_isDocument) { 10767 // simulate resize event. Only works for viewport relevant param (performance) 10768 if (_viewPortSize != getViewportSize()) { 10769 var resizeEvent; 10770 try { 10771 resizeEvent = new Event('resize', { 10772 bubbles: false, 10773 cancelable: false 10774 }); 10775 } catch (e) { 10776 // stupid IE 10777 resizeEvent = document.createEvent("Event"); 10778 resizeEvent.initEvent("resize", false, false); 10779 } 10780 _options.container.dispatchEvent(resizeEvent); 10781 } 10782 } 10783 _sceneObjects.forEach(function (scene, index) { 10784 // refresh all scenes 10785 scene.refresh(); 10786 }); 10787 scheduleRefresh(); 10788 }; 10789 10790 /** 10791 * Send a debug message to the console. 10792 * provided publicly with _log for plugins 10793 * @private 10794 * 10795 * @param {number} loglevel - The loglevel required to initiate output for the message. 10796 * @param {...mixed} output - One or more variables that should be passed to the console. 10797 */ 10798 var log = this._log = function (loglevel, output) { 10799 if (_options.loglevel >= loglevel) { 10800 Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); 10801 _util.log.apply(window, arguments); 10802 } 10803 }; 10804 // for scenes we have getters for each option, but for the controller we don't, so we need to make it available externally for plugins 10805 this._options = _options; 10806 10807 /** 10808 * Sort scenes in ascending order of their start offset. 10809 * @private 10810 * 10811 * @param {array} ScenesArray - an array of ScrollMagic Scenes that should be sorted 10812 * @return {array} The sorted array of Scenes. 10813 */ 10814 var sortScenes = function sortScenes(ScenesArray) { 10815 if (ScenesArray.length <= 1) { 10816 return ScenesArray; 10817 } else { 10818 var scenes = ScenesArray.slice(0); 10819 scenes.sort(function (a, b) { 10820 return a.scrollOffset() > b.scrollOffset() ? 1 : -1; 10821 }); 10822 return scenes; 10823 } 10824 }; 10825 10826 /** 10827 * ---------------------------------------------------------------- 10828 * public functions 10829 * ---------------------------------------------------------------- 10830 */ 10831 10832 /** 10833 * Add one ore more scene(s) to the controller. 10834 * This is the equivalent to `Scene.addTo(controller)`. 10835 * @public 10836 * @example 10837 * // with a previously defined scene 10838 * controller.addScene(scene); 10839 * 10840 * // with a newly created scene. 10841 * controller.addScene(new ScrollMagic.Scene({duration : 0})); 10842 * 10843 * // adding multiple scenes 10844 * controller.addScene([scene, scene2, new ScrollMagic.Scene({duration : 0})]); 10845 * 10846 * @param {(ScrollMagic.Scene|array)} newScene - ScrollMagic Scene or Array of Scenes to be added to the controller. 10847 * @return {Controller} Parent object for chaining. 10848 */ 10849 this.addScene = function (newScene) { 10850 if (_util.type.Array(newScene)) { 10851 newScene.forEach(function (scene, index) { 10852 Controller.addScene(scene); 10853 }); 10854 } else if (newScene instanceof ScrollMagic.Scene) { 10855 if (newScene.controller() !== Controller) { 10856 newScene.addTo(Controller); 10857 } else if (_sceneObjects.indexOf(newScene) < 0) { 10858 // new scene 10859 _sceneObjects.push(newScene); // add to array 10860 _sceneObjects = sortScenes(_sceneObjects); // sort 10861 newScene.on("shift.controller_sort", function () { 10862 // resort whenever scene moves 10863 _sceneObjects = sortScenes(_sceneObjects); 10864 }); 10865 // insert Global defaults. 10866 for (var key in _options.globalSceneOptions) { 10867 if (newScene[key]) { 10868 newScene[key].call(newScene, _options.globalSceneOptions[key]); 10869 } 10870 } 10871 log(3, "adding Scene (now " + _sceneObjects.length + " total)"); 10872 } 10873 } else { 10874 log(1, "ERROR: invalid argument supplied for '.addScene()'"); 10875 } 10876 return Controller; 10877 }; 10878 10879 /** 10880 * Remove one ore more scene(s) from the controller. 10881 * This is the equivalent to `Scene.remove()`. 10882 * @public 10883 * @example 10884 * // remove a scene from the controller 10885 * controller.removeScene(scene); 10886 * 10887 * // remove multiple scenes from the controller 10888 * controller.removeScene([scene, scene2, scene3]); 10889 * 10890 * @param {(ScrollMagic.Scene|array)} Scene - ScrollMagic Scene or Array of Scenes to be removed from the controller. 10891 * @returns {Controller} Parent object for chaining. 10892 */ 10893 this.removeScene = function (Scene) { 10894 if (_util.type.Array(Scene)) { 10895 Scene.forEach(function (scene, index) { 10896 Controller.removeScene(scene); 10897 }); 10898 } else { 10899 var index = _sceneObjects.indexOf(Scene); 10900 if (index > -1) { 10901 Scene.off("shift.controller_sort"); 10902 _sceneObjects.splice(index, 1); 10903 log(3, "removing Scene (now " + _sceneObjects.length + " left)"); 10904 Scene.remove(); 10905 } 10906 } 10907 return Controller; 10908 }; 10909 10910 /** 10911 * Update one ore more scene(s) according to the scroll position of the container. 10912 * This is the equivalent to `Scene.update()`. 10913 * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. 10914 * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. 10915 * _**Note:** This method gets called constantly whenever Controller detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ 10916 * @public 10917 * @example 10918 * // update a specific scene on next cycle 10919 * controller.updateScene(scene); 10920 * 10921 * // update a specific scene immediately 10922 * controller.updateScene(scene, true); 10923 * 10924 * // update multiple scenes scene on next cycle 10925 * controller.updateScene([scene1, scene2, scene3]); 10926 * 10927 * @param {ScrollMagic.Scene} Scene - ScrollMagic Scene or Array of Scenes that is/are supposed to be updated. 10928 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle. 10929 This is useful when changing multiple properties of the scene - this way it will only be updated once all new properties are set (updateScenes). 10930 * @return {Controller} Parent object for chaining. 10931 */ 10932 this.updateScene = function (Scene, immediately) { 10933 if (_util.type.Array(Scene)) { 10934 Scene.forEach(function (scene, index) { 10935 Controller.updateScene(scene, immediately); 10936 }); 10937 } else { 10938 if (immediately) { 10939 Scene.update(true); 10940 } else if (_updateScenesOnNextCycle !== true && Scene instanceof ScrollMagic.Scene) { 10941 // if _updateScenesOnNextCycle is true, all connected scenes are already scheduled for update 10942 // prep array for next update cycle 10943 _updateScenesOnNextCycle = _updateScenesOnNextCycle || []; 10944 if (_updateScenesOnNextCycle.indexOf(Scene) == -1) { 10945 _updateScenesOnNextCycle.push(Scene); 10946 } 10947 _updateScenesOnNextCycle = sortScenes(_updateScenesOnNextCycle); // sort 10948 debounceUpdate(); 10949 } 10950 } 10951 return Controller; 10952 }; 10953 10954 /** 10955 * Updates the controller params and calls updateScene on every scene, that is attached to the controller. 10956 * See `Controller.updateScene()` for more information about what this means. 10957 * In most cases you will not need this function, as it is called constantly, whenever ScrollMagic detects a state change event, like resize or scroll. 10958 * The only application for this method is when ScrollMagic fails to detect these events. 10959 * One application is with some external scroll libraries (like iScroll) that move an internal container to a negative offset instead of actually scrolling. In this case the update on the controller needs to be called whenever the child container's position changes. 10960 * For this case there will also be the need to provide a custom function to calculate the correct scroll position. See `Controller.scrollPos()` for details. 10961 * @public 10962 * @example 10963 * // update the controller on next cycle (saves performance due to elimination of redundant updates) 10964 * controller.update(); 10965 * 10966 * // update the controller immediately 10967 * controller.update(true); 10968 * 10969 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance) 10970 * @return {Controller} Parent object for chaining. 10971 */ 10972 this.update = function (immediately) { 10973 onChange({ 10974 type: "resize" 10975 }); // will update size and set _updateScenesOnNextCycle to true 10976 if (immediately) { 10977 updateScenes(); 10978 } 10979 return Controller; 10980 }; 10981 10982 /** 10983 * Scroll to a numeric scroll offset, a DOM element, the start of a scene or provide an alternate method for scrolling. 10984 * For vertical controllers it will change the top scroll offset and for horizontal applications it will change the left offset. 10985 * @public 10986 * 10987 * @since 1.1.0 10988 * @example 10989 * // scroll to an offset of 100 10990 * controller.scrollTo(100); 10991 * 10992 * // scroll to a DOM element 10993 * controller.scrollTo("#anchor"); 10994 * 10995 * // scroll to the beginning of a scene 10996 * var scene = new ScrollMagic.Scene({offset: 200}); 10997 * controller.scrollTo(scene); 10998 * 10999 * // define a new scroll position modification function (jQuery animate instead of jump) 11000 * controller.scrollTo(function (newScrollPos) { 11001 * $("html, body").animate({scrollTop: newScrollPos}); 11002 * }); 11003 * controller.scrollTo(100); // call as usual, but the new function will be used instead 11004 * 11005 * // define a new scroll function with an additional parameter 11006 * controller.scrollTo(function (newScrollPos, message) { 11007 * console.log(message); 11008 * $(this).animate({scrollTop: newScrollPos}); 11009 * }); 11010 * // call as usual, but supply an extra parameter to the defined custom function 11011 * controller.scrollTo(100, "my message"); 11012 * 11013 * // define a new scroll function with an additional parameter containing multiple variables 11014 * controller.scrollTo(function (newScrollPos, options) { 11015 * someGlobalVar = options.a + options.b; 11016 * $(this).animate({scrollTop: newScrollPos}); 11017 * }); 11018 * // call as usual, but supply an extra parameter containing multiple options 11019 * controller.scrollTo(100, {a: 1, b: 2}); 11020 * 11021 * // define a new scroll function with a callback supplied as an additional parameter 11022 * controller.scrollTo(function (newScrollPos, callback) { 11023 * $(this).animate({scrollTop: newScrollPos}, 400, "swing", callback); 11024 * }); 11025 * // call as usual, but supply an extra parameter, which is used as a callback in the previously defined custom scroll function 11026 * controller.scrollTo(100, function() { 11027 * console.log("scroll has finished."); 11028 * }); 11029 * 11030 * @param {mixed} scrollTarget - The supplied argument can be one of these types: 11031 * 1. `number` -> The container will scroll to this new scroll offset. 11032 * 2. `string` or `object` -> Can be a selector or a DOM object. 11033 * The container will scroll to the position of this element. 11034 * 3. `ScrollMagic Scene` -> The container will scroll to the start of this scene. 11035 * 4. `function` -> This function will be used for future scroll position modifications. 11036 * This provides a way for you to change the behaviour of scrolling and adding new behaviour like animation. The function receives the new scroll position as a parameter and a reference to the container element using `this`. 11037 * It may also optionally receive an optional additional parameter (see below) 11038 * _**NOTE:** 11039 * All other options will still work as expected, using the new function to scroll._ 11040 * @param {mixed} [additionalParameter] - If a custom scroll function was defined (see above 4.), you may want to supply additional parameters to it, when calling it. You can do this using this parameter – see examples for details. Please note, that this parameter will have no effect, if you use the default scrolling function. 11041 * @returns {Controller} Parent object for chaining. 11042 */ 11043 this.scrollTo = function (scrollTarget, additionalParameter) { 11044 if (_util.type.Number(scrollTarget)) { 11045 // excecute 11046 setScrollPos.call(_options.container, scrollTarget, additionalParameter); 11047 } else if (scrollTarget instanceof ScrollMagic.Scene) { 11048 // scroll to scene 11049 if (scrollTarget.controller() === Controller) { 11050 // check if the controller is associated with this scene 11051 Controller.scrollTo(scrollTarget.scrollOffset(), additionalParameter); 11052 } else { 11053 log(2, "scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.", scrollTarget); 11054 } 11055 } else if (_util.type.Function(scrollTarget)) { 11056 // assign new scroll function 11057 setScrollPos = scrollTarget; 11058 } else { 11059 // scroll to element 11060 var elem = _util.get.elements(scrollTarget)[0]; 11061 if (elem) { 11062 // if parent is pin spacer, use spacer position instead so correct start position is returned for pinned elements. 11063 while (elem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { 11064 elem = elem.parentNode; 11065 } 11066 var param = _options.vertical ? "top" : "left", 11067 // which param is of interest ? 11068 containerOffset = _util.get.offset(_options.container), 11069 // container position is needed because element offset is returned in relation to document, not in relation to container. 11070 elementOffset = _util.get.offset(elem); 11071 if (!_isDocument) { 11072 // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent 11073 containerOffset[param] -= Controller.scrollPos(); 11074 } 11075 Controller.scrollTo(elementOffset[param] - containerOffset[param], additionalParameter); 11076 } else { 11077 log(2, "scrollTo(): The supplied argument is invalid. Scroll cancelled.", scrollTarget); 11078 } 11079 } 11080 return Controller; 11081 }; 11082 11083 /** 11084 * **Get** the current scrollPosition or **Set** a new method to calculate it. 11085 * -> **GET**: 11086 * When used as a getter this function will return the current scroll position. 11087 * To get a cached value use Controller.info("scrollPos"), which will be updated in the update cycle. 11088 * For vertical controllers it will return the top scroll offset and for horizontal applications it will return the left offset. 11089 * 11090 * -> **SET**: 11091 * When used as a setter this method prodes a way to permanently overwrite the controller's scroll position calculation. 11092 * A typical usecase is when the scroll position is not reflected by the containers scrollTop or scrollLeft values, but for example by the inner offset of a child container. 11093 * Moving a child container inside a parent is a commonly used method for several scrolling frameworks, including iScroll. 11094 * By providing an alternate calculation function you can make sure ScrollMagic receives the correct scroll position. 11095 * Please also bear in mind that your function should return y values for vertical scrolls an x for horizontals. 11096 * 11097 * To change the current scroll position please use `Controller.scrollTo()`. 11098 * @public 11099 * 11100 * @example 11101 * // get the current scroll Position 11102 * var scrollPos = controller.scrollPos(); 11103 * 11104 * // set a new scroll position calculation method 11105 * controller.scrollPos(function () { 11106 * return this.info("vertical") ? -mychildcontainer.y : -mychildcontainer.x 11107 * }); 11108 * 11109 * @param {function} [scrollPosMethod] - The function to be used for the scroll position calculation of the container. 11110 * @returns {(number|Controller)} Current scroll position or parent object for chaining. 11111 */ 11112 this.scrollPos = function (scrollPosMethod) { 11113 if (!arguments.length) { 11114 // get 11115 return getScrollPos.call(Controller); 11116 } else { 11117 // set 11118 if (_util.type.Function(scrollPosMethod)) { 11119 getScrollPos = scrollPosMethod; 11120 } else { 11121 log(2, "Provided value for method 'scrollPos' is not a function. To change the current scroll position use 'scrollTo()'."); 11122 } 11123 } 11124 return Controller; 11125 }; 11126 11127 /** 11128 * **Get** all infos or one in particular about the controller. 11129 * @public 11130 * @example 11131 * // returns the current scroll position (number) 11132 * var scrollPos = controller.info("scrollPos"); 11133 * 11134 * // returns all infos as an object 11135 * var infos = controller.info(); 11136 * 11137 * @param {string} [about] - If passed only this info will be returned instead of an object containing all. 11138 Valid options are: 11139 ** `"size"` => the current viewport size of the container 11140 ** `"vertical"` => true if vertical scrolling, otherwise false 11141 ** `"scrollPos"` => the current scroll position 11142 ** `"scrollDirection"` => the last known direction of the scroll 11143 ** `"container"` => the container element 11144 ** `"isDocument"` => true if container element is the document. 11145 * @returns {(mixed|object)} The requested info(s). 11146 */ 11147 this.info = function (about) { 11148 var values = { 11149 size: _viewPortSize, 11150 // contains height or width (in regard to orientation); 11151 vertical: _options.vertical, 11152 scrollPos: _scrollPos, 11153 scrollDirection: _scrollDirection, 11154 container: _options.container, 11155 isDocument: _isDocument 11156 }; 11157 if (!arguments.length) { 11158 // get all as an object 11159 return values; 11160 } else if (values[about] !== undefined) { 11161 return values[about]; 11162 } else { 11163 log(1, "ERROR: option \"" + about + "\" is not available"); 11164 return; 11165 } 11166 }; 11167 11168 /** 11169 * **Get** or **Set** the current loglevel option value. 11170 * @public 11171 * 11172 * @example 11173 * // get the current value 11174 * var loglevel = controller.loglevel(); 11175 * 11176 * // set a new value 11177 * controller.loglevel(3); 11178 * 11179 * @param {number} [newLoglevel] - The new loglevel setting of the Controller. `[0-3]` 11180 * @returns {(number|Controller)} Current loglevel or parent object for chaining. 11181 */ 11182 this.loglevel = function (newLoglevel) { 11183 if (!arguments.length) { 11184 // get 11185 return _options.loglevel; 11186 } else if (_options.loglevel != newLoglevel) { 11187 // set 11188 _options.loglevel = newLoglevel; 11189 } 11190 return Controller; 11191 }; 11192 11193 /** 11194 * **Get** or **Set** the current enabled state of the controller. 11195 * This can be used to disable all Scenes connected to the controller without destroying or removing them. 11196 * @public 11197 * 11198 * @example 11199 * // get the current value 11200 * var enabled = controller.enabled(); 11201 * 11202 * // disable the controller 11203 * controller.enabled(false); 11204 * 11205 * @param {boolean} [newState] - The new enabled state of the controller `true` or `false`. 11206 * @returns {(boolean|Controller)} Current enabled state or parent object for chaining. 11207 */ 11208 this.enabled = function (newState) { 11209 if (!arguments.length) { 11210 // get 11211 return _enabled; 11212 } else if (_enabled != newState) { 11213 // set 11214 _enabled = !!newState; 11215 Controller.updateScene(_sceneObjects, true); 11216 } 11217 return Controller; 11218 }; 11219 11220 /** 11221 * Destroy the Controller, all Scenes and everything. 11222 * @public 11223 * 11224 * @example 11225 * // without resetting the scenes 11226 * controller = controller.destroy(); 11227 * 11228 * // with scene reset 11229 * controller = controller.destroy(true); 11230 * 11231 * @param {boolean} [resetScenes=false] - If `true` the pins and tweens (if existent) of all scenes will be reset. 11232 * @returns {null} Null to unset handler variables. 11233 */ 11234 this.destroy = function (resetScenes) { 11235 window.clearTimeout(_refreshTimeout); 11236 var i = _sceneObjects.length; 11237 while (i--) { 11238 _sceneObjects[i].destroy(resetScenes); 11239 } 11240 _options.container.removeEventListener("resize", onChange); 11241 _options.container.removeEventListener("scroll", onChange); 11242 _util.cAF(_updateTimeout); 11243 log(3, "destroyed " + NAMESPACE + " (reset: " + (resetScenes ? "true" : "false") + ")"); 11244 return null; 11245 }; 11246 11247 // INIT 11248 construct(); 11249 return Controller; 11250 }; 11251 11252 // store pagewide controller options 11253 var CONTROLLER_OPTIONS = { 11254 defaults: { 11255 container: window, 11256 vertical: true, 11257 globalSceneOptions: {}, 11258 loglevel: 2, 11259 refreshInterval: 100 11260 } 11261 }; 11262 /* 11263 * method used to add an option to ScrollMagic Scenes. 11264 */ 11265 ScrollMagic.Controller.addOption = function (name, defaultValue) { 11266 CONTROLLER_OPTIONS.defaults[name] = defaultValue; 11267 }; 11268 // instance extension function for plugins 11269 ScrollMagic.Controller.extend = function (extension) { 11270 var oldClass = this; 11271 ScrollMagic.Controller = function () { 11272 oldClass.apply(this, arguments); 11273 this.$super = _util.extend({}, this); // copy parent state 11274 return extension.apply(this, arguments) || this; 11275 }; 11276 _util.extend(ScrollMagic.Controller, oldClass); // copy properties 11277 ScrollMagic.Controller.prototype = oldClass.prototype; // copy prototype 11278 ScrollMagic.Controller.prototype.constructor = ScrollMagic.Controller; // restore constructor 11279 }; 11280 11281 /** 11282 * A Scene defines where the controller should react and how. 11283 * 11284 * @class 11285 * 11286 * @example 11287 * // create a standard scene and add it to a controller 11288 * new ScrollMagic.Scene() 11289 * .addTo(controller); 11290 * 11291 * // create a scene with custom options and assign a handler to it. 11292 * var scene = new ScrollMagic.Scene({ 11293 * duration: 100, 11294 * offset: 200, 11295 * triggerHook: "onEnter", 11296 * reverse: false 11297 * }); 11298 * 11299 * @param {object} [options] - Options for the Scene. The options can be updated at any time. 11300 Instead of setting the options for each scene individually you can also set them globally in the controller as the controllers `globalSceneOptions` option. The object accepts the same properties as the ones below. 11301 When a scene is added to the controller the options defined using the Scene constructor will be overwritten by those set in `globalSceneOptions`. 11302 * @param {(number|string|function)} [options.duration=0] - The duration of the scene. 11303 Please see `Scene.duration()` for details. 11304 * @param {number} [options.offset=0] - Offset Value for the Trigger Position. If no triggerElement is defined this will be the scroll distance from the start of the page, after which the scene will start. 11305 * @param {(string|object)} [options.triggerElement=null] - Selector or DOM object that defines the start of the scene. If undefined the scene will start right at the start of the page (unless an offset is set). 11306 * @param {(number|string)} [options.triggerHook="onCenter"] - Can be a number between 0 and 1 defining the position of the trigger Hook in relation to the viewport. 11307 Can also be defined using a string: 11308 ** `"onEnter"` => `1` 11309 ** `"onCenter"` => `0.5` 11310 ** `"onLeave"` => `0` 11311 * @param {boolean} [options.reverse=true] - Should the scene reverse, when scrolling up? 11312 * @param {number} [options.loglevel=2] - Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic. 11313 ** `0` => silent 11314 ** `1` => errors 11315 ** `2` => errors, warnings 11316 ** `3` => errors, warnings, debuginfo 11317 * 11318 */ 11319 ScrollMagic.Scene = function (options) { 11320 /* 11321 * ---------------------------------------------------------------- 11322 * settings 11323 * ---------------------------------------------------------------- 11324 */ 11325 11326 var NAMESPACE = 'ScrollMagic.Scene', 11327 SCENE_STATE_BEFORE = 'BEFORE', 11328 SCENE_STATE_DURING = 'DURING', 11329 SCENE_STATE_AFTER = 'AFTER', 11330 DEFAULT_OPTIONS = SCENE_OPTIONS.defaults; 11331 11332 /* 11333 * ---------------------------------------------------------------- 11334 * private vars 11335 * ---------------------------------------------------------------- 11336 */ 11337 11338 var Scene = this, 11339 _options = _util.extend({}, DEFAULT_OPTIONS, options), 11340 _state = SCENE_STATE_BEFORE, 11341 _progress = 0, 11342 _scrollOffset = { 11343 start: 0, 11344 end: 0 11345 }, 11346 // reflects the controllers's scroll position for the start and end of the scene respectively 11347 _triggerPos = 0, 11348 _enabled = true, 11349 _durationUpdateMethod, 11350 _controller; 11351 11352 /** 11353 * Internal constructor function of the ScrollMagic Scene 11354 * @private 11355 */ 11356 var construct = function construct() { 11357 for (var key in _options) { 11358 // check supplied options 11359 if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { 11360 log(2, "WARNING: Unknown option \"" + key + "\""); 11361 delete _options[key]; 11362 } 11363 } 11364 // add getters/setters for all possible options 11365 for (var optionName in DEFAULT_OPTIONS) { 11366 addSceneOption(optionName); 11367 } 11368 // validate all options 11369 validateOption(); 11370 }; 11371 11372 /* 11373 * ---------------------------------------------------------------- 11374 * Event Management 11375 * ---------------------------------------------------------------- 11376 */ 11377 11378 var _listeners = {}; 11379 /** 11380 * Scene start event. 11381 * Fires whenever the scroll position its the starting point of the scene. 11382 * It will also fire when scrolling back up going over the start position of the scene. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. 11383 * 11384 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. 11385 * 11386 * @event ScrollMagic.Scene#start 11387 * 11388 * @example 11389 * scene.on("start", function (event) { 11390 * console.log("Hit start point of scene."); 11391 * }); 11392 * 11393 * @property {object} event - The event Object passed to each callback 11394 * @property {string} event.type - The name of the event 11395 * @property {Scene} event.target - The Scene object that triggered this event 11396 * @property {number} event.progress - Reflects the current progress of the scene 11397 * @property {string} event.state - The current state of the scene `"BEFORE"` or `"DURING"` 11398 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` 11399 */ 11400 /** 11401 * Scene end event. 11402 * Fires whenever the scroll position its the ending point of the scene. 11403 * It will also fire when scrolling back up from after the scene and going over its end position. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback. 11404 * 11405 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. 11406 * 11407 * @event ScrollMagic.Scene#end 11408 * 11409 * @example 11410 * scene.on("end", function (event) { 11411 * console.log("Hit end point of scene."); 11412 * }); 11413 * 11414 * @property {object} event - The event Object passed to each callback 11415 * @property {string} event.type - The name of the event 11416 * @property {Scene} event.target - The Scene object that triggered this event 11417 * @property {number} event.progress - Reflects the current progress of the scene 11418 * @property {string} event.state - The current state of the scene `"DURING"` or `"AFTER"` 11419 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` 11420 */ 11421 /** 11422 * Scene enter event. 11423 * Fires whenever the scene enters the "DURING" state. 11424 * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene enters its active scroll timeframe, regardless of the scroll-direction. 11425 * 11426 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. 11427 * 11428 * @event ScrollMagic.Scene#enter 11429 * 11430 * @example 11431 * scene.on("enter", function (event) { 11432 * console.log("Scene entered."); 11433 * }); 11434 * 11435 * @property {object} event - The event Object passed to each callback 11436 * @property {string} event.type - The name of the event 11437 * @property {Scene} event.target - The Scene object that triggered this event 11438 * @property {number} event.progress - Reflects the current progress of the scene 11439 * @property {string} event.state - The current state of the scene - always `"DURING"` 11440 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` 11441 */ 11442 /** 11443 * Scene leave event. 11444 * Fires whenever the scene's state goes from "DURING" to either "BEFORE" or "AFTER". 11445 * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene leaves its active scroll timeframe, regardless of the scroll-direction. 11446 * 11447 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. 11448 * 11449 * @event ScrollMagic.Scene#leave 11450 * 11451 * @example 11452 * scene.on("leave", function (event) { 11453 * console.log("Scene left."); 11454 * }); 11455 * 11456 * @property {object} event - The event Object passed to each callback 11457 * @property {string} event.type - The name of the event 11458 * @property {Scene} event.target - The Scene object that triggered this event 11459 * @property {number} event.progress - Reflects the current progress of the scene 11460 * @property {string} event.state - The current state of the scene `"BEFORE"` or `"AFTER"` 11461 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` 11462 */ 11463 /** 11464 * Scene update event. 11465 * Fires whenever the scene is updated (but not necessarily changes the progress). 11466 * 11467 * @event ScrollMagic.Scene#update 11468 * 11469 * @example 11470 * scene.on("update", function (event) { 11471 * console.log("Scene updated."); 11472 * }); 11473 * 11474 * @property {object} event - The event Object passed to each callback 11475 * @property {string} event.type - The name of the event 11476 * @property {Scene} event.target - The Scene object that triggered this event 11477 * @property {number} event.startPos - The starting position of the scene (in relation to the conainer) 11478 * @property {number} event.endPos - The ending position of the scene (in relation to the conainer) 11479 * @property {number} event.scrollPos - The current scroll position of the container 11480 */ 11481 /** 11482 * Scene progress event. 11483 * Fires whenever the progress of the scene changes. 11484 * 11485 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method. 11486 * 11487 * @event ScrollMagic.Scene#progress 11488 * 11489 * @example 11490 * scene.on("progress", function (event) { 11491 * console.log("Scene progress changed to " + event.progress); 11492 * }); 11493 * 11494 * @property {object} event - The event Object passed to each callback 11495 * @property {string} event.type - The name of the event 11496 * @property {Scene} event.target - The Scene object that triggered this event 11497 * @property {number} event.progress - Reflects the current progress of the scene 11498 * @property {string} event.state - The current state of the scene `"BEFORE"`, `"DURING"` or `"AFTER"` 11499 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"` 11500 */ 11501 /** 11502 * Scene change event. 11503 * Fires whenvever a property of the scene is changed. 11504 * 11505 * @event ScrollMagic.Scene#change 11506 * 11507 * @example 11508 * scene.on("change", function (event) { 11509 * console.log("Scene Property \"" + event.what + "\" changed to " + event.newval); 11510 * }); 11511 * 11512 * @property {object} event - The event Object passed to each callback 11513 * @property {string} event.type - The name of the event 11514 * @property {Scene} event.target - The Scene object that triggered this event 11515 * @property {string} event.what - Indicates what value has been changed 11516 * @property {mixed} event.newval - The new value of the changed property 11517 */ 11518 /** 11519 * Scene shift event. 11520 * Fires whenvever the start or end **scroll offset** of the scene change. 11521 * This happens explicitely, when one of these values change: `offset`, `duration` or `triggerHook`. 11522 * It will fire implicitly when the `triggerElement` changes, if the new element has a different position (most cases). 11523 * It will also fire implicitly when the size of the container changes and the triggerHook is anything other than `onLeave`. 11524 * 11525 * @event ScrollMagic.Scene#shift 11526 * @since 1.1.0 11527 * 11528 * @example 11529 * scene.on("shift", function (event) { 11530 * console.log("Scene moved, because the " + event.reason + " has changed.)"); 11531 * }); 11532 * 11533 * @property {object} event - The event Object passed to each callback 11534 * @property {string} event.type - The name of the event 11535 * @property {Scene} event.target - The Scene object that triggered this event 11536 * @property {string} event.reason - Indicates why the scene has shifted 11537 */ 11538 /** 11539 * Scene destroy event. 11540 * Fires whenvever the scene is destroyed. 11541 * This can be used to tidy up custom behaviour used in events. 11542 * 11543 * @event ScrollMagic.Scene#destroy 11544 * @since 1.1.0 11545 * 11546 * @example 11547 * scene.on("enter", function (event) { 11548 * // add custom action 11549 * $("#my-elem").left("200"); 11550 * }) 11551 * .on("destroy", function (event) { 11552 * // reset my element to start position 11553 * if (event.reset) { 11554 * $("#my-elem").left("0"); 11555 * } 11556 * }); 11557 * 11558 * @property {object} event - The event Object passed to each callback 11559 * @property {string} event.type - The name of the event 11560 * @property {Scene} event.target - The Scene object that triggered this event 11561 * @property {boolean} event.reset - Indicates if the destroy method was called with reset `true` or `false`. 11562 */ 11563 /** 11564 * Scene add event. 11565 * Fires when the scene is added to a controller. 11566 * This is mostly used by plugins to know that change might be due. 11567 * 11568 * @event ScrollMagic.Scene#add 11569 * @since 2.0.0 11570 * 11571 * @example 11572 * scene.on("add", function (event) { 11573 * console.log('Scene was added to a new controller.'); 11574 * }); 11575 * 11576 * @property {object} event - The event Object passed to each callback 11577 * @property {string} event.type - The name of the event 11578 * @property {Scene} event.target - The Scene object that triggered this event 11579 * @property {boolean} event.controller - The controller object the scene was added to. 11580 */ 11581 /** 11582 * Scene remove event. 11583 * Fires when the scene is removed from a controller. 11584 * This is mostly used by plugins to know that change might be due. 11585 * 11586 * @event ScrollMagic.Scene#remove 11587 * @since 2.0.0 11588 * 11589 * @example 11590 * scene.on("remove", function (event) { 11591 * console.log('Scene was removed from its controller.'); 11592 * }); 11593 * 11594 * @property {object} event - The event Object passed to each callback 11595 * @property {string} event.type - The name of the event 11596 * @property {Scene} event.target - The Scene object that triggered this event 11597 */ 11598 11599 /** 11600 * Add one ore more event listener. 11601 * The callback function will be fired at the respective event, and an object containing relevant data will be passed to the callback. 11602 * @method ScrollMagic.Scene#on 11603 * 11604 * @example 11605 * function callback (event) { 11606 * console.log("Event fired! (" + event.type + ")"); 11607 * } 11608 * // add listeners 11609 * scene.on("change update progress start end enter leave", callback); 11610 * 11611 * @param {string} names - The name or names of the event the callback should be attached to. 11612 * @param {function} callback - A function that should be executed, when the event is dispatched. An event object will be passed to the callback. 11613 * @returns {Scene} Parent object for chaining. 11614 */ 11615 this.on = function (names, callback) { 11616 if (_util.type.Function(callback)) { 11617 names = names.trim().split(' '); 11618 names.forEach(function (fullname) { 11619 var nameparts = fullname.split('.'), 11620 eventname = nameparts[0], 11621 namespace = nameparts[1]; 11622 if (eventname != "*") { 11623 // disallow wildcards 11624 if (!_listeners[eventname]) { 11625 _listeners[eventname] = []; 11626 } 11627 _listeners[eventname].push({ 11628 namespace: namespace || '', 11629 callback: callback 11630 }); 11631 } 11632 }); 11633 } else { 11634 log(1, "ERROR when calling '.on()': Supplied callback for '" + names + "' is not a valid function!"); 11635 } 11636 return Scene; 11637 }; 11638 11639 /** 11640 * Remove one or more event listener. 11641 * @method ScrollMagic.Scene#off 11642 * 11643 * @example 11644 * function callback (event) { 11645 * console.log("Event fired! (" + event.type + ")"); 11646 * } 11647 * // add listeners 11648 * scene.on("change update", callback); 11649 * // remove listeners 11650 * scene.off("change update", callback); 11651 * 11652 * @param {string} names - The name or names of the event that should be removed. 11653 * @param {function} [callback] - A specific callback function that should be removed. If none is passed all callbacks to the event listener will be removed. 11654 * @returns {Scene} Parent object for chaining. 11655 */ 11656 this.off = function (names, callback) { 11657 if (!names) { 11658 log(1, "ERROR: Invalid event name supplied."); 11659 return Scene; 11660 } 11661 names = names.trim().split(' '); 11662 names.forEach(function (fullname, key) { 11663 var nameparts = fullname.split('.'), 11664 eventname = nameparts[0], 11665 namespace = nameparts[1] || '', 11666 removeList = eventname === '*' ? Object.keys(_listeners) : [eventname]; 11667 removeList.forEach(function (remove) { 11668 var list = _listeners[remove] || [], 11669 i = list.length; 11670 while (i--) { 11671 var listener = list[i]; 11672 if (listener && (namespace === listener.namespace || namespace === '*') && (!callback || callback == listener.callback)) { 11673 list.splice(i, 1); 11674 } 11675 } 11676 if (!list.length) { 11677 delete _listeners[remove]; 11678 } 11679 }); 11680 }); 11681 return Scene; 11682 }; 11683 11684 /** 11685 * Trigger an event. 11686 * @method ScrollMagic.Scene#trigger 11687 * 11688 * @example 11689 * this.trigger("change"); 11690 * 11691 * @param {string} name - The name of the event that should be triggered. 11692 * @param {object} [vars] - An object containing info that should be passed to the callback. 11693 * @returns {Scene} Parent object for chaining. 11694 */ 11695 this.trigger = function (name, vars) { 11696 if (name) { 11697 var nameparts = name.trim().split('.'), 11698 eventname = nameparts[0], 11699 namespace = nameparts[1], 11700 listeners = _listeners[eventname]; 11701 log(3, 'event fired:', eventname, vars ? "->" : '', vars || ''); 11702 if (listeners) { 11703 listeners.forEach(function (listener, key) { 11704 if (!namespace || namespace === listener.namespace) { 11705 listener.callback.call(Scene, new ScrollMagic.Event(eventname, listener.namespace, Scene, vars)); 11706 } 11707 }); 11708 } 11709 } else { 11710 log(1, "ERROR: Invalid event name supplied."); 11711 } 11712 return Scene; 11713 }; 11714 11715 // set event listeners 11716 Scene.on("change.internal", function (e) { 11717 if (e.what !== "loglevel" && e.what !== "tweenChanges") { 11718 // no need for a scene update scene with these options... 11719 if (e.what === "triggerElement") { 11720 updateTriggerElementPosition(); 11721 } else if (e.what === "reverse") { 11722 // the only property left that may have an impact on the current scene state. Everything else is handled by the shift event. 11723 Scene.update(); 11724 } 11725 } 11726 }).on("shift.internal", function (e) { 11727 updateScrollOffset(); 11728 Scene.update(); // update scene to reflect new position 11729 }); 11730 11731 /** 11732 * Send a debug message to the console. 11733 * @private 11734 * but provided publicly with _log for plugins 11735 * 11736 * @param {number} loglevel - The loglevel required to initiate output for the message. 11737 * @param {...mixed} output - One or more variables that should be passed to the console. 11738 */ 11739 var log = this._log = function (loglevel, output) { 11740 if (_options.loglevel >= loglevel) { 11741 Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->"); 11742 _util.log.apply(window, arguments); 11743 } 11744 }; 11745 11746 /** 11747 * Add the scene to a controller. 11748 * This is the equivalent to `Controller.addScene(scene)`. 11749 * @method ScrollMagic.Scene#addTo 11750 * 11751 * @example 11752 * // add a scene to a ScrollMagic Controller 11753 * scene.addTo(controller); 11754 * 11755 * @param {ScrollMagic.Controller} controller - The controller to which the scene should be added. 11756 * @returns {Scene} Parent object for chaining. 11757 */ 11758 this.addTo = function (controller) { 11759 if (!(controller instanceof ScrollMagic.Controller)) { 11760 log(1, "ERROR: supplied argument of 'addTo()' is not a valid ScrollMagic Controller"); 11761 } else if (_controller != controller) { 11762 // new controller 11763 if (_controller) { 11764 // was associated to a different controller before, so remove it... 11765 _controller.removeScene(Scene); 11766 } 11767 _controller = controller; 11768 validateOption(); 11769 updateDuration(true); 11770 updateTriggerElementPosition(true); 11771 updateScrollOffset(); 11772 _controller.info("container").addEventListener('resize', onContainerResize); 11773 controller.addScene(Scene); 11774 Scene.trigger("add", { 11775 controller: _controller 11776 }); 11777 log(3, "added " + NAMESPACE + " to controller"); 11778 Scene.update(); 11779 } 11780 return Scene; 11781 }; 11782 11783 /** 11784 * **Get** or **Set** the current enabled state of the scene. 11785 * This can be used to disable this scene without removing or destroying it. 11786 * @method ScrollMagic.Scene#enabled 11787 * 11788 * @example 11789 * // get the current value 11790 * var enabled = scene.enabled(); 11791 * 11792 * // disable the scene 11793 * scene.enabled(false); 11794 * 11795 * @param {boolean} [newState] - The new enabled state of the scene `true` or `false`. 11796 * @returns {(boolean|Scene)} Current enabled state or parent object for chaining. 11797 */ 11798 this.enabled = function (newState) { 11799 if (!arguments.length) { 11800 // get 11801 return _enabled; 11802 } else if (_enabled != newState) { 11803 // set 11804 _enabled = !!newState; 11805 Scene.update(true); 11806 } 11807 return Scene; 11808 }; 11809 11810 /** 11811 * Remove the scene from the controller. 11812 * This is the equivalent to `Controller.removeScene(scene)`. 11813 * The scene will not be updated anymore until you readd it to a controller. 11814 * To remove the pin or the tween you need to call removeTween() or removePin() respectively. 11815 * @method ScrollMagic.Scene#remove 11816 * @example 11817 * // remove the scene from its controller 11818 * scene.remove(); 11819 * 11820 * @returns {Scene} Parent object for chaining. 11821 */ 11822 this.remove = function () { 11823 if (_controller) { 11824 _controller.info("container").removeEventListener('resize', onContainerResize); 11825 var tmpParent = _controller; 11826 _controller = undefined; 11827 tmpParent.removeScene(Scene); 11828 Scene.trigger("remove"); 11829 log(3, "removed " + NAMESPACE + " from controller"); 11830 } 11831 return Scene; 11832 }; 11833 11834 /** 11835 * Destroy the scene and everything. 11836 * @method ScrollMagic.Scene#destroy 11837 * @example 11838 * // destroy the scene without resetting the pin and tween to their initial positions 11839 * scene = scene.destroy(); 11840 * 11841 * // destroy the scene and reset the pin and tween 11842 * scene = scene.destroy(true); 11843 * 11844 * @param {boolean} [reset=false] - If `true` the pin and tween (if existent) will be reset. 11845 * @returns {null} Null to unset handler variables. 11846 */ 11847 this.destroy = function (reset) { 11848 Scene.trigger("destroy", { 11849 reset: reset 11850 }); 11851 Scene.remove(); 11852 Scene.off("*.*"); 11853 log(3, "destroyed " + NAMESPACE + " (reset: " + (reset ? "true" : "false") + ")"); 11854 return null; 11855 }; 11856 11857 /** 11858 * Updates the Scene to reflect the current state. 11859 * This is the equivalent to `Controller.updateScene(scene, immediately)`. 11860 * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. 11861 * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress. 11862 * This means an update doesn't necessarily result in a progress change. The `progress` event will be fired if the progress has indeed changed between this update and the last. 11863 * _**NOTE:** This method gets called constantly whenever ScrollMagic detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._ 11864 * @method ScrollMagic.Scene#update 11865 * @example 11866 * // update the scene on next tick 11867 * scene.update(); 11868 * 11869 * // update the scene immediately 11870 * scene.update(true); 11871 * 11872 * @fires Scene.update 11873 * 11874 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance). 11875 * @returns {Scene} Parent object for chaining. 11876 */ 11877 this.update = function (immediately) { 11878 if (_controller) { 11879 if (immediately) { 11880 if (_controller.enabled() && _enabled) { 11881 var scrollPos = _controller.info("scrollPos"), 11882 newProgress; 11883 if (_options.duration > 0) { 11884 newProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start); 11885 } else { 11886 newProgress = scrollPos >= _scrollOffset.start ? 1 : 0; 11887 } 11888 Scene.trigger("update", { 11889 startPos: _scrollOffset.start, 11890 endPos: _scrollOffset.end, 11891 scrollPos: scrollPos 11892 }); 11893 Scene.progress(newProgress); 11894 } else if (_pin && _state === SCENE_STATE_DURING) { 11895 updatePinState(true); // unpin in position 11896 } 11897 } else { 11898 _controller.updateScene(Scene, false); 11899 } 11900 } 11901 return Scene; 11902 }; 11903 11904 /** 11905 * Updates dynamic scene variables like the trigger element position or the duration. 11906 * This method is automatically called in regular intervals from the controller. See {@link ScrollMagic.Controller} option `refreshInterval`. 11907 * 11908 * You can call it to minimize lag, for example when you intentionally change the position of the triggerElement. 11909 * If you don't it will simply be updated in the next refresh interval of the container, which is usually sufficient. 11910 * 11911 * @method ScrollMagic.Scene#refresh 11912 * @since 1.1.0 11913 * @example 11914 * scene = new ScrollMagic.Scene({triggerElement: "#trigger"}); 11915 * 11916 * // change the position of the trigger 11917 * $("#trigger").css("top", 500); 11918 * // immediately let the scene know of this change 11919 * scene.refresh(); 11920 * 11921 * @fires {@link Scene.shift}, if the trigger element position or the duration changed 11922 * @fires {@link Scene.change}, if the duration changed 11923 * 11924 * @returns {Scene} Parent object for chaining. 11925 */ 11926 this.refresh = function () { 11927 updateDuration(); 11928 updateTriggerElementPosition(); 11929 // update trigger element position 11930 return Scene; 11931 }; 11932 11933 /** 11934 * **Get** or **Set** the scene's progress. 11935 * Usually it shouldn't be necessary to use this as a setter, as it is set automatically by scene.update(). 11936 * The order in which the events are fired depends on the duration of the scene: 11937 * 1. Scenes with `duration == 0`: 11938 * Scenes that have no duration by definition have no ending. Thus the `end` event will never be fired. 11939 * When the trigger position of the scene is passed the events are always fired in this order: 11940 * `enter`, `start`, `progress` when scrolling forward 11941 * and 11942 * `progress`, `start`, `leave` when scrolling in reverse 11943 * 2. Scenes with `duration > 0`: 11944 * Scenes with a set duration have a defined start and end point. 11945 * When scrolling past the start position of the scene it will fire these events in this order: 11946 * `enter`, `start`, `progress` 11947 * When continuing to scroll and passing the end point it will fire these events: 11948 * `progress`, `end`, `leave` 11949 * When reversing through the end point these events are fired: 11950 * `enter`, `end`, `progress` 11951 * And when continuing to scroll past the start position in reverse it will fire: 11952 * `progress`, `start`, `leave` 11953 * In between start and end the `progress` event will be called constantly, whenever the progress changes. 11954 * 11955 * In short: 11956 * `enter` events will always trigger **before** the progress update and `leave` envents will trigger **after** the progress update. 11957 * `start` and `end` will always trigger at their respective position. 11958 * 11959 * Please review the event descriptions for details on the events and the event object that is passed to the callback. 11960 * 11961 * @method ScrollMagic.Scene#progress 11962 * @example 11963 * // get the current scene progress 11964 * var progress = scene.progress(); 11965 * 11966 * // set new scene progress 11967 * scene.progress(0.3); 11968 * 11969 * @fires {@link Scene.enter}, when used as setter 11970 * @fires {@link Scene.start}, when used as setter 11971 * @fires {@link Scene.progress}, when used as setter 11972 * @fires {@link Scene.end}, when used as setter 11973 * @fires {@link Scene.leave}, when used as setter 11974 * 11975 * @param {number} [progress] - The new progress value of the scene `[0-1]`. 11976 * @returns {number} `get` - Current scene progress. 11977 * @returns {Scene} `set` - Parent object for chaining. 11978 */ 11979 this.progress = function (progress) { 11980 if (!arguments.length) { 11981 // get 11982 return _progress; 11983 } else { 11984 // set 11985 var doUpdate = false, 11986 oldState = _state, 11987 scrollDirection = _controller ? _controller.info("scrollDirection") : 'PAUSED', 11988 reverseOrForward = _options.reverse || progress >= _progress; 11989 if (_options.duration === 0) { 11990 // zero duration scenes 11991 doUpdate = _progress != progress; 11992 _progress = progress < 1 && reverseOrForward ? 0 : 1; 11993 _state = _progress === 0 ? SCENE_STATE_BEFORE : SCENE_STATE_DURING; 11994 } else { 11995 // scenes with start and end 11996 if (progress < 0 && _state !== SCENE_STATE_BEFORE && reverseOrForward) { 11997 // go back to initial state 11998 _progress = 0; 11999 _state = SCENE_STATE_BEFORE; 12000 doUpdate = true; 12001 } else if (progress >= 0 && progress < 1 && reverseOrForward) { 12002 _progress = progress; 12003 _state = SCENE_STATE_DURING; 12004 doUpdate = true; 12005 } else if (progress >= 1 && _state !== SCENE_STATE_AFTER) { 12006 _progress = 1; 12007 _state = SCENE_STATE_AFTER; 12008 doUpdate = true; 12009 } else if (_state === SCENE_STATE_DURING && !reverseOrForward) { 12010 updatePinState(); // in case we scrolled backwards mid-scene and reverse is disabled => update the pin position, so it doesn't move back as well. 12011 } 12012 } 12013 12014 if (doUpdate) { 12015 // fire events 12016 var eventVars = { 12017 progress: _progress, 12018 state: _state, 12019 scrollDirection: scrollDirection 12020 }, 12021 stateChanged = _state != oldState; 12022 var trigger = function trigger(eventName) { 12023 // tmp helper to simplify code 12024 Scene.trigger(eventName, eventVars); 12025 }; 12026 if (stateChanged) { 12027 // enter events 12028 if (oldState !== SCENE_STATE_DURING) { 12029 trigger("enter"); 12030 trigger(oldState === SCENE_STATE_BEFORE ? "start" : "end"); 12031 } 12032 } 12033 trigger("progress"); 12034 if (stateChanged) { 12035 // leave events 12036 if (_state !== SCENE_STATE_DURING) { 12037 trigger(_state === SCENE_STATE_BEFORE ? "start" : "end"); 12038 trigger("leave"); 12039 } 12040 } 12041 } 12042 return Scene; 12043 } 12044 }; 12045 12046 /** 12047 * Update the start and end scrollOffset of the container. 12048 * The positions reflect what the controller's scroll position will be at the start and end respectively. 12049 * Is called, when: 12050 * - Scene event "change" is called with: offset, triggerHook, duration 12051 * - scroll container event "resize" is called 12052 * - the position of the triggerElement changes 12053 * - the controller changes -> addTo() 12054 * @private 12055 */ 12056 var updateScrollOffset = function updateScrollOffset() { 12057 _scrollOffset = { 12058 start: _triggerPos + _options.offset 12059 }; 12060 if (_controller && _options.triggerElement) { 12061 // take away triggerHook portion to get relative to top 12062 _scrollOffset.start -= _controller.info("size") * _options.triggerHook; 12063 } 12064 _scrollOffset.end = _scrollOffset.start + _options.duration; 12065 }; 12066 12067 /** 12068 * Updates the duration if set to a dynamic function. 12069 * This method is called when the scene is added to a controller and in regular intervals from the controller through scene.refresh(). 12070 * 12071 * @fires {@link Scene.change}, if the duration changed 12072 * @fires {@link Scene.shift}, if the duration changed 12073 * 12074 * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. 12075 * @private 12076 */ 12077 var updateDuration = function updateDuration(suppressEvents) { 12078 // update duration 12079 if (_durationUpdateMethod) { 12080 var varname = "duration"; 12081 if (changeOption(varname, _durationUpdateMethod.call(Scene)) && !suppressEvents) { 12082 // set 12083 Scene.trigger("change", { 12084 what: varname, 12085 newval: _options[varname] 12086 }); 12087 Scene.trigger("shift", { 12088 reason: varname 12089 }); 12090 } 12091 } 12092 }; 12093 12094 /** 12095 * Updates the position of the triggerElement, if present. 12096 * This method is called ... 12097 * - ... when the triggerElement is changed 12098 * - ... when the scene is added to a (new) controller 12099 * - ... in regular intervals from the controller through scene.refresh(). 12100 * 12101 * @fires {@link Scene.shift}, if the position changed 12102 * 12103 * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed. 12104 * @private 12105 */ 12106 var updateTriggerElementPosition = function updateTriggerElementPosition(suppressEvents) { 12107 var elementPos = 0, 12108 telem = _options.triggerElement; 12109 if (_controller && (telem || _triggerPos > 0)) { 12110 // either an element exists or was removed and the triggerPos is still > 0 12111 if (telem) { 12112 // there currently a triggerElement set 12113 if (telem.parentNode) { 12114 // check if element is still attached to DOM 12115 var controllerInfo = _controller.info(), 12116 containerOffset = _util.get.offset(controllerInfo.container), 12117 // container position is needed because element offset is returned in relation to document, not in relation to container. 12118 param = controllerInfo.vertical ? "top" : "left"; // which param is of interest ? 12119 12120 // if parent is spacer, use spacer position instead so correct start position is returned for pinned elements. 12121 while (telem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { 12122 telem = telem.parentNode; 12123 } 12124 var elementOffset = _util.get.offset(telem); 12125 if (!controllerInfo.isDocument) { 12126 // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent 12127 containerOffset[param] -= _controller.scrollPos(); 12128 } 12129 elementPos = elementOffset[param] - containerOffset[param]; 12130 } else { 12131 // there was an element, but it was removed from DOM 12132 log(2, "WARNING: triggerElement was removed from DOM and will be reset to", undefined); 12133 Scene.triggerElement(undefined); // unset, so a change event is triggered 12134 } 12135 } 12136 12137 var changed = elementPos != _triggerPos; 12138 _triggerPos = elementPos; 12139 if (changed && !suppressEvents) { 12140 Scene.trigger("shift", { 12141 reason: "triggerElementPosition" 12142 }); 12143 } 12144 } 12145 }; 12146 12147 /** 12148 * Trigger a shift event, when the container is resized and the triggerHook is > 1. 12149 * @private 12150 */ 12151 var onContainerResize = function onContainerResize(e) { 12152 if (_options.triggerHook > 0) { 12153 Scene.trigger("shift", { 12154 reason: "containerResize" 12155 }); 12156 } 12157 }; 12158 var _validate = _util.extend(SCENE_OPTIONS.validate, { 12159 // validation for duration handled internally for reference to private var _durationMethod 12160 duration: function duration(val) { 12161 if (_util.type.String(val) && val.match(/^(\.|\d)*\d+%$/)) { 12162 // percentage value 12163 var perc = parseFloat(val) / 100; 12164 val = function val() { 12165 return _controller ? _controller.info("size") * perc : 0; 12166 }; 12167 } 12168 if (_util.type.Function(val)) { 12169 // function 12170 _durationUpdateMethod = val; 12171 try { 12172 val = parseFloat(_durationUpdateMethod.call(Scene)); 12173 } catch (e) { 12174 val = -1; // will cause error below 12175 } 12176 } 12177 // val has to be float 12178 val = parseFloat(val); 12179 if (!_util.type.Number(val) || val < 0) { 12180 if (_durationUpdateMethod) { 12181 _durationUpdateMethod = undefined; 12182 throw ["Invalid return value of supplied function for option \"duration\":", val]; 12183 } else { 12184 throw ["Invalid value for option \"duration\":", val]; 12185 } 12186 } 12187 return val; 12188 } 12189 }); 12190 12191 /** 12192 * Checks the validity of a specific or all options and reset to default if neccessary. 12193 * @private 12194 */ 12195 var validateOption = function validateOption(check) { 12196 check = arguments.length ? [check] : Object.keys(_validate); 12197 check.forEach(function (optionName, key) { 12198 var value; 12199 if (_validate[optionName]) { 12200 // there is a validation method for this option 12201 try { 12202 // validate value 12203 value = _validate[optionName](_options[optionName]); 12204 } catch (e) { 12205 // validation failed -> reset to default 12206 value = DEFAULT_OPTIONS[optionName]; 12207 var logMSG = _util.type.String(e) ? [e] : e; 12208 if (_util.type.Array(logMSG)) { 12209 logMSG[0] = "ERROR: " + logMSG[0]; 12210 logMSG.unshift(1); // loglevel 1 for error msg 12211 log.apply(this, logMSG); 12212 } else { 12213 log(1, "ERROR: Problem executing validation callback for option '" + optionName + "':", e.message); 12214 } 12215 } finally { 12216 _options[optionName] = value; 12217 } 12218 } 12219 }); 12220 }; 12221 12222 /** 12223 * Helper used by the setter/getters for scene options 12224 * @private 12225 */ 12226 var changeOption = function changeOption(varname, newval) { 12227 var changed = false, 12228 oldval = _options[varname]; 12229 if (_options[varname] != newval) { 12230 _options[varname] = newval; 12231 validateOption(varname); // resets to default if necessary 12232 changed = oldval != _options[varname]; 12233 } 12234 return changed; 12235 }; 12236 12237 // generate getters/setters for all options 12238 var addSceneOption = function addSceneOption(optionName) { 12239 if (!Scene[optionName]) { 12240 Scene[optionName] = function (newVal) { 12241 if (!arguments.length) { 12242 // get 12243 return _options[optionName]; 12244 } else { 12245 if (optionName === "duration") { 12246 // new duration is set, so any previously set function must be unset 12247 _durationUpdateMethod = undefined; 12248 } 12249 if (changeOption(optionName, newVal)) { 12250 // set 12251 Scene.trigger("change", { 12252 what: optionName, 12253 newval: _options[optionName] 12254 }); 12255 if (SCENE_OPTIONS.shifts.indexOf(optionName) > -1) { 12256 Scene.trigger("shift", { 12257 reason: optionName 12258 }); 12259 } 12260 } 12261 } 12262 return Scene; 12263 }; 12264 } 12265 }; 12266 12267 /** 12268 * **Get** or **Set** the duration option value. 12269 * 12270 * As a **setter** it accepts three types of parameters: 12271 * 1. `number`: Sets the duration of the scene to exactly this amount of pixels. 12272 * This means the scene will last for exactly this amount of pixels scrolled. Sub-Pixels are also valid. 12273 * A value of `0` means that the scene is 'open end' and no end will be triggered. Pins will never unpin and animations will play independently of scroll progress. 12274 * 2. `string`: Always updates the duration relative to parent scroll container. 12275 * For example `"100%"` will keep the duration always exactly at the inner height of the scroll container. 12276 * When scrolling vertically the width is used for reference respectively. 12277 * 3. `function`: The supplied function will be called to return the scene duration. 12278 * This is useful in setups where the duration depends on other elements who might change size. By supplying a function you can return a value instead of updating potentially multiple scene durations. 12279 * The scene can be referenced inside the callback using `this`. 12280 * _**WARNING:** This is an easy way to kill performance, as the callback will be executed every time `Scene.refresh()` is called, which happens a lot. The interval is defined by the controller (see ScrollMagic.Controller option `refreshInterval`). 12281 * It's recomended to avoid calculations within the function and use cached variables as return values. 12282 * This counts double if you use the same function for multiple scenes._ 12283 * 12284 * @method ScrollMagic.Scene#duration 12285 * @example 12286 * // get the current duration value 12287 * var duration = scene.duration(); 12288 * 12289 * // set a new duration 12290 * scene.duration(300); 12291 * 12292 * // set duration responsively to container size 12293 * scene.duration("100%"); 12294 * 12295 * // use a function to randomize the duration for some reason. 12296 * var durationValueCache; 12297 * function durationCallback () { 12298 * return durationValueCache; 12299 * } 12300 * function updateDuration () { 12301 * durationValueCache = Math.random() * 100; 12302 * } 12303 * updateDuration(); // set to initial value 12304 * scene.duration(durationCallback); // set duration callback 12305 * 12306 * @fires {@link Scene.change}, when used as setter 12307 * @fires {@link Scene.shift}, when used as setter 12308 * @param {(number|string|function)} [newDuration] - The new duration setting for the scene. 12309 * @returns {number} `get` - Current scene duration. 12310 * @returns {Scene} `set` - Parent object for chaining. 12311 */ 12312 12313 /** 12314 * **Get** or **Set** the offset option value. 12315 * @method ScrollMagic.Scene#offset 12316 * @example 12317 * // get the current offset 12318 * var offset = scene.offset(); 12319 * 12320 * // set a new offset 12321 * scene.offset(100); 12322 * 12323 * @fires {@link Scene.change}, when used as setter 12324 * @fires {@link Scene.shift}, when used as setter 12325 * @param {number} [newOffset] - The new offset of the scene. 12326 * @returns {number} `get` - Current scene offset. 12327 * @returns {Scene} `set` - Parent object for chaining. 12328 */ 12329 12330 /** 12331 * **Get** or **Set** the triggerElement option value. 12332 * Does **not** fire `Scene.shift`, because changing the trigger Element doesn't necessarily mean the start position changes. This will be determined in `Scene.refresh()`, which is automatically triggered. 12333 * @method ScrollMagic.Scene#triggerElement 12334 * @example 12335 * // get the current triggerElement 12336 * var triggerElement = scene.triggerElement(); 12337 * 12338 * // set a new triggerElement using a selector 12339 * scene.triggerElement("#trigger"); 12340 * // set a new triggerElement using a DOM object 12341 * scene.triggerElement(document.getElementById("trigger")); 12342 * 12343 * @fires {@link Scene.change}, when used as setter 12344 * @param {(string|object)} [newTriggerElement] - The new trigger element for the scene. 12345 * @returns {(string|object)} `get` - Current triggerElement. 12346 * @returns {Scene} `set` - Parent object for chaining. 12347 */ 12348 12349 /** 12350 * **Get** or **Set** the triggerHook option value. 12351 * @method ScrollMagic.Scene#triggerHook 12352 * @example 12353 * // get the current triggerHook value 12354 * var triggerHook = scene.triggerHook(); 12355 * 12356 * // set a new triggerHook using a string 12357 * scene.triggerHook("onLeave"); 12358 * // set a new triggerHook using a number 12359 * scene.triggerHook(0.7); 12360 * 12361 * @fires {@link Scene.change}, when used as setter 12362 * @fires {@link Scene.shift}, when used as setter 12363 * @param {(number|string)} [newTriggerHook] - The new triggerHook of the scene. See {@link Scene} parameter description for value options. 12364 * @returns {number} `get` - Current triggerHook (ALWAYS numerical). 12365 * @returns {Scene} `set` - Parent object for chaining. 12366 */ 12367 12368 /** 12369 * **Get** or **Set** the reverse option value. 12370 * @method ScrollMagic.Scene#reverse 12371 * @example 12372 * // get the current reverse option 12373 * var reverse = scene.reverse(); 12374 * 12375 * // set new reverse option 12376 * scene.reverse(false); 12377 * 12378 * @fires {@link Scene.change}, when used as setter 12379 * @param {boolean} [newReverse] - The new reverse setting of the scene. 12380 * @returns {boolean} `get` - Current reverse option value. 12381 * @returns {Scene} `set` - Parent object for chaining. 12382 */ 12383 12384 /** 12385 * **Get** or **Set** the loglevel option value. 12386 * @method ScrollMagic.Scene#loglevel 12387 * @example 12388 * // get the current loglevel 12389 * var loglevel = scene.loglevel(); 12390 * 12391 * // set new loglevel 12392 * scene.loglevel(3); 12393 * 12394 * @fires {@link Scene.change}, when used as setter 12395 * @param {number} [newLoglevel] - The new loglevel setting of the scene. `[0-3]` 12396 * @returns {number} `get` - Current loglevel. 12397 * @returns {Scene} `set` - Parent object for chaining. 12398 */ 12399 12400 /** 12401 * **Get** the associated controller. 12402 * @method ScrollMagic.Scene#controller 12403 * @example 12404 * // get the controller of a scene 12405 * var controller = scene.controller(); 12406 * 12407 * @returns {ScrollMagic.Controller} Parent controller or `undefined` 12408 */ 12409 this.controller = function () { 12410 return _controller; 12411 }; 12412 12413 /** 12414 * **Get** the current state. 12415 * @method ScrollMagic.Scene#state 12416 * @example 12417 * // get the current state 12418 * var state = scene.state(); 12419 * 12420 * @returns {string} `"BEFORE"`, `"DURING"` or `"AFTER"` 12421 */ 12422 this.state = function () { 12423 return _state; 12424 }; 12425 12426 /** 12427 * **Get** the current scroll offset for the start of the scene. 12428 * Mind, that the scrollOffset is related to the size of the container, if `triggerHook` is bigger than `0` (or `"onLeave"`). 12429 * This means, that resizing the container or changing the `triggerHook` will influence the scene's start offset. 12430 * @method ScrollMagic.Scene#scrollOffset 12431 * @example 12432 * // get the current scroll offset for the start and end of the scene. 12433 * var start = scene.scrollOffset(); 12434 * var end = scene.scrollOffset() + scene.duration(); 12435 * console.log("the scene starts at", start, "and ends at", end); 12436 * 12437 * @returns {number} The scroll offset (of the container) at which the scene will trigger. Y value for vertical and X value for horizontal scrolls. 12438 */ 12439 this.scrollOffset = function () { 12440 return _scrollOffset.start; 12441 }; 12442 12443 /** 12444 * **Get** the trigger position of the scene (including the value of the `offset` option). 12445 * @method ScrollMagic.Scene#triggerPosition 12446 * @example 12447 * // get the scene's trigger position 12448 * var triggerPosition = scene.triggerPosition(); 12449 * 12450 * @returns {number} Start position of the scene. Top position value for vertical and left position value for horizontal scrolls. 12451 */ 12452 this.triggerPosition = function () { 12453 var pos = _options.offset; // the offset is the basis 12454 if (_controller) { 12455 // get the trigger position 12456 if (_options.triggerElement) { 12457 // Element as trigger 12458 pos += _triggerPos; 12459 } else { 12460 // return the height of the triggerHook to start at the beginning 12461 pos += _controller.info("size") * Scene.triggerHook(); 12462 } 12463 } 12464 return pos; 12465 }; 12466 var _pin, _pinOptions; 12467 Scene.on("shift.internal", function (e) { 12468 var durationChanged = e.reason === "duration"; 12469 if (_state === SCENE_STATE_AFTER && durationChanged || _state === SCENE_STATE_DURING && _options.duration === 0) { 12470 // if [duration changed after a scene (inside scene progress updates pin position)] or [duration is 0, we are in pin phase and some other value changed]. 12471 updatePinState(); 12472 } 12473 if (durationChanged) { 12474 updatePinDimensions(); 12475 } 12476 }).on("progress.internal", function (e) { 12477 updatePinState(); 12478 }).on("add.internal", function (e) { 12479 updatePinDimensions(); 12480 }).on("destroy.internal", function (e) { 12481 Scene.removePin(e.reset); 12482 }); 12483 /** 12484 * Update the pin state. 12485 * @private 12486 */ 12487 var updatePinState = function updatePinState(forceUnpin) { 12488 if (_pin && _controller) { 12489 var containerInfo = _controller.info(), 12490 pinTarget = _pinOptions.spacer.firstChild; // may be pin element or another spacer, if cascading pins 12491 12492 if (!forceUnpin && _state === SCENE_STATE_DURING) { 12493 // during scene or if duration is 0 and we are past the trigger 12494 // pinned state 12495 if (_util.css(pinTarget, "position") != "fixed") { 12496 // change state before updating pin spacer (position changes due to fixed collapsing might occur.) 12497 _util.css(pinTarget, { 12498 "position": "fixed" 12499 }); 12500 // update pin spacer 12501 updatePinDimensions(); 12502 } 12503 var fixedPos = _util.get.offset(_pinOptions.spacer, true), 12504 // get viewport position of spacer 12505 scrollDistance = _options.reverse || _options.duration === 0 ? containerInfo.scrollPos - _scrollOffset.start // quicker 12506 : Math.round(_progress * _options.duration * 10) / 10; // if no reverse and during pin the position needs to be recalculated using the progress 12507 12508 // add scrollDistance 12509 fixedPos[containerInfo.vertical ? "top" : "left"] += scrollDistance; 12510 12511 // set new values 12512 _util.css(_pinOptions.spacer.firstChild, { 12513 top: fixedPos.top, 12514 left: fixedPos.left 12515 }); 12516 } else { 12517 // unpinned state 12518 var newCSS = { 12519 position: _pinOptions.inFlow ? "relative" : "absolute", 12520 top: 0, 12521 left: 0 12522 }, 12523 change = _util.css(pinTarget, "position") != newCSS.position; 12524 if (!_pinOptions.pushFollowers) { 12525 newCSS[containerInfo.vertical ? "top" : "left"] = _options.duration * _progress; 12526 } else if (_options.duration > 0) { 12527 // only concerns scenes with duration 12528 if (_state === SCENE_STATE_AFTER && parseFloat(_util.css(_pinOptions.spacer, "padding-top")) === 0) { 12529 change = true; // if in after state but havent updated spacer yet (jumped past pin) 12530 } else if (_state === SCENE_STATE_BEFORE && parseFloat(_util.css(_pinOptions.spacer, "padding-bottom")) === 0) { 12531 // before 12532 change = true; // jumped past fixed state upward direction 12533 } 12534 } 12535 // set new values 12536 _util.css(pinTarget, newCSS); 12537 if (change) { 12538 // update pin spacer if state changed 12539 updatePinDimensions(); 12540 } 12541 } 12542 } 12543 }; 12544 12545 /** 12546 * Update the pin spacer and/or element size. 12547 * The size of the spacer needs to be updated whenever the duration of the scene changes, if it is to push down following elements. 12548 * @private 12549 */ 12550 var updatePinDimensions = function updatePinDimensions() { 12551 if (_pin && _controller && _pinOptions.inFlow) { 12552 // no spacerresize, if original position is absolute 12553 var after = _state === SCENE_STATE_AFTER, 12554 before = _state === SCENE_STATE_BEFORE, 12555 during = _state === SCENE_STATE_DURING, 12556 vertical = _controller.info("vertical"), 12557 pinTarget = _pinOptions.spacer.firstChild, 12558 // usually the pined element but can also be another spacer (cascaded pins) 12559 marginCollapse = _util.isMarginCollapseType(_util.css(_pinOptions.spacer, "display")), 12560 css = {}; 12561 12562 // set new size 12563 // if relsize: spacer -> pin | else: pin -> spacer 12564 if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { 12565 if (during) { 12566 _util.css(_pin, { 12567 "width": _util.get.width(_pinOptions.spacer) 12568 }); 12569 } else { 12570 _util.css(_pin, { 12571 "width": "100%" 12572 }); 12573 } 12574 } else { 12575 // minwidth is needed for cascaded pins. 12576 css["min-width"] = _util.get.width(vertical ? _pin : pinTarget, true, true); 12577 css.width = during ? css["min-width"] : "auto"; 12578 } 12579 if (_pinOptions.relSize.height) { 12580 if (during) { 12581 // the only padding the spacer should ever include is the duration (if pushFollowers = true), so we need to substract that. 12582 _util.css(_pin, { 12583 "height": _util.get.height(_pinOptions.spacer) - (_pinOptions.pushFollowers ? _options.duration : 0) 12584 }); 12585 } else { 12586 _util.css(_pin, { 12587 "height": "100%" 12588 }); 12589 } 12590 } else { 12591 // margin is only included if it's a cascaded pin to resolve an IE9 bug 12592 css["min-height"] = _util.get.height(vertical ? pinTarget : _pin, true, !marginCollapse); // needed for cascading pins 12593 css.height = during ? css["min-height"] : "auto"; 12594 } 12595 12596 // add space for duration if pushFollowers is true 12597 if (_pinOptions.pushFollowers) { 12598 css["padding" + (vertical ? "Top" : "Left")] = _options.duration * _progress; 12599 css["padding" + (vertical ? "Bottom" : "Right")] = _options.duration * (1 - _progress); 12600 } 12601 _util.css(_pinOptions.spacer, css); 12602 } 12603 }; 12604 12605 /** 12606 * Updates the Pin state (in certain scenarios) 12607 * If the controller container is not the document and we are mid-pin-phase scrolling or resizing the main document can result to wrong pin positions. 12608 * So this function is called on resize and scroll of the document. 12609 * @private 12610 */ 12611 var updatePinInContainer = function updatePinInContainer() { 12612 if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { 12613 updatePinState(); 12614 } 12615 }; 12616 12617 /** 12618 * Updates the Pin spacer size state (in certain scenarios) 12619 * If container is resized during pin and relatively sized the size of the pin might need to be updated... 12620 * So this function is called on resize of the container. 12621 * @private 12622 */ 12623 var updateRelativePinSpacer = function updateRelativePinSpacer() { 12624 if (_controller && _pin && 12625 // well, duh 12626 _state === SCENE_STATE_DURING && ( 12627 // element in pinned state? 12628 // is width or height relatively sized, but not in relation to body? then we need to recalc. 12629 (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) && _util.get.width(window) != _util.get.width(_pinOptions.spacer.parentNode) || _pinOptions.relSize.height && _util.get.height(window) != _util.get.height(_pinOptions.spacer.parentNode))) { 12630 updatePinDimensions(); 12631 } 12632 }; 12633 12634 /** 12635 * Is called, when the mousewhel is used while over a pinned element inside a div container. 12636 * If the scene is in fixed state scroll events would be counted towards the body. This forwards the event to the scroll container. 12637 * @private 12638 */ 12639 var onMousewheelOverPin = function onMousewheelOverPin(e) { 12640 if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { 12641 // in pin state 12642 e.preventDefault(); 12643 _controller._setScrollPos(_controller.info("scrollPos") - ((e.wheelDelta || e[_controller.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || -e.detail * 30)); 12644 } 12645 }; 12646 12647 /** 12648 * Pin an element for the duration of the scene. 12649 * If the scene duration is 0 the element will only be unpinned, if the user scrolls back past the start position. 12650 * Make sure only one pin is applied to an element at the same time. 12651 * An element can be pinned multiple times, but only successively. 12652 * _**NOTE:** The option `pushFollowers` has no effect, when the scene duration is 0._ 12653 * @method ScrollMagic.Scene#setPin 12654 * @example 12655 * // pin element and push all following elements down by the amount of the pin duration. 12656 * scene.setPin("#pin"); 12657 * 12658 * // pin element and keeping all following elements in their place. The pinned element will move past them. 12659 * scene.setPin("#pin", {pushFollowers: false}); 12660 * 12661 * @param {(string|object)} element - A Selector targeting an element or a DOM object that is supposed to be pinned. 12662 * @param {object} [settings] - settings for the pin 12663 * @param {boolean} [settings.pushFollowers=true] - If `true` following elements will be "pushed" down for the duration of the pin, if `false` the pinned element will just scroll past them. 12664 Ignored, when duration is `0`. 12665 * @param {string} [settings.spacerClass="scrollmagic-pin-spacer"] - Classname of the pin spacer element, which is used to replace the element. 12666 * 12667 * @returns {Scene} Parent object for chaining. 12668 */ 12669 this.setPin = function (element, settings) { 12670 var defaultSettings = { 12671 pushFollowers: true, 12672 spacerClass: "scrollmagic-pin-spacer" 12673 }; 12674 var pushFollowersActivelySet = settings && settings.hasOwnProperty('pushFollowers'); 12675 settings = _util.extend({}, defaultSettings, settings); 12676 12677 // validate Element 12678 element = _util.get.elements(element)[0]; 12679 if (!element) { 12680 log(1, "ERROR calling method 'setPin()': Invalid pin element supplied."); 12681 return Scene; // cancel 12682 } else if (_util.css(element, "position") === "fixed") { 12683 log(1, "ERROR calling method 'setPin()': Pin does not work with elements that are positioned 'fixed'."); 12684 return Scene; // cancel 12685 } 12686 12687 if (_pin) { 12688 // preexisting pin? 12689 if (_pin === element) { 12690 // same pin we already have -> do nothing 12691 return Scene; // cancel 12692 } else { 12693 // kill old pin 12694 Scene.removePin(); 12695 } 12696 } 12697 _pin = element; 12698 var parentDisplay = _pin.parentNode.style.display, 12699 boundsParams = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"]; 12700 _pin.parentNode.style.display = 'none'; // hack start to force css to return stylesheet values instead of calculated px values. 12701 var inFlow = _util.css(_pin, "position") != "absolute", 12702 pinCSS = _util.css(_pin, boundsParams.concat(["display"])), 12703 sizeCSS = _util.css(_pin, ["width", "height"]); 12704 _pin.parentNode.style.display = parentDisplay; // hack end. 12705 12706 if (!inFlow && settings.pushFollowers) { 12707 log(2, "WARNING: If the pinned element is positioned absolutely pushFollowers will be disabled."); 12708 settings.pushFollowers = false; 12709 } 12710 window.setTimeout(function () { 12711 // wait until all finished, because with responsive duration it will only be set after scene is added to controller 12712 if (_pin && _options.duration === 0 && pushFollowersActivelySet && settings.pushFollowers) { 12713 log(2, "WARNING: pushFollowers =", true, "has no effect, when scene duration is 0."); 12714 } 12715 }, 0); 12716 12717 // create spacer and insert 12718 var spacer = _pin.parentNode.insertBefore(document.createElement('div'), _pin), 12719 spacerCSS = _util.extend(pinCSS, { 12720 position: inFlow ? "relative" : "absolute", 12721 boxSizing: "content-box", 12722 mozBoxSizing: "content-box", 12723 webkitBoxSizing: "content-box" 12724 }); 12725 if (!inFlow) { 12726 // copy size if positioned absolutely, to work for bottom/right positioned elements. 12727 _util.extend(spacerCSS, _util.css(_pin, ["width", "height"])); 12728 } 12729 _util.css(spacer, spacerCSS); 12730 spacer.setAttribute(PIN_SPACER_ATTRIBUTE, ""); 12731 _util.addClass(spacer, settings.spacerClass); 12732 12733 // set the pin Options 12734 _pinOptions = { 12735 spacer: spacer, 12736 relSize: { 12737 // save if size is defined using % values. if so, handle spacer resize differently... 12738 width: sizeCSS.width.slice(-1) === "%", 12739 height: sizeCSS.height.slice(-1) === "%", 12740 autoFullWidth: sizeCSS.width === "auto" && inFlow && _util.isMarginCollapseType(pinCSS.display) 12741 }, 12742 pushFollowers: settings.pushFollowers, 12743 inFlow: inFlow // stores if the element takes up space in the document flow 12744 }; 12745 12746 if (!_pin.___origStyle) { 12747 _pin.___origStyle = {}; 12748 var pinInlineCSS = _pin.style, 12749 copyStyles = boundsParams.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]); 12750 copyStyles.forEach(function (val) { 12751 _pin.___origStyle[val] = pinInlineCSS[val] || ""; 12752 }); 12753 } 12754 12755 // if relative size, transfer it to spacer and make pin calculate it... 12756 if (_pinOptions.relSize.width) { 12757 _util.css(spacer, { 12758 width: sizeCSS.width 12759 }); 12760 } 12761 if (_pinOptions.relSize.height) { 12762 _util.css(spacer, { 12763 height: sizeCSS.height 12764 }); 12765 } 12766 12767 // now place the pin element inside the spacer 12768 spacer.appendChild(_pin); 12769 // and set new css 12770 _util.css(_pin, { 12771 position: inFlow ? "relative" : "absolute", 12772 margin: "auto", 12773 top: "auto", 12774 left: "auto", 12775 bottom: "auto", 12776 right: "auto" 12777 }); 12778 if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) { 12779 _util.css(_pin, { 12780 boxSizing: "border-box", 12781 mozBoxSizing: "border-box", 12782 webkitBoxSizing: "border-box" 12783 }); 12784 } 12785 12786 // add listener to document to update pin position in case controller is not the document. 12787 window.addEventListener('scroll', updatePinInContainer); 12788 window.addEventListener('resize', updatePinInContainer); 12789 window.addEventListener('resize', updateRelativePinSpacer); 12790 // add mousewheel listener to catch scrolls over fixed elements 12791 _pin.addEventListener("mousewheel", onMousewheelOverPin); 12792 _pin.addEventListener("DOMMouseScroll", onMousewheelOverPin); 12793 log(3, "added pin"); 12794 12795 // finally update the pin to init 12796 updatePinState(); 12797 return Scene; 12798 }; 12799 12800 /** 12801 * Remove the pin from the scene. 12802 * @method ScrollMagic.Scene#removePin 12803 * @example 12804 * // remove the pin from the scene without resetting it (the spacer is not removed) 12805 * scene.removePin(); 12806 * 12807 * // remove the pin from the scene and reset the pin element to its initial position (spacer is removed) 12808 * scene.removePin(true); 12809 * 12810 * @param {boolean} [reset=false] - If `false` the spacer will not be removed and the element's position will not be reset. 12811 * @returns {Scene} Parent object for chaining. 12812 */ 12813 this.removePin = function (reset) { 12814 if (_pin) { 12815 if (_state === SCENE_STATE_DURING) { 12816 updatePinState(true); // force unpin at position 12817 } 12818 12819 if (reset || !_controller) { 12820 // if there's no controller no progress was made anyway... 12821 var pinTarget = _pinOptions.spacer.firstChild; // usually the pin element, but may be another spacer (cascaded pins)... 12822 if (pinTarget.hasAttribute(PIN_SPACER_ATTRIBUTE)) { 12823 // copy margins to child spacer 12824 var style = _pinOptions.spacer.style, 12825 values = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"], 12826 margins = {}; 12827 values.forEach(function (val) { 12828 margins[val] = style[val] || ""; 12829 }); 12830 _util.css(pinTarget, margins); 12831 } 12832 _pinOptions.spacer.parentNode.insertBefore(pinTarget, _pinOptions.spacer); 12833 _pinOptions.spacer.parentNode.removeChild(_pinOptions.spacer); 12834 if (!_pin.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { 12835 // if it's the last pin for this element -> restore inline styles 12836 // TODO: only correctly set for first pin (when cascading) - how to fix? 12837 _util.css(_pin, _pin.___origStyle); 12838 delete _pin.___origStyle; 12839 } 12840 } 12841 window.removeEventListener('scroll', updatePinInContainer); 12842 window.removeEventListener('resize', updatePinInContainer); 12843 window.removeEventListener('resize', updateRelativePinSpacer); 12844 _pin.removeEventListener("mousewheel", onMousewheelOverPin); 12845 _pin.removeEventListener("DOMMouseScroll", onMousewheelOverPin); 12846 _pin = undefined; 12847 log(3, "removed pin (reset: " + (reset ? "true" : "false") + ")"); 12848 } 12849 return Scene; 12850 }; 12851 var _cssClasses, 12852 _cssClassElems = []; 12853 Scene.on("destroy.internal", function (e) { 12854 Scene.removeClassToggle(e.reset); 12855 }); 12856 /** 12857 * Define a css class modification while the scene is active. 12858 * When the scene triggers the classes will be added to the supplied element and removed, when the scene is over. 12859 * If the scene duration is 0 the classes will only be removed if the user scrolls back past the start position. 12860 * @method ScrollMagic.Scene#setClassToggle 12861 * @example 12862 * // add the class 'myclass' to the element with the id 'my-elem' for the duration of the scene 12863 * scene.setClassToggle("#my-elem", "myclass"); 12864 * 12865 * // add multiple classes to multiple elements defined by the selector '.classChange' 12866 * scene.setClassToggle(".classChange", "class1 class2 class3"); 12867 * 12868 * @param {(string|object)} element - A Selector targeting one or more elements or a DOM object that is supposed to be modified. 12869 * @param {string} classes - One or more Classnames (separated by space) that should be added to the element during the scene. 12870 * 12871 * @returns {Scene} Parent object for chaining. 12872 */ 12873 this.setClassToggle = function (element, classes) { 12874 var elems = _util.get.elements(element); 12875 if (elems.length === 0 || !_util.type.String(classes)) { 12876 log(1, "ERROR calling method 'setClassToggle()': Invalid " + (elems.length === 0 ? "element" : "classes") + " supplied."); 12877 return Scene; 12878 } 12879 if (_cssClassElems.length > 0) { 12880 // remove old ones 12881 Scene.removeClassToggle(); 12882 } 12883 _cssClasses = classes; 12884 _cssClassElems = elems; 12885 Scene.on("enter.internal_class leave.internal_class", function (e) { 12886 var toggle = e.type === "enter" ? _util.addClass : _util.removeClass; 12887 _cssClassElems.forEach(function (elem, key) { 12888 toggle(elem, _cssClasses); 12889 }); 12890 }); 12891 return Scene; 12892 }; 12893 12894 /** 12895 * Remove the class binding from the scene. 12896 * @method ScrollMagic.Scene#removeClassToggle 12897 * @example 12898 * // remove class binding from the scene without reset 12899 * scene.removeClassToggle(); 12900 * 12901 * // remove class binding and remove the changes it caused 12902 * scene.removeClassToggle(true); 12903 * 12904 * @param {boolean} [reset=false] - If `false` and the classes are currently active, they will remain on the element. If `true` they will be removed. 12905 * @returns {Scene} Parent object for chaining. 12906 */ 12907 this.removeClassToggle = function (reset) { 12908 if (reset) { 12909 _cssClassElems.forEach(function (elem, key) { 12910 _util.removeClass(elem, _cssClasses); 12911 }); 12912 } 12913 Scene.off("start.internal_class end.internal_class"); 12914 _cssClasses = undefined; 12915 _cssClassElems = []; 12916 return Scene; 12917 }; 12918 12919 // INIT 12920 construct(); 12921 return Scene; 12922 }; 12923 12924 // store pagewide scene options 12925 var SCENE_OPTIONS = { 12926 defaults: { 12927 duration: 0, 12928 offset: 0, 12929 triggerElement: undefined, 12930 triggerHook: 0.5, 12931 reverse: true, 12932 loglevel: 2 12933 }, 12934 validate: { 12935 offset: function offset(val) { 12936 val = parseFloat(val); 12937 if (!_util.type.Number(val)) { 12938 throw ["Invalid value for option \"offset\":", val]; 12939 } 12940 return val; 12941 }, 12942 triggerElement: function triggerElement(val) { 12943 val = val || undefined; 12944 if (val) { 12945 var elem = _util.get.elements(val)[0]; 12946 if (elem && elem.parentNode) { 12947 val = elem; 12948 } else { 12949 throw ["Element defined in option \"triggerElement\" was not found:", val]; 12950 } 12951 } 12952 return val; 12953 }, 12954 triggerHook: function triggerHook(val) { 12955 var translate = { 12956 "onCenter": 0.5, 12957 "onEnter": 1, 12958 "onLeave": 0 12959 }; 12960 if (_util.type.Number(val)) { 12961 val = Math.max(0, Math.min(parseFloat(val), 1)); // make sure its betweeen 0 and 1 12962 } else if (val in translate) { 12963 val = translate[val]; 12964 } else { 12965 throw ["Invalid value for option \"triggerHook\": ", val]; 12966 } 12967 return val; 12968 }, 12969 reverse: function reverse(val) { 12970 return !!val; // force boolean 12971 }, 12972 12973 loglevel: function loglevel(val) { 12974 val = parseInt(val); 12975 if (!_util.type.Number(val) || val < 0 || val > 3) { 12976 throw ["Invalid value for option \"loglevel\":", val]; 12977 } 12978 return val; 12979 } 12980 }, 12981 // holder for validation methods. duration validation is handled in 'getters-setters.js' 12982 shifts: ["duration", "offset", "triggerHook"] // list of options that trigger a `shift` event 12983 }; 12984 /* 12985 * method used to add an option to ScrollMagic Scenes. 12986 * TODO: DOC (private for dev) 12987 */ 12988 ScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) { 12989 if (!(name in SCENE_OPTIONS.defaults)) { 12990 SCENE_OPTIONS.defaults[name] = defaultValue; 12991 SCENE_OPTIONS.validate[name] = validationCallback; 12992 if (shifts) { 12993 SCENE_OPTIONS.shifts.push(name); 12994 } 12995 } else { 12996 ScrollMagic._util.log(1, "[static] ScrollMagic.Scene -> Cannot add Scene option '" + name + "', because it already exists."); 12997 } 12998 }; 12999 // instance extension function for plugins 13000 // TODO: DOC (private for dev) 13001 ScrollMagic.Scene.extend = function (extension) { 13002 var oldClass = this; 13003 ScrollMagic.Scene = function () { 13004 oldClass.apply(this, arguments); 13005 this.$super = _util.extend({}, this); // copy parent state 13006 return extension.apply(this, arguments) || this; 13007 }; 13008 _util.extend(ScrollMagic.Scene, oldClass); // copy properties 13009 ScrollMagic.Scene.prototype = oldClass.prototype; // copy prototype 13010 ScrollMagic.Scene.prototype.constructor = ScrollMagic.Scene; // restore constructor 13011 }; 13012 13013 /** 13014 * TODO: DOCS (private for dev) 13015 * @class 13016 * @private 13017 */ 13018 13019 ScrollMagic.Event = function (type, namespace, target, vars) { 13020 vars = vars || {}; 13021 for (var key in vars) { 13022 this[key] = vars[key]; 13023 } 13024 this.type = type; 13025 this.target = this.currentTarget = target; 13026 this.namespace = namespace || ''; 13027 this.timeStamp = this.timestamp = Date.now(); 13028 return this; 13029 }; 13030 13031 /* 13032 * TODO: DOCS (private for dev) 13033 */ 13034 13035 var _util = ScrollMagic._util = function (window) { 13036 var U = {}, 13037 i; 13038 13039 /** 13040 * ------------------------------ 13041 * internal helpers 13042 * ------------------------------ 13043 */ 13044 13045 // parse float and fall back to 0. 13046 var floatval = function floatval(number) { 13047 return parseFloat(number) || 0; 13048 }; 13049 // get current style IE safe (otherwise IE would return calculated values for 'auto') 13050 var _getComputedStyle = function _getComputedStyle(elem) { 13051 return elem.currentStyle ? elem.currentStyle : window.getComputedStyle(elem); 13052 }; 13053 13054 // get element dimension (width or height) 13055 var _dimension = function _dimension(which, elem, outer, includeMargin) { 13056 elem = elem === document ? window : elem; 13057 if (elem === window) { 13058 includeMargin = false; 13059 } else if (!_type.DomElement(elem)) { 13060 return 0; 13061 } 13062 which = which.charAt(0).toUpperCase() + which.substr(1).toLowerCase(); 13063 var dimension = (outer ? elem['offset' + which] || elem['outer' + which] : elem['client' + which] || elem['inner' + which]) || 0; 13064 if (outer && includeMargin) { 13065 var style = _getComputedStyle(elem); 13066 dimension += which === 'Height' ? floatval(style.marginTop) + floatval(style.marginBottom) : floatval(style.marginLeft) + floatval(style.marginRight); 13067 } 13068 return dimension; 13069 }; 13070 // converts 'margin-top' into 'marginTop' 13071 var _camelCase = function _camelCase(str) { 13072 return str.replace(/^[^a-z]+([a-z])/g, '$1').replace(/-([a-z])/g, function (g) { 13073 return g[1].toUpperCase(); 13074 }); 13075 }; 13076 13077 /** 13078 * ------------------------------ 13079 * external helpers 13080 * ------------------------------ 13081 */ 13082 13083 // extend obj – same as jQuery.extend({}, objA, objB) 13084 U.extend = function (obj) { 13085 obj = obj || {}; 13086 for (i = 1; i < arguments.length; i++) { 13087 if (!arguments[i]) { 13088 continue; 13089 } 13090 for (var key in arguments[i]) { 13091 if (arguments[i].hasOwnProperty(key)) { 13092 obj[key] = arguments[i][key]; 13093 } 13094 } 13095 } 13096 return obj; 13097 }; 13098 13099 // check if a css display type results in margin-collapse or not 13100 U.isMarginCollapseType = function (str) { 13101 return ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(str) > -1; 13102 }; 13103 13104 // implementation of requestAnimationFrame 13105 // based on https://gist.github.com/paulirish/1579671 13106 var lastTime = 0, 13107 vendors = ['ms', 'moz', 'webkit', 'o']; 13108 var _requestAnimationFrame = window.requestAnimationFrame; 13109 var _cancelAnimationFrame = window.cancelAnimationFrame; 13110 // try vendor prefixes if the above doesn't work 13111 for (i = 0; !_requestAnimationFrame && i < vendors.length; ++i) { 13112 _requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame']; 13113 _cancelAnimationFrame = window[vendors[i] + 'CancelAnimationFrame'] || window[vendors[i] + 'CancelRequestAnimationFrame']; 13114 } 13115 13116 // fallbacks 13117 if (!_requestAnimationFrame) { 13118 _requestAnimationFrame = function _requestAnimationFrame(callback) { 13119 var currTime = new Date().getTime(), 13120 timeToCall = Math.max(0, 16 - (currTime - lastTime)), 13121 id = window.setTimeout(function () { 13122 callback(currTime + timeToCall); 13123 }, timeToCall); 13124 lastTime = currTime + timeToCall; 13125 return id; 13126 }; 13127 } 13128 if (!_cancelAnimationFrame) { 13129 _cancelAnimationFrame = function _cancelAnimationFrame(id) { 13130 window.clearTimeout(id); 13131 }; 13132 } 13133 U.rAF = _requestAnimationFrame.bind(window); 13134 U.cAF = _cancelAnimationFrame.bind(window); 13135 var loglevels = ["error", "warn", "log"], 13136 console = window.console || {}; 13137 console.log = console.log || function () {}; // no console log, well - do nothing then... 13138 // make sure methods for all levels exist. 13139 for (i = 0; i < loglevels.length; i++) { 13140 var method = loglevels[i]; 13141 if (!console[method]) { 13142 console[method] = console.log; // prefer .log over nothing 13143 } 13144 } 13145 13146 U.log = function (loglevel) { 13147 if (loglevel > loglevels.length || loglevel <= 0) loglevel = loglevels.length; 13148 var now = new Date(), 13149 time = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2) + ":" + ("0" + now.getSeconds()).slice(-2) + ":" + ("00" + now.getMilliseconds()).slice(-3), 13150 method = loglevels[loglevel - 1], 13151 args = Array.prototype.splice.call(arguments, 1), 13152 func = Function.prototype.bind.call(console[method], console); 13153 args.unshift(time); 13154 func.apply(console, args); 13155 }; 13156 13157 /** 13158 * ------------------------------ 13159 * type testing 13160 * ------------------------------ 13161 */ 13162 13163 var _type = U.type = function (v) { 13164 return Object.prototype.toString.call(v).replace(/^\[object (.+)\]$/, "$1").toLowerCase(); 13165 }; 13166 _type.String = function (v) { 13167 return _type(v) === 'string'; 13168 }; 13169 _type.Function = function (v) { 13170 return _type(v) === 'function'; 13171 }; 13172 _type.Array = function (v) { 13173 return Array.isArray(v); 13174 }; 13175 _type.Number = function (v) { 13176 return !_type.Array(v) && v - parseFloat(v) + 1 >= 0; 13177 }; 13178 _type.DomElement = function (o) { 13179 return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === "object" || typeof HTMLElement === "function" ? o instanceof HTMLElement || o instanceof SVGElement : 13180 //DOM2 13181 o && _typeof(o) === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"; 13182 }; 13183 13184 /** 13185 * ------------------------------ 13186 * DOM Element info 13187 * ------------------------------ 13188 */ 13189 // always returns a list of matching DOM elements, from a selector, a DOM element or an list of elements or even an array of selectors 13190 var _get = U.get = {}; 13191 _get.elements = function (selector) { 13192 var arr = []; 13193 if (_type.String(selector)) { 13194 try { 13195 selector = document.querySelectorAll(selector); 13196 } catch (e) { 13197 // invalid selector 13198 return arr; 13199 } 13200 } 13201 if (_type(selector) === 'nodelist' || _type.Array(selector) || selector instanceof NodeList) { 13202 for (var i = 0, ref = arr.length = selector.length; i < ref; i++) { 13203 // list of elements 13204 var elem = selector[i]; 13205 arr[i] = _type.DomElement(elem) ? elem : _get.elements(elem); // if not an element, try to resolve recursively 13206 } 13207 } else if (_type.DomElement(selector) || selector === document || selector === window) { 13208 arr = [selector]; // only the element 13209 } 13210 13211 return arr; 13212 }; 13213 // get scroll top value 13214 _get.scrollTop = function (elem) { 13215 return elem && typeof elem.scrollTop === 'number' ? elem.scrollTop : window.pageYOffset || 0; 13216 }; 13217 // get scroll left value 13218 _get.scrollLeft = function (elem) { 13219 return elem && typeof elem.scrollLeft === 'number' ? elem.scrollLeft : window.pageXOffset || 0; 13220 }; 13221 // get element height 13222 _get.width = function (elem, outer, includeMargin) { 13223 return _dimension('width', elem, outer, includeMargin); 13224 }; 13225 // get element width 13226 _get.height = function (elem, outer, includeMargin) { 13227 return _dimension('height', elem, outer, includeMargin); 13228 }; 13229 13230 // get element position (optionally relative to viewport) 13231 _get.offset = function (elem, relativeToViewport) { 13232 var offset = { 13233 top: 0, 13234 left: 0 13235 }; 13236 if (elem && elem.getBoundingClientRect) { 13237 // check if available 13238 var rect = elem.getBoundingClientRect(); 13239 offset.top = rect.top; 13240 offset.left = rect.left; 13241 if (!relativeToViewport) { 13242 // clientRect is by default relative to viewport... 13243 offset.top += _get.scrollTop(); 13244 offset.left += _get.scrollLeft(); 13245 } 13246 } 13247 return offset; 13248 }; 13249 13250 /** 13251 * ------------------------------ 13252 * DOM Element manipulation 13253 * ------------------------------ 13254 */ 13255 13256 U.addClass = function (elem, classname) { 13257 if (classname) { 13258 if (elem.classList) elem.classList.add(classname);else elem.className += ' ' + classname; 13259 } 13260 }; 13261 U.removeClass = function (elem, classname) { 13262 if (classname) { 13263 if (elem.classList) elem.classList.remove(classname);else elem.className = elem.className.replace(new RegExp('(^|\\b)' + classname.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); 13264 } 13265 }; 13266 // if options is string -> returns css value 13267 // if options is array -> returns object with css value pairs 13268 // if options is object -> set new css values 13269 U.css = function (elem, options) { 13270 if (_type.String(options)) { 13271 return _getComputedStyle(elem)[_camelCase(options)]; 13272 } else if (_type.Array(options)) { 13273 var obj = {}, 13274 style = _getComputedStyle(elem); 13275 options.forEach(function (option, key) { 13276 obj[option] = style[_camelCase(option)]; 13277 }); 13278 return obj; 13279 } else { 13280 for (var option in options) { 13281 var val = options[option]; 13282 if (val == parseFloat(val)) { 13283 // assume pixel for seemingly numerical values 13284 val += 'px'; 13285 } 13286 elem.style[_camelCase(option)] = val; 13287 } 13288 } 13289 }; 13290 return U; 13291 }(window || {}); 13292 ScrollMagic.Scene.prototype.addIndicators = function () { 13293 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling addIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); 13294 return this; 13295 }; 13296 ScrollMagic.Scene.prototype.removeIndicators = function () { 13297 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js'); 13298 return this; 13299 }; 13300 ScrollMagic.Scene.prototype.setTween = function () { 13301 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); 13302 return this; 13303 }; 13304 ScrollMagic.Scene.prototype.removeTween = function () { 13305 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js'); 13306 return this; 13307 }; 13308 ScrollMagic.Scene.prototype.setVelocity = function () { 13309 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); 13310 return this; 13311 }; 13312 ScrollMagic.Scene.prototype.removeVelocity = function () { 13313 ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js'); 13314 return this; 13315 }; 13316 return ScrollMagic; 13317}); 13318 13319/***/ }), 13320
vendor: 10,000 bytes, lines 13321-13513
13321/***/ "./node_modules/smooth-scroll/dist/smooth-scroll.polyfills.min.js": 13322/*!************************************************************************!*\ 13323 !*** ./node_modules/smooth-scroll/dist/smooth-scroll.polyfills.min.js ***! 13324 \************************************************************************/ 13325/***/ (function(module, exports, __webpack_require__) { 13326 13327var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 13328/*! smooth-scroll v16.1.3 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ 13329window.Element && !Element.prototype.closest && (Element.prototype.closest = function (e) { 13330 var t, 13331 n = (this.document || this.ownerDocument).querySelectorAll(e), 13332 o = this; 13333 do { 13334 for (t = n.length; 0 <= --t && n.item(t) !== o;); 13335 } while (t < 0 && (o = o.parentElement)); 13336 return o; 13337}), function () { 13338 if ("function" == typeof window.CustomEvent) return; 13339 function e(e, t) { 13340 t = t || { 13341 bubbles: !1, 13342 cancelable: !1, 13343 detail: void 0 13344 }; 13345 var n = document.createEvent("CustomEvent"); 13346 return n.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), n; 13347 } 13348 e.prototype = window.Event.prototype, window.CustomEvent = e; 13349}(), function () { 13350 for (var r = 0, e = ["ms", "moz", "webkit", "o"], t = 0; t < e.length && !window.requestAnimationFrame; ++t) window.requestAnimationFrame = window[e[t] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[e[t] + "CancelAnimationFrame"] || window[e[t] + "CancelRequestAnimationFrame"]; 13351 window.requestAnimationFrame || (window.requestAnimationFrame = function (e, t) { 13352 var n = new Date().getTime(), 13353 o = Math.max(0, 16 - (n - r)), 13354 a = window.setTimeout(function () { 13355 e(n + o); 13356 }, o); 13357 return r = n + o, a; 13358 }), window.cancelAnimationFrame || (window.cancelAnimationFrame = function (e) { 13359 clearTimeout(e); 13360 }); 13361}(), function (e, t) { 13362 true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 13363 return t(e); 13364 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 13365 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0; 13366}("undefined" != typeof __webpack_require__.g ? __webpack_require__.g : "undefined" != typeof window ? window : this, function (M) { 13367 "use strict"; 13368 13369 var q = { 13370 ignore: "[data-scroll-ignore]", 13371 header: null, 13372 topOnEmptyHash: !0, 13373 speed: 500, 13374 speedAsDuration: !1, 13375 durationMax: null, 13376 durationMin: null, 13377 clip: !0, 13378 offset: 0, 13379 easing: "easeInOutCubic", 13380 customEasing: null, 13381 updateURL: !0, 13382 popstate: !0, 13383 emitEvents: !0 13384 }, 13385 I = function I() { 13386 var n = {}; 13387 return Array.prototype.forEach.call(arguments, function (e) { 13388 for (var t in e) { 13389 if (!e.hasOwnProperty(t)) return; 13390 n[t] = e[t]; 13391 } 13392 }), n; 13393 }, 13394 r = function r(e) { 13395 "#" === e.charAt(0) && (e = e.substr(1)); 13396 for (var t, n = String(e), o = n.length, a = -1, r = "", i = n.charCodeAt(0); ++a < o;) { 13397 if (0 === (t = n.charCodeAt(a))) throw new InvalidCharacterError("Invalid character: the input contains U+0000."); 13398 1 <= t && t <= 31 || 127 == t || 0 === a && 48 <= t && t <= 57 || 1 === a && 48 <= t && t <= 57 && 45 === i ? r += "\\" + t.toString(16) + " " : r += 128 <= t || 45 === t || 95 === t || 48 <= t && t <= 57 || 65 <= t && t <= 90 || 97 <= t && t <= 122 ? n.charAt(a) : "\\" + n.charAt(a); 13399 } 13400 return "#" + r; 13401 }, 13402 F = function F() { 13403 return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); 13404 }, 13405 L = function L(e) { 13406 return e ? (t = e, parseInt(M.getComputedStyle(t).height, 10) + e.offsetTop) : 0; 13407 var t; 13408 }, 13409 x = function x(e, t, n) { 13410 0 === e && document.body.focus(), n || (e.focus(), document.activeElement !== e && (e.setAttribute("tabindex", "-1"), e.focus(), e.style.outline = "none"), M.scrollTo(0, t)); 13411 }, 13412 H = function H(e, t, n, o) { 13413 if (t.emitEvents && "function" == typeof M.CustomEvent) { 13414 var a = new CustomEvent(e, { 13415 bubbles: !0, 13416 detail: { 13417 anchor: n, 13418 toggle: o 13419 } 13420 }); 13421 document.dispatchEvent(a); 13422 } 13423 }; 13424 return function (o, e) { 13425 var b, 13426 a, 13427 A, 13428 O, 13429 C = {}; 13430 C.cancelScroll = function (e) { 13431 cancelAnimationFrame(O), O = null, e || H("scrollCancel", b); 13432 }, C.animateScroll = function (a, r, e) { 13433 C.cancelScroll(); 13434 var i = I(b || q, e || {}), 13435 c = "[object Number]" === Object.prototype.toString.call(a), 13436 t = c || !a.tagName ? null : a; 13437 if (c || t) { 13438 var s = M.pageYOffset; 13439 i.header && !A && (A = document.querySelector(i.header)); 13440 var n, 13441 o, 13442 u, 13443 l, 13444 m, 13445 d, 13446 f, 13447 h, 13448 p = L(A), 13449 g = c ? a : function (e, t, n, o) { 13450 var a = 0; 13451 if (e.offsetParent) for (; a += e.offsetTop, e = e.offsetParent;); 13452 return a = Math.max(a - t - n, 0), o && (a = Math.min(a, F() - M.innerHeight)), a; 13453 }(t, p, parseInt("function" == typeof i.offset ? i.offset(a, r) : i.offset, 10), i.clip), 13454 y = g - s, 13455 v = F(), 13456 w = 0, 13457 S = (n = y, u = (o = i).speedAsDuration ? o.speed : Math.abs(n / 1e3 * o.speed), o.durationMax && u > o.durationMax ? o.durationMax : o.durationMin && u < o.durationMin ? o.durationMin : parseInt(u, 10)), 13458 E = function E(e) { 13459 var t, n, o; 13460 l || (l = e), w += e - l, d = s + y * (n = m = 1 < (m = 0 === S ? 0 : w / S) ? 1 : m, "easeInQuad" === (t = i).easing && (o = n * n), "easeOutQuad" === t.easing && (o = n * (2 - n)), "easeInOutQuad" === t.easing && (o = n < .5 ? 2 * n * n : (4 - 2 * n) * n - 1), "easeInCubic" === t.easing && (o = n * n * n), "easeOutCubic" === t.easing && (o = --n * n * n + 1), "easeInOutCubic" === t.easing && (o = n < .5 ? 4 * n * n * n : (n - 1) * (2 * n - 2) * (2 * n - 2) + 1), "easeInQuart" === t.easing && (o = n * n * n * n), "easeOutQuart" === t.easing && (o = 1 - --n * n * n * n), "easeInOutQuart" === t.easing && (o = n < .5 ? 8 * n * n * n * n : 1 - 8 * --n * n * n * n), "easeInQuint" === t.easing && (o = n * n * n * n * n), "easeOutQuint" === t.easing && (o = 1 + --n * n * n * n * n), "easeInOutQuint" === t.easing && (o = n < .5 ? 16 * n * n * n * n * n : 1 + 16 * --n * n * n * n * n), t.customEasing && (o = t.customEasing(n)), o || n), M.scrollTo(0, Math.floor(d)), function (e, t) { 13461 var n = M.pageYOffset; 13462 if (e == t || n == t || (s < t && M.innerHeight + n) >= v) return C.cancelScroll(!0), x(a, t, c), H("scrollStop", i, a, r), !(O = l = null); 13463 }(d, g) || (O = M.requestAnimationFrame(E), l = e); 13464 }; 13465 0 === M.pageYOffset && M.scrollTo(0, 0), f = a, h = i, c || history.pushState && h.updateURL && history.pushState({ 13466 smoothScroll: JSON.stringify(h), 13467 anchor: f.id 13468 }, document.title, f === document.documentElement ? "#top" : "#" + f.id), "matchMedia" in M && M.matchMedia("(prefers-reduced-motion)").matches ? x(a, Math.floor(g), !1) : (H("scrollStart", i, a, r), C.cancelScroll(!0), M.requestAnimationFrame(E)); 13469 } 13470 }; 13471 var t = function t(e) { 13472 if (!e.defaultPrevented && !(0 !== e.button || e.metaKey || e.ctrlKey || e.shiftKey) && "closest" in e.target && (a = e.target.closest(o)) && "a" === a.tagName.toLowerCase() && !e.target.closest(b.ignore) && a.hostname === M.location.hostname && a.pathname === M.location.pathname && /#/.test(a.href)) { 13473 var t, n; 13474 try { 13475 t = r(decodeURIComponent(a.hash)); 13476 } catch (e) { 13477 t = r(a.hash); 13478 } 13479 if ("#" === t) { 13480 if (!b.topOnEmptyHash) return; 13481 n = document.documentElement; 13482 } else n = document.querySelector(t); 13483 (n = n || "#top" !== t ? n : document.documentElement) && (e.preventDefault(), function (e) { 13484 if (history.replaceState && e.updateURL && !history.state) { 13485 var t = M.location.hash; 13486 t = t || "", history.replaceState({ 13487 smoothScroll: JSON.stringify(e), 13488 anchor: t || M.pageYOffset 13489 }, document.title, t || M.location.href); 13490 } 13491 }(b), C.animateScroll(n, a)); 13492 } 13493 }, 13494 n = function n(e) { 13495 if (null !== history.state && history.state.smoothScroll && history.state.smoothScroll === JSON.stringify(b)) { 13496 var t = history.state.anchor; 13497 "string" == typeof t && t && !(t = document.querySelector(r(history.state.anchor))) || C.animateScroll(t, null, { 13498 updateURL: !1 13499 }); 13500 } 13501 }; 13502 C.destroy = function () { 13503 b && (document.removeEventListener("click", t, !1), M.removeEventListener("popstate", n, !1), C.cancelScroll(), O = A = a = b = null); 13504 }; 13505 return function () { 13506 if (!("querySelector" in document && "addEventListener" in M && "requestAnimationFrame" in M && "closest" in M.Element.prototype)) throw "Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs."; 13507 C.destroy(), b = I(q, e || {}), A = b.header ? document.querySelector(b.header) : null, document.addEventListener("click", t, !1), b.updateURL && b.popstate && M.addEventListener("popstate", n, !1); 13508 }(), C; 13509 }; 13510}); 13511 13512/***/ }), 13513
13514/***/ "./src/js/modules/particles.js": 13515/*!*************************************!*\ 13516 !*** ./src/js/modules/particles.js ***! 13517 \*************************************/ 13518/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 13519 13520"use strict"; 13521__webpack_require__.r(__webpack_exports__); 13522/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13523/* harmony export */ particles: function() { return /* binding */ particles; } 13524/* harmony export */ }); 13525function particles() { 13526 if (document.querySelector('.js-particles')) { 13527 /* ---- particles.js config ---- */ 13528 13529 if (navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/i)) { 13530 particlesJS('particles', { 13531 particles: { 13532 number: { 13533 value: 100, 13534 density: { 13535 enable: true, 13536 value_area: 600 13537 } 13538 }, 13539 color: { 13540 value: '#E3E7EA' 13541 }, 13542 shape: { 13543 type: 'edge', 13544 stroke: { 13545 width: 0, 13546 color: '#000000' 13547 }, 13548 polygon: { 13549 nb_sides: 5 13550 }, 13551 image: { 13552 src: 'img/github.svg', 13553 width: 100, 13554 height: 100 13555 } 13556 }, 13557 opacity: { 13558 value: 1, 13559 random: false, 13560 anim: { 13561 enable: false, 13562 speed: 1, 13563 opacity_min: 0.1, 13564 sync: false 13565 } 13566 }, 13567 size: { 13568 value: 1.5, 13569 random: true, 13570 anim: { 13571 enable: false, 13572 speed: 40, 13573 size_min: 0.1, 13574 sync: false 13575 } 13576 }, 13577 line_linked: { 13578 enable: true, 13579 distance: 75, 13580 color: '#E3E7EA', 13581 opacity: 0.4, 13582 width: 1 13583 }, 13584 move: { 13585 enable: true, 13586 speed: 2, 13587 direction: 'none', 13588 random: false, 13589 straight: false, 13590 out_mode: 'out', 13591 bounce: false, 13592 attract: { 13593 enable: false, 13594 rotateX: 300, 13595 rotateY: 600 13596 } 13597 } 13598 }, 13599 interactivity: { 13600 detect_on: 'canvas', 13601 events: { 13602 onhover: { 13603 enable: false, 13604 mode: 'repulse' 13605 }, 13606 onclick: { 13607 enable: true, 13608 mode: 'push' 13609 }, 13610 resize: true 13611 }, 13612 modes: { 13613 grab: { 13614 distance: 400, 13615 line_linked: { 13616 opacity: 1 13617 } 13618 }, 13619 bubble: { 13620 distance: 400, 13621 size: 40, 13622 duration: 2, 13623 opacity: 8, 13624 speed: 3 13625 }, 13626 repulse: { 13627 distance: 200, 13628 duration: 0.4 13629 }, 13630 push: { 13631 particles_nb: 4 13632 }, 13633 remove: { 13634 particles_nb: 2 13635 } 13636 } 13637 }, 13638 retina_detect: true 13639 }); 13640 } else { 13641 particlesJS('particles', { 13642 particles: { 13643 number: { 13644 value: 200, 13645 density: { 13646 enable: true, 13647 value_area: 1100 13648 } 13649 }, 13650 color: { 13651 value: '#E3E7EA' 13652 }, 13653 shape: { 13654 type: 'edge', 13655 stroke: { 13656 width: 0, 13657 color: '#000000' 13658 }, 13659 polygon: { 13660 nb_sides: 5 13661 }, 13662 image: { 13663 src: 'img/github.svg', 13664 width: 100, 13665 height: 100 13666 } 13667 }, 13668 opacity: { 13669 value: 1, 13670 random: false, 13671 anim: { 13672 enable: false, 13673 speed: 1, 13674 opacity_min: 0.1, 13675 sync: false 13676 } 13677 }, 13678 size: { 13679 value: 3, 13680 random: true, 13681 anim: { 13682 enable: false, 13683 speed: 40, 13684 size_min: 0.1, 13685 sync: false 13686 } 13687 }, 13688 line_linked: { 13689 enable: true, 13690 distance: 150, 13691 color: '#E3E7EA', 13692 opacity: 0.4, 13693 width: 1 13694 }, 13695 move: { 13696 enable: true, 13697 speed: 2, 13698 direction: 'none', 13699 random: false, 13700 straight: false, 13701 out_mode: 'out', 13702 bounce: false, 13703 attract: { 13704 enable: false, 13705 rotateX: 600, 13706 rotateY: 1200 13707 } 13708 } 13709 }, 13710 interactivity: { 13711 detect_on: 'canvas', 13712 events: { 13713 onhover: { 13714 enable: false, 13715 mode: 'repulse' 13716 }, 13717 onclick: { 13718 enable: true, 13719 mode: 'push' 13720 }, 13721 resize: true 13722 }, 13723 modes: { 13724 grab: { 13725 distance: 400, 13726 line_linked: { 13727 opacity: 1 13728 } 13729 }, 13730 bubble: { 13731 distance: 400, 13732 size: 40, 13733 duration: 2, 13734 opacity: 8, 13735 speed: 3 13736 }, 13737 repulse: { 13738 distance: 200, 13739 duration: 0.4 13740 }, 13741 push: { 13742 particles_nb: 4 13743 }, 13744 remove: { 13745 particles_nb: 2 13746 } 13747 } 13748 }, 13749 retina_detect: true 13750 }); 13751 } 13752 } 13753} 13754 13755/***/ }), 13756
13757/***/ "./src/js/modules/scrollMenu.js": 13758/*!**************************************!*\ 13759 !*** ./src/js/modules/scrollMenu.js ***! 13760 \**************************************/ 13761/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 13762 13763"use strict"; 13764__webpack_require__.r(__webpack_exports__); 13765/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13766/* harmony export */ stickyMagic: function() { return /* binding */ stickyMagic; }, 13767/* harmony export */ stickyMenu: function() { return /* binding */ stickyMenu; } 13768/* harmony export */ }); 13769/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 13770/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 13771/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scrollmagic */ "./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js"); 13772/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scrollmagic__WEBPACK_IMPORTED_MODULE_1__); 13773 13774 13775function stickyMagic() { 13776 var controller = new (scrollmagic__WEBPACK_IMPORTED_MODULE_1___default().Controller)(); 13777 var fadeIn = document.querySelectorAll('.js-scrollSticky'); 13778 for (var i = 0; i < fadeIn.length; i++) { 13779 var tag = fadeIn[i]; 13780 new (scrollmagic__WEBPACK_IMPORTED_MODULE_1___default().Scene)({ 13781 triggerElement: tag, 13782 triggerHook: 'onEnter', 13783 offset: 0 13784 }).setClassToggle(tag, 'is-animated').addTo(controller); 13785 } 13786} 13787function stickyMenu() { 13788 window.addEventListener('resize', _.throttle(function (e) { 13789 stickyAddClass(); 13790 return false; 13791 }, 100, { 13792 trailing: true, 13793 leading: true 13794 })); 13795 window.addEventListener('DOMContentLoaded', function () { 13796 stickyAddClass(); 13797 }); 13798 function stickyAddClass() { 13799 if (document.querySelector('.js-anchorHeading')) { 13800 var anchorHeadingEle = document.querySelector('.js-anchorHeading'); 13801 var observer = new window.IntersectionObserver(function (entry) { 13802 if (!entry[0].isIntersecting) { 13803 document.querySelector('.js-anchorMenu').classList.add('is-sticky'); 13804 } else { 13805 document.querySelector('.js-anchorMenu').classList.remove('is-sticky'); 13806 } 13807 }); 13808 observer.observe(anchorHeadingEle); 13809 } 13810 } 13811} 13812 13813/***/ }), 13814
13815/***/ "./src/js/modules/scrollmagic.js": 13816/*!***************************************!*\ 13817 !*** ./src/js/modules/scrollmagic.js ***! 13818 \***************************************/ 13819/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 13820 13821"use strict"; 13822__webpack_require__.r(__webpack_exports__); 13823/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13824/* harmony export */ scrollmagic: function() { return /* binding */ scrollmagic; } 13825/* harmony export */ }); 13826/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scrollmagic */ "./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js"); 13827/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scrollmagic__WEBPACK_IMPORTED_MODULE_0__); 13828 13829function scrollmagic() { 13830 var controller = new (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Controller)(); 13831 var fadeIn = document.querySelectorAll('.js-scrollAnimation'); 13832 for (var i = 0; i < fadeIn.length; i++) { 13833 var tag = fadeIn[i]; 13834 new (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Scene)({ 13835 triggerElement: tag, 13836 triggerHook: 'onEnter', 13837 offset: 20 13838 }).setClassToggle(tag, 'is-animated').addTo(controller); 13839 } 13840} 13841 13842/***/ }), 13843
13844/***/ "./src/js/modules/smooth.js": 13845/*!**********************************!*\ 13846 !*** ./src/js/modules/smooth.js ***! 13847 \**********************************/ 13848/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 13849 13850"use strict"; 13851__webpack_require__.r(__webpack_exports__); 13852/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13853/* harmony export */ smooth: function() { return /* binding */ smooth; } 13854/* harmony export */ }); 13855/* harmony import */ var smooth_scroll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! smooth-scroll */ "./node_modules/smooth-scroll/dist/smooth-scroll.polyfills.min.js"); 13856/* harmony import */ var smooth_scroll__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(smooth_scroll__WEBPACK_IMPORTED_MODULE_0__); 13857 13858function smooth() { 13859 var windowWidth = window.innerWidth; 13860 var fixedMenuHeight; 13861 if (windowWidth < 769) { 13862 if (document.querySelector('.p-caseAnchor_cont')) { 13863 var fixedMenu = document.querySelector('.p-caseAnchor_cont'); 13864 fixedMenuHeight = fixedMenu.clientHeight; 13865 } else { 13866 fixedMenuHeight = '0'; 13867 } 13868 } else { 13869 fixedMenuHeight = '55'; 13870 } 13871 var scroll = new (smooth_scroll__WEBPACK_IMPORTED_MODULE_0___default())('a[href*="#"]', { 13872 header: '#header', 13873 speed: 300, 13874 speedAsDuration: true, 13875 updateURL: false, 13876 offset: fixedMenuHeight 13877 }); 13878} 13879 13880/***/ }), 13881
13882/***/ "./src/js/modules/windowAction.js": 13883/*!****************************************!*\ 13884 !*** ./src/js/modules/windowAction.js ***! 13885 \****************************************/ 13886/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 13887 13888"use strict"; 13889__webpack_require__.r(__webpack_exports__); 13890/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13891/* harmony export */ windowAction: function() { return /* binding */ windowAction; } 13892/* harmony export */ }); 13893/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 13894/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); 13895 13896function windowAction() { 13897 window.addEventListener('scroll', _.throttle(function (e) { 13898 canvasOpacityChange(); 13899 return false; 13900 }, 100, { 13901 trailing: true, 13902 leading: true 13903 })); 13904 function canvasOpacityChange() { 13905 if (document.querySelector('.js-particles')) { 13906 var particlesEle = document.querySelector('.js-particles'); 13907 var menuEle = document.querySelector('.js-menu'); 13908 var IS_ANIMATED = 'is-animated'; 13909 var IS_ACTIVE = 'is-active'; 13910 if (menuEle.classList.contains(IS_ANIMATED)) { 13911 particlesEle.classList.add(IS_ACTIVE); 13912 } else { 13913 particlesEle.classList.remove(IS_ACTIVE); 13914 } 13915 } 13916 } 13917} 13918 13919/***/ })
13919 13920 13921/******/ }); 13922/************************************************************************/ 13923/******/ // The module cache 13924/******/ var __webpack_module_cache__ = {}; 13925/******/ 13926/******/ // The require function 13927/******/ function __webpack_require__(moduleId) { 13928/******/ // Check if module is in cache 13929/******/ var cachedModule = __webpack_module_cache__[moduleId]; 13930/******/ if (cachedModule !== undefined) { 13931/******/ return cachedModule.exports; 13932/******/ } 13933/******/ // Create a new module (and put it into the cache) 13934/******/ var module = __webpack_module_cache__[moduleId] = { 13935/******/ id: moduleId, 13936/******/ loaded: false, 13937/******/ exports: {} 13938/******/ }; 13939/******/ 13940/******/ // Execute the module function 13941/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 13942/******/ 13943/******/ // Flag the module as loaded 13944/******/ module.loaded = true; 13945/******/ 13946/******/ // Return the exports of the module 13947/******/ return module.exports; 13948/******/ } 13949/******/ 13950/************************************************************************/ 13951/******/ /* webpack/runtime/amd options */ 13952/******/ !function() { 13953/******/ __webpack_require__.amdO = {}; 13954/******/ }(); 13955/******/ 13956/******/ /* webpack/runtime/compat get default export */ 13957/******/ !function() { 13958/******/ // getDefaultExport function for compatibility with non-harmony modules 13959/******/ __webpack_require__.n = function(module) { 13960/******/ var getter = module && module.__esModule ? 13961/******/ function() { return module['default']; } : 13962/******/ function() { return module; }; 13963/******/ __webpack_require__.d(getter, { a: getter }); 13964/******/ return getter; 13965/******/ }; 13966/******/ }(); 13967/******/ 13968/******/ /* webpack/runtime/define property getters */ 13969/******/ !function() { 13970/******/ // define getter functions for harmony exports 13971/******/ __webpack_require__.d = function(exports, definition) { 13972/******/ for(var key in definition) { 13973/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 13974/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 13975/******/ } 13976/******/ } 13977/******/ }; 13978/******/ }(); 13979/******/ 13980/******/ /* webpack/runtime/global */ 13981/******/ !function() { 13982/******/ __webpack_require__.g = (function() { 13983/******/ if (typeof globalThis === 'object') return globalThis; 13984/******/ try { 13985/******/ return this || new Function('return this')(); 13986/******/ } catch (e) { 13987/******/ if (typeof window === 'object') return window; 13988/******/ } 13989/******/ })(); 13990/******/ }(); 13991/******/ 13992/******/ /* webpack/runtime/hasOwnProperty shorthand */ 13993/******/ !function() { 13994/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 13995/******/ }(); 13996/******/ 13997/******/ /* webpack/runtime/make namespace object */ 13998/******/ !function() { 13999/******/ // define __esModule on exports 14000/******/ __webpack_require__.r = function(exports) { 14001/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 14002/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 14003/******/ } 14004/******/ Object.defineProperty(exports, '__esModule', { value: true }); 14005/******/ }; 14006/******/ }(); 14007/******/ 14008/******/ /* webpack/runtime/node module decorator */ 14009/******/ !function() { 14010/******/ __webpack_require__.nmd = function(module) { 14011/******/ module.paths = []; 14012/******/ if (!module.children) module.children = []; 14013/******/ return module; 14014/******/ }; 14015/******/ }(); 14016/******/ 14017/************************************************************************/ 14018var __webpack_exports__ = {}; 14019// This entry need to be wrapped in an IIFE because it need to be in strict mode. 14020!function() { 14021"use strict"; 14022/*!**********************!*\ 14023 !*** ./src/js/lp.js ***! 14024 \**********************/ 14025__webpack_require__.r(__webpack_exports__); 14026/* harmony import */ var rellax__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rellax */ "./node_modules/rellax/rellax.js"); 14027/* harmony import */ var rellax__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rellax__WEBPACK_IMPORTED_MODULE_0__); 14028/* harmony import */ var aos__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! aos */ "./node_modules/aos/dist/aos.js"); 14029/* harmony import */ var aos__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aos__WEBPACK_IMPORTED_MODULE_1__); 14030/* harmony import */ var _modules_particles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/particles */ "./src/js/modules/particles.js"); 14031/* harmony import */ var _modules_scrollmagic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/scrollmagic */ "./src/js/modules/scrollmagic.js"); 14032/* harmony import */ var _modules_windowAction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/windowAction */ "./src/js/modules/windowAction.js"); 14033/* harmony import */ var _modules_scrollMenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/scrollMenu */ "./src/js/modules/scrollMenu.js"); 14034/* harmony import */ var _modules_smooth__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/smooth */ "./src/js/modules/smooth.js"); 14035 14036 14037 14038 14039 14040 14041 14042window.addEventListener('load', function () { 14043 (0,_modules_particles__WEBPACK_IMPORTED_MODULE_2__.particles)(); 14044}); 14045aos__WEBPACK_IMPORTED_MODULE_1___default().init({ 14046 duration: 1000 14047}); 14048(0,_modules_scrollMenu__WEBPACK_IMPORTED_MODULE_5__.stickyMenu)(); 14049(0,_modules_scrollMenu__WEBPACK_IMPORTED_MODULE_5__.stickyMagic)(); 14050(0,_modules_scrollmagic__WEBPACK_IMPORTED_MODULE_3__.scrollmagic)(); 14051(0,_modules_windowAction__WEBPACK_IMPORTED_MODULE_4__.windowAction)(); 14052(0,_modules_smooth__WEBPACK_IMPORTED_MODULE_6__.smooth)(); 14053if (navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/i)) { 14054 var rellax = new (rellax__WEBPACK_IMPORTED_MODULE_0___default())('.js-rellax', { 14055 speed: 0.5, 14056 center: false, 14057 wrapper: null, 14058 round: true, 14059 vertical: true, 14060 horizontal: false 14061 }); 14062} else { 14063 var _rellax = new (rellax__WEBPACK_IMPORTED_MODULE_0___default())('.js-rellax', { 14064 speed: -2, 14065 center: false, 14066 wrapper: null, 14067 round: true, 14068 vertical: true, 14069 horizontal: false 14070 }); 14071} 14072}(); 14073/******/ })() 14074; 14075//# sourceMappingURL=lp.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.