g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","// note prettier is ignored here via .prettierignore\nimport { TidyFn, TidyGroupExportFn } from './types';\n\n// pipe types not well supported: https://github.com/microsoft/TypeScript/issues/29904\n// so manually make types overloaded for up to 10 steps\n\n/**\n * Forms a tidy pipeline that can be called with (items)\n * @param items array of items to manipulate\n * @param fns Tidy functions\n */\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyFn, f9: TidyFn, f10: TidyFn): T10[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyFn, f9: TidyFn, f10: TidyGroupExportFn): T10;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyFn, f9: TidyFn): T9[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyFn, f9: TidyGroupExportFn): T9;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyFn): T8[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn, f8: TidyGroupExportFn): T8;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyFn): T7[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn, f7: TidyGroupExportFn): T7;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyFn): T6[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn, f6: TidyGroupExportFn): T6;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyFn ): T5[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn, f5: TidyGroupExportFn ): T5;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyFn): T4[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn, f4: TidyGroupExportFn): T4;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyFn): T3[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn, f3: TidyGroupExportFn): T3;\nexport function tidy(items: T[], f1: TidyFn, f2: TidyFn): T2[];\nexport function tidy(items: T[], f1: TidyFn, f2: TidyGroupExportFn): T2;\nexport function tidy(items: T[], f1: TidyFn): T1[];\nexport function tidy(items: T[], f1: TidyGroupExportFn): T1;\nexport function tidy(\n items: InputT[],\n ...fns: (TidyFn | TidyGroupExportFn)[]\n): any {\n if (typeof items === 'function') {\n throw new Error('You must supply the data as the first argument to tidy()');\n }\n\n let result: any = items;\n for (const fn of fns) {\n if (fn) {\n // skip falsy values\n result = fn(result);\n }\n }\n\n return result;\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(value);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","export default function(x) {\n return x;\n}\n","import {InternMap} from \"internmap\";\nimport identity from \"./identity.js\";\n\nexport default function group(values, ...keys) {\n return nest(values, identity, identity, keys);\n}\n\nexport function groups(values, ...keys) {\n return nest(values, Array.from, identity, keys);\n}\n\nexport function rollup(values, reduce, ...keys) {\n return nest(values, identity, reduce, keys);\n}\n\nexport function rollups(values, reduce, ...keys) {\n return nest(values, Array.from, reduce, keys);\n}\n\nexport function index(values, ...keys) {\n return nest(values, identity, unique, keys);\n}\n\nexport function indexes(values, ...keys) {\n return nest(values, Array.from, unique, keys);\n}\n\nfunction unique(values) {\n if (values.length !== 1) throw new Error(\"duplicate key\");\n return values[0];\n}\n\nfunction nest(values, map, reduce, keys) {\n return (function regroup(values, i) {\n if (i >= keys.length) return reduce(values);\n const groups = new InternMap();\n const keyof = keys[i++];\n let index = -1;\n for (const value of values) {\n const key = keyof(value, ++index, values);\n const group = groups.get(key);\n if (group) group.push(value);\n else groups.set(key, [value]);\n }\n for (const [key, values] of groups) {\n groups.set(key, regroup(values, i));\n }\n return map(groups);\n })(values, 0);\n}\n","import { GroupKey } from '../types';\n\n/**\n * Given an object and a set of group keys [[keyName, keyValue], ...]\n * set the keys as properties within the object: { [keyName]: keyValue, ... }\n * (creates a new object with these properties added)\n */\nexport function assignGroupKeys(d: T, keys: GroupKey[]) {\n // abort if atypical input\n if (d == null || typeof d !== 'object' || Array.isArray(d)) return d;\n\n // transform to { groupKey1: value, ... } excluding function group keys\n const keysObj = Object.fromEntries(\n keys.filter((key) => typeof key[0] !== 'function' && key[0] != null)\n );\n\n return Object.assign(keysObj, d);\n}\n","import { Grouped, Datum } from '../types';\n\n/**\n * Traverse the leaves of the grouped items and and run the\n * groupFn on them. Basically an in-order traversal. Can you\n * believe this is real and not part of a coding interview??\n */\nexport function groupTraversal<\n T extends object,\n T2 extends Datum = T,\n OutputType = Grouped\n>(\n grouped: Grouped,\n outputGrouped: OutputType,\n keys: any[],\n addSubgroup: (root: OutputType, keys: any[], level: number) => OutputType,\n addLeaves: (root: OutputType, keys: any[], items: T[], level: number) => void,\n level: number = 0\n) {\n for (const [key, value] of grouped.entries()) {\n const keysHere = [...keys, key];\n\n // internal node\n if (value instanceof Map) {\n const subgroup = addSubgroup(outputGrouped, keysHere, level);\n\n // recurse\n groupTraversal(\n value,\n subgroup,\n keysHere,\n addSubgroup,\n addLeaves,\n level + 1\n );\n } else {\n // leaf\n addLeaves(outputGrouped, keysHere, value, level);\n }\n }\n\n return outputGrouped;\n}\n","import { Grouped } from '../types';\nimport { groupTraversal } from './groupTraversal';\n\nexport function groupMap(\n grouped: Grouped,\n groupFn: (items: T[], keys: any[]) => OutputT[],\n keyFn: (keys: any[]) => any = (keys) =>\n keys[\n keys.length - 1\n ] /* optional func to transform key based on all keys in map so far */\n): Grouped {\n function addSubgroup(parentGrouped: Grouped, keys: any[]) {\n const subgroup = new Map();\n parentGrouped.set(keyFn(keys), subgroup);\n return subgroup;\n }\n\n function addLeaves(\n parentGrouped: Grouped,\n keys: any[],\n values: T[]\n ) {\n parentGrouped.set(keyFn(keys), groupFn(values, keys));\n }\n\n const outputGrouped: Grouped = new Map();\n\n groupTraversal(grouped, outputGrouped, [], addSubgroup, addLeaves);\n\n return outputGrouped;\n}\n","export const identity = (d: T): T => d;\n","import { group } from 'd3-array';\nimport { A, O } from 'ts-toolbelt';\nimport { assignGroupKeys } from './helpers/assignGroupKeys';\nimport { groupMap } from './helpers/groupMap';\nimport { groupTraversal } from './helpers/groupTraversal';\nimport { identity } from './helpers/identity';\nimport { isObject } from './helpers/isObject';\nimport { SingleOrArray, singleOrArray } from './helpers/singleOrArray';\nimport { Grouped, GroupKey, TidyGroupExportFn, Key, TidyFn } from './types';\n\n/** [key, values] where values could be more nested entries */\ntype EntriesOutput = [any, any][];\ntype EntriesObjectOutput = { key: Key; values: any }[];\n\n/** nested objects: { [key]: values } */\ntype ObjectOutput = Record;\n\n/** nested keys: e.g. [key, key, key, [key, key, [key]]] */\ntype KeysOutput = any[];\n\n/** nested values: e.g. [[value1_1, value1_2], [value2_1, value2_2]] */\ntype ValuesOutput = any[];\n\nexport type LevelSpec = {\n id?: string;\n createEmptySubgroup: () => any;\n addSubgroup: (\n parentGrouped: any,\n newSubgroup: any,\n key: any,\n level: number\n ) => void;\n addLeaf: (parentGrouped: any, key: any, values: any[], level: number) => void;\n};\n\n/**\n * Options to affect export type\n */\ninterface GroupByOptions {\n /** whether to merge group keys back into the objects */\n readonly addGroupKeys?: boolean;\n\n // -- export related -- //\n /** export method */\n readonly export?:\n | 'grouped'\n | 'entries'\n | 'entries-object'\n | 'object'\n | 'map'\n | 'keys'\n | 'values'\n | 'levels'\n | 'ungrouped';\n /** if all nested levels should be brought to a single top level */\n readonly flat?: boolean;\n /** when flat is true, how to flatten nested keys */\n readonly compositeKey?: (keys: any[]) => string;\n /** whether the leaf sets consist of just one item (typical after summarize).\n * if true, uses the first element in the leaf set instead of an array\n */\n readonly single?: boolean;\n /** operation called on each leaf during export to map it to a different value\n * (default: identity)\n */\n readonly mapLeaf?: (value: any) => any;\n /** operation called on each leaf set to map the array of values to a different value.\n * Similar to `rollup` from d3-collection nest or d3-array\n * (default: identity)\n */\n readonly mapLeaves?: (values: any[]) => any;\n /** [entries only] operation called on entries to map from [key, values] to\n * whatever the output of this is (e.g. `{ key, values }`)\n * (default: identity)\n */\n readonly mapEntry?: (entry: [any, any], level: number) => any;\n\n /** [required for levels] specifies the export operation for each level of the grouping */\n readonly levels?: (\n | 'entries'\n | 'entries-object'\n | 'object'\n | 'map'\n | 'keys'\n | 'values'\n | LevelSpec\n )[];\n}\n\n// aliases to make overloads shorter\ntype GK = SingleOrArray any)>;\ntype F = TidyFn;\n\n// merge back in group keys to output types\ntype MergeGroupKeys<\n T extends object,\n Out extends object,\n Keys extends GK\n> = Keys extends keyof T\n ? O.Merge, Out>\n : Keys extends (keyof T)[]\n ? O.Merge, Out>\n : Out;\n\n// do not merge in group keys if explicitly said not to\ntype WithGroupKeys<\n T extends object,\n Out extends object,\n Keys extends GK,\n Opts extends GroupByOptions\n> = NonNullable['addGroupKeys'] extends false\n ? Out\n : MergeGroupKeys;\n\n/**\n * output varies based on export options\n */\ntype GroupByOutput<\n T extends object,\n O extends object,\n Keys extends GK,\n Opts extends GroupByOptions\n> = A.Compute<\n NonNullable['export'] extends 'grouped'\n ? Grouped>\n : NonNullable['export'] extends 'entries'\n ? EntriesOutput\n : NonNullable['export'] extends 'entries-object'\n ? EntriesObjectOutput\n : NonNullable['export'] extends 'object'\n ? ObjectOutput\n : NonNullable['export'] extends 'map'\n ? Map\n : NonNullable['export'] extends 'keys'\n ? KeysOutput\n : NonNullable['export'] extends 'values'\n ? ValuesOutput\n : NonNullable['export'] extends 'levels'\n ? any\n : WithGroupKeys[]\n>;\n\ntype GroupByFn<\n T extends object,\n O extends object,\n Keys extends GK,\n Opts extends GroupByOptions\n> = Opts['export'] extends\n | 'grouped'\n | 'entries'\n | 'entries-object'\n | 'object'\n | 'map'\n | 'keys'\n | 'values'\n | 'levels'\n ? TidyGroupExportFn>\n : // default is no export, ungrouped and back in simple form\n TidyFn>;\n\n/**\n * Nests the data by the specified groupings\n */\n// prettier-ignore\nexport function groupBy, Opts extends GroupByOptions>(groupKeys: Keys, fns: F, options: Opts): GroupByFn;\n// prettier-ignore\nexport function groupBy>(groupKeys: Keys, fns: F): GroupByFn;\n// prettier-ignore\nexport function groupBy, Opts extends GroupByOptions>(groupKeys: Keys, fns: [F, F, F, F, F, F, F], options: Opts): GroupByFn;\n// prettier-ignore\nexport function groupBy>(groupKeys: Keys, fns: [F, F, F, F, F, F, F]): GroupByFn;\n// prettier-ignore\nexport function groupBy, Opts extends GroupByOptions>(groupKeys: Keys, fns: [F, F, F, F, F, F], options: Opts): GroupByFn;\n// prettier-ignore\nexport function groupBy>(groupKeys: Keys, fns: [F, F, F, F, F, F]): GroupByFn;\n// prettier-ignore\nexport function groupBy, Opts extends GroupByOptions>(groupKeys: Keys, fns: [F, F, F, F, F], options: Opts): GroupByFn;\n// prettier-ignore\nexport function groupBy>(groupKeys: Keys, fns: [F, F, F, F, F]): GroupByFn;\n// prettier-ignore\nexport function groupBy, Opts extends GroupByOptions>(groupKeys: Keys, fns: [F, F, F, F], options: Opts): GroupByFn;\n// prettier-ignore\nexport function groupBy>(groupKeys: Keys, fns: [F