// Version 1.4.1 index-array-by - https://github.com/vasturiano/index-array-by !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).indexBy=r()}(this,(function(){"use strict";function t(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,a=[],l=!0,f=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=i.call(e)).done)&&(a.push(n.value),a.length!==r);l=!0);}catch(t){f=!0,o=t}finally{try{if(!l&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(f)throw o}}return a}}(t,r)||n(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,r){if(t){if("string"==typeof t)return o(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,r):void 0}}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=(o instanceof Array?o.length?o:[void 0]:[o]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=n.reduce((function(r,e){var n=r,o=e;return l.forEach((function(r,e){var a,f=r.keyAccessor;if(r.isProp){var c=o,s=c[f],y=t(c,[f].map(i));a=s,o=y}else a=f(o,e);e+11&&void 0!==arguments[1]?arguments[1]:1;e===l.length?Object.keys(r).forEach((function(t){return r[t]=u(r[t])})):Object.values(r).forEach((function(r){return t(r,e+1)}))}(f);var c=f;return a&&(c=[],function t(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];o.length===l.length?c.push({keys:o,vals:n}):Object.entries(n).forEach((function(n){var i=r(n,2),u=i[0],a=i[1];return t(a,[].concat(e(o),[u]))}))}(f),o instanceof Array&&0===o.length&&1===c.length&&(c[0].keys=[])),c}}));