universal-parcel-scraper 0.7.2-main.330 → 0.8.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 +5 -5
- package/data/catalog.json +33 -0
- package/data/coverage-summary.json +7 -7
- package/data/detection-golden.json +36 -12
- package/dist/browser/scraper.js +834 -796
- package/dist/carriers/dachser/numbers.json +2 -1
- package/dist/carriers/dhl/numbers.json +2 -64
- package/dist/carriers/dhl-express/adapter.d.ts +15 -0
- package/dist/carriers/dhl-express/adapter.js +174 -0
- package/dist/carriers/dhl-express/carrier.json +69 -0
- package/dist/carriers/dhl-express/numbers.json +72 -0
- package/dist/carriers/dhl-express/statuses.json +47 -0
- package/dist/carriers/estafeta/numbers.json +4 -2
- package/dist/carriers/hermes-de/numbers.json +2 -1
- package/dist/carriers/mondial-relay/numbers.json +2 -1
- package/dist/carriers/relais-colis/numbers.json +2 -1
- package/dist/carriers/tipsa/numbers.json +2 -1
- package/dist/carriers/unknown/numbers.json +2 -1
- package/dist/core/catalog/inputs.d.ts +2 -0
- package/dist/core/catalog/inputs.js +8 -0
- package/dist/data/catalog.json +33 -0
- package/dist/generated/catalog.d.ts +25 -1
- package/dist/generated/catalog.js +34 -0
- package/dist/generated/recognition.js +1 -0
- package/dist/generated/registry.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/providers/coverage.json +80 -70
- package/dist/providers/plan.js +3 -0
- package/dist/server/openapi.json +1 -1
- package/package.json +1 -1
package/dist/browser/scraper.js
CHANGED
|
@@ -83,28 +83,28 @@ var m = class extends t {
|
|
|
83
83
|
constructor(e, t, n) {
|
|
84
84
|
super("transport", e, `${e} is unreachable`, { cause: t }), this.request = n, this.name = "UpstreamNetworkError";
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
function
|
|
86
|
+
}, h = 8;
|
|
87
|
+
function g(e) {
|
|
88
88
|
let n = /* @__PURE__ */ new Set(), r = e;
|
|
89
|
-
for (let e = 0; e <
|
|
89
|
+
for (let e = 0; e < h && r instanceof Error && !n.has(r); e += 1) {
|
|
90
90
|
if (n.add(r), r instanceof t) return r.kind;
|
|
91
91
|
r = r.cause;
|
|
92
92
|
}
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function _(e) {
|
|
96
96
|
let n = /* @__PURE__ */ new Set(), r = e;
|
|
97
|
-
for (let e = 0; e <
|
|
97
|
+
for (let e = 0; e < h && r instanceof Error && !n.has(r); e += 1) {
|
|
98
98
|
if (n.add(r), r instanceof t && r.retryAfterMs !== void 0) return r.retryAfterMs;
|
|
99
99
|
r = r.cause;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function te(e) {
|
|
103
103
|
return e instanceof Error && /^(?:Error|[A-Z][A-Za-z0-9_.-]{0,80}(?:Error|Exception))$/.test(e.name.trim()) ? e.name.trim() : e instanceof Error ? "Error" : typeof e;
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region carriers/the-courier-guy/number.ts
|
|
107
|
-
function
|
|
107
|
+
function ne(e) {
|
|
108
108
|
let t = e.replace(/\s/g, "").toUpperCase(), n = /^(DD|LD)-?([A-Z0-9]{6})$/.exec(t);
|
|
109
109
|
if (n) return `${n[1]}-${n[2]}`;
|
|
110
110
|
if (!/^[A-Z0-9]{5,40}$/.test(t)) throw new u("The Courier Guy", "The Courier Guy requires a shipment tracking reference");
|
|
@@ -112,13 +112,13 @@ function ie(e) {
|
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region carriers/postlogistics/number.ts
|
|
115
|
-
function
|
|
115
|
+
function re(e) {
|
|
116
116
|
let t = e.trim();
|
|
117
117
|
return /^\d{11}$/.test(t) ? `${t.slice(0, 8)}-${t.slice(8)}` : t;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region core/detection/mondialRelay.ts
|
|
121
|
-
function
|
|
121
|
+
function ie(e) {
|
|
122
122
|
if (!/^\d{26}$/.test(e)) return !1;
|
|
123
123
|
let t = (e) => {
|
|
124
124
|
let t = 11 - [...e].reverse().reduce((e, t, n) => e + Number(t) * (2 + n % 6), 0) % 11;
|
|
@@ -128,24 +128,24 @@ function oe(e) {
|
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region core/detection/normalize.ts
|
|
131
|
-
function
|
|
131
|
+
function v(e) {
|
|
132
132
|
return e.toUpperCase().replace(/[\s.-]/g, "");
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
return /^99990\d{8}$/.test(
|
|
134
|
+
function ae(e) {
|
|
135
|
+
return /^99990\d{8}$/.test(v(e));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
if (t === "postlogistics") return
|
|
139
|
-
let n =
|
|
140
|
-
return
|
|
137
|
+
function oe(e, t) {
|
|
138
|
+
if (t === "postlogistics") return re(e);
|
|
139
|
+
let n = v(e);
|
|
140
|
+
return ae(n) ? `${n.slice(0, 3)}.${n.slice(3, 5)}.${n.slice(5)}` : /^\d{18}$/.test(n) ? `${n.slice(0, 2)}.${n.slice(2, 4)}.${n.slice(4, 10)}.${n.slice(10)}` : n;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
let t =
|
|
142
|
+
function se(e) {
|
|
143
|
+
let t = v(e);
|
|
144
144
|
return t.length >= 4 && t.length <= 40 && (/^[A-Z0-9]+$/.test(t) || /^\d{4}\/\d{8}$/.test(t)) && /\d/.test(t);
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region generated/catalog.ts
|
|
148
|
-
var
|
|
148
|
+
var ce = {
|
|
149
149
|
"swiss-post": {
|
|
150
150
|
displayName: "Swiss Post",
|
|
151
151
|
color: "#ffcc00",
|
|
@@ -3072,6 +3072,30 @@ var ue = {
|
|
|
3072
3072
|
}],
|
|
3073
3073
|
detectionRules: []
|
|
3074
3074
|
},
|
|
3075
|
+
"dhl-express": {
|
|
3076
|
+
displayName: "DHL Express",
|
|
3077
|
+
color: "#ffcc00",
|
|
3078
|
+
aliases: ["DHL Express Worldwide", "MyDHL+"],
|
|
3079
|
+
selectable: !0,
|
|
3080
|
+
timezone: "UTC",
|
|
3081
|
+
tracking: {
|
|
3082
|
+
mode: "automatic",
|
|
3083
|
+
adapter: "dhl-express",
|
|
3084
|
+
recognitionRank: 75,
|
|
3085
|
+
browserRecognitionRank: 75,
|
|
3086
|
+
localClocks: !0
|
|
3087
|
+
},
|
|
3088
|
+
canaryUrl: "https://mydhl.express.dhl/gb/en/tracking.html",
|
|
3089
|
+
trackingUrlTemplate: "https://mydhl.express.dhl/gb/en/tracking.html#/results?id={trackingNumber}",
|
|
3090
|
+
linkRules: [{
|
|
3091
|
+
domains: ["mydhl.express.dhl"],
|
|
3092
|
+
fragment: "^/results\\?id=(\\d{10})(?:&|$)"
|
|
3093
|
+
}],
|
|
3094
|
+
detectionRules: [{
|
|
3095
|
+
pattern: "^\\d{10}$",
|
|
3096
|
+
confidence: "low"
|
|
3097
|
+
}]
|
|
3098
|
+
},
|
|
3075
3099
|
omgo: {
|
|
3076
3100
|
displayName: "OMGO",
|
|
3077
3101
|
color: "#8e8e93",
|
|
@@ -3091,7 +3115,7 @@ var ue = {
|
|
|
3091
3115
|
confidence: "high"
|
|
3092
3116
|
}]
|
|
3093
3117
|
}
|
|
3094
|
-
},
|
|
3118
|
+
}, le = /* @__PURE__ */ "swiss-post.swiss-post-cargo.quickpac.planzer.aliexpress.sunyou.hermes.spring-gds.postlogistics.dachser.dhl.dhl-ecommerce.ups.amazon-logistics.amazon-shipping.fedex.gls-ch.dpd.dpd-fr.mondial-relay.relais-colis.la-poste.chronopost.gls-fr.colis-prive.geodis.colisweb.c-chez-vous.heppner.ciblex.paack.asendia.shipup.india-post.hermes-de.gls-de.delivengo.intl-post.unknown.royal-mail.parcelforce.evri.inpost.an-post.bpost.austrian-post.postnord.posti.correos-express.seur.mrw.nacex.ctt.ctt-express.poste-italiane.brt.ecoscooting.tipsa.ukrposhta.usps.canada-post.purolator.canpar.ontrac.speedx.uniuni.landmark-global.old-dominion.spee-dee.gofo.estafeta.correios-br.correos-chile.yunexpress.four-px.blue-dart.delhivery.nz-post.singapore-post.japan-post.sf-express.sto.yunda.yto.zto.jd-logistics.yamato.korea-post.thailand-post.dtdc.australia-post.hongkong-post.pos-malaysia.ninja-van.china-post.packeta.poczta-polska.bring-posten.aramex.tnt.correos-spain.yanwen.the-courier-guy.j-and-t.ems.dhl-express.omgo".split("."), ue = [
|
|
3095
3119
|
"pending",
|
|
3096
3120
|
"registered",
|
|
3097
3121
|
"accepted",
|
|
@@ -3103,16 +3127,16 @@ var ue = {
|
|
|
3103
3127
|
"ready_for_pickup",
|
|
3104
3128
|
"returned",
|
|
3105
3129
|
"exception"
|
|
3106
|
-
],
|
|
3107
|
-
function
|
|
3108
|
-
return new RegExp(
|
|
3130
|
+
], de = ce["amazon-logistics"].detectionRules[0].pattern;
|
|
3131
|
+
function fe(e) {
|
|
3132
|
+
return new RegExp(de).test(e.replace(/[\s.-]/g, "").toUpperCase());
|
|
3109
3133
|
}
|
|
3110
3134
|
//#endregion
|
|
3111
3135
|
//#region core/catalog/amazon.ts
|
|
3112
|
-
function
|
|
3113
|
-
return e !== "amazon-shipping" && (e === "amazon-logistics" ||
|
|
3136
|
+
function pe(e, t = "") {
|
|
3137
|
+
return e !== "amazon-shipping" && (e === "amazon-logistics" || fe(t));
|
|
3114
3138
|
}
|
|
3115
|
-
function
|
|
3139
|
+
function me(e) {
|
|
3116
3140
|
return {
|
|
3117
3141
|
FR: "fr",
|
|
3118
3142
|
DE: "de",
|
|
@@ -3130,10 +3154,10 @@ function ge(e) {
|
|
|
3130
3154
|
TR: "com.tr"
|
|
3131
3155
|
}[e.replace(/[\s.-]/g, "").toUpperCase().slice(0, 2)] ?? "com";
|
|
3132
3156
|
}
|
|
3133
|
-
function
|
|
3134
|
-
return `https://www.amazon.${
|
|
3157
|
+
function he(e) {
|
|
3158
|
+
return `https://www.amazon.${me(e)}/gp/your-account/order-history`;
|
|
3135
3159
|
}
|
|
3136
|
-
function
|
|
3160
|
+
function ge(e) {
|
|
3137
3161
|
return `https://track.amazon.${{
|
|
3138
3162
|
IT: "it",
|
|
3139
3163
|
ES: "es",
|
|
@@ -3142,30 +3166,30 @@ function ve(e) {
|
|
|
3142
3166
|
TB: "com"
|
|
3143
3167
|
}[e.replace(/[\s.-]/g, "").toUpperCase().slice(0, 2)] ?? "fr"}`;
|
|
3144
3168
|
}
|
|
3145
|
-
function
|
|
3146
|
-
return `${
|
|
3169
|
+
function _e(e) {
|
|
3170
|
+
return `${ge(e)}/tracking/${encodeURIComponent(e.replace(/[\s.-]/g, "").toUpperCase())}`;
|
|
3147
3171
|
}
|
|
3148
3172
|
//#endregion
|
|
3149
3173
|
//#region core/catalog/definitions.ts
|
|
3150
|
-
var
|
|
3151
|
-
function
|
|
3152
|
-
let t =
|
|
3174
|
+
var y = ce;
|
|
3175
|
+
function b(e) {
|
|
3176
|
+
let t = y[e];
|
|
3153
3177
|
if (!t) throw RangeError(`Unknown carrier ${e}`);
|
|
3154
3178
|
return t;
|
|
3155
3179
|
}
|
|
3156
|
-
function
|
|
3157
|
-
return
|
|
3180
|
+
function ve(e) {
|
|
3181
|
+
return b(e).timezone ?? "UTC";
|
|
3158
3182
|
}
|
|
3159
|
-
function
|
|
3160
|
-
return
|
|
3183
|
+
function ye(e) {
|
|
3184
|
+
return b(e).tracking.adapter;
|
|
3161
3185
|
}
|
|
3162
|
-
function
|
|
3163
|
-
return (
|
|
3186
|
+
function be(e, t) {
|
|
3187
|
+
return (b(e).tracking.requirements ?? []).filter((e) => !e.whenTrackingNumber || RegExp(`^(?:${e.whenTrackingNumber})$`).test(t));
|
|
3164
3188
|
}
|
|
3165
|
-
function
|
|
3166
|
-
return
|
|
3189
|
+
function xe(e, t) {
|
|
3190
|
+
return be(e, t).filter((e) => e.optional !== !0);
|
|
3167
3191
|
}
|
|
3168
|
-
var
|
|
3192
|
+
var Se = new Set(Object.entries(y).filter(([, e]) => e.tracking.mode === "automatic").map(([e]) => e)), Ce = new Map(Object.entries(y).filter(([e]) => Se.has(e)).map(([e, t]) => [e, t.tracking.upstreamName ?? t.displayName])), we = Object.entries(y).flatMap(([e, t]) => t.linkRules.map((t) => ({
|
|
3169
3193
|
carrier: e,
|
|
3170
3194
|
domains: [...t.domains],
|
|
3171
3195
|
params: t.params ? [...t.params] : void 0,
|
|
@@ -3175,29 +3199,29 @@ var we = new Set(Object.entries(_).filter(([, e]) => e.tracking.mode === "automa
|
|
|
3175
3199
|
detectFromNumber: t.detectFromNumber,
|
|
3176
3200
|
keepsCapabilityUrl: t.keepsCapabilityUrl
|
|
3177
3201
|
})));
|
|
3178
|
-
function
|
|
3179
|
-
return
|
|
3202
|
+
function Te(e) {
|
|
3203
|
+
return we.filter((t) => t.carrier === e);
|
|
3180
3204
|
}
|
|
3181
|
-
function
|
|
3205
|
+
function Ee(e, t) {
|
|
3182
3206
|
return e === t || e.endsWith(`.${t}`);
|
|
3183
3207
|
}
|
|
3184
3208
|
//#endregion
|
|
3185
3209
|
//#region core/catalog/index.ts
|
|
3186
|
-
function
|
|
3187
|
-
let n =
|
|
3188
|
-
if (e === "mondial-relay" &&
|
|
3210
|
+
function De(e, t) {
|
|
3211
|
+
let n = v(t);
|
|
3212
|
+
if (e === "mondial-relay" && ie(n)) return n.slice(0, 12);
|
|
3189
3213
|
if (e === "c-chez-vous") {
|
|
3190
3214
|
let e = /^([A-Z0-9]{11})(\d{5})$/.exec(n);
|
|
3191
3215
|
if (e) return `${e[1]}--${e[2]}`;
|
|
3192
3216
|
}
|
|
3193
|
-
return e === "the-courier-guy" && /^(DD|LD)([A-Z0-9]{6})$/.exec(n) ?
|
|
3217
|
+
return e === "the-courier-guy" && /^(DD|LD)([A-Z0-9]{6})$/.exec(n) ? ne(n) : e === "postlogistics" ? re(t) : t;
|
|
3194
3218
|
}
|
|
3195
|
-
function
|
|
3196
|
-
if (e === "amazon-logistics") return
|
|
3197
|
-
if (e === "amazon-shipping") return
|
|
3198
|
-
if (t) return (n) => t.replace("{trackingNumber}", encodeURIComponent(
|
|
3219
|
+
function Oe(e, t) {
|
|
3220
|
+
if (e === "amazon-logistics") return he;
|
|
3221
|
+
if (e === "amazon-shipping") return _e;
|
|
3222
|
+
if (t) return (n) => t.replace("{trackingNumber}", encodeURIComponent(De(e, n)));
|
|
3199
3223
|
}
|
|
3200
|
-
function
|
|
3224
|
+
function ke(e, t) {
|
|
3201
3225
|
return {
|
|
3202
3226
|
id: e,
|
|
3203
3227
|
name: t.displayName,
|
|
@@ -3205,7 +3229,7 @@ function je(e, t) {
|
|
|
3205
3229
|
countries: t.countries ?? [],
|
|
3206
3230
|
trackingSiteName: t.trackingSiteName,
|
|
3207
3231
|
color: t.color,
|
|
3208
|
-
trackingUrl:
|
|
3232
|
+
trackingUrl: Oe(e, t.trackingUrlTemplate),
|
|
3209
3233
|
capabilities: {
|
|
3210
3234
|
tracking: {
|
|
3211
3235
|
mode: t.tracking.mode,
|
|
@@ -3217,27 +3241,27 @@ function je(e, t) {
|
|
|
3217
3241
|
}
|
|
3218
3242
|
};
|
|
3219
3243
|
}
|
|
3220
|
-
var
|
|
3221
|
-
function
|
|
3222
|
-
let n =
|
|
3244
|
+
var x = Object.fromEntries(Object.entries(y).map(([e, t]) => [e, ke(e, t)]));
|
|
3245
|
+
function Ae(e, t) {
|
|
3246
|
+
let n = x[e] ?? x.unknown, r = t ? y[n.id].displayNames?.[t] : void 0;
|
|
3223
3247
|
return r ? {
|
|
3224
3248
|
...n,
|
|
3225
3249
|
name: r
|
|
3226
3250
|
} : n;
|
|
3227
3251
|
}
|
|
3228
|
-
var
|
|
3229
|
-
function
|
|
3230
|
-
let n =
|
|
3231
|
-
return
|
|
3252
|
+
var je = Object.values(x).filter((e) => e.capabilities.selectable);
|
|
3253
|
+
function Me(e, t) {
|
|
3254
|
+
let n = v(t);
|
|
3255
|
+
return x[e].capabilities.tracking.requirements.filter((e) => !e.whenTrackingNumber || new RegExp(e.whenTrackingNumber).test(n));
|
|
3232
3256
|
}
|
|
3233
|
-
function
|
|
3257
|
+
function Ne(e, t) {
|
|
3234
3258
|
let n = t.trim();
|
|
3235
3259
|
return n ? !e.pattern || new RegExp(e.pattern).test(n) : e.optional === !0;
|
|
3236
3260
|
}
|
|
3237
|
-
function
|
|
3238
|
-
return
|
|
3261
|
+
function Pe(e) {
|
|
3262
|
+
return x[e].capabilities.tracking.mode === "automatic";
|
|
3239
3263
|
}
|
|
3240
|
-
function
|
|
3264
|
+
function Fe(e, t, n) {
|
|
3241
3265
|
if (!n || ![
|
|
3242
3266
|
"en",
|
|
3243
3267
|
"de",
|
|
@@ -3266,18 +3290,18 @@ function Le(e, t, n) {
|
|
|
3266
3290
|
}
|
|
3267
3291
|
//#endregion
|
|
3268
3292
|
//#region core/detection/gls.ts
|
|
3269
|
-
function
|
|
3293
|
+
function Ie(e) {
|
|
3270
3294
|
return /^\d{12}$/.test(e) ? (10 - [...e.slice(0, 11)].reverse().reduce((e, t, n) => e + Number(t) * (n % 2 == 0 ? 3 : 1), 1) % 10) % 10 === Number(e[11]) : !1;
|
|
3271
3295
|
}
|
|
3272
3296
|
//#endregion
|
|
3273
3297
|
//#region core/detection/hermes.ts
|
|
3274
|
-
function
|
|
3298
|
+
function Le(e) {
|
|
3275
3299
|
return /^\d{14}$/.test(e) ? (10 - [...e.slice(0, 13)].reduce((e, t, n) => e + Number(t) * (n % 2 == 0 ? 3 : 1), 0) % 10) % 10 === Number(e[13]) : !1;
|
|
3276
3300
|
}
|
|
3277
3301
|
//#endregion
|
|
3278
3302
|
//#region core/detection/s10.ts
|
|
3279
|
-
function
|
|
3280
|
-
let t =
|
|
3303
|
+
function Re(e) {
|
|
3304
|
+
let t = v(e);
|
|
3281
3305
|
if (!/^[A-Z]{2}\d{9}[A-Z]{2}$/.test(t)) return !1;
|
|
3282
3306
|
let n = 11 - [
|
|
3283
3307
|
8,
|
|
@@ -3291,17 +3315,17 @@ function Be(e) {
|
|
|
3291
3315
|
].reduce((e, n, r) => e + Number(t[r + 2]) * n, 0) % 11, r = n === 10 ? 0 : n === 11 ? 5 : n;
|
|
3292
3316
|
return Number(t[10]) === r;
|
|
3293
3317
|
}
|
|
3294
|
-
function
|
|
3295
|
-
let t =
|
|
3296
|
-
return /^L[A-Z]\d{9}CH$/.test(t) &&
|
|
3318
|
+
function ze(e) {
|
|
3319
|
+
let t = v(e);
|
|
3320
|
+
return /^L[A-Z]\d{9}CH$/.test(t) && Re(t);
|
|
3297
3321
|
}
|
|
3298
3322
|
//#endregion
|
|
3299
3323
|
//#region core/detection/detect.ts
|
|
3300
|
-
function
|
|
3301
|
-
return e.checksum === "mondial-relay" ?
|
|
3324
|
+
function Be(e, t) {
|
|
3325
|
+
return e.checksum === "mondial-relay" ? ie(t) : e.checksum === "s10" ? Re(t) : e.checksum === "hermes" ? Le(t) : e.checksum !== "gls" || Ie(t);
|
|
3302
3326
|
}
|
|
3303
|
-
function
|
|
3304
|
-
let t = e.trim().toUpperCase(), n =
|
|
3327
|
+
function S(e) {
|
|
3328
|
+
let t = e.trim().toUpperCase(), n = v(e);
|
|
3305
3329
|
if (!n) return {
|
|
3306
3330
|
carrier: "unknown",
|
|
3307
3331
|
confidence: "none",
|
|
@@ -3309,8 +3333,8 @@ function b(e) {
|
|
|
3309
3333
|
preferred: []
|
|
3310
3334
|
};
|
|
3311
3335
|
let r = [];
|
|
3312
|
-
for (let [e, i] of Object.entries(
|
|
3313
|
-
let a = i.detectionRules.find((e) => new RegExp(e.pattern).test(n) && (!e.rawPattern || new RegExp(e.rawPattern).test(t)) &&
|
|
3336
|
+
for (let [e, i] of Object.entries(y)) {
|
|
3337
|
+
let a = i.detectionRules.find((e) => new RegExp(e.pattern).test(n) && (!e.rawPattern || new RegExp(e.rawPattern).test(t)) && Be(e, n));
|
|
3314
3338
|
a && r.push({
|
|
3315
3339
|
carrier: e,
|
|
3316
3340
|
confidence: a.confidence,
|
|
@@ -3330,13 +3354,13 @@ function b(e) {
|
|
|
3330
3354
|
preferred: o
|
|
3331
3355
|
};
|
|
3332
3356
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return
|
|
3357
|
+
function Ve(e) {
|
|
3358
|
+
return S(e).carrier;
|
|
3335
3359
|
}
|
|
3336
3360
|
//#endregion
|
|
3337
3361
|
//#region core/detection/candidates.ts
|
|
3338
|
-
var
|
|
3339
|
-
RegExp(`\\b${
|
|
3362
|
+
var He = [
|
|
3363
|
+
RegExp(`\\b${de.slice(1, -1).replaceAll("[0-9]", "(?:[\\s.-]*[0-9])")}\\b`, "gi"),
|
|
3340
3364
|
/\b\d{4}\/\d{8}\b/g,
|
|
3341
3365
|
/\b\d{26}\b/g,
|
|
3342
3366
|
/\bH\d{15,19}\b/gi,
|
|
@@ -3347,43 +3371,43 @@ var We = [
|
|
|
3347
3371
|
/\b\d(?:[\s.-]?\d){9,19}\b/g,
|
|
3348
3372
|
/\b[A-Z0-9]{4,40}\b/gi
|
|
3349
3373
|
];
|
|
3350
|
-
function
|
|
3351
|
-
for (let t of
|
|
3374
|
+
function Ue(e) {
|
|
3375
|
+
for (let t of He) {
|
|
3352
3376
|
t.lastIndex = 0;
|
|
3353
3377
|
for (let n of e.matchAll(t)) {
|
|
3354
3378
|
let e = n[0].trim();
|
|
3355
|
-
if (
|
|
3379
|
+
if (S(e).confidence === "high") return e;
|
|
3356
3380
|
}
|
|
3357
3381
|
}
|
|
3358
3382
|
}
|
|
3359
|
-
function
|
|
3383
|
+
function We(e) {
|
|
3360
3384
|
let t = e.match(/(?:(?:tracking|track(?:ing)?\s*(?:number|no\.?|id)?)|(?:parcel|shipment)(?:\s+(?:tracking|number|no\.?|id))?)\s*[:#-]?\s*([A-Z0-9][A-Z0-9.-]{3,39})/i)?.[1]?.trim();
|
|
3361
|
-
return t &&
|
|
3385
|
+
return t && se(t) ? t : void 0;
|
|
3362
3386
|
}
|
|
3363
3387
|
//#endregion
|
|
3364
3388
|
//#region core/detection/parse.ts
|
|
3365
|
-
function
|
|
3389
|
+
function Ge(e) {
|
|
3366
3390
|
return e.replace(/^[\s<'"(\x5b]+/, "").replace(/[\s>'")\],;.!?]+$/, "");
|
|
3367
3391
|
}
|
|
3368
|
-
function
|
|
3392
|
+
function Ke(e) {
|
|
3369
3393
|
return e.split(/[,|]/, 1)[0].trim();
|
|
3370
3394
|
}
|
|
3371
|
-
function
|
|
3395
|
+
function qe(e, t) {
|
|
3372
3396
|
let n = new Set(t.map((e) => e.toLowerCase()));
|
|
3373
3397
|
for (let [t, r] of e.searchParams) if (n.has(t.toLowerCase()) && r.trim()) return r;
|
|
3374
3398
|
}
|
|
3375
|
-
function
|
|
3376
|
-
let n = t.params ?
|
|
3377
|
-
return
|
|
3399
|
+
function Je(e, t) {
|
|
3400
|
+
let n = t.params ? qe(e, t.params) : void 0, r = t.path?.exec(e.pathname)?.[1], i = t.fragment?.exec(decodeURIComponent(e.hash.slice(1)))?.[1], a = Ke(n ?? r ?? i ?? "");
|
|
3401
|
+
return se(a) ? a : void 0;
|
|
3378
3402
|
}
|
|
3379
|
-
function
|
|
3403
|
+
function Ye(e, t) {
|
|
3380
3404
|
return {
|
|
3381
3405
|
trackingNumber: e,
|
|
3382
3406
|
source: t,
|
|
3383
|
-
...
|
|
3407
|
+
...S(e)
|
|
3384
3408
|
};
|
|
3385
3409
|
}
|
|
3386
|
-
function
|
|
3410
|
+
function Xe(e) {
|
|
3387
3411
|
let t = e.trim();
|
|
3388
3412
|
if (!t) return {
|
|
3389
3413
|
trackingNumber: "",
|
|
@@ -3395,14 +3419,14 @@ function Qe(e) {
|
|
|
3395
3419
|
};
|
|
3396
3420
|
let n = t.match(/https?:\/\/[^\s<>"']+/gi) ?? [];
|
|
3397
3421
|
for (let e of n) {
|
|
3398
|
-
let t =
|
|
3422
|
+
let t = Ge(e);
|
|
3399
3423
|
try {
|
|
3400
|
-
let e = new URL(t), n =
|
|
3424
|
+
let e = new URL(t), n = we.filter((t) => t.domains.some((t) => Ee(e.hostname.toLowerCase(), t)) && (!t.pathPattern || t.pathPattern.test(e.pathname))), r = (t) => Math.max(...t.domains.filter((t) => Ee(e.hostname.toLowerCase(), t)).map((e) => e.length));
|
|
3401
3425
|
n.sort((e, t) => r(t) - r(e));
|
|
3402
3426
|
for (let r of n) {
|
|
3403
|
-
let i =
|
|
3427
|
+
let i = Je(e, r);
|
|
3404
3428
|
if (i) {
|
|
3405
|
-
let e =
|
|
3429
|
+
let e = S(i);
|
|
3406
3430
|
if (r.detectFromNumber && e.confidence === "high") return {
|
|
3407
3431
|
trackingNumber: i,
|
|
3408
3432
|
...e,
|
|
@@ -3420,14 +3444,14 @@ function Qe(e) {
|
|
|
3420
3444
|
};
|
|
3421
3445
|
}
|
|
3422
3446
|
}
|
|
3423
|
-
let i =
|
|
3424
|
-
if (i) return
|
|
3447
|
+
let i = Ue(decodeURIComponent(e.href));
|
|
3448
|
+
if (i) return Ye(i, "link");
|
|
3425
3449
|
} catch {}
|
|
3426
3450
|
}
|
|
3427
|
-
let r =
|
|
3428
|
-
if (r) return
|
|
3429
|
-
let i =
|
|
3430
|
-
return i ?
|
|
3451
|
+
let r = Ue(t);
|
|
3452
|
+
if (r) return Ye(r, t === r ? "number" : "text");
|
|
3453
|
+
let i = We(t);
|
|
3454
|
+
return i ? Ye(i, "text") : !t.includes("://") && se(t) ? Ye(t, "number") : {
|
|
3431
3455
|
trackingNumber: "",
|
|
3432
3456
|
carrier: "unknown",
|
|
3433
3457
|
confidence: "none",
|
|
@@ -3438,19 +3462,19 @@ function Qe(e) {
|
|
|
3438
3462
|
}
|
|
3439
3463
|
//#endregion
|
|
3440
3464
|
//#region core/types.ts
|
|
3441
|
-
function
|
|
3465
|
+
function Ze(e) {
|
|
3442
3466
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3443
3467
|
}
|
|
3444
3468
|
//#endregion
|
|
3445
3469
|
//#region core/result/index.ts
|
|
3446
|
-
var
|
|
3470
|
+
var Qe = /* @__PURE__ */ new Set([
|
|
3447
3471
|
"pending",
|
|
3448
3472
|
"in_transit",
|
|
3449
3473
|
"out_for_delivery",
|
|
3450
3474
|
"delivered",
|
|
3451
3475
|
"exception",
|
|
3452
3476
|
"unknown"
|
|
3453
|
-
]),
|
|
3477
|
+
]), $e = new Set(ue), et = [
|
|
3454
3478
|
"current_stage_source",
|
|
3455
3479
|
"last_status_text",
|
|
3456
3480
|
"last_update",
|
|
@@ -3464,45 +3488,45 @@ var et = /* @__PURE__ */ new Set([
|
|
|
3464
3488
|
"canonical_tracking_number",
|
|
3465
3489
|
"international_tracking_number",
|
|
3466
3490
|
"timezone"
|
|
3467
|
-
],
|
|
3491
|
+
], tt = [
|
|
3468
3492
|
"time",
|
|
3469
3493
|
"location",
|
|
3470
3494
|
"description",
|
|
3471
3495
|
"stage",
|
|
3472
3496
|
"stage_source"
|
|
3473
3497
|
];
|
|
3474
|
-
function
|
|
3498
|
+
function nt(e, t) {
|
|
3475
3499
|
let n = (e) => typeof e == "string" && e.trim() ? Number(e) : e, r = n(e), i = n(t);
|
|
3476
3500
|
return typeof r != "number" || typeof i != "number" || !Number.isFinite(r) || !Number.isFinite(i) || Math.abs(r) > 90 || Math.abs(i) > 180 || r === 0 && i === 0 ? null : {
|
|
3477
3501
|
latitude: Math.round(r * 1e4) / 1e4,
|
|
3478
3502
|
longitude: Math.round(i * 1e4) / 1e4
|
|
3479
3503
|
};
|
|
3480
3504
|
}
|
|
3481
|
-
function
|
|
3482
|
-
if (
|
|
3505
|
+
function rt(e) {
|
|
3506
|
+
if (!Ze(e)) throw TypeError("The carrier adapter returned an invalid response");
|
|
3483
3507
|
let t = { ...e };
|
|
3484
|
-
if (t.status = typeof e.status == "string" &&
|
|
3485
|
-
if (typeof e.current_stage != "string" ||
|
|
3508
|
+
if (t.status = typeof e.status == "string" && Qe.has(e.status) ? e.status : "unknown", e.current_stage !== void 0) {
|
|
3509
|
+
if (typeof e.current_stage != "string" || !$e.has(e.current_stage)) throw TypeError("The carrier adapter returned an invalid current stage");
|
|
3486
3510
|
t.current_stage = e.current_stage;
|
|
3487
3511
|
}
|
|
3488
|
-
for (let e of
|
|
3512
|
+
for (let e of et) {
|
|
3489
3513
|
let n = t[e];
|
|
3490
3514
|
if (n != null && typeof n != "string") throw TypeError(`The carrier adapter returned an invalid ${e.replaceAll("_", " ")}`);
|
|
3491
3515
|
}
|
|
3492
3516
|
let n = t.weight_kg;
|
|
3493
3517
|
if (n != null && (typeof n != "number" || !Number.isFinite(n) || n < 0)) throw TypeError("The carrier adapter returned an invalid parcel weight");
|
|
3494
|
-
(t.delivery_carrier != null && (typeof t.delivery_carrier != "string" || !Object.hasOwn(
|
|
3518
|
+
(t.delivery_carrier != null && (typeof t.delivery_carrier != "string" || !Object.hasOwn(ce, t.delivery_carrier)) || t.delivery_tracking_number != null && (typeof t.delivery_tracking_number != "string" || !/^[A-Z0-9]{4,40}$/.test(t.delivery_tracking_number))) && (delete t.delivery_carrier, delete t.delivery_tracking_number), (typeof t.destination_country != "string" || !/^[A-Z]{2}$/.test(t.destination_country)) && delete t.destination_country, (typeof t.destination_country_name != "string" || t.destination_country_name.length > 80) && delete t.destination_country_name;
|
|
3495
3519
|
let r = t.events ?? [];
|
|
3496
3520
|
if (!Array.isArray(r)) throw TypeError("The carrier adapter returned invalid tracking events");
|
|
3497
3521
|
return t.events = r.map((e) => {
|
|
3498
|
-
if (
|
|
3499
|
-
for (let t of
|
|
3522
|
+
if (!Ze(e)) throw TypeError("The carrier adapter returned an invalid tracking event");
|
|
3523
|
+
for (let t of tt) {
|
|
3500
3524
|
let n = e[t];
|
|
3501
3525
|
if (n != null && typeof n != "string") throw TypeError("The carrier adapter returned an invalid tracking event");
|
|
3502
3526
|
}
|
|
3503
3527
|
let t = { ...e };
|
|
3504
3528
|
if (t.point !== void 0) {
|
|
3505
|
-
let e =
|
|
3529
|
+
let e = Ze(t.point) ? nt(t.point.latitude, t.point.longitude) : null;
|
|
3506
3530
|
e ? t.point = e : delete t.point;
|
|
3507
3531
|
}
|
|
3508
3532
|
return t;
|
|
@@ -3510,14 +3534,14 @@ function at(e) {
|
|
|
3510
3534
|
}
|
|
3511
3535
|
//#endregion
|
|
3512
3536
|
//#region core/status/language.ts
|
|
3513
|
-
function
|
|
3537
|
+
function it(e) {
|
|
3514
3538
|
let t = e.toLowerCase().replace(/[’‘]/g, "'").replace(/\s+/g, " ").replace(/\bwon't\b/g, "will not").replace(/\bshan't\b/g, "shall not").replace(/\bcan't\b|\bcannot\b/g, "can not").replace(/\b([a-z]+)n't\b/g, "$1 not");
|
|
3515
3539
|
return /\b(?:will|would|should|shall|must|may|might|can|could|ought to|needs? to|to) (?:(?:not|never|yet|still|already|soon|shortly|eventually|possibly|probably) )*(?:be|have been) delivered (?:back )?to (?:the )?(?:sender|shipper)\b|\b(?:not|never)(?: yet| already| still)? (?:(?:have|has|be|been|being) )*delivered (?:back )?to (?:the )?(?:sender|shipper)\b|\bbeing delivered (?:back )?to (?:the )?(?:sender|shipper)\b/.test(t) ? !0 : /\breturn(?:ing)? to (?:the )?sender\b|\b(?:will|would|should|shall|must|may|might|can|could|ought to|needs? to|to) (?:(?:not|never|yet|still|already|soon|shortly|eventually|possibly|probably) )*(?:be|have been) returned to (?:the )?sender\b|\b(?:not|never)(?: yet| already| still)? (?:(?:have|has|be|been|being) )*returned to (?:the )?sender\b|\bbeing returned to (?:the )?sender\b|\breturn (?:has been )?(?:initiated|requested|started)\b/.test(t);
|
|
3516
3540
|
}
|
|
3517
|
-
function
|
|
3541
|
+
function at(e) {
|
|
3518
3542
|
let t = e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "").replace(/[’‘]/g, "'").replace(/ł/g, "l").replace(/[_–—-]/g, " ").replace(/\s+/g, " ").trim().replace(/[.!]+$/, "");
|
|
3519
3543
|
if (/^wird zugestellt$/.test(t)) return "out_for_delivery";
|
|
3520
|
-
if (
|
|
3544
|
+
if (it(t) || /\b(?:en|em) (?:proceso de |processo de )?devolu(?:cion|cao)\b|^devolu(?:cion|cao)$|\bdevolu(?:cion|cao) (?:en curso|em curso|iniciada|solicitada|en transito|em transito)\b|\bdevolu(?:cion|cao) (?:al|ao|a la|a) (?:remitente|remetente|origen|origem)\b(?! (?:completad|finalizad|concluid|entregad|entregue|realizad|efectuad|efetuad))|\ben camino (?:de vuelta |de regreso )?(?:al|hacia el) remitente\b|\b(?:a caminho (?:de volta )?(?:do|ao)|em transito para o) remetente\b|\b(?:siendo|sendo|a ser) (?:(?:devuelt|devolvid)[oa]s?|entregad[oa]s? al remitente|entregues? ao remetente)\b|\b(?:no|nao) (?:(?:ha|han|se|fue|foi|foram|sido|ser|sera|puede|pode|pudo|podido|todavia|aun|ainda|ya|ja) )*(?:(?:devuelt|devolvid)[oa]s?|entregad[oa]s? al remitente|entregues? ao remetente)\b|\b(?:sera|seran|serao|va a ser|vai ser|puede ser|pode ser|debe ser|deve ser|devera ser) (?:(?:pronto|proximamente|en breve|em breve|brevemente) )?(?:(?:devuelt|devolvid)[oa]s?|entregad[oa]s? al remitente|entregues? ao remetente)\b|\bse (?:le )?devolvera\b/.test(t)) return "exception";
|
|
3521
3545
|
if (/returned to (?:the )?sender|retour(?:ne)? a l'expediteur|zuruck an (?:den )?absender|an (?:den )?absender zuruck|retour a l'expediteur|reso al mittente|restituit[oa] al mittente|delivered (?:back )?to (?:the )?(?:sender|shipper)/.test(t) || /^(?:(?:envio|paquete|pedido|objeto|encomenda|pacote|remessa) )?(?:devuelt|devolvid)[oa]$|\b(?:devuelt|devolvid|retornad)[oa]s? (?:al|ao|a la|a) (?:remitente|remetente|origen|origem)\b|\bentregad[oa]s? al remitente\b|\bentregues? ao remetente\b|\bdevolu(?:cion|cao) (?:(?:al|ao|a la|a) (?:remitente|remetente|origen|origem) )?(?:completad|finalizad|concluid|entregad|entregue|realizad|efectuad|efetuad)/.test(t)) return "returned";
|
|
3522
3546
|
if (/not (?:yet )?delivered|\bundelivered\b|could not.*deliver|unable to deliver|delivery (?:attempt|failed)|non livre|n'(?:a|avons) (?:pas )?pu.*(?:remis|remettre)|n'a pas pu etre (?:distribue|livre)|livraison (?:impossible|echouee)|tentative de livraison|nicht zugestellt|nicht zugestellt werden|zustellung.*(?:fehlgeschlagen|nicht moglich)|zustellversuch|non consegnat[oa]|non e stato possibile consegnare|consegna (?:fallita|non riuscita)|tentativo di consegna/.test(t) || /\bno (?:(?:ha|han|hemos|se|le|lo|la|fue|sido|ser|es|era|pudo|puede|podido|posible|todavia|aun) )*(?:entregad[oa]s?|entregar(?:lo|la|le|se)?|repartid[oa]s?|realizar la entrega|efectuar la entrega)\b|\bsin entregar\b|\b(?:entrega|reparto) (?:fallid[oa]|imposible|no (?:(?:ha|han|se|fue|sido|ser|pudo|puede|podido) )*(?:realizad[oa]|efectuad[oa]|completad[oa]|posible|conseguid[oa]))\b|\bimposible (?:entregar|realizar la entrega|efectuar la entrega)\b|\bfallo (?:en la|de) entrega\b|\bintento fallido\b|\bintento de (?:entrega|reparto)\b(?! (?:programad|previst|para (?:hoy|manana|el)|manana|hoy))|\bnao (?:(?:foi|foram|ser|sera|pode|podemos|conseguimos|conseguiu|se|possivel|e|ainda|tem sido|esta|estava) )*(?:entregues?|entregar|efetuar a entrega|efectuar a entrega|realizar a entrega)\b|\bentrega (?:falhada|sem sucesso|impossivel|nao (?:(?:foi|pode|ser|sera|tem sido) )*(?:efetuada|efectuada|realizada|conseguida|concretizada|possivel))\b|\bfalha (?:na|de) entrega\b|\btentativa (?:de entrega|sem sucesso)\b(?! (?:agendada|prevista|programada|para (?:hoje|amanha)|amanha|hoje))|\bcarteiro nao atendido\b/.test(t) || !/\bpick ?up (?:attempt|was attempted|unsuccessful|failed)|attempted (?:to )?pick ?up/.test(t) && /(?:attempted|tried) to deliver|\battempted delivery\b(?! (?:is )?(?:scheduled|planned|expected|tomorrow|will)\b)|unsuccessful delivery|delivery (?:was )?unsuccessful|unable to complete (?:the |your |this )?delivery|(?<!\bif (?:the |your )?)\b(?:recipient|addressee|consignee|customer|receiver|user)(?: was| is)? (?:not (?:at home|home|available|present)|unavailable|absent)\b|absence of (?:the )?(?:recipient|addressee|consignee)|\bbusiness (?:was |is )?closed\b|destinataire absent|(?:entreprise|societe) (?:etait |est )?fermee?\b|nicht angetroffen|(?:firma|betrieb|geschaft) (?:war |ist )?geschlossen|destinatario assente|(?:attivita|azienda|ditta) (?:era |e )?chiusa/.test(t) || !/\bintento de recogida\b|\brecogida (?:fallida|no realizada|no efectuada)\b|\btentativa de (?:recolha|coleta)\b|\b(?:recolha|coleta) (?:falhada|sem sucesso|nao (?:realizada|efetuada|efectuada))\b/.test(t) && !/\b(?:si|caso)\b[^.;:]*\b(?:ausen|nadie|ninguem|cerrad|fechad|no (?:esta|se encuentra)|nao (?:esta|se encontra))|\bse (?:o |a )?(?:destinatari[oa] |cliente )?(?:estiver|for|nao estiver)\b/.test(t) && /\bausen(?:te|tes|cia)\b|\b(?:destinatari[oa]|cliente|consignatari[oa]) (?:no (?:esta|estaba|se encuentra|se encontraba|disponible|presente)|nao (?:esta|estava|se encontra|se encontrava|disponivel|presente))\b|\bnadie en (?:casa|el domicilio)\b|\bninguem em casa\b|\b(?:establecimiento|negocio|empresa|comercio|tienda) (?:esta |estaba |se encontraba )?cerrad[oa]\b|\b(?:estabelecimento|empresa|loja|comercio|negocio) (?:esta |estava |se encontrava )?fechad[oa]\b/.test(t)) return "failed_attempt";
|
|
3523
3547
|
if (/\b(?:damaged|broken in transit)\b|endommag|avarie|deterior|beschadigt|danneggiat|danad[oa]|danificad|uszkodzon/.test(t) || /\blost (?:in transit|package|parcel|shipment)?\b|colis perdu|envoi perdu|egare|verloren|verlust der sendung|smarrit|(?:paquete|envio) perdid|extraviad|zagubion|zaginion/.test(t) || /refused by (?:the )?(?:recipient|consignee)|\brefused\b|rejected by (?:the )?recipient|refus(?:e|ee)? par le destinataire|refus du destinataire|(?:colis|envoi|pli) refuse|annahme verweigert|verweigert|rifiutat|rechazad|recusad|odmowa przyjecia|odmowiono przyjecia/.test(t) || /address (?:incomplete|incorrect|invalid|insufficient|unknown)|(?:incorrect|incomplete|insufficient|wrong|invalid) address|(?:updated|correct(?:ed)?|complete) (?:delivery )?address (?:is )?(?:required|needed)|address(?:ee)? (?:unknown|cannot be located)|recipient unknown|adresse (?:incorrecte|incomplete|erronee|invalide|inconnue)|destinataire inconnu|(?:adresse|anschrift) (?:unvollstandig|falsch|unbekannt)|empfanger unbekannt|indirizzo (?:errato|incompleto|insufficiente|sconosciuto)|destinatario sconosciuto|direccion (?:incorrecta|incompleta|erronea|desconocida)|destinatario desconocido|endereco (?:incorreto|incompleto|errado|desconhecido)|destinatario desconhecido|adres (?:niepelny|nieprawidlowy|bledny)|nieznany adresat/.test(t) || /customs (?:issue|problem|hold)|held (?:by|in|at) customs|detained by customs|probleme de douane|retenu en douane|zollproblem|vom zoll zuruckgehalten|problema doganale|fermo in dogana|problema de aduana|retenido en aduana|problema (?:alfandegario|na alfandega)|retido na alfandega|problem celny|zatrzyman[ay] przez (?:urzad celny|cel)/.test(t) || /(?:shipment|parcel|package) (?:is )?(?:held|blocked|on hold)|held pending|awaiting (?:your )?instructions|action required|(?:colis|envoi|pli) (?:bloque|retenu)|en attente d'instructions|action requise|sendung (?:blockiert|zuruckgehalten|angehalten)|wartet auf anweisungen|handlung erforderlich|spedizione (?:bloccata|trattenuta)|in attesa di istruzioni|envio (?:bloqueado|retenido)|en espera de instrucciones|accion requerida|encomenda (?:bloqueada|retida)|aguarda instrucoes|acao necessaria|przesylka (?:zatrzymana|wstrzymana)|oczekuje na instrukcje/.test(t) || /\bincident\b|\banomal(?:y|ie|ia)\b|delivery exception|shipment exception|irregularit|unregelmassigkeit|storung|vorfall|inconveniente|incidencia|nieprawidlowosc/.test(t)) return "exception";
|
|
@@ -3539,16 +3563,16 @@ function st(e) {
|
|
|
3539
3563
|
if (/^(?:posting\/collection|posted|origin scan)$|received at (?:our |the )?(?:[a-z]+ )?origin (?:office|facility|hub)|dropped off (?:after|before) (?:the )?latest drop ?off time/.test(t) || /accepted|picked up|pick up was successful|^drop off$|pick ?up scan|prepared the package for return to ups or pickup by ups|handed (?:over )?to (?:dpd|gls)|package received at dhl|item booked|consignment was mailed|posted at a postal point|pris en charge|prise en charge|collecte.*(?:reussi|effectue)|recupere.*boite aux lettres|depose.*point postal|remis a (?:dpd|gls)|envoi.*depose|abholung.*erfolgreich|eingeliefert|an (?:dpd|gls) ubergeben|paket.*(?:angenommen|ubernommen)|ritiro.*(?:riuscito|effettuato)|pres[oa] in carico|affidat[oa] a (?:dpd|gls)|depositat.*punto postale|spedizione.*impostata/.test(t)) return "accepted";
|
|
3540
3564
|
if (/transit|en route|on (?:its|the) way|\bfacility\b|airport|\bleaving\b|\bdispatched\b|^delay(?:ed)?$|received by (?:the )?(?:local )?(?:delivery|logistics) company|received by postnl|notification.*sent to the recipient|delivery option requested|instruction de livraison recue|expedie (?:depuis|du|de)\b|acheminement|unterwegs|transport|trasport|arriv|depart|processed|processing completed|sorted|sorting|\btri\b|trie|traitement|traite|sortier|bearbeitet|bearbeitung|elaborat|elaborazion|smistat|parcel cent(?:er|re)|delivery cent(?:er|re)|centre.*(?:colis|distribution)|paketzentrum|verteilzentrum|centro.*(?:pacchi|distribuzione)|depot|import scan|scan.*import|importscan|scansione.*import|delivery.*delayed|livraison.*retard|zustellung.*verzogert|consegna.*ritard|transferred|transfere|weitergeleitet|inoltrato|left.*(?:point|center)|quitte|verlassen|raggiunto|close bag|fermeture du sac|sack.*geschlossen|chiusura.*sacco|scanned into|scanne dans|eingescannt|scansionat|\bloaded\b|^(?:item|parcel|shipment) distributed$|charg.*vehicule de transport|transportfahrzeug.*geladen|caric.*veicolo.*trasporto/.test(t) || /^enviad[oa]$|\bclasificad[oa]s?\b|\bclasificacion\b|\ben ruta\b|\ben camino\b|\bllegad[oa]s? (?:a|al|en)\b|\bllegada (?:a|al|en|de)\b|\bha llegado\b|\bllego (?:a|al)\b|\bsalida (?:de|del|desde)\b|\b(?:ha )?salido (?:de|del)\b|\bsalio (?:de|del)\b|\ben destino\b|\b(?:agencia|delegacion|plataforma|oficina|franquicia) (?:de )?destino\b|\b(?:unidad|centro|oficina|delegacion|base|agencia|plataforma) de reparto\b|\bcentro (?:de )?(?:clasificacion|distribucion|tratamiento|logistico|operaciones|operativo)\b|\blectura\b|\bleid[oa]s?\b|\brecepcionad[oa]s?\b|\bprocesad[oa]s?\b|\bexpedid[oa]s?\b|\btriagem\b|\btriad[oa]s?\b|\bem tratamento\b|\btratad[oa]s?\b|\bcentro (?:de )?(?:distribuicao|tratamento|triagem|operacional)\b|\bchegad[ao] (?:a|ao|no|na|em)\b|\bchegou (?:a|ao|no|na|em)\b|\bsaida (?:do|da|de|dos|das)\b|\bsaiu (?:do|da|de|dos|das)\b|\bem rota\b|\ba caminho\b|\bencaminhad[oa]s?\b|\b(?:em )?transferencia\b|\btransferid[oa]s?\b|\bprocessad[oa]s?\b|\brecebid[oa] (?:no|na|em) (?:centro|armazem|unidade|plataforma)\b|\brecibid[oa] en (?:el |la |nuestr[oa] )?(?:almacen|centro|delegacion|plataforma|hub|agencia)\b/.test(t)) return "in_transit";
|
|
3541
3565
|
}
|
|
3542
|
-
function
|
|
3566
|
+
function ot(e) {
|
|
3543
3567
|
return e === "registered" || e === "pending" ? "pending" : e === "delivered" ? "delivered" : e === "out_for_delivery" || e === "ready_for_pickup" ? "out_for_delivery" : e === "returned" || e === "failed_attempt" || e === "exception" ? "exception" : "in_transit";
|
|
3544
3568
|
}
|
|
3545
3569
|
//#endregion
|
|
3546
3570
|
//#region core/status/wording.ts
|
|
3547
|
-
function
|
|
3571
|
+
function st(e, t = "in_transit") {
|
|
3548
3572
|
let n = (e, t) => ({
|
|
3549
3573
|
stage: e,
|
|
3550
3574
|
source: `wording:${t}`
|
|
3551
|
-
}), r =
|
|
3575
|
+
}), r = at(e);
|
|
3552
3576
|
if (r) return n(r, "language");
|
|
3553
3577
|
let i = e.toLocaleLowerCase("en-US").replaceAll("_", " ").trim().split(/\s+/).join(" ");
|
|
3554
3578
|
return i.includes("to be delivered") ? n("in_transit", "to_be_delivered") : i === "reported" ? n("registered", "reported") : [
|
|
@@ -3700,187 +3724,187 @@ function lt(e, t = "in_transit") {
|
|
|
3700
3724
|
source: "none"
|
|
3701
3725
|
};
|
|
3702
3726
|
}
|
|
3703
|
-
function
|
|
3704
|
-
return
|
|
3727
|
+
function ct(e, t = "in_transit") {
|
|
3728
|
+
return st(e, t).stage;
|
|
3705
3729
|
}
|
|
3706
3730
|
//#endregion
|
|
3707
3731
|
//#region node_modules/luxon/build/es6/luxon.mjs
|
|
3708
|
-
var
|
|
3732
|
+
var C = class extends Error {}, lt = class extends C {
|
|
3709
3733
|
constructor(e) {
|
|
3710
3734
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
3711
3735
|
}
|
|
3712
|
-
},
|
|
3736
|
+
}, ut = class extends C {
|
|
3713
3737
|
constructor(e) {
|
|
3714
3738
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
3715
3739
|
}
|
|
3716
|
-
},
|
|
3740
|
+
}, dt = class extends C {
|
|
3717
3741
|
constructor(e) {
|
|
3718
3742
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
3719
3743
|
}
|
|
3720
|
-
},
|
|
3744
|
+
}, w = class extends C {}, ft = class extends C {
|
|
3721
3745
|
constructor(e) {
|
|
3722
3746
|
super(`Invalid unit ${e}`);
|
|
3723
3747
|
}
|
|
3724
|
-
},
|
|
3748
|
+
}, T = class extends C {}, E = class extends C {
|
|
3725
3749
|
constructor() {
|
|
3726
3750
|
super("Zone is an abstract class");
|
|
3727
3751
|
}
|
|
3728
|
-
},
|
|
3729
|
-
year:
|
|
3730
|
-
month:
|
|
3731
|
-
day:
|
|
3752
|
+
}, D = "numeric", O = "short", k = "long", pt = {
|
|
3753
|
+
year: D,
|
|
3754
|
+
month: D,
|
|
3755
|
+
day: D
|
|
3756
|
+
}, mt = {
|
|
3757
|
+
year: D,
|
|
3758
|
+
month: O,
|
|
3759
|
+
day: D
|
|
3760
|
+
}, ht = {
|
|
3761
|
+
year: D,
|
|
3762
|
+
month: O,
|
|
3763
|
+
day: D,
|
|
3764
|
+
weekday: O
|
|
3732
3765
|
}, gt = {
|
|
3733
|
-
year:
|
|
3734
|
-
month:
|
|
3735
|
-
day:
|
|
3766
|
+
year: D,
|
|
3767
|
+
month: k,
|
|
3768
|
+
day: D
|
|
3736
3769
|
}, _t = {
|
|
3737
|
-
year:
|
|
3738
|
-
month:
|
|
3739
|
-
day:
|
|
3740
|
-
weekday:
|
|
3770
|
+
year: D,
|
|
3771
|
+
month: k,
|
|
3772
|
+
day: D,
|
|
3773
|
+
weekday: k
|
|
3741
3774
|
}, vt = {
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
day: T
|
|
3775
|
+
hour: D,
|
|
3776
|
+
minute: D
|
|
3745
3777
|
}, yt = {
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
weekday: D
|
|
3778
|
+
hour: D,
|
|
3779
|
+
minute: D,
|
|
3780
|
+
second: D
|
|
3750
3781
|
}, bt = {
|
|
3751
|
-
hour:
|
|
3752
|
-
minute:
|
|
3782
|
+
hour: D,
|
|
3783
|
+
minute: D,
|
|
3784
|
+
second: D,
|
|
3785
|
+
timeZoneName: O
|
|
3753
3786
|
}, xt = {
|
|
3754
|
-
hour:
|
|
3755
|
-
minute:
|
|
3756
|
-
second:
|
|
3787
|
+
hour: D,
|
|
3788
|
+
minute: D,
|
|
3789
|
+
second: D,
|
|
3790
|
+
timeZoneName: k
|
|
3757
3791
|
}, St = {
|
|
3758
|
-
hour:
|
|
3759
|
-
minute:
|
|
3760
|
-
|
|
3761
|
-
timeZoneName: E
|
|
3792
|
+
hour: D,
|
|
3793
|
+
minute: D,
|
|
3794
|
+
hourCycle: "h23"
|
|
3762
3795
|
}, Ct = {
|
|
3763
|
-
hour:
|
|
3764
|
-
minute:
|
|
3765
|
-
second:
|
|
3766
|
-
timeZoneName: D
|
|
3767
|
-
}, wt = {
|
|
3768
|
-
hour: T,
|
|
3769
|
-
minute: T,
|
|
3796
|
+
hour: D,
|
|
3797
|
+
minute: D,
|
|
3798
|
+
second: D,
|
|
3770
3799
|
hourCycle: "h23"
|
|
3800
|
+
}, wt = {
|
|
3801
|
+
hour: D,
|
|
3802
|
+
minute: D,
|
|
3803
|
+
second: D,
|
|
3804
|
+
hourCycle: "h23",
|
|
3805
|
+
timeZoneName: O
|
|
3771
3806
|
}, Tt = {
|
|
3772
|
-
hour:
|
|
3773
|
-
minute:
|
|
3774
|
-
second:
|
|
3775
|
-
hourCycle: "h23"
|
|
3776
|
-
}, Et = {
|
|
3777
|
-
hour: T,
|
|
3778
|
-
minute: T,
|
|
3779
|
-
second: T,
|
|
3807
|
+
hour: D,
|
|
3808
|
+
minute: D,
|
|
3809
|
+
second: D,
|
|
3780
3810
|
hourCycle: "h23",
|
|
3781
|
-
timeZoneName:
|
|
3811
|
+
timeZoneName: k
|
|
3812
|
+
}, Et = {
|
|
3813
|
+
year: D,
|
|
3814
|
+
month: D,
|
|
3815
|
+
day: D,
|
|
3816
|
+
hour: D,
|
|
3817
|
+
minute: D
|
|
3782
3818
|
}, Dt = {
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3819
|
+
year: D,
|
|
3820
|
+
month: D,
|
|
3821
|
+
day: D,
|
|
3822
|
+
hour: D,
|
|
3823
|
+
minute: D,
|
|
3824
|
+
second: D
|
|
3788
3825
|
}, Ot = {
|
|
3789
|
-
year:
|
|
3790
|
-
month:
|
|
3791
|
-
day:
|
|
3792
|
-
hour:
|
|
3793
|
-
minute:
|
|
3826
|
+
year: D,
|
|
3827
|
+
month: O,
|
|
3828
|
+
day: D,
|
|
3829
|
+
hour: D,
|
|
3830
|
+
minute: D
|
|
3794
3831
|
}, kt = {
|
|
3795
|
-
year:
|
|
3796
|
-
month:
|
|
3797
|
-
day:
|
|
3798
|
-
hour:
|
|
3799
|
-
minute:
|
|
3800
|
-
second:
|
|
3832
|
+
year: D,
|
|
3833
|
+
month: O,
|
|
3834
|
+
day: D,
|
|
3835
|
+
hour: D,
|
|
3836
|
+
minute: D,
|
|
3837
|
+
second: D
|
|
3801
3838
|
}, At = {
|
|
3802
|
-
year:
|
|
3803
|
-
month:
|
|
3804
|
-
day:
|
|
3805
|
-
|
|
3806
|
-
|
|
3839
|
+
year: D,
|
|
3840
|
+
month: O,
|
|
3841
|
+
day: D,
|
|
3842
|
+
weekday: O,
|
|
3843
|
+
hour: D,
|
|
3844
|
+
minute: D
|
|
3807
3845
|
}, jt = {
|
|
3808
|
-
year:
|
|
3809
|
-
month:
|
|
3810
|
-
day:
|
|
3811
|
-
hour:
|
|
3812
|
-
minute:
|
|
3813
|
-
|
|
3846
|
+
year: D,
|
|
3847
|
+
month: k,
|
|
3848
|
+
day: D,
|
|
3849
|
+
hour: D,
|
|
3850
|
+
minute: D,
|
|
3851
|
+
timeZoneName: O
|
|
3814
3852
|
}, Mt = {
|
|
3815
|
-
year:
|
|
3816
|
-
month:
|
|
3817
|
-
day:
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3853
|
+
year: D,
|
|
3854
|
+
month: k,
|
|
3855
|
+
day: D,
|
|
3856
|
+
hour: D,
|
|
3857
|
+
minute: D,
|
|
3858
|
+
second: D,
|
|
3859
|
+
timeZoneName: O
|
|
3821
3860
|
}, Nt = {
|
|
3822
|
-
year:
|
|
3823
|
-
month:
|
|
3824
|
-
day:
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3861
|
+
year: D,
|
|
3862
|
+
month: k,
|
|
3863
|
+
day: D,
|
|
3864
|
+
weekday: k,
|
|
3865
|
+
hour: D,
|
|
3866
|
+
minute: D,
|
|
3867
|
+
timeZoneName: k
|
|
3828
3868
|
}, Pt = {
|
|
3829
|
-
year:
|
|
3830
|
-
month:
|
|
3831
|
-
day:
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
month: D,
|
|
3839
|
-
day: T,
|
|
3840
|
-
weekday: D,
|
|
3841
|
-
hour: T,
|
|
3842
|
-
minute: T,
|
|
3843
|
-
timeZoneName: D
|
|
3844
|
-
}, It = {
|
|
3845
|
-
year: T,
|
|
3846
|
-
month: D,
|
|
3847
|
-
day: T,
|
|
3848
|
-
weekday: D,
|
|
3849
|
-
hour: T,
|
|
3850
|
-
minute: T,
|
|
3851
|
-
second: T,
|
|
3852
|
-
timeZoneName: D
|
|
3853
|
-
}, Lt = class {
|
|
3869
|
+
year: D,
|
|
3870
|
+
month: k,
|
|
3871
|
+
day: D,
|
|
3872
|
+
weekday: k,
|
|
3873
|
+
hour: D,
|
|
3874
|
+
minute: D,
|
|
3875
|
+
second: D,
|
|
3876
|
+
timeZoneName: k
|
|
3877
|
+
}, Ft = class {
|
|
3854
3878
|
get type() {
|
|
3855
|
-
throw new
|
|
3879
|
+
throw new E();
|
|
3856
3880
|
}
|
|
3857
3881
|
get name() {
|
|
3858
|
-
throw new
|
|
3882
|
+
throw new E();
|
|
3859
3883
|
}
|
|
3860
3884
|
get ianaName() {
|
|
3861
3885
|
return this.name;
|
|
3862
3886
|
}
|
|
3863
3887
|
get isUniversal() {
|
|
3864
|
-
throw new
|
|
3888
|
+
throw new E();
|
|
3865
3889
|
}
|
|
3866
3890
|
offsetName(e, t) {
|
|
3867
|
-
throw new
|
|
3891
|
+
throw new E();
|
|
3868
3892
|
}
|
|
3869
3893
|
formatOffset(e, t) {
|
|
3870
|
-
throw new
|
|
3894
|
+
throw new E();
|
|
3871
3895
|
}
|
|
3872
3896
|
offset(e) {
|
|
3873
|
-
throw new
|
|
3897
|
+
throw new E();
|
|
3874
3898
|
}
|
|
3875
3899
|
equals(e) {
|
|
3876
|
-
throw new
|
|
3900
|
+
throw new E();
|
|
3877
3901
|
}
|
|
3878
3902
|
get isValid() {
|
|
3879
|
-
throw new
|
|
3903
|
+
throw new E();
|
|
3880
3904
|
}
|
|
3881
|
-
},
|
|
3905
|
+
}, It = null, Lt = class e extends Ft {
|
|
3882
3906
|
static get instance() {
|
|
3883
|
-
return
|
|
3907
|
+
return It === null && (It = new e()), It;
|
|
3884
3908
|
}
|
|
3885
3909
|
get type() {
|
|
3886
3910
|
return "system";
|
|
@@ -3892,10 +3916,10 @@ var x = class extends Error {}, dt = class extends x {
|
|
|
3892
3916
|
return !1;
|
|
3893
3917
|
}
|
|
3894
3918
|
offsetName(e, { format: t, locale: n }) {
|
|
3895
|
-
return
|
|
3919
|
+
return dr(e, t, n);
|
|
3896
3920
|
}
|
|
3897
3921
|
formatOffset(e, t) {
|
|
3898
|
-
return
|
|
3922
|
+
return hr(this.offset(e), t);
|
|
3899
3923
|
}
|
|
3900
3924
|
offset(e) {
|
|
3901
3925
|
return -new Date(e).getTimezoneOffset();
|
|
@@ -3906,9 +3930,9 @@ var x = class extends Error {}, dt = class extends x {
|
|
|
3906
3930
|
get isValid() {
|
|
3907
3931
|
return !0;
|
|
3908
3932
|
}
|
|
3909
|
-
},
|
|
3910
|
-
function
|
|
3911
|
-
let t =
|
|
3933
|
+
}, Rt = /* @__PURE__ */ new Map();
|
|
3934
|
+
function zt(e) {
|
|
3935
|
+
let t = Rt.get(e);
|
|
3912
3936
|
return t === void 0 && (t = new Intl.DateTimeFormat("en-US", {
|
|
3913
3937
|
hour12: !1,
|
|
3914
3938
|
timeZone: e,
|
|
@@ -3919,9 +3943,9 @@ function Vt(e) {
|
|
|
3919
3943
|
minute: "2-digit",
|
|
3920
3944
|
second: "2-digit",
|
|
3921
3945
|
era: "short"
|
|
3922
|
-
}),
|
|
3946
|
+
}), Rt.set(e, t)), t;
|
|
3923
3947
|
}
|
|
3924
|
-
var
|
|
3948
|
+
var Bt = {
|
|
3925
3949
|
year: 0,
|
|
3926
3950
|
month: 1,
|
|
3927
3951
|
day: 2,
|
|
@@ -3930,7 +3954,7 @@ var Ht = {
|
|
|
3930
3954
|
minute: 5,
|
|
3931
3955
|
second: 6
|
|
3932
3956
|
};
|
|
3933
|
-
function
|
|
3957
|
+
function Vt(e, t) {
|
|
3934
3958
|
let n = e.format(t).replace(/\u200E/g, ""), [, r, i, a, o, s, c, l] = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);
|
|
3935
3959
|
return [
|
|
3936
3960
|
a,
|
|
@@ -3942,21 +3966,21 @@ function Ut(e, t) {
|
|
|
3942
3966
|
l
|
|
3943
3967
|
];
|
|
3944
3968
|
}
|
|
3945
|
-
function
|
|
3969
|
+
function Ht(e, t) {
|
|
3946
3970
|
let n = e.formatToParts(t), r = [];
|
|
3947
3971
|
for (let e = 0; e < n.length; e++) {
|
|
3948
|
-
let { type: t, value: i } = n[e], a =
|
|
3949
|
-
t === "era" ? r[a] = i :
|
|
3972
|
+
let { type: t, value: i } = n[e], a = Bt[t];
|
|
3973
|
+
t === "era" ? r[a] = i : R(a) || (r[a] = parseInt(i, 10));
|
|
3950
3974
|
}
|
|
3951
3975
|
return r;
|
|
3952
3976
|
}
|
|
3953
|
-
var
|
|
3977
|
+
var Ut = /* @__PURE__ */ new Map(), A = class e extends Ft {
|
|
3954
3978
|
static create(t) {
|
|
3955
|
-
let n =
|
|
3956
|
-
return n === void 0 &&
|
|
3979
|
+
let n = Ut.get(t);
|
|
3980
|
+
return n === void 0 && Ut.set(t, n = new e(t)), n;
|
|
3957
3981
|
}
|
|
3958
3982
|
static resetCache() {
|
|
3959
|
-
|
|
3983
|
+
Ut.clear(), Rt.clear();
|
|
3960
3984
|
}
|
|
3961
3985
|
static isValidSpecifier(e) {
|
|
3962
3986
|
return this.isValidZone(e);
|
|
@@ -3982,18 +4006,18 @@ var Gt = /* @__PURE__ */ new Map(), O = class e extends Lt {
|
|
|
3982
4006
|
return !1;
|
|
3983
4007
|
}
|
|
3984
4008
|
offsetName(e, { format: t, locale: n }) {
|
|
3985
|
-
return
|
|
4009
|
+
return dr(e, t, n, this.name);
|
|
3986
4010
|
}
|
|
3987
4011
|
formatOffset(e, t) {
|
|
3988
|
-
return
|
|
4012
|
+
return hr(this.offset(e), t);
|
|
3989
4013
|
}
|
|
3990
4014
|
offset(e) {
|
|
3991
4015
|
if (!this.valid) return NaN;
|
|
3992
4016
|
let t = new Date(e);
|
|
3993
4017
|
if (isNaN(t)) return NaN;
|
|
3994
|
-
let n =
|
|
4018
|
+
let n = zt(this.name), [r, i, a, o, s, c, l] = n.formatToParts ? Ht(n, t) : Vt(n, t);
|
|
3995
4019
|
o === "BC" && (r = -Math.abs(r) + 1);
|
|
3996
|
-
let u =
|
|
4020
|
+
let u = sr({
|
|
3997
4021
|
year: r,
|
|
3998
4022
|
month: i,
|
|
3999
4023
|
day: a,
|
|
@@ -4010,48 +4034,48 @@ var Gt = /* @__PURE__ */ new Map(), O = class e extends Lt {
|
|
|
4010
4034
|
get isValid() {
|
|
4011
4035
|
return this.valid;
|
|
4012
4036
|
}
|
|
4013
|
-
},
|
|
4037
|
+
}, Wt = {};
|
|
4038
|
+
function Gt(e, t = {}) {
|
|
4039
|
+
let n = JSON.stringify([e, t]), r = Wt[n];
|
|
4040
|
+
return r || (r = new Intl.ListFormat(e, t), Wt[n] = r), r;
|
|
4041
|
+
}
|
|
4042
|
+
var Kt = /* @__PURE__ */ new Map();
|
|
4014
4043
|
function qt(e, t = {}) {
|
|
4015
|
-
let n = JSON.stringify([e, t]), r = Kt
|
|
4016
|
-
return r
|
|
4044
|
+
let n = JSON.stringify([e, t]), r = Kt.get(n);
|
|
4045
|
+
return r === void 0 && (r = new Intl.DateTimeFormat(e, t), Kt.set(n, r)), r;
|
|
4017
4046
|
}
|
|
4018
4047
|
var Jt = /* @__PURE__ */ new Map();
|
|
4019
4048
|
function Yt(e, t = {}) {
|
|
4020
4049
|
let n = JSON.stringify([e, t]), r = Jt.get(n);
|
|
4021
|
-
return r === void 0 && (r = new Intl.
|
|
4050
|
+
return r === void 0 && (r = new Intl.NumberFormat(e, t), Jt.set(n, r)), r;
|
|
4022
4051
|
}
|
|
4023
4052
|
var Xt = /* @__PURE__ */ new Map();
|
|
4024
4053
|
function Zt(e, t = {}) {
|
|
4025
|
-
let n = JSON.stringify([e,
|
|
4026
|
-
return
|
|
4054
|
+
let { base: n, ...r } = t, i = JSON.stringify([e, r]), a = Xt.get(i);
|
|
4055
|
+
return a === void 0 && (a = new Intl.RelativeTimeFormat(e, t), Xt.set(i, a)), a;
|
|
4027
4056
|
}
|
|
4028
|
-
var Qt =
|
|
4029
|
-
function $t(
|
|
4030
|
-
|
|
4031
|
-
return a === void 0 && (a = new Intl.RelativeTimeFormat(e, t), Qt.set(i, a)), a;
|
|
4057
|
+
var Qt = null;
|
|
4058
|
+
function $t() {
|
|
4059
|
+
return Qt || (Qt = new Intl.DateTimeFormat().resolvedOptions().locale, Qt);
|
|
4032
4060
|
}
|
|
4033
|
-
var en =
|
|
4034
|
-
function tn() {
|
|
4035
|
-
|
|
4061
|
+
var en = /* @__PURE__ */ new Map();
|
|
4062
|
+
function tn(e) {
|
|
4063
|
+
let t = en.get(e);
|
|
4064
|
+
return t === void 0 && (t = new Intl.DateTimeFormat(e).resolvedOptions(), en.set(e, t)), t;
|
|
4036
4065
|
}
|
|
4037
4066
|
var nn = /* @__PURE__ */ new Map();
|
|
4038
4067
|
function rn(e) {
|
|
4039
4068
|
let t = nn.get(e);
|
|
4040
|
-
return t === void 0 && (t = new Intl.DateTimeFormat(e).resolvedOptions(), nn.set(e, t)), t;
|
|
4041
|
-
}
|
|
4042
|
-
var an = /* @__PURE__ */ new Map();
|
|
4043
|
-
function on(e) {
|
|
4044
|
-
let t = an.get(e);
|
|
4045
4069
|
if (!t) {
|
|
4046
4070
|
let n = new Intl.Locale(e);
|
|
4047
4071
|
t = "getWeekInfo" in n ? n.getWeekInfo() : n.weekInfo, "minimalDays" in t || (t = {
|
|
4048
|
-
...
|
|
4072
|
+
...mn,
|
|
4049
4073
|
...t
|
|
4050
|
-
}),
|
|
4074
|
+
}), nn.set(e, t);
|
|
4051
4075
|
}
|
|
4052
4076
|
return t;
|
|
4053
4077
|
}
|
|
4054
|
-
function
|
|
4078
|
+
function an(e) {
|
|
4055
4079
|
let t = e.indexOf("-x-");
|
|
4056
4080
|
t !== -1 && (e = e.substring(0, t));
|
|
4057
4081
|
let n = e.indexOf("-u-");
|
|
@@ -4059,10 +4083,10 @@ function sn(e) {
|
|
|
4059
4083
|
{
|
|
4060
4084
|
let t, r;
|
|
4061
4085
|
try {
|
|
4062
|
-
t =
|
|
4086
|
+
t = qt(e).resolvedOptions(), r = e;
|
|
4063
4087
|
} catch {
|
|
4064
4088
|
let i = e.substring(0, n);
|
|
4065
|
-
t =
|
|
4089
|
+
t = qt(i).resolvedOptions(), r = i;
|
|
4066
4090
|
}
|
|
4067
4091
|
let { numberingSystem: i, calendar: a } = t;
|
|
4068
4092
|
return [
|
|
@@ -4072,10 +4096,10 @@ function sn(e) {
|
|
|
4072
4096
|
];
|
|
4073
4097
|
}
|
|
4074
4098
|
}
|
|
4075
|
-
function
|
|
4099
|
+
function on(e, t, n) {
|
|
4076
4100
|
return n || t ? (e.includes("-u-") || (e += "-u"), n && (e += `-ca-${n}`), t && (e += `-nu-${t}`), e) : e;
|
|
4077
4101
|
}
|
|
4078
|
-
function
|
|
4102
|
+
function sn(e) {
|
|
4079
4103
|
let t = [];
|
|
4080
4104
|
for (let n = 1; n <= 12; n++) {
|
|
4081
4105
|
let r = $.utc(2009, n, 1);
|
|
@@ -4083,7 +4107,7 @@ function ln(e) {
|
|
|
4083
4107
|
}
|
|
4084
4108
|
return t;
|
|
4085
4109
|
}
|
|
4086
|
-
function
|
|
4110
|
+
function cn(e) {
|
|
4087
4111
|
let t = [];
|
|
4088
4112
|
for (let n = 1; n <= 7; n++) {
|
|
4089
4113
|
let r = $.utc(2016, 11, 13 + n);
|
|
@@ -4091,14 +4115,14 @@ function un(e) {
|
|
|
4091
4115
|
}
|
|
4092
4116
|
return t;
|
|
4093
4117
|
}
|
|
4094
|
-
function
|
|
4118
|
+
function ln(e, t, n, r) {
|
|
4095
4119
|
let i = e.listingMode();
|
|
4096
4120
|
return i === "error" ? null : i === "en" ? n(t) : r(t);
|
|
4097
4121
|
}
|
|
4098
|
-
function
|
|
4099
|
-
return e.numberingSystem && e.numberingSystem !== "latn" ? !1 : e.numberingSystem === "latn" || !e.locale || e.locale.startsWith("en") ||
|
|
4122
|
+
function un(e) {
|
|
4123
|
+
return e.numberingSystem && e.numberingSystem !== "latn" ? !1 : e.numberingSystem === "latn" || !e.locale || e.locale.startsWith("en") || tn(e.locale).numberingSystem === "latn";
|
|
4100
4124
|
}
|
|
4101
|
-
var
|
|
4125
|
+
var dn = class {
|
|
4102
4126
|
constructor(e, t, n) {
|
|
4103
4127
|
this.padTo = n.padTo || 0, this.floor = n.floor || !1;
|
|
4104
4128
|
let { padTo: r, floor: i, ...a } = n;
|
|
@@ -4107,7 +4131,7 @@ var pn = class {
|
|
|
4107
4131
|
useGrouping: !1,
|
|
4108
4132
|
...n
|
|
4109
4133
|
};
|
|
4110
|
-
n.padTo > 0 && (t.minimumIntegerDigits = n.padTo), this.inf =
|
|
4134
|
+
n.padTo > 0 && (t.minimumIntegerDigits = n.padTo), this.inf = Yt(e, t);
|
|
4111
4135
|
}
|
|
4112
4136
|
}
|
|
4113
4137
|
format(e) {
|
|
@@ -4115,19 +4139,19 @@ var pn = class {
|
|
|
4115
4139
|
let t = this.floor ? Math.floor(e) : e;
|
|
4116
4140
|
return this.inf.format(t);
|
|
4117
4141
|
}
|
|
4118
|
-
return
|
|
4142
|
+
return H(this.floor ? Math.floor(e) : rr(e, 3), this.padTo);
|
|
4119
4143
|
}
|
|
4120
|
-
},
|
|
4144
|
+
}, fn = class {
|
|
4121
4145
|
constructor(e, t, n) {
|
|
4122
4146
|
this.opts = n, this.originalZone = void 0;
|
|
4123
4147
|
let r;
|
|
4124
4148
|
if (this.opts.timeZone) this.dt = e;
|
|
4125
4149
|
else if (e.zone.type === "fixed") {
|
|
4126
4150
|
let t = -1 * (e.offset / 60), n = t >= 0 ? `Etc/GMT+${t}` : `Etc/GMT${t}`;
|
|
4127
|
-
e.offset !== 0 &&
|
|
4151
|
+
e.offset !== 0 && A.create(n).valid ? (r = n, this.dt = e) : (r = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
4128
4152
|
} else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, r = e.zone.name) : (r = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
4129
4153
|
let i = { ...this.opts };
|
|
4130
|
-
i.timeZone = i.timeZone || r, this.dtf =
|
|
4154
|
+
i.timeZone = i.timeZone || r, this.dtf = qt(t, i);
|
|
4131
4155
|
}
|
|
4132
4156
|
format() {
|
|
4133
4157
|
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
@@ -4151,40 +4175,40 @@ var pn = class {
|
|
|
4151
4175
|
resolvedOptions() {
|
|
4152
4176
|
return this.dtf.resolvedOptions();
|
|
4153
4177
|
}
|
|
4154
|
-
},
|
|
4178
|
+
}, pn = class {
|
|
4155
4179
|
constructor(e, t, n) {
|
|
4156
4180
|
this.opts = {
|
|
4157
4181
|
style: "long",
|
|
4158
4182
|
...n
|
|
4159
|
-
}, !t &&
|
|
4183
|
+
}, !t && Yn() && (this.rtf = Zt(e, n));
|
|
4160
4184
|
}
|
|
4161
4185
|
format(e, t) {
|
|
4162
|
-
return this.rtf ? this.rtf.format(e, t) :
|
|
4186
|
+
return this.rtf ? this.rtf.format(e, t) : Pr(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
4163
4187
|
}
|
|
4164
4188
|
formatToParts(e, t) {
|
|
4165
4189
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
4166
4190
|
}
|
|
4167
|
-
},
|
|
4191
|
+
}, mn = {
|
|
4168
4192
|
firstDay: 1,
|
|
4169
4193
|
minimalDays: 4,
|
|
4170
4194
|
weekend: [6, 7]
|
|
4171
|
-
},
|
|
4195
|
+
}, j = class e {
|
|
4172
4196
|
static fromOpts(t) {
|
|
4173
4197
|
return e.create(t.locale, t.numberingSystem, t.outputCalendar, t.weekSettings, t.defaultToEN);
|
|
4174
4198
|
}
|
|
4175
4199
|
static create(t, n, r, i, a = !1) {
|
|
4176
|
-
let o = t ||
|
|
4200
|
+
let o = t || F.defaultLocale, s = o || (a ? "en-US" : $t()), c = n || F.defaultNumberingSystem, l = r || F.defaultOutputCalendar, u = er(i) || F.defaultWeekSettings;
|
|
4177
4201
|
return new e(s, c, l, u, o);
|
|
4178
4202
|
}
|
|
4179
4203
|
static resetCache() {
|
|
4180
|
-
|
|
4204
|
+
Qt = null, Kt.clear(), Jt.clear(), Xt.clear(), en.clear(), nn.clear();
|
|
4181
4205
|
}
|
|
4182
4206
|
static fromObject({ locale: t, numberingSystem: n, outputCalendar: r, weekSettings: i } = {}) {
|
|
4183
4207
|
return e.create(t, n, r, i);
|
|
4184
4208
|
}
|
|
4185
4209
|
constructor(e, t, n, r, i) {
|
|
4186
|
-
let [a, o, s] =
|
|
4187
|
-
this.locale = a, this.numberingSystem = t || o || null, this.outputCalendar = n || s || null, this.weekSettings = r, this.intl =
|
|
4210
|
+
let [a, o, s] = an(e);
|
|
4211
|
+
this.locale = a, this.numberingSystem = t || o || null, this.outputCalendar = n || s || null, this.weekSettings = r, this.intl = on(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = {
|
|
4188
4212
|
format: {},
|
|
4189
4213
|
standalone: {}
|
|
4190
4214
|
}, this.monthsCache = {
|
|
@@ -4193,14 +4217,14 @@ var pn = class {
|
|
|
4193
4217
|
}, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
|
|
4194
4218
|
}
|
|
4195
4219
|
get fastNumbers() {
|
|
4196
|
-
return this.fastNumbersCached ??=
|
|
4220
|
+
return this.fastNumbersCached ??= un(this), this.fastNumbersCached;
|
|
4197
4221
|
}
|
|
4198
4222
|
listingMode() {
|
|
4199
4223
|
let e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
4200
4224
|
return e && t ? "en" : "intl";
|
|
4201
4225
|
}
|
|
4202
4226
|
clone(t) {
|
|
4203
|
-
return !t || Object.getOwnPropertyNames(t).length === 0 ? this : e.create(t.locale || this.specifiedLocale, t.numberingSystem || this.numberingSystem, t.outputCalendar || this.outputCalendar,
|
|
4227
|
+
return !t || Object.getOwnPropertyNames(t).length === 0 ? this : e.create(t.locale || this.specifiedLocale, t.numberingSystem || this.numberingSystem, t.outputCalendar || this.outputCalendar, er(t.weekSettings) || this.weekSettings, t.defaultToEN || !1);
|
|
4204
4228
|
}
|
|
4205
4229
|
redefaultToEN(e = {}) {
|
|
4206
4230
|
return this.clone({
|
|
@@ -4215,7 +4239,7 @@ var pn = class {
|
|
|
4215
4239
|
});
|
|
4216
4240
|
}
|
|
4217
4241
|
months(e, t = !1) {
|
|
4218
|
-
return
|
|
4242
|
+
return ln(this, e, br, () => {
|
|
4219
4243
|
let n = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
4220
4244
|
t &= !n;
|
|
4221
4245
|
let r = t ? {
|
|
@@ -4224,24 +4248,24 @@ var pn = class {
|
|
|
4224
4248
|
} : { month: e }, i = t ? "format" : "standalone";
|
|
4225
4249
|
if (!this.monthsCache[i][e]) {
|
|
4226
4250
|
let t = n ? (e) => this.dtFormatter(e, r).format() : (e) => this.extract(e, r, "month");
|
|
4227
|
-
this.monthsCache[i][e] =
|
|
4251
|
+
this.monthsCache[i][e] = sn(t);
|
|
4228
4252
|
}
|
|
4229
4253
|
return this.monthsCache[i][e];
|
|
4230
4254
|
});
|
|
4231
4255
|
}
|
|
4232
4256
|
weekdays(e, t = !1) {
|
|
4233
|
-
return
|
|
4257
|
+
return ln(this, e, wr, () => {
|
|
4234
4258
|
let n = t ? {
|
|
4235
4259
|
weekday: e,
|
|
4236
4260
|
year: "numeric",
|
|
4237
4261
|
month: "long",
|
|
4238
4262
|
day: "numeric"
|
|
4239
4263
|
} : { weekday: e }, r = t ? "format" : "standalone";
|
|
4240
|
-
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] =
|
|
4264
|
+
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = cn((e) => this.extract(e, n, "weekday"))), this.weekdaysCache[r][e];
|
|
4241
4265
|
});
|
|
4242
4266
|
}
|
|
4243
4267
|
meridiems() {
|
|
4244
|
-
return
|
|
4268
|
+
return ln(this, void 0, () => Tr, () => {
|
|
4245
4269
|
if (!this.meridiemCache) {
|
|
4246
4270
|
let e = {
|
|
4247
4271
|
hour: "numeric",
|
|
@@ -4253,7 +4277,7 @@ var pn = class {
|
|
|
4253
4277
|
});
|
|
4254
4278
|
}
|
|
4255
4279
|
eras(e) {
|
|
4256
|
-
return
|
|
4280
|
+
return ln(this, e, kr, () => {
|
|
4257
4281
|
let t = { era: e };
|
|
4258
4282
|
return this.eraCache[e] || (this.eraCache[e] = [$.utc(-40, 1, 1), $.utc(2017, 1, 1)].map((e) => this.extract(e, t, "era"))), this.eraCache[e];
|
|
4259
4283
|
});
|
|
@@ -4263,22 +4287,22 @@ var pn = class {
|
|
|
4263
4287
|
return r ? r.value : null;
|
|
4264
4288
|
}
|
|
4265
4289
|
numberFormatter(e = {}) {
|
|
4266
|
-
return new
|
|
4290
|
+
return new dn(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
4267
4291
|
}
|
|
4268
4292
|
dtFormatter(e, t = {}) {
|
|
4269
|
-
return new
|
|
4293
|
+
return new fn(e, this.intl, t);
|
|
4270
4294
|
}
|
|
4271
4295
|
relFormatter(e = {}) {
|
|
4272
|
-
return new
|
|
4296
|
+
return new pn(this.intl, this.isEnglish(), e);
|
|
4273
4297
|
}
|
|
4274
4298
|
listFormatter(e = {}) {
|
|
4275
|
-
return
|
|
4299
|
+
return Gt(this.intl, e);
|
|
4276
4300
|
}
|
|
4277
4301
|
isEnglish() {
|
|
4278
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
4302
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || tn(this.intl).locale.startsWith("en-us");
|
|
4279
4303
|
}
|
|
4280
4304
|
getWeekSettings() {
|
|
4281
|
-
return this.weekSettings ? this.weekSettings :
|
|
4305
|
+
return this.weekSettings ? this.weekSettings : Xn() ? rn(this.locale) : mn;
|
|
4282
4306
|
}
|
|
4283
4307
|
getStartOfWeek() {
|
|
4284
4308
|
return this.getWeekSettings().firstDay;
|
|
@@ -4295,9 +4319,9 @@ var pn = class {
|
|
|
4295
4319
|
toString() {
|
|
4296
4320
|
return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;
|
|
4297
4321
|
}
|
|
4298
|
-
},
|
|
4322
|
+
}, hn = null, M = class e extends Ft {
|
|
4299
4323
|
static get utcInstance() {
|
|
4300
|
-
return
|
|
4324
|
+
return hn === null && (hn = new e(0)), hn;
|
|
4301
4325
|
}
|
|
4302
4326
|
static instance(t) {
|
|
4303
4327
|
return t === 0 ? e.utcInstance : new e(t);
|
|
@@ -4305,7 +4329,7 @@ var pn = class {
|
|
|
4305
4329
|
static parseSpecifier(t) {
|
|
4306
4330
|
if (t) {
|
|
4307
4331
|
let n = t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
4308
|
-
if (n) return new e(
|
|
4332
|
+
if (n) return new e(fr(n[1], n[2]));
|
|
4309
4333
|
}
|
|
4310
4334
|
return null;
|
|
4311
4335
|
}
|
|
@@ -4316,16 +4340,16 @@ var pn = class {
|
|
|
4316
4340
|
return "fixed";
|
|
4317
4341
|
}
|
|
4318
4342
|
get name() {
|
|
4319
|
-
return this.fixed === 0 ? "UTC" : `UTC${
|
|
4343
|
+
return this.fixed === 0 ? "UTC" : `UTC${hr(this.fixed, "narrow")}`;
|
|
4320
4344
|
}
|
|
4321
4345
|
get ianaName() {
|
|
4322
|
-
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${
|
|
4346
|
+
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${hr(-this.fixed, "narrow")}`;
|
|
4323
4347
|
}
|
|
4324
4348
|
offsetName() {
|
|
4325
4349
|
return this.name;
|
|
4326
4350
|
}
|
|
4327
4351
|
formatOffset(e, t) {
|
|
4328
|
-
return
|
|
4352
|
+
return hr(this.fixed, t);
|
|
4329
4353
|
}
|
|
4330
4354
|
get isUniversal() {
|
|
4331
4355
|
return !0;
|
|
@@ -4339,7 +4363,7 @@ var pn = class {
|
|
|
4339
4363
|
get isValid() {
|
|
4340
4364
|
return !0;
|
|
4341
4365
|
}
|
|
4342
|
-
},
|
|
4366
|
+
}, gn = class extends Ft {
|
|
4343
4367
|
constructor(e) {
|
|
4344
4368
|
super(), this.zoneName = e;
|
|
4345
4369
|
}
|
|
@@ -4368,16 +4392,16 @@ var pn = class {
|
|
|
4368
4392
|
return !1;
|
|
4369
4393
|
}
|
|
4370
4394
|
};
|
|
4371
|
-
function
|
|
4372
|
-
if (
|
|
4373
|
-
if (e instanceof
|
|
4374
|
-
if (
|
|
4395
|
+
function N(e, t) {
|
|
4396
|
+
if (R(e) || e === null) return t;
|
|
4397
|
+
if (e instanceof Ft) return e;
|
|
4398
|
+
if (qn(e)) {
|
|
4375
4399
|
let n = e.toLowerCase();
|
|
4376
|
-
return n === "default" ? t : n === "local" || n === "system" ?
|
|
4400
|
+
return n === "default" ? t : n === "local" || n === "system" ? Lt.instance : n === "utc" || n === "gmt" ? M.utcInstance : M.parseSpecifier(n) || A.create(e);
|
|
4377
4401
|
}
|
|
4378
|
-
return
|
|
4402
|
+
return z(e) ? M.instance(e) : typeof e == "object" && "offset" in e && typeof e.offset == "function" ? e : new gn(e);
|
|
4379
4403
|
}
|
|
4380
|
-
var
|
|
4404
|
+
var _n = {
|
|
4381
4405
|
arab: "[٠-٩]",
|
|
4382
4406
|
arabext: "[۰-۹]",
|
|
4383
4407
|
bali: "[᭐-᭙]",
|
|
@@ -4399,7 +4423,7 @@ var yn = {
|
|
|
4399
4423
|
thai: "[๐-๙]",
|
|
4400
4424
|
tibt: "[༠-༩]",
|
|
4401
4425
|
latn: "\\d"
|
|
4402
|
-
},
|
|
4426
|
+
}, vn = {
|
|
4403
4427
|
arab: [1632, 1641],
|
|
4404
4428
|
arabext: [1776, 1785],
|
|
4405
4429
|
bali: [6992, 7001],
|
|
@@ -4419,16 +4443,16 @@ var yn = {
|
|
|
4419
4443
|
telu: [3174, 3183],
|
|
4420
4444
|
thai: [3664, 3673],
|
|
4421
4445
|
tibt: [3872, 3881]
|
|
4422
|
-
},
|
|
4423
|
-
function
|
|
4446
|
+
}, yn = _n.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
4447
|
+
function bn(e) {
|
|
4424
4448
|
let t = parseInt(e, 10);
|
|
4425
4449
|
if (isNaN(t)) {
|
|
4426
4450
|
t = "";
|
|
4427
4451
|
for (let n = 0; n < e.length; n++) {
|
|
4428
4452
|
let r = e.charCodeAt(n);
|
|
4429
|
-
if (e[n].search(
|
|
4430
|
-
else for (let e in
|
|
4431
|
-
let [n, i] =
|
|
4453
|
+
if (e[n].search(_n.hanidec) !== -1) t += yn.indexOf(e[n]);
|
|
4454
|
+
else for (let e in vn) {
|
|
4455
|
+
let [n, i] = vn[e];
|
|
4432
4456
|
r >= n && r <= i && (t += r - n);
|
|
4433
4457
|
}
|
|
4434
4458
|
}
|
|
@@ -4436,76 +4460,76 @@ function Sn(e) {
|
|
|
4436
4460
|
}
|
|
4437
4461
|
return t;
|
|
4438
4462
|
}
|
|
4439
|
-
var
|
|
4440
|
-
function
|
|
4441
|
-
|
|
4463
|
+
var xn = /* @__PURE__ */ new Map();
|
|
4464
|
+
function Sn() {
|
|
4465
|
+
xn.clear();
|
|
4442
4466
|
}
|
|
4443
|
-
function
|
|
4444
|
-
let n = e || "latn", r =
|
|
4445
|
-
r === void 0 && (r = /* @__PURE__ */ new Map(),
|
|
4467
|
+
function P({ numberingSystem: e }, t = "") {
|
|
4468
|
+
let n = e || "latn", r = xn.get(n);
|
|
4469
|
+
r === void 0 && (r = /* @__PURE__ */ new Map(), xn.set(n, r));
|
|
4446
4470
|
let i = r.get(t);
|
|
4447
|
-
return i === void 0 && (i = RegExp(`${
|
|
4471
|
+
return i === void 0 && (i = RegExp(`${_n[n]}${t}`), r.set(t, i)), i;
|
|
4448
4472
|
}
|
|
4449
|
-
var
|
|
4473
|
+
var Cn = () => Date.now(), wn = "system", Tn = null, En = null, Dn = null, On = 60, kn, An = null, F = class {
|
|
4450
4474
|
static get now() {
|
|
4451
|
-
return
|
|
4475
|
+
return Cn;
|
|
4452
4476
|
}
|
|
4453
4477
|
static set now(e) {
|
|
4454
|
-
|
|
4478
|
+
Cn = e;
|
|
4455
4479
|
}
|
|
4456
4480
|
static set defaultZone(e) {
|
|
4457
|
-
|
|
4481
|
+
wn = e;
|
|
4458
4482
|
}
|
|
4459
4483
|
static get defaultZone() {
|
|
4460
|
-
return
|
|
4484
|
+
return N(wn, Lt.instance);
|
|
4461
4485
|
}
|
|
4462
4486
|
static get defaultLocale() {
|
|
4463
|
-
return
|
|
4487
|
+
return Tn;
|
|
4464
4488
|
}
|
|
4465
4489
|
static set defaultLocale(e) {
|
|
4466
|
-
|
|
4490
|
+
Tn = e;
|
|
4467
4491
|
}
|
|
4468
4492
|
static get defaultNumberingSystem() {
|
|
4469
|
-
return
|
|
4493
|
+
return En;
|
|
4470
4494
|
}
|
|
4471
4495
|
static set defaultNumberingSystem(e) {
|
|
4472
|
-
|
|
4496
|
+
En = e;
|
|
4473
4497
|
}
|
|
4474
4498
|
static get defaultOutputCalendar() {
|
|
4475
|
-
return
|
|
4499
|
+
return Dn;
|
|
4476
4500
|
}
|
|
4477
4501
|
static set defaultOutputCalendar(e) {
|
|
4478
|
-
|
|
4502
|
+
Dn = e;
|
|
4479
4503
|
}
|
|
4480
4504
|
static get defaultWeekSettings() {
|
|
4481
|
-
return
|
|
4505
|
+
return An;
|
|
4482
4506
|
}
|
|
4483
4507
|
static set defaultWeekSettings(e) {
|
|
4484
|
-
|
|
4508
|
+
An = er(e);
|
|
4485
4509
|
}
|
|
4486
4510
|
static get twoDigitCutoffYear() {
|
|
4487
|
-
return
|
|
4511
|
+
return On;
|
|
4488
4512
|
}
|
|
4489
4513
|
static set twoDigitCutoffYear(e) {
|
|
4490
|
-
|
|
4514
|
+
On = e % 100;
|
|
4491
4515
|
}
|
|
4492
4516
|
static get throwOnInvalid() {
|
|
4493
|
-
return
|
|
4517
|
+
return kn;
|
|
4494
4518
|
}
|
|
4495
4519
|
static set throwOnInvalid(e) {
|
|
4496
|
-
|
|
4520
|
+
kn = e;
|
|
4497
4521
|
}
|
|
4498
4522
|
static resetCaches() {
|
|
4499
|
-
|
|
4523
|
+
j.resetCache(), A.resetCache(), $.resetCache(), Sn();
|
|
4500
4524
|
}
|
|
4501
|
-
},
|
|
4525
|
+
}, I = class {
|
|
4502
4526
|
constructor(e, t) {
|
|
4503
4527
|
this.reason = e, this.explanation = t;
|
|
4504
4528
|
}
|
|
4505
4529
|
toMessage() {
|
|
4506
4530
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
4507
4531
|
}
|
|
4508
|
-
},
|
|
4532
|
+
}, jn = [
|
|
4509
4533
|
0,
|
|
4510
4534
|
31,
|
|
4511
4535
|
59,
|
|
@@ -4518,7 +4542,7 @@ var Tn = () => Date.now(), En = "system", Dn = null, On = null, kn = null, An =
|
|
|
4518
4542
|
273,
|
|
4519
4543
|
304,
|
|
4520
4544
|
334
|
|
4521
|
-
],
|
|
4545
|
+
], Mn = [
|
|
4522
4546
|
0,
|
|
4523
4547
|
31,
|
|
4524
4548
|
60,
|
|
@@ -4532,69 +4556,69 @@ var Tn = () => Date.now(), En = "system", Dn = null, On = null, kn = null, An =
|
|
|
4532
4556
|
305,
|
|
4533
4557
|
335
|
|
4534
4558
|
];
|
|
4535
|
-
function
|
|
4536
|
-
return new
|
|
4559
|
+
function L(e, t) {
|
|
4560
|
+
return new I("unit out of range", `you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`);
|
|
4537
4561
|
}
|
|
4538
|
-
function
|
|
4562
|
+
function Nn(e, t, n) {
|
|
4539
4563
|
let r = new Date(Date.UTC(e, t - 1, n));
|
|
4540
4564
|
e < 100 && e >= 0 && r.setUTCFullYear(r.getUTCFullYear() - 1900);
|
|
4541
4565
|
let i = r.getUTCDay();
|
|
4542
4566
|
return i === 0 ? 7 : i;
|
|
4543
4567
|
}
|
|
4544
|
-
function
|
|
4545
|
-
return n + (
|
|
4568
|
+
function Pn(e, t, n) {
|
|
4569
|
+
return n + (ir(e) ? Mn : jn)[t - 1];
|
|
4546
4570
|
}
|
|
4547
|
-
function
|
|
4548
|
-
let n =
|
|
4571
|
+
function Fn(e, t) {
|
|
4572
|
+
let n = ir(e) ? Mn : jn, r = n.findIndex((e) => e < t), i = t - n[r];
|
|
4549
4573
|
return {
|
|
4550
4574
|
month: r + 1,
|
|
4551
4575
|
day: i
|
|
4552
4576
|
};
|
|
4553
4577
|
}
|
|
4554
|
-
function
|
|
4578
|
+
function In(e, t) {
|
|
4555
4579
|
return (e - t + 7) % 7 + 1;
|
|
4556
4580
|
}
|
|
4557
|
-
function
|
|
4558
|
-
let { year: r, month: i, day: a } = e, o =
|
|
4559
|
-
return c < 1 ? (l = r - 1, c =
|
|
4581
|
+
function Ln(e, t = 4, n = 1) {
|
|
4582
|
+
let { year: r, month: i, day: a } = e, o = Pn(r, i, a), s = In(Nn(r, i, a), n), c = Math.floor((o - s + 14 - t) / 7), l;
|
|
4583
|
+
return c < 1 ? (l = r - 1, c = lr(l, t, n)) : c > lr(r, t, n) ? (l = r + 1, c = 1) : l = r, {
|
|
4560
4584
|
weekYear: l,
|
|
4561
4585
|
weekNumber: c,
|
|
4562
4586
|
weekday: s,
|
|
4563
|
-
...
|
|
4587
|
+
...gr(e)
|
|
4564
4588
|
};
|
|
4565
4589
|
}
|
|
4566
|
-
function
|
|
4567
|
-
let { weekYear: r, weekNumber: i, weekday: a } = e, o =
|
|
4568
|
-
c < 1 ? (l = r - 1, c +=
|
|
4569
|
-
let { month: u, day: d } =
|
|
4590
|
+
function Rn(e, t = 4, n = 1) {
|
|
4591
|
+
let { weekYear: r, weekNumber: i, weekday: a } = e, o = In(Nn(r, 1, t), n), s = ar(r), c = i * 7 + a - o - 7 + t, l;
|
|
4592
|
+
c < 1 ? (l = r - 1, c += ar(l)) : c > s ? (l = r + 1, c -= ar(r)) : l = r;
|
|
4593
|
+
let { month: u, day: d } = Fn(l, c);
|
|
4570
4594
|
return {
|
|
4571
4595
|
year: l,
|
|
4572
4596
|
month: u,
|
|
4573
4597
|
day: d,
|
|
4574
|
-
...
|
|
4598
|
+
...gr(e)
|
|
4575
4599
|
};
|
|
4576
4600
|
}
|
|
4577
|
-
function
|
|
4601
|
+
function zn(e) {
|
|
4578
4602
|
let { year: t, month: n, day: r } = e;
|
|
4579
4603
|
return {
|
|
4580
4604
|
year: t,
|
|
4581
|
-
ordinal:
|
|
4582
|
-
...
|
|
4605
|
+
ordinal: Pn(t, n, r),
|
|
4606
|
+
...gr(e)
|
|
4583
4607
|
};
|
|
4584
4608
|
}
|
|
4585
|
-
function
|
|
4586
|
-
let { year: t, ordinal: n } = e, { month: r, day: i } =
|
|
4609
|
+
function Bn(e) {
|
|
4610
|
+
let { year: t, ordinal: n } = e, { month: r, day: i } = Fn(t, n);
|
|
4587
4611
|
return {
|
|
4588
4612
|
year: t,
|
|
4589
4613
|
month: r,
|
|
4590
4614
|
day: i,
|
|
4591
|
-
...
|
|
4615
|
+
...gr(e)
|
|
4592
4616
|
};
|
|
4593
4617
|
}
|
|
4594
|
-
function
|
|
4595
|
-
if (!
|
|
4596
|
-
if (!
|
|
4597
|
-
return
|
|
4618
|
+
function Vn(e, t) {
|
|
4619
|
+
if (!R(e.localWeekday) || !R(e.localWeekNumber) || !R(e.localWeekYear)) {
|
|
4620
|
+
if (!R(e.weekday) || !R(e.weekNumber) || !R(e.weekYear)) throw new w("Cannot mix locale-based week fields with ISO-based week fields");
|
|
4621
|
+
return R(e.localWeekday) || (e.weekday = e.localWeekday), R(e.localWeekNumber) || (e.weekNumber = e.localWeekNumber), R(e.localWeekYear) || (e.weekYear = e.localWeekYear), delete e.localWeekday, delete e.localWeekNumber, delete e.localWeekYear, {
|
|
4598
4622
|
minDaysInFirstWeek: t.getMinDaysInFirstWeek(),
|
|
4599
4623
|
startOfWeek: t.getStartOfWeek()
|
|
4600
4624
|
};
|
|
@@ -4604,99 +4628,99 @@ function Un(e, t) {
|
|
|
4604
4628
|
startOfWeek: 1
|
|
4605
4629
|
};
|
|
4606
4630
|
}
|
|
4607
|
-
function
|
|
4608
|
-
let r =
|
|
4609
|
-
return r ? i ? !a &&
|
|
4631
|
+
function Hn(e, t = 4, n = 1) {
|
|
4632
|
+
let r = Kn(e.weekYear), i = V(e.weekNumber, 1, lr(e.weekYear, t, n)), a = V(e.weekday, 1, 7);
|
|
4633
|
+
return r ? i ? !a && L("weekday", e.weekday) : L("week", e.weekNumber) : L("weekYear", e.weekYear);
|
|
4610
4634
|
}
|
|
4611
|
-
function
|
|
4612
|
-
let t =
|
|
4613
|
-
return t ? !n &&
|
|
4635
|
+
function Un(e) {
|
|
4636
|
+
let t = Kn(e.year), n = V(e.ordinal, 1, ar(e.year));
|
|
4637
|
+
return t ? !n && L("ordinal", e.ordinal) : L("year", e.year);
|
|
4614
4638
|
}
|
|
4615
|
-
function
|
|
4616
|
-
let t =
|
|
4617
|
-
return t ? n ? !r &&
|
|
4639
|
+
function Wn(e) {
|
|
4640
|
+
let t = Kn(e.year), n = V(e.month, 1, 12), r = V(e.day, 1, or(e.year, e.month));
|
|
4641
|
+
return t ? n ? !r && L("day", e.day) : L("month", e.month) : L("year", e.year);
|
|
4618
4642
|
}
|
|
4619
|
-
function
|
|
4620
|
-
let { hour: t, minute: n, second: r, millisecond: i } = e, a =
|
|
4621
|
-
return a ? o ? s ? !c &&
|
|
4643
|
+
function Gn(e) {
|
|
4644
|
+
let { hour: t, minute: n, second: r, millisecond: i } = e, a = V(t, 0, 23) || t === 24 && n === 0 && r === 0 && i === 0, o = V(n, 0, 59), s = V(r, 0, 59), c = V(i, 0, 999);
|
|
4645
|
+
return a ? o ? s ? !c && L("millisecond", i) : L("second", r) : L("minute", n) : L("hour", t);
|
|
4622
4646
|
}
|
|
4623
|
-
function
|
|
4647
|
+
function R(e) {
|
|
4624
4648
|
return e === void 0;
|
|
4625
4649
|
}
|
|
4626
|
-
function
|
|
4650
|
+
function z(e) {
|
|
4627
4651
|
return typeof e == "number";
|
|
4628
4652
|
}
|
|
4629
|
-
function
|
|
4653
|
+
function Kn(e) {
|
|
4630
4654
|
return typeof e == "number" && e % 1 == 0;
|
|
4631
4655
|
}
|
|
4632
|
-
function
|
|
4656
|
+
function qn(e) {
|
|
4633
4657
|
return typeof e == "string";
|
|
4634
4658
|
}
|
|
4635
|
-
function
|
|
4659
|
+
function Jn(e) {
|
|
4636
4660
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
4637
4661
|
}
|
|
4638
|
-
function
|
|
4662
|
+
function Yn() {
|
|
4639
4663
|
try {
|
|
4640
4664
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
4641
4665
|
} catch {
|
|
4642
4666
|
return !1;
|
|
4643
4667
|
}
|
|
4644
4668
|
}
|
|
4645
|
-
function
|
|
4669
|
+
function Xn() {
|
|
4646
4670
|
try {
|
|
4647
4671
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
4648
4672
|
} catch {
|
|
4649
4673
|
return !1;
|
|
4650
4674
|
}
|
|
4651
4675
|
}
|
|
4652
|
-
function
|
|
4676
|
+
function Zn(e) {
|
|
4653
4677
|
return Array.isArray(e) ? e : [e];
|
|
4654
4678
|
}
|
|
4655
|
-
function
|
|
4679
|
+
function Qn(e, t, n) {
|
|
4656
4680
|
if (e.length !== 0) return e.reduce((e, r) => {
|
|
4657
4681
|
let i = [t(r), r];
|
|
4658
4682
|
return e && n(e[0], i[0]) === e[0] ? e : i;
|
|
4659
4683
|
}, null)[1];
|
|
4660
4684
|
}
|
|
4661
|
-
function
|
|
4685
|
+
function $n(e, t) {
|
|
4662
4686
|
return t.reduce((t, n) => (t[n] = e[n], t), {});
|
|
4663
4687
|
}
|
|
4664
|
-
function
|
|
4688
|
+
function B(e, t) {
|
|
4665
4689
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
4666
4690
|
}
|
|
4667
|
-
function
|
|
4691
|
+
function er(e) {
|
|
4668
4692
|
if (e == null) return null;
|
|
4669
|
-
if (typeof e != "object") throw new
|
|
4670
|
-
if (!
|
|
4693
|
+
if (typeof e != "object") throw new T("Week settings must be an object");
|
|
4694
|
+
if (!V(e.firstDay, 1, 7) || !V(e.minimalDays, 1, 7) || !Array.isArray(e.weekend) || e.weekend.some((e) => !V(e, 1, 7))) throw new T("Invalid week settings");
|
|
4671
4695
|
return {
|
|
4672
4696
|
firstDay: e.firstDay,
|
|
4673
4697
|
minimalDays: e.minimalDays,
|
|
4674
4698
|
weekend: Array.from(e.weekend)
|
|
4675
4699
|
};
|
|
4676
4700
|
}
|
|
4677
|
-
function
|
|
4678
|
-
return
|
|
4701
|
+
function V(e, t, n) {
|
|
4702
|
+
return Kn(e) && e >= t && e <= n;
|
|
4679
4703
|
}
|
|
4680
|
-
function
|
|
4704
|
+
function tr(e, t) {
|
|
4681
4705
|
return e - t * Math.floor(e / t);
|
|
4682
4706
|
}
|
|
4683
|
-
function
|
|
4707
|
+
function H(e, t = 2) {
|
|
4684
4708
|
let n = e < 0, r;
|
|
4685
4709
|
return r = n ? "-" + ("" + -e).padStart(t, "0") : ("" + e).padStart(t, "0"), r;
|
|
4686
4710
|
}
|
|
4687
|
-
function
|
|
4688
|
-
if (!(
|
|
4711
|
+
function U(e) {
|
|
4712
|
+
if (!(R(e) || e === null || e === "")) return parseInt(e, 10);
|
|
4689
4713
|
}
|
|
4690
|
-
function
|
|
4691
|
-
if (!(
|
|
4714
|
+
function W(e) {
|
|
4715
|
+
if (!(R(e) || e === null || e === "")) return parseFloat(e);
|
|
4692
4716
|
}
|
|
4693
|
-
function
|
|
4694
|
-
if (!(
|
|
4717
|
+
function nr(e) {
|
|
4718
|
+
if (!(R(e) || e === null || e === "")) {
|
|
4695
4719
|
let t = parseFloat("0." + e) * 1e3;
|
|
4696
4720
|
return Math.floor(t);
|
|
4697
4721
|
}
|
|
4698
4722
|
}
|
|
4699
|
-
function
|
|
4723
|
+
function rr(e, t, n = "round") {
|
|
4700
4724
|
let r = 10 ** t;
|
|
4701
4725
|
switch (n) {
|
|
4702
4726
|
case "expand": return e > 0 ? Math.ceil(e * r) / r : Math.floor(e * r) / r;
|
|
@@ -4707,15 +4731,15 @@ function or(e, t, n = "round") {
|
|
|
4707
4731
|
default: throw RangeError(`Value rounding ${n} is out of range`);
|
|
4708
4732
|
}
|
|
4709
4733
|
}
|
|
4710
|
-
function
|
|
4734
|
+
function ir(e) {
|
|
4711
4735
|
return e % 4 == 0 && (e % 100 != 0 || e % 400 == 0);
|
|
4712
4736
|
}
|
|
4713
|
-
function
|
|
4714
|
-
return
|
|
4737
|
+
function ar(e) {
|
|
4738
|
+
return ir(e) ? 366 : 365;
|
|
4715
4739
|
}
|
|
4716
|
-
function
|
|
4717
|
-
let n =
|
|
4718
|
-
return n === 2 ?
|
|
4740
|
+
function or(e, t) {
|
|
4741
|
+
let n = tr(t - 1, 12) + 1, r = e + (t - n) / 12;
|
|
4742
|
+
return n === 2 ? ir(r) ? 29 : 28 : [
|
|
4719
4743
|
31,
|
|
4720
4744
|
null,
|
|
4721
4745
|
31,
|
|
@@ -4730,21 +4754,21 @@ function lr(e, t) {
|
|
|
4730
4754
|
31
|
|
4731
4755
|
][n - 1];
|
|
4732
4756
|
}
|
|
4733
|
-
function
|
|
4757
|
+
function sr(e) {
|
|
4734
4758
|
let t = Date.UTC(e.year, e.month - 1, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
4735
4759
|
return e.year < 100 && e.year >= 0 && (t = new Date(t), t.setUTCFullYear(e.year, e.month - 1, e.day)), +t;
|
|
4736
4760
|
}
|
|
4737
|
-
function
|
|
4738
|
-
return -
|
|
4761
|
+
function cr(e, t, n) {
|
|
4762
|
+
return -In(Nn(e, 1, t), n) + t - 1;
|
|
4739
4763
|
}
|
|
4740
|
-
function
|
|
4741
|
-
let r =
|
|
4742
|
-
return (
|
|
4764
|
+
function lr(e, t = 4, n = 1) {
|
|
4765
|
+
let r = cr(e, t, n), i = cr(e + 1, t, n);
|
|
4766
|
+
return (ar(e) - r + i) / 7;
|
|
4743
4767
|
}
|
|
4744
|
-
function
|
|
4745
|
-
return e > 99 ? e : e >
|
|
4768
|
+
function ur(e) {
|
|
4769
|
+
return e > 99 ? e : e > F.twoDigitCutoffYear ? 1900 + e : 2e3 + e;
|
|
4746
4770
|
}
|
|
4747
|
-
function
|
|
4771
|
+
function dr(e, t, n, r = null) {
|
|
4748
4772
|
let i = new Date(e), a = {
|
|
4749
4773
|
hourCycle: "h23",
|
|
4750
4774
|
year: "numeric",
|
|
@@ -4760,44 +4784,44 @@ function mr(e, t, n, r = null) {
|
|
|
4760
4784
|
}, s = new Intl.DateTimeFormat(n, o).formatToParts(i).find((e) => e.type.toLowerCase() === "timezonename");
|
|
4761
4785
|
return s ? s.value : null;
|
|
4762
4786
|
}
|
|
4763
|
-
function
|
|
4787
|
+
function fr(e, t) {
|
|
4764
4788
|
let n = parseInt(e, 10);
|
|
4765
4789
|
Number.isNaN(n) && (n = 0);
|
|
4766
4790
|
let r = parseInt(t, 10) || 0, i = n < 0 || Object.is(n, -0) ? -r : r;
|
|
4767
4791
|
return n * 60 + i;
|
|
4768
4792
|
}
|
|
4769
|
-
function
|
|
4793
|
+
function pr(e) {
|
|
4770
4794
|
let t = Number(e);
|
|
4771
|
-
if (typeof e == "boolean" || e === "" || !Number.isFinite(t)) throw new
|
|
4795
|
+
if (typeof e == "boolean" || e === "" || !Number.isFinite(t)) throw new T(`Invalid unit value ${e}`);
|
|
4772
4796
|
return t;
|
|
4773
4797
|
}
|
|
4774
|
-
function
|
|
4798
|
+
function mr(e, t) {
|
|
4775
4799
|
let n = {};
|
|
4776
|
-
for (let r in e) if (
|
|
4800
|
+
for (let r in e) if (B(e, r)) {
|
|
4777
4801
|
let i = e[r];
|
|
4778
4802
|
if (i == null) continue;
|
|
4779
|
-
n[t(r)] =
|
|
4803
|
+
n[t(r)] = pr(i);
|
|
4780
4804
|
}
|
|
4781
4805
|
return n;
|
|
4782
4806
|
}
|
|
4783
|
-
function
|
|
4807
|
+
function hr(e, t) {
|
|
4784
4808
|
let n = Math.trunc(Math.abs(e / 60)), r = Math.trunc(Math.abs(e % 60)), i = e >= 0 ? "+" : "-";
|
|
4785
4809
|
switch (t) {
|
|
4786
|
-
case "short": return `${i}${
|
|
4810
|
+
case "short": return `${i}${H(n, 2)}:${H(r, 2)}`;
|
|
4787
4811
|
case "narrow": return `${i}${n}${r > 0 ? `:${r}` : ""}`;
|
|
4788
|
-
case "techie": return `${i}${
|
|
4812
|
+
case "techie": return `${i}${H(n, 2)}${H(r, 2)}`;
|
|
4789
4813
|
default: throw RangeError(`Value format ${t} is out of range for property format`);
|
|
4790
4814
|
}
|
|
4791
4815
|
}
|
|
4792
|
-
function
|
|
4793
|
-
return
|
|
4816
|
+
function gr(e) {
|
|
4817
|
+
return $n(e, [
|
|
4794
4818
|
"hour",
|
|
4795
4819
|
"minute",
|
|
4796
4820
|
"second",
|
|
4797
4821
|
"millisecond"
|
|
4798
4822
|
]);
|
|
4799
4823
|
}
|
|
4800
|
-
var
|
|
4824
|
+
var _r = [
|
|
4801
4825
|
"January",
|
|
4802
4826
|
"February",
|
|
4803
4827
|
"March",
|
|
@@ -4810,7 +4834,7 @@ var br = [
|
|
|
4810
4834
|
"October",
|
|
4811
4835
|
"November",
|
|
4812
4836
|
"December"
|
|
4813
|
-
],
|
|
4837
|
+
], vr = [
|
|
4814
4838
|
"Jan",
|
|
4815
4839
|
"Feb",
|
|
4816
4840
|
"Mar",
|
|
@@ -4823,7 +4847,7 @@ var br = [
|
|
|
4823
4847
|
"Oct",
|
|
4824
4848
|
"Nov",
|
|
4825
4849
|
"Dec"
|
|
4826
|
-
],
|
|
4850
|
+
], yr = [
|
|
4827
4851
|
"J",
|
|
4828
4852
|
"F",
|
|
4829
4853
|
"M",
|
|
@@ -4837,11 +4861,11 @@ var br = [
|
|
|
4837
4861
|
"N",
|
|
4838
4862
|
"D"
|
|
4839
4863
|
];
|
|
4840
|
-
function
|
|
4864
|
+
function br(e) {
|
|
4841
4865
|
switch (e) {
|
|
4842
|
-
case "narrow": return [...
|
|
4843
|
-
case "short": return [...
|
|
4844
|
-
case "long": return [...
|
|
4866
|
+
case "narrow": return [...yr];
|
|
4867
|
+
case "short": return [...vr];
|
|
4868
|
+
case "long": return [..._r];
|
|
4845
4869
|
case "numeric": return [
|
|
4846
4870
|
"1",
|
|
4847
4871
|
"2",
|
|
@@ -4873,7 +4897,7 @@ function Cr(e) {
|
|
|
4873
4897
|
default: return null;
|
|
4874
4898
|
}
|
|
4875
4899
|
}
|
|
4876
|
-
var
|
|
4900
|
+
var xr = [
|
|
4877
4901
|
"Monday",
|
|
4878
4902
|
"Tuesday",
|
|
4879
4903
|
"Wednesday",
|
|
@@ -4881,7 +4905,7 @@ var wr = [
|
|
|
4881
4905
|
"Friday",
|
|
4882
4906
|
"Saturday",
|
|
4883
4907
|
"Sunday"
|
|
4884
|
-
],
|
|
4908
|
+
], Sr = [
|
|
4885
4909
|
"Mon",
|
|
4886
4910
|
"Tue",
|
|
4887
4911
|
"Wed",
|
|
@@ -4889,7 +4913,7 @@ var wr = [
|
|
|
4889
4913
|
"Fri",
|
|
4890
4914
|
"Sat",
|
|
4891
4915
|
"Sun"
|
|
4892
|
-
],
|
|
4916
|
+
], Cr = [
|
|
4893
4917
|
"M",
|
|
4894
4918
|
"T",
|
|
4895
4919
|
"W",
|
|
@@ -4898,11 +4922,11 @@ var wr = [
|
|
|
4898
4922
|
"S",
|
|
4899
4923
|
"S"
|
|
4900
4924
|
];
|
|
4901
|
-
function
|
|
4925
|
+
function wr(e) {
|
|
4902
4926
|
switch (e) {
|
|
4903
|
-
case "narrow": return [...
|
|
4904
|
-
case "short": return [...
|
|
4905
|
-
case "long": return [...
|
|
4927
|
+
case "narrow": return [...Cr];
|
|
4928
|
+
case "short": return [...Sr];
|
|
4929
|
+
case "long": return [...xr];
|
|
4906
4930
|
case "numeric": return [
|
|
4907
4931
|
"1",
|
|
4908
4932
|
"2",
|
|
@@ -4915,28 +4939,28 @@ function Dr(e) {
|
|
|
4915
4939
|
default: return null;
|
|
4916
4940
|
}
|
|
4917
4941
|
}
|
|
4918
|
-
var
|
|
4919
|
-
function
|
|
4942
|
+
var Tr = ["AM", "PM"], Er = ["Before Christ", "Anno Domini"], Dr = ["BC", "AD"], Or = ["B", "A"];
|
|
4943
|
+
function kr(e) {
|
|
4920
4944
|
switch (e) {
|
|
4921
|
-
case "narrow": return [...
|
|
4922
|
-
case "short": return [...
|
|
4923
|
-
case "long": return [...
|
|
4945
|
+
case "narrow": return [...Or];
|
|
4946
|
+
case "short": return [...Dr];
|
|
4947
|
+
case "long": return [...Er];
|
|
4924
4948
|
default: return null;
|
|
4925
4949
|
}
|
|
4926
4950
|
}
|
|
4927
|
-
function
|
|
4928
|
-
return
|
|
4951
|
+
function Ar(e) {
|
|
4952
|
+
return Tr[e.hour < 12 ? 0 : 1];
|
|
4929
4953
|
}
|
|
4930
|
-
function
|
|
4931
|
-
return
|
|
4954
|
+
function jr(e, t) {
|
|
4955
|
+
return wr(t)[e.weekday - 1];
|
|
4932
4956
|
}
|
|
4933
|
-
function
|
|
4934
|
-
return
|
|
4957
|
+
function Mr(e, t) {
|
|
4958
|
+
return br(t)[e.month - 1];
|
|
4935
4959
|
}
|
|
4936
|
-
function
|
|
4937
|
-
return
|
|
4960
|
+
function Nr(e, t) {
|
|
4961
|
+
return kr(t)[e.year < 0 ? 0 : 1];
|
|
4938
4962
|
}
|
|
4939
|
-
function
|
|
4963
|
+
function Pr(e, t, n = "always", r = !1) {
|
|
4940
4964
|
let i = {
|
|
4941
4965
|
years: ["year", "yr."],
|
|
4942
4966
|
quarters: ["quarter", "qtr."],
|
|
@@ -4966,33 +4990,33 @@ function Lr(e, t, n = "always", r = !1) {
|
|
|
4966
4990
|
let o = Object.is(t, -0) || t < 0, s = Math.abs(t), c = s === 1, l = i[e], u = r ? c ? l[1] : l[2] || l[1] : c ? i[e][0] : e;
|
|
4967
4991
|
return o ? `${s} ${u} ago` : `in ${s} ${u}`;
|
|
4968
4992
|
}
|
|
4969
|
-
function
|
|
4993
|
+
function Fr(e, t) {
|
|
4970
4994
|
let n = "";
|
|
4971
4995
|
for (let r of e) r.literal ? n += r.val : n += t(r.val);
|
|
4972
4996
|
return n;
|
|
4973
4997
|
}
|
|
4974
|
-
var
|
|
4975
|
-
D:
|
|
4976
|
-
DD:
|
|
4977
|
-
DDD:
|
|
4978
|
-
DDDD:
|
|
4979
|
-
t:
|
|
4980
|
-
tt:
|
|
4981
|
-
ttt:
|
|
4982
|
-
tttt:
|
|
4983
|
-
T:
|
|
4984
|
-
TT:
|
|
4985
|
-
TTT:
|
|
4986
|
-
TTTT:
|
|
4987
|
-
f:
|
|
4988
|
-
ff:
|
|
4989
|
-
fff:
|
|
4990
|
-
ffff:
|
|
4991
|
-
F:
|
|
4992
|
-
FF:
|
|
4993
|
-
FFF:
|
|
4994
|
-
FFFF:
|
|
4995
|
-
},
|
|
4998
|
+
var Ir = {
|
|
4999
|
+
D: pt,
|
|
5000
|
+
DD: mt,
|
|
5001
|
+
DDD: gt,
|
|
5002
|
+
DDDD: _t,
|
|
5003
|
+
t: vt,
|
|
5004
|
+
tt: yt,
|
|
5005
|
+
ttt: bt,
|
|
5006
|
+
tttt: xt,
|
|
5007
|
+
T: St,
|
|
5008
|
+
TT: Ct,
|
|
5009
|
+
TTT: wt,
|
|
5010
|
+
TTTT: Tt,
|
|
5011
|
+
f: Et,
|
|
5012
|
+
ff: Ot,
|
|
5013
|
+
fff: jt,
|
|
5014
|
+
ffff: Nt,
|
|
5015
|
+
F: Dt,
|
|
5016
|
+
FF: kt,
|
|
5017
|
+
FFF: Mt,
|
|
5018
|
+
FFFF: Pt
|
|
5019
|
+
}, G = class e {
|
|
4996
5020
|
static create(t, n = {}) {
|
|
4997
5021
|
return new e(t, n);
|
|
4998
5022
|
}
|
|
@@ -5014,7 +5038,7 @@ var zr = {
|
|
|
5014
5038
|
}), i;
|
|
5015
5039
|
}
|
|
5016
5040
|
static macroTokenToFormatOpts(e) {
|
|
5017
|
-
return
|
|
5041
|
+
return Ir[e];
|
|
5018
5042
|
}
|
|
5019
5043
|
constructor(e, t) {
|
|
5020
5044
|
this.opts = t, this.loc = e, this.systemLoc = null;
|
|
@@ -5044,26 +5068,26 @@ var zr = {
|
|
|
5044
5068
|
return this.dtFormatter(e, t).resolvedOptions();
|
|
5045
5069
|
}
|
|
5046
5070
|
num(e, t = 0, n = void 0) {
|
|
5047
|
-
if (this.opts.forceSimple) return
|
|
5071
|
+
if (this.opts.forceSimple) return H(e, t);
|
|
5048
5072
|
let r = { ...this.opts };
|
|
5049
5073
|
return t > 0 && (r.padTo = t), n && (r.signDisplay = n), this.loc.numberFormatter(r).format(e);
|
|
5050
5074
|
}
|
|
5051
5075
|
formatDateTimeFromString(t, n) {
|
|
5052
|
-
let r = this.loc.listingMode() === "en", i = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (e, n) => this.loc.extract(t, e, n), o = (e) => t.isOffsetFixed && t.offset === 0 && e.allowZ ? "Z" : t.isValid ? t.zone.formatOffset(t.ts, e.format) : "", s = () => r ?
|
|
5076
|
+
let r = this.loc.listingMode() === "en", i = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (e, n) => this.loc.extract(t, e, n), o = (e) => t.isOffsetFixed && t.offset === 0 && e.allowZ ? "Z" : t.isValid ? t.zone.formatOffset(t.ts, e.format) : "", s = () => r ? Ar(t) : a({
|
|
5053
5077
|
hour: "numeric",
|
|
5054
5078
|
hourCycle: "h12"
|
|
5055
|
-
}, "dayperiod"), c = (e, n) => r ?
|
|
5079
|
+
}, "dayperiod"), c = (e, n) => r ? Mr(t, e) : a(n ? { month: e } : {
|
|
5056
5080
|
month: e,
|
|
5057
5081
|
day: "numeric"
|
|
5058
|
-
}, "month"), l = (e, n) => r ?
|
|
5082
|
+
}, "month"), l = (e, n) => r ? jr(t, e) : a(n ? { weekday: e } : {
|
|
5059
5083
|
weekday: e,
|
|
5060
5084
|
month: "long",
|
|
5061
5085
|
day: "numeric"
|
|
5062
5086
|
}, "weekday"), u = (n) => {
|
|
5063
5087
|
let r = e.macroTokenToFormatOpts(n);
|
|
5064
5088
|
return r ? this.formatWithSystemDefault(t, r) : n;
|
|
5065
|
-
}, d = (e) => r ?
|
|
5066
|
-
return
|
|
5089
|
+
}, d = (e) => r ? Nr(t, e) : a({ era: e }, "era");
|
|
5090
|
+
return Fr(e.parseFormat(n), (e) => {
|
|
5067
5091
|
switch (e) {
|
|
5068
5092
|
case "S": return this.num(t.millisecond);
|
|
5069
5093
|
case "u":
|
|
@@ -5172,17 +5196,17 @@ var zr = {
|
|
|
5172
5196
|
}
|
|
5173
5197
|
return n;
|
|
5174
5198
|
}, o = e.parseFormat(n), s = o.reduce((e, { literal: t, val: n }) => t ? e : e.concat(n), []), c = t.shiftTo(...s.map(i).filter((e) => e));
|
|
5175
|
-
return
|
|
5199
|
+
return Fr(o, a(c, {
|
|
5176
5200
|
isNegativeDuration: c < 0,
|
|
5177
5201
|
largestUnit: Object.keys(c.values)[0]
|
|
5178
5202
|
}));
|
|
5179
5203
|
}
|
|
5180
|
-
},
|
|
5181
|
-
function
|
|
5204
|
+
}, Lr = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
5205
|
+
function Rr(...e) {
|
|
5182
5206
|
let t = e.reduce((e, t) => e + t.source, "");
|
|
5183
5207
|
return RegExp(`^${t}$`);
|
|
5184
5208
|
}
|
|
5185
|
-
function
|
|
5209
|
+
function zr(...e) {
|
|
5186
5210
|
return (t) => e.reduce(([e, n, r], i) => {
|
|
5187
5211
|
let [a, o, s] = i(t, r);
|
|
5188
5212
|
return [
|
|
@@ -5199,7 +5223,7 @@ function W(...e) {
|
|
|
5199
5223
|
1
|
|
5200
5224
|
]).slice(0, 2);
|
|
5201
5225
|
}
|
|
5202
|
-
function
|
|
5226
|
+
function Br(e, ...t) {
|
|
5203
5227
|
if (e == null) return [null, null];
|
|
5204
5228
|
for (let [n, r] of t) {
|
|
5205
5229
|
let t = n.exec(e);
|
|
@@ -5210,7 +5234,7 @@ function G(e, ...t) {
|
|
|
5210
5234
|
function Vr(...e) {
|
|
5211
5235
|
return (t, n) => {
|
|
5212
5236
|
let r = {}, i = 0;
|
|
5213
|
-
for (; i < e.length; i++) r[e[i]] =
|
|
5237
|
+
for (; i < e.length; i++) r[e[i]] = U(t[n + i]);
|
|
5214
5238
|
return [
|
|
5215
5239
|
r,
|
|
5216
5240
|
null,
|
|
@@ -5218,10 +5242,10 @@ function Vr(...e) {
|
|
|
5218
5242
|
];
|
|
5219
5243
|
};
|
|
5220
5244
|
}
|
|
5221
|
-
var Hr = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Ur = `(?:${Hr.source}?(?:\\[(${
|
|
5245
|
+
var Hr = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Ur = `(?:${Hr.source}?(?:\\[(${Lr.source})\\])?)?`, Wr = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Gr = RegExp(`${Wr.source}${Ur}`), Kr = RegExp(`(?:[Tt]${Gr.source})?`), qr = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Jr = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Yr = /(\d{4})-?(\d{3})/, Xr = Vr("weekYear", "weekNumber", "weekDay"), Zr = Vr("year", "ordinal"), Qr = /(\d{4})-(\d\d)-(\d\d)/, $r = RegExp(`${Wr.source} ?(?:${Hr.source}|(${Lr.source}))?`), ei = RegExp(`(?: ${$r.source})?`);
|
|
5222
5246
|
function ti(e, t, n) {
|
|
5223
5247
|
let r = e[t];
|
|
5224
|
-
return
|
|
5248
|
+
return R(r) ? n : U(r);
|
|
5225
5249
|
}
|
|
5226
5250
|
function ni(e, t) {
|
|
5227
5251
|
return [
|
|
@@ -5240,24 +5264,24 @@ function ri(e, t) {
|
|
|
5240
5264
|
hours: ti(e, t, 0),
|
|
5241
5265
|
minutes: ti(e, t + 1, 0),
|
|
5242
5266
|
seconds: ti(e, t + 2, 0),
|
|
5243
|
-
milliseconds:
|
|
5267
|
+
milliseconds: nr(e[t + 3])
|
|
5244
5268
|
},
|
|
5245
5269
|
null,
|
|
5246
5270
|
t + 4
|
|
5247
5271
|
];
|
|
5248
5272
|
}
|
|
5249
5273
|
function ii(e, t) {
|
|
5250
|
-
let n = !e[t] && !e[t + 1], r =
|
|
5274
|
+
let n = !e[t] && !e[t + 1], r = fr(e[t + 1], e[t + 2]);
|
|
5251
5275
|
return [
|
|
5252
5276
|
{},
|
|
5253
|
-
n ? null :
|
|
5277
|
+
n ? null : M.instance(r),
|
|
5254
5278
|
t + 3
|
|
5255
5279
|
];
|
|
5256
5280
|
}
|
|
5257
5281
|
function ai(e, t) {
|
|
5258
5282
|
return [
|
|
5259
5283
|
{},
|
|
5260
|
-
e[t] ?
|
|
5284
|
+
e[t] ? A.create(e[t]) : null,
|
|
5261
5285
|
t + 1
|
|
5262
5286
|
];
|
|
5263
5287
|
}
|
|
@@ -5265,14 +5289,14 @@ var oi = RegExp(`^T?${Wr.source}$`), si = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)
|
|
|
5265
5289
|
function ci(e) {
|
|
5266
5290
|
let [t, n, r, i, a, o, s, c, l] = e, u = t[0] === "-", d = c && c[0] === "-", f = (e, t = !1) => e !== void 0 && (t || e && u) ? -e : e;
|
|
5267
5291
|
return [{
|
|
5268
|
-
years: f(
|
|
5269
|
-
months: f(
|
|
5270
|
-
weeks: f(
|
|
5271
|
-
days: f(
|
|
5272
|
-
hours: f(
|
|
5273
|
-
minutes: f(
|
|
5274
|
-
seconds: f(
|
|
5275
|
-
milliseconds: f(
|
|
5292
|
+
years: f(W(n)),
|
|
5293
|
+
months: f(W(r)),
|
|
5294
|
+
weeks: f(W(i)),
|
|
5295
|
+
days: f(W(a)),
|
|
5296
|
+
hours: f(W(o)),
|
|
5297
|
+
minutes: f(W(s)),
|
|
5298
|
+
seconds: f(W(c), c === "-0"),
|
|
5299
|
+
milliseconds: f(nr(l), d)
|
|
5276
5300
|
}];
|
|
5277
5301
|
}
|
|
5278
5302
|
var li = {
|
|
@@ -5288,18 +5312,18 @@ var li = {
|
|
|
5288
5312
|
};
|
|
5289
5313
|
function ui(e, t, n, r, i, a, o) {
|
|
5290
5314
|
let s = {
|
|
5291
|
-
year: t.length === 2 ?
|
|
5292
|
-
month:
|
|
5293
|
-
day:
|
|
5294
|
-
hour:
|
|
5295
|
-
minute:
|
|
5315
|
+
year: t.length === 2 ? ur(U(t)) : U(t),
|
|
5316
|
+
month: vr.indexOf(n) + 1,
|
|
5317
|
+
day: U(r),
|
|
5318
|
+
hour: U(i),
|
|
5319
|
+
minute: U(a)
|
|
5296
5320
|
};
|
|
5297
|
-
return o && (s.second =
|
|
5321
|
+
return o && (s.second = U(o)), e && (s.weekday = e.length > 3 ? xr.indexOf(e) + 1 : Sr.indexOf(e) + 1), s;
|
|
5298
5322
|
}
|
|
5299
5323
|
var di = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
5300
5324
|
function fi(e) {
|
|
5301
5325
|
let [, t, n, r, i, a, o, s, c, l, u, d] = e, f = ui(t, i, r, n, a, o, s), p;
|
|
5302
|
-
return p = c ? li[c] : l ? 0 :
|
|
5326
|
+
return p = c ? li[c] : l ? 0 : fr(u, d), [f, new M(p)];
|
|
5303
5327
|
}
|
|
5304
5328
|
function pi(e) {
|
|
5305
5329
|
return e.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -5307,32 +5331,32 @@ function pi(e) {
|
|
|
5307
5331
|
var mi = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, hi = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, gi = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
5308
5332
|
function _i(e) {
|
|
5309
5333
|
let [, t, n, r, i, a, o, s] = e;
|
|
5310
|
-
return [ui(t, i, r, n, a, o, s),
|
|
5334
|
+
return [ui(t, i, r, n, a, o, s), M.utcInstance];
|
|
5311
5335
|
}
|
|
5312
5336
|
function vi(e) {
|
|
5313
5337
|
let [, t, n, r, i, a, o, s] = e;
|
|
5314
|
-
return [ui(t, s, n, r, i, a, o),
|
|
5338
|
+
return [ui(t, s, n, r, i, a, o), M.utcInstance];
|
|
5315
5339
|
}
|
|
5316
|
-
var yi =
|
|
5340
|
+
var yi = Rr(qr, Kr), bi = Rr(Jr, Kr), xi = Rr(Yr, Kr), Si = Rr(Gr), Ci = zr(ni, ri, ii, ai), wi = zr(Xr, ri, ii, ai), Ti = zr(Zr, ri, ii, ai), Ei = zr(ri, ii, ai);
|
|
5317
5341
|
function Di(e) {
|
|
5318
|
-
return
|
|
5342
|
+
return Br(e, [yi, Ci], [bi, wi], [xi, Ti], [Si, Ei]);
|
|
5319
5343
|
}
|
|
5320
5344
|
function Oi(e) {
|
|
5321
|
-
return
|
|
5345
|
+
return Br(pi(e), [di, fi]);
|
|
5322
5346
|
}
|
|
5323
5347
|
function ki(e) {
|
|
5324
|
-
return
|
|
5348
|
+
return Br(e, [mi, _i], [hi, _i], [gi, vi]);
|
|
5325
5349
|
}
|
|
5326
5350
|
function Ai(e) {
|
|
5327
|
-
return
|
|
5351
|
+
return Br(e, [si, ci]);
|
|
5328
5352
|
}
|
|
5329
|
-
var ji =
|
|
5353
|
+
var ji = zr(ri);
|
|
5330
5354
|
function Mi(e) {
|
|
5331
|
-
return
|
|
5355
|
+
return Br(e, [oi, ji]);
|
|
5332
5356
|
}
|
|
5333
|
-
var Ni =
|
|
5357
|
+
var Ni = Rr(Qr, ei), Pi = Rr($r), Fi = zr(ri, ii, ai);
|
|
5334
5358
|
function Ii(e) {
|
|
5335
|
-
return
|
|
5359
|
+
return Br(e, [Ni, Ci], [Pi, Fi]);
|
|
5336
5360
|
}
|
|
5337
5361
|
var Li = "Invalid Duration", Ri = {
|
|
5338
5362
|
weeks: {
|
|
@@ -5446,14 +5470,14 @@ function Ui(e, t) {
|
|
|
5446
5470
|
function Wi(e, t) {
|
|
5447
5471
|
let n = Ui(e, t) < 0 ? -1 : 1;
|
|
5448
5472
|
q.reduceRight((r, i) => {
|
|
5449
|
-
if (
|
|
5473
|
+
if (R(t[i])) return r;
|
|
5450
5474
|
if (r) {
|
|
5451
5475
|
let a = t[r] * n, o = e[i][r], s = Math.floor(a / o);
|
|
5452
5476
|
t[i] += s * n, t[r] -= s * o * n;
|
|
5453
5477
|
}
|
|
5454
5478
|
return i;
|
|
5455
5479
|
}, null), q.reduce((n, r) => {
|
|
5456
|
-
if (
|
|
5480
|
+
if (R(t[r])) return n;
|
|
5457
5481
|
if (n) {
|
|
5458
5482
|
let i = t[n] % 1;
|
|
5459
5483
|
t[n] -= i, t[r] += i * e[n][r];
|
|
@@ -5469,25 +5493,25 @@ function Gi(e) {
|
|
|
5469
5493
|
var Y = class e {
|
|
5470
5494
|
constructor(e) {
|
|
5471
5495
|
let t = e.conversionAccuracy === "longterm" || !1, n = t ? Vi : zi;
|
|
5472
|
-
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc ||
|
|
5496
|
+
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc || j.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = n, this.isLuxonDuration = !0;
|
|
5473
5497
|
}
|
|
5474
5498
|
static fromMillis(t, n) {
|
|
5475
5499
|
return e.fromObject({ milliseconds: t }, n);
|
|
5476
5500
|
}
|
|
5477
5501
|
static fromObject(t, n = {}) {
|
|
5478
|
-
if (typeof t != "object" || !t) throw new
|
|
5502
|
+
if (typeof t != "object" || !t) throw new T(`Duration.fromObject: argument expected to be an object, got ${t === null ? "null" : typeof t}`);
|
|
5479
5503
|
return new e({
|
|
5480
|
-
values:
|
|
5481
|
-
loc:
|
|
5504
|
+
values: mr(t, e.normalizeUnit),
|
|
5505
|
+
loc: j.fromObject(n),
|
|
5482
5506
|
conversionAccuracy: n.conversionAccuracy,
|
|
5483
5507
|
matrix: n.matrix
|
|
5484
5508
|
});
|
|
5485
5509
|
}
|
|
5486
5510
|
static fromDurationLike(t) {
|
|
5487
|
-
if (
|
|
5511
|
+
if (z(t)) return e.fromMillis(t);
|
|
5488
5512
|
if (e.isDuration(t)) return t;
|
|
5489
5513
|
if (typeof t == "object") return e.fromObject(t);
|
|
5490
|
-
throw new
|
|
5514
|
+
throw new T(`Unknown duration argument ${t} of type ${typeof t}`);
|
|
5491
5515
|
}
|
|
5492
5516
|
static fromISO(t, n) {
|
|
5493
5517
|
let [r] = Ai(t);
|
|
@@ -5498,9 +5522,9 @@ var Y = class e {
|
|
|
5498
5522
|
return r ? e.fromObject(r, n) : e.invalid("unparsable", `the input "${t}" can't be parsed as ISO 8601`);
|
|
5499
5523
|
}
|
|
5500
5524
|
static invalid(t, n = null) {
|
|
5501
|
-
if (!t) throw new
|
|
5502
|
-
let r = t instanceof
|
|
5503
|
-
if (
|
|
5525
|
+
if (!t) throw new T("need to specify a reason the Duration is invalid");
|
|
5526
|
+
let r = t instanceof I ? t : new I(t, n);
|
|
5527
|
+
if (F.throwOnInvalid) throw new dt(r);
|
|
5504
5528
|
return new e({ invalid: r });
|
|
5505
5529
|
}
|
|
5506
5530
|
static normalizeUnit(e) {
|
|
@@ -5524,7 +5548,7 @@ var Y = class e {
|
|
|
5524
5548
|
millisecond: "milliseconds",
|
|
5525
5549
|
milliseconds: "milliseconds"
|
|
5526
5550
|
}[e && e.toLowerCase()];
|
|
5527
|
-
if (!t) throw new
|
|
5551
|
+
if (!t) throw new ft(e);
|
|
5528
5552
|
return t;
|
|
5529
5553
|
}
|
|
5530
5554
|
static isDuration(e) {
|
|
@@ -5541,13 +5565,13 @@ var Y = class e {
|
|
|
5541
5565
|
...t,
|
|
5542
5566
|
floor: t.round !== !1 && t.floor !== !1
|
|
5543
5567
|
};
|
|
5544
|
-
return this.isValid ?
|
|
5568
|
+
return this.isValid ? G.create(this.loc, n).formatDurationFromString(this, e) : Li;
|
|
5545
5569
|
}
|
|
5546
5570
|
toHuman(e = {}) {
|
|
5547
5571
|
if (!this.isValid) return Li;
|
|
5548
5572
|
let t = e.showZeros !== !1, n = q.map((n) => {
|
|
5549
5573
|
let r = this.values[n];
|
|
5550
|
-
return
|
|
5574
|
+
return R(r) || r === 0 && !t ? null : this.loc.numberFormatter({
|
|
5551
5575
|
style: "unit",
|
|
5552
5576
|
unitDisplay: "long",
|
|
5553
5577
|
...e,
|
|
@@ -5566,7 +5590,7 @@ var Y = class e {
|
|
|
5566
5590
|
toISO() {
|
|
5567
5591
|
if (!this.isValid) return null;
|
|
5568
5592
|
let e = "P";
|
|
5569
|
-
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e +=
|
|
5593
|
+
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += rr(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
|
|
5570
5594
|
}
|
|
5571
5595
|
toISOTime(e = {}) {
|
|
5572
5596
|
if (!this.isValid) return null;
|
|
@@ -5598,7 +5622,7 @@ var Y = class e {
|
|
|
5598
5622
|
plus(t) {
|
|
5599
5623
|
if (!this.isValid) return this;
|
|
5600
5624
|
let n = e.fromDurationLike(t), r = {};
|
|
5601
|
-
for (let e of q) (
|
|
5625
|
+
for (let e of q) (B(n.values, e) || B(this.values, e)) && (r[e] = n.get(e) + this.get(e));
|
|
5602
5626
|
return J(this, { values: r }, !0);
|
|
5603
5627
|
}
|
|
5604
5628
|
minus(t) {
|
|
@@ -5609,7 +5633,7 @@ var Y = class e {
|
|
|
5609
5633
|
mapUnits(e) {
|
|
5610
5634
|
if (!this.isValid) return this;
|
|
5611
5635
|
let t = {};
|
|
5612
|
-
for (let n of Object.keys(this.values)) t[n] =
|
|
5636
|
+
for (let n of Object.keys(this.values)) t[n] = pr(e(this.values[n], n));
|
|
5613
5637
|
return J(this, { values: t }, !0);
|
|
5614
5638
|
}
|
|
5615
5639
|
get(t) {
|
|
@@ -5619,7 +5643,7 @@ var Y = class e {
|
|
|
5619
5643
|
if (!this.isValid) return this;
|
|
5620
5644
|
let n = {
|
|
5621
5645
|
...this.values,
|
|
5622
|
-
...
|
|
5646
|
+
...mr(t, e.normalizeUnit)
|
|
5623
5647
|
};
|
|
5624
5648
|
return J(this, { values: n });
|
|
5625
5649
|
}
|
|
@@ -5655,10 +5679,10 @@ var Y = class e {
|
|
|
5655
5679
|
a = e;
|
|
5656
5680
|
let t = 0;
|
|
5657
5681
|
for (let n in r) t += this.matrix[n][e] * r[n], r[n] = 0;
|
|
5658
|
-
|
|
5682
|
+
z(i[e]) && (t += i[e]);
|
|
5659
5683
|
let o = Math.trunc(t);
|
|
5660
5684
|
n[e] = o, r[e] = (t * 1e3 - o * 1e3) / 1e3;
|
|
5661
|
-
} else
|
|
5685
|
+
} else z(i[e]) && (r[e] = i[e]);
|
|
5662
5686
|
for (let e in r) r[e] !== 0 && (n[a] += e === a ? r[e] : r[e] / this.matrix[a][e]);
|
|
5663
5687
|
return Wi(this.matrix, n), J(this, { values: n }, !0);
|
|
5664
5688
|
}
|
|
@@ -5729,9 +5753,9 @@ var Ji = class e {
|
|
|
5729
5753
|
this.s = e.start, this.e = e.end, this.invalid = e.invalid || null, this.isLuxonInterval = !0;
|
|
5730
5754
|
}
|
|
5731
5755
|
static invalid(t, n = null) {
|
|
5732
|
-
if (!t) throw new
|
|
5733
|
-
let r = t instanceof
|
|
5734
|
-
if (
|
|
5756
|
+
if (!t) throw new T("need to specify a reason the Interval is invalid");
|
|
5757
|
+
let r = t instanceof I ? t : new I(t, n);
|
|
5758
|
+
if (F.throwOnInvalid) throw new ut(r);
|
|
5735
5759
|
return new e({ invalid: r });
|
|
5736
5760
|
}
|
|
5737
5761
|
static fromDateTimes(t, n) {
|
|
@@ -5893,8 +5917,8 @@ var Ji = class e {
|
|
|
5893
5917
|
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
5894
5918
|
return this.isValid ? `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }` : `Interval { Invalid, reason: ${this.invalidReason} }`;
|
|
5895
5919
|
}
|
|
5896
|
-
toLocaleString(e =
|
|
5897
|
-
return this.isValid ?
|
|
5920
|
+
toLocaleString(e = pt, t = {}) {
|
|
5921
|
+
return this.isValid ? G.create(this.s.loc.clone(t), e).formatInterval(this) : Ki;
|
|
5898
5922
|
}
|
|
5899
5923
|
toISO(e) {
|
|
5900
5924
|
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` : Ki;
|
|
@@ -5915,47 +5939,47 @@ var Ji = class e {
|
|
|
5915
5939
|
return e.fromDateTimes(t(this.s), t(this.e));
|
|
5916
5940
|
}
|
|
5917
5941
|
}, Yi = class {
|
|
5918
|
-
static hasDST(e =
|
|
5942
|
+
static hasDST(e = F.defaultZone) {
|
|
5919
5943
|
let t = $.now().setZone(e).set({ month: 12 });
|
|
5920
5944
|
return !e.isUniversal && t.offset !== t.set({ month: 6 }).offset;
|
|
5921
5945
|
}
|
|
5922
5946
|
static isValidIANAZone(e) {
|
|
5923
|
-
return
|
|
5947
|
+
return A.isValidZone(e);
|
|
5924
5948
|
}
|
|
5925
5949
|
static normalizeZone(e) {
|
|
5926
|
-
return
|
|
5950
|
+
return N(e, F.defaultZone);
|
|
5927
5951
|
}
|
|
5928
5952
|
static getStartOfWeek({ locale: e = null, locObj: t = null } = {}) {
|
|
5929
|
-
return (t ||
|
|
5953
|
+
return (t || j.create(e)).getStartOfWeek();
|
|
5930
5954
|
}
|
|
5931
5955
|
static getMinimumDaysInFirstWeek({ locale: e = null, locObj: t = null } = {}) {
|
|
5932
|
-
return (t ||
|
|
5956
|
+
return (t || j.create(e)).getMinDaysInFirstWeek();
|
|
5933
5957
|
}
|
|
5934
5958
|
static getWeekendWeekdays({ locale: e = null, locObj: t = null } = {}) {
|
|
5935
|
-
return (t ||
|
|
5959
|
+
return (t || j.create(e)).getWeekendDays().slice();
|
|
5936
5960
|
}
|
|
5937
5961
|
static months(e = "long", { locale: t = null, numberingSystem: n = null, locObj: r = null, outputCalendar: i = "gregory" } = {}) {
|
|
5938
|
-
return (r ||
|
|
5962
|
+
return (r || j.create(t, n, i)).months(e);
|
|
5939
5963
|
}
|
|
5940
5964
|
static monthsFormat(e = "long", { locale: t = null, numberingSystem: n = null, locObj: r = null, outputCalendar: i = "gregory" } = {}) {
|
|
5941
|
-
return (r ||
|
|
5965
|
+
return (r || j.create(t, n, i)).months(e, !0);
|
|
5942
5966
|
}
|
|
5943
5967
|
static weekdays(e = "long", { locale: t = null, numberingSystem: n = null, locObj: r = null } = {}) {
|
|
5944
|
-
return (r ||
|
|
5968
|
+
return (r || j.create(t, n, null)).weekdays(e);
|
|
5945
5969
|
}
|
|
5946
5970
|
static weekdaysFormat(e = "long", { locale: t = null, numberingSystem: n = null, locObj: r = null } = {}) {
|
|
5947
|
-
return (r ||
|
|
5971
|
+
return (r || j.create(t, n, null)).weekdays(e, !0);
|
|
5948
5972
|
}
|
|
5949
5973
|
static meridiems({ locale: e = null } = {}) {
|
|
5950
|
-
return
|
|
5974
|
+
return j.create(e).meridiems();
|
|
5951
5975
|
}
|
|
5952
5976
|
static eras(e = "short", { locale: t = null } = {}) {
|
|
5953
|
-
return
|
|
5977
|
+
return j.create(t, null, "gregory").eras(e);
|
|
5954
5978
|
}
|
|
5955
5979
|
static features() {
|
|
5956
5980
|
return {
|
|
5957
|
-
relative:
|
|
5958
|
-
localeWeek:
|
|
5981
|
+
relative: Yn(),
|
|
5982
|
+
localeWeek: Xn()
|
|
5959
5983
|
};
|
|
5960
5984
|
}
|
|
5961
5985
|
};
|
|
@@ -5997,7 +6021,7 @@ var $i = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
5997
6021
|
function X(e, t = (e) => e) {
|
|
5998
6022
|
return {
|
|
5999
6023
|
regex: e,
|
|
6000
|
-
deser: ([e]) => t(
|
|
6024
|
+
deser: ([e]) => t(bn(e))
|
|
6001
6025
|
};
|
|
6002
6026
|
}
|
|
6003
6027
|
var ea = "[ \xA0]", ta = new RegExp(ea, "g");
|
|
@@ -6016,7 +6040,7 @@ function Z(e, t) {
|
|
|
6016
6040
|
function ia(e, t) {
|
|
6017
6041
|
return {
|
|
6018
6042
|
regex: e,
|
|
6019
|
-
deser: ([, e, t]) =>
|
|
6043
|
+
deser: ([, e, t]) => fr(e, t),
|
|
6020
6044
|
groups: t
|
|
6021
6045
|
};
|
|
6022
6046
|
}
|
|
@@ -6030,7 +6054,7 @@ function oa(e) {
|
|
|
6030
6054
|
return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
6031
6055
|
}
|
|
6032
6056
|
function sa(e, t) {
|
|
6033
|
-
let n =
|
|
6057
|
+
let n = P(t), r = P(t, "{2}"), i = P(t, "{3}"), a = P(t, "{4}"), o = P(t, "{6}"), s = P(t, "{1,2}"), c = P(t, "{1,3}"), l = P(t, "{1,6}"), u = P(t, "{1,9}"), d = P(t, "{2,4}"), f = P(t, "{4,6}"), p = (e) => ({
|
|
6034
6058
|
regex: RegExp(oa(e.val)),
|
|
6035
6059
|
deser: ([e]) => e,
|
|
6036
6060
|
literal: !0
|
|
@@ -6040,7 +6064,7 @@ function sa(e, t) {
|
|
|
6040
6064
|
case "G": return Z(t.eras("short"), 0);
|
|
6041
6065
|
case "GG": return Z(t.eras("long"), 0);
|
|
6042
6066
|
case "y": return X(l);
|
|
6043
|
-
case "yy": return X(d,
|
|
6067
|
+
case "yy": return X(d, ur);
|
|
6044
6068
|
case "yyyy": return X(a);
|
|
6045
6069
|
case "yyyyy": return X(f);
|
|
6046
6070
|
case "yyyyyy": return X(o);
|
|
@@ -6073,7 +6097,7 @@ function sa(e, t) {
|
|
|
6073
6097
|
case "uuu": return X(n);
|
|
6074
6098
|
case "a": return Z(t.meridiems(), 0);
|
|
6075
6099
|
case "kkkk": return X(a);
|
|
6076
|
-
case "kk": return X(d,
|
|
6100
|
+
case "kk": return X(d, ur);
|
|
6077
6101
|
case "W": return X(s);
|
|
6078
6102
|
case "WW": return X(r);
|
|
6079
6103
|
case "E":
|
|
@@ -6158,7 +6182,7 @@ function da(e, t, n) {
|
|
|
6158
6182
|
let r = e.match(t);
|
|
6159
6183
|
if (r) {
|
|
6160
6184
|
let e = {}, t = 1;
|
|
6161
|
-
for (let i in n) if (
|
|
6185
|
+
for (let i in n) if (B(n, i)) {
|
|
6162
6186
|
let a = n[i], o = a.groups ? a.groups + 1 : 1;
|
|
6163
6187
|
!a.literal && a.token && (e[a.token.val[0]] = a.deser(r.slice(t, t + o))), t += o;
|
|
6164
6188
|
}
|
|
@@ -6187,7 +6211,7 @@ function fa(e) {
|
|
|
6187
6211
|
default: return null;
|
|
6188
6212
|
}
|
|
6189
6213
|
}, n = null, r;
|
|
6190
|
-
return
|
|
6214
|
+
return R(e.z) || (n = A.create(e.z)), R(e.Z) || (n ||= new M(e.Z), r = e.Z), R(e.q) || (e.M = (e.q - 1) * 3 + 1), R(e.h) || (e.h < 12 && e.a === 1 ? e.h += 12 : e.h === 12 && e.a === 0 && (e.h = 0)), e.G === 0 && e.y && (e.y = -e.y), R(e.u) || (e.S = nr(e.u)), [
|
|
6191
6215
|
Object.keys(e).reduce((n, r) => {
|
|
6192
6216
|
let i = t(r);
|
|
6193
6217
|
return i && (n[i] = e[r]), n;
|
|
@@ -6202,7 +6226,7 @@ function ma() {
|
|
|
6202
6226
|
}
|
|
6203
6227
|
function ha(e, t) {
|
|
6204
6228
|
if (e.literal) return e;
|
|
6205
|
-
let n = ba(
|
|
6229
|
+
let n = ba(G.macroTokenToFormatOpts(e.val), t);
|
|
6206
6230
|
return n == null || n.includes(void 0) ? e : n;
|
|
6207
6231
|
}
|
|
6208
6232
|
function ga(e, t) {
|
|
@@ -6210,7 +6234,7 @@ function ga(e, t) {
|
|
|
6210
6234
|
}
|
|
6211
6235
|
var _a = class {
|
|
6212
6236
|
constructor(e, t) {
|
|
6213
|
-
if (this.locale = e, this.format = t, this.tokens = ga(
|
|
6237
|
+
if (this.locale = e, this.format = t, this.tokens = ga(G.parseFormat(t), e), this.units = this.tokens.map((t) => sa(t, e)), this.disqualifyingUnit = this.units.find((e) => e.invalidReason), !this.disqualifyingUnit) {
|
|
6214
6238
|
let [e, t] = ua(this.units);
|
|
6215
6239
|
this.regex = RegExp(e, "i"), this.handlers = t;
|
|
6216
6240
|
}
|
|
@@ -6222,7 +6246,7 @@ var _a = class {
|
|
|
6222
6246
|
null,
|
|
6223
6247
|
void 0
|
|
6224
6248
|
];
|
|
6225
|
-
if (
|
|
6249
|
+
if (B(n, "a") && B(n, "H")) throw new w("Can't include meridiem when specifying 24-hour format");
|
|
6226
6250
|
return {
|
|
6227
6251
|
input: e,
|
|
6228
6252
|
tokens: this.tokens,
|
|
@@ -6261,18 +6285,18 @@ function ya(e, t, n) {
|
|
|
6261
6285
|
}
|
|
6262
6286
|
function ba(e, t) {
|
|
6263
6287
|
if (!e) return null;
|
|
6264
|
-
let n =
|
|
6288
|
+
let n = G.create(t, e).dtFormatter(ma()), r = n.formatToParts(), i = n.resolvedOptions();
|
|
6265
6289
|
return r.map((t) => la(t, e, i));
|
|
6266
6290
|
}
|
|
6267
6291
|
var xa = "Invalid DateTime", Sa = 864e13;
|
|
6268
6292
|
function Ca(e) {
|
|
6269
|
-
return new
|
|
6293
|
+
return new I("unsupported zone", `the zone "${e.name}" is not supported`);
|
|
6270
6294
|
}
|
|
6271
6295
|
function wa(e) {
|
|
6272
|
-
return e.weekData === null && (e.weekData =
|
|
6296
|
+
return e.weekData === null && (e.weekData = Ln(e.c)), e.weekData;
|
|
6273
6297
|
}
|
|
6274
6298
|
function Ta(e) {
|
|
6275
|
-
return e.localWeekData === null && (e.localWeekData =
|
|
6299
|
+
return e.localWeekData === null && (e.localWeekData = Ln(e.c, e.loc.getMinDaysInFirstWeek(), e.loc.getStartOfWeek())), e.localWeekData;
|
|
6276
6300
|
}
|
|
6277
6301
|
function Q(e, t) {
|
|
6278
6302
|
let n = {
|
|
@@ -6310,14 +6334,14 @@ function Da(e, t) {
|
|
|
6310
6334
|
};
|
|
6311
6335
|
}
|
|
6312
6336
|
function Oa(e, t, n) {
|
|
6313
|
-
return Ea(
|
|
6337
|
+
return Ea(sr(e), t, n);
|
|
6314
6338
|
}
|
|
6315
6339
|
function ka(e, t) {
|
|
6316
6340
|
let n = e.o, r = e.c.year + Math.trunc(t.years), i = e.c.month + Math.trunc(t.months) + Math.trunc(t.quarters) * 3, a = {
|
|
6317
6341
|
...e.c,
|
|
6318
6342
|
year: r,
|
|
6319
6343
|
month: i,
|
|
6320
|
-
day: Math.min(e.c.day,
|
|
6344
|
+
day: Math.min(e.c.day, or(r, i)) + Math.trunc(t.days) + Math.trunc(t.weeks) * 7
|
|
6321
6345
|
}, o = Y.fromObject({
|
|
6322
6346
|
years: t.years - Math.trunc(t.years),
|
|
6323
6347
|
quarters: t.quarters - Math.trunc(t.quarters),
|
|
@@ -6328,7 +6352,7 @@ function ka(e, t) {
|
|
|
6328
6352
|
minutes: t.minutes,
|
|
6329
6353
|
seconds: t.seconds,
|
|
6330
6354
|
milliseconds: t.milliseconds
|
|
6331
|
-
}).as("milliseconds"), [s, c] = Ea(
|
|
6355
|
+
}).as("milliseconds"), [s, c] = Ea(sr(a), n, e.zone);
|
|
6332
6356
|
return o !== 0 && (s += o, c = e.zone.offset(s)), {
|
|
6333
6357
|
ts: s,
|
|
6334
6358
|
o: c
|
|
@@ -6344,22 +6368,22 @@ function Aa(e, t, n, r, i, a) {
|
|
|
6344
6368
|
});
|
|
6345
6369
|
return o ? i : i.setZone(s);
|
|
6346
6370
|
}
|
|
6347
|
-
return $.invalid(new
|
|
6371
|
+
return $.invalid(new I("unparsable", `the input "${i}" can't be parsed as ${r}`));
|
|
6348
6372
|
}
|
|
6349
6373
|
function ja(e, t, n = !0) {
|
|
6350
|
-
return e.isValid ?
|
|
6374
|
+
return e.isValid ? G.create(j.create("en-US"), {
|
|
6351
6375
|
allowZ: n,
|
|
6352
6376
|
forceSimple: !0
|
|
6353
6377
|
}).formatDateTimeFromString(e, t) : null;
|
|
6354
6378
|
}
|
|
6355
6379
|
function Ma(e, t, n) {
|
|
6356
6380
|
let r = e.c.year > 9999 || e.c.year < 0, i = "";
|
|
6357
|
-
if (r && e.c.year >= 0 && (i += "+"), i +=
|
|
6381
|
+
if (r && e.c.year >= 0 && (i += "+"), i += H(e.c.year, r ? 6 : 4), n === "year") return i;
|
|
6358
6382
|
if (t) {
|
|
6359
|
-
if (i += "-", i +=
|
|
6383
|
+
if (i += "-", i += H(e.c.month), n === "month") return i;
|
|
6360
6384
|
i += "-";
|
|
6361
|
-
} else if (i +=
|
|
6362
|
-
return i +=
|
|
6385
|
+
} else if (i += H(e.c.month), n === "month") return i;
|
|
6386
|
+
return i += H(e.c.day), i;
|
|
6363
6387
|
}
|
|
6364
6388
|
function Na(e, t, n, r, i, a, o) {
|
|
6365
6389
|
let s = !n || e.c.millisecond !== 0 || e.c.second !== 0, c = "";
|
|
@@ -6368,18 +6392,18 @@ function Na(e, t, n, r, i, a, o) {
|
|
|
6368
6392
|
case "month":
|
|
6369
6393
|
case "year": break;
|
|
6370
6394
|
default:
|
|
6371
|
-
if (c +=
|
|
6395
|
+
if (c += H(e.c.hour), o === "hour") break;
|
|
6372
6396
|
if (t) {
|
|
6373
|
-
if (c += ":", c +=
|
|
6374
|
-
s && (c += ":", c +=
|
|
6397
|
+
if (c += ":", c += H(e.c.minute), o === "minute") break;
|
|
6398
|
+
s && (c += ":", c += H(e.c.second));
|
|
6375
6399
|
} else {
|
|
6376
|
-
if (c +=
|
|
6377
|
-
s && (c +=
|
|
6400
|
+
if (c += H(e.c.minute), o === "minute") break;
|
|
6401
|
+
s && (c += H(e.c.second));
|
|
6378
6402
|
}
|
|
6379
6403
|
if (o === "second") break;
|
|
6380
|
-
s && (!r || e.c.millisecond !== 0) && (c += ".", c +=
|
|
6404
|
+
s && (!r || e.c.millisecond !== 0) && (c += ".", c += H(e.c.millisecond, 3));
|
|
6381
6405
|
}
|
|
6382
|
-
return i && (e.isOffsetFixed && e.offset === 0 && !a ? c += "Z" : e.o < 0 ? (c += "-", c +=
|
|
6406
|
+
return i && (e.isOffsetFixed && e.offset === 0 && !a ? c += "Z" : e.o < 0 ? (c += "-", c += H(Math.trunc(-e.o / 60)), c += ":", c += H(Math.trunc(-e.o % 60))) : (c += "+", c += H(Math.trunc(e.o / 60)), c += ":", c += H(Math.trunc(e.o % 60)))), a && (c += "[" + e.zone.ianaName + "]"), c;
|
|
6383
6407
|
}
|
|
6384
6408
|
var Pa = {
|
|
6385
6409
|
month: 1,
|
|
@@ -6452,7 +6476,7 @@ function Ba(e) {
|
|
|
6452
6476
|
weekyears: "weekYear",
|
|
6453
6477
|
ordinal: "ordinal"
|
|
6454
6478
|
}[e.toLowerCase()];
|
|
6455
|
-
if (!t) throw new
|
|
6479
|
+
if (!t) throw new ft(e);
|
|
6456
6480
|
return t;
|
|
6457
6481
|
}
|
|
6458
6482
|
function Va(e) {
|
|
@@ -6467,18 +6491,18 @@ function Va(e) {
|
|
|
6467
6491
|
}
|
|
6468
6492
|
}
|
|
6469
6493
|
function Ha(e) {
|
|
6470
|
-
if (Ka === void 0 && (Ka =
|
|
6494
|
+
if (Ka === void 0 && (Ka = F.now()), e.type !== "iana") return e.offset(Ka);
|
|
6471
6495
|
let t = e.name, n = qa.get(t);
|
|
6472
6496
|
return n === void 0 && (n = e.offset(Ka), qa.set(t, n)), n;
|
|
6473
6497
|
}
|
|
6474
6498
|
function Ua(e, t) {
|
|
6475
|
-
let n =
|
|
6499
|
+
let n = N(t.zone, F.defaultZone);
|
|
6476
6500
|
if (!n.isValid) return $.invalid(Ca(n));
|
|
6477
|
-
let r =
|
|
6478
|
-
if (
|
|
6501
|
+
let r = j.fromObject(t), i, a;
|
|
6502
|
+
if (R(e.year)) i = F.now();
|
|
6479
6503
|
else {
|
|
6480
|
-
for (let t of La)
|
|
6481
|
-
let t =
|
|
6504
|
+
for (let t of La) R(e[t]) && (e[t] = Pa[t]);
|
|
6505
|
+
let t = Wn(e) || Gn(e);
|
|
6482
6506
|
if (t) return $.invalid(t);
|
|
6483
6507
|
let r = Ha(n);
|
|
6484
6508
|
[i, a] = Oa(e, r, n);
|
|
@@ -6491,7 +6515,7 @@ function Ua(e, t) {
|
|
|
6491
6515
|
});
|
|
6492
6516
|
}
|
|
6493
6517
|
function Wa(e, t, n) {
|
|
6494
|
-
let r =
|
|
6518
|
+
let r = R(n.round) ? !0 : n.round, i = R(n.rounding) ? "trunc" : n.rounding, a = (e, a) => (e = rr(e, r || n.calendary ? 0 : 2, n.calendary ? "round" : i), t.loc.clone(n).relFormatter(n).format(e, a)), o = (r) => n.calendary ? t.hasSame(e, r) ? 0 : t.startOf(r).diff(e.startOf(r), r).get(r) : t.diff(e, r).get(r);
|
|
6495
6519
|
if (n.unit) return a(o(n.unit), n.unit);
|
|
6496
6520
|
for (let e of n.units) {
|
|
6497
6521
|
let t = o(e);
|
|
@@ -6505,17 +6529,17 @@ function Ga(e) {
|
|
|
6505
6529
|
}
|
|
6506
6530
|
var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
6507
6531
|
constructor(e) {
|
|
6508
|
-
let t = e.zone ||
|
|
6509
|
-
this.ts =
|
|
6532
|
+
let t = e.zone || F.defaultZone, n = e.invalid || (Number.isNaN(e.ts) ? new I("invalid input") : null) || (t.isValid ? null : Ca(t));
|
|
6533
|
+
this.ts = R(e.ts) ? F.now() : e.ts;
|
|
6510
6534
|
let r = null, i = null;
|
|
6511
6535
|
if (!n) {
|
|
6512
6536
|
if (e.old && e.old.ts === this.ts && e.old.zone.equals(t)) [r, i] = [e.old.c, e.old.o];
|
|
6513
6537
|
else {
|
|
6514
|
-
let a =
|
|
6515
|
-
r = Da(this.ts, a), n = Number.isNaN(r.year) ? new
|
|
6538
|
+
let a = z(e.o) && !e.old ? e.o : t.offset(this.ts);
|
|
6539
|
+
r = Da(this.ts, a), n = Number.isNaN(r.year) ? new I("invalid input") : null, r = n ? null : r, i = n ? null : a;
|
|
6516
6540
|
}
|
|
6517
6541
|
}
|
|
6518
|
-
this._zone = t, this.loc = e.loc ||
|
|
6542
|
+
this._zone = t, this.loc = e.loc || j.create(), this.invalid = n, this.weekData = null, this.localWeekData = null, this.c = r, this.o = i, this.isLuxonDateTime = !0;
|
|
6519
6543
|
}
|
|
6520
6544
|
static now() {
|
|
6521
6545
|
return new e({});
|
|
@@ -6534,7 +6558,7 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6534
6558
|
}
|
|
6535
6559
|
static utc() {
|
|
6536
6560
|
let [e, t] = Ga(arguments), [n, r, i, a, o, s, c] = t;
|
|
6537
|
-
return e.zone =
|
|
6561
|
+
return e.zone = M.utcInstance, Ua({
|
|
6538
6562
|
year: n,
|
|
6539
6563
|
month: r,
|
|
6540
6564
|
day: i,
|
|
@@ -6545,54 +6569,54 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6545
6569
|
}, e);
|
|
6546
6570
|
}
|
|
6547
6571
|
static fromJSDate(t, n = {}) {
|
|
6548
|
-
let r =
|
|
6572
|
+
let r = Jn(t) ? t.valueOf() : NaN;
|
|
6549
6573
|
if (Number.isNaN(r)) return e.invalid("invalid input");
|
|
6550
|
-
let i =
|
|
6574
|
+
let i = N(n.zone, F.defaultZone);
|
|
6551
6575
|
return i.isValid ? new e({
|
|
6552
6576
|
ts: r,
|
|
6553
6577
|
zone: i,
|
|
6554
|
-
loc:
|
|
6578
|
+
loc: j.fromObject(n)
|
|
6555
6579
|
}) : e.invalid(Ca(i));
|
|
6556
6580
|
}
|
|
6557
6581
|
static fromMillis(t, n = {}) {
|
|
6558
|
-
if (!
|
|
6582
|
+
if (!z(t)) throw new T(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);
|
|
6559
6583
|
return t < -864e13 || t > Sa ? e.invalid("Timestamp out of range") : new e({
|
|
6560
6584
|
ts: t,
|
|
6561
|
-
zone:
|
|
6562
|
-
loc:
|
|
6585
|
+
zone: N(n.zone, F.defaultZone),
|
|
6586
|
+
loc: j.fromObject(n)
|
|
6563
6587
|
});
|
|
6564
6588
|
}
|
|
6565
6589
|
static fromSeconds(t, n = {}) {
|
|
6566
|
-
if (
|
|
6590
|
+
if (z(t)) return new e({
|
|
6567
6591
|
ts: t * 1e3,
|
|
6568
|
-
zone:
|
|
6569
|
-
loc:
|
|
6592
|
+
zone: N(n.zone, F.defaultZone),
|
|
6593
|
+
loc: j.fromObject(n)
|
|
6570
6594
|
});
|
|
6571
|
-
throw new
|
|
6595
|
+
throw new T("fromSeconds requires a numerical input");
|
|
6572
6596
|
}
|
|
6573
6597
|
static fromObject(t, n = {}) {
|
|
6574
6598
|
t ||= {};
|
|
6575
|
-
let r =
|
|
6599
|
+
let r = N(n.zone, F.defaultZone);
|
|
6576
6600
|
if (!r.isValid) return e.invalid(Ca(r));
|
|
6577
|
-
let i =
|
|
6578
|
-
if ((p || u) && m) throw new
|
|
6579
|
-
if (f && u) throw new
|
|
6580
|
-
let ee = m || a.weekday && !p,
|
|
6581
|
-
ee ? (
|
|
6582
|
-
let
|
|
6583
|
-
for (let e of
|
|
6601
|
+
let i = j.fromObject(n), a = mr(t, Va), { minDaysInFirstWeek: o, startOfWeek: s } = Vn(a, i), c = F.now(), l = R(n.specificOffset) ? r.offset(c) : n.specificOffset, u = !R(a.ordinal), d = !R(a.year), f = !R(a.month) || !R(a.day), p = d || f, m = a.weekYear || a.weekNumber;
|
|
6602
|
+
if ((p || u) && m) throw new w("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
|
|
6603
|
+
if (f && u) throw new w("Can't mix ordinal dates with month/day");
|
|
6604
|
+
let ee = m || a.weekday && !p, h, g, _ = Da(c, l);
|
|
6605
|
+
ee ? (h = Ra, g = Fa, _ = Ln(_, o, s)) : u ? (h = za, g = Ia, _ = zn(_)) : (h = La, g = Pa);
|
|
6606
|
+
let te = !1;
|
|
6607
|
+
for (let e of h) {
|
|
6584
6608
|
let t = a[e];
|
|
6585
|
-
|
|
6609
|
+
R(t) ? a[e] = te ? g[e] : _[e] : te = !0;
|
|
6586
6610
|
}
|
|
6587
|
-
let
|
|
6588
|
-
if (
|
|
6589
|
-
let [
|
|
6590
|
-
ts:
|
|
6611
|
+
let ne = (ee ? Hn(a, o, s) : u ? Un(a) : Wn(a)) || Gn(a);
|
|
6612
|
+
if (ne) return e.invalid(ne);
|
|
6613
|
+
let [re, ie] = Oa(ee ? Rn(a, o, s) : u ? Bn(a) : a, l, r), v = new e({
|
|
6614
|
+
ts: re,
|
|
6591
6615
|
zone: r,
|
|
6592
|
-
o:
|
|
6616
|
+
o: ie,
|
|
6593
6617
|
loc: i
|
|
6594
6618
|
});
|
|
6595
|
-
return a.weekday && p && t.weekday !==
|
|
6619
|
+
return a.weekday && p && t.weekday !== v.weekday ? e.invalid("mismatched weekday", `you can't specify both a weekday of ${a.weekday} and a date of ${v.toISO()}`) : v.isValid ? v : e.invalid(v.invalid);
|
|
6596
6620
|
}
|
|
6597
6621
|
static fromISO(e, t = {}) {
|
|
6598
6622
|
let [n, r] = Di(e);
|
|
@@ -6607,8 +6631,8 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6607
6631
|
return Aa(n, r, t, "HTTP", t);
|
|
6608
6632
|
}
|
|
6609
6633
|
static fromFormat(t, n, r = {}) {
|
|
6610
|
-
if (
|
|
6611
|
-
let { locale: i = null, numberingSystem: a = null } = r, [o, s, c, l] = ya(
|
|
6634
|
+
if (R(t) || R(n)) throw new T("fromFormat requires an input string and a format");
|
|
6635
|
+
let { locale: i = null, numberingSystem: a = null } = r, [o, s, c, l] = ya(j.fromOpts({
|
|
6612
6636
|
locale: i,
|
|
6613
6637
|
numberingSystem: a,
|
|
6614
6638
|
defaultToEN: !0
|
|
@@ -6623,20 +6647,20 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6623
6647
|
return Aa(n, r, t, "SQL", e);
|
|
6624
6648
|
}
|
|
6625
6649
|
static invalid(t, n = null) {
|
|
6626
|
-
if (!t) throw new
|
|
6627
|
-
let r = t instanceof
|
|
6628
|
-
if (
|
|
6650
|
+
if (!t) throw new T("need to specify a reason the DateTime is invalid");
|
|
6651
|
+
let r = t instanceof I ? t : new I(t, n);
|
|
6652
|
+
if (F.throwOnInvalid) throw new lt(r);
|
|
6629
6653
|
return new e({ invalid: r });
|
|
6630
6654
|
}
|
|
6631
6655
|
static isDateTime(e) {
|
|
6632
6656
|
return e && e.isLuxonDateTime || !1;
|
|
6633
6657
|
}
|
|
6634
6658
|
static parseFormatForOpts(e, t = {}) {
|
|
6635
|
-
let n = ba(e,
|
|
6659
|
+
let n = ba(e, j.fromObject(t));
|
|
6636
6660
|
return n ? n.map((e) => e ? e.val : null).join("") : null;
|
|
6637
6661
|
}
|
|
6638
6662
|
static expandFormat(e, t = {}) {
|
|
6639
|
-
return ga(
|
|
6663
|
+
return ga(G.parseFormat(e), j.fromObject(t)).map((e) => e.val).join("");
|
|
6640
6664
|
}
|
|
6641
6665
|
static resetCache() {
|
|
6642
6666
|
Ka = void 0, qa.clear();
|
|
@@ -6714,7 +6738,7 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6714
6738
|
return this.isValid ? Ta(this).weekYear : NaN;
|
|
6715
6739
|
}
|
|
6716
6740
|
get ordinal() {
|
|
6717
|
-
return this.isValid ?
|
|
6741
|
+
return this.isValid ? zn(this.c).ordinal : NaN;
|
|
6718
6742
|
}
|
|
6719
6743
|
get monthShort() {
|
|
6720
6744
|
return this.isValid ? Yi.months("short", { locObj: this.loc })[this.month - 1] : null;
|
|
@@ -6754,28 +6778,28 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6754
6778
|
}
|
|
6755
6779
|
getPossibleOffsets() {
|
|
6756
6780
|
if (!this.isValid || this.isOffsetFixed) return [this];
|
|
6757
|
-
let e = 864e5, t = 6e4, n =
|
|
6781
|
+
let e = 864e5, t = 6e4, n = sr(this.c), r = this.zone.offset(n - e), i = this.zone.offset(n + e), a = this.zone.offset(n - r * t), o = this.zone.offset(n - i * t);
|
|
6758
6782
|
if (a === o) return [this];
|
|
6759
6783
|
let s = n - a * t, c = n - o * t, l = Da(s, a), u = Da(c, o);
|
|
6760
6784
|
return l.hour === u.hour && l.minute === u.minute && l.second === u.second && l.millisecond === u.millisecond ? [Q(this, { ts: s }), Q(this, { ts: c })] : [this];
|
|
6761
6785
|
}
|
|
6762
6786
|
get isInLeapYear() {
|
|
6763
|
-
return
|
|
6787
|
+
return ir(this.year);
|
|
6764
6788
|
}
|
|
6765
6789
|
get daysInMonth() {
|
|
6766
|
-
return
|
|
6790
|
+
return or(this.year, this.month);
|
|
6767
6791
|
}
|
|
6768
6792
|
get daysInYear() {
|
|
6769
|
-
return this.isValid ?
|
|
6793
|
+
return this.isValid ? ar(this.year) : NaN;
|
|
6770
6794
|
}
|
|
6771
6795
|
get weeksInWeekYear() {
|
|
6772
|
-
return this.isValid ?
|
|
6796
|
+
return this.isValid ? lr(this.weekYear) : NaN;
|
|
6773
6797
|
}
|
|
6774
6798
|
get weeksInLocalWeekYear() {
|
|
6775
|
-
return this.isValid ?
|
|
6799
|
+
return this.isValid ? lr(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN;
|
|
6776
6800
|
}
|
|
6777
6801
|
resolvedLocaleOptions(e = {}) {
|
|
6778
|
-
let { locale: t, numberingSystem: n, calendar: r } =
|
|
6802
|
+
let { locale: t, numberingSystem: n, calendar: r } = G.create(this.loc.clone(e), e).resolvedOptions(this);
|
|
6779
6803
|
return {
|
|
6780
6804
|
locale: t,
|
|
6781
6805
|
numberingSystem: n,
|
|
@@ -6783,13 +6807,13 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6783
6807
|
};
|
|
6784
6808
|
}
|
|
6785
6809
|
toUTC(e = 0, t = {}) {
|
|
6786
|
-
return this.setZone(
|
|
6810
|
+
return this.setZone(M.instance(e), t);
|
|
6787
6811
|
}
|
|
6788
6812
|
toLocal() {
|
|
6789
|
-
return this.setZone(
|
|
6813
|
+
return this.setZone(F.defaultZone);
|
|
6790
6814
|
}
|
|
6791
6815
|
setZone(t, { keepLocalTime: n = !1, keepCalendarTime: r = !1 } = {}) {
|
|
6792
|
-
if (t =
|
|
6816
|
+
if (t = N(t, F.defaultZone), t.equals(this.zone)) return this;
|
|
6793
6817
|
if (t.isValid) {
|
|
6794
6818
|
let e = this.ts;
|
|
6795
6819
|
if (n || r) {
|
|
@@ -6816,18 +6840,18 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6816
6840
|
}
|
|
6817
6841
|
set(e) {
|
|
6818
6842
|
if (!this.isValid) return this;
|
|
6819
|
-
let t =
|
|
6820
|
-
if ((c || a) && l) throw new
|
|
6821
|
-
if (s && a) throw new
|
|
6843
|
+
let t = mr(e, Va), { minDaysInFirstWeek: n, startOfWeek: r } = Vn(t, this.loc), i = !R(t.weekYear) || !R(t.weekNumber) || !R(t.weekday), a = !R(t.ordinal), o = !R(t.year), s = !R(t.month) || !R(t.day), c = o || s, l = t.weekYear || t.weekNumber;
|
|
6844
|
+
if ((c || a) && l) throw new w("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
|
|
6845
|
+
if (s && a) throw new w("Can't mix ordinal dates with month/day");
|
|
6822
6846
|
let u;
|
|
6823
|
-
i ? u =
|
|
6824
|
-
...
|
|
6847
|
+
i ? u = Rn({
|
|
6848
|
+
...Ln(this.c, n, r),
|
|
6825
6849
|
...t
|
|
6826
|
-
}, n, r) :
|
|
6850
|
+
}, n, r) : R(t.ordinal) ? (u = {
|
|
6827
6851
|
...this.toObject(),
|
|
6828
6852
|
...t
|
|
6829
|
-
},
|
|
6830
|
-
...
|
|
6853
|
+
}, R(t.day) && (u.day = Math.min(or(u.year, u.month), u.day))) : u = Bn({
|
|
6854
|
+
...zn(this.c),
|
|
6831
6855
|
...t
|
|
6832
6856
|
});
|
|
6833
6857
|
let [d, f] = Oa(u, this.o, this.zone);
|
|
@@ -6871,13 +6895,13 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6871
6895
|
return this.isValid ? this.plus({ [e]: 1 }).startOf(e, t).minus(1) : this;
|
|
6872
6896
|
}
|
|
6873
6897
|
toFormat(e, t = {}) {
|
|
6874
|
-
return this.isValid ?
|
|
6898
|
+
return this.isValid ? G.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : xa;
|
|
6875
6899
|
}
|
|
6876
|
-
toLocaleString(e =
|
|
6877
|
-
return this.isValid ?
|
|
6900
|
+
toLocaleString(e = pt, t = {}) {
|
|
6901
|
+
return this.isValid ? G.create(this.loc.clone(t), e).formatDateTime(this) : xa;
|
|
6878
6902
|
}
|
|
6879
6903
|
toLocaleParts(e = {}) {
|
|
6880
|
-
return this.isValid ?
|
|
6904
|
+
return this.isValid ? G.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
|
|
6881
6905
|
}
|
|
6882
6906
|
toISO({ format: e = "extended", suppressSeconds: t = !1, suppressMilliseconds: n = !1, includeOffset: r = !0, extendedZone: i = !1, precision: a = "milliseconds" } = {}) {
|
|
6883
6907
|
if (!this.isValid) return null;
|
|
@@ -6948,7 +6972,7 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6948
6972
|
locale: this.locale,
|
|
6949
6973
|
numberingSystem: this.numberingSystem,
|
|
6950
6974
|
...n
|
|
6951
|
-
}, i =
|
|
6975
|
+
}, i = Zn(t).map(Y.normalizeUnit), a = e.valueOf() > this.valueOf(), o = Qi(a ? this : e, a ? e : this, i, r);
|
|
6952
6976
|
return a ? o.negate() : o;
|
|
6953
6977
|
}
|
|
6954
6978
|
diffNow(t = "milliseconds", n = {}) {
|
|
@@ -6995,16 +7019,16 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
6995
7019
|
}) : null;
|
|
6996
7020
|
}
|
|
6997
7021
|
static min(...t) {
|
|
6998
|
-
if (!t.every(e.isDateTime)) throw new
|
|
6999
|
-
return
|
|
7022
|
+
if (!t.every(e.isDateTime)) throw new T("min requires all arguments be DateTimes");
|
|
7023
|
+
return Qn(t, (e) => e.valueOf(), Math.min);
|
|
7000
7024
|
}
|
|
7001
7025
|
static max(...t) {
|
|
7002
|
-
if (!t.every(e.isDateTime)) throw new
|
|
7003
|
-
return
|
|
7026
|
+
if (!t.every(e.isDateTime)) throw new T("max requires all arguments be DateTimes");
|
|
7027
|
+
return Qn(t, (e) => e.valueOf(), Math.max);
|
|
7004
7028
|
}
|
|
7005
7029
|
static fromFormatExplain(e, t, n = {}) {
|
|
7006
7030
|
let { locale: r = null, numberingSystem: i = null } = n;
|
|
7007
|
-
return va(
|
|
7031
|
+
return va(j.fromOpts({
|
|
7008
7032
|
locale: r,
|
|
7009
7033
|
numberingSystem: i,
|
|
7010
7034
|
defaultToEN: !0
|
|
@@ -7015,95 +7039,95 @@ var Ka, qa = /* @__PURE__ */ new Map(), $ = class e {
|
|
|
7015
7039
|
}
|
|
7016
7040
|
static buildFormatParser(e, t = {}) {
|
|
7017
7041
|
let { locale: n = null, numberingSystem: r = null } = t;
|
|
7018
|
-
return new _a(
|
|
7042
|
+
return new _a(j.fromOpts({
|
|
7019
7043
|
locale: n,
|
|
7020
7044
|
numberingSystem: r,
|
|
7021
7045
|
defaultToEN: !0
|
|
7022
7046
|
}), e);
|
|
7023
7047
|
}
|
|
7024
7048
|
static fromFormatParser(t, n, r = {}) {
|
|
7025
|
-
if (
|
|
7026
|
-
let { locale: i = null, numberingSystem: a = null } = r, o =
|
|
7049
|
+
if (R(t) || R(n)) throw new T("fromFormatParser requires an input string and a format parser");
|
|
7050
|
+
let { locale: i = null, numberingSystem: a = null } = r, o = j.fromOpts({
|
|
7027
7051
|
locale: i,
|
|
7028
7052
|
numberingSystem: a,
|
|
7029
7053
|
defaultToEN: !0
|
|
7030
7054
|
});
|
|
7031
|
-
if (!o.equals(n.locale)) throw new
|
|
7055
|
+
if (!o.equals(n.locale)) throw new T(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);
|
|
7032
7056
|
let { result: s, zone: c, specificOffset: l, invalidReason: u } = n.explainFromTokens(t);
|
|
7033
7057
|
return u ? e.invalid(u) : Aa(s, c, r, `format ${n.format}`, t, l);
|
|
7034
7058
|
}
|
|
7035
7059
|
static get DATE_SHORT() {
|
|
7036
|
-
return
|
|
7060
|
+
return pt;
|
|
7037
7061
|
}
|
|
7038
7062
|
static get DATE_MED() {
|
|
7039
|
-
return
|
|
7063
|
+
return mt;
|
|
7040
7064
|
}
|
|
7041
7065
|
static get DATE_MED_WITH_WEEKDAY() {
|
|
7042
|
-
return
|
|
7066
|
+
return ht;
|
|
7043
7067
|
}
|
|
7044
7068
|
static get DATE_FULL() {
|
|
7045
|
-
return
|
|
7069
|
+
return gt;
|
|
7046
7070
|
}
|
|
7047
7071
|
static get DATE_HUGE() {
|
|
7048
|
-
return
|
|
7072
|
+
return _t;
|
|
7049
7073
|
}
|
|
7050
7074
|
static get TIME_SIMPLE() {
|
|
7051
|
-
return
|
|
7075
|
+
return vt;
|
|
7052
7076
|
}
|
|
7053
7077
|
static get TIME_WITH_SECONDS() {
|
|
7054
|
-
return
|
|
7078
|
+
return yt;
|
|
7055
7079
|
}
|
|
7056
7080
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
7057
|
-
return
|
|
7081
|
+
return bt;
|
|
7058
7082
|
}
|
|
7059
7083
|
static get TIME_WITH_LONG_OFFSET() {
|
|
7060
|
-
return
|
|
7084
|
+
return xt;
|
|
7061
7085
|
}
|
|
7062
7086
|
static get TIME_24_SIMPLE() {
|
|
7063
|
-
return
|
|
7087
|
+
return St;
|
|
7064
7088
|
}
|
|
7065
7089
|
static get TIME_24_WITH_SECONDS() {
|
|
7066
|
-
return
|
|
7090
|
+
return Ct;
|
|
7067
7091
|
}
|
|
7068
7092
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
7069
|
-
return
|
|
7093
|
+
return wt;
|
|
7070
7094
|
}
|
|
7071
7095
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
7072
|
-
return
|
|
7096
|
+
return Tt;
|
|
7073
7097
|
}
|
|
7074
7098
|
static get DATETIME_SHORT() {
|
|
7075
|
-
return
|
|
7099
|
+
return Et;
|
|
7076
7100
|
}
|
|
7077
7101
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
7078
|
-
return
|
|
7102
|
+
return Dt;
|
|
7079
7103
|
}
|
|
7080
7104
|
static get DATETIME_MED() {
|
|
7081
|
-
return
|
|
7105
|
+
return Ot;
|
|
7082
7106
|
}
|
|
7083
7107
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
7084
|
-
return
|
|
7108
|
+
return kt;
|
|
7085
7109
|
}
|
|
7086
7110
|
static get DATETIME_MED_WITH_WEEKDAY() {
|
|
7087
|
-
return
|
|
7111
|
+
return At;
|
|
7088
7112
|
}
|
|
7089
7113
|
static get DATETIME_FULL() {
|
|
7090
|
-
return
|
|
7114
|
+
return jt;
|
|
7091
7115
|
}
|
|
7092
7116
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
7093
|
-
return
|
|
7117
|
+
return Mt;
|
|
7094
7118
|
}
|
|
7095
7119
|
static get DATETIME_HUGE() {
|
|
7096
|
-
return
|
|
7120
|
+
return Nt;
|
|
7097
7121
|
}
|
|
7098
7122
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
7099
|
-
return
|
|
7123
|
+
return Pt;
|
|
7100
7124
|
}
|
|
7101
7125
|
};
|
|
7102
7126
|
function Ja(e) {
|
|
7103
7127
|
if ($.isDateTime(e)) return e;
|
|
7104
|
-
if (e && e.valueOf &&
|
|
7128
|
+
if (e && e.valueOf && z(e.valueOf())) return $.fromJSDate(e);
|
|
7105
7129
|
if (e && typeof e == "object") return $.fromObject(e);
|
|
7106
|
-
throw new
|
|
7130
|
+
throw new T(`Unknown datetime argument: ${e}, of type ${typeof e}`);
|
|
7107
7131
|
}
|
|
7108
7132
|
//#endregion
|
|
7109
7133
|
//#region generated/regionTowns.ts
|
|
@@ -7358,7 +7382,7 @@ function To(e, t, n) {
|
|
|
7358
7382
|
}
|
|
7359
7383
|
//#endregion
|
|
7360
7384
|
//#region core/result/resolve.ts
|
|
7361
|
-
var Eo = new Set(
|
|
7385
|
+
var Eo = new Set(ue);
|
|
7362
7386
|
function Do(e) {
|
|
7363
7387
|
if (Eo.has(e.current_stage ?? "")) return e.current_stage;
|
|
7364
7388
|
let t = {
|
|
@@ -7369,18 +7393,18 @@ function Do(e) {
|
|
|
7369
7393
|
exception: "failed_attempt"
|
|
7370
7394
|
}[e.status ?? "unknown"];
|
|
7371
7395
|
if (!t) return null;
|
|
7372
|
-
let n =
|
|
7396
|
+
let n = st(e.last_status_text ?? "", t).stage, r = e.events?.[0]?.stage;
|
|
7373
7397
|
return n === "pending" && Eo.has(r ?? "") ? r : n;
|
|
7374
7398
|
}
|
|
7375
7399
|
function Oo(e) {
|
|
7376
7400
|
let t = Do(e);
|
|
7377
7401
|
return !!(t && t !== "pending") || (e.events ?? []).some((e) => {
|
|
7378
7402
|
let t = Eo.has(e.stage ?? "") ? e.stage : void 0;
|
|
7379
|
-
return !!(t && t !== "pending") || !!(e.description &&
|
|
7403
|
+
return !!(t && t !== "pending") || !!(e.description && st(e.description, "pending").stage !== "pending");
|
|
7380
7404
|
});
|
|
7381
7405
|
}
|
|
7382
7406
|
function ko(e, t = "in_transit") {
|
|
7383
|
-
return
|
|
7407
|
+
return st(e, t);
|
|
7384
7408
|
}
|
|
7385
7409
|
function Ao(e, t = "in_transit") {
|
|
7386
7410
|
return ko(e, t).stage;
|
|
@@ -7389,8 +7413,8 @@ function jo(e, t, n) {
|
|
|
7389
7413
|
return Eo.has(e) ? typeof n == "string" && n.length <= 100 && (n === "none" || n === "carrier_map" || /^wording:[a-z0-9_]+$/.test(n)) ? n : "carrier_map" : ko(t).source;
|
|
7390
7414
|
}
|
|
7391
7415
|
function Mo(e) {
|
|
7392
|
-
let t =
|
|
7393
|
-
let t = Eo.has(e.stage ?? "") ? e.stage : void 0, n =
|
|
7416
|
+
let t = rt(e), n = Do(t), r = (t.events ?? []).map((e) => {
|
|
7417
|
+
let t = Eo.has(e.stage ?? "") ? e.stage : void 0, n = st(e.description ?? "", "in_transit");
|
|
7394
7418
|
return {
|
|
7395
7419
|
...e,
|
|
7396
7420
|
stage: t ?? n.stage,
|
|
@@ -7407,10 +7431,10 @@ function Mo(e) {
|
|
|
7407
7431
|
//#endregion
|
|
7408
7432
|
//#region core/errors/hint.ts
|
|
7409
7433
|
function No(e) {
|
|
7410
|
-
return
|
|
7434
|
+
return g(e) ?? (e instanceof TypeError || e instanceof RangeError || e instanceof SyntaxError ? "schema" : "transport");
|
|
7411
7435
|
}
|
|
7412
7436
|
function Po(e) {
|
|
7413
|
-
let t = No(e), n =
|
|
7437
|
+
let t = No(e), n = _(e);
|
|
7414
7438
|
return {
|
|
7415
7439
|
kind: t,
|
|
7416
7440
|
...n === void 0 ? {} : { retryAfterMs: n }
|
|
@@ -7441,6 +7465,7 @@ var Lo = {
|
|
|
7441
7465
|
"correos-express": 36,
|
|
7442
7466
|
"ctt-express": 35,
|
|
7443
7467
|
"dhl-ecommerce": 23,
|
|
7468
|
+
"dhl-express": 75,
|
|
7444
7469
|
dpd: 70,
|
|
7445
7470
|
"gls-ch": 60,
|
|
7446
7471
|
"gls-de": 50,
|
|
@@ -7461,25 +7486,25 @@ var Lo = {
|
|
|
7461
7486
|
uniuni: 33
|
|
7462
7487
|
}, Ro = 5;
|
|
7463
7488
|
function zo(e, t = {}) {
|
|
7464
|
-
let n =
|
|
7489
|
+
let n = S(e), r = n.carrier === "intl-post";
|
|
7465
7490
|
if (n.confidence !== "low" && !r) return [];
|
|
7466
|
-
let i =
|
|
7491
|
+
let i = v(e), a = r ? Object.entries(y).flatMap(([t, n]) => {
|
|
7467
7492
|
let r = n.detectionRules.find((t) => t.confidence === "low" && (!t.checksum || t.checksum === "s10") && new RegExp(t.pattern).test(i) && (!t.rawPattern || new RegExp(t.rawPattern).test(e.trim().toUpperCase())));
|
|
7468
7493
|
return r ? [{
|
|
7469
7494
|
carrier: t,
|
|
7470
7495
|
preferred: r.preferred === !0
|
|
7471
7496
|
}] : [];
|
|
7472
|
-
}) : [], o = r ? a.map(({ carrier: e }) => e) : n.candidates, s = r ? a.filter((e) => e.preferred).map(({ carrier: e }) => e) : n.preferred, c = t.phase === "browser" ? Object.fromEntries(Object.entries(
|
|
7497
|
+
}) : [], o = r ? a.map(({ carrier: e }) => e) : n.candidates, s = r ? a.filter((e) => e.preferred).map(({ carrier: e }) => e) : n.preferred, c = t.phase === "browser" ? Object.fromEntries(Object.entries(y).map(([e, t]) => [e, t.tracking.browserRecognitionRank])) : Lo, l = new Set(s.filter((e) => c[e] === void 0).map((e) => Io(e)).filter(Boolean)), u = (e) => [
|
|
7473
7498
|
+(e === t.hint),
|
|
7474
7499
|
+!!s.includes(e),
|
|
7475
7500
|
c[e] ?? 0
|
|
7476
7501
|
];
|
|
7477
|
-
return o.filter((e) => c[e] !== void 0 &&
|
|
7502
|
+
return o.filter((e) => c[e] !== void 0 && Se.has(e) && ye(e) !== "universal" && !l.has(Io(e)) && !t.skip?.(e)).map((e) => ({
|
|
7478
7503
|
carrier: e,
|
|
7479
7504
|
score: u(e)
|
|
7480
7505
|
})).sort((e, t) => t.score[0] - e.score[0] || t.score[1] - e.score[1] || t.score[2] - e.score[2]).map(({ carrier: t }) => ({
|
|
7481
7506
|
carrier: t,
|
|
7482
|
-
needsInput:
|
|
7507
|
+
needsInput: xe(t, e)[0]?.field ?? null,
|
|
7483
7508
|
preferred: s.includes(t)
|
|
7484
7509
|
})).filter((e) => t.phase !== "browser" || !e.needsInput);
|
|
7485
7510
|
}
|
|
@@ -7563,7 +7588,7 @@ var Wo = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), Go = [
|
|
|
7563
7588
|
finlandpost: "posti"
|
|
7564
7589
|
};
|
|
7565
7590
|
[
|
|
7566
|
-
...Object.entries(
|
|
7591
|
+
...Object.entries(y).filter(([e]) => e !== "unknown").map(([, e]) => Wo(e.displayName)),
|
|
7567
7592
|
...Object.keys(Ko),
|
|
7568
7593
|
...Go
|
|
7569
7594
|
];
|
|
@@ -7601,7 +7626,7 @@ function Zo(e) {
|
|
|
7601
7626
|
} catch {
|
|
7602
7627
|
return [];
|
|
7603
7628
|
}
|
|
7604
|
-
return !["https:", "http:"].includes(t.protocol) || t.username || t.password ? [] : ["post.ch", "www.post.ch"].includes(t.hostname) ? ["swiss-post"] : Object.entries(
|
|
7629
|
+
return !["https:", "http:"].includes(t.protocol) || t.username || t.password ? [] : ["post.ch", "www.post.ch"].includes(t.hostname) ? ["swiss-post"] : Object.entries(y).filter(([, e]) => e.linkRules.some((e) => e.domains.some((e) => Ee(t.hostname, e)))).map(([e]) => e);
|
|
7605
7630
|
}
|
|
7606
7631
|
function Qo(e, t) {
|
|
7607
7632
|
return [...new Set(e.flatMap((e) => [...String(e ?? "").matchAll(/https?:\/\/[^\s<>"')]+/gi)].flatMap(([e]) => Zo(e)).filter((e) => e !== t)))];
|
|
@@ -7609,18 +7634,18 @@ function Qo(e, t) {
|
|
|
7609
7634
|
//#endregion
|
|
7610
7635
|
//#region core/catalog/handoff.ts
|
|
7611
7636
|
function $o(e, t) {
|
|
7612
|
-
return !
|
|
7637
|
+
return !Se.has(e) || ye(e) === "universal" || xe(e, t).length > 0 ? !1 : be(e, t).length === 0 || S(t).candidates.includes(e);
|
|
7613
7638
|
}
|
|
7614
7639
|
function es(e, t, n) {
|
|
7615
7640
|
if (n.delivery_tracking_number != null && (typeof n.delivery_tracking_number != "string" || !/^[A-Z0-9]{4,40}$/.test(n.delivery_tracking_number))) return null;
|
|
7616
7641
|
let r = Qo([n.last_status_text, ...(n.events ?? []).map((e) => e.description)], e);
|
|
7617
7642
|
if (!n.delivery_carrier && r.length > 1) return null;
|
|
7618
7643
|
let i = n.delivery_carrier ?? r[0], a = "partner", o = n.delivery_tracking_number || t, s = typeof n.destination_country == "string" ? n.destination_country : typeof n.destination_country_name == "string" ? n.destination_country_name : void 0;
|
|
7619
|
-
if (!i &&
|
|
7620
|
-
let e =
|
|
7644
|
+
if (!i && Re(o) && (i = Xo(s), i && (a = "destination")), !i && n.delivery_tracking_number) {
|
|
7645
|
+
let e = S(o);
|
|
7621
7646
|
e.confidence === "high" && (i = e.carrier, a = "reference");
|
|
7622
7647
|
}
|
|
7623
|
-
return !i && !n.delivery_tracking_number && ["aliexpress", "intl-post"].includes(e) &&
|
|
7648
|
+
return !i && !n.delivery_tracking_number && ["aliexpress", "intl-post"].includes(e) && ze(t) && (!s || ["ch", "switzerland"].includes(s.trim().toLowerCase())) && (i = "swiss-post", a = "reference"), !i || i === e || !/^[A-Z0-9]{4,40}$/.test(o) || !$o(i, o) ? null : {
|
|
7624
7649
|
carrier: i,
|
|
7625
7650
|
number: o,
|
|
7626
7651
|
basis: a
|
|
@@ -7661,7 +7686,7 @@ function ls(e, t) {
|
|
|
7661
7686
|
}
|
|
7662
7687
|
let a = ns.exec(i);
|
|
7663
7688
|
if (!a) throw TypeError("Paste a Planzer shared shipment URL");
|
|
7664
|
-
if (
|
|
7689
|
+
if (v(a[1]) !== v(t)) throw TypeError("The Planzer URL belongs to a different tracking number");
|
|
7665
7690
|
let o = r.searchParams.getAll("accessKey");
|
|
7666
7691
|
if (o.length !== 1 || !rs.test(o[0])) throw TypeError("The Planzer URL must include its accessKey");
|
|
7667
7692
|
return r.toString();
|
|
@@ -7692,7 +7717,7 @@ function us(e, t) {
|
|
|
7692
7717
|
}
|
|
7693
7718
|
let o = a.get("numeroUnico");
|
|
7694
7719
|
if (!o) throw TypeError("The Dachser URL must include its shipment number");
|
|
7695
|
-
if (
|
|
7720
|
+
if (v(o) !== v(t)) throw TypeError("The Dachser URL belongs to a different tracking number");
|
|
7696
7721
|
let s = a.get("hash"), c = a.get("clave"), l = a.get("fecha"), u = !!(s && os.test(s)), d = !!(c && l && os.test(c) && /^\d{8}$/.test(l));
|
|
7697
7722
|
if (!u && !d) throw TypeError("The Dachser URL must include its access parameters");
|
|
7698
7723
|
return r.protocol = "https:", r.hostname = is, r.port = "", r.toString();
|
|
@@ -7704,8 +7729,8 @@ function ds(e, t, n, r) {
|
|
|
7704
7729
|
trackingUrl: n.trim() || null,
|
|
7705
7730
|
postcode: r.trim() || null
|
|
7706
7731
|
}, a = e === "mondial-relay" && /^\d{26}$/.test(t);
|
|
7707
|
-
if (a && !
|
|
7708
|
-
let o = new Map(
|
|
7732
|
+
if (a && !ie(t)) throw TypeError("Invalid Mondial Relay barcode");
|
|
7733
|
+
let o = new Map(be(e, t).map((e) => [e.field, e]));
|
|
7709
7734
|
a && i.postcode && o.set("postcode", {
|
|
7710
7735
|
field: "postcode",
|
|
7711
7736
|
validator: "francePostcode"
|
|
@@ -7715,7 +7740,7 @@ function ds(e, t, n, r) {
|
|
|
7715
7740
|
let a = i[n];
|
|
7716
7741
|
if (!a) {
|
|
7717
7742
|
if (r.optional) continue;
|
|
7718
|
-
throw n === "trackingUrl" ? TypeError(`${
|
|
7743
|
+
throw n === "trackingUrl" ? TypeError(`${b(e).displayName} requires its complete tracking URL`) : r.validator === "swissPostcode" ? TypeError(`${b(e).displayName} requires the four-digit delivery postcode`) : r.validator === "francePostcode" ? TypeError(`${b(e).displayName} requires the five-digit delivery postcode`) : r.validator === "swissOrFrancePostcode" ? TypeError(`${b(e).displayName} requires a four- or five-digit delivery postcode`) : r.validator === "paackPostcode" ? TypeError("Paack requires the delivery postcode") : TypeError(`${b(e).displayName} requires the delivery postcode`);
|
|
7719
7744
|
}
|
|
7720
7745
|
switch (r.validator) {
|
|
7721
7746
|
case "planzerSharedUrl":
|
|
@@ -7725,13 +7750,13 @@ function ds(e, t, n, r) {
|
|
|
7725
7750
|
i[n] = us(a, t);
|
|
7726
7751
|
break;
|
|
7727
7752
|
case "swissPostcode":
|
|
7728
|
-
if (!/^\d{4}$/.test(a)) throw TypeError(`${
|
|
7753
|
+
if (!/^\d{4}$/.test(a)) throw TypeError(`${b(e).displayName} requires the four-digit delivery postcode`);
|
|
7729
7754
|
break;
|
|
7730
7755
|
case "francePostcode":
|
|
7731
|
-
if (!/^\d{5}$/.test(a)) throw TypeError(`${
|
|
7756
|
+
if (!/^\d{5}$/.test(a)) throw TypeError(`${b(e).displayName} requires the five-digit delivery postcode`);
|
|
7732
7757
|
break;
|
|
7733
7758
|
case "swissOrFrancePostcode":
|
|
7734
|
-
if (!/^\d{4,5}$/.test(a)) throw TypeError(`${
|
|
7759
|
+
if (!/^\d{4,5}$/.test(a)) throw TypeError(`${b(e).displayName} requires a four- or five-digit delivery postcode`);
|
|
7735
7760
|
break;
|
|
7736
7761
|
case "paackPostcode": {
|
|
7737
7762
|
let e = a.toLocaleUpperCase("en-US");
|
|
@@ -7744,24 +7769,37 @@ function ds(e, t, n, r) {
|
|
|
7744
7769
|
}
|
|
7745
7770
|
return i;
|
|
7746
7771
|
}
|
|
7747
|
-
|
|
7772
|
+
function fs(e) {
|
|
7773
|
+
let t = e.trim().toUpperCase().replace(/\s+/g, " ");
|
|
7774
|
+
if (!/^(?=.{3,12}$)(?=.*\d)[A-Z0-9]+(?:[ -][A-Z0-9]+)*$/.test(t)) throw TypeError("A valid delivery postcode is required");
|
|
7775
|
+
return t;
|
|
7776
|
+
}
|
|
7777
|
+
var ps = { carriers: [
|
|
7748
7778
|
{
|
|
7749
7779
|
carrier: "dhl",
|
|
7750
7780
|
direct: "Yes",
|
|
7751
7781
|
sample: "Blocked",
|
|
7782
|
+
references: [{ results: {
|
|
7783
|
+
Ship24: 10,
|
|
7784
|
+
ParcelsApp: 14,
|
|
7785
|
+
"17TRACK": "no_history",
|
|
7786
|
+
"Postal Ninja": 14,
|
|
7787
|
+
UPU: 1
|
|
7788
|
+
} }]
|
|
7789
|
+
},
|
|
7790
|
+
{
|
|
7791
|
+
carrier: "dhl-express",
|
|
7792
|
+
direct: "Yes",
|
|
7793
|
+
sample: "✓ 23",
|
|
7752
7794
|
references: [
|
|
7753
|
-
{ results: {
|
|
7754
|
-
Ship24: 10,
|
|
7755
|
-
ParcelsApp: 14,
|
|
7756
|
-
"17TRACK": "no_history",
|
|
7757
|
-
"Postal Ninja": 14,
|
|
7758
|
-
UPU: 1
|
|
7759
|
-
} },
|
|
7760
7795
|
{
|
|
7761
7796
|
note: "DHL Express waybill: https://www.trustpilot.com/reviews/6aaaf40b0ae5ece3b117fe62",
|
|
7762
7797
|
results: {
|
|
7763
7798
|
Ship24: 23,
|
|
7764
|
-
ParcelsApp: 23
|
|
7799
|
+
ParcelsApp: 23,
|
|
7800
|
+
"17TRACK": "unverified",
|
|
7801
|
+
"Postal Ninja": "unverified",
|
|
7802
|
+
UPU: "n/a"
|
|
7765
7803
|
}
|
|
7766
7804
|
},
|
|
7767
7805
|
{
|
|
@@ -9262,74 +9300,74 @@ var fs = { carriers: [
|
|
|
9262
9300
|
UPU: "n/a"
|
|
9263
9301
|
} }]
|
|
9264
9302
|
}
|
|
9265
|
-
] },
|
|
9303
|
+
] }, ms = [
|
|
9266
9304
|
"Ship24",
|
|
9267
9305
|
"ParcelsApp",
|
|
9268
9306
|
"17TRACK",
|
|
9269
9307
|
"Postal Ninja",
|
|
9270
9308
|
"UPU"
|
|
9271
|
-
],
|
|
9309
|
+
], hs = /* @__PURE__ */ new Set([
|
|
9272
9310
|
"no_history",
|
|
9273
9311
|
"summary_only",
|
|
9274
9312
|
"sign_in",
|
|
9275
9313
|
"postcode_prompt"
|
|
9276
|
-
]),
|
|
9277
|
-
function
|
|
9314
|
+
]), gs = ps.carriers, _s = new Map(gs.map((e) => [e.carrier, e]));
|
|
9315
|
+
function vs(e) {
|
|
9278
9316
|
return typeof e == "number" || e === "history" || typeof e == "object" && !!e;
|
|
9279
9317
|
}
|
|
9280
|
-
function
|
|
9281
|
-
let n = t.filter((t) => t.results[e] !== void 0), r = n.some((t) => !t.stale && (
|
|
9282
|
-
return n.some((t) =>
|
|
9318
|
+
function ys(e, t) {
|
|
9319
|
+
let n = t.filter((t) => t.results[e] !== void 0), r = n.some((t) => !t.stale && (hs.has(t.results[e]) || t.results[e] === "wrong_carrier") && Object.entries(t.results).some(([t, n]) => t !== e && t !== "UPU" && vs(n)));
|
|
9320
|
+
return n.some((t) => vs(t.results[e])) ? n.some((t) => typeof t.results[e] == "object") || r ? "partial" : "full" : n.some((t) => ["wrong_carrier", "refused"].includes(t.results[e])) ? "excluded" : n.some((t) => !t.stale && hs.has(t.results[e])) ? "empty" : "unknown";
|
|
9283
9321
|
}
|
|
9284
|
-
function
|
|
9285
|
-
let t = e ?
|
|
9286
|
-
return t ? Object.fromEntries(
|
|
9322
|
+
function bs(e) {
|
|
9323
|
+
let t = e ? _s.get(e) : void 0;
|
|
9324
|
+
return t ? Object.fromEntries(ms.map((e) => [e, ys(e, t.references)])) : null;
|
|
9287
9325
|
}
|
|
9288
9326
|
//#endregion
|
|
9289
9327
|
//#region providers/plan.ts
|
|
9290
|
-
var
|
|
9328
|
+
var xs = [
|
|
9291
9329
|
"ParcelsApp",
|
|
9292
9330
|
"Ship24",
|
|
9293
9331
|
"17TRACK",
|
|
9294
9332
|
"UPU"
|
|
9295
|
-
],
|
|
9296
|
-
function
|
|
9333
|
+
], Ss = /* @__PURE__ */ new Set(["17TRACK", "Postal Ninja"]);
|
|
9334
|
+
function Cs(e) {
|
|
9297
9335
|
return e === "ParcelsApp" ? 45e3 : e === "UPU" ? 8e3 : 3e4;
|
|
9298
9336
|
}
|
|
9299
|
-
function
|
|
9300
|
-
return e && /^[CL][A-Z]\d{9}CN$/.test(
|
|
9337
|
+
function ws(e) {
|
|
9338
|
+
return e && /^\d{10}$/.test(v(e)) ? "Ship24" : e && /^[CL][A-Z]\d{9}CN$/.test(v(e)) && Re(e) ? "17TRACK" : void 0;
|
|
9301
9339
|
}
|
|
9302
|
-
var
|
|
9340
|
+
var Ts = {
|
|
9303
9341
|
full: 0,
|
|
9304
9342
|
partial: 1,
|
|
9305
9343
|
unknown: 2,
|
|
9306
9344
|
empty: 3,
|
|
9307
9345
|
excluded: 4
|
|
9308
|
-
},
|
|
9309
|
-
function
|
|
9346
|
+
}, Es = (e, t) => Ts[t === "UPU" ? "unknown" : e?.[t] ?? "unknown"];
|
|
9347
|
+
function Ds(e, t) {
|
|
9310
9348
|
let n = (e) => e !== "UPU" && t?.[e] === "excluded";
|
|
9311
|
-
return (e.some((e) => e !== "UPU" && !n(e)) ? e.filter((e) => !n(e)) : [...e]).sort((n, r) => Number(n === "UPU") - Number(r === "UPU") ||
|
|
9349
|
+
return (e.some((e) => e !== "UPU" && !n(e)) ? e.filter((e) => !n(e)) : [...e]).sort((n, r) => Number(n === "UPU") - Number(r === "UPU") || Es(t, n) - Es(t, r) || Number(Ss.has(n)) - Number(Ss.has(r)) || e.indexOf(n) - e.indexOf(r));
|
|
9312
9350
|
}
|
|
9313
|
-
function
|
|
9351
|
+
function Os(e = {}) {
|
|
9314
9352
|
let { trackingNumber: t, enablePostalNinja: n = !1 } = e, r = (n ? [
|
|
9315
9353
|
"ParcelsApp",
|
|
9316
9354
|
"Ship24",
|
|
9317
9355
|
"Postal Ninja",
|
|
9318
9356
|
"17TRACK",
|
|
9319
9357
|
"UPU"
|
|
9320
|
-
] : [...
|
|
9358
|
+
] : [...xs]).filter((e) => e !== "UPU" || t === void 0 || Re(t)), i = (e.carriers ?? []).find((e) => bs(e)) ?? null, a = bs(i), o = Ds(r, a), s = ws(t);
|
|
9321
9359
|
return {
|
|
9322
9360
|
sources: s ? [s, ...o.filter((e) => e !== s)] : o,
|
|
9323
9361
|
carrier: i,
|
|
9324
9362
|
tier: (e) => a?.[e] ?? "unknown",
|
|
9325
|
-
rank: (e) =>
|
|
9363
|
+
rank: (e) => Es(a, e)
|
|
9326
9364
|
};
|
|
9327
9365
|
}
|
|
9328
|
-
function
|
|
9329
|
-
return
|
|
9366
|
+
function ks(e = !1, t) {
|
|
9367
|
+
return Os({
|
|
9330
9368
|
trackingNumber: t,
|
|
9331
9369
|
enablePostalNinja: e
|
|
9332
9370
|
}).sources;
|
|
9333
9371
|
}
|
|
9334
9372
|
//#endregion
|
|
9335
|
-
export {
|
|
9373
|
+
export { de as AMAZON_NUMBER_PATTERN, Se as AUTOMATIC_CARRIER_IDS, Ss as BROWSER_SOURCES, f as BudgetExceededError, x as CARRIERS, ce as CARRIER_CATALOG, y as CARRIER_DEFINITIONS, le as CARRIER_IDS, Ce as CARRIER_NAMES, t as CarrierError, a as ChallengeError, Za as EXPLICIT_OFFSET_PATTERN, r as IndeterminateError, l as InputRequiredError, u as InvalidInputError, Ro as MAX_RECOGNITIONS, s as MaintenanceError, i as NoHistoryError, n as NotFoundError, o as RateLimitedError, je as SELECTABLE_CARRIERS, ue as STAGES, c as SchemaError, He as TRACKING_CANDIDATE_PATTERNS, we as TRACKING_LINK_RULES, d as TransportError, xs as UNIVERSAL_SOURCES, m as UpstreamHttpError, ee as UpstreamNetworkError, be as activeRequirements, me as amazonMarketplace, he as amazonOrdersUrl, ge as amazonShippingOrigin, _e as amazonShippingUrl, To as calendarDay, yo as canadaProvinceTimeZone, ye as carrierAdapter, b as carrierDefinition, g as carrierErrorKind, Ae as carrierInfo, Te as carrierLinkRules, Me as carrierRequirements, ve as carrierTimezone, ko as classifyStage, st as classifyWording, po as countryCode, mo as countryTimeZone, es as deliveryHandoff, Ve as detectCarrier, S as detectCarrierMatch, Co as epochMillisTime, wo as epochSecondsTime, te as errorTypeOf, nt as eventPoint, $a as explicitOffsetTime, Po as failureHint, No as failureKind, oe as formatTrackingNumber, $o as hasDirectHandoffAdapter, Ao as inferStage, fe as isAmazonTrackingNumber, ae as isPlanzerSharedTrackingNumber, Ie as isValidGlsParcelNumber, Le as isValidHermesParcelNumber, ie as isValidMondialRelayBarcode, Re as isValidS10TrackingNumber, to as isoTime, We as keywordNumberInText, ot as languageStageStatus, Fe as localizedCarrierUrl, Ee as matchesDomain, ro as mislabeledLocalTime, io as mislabeledWallTime, ds as normalizeCarrierInputs, rt as normalizeCarrierResult, fs as normalizeDeliveryPostcode, v as normalizeTrackingNumber, Ds as orderUniversalSources, Xe as parseTrackingInput, ws as priorityUniversalSource, zo as recognitionCandidates, Vo as recognizeAll, Ue as recognizedNumberInText, So as regionHasTown, xe as requiredRequirements, Ne as requirementSatisfied, pe as requiresAmazonAccount, Mo as resolveResult, Oo as resultHasUpdate, Do as resultStage, _ as retryAfterMsOf, so as settleGuessedClocks, Uo as settleRecognition, ao as sharedClockZone, jo as stageSource, ze as supportsSwissPostHandoff, ho as timeZoneCountry, bo as townKey, at as trackingLanguageStage, Oe as trackingLink, De as trackingNumberForLink, Pe as tracksAutomatically, Os as universalPlan, Cs as universalSourceBudget, ks as universalSources, _o as usStateTimeZone, se as validTrackingNumber, us as validateDachserTrackingUrl, ls as validatePlanzerSharedUrl, ct as wordingStage, eo as zonedTime };
|