remove and hide /js files

This commit is contained in:
zkldi
2021-08-10 22:34:43 +01:00
parent eff8bff465
commit 259b9cb5d3
25 changed files with 3 additions and 2766 deletions
+3 -1
View File
@@ -2,4 +2,6 @@
/.vscode
.nyc_output
coverage
coverage
/js
-77
View File
@@ -1,77 +0,0 @@
import { ClassInfo, GameClassSets } from "../game-classes";
import { ESDJudgementFormat } from "../lib/esd";
import { Playtypes, Game, Difficulties, IDStrings, ScoreCalculatedDataLookup, SessionCalculatedDataLookup, UGSRatingsLookup, Grades, Lamps, JudgementLookup } from "../types";
export interface GameConfig<G extends Game = Game> {
internalName: string;
name: string;
defaultPlaytype: Playtypes[G];
validPlaytypes: Playtypes[G][];
}
interface BaseGamePTConfig<I extends IDStrings> {
idString: I;
percentMax: number;
defaultScoreRatingAlg: ScoreCalculatedDataLookup[I];
defaultSessionRatingAlg: SessionCalculatedDataLookup[I];
defaultProfileRatingAlg: UGSRatingsLookup[I];
scoreRatingAlgs: ScoreCalculatedDataLookup[I][];
sessionRatingAlgs: SessionCalculatedDataLookup[I][];
profileRatingAlgs: UGSRatingsLookup[I][];
difficulties: Difficulties[I][];
shortDifficulties: Partial<Record<Difficulties[I], string>>;
defaultDifficulty: Difficulties[I];
difficultyColours: Record<Difficulties[I], string | null>;
grades: Grades[I][];
gradeColours: Record<Grades[I], string>;
clearGrade: Grades[I];
gradeBoundaries: number[];
lamps: Lamps[I][];
lampColours: Record<Lamps[I], string>;
clearLamp: Lamps[I];
classHumanisedFormat: Record<GameClassSets[I], ClassInfo[]>;
judgements: JudgementLookup[I][];
defaultTable: string;
scoreBucket: "grade" | "lamp";
}
interface GamePTConfigWithESD<I extends IDStrings> extends BaseGamePTConfig<I> {
supportsESD: true;
judgementWindows: ESDJudgementFormat[];
}
interface GamePTConfigWithoutESD<I extends IDStrings> extends BaseGamePTConfig<I> {
supportsESD: false;
}
export declare type GamePTConfig<I extends IDStrings = IDStrings> = GamePTConfigWithESD<I> | GamePTConfigWithoutESD<I>;
/**
* A collection of CSS colours we want to work with.
*/
export declare const COLOUR_SET: {
gray: string;
maroon: string;
red: string;
paleGreen: string;
paleBlue: string;
green: string;
blue: string;
gold: string;
vibrantYellow: string;
teal: string;
white: string;
purple: string;
vibrantPurple: string;
paleOrange: string;
orange: string;
vibrantOrange: string;
vibrantBlue: string;
vibrantGreen: string;
vibrantRed: string;
};
/**
* Returns the configuration for this game.
*/
export declare function GetGameConfig<G extends Game>(game: G): GameConfig<G>;
/**
* Returns the configuration for this Game + Playtype.
* Optionally, a generic parameter - IDStrings - can be passed
* to indicate what IDString this configuration is for.
*/
export declare function GetGamePTConfig<I extends IDStrings = IDStrings>(game: Game, playtype: Playtypes[Game]): GamePTConfig<I>;
export {};
-959
View File
@@ -1,959 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetGamePTConfig = exports.GetGameConfig = exports.COLOUR_SET = void 0;
const game_classes_1 = require("../game-classes");
/**
* A collection of CSS colours we want to work with.
*/
exports.COLOUR_SET = {
gray: "rgba(105, 105, 105, 1)",
maroon: "rgba(85, 17, 17, 1)",
red: "rgba(170, 85, 85, 1)",
paleGreen: "rgba(142,174,79, 1)",
paleBlue: "rgba(92, 97, 153, 1)",
green: "rgba(50, 205, 50, 1)",
blue: "rgba(70, 130, 180, 1)",
gold: "rgba(255, 215, 0, 1)",
vibrantYellow: "rgba(245, 229, 27, 1)",
teal: "rgba(127, 255, 212, 1)",
white: "rgba(192, 192, 192, 1)",
purple: "rgba(153, 50, 204, 1)",
vibrantPurple: "rgba(161, 23, 230, 1)",
paleOrange: "rgba(235, 151, 78, 1)",
orange: "rgba(248, 148, 6, 1)",
vibrantOrange: "rgba(248, 175, 6, 1)",
vibrantBlue: "rgba(43, 149, 237, 1)",
vibrantGreen: "rgba(26, 232, 26, 1)",
vibrantRed: "rgba(243, 23, 45, 1)",
};
const GAME_CONFIGS = {
iidx: {
defaultPlaytype: "SP",
name: "beatmania IIDX",
internalName: "iidx",
validPlaytypes: ["SP", "DP"],
},
museca: {
defaultPlaytype: "Single",
name: "MÚSECA",
internalName: "museca",
validPlaytypes: ["Single"],
},
chunithm: {
defaultPlaytype: "Single",
name: "CHUNITHM",
internalName: "chunithm",
validPlaytypes: ["Single"],
},
ddr: {
defaultPlaytype: "SP",
name: "DDR",
internalName: "ddr",
validPlaytypes: ["SP", "DP"],
},
bms: {
defaultPlaytype: "7K",
name: "BMS",
internalName: "bms",
validPlaytypes: ["7K", "14K"],
},
gitadora: {
defaultPlaytype: "Dora",
name: "GITADORA",
internalName: "gitadora",
validPlaytypes: ["Gita", "Dora"],
},
// jubeat: {
// defaultPlaytype: "Single",
// name: "jubeat",
// internalName: "jubeat",
// validPlaytypes: ["Single"],
// },
maimai: {
defaultPlaytype: "Single",
name: "maimai",
internalName: "maimai",
validPlaytypes: ["Single"],
},
// popn: {
// defaultPlaytype: "9B",
// name: "pop'n music",
// internalName: "popn", // note: KAI servers use pnm as a name.
// validPlaytypes: ["9B"],
// },
sdvx: {
defaultPlaytype: "Single",
name: "SOUND VOLTEX",
internalName: "sdvx",
validPlaytypes: ["Single"],
},
usc: {
defaultPlaytype: "Single",
name: "unnamed_sdvx_clone",
internalName: "usc",
validPlaytypes: ["Single"],
},
};
const GAME_PT_CONFIGS = {
"iidx:SP": {
idString: "iidx:SP",
percentMax: 100,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
sessionRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
profileRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
difficulties: ["BEGINNER", "NORMAL", "HYPER", "ANOTHER", "LEGGENDARIA"],
shortDifficulties: {
BEGINNER: "B",
NORMAL: "N",
HYPER: "H",
ANOTHER: "A",
LEGGENDARIA: "L",
},
defaultDifficulty: "ANOTHER",
difficultyColours: {
BEGINNER: exports.COLOUR_SET.paleGreen,
NORMAL: exports.COLOUR_SET.blue,
HYPER: exports.COLOUR_SET.orange,
ANOTHER: exports.COLOUR_SET.red,
LEGGENDARIA: exports.COLOUR_SET.purple,
},
grades: ["F", "E", "D", "C", "B", "A", "AA", "AAA", "MAX-", "MAX"],
gradeColours: {
F: exports.COLOUR_SET.gray,
E: exports.COLOUR_SET.red,
D: exports.COLOUR_SET.maroon,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleBlue,
A: exports.COLOUR_SET.green,
AA: exports.COLOUR_SET.blue,
AAA: exports.COLOUR_SET.gold,
"MAX-": exports.COLOUR_SET.teal,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 22.22, 33.33, 44.44, 55.55, 66.66, 77.77, 88.88, 94.44, 100.0],
lamps: [
"NO PLAY",
"FAILED",
"ASSIST CLEAR",
"EASY CLEAR",
"CLEAR",
"HARD CLEAR",
"EX HARD CLEAR",
"FULL COMBO",
],
lampColours: {
"NO PLAY": exports.COLOUR_SET.gray,
FAILED: exports.COLOUR_SET.red,
"ASSIST CLEAR": exports.COLOUR_SET.purple,
"EASY CLEAR": exports.COLOUR_SET.green,
CLEAR: exports.COLOUR_SET.blue,
"HARD CLEAR": exports.COLOUR_SET.orange,
"EX HARD CLEAR": exports.COLOUR_SET.gold,
"FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
dan: game_classes_1.IIDXDans,
},
supportsESD: true,
judgementWindows: [
{ name: "PGREAT", msBorder: 16.667, value: 2 },
{ name: "GREAT", msBorder: 33.333, value: 1 },
{ name: "GOOD", msBorder: 116.667, value: 0 },
],
judgements: ["pgreat", "great", "good", "bad", "poor"],
defaultTable: "levels_n-1",
scoreBucket: "lamp",
},
"iidx:DP": {
idString: "iidx:DP",
percentMax: 100,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
sessionRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
profileRatingAlgs: ["ktRating", "ktLampRating", "BPI"],
difficulties: ["NORMAL", "HYPER", "ANOTHER", "LEGGENDARIA"],
shortDifficulties: {
NORMAL: "N",
HYPER: "H",
ANOTHER: "A",
LEGGENDARIA: "L",
},
defaultDifficulty: "ANOTHER",
difficultyColours: {
NORMAL: exports.COLOUR_SET.blue,
HYPER: exports.COLOUR_SET.orange,
ANOTHER: exports.COLOUR_SET.red,
LEGGENDARIA: exports.COLOUR_SET.purple,
},
grades: ["F", "E", "D", "C", "B", "A", "AA", "AAA", "MAX-", "MAX"],
gradeColours: {
F: exports.COLOUR_SET.gray,
E: exports.COLOUR_SET.red,
D: exports.COLOUR_SET.maroon,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleBlue,
A: exports.COLOUR_SET.green,
AA: exports.COLOUR_SET.blue,
AAA: exports.COLOUR_SET.gold,
"MAX-": exports.COLOUR_SET.teal,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 22.22, 33.33, 44.44, 55.55, 66.66, 77.77, 88.88, 94.44, 100.0],
lamps: [
"NO PLAY",
"FAILED",
"ASSIST CLEAR",
"EASY CLEAR",
"CLEAR",
"HARD CLEAR",
"EX HARD CLEAR",
"FULL COMBO",
],
lampColours: {
"NO PLAY": exports.COLOUR_SET.gray,
FAILED: exports.COLOUR_SET.red,
"ASSIST CLEAR": exports.COLOUR_SET.purple,
"EASY CLEAR": exports.COLOUR_SET.green,
CLEAR: exports.COLOUR_SET.blue,
"HARD CLEAR": exports.COLOUR_SET.orange,
"EX HARD CLEAR": exports.COLOUR_SET.gold,
"FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
dan: game_classes_1.IIDXDans,
},
supportsESD: true,
judgementWindows: [
{ name: "PGREAT", msBorder: 16.667, value: 2 },
{ name: "GREAT", msBorder: 33.333, value: 1 },
{ name: "GOOD", msBorder: 116.667, value: 0 },
],
judgements: ["pgreat", "great", "good", "bad", "poor"],
defaultTable: "levels_n-1",
scoreBucket: "lamp",
},
"chunithm:Single": {
idString: "chunithm:Single",
percentMax: 101,
defaultScoreRatingAlg: "rating",
defaultSessionRatingAlg: "naiveRating",
defaultProfileRatingAlg: "naiveRating",
scoreRatingAlgs: ["rating"],
sessionRatingAlgs: ["naiveRating"],
profileRatingAlgs: ["naiveRating"],
difficulties: ["BASIC", "ADVANCED", "EXPERT", "MASTER", "WORLD'S END"],
shortDifficulties: {
BASIC: "B",
ADVANCED: "A",
EXPERT: "E",
MASTER: "M",
"WORLD'S END": "W",
},
defaultDifficulty: "MASTER",
difficultyColours: {
BASIC: exports.COLOUR_SET.blue,
ADVANCED: exports.COLOUR_SET.orange,
EXPERT: exports.COLOUR_SET.red,
MASTER: exports.COLOUR_SET.purple,
"WORLD'S END": exports.COLOUR_SET.vibrantYellow,
},
grades: ["D", "C", "B", "BB", "BBB", "A", "AA", "AAA", "S", "SS", "SSS"],
gradeColours: {
D: exports.COLOUR_SET.red,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleBlue,
BB: exports.COLOUR_SET.blue,
BBB: exports.COLOUR_SET.vibrantBlue,
A: exports.COLOUR_SET.paleGreen,
AA: exports.COLOUR_SET.green,
AAA: exports.COLOUR_SET.vibrantGreen,
S: exports.COLOUR_SET.vibrantOrange,
SS: exports.COLOUR_SET.vibrantYellow,
SSS: exports.COLOUR_SET.teal,
},
clearGrade: "A",
gradeBoundaries: [0, 50, 60, 70, 80, 90, 92.5, 95.0, 97.5, 100, 107.5, 101],
lamps: ["FAILED", "CLEAR", "FULL COMBO", "ALL JUSTICE", "ALL JUSTICE CRITICAL"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.paleGreen,
"FULL COMBO": exports.COLOUR_SET.paleBlue,
"ALL JUSTICE": exports.COLOUR_SET.gold,
"ALL JUSTICE CRITICAL": exports.COLOUR_SET.white,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
colour: game_classes_1.CHUNITHMColours,
},
supportsESD: false,
judgements: ["jcrit", "justice", "attack", "miss"],
defaultTable: "levels_n-1",
scoreBucket: "grade",
},
"sdvx:Single": {
idString: "sdvx:Single",
percentMax: 100,
defaultScoreRatingAlg: "VF6",
defaultSessionRatingAlg: "ProfileVF6",
defaultProfileRatingAlg: "VF6",
scoreRatingAlgs: ["VF6"],
sessionRatingAlgs: ["ProfileVF6", "VF6"],
profileRatingAlgs: ["VF6"],
difficulties: ["NOV", "ADV", "EXH", "INF", "GRV", "HVN", "VVD", "MXM"],
shortDifficulties: {},
defaultDifficulty: "EXH",
difficultyColours: {
NOV: exports.COLOUR_SET.purple,
ADV: exports.COLOUR_SET.vibrantYellow,
EXH: exports.COLOUR_SET.red,
INF: "TODO",
GRV: exports.COLOUR_SET.orange,
HVN: exports.COLOUR_SET.teal,
VVD: "TODO",
MXM: exports.COLOUR_SET.white,
},
grades: ["D", "C", "B", "A", "A+", "AA", "AA+", "AAA", "AAA+", "S"],
gradeColours: {
D: exports.COLOUR_SET.gray,
C: exports.COLOUR_SET.red,
B: exports.COLOUR_SET.maroon,
A: exports.COLOUR_SET.paleBlue,
"A+": exports.COLOUR_SET.blue,
AA: exports.COLOUR_SET.paleGreen,
"AA+": exports.COLOUR_SET.green,
AAA: exports.COLOUR_SET.gold,
"AAA+": exports.COLOUR_SET.vibrantYellow,
S: exports.COLOUR_SET.teal,
},
clearGrade: "A",
gradeBoundaries: [0, 70, 80, 87, 90, 93, 95, 97, 98, 99],
lamps: ["FAILED", "CLEAR", "EXCESSIVE CLEAR", "ULTIMATE CHAIN", "PERFECT ULTIMATE CHAIN"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.green,
"EXCESSIVE CLEAR": exports.COLOUR_SET.orange,
"ULTIMATE CHAIN": exports.COLOUR_SET.teal,
"PERFECT ULTIMATE CHAIN": exports.COLOUR_SET.gold,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
dan: game_classes_1.SDVXDans,
vfClass: game_classes_1.SDVXVFClasses,
},
supportsESD: false,
judgements: ["critical", "near", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
"usc:Single": {
idString: "usc:Single",
percentMax: 100,
defaultScoreRatingAlg: "VF6",
defaultSessionRatingAlg: "ProfileVF6",
defaultProfileRatingAlg: "VF6",
scoreRatingAlgs: ["VF6"],
sessionRatingAlgs: ["ProfileVF6", "VF6"],
profileRatingAlgs: ["VF6"],
difficulties: ["NOV", "ADV", "EXH", "INF"],
shortDifficulties: {},
defaultDifficulty: "EXH",
difficultyColours: {
NOV: exports.COLOUR_SET.purple,
ADV: exports.COLOUR_SET.vibrantYellow,
EXH: exports.COLOUR_SET.red,
INF: "TODO", // colour set light pink
},
grades: ["D", "C", "B", "A", "A+", "AA", "AA+", "AAA", "AAA+", "S"],
gradeColours: {
D: exports.COLOUR_SET.gray,
C: exports.COLOUR_SET.red,
B: exports.COLOUR_SET.maroon,
A: exports.COLOUR_SET.paleBlue,
"A+": exports.COLOUR_SET.blue,
AA: exports.COLOUR_SET.paleGreen,
"AA+": exports.COLOUR_SET.green,
AAA: exports.COLOUR_SET.gold,
"AAA+": exports.COLOUR_SET.vibrantYellow,
S: exports.COLOUR_SET.teal,
},
clearGrade: "A",
gradeBoundaries: [0, 70, 80, 87, 90, 93, 95, 97, 98, 99],
lamps: ["FAILED", "CLEAR", "EXCESSIVE CLEAR", "ULTIMATE CHAIN", "PERFECT ULTIMATE CHAIN"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.green,
"EXCESSIVE CLEAR": exports.COLOUR_SET.orange,
"ULTIMATE CHAIN": exports.COLOUR_SET.teal,
"PERFECT ULTIMATE CHAIN": exports.COLOUR_SET.gold,
},
clearLamp: "CLEAR",
classHumanisedFormat: {},
supportsESD: false,
judgements: ["critical", "near", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
"museca:Single": {
idString: "museca:Single",
percentMax: 100,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["ktRating"],
sessionRatingAlgs: ["ktRating"],
profileRatingAlgs: ["ktRating"],
difficulties: ["Green", "Yellow", "Red"],
shortDifficulties: { Green: "G", Yellow: "Y", Red: "R" },
defaultDifficulty: "Red",
difficultyColours: {
Green: exports.COLOUR_SET.green,
Yellow: exports.COLOUR_SET.vibrantYellow,
Red: exports.COLOUR_SET.red,
},
grades: ["没", "拙", "凡", "佳", "良", "優", "秀", "傑", "傑G"],
gradeColours: {
没: exports.COLOUR_SET.gray,
拙: exports.COLOUR_SET.maroon,
凡: exports.COLOUR_SET.red,
佳: exports.COLOUR_SET.paleGreen,
良: exports.COLOUR_SET.paleBlue,
優: exports.COLOUR_SET.green,
秀: exports.COLOUR_SET.blue,
傑: exports.COLOUR_SET.teal,
傑G: exports.COLOUR_SET.gold,
},
clearGrade: "良",
gradeBoundaries: [0, 60, 70, 80, 85, 90, 95, 97.5, 100],
lamps: ["FAILED", "CLEAR", "CONNECT ALL", "PERFECT CONNECT ALL"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.green,
"CONNECT ALL": exports.COLOUR_SET.teal,
"PERFECT CONNECT ALL": exports.COLOUR_SET.gold,
},
clearLamp: "CLEAR",
classHumanisedFormat: {},
supportsESD: true,
judgementWindows: [
{ name: "CRITICAL", msBorder: 33.333, value: 2 },
{ name: "NEAR", msBorder: 66.667, value: 1 },
],
judgements: ["critical", "near", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
"bms:7K": {
idString: "bms:7K",
percentMax: 100,
defaultScoreRatingAlg: "sieglinde",
defaultSessionRatingAlg: "sieglinde",
defaultProfileRatingAlg: "sieglinde",
scoreRatingAlgs: ["sieglinde"],
sessionRatingAlgs: ["sieglinde"],
profileRatingAlgs: ["sieglinde"],
difficulties: ["CHART"],
shortDifficulties: {},
defaultDifficulty: "CHART",
difficultyColours: {
CHART: null,
},
grades: ["F", "E", "D", "C", "B", "A", "AA", "AAA", "MAX-", "MAX"],
gradeColours: {
F: exports.COLOUR_SET.gray,
E: exports.COLOUR_SET.red,
D: exports.COLOUR_SET.maroon,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleBlue,
A: exports.COLOUR_SET.green,
AA: exports.COLOUR_SET.blue,
AAA: exports.COLOUR_SET.gold,
"MAX-": exports.COLOUR_SET.teal,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 22.22, 33.33, 44.44, 55.55, 66.66, 77.77, 88.88, 94.44, 100.0],
lamps: [
"NO PLAY",
"FAILED",
"ASSIST CLEAR",
"EASY CLEAR",
"CLEAR",
"HARD CLEAR",
"EX HARD CLEAR",
"FULL COMBO",
],
lampColours: {
"NO PLAY": exports.COLOUR_SET.gray,
FAILED: exports.COLOUR_SET.red,
"ASSIST CLEAR": exports.COLOUR_SET.purple,
"EASY CLEAR": exports.COLOUR_SET.green,
CLEAR: exports.COLOUR_SET.blue,
"HARD CLEAR": exports.COLOUR_SET.orange,
"EX HARD CLEAR": exports.COLOUR_SET.gold,
"FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
genocideDan: game_classes_1.BMSGenocideDans,
stslDan: game_classes_1.BMSStSlDans,
},
supportsESD: false,
judgements: ["pgreat", "great", "good", "bad", "poor"],
defaultTable: "insane",
scoreBucket: "lamp",
},
"bms:14K": {
idString: "bms:14K",
percentMax: 100,
defaultScoreRatingAlg: "sieglinde",
defaultSessionRatingAlg: "sieglinde",
defaultProfileRatingAlg: "sieglinde",
scoreRatingAlgs: ["sieglinde"],
sessionRatingAlgs: ["sieglinde"],
profileRatingAlgs: ["sieglinde"],
difficulties: ["CHART"],
shortDifficulties: {},
defaultDifficulty: "CHART",
difficultyColours: {
CHART: null,
},
grades: ["F", "E", "D", "C", "B", "A", "AA", "AAA", "MAX-", "MAX"],
gradeColours: {
F: exports.COLOUR_SET.gray,
E: exports.COLOUR_SET.red,
D: exports.COLOUR_SET.maroon,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleBlue,
A: exports.COLOUR_SET.green,
AA: exports.COLOUR_SET.blue,
AAA: exports.COLOUR_SET.gold,
"MAX-": exports.COLOUR_SET.teal,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 22.22, 33.33, 44.44, 55.55, 66.66, 77.77, 88.88, 94.44, 100.0],
lamps: [
"NO PLAY",
"FAILED",
"ASSIST CLEAR",
"EASY CLEAR",
"CLEAR",
"HARD CLEAR",
"EX HARD CLEAR",
"FULL COMBO",
],
lampColours: {
"NO PLAY": exports.COLOUR_SET.gray,
FAILED: exports.COLOUR_SET.red,
"ASSIST CLEAR": exports.COLOUR_SET.purple,
"EASY CLEAR": exports.COLOUR_SET.green,
CLEAR: exports.COLOUR_SET.blue,
"HARD CLEAR": exports.COLOUR_SET.orange,
"EX HARD CLEAR": exports.COLOUR_SET.gold,
"FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
genocideDan: game_classes_1.BMSGenocideDans,
},
supportsESD: false,
judgements: ["pgreat", "great", "good", "bad", "poor"],
defaultTable: "insane",
scoreBucket: "lamp",
},
"ddr:SP": {
idString: "ddr:SP",
percentMax: 100,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["MFCP", "ktRating"],
sessionRatingAlgs: ["MFCP", "ktRating"],
profileRatingAlgs: ["MFCP", "ktRating"],
difficulties: ["BEGINNER", "BASIC", "DIFFICULT", "EXPERT", "CHALLENGE"],
shortDifficulties: {
BEGINNER: "b",
BASIC: "B",
DIFFICULT: "D",
EXPERT: "E",
CHALLENGE: "C",
},
defaultDifficulty: "EXPERT",
difficultyColours: {
BEGINNER: exports.COLOUR_SET.paleBlue,
BASIC: exports.COLOUR_SET.orange,
DIFFICULT: exports.COLOUR_SET.red,
EXPERT: exports.COLOUR_SET.green,
CHALLENGE: exports.COLOUR_SET.purple,
},
grades: [
"D",
"D+",
"C-",
"C",
"C+",
"B-",
"B",
"B+",
"A-",
"A",
"A+",
"AA-",
"AA",
"AA+",
"AAA",
],
gradeColours: {
D: exports.COLOUR_SET.gray,
"D+": exports.COLOUR_SET.maroon,
"C-": exports.COLOUR_SET.red,
C: exports.COLOUR_SET.purple,
"C+": exports.COLOUR_SET.vibrantPurple,
"B-": exports.COLOUR_SET.paleBlue,
B: exports.COLOUR_SET.blue,
"B+": exports.COLOUR_SET.vibrantBlue,
"A-": exports.COLOUR_SET.paleGreen,
A: exports.COLOUR_SET.green,
"A+": exports.COLOUR_SET.vibrantGreen,
"AA-": exports.COLOUR_SET.paleOrange,
AA: exports.COLOUR_SET.orange,
"AA+": exports.COLOUR_SET.vibrantOrange,
AAA: exports.COLOUR_SET.gold,
},
clearGrade: "A",
gradeBoundaries: [0, 55, 59, 60, 65, 69, 70, 75, 79, 80, 85, 89, 90, 95, 99],
lamps: [
"FAILED",
"CLEAR",
"LIFE4",
"FULL COMBO",
"GREAT FULL COMBO",
"PERFECT FULL COMBO",
"MARVELOUS FULL COMBO",
],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.paleGreen,
LIFE4: exports.COLOUR_SET.orange,
"FULL COMBO": exports.COLOUR_SET.paleBlue,
"GREAT FULL COMBO": exports.COLOUR_SET.green,
"PERFECT FULL COMBO": exports.COLOUR_SET.gold,
"MARVELOUS FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
dan: game_classes_1.DDRDans,
},
supportsESD: true,
judgementWindows: [
{ name: "MARVELOUS", msBorder: 15, value: 3 },
{ name: "PERFECT", msBorder: 30, value: 2 },
{ name: "GREAT", msBorder: 59, value: 1 },
{ name: "GOOD", msBorder: 89, value: 0 },
{ name: "BAD", msBorder: 119, value: 0 },
],
judgements: ["marvelous", "perfect", "great", "good", "boo", "miss", "ok", "ng"],
defaultTable: "levels",
scoreBucket: "lamp",
},
"ddr:DP": {
idString: "ddr:DP",
percentMax: 100,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["MFCP", "ktRating"],
sessionRatingAlgs: ["MFCP", "ktRating"],
profileRatingAlgs: ["MFCP", "ktRating"],
difficulties: ["BASIC", "DIFFICULT", "EXPERT", "CHALLENGE"],
shortDifficulties: {
BASIC: "B",
DIFFICULT: "D",
EXPERT: "E",
CHALLENGE: "C",
},
defaultDifficulty: "EXPERT",
difficultyColours: {
BASIC: exports.COLOUR_SET.orange,
DIFFICULT: exports.COLOUR_SET.red,
EXPERT: exports.COLOUR_SET.green,
CHALLENGE: exports.COLOUR_SET.purple,
},
grades: [
"D",
"D+",
"C-",
"C",
"C+",
"B-",
"B",
"B+",
"A-",
"A",
"A+",
"AA-",
"AA",
"AA+",
"AAA",
],
gradeColours: {
D: exports.COLOUR_SET.gray,
"D+": exports.COLOUR_SET.maroon,
"C-": exports.COLOUR_SET.red,
C: exports.COLOUR_SET.purple,
"C+": exports.COLOUR_SET.vibrantPurple,
"B-": exports.COLOUR_SET.paleBlue,
B: exports.COLOUR_SET.blue,
"B+": exports.COLOUR_SET.vibrantBlue,
"A-": exports.COLOUR_SET.paleGreen,
A: exports.COLOUR_SET.green,
"A+": exports.COLOUR_SET.vibrantGreen,
"AA-": exports.COLOUR_SET.paleOrange,
AA: exports.COLOUR_SET.orange,
"AA+": exports.COLOUR_SET.vibrantOrange,
AAA: exports.COLOUR_SET.gold,
},
clearGrade: "A",
gradeBoundaries: [0, 55, 59, 60, 65, 69, 70, 75, 79, 80, 85, 89, 90, 95, 99],
lamps: [
"FAILED",
"CLEAR",
"LIFE4",
"FULL COMBO",
"GREAT FULL COMBO",
"PERFECT FULL COMBO",
"MARVELOUS FULL COMBO",
],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.paleGreen,
LIFE4: exports.COLOUR_SET.orange,
"FULL COMBO": exports.COLOUR_SET.paleBlue,
"GREAT FULL COMBO": exports.COLOUR_SET.green,
"PERFECT FULL COMBO": exports.COLOUR_SET.gold,
"MARVELOUS FULL COMBO": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
dan: game_classes_1.DDRDans,
},
supportsESD: true,
judgementWindows: [
{ name: "MARVELOUS", msBorder: 15, value: 3 },
{ name: "PERFECT", msBorder: 30, value: 2 },
{ name: "GREAT", msBorder: 59, value: 1 },
{ name: "GOOD", msBorder: 89, value: 0 },
{ name: "BAD", msBorder: 119, value: 0 },
],
judgements: ["marvelous", "perfect", "great", "good", "boo", "miss", "ok", "ng"],
defaultTable: "levels",
scoreBucket: "lamp",
},
"maimai:Single": {
idString: "maimai:Single",
percentMax: 120,
defaultScoreRatingAlg: "ktRating",
defaultSessionRatingAlg: "ktRating",
defaultProfileRatingAlg: "ktRating",
scoreRatingAlgs: ["ktRating"],
sessionRatingAlgs: ["ktRating"],
profileRatingAlgs: ["ktRating"],
difficulties: ["Easy", "Basic", "Advanced", "Expert", "Master", "Re:Master"],
shortDifficulties: {
Easy: "e",
Basic: "B",
Advanced: "A",
Expert: "E",
Master: "M",
"Re:Master": "Re",
},
defaultDifficulty: "Master",
difficultyColours: {
Easy: exports.COLOUR_SET.blue,
Basic: exports.COLOUR_SET.green,
Advanced: exports.COLOUR_SET.orange,
Expert: exports.COLOUR_SET.red,
Master: exports.COLOUR_SET.purple,
"Re:Master": exports.COLOUR_SET.white,
},
grades: ["F", "E", "D", "C", "B", "A", "AA", "AAA", "S", "S+", "SS", "SS+", "SSS", "SSS+"],
gradeColours: {
F: exports.COLOUR_SET.gray,
E: exports.COLOUR_SET.red,
D: exports.COLOUR_SET.maroon,
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.paleGreen,
A: exports.COLOUR_SET.green,
AA: exports.COLOUR_SET.paleBlue,
AAA: exports.COLOUR_SET.blue,
S: exports.COLOUR_SET.gold,
"S+": exports.COLOUR_SET.vibrantYellow,
SS: exports.COLOUR_SET.paleOrange,
"SS+": exports.COLOUR_SET.orange,
SSS: exports.COLOUR_SET.teal,
"SSS+": exports.COLOUR_SET.white,
},
clearGrade: "A",
// @hack Maimai's top grade depends on the chart's maximum percent
// we just set it at percentMax, but it's not technically correct
gradeBoundaries: [0, 10, 20, 40, 60, 80, 90, 94, 97, 98, 99, 99.5, 100, 120],
lamps: ["FAILED", "CLEAR", "FULL COMBO", "ALL PERFECT", "ALL PERFECT+"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.green,
"FULL COMBO": exports.COLOUR_SET.blue,
"ALL PERFECT": exports.COLOUR_SET.gold,
"ALL PERFECT+": exports.COLOUR_SET.teal,
},
clearLamp: "CLEAR",
classHumanisedFormat: {},
supportsESD: false,
judgements: ["perfect", "great", "good", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
"gitadora:Gita": {
idString: "gitadora:Gita",
percentMax: 100,
defaultScoreRatingAlg: "skill",
defaultSessionRatingAlg: "skill",
defaultProfileRatingAlg: "skill",
scoreRatingAlgs: ["skill"],
sessionRatingAlgs: ["skill"],
profileRatingAlgs: ["skill"],
difficulties: [
"BASIC",
"ADVANCED",
"EXTREME",
"MASTER",
"BASS BASIC",
"BASS ADVANCED",
"BASS EXTREME",
"BASS MASTER",
],
shortDifficulties: {
BASIC: "G-BSC",
ADVANCED: "G-ADV",
EXTREME: "G-EXT",
MASTER: "G-MAS",
"BASS BASIC": "B-BSC",
"BASS ADVANCED": "B-ADV",
"BASS EXTREME": "B-EXT",
"BASS MASTER": "B-MAS",
},
defaultDifficulty: "EXTREME",
difficultyColours: {
BASIC: exports.COLOUR_SET.blue,
ADVANCED: exports.COLOUR_SET.orange,
EXTREME: exports.COLOUR_SET.red,
MASTER: exports.COLOUR_SET.purple,
"BASS BASIC": exports.COLOUR_SET.vibrantBlue,
"BASS ADVANCED": exports.COLOUR_SET.vibrantOrange,
"BASS EXTREME": "todo",
"BASS MASTER": exports.COLOUR_SET.vibrantPurple,
},
grades: ["C", "B", "A", "S", "SS", "MAX"],
gradeColours: {
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.blue,
A: exports.COLOUR_SET.green,
S: exports.COLOUR_SET.orange,
SS: exports.COLOUR_SET.gold,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 63, 73, 80, 95, 100],
lamps: ["FAILED", "CLEAR", "FULL COMBO", "EXCELLENT"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.blue,
"FULL COMBO": exports.COLOUR_SET.teal,
EXCELLENT: exports.COLOUR_SET.gold,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
colour: game_classes_1.GitadoraColours,
},
supportsESD: false,
judgements: ["perfect", "great", "good", "ok", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
"gitadora:Dora": {
idString: "gitadora:Dora",
percentMax: 100,
defaultScoreRatingAlg: "skill",
defaultSessionRatingAlg: "skill",
defaultProfileRatingAlg: "skill",
scoreRatingAlgs: ["skill"],
sessionRatingAlgs: ["skill"],
profileRatingAlgs: ["skill"],
difficulties: ["BASIC", "ADVANCED", "EXTREME", "MASTER"],
shortDifficulties: {
BASIC: "D-BSC",
ADVANCED: "D-ADV",
EXTREME: "D-EXT",
MASTER: "D-MAS",
},
defaultDifficulty: "EXTREME",
difficultyColours: {
BASIC: exports.COLOUR_SET.blue,
ADVANCED: exports.COLOUR_SET.orange,
EXTREME: exports.COLOUR_SET.red,
MASTER: exports.COLOUR_SET.purple,
},
grades: ["C", "B", "A", "S", "SS", "MAX"],
gradeColours: {
C: exports.COLOUR_SET.purple,
B: exports.COLOUR_SET.blue,
A: exports.COLOUR_SET.green,
S: exports.COLOUR_SET.orange,
SS: exports.COLOUR_SET.gold,
MAX: exports.COLOUR_SET.white,
},
clearGrade: "A",
gradeBoundaries: [0, 63, 73, 80, 95, 100],
lamps: ["FAILED", "CLEAR", "FULL COMBO", "EXCELLENT"],
lampColours: {
FAILED: exports.COLOUR_SET.red,
CLEAR: exports.COLOUR_SET.blue,
"FULL COMBO": exports.COLOUR_SET.teal,
EXCELLENT: exports.COLOUR_SET.gold,
},
clearLamp: "CLEAR",
classHumanisedFormat: {
colour: game_classes_1.GitadoraColours,
},
supportsESD: false,
judgements: ["perfect", "great", "good", "ok", "miss"],
defaultTable: "levels",
scoreBucket: "grade",
},
};
/**
* Returns the configuration for this game.
*/
function GetGameConfig(game) {
return GAME_CONFIGS[game];
}
exports.GetGameConfig = GetGameConfig;
/**
* Returns the configuration for this Game + Playtype.
* Optionally, a generic parameter - IDStrings - can be passed
* to indicate what IDString this configuration is for.
*/
function GetGamePTConfig(game, playtype) {
const idString = `${game}:${playtype}`;
return GAME_PT_CONFIGS[idString];
}
exports.GetGamePTConfig = GetGamePTConfig;
//# sourceMappingURL=config.js.map
File diff suppressed because one or more lines are too long
-14
View File
@@ -1,14 +0,0 @@
import { FileUploadImportTypes, IRImportTypes, APIImportTypes, ImportTypes, Game } from "..";
export declare const fileImportTypes: FileUploadImportTypes[];
export declare const irImportTypes: IRImportTypes[];
export declare const apiImportTypes: APIImportTypes[];
export declare const allImportTypes: ImportTypes[];
export declare const allSupportedGames: Game[];
export interface ServerConfig {
name: string;
supportedGames: Game[];
supportedImportTypes: ImportTypes[];
}
export declare const KTCHI_CONFIG: ServerConfig;
export declare const BTCHI_CONFIG: ServerConfig;
export declare const OMNI_CONFIG: ServerConfig;
-78
View File
@@ -1,78 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OMNI_CONFIG = exports.BTCHI_CONFIG = exports.KTCHI_CONFIG = exports.allSupportedGames = exports.allImportTypes = exports.apiImportTypes = exports.irImportTypes = exports.fileImportTypes = void 0;
exports.fileImportTypes = [
"file/eamusement-iidx-csv",
"file/batch-manual",
"file/solid-state-squad",
"file/mer-iidx",
"file/pli-iidx-csv",
];
exports.irImportTypes = [
"ir/direct-manual",
"ir/barbatos",
"ir/fervidex",
"ir/fervidex-static",
"ir/beatoraja",
"ir/chunitachi",
"ir/usc",
];
exports.apiImportTypes = [
"api/arc-iidx",
"api/arc-sdvx",
"api/arc-ddr",
"api/eag-iidx",
"api/eag-sdvx",
"api/flo-iidx",
"api/flo-sdvx",
];
exports.allImportTypes = [
...exports.fileImportTypes,
...exports.irImportTypes,
...exports.apiImportTypes,
];
exports.allSupportedGames = [
"iidx",
"museca",
"maimai",
// "jubeat",
// "popn",
"sdvx",
"ddr",
"bms",
"chunithm",
"gitadora",
"usc",
];
exports.KTCHI_CONFIG = {
name: "Kamaitachi",
supportedGames: ["iidx", "gitadora", "chunithm", "maimai", "museca", "sdvx"],
supportedImportTypes: [
"api/arc-iidx",
"api/arc-sdvx",
"api/arc-ddr",
"api/eag-iidx",
"api/eag-sdvx",
"api/flo-iidx",
"api/flo-sdvx",
"ir/direct-manual",
"ir/fervidex",
"ir/fervidex-static",
"ir/chunitachi",
"file/eamusement-iidx-csv",
"file/solid-state-squad",
"file/mer-iidx",
"file/pli-iidx-csv",
],
};
exports.BTCHI_CONFIG = {
name: "Bokutachi",
supportedGames: ["usc", "bms"],
supportedImportTypes: ["ir/beatoraja", "ir/usc", "ir/direct-manual", "file/batch-manual"],
};
exports.OMNI_CONFIG = {
name: "Omnitachi",
supportedGames: exports.allSupportedGames,
supportedImportTypes: exports.allImportTypes,
};
//# sourceMappingURL=static-config.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"static-config.js","sourceRoot":"","sources":["../../src/config/static-config.ts"],"names":[],"mappings":";;;AAUa,QAAA,eAAe,GAA4B;IACvD,0BAA0B;IAC1B,mBAAmB;IACnB,wBAAwB;IACxB,eAAe;IACf,mBAAmB;CACnB,CAAC;AAEW,QAAA,aAAa,GAAoB;IAC7C,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,cAAc;IACd,eAAe;IACf,QAAQ;CACR,CAAC;AAEW,QAAA,cAAc,GAAqB;IAC/C,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;CACd,CAAC;AAEW,QAAA,cAAc,GAAkB;IAC5C,GAAG,uBAAe;IAClB,GAAG,qBAAa;IAChB,GAAG,sBAAc;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAW;IACxC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,MAAM;IACN,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,KAAK;CACL,CAAC;AAQW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,YAAY;IAClB,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;IAC5E,oBAAoB,EAAE;QACrB,cAAc;QACd,cAAc;QACd,aAAa;QACb,cAAc;QACd,cAAc;QACd,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,aAAa;QACb,oBAAoB;QACpB,eAAe;QACf,0BAA0B;QAC1B,wBAAwB;QACxB,eAAe;QACf,mBAAmB;KACnB;CACD,CAAC;AAEW,QAAA,YAAY,GAAiB;IACzC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9B,oBAAoB,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,CAAC;CACzF,CAAC;AAEW,QAAA,WAAW,GAAiB;IACxC,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,yBAAiB;IACjC,oBAAoB,EAAE,sBAAc;CACpC,CAAC"}
-54
View File
@@ -1,54 +0,0 @@
import { IDStrings, integer } from "./types";
export interface ClassInfo {
display: string;
mouseover?: string;
css?: {
backgroundColor: string;
color: string;
};
variant?: "primary" | "secondary" | "success" | "warning" | "danger" | "info";
}
export declare const IIDXDans: ClassInfo[];
export declare const GitadoraColours: ClassInfo[];
export declare const BMSGenocideDans: ClassInfo[];
export declare const BMSStSlDans: ClassInfo[];
export declare const SDVXDans: ClassInfo[];
export declare const SDVXVFClasses: ClassInfo[];
export declare const DDRDans: {
display: string;
mouseover: string;
variant: "warning" | "primary" | "secondary" | "success" | "danger" | "info";
}[];
export declare const CHUNITHMColours: ({
display: string;
mouseover: string;
css: {
backgroundColor: string;
color: string;
};
} | {
display: string;
mouseover: string;
variant: "warning" | "primary" | "secondary" | "success" | "danger" | "info";
})[];
export interface GameClassSets {
"iidx:SP": "dan";
"iidx:DP": "dan";
"popn:9B": never;
"sdvx:Single": "dan" | "vfClass";
"usc:Single": never;
"ddr:SP": "dan";
"ddr:DP": "dan";
"maimai:Single": never;
"jubeat:Single": "colour";
"museca:Single": never;
"bms:7K": "genocideDan" | "stslDan";
"bms:14K": "genocideDan";
"chunithm:Single": "colour";
"gitadora:Gita": "colour";
"gitadora:Dora": "colour";
}
export declare type AllClassSets = GameClassSets[IDStrings];
export declare type GameClasses<I extends IDStrings> = {
[K in GameClassSets[I]]: integer;
};
-187
View File
@@ -1,187 +0,0 @@
"use strict";
// Classes refer to things like dans.
// Not the JS construct.
Object.defineProperty(exports, "__esModule", { value: true });
exports.CHUNITHMColours = exports.DDRDans = exports.SDVXVFClasses = exports.SDVXDans = exports.BMSStSlDans = exports.BMSGenocideDans = exports.GitadoraColours = exports.IIDXDans = void 0;
function c(d, m, bg = "black", color = "white") {
return { display: d, mouseover: m, css: { backgroundColor: bg, color } };
}
function v(d, m, variant) {
return { display: d, mouseover: m, variant };
}
function n(d, bg = "#131313", color = "white") {
return { display: d, css: { backgroundColor: bg, color } };
}
exports.IIDXDans = [
c("七級", "7th Kyu", "green"),
c("六級", "6th Kyu", "green"),
c("五級", "5th Kyu", "green"),
c("四級", "4th Kyu", "green"),
c("三級", "3rd Kyu", "green"),
c("二級", "2nd Kyu", "green"),
c("一級", "1st Kyu", "green"),
v("初段", "1st Dan", "info"),
v("二段", "2nd Dan", "info"),
v("三段", "3rd Dan", "info"),
v("四段", "4th Dan", "info"),
v("五段", "5th Dan", "info"),
v("六段", "6th Dan", "info"),
v("七段", "7th Dan", "info"),
v("八段", "8th Dan", "info"),
v("九段", "9th Dan", "danger"),
v("十段", "10th Dan", "danger"),
c("中伝", "Chuuden", "silver", "black"),
v("皆伝", "Kaiden", "warning"),
];
exports.GitadoraColours = [
c("白", "White", "white", "black"),
c("橙", "Orange", "orange"),
c("橙グラ", "Orange Gradient", "orange"),
v("黄", "Yellow", "warning"),
v("黄グラ", "Yellow Gradient", "warning"),
c("緑", "Green", "green"),
c("緑グラ", "Green Gradient", "green"),
v("青", "Blue", "info"),
v("青グラ", "Blue Gradient", "info"),
c("紫", "Purple", "purple"),
c("紫グラ", "Purple Gradient", "purple"),
v("赤", "Red", "danger"),
v("赤グラ", "Red Gradient", "danger"),
c("銅", "Bronze", "bronze"),
c("銀", "Silver", "silver", "black"),
c("金", "Gold", "gold"),
c("虹", "Rainbow", "todo"),
];
exports.BMSGenocideDans = [
c("☆1", "Normal 1st Dan", "lightblue"),
c("☆2", "Normal 2nd Dan", "lightblue"),
c("☆3", "Normal 3rd Dan", "lightblue"),
c("☆4", "Normal 4th Dan", "lightblue"),
c("☆5", "Normal 5th Dan", "lightblue"),
c("☆6", "Normal 6th Dan", "lightblue"),
c("☆7", "Normal 7th Dan", "lightblue"),
c("☆8", "Normal 8th Dan", "lightblue"),
c("☆9", "Normal 9th Dan", "lightred"),
c("☆10", "Normal 10th Dan", "lightred"),
v("★1", "Insane 1st Dan", "info"),
v("★2", "Insane 2nd Dan", "info"),
v("★3", "Insane 3rd Dan", "info"),
v("★4", "Insane 4th Dan", "info"),
v("★5", "Insane 5th Dan", "info"),
v("★6", "Insane 6th Dan", "info"),
v("★7", "Insane 7th Dan", "info"),
v("★8", "Insane 8th Dan", "info"),
c("★9", "Insane 9th Dan", "red"),
c("★10", "Insane 10th Dan", "red"),
c("★★", "Insane Kaiden", "teal"),
c("(^^)", "Overjoy", "purple"),
];
exports.BMSStSlDans = [
c("sl0", "Satellite 0"),
c("sl1", "Satellite 1"),
c("sl2", "Satellite 2"),
c("sl3", "Satellite 3"),
c("sl4", "Satellite 4"),
c("sl5", "Satellite 5"),
c("sl6", "Satellite 6"),
c("sl7", "Satellite 7"),
c("sl8", "Satellite 8"),
c("sl9", "Satellite 9"),
c("sl10", "Satellite 10"),
c("sl11", "Satellite 11"),
c("sl12", "Satellite 12"),
c("st0", "Stella 0"),
c("st1", "Stella 1"),
c("st2", "Stella 2"),
c("st3", "Stella 3"),
c("st4", "Stella 4"),
c("st5", "Stella 5"),
c("st6", "Stella 6"),
c("st7", "Stella 7"),
c("st8", "Stella 8"),
c("st9", "Stella 9"),
c("st10", "Stella 10"),
c("st11", "Stella 11"),
];
exports.SDVXDans = [
c("LV.01", "1st Dan"),
c("LV.02", "2nd Dan"),
c("LV.03", "3rd Dan"),
c("LV.04", "4th Dan"),
c("LV.05", "5th Dan"),
c("LV.06", "6th Dan"),
c("LV.07", "7th Dan"),
c("LV.08", "8th Dan"),
c("LV.09", "9th Dan"),
v("LV.10", "10th Dan", "warning"),
v("LV.11", "11th Dan", "danger"),
c("LV.INF", "Inf. Dan", "purple", "gold"),
];
exports.SDVXVFClasses = [
n("Sienna I"),
n("Sienna II"),
n("Sienna III"),
n("Sienna IV"),
n("Cobalt I"),
n("Cobalt II"),
n("Cobalt III"),
n("Cobalt IV"),
n("Dandelion I"),
n("Dandelion II"),
n("Dandelion III"),
n("Dandelion IV"),
n("Cyan I"),
n("Cyan II"),
n("Cyan III"),
n("Cyan IV"),
n("Scarlet I"),
n("Scarlet II"),
n("Scarlet III"),
n("Scarlet IV"),
n("Coral I"),
n("Coral II"),
n("Coral III"),
n("Coral IV"),
n("Argento I"),
n("Argento II"),
n("Argento III"),
n("Argento IV"),
n("Eldora I"),
n("Eldora II"),
n("Eldora III"),
n("Eldora IV"),
n("Crimson I"),
n("Crimson II"),
n("Crimson III"),
n("Crimson IV"),
n("Imperial I"),
n("Imperial II"),
n("Imperial III"),
n("Imperial IV"),
];
exports.DDRDans = [
v("初段", "1st Dan", "info"),
v("二段", "2nd Dan", "info"),
v("三段", "3rd Dan", "info"),
v("四段", "4th Dan", "info"),
v("五段", "5th Dan", "info"),
v("六段", "6th Dan", "info"),
v("七段", "7th Dan", "info"),
v("八段", "8th Dan", "info"),
v("九段", "9th Dan", "danger"),
v("十段", "10th Dan", "danger"),
v("皆伝", "Kaiden", "warning"),
];
exports.CHUNITHMColours = [
v("青", "Blue", "info"),
c("緑", "Green", "green"),
c("橙", "Orange", "orange"),
v("赤", "Red", "danger"),
c("紫", "Purple", "purple"),
c("銅", "Copper", "bronze"),
v("銀", "Silver", "secondary"),
v("金", "Gold", "warning"),
c("鉑", "Platinum", "silver", "black"),
v("虹", "Rainbow", "success"),
];
//# sourceMappingURL=game-classes.js.map
File diff suppressed because one or more lines are too long
-6
View File
@@ -1,6 +0,0 @@
export * from "./types";
export * from "./config/config";
export * as gameClasses from "./game-classes";
export * as ESDCore from "./lib/esd";
export * as StaticConfig from "./config/static-config";
export * from "./utils/util";
-32
View File
@@ -1,32 +0,0 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticConfig = exports.ESDCore = exports.gameClasses = void 0;
__exportStar(require("./types"), exports);
__exportStar(require("./config/config"), exports);
exports.gameClasses = __importStar(require("./game-classes"));
exports.ESDCore = __importStar(require("./lib/esd"));
exports.StaticConfig = __importStar(require("./config/static-config"));
__exportStar(require("./utils/util"), exports);
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAwB;AAExB,kDAAgC;AAChC,8DAA8C;AAC9C,qDAAqC;AACrC,uEAAuD;AACvD,+CAA6B"}
-26
View File
@@ -1,26 +0,0 @@
export interface ESDJudgementFormat {
name: string;
msBorder: number;
value: number;
}
/**
* Given judgements and a percent, estimate the standard deviation needed to get a score
* with that percent.
* @param judgements - The judgements for this game.
* @param percent - The percent to estimate SD needed to get.
* @param errOnInaccuracy - Whether or whether not to throw if the estimate is not accurate enough.
* @returns
*/
export declare function CalculateESD(judgements: ESDJudgementFormat[], percent: number, errOnInaccuracy?: boolean): number;
/**
* Compares two ESD values such that 1->2 produces a larger value than 101->102.
* @param baseESD - The first ESD to compare.
* @param compareESD - The second ESD to compare.
* @param cdeg - The degrees of confidence to use. This should be 1.
* @returns A number between -100 and 100.
*/
export declare function ESDCompare(baseESD: number, compareESD: number, cdeg?: number): number;
/**
* Converts two percents to ESD, then runs ESDCompare.
*/
export declare function PercentCompare(judgements: ESDJudgementFormat[], baseP: number, compareP: number, cdeg?: number): number;
-144
View File
@@ -1,144 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PercentCompare = exports.ESDCompare = exports.CalculateESD = void 0;
/**
* Cumulative Distribution Function
* https://en.wikipedia.org/wiki/Cumulative_distribution_function
*/
function cdf(x, mean, variance) {
return 0.5 * (1 + erf((x - mean) / Math.sqrt(2 * variance)));
}
/**
* Error Function
* https://en.wikipedia.org/wiki/Error_function
*/
function erf(x) {
// save the sign of x
const sign = x >= 0 ? 1 : -1;
x = Math.abs(x);
// constants
const a1 = 0.254829592;
const a2 = -0.284496736;
const a3 = 1.421413741;
const a4 = -1.453152027;
const a5 = 1.061405429;
const p = 0.3275911;
// A&S formula 7.1.26
const t = 1.0 / (1.0 + p * x);
const y = 1.0 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);
return sign * y; // erf(-x) = -erf(x);
}
function CDFBetween(lowBound, highBound, mean, variance) {
// Since the normal distribution is symmetrical, we want to double this, as the cut will only get one tail.
return 2 * (cdf(highBound, mean, variance) - cdf(lowBound, mean, variance));
}
// This is a direct port of ESD-JS to typescript. Maybe this should be released as its own module some day.
const MEAN = 0;
/**
* Gets the percent this score would roughly be, given a standard deviation.
* @param judgements - The judgements this game uses.
* @param stddev - The standard deviation to estimate the percent of.
* @param largestValue - The largest "value" of a judgement in this game. This lets us normalise results.
* @returns The percent this std. deviation would produce.
*/
function StdDeviationToPercent(judgements, stddev, largestValue) {
let lastJudgeMSBorder = 0;
let prbSum = 0;
for (let i = 0; i < judgements.length; i++) {
const judge = judgements[i];
const nVal = CDFBetween(lastJudgeMSBorder, judge.msBorder, MEAN, Math.pow(stddev, 2)) * judge.value;
lastJudgeMSBorder = judge.msBorder;
prbSum += nVal;
}
prbSum /= largestValue;
return prbSum;
}
const ACCEPTABLE_ERROR = 0.001;
const MAX_ITERATIONS = 50;
/**
* Given judgements and a percent, estimate the standard deviation needed to get a score
* with that percent.
* @param judgements - The judgements for this game.
* @param percent - The percent to estimate SD needed to get.
* @param errOnInaccuracy - Whether or whether not to throw if the estimate is not accurate enough.
* @returns
*/
function CalculateESD(judgements, percent, errOnInaccuracy = false) {
if (percent > 1 || percent < 0 || Number.isNaN(percent)) {
throw new Error("(ESD) Invalid percent. Percent must be between 0 and 1, and also a number.");
}
const largestValue = judgements.slice(0).sort((a, b) => b.value - a.value)[0].value;
// massive optimisation possible here by using better initial estimates with precalc'd table of values.
// until then, it's just kinda slow.
let minSD = 0;
let maxSD = 200;
let estSD = (minSD + maxSD) / 2;
// So, fundamentally the function that takes SD and returns estimated percent is NOT invertible.
// as in, it is very literally not invertible.
// if you figure it out, let me know.
// until then; we make MAX_ITERATIONS attempts at finding a value within the acceptable range of error.
// the defaults for these are 100 for iterations, and 0.001 for error.
// for most of what i've tested, this has been fine.
for (let i = 0; i < MAX_ITERATIONS; i++) {
const estimatedPercent = StdDeviationToPercent(judgements, estSD, largestValue);
if (Math.abs(estimatedPercent - percent) < ACCEPTABLE_ERROR) {
return estSD;
}
if (estimatedPercent < percent) {
maxSD = estSD;
}
else {
minSD = estSD;
}
if (estSD === (minSD + maxSD) / 2) {
// if it isn't moving, just terminate
break;
}
estSD = (minSD + maxSD) / 2;
}
if (errOnInaccuracy) {
throw `(ESD-JS) Did not reach value within MAX_ITERATIONS (${MAX_ITERATIONS})`;
}
return estSD;
}
exports.CalculateESD = CalculateESD;
/**
* Compares two ESD values such that 1->2 produces a larger value than 101->102.
* @param baseESD - The first ESD to compare.
* @param compareESD - The second ESD to compare.
* @param cdeg - The degrees of confidence to use. This should be 1.
* @returns A number between -100 and 100.
*/
function ESDCompare(baseESD, compareESD, cdeg = 1) {
const CONFIDENCE_DEGREE = cdeg;
const BASE_CASE = CDFBetween(-1 * CONFIDENCE_DEGREE, CONFIDENCE_DEGREE, 0, 1) / 2;
let inv = false;
let variance;
let bound;
if (compareESD > baseESD) {
inv = true;
variance = Math.pow(compareESD, 2);
bound = CONFIDENCE_DEGREE * baseESD;
}
else {
variance = Math.pow(baseESD, 2);
bound = CONFIDENCE_DEGREE * compareESD;
}
const esdc = CDFBetween(-1 * bound, bound, 0, variance) / 2;
let besdc = BASE_CASE - esdc;
if (inv) {
besdc *= -1;
}
return besdc * 100;
}
exports.ESDCompare = ESDCompare;
/**
* Converts two percents to ESD, then runs ESDCompare.
*/
function PercentCompare(judgements, baseP, compareP, cdeg = 1) {
const e1 = CalculateESD(judgements, baseP);
const e2 = CalculateESD(judgements, compareP);
return ESDCompare(e1, e2, cdeg);
}
exports.PercentCompare = PercentCompare;
//# sourceMappingURL=esd.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"esd.js","sourceRoot":"","sources":["../../src/lib/esd.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAS,GAAG,CAAC,CAAS,EAAE,IAAY,EAAE,QAAgB;IACrD,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,SAAS,GAAG,CAAC,CAAS;IACrB,qBAAqB;IACrB,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEhB,YAAY;IACZ,MAAM,EAAE,GAAG,WAAW,CAAC;IACvB,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC;IACxB,MAAM,EAAE,GAAG,WAAW,CAAC;IACvB,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC;IACxB,MAAM,EAAE,GAAG,WAAW,CAAC;IACvB,MAAM,CAAC,GAAG,SAAS,CAAC;IAEpB,qBAAqB;IACrB,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,G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AC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC;AATD,wCASC"}
-2
View File
@@ -1,2 +0,0 @@
import { Grades, integer } from "../types";
export declare function CalculateGradeDeltaIIDX(cmpGrade: Grades["iidx:SP" | "iidx:DP"], score: integer, notecount: integer): string;
-20
View File
@@ -1,20 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CalculateGradeDeltaIIDX = void 0;
const config_1 = require("../config/config");
const IIDXConfig = config_1.GetGamePTConfig("iidx", "SP");
function CalculateGradeDeltaIIDX(cmpGrade, score, notecount) {
const cmpGradeIDX = IIDXConfig.grades.indexOf(cmpGrade);
const cmpGradePercent = IIDXConfig.gradeBoundaries[cmpGradeIDX];
const cmpScore = Math.ceil(notecount * (cmpGradePercent / 100));
const delta = score - cmpScore;
if (delta >= 0) {
return `${cmpGrade}+${delta}`;
}
else {
// negative numbers implicitly stringify with the - prefix
return `${cmpGrade}${delta}`;
}
}
exports.CalculateGradeDeltaIIDX = CalculateGradeDeltaIIDX;
//# sourceMappingURL=util.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/lib/util.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AAGnD,MAAM,UAAU,GAAG,wBAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEjD,SAAgB,uBAAuB,CACtC,QAAuC,EACvC,KAAc,EACd,SAAkB;IAElB,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAExD,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAEhE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC,CAAC;IAEhE,MAAM,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAE/B,IAAI,KAAK,IAAI,CAAC,EAAE;QACf,OAAO,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;KAC9B;SAAM;QACN,0DAA0D;QAC1D,OAAO,GAAG,QAAQ,GAAG,KAAK,EAAE,CAAC;KAC7B;AACF,CAAC;AAnBD,0DAmBC"}
-1084
View File
File diff suppressed because it is too large Load Diff
-3
View File
@@ -1,3 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
-9
View File
@@ -1,9 +0,0 @@
import { AnyChartDocument, AnySongDocument, Game, Playtypes } from "..";
export declare function FormatDifficulty(chart: AnyChartDocument, game: Game): string;
/**
* Formats a chart's difficulty into a shorter variant. This handles a lot of
* game-specific strange edge cases.
*/
export declare function FormatDifficultyShort(chart: AnyChartDocument, game: Game): string;
export declare function FormatGame(game: Game, playtype: Playtypes[Game]): string;
export declare function FormatChart(game: Game, song: AnySongDocument, chart: AnyChartDocument): string;
-62
View File
@@ -1,62 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatChart = exports.FormatGame = exports.FormatDifficultyShort = exports.FormatDifficulty = void 0;
const config_1 = require("../config/config");
function FormatDifficulty(chart, game) {
const gameConfig = config_1.GetGameConfig(game);
if (game === "bms") {
return `${chart.playtype} ${chart.level}`;
}
if (gameConfig.validPlaytypes.length > 1) {
return `${chart.playtype} ${chart.difficulty} ${chart.level}`;
}
return `${chart.difficulty}`;
}
exports.FormatDifficulty = FormatDifficulty;
/**
* Formats a chart's difficulty into a shorter variant. This handles a lot of
* game-specific strange edge cases.
*/
function FormatDifficultyShort(chart, game) {
var _a;
const gameConfig = config_1.GetGameConfig(game);
const gptConfig = config_1.GetGamePTConfig(game, chart.playtype);
const shortDiff = (_a = gptConfig.shortDifficulties[chart.difficulty]) !== null && _a !== void 0 ? _a : chart.difficulty;
if (game === "bms") {
return `${chart.playtype} ${chart.level}`;
}
if (game === "ddr") {
return `${shortDiff}${chart.playtype}`;
}
if (gameConfig.validPlaytypes.length === 1 || game === "gitadora") {
return `${shortDiff} ${chart.level}`;
}
return `${chart.playtype}${shortDiff} ${chart.level}`;
}
exports.FormatDifficultyShort = FormatDifficultyShort;
function FormatGame(game, playtype) {
const gameConfig = config_1.GetGameConfig(game);
if (gameConfig.validPlaytypes.length === 1) {
return gameConfig.name;
}
return `${gameConfig.name} (${playtype})`;
}
exports.FormatGame = FormatGame;
function FormatChart(game, song, chart) {
if (game === "bms") {
return song.title;
}
const gameConfig = config_1.GetGameConfig(game);
let playtypeStr = `${chart.playtype} `;
if (gameConfig.validPlaytypes.length === 1) {
playtypeStr = "";
}
// return the most recent version this chart appeared in if it
// is not primary.
if (!chart.isPrimary) {
return `${song.title} (${playtypeStr}${chart.difficulty} ${chart.versions[0]})`;
}
return `${song.title} (${playtypeStr}${chart.difficulty})`;
}
exports.FormatChart = FormatChart;
//# sourceMappingURL=util.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":";;;AACA,6CAAkE;AAElE,SAAgB,gBAAgB,CAAC,KAAuB,EAAE,IAAU;IACnE,MAAM,UAAU,GAAG,sBAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,IAAI,KAAK,KAAK,EAAE;QACnB,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;KAC1C;IAED,IAAI,UAAU,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QACzC,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;KAC9D;IAED,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;AAC9B,CAAC;AAZD,4CAYC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,KAAuB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