ropegeo-common 1.9.4 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/api/getRopewikiPageView/ropewikiPageView.d.ts.map +1 -1
- package/dist/classes/api/getRopewikiPageView/ropewikiPageView.js +4 -2
- package/dist/classes/difficulty/acaDifficulty.d.ts +7 -6
- package/dist/classes/difficulty/acaDifficulty.d.ts.map +1 -1
- package/dist/classes/difficulty/acaDifficulty.js +18 -15
- package/dist/classes/filters/acaDifficultyFilterOptions.d.ts +2 -2
- package/dist/classes/filters/acaDifficultyFilterOptions.d.ts.map +1 -1
- package/dist/classes/filters/acaDifficultyFilterOptions.js +9 -6
- package/dist/classes/mobile/savedPage.js +1 -1
- package/dist/classes/previews/pagePreview.d.ts +1 -1
- package/dist/classes/previews/pagePreview.js +2 -2
- package/dist/classes/requestParams/acaDifficultyParams.d.ts +2 -2
- package/dist/classes/requestParams/acaDifficultyParams.d.ts.map +1 -1
- package/dist/classes/requestParams/acaDifficultyParams.js +9 -9
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ropewikiPageView.d.ts","sourceRoot":"","sources":["../../../../src/classes/api/getRopewikiPageView/ropewikiPageView.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,KAAK,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE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CAAC,MAAM,CAAC,iBAAiB;IAmBhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA+BjC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA+B/B,OAAO,CAAC,MAAM,CAAC,YAAY;IAgB3B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA2BhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAOnC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAkBtC,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAexC,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAczC"}
|
|
@@ -181,8 +181,10 @@ class RopewikiPageView {
|
|
|
181
181
|
if (d.time !== null && d.time !== undefined && typeof d.time !== 'string') {
|
|
182
182
|
throw new Error(`RopewikiPageView.${key}.time must be string or null`);
|
|
183
183
|
}
|
|
184
|
-
if (d.
|
|
185
|
-
|
|
184
|
+
if (d.additionalRisk !== null &&
|
|
185
|
+
d.additionalRisk !== undefined &&
|
|
186
|
+
typeof d.additionalRisk !== 'string') {
|
|
187
|
+
throw new Error(`RopewikiPageView.${key}.additionalRisk must be string or null`);
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
static assertPermit(obj, key) {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Difficulty, DifficultyType } from './difficulty';
|
|
2
2
|
import { AcaRiskRating, AcaTechnicalRating, AcaTimeRating, AcaWaterRating } from './acaRatings';
|
|
3
3
|
/**
|
|
4
|
-
* ACA canyon difficulty from DB strings. `
|
|
5
|
-
* applies the technical default floor when `
|
|
4
|
+
* ACA canyon difficulty from DB strings. `additionalRisk` is the raw stored value (`riskRating`
|
|
5
|
+
* column); `effectiveRisk` applies the technical default floor when `additionalRisk` is null or
|
|
6
|
+
* milder than that default.
|
|
6
7
|
*/
|
|
7
8
|
export declare class AcaDifficulty extends Difficulty {
|
|
8
9
|
readonly difficultyType = DifficultyType.ACA;
|
|
9
10
|
readonly technical: AcaTechnicalRating | null;
|
|
10
11
|
readonly water: AcaWaterRating | null;
|
|
11
12
|
readonly time: AcaTimeRating | null;
|
|
12
|
-
/** Raw risk from ropewiki (`riskRating` column), after enum parse; null if unset. */
|
|
13
|
-
readonly
|
|
13
|
+
/** Raw additional risk from ropewiki (`riskRating` column), after enum parse; null if unset. */
|
|
14
|
+
readonly additionalRisk: AcaRiskRating | null;
|
|
14
15
|
/** Risk used for display and sorting (never milder than the default implied by technical). */
|
|
15
16
|
readonly effectiveRisk: AcaRiskRating | null;
|
|
16
|
-
constructor(technicalRating: string | null | undefined, waterRating: string | null | undefined, timeRating: string | null | undefined,
|
|
17
|
+
constructor(technicalRating: string | null | undefined, waterRating: string | null | undefined, timeRating: string | null | undefined, additionalRiskRating: string | null | undefined);
|
|
17
18
|
getEffectiveRiskForDisplay(): AcaRiskRating | null;
|
|
18
19
|
private static assignParts;
|
|
19
20
|
private static defaultRiskFromTechnical;
|
|
@@ -21,7 +22,7 @@ export declare class AcaDifficulty extends Difficulty {
|
|
|
21
22
|
private static parseField;
|
|
22
23
|
/**
|
|
23
24
|
* Parses JSON/API objects: `difficultyType: 'ACA'` (optional when dispatched via
|
|
24
|
-
* {@link Difficulty.fromResult}), `technical`, `water`, `time`, `
|
|
25
|
+
* {@link Difficulty.fromResult}), `technical`, `water`, `time`, `additionalRisk` (raw), optional
|
|
25
26
|
* `effectiveRisk` override.
|
|
26
27
|
*/
|
|
27
28
|
static fromResult(result: unknown): AcaDifficulty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acaDifficulty.d.ts","sourceRoot":"","sources":["../../../src/classes/difficulty/acaDifficulty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAA4B,MAAM,cAAc,CAAC;AACpF,OAAO,EAEH,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,cAAc,EACjB,MAAM,cAAc,CAAC;AAUtB
|
|
1
|
+
{"version":3,"file":"acaDifficulty.d.ts","sourceRoot":"","sources":["../../../src/classes/difficulty/acaDifficulty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAA4B,MAAM,cAAc,CAAC;AACpF,OAAO,EAEH,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,cAAc,EACjB,MAAM,cAAc,CAAC;AAUtB;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,UAAU;IACzC,QAAQ,CAAC,cAAc,sBAAsB;IAE7C,QAAQ,CAAC,SAAS,EAAG,kBAAkB,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAG,cAAc,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAG,aAAa,GAAG,IAAI,CAAC;IACrC,gGAAgG;IAChG,QAAQ,CAAC,cAAc,EAAG,aAAa,GAAG,IAAI,CAAC;IAC/C,8FAA8F;IAC9F,QAAQ,CAAC,aAAa,EAAG,aAAa,GAAG,IAAI,CAAC;gBAG1C,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC1C,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAoCnD,0BAA0B,IAAI,aAAa,GAAG,IAAI;IAIlD,OAAO,CAAC,MAAM,CAAC,WAAW;IAU1B,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAcvC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAcnC,OAAO,CAAC,MAAM,CAAC,UAAU;IAezB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa;IAyCjD,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAOtC"}
|
|
@@ -4,23 +4,24 @@ exports.AcaDifficulty = void 0;
|
|
|
4
4
|
const difficulty_1 = require("./difficulty");
|
|
5
5
|
const acaRatings_1 = require("./acaRatings");
|
|
6
6
|
/**
|
|
7
|
-
* ACA canyon difficulty from DB strings. `
|
|
8
|
-
* applies the technical default floor when `
|
|
7
|
+
* ACA canyon difficulty from DB strings. `additionalRisk` is the raw stored value (`riskRating`
|
|
8
|
+
* column); `effectiveRisk` applies the technical default floor when `additionalRisk` is null or
|
|
9
|
+
* milder than that default.
|
|
9
10
|
*/
|
|
10
11
|
class AcaDifficulty extends difficulty_1.Difficulty {
|
|
11
|
-
constructor(technicalRating, waterRating, timeRating,
|
|
12
|
+
constructor(technicalRating, waterRating, timeRating, additionalRiskRating) {
|
|
12
13
|
super();
|
|
13
14
|
this.difficultyType = difficulty_1.DifficultyType.ACA;
|
|
14
15
|
const technical = AcaDifficulty.parseField(technicalRating, Object.values(acaRatings_1.AcaTechnicalRating), 'technical');
|
|
15
16
|
const water = AcaDifficulty.parseField(waterRating, Object.values(acaRatings_1.AcaWaterRating), 'water');
|
|
16
17
|
const time = AcaDifficulty.parseField(timeRating, Object.values(acaRatings_1.AcaTimeRating), 'time');
|
|
17
|
-
const
|
|
18
|
+
const parsedAdditionalRisk = AcaDifficulty.parseField(additionalRiskRating, Object.values(acaRatings_1.AcaRiskRating), 'additionalRisk');
|
|
18
19
|
const parts = {
|
|
19
20
|
technical,
|
|
20
21
|
water,
|
|
21
22
|
time,
|
|
22
|
-
|
|
23
|
-
effectiveRisk: AcaDifficulty.computeEffectiveRisk(
|
|
23
|
+
additionalRisk: parsedAdditionalRisk,
|
|
24
|
+
effectiveRisk: AcaDifficulty.computeEffectiveRisk(parsedAdditionalRisk, technical),
|
|
24
25
|
};
|
|
25
26
|
AcaDifficulty.assignParts(this, parts);
|
|
26
27
|
}
|
|
@@ -31,7 +32,8 @@ class AcaDifficulty extends difficulty_1.Difficulty {
|
|
|
31
32
|
target.technical = parts.technical;
|
|
32
33
|
target.water = parts.water;
|
|
33
34
|
target.time = parts.time;
|
|
34
|
-
target.
|
|
35
|
+
target.additionalRisk =
|
|
36
|
+
parts.additionalRisk;
|
|
35
37
|
target.effectiveRisk =
|
|
36
38
|
parts.effectiveRisk;
|
|
37
39
|
}
|
|
@@ -46,12 +48,13 @@ class AcaDifficulty extends difficulty_1.Difficulty {
|
|
|
46
48
|
}
|
|
47
49
|
return null;
|
|
48
50
|
}
|
|
49
|
-
static computeEffectiveRisk(
|
|
51
|
+
static computeEffectiveRisk(additionalRisk, technical) {
|
|
50
52
|
const defaultRisk = AcaDifficulty.defaultRiskFromTechnical(technical);
|
|
51
|
-
if (
|
|
52
|
-
return defaultRisk != null &&
|
|
53
|
+
if (additionalRisk != null) {
|
|
54
|
+
return defaultRisk != null &&
|
|
55
|
+
acaRatings_1.ACA_RISK_ORDER[additionalRisk] < acaRatings_1.ACA_RISK_ORDER[defaultRisk]
|
|
53
56
|
? defaultRisk
|
|
54
|
-
:
|
|
57
|
+
: additionalRisk;
|
|
55
58
|
}
|
|
56
59
|
return defaultRisk;
|
|
57
60
|
}
|
|
@@ -66,7 +69,7 @@ class AcaDifficulty extends difficulty_1.Difficulty {
|
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
68
71
|
* Parses JSON/API objects: `difficultyType: 'ACA'` (optional when dispatched via
|
|
69
|
-
* {@link Difficulty.fromResult}), `technical`, `water`, `time`, `
|
|
72
|
+
* {@link Difficulty.fromResult}), `technical`, `water`, `time`, `additionalRisk` (raw), optional
|
|
70
73
|
* `effectiveRisk` override.
|
|
71
74
|
*/
|
|
72
75
|
static fromResult(result) {
|
|
@@ -84,15 +87,15 @@ class AcaDifficulty extends difficulty_1.Difficulty {
|
|
|
84
87
|
const tech = AcaDifficulty.coerceOptionalString(r.technical ?? r.Technical);
|
|
85
88
|
const water = AcaDifficulty.coerceOptionalString(r.water ?? r.Water);
|
|
86
89
|
const time = AcaDifficulty.coerceOptionalString(r.time ?? r.Time);
|
|
87
|
-
const
|
|
90
|
+
const additionalRiskRaw = AcaDifficulty.coerceOptionalString(r.additionalRisk ?? r.AdditionalRisk);
|
|
88
91
|
const effectiveRaw = AcaDifficulty.coerceOptionalString(r.effectiveRisk ?? r.EffectiveRisk);
|
|
89
92
|
if (effectiveRaw !== null) {
|
|
90
|
-
const inst = new AcaDifficulty(tech, water, time,
|
|
93
|
+
const inst = new AcaDifficulty(tech, water, time, additionalRiskRaw);
|
|
91
94
|
const effParsed = AcaDifficulty.parseField(effectiveRaw, Object.values(acaRatings_1.AcaRiskRating), 'effectiveRisk');
|
|
92
95
|
inst.effectiveRisk = effParsed;
|
|
93
96
|
return inst;
|
|
94
97
|
}
|
|
95
|
-
return new AcaDifficulty(tech, water, time,
|
|
98
|
+
return new AcaDifficulty(tech, water, time, additionalRiskRaw);
|
|
96
99
|
}
|
|
97
100
|
static coerceOptionalString(v) {
|
|
98
101
|
if (v === undefined || v === null || v === '')
|
|
@@ -27,8 +27,8 @@ export declare class AcaDifficultyFilterOptions extends DifficultyFilterOptions
|
|
|
27
27
|
readonly technical: TechnicalMinMax;
|
|
28
28
|
readonly water: WaterMinMax;
|
|
29
29
|
readonly time: TimeMinMax;
|
|
30
|
-
readonly
|
|
31
|
-
constructor(technical: TechnicalMinMax, water: WaterMinMax, time: TimeMinMax,
|
|
30
|
+
readonly effectiveRisk: RiskMinMax;
|
|
31
|
+
constructor(technical: TechnicalMinMax, water: WaterMinMax, time: TimeMinMax, effectiveRisk: RiskMinMax);
|
|
32
32
|
toDifficultyParams(): AcaDifficultyParams;
|
|
33
33
|
toJSON(): Record<string, unknown>;
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acaDifficultyFilterOptions.d.ts","sourceRoot":"","sources":["../../../src/classes/filters/acaDifficultyFilterOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,cAAc,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAyC,MAAM,2BAA2B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE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16 @@ class RiskMinMax {
|
|
|
60
60
|
}
|
|
61
61
|
exports.RiskMinMax = RiskMinMax;
|
|
62
62
|
class AcaDifficultyFilterOptions extends difficultyFilterOptions_1.DifficultyFilterOptions {
|
|
63
|
-
constructor(technical, water, time,
|
|
63
|
+
constructor(technical, water, time, effectiveRisk) {
|
|
64
64
|
super();
|
|
65
65
|
this.difficultyType = difficulty_1.DifficultyType.ACA;
|
|
66
66
|
this.technical = technical;
|
|
67
67
|
this.water = water;
|
|
68
68
|
this.time = time;
|
|
69
|
-
this.
|
|
69
|
+
this.effectiveRisk = effectiveRisk;
|
|
70
70
|
}
|
|
71
71
|
toDifficultyParams() {
|
|
72
|
-
return new acaDifficultyParams_1.AcaDifficultyParams(expandInclusive(this.technical.min, this.technical.max, TECHNICAL_ORDERED, acaRatings_1.ACA_TECHNICAL_ORDER), expandInclusive(this.water.min, this.water.max, WATER_ORDERED, acaRatings_1.ACA_WATER_ORDER), expandInclusive(this.time.min, this.time.max, TIME_ORDERED, acaRatings_1.ACA_TIME_ORDER), expandInclusive(this.
|
|
72
|
+
return new acaDifficultyParams_1.AcaDifficultyParams(expandInclusive(this.technical.min, this.technical.max, TECHNICAL_ORDERED, acaRatings_1.ACA_TECHNICAL_ORDER), expandInclusive(this.water.min, this.water.max, WATER_ORDERED, acaRatings_1.ACA_WATER_ORDER), expandInclusive(this.time.min, this.time.max, TIME_ORDERED, acaRatings_1.ACA_TIME_ORDER), expandInclusive(this.effectiveRisk.min, this.effectiveRisk.max, RISK_ORDERED, acaRatings_1.ACA_RISK_ORDER));
|
|
73
73
|
}
|
|
74
74
|
toJSON() {
|
|
75
75
|
return {
|
|
@@ -77,7 +77,10 @@ class AcaDifficultyFilterOptions extends difficultyFilterOptions_1.DifficultyFil
|
|
|
77
77
|
technical: { min: this.technical.min, max: this.technical.max },
|
|
78
78
|
water: { min: this.water.min, max: this.water.max },
|
|
79
79
|
time: { min: this.time.min, max: this.time.max },
|
|
80
|
-
|
|
80
|
+
effectiveRisk: {
|
|
81
|
+
min: this.effectiveRisk.min,
|
|
82
|
+
max: this.effectiveRisk.max,
|
|
83
|
+
},
|
|
81
84
|
};
|
|
82
85
|
}
|
|
83
86
|
/**
|
|
@@ -99,8 +102,8 @@ class AcaDifficultyFilterOptions extends difficultyFilterOptions_1.DifficultyFil
|
|
|
99
102
|
const tech = r.technical;
|
|
100
103
|
const water = r.water;
|
|
101
104
|
const time = r.time;
|
|
102
|
-
const
|
|
103
|
-
return new AcaDifficultyFilterOptions(new TechnicalMinMax(tech.min, tech.max), new WaterMinMax(water.min, water.max), new TimeMinMax(time.min, time.max), new RiskMinMax(
|
|
105
|
+
const riskRec = r.effectiveRisk;
|
|
106
|
+
return new AcaDifficultyFilterOptions(new TechnicalMinMax(tech.min, tech.max), new WaterMinMax(water.min, water.max), new TimeMinMax(time.min, time.max), new RiskMinMax(riskRec.min, riskRec.max));
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
exports.AcaDifficultyFilterOptions = AcaDifficultyFilterOptions;
|
|
@@ -25,7 +25,7 @@ function pagePreviewToPlain(p) {
|
|
|
25
25
|
technical: p.difficulty.technical,
|
|
26
26
|
water: p.difficulty.water,
|
|
27
27
|
time: p.difficulty.time,
|
|
28
|
-
|
|
28
|
+
additionalRisk: p.difficulty.additionalRisk,
|
|
29
29
|
effectiveRisk: p.difficulty.effectiveRisk,
|
|
30
30
|
}
|
|
31
31
|
: {
|
|
@@ -60,7 +60,7 @@ export declare class PagePreview extends Preview {
|
|
|
60
60
|
static fromDbRow(row: GetRopewikiPagePreviewRow, mapData: string | null, regions?: string[], aka?: string[]): PagePreview;
|
|
61
61
|
/**
|
|
62
62
|
* Validates result has page preview fields and applies PagePreview.prototype.
|
|
63
|
-
* Expects difficulty as plain object with technical, water, time,
|
|
63
|
+
* Expects difficulty as plain object with technical, water, time, additionalRisk (optional).
|
|
64
64
|
*/
|
|
65
65
|
static fromResult(result: unknown): PagePreview;
|
|
66
66
|
private static assertString;
|
|
@@ -38,7 +38,7 @@ class PagePreview extends preview_1.Preview {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Validates result has page preview fields and applies PagePreview.prototype.
|
|
41
|
-
* Expects difficulty as plain object with technical, water, time,
|
|
41
|
+
* Expects difficulty as plain object with technical, water, time, additionalRisk (optional).
|
|
42
42
|
*/
|
|
43
43
|
static fromResult(result) {
|
|
44
44
|
if (result == null || typeof result !== 'object') {
|
|
@@ -110,7 +110,7 @@ class PagePreview extends preview_1.Preview {
|
|
|
110
110
|
strOrNull(d.technical, 'technical');
|
|
111
111
|
strOrNull(d.water, 'water');
|
|
112
112
|
strOrNull(d.time, 'time');
|
|
113
|
-
strOrNull(d.
|
|
113
|
+
strOrNull(d.additionalRisk, 'additionalRisk');
|
|
114
114
|
strOrNull(d.effectiveRisk, 'effectiveRisk');
|
|
115
115
|
const dtype = d.difficultyType ?? d.DifficultyType;
|
|
116
116
|
if (dtype !== undefined &&
|
|
@@ -11,8 +11,8 @@ export declare class AcaDifficultyParams extends DifficultyParams {
|
|
|
11
11
|
readonly technical: AcaTechnicalRating[];
|
|
12
12
|
readonly water: AcaWaterRating[];
|
|
13
13
|
readonly time: AcaTimeRating[];
|
|
14
|
-
readonly
|
|
15
|
-
constructor(technical: AcaTechnicalRating[], water: AcaWaterRating[], time: AcaTimeRating[],
|
|
14
|
+
readonly effectiveRisk: AcaRiskRating[];
|
|
15
|
+
constructor(technical: AcaTechnicalRating[], water: AcaWaterRating[], time: AcaTimeRating[], effectiveRisk: AcaRiskRating[]);
|
|
16
16
|
isActive(): boolean;
|
|
17
17
|
toQueryString(): string;
|
|
18
18
|
static fromQueryStringParams(q: DifficultyParamsQueryRecord): AcaDifficultyParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acaDifficultyParams.d.ts","sourceRoot":"","sources":["../../../src/classes/requestParams/acaDifficultyParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,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AAkB,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC;gBAGpC,SAAS,EAAE,kBAAkB,EAAE,EAC/B,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,EAAE,aAAa,EAAE,EACrB,aAAa,EAAE,aAAa,EAAE;IASlC,QAAQ,IAAI,OAAO;IASnB,aAAa,IAAI,MAAM;IAwBvB,MAAM,CAAC,qBAAqB,CACxB,CAAC,EAAE,2BAA2B,GAC/B,mBAAmB;IAwBtB,OAAO,CAAC,MAAM,CAAC,cAAc;IAW7B,uFAAuF;IACvF,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,mBAAmB;IAgCpE,kEAAkE;IAClE,MAAM,CAAC,cAAc,CACjB,MAAM,EAAE,mBAAmB,GAAG,IAAI,GACnC,mBAAmB,GAAG,IAAI;CAIhC"}
|
|
@@ -43,19 +43,19 @@ function acaAxisKeysPresent(q) {
|
|
|
43
43
|
(q[exports.Q_ACA_RISK] ?? '').trim() !== '');
|
|
44
44
|
}
|
|
45
45
|
class AcaDifficultyParams extends difficultyParams_1.DifficultyParams {
|
|
46
|
-
constructor(technical, water, time,
|
|
46
|
+
constructor(technical, water, time, effectiveRisk) {
|
|
47
47
|
super();
|
|
48
48
|
this.difficultyType = difficulty_1.DifficultyType.ACA;
|
|
49
49
|
this.technical = [...technical];
|
|
50
50
|
this.water = [...water];
|
|
51
51
|
this.time = [...time];
|
|
52
|
-
this.
|
|
52
|
+
this.effectiveRisk = [...effectiveRisk];
|
|
53
53
|
}
|
|
54
54
|
isActive() {
|
|
55
55
|
return (this.technical.length > 0 ||
|
|
56
56
|
this.water.length > 0 ||
|
|
57
57
|
this.time.length > 0 ||
|
|
58
|
-
this.
|
|
58
|
+
this.effectiveRisk.length > 0);
|
|
59
59
|
}
|
|
60
60
|
toQueryString() {
|
|
61
61
|
const p = new URLSearchParams();
|
|
@@ -69,8 +69,8 @@ class AcaDifficultyParams extends difficultyParams_1.DifficultyParams {
|
|
|
69
69
|
if (this.time.length > 0) {
|
|
70
70
|
p.set(exports.Q_ACA_TIME, this.time.map((x) => x.toLowerCase()).join('|'));
|
|
71
71
|
}
|
|
72
|
-
if (this.
|
|
73
|
-
p.set(exports.Q_ACA_RISK, this.
|
|
72
|
+
if (this.effectiveRisk.length > 0) {
|
|
73
|
+
p.set(exports.Q_ACA_RISK, this.effectiveRisk.map((x) => x.toLowerCase()).join('|'));
|
|
74
74
|
}
|
|
75
75
|
return p.toString();
|
|
76
76
|
}
|
|
@@ -78,8 +78,8 @@ class AcaDifficultyParams extends difficultyParams_1.DifficultyParams {
|
|
|
78
78
|
const technical = parseEnumTokens(q[exports.Q_ACA_TECHNICAL] ?? q['Aca-Technical-Rating'], Object.values(acaRatings_1.AcaTechnicalRating), 'aca-technical-rating');
|
|
79
79
|
const water = parseEnumTokens(q[exports.Q_ACA_WATER] ?? q['Aca-Water-Rating'], Object.values(acaRatings_1.AcaWaterRating), 'aca-water-rating');
|
|
80
80
|
const time = parseEnumTokens(q[exports.Q_ACA_TIME] ?? q['Aca-Time-Rating'], Object.values(acaRatings_1.AcaTimeRating), 'aca-time-rating');
|
|
81
|
-
const
|
|
82
|
-
return new AcaDifficultyParams(technical, water, time,
|
|
81
|
+
const effectiveRisk = parseEnumTokens(q[exports.Q_ACA_RISK] ?? q['Aca-Risk-Rating'], Object.values(acaRatings_1.AcaRiskRating), 'aca-risk-rating');
|
|
82
|
+
return new AcaDifficultyParams(technical, water, time, effectiveRisk);
|
|
83
83
|
}
|
|
84
84
|
static optionalString(obj, ...keys) {
|
|
85
85
|
for (const k of keys) {
|
|
@@ -94,8 +94,8 @@ class AcaDifficultyParams extends difficultyParams_1.DifficultyParams {
|
|
|
94
94
|
const technical = parseEnumTokens(AcaDifficultyParams.optionalString(obj, exports.Q_ACA_TECHNICAL, 'Aca-Technical-Rating'), Object.values(acaRatings_1.AcaTechnicalRating), 'aca-technical-rating');
|
|
95
95
|
const water = parseEnumTokens(AcaDifficultyParams.optionalString(obj, exports.Q_ACA_WATER, 'Aca-Water-Rating'), Object.values(acaRatings_1.AcaWaterRating), 'aca-water-rating');
|
|
96
96
|
const time = parseEnumTokens(AcaDifficultyParams.optionalString(obj, exports.Q_ACA_TIME, 'Aca-Time-Rating'), Object.values(acaRatings_1.AcaTimeRating), 'aca-time-rating');
|
|
97
|
-
const
|
|
98
|
-
return new AcaDifficultyParams(technical, water, time,
|
|
97
|
+
const effectiveRisk = parseEnumTokens(AcaDifficultyParams.optionalString(obj, exports.Q_ACA_RISK, 'Aca-Risk-Rating'), Object.values(acaRatings_1.AcaRiskRating), 'aca-risk-rating');
|
|
98
|
+
return new AcaDifficultyParams(technical, water, time, effectiveRisk);
|
|
99
99
|
}
|
|
100
100
|
/** Returns null if every axis is empty (no difficulty filter). */
|
|
101
101
|
static normalizeEmpty(params) {
|