@tanstack/react-router-devtools 0.0.1-beta.41 → 0.0.1-beta.49
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/LICENSE +21 -0
- package/build/cjs/Explorer.js +35 -43
- package/build/cjs/Explorer.js.map +1 -1
- package/build/cjs/devtools.js +46 -51
- package/build/cjs/devtools.js.map +1 -1
- package/build/cjs/styledComponents.js +0 -32
- package/build/cjs/styledComponents.js.map +1 -1
- package/build/cjs/theme.js +4 -5
- package/build/cjs/theme.js.map +1 -1
- package/build/cjs/useMediaQuery.js +3 -6
- package/build/cjs/useMediaQuery.js.map +1 -1
- package/build/cjs/utils.js +10 -23
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +98 -160
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +5057 -4480
- package/build/umd/index.development.js +3663 -762
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +3 -3
- package/build/umd/index.production.js.map +1 -1
- package/package.json +3 -3
- package/src/devtools.tsx +44 -38
- package/src/utils.ts +3 -3
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
(function (global, factory) {
|
|
12
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim')) :
|
|
13
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim'], factory) :
|
|
14
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.
|
|
15
|
-
})(this, (function (exports, React,
|
|
12
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim/with-selector')) :
|
|
13
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim/with-selector'], factory) :
|
|
14
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.withSelector));
|
|
15
|
+
})(this, (function (exports, React, withSelector) { 'use strict';
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
|
@@ -52,393 +52,18 @@
|
|
|
52
52
|
return _extends.apply(this, arguments);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
// src/core.ts
|
|
56
|
-
var CurrentReaction = void 0;
|
|
57
|
-
var CurrentGets = null;
|
|
58
|
-
var CurrentGetsIndex = 0;
|
|
59
|
-
var EffectQueue = null;
|
|
60
|
-
var CacheClean = 0;
|
|
61
|
-
var CacheCheck = 1;
|
|
62
|
-
var CacheDirty = 2;
|
|
63
|
-
var Root;
|
|
64
|
-
var Reactive = class {
|
|
65
|
-
value;
|
|
66
|
-
fn;
|
|
67
|
-
observers = null;
|
|
68
|
-
sources = null;
|
|
69
|
-
state;
|
|
70
|
-
effect;
|
|
71
|
-
cleanups = null;
|
|
72
|
-
alwaysUpdate = false;
|
|
73
|
-
constructor(fnOrValue, type) {
|
|
74
|
-
if (type != 0 /* Signal */) {
|
|
75
|
-
this.fn = fnOrValue;
|
|
76
|
-
this.value = void 0;
|
|
77
|
-
this.state = CacheDirty;
|
|
78
|
-
if (Root)
|
|
79
|
-
Root.push(this);
|
|
80
|
-
else
|
|
81
|
-
console.error("Memos and effects must be wrapped in a createRoot");
|
|
82
|
-
this.effect = type == 2 /* Effect */;
|
|
83
|
-
if (this.effect)
|
|
84
|
-
this.update();
|
|
85
|
-
} else {
|
|
86
|
-
this.fn = void 0;
|
|
87
|
-
this.value = fnOrValue;
|
|
88
|
-
this.state = CacheClean;
|
|
89
|
-
this.effect = false;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
get() {
|
|
93
|
-
if (CurrentReaction) {
|
|
94
|
-
if (!CurrentGets && CurrentReaction.sources && CurrentReaction.sources[CurrentGetsIndex] == this) {
|
|
95
|
-
CurrentGetsIndex++;
|
|
96
|
-
} else {
|
|
97
|
-
if (!CurrentGets)
|
|
98
|
-
CurrentGets = [this];
|
|
99
|
-
else
|
|
100
|
-
CurrentGets.push(this);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (this.fn)
|
|
104
|
-
this.updateIfNecessary();
|
|
105
|
-
return this.value;
|
|
106
|
-
}
|
|
107
|
-
set(value) {
|
|
108
|
-
const notInBatch = !EffectQueue;
|
|
109
|
-
const newValue = typeof value === "function" ? value(this.value) : value;
|
|
110
|
-
if ((this.value !== newValue || this.alwaysUpdate) && this.observers) {
|
|
111
|
-
for (let i = 0; i < this.observers.length; i++) {
|
|
112
|
-
this.observers[i].stale(CacheDirty);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
this.value = newValue;
|
|
116
|
-
if (notInBatch)
|
|
117
|
-
stabilize();
|
|
118
|
-
return newValue;
|
|
119
|
-
}
|
|
120
|
-
stale(state) {
|
|
121
|
-
if (this.state < state) {
|
|
122
|
-
if (this.state === CacheClean && this.effect) {
|
|
123
|
-
if (EffectQueue)
|
|
124
|
-
EffectQueue.push(this);
|
|
125
|
-
else
|
|
126
|
-
EffectQueue = [this];
|
|
127
|
-
}
|
|
128
|
-
this.state = state;
|
|
129
|
-
if (this.observers) {
|
|
130
|
-
for (let i = 0; i < this.observers.length; i++) {
|
|
131
|
-
this.observers[i].stale(CacheCheck);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
update() {
|
|
137
|
-
const oldValue = this.value;
|
|
138
|
-
const prevReaction = CurrentReaction;
|
|
139
|
-
const prevGets = CurrentGets;
|
|
140
|
-
const prevIndex = CurrentGetsIndex;
|
|
141
|
-
CurrentReaction = this;
|
|
142
|
-
CurrentGets = null;
|
|
143
|
-
CurrentGetsIndex = 0;
|
|
144
|
-
try {
|
|
145
|
-
if (this.cleanups) {
|
|
146
|
-
this.cleanups.forEach((c) => c());
|
|
147
|
-
this.cleanups = null;
|
|
148
|
-
}
|
|
149
|
-
this.value = this.fn();
|
|
150
|
-
if (CurrentGets) {
|
|
151
|
-
this.removeParentObservers(CurrentGetsIndex);
|
|
152
|
-
if (this.sources && CurrentGetsIndex > 0) {
|
|
153
|
-
this.sources.length = CurrentGetsIndex + CurrentGets.length;
|
|
154
|
-
for (let i = 0; i < CurrentGets.length; i++) {
|
|
155
|
-
this.sources[CurrentGetsIndex + i] = CurrentGets[i];
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
this.sources = CurrentGets;
|
|
159
|
-
}
|
|
160
|
-
for (let i = CurrentGetsIndex; i < this.sources.length; i++) {
|
|
161
|
-
const source = this.sources[i];
|
|
162
|
-
if (!source.observers) {
|
|
163
|
-
source.observers = [this];
|
|
164
|
-
} else {
|
|
165
|
-
source.observers.push(this);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
} else if (this.sources && CurrentGetsIndex < this.sources.length) {
|
|
169
|
-
this.removeParentObservers(CurrentGetsIndex);
|
|
170
|
-
this.sources.length = CurrentGetsIndex;
|
|
171
|
-
}
|
|
172
|
-
} finally {
|
|
173
|
-
CurrentGets = prevGets;
|
|
174
|
-
CurrentReaction = prevReaction;
|
|
175
|
-
CurrentGetsIndex = prevIndex;
|
|
176
|
-
}
|
|
177
|
-
if ((oldValue !== this.value || this.alwaysUpdate) && this.observers) {
|
|
178
|
-
for (let i = 0; i < this.observers.length; i++) {
|
|
179
|
-
this.observers[i].state = CacheDirty;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
this.state = CacheClean;
|
|
183
|
-
}
|
|
184
|
-
updateIfNecessary() {
|
|
185
|
-
if (this.state === CacheCheck) {
|
|
186
|
-
for (const source of this.sources) {
|
|
187
|
-
source.updateIfNecessary();
|
|
188
|
-
if (this.state === CacheDirty) {
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (this.state === CacheDirty) {
|
|
194
|
-
this.update();
|
|
195
|
-
}
|
|
196
|
-
this.state = CacheClean;
|
|
197
|
-
}
|
|
198
|
-
removeParentObservers(index) {
|
|
199
|
-
if (!this.sources)
|
|
200
|
-
return;
|
|
201
|
-
for (let i = index; i < this.sources.length; i++) {
|
|
202
|
-
const source = this.sources[i];
|
|
203
|
-
const swap = source.observers.findIndex((v) => v === this);
|
|
204
|
-
source.observers[swap] = source.observers[source.observers.length - 1];
|
|
205
|
-
source.observers.pop();
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
destroy() {
|
|
209
|
-
if (this.cleanups) {
|
|
210
|
-
this.cleanups.forEach((c) => c());
|
|
211
|
-
this.cleanups = null;
|
|
212
|
-
}
|
|
213
|
-
this.removeParentObservers(0);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
function stabilize() {
|
|
217
|
-
if (!EffectQueue)
|
|
218
|
-
return;
|
|
219
|
-
for (let i = 0; i < EffectQueue.length; i++) {
|
|
220
|
-
EffectQueue[i].get();
|
|
221
|
-
}
|
|
222
|
-
EffectQueue = null;
|
|
223
|
-
}
|
|
224
|
-
function createEffect(fn) {
|
|
225
|
-
const effect = new Reactive(fn, 2 /* Effect */);
|
|
226
|
-
return effect.get.bind(effect);
|
|
227
|
-
}
|
|
228
|
-
function createRoot(fn) {
|
|
229
|
-
let root = [];
|
|
230
|
-
Root = root;
|
|
231
|
-
fn();
|
|
232
|
-
Root = null;
|
|
233
|
-
return () => {
|
|
234
|
-
if (!root)
|
|
235
|
-
return;
|
|
236
|
-
root.forEach((r) => r.destroy());
|
|
237
|
-
root = null;
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
function batch(fn) {
|
|
241
|
-
EffectQueue = [];
|
|
242
|
-
let out = fn();
|
|
243
|
-
stabilize();
|
|
244
|
-
return out;
|
|
245
|
-
}
|
|
246
|
-
function untrack(fn) {
|
|
247
|
-
const listener = CurrentReaction;
|
|
248
|
-
CurrentReaction = void 0;
|
|
249
|
-
try {
|
|
250
|
-
return fn();
|
|
251
|
-
} finally {
|
|
252
|
-
CurrentReaction = listener;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// src/store.ts
|
|
257
|
-
var $RAW = Symbol("store-raw");
|
|
258
|
-
var $TRACK = Symbol("track");
|
|
259
|
-
var $PROXY = Symbol("store-proxy");
|
|
260
|
-
var $NODE = Symbol("store-node");
|
|
261
|
-
function wrap(value) {
|
|
262
|
-
let p = value[$PROXY];
|
|
263
|
-
if (!p) {
|
|
264
|
-
Object.defineProperty(value, $PROXY, {
|
|
265
|
-
value: p = new Proxy(value, proxyTraps)
|
|
266
|
-
});
|
|
267
|
-
if (!Array.isArray(value)) {
|
|
268
|
-
const keys = Object.keys(value);
|
|
269
|
-
const desc = Object.getOwnPropertyDescriptors(value);
|
|
270
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
271
|
-
const prop = keys[i];
|
|
272
|
-
if (desc[prop].get) {
|
|
273
|
-
const get = desc[prop].get.bind(p);
|
|
274
|
-
Object.defineProperty(value, prop, {
|
|
275
|
-
enumerable: desc[prop].enumerable,
|
|
276
|
-
get
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return p;
|
|
283
|
-
}
|
|
284
|
-
function isWrappable(obj) {
|
|
285
|
-
let proto;
|
|
286
|
-
return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
|
|
287
|
-
}
|
|
288
|
-
function unwrap(item, set = /* @__PURE__ */ new Set()) {
|
|
289
|
-
let result, unwrapped, v, prop;
|
|
290
|
-
if (result = item != null && item[$RAW])
|
|
291
|
-
return result;
|
|
292
|
-
if (!isWrappable(item) || set.has(item))
|
|
293
|
-
return item;
|
|
294
|
-
if (Array.isArray(item)) {
|
|
295
|
-
if (Object.isFrozen(item))
|
|
296
|
-
item = item.slice(0);
|
|
297
|
-
else
|
|
298
|
-
set.add(item);
|
|
299
|
-
for (let i = 0, l = item.length; i < l; i++) {
|
|
300
|
-
v = item[i];
|
|
301
|
-
if ((unwrapped = unwrap(v, set)) !== v)
|
|
302
|
-
item[i] = unwrapped;
|
|
303
|
-
}
|
|
304
|
-
} else {
|
|
305
|
-
if (Object.isFrozen(item))
|
|
306
|
-
item = Object.assign({}, item);
|
|
307
|
-
else
|
|
308
|
-
set.add(item);
|
|
309
|
-
const keys = Object.keys(item);
|
|
310
|
-
const desc = Object.getOwnPropertyDescriptors(item);
|
|
311
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
312
|
-
prop = keys[i];
|
|
313
|
-
if (desc[prop].get)
|
|
314
|
-
continue;
|
|
315
|
-
v = item[prop];
|
|
316
|
-
if ((unwrapped = unwrap(v, set)) !== v)
|
|
317
|
-
item[prop] = unwrapped;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return item;
|
|
321
|
-
}
|
|
322
|
-
function getDataNodes(target) {
|
|
323
|
-
let nodes = target[$NODE];
|
|
324
|
-
if (!nodes)
|
|
325
|
-
Object.defineProperty(target, $NODE, { value: nodes = {} });
|
|
326
|
-
return nodes;
|
|
327
|
-
}
|
|
328
|
-
function getDataNode(nodes, property, value) {
|
|
329
|
-
return nodes[property] || (nodes[property] = createDataNode(value));
|
|
330
|
-
}
|
|
331
|
-
function proxyDescriptor(target, property) {
|
|
332
|
-
const desc = Reflect.getOwnPropertyDescriptor(target, property);
|
|
333
|
-
if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE)
|
|
334
|
-
return desc;
|
|
335
|
-
delete desc.value;
|
|
336
|
-
delete desc.writable;
|
|
337
|
-
desc.get = () => target[$PROXY][property];
|
|
338
|
-
return desc;
|
|
339
|
-
}
|
|
340
|
-
function trackSelf(target) {
|
|
341
|
-
if (CurrentReaction) {
|
|
342
|
-
const nodes = getDataNodes(target);
|
|
343
|
-
(nodes._ || (nodes._ = createDataNode())).get();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
function ownKeys(target) {
|
|
347
|
-
trackSelf(target);
|
|
348
|
-
return Reflect.ownKeys(target);
|
|
349
|
-
}
|
|
350
|
-
function createDataNode(value) {
|
|
351
|
-
const s = new Reactive(value, 0);
|
|
352
|
-
s.alwaysUpdate = true;
|
|
353
|
-
return s;
|
|
354
|
-
}
|
|
355
|
-
var Writing = false;
|
|
356
|
-
var proxyTraps = {
|
|
357
|
-
get(target, property, receiver) {
|
|
358
|
-
if (property === $RAW)
|
|
359
|
-
return target;
|
|
360
|
-
if (property === $PROXY)
|
|
361
|
-
return receiver;
|
|
362
|
-
if (property === $TRACK) {
|
|
363
|
-
trackSelf(target);
|
|
364
|
-
return receiver;
|
|
365
|
-
}
|
|
366
|
-
const nodes = getDataNodes(target);
|
|
367
|
-
const tracked = nodes.hasOwnProperty(property);
|
|
368
|
-
let value = tracked ? nodes[property].get() : target[property];
|
|
369
|
-
if (property === $NODE || property === "__proto__")
|
|
370
|
-
return value;
|
|
371
|
-
if (!tracked) {
|
|
372
|
-
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
373
|
-
if (CurrentReaction && (typeof value !== "function" || target.hasOwnProperty(property)) && !(desc && desc.get))
|
|
374
|
-
value = getDataNode(nodes, property, value).get();
|
|
375
|
-
}
|
|
376
|
-
return isWrappable(value) ? wrap(value) : value;
|
|
377
|
-
},
|
|
378
|
-
has(target, property) {
|
|
379
|
-
if (property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === "__proto__")
|
|
380
|
-
return true;
|
|
381
|
-
this.get(target, property, target);
|
|
382
|
-
return property in target;
|
|
383
|
-
},
|
|
384
|
-
set(target, property, value) {
|
|
385
|
-
Writing && setProperty(target, property, unwrap(value));
|
|
386
|
-
return true;
|
|
387
|
-
},
|
|
388
|
-
deleteProperty(target, property) {
|
|
389
|
-
Writing && setProperty(target, property, void 0, true);
|
|
390
|
-
return true;
|
|
391
|
-
},
|
|
392
|
-
ownKeys,
|
|
393
|
-
getOwnPropertyDescriptor: proxyDescriptor
|
|
394
|
-
};
|
|
395
|
-
function setProperty(state, property, value, deleting = false) {
|
|
396
|
-
if (!deleting && state[property] === value)
|
|
397
|
-
return;
|
|
398
|
-
const prev = state[property];
|
|
399
|
-
const len = state.length;
|
|
400
|
-
if (deleting)
|
|
401
|
-
delete state[property];
|
|
402
|
-
else
|
|
403
|
-
state[property] = value;
|
|
404
|
-
const nodes = getDataNodes(state);
|
|
405
|
-
let node;
|
|
406
|
-
if (node = getDataNode(nodes, property, prev))
|
|
407
|
-
node.set(() => value);
|
|
408
|
-
if (Array.isArray(state) && state.length !== len)
|
|
409
|
-
(node = getDataNode(nodes, "length", len)) && node.set(state.length);
|
|
410
|
-
(node = nodes._) && node.set();
|
|
411
|
-
}
|
|
412
|
-
function createStore(store) {
|
|
413
|
-
const unwrappedStore = unwrap(store);
|
|
414
|
-
const wrappedStore = wrap(unwrappedStore);
|
|
415
|
-
const setStore = (fn) => {
|
|
416
|
-
batch(() => {
|
|
417
|
-
try {
|
|
418
|
-
Writing = true;
|
|
419
|
-
fn(wrappedStore);
|
|
420
|
-
} finally {
|
|
421
|
-
Writing = false;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
};
|
|
425
|
-
return [wrappedStore, setStore];
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
var isProduction = "development" === 'production';
|
|
429
55
|
var prefix = 'Invariant failed';
|
|
430
56
|
function invariant(condition, message) {
|
|
431
57
|
if (condition) {
|
|
432
58
|
return;
|
|
433
59
|
}
|
|
434
|
-
if (isProduction) {
|
|
435
|
-
throw new Error(prefix);
|
|
436
|
-
}
|
|
437
60
|
var provided = typeof message === 'function' ? message() : message;
|
|
438
61
|
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
439
62
|
throw new Error(value);
|
|
440
63
|
}
|
|
441
64
|
|
|
65
|
+
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];{var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}}function r(n){return !!n&&!!n[Q]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un;an.produce;an.produceWithPatches.bind(an);var sn=an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
66
|
+
|
|
442
67
|
/**
|
|
443
68
|
* router-core
|
|
444
69
|
*
|
|
@@ -463,190 +88,87 @@
|
|
|
463
88
|
return true;
|
|
464
89
|
}
|
|
465
90
|
|
|
91
|
+
sn(false);
|
|
92
|
+
|
|
466
93
|
/**
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
94
|
+
* react-router
|
|
95
|
+
*
|
|
96
|
+
* Copyright (c) TanStack
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the MIT license found in the
|
|
99
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
100
|
+
*
|
|
101
|
+
* @license MIT
|
|
470
102
|
*/
|
|
471
|
-
function sharedClone(prev, next, touchAll) {
|
|
472
|
-
const things = new Map();
|
|
473
|
-
function recurse(prev, next) {
|
|
474
|
-
if (prev === next) {
|
|
475
|
-
return prev;
|
|
476
|
-
}
|
|
477
|
-
if (things.has(next)) {
|
|
478
|
-
return things.get(next);
|
|
479
|
-
}
|
|
480
|
-
const prevIsArray = Array.isArray(prev);
|
|
481
|
-
const nextIsArray = Array.isArray(next);
|
|
482
|
-
const prevIsObj = isPlainObject(prev);
|
|
483
|
-
const nextIsObj = isPlainObject(next);
|
|
484
|
-
const isArray = prevIsArray && nextIsArray;
|
|
485
|
-
const isObj = prevIsObj && nextIsObj;
|
|
486
|
-
const isSameStructure = isArray || isObj;
|
|
487
|
-
|
|
488
|
-
// Both are arrays or objects
|
|
489
|
-
if (isSameStructure) {
|
|
490
|
-
const aSize = isArray ? prev.length : Object.keys(prev).length;
|
|
491
|
-
const bItems = isArray ? next : Object.keys(next);
|
|
492
|
-
const bSize = bItems.length;
|
|
493
|
-
const copy = isArray ? [] : {};
|
|
494
|
-
let equalItems = 0;
|
|
495
|
-
for (let i = 0; i < bSize; i++) {
|
|
496
|
-
const key = isArray ? i : bItems[i];
|
|
497
|
-
if (copy[key] === prev[key]) {
|
|
498
|
-
equalItems++;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
if (aSize === bSize && equalItems === aSize) {
|
|
502
|
-
things.set(next, prev);
|
|
503
|
-
return prev;
|
|
504
|
-
}
|
|
505
|
-
things.set(next, copy);
|
|
506
|
-
for (let i = 0; i < bSize; i++) {
|
|
507
|
-
const key = isArray ? i : bItems[i];
|
|
508
|
-
if (typeof bItems[i] === 'function') {
|
|
509
|
-
copy[key] = prev[key];
|
|
510
|
-
} else {
|
|
511
|
-
copy[key] = recurse(prev[key], next[key]);
|
|
512
|
-
}
|
|
513
|
-
if (copy[key] === prev[key]) {
|
|
514
|
-
equalItems++;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return copy;
|
|
518
|
-
}
|
|
519
|
-
if (nextIsArray) {
|
|
520
|
-
const copy = [];
|
|
521
|
-
things.set(next, copy);
|
|
522
|
-
for (let i = 0; i < next.length; i++) {
|
|
523
|
-
copy[i] = recurse(undefined, next[i]);
|
|
524
|
-
}
|
|
525
|
-
return copy;
|
|
526
|
-
}
|
|
527
|
-
if (nextIsObj) {
|
|
528
|
-
const copy = {};
|
|
529
|
-
things.set(next, copy);
|
|
530
|
-
const nextKeys = Object.keys(next);
|
|
531
|
-
for (let i = 0; i < nextKeys.length; i++) {
|
|
532
|
-
const key = nextKeys[i];
|
|
533
|
-
copy[key] = recurse(undefined, next[key]);
|
|
534
|
-
}
|
|
535
|
-
return copy;
|
|
536
|
-
}
|
|
537
|
-
return next;
|
|
538
|
-
}
|
|
539
|
-
return recurse(prev, next);
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// Copied from: https://github.com/jonschlinkert/is-plain-object
|
|
543
|
-
function isPlainObject(o) {
|
|
544
|
-
if (!hasObjectPrototype(o)) {
|
|
545
|
-
return false;
|
|
546
|
-
}
|
|
547
103
|
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
104
|
+
function useStore(store, selector = d => d, compareShallow) {
|
|
105
|
+
const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);
|
|
106
|
+
return slice;
|
|
107
|
+
}
|
|
108
|
+
function shallow(objA, objB) {
|
|
109
|
+
if (Object.is(objA, objB)) {
|
|
551
110
|
return true;
|
|
552
111
|
}
|
|
553
|
-
|
|
554
|
-
// If has modified prototype
|
|
555
|
-
const prot = ctor.prototype;
|
|
556
|
-
if (!hasObjectPrototype(prot)) {
|
|
112
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
557
113
|
return false;
|
|
558
114
|
}
|
|
559
115
|
|
|
560
|
-
//
|
|
561
|
-
if (
|
|
116
|
+
// if (objA instanceof Map && objB instanceof Map) {
|
|
117
|
+
// if (objA.size !== objB.size) return false
|
|
118
|
+
|
|
119
|
+
// for (const [key, value] of objA) {
|
|
120
|
+
// if (!Object.is(value, objB.get(key))) {
|
|
121
|
+
// return false
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
124
|
+
// return true
|
|
125
|
+
// }
|
|
126
|
+
|
|
127
|
+
// if (objA instanceof Set && objB instanceof Set) {
|
|
128
|
+
// if (objA.size !== objB.size) return false
|
|
129
|
+
|
|
130
|
+
// for (const value of objA) {
|
|
131
|
+
// if (!objB.has(value)) {
|
|
132
|
+
// return false
|
|
133
|
+
// }
|
|
134
|
+
// }
|
|
135
|
+
// return true
|
|
136
|
+
// }
|
|
137
|
+
|
|
138
|
+
const keysA = Object.keys(objA);
|
|
139
|
+
if (keysA.length !== Object.keys(objB).length) {
|
|
562
140
|
return false;
|
|
563
141
|
}
|
|
564
|
-
|
|
565
|
-
|
|
142
|
+
for (let i = 0; i < keysA.length; i++) {
|
|
143
|
+
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
566
147
|
return true;
|
|
567
148
|
}
|
|
568
|
-
function hasObjectPrototype(o) {
|
|
569
|
-
return Object.prototype.toString.call(o) === '[object Object]';
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
var _window$document;
|
|
573
|
-
// Detect if we're in the DOM
|
|
574
|
-
typeof window === 'undefined' || !((_window$document = window.document) != null && _window$document.createElement);
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* react-router
|
|
578
|
-
*
|
|
579
|
-
* Copyright (c) TanStack
|
|
580
|
-
*
|
|
581
|
-
* This source code is licensed under the MIT license found in the
|
|
582
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
583
|
-
*
|
|
584
|
-
* @license MIT
|
|
585
|
-
*/
|
|
586
149
|
const routerContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
587
|
-
const EMPTY = {};
|
|
588
|
-
const __useStoreValue = (seed, selector) => {
|
|
589
|
-
const valueRef = React__namespace.useRef(EMPTY);
|
|
590
|
-
|
|
591
|
-
// If there is no selector, track the seed
|
|
592
|
-
// If there is a selector, do not track the seed
|
|
593
|
-
const getValue = () => !selector ? seed() : selector(untrack(() => seed()));
|
|
594
|
-
|
|
595
|
-
// If empty, initialize the value
|
|
596
|
-
if (valueRef.current === EMPTY) {
|
|
597
|
-
valueRef.current = sharedClone(undefined, getValue());
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
// Snapshot should just return the current cached value
|
|
601
|
-
const getSnapshot = React__namespace.useCallback(() => valueRef.current, []);
|
|
602
|
-
const getStore = React__namespace.useCallback(cb => {
|
|
603
|
-
// A root is necessary to track effects
|
|
604
|
-
return createRoot(() => {
|
|
605
|
-
createEffect(() => {
|
|
606
|
-
// Read and update the value
|
|
607
|
-
// getValue will handle which values are accessed and
|
|
608
|
-
// thus tracked.
|
|
609
|
-
// sharedClone will both recursively track the end result
|
|
610
|
-
// and ensure that the previous value is structurally shared
|
|
611
|
-
// into the new version.
|
|
612
|
-
valueRef.current = unwrap(
|
|
613
|
-
// Unwrap the value to get rid of any proxy structures
|
|
614
|
-
sharedClone(valueRef.current, getValue()));
|
|
615
|
-
cb();
|
|
616
|
-
});
|
|
617
|
-
});
|
|
618
|
-
}, []);
|
|
619
|
-
return shim.useSyncExternalStore(getStore, getSnapshot, getSnapshot);
|
|
620
|
-
};
|
|
621
|
-
const [store, setStore] = createStore({
|
|
622
|
-
foo: 'foo',
|
|
623
|
-
bar: {
|
|
624
|
-
baz: 'baz'
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
-
createRoot(() => {
|
|
628
|
-
let prev;
|
|
629
|
-
createEffect(() => {
|
|
630
|
-
console.log('effect');
|
|
631
|
-
const next = sharedClone(prev, store);
|
|
632
|
-
console.log(next);
|
|
633
|
-
prev = untrack(() => next);
|
|
634
|
-
});
|
|
635
|
-
});
|
|
636
|
-
setStore(s => {
|
|
637
|
-
s.foo = '1';
|
|
638
|
-
});
|
|
639
|
-
setStore(s => {
|
|
640
|
-
s.bar.baz = '2';
|
|
641
|
-
});
|
|
642
150
|
function useRouter() {
|
|
643
151
|
const value = React__namespace.useContext(routerContext);
|
|
644
152
|
warning(!value, 'useRouter must be used inside a <Router> component!');
|
|
645
153
|
return value.router;
|
|
646
154
|
}
|
|
647
|
-
function useRouterStore(selector) {
|
|
155
|
+
function useRouterStore(selector, shallow) {
|
|
648
156
|
const router = useRouter();
|
|
649
|
-
return
|
|
157
|
+
return useStore(router.store, selector, shallow);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function toInteger(dirtyNumber) {
|
|
161
|
+
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
162
|
+
return NaN;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var number = Number(dirtyNumber);
|
|
166
|
+
|
|
167
|
+
if (isNaN(number)) {
|
|
168
|
+
return number;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
650
172
|
}
|
|
651
173
|
|
|
652
174
|
function requiredArgs(required, args) {
|
|
@@ -655,7 +177,7 @@
|
|
|
655
177
|
}
|
|
656
178
|
}
|
|
657
179
|
|
|
658
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
180
|
+
function _typeof$w(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$w = function _typeof(obj) { return typeof obj; }; } else { _typeof$w = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$w(obj); }
|
|
659
181
|
/**
|
|
660
182
|
* @name toDate
|
|
661
183
|
* @category Common Helpers
|
|
@@ -691,7 +213,7 @@
|
|
|
691
213
|
requiredArgs(1, arguments);
|
|
692
214
|
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
693
215
|
|
|
694
|
-
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
216
|
+
if (argument instanceof Date || _typeof$w(argument) === 'object' && argStr === '[object Date]') {
|
|
695
217
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
696
218
|
return new Date(argument.getTime());
|
|
697
219
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -778,6 +300,174 @@
|
|
|
778
300
|
}
|
|
779
301
|
}
|
|
780
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Days in 1 week.
|
|
305
|
+
*
|
|
306
|
+
* @name daysInWeek
|
|
307
|
+
* @constant
|
|
308
|
+
* @type {number}
|
|
309
|
+
* @default
|
|
310
|
+
*/
|
|
311
|
+
/**
|
|
312
|
+
* Milliseconds in 1 minute
|
|
313
|
+
*
|
|
314
|
+
* @name millisecondsInMinute
|
|
315
|
+
* @constant
|
|
316
|
+
* @type {number}
|
|
317
|
+
* @default
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
var millisecondsInMinute = 60000;
|
|
321
|
+
/**
|
|
322
|
+
* Milliseconds in 1 hour
|
|
323
|
+
*
|
|
324
|
+
* @name millisecondsInHour
|
|
325
|
+
* @constant
|
|
326
|
+
* @type {number}
|
|
327
|
+
* @default
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
var millisecondsInHour = 3600000;
|
|
331
|
+
/**
|
|
332
|
+
* Milliseconds in 1 second
|
|
333
|
+
*
|
|
334
|
+
* @name millisecondsInSecond
|
|
335
|
+
* @constant
|
|
336
|
+
* @type {number}
|
|
337
|
+
* @default
|
|
338
|
+
*/
|
|
339
|
+
|
|
340
|
+
var millisecondsInSecond = 1000;
|
|
341
|
+
|
|
342
|
+
function startOfUTCISOWeek(dirtyDate) {
|
|
343
|
+
requiredArgs(1, arguments);
|
|
344
|
+
var weekStartsOn = 1;
|
|
345
|
+
var date = toDate(dirtyDate);
|
|
346
|
+
var day = date.getUTCDay();
|
|
347
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
348
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
|
349
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
350
|
+
return date;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function getUTCISOWeekYear(dirtyDate) {
|
|
354
|
+
requiredArgs(1, arguments);
|
|
355
|
+
var date = toDate(dirtyDate);
|
|
356
|
+
var year = date.getUTCFullYear();
|
|
357
|
+
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
358
|
+
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
|
359
|
+
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
360
|
+
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
|
|
361
|
+
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
362
|
+
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
363
|
+
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
364
|
+
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
|
365
|
+
|
|
366
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
367
|
+
return year + 1;
|
|
368
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
369
|
+
return year;
|
|
370
|
+
} else {
|
|
371
|
+
return year - 1;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function startOfUTCISOWeekYear(dirtyDate) {
|
|
376
|
+
requiredArgs(1, arguments);
|
|
377
|
+
var year = getUTCISOWeekYear(dirtyDate);
|
|
378
|
+
var fourthOfJanuary = new Date(0);
|
|
379
|
+
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
|
380
|
+
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
|
381
|
+
var date = startOfUTCISOWeek(fourthOfJanuary);
|
|
382
|
+
return date;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
386
|
+
function getUTCISOWeek(dirtyDate) {
|
|
387
|
+
requiredArgs(1, arguments);
|
|
388
|
+
var date = toDate(dirtyDate);
|
|
389
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
|
390
|
+
// because the number of milliseconds in a week is not constant
|
|
391
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
392
|
+
|
|
393
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function startOfUTCWeek(dirtyDate, options) {
|
|
397
|
+
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
398
|
+
|
|
399
|
+
requiredArgs(1, arguments);
|
|
400
|
+
var defaultOptions = getDefaultOptions();
|
|
401
|
+
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
402
|
+
|
|
403
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
404
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
var date = toDate(dirtyDate);
|
|
408
|
+
var day = date.getUTCDay();
|
|
409
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
410
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
|
411
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
412
|
+
return date;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function getUTCWeekYear(dirtyDate, options) {
|
|
416
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
417
|
+
|
|
418
|
+
requiredArgs(1, arguments);
|
|
419
|
+
var date = toDate(dirtyDate);
|
|
420
|
+
var year = date.getUTCFullYear();
|
|
421
|
+
var defaultOptions = getDefaultOptions();
|
|
422
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
423
|
+
|
|
424
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
425
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
var firstWeekOfNextYear = new Date(0);
|
|
429
|
+
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
430
|
+
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
431
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
|
|
432
|
+
var firstWeekOfThisYear = new Date(0);
|
|
433
|
+
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
434
|
+
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
435
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
|
436
|
+
|
|
437
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
438
|
+
return year + 1;
|
|
439
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
440
|
+
return year;
|
|
441
|
+
} else {
|
|
442
|
+
return year - 1;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function startOfUTCWeekYear(dirtyDate, options) {
|
|
447
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
448
|
+
|
|
449
|
+
requiredArgs(1, arguments);
|
|
450
|
+
var defaultOptions = getDefaultOptions();
|
|
451
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
452
|
+
var year = getUTCWeekYear(dirtyDate, options);
|
|
453
|
+
var firstWeek = new Date(0);
|
|
454
|
+
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
455
|
+
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
456
|
+
var date = startOfUTCWeek(firstWeek, options);
|
|
457
|
+
return date;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
var MILLISECONDS_IN_WEEK = 604800000;
|
|
461
|
+
function getUTCWeek(dirtyDate, options) {
|
|
462
|
+
requiredArgs(1, arguments);
|
|
463
|
+
var date = toDate(dirtyDate);
|
|
464
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
|
|
465
|
+
// because the number of milliseconds in a week is not constant
|
|
466
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
467
|
+
|
|
468
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
469
|
+
}
|
|
470
|
+
|
|
781
471
|
var formatDistanceLocale = {
|
|
782
472
|
lessThanXSeconds: {
|
|
783
473
|
one: 'less than a second',
|
|
@@ -865,8 +555,6 @@
|
|
|
865
555
|
return result;
|
|
866
556
|
};
|
|
867
557
|
|
|
868
|
-
var formatDistance$1 = formatDistance;
|
|
869
|
-
|
|
870
558
|
function buildFormatLongFn(args) {
|
|
871
559
|
return function () {
|
|
872
560
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -909,7 +597,6 @@
|
|
|
909
597
|
defaultWidth: 'full'
|
|
910
598
|
})
|
|
911
599
|
};
|
|
912
|
-
var formatLong$1 = formatLong;
|
|
913
600
|
|
|
914
601
|
var formatRelativeLocale = {
|
|
915
602
|
lastWeek: "'last' eeee 'at' p",
|
|
@@ -924,8 +611,6 @@
|
|
|
924
611
|
return formatRelativeLocale[token];
|
|
925
612
|
};
|
|
926
613
|
|
|
927
|
-
var formatRelative$1 = formatRelative;
|
|
928
|
-
|
|
929
614
|
function buildLocalizeFn(args) {
|
|
930
615
|
return function (dirtyIndex, options) {
|
|
931
616
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
|
|
@@ -1093,7 +778,6 @@
|
|
|
1093
778
|
defaultFormattingWidth: 'wide'
|
|
1094
779
|
})
|
|
1095
780
|
};
|
|
1096
|
-
var localize$1 = localize;
|
|
1097
781
|
|
|
1098
782
|
function buildMatchFn(args) {
|
|
1099
783
|
return function (string) {
|
|
@@ -1257,7 +941,6 @@
|
|
|
1257
941
|
defaultParseWidth: 'any'
|
|
1258
942
|
})
|
|
1259
943
|
};
|
|
1260
|
-
var match$1 = match;
|
|
1261
944
|
|
|
1262
945
|
/**
|
|
1263
946
|
* @type {Locale}
|
|
@@ -1270,11 +953,11 @@
|
|
|
1270
953
|
*/
|
|
1271
954
|
var locale = {
|
|
1272
955
|
code: 'en-US',
|
|
1273
|
-
formatDistance: formatDistance
|
|
1274
|
-
formatLong: formatLong
|
|
1275
|
-
formatRelative: formatRelative
|
|
1276
|
-
localize: localize
|
|
1277
|
-
match: match
|
|
956
|
+
formatDistance: formatDistance,
|
|
957
|
+
formatLong: formatLong,
|
|
958
|
+
formatRelative: formatRelative,
|
|
959
|
+
localize: localize,
|
|
960
|
+
match: match,
|
|
1278
961
|
options: {
|
|
1279
962
|
weekStartsOn: 0
|
|
1280
963
|
/* Sunday */
|
|
@@ -1282,7 +965,6 @@
|
|
|
1282
965
|
firstWeekContainsDate: 1
|
|
1283
966
|
}
|
|
1284
967
|
};
|
|
1285
|
-
var defaultLocale = locale;
|
|
1286
968
|
|
|
1287
969
|
function assign(target, object) {
|
|
1288
970
|
if (target == null) {
|
|
@@ -1393,9 +1075,9 @@
|
|
|
1393
1075
|
|
|
1394
1076
|
requiredArgs(2, arguments);
|
|
1395
1077
|
var defaultOptions = getDefaultOptions();
|
|
1396
|
-
var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref :
|
|
1078
|
+
var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
|
|
1397
1079
|
|
|
1398
|
-
if (!locale.formatDistance) {
|
|
1080
|
+
if (!locale$1.formatDistance) {
|
|
1399
1081
|
throw new RangeError('locale must contain localize.formatDistance property');
|
|
1400
1082
|
}
|
|
1401
1083
|
|
|
@@ -1463,62 +1145,3343 @@
|
|
|
1463
1145
|
|
|
1464
1146
|
if (unit === 'second') {
|
|
1465
1147
|
var seconds = roundingMethodFn(milliseconds / 1000);
|
|
1466
|
-
return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
|
|
1148
|
+
return locale$1.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
|
|
1467
1149
|
} else if (unit === 'minute') {
|
|
1468
1150
|
var roundedMinutes = roundingMethodFn(minutes);
|
|
1469
|
-
return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
|
|
1151
|
+
return locale$1.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
|
|
1470
1152
|
} else if (unit === 'hour') {
|
|
1471
1153
|
var hours = roundingMethodFn(minutes / 60);
|
|
1472
|
-
return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
|
|
1154
|
+
return locale$1.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
|
|
1473
1155
|
} else if (unit === 'day') {
|
|
1474
1156
|
var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);
|
|
1475
|
-
return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
|
|
1157
|
+
return locale$1.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
|
|
1476
1158
|
} else if (unit === 'month') {
|
|
1477
1159
|
var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);
|
|
1478
|
-
return months === 12 && defaultUnit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
|
|
1160
|
+
return months === 12 && defaultUnit !== 'month' ? locale$1.formatDistance('xYears', 1, localizeOptions) : locale$1.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
|
|
1479
1161
|
} else if (unit === 'year') {
|
|
1480
1162
|
var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);
|
|
1481
|
-
return locale.formatDistance('xYears', years, localizeOptions);
|
|
1163
|
+
return locale$1.formatDistance('xYears', years, localizeOptions);
|
|
1482
1164
|
}
|
|
1483
1165
|
|
|
1484
1166
|
throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
|
|
1485
1167
|
}
|
|
1486
1168
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1169
|
+
function _typeof$v(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$v = function _typeof(obj) { return typeof obj; }; } else { _typeof$v = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$v(obj); }
|
|
1170
|
+
|
|
1171
|
+
function _inherits$v(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$v(subClass, superClass); }
|
|
1172
|
+
|
|
1173
|
+
function _setPrototypeOf$v(o, p) { _setPrototypeOf$v = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$v(o, p); }
|
|
1174
|
+
|
|
1175
|
+
function _createSuper$v(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$v(); return function _createSuperInternal() { var Super = _getPrototypeOf$v(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$v(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$v(this, result); }; }
|
|
1176
|
+
|
|
1177
|
+
function _possibleConstructorReturn$v(self, call) { if (call && (_typeof$v(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$v(self); }
|
|
1178
|
+
|
|
1179
|
+
function _assertThisInitialized$v(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1180
|
+
|
|
1181
|
+
function _isNativeReflectConstruct$v() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1182
|
+
|
|
1183
|
+
function _getPrototypeOf$v(o) { _getPrototypeOf$v = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$v(o); }
|
|
1184
|
+
|
|
1185
|
+
function _classCallCheck$w(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1186
|
+
|
|
1187
|
+
function _defineProperties$w(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1188
|
+
|
|
1189
|
+
function _createClass$w(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$w(Constructor.prototype, protoProps); if (staticProps) _defineProperties$w(Constructor, staticProps); return Constructor; }
|
|
1190
|
+
|
|
1191
|
+
function _defineProperty$v(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1192
|
+
var Setter = /*#__PURE__*/function () {
|
|
1193
|
+
function Setter() {
|
|
1194
|
+
_classCallCheck$w(this, Setter);
|
|
1195
|
+
|
|
1196
|
+
_defineProperty$v(this, "subPriority", 0);
|
|
1496
1197
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
if (typeof initialValue === 'undefined' || initialValue === null) {
|
|
1503
|
-
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
|
|
1504
|
-
} else {
|
|
1505
|
-
setValue(initialValue);
|
|
1198
|
+
|
|
1199
|
+
_createClass$w(Setter, [{
|
|
1200
|
+
key: "validate",
|
|
1201
|
+
value: function validate(_utcDate, _options) {
|
|
1202
|
+
return true;
|
|
1506
1203
|
}
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1204
|
+
}]);
|
|
1205
|
+
|
|
1206
|
+
return Setter;
|
|
1207
|
+
}();
|
|
1208
|
+
var ValueSetter = /*#__PURE__*/function (_Setter) {
|
|
1209
|
+
_inherits$v(ValueSetter, _Setter);
|
|
1210
|
+
|
|
1211
|
+
var _super = _createSuper$v(ValueSetter);
|
|
1212
|
+
|
|
1213
|
+
function ValueSetter(value, validateValue, setValue, priority, subPriority) {
|
|
1214
|
+
var _this;
|
|
1215
|
+
|
|
1216
|
+
_classCallCheck$w(this, ValueSetter);
|
|
1217
|
+
|
|
1218
|
+
_this = _super.call(this);
|
|
1219
|
+
_this.value = value;
|
|
1220
|
+
_this.validateValue = validateValue;
|
|
1221
|
+
_this.setValue = setValue;
|
|
1222
|
+
_this.priority = priority;
|
|
1223
|
+
|
|
1224
|
+
if (subPriority) {
|
|
1225
|
+
_this.subPriority = subPriority;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
return _this;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
_createClass$w(ValueSetter, [{
|
|
1232
|
+
key: "validate",
|
|
1233
|
+
value: function validate(utcDate, options) {
|
|
1234
|
+
return this.validateValue(utcDate, this.value, options);
|
|
1235
|
+
}
|
|
1236
|
+
}, {
|
|
1237
|
+
key: "set",
|
|
1238
|
+
value: function set(utcDate, flags, options) {
|
|
1239
|
+
return this.setValue(utcDate, flags, this.value, options);
|
|
1240
|
+
}
|
|
1241
|
+
}]);
|
|
1242
|
+
|
|
1243
|
+
return ValueSetter;
|
|
1244
|
+
}(Setter);
|
|
1245
|
+
|
|
1246
|
+
function _classCallCheck$v(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1247
|
+
|
|
1248
|
+
function _defineProperties$v(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1249
|
+
|
|
1250
|
+
function _createClass$v(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$v(Constructor.prototype, protoProps); if (staticProps) _defineProperties$v(Constructor, staticProps); return Constructor; }
|
|
1251
|
+
var Parser = /*#__PURE__*/function () {
|
|
1252
|
+
function Parser() {
|
|
1253
|
+
_classCallCheck$v(this, Parser);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
_createClass$v(Parser, [{
|
|
1257
|
+
key: "run",
|
|
1258
|
+
value: function run(dateString, token, match, options) {
|
|
1259
|
+
var result = this.parse(dateString, token, match, options);
|
|
1260
|
+
|
|
1261
|
+
if (!result) {
|
|
1262
|
+
return null;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
return {
|
|
1266
|
+
setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
|
|
1267
|
+
rest: result.rest
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
}, {
|
|
1271
|
+
key: "validate",
|
|
1272
|
+
value: function validate(_utcDate, _value, _options) {
|
|
1273
|
+
return true;
|
|
1274
|
+
}
|
|
1275
|
+
}]);
|
|
1276
|
+
|
|
1277
|
+
return Parser;
|
|
1278
|
+
}();
|
|
1279
|
+
|
|
1280
|
+
function _typeof$u(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$u = function _typeof(obj) { return typeof obj; }; } else { _typeof$u = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$u(obj); }
|
|
1281
|
+
|
|
1282
|
+
function _classCallCheck$u(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1283
|
+
|
|
1284
|
+
function _defineProperties$u(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1285
|
+
|
|
1286
|
+
function _createClass$u(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$u(Constructor.prototype, protoProps); if (staticProps) _defineProperties$u(Constructor, staticProps); return Constructor; }
|
|
1287
|
+
|
|
1288
|
+
function _inherits$u(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$u(subClass, superClass); }
|
|
1289
|
+
|
|
1290
|
+
function _setPrototypeOf$u(o, p) { _setPrototypeOf$u = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$u(o, p); }
|
|
1291
|
+
|
|
1292
|
+
function _createSuper$u(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$u(); return function _createSuperInternal() { var Super = _getPrototypeOf$u(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$u(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$u(this, result); }; }
|
|
1293
|
+
|
|
1294
|
+
function _possibleConstructorReturn$u(self, call) { if (call && (_typeof$u(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$u(self); }
|
|
1295
|
+
|
|
1296
|
+
function _assertThisInitialized$u(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1297
|
+
|
|
1298
|
+
function _isNativeReflectConstruct$u() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1299
|
+
|
|
1300
|
+
function _getPrototypeOf$u(o) { _getPrototypeOf$u = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$u(o); }
|
|
1301
|
+
|
|
1302
|
+
function _defineProperty$u(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1303
|
+
var EraParser = /*#__PURE__*/function (_Parser) {
|
|
1304
|
+
_inherits$u(EraParser, _Parser);
|
|
1305
|
+
|
|
1306
|
+
var _super = _createSuper$u(EraParser);
|
|
1307
|
+
|
|
1308
|
+
function EraParser() {
|
|
1309
|
+
var _this;
|
|
1310
|
+
|
|
1311
|
+
_classCallCheck$u(this, EraParser);
|
|
1312
|
+
|
|
1313
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1314
|
+
args[_key] = arguments[_key];
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1318
|
+
|
|
1319
|
+
_defineProperty$u(_assertThisInitialized$u(_this), "priority", 140);
|
|
1320
|
+
|
|
1321
|
+
_defineProperty$u(_assertThisInitialized$u(_this), "incompatibleTokens", ['R', 'u', 't', 'T']);
|
|
1322
|
+
|
|
1323
|
+
return _this;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
_createClass$u(EraParser, [{
|
|
1327
|
+
key: "parse",
|
|
1328
|
+
value: function parse(dateString, token, match) {
|
|
1329
|
+
switch (token) {
|
|
1330
|
+
// AD, BC
|
|
1331
|
+
case 'G':
|
|
1332
|
+
case 'GG':
|
|
1333
|
+
case 'GGG':
|
|
1334
|
+
return match.era(dateString, {
|
|
1335
|
+
width: 'abbreviated'
|
|
1336
|
+
}) || match.era(dateString, {
|
|
1337
|
+
width: 'narrow'
|
|
1338
|
+
});
|
|
1339
|
+
// A, B
|
|
1340
|
+
|
|
1341
|
+
case 'GGGGG':
|
|
1342
|
+
return match.era(dateString, {
|
|
1343
|
+
width: 'narrow'
|
|
1344
|
+
});
|
|
1345
|
+
// Anno Domini, Before Christ
|
|
1346
|
+
|
|
1347
|
+
case 'GGGG':
|
|
1348
|
+
default:
|
|
1349
|
+
return match.era(dateString, {
|
|
1350
|
+
width: 'wide'
|
|
1351
|
+
}) || match.era(dateString, {
|
|
1352
|
+
width: 'abbreviated'
|
|
1353
|
+
}) || match.era(dateString, {
|
|
1354
|
+
width: 'narrow'
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}, {
|
|
1359
|
+
key: "set",
|
|
1360
|
+
value: function set(date, flags, value) {
|
|
1361
|
+
flags.era = value;
|
|
1362
|
+
date.setUTCFullYear(value, 0, 1);
|
|
1363
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1364
|
+
return date;
|
|
1365
|
+
}
|
|
1366
|
+
}]);
|
|
1367
|
+
|
|
1368
|
+
return EraParser;
|
|
1369
|
+
}(Parser);
|
|
1370
|
+
|
|
1371
|
+
var numericPatterns = {
|
|
1372
|
+
month: /^(1[0-2]|0?\d)/,
|
|
1373
|
+
// 0 to 12
|
|
1374
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
1375
|
+
// 0 to 31
|
|
1376
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
1377
|
+
// 0 to 366
|
|
1378
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
1379
|
+
// 0 to 53
|
|
1380
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
1381
|
+
// 0 to 23
|
|
1382
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
1383
|
+
// 0 to 24
|
|
1384
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
1385
|
+
// 0 to 11
|
|
1386
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
1387
|
+
// 0 to 12
|
|
1388
|
+
minute: /^[0-5]?\d/,
|
|
1389
|
+
// 0 to 59
|
|
1390
|
+
second: /^[0-5]?\d/,
|
|
1391
|
+
// 0 to 59
|
|
1392
|
+
singleDigit: /^\d/,
|
|
1393
|
+
// 0 to 9
|
|
1394
|
+
twoDigits: /^\d{1,2}/,
|
|
1395
|
+
// 0 to 99
|
|
1396
|
+
threeDigits: /^\d{1,3}/,
|
|
1397
|
+
// 0 to 999
|
|
1398
|
+
fourDigits: /^\d{1,4}/,
|
|
1399
|
+
// 0 to 9999
|
|
1400
|
+
anyDigitsSigned: /^-?\d+/,
|
|
1401
|
+
singleDigitSigned: /^-?\d/,
|
|
1402
|
+
// 0 to 9, -0 to -9
|
|
1403
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
1404
|
+
// 0 to 99, -0 to -99
|
|
1405
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
1406
|
+
// 0 to 999, -0 to -999
|
|
1407
|
+
fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
|
|
1408
|
+
|
|
1409
|
+
};
|
|
1410
|
+
var timezonePatterns = {
|
|
1411
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1412
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1413
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
1414
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
1415
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
function mapValue(parseFnResult, mapFn) {
|
|
1419
|
+
if (!parseFnResult) {
|
|
1420
|
+
return parseFnResult;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
return {
|
|
1424
|
+
value: mapFn(parseFnResult.value),
|
|
1425
|
+
rest: parseFnResult.rest
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
function parseNumericPattern(pattern, dateString) {
|
|
1429
|
+
var matchResult = dateString.match(pattern);
|
|
1430
|
+
|
|
1431
|
+
if (!matchResult) {
|
|
1432
|
+
return null;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
return {
|
|
1436
|
+
value: parseInt(matchResult[0], 10),
|
|
1437
|
+
rest: dateString.slice(matchResult[0].length)
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
function parseTimezonePattern(pattern, dateString) {
|
|
1441
|
+
var matchResult = dateString.match(pattern);
|
|
1442
|
+
|
|
1443
|
+
if (!matchResult) {
|
|
1444
|
+
return null;
|
|
1445
|
+
} // Input is 'Z'
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
if (matchResult[0] === 'Z') {
|
|
1449
|
+
return {
|
|
1450
|
+
value: 0,
|
|
1451
|
+
rest: dateString.slice(1)
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
var sign = matchResult[1] === '+' ? 1 : -1;
|
|
1456
|
+
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
1457
|
+
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
1458
|
+
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
1459
|
+
return {
|
|
1460
|
+
value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
|
|
1461
|
+
rest: dateString.slice(matchResult[0].length)
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function parseAnyDigitsSigned(dateString) {
|
|
1465
|
+
return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
|
|
1466
|
+
}
|
|
1467
|
+
function parseNDigits(n, dateString) {
|
|
1468
|
+
switch (n) {
|
|
1469
|
+
case 1:
|
|
1470
|
+
return parseNumericPattern(numericPatterns.singleDigit, dateString);
|
|
1471
|
+
|
|
1472
|
+
case 2:
|
|
1473
|
+
return parseNumericPattern(numericPatterns.twoDigits, dateString);
|
|
1474
|
+
|
|
1475
|
+
case 3:
|
|
1476
|
+
return parseNumericPattern(numericPatterns.threeDigits, dateString);
|
|
1477
|
+
|
|
1478
|
+
case 4:
|
|
1479
|
+
return parseNumericPattern(numericPatterns.fourDigits, dateString);
|
|
1480
|
+
|
|
1481
|
+
default:
|
|
1482
|
+
return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
function parseNDigitsSigned(n, dateString) {
|
|
1486
|
+
switch (n) {
|
|
1487
|
+
case 1:
|
|
1488
|
+
return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
|
|
1489
|
+
|
|
1490
|
+
case 2:
|
|
1491
|
+
return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
|
|
1492
|
+
|
|
1493
|
+
case 3:
|
|
1494
|
+
return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
|
|
1495
|
+
|
|
1496
|
+
case 4:
|
|
1497
|
+
return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
|
|
1498
|
+
|
|
1499
|
+
default:
|
|
1500
|
+
return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
function dayPeriodEnumToHours(dayPeriod) {
|
|
1504
|
+
switch (dayPeriod) {
|
|
1505
|
+
case 'morning':
|
|
1506
|
+
return 4;
|
|
1507
|
+
|
|
1508
|
+
case 'evening':
|
|
1509
|
+
return 17;
|
|
1510
|
+
|
|
1511
|
+
case 'pm':
|
|
1512
|
+
case 'noon':
|
|
1513
|
+
case 'afternoon':
|
|
1514
|
+
return 12;
|
|
1515
|
+
|
|
1516
|
+
case 'am':
|
|
1517
|
+
case 'midnight':
|
|
1518
|
+
case 'night':
|
|
1519
|
+
default:
|
|
1520
|
+
return 0;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
1524
|
+
var isCommonEra = currentYear > 0; // Absolute number of the current year:
|
|
1525
|
+
// 1 -> 1 AC
|
|
1526
|
+
// 0 -> 1 BC
|
|
1527
|
+
// -1 -> 2 BC
|
|
1528
|
+
|
|
1529
|
+
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
1530
|
+
var result;
|
|
1531
|
+
|
|
1532
|
+
if (absCurrentYear <= 50) {
|
|
1533
|
+
result = twoDigitYear || 100;
|
|
1534
|
+
} else {
|
|
1535
|
+
var rangeEnd = absCurrentYear + 50;
|
|
1536
|
+
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
1537
|
+
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
1538
|
+
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
return isCommonEra ? result : 1 - result;
|
|
1542
|
+
}
|
|
1543
|
+
function isLeapYearIndex(year) {
|
|
1544
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
function _typeof$t(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$t = function _typeof(obj) { return typeof obj; }; } else { _typeof$t = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$t(obj); }
|
|
1548
|
+
|
|
1549
|
+
function _classCallCheck$t(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1550
|
+
|
|
1551
|
+
function _defineProperties$t(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1552
|
+
|
|
1553
|
+
function _createClass$t(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$t(Constructor.prototype, protoProps); if (staticProps) _defineProperties$t(Constructor, staticProps); return Constructor; }
|
|
1554
|
+
|
|
1555
|
+
function _inherits$t(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$t(subClass, superClass); }
|
|
1556
|
+
|
|
1557
|
+
function _setPrototypeOf$t(o, p) { _setPrototypeOf$t = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$t(o, p); }
|
|
1558
|
+
|
|
1559
|
+
function _createSuper$t(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$t(); return function _createSuperInternal() { var Super = _getPrototypeOf$t(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$t(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$t(this, result); }; }
|
|
1560
|
+
|
|
1561
|
+
function _possibleConstructorReturn$t(self, call) { if (call && (_typeof$t(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$t(self); }
|
|
1562
|
+
|
|
1563
|
+
function _assertThisInitialized$t(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1564
|
+
|
|
1565
|
+
function _isNativeReflectConstruct$t() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1566
|
+
|
|
1567
|
+
function _getPrototypeOf$t(o) { _getPrototypeOf$t = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$t(o); }
|
|
1568
|
+
|
|
1569
|
+
function _defineProperty$t(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1570
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
|
1571
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
1572
|
+
// |----------|-------|----|-------|-------|-------|
|
|
1573
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
1574
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
1575
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
1576
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
1577
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
1578
|
+
var YearParser = /*#__PURE__*/function (_Parser) {
|
|
1579
|
+
_inherits$t(YearParser, _Parser);
|
|
1580
|
+
|
|
1581
|
+
var _super = _createSuper$t(YearParser);
|
|
1582
|
+
|
|
1583
|
+
function YearParser() {
|
|
1584
|
+
var _this;
|
|
1585
|
+
|
|
1586
|
+
_classCallCheck$t(this, YearParser);
|
|
1587
|
+
|
|
1588
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1589
|
+
args[_key] = arguments[_key];
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1593
|
+
|
|
1594
|
+
_defineProperty$t(_assertThisInitialized$t(_this), "priority", 130);
|
|
1595
|
+
|
|
1596
|
+
_defineProperty$t(_assertThisInitialized$t(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
|
|
1597
|
+
|
|
1598
|
+
return _this;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
_createClass$t(YearParser, [{
|
|
1602
|
+
key: "parse",
|
|
1603
|
+
value: function parse(dateString, token, match) {
|
|
1604
|
+
var valueCallback = function valueCallback(year) {
|
|
1605
|
+
return {
|
|
1606
|
+
year: year,
|
|
1607
|
+
isTwoDigitYear: token === 'yy'
|
|
1608
|
+
};
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
switch (token) {
|
|
1612
|
+
case 'y':
|
|
1613
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
1614
|
+
|
|
1615
|
+
case 'yo':
|
|
1616
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
1617
|
+
unit: 'year'
|
|
1618
|
+
}), valueCallback);
|
|
1619
|
+
|
|
1620
|
+
default:
|
|
1621
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}, {
|
|
1625
|
+
key: "validate",
|
|
1626
|
+
value: function validate(_date, value) {
|
|
1627
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
1628
|
+
}
|
|
1629
|
+
}, {
|
|
1630
|
+
key: "set",
|
|
1631
|
+
value: function set(date, flags, value) {
|
|
1632
|
+
var currentYear = date.getUTCFullYear();
|
|
1633
|
+
|
|
1634
|
+
if (value.isTwoDigitYear) {
|
|
1635
|
+
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
1636
|
+
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
|
|
1637
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1638
|
+
return date;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
1642
|
+
date.setUTCFullYear(year, 0, 1);
|
|
1643
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1644
|
+
return date;
|
|
1645
|
+
}
|
|
1646
|
+
}]);
|
|
1647
|
+
|
|
1648
|
+
return YearParser;
|
|
1649
|
+
}(Parser);
|
|
1650
|
+
|
|
1651
|
+
function _typeof$s(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$s = function _typeof(obj) { return typeof obj; }; } else { _typeof$s = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$s(obj); }
|
|
1652
|
+
|
|
1653
|
+
function _classCallCheck$s(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1654
|
+
|
|
1655
|
+
function _defineProperties$s(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1656
|
+
|
|
1657
|
+
function _createClass$s(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$s(Constructor.prototype, protoProps); if (staticProps) _defineProperties$s(Constructor, staticProps); return Constructor; }
|
|
1658
|
+
|
|
1659
|
+
function _inherits$s(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$s(subClass, superClass); }
|
|
1660
|
+
|
|
1661
|
+
function _setPrototypeOf$s(o, p) { _setPrototypeOf$s = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$s(o, p); }
|
|
1662
|
+
|
|
1663
|
+
function _createSuper$s(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$s(); return function _createSuperInternal() { var Super = _getPrototypeOf$s(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$s(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$s(this, result); }; }
|
|
1664
|
+
|
|
1665
|
+
function _possibleConstructorReturn$s(self, call) { if (call && (_typeof$s(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$s(self); }
|
|
1666
|
+
|
|
1667
|
+
function _assertThisInitialized$s(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1668
|
+
|
|
1669
|
+
function _isNativeReflectConstruct$s() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1670
|
+
|
|
1671
|
+
function _getPrototypeOf$s(o) { _getPrototypeOf$s = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$s(o); }
|
|
1672
|
+
|
|
1673
|
+
function _defineProperty$s(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1674
|
+
// Local week-numbering year
|
|
1675
|
+
var LocalWeekYearParser = /*#__PURE__*/function (_Parser) {
|
|
1676
|
+
_inherits$s(LocalWeekYearParser, _Parser);
|
|
1677
|
+
|
|
1678
|
+
var _super = _createSuper$s(LocalWeekYearParser);
|
|
1679
|
+
|
|
1680
|
+
function LocalWeekYearParser() {
|
|
1681
|
+
var _this;
|
|
1682
|
+
|
|
1683
|
+
_classCallCheck$s(this, LocalWeekYearParser);
|
|
1684
|
+
|
|
1685
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1686
|
+
args[_key] = arguments[_key];
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1690
|
+
|
|
1691
|
+
_defineProperty$s(_assertThisInitialized$s(_this), "priority", 130);
|
|
1692
|
+
|
|
1693
|
+
_defineProperty$s(_assertThisInitialized$s(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
|
|
1694
|
+
|
|
1695
|
+
return _this;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
_createClass$s(LocalWeekYearParser, [{
|
|
1699
|
+
key: "parse",
|
|
1700
|
+
value: function parse(dateString, token, match) {
|
|
1701
|
+
var valueCallback = function valueCallback(year) {
|
|
1702
|
+
return {
|
|
1703
|
+
year: year,
|
|
1704
|
+
isTwoDigitYear: token === 'YY'
|
|
1705
|
+
};
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
switch (token) {
|
|
1709
|
+
case 'Y':
|
|
1710
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
1711
|
+
|
|
1712
|
+
case 'Yo':
|
|
1713
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
1714
|
+
unit: 'year'
|
|
1715
|
+
}), valueCallback);
|
|
1716
|
+
|
|
1717
|
+
default:
|
|
1718
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
}, {
|
|
1722
|
+
key: "validate",
|
|
1723
|
+
value: function validate(_date, value) {
|
|
1724
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
1725
|
+
}
|
|
1726
|
+
}, {
|
|
1727
|
+
key: "set",
|
|
1728
|
+
value: function set(date, flags, value, options) {
|
|
1729
|
+
var currentYear = getUTCWeekYear(date, options);
|
|
1730
|
+
|
|
1731
|
+
if (value.isTwoDigitYear) {
|
|
1732
|
+
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
1733
|
+
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
|
|
1734
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1735
|
+
return startOfUTCWeek(date, options);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
1739
|
+
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
|
|
1740
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1741
|
+
return startOfUTCWeek(date, options);
|
|
1742
|
+
}
|
|
1743
|
+
}]);
|
|
1744
|
+
|
|
1745
|
+
return LocalWeekYearParser;
|
|
1746
|
+
}(Parser);
|
|
1747
|
+
|
|
1748
|
+
function _typeof$r(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$r = function _typeof(obj) { return typeof obj; }; } else { _typeof$r = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$r(obj); }
|
|
1749
|
+
|
|
1750
|
+
function _classCallCheck$r(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1751
|
+
|
|
1752
|
+
function _defineProperties$r(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1753
|
+
|
|
1754
|
+
function _createClass$r(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$r(Constructor.prototype, protoProps); if (staticProps) _defineProperties$r(Constructor, staticProps); return Constructor; }
|
|
1755
|
+
|
|
1756
|
+
function _inherits$r(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$r(subClass, superClass); }
|
|
1757
|
+
|
|
1758
|
+
function _setPrototypeOf$r(o, p) { _setPrototypeOf$r = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$r(o, p); }
|
|
1759
|
+
|
|
1760
|
+
function _createSuper$r(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$r(); return function _createSuperInternal() { var Super = _getPrototypeOf$r(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$r(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$r(this, result); }; }
|
|
1761
|
+
|
|
1762
|
+
function _possibleConstructorReturn$r(self, call) { if (call && (_typeof$r(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$r(self); }
|
|
1763
|
+
|
|
1764
|
+
function _assertThisInitialized$r(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1765
|
+
|
|
1766
|
+
function _isNativeReflectConstruct$r() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1767
|
+
|
|
1768
|
+
function _getPrototypeOf$r(o) { _getPrototypeOf$r = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$r(o); }
|
|
1769
|
+
|
|
1770
|
+
function _defineProperty$r(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1771
|
+
|
|
1772
|
+
var ISOWeekYearParser = /*#__PURE__*/function (_Parser) {
|
|
1773
|
+
_inherits$r(ISOWeekYearParser, _Parser);
|
|
1774
|
+
|
|
1775
|
+
var _super = _createSuper$r(ISOWeekYearParser);
|
|
1776
|
+
|
|
1777
|
+
function ISOWeekYearParser() {
|
|
1778
|
+
var _this;
|
|
1779
|
+
|
|
1780
|
+
_classCallCheck$r(this, ISOWeekYearParser);
|
|
1781
|
+
|
|
1782
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1783
|
+
args[_key] = arguments[_key];
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1787
|
+
|
|
1788
|
+
_defineProperty$r(_assertThisInitialized$r(_this), "priority", 130);
|
|
1789
|
+
|
|
1790
|
+
_defineProperty$r(_assertThisInitialized$r(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
|
|
1791
|
+
|
|
1792
|
+
return _this;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
_createClass$r(ISOWeekYearParser, [{
|
|
1796
|
+
key: "parse",
|
|
1797
|
+
value: function parse(dateString, token) {
|
|
1798
|
+
if (token === 'R') {
|
|
1799
|
+
return parseNDigitsSigned(4, dateString);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
1803
|
+
}
|
|
1804
|
+
}, {
|
|
1805
|
+
key: "set",
|
|
1806
|
+
value: function set(_date, _flags, value) {
|
|
1807
|
+
var firstWeekOfYear = new Date(0);
|
|
1808
|
+
firstWeekOfYear.setUTCFullYear(value, 0, 4);
|
|
1809
|
+
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
|
|
1810
|
+
return startOfUTCISOWeek(firstWeekOfYear);
|
|
1811
|
+
}
|
|
1812
|
+
}]);
|
|
1813
|
+
|
|
1814
|
+
return ISOWeekYearParser;
|
|
1815
|
+
}(Parser);
|
|
1816
|
+
|
|
1817
|
+
function _typeof$q(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$q = function _typeof(obj) { return typeof obj; }; } else { _typeof$q = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$q(obj); }
|
|
1818
|
+
|
|
1819
|
+
function _classCallCheck$q(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1820
|
+
|
|
1821
|
+
function _defineProperties$q(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1822
|
+
|
|
1823
|
+
function _createClass$q(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$q(Constructor.prototype, protoProps); if (staticProps) _defineProperties$q(Constructor, staticProps); return Constructor; }
|
|
1824
|
+
|
|
1825
|
+
function _inherits$q(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$q(subClass, superClass); }
|
|
1826
|
+
|
|
1827
|
+
function _setPrototypeOf$q(o, p) { _setPrototypeOf$q = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$q(o, p); }
|
|
1828
|
+
|
|
1829
|
+
function _createSuper$q(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$q(); return function _createSuperInternal() { var Super = _getPrototypeOf$q(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$q(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$q(this, result); }; }
|
|
1830
|
+
|
|
1831
|
+
function _possibleConstructorReturn$q(self, call) { if (call && (_typeof$q(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$q(self); }
|
|
1832
|
+
|
|
1833
|
+
function _assertThisInitialized$q(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1834
|
+
|
|
1835
|
+
function _isNativeReflectConstruct$q() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1836
|
+
|
|
1837
|
+
function _getPrototypeOf$q(o) { _getPrototypeOf$q = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$q(o); }
|
|
1838
|
+
|
|
1839
|
+
function _defineProperty$q(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1840
|
+
var ExtendedYearParser = /*#__PURE__*/function (_Parser) {
|
|
1841
|
+
_inherits$q(ExtendedYearParser, _Parser);
|
|
1842
|
+
|
|
1843
|
+
var _super = _createSuper$q(ExtendedYearParser);
|
|
1844
|
+
|
|
1845
|
+
function ExtendedYearParser() {
|
|
1846
|
+
var _this;
|
|
1847
|
+
|
|
1848
|
+
_classCallCheck$q(this, ExtendedYearParser);
|
|
1849
|
+
|
|
1850
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1851
|
+
args[_key] = arguments[_key];
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1855
|
+
|
|
1856
|
+
_defineProperty$q(_assertThisInitialized$q(_this), "priority", 130);
|
|
1857
|
+
|
|
1858
|
+
_defineProperty$q(_assertThisInitialized$q(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
|
|
1859
|
+
|
|
1860
|
+
return _this;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
_createClass$q(ExtendedYearParser, [{
|
|
1864
|
+
key: "parse",
|
|
1865
|
+
value: function parse(dateString, token) {
|
|
1866
|
+
if (token === 'u') {
|
|
1867
|
+
return parseNDigitsSigned(4, dateString);
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
1871
|
+
}
|
|
1872
|
+
}, {
|
|
1873
|
+
key: "set",
|
|
1874
|
+
value: function set(date, _flags, value) {
|
|
1875
|
+
date.setUTCFullYear(value, 0, 1);
|
|
1876
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1877
|
+
return date;
|
|
1878
|
+
}
|
|
1879
|
+
}]);
|
|
1880
|
+
|
|
1881
|
+
return ExtendedYearParser;
|
|
1882
|
+
}(Parser);
|
|
1883
|
+
|
|
1884
|
+
function _typeof$p(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$p = function _typeof(obj) { return typeof obj; }; } else { _typeof$p = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$p(obj); }
|
|
1885
|
+
|
|
1886
|
+
function _classCallCheck$p(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1887
|
+
|
|
1888
|
+
function _defineProperties$p(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1889
|
+
|
|
1890
|
+
function _createClass$p(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$p(Constructor.prototype, protoProps); if (staticProps) _defineProperties$p(Constructor, staticProps); return Constructor; }
|
|
1891
|
+
|
|
1892
|
+
function _inherits$p(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$p(subClass, superClass); }
|
|
1893
|
+
|
|
1894
|
+
function _setPrototypeOf$p(o, p) { _setPrototypeOf$p = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$p(o, p); }
|
|
1895
|
+
|
|
1896
|
+
function _createSuper$p(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$p(); return function _createSuperInternal() { var Super = _getPrototypeOf$p(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$p(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$p(this, result); }; }
|
|
1897
|
+
|
|
1898
|
+
function _possibleConstructorReturn$p(self, call) { if (call && (_typeof$p(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$p(self); }
|
|
1899
|
+
|
|
1900
|
+
function _assertThisInitialized$p(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1901
|
+
|
|
1902
|
+
function _isNativeReflectConstruct$p() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1903
|
+
|
|
1904
|
+
function _getPrototypeOf$p(o) { _getPrototypeOf$p = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$p(o); }
|
|
1905
|
+
|
|
1906
|
+
function _defineProperty$p(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1907
|
+
var QuarterParser = /*#__PURE__*/function (_Parser) {
|
|
1908
|
+
_inherits$p(QuarterParser, _Parser);
|
|
1909
|
+
|
|
1910
|
+
var _super = _createSuper$p(QuarterParser);
|
|
1911
|
+
|
|
1912
|
+
function QuarterParser() {
|
|
1913
|
+
var _this;
|
|
1914
|
+
|
|
1915
|
+
_classCallCheck$p(this, QuarterParser);
|
|
1916
|
+
|
|
1917
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1918
|
+
args[_key] = arguments[_key];
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1922
|
+
|
|
1923
|
+
_defineProperty$p(_assertThisInitialized$p(_this), "priority", 120);
|
|
1924
|
+
|
|
1925
|
+
_defineProperty$p(_assertThisInitialized$p(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
1926
|
+
|
|
1927
|
+
return _this;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
_createClass$p(QuarterParser, [{
|
|
1931
|
+
key: "parse",
|
|
1932
|
+
value: function parse(dateString, token, match) {
|
|
1933
|
+
switch (token) {
|
|
1934
|
+
// 1, 2, 3, 4
|
|
1935
|
+
case 'Q':
|
|
1936
|
+
case 'QQ':
|
|
1937
|
+
// 01, 02, 03, 04
|
|
1938
|
+
return parseNDigits(token.length, dateString);
|
|
1939
|
+
// 1st, 2nd, 3rd, 4th
|
|
1940
|
+
|
|
1941
|
+
case 'Qo':
|
|
1942
|
+
return match.ordinalNumber(dateString, {
|
|
1943
|
+
unit: 'quarter'
|
|
1944
|
+
});
|
|
1945
|
+
// Q1, Q2, Q3, Q4
|
|
1946
|
+
|
|
1947
|
+
case 'QQQ':
|
|
1948
|
+
return match.quarter(dateString, {
|
|
1949
|
+
width: 'abbreviated',
|
|
1950
|
+
context: 'formatting'
|
|
1951
|
+
}) || match.quarter(dateString, {
|
|
1952
|
+
width: 'narrow',
|
|
1953
|
+
context: 'formatting'
|
|
1954
|
+
});
|
|
1955
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1956
|
+
|
|
1957
|
+
case 'QQQQQ':
|
|
1958
|
+
return match.quarter(dateString, {
|
|
1959
|
+
width: 'narrow',
|
|
1960
|
+
context: 'formatting'
|
|
1961
|
+
});
|
|
1962
|
+
// 1st quarter, 2nd quarter, ...
|
|
1963
|
+
|
|
1964
|
+
case 'QQQQ':
|
|
1965
|
+
default:
|
|
1966
|
+
return match.quarter(dateString, {
|
|
1967
|
+
width: 'wide',
|
|
1968
|
+
context: 'formatting'
|
|
1969
|
+
}) || match.quarter(dateString, {
|
|
1970
|
+
width: 'abbreviated',
|
|
1971
|
+
context: 'formatting'
|
|
1972
|
+
}) || match.quarter(dateString, {
|
|
1973
|
+
width: 'narrow',
|
|
1974
|
+
context: 'formatting'
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
}, {
|
|
1979
|
+
key: "validate",
|
|
1980
|
+
value: function validate(_date, value) {
|
|
1981
|
+
return value >= 1 && value <= 4;
|
|
1982
|
+
}
|
|
1983
|
+
}, {
|
|
1984
|
+
key: "set",
|
|
1985
|
+
value: function set(date, _flags, value) {
|
|
1986
|
+
date.setUTCMonth((value - 1) * 3, 1);
|
|
1987
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
1988
|
+
return date;
|
|
1989
|
+
}
|
|
1990
|
+
}]);
|
|
1991
|
+
|
|
1992
|
+
return QuarterParser;
|
|
1993
|
+
}(Parser);
|
|
1994
|
+
|
|
1995
|
+
function _typeof$o(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$o = function _typeof(obj) { return typeof obj; }; } else { _typeof$o = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$o(obj); }
|
|
1996
|
+
|
|
1997
|
+
function _classCallCheck$o(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1998
|
+
|
|
1999
|
+
function _defineProperties$o(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2000
|
+
|
|
2001
|
+
function _createClass$o(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$o(Constructor.prototype, protoProps); if (staticProps) _defineProperties$o(Constructor, staticProps); return Constructor; }
|
|
2002
|
+
|
|
2003
|
+
function _inherits$o(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$o(subClass, superClass); }
|
|
2004
|
+
|
|
2005
|
+
function _setPrototypeOf$o(o, p) { _setPrototypeOf$o = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$o(o, p); }
|
|
2006
|
+
|
|
2007
|
+
function _createSuper$o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$o(); return function _createSuperInternal() { var Super = _getPrototypeOf$o(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$o(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$o(this, result); }; }
|
|
2008
|
+
|
|
2009
|
+
function _possibleConstructorReturn$o(self, call) { if (call && (_typeof$o(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$o(self); }
|
|
2010
|
+
|
|
2011
|
+
function _assertThisInitialized$o(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2012
|
+
|
|
2013
|
+
function _isNativeReflectConstruct$o() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2014
|
+
|
|
2015
|
+
function _getPrototypeOf$o(o) { _getPrototypeOf$o = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$o(o); }
|
|
2016
|
+
|
|
2017
|
+
function _defineProperty$o(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2018
|
+
var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) {
|
|
2019
|
+
_inherits$o(StandAloneQuarterParser, _Parser);
|
|
2020
|
+
|
|
2021
|
+
var _super = _createSuper$o(StandAloneQuarterParser);
|
|
2022
|
+
|
|
2023
|
+
function StandAloneQuarterParser() {
|
|
2024
|
+
var _this;
|
|
2025
|
+
|
|
2026
|
+
_classCallCheck$o(this, StandAloneQuarterParser);
|
|
2027
|
+
|
|
2028
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2029
|
+
args[_key] = arguments[_key];
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2033
|
+
|
|
2034
|
+
_defineProperty$o(_assertThisInitialized$o(_this), "priority", 120);
|
|
2035
|
+
|
|
2036
|
+
_defineProperty$o(_assertThisInitialized$o(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
2037
|
+
|
|
2038
|
+
return _this;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
_createClass$o(StandAloneQuarterParser, [{
|
|
2042
|
+
key: "parse",
|
|
2043
|
+
value: function parse(dateString, token, match) {
|
|
2044
|
+
switch (token) {
|
|
2045
|
+
// 1, 2, 3, 4
|
|
2046
|
+
case 'q':
|
|
2047
|
+
case 'qq':
|
|
2048
|
+
// 01, 02, 03, 04
|
|
2049
|
+
return parseNDigits(token.length, dateString);
|
|
2050
|
+
// 1st, 2nd, 3rd, 4th
|
|
2051
|
+
|
|
2052
|
+
case 'qo':
|
|
2053
|
+
return match.ordinalNumber(dateString, {
|
|
2054
|
+
unit: 'quarter'
|
|
2055
|
+
});
|
|
2056
|
+
// Q1, Q2, Q3, Q4
|
|
2057
|
+
|
|
2058
|
+
case 'qqq':
|
|
2059
|
+
return match.quarter(dateString, {
|
|
2060
|
+
width: 'abbreviated',
|
|
2061
|
+
context: 'standalone'
|
|
2062
|
+
}) || match.quarter(dateString, {
|
|
2063
|
+
width: 'narrow',
|
|
2064
|
+
context: 'standalone'
|
|
2065
|
+
});
|
|
2066
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2067
|
+
|
|
2068
|
+
case 'qqqqq':
|
|
2069
|
+
return match.quarter(dateString, {
|
|
2070
|
+
width: 'narrow',
|
|
2071
|
+
context: 'standalone'
|
|
2072
|
+
});
|
|
2073
|
+
// 1st quarter, 2nd quarter, ...
|
|
2074
|
+
|
|
2075
|
+
case 'qqqq':
|
|
2076
|
+
default:
|
|
2077
|
+
return match.quarter(dateString, {
|
|
2078
|
+
width: 'wide',
|
|
2079
|
+
context: 'standalone'
|
|
2080
|
+
}) || match.quarter(dateString, {
|
|
2081
|
+
width: 'abbreviated',
|
|
2082
|
+
context: 'standalone'
|
|
2083
|
+
}) || match.quarter(dateString, {
|
|
2084
|
+
width: 'narrow',
|
|
2085
|
+
context: 'standalone'
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
}, {
|
|
2090
|
+
key: "validate",
|
|
2091
|
+
value: function validate(_date, value) {
|
|
2092
|
+
return value >= 1 && value <= 4;
|
|
2093
|
+
}
|
|
2094
|
+
}, {
|
|
2095
|
+
key: "set",
|
|
2096
|
+
value: function set(date, _flags, value) {
|
|
2097
|
+
date.setUTCMonth((value - 1) * 3, 1);
|
|
2098
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2099
|
+
return date;
|
|
2100
|
+
}
|
|
2101
|
+
}]);
|
|
2102
|
+
|
|
2103
|
+
return StandAloneQuarterParser;
|
|
2104
|
+
}(Parser);
|
|
2105
|
+
|
|
2106
|
+
function _typeof$n(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$n = function _typeof(obj) { return typeof obj; }; } else { _typeof$n = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$n(obj); }
|
|
2107
|
+
|
|
2108
|
+
function _classCallCheck$n(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2109
|
+
|
|
2110
|
+
function _defineProperties$n(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2111
|
+
|
|
2112
|
+
function _createClass$n(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$n(Constructor.prototype, protoProps); if (staticProps) _defineProperties$n(Constructor, staticProps); return Constructor; }
|
|
2113
|
+
|
|
2114
|
+
function _inherits$n(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$n(subClass, superClass); }
|
|
2115
|
+
|
|
2116
|
+
function _setPrototypeOf$n(o, p) { _setPrototypeOf$n = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$n(o, p); }
|
|
2117
|
+
|
|
2118
|
+
function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf$n(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$n(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$n(this, result); }; }
|
|
2119
|
+
|
|
2120
|
+
function _possibleConstructorReturn$n(self, call) { if (call && (_typeof$n(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$n(self); }
|
|
2121
|
+
|
|
2122
|
+
function _assertThisInitialized$n(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2123
|
+
|
|
2124
|
+
function _isNativeReflectConstruct$n() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2125
|
+
|
|
2126
|
+
function _getPrototypeOf$n(o) { _getPrototypeOf$n = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$n(o); }
|
|
2127
|
+
|
|
2128
|
+
function _defineProperty$n(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2129
|
+
var MonthParser = /*#__PURE__*/function (_Parser) {
|
|
2130
|
+
_inherits$n(MonthParser, _Parser);
|
|
2131
|
+
|
|
2132
|
+
var _super = _createSuper$n(MonthParser);
|
|
2133
|
+
|
|
2134
|
+
function MonthParser() {
|
|
2135
|
+
var _this;
|
|
2136
|
+
|
|
2137
|
+
_classCallCheck$n(this, MonthParser);
|
|
2138
|
+
|
|
2139
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2140
|
+
args[_key] = arguments[_key];
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2144
|
+
|
|
2145
|
+
_defineProperty$n(_assertThisInitialized$n(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
2146
|
+
|
|
2147
|
+
_defineProperty$n(_assertThisInitialized$n(_this), "priority", 110);
|
|
2148
|
+
|
|
2149
|
+
return _this;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
_createClass$n(MonthParser, [{
|
|
2153
|
+
key: "parse",
|
|
2154
|
+
value: function parse(dateString, token, match) {
|
|
2155
|
+
var valueCallback = function valueCallback(value) {
|
|
2156
|
+
return value - 1;
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2159
|
+
switch (token) {
|
|
2160
|
+
// 1, 2, ..., 12
|
|
2161
|
+
case 'M':
|
|
2162
|
+
return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
|
|
2163
|
+
// 01, 02, ..., 12
|
|
2164
|
+
|
|
2165
|
+
case 'MM':
|
|
2166
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
2167
|
+
// 1st, 2nd, ..., 12th
|
|
2168
|
+
|
|
2169
|
+
case 'Mo':
|
|
2170
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
2171
|
+
unit: 'month'
|
|
2172
|
+
}), valueCallback);
|
|
2173
|
+
// Jan, Feb, ..., Dec
|
|
2174
|
+
|
|
2175
|
+
case 'MMM':
|
|
2176
|
+
return match.month(dateString, {
|
|
2177
|
+
width: 'abbreviated',
|
|
2178
|
+
context: 'formatting'
|
|
2179
|
+
}) || match.month(dateString, {
|
|
2180
|
+
width: 'narrow',
|
|
2181
|
+
context: 'formatting'
|
|
2182
|
+
});
|
|
2183
|
+
// J, F, ..., D
|
|
2184
|
+
|
|
2185
|
+
case 'MMMMM':
|
|
2186
|
+
return match.month(dateString, {
|
|
2187
|
+
width: 'narrow',
|
|
2188
|
+
context: 'formatting'
|
|
2189
|
+
});
|
|
2190
|
+
// January, February, ..., December
|
|
2191
|
+
|
|
2192
|
+
case 'MMMM':
|
|
2193
|
+
default:
|
|
2194
|
+
return match.month(dateString, {
|
|
2195
|
+
width: 'wide',
|
|
2196
|
+
context: 'formatting'
|
|
2197
|
+
}) || match.month(dateString, {
|
|
2198
|
+
width: 'abbreviated',
|
|
2199
|
+
context: 'formatting'
|
|
2200
|
+
}) || match.month(dateString, {
|
|
2201
|
+
width: 'narrow',
|
|
2202
|
+
context: 'formatting'
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
}, {
|
|
2207
|
+
key: "validate",
|
|
2208
|
+
value: function validate(_date, value) {
|
|
2209
|
+
return value >= 0 && value <= 11;
|
|
2210
|
+
}
|
|
2211
|
+
}, {
|
|
2212
|
+
key: "set",
|
|
2213
|
+
value: function set(date, _flags, value) {
|
|
2214
|
+
date.setUTCMonth(value, 1);
|
|
2215
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2216
|
+
return date;
|
|
2217
|
+
}
|
|
2218
|
+
}]);
|
|
2219
|
+
|
|
2220
|
+
return MonthParser;
|
|
2221
|
+
}(Parser);
|
|
2222
|
+
|
|
2223
|
+
function _typeof$m(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$m = function _typeof(obj) { return typeof obj; }; } else { _typeof$m = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$m(obj); }
|
|
2224
|
+
|
|
2225
|
+
function _classCallCheck$m(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2226
|
+
|
|
2227
|
+
function _defineProperties$m(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2228
|
+
|
|
2229
|
+
function _createClass$m(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$m(Constructor.prototype, protoProps); if (staticProps) _defineProperties$m(Constructor, staticProps); return Constructor; }
|
|
2230
|
+
|
|
2231
|
+
function _inherits$m(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$m(subClass, superClass); }
|
|
2232
|
+
|
|
2233
|
+
function _setPrototypeOf$m(o, p) { _setPrototypeOf$m = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$m(o, p); }
|
|
2234
|
+
|
|
2235
|
+
function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); return function _createSuperInternal() { var Super = _getPrototypeOf$m(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$m(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$m(this, result); }; }
|
|
2236
|
+
|
|
2237
|
+
function _possibleConstructorReturn$m(self, call) { if (call && (_typeof$m(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$m(self); }
|
|
2238
|
+
|
|
2239
|
+
function _assertThisInitialized$m(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2240
|
+
|
|
2241
|
+
function _isNativeReflectConstruct$m() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2242
|
+
|
|
2243
|
+
function _getPrototypeOf$m(o) { _getPrototypeOf$m = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$m(o); }
|
|
2244
|
+
|
|
2245
|
+
function _defineProperty$m(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2246
|
+
var StandAloneMonthParser = /*#__PURE__*/function (_Parser) {
|
|
2247
|
+
_inherits$m(StandAloneMonthParser, _Parser);
|
|
2248
|
+
|
|
2249
|
+
var _super = _createSuper$m(StandAloneMonthParser);
|
|
2250
|
+
|
|
2251
|
+
function StandAloneMonthParser() {
|
|
2252
|
+
var _this;
|
|
2253
|
+
|
|
2254
|
+
_classCallCheck$m(this, StandAloneMonthParser);
|
|
2255
|
+
|
|
2256
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2257
|
+
args[_key] = arguments[_key];
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2261
|
+
|
|
2262
|
+
_defineProperty$m(_assertThisInitialized$m(_this), "priority", 110);
|
|
2263
|
+
|
|
2264
|
+
_defineProperty$m(_assertThisInitialized$m(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
2265
|
+
|
|
2266
|
+
return _this;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
_createClass$m(StandAloneMonthParser, [{
|
|
2270
|
+
key: "parse",
|
|
2271
|
+
value: function parse(dateString, token, match) {
|
|
2272
|
+
var valueCallback = function valueCallback(value) {
|
|
2273
|
+
return value - 1;
|
|
2274
|
+
};
|
|
2275
|
+
|
|
2276
|
+
switch (token) {
|
|
2277
|
+
// 1, 2, ..., 12
|
|
2278
|
+
case 'L':
|
|
2279
|
+
return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
|
|
2280
|
+
// 01, 02, ..., 12
|
|
2281
|
+
|
|
2282
|
+
case 'LL':
|
|
2283
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
2284
|
+
// 1st, 2nd, ..., 12th
|
|
2285
|
+
|
|
2286
|
+
case 'Lo':
|
|
2287
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
2288
|
+
unit: 'month'
|
|
2289
|
+
}), valueCallback);
|
|
2290
|
+
// Jan, Feb, ..., Dec
|
|
2291
|
+
|
|
2292
|
+
case 'LLL':
|
|
2293
|
+
return match.month(dateString, {
|
|
2294
|
+
width: 'abbreviated',
|
|
2295
|
+
context: 'standalone'
|
|
2296
|
+
}) || match.month(dateString, {
|
|
2297
|
+
width: 'narrow',
|
|
2298
|
+
context: 'standalone'
|
|
2299
|
+
});
|
|
2300
|
+
// J, F, ..., D
|
|
2301
|
+
|
|
2302
|
+
case 'LLLLL':
|
|
2303
|
+
return match.month(dateString, {
|
|
2304
|
+
width: 'narrow',
|
|
2305
|
+
context: 'standalone'
|
|
2306
|
+
});
|
|
2307
|
+
// January, February, ..., December
|
|
2308
|
+
|
|
2309
|
+
case 'LLLL':
|
|
2310
|
+
default:
|
|
2311
|
+
return match.month(dateString, {
|
|
2312
|
+
width: 'wide',
|
|
2313
|
+
context: 'standalone'
|
|
2314
|
+
}) || match.month(dateString, {
|
|
2315
|
+
width: 'abbreviated',
|
|
2316
|
+
context: 'standalone'
|
|
2317
|
+
}) || match.month(dateString, {
|
|
2318
|
+
width: 'narrow',
|
|
2319
|
+
context: 'standalone'
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}, {
|
|
2324
|
+
key: "validate",
|
|
2325
|
+
value: function validate(_date, value) {
|
|
2326
|
+
return value >= 0 && value <= 11;
|
|
2327
|
+
}
|
|
2328
|
+
}, {
|
|
2329
|
+
key: "set",
|
|
2330
|
+
value: function set(date, _flags, value) {
|
|
2331
|
+
date.setUTCMonth(value, 1);
|
|
2332
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2333
|
+
return date;
|
|
2334
|
+
}
|
|
2335
|
+
}]);
|
|
2336
|
+
|
|
2337
|
+
return StandAloneMonthParser;
|
|
2338
|
+
}(Parser);
|
|
2339
|
+
|
|
2340
|
+
function setUTCWeek(dirtyDate, dirtyWeek, options) {
|
|
2341
|
+
requiredArgs(2, arguments);
|
|
2342
|
+
var date = toDate(dirtyDate);
|
|
2343
|
+
var week = toInteger(dirtyWeek);
|
|
2344
|
+
var diff = getUTCWeek(date, options) - week;
|
|
2345
|
+
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
2346
|
+
return date;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
function _typeof$l(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$l = function _typeof(obj) { return typeof obj; }; } else { _typeof$l = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$l(obj); }
|
|
2350
|
+
|
|
2351
|
+
function _classCallCheck$l(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2352
|
+
|
|
2353
|
+
function _defineProperties$l(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2354
|
+
|
|
2355
|
+
function _createClass$l(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$l(Constructor.prototype, protoProps); if (staticProps) _defineProperties$l(Constructor, staticProps); return Constructor; }
|
|
2356
|
+
|
|
2357
|
+
function _inherits$l(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$l(subClass, superClass); }
|
|
2358
|
+
|
|
2359
|
+
function _setPrototypeOf$l(o, p) { _setPrototypeOf$l = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$l(o, p); }
|
|
2360
|
+
|
|
2361
|
+
function _createSuper$l(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$l(); return function _createSuperInternal() { var Super = _getPrototypeOf$l(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$l(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$l(this, result); }; }
|
|
2362
|
+
|
|
2363
|
+
function _possibleConstructorReturn$l(self, call) { if (call && (_typeof$l(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$l(self); }
|
|
2364
|
+
|
|
2365
|
+
function _assertThisInitialized$l(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2366
|
+
|
|
2367
|
+
function _isNativeReflectConstruct$l() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2368
|
+
|
|
2369
|
+
function _getPrototypeOf$l(o) { _getPrototypeOf$l = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$l(o); }
|
|
2370
|
+
|
|
2371
|
+
function _defineProperty$l(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2372
|
+
|
|
2373
|
+
var LocalWeekParser = /*#__PURE__*/function (_Parser) {
|
|
2374
|
+
_inherits$l(LocalWeekParser, _Parser);
|
|
2375
|
+
|
|
2376
|
+
var _super = _createSuper$l(LocalWeekParser);
|
|
2377
|
+
|
|
2378
|
+
function LocalWeekParser() {
|
|
2379
|
+
var _this;
|
|
2380
|
+
|
|
2381
|
+
_classCallCheck$l(this, LocalWeekParser);
|
|
2382
|
+
|
|
2383
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2384
|
+
args[_key] = arguments[_key];
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2388
|
+
|
|
2389
|
+
_defineProperty$l(_assertThisInitialized$l(_this), "priority", 100);
|
|
2390
|
+
|
|
2391
|
+
_defineProperty$l(_assertThisInitialized$l(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
|
|
2392
|
+
|
|
2393
|
+
return _this;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
_createClass$l(LocalWeekParser, [{
|
|
2397
|
+
key: "parse",
|
|
2398
|
+
value: function parse(dateString, token, match) {
|
|
2399
|
+
switch (token) {
|
|
2400
|
+
case 'w':
|
|
2401
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
2402
|
+
|
|
2403
|
+
case 'wo':
|
|
2404
|
+
return match.ordinalNumber(dateString, {
|
|
2405
|
+
unit: 'week'
|
|
2406
|
+
});
|
|
2407
|
+
|
|
2408
|
+
default:
|
|
2409
|
+
return parseNDigits(token.length, dateString);
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}, {
|
|
2413
|
+
key: "validate",
|
|
2414
|
+
value: function validate(_date, value) {
|
|
2415
|
+
return value >= 1 && value <= 53;
|
|
2416
|
+
}
|
|
2417
|
+
}, {
|
|
2418
|
+
key: "set",
|
|
2419
|
+
value: function set(date, _flags, value, options) {
|
|
2420
|
+
return startOfUTCWeek(setUTCWeek(date, value, options), options);
|
|
2421
|
+
}
|
|
2422
|
+
}]);
|
|
2423
|
+
|
|
2424
|
+
return LocalWeekParser;
|
|
2425
|
+
}(Parser);
|
|
2426
|
+
|
|
2427
|
+
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
|
|
2428
|
+
requiredArgs(2, arguments);
|
|
2429
|
+
var date = toDate(dirtyDate);
|
|
2430
|
+
var isoWeek = toInteger(dirtyISOWeek);
|
|
2431
|
+
var diff = getUTCISOWeek(date) - isoWeek;
|
|
2432
|
+
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
2433
|
+
return date;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
function _typeof$k(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$k = function _typeof(obj) { return typeof obj; }; } else { _typeof$k = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$k(obj); }
|
|
2437
|
+
|
|
2438
|
+
function _classCallCheck$k(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2439
|
+
|
|
2440
|
+
function _defineProperties$k(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2441
|
+
|
|
2442
|
+
function _createClass$k(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$k(Constructor.prototype, protoProps); if (staticProps) _defineProperties$k(Constructor, staticProps); return Constructor; }
|
|
2443
|
+
|
|
2444
|
+
function _inherits$k(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$k(subClass, superClass); }
|
|
2445
|
+
|
|
2446
|
+
function _setPrototypeOf$k(o, p) { _setPrototypeOf$k = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$k(o, p); }
|
|
2447
|
+
|
|
2448
|
+
function _createSuper$k(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$k(); return function _createSuperInternal() { var Super = _getPrototypeOf$k(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$k(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$k(this, result); }; }
|
|
2449
|
+
|
|
2450
|
+
function _possibleConstructorReturn$k(self, call) { if (call && (_typeof$k(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$k(self); }
|
|
2451
|
+
|
|
2452
|
+
function _assertThisInitialized$k(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2453
|
+
|
|
2454
|
+
function _isNativeReflectConstruct$k() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2455
|
+
|
|
2456
|
+
function _getPrototypeOf$k(o) { _getPrototypeOf$k = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$k(o); }
|
|
2457
|
+
|
|
2458
|
+
function _defineProperty$k(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2459
|
+
|
|
2460
|
+
var ISOWeekParser = /*#__PURE__*/function (_Parser) {
|
|
2461
|
+
_inherits$k(ISOWeekParser, _Parser);
|
|
2462
|
+
|
|
2463
|
+
var _super = _createSuper$k(ISOWeekParser);
|
|
2464
|
+
|
|
2465
|
+
function ISOWeekParser() {
|
|
2466
|
+
var _this;
|
|
2467
|
+
|
|
2468
|
+
_classCallCheck$k(this, ISOWeekParser);
|
|
2469
|
+
|
|
2470
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2471
|
+
args[_key] = arguments[_key];
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2475
|
+
|
|
2476
|
+
_defineProperty$k(_assertThisInitialized$k(_this), "priority", 100);
|
|
2477
|
+
|
|
2478
|
+
_defineProperty$k(_assertThisInitialized$k(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
|
|
2479
|
+
|
|
2480
|
+
return _this;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
_createClass$k(ISOWeekParser, [{
|
|
2484
|
+
key: "parse",
|
|
2485
|
+
value: function parse(dateString, token, match) {
|
|
2486
|
+
switch (token) {
|
|
2487
|
+
case 'I':
|
|
2488
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
2489
|
+
|
|
2490
|
+
case 'Io':
|
|
2491
|
+
return match.ordinalNumber(dateString, {
|
|
2492
|
+
unit: 'week'
|
|
2493
|
+
});
|
|
2494
|
+
|
|
2495
|
+
default:
|
|
2496
|
+
return parseNDigits(token.length, dateString);
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
}, {
|
|
2500
|
+
key: "validate",
|
|
2501
|
+
value: function validate(_date, value) {
|
|
2502
|
+
return value >= 1 && value <= 53;
|
|
2503
|
+
}
|
|
2504
|
+
}, {
|
|
2505
|
+
key: "set",
|
|
2506
|
+
value: function set(date, _flags, value) {
|
|
2507
|
+
return startOfUTCISOWeek(setUTCISOWeek(date, value));
|
|
2508
|
+
}
|
|
2509
|
+
}]);
|
|
2510
|
+
|
|
2511
|
+
return ISOWeekParser;
|
|
2512
|
+
}(Parser);
|
|
2513
|
+
|
|
2514
|
+
function _typeof$j(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$j = function _typeof(obj) { return typeof obj; }; } else { _typeof$j = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$j(obj); }
|
|
2515
|
+
|
|
2516
|
+
function _classCallCheck$j(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2517
|
+
|
|
2518
|
+
function _defineProperties$j(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2519
|
+
|
|
2520
|
+
function _createClass$j(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$j(Constructor.prototype, protoProps); if (staticProps) _defineProperties$j(Constructor, staticProps); return Constructor; }
|
|
2521
|
+
|
|
2522
|
+
function _inherits$j(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$j(subClass, superClass); }
|
|
2523
|
+
|
|
2524
|
+
function _setPrototypeOf$j(o, p) { _setPrototypeOf$j = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$j(o, p); }
|
|
2525
|
+
|
|
2526
|
+
function _createSuper$j(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$j(); return function _createSuperInternal() { var Super = _getPrototypeOf$j(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$j(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$j(this, result); }; }
|
|
2527
|
+
|
|
2528
|
+
function _possibleConstructorReturn$j(self, call) { if (call && (_typeof$j(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$j(self); }
|
|
2529
|
+
|
|
2530
|
+
function _assertThisInitialized$j(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2531
|
+
|
|
2532
|
+
function _isNativeReflectConstruct$j() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2533
|
+
|
|
2534
|
+
function _getPrototypeOf$j(o) { _getPrototypeOf$j = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$j(o); }
|
|
2535
|
+
|
|
2536
|
+
function _defineProperty$j(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2537
|
+
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2538
|
+
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // Day of the month
|
|
2539
|
+
|
|
2540
|
+
var DateParser = /*#__PURE__*/function (_Parser) {
|
|
2541
|
+
_inherits$j(DateParser, _Parser);
|
|
2542
|
+
|
|
2543
|
+
var _super = _createSuper$j(DateParser);
|
|
2544
|
+
|
|
2545
|
+
function DateParser() {
|
|
2546
|
+
var _this;
|
|
2547
|
+
|
|
2548
|
+
_classCallCheck$j(this, DateParser);
|
|
2549
|
+
|
|
2550
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2551
|
+
args[_key] = arguments[_key];
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2555
|
+
|
|
2556
|
+
_defineProperty$j(_assertThisInitialized$j(_this), "priority", 90);
|
|
2557
|
+
|
|
2558
|
+
_defineProperty$j(_assertThisInitialized$j(_this), "subPriority", 1);
|
|
2559
|
+
|
|
2560
|
+
_defineProperty$j(_assertThisInitialized$j(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
|
|
2561
|
+
|
|
2562
|
+
return _this;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
_createClass$j(DateParser, [{
|
|
2566
|
+
key: "parse",
|
|
2567
|
+
value: function parse(dateString, token, match) {
|
|
2568
|
+
switch (token) {
|
|
2569
|
+
case 'd':
|
|
2570
|
+
return parseNumericPattern(numericPatterns.date, dateString);
|
|
2571
|
+
|
|
2572
|
+
case 'do':
|
|
2573
|
+
return match.ordinalNumber(dateString, {
|
|
2574
|
+
unit: 'date'
|
|
2575
|
+
});
|
|
2576
|
+
|
|
2577
|
+
default:
|
|
2578
|
+
return parseNDigits(token.length, dateString);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
}, {
|
|
2582
|
+
key: "validate",
|
|
2583
|
+
value: function validate(date, value) {
|
|
2584
|
+
var year = date.getUTCFullYear();
|
|
2585
|
+
var isLeapYear = isLeapYearIndex(year);
|
|
2586
|
+
var month = date.getUTCMonth();
|
|
2587
|
+
|
|
2588
|
+
if (isLeapYear) {
|
|
2589
|
+
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
2590
|
+
} else {
|
|
2591
|
+
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
}, {
|
|
2595
|
+
key: "set",
|
|
2596
|
+
value: function set(date, _flags, value) {
|
|
2597
|
+
date.setUTCDate(value);
|
|
2598
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2599
|
+
return date;
|
|
2600
|
+
}
|
|
2601
|
+
}]);
|
|
2602
|
+
|
|
2603
|
+
return DateParser;
|
|
2604
|
+
}(Parser);
|
|
2605
|
+
|
|
2606
|
+
function _typeof$i(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$i = function _typeof(obj) { return typeof obj; }; } else { _typeof$i = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$i(obj); }
|
|
2607
|
+
|
|
2608
|
+
function _classCallCheck$i(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2609
|
+
|
|
2610
|
+
function _defineProperties$i(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2611
|
+
|
|
2612
|
+
function _createClass$i(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$i(Constructor.prototype, protoProps); if (staticProps) _defineProperties$i(Constructor, staticProps); return Constructor; }
|
|
2613
|
+
|
|
2614
|
+
function _inherits$i(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$i(subClass, superClass); }
|
|
2615
|
+
|
|
2616
|
+
function _setPrototypeOf$i(o, p) { _setPrototypeOf$i = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$i(o, p); }
|
|
2617
|
+
|
|
2618
|
+
function _createSuper$i(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$i(); return function _createSuperInternal() { var Super = _getPrototypeOf$i(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$i(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$i(this, result); }; }
|
|
2619
|
+
|
|
2620
|
+
function _possibleConstructorReturn$i(self, call) { if (call && (_typeof$i(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$i(self); }
|
|
2621
|
+
|
|
2622
|
+
function _assertThisInitialized$i(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2623
|
+
|
|
2624
|
+
function _isNativeReflectConstruct$i() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2625
|
+
|
|
2626
|
+
function _getPrototypeOf$i(o) { _getPrototypeOf$i = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$i(o); }
|
|
2627
|
+
|
|
2628
|
+
function _defineProperty$i(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2629
|
+
var DayOfYearParser = /*#__PURE__*/function (_Parser) {
|
|
2630
|
+
_inherits$i(DayOfYearParser, _Parser);
|
|
2631
|
+
|
|
2632
|
+
var _super = _createSuper$i(DayOfYearParser);
|
|
2633
|
+
|
|
2634
|
+
function DayOfYearParser() {
|
|
2635
|
+
var _this;
|
|
2636
|
+
|
|
2637
|
+
_classCallCheck$i(this, DayOfYearParser);
|
|
2638
|
+
|
|
2639
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2640
|
+
args[_key] = arguments[_key];
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2644
|
+
|
|
2645
|
+
_defineProperty$i(_assertThisInitialized$i(_this), "priority", 90);
|
|
2646
|
+
|
|
2647
|
+
_defineProperty$i(_assertThisInitialized$i(_this), "subpriority", 1);
|
|
2648
|
+
|
|
2649
|
+
_defineProperty$i(_assertThisInitialized$i(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']);
|
|
2650
|
+
|
|
2651
|
+
return _this;
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
_createClass$i(DayOfYearParser, [{
|
|
2655
|
+
key: "parse",
|
|
2656
|
+
value: function parse(dateString, token, match) {
|
|
2657
|
+
switch (token) {
|
|
2658
|
+
case 'D':
|
|
2659
|
+
case 'DD':
|
|
2660
|
+
return parseNumericPattern(numericPatterns.dayOfYear, dateString);
|
|
2661
|
+
|
|
2662
|
+
case 'Do':
|
|
2663
|
+
return match.ordinalNumber(dateString, {
|
|
2664
|
+
unit: 'date'
|
|
2665
|
+
});
|
|
2666
|
+
|
|
2667
|
+
default:
|
|
2668
|
+
return parseNDigits(token.length, dateString);
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
}, {
|
|
2672
|
+
key: "validate",
|
|
2673
|
+
value: function validate(date, value) {
|
|
2674
|
+
var year = date.getUTCFullYear();
|
|
2675
|
+
var isLeapYear = isLeapYearIndex(year);
|
|
2676
|
+
|
|
2677
|
+
if (isLeapYear) {
|
|
2678
|
+
return value >= 1 && value <= 366;
|
|
2679
|
+
} else {
|
|
2680
|
+
return value >= 1 && value <= 365;
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
}, {
|
|
2684
|
+
key: "set",
|
|
2685
|
+
value: function set(date, _flags, value) {
|
|
2686
|
+
date.setUTCMonth(0, value);
|
|
2687
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2688
|
+
return date;
|
|
2689
|
+
}
|
|
2690
|
+
}]);
|
|
2691
|
+
|
|
2692
|
+
return DayOfYearParser;
|
|
2693
|
+
}(Parser);
|
|
2694
|
+
|
|
2695
|
+
function setUTCDay(dirtyDate, dirtyDay, options) {
|
|
2696
|
+
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
2697
|
+
|
|
2698
|
+
requiredArgs(2, arguments);
|
|
2699
|
+
var defaultOptions = getDefaultOptions();
|
|
2700
|
+
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
2701
|
+
|
|
2702
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
2703
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
var date = toDate(dirtyDate);
|
|
2707
|
+
var day = toInteger(dirtyDay);
|
|
2708
|
+
var currentDay = date.getUTCDay();
|
|
2709
|
+
var remainder = day % 7;
|
|
2710
|
+
var dayIndex = (remainder + 7) % 7;
|
|
2711
|
+
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
2712
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
2713
|
+
return date;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
function _typeof$h(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$h = function _typeof(obj) { return typeof obj; }; } else { _typeof$h = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$h(obj); }
|
|
2717
|
+
|
|
2718
|
+
function _classCallCheck$h(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2719
|
+
|
|
2720
|
+
function _defineProperties$h(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2721
|
+
|
|
2722
|
+
function _createClass$h(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$h(Constructor.prototype, protoProps); if (staticProps) _defineProperties$h(Constructor, staticProps); return Constructor; }
|
|
2723
|
+
|
|
2724
|
+
function _inherits$h(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$h(subClass, superClass); }
|
|
2725
|
+
|
|
2726
|
+
function _setPrototypeOf$h(o, p) { _setPrototypeOf$h = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$h(o, p); }
|
|
2727
|
+
|
|
2728
|
+
function _createSuper$h(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$h(); return function _createSuperInternal() { var Super = _getPrototypeOf$h(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$h(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$h(this, result); }; }
|
|
2729
|
+
|
|
2730
|
+
function _possibleConstructorReturn$h(self, call) { if (call && (_typeof$h(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$h(self); }
|
|
2731
|
+
|
|
2732
|
+
function _assertThisInitialized$h(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2733
|
+
|
|
2734
|
+
function _isNativeReflectConstruct$h() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2735
|
+
|
|
2736
|
+
function _getPrototypeOf$h(o) { _getPrototypeOf$h = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$h(o); }
|
|
2737
|
+
|
|
2738
|
+
function _defineProperty$h(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2739
|
+
|
|
2740
|
+
var DayParser = /*#__PURE__*/function (_Parser) {
|
|
2741
|
+
_inherits$h(DayParser, _Parser);
|
|
2742
|
+
|
|
2743
|
+
var _super = _createSuper$h(DayParser);
|
|
2744
|
+
|
|
2745
|
+
function DayParser() {
|
|
2746
|
+
var _this;
|
|
2747
|
+
|
|
2748
|
+
_classCallCheck$h(this, DayParser);
|
|
2749
|
+
|
|
2750
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2751
|
+
args[_key] = arguments[_key];
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2755
|
+
|
|
2756
|
+
_defineProperty$h(_assertThisInitialized$h(_this), "priority", 90);
|
|
2757
|
+
|
|
2758
|
+
_defineProperty$h(_assertThisInitialized$h(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']);
|
|
2759
|
+
|
|
2760
|
+
return _this;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
_createClass$h(DayParser, [{
|
|
2764
|
+
key: "parse",
|
|
2765
|
+
value: function parse(dateString, token, match) {
|
|
2766
|
+
switch (token) {
|
|
2767
|
+
// Tue
|
|
2768
|
+
case 'E':
|
|
2769
|
+
case 'EE':
|
|
2770
|
+
case 'EEE':
|
|
2771
|
+
return match.day(dateString, {
|
|
2772
|
+
width: 'abbreviated',
|
|
2773
|
+
context: 'formatting'
|
|
2774
|
+
}) || match.day(dateString, {
|
|
2775
|
+
width: 'short',
|
|
2776
|
+
context: 'formatting'
|
|
2777
|
+
}) || match.day(dateString, {
|
|
2778
|
+
width: 'narrow',
|
|
2779
|
+
context: 'formatting'
|
|
2780
|
+
});
|
|
2781
|
+
// T
|
|
2782
|
+
|
|
2783
|
+
case 'EEEEE':
|
|
2784
|
+
return match.day(dateString, {
|
|
2785
|
+
width: 'narrow',
|
|
2786
|
+
context: 'formatting'
|
|
2787
|
+
});
|
|
2788
|
+
// Tu
|
|
2789
|
+
|
|
2790
|
+
case 'EEEEEE':
|
|
2791
|
+
return match.day(dateString, {
|
|
2792
|
+
width: 'short',
|
|
2793
|
+
context: 'formatting'
|
|
2794
|
+
}) || match.day(dateString, {
|
|
2795
|
+
width: 'narrow',
|
|
2796
|
+
context: 'formatting'
|
|
2797
|
+
});
|
|
2798
|
+
// Tuesday
|
|
2799
|
+
|
|
2800
|
+
case 'EEEE':
|
|
2801
|
+
default:
|
|
2802
|
+
return match.day(dateString, {
|
|
2803
|
+
width: 'wide',
|
|
2804
|
+
context: 'formatting'
|
|
2805
|
+
}) || match.day(dateString, {
|
|
2806
|
+
width: 'abbreviated',
|
|
2807
|
+
context: 'formatting'
|
|
2808
|
+
}) || match.day(dateString, {
|
|
2809
|
+
width: 'short',
|
|
2810
|
+
context: 'formatting'
|
|
2811
|
+
}) || match.day(dateString, {
|
|
2812
|
+
width: 'narrow',
|
|
2813
|
+
context: 'formatting'
|
|
2814
|
+
});
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
}, {
|
|
2818
|
+
key: "validate",
|
|
2819
|
+
value: function validate(_date, value) {
|
|
2820
|
+
return value >= 0 && value <= 6;
|
|
2821
|
+
}
|
|
2822
|
+
}, {
|
|
2823
|
+
key: "set",
|
|
2824
|
+
value: function set(date, _flags, value, options) {
|
|
2825
|
+
date = setUTCDay(date, value, options);
|
|
2826
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2827
|
+
return date;
|
|
2828
|
+
}
|
|
2829
|
+
}]);
|
|
2830
|
+
|
|
2831
|
+
return DayParser;
|
|
2832
|
+
}(Parser);
|
|
2833
|
+
|
|
2834
|
+
function _typeof$g(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$g = function _typeof(obj) { return typeof obj; }; } else { _typeof$g = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$g(obj); }
|
|
2835
|
+
|
|
2836
|
+
function _classCallCheck$g(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2837
|
+
|
|
2838
|
+
function _defineProperties$g(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2839
|
+
|
|
2840
|
+
function _createClass$g(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$g(Constructor.prototype, protoProps); if (staticProps) _defineProperties$g(Constructor, staticProps); return Constructor; }
|
|
2841
|
+
|
|
2842
|
+
function _inherits$g(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$g(subClass, superClass); }
|
|
2843
|
+
|
|
2844
|
+
function _setPrototypeOf$g(o, p) { _setPrototypeOf$g = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$g(o, p); }
|
|
2845
|
+
|
|
2846
|
+
function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); return function _createSuperInternal() { var Super = _getPrototypeOf$g(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$g(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$g(this, result); }; }
|
|
2847
|
+
|
|
2848
|
+
function _possibleConstructorReturn$g(self, call) { if (call && (_typeof$g(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$g(self); }
|
|
2849
|
+
|
|
2850
|
+
function _assertThisInitialized$g(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2851
|
+
|
|
2852
|
+
function _isNativeReflectConstruct$g() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2853
|
+
|
|
2854
|
+
function _getPrototypeOf$g(o) { _getPrototypeOf$g = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$g(o); }
|
|
2855
|
+
|
|
2856
|
+
function _defineProperty$g(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2857
|
+
|
|
2858
|
+
var LocalDayParser = /*#__PURE__*/function (_Parser) {
|
|
2859
|
+
_inherits$g(LocalDayParser, _Parser);
|
|
2860
|
+
|
|
2861
|
+
var _super = _createSuper$g(LocalDayParser);
|
|
2862
|
+
|
|
2863
|
+
function LocalDayParser() {
|
|
2864
|
+
var _this;
|
|
2865
|
+
|
|
2866
|
+
_classCallCheck$g(this, LocalDayParser);
|
|
2867
|
+
|
|
2868
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2869
|
+
args[_key] = arguments[_key];
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2873
|
+
|
|
2874
|
+
_defineProperty$g(_assertThisInitialized$g(_this), "priority", 90);
|
|
2875
|
+
|
|
2876
|
+
_defineProperty$g(_assertThisInitialized$g(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
|
|
2877
|
+
|
|
2878
|
+
return _this;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
_createClass$g(LocalDayParser, [{
|
|
2882
|
+
key: "parse",
|
|
2883
|
+
value: function parse(dateString, token, match, options) {
|
|
2884
|
+
var valueCallback = function valueCallback(value) {
|
|
2885
|
+
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
2886
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
2887
|
+
};
|
|
2888
|
+
|
|
2889
|
+
switch (token) {
|
|
2890
|
+
// 3
|
|
2891
|
+
case 'e':
|
|
2892
|
+
case 'ee':
|
|
2893
|
+
// 03
|
|
2894
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
2895
|
+
// 3rd
|
|
2896
|
+
|
|
2897
|
+
case 'eo':
|
|
2898
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
2899
|
+
unit: 'day'
|
|
2900
|
+
}), valueCallback);
|
|
2901
|
+
// Tue
|
|
2902
|
+
|
|
2903
|
+
case 'eee':
|
|
2904
|
+
return match.day(dateString, {
|
|
2905
|
+
width: 'abbreviated',
|
|
2906
|
+
context: 'formatting'
|
|
2907
|
+
}) || match.day(dateString, {
|
|
2908
|
+
width: 'short',
|
|
2909
|
+
context: 'formatting'
|
|
2910
|
+
}) || match.day(dateString, {
|
|
2911
|
+
width: 'narrow',
|
|
2912
|
+
context: 'formatting'
|
|
2913
|
+
});
|
|
2914
|
+
// T
|
|
2915
|
+
|
|
2916
|
+
case 'eeeee':
|
|
2917
|
+
return match.day(dateString, {
|
|
2918
|
+
width: 'narrow',
|
|
2919
|
+
context: 'formatting'
|
|
2920
|
+
});
|
|
2921
|
+
// Tu
|
|
2922
|
+
|
|
2923
|
+
case 'eeeeee':
|
|
2924
|
+
return match.day(dateString, {
|
|
2925
|
+
width: 'short',
|
|
2926
|
+
context: 'formatting'
|
|
2927
|
+
}) || match.day(dateString, {
|
|
2928
|
+
width: 'narrow',
|
|
2929
|
+
context: 'formatting'
|
|
2930
|
+
});
|
|
2931
|
+
// Tuesday
|
|
2932
|
+
|
|
2933
|
+
case 'eeee':
|
|
2934
|
+
default:
|
|
2935
|
+
return match.day(dateString, {
|
|
2936
|
+
width: 'wide',
|
|
2937
|
+
context: 'formatting'
|
|
2938
|
+
}) || match.day(dateString, {
|
|
2939
|
+
width: 'abbreviated',
|
|
2940
|
+
context: 'formatting'
|
|
2941
|
+
}) || match.day(dateString, {
|
|
2942
|
+
width: 'short',
|
|
2943
|
+
context: 'formatting'
|
|
2944
|
+
}) || match.day(dateString, {
|
|
2945
|
+
width: 'narrow',
|
|
2946
|
+
context: 'formatting'
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
}, {
|
|
2951
|
+
key: "validate",
|
|
2952
|
+
value: function validate(_date, value) {
|
|
2953
|
+
return value >= 0 && value <= 6;
|
|
2954
|
+
}
|
|
2955
|
+
}, {
|
|
2956
|
+
key: "set",
|
|
2957
|
+
value: function set(date, _flags, value, options) {
|
|
2958
|
+
date = setUTCDay(date, value, options);
|
|
2959
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
2960
|
+
return date;
|
|
2961
|
+
}
|
|
2962
|
+
}]);
|
|
2963
|
+
|
|
2964
|
+
return LocalDayParser;
|
|
2965
|
+
}(Parser);
|
|
2966
|
+
|
|
2967
|
+
function _typeof$f(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$f = function _typeof(obj) { return typeof obj; }; } else { _typeof$f = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$f(obj); }
|
|
2968
|
+
|
|
2969
|
+
function _classCallCheck$f(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2970
|
+
|
|
2971
|
+
function _defineProperties$f(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2972
|
+
|
|
2973
|
+
function _createClass$f(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$f(Constructor.prototype, protoProps); if (staticProps) _defineProperties$f(Constructor, staticProps); return Constructor; }
|
|
2974
|
+
|
|
2975
|
+
function _inherits$f(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$f(subClass, superClass); }
|
|
2976
|
+
|
|
2977
|
+
function _setPrototypeOf$f(o, p) { _setPrototypeOf$f = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$f(o, p); }
|
|
2978
|
+
|
|
2979
|
+
function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf$f(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$f(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$f(this, result); }; }
|
|
2980
|
+
|
|
2981
|
+
function _possibleConstructorReturn$f(self, call) { if (call && (_typeof$f(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$f(self); }
|
|
2982
|
+
|
|
2983
|
+
function _assertThisInitialized$f(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2984
|
+
|
|
2985
|
+
function _isNativeReflectConstruct$f() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2986
|
+
|
|
2987
|
+
function _getPrototypeOf$f(o) { _getPrototypeOf$f = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$f(o); }
|
|
2988
|
+
|
|
2989
|
+
function _defineProperty$f(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2990
|
+
|
|
2991
|
+
var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) {
|
|
2992
|
+
_inherits$f(StandAloneLocalDayParser, _Parser);
|
|
2993
|
+
|
|
2994
|
+
var _super = _createSuper$f(StandAloneLocalDayParser);
|
|
2995
|
+
|
|
2996
|
+
function StandAloneLocalDayParser() {
|
|
2997
|
+
var _this;
|
|
2998
|
+
|
|
2999
|
+
_classCallCheck$f(this, StandAloneLocalDayParser);
|
|
3000
|
+
|
|
3001
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3002
|
+
args[_key] = arguments[_key];
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3006
|
+
|
|
3007
|
+
_defineProperty$f(_assertThisInitialized$f(_this), "priority", 90);
|
|
3008
|
+
|
|
3009
|
+
_defineProperty$f(_assertThisInitialized$f(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']);
|
|
3010
|
+
|
|
3011
|
+
return _this;
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
_createClass$f(StandAloneLocalDayParser, [{
|
|
3015
|
+
key: "parse",
|
|
3016
|
+
value: function parse(dateString, token, match, options) {
|
|
3017
|
+
var valueCallback = function valueCallback(value) {
|
|
3018
|
+
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
3019
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
3020
|
+
};
|
|
3021
|
+
|
|
3022
|
+
switch (token) {
|
|
3023
|
+
// 3
|
|
3024
|
+
case 'c':
|
|
3025
|
+
case 'cc':
|
|
3026
|
+
// 03
|
|
3027
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
3028
|
+
// 3rd
|
|
3029
|
+
|
|
3030
|
+
case 'co':
|
|
3031
|
+
return mapValue(match.ordinalNumber(dateString, {
|
|
3032
|
+
unit: 'day'
|
|
3033
|
+
}), valueCallback);
|
|
3034
|
+
// Tue
|
|
3035
|
+
|
|
3036
|
+
case 'ccc':
|
|
3037
|
+
return match.day(dateString, {
|
|
3038
|
+
width: 'abbreviated',
|
|
3039
|
+
context: 'standalone'
|
|
3040
|
+
}) || match.day(dateString, {
|
|
3041
|
+
width: 'short',
|
|
3042
|
+
context: 'standalone'
|
|
3043
|
+
}) || match.day(dateString, {
|
|
3044
|
+
width: 'narrow',
|
|
3045
|
+
context: 'standalone'
|
|
3046
|
+
});
|
|
3047
|
+
// T
|
|
3048
|
+
|
|
3049
|
+
case 'ccccc':
|
|
3050
|
+
return match.day(dateString, {
|
|
3051
|
+
width: 'narrow',
|
|
3052
|
+
context: 'standalone'
|
|
3053
|
+
});
|
|
3054
|
+
// Tu
|
|
3055
|
+
|
|
3056
|
+
case 'cccccc':
|
|
3057
|
+
return match.day(dateString, {
|
|
3058
|
+
width: 'short',
|
|
3059
|
+
context: 'standalone'
|
|
3060
|
+
}) || match.day(dateString, {
|
|
3061
|
+
width: 'narrow',
|
|
3062
|
+
context: 'standalone'
|
|
3063
|
+
});
|
|
3064
|
+
// Tuesday
|
|
3065
|
+
|
|
3066
|
+
case 'cccc':
|
|
3067
|
+
default:
|
|
3068
|
+
return match.day(dateString, {
|
|
3069
|
+
width: 'wide',
|
|
3070
|
+
context: 'standalone'
|
|
3071
|
+
}) || match.day(dateString, {
|
|
3072
|
+
width: 'abbreviated',
|
|
3073
|
+
context: 'standalone'
|
|
3074
|
+
}) || match.day(dateString, {
|
|
3075
|
+
width: 'short',
|
|
3076
|
+
context: 'standalone'
|
|
3077
|
+
}) || match.day(dateString, {
|
|
3078
|
+
width: 'narrow',
|
|
3079
|
+
context: 'standalone'
|
|
3080
|
+
});
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
}, {
|
|
3084
|
+
key: "validate",
|
|
3085
|
+
value: function validate(_date, value) {
|
|
3086
|
+
return value >= 0 && value <= 6;
|
|
3087
|
+
}
|
|
3088
|
+
}, {
|
|
3089
|
+
key: "set",
|
|
3090
|
+
value: function set(date, _flags, value, options) {
|
|
3091
|
+
date = setUTCDay(date, value, options);
|
|
3092
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3093
|
+
return date;
|
|
3094
|
+
}
|
|
3095
|
+
}]);
|
|
3096
|
+
|
|
3097
|
+
return StandAloneLocalDayParser;
|
|
3098
|
+
}(Parser);
|
|
3099
|
+
|
|
3100
|
+
function setUTCISODay(dirtyDate, dirtyDay) {
|
|
3101
|
+
requiredArgs(2, arguments);
|
|
3102
|
+
var day = toInteger(dirtyDay);
|
|
3103
|
+
|
|
3104
|
+
if (day % 7 === 0) {
|
|
3105
|
+
day = day - 7;
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
var weekStartsOn = 1;
|
|
3109
|
+
var date = toDate(dirtyDate);
|
|
3110
|
+
var currentDay = date.getUTCDay();
|
|
3111
|
+
var remainder = day % 7;
|
|
3112
|
+
var dayIndex = (remainder + 7) % 7;
|
|
3113
|
+
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
3114
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
3115
|
+
return date;
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
function _typeof$e(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$e = function _typeof(obj) { return typeof obj; }; } else { _typeof$e = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$e(obj); }
|
|
3119
|
+
|
|
3120
|
+
function _classCallCheck$e(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3121
|
+
|
|
3122
|
+
function _defineProperties$e(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3123
|
+
|
|
3124
|
+
function _createClass$e(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$e(Constructor.prototype, protoProps); if (staticProps) _defineProperties$e(Constructor, staticProps); return Constructor; }
|
|
3125
|
+
|
|
3126
|
+
function _inherits$e(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$e(subClass, superClass); }
|
|
3127
|
+
|
|
3128
|
+
function _setPrototypeOf$e(o, p) { _setPrototypeOf$e = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$e(o, p); }
|
|
3129
|
+
|
|
3130
|
+
function _createSuper$e(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$e(); return function _createSuperInternal() { var Super = _getPrototypeOf$e(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$e(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$e(this, result); }; }
|
|
3131
|
+
|
|
3132
|
+
function _possibleConstructorReturn$e(self, call) { if (call && (_typeof$e(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$e(self); }
|
|
3133
|
+
|
|
3134
|
+
function _assertThisInitialized$e(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3135
|
+
|
|
3136
|
+
function _isNativeReflectConstruct$e() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3137
|
+
|
|
3138
|
+
function _getPrototypeOf$e(o) { _getPrototypeOf$e = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$e(o); }
|
|
3139
|
+
|
|
3140
|
+
function _defineProperty$e(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3141
|
+
|
|
3142
|
+
var ISODayParser = /*#__PURE__*/function (_Parser) {
|
|
3143
|
+
_inherits$e(ISODayParser, _Parser);
|
|
3144
|
+
|
|
3145
|
+
var _super = _createSuper$e(ISODayParser);
|
|
3146
|
+
|
|
3147
|
+
function ISODayParser() {
|
|
3148
|
+
var _this;
|
|
3149
|
+
|
|
3150
|
+
_classCallCheck$e(this, ISODayParser);
|
|
3151
|
+
|
|
3152
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3153
|
+
args[_key] = arguments[_key];
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3157
|
+
|
|
3158
|
+
_defineProperty$e(_assertThisInitialized$e(_this), "priority", 90);
|
|
3159
|
+
|
|
3160
|
+
_defineProperty$e(_assertThisInitialized$e(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
|
|
3161
|
+
|
|
3162
|
+
return _this;
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
_createClass$e(ISODayParser, [{
|
|
3166
|
+
key: "parse",
|
|
3167
|
+
value: function parse(dateString, token, match) {
|
|
3168
|
+
var valueCallback = function valueCallback(value) {
|
|
3169
|
+
if (value === 0) {
|
|
3170
|
+
return 7;
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
return value;
|
|
3174
|
+
};
|
|
3175
|
+
|
|
3176
|
+
switch (token) {
|
|
3177
|
+
// 2
|
|
3178
|
+
case 'i':
|
|
3179
|
+
case 'ii':
|
|
3180
|
+
// 02
|
|
3181
|
+
return parseNDigits(token.length, dateString);
|
|
3182
|
+
// 2nd
|
|
3183
|
+
|
|
3184
|
+
case 'io':
|
|
3185
|
+
return match.ordinalNumber(dateString, {
|
|
3186
|
+
unit: 'day'
|
|
3187
|
+
});
|
|
3188
|
+
// Tue
|
|
3189
|
+
|
|
3190
|
+
case 'iii':
|
|
3191
|
+
return mapValue(match.day(dateString, {
|
|
3192
|
+
width: 'abbreviated',
|
|
3193
|
+
context: 'formatting'
|
|
3194
|
+
}) || match.day(dateString, {
|
|
3195
|
+
width: 'short',
|
|
3196
|
+
context: 'formatting'
|
|
3197
|
+
}) || match.day(dateString, {
|
|
3198
|
+
width: 'narrow',
|
|
3199
|
+
context: 'formatting'
|
|
3200
|
+
}), valueCallback);
|
|
3201
|
+
// T
|
|
3202
|
+
|
|
3203
|
+
case 'iiiii':
|
|
3204
|
+
return mapValue(match.day(dateString, {
|
|
3205
|
+
width: 'narrow',
|
|
3206
|
+
context: 'formatting'
|
|
3207
|
+
}), valueCallback);
|
|
3208
|
+
// Tu
|
|
3209
|
+
|
|
3210
|
+
case 'iiiiii':
|
|
3211
|
+
return mapValue(match.day(dateString, {
|
|
3212
|
+
width: 'short',
|
|
3213
|
+
context: 'formatting'
|
|
3214
|
+
}) || match.day(dateString, {
|
|
3215
|
+
width: 'narrow',
|
|
3216
|
+
context: 'formatting'
|
|
3217
|
+
}), valueCallback);
|
|
3218
|
+
// Tuesday
|
|
3219
|
+
|
|
3220
|
+
case 'iiii':
|
|
3221
|
+
default:
|
|
3222
|
+
return mapValue(match.day(dateString, {
|
|
3223
|
+
width: 'wide',
|
|
3224
|
+
context: 'formatting'
|
|
3225
|
+
}) || match.day(dateString, {
|
|
3226
|
+
width: 'abbreviated',
|
|
3227
|
+
context: 'formatting'
|
|
3228
|
+
}) || match.day(dateString, {
|
|
3229
|
+
width: 'short',
|
|
3230
|
+
context: 'formatting'
|
|
3231
|
+
}) || match.day(dateString, {
|
|
3232
|
+
width: 'narrow',
|
|
3233
|
+
context: 'formatting'
|
|
3234
|
+
}), valueCallback);
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
}, {
|
|
3238
|
+
key: "validate",
|
|
3239
|
+
value: function validate(_date, value) {
|
|
3240
|
+
return value >= 1 && value <= 7;
|
|
3241
|
+
}
|
|
3242
|
+
}, {
|
|
3243
|
+
key: "set",
|
|
3244
|
+
value: function set(date, _flags, value) {
|
|
3245
|
+
date = setUTCISODay(date, value);
|
|
3246
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3247
|
+
return date;
|
|
3248
|
+
}
|
|
3249
|
+
}]);
|
|
3250
|
+
|
|
3251
|
+
return ISODayParser;
|
|
3252
|
+
}(Parser);
|
|
3253
|
+
|
|
3254
|
+
function _typeof$d(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$d = function _typeof(obj) { return typeof obj; }; } else { _typeof$d = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$d(obj); }
|
|
3255
|
+
|
|
3256
|
+
function _classCallCheck$d(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3257
|
+
|
|
3258
|
+
function _defineProperties$d(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3259
|
+
|
|
3260
|
+
function _createClass$d(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$d(Constructor.prototype, protoProps); if (staticProps) _defineProperties$d(Constructor, staticProps); return Constructor; }
|
|
3261
|
+
|
|
3262
|
+
function _inherits$d(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$d(subClass, superClass); }
|
|
3263
|
+
|
|
3264
|
+
function _setPrototypeOf$d(o, p) { _setPrototypeOf$d = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$d(o, p); }
|
|
3265
|
+
|
|
3266
|
+
function _createSuper$d(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$d(); return function _createSuperInternal() { var Super = _getPrototypeOf$d(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$d(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$d(this, result); }; }
|
|
3267
|
+
|
|
3268
|
+
function _possibleConstructorReturn$d(self, call) { if (call && (_typeof$d(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$d(self); }
|
|
3269
|
+
|
|
3270
|
+
function _assertThisInitialized$d(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3271
|
+
|
|
3272
|
+
function _isNativeReflectConstruct$d() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3273
|
+
|
|
3274
|
+
function _getPrototypeOf$d(o) { _getPrototypeOf$d = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$d(o); }
|
|
3275
|
+
|
|
3276
|
+
function _defineProperty$d(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3277
|
+
var AMPMParser = /*#__PURE__*/function (_Parser) {
|
|
3278
|
+
_inherits$d(AMPMParser, _Parser);
|
|
3279
|
+
|
|
3280
|
+
var _super = _createSuper$d(AMPMParser);
|
|
3281
|
+
|
|
3282
|
+
function AMPMParser() {
|
|
3283
|
+
var _this;
|
|
3284
|
+
|
|
3285
|
+
_classCallCheck$d(this, AMPMParser);
|
|
3286
|
+
|
|
3287
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3288
|
+
args[_key] = arguments[_key];
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3292
|
+
|
|
3293
|
+
_defineProperty$d(_assertThisInitialized$d(_this), "priority", 80);
|
|
3294
|
+
|
|
3295
|
+
_defineProperty$d(_assertThisInitialized$d(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']);
|
|
3296
|
+
|
|
3297
|
+
return _this;
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
_createClass$d(AMPMParser, [{
|
|
3301
|
+
key: "parse",
|
|
3302
|
+
value: function parse(dateString, token, match) {
|
|
3303
|
+
switch (token) {
|
|
3304
|
+
case 'a':
|
|
3305
|
+
case 'aa':
|
|
3306
|
+
case 'aaa':
|
|
3307
|
+
return match.dayPeriod(dateString, {
|
|
3308
|
+
width: 'abbreviated',
|
|
3309
|
+
context: 'formatting'
|
|
3310
|
+
}) || match.dayPeriod(dateString, {
|
|
3311
|
+
width: 'narrow',
|
|
3312
|
+
context: 'formatting'
|
|
3313
|
+
});
|
|
3314
|
+
|
|
3315
|
+
case 'aaaaa':
|
|
3316
|
+
return match.dayPeriod(dateString, {
|
|
3317
|
+
width: 'narrow',
|
|
3318
|
+
context: 'formatting'
|
|
3319
|
+
});
|
|
3320
|
+
|
|
3321
|
+
case 'aaaa':
|
|
3322
|
+
default:
|
|
3323
|
+
return match.dayPeriod(dateString, {
|
|
3324
|
+
width: 'wide',
|
|
3325
|
+
context: 'formatting'
|
|
3326
|
+
}) || match.dayPeriod(dateString, {
|
|
3327
|
+
width: 'abbreviated',
|
|
3328
|
+
context: 'formatting'
|
|
3329
|
+
}) || match.dayPeriod(dateString, {
|
|
3330
|
+
width: 'narrow',
|
|
3331
|
+
context: 'formatting'
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
}, {
|
|
3336
|
+
key: "set",
|
|
3337
|
+
value: function set(date, _flags, value) {
|
|
3338
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
3339
|
+
return date;
|
|
3340
|
+
}
|
|
3341
|
+
}]);
|
|
3342
|
+
|
|
3343
|
+
return AMPMParser;
|
|
3344
|
+
}(Parser);
|
|
3345
|
+
|
|
3346
|
+
function _typeof$c(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$c = function _typeof(obj) { return typeof obj; }; } else { _typeof$c = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$c(obj); }
|
|
3347
|
+
|
|
3348
|
+
function _classCallCheck$c(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3349
|
+
|
|
3350
|
+
function _defineProperties$c(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3351
|
+
|
|
3352
|
+
function _createClass$c(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$c(Constructor.prototype, protoProps); if (staticProps) _defineProperties$c(Constructor, staticProps); return Constructor; }
|
|
3353
|
+
|
|
3354
|
+
function _inherits$c(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$c(subClass, superClass); }
|
|
3355
|
+
|
|
3356
|
+
function _setPrototypeOf$c(o, p) { _setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$c(o, p); }
|
|
3357
|
+
|
|
3358
|
+
function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf$c(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$c(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$c(this, result); }; }
|
|
3359
|
+
|
|
3360
|
+
function _possibleConstructorReturn$c(self, call) { if (call && (_typeof$c(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$c(self); }
|
|
3361
|
+
|
|
3362
|
+
function _assertThisInitialized$c(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3363
|
+
|
|
3364
|
+
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3365
|
+
|
|
3366
|
+
function _getPrototypeOf$c(o) { _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$c(o); }
|
|
3367
|
+
|
|
3368
|
+
function _defineProperty$c(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3369
|
+
var AMPMMidnightParser = /*#__PURE__*/function (_Parser) {
|
|
3370
|
+
_inherits$c(AMPMMidnightParser, _Parser);
|
|
3371
|
+
|
|
3372
|
+
var _super = _createSuper$c(AMPMMidnightParser);
|
|
3373
|
+
|
|
3374
|
+
function AMPMMidnightParser() {
|
|
3375
|
+
var _this;
|
|
3376
|
+
|
|
3377
|
+
_classCallCheck$c(this, AMPMMidnightParser);
|
|
3378
|
+
|
|
3379
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3380
|
+
args[_key] = arguments[_key];
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3384
|
+
|
|
3385
|
+
_defineProperty$c(_assertThisInitialized$c(_this), "priority", 80);
|
|
3386
|
+
|
|
3387
|
+
_defineProperty$c(_assertThisInitialized$c(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
|
|
3388
|
+
|
|
3389
|
+
return _this;
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
_createClass$c(AMPMMidnightParser, [{
|
|
3393
|
+
key: "parse",
|
|
3394
|
+
value: function parse(dateString, token, match) {
|
|
3395
|
+
switch (token) {
|
|
3396
|
+
case 'b':
|
|
3397
|
+
case 'bb':
|
|
3398
|
+
case 'bbb':
|
|
3399
|
+
return match.dayPeriod(dateString, {
|
|
3400
|
+
width: 'abbreviated',
|
|
3401
|
+
context: 'formatting'
|
|
3402
|
+
}) || match.dayPeriod(dateString, {
|
|
3403
|
+
width: 'narrow',
|
|
3404
|
+
context: 'formatting'
|
|
3405
|
+
});
|
|
3406
|
+
|
|
3407
|
+
case 'bbbbb':
|
|
3408
|
+
return match.dayPeriod(dateString, {
|
|
3409
|
+
width: 'narrow',
|
|
3410
|
+
context: 'formatting'
|
|
3411
|
+
});
|
|
3412
|
+
|
|
3413
|
+
case 'bbbb':
|
|
3414
|
+
default:
|
|
3415
|
+
return match.dayPeriod(dateString, {
|
|
3416
|
+
width: 'wide',
|
|
3417
|
+
context: 'formatting'
|
|
3418
|
+
}) || match.dayPeriod(dateString, {
|
|
3419
|
+
width: 'abbreviated',
|
|
3420
|
+
context: 'formatting'
|
|
3421
|
+
}) || match.dayPeriod(dateString, {
|
|
3422
|
+
width: 'narrow',
|
|
3423
|
+
context: 'formatting'
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
}, {
|
|
3428
|
+
key: "set",
|
|
3429
|
+
value: function set(date, _flags, value) {
|
|
3430
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
3431
|
+
return date;
|
|
3432
|
+
}
|
|
3433
|
+
}]);
|
|
3434
|
+
|
|
3435
|
+
return AMPMMidnightParser;
|
|
3436
|
+
}(Parser);
|
|
3437
|
+
|
|
3438
|
+
function _typeof$b(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$b = function _typeof(obj) { return typeof obj; }; } else { _typeof$b = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$b(obj); }
|
|
3439
|
+
|
|
3440
|
+
function _classCallCheck$b(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3441
|
+
|
|
3442
|
+
function _defineProperties$b(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3443
|
+
|
|
3444
|
+
function _createClass$b(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$b(Constructor.prototype, protoProps); if (staticProps) _defineProperties$b(Constructor, staticProps); return Constructor; }
|
|
3445
|
+
|
|
3446
|
+
function _inherits$b(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$b(subClass, superClass); }
|
|
3447
|
+
|
|
3448
|
+
function _setPrototypeOf$b(o, p) { _setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$b(o, p); }
|
|
3449
|
+
|
|
3450
|
+
function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf$b(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$b(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$b(this, result); }; }
|
|
3451
|
+
|
|
3452
|
+
function _possibleConstructorReturn$b(self, call) { if (call && (_typeof$b(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$b(self); }
|
|
3453
|
+
|
|
3454
|
+
function _assertThisInitialized$b(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3455
|
+
|
|
3456
|
+
function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3457
|
+
|
|
3458
|
+
function _getPrototypeOf$b(o) { _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$b(o); }
|
|
3459
|
+
|
|
3460
|
+
function _defineProperty$b(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3461
|
+
|
|
3462
|
+
var DayPeriodParser = /*#__PURE__*/function (_Parser) {
|
|
3463
|
+
_inherits$b(DayPeriodParser, _Parser);
|
|
3464
|
+
|
|
3465
|
+
var _super = _createSuper$b(DayPeriodParser);
|
|
3466
|
+
|
|
3467
|
+
function DayPeriodParser() {
|
|
3468
|
+
var _this;
|
|
3469
|
+
|
|
3470
|
+
_classCallCheck$b(this, DayPeriodParser);
|
|
3471
|
+
|
|
3472
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3473
|
+
args[_key] = arguments[_key];
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3476
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3477
|
+
|
|
3478
|
+
_defineProperty$b(_assertThisInitialized$b(_this), "priority", 80);
|
|
3479
|
+
|
|
3480
|
+
_defineProperty$b(_assertThisInitialized$b(_this), "incompatibleTokens", ['a', 'b', 't', 'T']);
|
|
3481
|
+
|
|
3482
|
+
return _this;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
_createClass$b(DayPeriodParser, [{
|
|
3486
|
+
key: "parse",
|
|
3487
|
+
value: function parse(dateString, token, match) {
|
|
3488
|
+
switch (token) {
|
|
3489
|
+
case 'B':
|
|
3490
|
+
case 'BB':
|
|
3491
|
+
case 'BBB':
|
|
3492
|
+
return match.dayPeriod(dateString, {
|
|
3493
|
+
width: 'abbreviated',
|
|
3494
|
+
context: 'formatting'
|
|
3495
|
+
}) || match.dayPeriod(dateString, {
|
|
3496
|
+
width: 'narrow',
|
|
3497
|
+
context: 'formatting'
|
|
3498
|
+
});
|
|
3499
|
+
|
|
3500
|
+
case 'BBBBB':
|
|
3501
|
+
return match.dayPeriod(dateString, {
|
|
3502
|
+
width: 'narrow',
|
|
3503
|
+
context: 'formatting'
|
|
3504
|
+
});
|
|
3505
|
+
|
|
3506
|
+
case 'BBBB':
|
|
3507
|
+
default:
|
|
3508
|
+
return match.dayPeriod(dateString, {
|
|
3509
|
+
width: 'wide',
|
|
3510
|
+
context: 'formatting'
|
|
3511
|
+
}) || match.dayPeriod(dateString, {
|
|
3512
|
+
width: 'abbreviated',
|
|
3513
|
+
context: 'formatting'
|
|
3514
|
+
}) || match.dayPeriod(dateString, {
|
|
3515
|
+
width: 'narrow',
|
|
3516
|
+
context: 'formatting'
|
|
3517
|
+
});
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
}, {
|
|
3521
|
+
key: "set",
|
|
3522
|
+
value: function set(date, _flags, value) {
|
|
3523
|
+
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
3524
|
+
return date;
|
|
3525
|
+
}
|
|
3526
|
+
}]);
|
|
3527
|
+
|
|
3528
|
+
return DayPeriodParser;
|
|
3529
|
+
}(Parser);
|
|
3530
|
+
|
|
3531
|
+
function _typeof$a(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$a = function _typeof(obj) { return typeof obj; }; } else { _typeof$a = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$a(obj); }
|
|
3532
|
+
|
|
3533
|
+
function _classCallCheck$a(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3534
|
+
|
|
3535
|
+
function _defineProperties$a(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3536
|
+
|
|
3537
|
+
function _createClass$a(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$a(Constructor.prototype, protoProps); if (staticProps) _defineProperties$a(Constructor, staticProps); return Constructor; }
|
|
3538
|
+
|
|
3539
|
+
function _inherits$a(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$a(subClass, superClass); }
|
|
3540
|
+
|
|
3541
|
+
function _setPrototypeOf$a(o, p) { _setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$a(o, p); }
|
|
3542
|
+
|
|
3543
|
+
function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf$a(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$a(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$a(this, result); }; }
|
|
3544
|
+
|
|
3545
|
+
function _possibleConstructorReturn$a(self, call) { if (call && (_typeof$a(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$a(self); }
|
|
3546
|
+
|
|
3547
|
+
function _assertThisInitialized$a(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3548
|
+
|
|
3549
|
+
function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3550
|
+
|
|
3551
|
+
function _getPrototypeOf$a(o) { _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$a(o); }
|
|
3552
|
+
|
|
3553
|
+
function _defineProperty$a(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3554
|
+
var Hour1to12Parser = /*#__PURE__*/function (_Parser) {
|
|
3555
|
+
_inherits$a(Hour1to12Parser, _Parser);
|
|
3556
|
+
|
|
3557
|
+
var _super = _createSuper$a(Hour1to12Parser);
|
|
3558
|
+
|
|
3559
|
+
function Hour1to12Parser() {
|
|
3560
|
+
var _this;
|
|
3561
|
+
|
|
3562
|
+
_classCallCheck$a(this, Hour1to12Parser);
|
|
3563
|
+
|
|
3564
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3565
|
+
args[_key] = arguments[_key];
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3569
|
+
|
|
3570
|
+
_defineProperty$a(_assertThisInitialized$a(_this), "priority", 70);
|
|
3571
|
+
|
|
3572
|
+
_defineProperty$a(_assertThisInitialized$a(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']);
|
|
3573
|
+
|
|
3574
|
+
return _this;
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
_createClass$a(Hour1to12Parser, [{
|
|
3578
|
+
key: "parse",
|
|
3579
|
+
value: function parse(dateString, token, match) {
|
|
3580
|
+
switch (token) {
|
|
3581
|
+
case 'h':
|
|
3582
|
+
return parseNumericPattern(numericPatterns.hour12h, dateString);
|
|
3583
|
+
|
|
3584
|
+
case 'ho':
|
|
3585
|
+
return match.ordinalNumber(dateString, {
|
|
3586
|
+
unit: 'hour'
|
|
3587
|
+
});
|
|
3588
|
+
|
|
3589
|
+
default:
|
|
3590
|
+
return parseNDigits(token.length, dateString);
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
}, {
|
|
3594
|
+
key: "validate",
|
|
3595
|
+
value: function validate(_date, value) {
|
|
3596
|
+
return value >= 1 && value <= 12;
|
|
3597
|
+
}
|
|
3598
|
+
}, {
|
|
3599
|
+
key: "set",
|
|
3600
|
+
value: function set(date, _flags, value) {
|
|
3601
|
+
var isPM = date.getUTCHours() >= 12;
|
|
3602
|
+
|
|
3603
|
+
if (isPM && value < 12) {
|
|
3604
|
+
date.setUTCHours(value + 12, 0, 0, 0);
|
|
3605
|
+
} else if (!isPM && value === 12) {
|
|
3606
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
3607
|
+
} else {
|
|
3608
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
return date;
|
|
3612
|
+
}
|
|
3613
|
+
}]);
|
|
3614
|
+
|
|
3615
|
+
return Hour1to12Parser;
|
|
3616
|
+
}(Parser);
|
|
3617
|
+
|
|
3618
|
+
function _typeof$9(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$9 = function _typeof(obj) { return typeof obj; }; } else { _typeof$9 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$9(obj); }
|
|
3619
|
+
|
|
3620
|
+
function _classCallCheck$9(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3621
|
+
|
|
3622
|
+
function _defineProperties$9(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3623
|
+
|
|
3624
|
+
function _createClass$9(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$9(Constructor.prototype, protoProps); if (staticProps) _defineProperties$9(Constructor, staticProps); return Constructor; }
|
|
3625
|
+
|
|
3626
|
+
function _inherits$9(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$9(subClass, superClass); }
|
|
3627
|
+
|
|
3628
|
+
function _setPrototypeOf$9(o, p) { _setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$9(o, p); }
|
|
3629
|
+
|
|
3630
|
+
function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf$9(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$9(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$9(this, result); }; }
|
|
3631
|
+
|
|
3632
|
+
function _possibleConstructorReturn$9(self, call) { if (call && (_typeof$9(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$9(self); }
|
|
3633
|
+
|
|
3634
|
+
function _assertThisInitialized$9(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3635
|
+
|
|
3636
|
+
function _isNativeReflectConstruct$9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3637
|
+
|
|
3638
|
+
function _getPrototypeOf$9(o) { _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$9(o); }
|
|
3639
|
+
|
|
3640
|
+
function _defineProperty$9(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3641
|
+
var Hour0to23Parser = /*#__PURE__*/function (_Parser) {
|
|
3642
|
+
_inherits$9(Hour0to23Parser, _Parser);
|
|
3643
|
+
|
|
3644
|
+
var _super = _createSuper$9(Hour0to23Parser);
|
|
3645
|
+
|
|
3646
|
+
function Hour0to23Parser() {
|
|
3647
|
+
var _this;
|
|
3648
|
+
|
|
3649
|
+
_classCallCheck$9(this, Hour0to23Parser);
|
|
3650
|
+
|
|
3651
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3652
|
+
args[_key] = arguments[_key];
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3656
|
+
|
|
3657
|
+
_defineProperty$9(_assertThisInitialized$9(_this), "priority", 70);
|
|
3658
|
+
|
|
3659
|
+
_defineProperty$9(_assertThisInitialized$9(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']);
|
|
3660
|
+
|
|
3661
|
+
return _this;
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
_createClass$9(Hour0to23Parser, [{
|
|
3665
|
+
key: "parse",
|
|
3666
|
+
value: function parse(dateString, token, match) {
|
|
3667
|
+
switch (token) {
|
|
3668
|
+
case 'H':
|
|
3669
|
+
return parseNumericPattern(numericPatterns.hour23h, dateString);
|
|
3670
|
+
|
|
3671
|
+
case 'Ho':
|
|
3672
|
+
return match.ordinalNumber(dateString, {
|
|
3673
|
+
unit: 'hour'
|
|
3674
|
+
});
|
|
3675
|
+
|
|
3676
|
+
default:
|
|
3677
|
+
return parseNDigits(token.length, dateString);
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}, {
|
|
3681
|
+
key: "validate",
|
|
3682
|
+
value: function validate(_date, value) {
|
|
3683
|
+
return value >= 0 && value <= 23;
|
|
3684
|
+
}
|
|
3685
|
+
}, {
|
|
3686
|
+
key: "set",
|
|
3687
|
+
value: function set(date, _flags, value) {
|
|
3688
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
3689
|
+
return date;
|
|
3690
|
+
}
|
|
3691
|
+
}]);
|
|
3692
|
+
|
|
3693
|
+
return Hour0to23Parser;
|
|
3694
|
+
}(Parser);
|
|
3695
|
+
|
|
3696
|
+
function _typeof$8(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$8 = function _typeof(obj) { return typeof obj; }; } else { _typeof$8 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$8(obj); }
|
|
3697
|
+
|
|
3698
|
+
function _classCallCheck$8(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3699
|
+
|
|
3700
|
+
function _defineProperties$8(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3701
|
+
|
|
3702
|
+
function _createClass$8(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$8(Constructor.prototype, protoProps); if (staticProps) _defineProperties$8(Constructor, staticProps); return Constructor; }
|
|
3703
|
+
|
|
3704
|
+
function _inherits$8(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$8(subClass, superClass); }
|
|
3705
|
+
|
|
3706
|
+
function _setPrototypeOf$8(o, p) { _setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$8(o, p); }
|
|
3707
|
+
|
|
3708
|
+
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf$8(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$8(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$8(this, result); }; }
|
|
3709
|
+
|
|
3710
|
+
function _possibleConstructorReturn$8(self, call) { if (call && (_typeof$8(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$8(self); }
|
|
3711
|
+
|
|
3712
|
+
function _assertThisInitialized$8(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3713
|
+
|
|
3714
|
+
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3715
|
+
|
|
3716
|
+
function _getPrototypeOf$8(o) { _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$8(o); }
|
|
3717
|
+
|
|
3718
|
+
function _defineProperty$8(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3719
|
+
var Hour0To11Parser = /*#__PURE__*/function (_Parser) {
|
|
3720
|
+
_inherits$8(Hour0To11Parser, _Parser);
|
|
3721
|
+
|
|
3722
|
+
var _super = _createSuper$8(Hour0To11Parser);
|
|
3723
|
+
|
|
3724
|
+
function Hour0To11Parser() {
|
|
3725
|
+
var _this;
|
|
3726
|
+
|
|
3727
|
+
_classCallCheck$8(this, Hour0To11Parser);
|
|
3728
|
+
|
|
3729
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3730
|
+
args[_key] = arguments[_key];
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3734
|
+
|
|
3735
|
+
_defineProperty$8(_assertThisInitialized$8(_this), "priority", 70);
|
|
3736
|
+
|
|
3737
|
+
_defineProperty$8(_assertThisInitialized$8(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']);
|
|
3738
|
+
|
|
3739
|
+
return _this;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
_createClass$8(Hour0To11Parser, [{
|
|
3743
|
+
key: "parse",
|
|
3744
|
+
value: function parse(dateString, token, match) {
|
|
3745
|
+
switch (token) {
|
|
3746
|
+
case 'K':
|
|
3747
|
+
return parseNumericPattern(numericPatterns.hour11h, dateString);
|
|
3748
|
+
|
|
3749
|
+
case 'Ko':
|
|
3750
|
+
return match.ordinalNumber(dateString, {
|
|
3751
|
+
unit: 'hour'
|
|
3752
|
+
});
|
|
3753
|
+
|
|
3754
|
+
default:
|
|
3755
|
+
return parseNDigits(token.length, dateString);
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
}, {
|
|
3759
|
+
key: "validate",
|
|
3760
|
+
value: function validate(_date, value) {
|
|
3761
|
+
return value >= 0 && value <= 11;
|
|
3762
|
+
}
|
|
3763
|
+
}, {
|
|
3764
|
+
key: "set",
|
|
3765
|
+
value: function set(date, _flags, value) {
|
|
3766
|
+
var isPM = date.getUTCHours() >= 12;
|
|
3767
|
+
|
|
3768
|
+
if (isPM && value < 12) {
|
|
3769
|
+
date.setUTCHours(value + 12, 0, 0, 0);
|
|
3770
|
+
} else {
|
|
3771
|
+
date.setUTCHours(value, 0, 0, 0);
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
return date;
|
|
3775
|
+
}
|
|
3776
|
+
}]);
|
|
3777
|
+
|
|
3778
|
+
return Hour0To11Parser;
|
|
3779
|
+
}(Parser);
|
|
3780
|
+
|
|
3781
|
+
function _typeof$7(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$7 = function _typeof(obj) { return typeof obj; }; } else { _typeof$7 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$7(obj); }
|
|
3782
|
+
|
|
3783
|
+
function _classCallCheck$7(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3784
|
+
|
|
3785
|
+
function _defineProperties$7(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3786
|
+
|
|
3787
|
+
function _createClass$7(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$7(Constructor.prototype, protoProps); if (staticProps) _defineProperties$7(Constructor, staticProps); return Constructor; }
|
|
3788
|
+
|
|
3789
|
+
function _inherits$7(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$7(subClass, superClass); }
|
|
3790
|
+
|
|
3791
|
+
function _setPrototypeOf$7(o, p) { _setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$7(o, p); }
|
|
3792
|
+
|
|
3793
|
+
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf$7(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$7(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$7(this, result); }; }
|
|
3794
|
+
|
|
3795
|
+
function _possibleConstructorReturn$7(self, call) { if (call && (_typeof$7(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$7(self); }
|
|
3796
|
+
|
|
3797
|
+
function _assertThisInitialized$7(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3798
|
+
|
|
3799
|
+
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3800
|
+
|
|
3801
|
+
function _getPrototypeOf$7(o) { _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$7(o); }
|
|
3802
|
+
|
|
3803
|
+
function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3804
|
+
var Hour1To24Parser = /*#__PURE__*/function (_Parser) {
|
|
3805
|
+
_inherits$7(Hour1To24Parser, _Parser);
|
|
3806
|
+
|
|
3807
|
+
var _super = _createSuper$7(Hour1To24Parser);
|
|
3808
|
+
|
|
3809
|
+
function Hour1To24Parser() {
|
|
3810
|
+
var _this;
|
|
3811
|
+
|
|
3812
|
+
_classCallCheck$7(this, Hour1To24Parser);
|
|
3813
|
+
|
|
3814
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3815
|
+
args[_key] = arguments[_key];
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3818
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3819
|
+
|
|
3820
|
+
_defineProperty$7(_assertThisInitialized$7(_this), "priority", 70);
|
|
3821
|
+
|
|
3822
|
+
_defineProperty$7(_assertThisInitialized$7(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']);
|
|
3823
|
+
|
|
3824
|
+
return _this;
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
_createClass$7(Hour1To24Parser, [{
|
|
3828
|
+
key: "parse",
|
|
3829
|
+
value: function parse(dateString, token, match) {
|
|
3830
|
+
switch (token) {
|
|
3831
|
+
case 'k':
|
|
3832
|
+
return parseNumericPattern(numericPatterns.hour24h, dateString);
|
|
3833
|
+
|
|
3834
|
+
case 'ko':
|
|
3835
|
+
return match.ordinalNumber(dateString, {
|
|
3836
|
+
unit: 'hour'
|
|
3837
|
+
});
|
|
3838
|
+
|
|
3839
|
+
default:
|
|
3840
|
+
return parseNDigits(token.length, dateString);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
}, {
|
|
3844
|
+
key: "validate",
|
|
3845
|
+
value: function validate(_date, value) {
|
|
3846
|
+
return value >= 1 && value <= 24;
|
|
3847
|
+
}
|
|
3848
|
+
}, {
|
|
3849
|
+
key: "set",
|
|
3850
|
+
value: function set(date, _flags, value) {
|
|
3851
|
+
var hours = value <= 24 ? value % 24 : value;
|
|
3852
|
+
date.setUTCHours(hours, 0, 0, 0);
|
|
3853
|
+
return date;
|
|
3854
|
+
}
|
|
3855
|
+
}]);
|
|
3856
|
+
|
|
3857
|
+
return Hour1To24Parser;
|
|
3858
|
+
}(Parser);
|
|
3859
|
+
|
|
3860
|
+
function _typeof$6(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$6(obj); }
|
|
3861
|
+
|
|
3862
|
+
function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3863
|
+
|
|
3864
|
+
function _defineProperties$6(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3865
|
+
|
|
3866
|
+
function _createClass$6(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); if (staticProps) _defineProperties$6(Constructor, staticProps); return Constructor; }
|
|
3867
|
+
|
|
3868
|
+
function _inherits$6(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$6(subClass, superClass); }
|
|
3869
|
+
|
|
3870
|
+
function _setPrototypeOf$6(o, p) { _setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$6(o, p); }
|
|
3871
|
+
|
|
3872
|
+
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf$6(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$6(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$6(this, result); }; }
|
|
3873
|
+
|
|
3874
|
+
function _possibleConstructorReturn$6(self, call) { if (call && (_typeof$6(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$6(self); }
|
|
3875
|
+
|
|
3876
|
+
function _assertThisInitialized$6(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3877
|
+
|
|
3878
|
+
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3879
|
+
|
|
3880
|
+
function _getPrototypeOf$6(o) { _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$6(o); }
|
|
3881
|
+
|
|
3882
|
+
function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3883
|
+
var MinuteParser = /*#__PURE__*/function (_Parser) {
|
|
3884
|
+
_inherits$6(MinuteParser, _Parser);
|
|
3885
|
+
|
|
3886
|
+
var _super = _createSuper$6(MinuteParser);
|
|
3887
|
+
|
|
3888
|
+
function MinuteParser() {
|
|
3889
|
+
var _this;
|
|
3890
|
+
|
|
3891
|
+
_classCallCheck$6(this, MinuteParser);
|
|
3892
|
+
|
|
3893
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3894
|
+
args[_key] = arguments[_key];
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3898
|
+
|
|
3899
|
+
_defineProperty$6(_assertThisInitialized$6(_this), "priority", 60);
|
|
3900
|
+
|
|
3901
|
+
_defineProperty$6(_assertThisInitialized$6(_this), "incompatibleTokens", ['t', 'T']);
|
|
3902
|
+
|
|
3903
|
+
return _this;
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
_createClass$6(MinuteParser, [{
|
|
3907
|
+
key: "parse",
|
|
3908
|
+
value: function parse(dateString, token, match) {
|
|
3909
|
+
switch (token) {
|
|
3910
|
+
case 'm':
|
|
3911
|
+
return parseNumericPattern(numericPatterns.minute, dateString);
|
|
3912
|
+
|
|
3913
|
+
case 'mo':
|
|
3914
|
+
return match.ordinalNumber(dateString, {
|
|
3915
|
+
unit: 'minute'
|
|
3916
|
+
});
|
|
3917
|
+
|
|
3918
|
+
default:
|
|
3919
|
+
return parseNDigits(token.length, dateString);
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
}, {
|
|
3923
|
+
key: "validate",
|
|
3924
|
+
value: function validate(_date, value) {
|
|
3925
|
+
return value >= 0 && value <= 59;
|
|
3926
|
+
}
|
|
3927
|
+
}, {
|
|
3928
|
+
key: "set",
|
|
3929
|
+
value: function set(date, _flags, value) {
|
|
3930
|
+
date.setUTCMinutes(value, 0, 0);
|
|
3931
|
+
return date;
|
|
3932
|
+
}
|
|
3933
|
+
}]);
|
|
3934
|
+
|
|
3935
|
+
return MinuteParser;
|
|
3936
|
+
}(Parser);
|
|
3937
|
+
|
|
3938
|
+
function _typeof$5(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$5(obj); }
|
|
3939
|
+
|
|
3940
|
+
function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3941
|
+
|
|
3942
|
+
function _defineProperties$5(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3943
|
+
|
|
3944
|
+
function _createClass$5(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); if (staticProps) _defineProperties$5(Constructor, staticProps); return Constructor; }
|
|
3945
|
+
|
|
3946
|
+
function _inherits$5(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$5(subClass, superClass); }
|
|
3947
|
+
|
|
3948
|
+
function _setPrototypeOf$5(o, p) { _setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$5(o, p); }
|
|
3949
|
+
|
|
3950
|
+
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf$5(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$5(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$5(this, result); }; }
|
|
3951
|
+
|
|
3952
|
+
function _possibleConstructorReturn$5(self, call) { if (call && (_typeof$5(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$5(self); }
|
|
3953
|
+
|
|
3954
|
+
function _assertThisInitialized$5(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3955
|
+
|
|
3956
|
+
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3957
|
+
|
|
3958
|
+
function _getPrototypeOf$5(o) { _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$5(o); }
|
|
3959
|
+
|
|
3960
|
+
function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3961
|
+
var SecondParser = /*#__PURE__*/function (_Parser) {
|
|
3962
|
+
_inherits$5(SecondParser, _Parser);
|
|
3963
|
+
|
|
3964
|
+
var _super = _createSuper$5(SecondParser);
|
|
3965
|
+
|
|
3966
|
+
function SecondParser() {
|
|
3967
|
+
var _this;
|
|
3968
|
+
|
|
3969
|
+
_classCallCheck$5(this, SecondParser);
|
|
3970
|
+
|
|
3971
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3972
|
+
args[_key] = arguments[_key];
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3976
|
+
|
|
3977
|
+
_defineProperty$5(_assertThisInitialized$5(_this), "priority", 50);
|
|
3978
|
+
|
|
3979
|
+
_defineProperty$5(_assertThisInitialized$5(_this), "incompatibleTokens", ['t', 'T']);
|
|
3980
|
+
|
|
3981
|
+
return _this;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
_createClass$5(SecondParser, [{
|
|
3985
|
+
key: "parse",
|
|
3986
|
+
value: function parse(dateString, token, match) {
|
|
3987
|
+
switch (token) {
|
|
3988
|
+
case 's':
|
|
3989
|
+
return parseNumericPattern(numericPatterns.second, dateString);
|
|
3990
|
+
|
|
3991
|
+
case 'so':
|
|
3992
|
+
return match.ordinalNumber(dateString, {
|
|
3993
|
+
unit: 'second'
|
|
3994
|
+
});
|
|
3995
|
+
|
|
3996
|
+
default:
|
|
3997
|
+
return parseNDigits(token.length, dateString);
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
}, {
|
|
4001
|
+
key: "validate",
|
|
4002
|
+
value: function validate(_date, value) {
|
|
4003
|
+
return value >= 0 && value <= 59;
|
|
4004
|
+
}
|
|
4005
|
+
}, {
|
|
4006
|
+
key: "set",
|
|
4007
|
+
value: function set(date, _flags, value) {
|
|
4008
|
+
date.setUTCSeconds(value, 0);
|
|
4009
|
+
return date;
|
|
4010
|
+
}
|
|
4011
|
+
}]);
|
|
4012
|
+
|
|
4013
|
+
return SecondParser;
|
|
4014
|
+
}(Parser);
|
|
4015
|
+
|
|
4016
|
+
function _typeof$4(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$4(obj); }
|
|
4017
|
+
|
|
4018
|
+
function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4019
|
+
|
|
4020
|
+
function _defineProperties$4(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4021
|
+
|
|
4022
|
+
function _createClass$4(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); if (staticProps) _defineProperties$4(Constructor, staticProps); return Constructor; }
|
|
4023
|
+
|
|
4024
|
+
function _inherits$4(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$4(subClass, superClass); }
|
|
4025
|
+
|
|
4026
|
+
function _setPrototypeOf$4(o, p) { _setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$4(o, p); }
|
|
4027
|
+
|
|
4028
|
+
function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf$4(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$4(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$4(this, result); }; }
|
|
4029
|
+
|
|
4030
|
+
function _possibleConstructorReturn$4(self, call) { if (call && (_typeof$4(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$4(self); }
|
|
4031
|
+
|
|
4032
|
+
function _assertThisInitialized$4(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4033
|
+
|
|
4034
|
+
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4035
|
+
|
|
4036
|
+
function _getPrototypeOf$4(o) { _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$4(o); }
|
|
4037
|
+
|
|
4038
|
+
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4039
|
+
var FractionOfSecondParser = /*#__PURE__*/function (_Parser) {
|
|
4040
|
+
_inherits$4(FractionOfSecondParser, _Parser);
|
|
4041
|
+
|
|
4042
|
+
var _super = _createSuper$4(FractionOfSecondParser);
|
|
4043
|
+
|
|
4044
|
+
function FractionOfSecondParser() {
|
|
4045
|
+
var _this;
|
|
4046
|
+
|
|
4047
|
+
_classCallCheck$4(this, FractionOfSecondParser);
|
|
4048
|
+
|
|
4049
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4050
|
+
args[_key] = arguments[_key];
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4054
|
+
|
|
4055
|
+
_defineProperty$4(_assertThisInitialized$4(_this), "priority", 30);
|
|
4056
|
+
|
|
4057
|
+
_defineProperty$4(_assertThisInitialized$4(_this), "incompatibleTokens", ['t', 'T']);
|
|
4058
|
+
|
|
4059
|
+
return _this;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
_createClass$4(FractionOfSecondParser, [{
|
|
4063
|
+
key: "parse",
|
|
4064
|
+
value: function parse(dateString, token) {
|
|
4065
|
+
var valueCallback = function valueCallback(value) {
|
|
4066
|
+
return Math.floor(value * Math.pow(10, -token.length + 3));
|
|
4067
|
+
};
|
|
4068
|
+
|
|
4069
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
4070
|
+
}
|
|
4071
|
+
}, {
|
|
4072
|
+
key: "set",
|
|
4073
|
+
value: function set(date, _flags, value) {
|
|
4074
|
+
date.setUTCMilliseconds(value);
|
|
4075
|
+
return date;
|
|
4076
|
+
}
|
|
4077
|
+
}]);
|
|
4078
|
+
|
|
4079
|
+
return FractionOfSecondParser;
|
|
4080
|
+
}(Parser);
|
|
4081
|
+
|
|
4082
|
+
function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
|
|
4083
|
+
|
|
4084
|
+
function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4085
|
+
|
|
4086
|
+
function _defineProperties$3(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4087
|
+
|
|
4088
|
+
function _createClass$3(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); if (staticProps) _defineProperties$3(Constructor, staticProps); return Constructor; }
|
|
4089
|
+
|
|
4090
|
+
function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$3(subClass, superClass); }
|
|
4091
|
+
|
|
4092
|
+
function _setPrototypeOf$3(o, p) { _setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$3(o, p); }
|
|
4093
|
+
|
|
4094
|
+
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf$3(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$3(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$3(this, result); }; }
|
|
4095
|
+
|
|
4096
|
+
function _possibleConstructorReturn$3(self, call) { if (call && (_typeof$3(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$3(self); }
|
|
4097
|
+
|
|
4098
|
+
function _assertThisInitialized$3(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4099
|
+
|
|
4100
|
+
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4101
|
+
|
|
4102
|
+
function _getPrototypeOf$3(o) { _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$3(o); }
|
|
4103
|
+
|
|
4104
|
+
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4105
|
+
|
|
4106
|
+
var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) {
|
|
4107
|
+
_inherits$3(ISOTimezoneWithZParser, _Parser);
|
|
4108
|
+
|
|
4109
|
+
var _super = _createSuper$3(ISOTimezoneWithZParser);
|
|
4110
|
+
|
|
4111
|
+
function ISOTimezoneWithZParser() {
|
|
4112
|
+
var _this;
|
|
4113
|
+
|
|
4114
|
+
_classCallCheck$3(this, ISOTimezoneWithZParser);
|
|
4115
|
+
|
|
4116
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4117
|
+
args[_key] = arguments[_key];
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4121
|
+
|
|
4122
|
+
_defineProperty$3(_assertThisInitialized$3(_this), "priority", 10);
|
|
4123
|
+
|
|
4124
|
+
_defineProperty$3(_assertThisInitialized$3(_this), "incompatibleTokens", ['t', 'T', 'x']);
|
|
4125
|
+
|
|
4126
|
+
return _this;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
_createClass$3(ISOTimezoneWithZParser, [{
|
|
4130
|
+
key: "parse",
|
|
4131
|
+
value: function parse(dateString, token) {
|
|
4132
|
+
switch (token) {
|
|
4133
|
+
case 'X':
|
|
4134
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
|
|
4135
|
+
|
|
4136
|
+
case 'XX':
|
|
4137
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
4138
|
+
|
|
4139
|
+
case 'XXXX':
|
|
4140
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
|
|
4141
|
+
|
|
4142
|
+
case 'XXXXX':
|
|
4143
|
+
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
|
|
4144
|
+
|
|
4145
|
+
case 'XXX':
|
|
4146
|
+
default:
|
|
4147
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
}, {
|
|
4151
|
+
key: "set",
|
|
4152
|
+
value: function set(date, flags, value) {
|
|
4153
|
+
if (flags.timestampIsSet) {
|
|
4154
|
+
return date;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
return new Date(date.getTime() - value);
|
|
4158
|
+
}
|
|
4159
|
+
}]);
|
|
4160
|
+
|
|
4161
|
+
return ISOTimezoneWithZParser;
|
|
4162
|
+
}(Parser);
|
|
4163
|
+
|
|
4164
|
+
function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
|
|
4165
|
+
|
|
4166
|
+
function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4167
|
+
|
|
4168
|
+
function _defineProperties$2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4169
|
+
|
|
4170
|
+
function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); if (staticProps) _defineProperties$2(Constructor, staticProps); return Constructor; }
|
|
4171
|
+
|
|
4172
|
+
function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$2(subClass, superClass); }
|
|
4173
|
+
|
|
4174
|
+
function _setPrototypeOf$2(o, p) { _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$2(o, p); }
|
|
4175
|
+
|
|
4176
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf$2(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$2(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$2(this, result); }; }
|
|
4177
|
+
|
|
4178
|
+
function _possibleConstructorReturn$2(self, call) { if (call && (_typeof$2(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$2(self); }
|
|
4179
|
+
|
|
4180
|
+
function _assertThisInitialized$2(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4181
|
+
|
|
4182
|
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4183
|
+
|
|
4184
|
+
function _getPrototypeOf$2(o) { _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$2(o); }
|
|
4185
|
+
|
|
4186
|
+
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4187
|
+
|
|
4188
|
+
var ISOTimezoneParser = /*#__PURE__*/function (_Parser) {
|
|
4189
|
+
_inherits$2(ISOTimezoneParser, _Parser);
|
|
4190
|
+
|
|
4191
|
+
var _super = _createSuper$2(ISOTimezoneParser);
|
|
4192
|
+
|
|
4193
|
+
function ISOTimezoneParser() {
|
|
4194
|
+
var _this;
|
|
4195
|
+
|
|
4196
|
+
_classCallCheck$2(this, ISOTimezoneParser);
|
|
4197
|
+
|
|
4198
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4199
|
+
args[_key] = arguments[_key];
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4203
|
+
|
|
4204
|
+
_defineProperty$2(_assertThisInitialized$2(_this), "priority", 10);
|
|
4205
|
+
|
|
4206
|
+
_defineProperty$2(_assertThisInitialized$2(_this), "incompatibleTokens", ['t', 'T', 'X']);
|
|
4207
|
+
|
|
4208
|
+
return _this;
|
|
4209
|
+
}
|
|
4210
|
+
|
|
4211
|
+
_createClass$2(ISOTimezoneParser, [{
|
|
4212
|
+
key: "parse",
|
|
4213
|
+
value: function parse(dateString, token) {
|
|
4214
|
+
switch (token) {
|
|
4215
|
+
case 'x':
|
|
4216
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
|
|
4217
|
+
|
|
4218
|
+
case 'xx':
|
|
4219
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
4220
|
+
|
|
4221
|
+
case 'xxxx':
|
|
4222
|
+
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
|
|
4223
|
+
|
|
4224
|
+
case 'xxxxx':
|
|
4225
|
+
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
|
|
4226
|
+
|
|
4227
|
+
case 'xxx':
|
|
4228
|
+
default:
|
|
4229
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
}, {
|
|
4233
|
+
key: "set",
|
|
4234
|
+
value: function set(date, flags, value) {
|
|
4235
|
+
if (flags.timestampIsSet) {
|
|
4236
|
+
return date;
|
|
4237
|
+
}
|
|
4238
|
+
|
|
4239
|
+
return new Date(date.getTime() - value);
|
|
4240
|
+
}
|
|
4241
|
+
}]);
|
|
4242
|
+
|
|
4243
|
+
return ISOTimezoneParser;
|
|
4244
|
+
}(Parser);
|
|
4245
|
+
|
|
4246
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
4247
|
+
|
|
4248
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4249
|
+
|
|
4250
|
+
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4251
|
+
|
|
4252
|
+
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
|
4253
|
+
|
|
4254
|
+
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
|
|
4255
|
+
|
|
4256
|
+
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
|
|
4257
|
+
|
|
4258
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$1(this, result); }; }
|
|
4259
|
+
|
|
4260
|
+
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
|
|
4261
|
+
|
|
4262
|
+
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4263
|
+
|
|
4264
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4265
|
+
|
|
4266
|
+
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
|
|
4267
|
+
|
|
4268
|
+
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4269
|
+
var TimestampSecondsParser = /*#__PURE__*/function (_Parser) {
|
|
4270
|
+
_inherits$1(TimestampSecondsParser, _Parser);
|
|
4271
|
+
|
|
4272
|
+
var _super = _createSuper$1(TimestampSecondsParser);
|
|
4273
|
+
|
|
4274
|
+
function TimestampSecondsParser() {
|
|
4275
|
+
var _this;
|
|
4276
|
+
|
|
4277
|
+
_classCallCheck$1(this, TimestampSecondsParser);
|
|
4278
|
+
|
|
4279
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4280
|
+
args[_key] = arguments[_key];
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4284
|
+
|
|
4285
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "priority", 40);
|
|
4286
|
+
|
|
4287
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "incompatibleTokens", '*');
|
|
4288
|
+
|
|
4289
|
+
return _this;
|
|
4290
|
+
}
|
|
4291
|
+
|
|
4292
|
+
_createClass$1(TimestampSecondsParser, [{
|
|
4293
|
+
key: "parse",
|
|
4294
|
+
value: function parse(dateString) {
|
|
4295
|
+
return parseAnyDigitsSigned(dateString);
|
|
4296
|
+
}
|
|
4297
|
+
}, {
|
|
4298
|
+
key: "set",
|
|
4299
|
+
value: function set(_date, _flags, value) {
|
|
4300
|
+
return [new Date(value * 1000), {
|
|
4301
|
+
timestampIsSet: true
|
|
4302
|
+
}];
|
|
4303
|
+
}
|
|
4304
|
+
}]);
|
|
4305
|
+
|
|
4306
|
+
return TimestampSecondsParser;
|
|
4307
|
+
}(Parser);
|
|
4308
|
+
|
|
4309
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4310
|
+
|
|
4311
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4312
|
+
|
|
4313
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4314
|
+
|
|
4315
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
4316
|
+
|
|
4317
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
4318
|
+
|
|
4319
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
4320
|
+
|
|
4321
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4322
|
+
|
|
4323
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4324
|
+
|
|
4325
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4326
|
+
|
|
4327
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4328
|
+
|
|
4329
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
4330
|
+
|
|
4331
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4332
|
+
var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) {
|
|
4333
|
+
_inherits(TimestampMillisecondsParser, _Parser);
|
|
4334
|
+
|
|
4335
|
+
var _super = _createSuper(TimestampMillisecondsParser);
|
|
4336
|
+
|
|
4337
|
+
function TimestampMillisecondsParser() {
|
|
4338
|
+
var _this;
|
|
4339
|
+
|
|
4340
|
+
_classCallCheck(this, TimestampMillisecondsParser);
|
|
4341
|
+
|
|
4342
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4343
|
+
args[_key] = arguments[_key];
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4347
|
+
|
|
4348
|
+
_defineProperty(_assertThisInitialized(_this), "priority", 20);
|
|
4349
|
+
|
|
4350
|
+
_defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
|
|
4351
|
+
|
|
4352
|
+
return _this;
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4355
|
+
_createClass(TimestampMillisecondsParser, [{
|
|
4356
|
+
key: "parse",
|
|
4357
|
+
value: function parse(dateString) {
|
|
4358
|
+
return parseAnyDigitsSigned(dateString);
|
|
4359
|
+
}
|
|
4360
|
+
}, {
|
|
4361
|
+
key: "set",
|
|
4362
|
+
value: function set(_date, _flags, value) {
|
|
4363
|
+
return [new Date(value), {
|
|
4364
|
+
timestampIsSet: true
|
|
4365
|
+
}];
|
|
4366
|
+
}
|
|
4367
|
+
}]);
|
|
4368
|
+
|
|
4369
|
+
return TimestampMillisecondsParser;
|
|
4370
|
+
}(Parser);
|
|
4371
|
+
|
|
4372
|
+
/*
|
|
4373
|
+
* | | Unit | | Unit |
|
|
4374
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
4375
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
4376
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
4377
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
4378
|
+
* | d | Day of month | D | Day of year |
|
|
4379
|
+
* | e | Local day of week | E | Day of week |
|
|
4380
|
+
* | f | | F* | Day of week in month |
|
|
4381
|
+
* | g* | Modified Julian day | G | Era |
|
|
4382
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
4383
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
4384
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
4385
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
4386
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
4387
|
+
* | m | Minute | M | Month |
|
|
4388
|
+
* | n | | N | |
|
|
4389
|
+
* | o! | Ordinal number modifier | O* | Timezone (GMT) |
|
|
4390
|
+
* | p | | P | |
|
|
4391
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
4392
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
4393
|
+
* | s | Second | S | Fraction of second |
|
|
4394
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
4395
|
+
* | u | Extended year | U* | Cyclic year |
|
|
4396
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
4397
|
+
* | w | Local week of year | W* | Week of month |
|
|
4398
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
4399
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
4400
|
+
* | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
4401
|
+
*
|
|
4402
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
4403
|
+
*
|
|
4404
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
4405
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
|
|
4406
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
4407
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
4408
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
4409
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
4410
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
4411
|
+
* for universal ISO week-numbering date, whereas
|
|
4412
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
4413
|
+
* for week-numbering date specific to the locale.
|
|
4414
|
+
*/
|
|
4415
|
+
|
|
4416
|
+
({
|
|
4417
|
+
G: new EraParser(),
|
|
4418
|
+
y: new YearParser(),
|
|
4419
|
+
Y: new LocalWeekYearParser(),
|
|
4420
|
+
R: new ISOWeekYearParser(),
|
|
4421
|
+
u: new ExtendedYearParser(),
|
|
4422
|
+
Q: new QuarterParser(),
|
|
4423
|
+
q: new StandAloneQuarterParser(),
|
|
4424
|
+
M: new MonthParser(),
|
|
4425
|
+
L: new StandAloneMonthParser(),
|
|
4426
|
+
w: new LocalWeekParser(),
|
|
4427
|
+
I: new ISOWeekParser(),
|
|
4428
|
+
d: new DateParser(),
|
|
4429
|
+
D: new DayOfYearParser(),
|
|
4430
|
+
E: new DayParser(),
|
|
4431
|
+
e: new LocalDayParser(),
|
|
4432
|
+
c: new StandAloneLocalDayParser(),
|
|
4433
|
+
i: new ISODayParser(),
|
|
4434
|
+
a: new AMPMParser(),
|
|
4435
|
+
b: new AMPMMidnightParser(),
|
|
4436
|
+
B: new DayPeriodParser(),
|
|
4437
|
+
h: new Hour1to12Parser(),
|
|
4438
|
+
H: new Hour0to23Parser(),
|
|
4439
|
+
K: new Hour0To11Parser(),
|
|
4440
|
+
k: new Hour1To24Parser(),
|
|
4441
|
+
m: new MinuteParser(),
|
|
4442
|
+
s: new SecondParser(),
|
|
4443
|
+
S: new FractionOfSecondParser(),
|
|
4444
|
+
X: new ISOTimezoneWithZParser(),
|
|
4445
|
+
x: new ISOTimezoneParser(),
|
|
4446
|
+
t: new TimestampSecondsParser(),
|
|
4447
|
+
T: new TimestampMillisecondsParser()
|
|
4448
|
+
});
|
|
4449
|
+
|
|
4450
|
+
const getItem = key => {
|
|
4451
|
+
try {
|
|
4452
|
+
const itemValue = localStorage.getItem(key);
|
|
4453
|
+
if (typeof itemValue === 'string') {
|
|
4454
|
+
return JSON.parse(itemValue);
|
|
4455
|
+
}
|
|
4456
|
+
return undefined;
|
|
4457
|
+
} catch {
|
|
4458
|
+
return undefined;
|
|
4459
|
+
}
|
|
4460
|
+
};
|
|
4461
|
+
function useLocalStorage(key, defaultValue) {
|
|
4462
|
+
const [value, setValue] = React__default["default"].useState();
|
|
4463
|
+
React__default["default"].useEffect(() => {
|
|
4464
|
+
const initialValue = getItem(key);
|
|
4465
|
+
if (typeof initialValue === 'undefined' || initialValue === null) {
|
|
4466
|
+
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
|
|
4467
|
+
} else {
|
|
4468
|
+
setValue(initialValue);
|
|
4469
|
+
}
|
|
4470
|
+
}, [defaultValue, key]);
|
|
4471
|
+
const setter = React__default["default"].useCallback(updater => {
|
|
4472
|
+
setValue(old => {
|
|
4473
|
+
let newVal = updater;
|
|
4474
|
+
if (typeof updater == 'function') {
|
|
4475
|
+
newVal = updater(old);
|
|
4476
|
+
}
|
|
4477
|
+
try {
|
|
4478
|
+
localStorage.setItem(key, JSON.stringify(newVal));
|
|
4479
|
+
} catch {}
|
|
4480
|
+
return newVal;
|
|
4481
|
+
});
|
|
4482
|
+
}, [key]);
|
|
4483
|
+
return [value, setter];
|
|
4484
|
+
}
|
|
1522
4485
|
|
|
1523
4486
|
const defaultTheme = {
|
|
1524
4487
|
background: '#0b1521',
|
|
@@ -1534,11 +4497,10 @@
|
|
|
1534
4497
|
warning: '#ffb200'
|
|
1535
4498
|
};
|
|
1536
4499
|
const ThemeContext = /*#__PURE__*/React__default["default"].createContext(defaultTheme);
|
|
1537
|
-
function ThemeProvider(
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
} = _ref;
|
|
4500
|
+
function ThemeProvider({
|
|
4501
|
+
theme,
|
|
4502
|
+
...rest
|
|
4503
|
+
}) {
|
|
1542
4504
|
return /*#__PURE__*/React__default["default"].createElement(ThemeContext.Provider, _extends({
|
|
1543
4505
|
value: theme
|
|
1544
4506
|
}, rest));
|
|
@@ -1567,12 +4529,9 @@
|
|
|
1567
4529
|
const matcher = window.matchMedia(query);
|
|
1568
4530
|
|
|
1569
4531
|
// Create our handler
|
|
1570
|
-
const onChange =
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
} = _ref;
|
|
1574
|
-
return setIsMatch(matches);
|
|
1575
|
-
};
|
|
4532
|
+
const onChange = ({
|
|
4533
|
+
matches
|
|
4534
|
+
}) => setIsMatch(matches);
|
|
1576
4535
|
|
|
1577
4536
|
// Listen for changes
|
|
1578
4537
|
matcher.addListener(onChange);
|
|
@@ -1588,7 +4547,7 @@
|
|
|
1588
4547
|
|
|
1589
4548
|
const isServer$1 = typeof window === 'undefined';
|
|
1590
4549
|
function getStatusColor(match, theme) {
|
|
1591
|
-
return match.store.isFetching ? theme.active : match.store.status === 'error' ? theme.danger : match.store.status === 'success' ? theme.success : theme.gray;
|
|
4550
|
+
return match.store.state.isFetching ? theme.active : match.store.state.status === 'error' ? theme.danger : match.store.state.status === 'success' ? theme.success : theme.gray;
|
|
1592
4551
|
}
|
|
1593
4552
|
|
|
1594
4553
|
// export function getQueryStatusLabel(query: Query) {
|
|
@@ -1601,18 +4560,13 @@
|
|
|
1601
4560
|
// : 'fresh'
|
|
1602
4561
|
// }
|
|
1603
4562
|
|
|
1604
|
-
function styled(type, newStyles, queries) {
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
let {
|
|
1610
|
-
style,
|
|
1611
|
-
...rest
|
|
1612
|
-
} = _ref;
|
|
4563
|
+
function styled(type, newStyles, queries = {}) {
|
|
4564
|
+
return /*#__PURE__*/React__default["default"].forwardRef(({
|
|
4565
|
+
style,
|
|
4566
|
+
...rest
|
|
4567
|
+
}, ref) => {
|
|
1613
4568
|
const theme = useTheme();
|
|
1614
|
-
const mediaStyles = Object.entries(queries).reduce((current,
|
|
1615
|
-
let [key, value] = _ref2;
|
|
4569
|
+
const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
|
|
1616
4570
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1617
4571
|
return useMediaQuery(key) ? {
|
|
1618
4572
|
...current,
|
|
@@ -1679,13 +4633,8 @@
|
|
|
1679
4633
|
throw error;
|
|
1680
4634
|
}));
|
|
1681
4635
|
}
|
|
1682
|
-
function multiSortBy(arr, accessors) {
|
|
1683
|
-
|
|
1684
|
-
accessors = [d => d];
|
|
1685
|
-
}
|
|
1686
|
-
return arr.map((d, i) => [d, i]).sort((_ref3, _ref4) => {
|
|
1687
|
-
let [a, ai] = _ref3;
|
|
1688
|
-
let [b, bi] = _ref4;
|
|
4636
|
+
function multiSortBy(arr, accessors = [d => d]) {
|
|
4637
|
+
return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
|
|
1689
4638
|
for (const accessor of accessors) {
|
|
1690
4639
|
const ao = accessor(a);
|
|
1691
4640
|
const bo = accessor(b);
|
|
@@ -1701,10 +4650,7 @@
|
|
|
1701
4650
|
return ao > bo ? 1 : -1;
|
|
1702
4651
|
}
|
|
1703
4652
|
return ai - bi;
|
|
1704
|
-
}).map(
|
|
1705
|
-
let [d] = _ref5;
|
|
1706
|
-
return d;
|
|
1707
|
-
});
|
|
4653
|
+
}).map(([d]) => d);
|
|
1708
4654
|
}
|
|
1709
4655
|
|
|
1710
4656
|
const Panel = styled('div', (_props, theme) => ({
|
|
@@ -1764,38 +4710,6 @@
|
|
|
1764
4710
|
const Code = styled('code', {
|
|
1765
4711
|
fontSize: '.9em'
|
|
1766
4712
|
});
|
|
1767
|
-
styled('input', (_props, theme) => ({
|
|
1768
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
1769
|
-
border: 0,
|
|
1770
|
-
borderRadius: '.2em',
|
|
1771
|
-
color: theme.inputTextColor,
|
|
1772
|
-
fontSize: '.9em',
|
|
1773
|
-
lineHeight: `1.3`,
|
|
1774
|
-
padding: '.3em .4em'
|
|
1775
|
-
}));
|
|
1776
|
-
styled('select', (_props, theme) => ({
|
|
1777
|
-
display: `inline-block`,
|
|
1778
|
-
fontSize: `.9em`,
|
|
1779
|
-
fontFamily: `sans-serif`,
|
|
1780
|
-
fontWeight: 'normal',
|
|
1781
|
-
lineHeight: `1.3`,
|
|
1782
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
1783
|
-
height: 'auto',
|
|
1784
|
-
border: 0,
|
|
1785
|
-
borderRadius: `.2em`,
|
|
1786
|
-
appearance: `none`,
|
|
1787
|
-
WebkitAppearance: 'none',
|
|
1788
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
1789
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
1790
|
-
backgroundRepeat: `no-repeat`,
|
|
1791
|
-
backgroundPosition: `right .55em center`,
|
|
1792
|
-
backgroundSize: `.65em auto, 100%`,
|
|
1793
|
-
color: theme.inputTextColor
|
|
1794
|
-
}), {
|
|
1795
|
-
'(max-width: 500px)': {
|
|
1796
|
-
display: 'none'
|
|
1797
|
-
}
|
|
1798
|
-
});
|
|
1799
4713
|
|
|
1800
4714
|
const Entry = styled('div', {
|
|
1801
4715
|
fontFamily: 'Menlo, monospace',
|
|
@@ -1832,20 +4746,17 @@
|
|
|
1832
4746
|
color: 'grey',
|
|
1833
4747
|
fontSize: '.7em'
|
|
1834
4748
|
});
|
|
1835
|
-
const Expander =
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
}
|
|
1847
|
-
}, "\u25B6");
|
|
1848
|
-
};
|
|
4749
|
+
const Expander = ({
|
|
4750
|
+
expanded,
|
|
4751
|
+
style = {}
|
|
4752
|
+
}) => /*#__PURE__*/React__namespace.createElement("span", {
|
|
4753
|
+
style: {
|
|
4754
|
+
display: 'inline-block',
|
|
4755
|
+
transition: 'all .1s ease',
|
|
4756
|
+
transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
|
|
4757
|
+
...style
|
|
4758
|
+
}
|
|
4759
|
+
}, "\u25B6");
|
|
1849
4760
|
/**
|
|
1850
4761
|
* Chunk elements in the array by size
|
|
1851
4762
|
*
|
|
@@ -1865,19 +4776,18 @@
|
|
|
1865
4776
|
}
|
|
1866
4777
|
return result;
|
|
1867
4778
|
}
|
|
1868
|
-
const DefaultRenderer =
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
} = _ref2;
|
|
4779
|
+
const DefaultRenderer = ({
|
|
4780
|
+
handleEntry,
|
|
4781
|
+
label,
|
|
4782
|
+
value,
|
|
4783
|
+
subEntries = [],
|
|
4784
|
+
subEntryPages = [],
|
|
4785
|
+
type,
|
|
4786
|
+
expanded = false,
|
|
4787
|
+
toggleExpanded,
|
|
4788
|
+
pageSize,
|
|
4789
|
+
renderer
|
|
4790
|
+
}) => {
|
|
1881
4791
|
const [expandedPages, setExpandedPages] = React__namespace.useState([]);
|
|
1882
4792
|
const [valueSnapshot, setValueSnapshot] = React__namespace.useState(undefined);
|
|
1883
4793
|
const refreshValueSnapshot = () => {
|
|
@@ -1910,14 +4820,13 @@
|
|
|
1910
4820
|
function isIterable(x) {
|
|
1911
4821
|
return Symbol.iterator in x;
|
|
1912
4822
|
}
|
|
1913
|
-
function Explorer(
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
} = _ref3;
|
|
4823
|
+
function Explorer({
|
|
4824
|
+
value,
|
|
4825
|
+
defaultExpanded,
|
|
4826
|
+
renderer = DefaultRenderer,
|
|
4827
|
+
pageSize = 100,
|
|
4828
|
+
...rest
|
|
4829
|
+
}) {
|
|
1921
4830
|
const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
|
|
1922
4831
|
const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
|
|
1923
4832
|
let type = typeof value;
|
|
@@ -1925,7 +4834,7 @@
|
|
|
1925
4834
|
const makeProperty = sub => {
|
|
1926
4835
|
const subDefaultExpanded = defaultExpanded === true ? {
|
|
1927
4836
|
[sub.label]: true
|
|
1928
|
-
} : defaultExpanded
|
|
4837
|
+
} : defaultExpanded?.[sub.label];
|
|
1929
4838
|
return {
|
|
1930
4839
|
...sub,
|
|
1931
4840
|
defaultExpanded: subDefaultExpanded
|
|
@@ -1945,13 +4854,10 @@
|
|
|
1945
4854
|
}));
|
|
1946
4855
|
} else if (typeof value === 'object' && value !== null) {
|
|
1947
4856
|
type = 'object';
|
|
1948
|
-
subEntries = Object.entries(value).map(
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
value: val
|
|
1953
|
-
});
|
|
1954
|
-
});
|
|
4857
|
+
subEntries = Object.entries(value).map(([key, val]) => makeProperty({
|
|
4858
|
+
label: key,
|
|
4859
|
+
value: val
|
|
4860
|
+
}));
|
|
1955
4861
|
}
|
|
1956
4862
|
const subEntryPages = chunkArray(subEntries, pageSize);
|
|
1957
4863
|
return renderer({
|
|
@@ -2001,16 +4907,15 @@
|
|
|
2001
4907
|
}
|
|
2002
4908
|
}, "ROUTER"));
|
|
2003
4909
|
}
|
|
2004
|
-
function TanStackRouterDevtools(
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
} = _ref;
|
|
4910
|
+
function TanStackRouterDevtools({
|
|
4911
|
+
initialIsOpen,
|
|
4912
|
+
panelProps = {},
|
|
4913
|
+
closeButtonProps = {},
|
|
4914
|
+
toggleButtonProps = {},
|
|
4915
|
+
position = 'bottom-left',
|
|
4916
|
+
containerElement: Container = 'footer',
|
|
4917
|
+
router
|
|
4918
|
+
}) {
|
|
2014
4919
|
const rootRef = React__default["default"].useRef(null);
|
|
2015
4920
|
const panelRef = React__default["default"].useRef(null);
|
|
2016
4921
|
const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
|
|
@@ -2023,12 +4928,12 @@
|
|
|
2023
4928
|
|
|
2024
4929
|
setIsResizing(true);
|
|
2025
4930
|
const dragInfo = {
|
|
2026
|
-
originalHeight:
|
|
4931
|
+
originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
|
|
2027
4932
|
pageY: startEvent.pageY
|
|
2028
4933
|
};
|
|
2029
4934
|
const run = moveEvent => {
|
|
2030
4935
|
const delta = dragInfo.pageY - moveEvent.pageY;
|
|
2031
|
-
const newHeight =
|
|
4936
|
+
const newHeight = dragInfo?.originalHeight + delta;
|
|
2032
4937
|
setDevtoolsHeight(newHeight);
|
|
2033
4938
|
if (newHeight < 70) {
|
|
2034
4939
|
setIsOpen(false);
|
|
@@ -2074,12 +4979,10 @@
|
|
|
2074
4979
|
}, [isResolvedOpen]);
|
|
2075
4980
|
React__default["default"][isServer ? 'useEffect' : 'useLayoutEffect'](() => {
|
|
2076
4981
|
if (isResolvedOpen) {
|
|
2077
|
-
|
|
2078
|
-
const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
|
|
4982
|
+
const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
|
|
2079
4983
|
const run = () => {
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
|
|
4984
|
+
const containerHeight = panelRef.current?.getBoundingClientRect().height;
|
|
4985
|
+
if (rootRef.current?.parentElement) {
|
|
2083
4986
|
rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
|
|
2084
4987
|
}
|
|
2085
4988
|
};
|
|
@@ -2087,9 +4990,8 @@
|
|
|
2087
4990
|
if (typeof window !== 'undefined') {
|
|
2088
4991
|
window.addEventListener('resize', run);
|
|
2089
4992
|
return () => {
|
|
2090
|
-
var _rootRef$current3;
|
|
2091
4993
|
window.removeEventListener('resize', run);
|
|
2092
|
-
if (
|
|
4994
|
+
if (rootRef.current?.parentElement && typeof previousValue === 'string') {
|
|
2093
4995
|
rootRef.current.parentElement.style.paddingBottom = previousValue;
|
|
2094
4996
|
}
|
|
2095
4997
|
};
|
|
@@ -2219,7 +5121,6 @@
|
|
|
2219
5121
|
})) : null);
|
|
2220
5122
|
}
|
|
2221
5123
|
const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default["default"].forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
|
|
2222
|
-
var _Object$values, _Object$values$find, _router$store$current, _router$store$pending, _router$store$pending2, _last, _last2, _last3, _last4, _last5, _last6;
|
|
2223
5124
|
const {
|
|
2224
5125
|
isOpen = true,
|
|
2225
5126
|
setIsOpen,
|
|
@@ -2228,7 +5129,7 @@
|
|
|
2228
5129
|
...panelProps
|
|
2229
5130
|
} = props;
|
|
2230
5131
|
const routerContextValue = React__default["default"].useContext(routerContext);
|
|
2231
|
-
const router = userRouter ??
|
|
5132
|
+
const router = userRouter ?? routerContextValue?.router;
|
|
2232
5133
|
invariant(router, 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.');
|
|
2233
5134
|
useRouterStore();
|
|
2234
5135
|
const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
|
|
@@ -2236,11 +5137,11 @@
|
|
|
2236
5137
|
React__default["default"].useEffect(() => {
|
|
2237
5138
|
setActiveMatchId('');
|
|
2238
5139
|
}, [activeRouteId]);
|
|
2239
|
-
const activeMatch =
|
|
2240
|
-
const matchCacheValues = multiSortBy(Object.keys(router.store.matchCache).filter(key => {
|
|
2241
|
-
const cacheEntry = router.store.matchCache[key];
|
|
5140
|
+
const activeMatch = Object.values(router.store.state.matchCache)?.find(d => d.match.id === activeMatchId)?.match ?? router.store.state.currentMatches?.find(d => d.route.id === activeRouteId);
|
|
5141
|
+
const matchCacheValues = multiSortBy(Object.keys(router.store.state.matchCache).filter(key => {
|
|
5142
|
+
const cacheEntry = router.store.state.matchCache[key];
|
|
2242
5143
|
return cacheEntry.gc > Date.now();
|
|
2243
|
-
}).map(key => router.store.matchCache[key]), [d => d.match.store.isFetching ? -1 : 1, d => -d.match.store.updatedAt]);
|
|
5144
|
+
}).map(key => router.store.state.matchCache[key]), [d => d.match.store.state.isFetching ? -1 : 1, d => -d.match.store.state.updatedAt]);
|
|
2244
5145
|
return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
|
|
2245
5146
|
theme: defaultTheme
|
|
2246
5147
|
}, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
|
|
@@ -2365,12 +5266,12 @@
|
|
|
2365
5266
|
top: 0,
|
|
2366
5267
|
zIndex: 1
|
|
2367
5268
|
}
|
|
2368
|
-
}, "Active Matches"), router.store.currentMatches.map((match, i) => {
|
|
5269
|
+
}, "Active Matches"), router.store.state.currentMatches.map((match, i) => {
|
|
2369
5270
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2370
|
-
key: match.
|
|
5271
|
+
key: match.route.id || i,
|
|
2371
5272
|
role: "button",
|
|
2372
|
-
"aria-label": `Open match details for ${match.
|
|
2373
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
5273
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
5274
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
2374
5275
|
style: {
|
|
2375
5276
|
display: 'flex',
|
|
2376
5277
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -2395,8 +5296,8 @@
|
|
|
2395
5296
|
style: {
|
|
2396
5297
|
padding: '.5em'
|
|
2397
5298
|
}
|
|
2398
|
-
}, `${match.
|
|
2399
|
-
}),
|
|
5299
|
+
}, `${match.id}`));
|
|
5300
|
+
}), router.store.state.pendingMatches?.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2400
5301
|
style: {
|
|
2401
5302
|
marginTop: '2rem',
|
|
2402
5303
|
padding: '.5em',
|
|
@@ -2405,12 +5306,12 @@
|
|
|
2405
5306
|
top: 0,
|
|
2406
5307
|
zIndex: 1
|
|
2407
5308
|
}
|
|
2408
|
-
}, "Pending Matches"),
|
|
5309
|
+
}, "Pending Matches"), router.store.state.pendingMatches?.map((match, i) => {
|
|
2409
5310
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2410
|
-
key: match.
|
|
5311
|
+
key: match.route.id || i,
|
|
2411
5312
|
role: "button",
|
|
2412
|
-
"aria-label": `Open match details for ${match.
|
|
2413
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
5313
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
5314
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
2414
5315
|
style: {
|
|
2415
5316
|
display: 'flex',
|
|
2416
5317
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -2434,7 +5335,7 @@
|
|
|
2434
5335
|
style: {
|
|
2435
5336
|
padding: '.5em'
|
|
2436
5337
|
}
|
|
2437
|
-
}, `${match.
|
|
5338
|
+
}, `${match.id}`));
|
|
2438
5339
|
})) : null, matchCacheValues.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2439
5340
|
style: {
|
|
2440
5341
|
marginTop: '2rem',
|
|
@@ -2450,7 +5351,7 @@
|
|
|
2450
5351
|
}
|
|
2451
5352
|
}, /*#__PURE__*/React__default["default"].createElement("div", null, "Match Cache"), /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
2452
5353
|
onClick: () => {
|
|
2453
|
-
router.
|
|
5354
|
+
router.store.setState(s => s.matchCache = {});
|
|
2454
5355
|
}
|
|
2455
5356
|
}, "Clear")), matchCacheValues.map((d, i) => {
|
|
2456
5357
|
const {
|
|
@@ -2458,10 +5359,10 @@
|
|
|
2458
5359
|
gc
|
|
2459
5360
|
} = d;
|
|
2460
5361
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2461
|
-
key: match.
|
|
5362
|
+
key: match.id || i,
|
|
2462
5363
|
role: "button",
|
|
2463
|
-
"aria-label": `Open match details for ${match.
|
|
2464
|
-
onClick: () => setActiveMatchId(activeMatchId === match.
|
|
5364
|
+
"aria-label": `Open match details for ${match.id}`,
|
|
5365
|
+
onClick: () => setActiveMatchId(activeMatchId === match.id ? '' : match.id),
|
|
2465
5366
|
style: {
|
|
2466
5367
|
display: 'flex',
|
|
2467
5368
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -2493,7 +5394,7 @@
|
|
|
2493
5394
|
borderRadius: '.25rem',
|
|
2494
5395
|
transition: 'all .2s ease-out'
|
|
2495
5396
|
}
|
|
2496
|
-
}), /*#__PURE__*/React__default["default"].createElement(Code, null, `${match.
|
|
5397
|
+
}), /*#__PURE__*/React__default["default"].createElement(Code, null, `${match.id}`)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2497
5398
|
style: {
|
|
2498
5399
|
fontSize: '.7rem',
|
|
2499
5400
|
opacity: '.5',
|
|
@@ -2519,19 +5420,19 @@
|
|
|
2519
5420
|
style: {
|
|
2520
5421
|
lineHeight: '1.8em'
|
|
2521
5422
|
}
|
|
2522
|
-
}, JSON.stringify(activeMatch.
|
|
5423
|
+
}, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
|
|
2523
5424
|
style: {
|
|
2524
5425
|
opacity: '.5'
|
|
2525
5426
|
}
|
|
2526
|
-
}, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
|
|
5427
|
+
}, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.state.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
|
|
2527
5428
|
style: {
|
|
2528
5429
|
opacity: '.5'
|
|
2529
5430
|
}
|
|
2530
|
-
}, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.
|
|
5431
|
+
}, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.getIsInvalid().toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
|
|
2531
5432
|
style: {
|
|
2532
5433
|
opacity: '.5'
|
|
2533
5434
|
}
|
|
2534
|
-
}, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.updatedAt ? new Date(activeMatch.store.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5435
|
+
}, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.state.updatedAt ? new Date(activeMatch.store.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2535
5436
|
style: {
|
|
2536
5437
|
background: defaultTheme.backgroundAlt,
|
|
2537
5438
|
padding: '.5em',
|
|
@@ -2599,9 +5500,9 @@
|
|
|
2599
5500
|
style: {
|
|
2600
5501
|
padding: '.5em'
|
|
2601
5502
|
}
|
|
2602
|
-
}, Object.keys(
|
|
2603
|
-
value:
|
|
2604
|
-
defaultExpanded: Object.keys(
|
|
5503
|
+
}, Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
|
|
5504
|
+
value: last(router.store.state.currentMatches)?.store.state.loaderData || {},
|
|
5505
|
+
defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).reduce((obj, next) => {
|
|
2605
5506
|
obj[next] = {};
|
|
2606
5507
|
return obj;
|
|
2607
5508
|
}, {})
|
|
@@ -2622,9 +5523,9 @@
|
|
|
2622
5523
|
style: {
|
|
2623
5524
|
padding: '.5em'
|
|
2624
5525
|
}
|
|
2625
|
-
}, Object.keys(
|
|
2626
|
-
value:
|
|
2627
|
-
defaultExpanded: Object.keys(
|
|
5526
|
+
}, Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
|
|
5527
|
+
value: last(router.store.state.currentMatches)?.store.state.search || {},
|
|
5528
|
+
defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).reduce((obj, next) => {
|
|
2628
5529
|
obj[next] = {};
|
|
2629
5530
|
return obj;
|
|
2630
5531
|
}, {})
|