@casomoltd/nhs-pay 0.19.4 → 0.20.0
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/README.md +69 -5
- package/dist/afc-scales.d.ts +14 -7
- package/dist/afc-scales.js +19 -19
- package/dist/afc-scales.js.map +1 -1
- package/dist/bands.d.ts +2 -2
- package/dist/commutation.d.ts +49 -5
- package/dist/commutation.js +124 -43
- package/dist/commutation.js.map +1 -1
- package/dist/dates.d.ts +2 -0
- package/dist/dates.js +4 -0
- package/dist/dates.js.map +1 -1
- package/dist/errors.d.ts +70 -12
- package/dist/errors.js +85 -19
- package/dist/errors.js.map +1 -1
- package/dist/factor-basis.d.ts +87 -0
- package/dist/factor-basis.js +99 -0
- package/dist/factor-basis.js.map +1 -0
- package/dist/gad/erf-1-401-2023-06-30.d.ts +47 -0
- package/dist/gad/erf-1-401-2023-06-30.js +73 -0
- package/dist/gad/erf-1-401-2023-06-30.js.map +1 -0
- package/dist/gad/erf-1-402-2023-06-30.d.ts +48 -0
- package/dist/gad/erf-1-402-2023-06-30.js +84 -0
- package/dist/gad/erf-1-402-2023-06-30.js.map +1 -0
- package/dist/gad/erf-1-407-2023-06-30.d.ts +47 -0
- package/dist/gad/erf-1-407-2023-06-30.js +73 -0
- package/dist/gad/erf-1-407-2023-06-30.js.map +1 -0
- package/dist/gad/erf-2023-06-30.d.ts +3 -0
- package/dist/gad/erf-2023-06-30.js +1 -0
- package/dist/gad/erf-2023-06-30.js.map +1 -1
- package/dist/gad/factor-table.d.ts +62 -31
- package/dist/gad/factor-table.js +67 -34
- package/dist/gad/factor-table.js.map +1 -1
- package/dist/gad/lrf-2-416-2023-06-30.d.ts +46 -0
- package/dist/gad/lrf-2-416-2023-06-30.js +72 -0
- package/dist/gad/lrf-2-416-2023-06-30.js.map +1 -0
- package/dist/gad/lrf-2023-06-30.d.ts +3 -0
- package/dist/gad/lrf-2023-06-30.js +1 -0
- package/dist/gad/lrf-2023-06-30.js.map +1 -1
- package/dist/gad/promotional-scale-2020.d.ts +37 -0
- package/dist/gad/promotional-scale-2020.js +38 -0
- package/dist/gad/promotional-scale-2020.js.map +1 -0
- package/dist/index.d.ts +16 -3
- package/dist/index.js +21 -12
- package/dist/index.js.map +1 -1
- package/dist/iso-date.d.ts +7 -0
- package/dist/iso-date.js +11 -0
- package/dist/iso-date.js.map +1 -1
- package/dist/member-benefits.d.ts +237 -0
- package/dist/member-benefits.js +440 -0
- package/dist/member-benefits.js.map +1 -0
- package/dist/pay-path.d.ts +70 -0
- package/dist/pay-path.js +155 -0
- package/dist/pay-path.js.map +1 -0
- package/dist/pension/curve.d.ts +74 -0
- package/dist/pension/curve.js +134 -0
- package/dist/pension/curve.js.map +1 -0
- package/dist/pension/history.js +3 -3
- package/dist/pension/history.js.map +1 -1
- package/dist/pension/ledger.d.ts +71 -31
- package/dist/pension/ledger.js +41 -6
- package/dist/pension/ledger.js.map +1 -1
- package/dist/pension/money.d.ts +23 -6
- package/dist/pension/money.js +23 -1
- package/dist/pension/money.js.map +1 -1
- package/dist/pension/uplift.d.ts +23 -0
- package/dist/pension/uplift.js +34 -1
- package/dist/pension/uplift.js.map +1 -1
- package/dist/pension-projection.d.ts +25 -31
- package/dist/pension-projection.js +40 -197
- package/dist/pension-projection.js.map +1 -1
- package/dist/scale-point.d.ts +11 -1
- package/dist/scales.d.ts +9 -9
- package/dist/scales.js +68 -67
- package/dist/scales.js.map +1 -1
- package/dist/sections/final-salary.d.ts +97 -0
- package/dist/sections/final-salary.js +99 -0
- package/dist/sections/final-salary.js.map +1 -0
- package/dist/sections/section-1995.d.ts +20 -0
- package/dist/sections/section-1995.js +52 -0
- package/dist/sections/section-1995.js.map +1 -0
- package/dist/sections/section-2008.d.ts +16 -0
- package/dist/sections/section-2008.js +44 -0
- package/dist/sections/section-2008.js.map +1 -0
- package/dist/sections/section-2015.d.ts +43 -0
- package/dist/sections/section-2015.js +57 -0
- package/dist/sections/section-2015.js.map +1 -0
- package/dist/values.d.ts +4 -5
- package/dist/values.js +4 -5
- package/dist/values.js.map +1 -1
- package/package.json +5 -3
package/dist/errors.d.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fail-loud machinery.
|
|
3
|
-
* - Errors
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Fail-loud machinery. Three kinds, kept together:
|
|
3
|
+
* - Errors a caller catches by type, part of the API contract: data
|
|
4
|
+
* the library does not publish ({@link ScaleUnavailable} and
|
|
5
|
+
* siblings — never silently substitute another year's or nation's
|
|
6
|
+
* figures), a member it cannot build pay for
|
|
7
|
+
* ({@link PayPathUnavailable}), and service it does not model
|
|
8
|
+
* ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
|
|
9
|
+
* code).
|
|
10
|
+
* - RangeError, thrown where a caller's input cannot be true.
|
|
6
11
|
* - {@link invariant} — an internal consistency guard. Its failure
|
|
7
12
|
* is a library bug, not an input problem, so no caller catches it;
|
|
8
13
|
* it throws a bare Error to fail loud in tests and pages.
|
|
9
14
|
*/
|
|
10
15
|
import type { Nation, PayYear, TaxYear } from '@casomoltd/paye-calc';
|
|
16
|
+
import type { FactorProvenance, FactorTableIndex } from './gad/factor-table.js';
|
|
17
|
+
/** A span, or an age, to the month: how a GAD table is keyed. */
|
|
18
|
+
interface YearsMonths {
|
|
19
|
+
readonly years: number;
|
|
20
|
+
readonly months: number;
|
|
21
|
+
}
|
|
11
22
|
/**
|
|
12
23
|
* Assert a domain invariant that must ALWAYS hold. Throws a bare
|
|
13
24
|
* Error when `condition` is false. Unlike the absent-data errors
|
|
@@ -54,22 +65,36 @@ export declare class PensionTiersUnavailable extends Error {
|
|
|
54
65
|
constructor(year: TaxYear, nation: Nation);
|
|
55
66
|
}
|
|
56
67
|
/**
|
|
57
|
-
* Thrown when a
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
68
|
+
* Thrown when a drawing falls outside the printed GAD factor table —
|
|
69
|
+
* e.g. more than 13y0m early under 0-420, or an age below 50 on 1-401.
|
|
70
|
+
* Sibling of {@link ScaleUnavailable}: the factor genuinely isn't
|
|
71
|
+
* published, so callers with free date inputs catch it by type rather
|
|
72
|
+
* than matching message text.
|
|
73
|
+
*
|
|
74
|
+
* `tableRef` names the table; `guidanceRef` alone does not, because the
|
|
75
|
+
* guidance numbers each scheme's tables from 1 and so `ERF1` is both
|
|
76
|
+
* 0-420 and 1-401. `years`, `months` and the bounds are a PERIOD from
|
|
77
|
+
* the pension age on a period table and the member's AGE on an age
|
|
78
|
+
* table, which `keyedBy` says.
|
|
62
79
|
*/
|
|
63
80
|
export declare class RetirementFactorOutOfRange extends Error {
|
|
64
81
|
/** Table name in the governing guidance, e.g. 'ERF1' */
|
|
65
82
|
readonly guidanceRef: string;
|
|
83
|
+
/** GAD's table reference, e.g. '0-420': unique, where
|
|
84
|
+
* `guidanceRef` is not. */
|
|
85
|
+
readonly tableRef: string;
|
|
86
|
+
readonly keyedBy: FactorTableIndex;
|
|
66
87
|
readonly years: number;
|
|
67
88
|
readonly months: number;
|
|
68
89
|
readonly maxYears: number;
|
|
69
90
|
readonly maxMonths: number;
|
|
70
|
-
constructor(
|
|
71
|
-
|
|
72
|
-
|
|
91
|
+
constructor({ provenance, index, at, max }: {
|
|
92
|
+
readonly provenance: FactorProvenance;
|
|
93
|
+
readonly index: FactorTableIndex;
|
|
94
|
+
/** Where the drawing fell, and the furthest the table prints. */
|
|
95
|
+
readonly at: YearsMonths;
|
|
96
|
+
readonly max: YearsMonths;
|
|
97
|
+
});
|
|
73
98
|
}
|
|
74
99
|
/**
|
|
75
100
|
* Thrown when no AfC pay award (consolidated % uplift) is recorded
|
|
@@ -100,3 +125,36 @@ export declare class AmbiguousScalePoint extends Error {
|
|
|
100
125
|
readonly matches: number;
|
|
101
126
|
constructor(grade: string, pointLabel: string, matches: number);
|
|
102
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* There is nothing to build a member's pay from: no usable current
|
|
130
|
+
* pay. Every year the pay path reconstructs or projects is scaled from
|
|
131
|
+
* that one figure, so without it there is no figure to scale, and any
|
|
132
|
+
* substitute would be a guess presented as the member's pay.
|
|
133
|
+
*/
|
|
134
|
+
export declare class PayPathUnavailable extends Error {
|
|
135
|
+
readonly reason: string;
|
|
136
|
+
constructor(reason: string);
|
|
137
|
+
}
|
|
138
|
+
/** What {@link BenefitNotModelled} refuses, as a closed set a
|
|
139
|
+
* consumer can branch on. Each is deferred, and each names the issue
|
|
140
|
+
* that carries what a build would take. */
|
|
141
|
+
export declare const NOT_MODELLED: {
|
|
142
|
+
readonly breakInService: "break-in-service";
|
|
143
|
+
readonly bothLegacySections: "both-legacy-sections";
|
|
144
|
+
readonly no2015Section: "no-2015-section";
|
|
145
|
+
readonly remedyMemberLeftEarly: "remedy-member-left-before-2022";
|
|
146
|
+
readonly statementBeforeRollback: "statement-before-rollback";
|
|
147
|
+
readonly preservedDrawnEarly: "preserved-benefits-drawn-early";
|
|
148
|
+
};
|
|
149
|
+
export type NotModelled = (typeof NOT_MODELLED)[keyof typeof NOT_MODELLED];
|
|
150
|
+
/**
|
|
151
|
+
* A benefit the library can name but has not modelled, refused rather
|
|
152
|
+
* than priced on an assumption nobody would see. `code` says which, so
|
|
153
|
+
* a consumer can tell a member what cannot yet be answered instead of
|
|
154
|
+
* showing a figure that answers something else.
|
|
155
|
+
*/
|
|
156
|
+
export declare class BenefitNotModelled extends Error {
|
|
157
|
+
readonly code: NotModelled;
|
|
158
|
+
constructor(code: NotModelled, detail: string);
|
|
159
|
+
}
|
|
160
|
+
export {};
|
package/dist/errors.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fail-loud machinery.
|
|
3
|
-
* - Errors
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Fail-loud machinery. Three kinds, kept together:
|
|
3
|
+
* - Errors a caller catches by type, part of the API contract: data
|
|
4
|
+
* the library does not publish ({@link ScaleUnavailable} and
|
|
5
|
+
* siblings — never silently substitute another year's or nation's
|
|
6
|
+
* figures), a member it cannot build pay for
|
|
7
|
+
* ({@link PayPathUnavailable}), and service it does not model
|
|
8
|
+
* ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
|
|
9
|
+
* code).
|
|
10
|
+
* - RangeError, thrown where a caller's input cannot be true.
|
|
6
11
|
* - {@link invariant} — an internal consistency guard. Its failure
|
|
7
12
|
* is a library bug, not an input problem, so no caller catches it;
|
|
8
13
|
* it throws a bare Error to fail loud in tests and pages.
|
|
@@ -65,29 +70,45 @@ export class PensionTiersUnavailable extends Error {
|
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
68
|
-
* Thrown when a
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
+
* Thrown when a drawing falls outside the printed GAD factor table —
|
|
74
|
+
* e.g. more than 13y0m early under 0-420, or an age below 50 on 1-401.
|
|
75
|
+
* Sibling of {@link ScaleUnavailable}: the factor genuinely isn't
|
|
76
|
+
* published, so callers with free date inputs catch it by type rather
|
|
77
|
+
* than matching message text.
|
|
78
|
+
*
|
|
79
|
+
* `tableRef` names the table; `guidanceRef` alone does not, because the
|
|
80
|
+
* guidance numbers each scheme's tables from 1 and so `ERF1` is both
|
|
81
|
+
* 0-420 and 1-401. `years`, `months` and the bounds are a PERIOD from
|
|
82
|
+
* the pension age on a period table and the member's AGE on an age
|
|
83
|
+
* table, which `keyedBy` says.
|
|
73
84
|
*/
|
|
74
85
|
export class RetirementFactorOutOfRange extends Error {
|
|
86
|
+
/** Table name in the governing guidance, e.g. 'ERF1' */
|
|
75
87
|
guidanceRef;
|
|
88
|
+
/** GAD's table reference, e.g. '0-420': unique, where
|
|
89
|
+
* `guidanceRef` is not. */
|
|
90
|
+
tableRef;
|
|
91
|
+
keyedBy;
|
|
76
92
|
years;
|
|
77
93
|
months;
|
|
78
94
|
maxYears;
|
|
79
95
|
maxMonths;
|
|
80
|
-
constructor(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.maxYears = maxYears;
|
|
89
|
-
this.maxMonths = maxMonths;
|
|
96
|
+
constructor({ provenance, index, at, max }) {
|
|
97
|
+
const { tableRef, guidanceRef } = provenance;
|
|
98
|
+
super(index.by === 'period'
|
|
99
|
+
? `${tableRef} (${guidanceRef}) out of range: ${at.years}yr `
|
|
100
|
+
+ `${at.months}mo (max ${max.years}yr ${max.months}mo)`
|
|
101
|
+
: `${tableRef} (${guidanceRef}): age ${at.years}yr ${at.months}mo `
|
|
102
|
+
+ `is outside ${index.firstAge}yr 0mo to `
|
|
103
|
+
+ `${max.years}yr ${max.months}mo`);
|
|
90
104
|
this.name = 'RetirementFactorOutOfRange';
|
|
105
|
+
this.guidanceRef = guidanceRef;
|
|
106
|
+
this.tableRef = tableRef;
|
|
107
|
+
this.keyedBy = index;
|
|
108
|
+
this.years = at.years;
|
|
109
|
+
this.months = at.months;
|
|
110
|
+
this.maxYears = max.years;
|
|
111
|
+
this.maxMonths = max.months;
|
|
91
112
|
}
|
|
92
113
|
}
|
|
93
114
|
/**
|
|
@@ -142,4 +163,49 @@ export class AmbiguousScalePoint extends Error {
|
|
|
142
163
|
this.name = 'AmbiguousScalePoint';
|
|
143
164
|
}
|
|
144
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* There is nothing to build a member's pay from: no usable current
|
|
168
|
+
* pay. Every year the pay path reconstructs or projects is scaled from
|
|
169
|
+
* that one figure, so without it there is no figure to scale, and any
|
|
170
|
+
* substitute would be a guess presented as the member's pay.
|
|
171
|
+
*/
|
|
172
|
+
export class PayPathUnavailable extends Error {
|
|
173
|
+
reason;
|
|
174
|
+
constructor(reason) {
|
|
175
|
+
super(`No pay path can be built: ${reason}`);
|
|
176
|
+
this.reason = reason;
|
|
177
|
+
this.name = 'PayPathUnavailable';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/** What {@link BenefitNotModelled} refuses, as a closed set a
|
|
181
|
+
* consumer can branch on. Each is deferred, and each names the issue
|
|
182
|
+
* that carries what a build would take. */
|
|
183
|
+
export const NOT_MODELLED = {
|
|
184
|
+
// https://github.com/casomoltd/nhs-pay/issues/16
|
|
185
|
+
breakInService: 'break-in-service',
|
|
186
|
+
// https://github.com/casomoltd/nhs-pay/issues/16
|
|
187
|
+
bothLegacySections: 'both-legacy-sections',
|
|
188
|
+
// https://github.com/casomoltd/nhs-pay/issues/19
|
|
189
|
+
no2015Section: 'no-2015-section',
|
|
190
|
+
// https://github.com/casomoltd/nhs-pay/issues/19
|
|
191
|
+
remedyMemberLeftEarly: 'remedy-member-left-before-2022',
|
|
192
|
+
// https://github.com/casomoltd/nhs-pay/issues/20
|
|
193
|
+
statementBeforeRollback: 'statement-before-rollback',
|
|
194
|
+
// https://github.com/casomoltd/nhs-pay/issues/18
|
|
195
|
+
preservedDrawnEarly: 'preserved-benefits-drawn-early',
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* A benefit the library can name but has not modelled, refused rather
|
|
199
|
+
* than priced on an assumption nobody would see. `code` says which, so
|
|
200
|
+
* a consumer can tell a member what cannot yet be answered instead of
|
|
201
|
+
* showing a figure that answers something else.
|
|
202
|
+
*/
|
|
203
|
+
export class BenefitNotModelled extends Error {
|
|
204
|
+
code;
|
|
205
|
+
constructor(code, detail) {
|
|
206
|
+
super(`Not modelled: ${detail}`);
|
|
207
|
+
this.code = code;
|
|
208
|
+
this.name = 'BenefitNotModelled';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
145
211
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors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ACjD,mBAAmB,EAAE,gCAAgC;CAC7C,CAAC;AAIX;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACtB;IAArB,YAAqB,IAAiB,EAAE,MAAc;QACpD,KAAK,CAAC,iBAAiB,MAAM,EAAE,CAAC,CAAC;QADd,SAAI,GAAJ,IAAI,CAAa;QAEpC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { FactorTable } from './gad/factor-table.js';
|
|
2
|
+
import type { FactorProvenance, FactorTableKind } from './gad/factor-table.js';
|
|
3
|
+
declare const TABLES: {
|
|
4
|
+
readonly '0-420': FactorTable<{
|
|
5
|
+
readonly by: "period";
|
|
6
|
+
}>;
|
|
7
|
+
readonly '0-421': FactorTable<{
|
|
8
|
+
readonly by: "period";
|
|
9
|
+
}>;
|
|
10
|
+
readonly '1-401': FactorTable<{
|
|
11
|
+
readonly by: "age";
|
|
12
|
+
readonly firstAge: 50;
|
|
13
|
+
}>;
|
|
14
|
+
readonly '1-402': FactorTable<{
|
|
15
|
+
readonly by: "age";
|
|
16
|
+
readonly firstAge: 50;
|
|
17
|
+
}>;
|
|
18
|
+
readonly '1-407': FactorTable<{
|
|
19
|
+
readonly by: "age";
|
|
20
|
+
readonly firstAge: 50;
|
|
21
|
+
}>;
|
|
22
|
+
readonly '2-416': FactorTable<{
|
|
23
|
+
readonly by: "age";
|
|
24
|
+
readonly firstAge: 65;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
/** Every table the library reads, by its GAD reference. The one set of
|
|
28
|
+
* instances, so two callers cannot read the same table two ways. */
|
|
29
|
+
export declare function factorTable<K extends keyof typeof TABLES>(ref: K): (typeof TABLES)[K];
|
|
30
|
+
/** Which 1995 Section benefit a factor reduces: the pension and the
|
|
31
|
+
* automatic lump sum read different tables. */
|
|
32
|
+
export declare const FACTOR_APPLIES: {
|
|
33
|
+
readonly pension: "pension";
|
|
34
|
+
readonly lumpSum: "lump-sum";
|
|
35
|
+
};
|
|
36
|
+
export type FactorApplies = (typeof FACTOR_APPLIES)[keyof typeof FACTOR_APPLIES];
|
|
37
|
+
/**
|
|
38
|
+
* What a factor is measured against. A 1995 Section drawing before 60
|
|
39
|
+
* reduces its pension and its automatic lump sum by two different
|
|
40
|
+
* tables, so that basis says which of the two it is for.
|
|
41
|
+
*/
|
|
42
|
+
export type FactorBasis = {
|
|
43
|
+
against: 60;
|
|
44
|
+
direction: 'early';
|
|
45
|
+
applies: FactorApplies;
|
|
46
|
+
} | {
|
|
47
|
+
against: 65;
|
|
48
|
+
direction: 'early';
|
|
49
|
+
} | {
|
|
50
|
+
against: 65;
|
|
51
|
+
direction: 'late';
|
|
52
|
+
} | {
|
|
53
|
+
against: 'npa';
|
|
54
|
+
npa: number;
|
|
55
|
+
direction: 'early' | 'late';
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Where a factor came from: a table, or one of the two reasons a drawing
|
|
59
|
+
* reads none. Every 1.000 says why it is 1.000, because "drawn exactly
|
|
60
|
+
* at the pension age" and "this section pays no late uplift" are
|
|
61
|
+
* different facts that print the same number.
|
|
62
|
+
*/
|
|
63
|
+
export declare const FACTOR_SOURCES: {
|
|
64
|
+
readonly table: "table";
|
|
65
|
+
readonly atPensionAge: "at-normal-pension-age";
|
|
66
|
+
readonly noLateUplift: "section-awards-no-late-uplift";
|
|
67
|
+
};
|
|
68
|
+
/** A factor and where it came from, discriminated on `source`. */
|
|
69
|
+
export type FactorOutcome = {
|
|
70
|
+
readonly source: typeof FACTOR_SOURCES.table;
|
|
71
|
+
readonly factor: number;
|
|
72
|
+
readonly tableKind: FactorTableKind;
|
|
73
|
+
readonly provenance: FactorProvenance;
|
|
74
|
+
} | {
|
|
75
|
+
readonly source: typeof FACTOR_SOURCES.atPensionAge;
|
|
76
|
+
readonly factor: 1;
|
|
77
|
+
} | {
|
|
78
|
+
readonly source: typeof FACTOR_SOURCES.noLateUplift;
|
|
79
|
+
readonly factor: 1;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Read the factor for a drawing. The date decides the direction as well
|
|
83
|
+
* as the cell, so a basis whose direction the dates contradict is a bug
|
|
84
|
+
* in the section that derived it and fails loud.
|
|
85
|
+
*/
|
|
86
|
+
export declare function readFactor(basis: FactorBasis, dateOfBirth: Date, drawn: Date): FactorOutcome;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one door every early or late retirement factor is read through.
|
|
3
|
+
*
|
|
4
|
+
* A factor is read against the pension age the reduction is measured
|
|
5
|
+
* from, and the direction. That is how GAD segments the tables: 1-402
|
|
6
|
+
* serves any benefit with a pension age of 65, whichever section holds
|
|
7
|
+
* it. So the key is the pension age, not the section — and each section
|
|
8
|
+
* derives its key privately from its own rules, which is what keeps the
|
|
9
|
+
* 1995 Section from reading 1-402 although the type would allow it.
|
|
10
|
+
*/
|
|
11
|
+
import { periodInYearsMonths, npaDate } from './dates.js';
|
|
12
|
+
import { invariant } from './errors.js';
|
|
13
|
+
import { FactorTable } from './gad/factor-table.js';
|
|
14
|
+
import { ERF_0_420 } from './gad/erf-2023-06-30.js';
|
|
15
|
+
import { LRF_0_421 } from './gad/lrf-2023-06-30.js';
|
|
16
|
+
import { ERF_1_401 } from './gad/erf-1-401-2023-06-30.js';
|
|
17
|
+
import { ERF_1_402 } from './gad/erf-1-402-2023-06-30.js';
|
|
18
|
+
import { ERF_1_407 } from './gad/erf-1-407-2023-06-30.js';
|
|
19
|
+
import { LRF_2_416 } from './gad/lrf-2-416-2023-06-30.js';
|
|
20
|
+
const TABLES = {
|
|
21
|
+
'0-420': new FactorTable(ERF_0_420),
|
|
22
|
+
'0-421': new FactorTable(LRF_0_421),
|
|
23
|
+
'1-401': new FactorTable(ERF_1_401),
|
|
24
|
+
'1-402': new FactorTable(ERF_1_402),
|
|
25
|
+
'1-407': new FactorTable(ERF_1_407),
|
|
26
|
+
'2-416': new FactorTable(LRF_2_416),
|
|
27
|
+
};
|
|
28
|
+
/** Every table the library reads, by its GAD reference. The one set of
|
|
29
|
+
* instances, so two callers cannot read the same table two ways. */
|
|
30
|
+
export function factorTable(ref) {
|
|
31
|
+
return TABLES[ref];
|
|
32
|
+
}
|
|
33
|
+
/** Which 1995 Section benefit a factor reduces: the pension and the
|
|
34
|
+
* automatic lump sum read different tables. */
|
|
35
|
+
export const FACTOR_APPLIES = {
|
|
36
|
+
pension: 'pension',
|
|
37
|
+
lumpSum: 'lump-sum',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Where a factor came from: a table, or one of the two reasons a drawing
|
|
41
|
+
* reads none. Every 1.000 says why it is 1.000, because "drawn exactly
|
|
42
|
+
* at the pension age" and "this section pays no late uplift" are
|
|
43
|
+
* different facts that print the same number.
|
|
44
|
+
*/
|
|
45
|
+
export const FACTOR_SOURCES = {
|
|
46
|
+
table: 'table',
|
|
47
|
+
atPensionAge: 'at-normal-pension-age',
|
|
48
|
+
noLateUplift: 'section-awards-no-late-uplift',
|
|
49
|
+
};
|
|
50
|
+
/** The table a basis reads, and how it is keyed. */
|
|
51
|
+
function tableFor(basis) {
|
|
52
|
+
if (basis.against === 'npa') {
|
|
53
|
+
return basis.direction === 'early'
|
|
54
|
+
? TABLES['0-420']
|
|
55
|
+
: TABLES['0-421'];
|
|
56
|
+
}
|
|
57
|
+
if (basis.against === 60) {
|
|
58
|
+
return basis.applies === FACTOR_APPLIES.pension
|
|
59
|
+
? TABLES['1-401']
|
|
60
|
+
: TABLES['1-407'];
|
|
61
|
+
}
|
|
62
|
+
return basis.direction === 'early'
|
|
63
|
+
? TABLES['1-402']
|
|
64
|
+
: TABLES['2-416'];
|
|
65
|
+
}
|
|
66
|
+
const keyedByAge = (table) => table.index.by === 'age';
|
|
67
|
+
/**
|
|
68
|
+
* Read the factor for a drawing. The date decides the direction as well
|
|
69
|
+
* as the cell, so a basis whose direction the dates contradict is a bug
|
|
70
|
+
* in the section that derived it and fails loud.
|
|
71
|
+
*/
|
|
72
|
+
export function readFactor(basis, dateOfBirth, drawn) {
|
|
73
|
+
const pensionAge = basis.against === 'npa' ? basis.npa : basis.against;
|
|
74
|
+
const at = npaDate(dateOfBirth, pensionAge);
|
|
75
|
+
if (drawn.getTime() === at.getTime()) {
|
|
76
|
+
return { source: FACTOR_SOURCES.atPensionAge, factor: 1 };
|
|
77
|
+
}
|
|
78
|
+
invariant((drawn < at) === (basis.direction === 'early'), `factor basis says ${basis.direction} for a drawing on `
|
|
79
|
+
+ `${drawn.toDateString()} against ${at.toDateString()}`);
|
|
80
|
+
const table = tableFor(basis);
|
|
81
|
+
if (keyedByAge(table)) {
|
|
82
|
+
return {
|
|
83
|
+
source: FACTOR_SOURCES.table,
|
|
84
|
+
factor: table.factorAtAge(periodInYearsMonths(dateOfBirth, drawn)),
|
|
85
|
+
tableKind: table.kind,
|
|
86
|
+
provenance: table.provenance,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const period = drawn < at
|
|
90
|
+
? periodInYearsMonths(drawn, at)
|
|
91
|
+
: periodInYearsMonths(at, drawn);
|
|
92
|
+
return {
|
|
93
|
+
source: FACTOR_SOURCES.table,
|
|
94
|
+
factor: table.factorFor(period),
|
|
95
|
+
tableKind: table.kind,
|
|
96
|
+
provenance: table.provenance,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=factor-basis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factor-basis.js","sourceRoot":"","sources":["../src/factor-basis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAOlD,OAAO,EAAC,SAAS,EAAC,MAAM,y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C,KAAK;YAC5B,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAClE,SAAS,EAAE,KAAK,CAAC,IAAI;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,GAAG,EAAE;QACvB,CAAC,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,mBAAmB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,KAAK;QAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/B,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
|
|
3
|
+
* Spreadsheet", table 1-401, factors issued 30 June 2023.
|
|
4
|
+
* Sheet x-401 · PDF p.1.
|
|
5
|
+
*
|
|
6
|
+
* Sources: "NHSBSA, Early and Late Retirement Factors" (the
|
|
7
|
+
* member-facing extract) and "GAD NHS_EW Consolidated Factors,
|
|
8
|
+
* version 2026-01" (the workbook, and the source of record) —
|
|
9
|
+
* see docs/source-archive.md#sa-01 and #sa-02.
|
|
10
|
+
*
|
|
11
|
+
* Table 1-401 (ERF1): 1995 Section early retirement factors,
|
|
12
|
+
* pension: voluntary early retirement from active service, relative
|
|
13
|
+
* to the Section's pension age of 60. Unisex; keyed by AGE "in
|
|
14
|
+
* complete years & months", as the table's own header defines it.
|
|
15
|
+
* Read for the 1995 Section's pension drawn before 60.
|
|
16
|
+
*
|
|
17
|
+
* Rows are ages (50–60), columns months (0–11), exactly as
|
|
18
|
+
* printed; the last row prints a single 0-month value. Delete this
|
|
19
|
+
* file whole when a later issue supersedes the table; git history is
|
|
20
|
+
* the archive.
|
|
21
|
+
*
|
|
22
|
+
* ── Checked against GAD's own workbook, 23 Sep 2026 ─
|
|
23
|
+
*
|
|
24
|
+
* **Unchanged and still current.** The workbook's *Version control*
|
|
25
|
+
* sheet shows x-401 last updated in version 2023-02, dated 30 June
|
|
26
|
+
* 2023, the `issued` date below; no later version names it. Every
|
|
27
|
+
* cell of the x-401 sheet was diffed against the NHSBSA extract —
|
|
28
|
+
* 121 cells — with **zero differences**.
|
|
29
|
+
*/
|
|
30
|
+
/** ERF — Table 1-401, issued 30 Jun 2023. */
|
|
31
|
+
export declare const ERF_1_401: {
|
|
32
|
+
readonly kind: "erf";
|
|
33
|
+
readonly index: {
|
|
34
|
+
readonly by: "age";
|
|
35
|
+
readonly firstAge: 50;
|
|
36
|
+
};
|
|
37
|
+
readonly provenance: {
|
|
38
|
+
readonly tableRef: "1-401";
|
|
39
|
+
readonly sheet: "x-401";
|
|
40
|
+
readonly page: 1;
|
|
41
|
+
readonly guidanceRef: "ERF1";
|
|
42
|
+
readonly issued: import("../iso-date.js").IsoDate;
|
|
43
|
+
readonly sourceUrl: string;
|
|
44
|
+
readonly methodGuidance: string;
|
|
45
|
+
};
|
|
46
|
+
readonly rows: readonly [readonly [0.682, 0.684, 0.686, 0.688, 0.689, 0.691, 0.693, 0.695, 0.697, 0.699, 0.7, 0.702], readonly [0.704, 0.706, 0.708, 0.71, 0.712, 0.714, 0.716, 0.718, 0.72, 0.722, 0.724, 0.726], readonly [0.728, 0.73, 0.732, 0.735, 0.737, 0.739, 0.741, 0.743, 0.745, 0.748, 0.75, 0.752], readonly [0.754, 0.756, 0.759, 0.761, 0.763, 0.766, 0.768, 0.77, 0.773, 0.775, 0.777, 0.78], readonly [0.782, 0.785, 0.787, 0.79, 0.792, 0.795, 0.797, 0.8, 0.802, 0.805, 0.807, 0.81], readonly [0.812, 0.815, 0.818, 0.82, 0.823, 0.826, 0.829, 0.831, 0.834, 0.837, 0.84, 0.842], readonly [0.845, 0.848, 0.851, 0.854, 0.857, 0.86, 0.863, 0.865, 0.868, 0.871, 0.874, 0.877], readonly [0.88, 0.883, 0.886, 0.889, 0.892, 0.895, 0.899, 0.902, 0.905, 0.908, 0.911, 0.914], readonly [0.917, 0.92, 0.924, 0.927, 0.93, 0.934, 0.937, 0.94, 0.944, 0.947, 0.95, 0.954], readonly [0.957, 0.961, 0.964, 0.968, 0.971, 0.975, 0.979, 0.982, 0.986, 0.989, 0.993, 0.996], readonly [1]];
|
|
47
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
|
|
3
|
+
* Spreadsheet", table 1-401, factors issued 30 June 2023.
|
|
4
|
+
* Sheet x-401 · PDF p.1.
|
|
5
|
+
*
|
|
6
|
+
* Sources: "NHSBSA, Early and Late Retirement Factors" (the
|
|
7
|
+
* member-facing extract) and "GAD NHS_EW Consolidated Factors,
|
|
8
|
+
* version 2026-01" (the workbook, and the source of record) —
|
|
9
|
+
* see docs/source-archive.md#sa-01 and #sa-02.
|
|
10
|
+
*
|
|
11
|
+
* Table 1-401 (ERF1): 1995 Section early retirement factors,
|
|
12
|
+
* pension: voluntary early retirement from active service, relative
|
|
13
|
+
* to the Section's pension age of 60. Unisex; keyed by AGE "in
|
|
14
|
+
* complete years & months", as the table's own header defines it.
|
|
15
|
+
* Read for the 1995 Section's pension drawn before 60.
|
|
16
|
+
*
|
|
17
|
+
* Rows are ages (50–60), columns months (0–11), exactly as
|
|
18
|
+
* printed; the last row prints a single 0-month value. Delete this
|
|
19
|
+
* file whole when a later issue supersedes the table; git history is
|
|
20
|
+
* the archive.
|
|
21
|
+
*
|
|
22
|
+
* ── Checked against GAD's own workbook, 23 Sep 2026 ─
|
|
23
|
+
*
|
|
24
|
+
* **Unchanged and still current.** The workbook's *Version control*
|
|
25
|
+
* sheet shows x-401 last updated in version 2023-02, dated 30 June
|
|
26
|
+
* 2023, the `issued` date below; no later version names it. Every
|
|
27
|
+
* cell of the x-401 sheet was diffed against the NHSBSA extract —
|
|
28
|
+
* 121 cells — with **zero differences**.
|
|
29
|
+
*/
|
|
30
|
+
import { isoDate } from '../iso-date.js';
|
|
31
|
+
/** ERF — Table 1-401, issued 30 Jun 2023. */
|
|
32
|
+
export const ERF_1_401 = {
|
|
33
|
+
kind: 'erf',
|
|
34
|
+
index: { by: 'age', firstAge: 50 },
|
|
35
|
+
provenance: {
|
|
36
|
+
tableRef: '1-401',
|
|
37
|
+
sheet: 'x-401',
|
|
38
|
+
page: 1,
|
|
39
|
+
guidanceRef: 'ERF1',
|
|
40
|
+
issued: isoDate('2023-06-30'),
|
|
41
|
+
sourceUrl: 'https://www.nhsbsa.nhs.uk/sites/default/'
|
|
42
|
+
+ 'files/2024-02/Early%20and%20Late%20Retirement'
|
|
43
|
+
+ '%20Factors.pdf',
|
|
44
|
+
methodGuidance: 'GAD NHSPS 1995/2008 E&W — Voluntary early and'
|
|
45
|
+
+ ' late retirements in normal health, 7 Aug 2019',
|
|
46
|
+
},
|
|
47
|
+
rows: [
|
|
48
|
+
// 0mo 1mo 2mo 3mo 4mo 5mo
|
|
49
|
+
// 6mo 7mo 8mo 9mo 10mo 11mo
|
|
50
|
+
[0.682, 0.684, 0.686, 0.688, 0.689, 0.691,
|
|
51
|
+
0.693, 0.695, 0.697, 0.699, 0.700, 0.702], // 50
|
|
52
|
+
[0.704, 0.706, 0.708, 0.710, 0.712, 0.714,
|
|
53
|
+
0.716, 0.718, 0.720, 0.722, 0.724, 0.726], // 51
|
|
54
|
+
[0.728, 0.730, 0.732, 0.735, 0.737, 0.739,
|
|
55
|
+
0.741, 0.743, 0.745, 0.748, 0.750, 0.752], // 52
|
|
56
|
+
[0.754, 0.756, 0.759, 0.761, 0.763, 0.766,
|
|
57
|
+
0.768, 0.770, 0.773, 0.775, 0.777, 0.780], // 53
|
|
58
|
+
[0.782, 0.785, 0.787, 0.790, 0.792, 0.795,
|
|
59
|
+
0.797, 0.800, 0.802, 0.805, 0.807, 0.810], // 54
|
|
60
|
+
[0.812, 0.815, 0.818, 0.820, 0.823, 0.826,
|
|
61
|
+
0.829, 0.831, 0.834, 0.837, 0.840, 0.842], // 55
|
|
62
|
+
[0.845, 0.848, 0.851, 0.854, 0.857, 0.860,
|
|
63
|
+
0.863, 0.865, 0.868, 0.871, 0.874, 0.877], // 56
|
|
64
|
+
[0.880, 0.883, 0.886, 0.889, 0.892, 0.895,
|
|
65
|
+
0.899, 0.902, 0.905, 0.908, 0.911, 0.914], // 57
|
|
66
|
+
[0.917, 0.920, 0.924, 0.927, 0.930, 0.934,
|
|
67
|
+
0.937, 0.940, 0.944, 0.947, 0.950, 0.954], // 58
|
|
68
|
+
[0.957, 0.961, 0.964, 0.968, 0.971, 0.975,
|
|
69
|
+
0.979, 0.982, 0.986, 0.989, 0.993, 0.996], // 59
|
|
70
|
+
[1.000], // 60 — 0mo only
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=erf-1-401-2023-06-30.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erf-1-401-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-1-401-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,EAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAC;IAChC,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;QAC7B,SAAS,EAAE,0CAA0C;cACjD,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,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK;QAClD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK;QAClD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK;QAClD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK;QAClD,CAAC,KAAK,CAAC,EAAiC,gBAAgB;KACzD;CACiC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
|
|
3
|
+
* Spreadsheet", table 1-402, factors issued 30 June 2023.
|
|
4
|
+
* Sheet x-402 · PDF p.2.
|
|
5
|
+
*
|
|
6
|
+
* Sources: "NHSBSA, Early and Late Retirement Factors" (the
|
|
7
|
+
* member-facing extract) and "GAD NHS_EW Consolidated Factors,
|
|
8
|
+
* version 2026-01" (the workbook, and the source of record) —
|
|
9
|
+
* see docs/source-archive.md#sa-01 and #sa-02.
|
|
10
|
+
*
|
|
11
|
+
* Table 1-402 (ERF2): early retirement factors relative to a pension
|
|
12
|
+
* age of 65, pension: GAD prints it for "members of 1995 or 2008
|
|
13
|
+
* section (relative to NPA 65)", so it serves any benefit whose
|
|
14
|
+
* pension age is 65, whichever section holds it. Unisex; keyed by
|
|
15
|
+
* AGE "in complete years & months", as the table's own header
|
|
16
|
+
* defines it. Read for the 2008 Section's pension drawn before 65.
|
|
17
|
+
*
|
|
18
|
+
* Rows are ages (50–65), columns months (0–11), exactly as
|
|
19
|
+
* printed; the last row prints a single 0-month value. Delete this
|
|
20
|
+
* file whole when a later issue supersedes the table; git history is
|
|
21
|
+
* the archive.
|
|
22
|
+
*
|
|
23
|
+
* ── Checked against GAD's own workbook, 23 Sep 2026 ─
|
|
24
|
+
*
|
|
25
|
+
* **Unchanged and still current.** The workbook's *Version control*
|
|
26
|
+
* sheet shows x-402 last updated in version 2023-02, dated 30 June
|
|
27
|
+
* 2023, the `issued` date below; no later version names it. Every
|
|
28
|
+
* cell of the x-402 sheet was diffed against the NHSBSA extract —
|
|
29
|
+
* 181 cells — with **zero differences**.
|
|
30
|
+
*/
|
|
31
|
+
/** ERF — Table 1-402, issued 30 Jun 2023. */
|
|
32
|
+
export declare const ERF_1_402: {
|
|
33
|
+
readonly kind: "erf";
|
|
34
|
+
readonly index: {
|
|
35
|
+
readonly by: "age";
|
|
36
|
+
readonly firstAge: 50;
|
|
37
|
+
};
|
|
38
|
+
readonly provenance: {
|
|
39
|
+
readonly tableRef: "1-402";
|
|
40
|
+
readonly sheet: "x-402";
|
|
41
|
+
readonly page: 2;
|
|
42
|
+
readonly guidanceRef: "ERF2";
|
|
43
|
+
readonly issued: import("../iso-date.js").IsoDate;
|
|
44
|
+
readonly sourceUrl: string;
|
|
45
|
+
readonly methodGuidance: string;
|
|
46
|
+
};
|
|
47
|
+
readonly rows: readonly [readonly [0.541, 0.543, 0.544, 0.546, 0.547, 0.549, 0.55, 0.552, 0.553, 0.555, 0.556, 0.558], readonly [0.559, 0.561, 0.562, 0.564, 0.565, 0.567, 0.568, 0.57, 0.571, 0.573, 0.574, 0.576], readonly [0.577, 0.579, 0.581, 0.582, 0.584, 0.586, 0.588, 0.589, 0.591, 0.593, 0.595, 0.596], readonly [0.598, 0.6, 0.602, 0.604, 0.605, 0.607, 0.609, 0.611, 0.613, 0.615, 0.616, 0.618], readonly [0.62, 0.622, 0.624, 0.626, 0.628, 0.63, 0.632, 0.633, 0.635, 0.637, 0.639, 0.641], readonly [0.643, 0.645, 0.647, 0.65, 0.652, 0.654, 0.656, 0.658, 0.66, 0.663, 0.665, 0.667], readonly [0.669, 0.671, 0.674, 0.676, 0.678, 0.68, 0.683, 0.685, 0.687, 0.689, 0.692, 0.694], readonly [0.696, 0.699, 0.701, 0.704, 0.706, 0.709, 0.711, 0.714, 0.716, 0.719, 0.721, 0.724], readonly [0.726, 0.729, 0.731, 0.734, 0.736, 0.739, 0.742, 0.744, 0.747, 0.749, 0.752, 0.754], readonly [0.757, 0.76, 0.763, 0.765, 0.768, 0.771, 0.774, 0.776, 0.779, 0.782, 0.785, 0.787], readonly [0.79, 0.793, 0.796, 0.799, 0.802, 0.805, 0.809, 0.812, 0.815, 0.818, 0.821, 0.824], readonly [0.827, 0.83, 0.833, 0.837, 0.84, 0.843, 0.846, 0.849, 0.852, 0.856, 0.859, 0.862], readonly [0.865, 0.869, 0.872, 0.876, 0.879, 0.883, 0.887, 0.89, 0.894, 0.897, 0.901, 0.904], readonly [0.908, 0.912, 0.916, 0.919, 0.923, 0.927, 0.931, 0.934, 0.938, 0.942, 0.946, 0.949], readonly [0.953, 0.957, 0.961, 0.965, 0.969, 0.973, 0.977, 0.98, 0.984, 0.988, 0.992, 0.996], readonly [1]];
|
|
48
|
+
};
|