Add settings page for managing forecasting API key and URL via UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-20 14:37:36 +00:00
parent cae411eae7
commit 1c411e402e
19809 changed files with 1962608 additions and 97 deletions

View file

@ -0,0 +1,27 @@
//#region src/set/countBy.d.ts
/**
* Counts the occurrences of items in a Set based on a transformation function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a Map with the generated keys and their counts as values.
* The count is incremented for each element for which the transformation produces the same key.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys produced by the transformation function.
* @param set - The Set to count occurrences from.
* @param mapper - The function to produce a key for counting.
* @returns A Map containing the mapped keys and their counts.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = countBy(set, (value) => value % 2 === 0 ? 'even' : 'odd');
* // result will be Map(2) { 'odd' => 3, 'even' => 2 }
*
* @example
* const set = new Set(['apple', 'banana', 'cherry']);
* const result = countBy(set, (value) => value.length);
* // result will be Map(2) { 5 => 1, 6 => 2 }
*/
declare function countBy<T, K>(set: Set<T>, mapper: (value: T, value2: T, set: Set<T>) => K): Map<K, number>;
//#endregion
export { countBy };

27
frontend/node_modules/es-toolkit/dist/set/countBy.d.ts generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/countBy.d.ts
/**
* Counts the occurrences of items in a Set based on a transformation function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a Map with the generated keys and their counts as values.
* The count is incremented for each element for which the transformation produces the same key.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys produced by the transformation function.
* @param set - The Set to count occurrences from.
* @param mapper - The function to produce a key for counting.
* @returns A Map containing the mapped keys and their counts.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = countBy(set, (value) => value % 2 === 0 ? 'even' : 'odd');
* // result will be Map(2) { 'odd' => 3, 'even' => 2 }
*
* @example
* const set = new Set(['apple', 'banana', 'cherry']);
* const result = countBy(set, (value) => value.length);
* // result will be Map(2) { 5 => 1, 6 => 2 }
*/
declare function countBy<T, K>(set: Set<T>, mapper: (value: T, value2: T, set: Set<T>) => K): Map<K, number>;
//#endregion
export { countBy };

34
frontend/node_modules/es-toolkit/dist/set/countBy.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
//#region src/set/countBy.ts
/**
* Counts the occurrences of items in a Set based on a transformation function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a Map with the generated keys and their counts as values.
* The count is incremented for each element for which the transformation produces the same key.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys produced by the transformation function.
* @param set - The Set to count occurrences from.
* @param mapper - The function to produce a key for counting.
* @returns A Map containing the mapped keys and their counts.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = countBy(set, (value) => value % 2 === 0 ? 'even' : 'odd');
* // result will be Map(2) { 'odd' => 3, 'even' => 2 }
*
* @example
* const set = new Set(['apple', 'banana', 'cherry']);
* const result = countBy(set, (value) => value.length);
* // result will be Map(2) { 5 => 1, 6 => 2 }
*/
function countBy(set, mapper) {
const result = /* @__PURE__ */ new Map();
for (const value of set) {
const mappedKey = mapper(value, value, set);
result.set(mappedKey, (result.get(mappedKey) ?? 0) + 1);
}
return result;
}
//#endregion
exports.countBy = countBy;

34
frontend/node_modules/es-toolkit/dist/set/countBy.mjs generated vendored Normal file
View file

@ -0,0 +1,34 @@
//#region src/set/countBy.ts
/**
* Counts the occurrences of items in a Set based on a transformation function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a Map with the generated keys and their counts as values.
* The count is incremented for each element for which the transformation produces the same key.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys produced by the transformation function.
* @param set - The Set to count occurrences from.
* @param mapper - The function to produce a key for counting.
* @returns A Map containing the mapped keys and their counts.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = countBy(set, (value) => value % 2 === 0 ? 'even' : 'odd');
* // result will be Map(2) { 'odd' => 3, 'even' => 2 }
*
* @example
* const set = new Set(['apple', 'banana', 'cherry']);
* const result = countBy(set, (value) => value.length);
* // result will be Map(2) { 5 => 1, 6 => 2 }
*/
function countBy(set, mapper) {
const result = /* @__PURE__ */ new Map();
for (const value of set) {
const mappedKey = mapper(value, value, set);
result.set(mappedKey, (result.get(mappedKey) ?? 0) + 1);
}
return result;
}
//#endregion
export { countBy };

24
frontend/node_modules/es-toolkit/dist/set/every.d.mts generated vendored Normal file
View file

@ -0,0 +1,24 @@
//#region src/set/every.d.ts
/**
* Tests whether all elements in a Set satisfy the provided predicate function.
*
* This function iterates through all elements of the Set and checks if the predicate function
* returns true for every element. It returns true if the predicate is satisfied for all elements,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if all elements satisfy the predicate, false otherwise.
*
* @example
* const set = new Set([10, 20, 30]);
* const result = every(set, (value) => value > 5);
* // result will be: true
*
* const result2 = every(set, (value) => value > 15);
* // result2 will be: false
*/
declare function every<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): boolean;
//#endregion
export { every };

24
frontend/node_modules/es-toolkit/dist/set/every.d.ts generated vendored Normal file
View file

@ -0,0 +1,24 @@
//#region src/set/every.d.ts
/**
* Tests whether all elements in a Set satisfy the provided predicate function.
*
* This function iterates through all elements of the Set and checks if the predicate function
* returns true for every element. It returns true if the predicate is satisfied for all elements,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if all elements satisfy the predicate, false otherwise.
*
* @example
* const set = new Set([10, 20, 30]);
* const result = every(set, (value) => value > 5);
* // result will be: true
*
* const result2 = every(set, (value) => value > 15);
* // result2 will be: false
*/
declare function every<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): boolean;
//#endregion
export { every };

27
frontend/node_modules/es-toolkit/dist/set/every.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/every.ts
/**
* Tests whether all elements in a Set satisfy the provided predicate function.
*
* This function iterates through all elements of the Set and checks if the predicate function
* returns true for every element. It returns true if the predicate is satisfied for all elements,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if all elements satisfy the predicate, false otherwise.
*
* @example
* const set = new Set([10, 20, 30]);
* const result = every(set, (value) => value > 5);
* // result will be: true
*
* const result2 = every(set, (value) => value > 15);
* // result2 will be: false
*/
function every(set, doesMatch) {
for (const value of set) if (!doesMatch(value, value, set)) return false;
return true;
}
//#endregion
exports.every = every;

27
frontend/node_modules/es-toolkit/dist/set/every.mjs generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/every.ts
/**
* Tests whether all elements in a Set satisfy the provided predicate function.
*
* This function iterates through all elements of the Set and checks if the predicate function
* returns true for every element. It returns true if the predicate is satisfied for all elements,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if all elements satisfy the predicate, false otherwise.
*
* @example
* const set = new Set([10, 20, 30]);
* const result = every(set, (value) => value > 5);
* // result will be: true
*
* const result2 = every(set, (value) => value > 15);
* // result2 will be: false
*/
function every(set, doesMatch) {
for (const value of set) if (!doesMatch(value, value, set)) return false;
return true;
}
//#endregion
export { every };

21
frontend/node_modules/es-toolkit/dist/set/filter.d.mts generated vendored Normal file
View file

@ -0,0 +1,21 @@
//#region src/set/filter.d.ts
/**
* Filters a Set based on a predicate function.
*
* This function takes a Set and a predicate function, and returns a new Set containing
* only the elements for which the predicate function returns true.
*
* @template T - The type of elements in the Set.
* @param set - The Set to filter.
* @param callback - A predicate function that tests each element.
* @returns A new Set containing only the elements that satisfy the predicate.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = filter(set, (value) => value > 2);
* // result will be:
* // Set(3) { 3, 4, 5 }
*/
declare function filter<T>(set: Set<T>, callback: (value: T, value2: T, set: Set<T>) => boolean): Set<T>;
//#endregion
export { filter };

21
frontend/node_modules/es-toolkit/dist/set/filter.d.ts generated vendored Normal file
View file

@ -0,0 +1,21 @@
//#region src/set/filter.d.ts
/**
* Filters a Set based on a predicate function.
*
* This function takes a Set and a predicate function, and returns a new Set containing
* only the elements for which the predicate function returns true.
*
* @template T - The type of elements in the Set.
* @param set - The Set to filter.
* @param callback - A predicate function that tests each element.
* @returns A new Set containing only the elements that satisfy the predicate.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = filter(set, (value) => value > 2);
* // result will be:
* // Set(3) { 3, 4, 5 }
*/
declare function filter<T>(set: Set<T>, callback: (value: T, value2: T, set: Set<T>) => boolean): Set<T>;
//#endregion
export { filter };

25
frontend/node_modules/es-toolkit/dist/set/filter.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
//#region src/set/filter.ts
/**
* Filters a Set based on a predicate function.
*
* This function takes a Set and a predicate function, and returns a new Set containing
* only the elements for which the predicate function returns true.
*
* @template T - The type of elements in the Set.
* @param set - The Set to filter.
* @param callback - A predicate function that tests each element.
* @returns A new Set containing only the elements that satisfy the predicate.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = filter(set, (value) => value > 2);
* // result will be:
* // Set(3) { 3, 4, 5 }
*/
function filter(set, callback) {
const result = /* @__PURE__ */ new Set();
for (const value of set) if (callback(value, value, set)) result.add(value);
return result;
}
//#endregion
exports.filter = filter;

25
frontend/node_modules/es-toolkit/dist/set/filter.mjs generated vendored Normal file
View file

@ -0,0 +1,25 @@
//#region src/set/filter.ts
/**
* Filters a Set based on a predicate function.
*
* This function takes a Set and a predicate function, and returns a new Set containing
* only the elements for which the predicate function returns true.
*
* @template T - The type of elements in the Set.
* @param set - The Set to filter.
* @param callback - A predicate function that tests each element.
* @returns A new Set containing only the elements that satisfy the predicate.
*
* @example
* const set = new Set([1, 2, 3, 4, 5]);
* const result = filter(set, (value) => value > 2);
* // result will be:
* // Set(3) { 3, 4, 5 }
*/
function filter(set, callback) {
const result = /* @__PURE__ */ new Set();
for (const value of set) if (callback(value, value, set)) result.add(value);
return result;
}
//#endregion
export { filter };

25
frontend/node_modules/es-toolkit/dist/set/find.d.mts generated vendored Normal file
View file

@ -0,0 +1,25 @@
//#region src/set/find.d.ts
/**
* Finds the first element in a Set for which the predicate function returns true.
*
* This function iterates through the elements of the Set and returns the first
* element for which the predicate function returns true. If no element satisfies the predicate,
* it returns undefined.
*
* @template T - The type of elements in the Set.
* @param set - The Set to search.
* @param doesMatch - A predicate function that tests each element.
* @returns The first element that satisfies the predicate, or undefined if none found.
*
* @example
* const set = new Set([
* { name: 'apple', quantity: 10 },
* { name: 'banana', quantity: 5 },
* { name: 'grape', quantity: 15 }
* ]);
* const result = find(set, (value) => value.quantity > 10);
* // result will be: { name: 'grape', quantity: 15 }
*/
declare function find<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): T | undefined;
//#endregion
export { find };

25
frontend/node_modules/es-toolkit/dist/set/find.d.ts generated vendored Normal file
View file

@ -0,0 +1,25 @@
//#region src/set/find.d.ts
/**
* Finds the first element in a Set for which the predicate function returns true.
*
* This function iterates through the elements of the Set and returns the first
* element for which the predicate function returns true. If no element satisfies the predicate,
* it returns undefined.
*
* @template T - The type of elements in the Set.
* @param set - The Set to search.
* @param doesMatch - A predicate function that tests each element.
* @returns The first element that satisfies the predicate, or undefined if none found.
*
* @example
* const set = new Set([
* { name: 'apple', quantity: 10 },
* { name: 'banana', quantity: 5 },
* { name: 'grape', quantity: 15 }
* ]);
* const result = find(set, (value) => value.quantity > 10);
* // result will be: { name: 'grape', quantity: 15 }
*/
declare function find<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): T | undefined;
//#endregion
export { find };

27
frontend/node_modules/es-toolkit/dist/set/find.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/find.ts
/**
* Finds the first element in a Set for which the predicate function returns true.
*
* This function iterates through the elements of the Set and returns the first
* element for which the predicate function returns true. If no element satisfies the predicate,
* it returns undefined.
*
* @template T - The type of elements in the Set.
* @param set - The Set to search.
* @param doesMatch - A predicate function that tests each element.
* @returns The first element that satisfies the predicate, or undefined if none found.
*
* @example
* const set = new Set([
* { name: 'apple', quantity: 10 },
* { name: 'banana', quantity: 5 },
* { name: 'grape', quantity: 15 }
* ]);
* const result = find(set, (value) => value.quantity > 10);
* // result will be: { name: 'grape', quantity: 15 }
*/
function find(set, doesMatch) {
for (const value of set) if (doesMatch(value, value, set)) return value;
}
//#endregion
exports.find = find;

27
frontend/node_modules/es-toolkit/dist/set/find.mjs generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/find.ts
/**
* Finds the first element in a Set for which the predicate function returns true.
*
* This function iterates through the elements of the Set and returns the first
* element for which the predicate function returns true. If no element satisfies the predicate,
* it returns undefined.
*
* @template T - The type of elements in the Set.
* @param set - The Set to search.
* @param doesMatch - A predicate function that tests each element.
* @returns The first element that satisfies the predicate, or undefined if none found.
*
* @example
* const set = new Set([
* { name: 'apple', quantity: 10 },
* { name: 'banana', quantity: 5 },
* { name: 'grape', quantity: 15 }
* ]);
* const result = find(set, (value) => value.quantity > 10);
* // result will be: { name: 'grape', quantity: 15 }
*/
function find(set, doesMatch) {
for (const value of set) if (doesMatch(value, value, set)) return value;
}
//#endregion
export { find };

View file

@ -0,0 +1,25 @@
//#region src/set/forEach.d.ts
/**
* Executes a provided function once for each element in a Set.
*
* This function iterates through all elements of the Set and executes the callback function
* for each element. The callback receives the value twice (for consistency with Map.forEach)
* and the Set itself as arguments.
*
* @template T - The type of elements in the Set.
* @param set - The Set to iterate over.
* @param callback - A function to execute for each element.
*
* @example
* const set = new Set([1, 2, 3]);
* forEach(set, (value) => {
* console.log(value * 2);
* });
* // Output:
* // 2
* // 4
* // 6
*/
declare function forEach<T>(set: Set<T>, callback: (value: T, value2: T, set: Set<T>) => void): void;
//#endregion
export { forEach };

25
frontend/node_modules/es-toolkit/dist/set/forEach.d.ts generated vendored Normal file
View file

@ -0,0 +1,25 @@
//#region src/set/forEach.d.ts
/**
* Executes a provided function once for each element in a Set.
*
* This function iterates through all elements of the Set and executes the callback function
* for each element. The callback receives the value twice (for consistency with Map.forEach)
* and the Set itself as arguments.
*
* @template T - The type of elements in the Set.
* @param set - The Set to iterate over.
* @param callback - A function to execute for each element.
*
* @example
* const set = new Set([1, 2, 3]);
* forEach(set, (value) => {
* console.log(value * 2);
* });
* // Output:
* // 2
* // 4
* // 6
*/
declare function forEach<T>(set: Set<T>, callback: (value: T, value2: T, set: Set<T>) => void): void;
//#endregion
export { forEach };

27
frontend/node_modules/es-toolkit/dist/set/forEach.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/forEach.ts
/**
* Executes a provided function once for each element in a Set.
*
* This function iterates through all elements of the Set and executes the callback function
* for each element. The callback receives the value twice (for consistency with Map.forEach)
* and the Set itself as arguments.
*
* @template T - The type of elements in the Set.
* @param set - The Set to iterate over.
* @param callback - A function to execute for each element.
*
* @example
* const set = new Set([1, 2, 3]);
* forEach(set, (value) => {
* console.log(value * 2);
* });
* // Output:
* // 2
* // 4
* // 6
*/
function forEach(set, callback) {
for (const value of set) callback(value, value, set);
}
//#endregion
exports.forEach = forEach;

27
frontend/node_modules/es-toolkit/dist/set/forEach.mjs generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/forEach.ts
/**
* Executes a provided function once for each element in a Set.
*
* This function iterates through all elements of the Set and executes the callback function
* for each element. The callback receives the value twice (for consistency with Map.forEach)
* and the Set itself as arguments.
*
* @template T - The type of elements in the Set.
* @param set - The Set to iterate over.
* @param callback - A function to execute for each element.
*
* @example
* const set = new Set([1, 2, 3]);
* forEach(set, (value) => {
* console.log(value * 2);
* });
* // Output:
* // 2
* // 4
* // 6
*/
function forEach(set, callback) {
for (const value of set) callback(value, value, set);
}
//#endregion
export { forEach };

10
frontend/node_modules/es-toolkit/dist/set/index.d.mts generated vendored Normal file
View file

@ -0,0 +1,10 @@
import { countBy } from "./countBy.mjs";
import { every } from "./every.mjs";
import { filter } from "./filter.mjs";
import { find } from "./find.mjs";
import { forEach } from "./forEach.mjs";
import { keyBy } from "./keyBy.mjs";
import { map } from "./map.mjs";
import { reduce } from "./reduce.mjs";
import { some } from "./some.mjs";
export { countBy, every, filter, find, forEach, keyBy, map, reduce, some };

10
frontend/node_modules/es-toolkit/dist/set/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
import { countBy } from "./countBy.js";
import { every } from "./every.js";
import { filter } from "./filter.js";
import { find } from "./find.js";
import { forEach } from "./forEach.js";
import { keyBy } from "./keyBy.js";
import { map } from "./map.js";
import { reduce } from "./reduce.js";
import { some } from "./some.js";
export { countBy, every, filter, find, forEach, keyBy, map, reduce, some };

19
frontend/node_modules/es-toolkit/dist/set/index.js generated vendored Normal file
View file

@ -0,0 +1,19 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_countBy = require("./countBy.js");
const require_every = require("./every.js");
const require_filter = require("./filter.js");
const require_find = require("./find.js");
const require_forEach = require("./forEach.js");
const require_keyBy = require("./keyBy.js");
const require_map = require("./map.js");
const require_reduce = require("./reduce.js");
const require_some = require("./some.js");
exports.countBy = require_countBy.countBy;
exports.every = require_every.every;
exports.filter = require_filter.filter;
exports.find = require_find.find;
exports.forEach = require_forEach.forEach;
exports.keyBy = require_keyBy.keyBy;
exports.map = require_map.map;
exports.reduce = require_reduce.reduce;
exports.some = require_some.some;

10
frontend/node_modules/es-toolkit/dist/set/index.mjs generated vendored Normal file
View file

@ -0,0 +1,10 @@
import { countBy } from "./countBy.mjs";
import { every } from "./every.mjs";
import { filter } from "./filter.mjs";
import { find } from "./find.mjs";
import { forEach } from "./forEach.mjs";
import { keyBy } from "./keyBy.mjs";
import { map } from "./map.mjs";
import { reduce } from "./reduce.mjs";
import { some } from "./some.mjs";
export { countBy, every, filter, find, forEach, keyBy, map, reduce, some };

31
frontend/node_modules/es-toolkit/dist/set/keyBy.d.mts generated vendored Normal file
View file

@ -0,0 +1,31 @@
//#region src/set/keyBy.d.ts
/**
* Maps each element of a Set based on a provided key-generating function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a new Map where the keys are generated by the key function and the values are
* the corresponding values from the original set. If multiple elements produce the same key,
* the last value encountered will be used.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys to produce in the returned Map.
* @param set - The set of elements to be mapped.
* @param getKeyFromValue - A function that generates a key from a value.
* @returns A Map where the generated keys are mapped to each element's value.
*
* @example
* const set = new Set([
* { type: 'fruit', name: 'apple' },
* { type: 'fruit', name: 'banana' },
* { type: 'vegetable', name: 'carrot' }
* ]);
* const result = keyBy(set, item => item.type);
* // result will be:
* // Map(2) {
* // 'fruit' => { type: 'fruit', name: 'banana' },
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
* // }
*/
declare function keyBy<T, K>(set: Set<T>, getKeyFromValue: (value: T, value2: T, set: Set<T>) => K): Map<K, T>;
//#endregion
export { keyBy };

31
frontend/node_modules/es-toolkit/dist/set/keyBy.d.ts generated vendored Normal file
View file

@ -0,0 +1,31 @@
//#region src/set/keyBy.d.ts
/**
* Maps each element of a Set based on a provided key-generating function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a new Map where the keys are generated by the key function and the values are
* the corresponding values from the original set. If multiple elements produce the same key,
* the last value encountered will be used.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys to produce in the returned Map.
* @param set - The set of elements to be mapped.
* @param getKeyFromValue - A function that generates a key from a value.
* @returns A Map where the generated keys are mapped to each element's value.
*
* @example
* const set = new Set([
* { type: 'fruit', name: 'apple' },
* { type: 'fruit', name: 'banana' },
* { type: 'vegetable', name: 'carrot' }
* ]);
* const result = keyBy(set, item => item.type);
* // result will be:
* // Map(2) {
* // 'fruit' => { type: 'fruit', name: 'banana' },
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
* // }
*/
declare function keyBy<T, K>(set: Set<T>, getKeyFromValue: (value: T, value2: T, set: Set<T>) => K): Map<K, T>;
//#endregion
export { keyBy };

38
frontend/node_modules/es-toolkit/dist/set/keyBy.js generated vendored Normal file
View file

@ -0,0 +1,38 @@
//#region src/set/keyBy.ts
/**
* Maps each element of a Set based on a provided key-generating function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a new Map where the keys are generated by the key function and the values are
* the corresponding values from the original set. If multiple elements produce the same key,
* the last value encountered will be used.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys to produce in the returned Map.
* @param set - The set of elements to be mapped.
* @param getKeyFromValue - A function that generates a key from a value.
* @returns A Map where the generated keys are mapped to each element's value.
*
* @example
* const set = new Set([
* { type: 'fruit', name: 'apple' },
* { type: 'fruit', name: 'banana' },
* { type: 'vegetable', name: 'carrot' }
* ]);
* const result = keyBy(set, item => item.type);
* // result will be:
* // Map(2) {
* // 'fruit' => { type: 'fruit', name: 'banana' },
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
* // }
*/
function keyBy(set, getKeyFromValue) {
const result = /* @__PURE__ */ new Map();
for (const value of set) {
const newKey = getKeyFromValue(value, value, set);
result.set(newKey, value);
}
return result;
}
//#endregion
exports.keyBy = keyBy;

38
frontend/node_modules/es-toolkit/dist/set/keyBy.mjs generated vendored Normal file
View file

@ -0,0 +1,38 @@
//#region src/set/keyBy.ts
/**
* Maps each element of a Set based on a provided key-generating function.
*
* This function takes a Set and a function that generates a key from each value.
* It returns a new Map where the keys are generated by the key function and the values are
* the corresponding values from the original set. If multiple elements produce the same key,
* the last value encountered will be used.
*
* @template T - The type of elements in the Set.
* @template K - The type of keys to produce in the returned Map.
* @param set - The set of elements to be mapped.
* @param getKeyFromValue - A function that generates a key from a value.
* @returns A Map where the generated keys are mapped to each element's value.
*
* @example
* const set = new Set([
* { type: 'fruit', name: 'apple' },
* { type: 'fruit', name: 'banana' },
* { type: 'vegetable', name: 'carrot' }
* ]);
* const result = keyBy(set, item => item.type);
* // result will be:
* // Map(2) {
* // 'fruit' => { type: 'fruit', name: 'banana' },
* // 'vegetable' => { type: 'vegetable', name: 'carrot' }
* // }
*/
function keyBy(set, getKeyFromValue) {
const result = /* @__PURE__ */ new Map();
for (const value of set) {
const newKey = getKeyFromValue(value, value, set);
result.set(newKey, value);
}
return result;
}
//#endregion
export { keyBy };

22
frontend/node_modules/es-toolkit/dist/set/map.d.mts generated vendored Normal file
View file

@ -0,0 +1,22 @@
//#region src/set/map.d.ts
/**
* Creates a new Set with elements transformed by the provided function.
*
* This function takes a Set and a function that generates a new value from each element.
* It returns a new Set where the elements are the result of applying the function to each element.
*
* @template T - The type of elements in the input Set.
* @template U - The type of elements in the output Set.
* @param set - The Set to transform.
* @param getNewValue - A function that generates a new value from an element.
* @returns A new Set with transformed elements.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = map(set, (value) => value * 2);
* // result will be:
* // Set(3) { 2, 4, 6 }
*/
declare function map<T, U>(set: Set<T>, getNewValue: (value: T, value2: T, set: Set<T>) => U): Set<U>;
//#endregion
export { map };

22
frontend/node_modules/es-toolkit/dist/set/map.d.ts generated vendored Normal file
View file

@ -0,0 +1,22 @@
//#region src/set/map.d.ts
/**
* Creates a new Set with elements transformed by the provided function.
*
* This function takes a Set and a function that generates a new value from each element.
* It returns a new Set where the elements are the result of applying the function to each element.
*
* @template T - The type of elements in the input Set.
* @template U - The type of elements in the output Set.
* @param set - The Set to transform.
* @param getNewValue - A function that generates a new value from an element.
* @returns A new Set with transformed elements.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = map(set, (value) => value * 2);
* // result will be:
* // Set(3) { 2, 4, 6 }
*/
declare function map<T, U>(set: Set<T>, getNewValue: (value: T, value2: T, set: Set<T>) => U): Set<U>;
//#endregion
export { map };

29
frontend/node_modules/es-toolkit/dist/set/map.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
//#region src/set/map.ts
/**
* Creates a new Set with elements transformed by the provided function.
*
* This function takes a Set and a function that generates a new value from each element.
* It returns a new Set where the elements are the result of applying the function to each element.
*
* @template T - The type of elements in the input Set.
* @template U - The type of elements in the output Set.
* @param set - The Set to transform.
* @param getNewValue - A function that generates a new value from an element.
* @returns A new Set with transformed elements.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = map(set, (value) => value * 2);
* // result will be:
* // Set(3) { 2, 4, 6 }
*/
function map(set, getNewValue) {
const result = /* @__PURE__ */ new Set();
for (const value of set) {
const newValue = getNewValue(value, value, set);
result.add(newValue);
}
return result;
}
//#endregion
exports.map = map;

29
frontend/node_modules/es-toolkit/dist/set/map.mjs generated vendored Normal file
View file

@ -0,0 +1,29 @@
//#region src/set/map.ts
/**
* Creates a new Set with elements transformed by the provided function.
*
* This function takes a Set and a function that generates a new value from each element.
* It returns a new Set where the elements are the result of applying the function to each element.
*
* @template T - The type of elements in the input Set.
* @template U - The type of elements in the output Set.
* @param set - The Set to transform.
* @param getNewValue - A function that generates a new value from an element.
* @returns A new Set with transformed elements.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = map(set, (value) => value * 2);
* // result will be:
* // Set(3) { 2, 4, 6 }
*/
function map(set, getNewValue) {
const result = /* @__PURE__ */ new Set();
for (const value of set) {
const newValue = getNewValue(value, value, set);
result.add(newValue);
}
return result;
}
//#endregion
export { map };

29
frontend/node_modules/es-toolkit/dist/set/reduce.d.mts generated vendored Normal file
View file

@ -0,0 +1,29 @@
//#region src/set/reduce.d.ts
/**
* Reduces a Set to a single value by iterating through its elements and applying a callback function.
*
* This function iterates through all elements of the Set and applies the callback function to each element,
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
* If no initial value is provided and the Set is empty, a TypeError is thrown.
*
* @template T - The type of elements in the Set.
* @template A - The type of the accumulator.
* @param set - The Set to reduce.
* @param callback - A function that processes each element and updates the accumulator.
* @param [initialValue] - The initial value for the accumulator. If not provided, the first element in the Set is used.
* @returns The final accumulated value.
* @throws {TypeError} If the Set is empty and no initial value is provided.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = reduce(set, (acc, value) => acc + value, 0);
* // result will be: 6
*
* @example
* const set = new Set([10, 20]);
* const result = reduce(set, (acc, value) => acc + value);
* // result will be: 30 (starts with first value 10)
*/
declare function reduce<T, A = T>(set: Set<T>, callback: (accumulator: A, value: T, value2: T, set: Set<T>) => A, initialValue?: A): A;
//#endregion
export { reduce };

29
frontend/node_modules/es-toolkit/dist/set/reduce.d.ts generated vendored Normal file
View file

@ -0,0 +1,29 @@
//#region src/set/reduce.d.ts
/**
* Reduces a Set to a single value by iterating through its elements and applying a callback function.
*
* This function iterates through all elements of the Set and applies the callback function to each element,
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
* If no initial value is provided and the Set is empty, a TypeError is thrown.
*
* @template T - The type of elements in the Set.
* @template A - The type of the accumulator.
* @param set - The Set to reduce.
* @param callback - A function that processes each element and updates the accumulator.
* @param [initialValue] - The initial value for the accumulator. If not provided, the first element in the Set is used.
* @returns The final accumulated value.
* @throws {TypeError} If the Set is empty and no initial value is provided.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = reduce(set, (acc, value) => acc + value, 0);
* // result will be: 6
*
* @example
* const set = new Set([10, 20]);
* const result = reduce(set, (acc, value) => acc + value);
* // result will be: 30 (starts with first value 10)
*/
declare function reduce<T, A = T>(set: Set<T>, callback: (accumulator: A, value: T, value2: T, set: Set<T>) => A, initialValue?: A): A;
//#endregion
export { reduce };

35
frontend/node_modules/es-toolkit/dist/set/reduce.js generated vendored Normal file
View file

@ -0,0 +1,35 @@
//#region src/set/reduce.ts
/**
* Reduces a Set to a single value by iterating through its elements and applying a callback function.
*
* This function iterates through all elements of the Set and applies the callback function to each element,
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
* If no initial value is provided and the Set is empty, a TypeError is thrown.
*
* @template T - The type of elements in the Set.
* @template A - The type of the accumulator.
* @param set - The Set to reduce.
* @param callback - A function that processes each element and updates the accumulator.
* @param [initialValue] - The initial value for the accumulator. If not provided, the first element in the Set is used.
* @returns The final accumulated value.
* @throws {TypeError} If the Set is empty and no initial value is provided.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = reduce(set, (acc, value) => acc + value, 0);
* // result will be: 6
*
* @example
* const set = new Set([10, 20]);
* const result = reduce(set, (acc, value) => acc + value);
* // result will be: 30 (starts with first value 10)
*/
function reduce(set, callback, initialValue) {
if (initialValue == null && set.size === 0) throw new TypeError("Reduce of empty set with no initial value");
let accumulator = initialValue;
for (const value of set) if (accumulator == null) accumulator = value;
else accumulator = callback(accumulator, value, value, set);
return accumulator;
}
//#endregion
exports.reduce = reduce;

35
frontend/node_modules/es-toolkit/dist/set/reduce.mjs generated vendored Normal file
View file

@ -0,0 +1,35 @@
//#region src/set/reduce.ts
/**
* Reduces a Set to a single value by iterating through its elements and applying a callback function.
*
* This function iterates through all elements of the Set and applies the callback function to each element,
* accumulating the result. If an initial value is provided, it is used as the starting accumulator value.
* If no initial value is provided and the Set is empty, a TypeError is thrown.
*
* @template T - The type of elements in the Set.
* @template A - The type of the accumulator.
* @param set - The Set to reduce.
* @param callback - A function that processes each element and updates the accumulator.
* @param [initialValue] - The initial value for the accumulator. If not provided, the first element in the Set is used.
* @returns The final accumulated value.
* @throws {TypeError} If the Set is empty and no initial value is provided.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = reduce(set, (acc, value) => acc + value, 0);
* // result will be: 6
*
* @example
* const set = new Set([10, 20]);
* const result = reduce(set, (acc, value) => acc + value);
* // result will be: 30 (starts with first value 10)
*/
function reduce(set, callback, initialValue) {
if (initialValue == null && set.size === 0) throw new TypeError("Reduce of empty set with no initial value");
let accumulator = initialValue;
for (const value of set) if (accumulator == null) accumulator = value;
else accumulator = callback(accumulator, value, value, set);
return accumulator;
}
//#endregion
export { reduce };

24
frontend/node_modules/es-toolkit/dist/set/some.d.mts generated vendored Normal file
View file

@ -0,0 +1,24 @@
//#region src/set/some.d.ts
/**
* Tests whether at least one element in a Set satisfies the provided predicate function.
*
* This function iterates through the elements of the Set and checks if the predicate function
* returns true for at least one element. It returns true if any element satisfies the predicate,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if at least one element satisfies the predicate, false otherwise.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = some(set, (value) => value > 2);
* // result will be: true
*
* const result2 = some(set, (value) => value > 5);
* // result2 will be: false
*/
declare function some<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): boolean;
//#endregion
export { some };

24
frontend/node_modules/es-toolkit/dist/set/some.d.ts generated vendored Normal file
View file

@ -0,0 +1,24 @@
//#region src/set/some.d.ts
/**
* Tests whether at least one element in a Set satisfies the provided predicate function.
*
* This function iterates through the elements of the Set and checks if the predicate function
* returns true for at least one element. It returns true if any element satisfies the predicate,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if at least one element satisfies the predicate, false otherwise.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = some(set, (value) => value > 2);
* // result will be: true
*
* const result2 = some(set, (value) => value > 5);
* // result2 will be: false
*/
declare function some<T>(set: Set<T>, doesMatch: (value: T, value2: T, set: Set<T>) => boolean): boolean;
//#endregion
export { some };

27
frontend/node_modules/es-toolkit/dist/set/some.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/some.ts
/**
* Tests whether at least one element in a Set satisfies the provided predicate function.
*
* This function iterates through the elements of the Set and checks if the predicate function
* returns true for at least one element. It returns true if any element satisfies the predicate,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if at least one element satisfies the predicate, false otherwise.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = some(set, (value) => value > 2);
* // result will be: true
*
* const result2 = some(set, (value) => value > 5);
* // result2 will be: false
*/
function some(set, doesMatch) {
for (const value of set) if (doesMatch(value, value, set)) return true;
return false;
}
//#endregion
exports.some = some;

27
frontend/node_modules/es-toolkit/dist/set/some.mjs generated vendored Normal file
View file

@ -0,0 +1,27 @@
//#region src/set/some.ts
/**
* Tests whether at least one element in a Set satisfies the provided predicate function.
*
* This function iterates through the elements of the Set and checks if the predicate function
* returns true for at least one element. It returns true if any element satisfies the predicate,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param set - The Set to test.
* @param doesMatch - A predicate function that tests each element.
* @returns true if at least one element satisfies the predicate, false otherwise.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = some(set, (value) => value > 2);
* // result will be: true
*
* const result2 = some(set, (value) => value > 5);
* // result2 will be: false
*/
function some(set, doesMatch) {
for (const value of set) if (doesMatch(value, value, set)) return true;
return false;
}
//#endregion
export { some };