@creopse/react 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4603 -105
- package/dist/index.js +4604 -107
- package/dist/index.mjs +4604 -106
- package/package.json +2 -2
- package/types/components/core/RootContainer/RootContainer.d.ts +9 -0
- package/types/components/core/RootContainer/index.d.ts +1 -0
- package/types/components/widgets/MountedTeleport/MountedTeleport.d.ts +8 -0
- package/types/components/widgets/MountedTeleport/index.d.ts +1 -0
- package/types/components/widgets/ReadMore/ReadMore.d.ts +12 -0
- package/types/components/widgets/ReadMore/index.d.ts +1 -0
- package/types/components/widgets/StickyBottom/StickyBottom.d.ts +9 -0
- package/types/components/widgets/StickyBottom/index.d.ts +1 -0
- package/types/components/widgets/StickyTop/StickyTop.d.ts +9 -0
- package/types/components/widgets/StickyTop/index.d.ts +1 -0
- package/types/index.d.ts +5 -0
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
+
const reactDom = require("react-dom");
|
|
4
5
|
function _interopNamespaceDefault(e) {
|
|
5
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
6
7
|
if (e) {
|
|
@@ -242,15 +243,15 @@ function requireReactJsxRuntime_development() {
|
|
|
242
243
|
else validateChildKeys(children);
|
|
243
244
|
if (hasOwnProperty.call(config, "key")) {
|
|
244
245
|
children = getComponentNameFromType(type);
|
|
245
|
-
var
|
|
246
|
+
var keys2 = Object.keys(config).filter(function(k) {
|
|
246
247
|
return "key" !== k;
|
|
247
248
|
});
|
|
248
|
-
isStaticChildren = 0 <
|
|
249
|
-
didWarnAboutKeySpread[children + isStaticChildren] || (
|
|
249
|
+
isStaticChildren = 0 < keys2.length ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
250
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys2 = 0 < keys2.length ? "{" + keys2.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
250
251
|
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
251
252
|
isStaticChildren,
|
|
252
253
|
children,
|
|
253
|
-
|
|
254
|
+
keys2,
|
|
254
255
|
children
|
|
255
256
|
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
256
257
|
}
|
|
@@ -393,11 +394,11 @@ function removeItem(arr, item) {
|
|
|
393
394
|
if (index > -1)
|
|
394
395
|
arr.splice(index, 1);
|
|
395
396
|
}
|
|
396
|
-
const clamp = (
|
|
397
|
-
if (v >
|
|
398
|
-
return
|
|
399
|
-
if (v <
|
|
400
|
-
return
|
|
397
|
+
const clamp = (min2, max2, v) => {
|
|
398
|
+
if (v > max2)
|
|
399
|
+
return max2;
|
|
400
|
+
if (v < min2)
|
|
401
|
+
return min2;
|
|
401
402
|
return v;
|
|
402
403
|
};
|
|
403
404
|
function formatErrorMessage(message, errorCode) {
|
|
@@ -421,7 +422,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
421
422
|
}
|
|
422
423
|
const MotionGlobalConfig = {};
|
|
423
424
|
const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
|
|
424
|
-
function isObject(value) {
|
|
425
|
+
function isObject$1(value) {
|
|
425
426
|
return typeof value === "object" && value !== null;
|
|
426
427
|
}
|
|
427
428
|
const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
|
|
@@ -437,9 +438,9 @@ function memo(callback) {
|
|
|
437
438
|
const noop = /* @__NO_SIDE_EFFECTS__ */ (any) => any;
|
|
438
439
|
const combineFunctions = (a, b) => (v) => b(a(v));
|
|
439
440
|
const pipe = (...transformers) => transformers.reduce(combineFunctions);
|
|
440
|
-
const progress = /* @__NO_SIDE_EFFECTS__ */ (
|
|
441
|
-
const toFromDifference =
|
|
442
|
-
return toFromDifference === 0 ? 1 : (value -
|
|
441
|
+
const progress = /* @__NO_SIDE_EFFECTS__ */ (from2, to2, value) => {
|
|
442
|
+
const toFromDifference = to2 - from2;
|
|
443
|
+
return toFromDifference === 0 ? 1 : (value - from2) / toFromDifference;
|
|
443
444
|
};
|
|
444
445
|
class SubscriptionManager {
|
|
445
446
|
constructor() {
|
|
@@ -469,8 +470,8 @@ class SubscriptionManager {
|
|
|
469
470
|
this.subscriptions.length = 0;
|
|
470
471
|
}
|
|
471
472
|
}
|
|
472
|
-
const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (
|
|
473
|
-
const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (
|
|
473
|
+
const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds2) => seconds2 * 1e3;
|
|
474
|
+
const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds2) => milliseconds2 / 1e3;
|
|
474
475
|
function velocityPerSecond(velocity, frameDuration) {
|
|
475
476
|
return frameDuration ? velocity * (1e3 / frameDuration) : 0;
|
|
476
477
|
}
|
|
@@ -687,23 +688,23 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
687
688
|
return { schedule, cancel, state, steps };
|
|
688
689
|
}
|
|
689
690
|
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
690
|
-
let now;
|
|
691
|
+
let now$1;
|
|
691
692
|
function clearTime() {
|
|
692
|
-
now = void 0;
|
|
693
|
+
now$1 = void 0;
|
|
693
694
|
}
|
|
694
695
|
const time = {
|
|
695
696
|
now: () => {
|
|
696
|
-
if (now === void 0) {
|
|
697
|
+
if (now$1 === void 0) {
|
|
697
698
|
time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now());
|
|
698
699
|
}
|
|
699
|
-
return now;
|
|
700
|
+
return now$1;
|
|
700
701
|
},
|
|
701
702
|
set: (newTime) => {
|
|
702
|
-
now = newTime;
|
|
703
|
+
now$1 = newTime;
|
|
703
704
|
queueMicrotask(clearTime);
|
|
704
705
|
}
|
|
705
706
|
};
|
|
706
|
-
const checkStringStartsWith = (
|
|
707
|
+
const checkStringStartsWith = (token2) => (key) => typeof key === "string" && key.startsWith(token2);
|
|
707
708
|
const isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--");
|
|
708
709
|
const startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--");
|
|
709
710
|
const isCSSVariableToken = (value) => {
|
|
@@ -945,12 +946,12 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
|
|
|
945
946
|
function mixImmediate(a, b) {
|
|
946
947
|
return (p) => p > 0 ? b : a;
|
|
947
948
|
}
|
|
948
|
-
const mixNumber$1 = (
|
|
949
|
-
return
|
|
949
|
+
const mixNumber$1 = (from2, to2, progress2) => {
|
|
950
|
+
return from2 + (to2 - from2) * progress2;
|
|
950
951
|
};
|
|
951
|
-
const mixLinearColor = (
|
|
952
|
-
const fromExpo =
|
|
953
|
-
const expo = v * (
|
|
952
|
+
const mixLinearColor = (from2, to2, v) => {
|
|
953
|
+
const fromExpo = from2 * from2;
|
|
954
|
+
const expo = v * (to2 * to2 - fromExpo) + fromExpo;
|
|
954
955
|
return expo < 0 ? 0 : Math.sqrt(expo);
|
|
955
956
|
};
|
|
956
957
|
const colorTypes = [hex, rgba, hsla];
|
|
@@ -966,11 +967,11 @@ function asRGBA(color2) {
|
|
|
966
967
|
}
|
|
967
968
|
return model;
|
|
968
969
|
}
|
|
969
|
-
const mixColor = (
|
|
970
|
-
const fromRGBA = asRGBA(
|
|
971
|
-
const toRGBA = asRGBA(
|
|
970
|
+
const mixColor = (from2, to2) => {
|
|
971
|
+
const fromRGBA = asRGBA(from2);
|
|
972
|
+
const toRGBA = asRGBA(to2);
|
|
972
973
|
if (!fromRGBA || !toRGBA) {
|
|
973
|
-
return mixImmediate(
|
|
974
|
+
return mixImmediate(from2, to2);
|
|
974
975
|
}
|
|
975
976
|
const blended = { ...fromRGBA };
|
|
976
977
|
return (v) => {
|
|
@@ -1057,12 +1058,12 @@ const mixComplex = (origin, target) => {
|
|
|
1057
1058
|
return mixImmediate(origin, target);
|
|
1058
1059
|
}
|
|
1059
1060
|
};
|
|
1060
|
-
function mix(
|
|
1061
|
-
if (typeof
|
|
1062
|
-
return mixNumber$1(
|
|
1061
|
+
function mix(from2, to2, p) {
|
|
1062
|
+
if (typeof from2 === "number" && typeof to2 === "number" && typeof p === "number") {
|
|
1063
|
+
return mixNumber$1(from2, to2, p);
|
|
1063
1064
|
}
|
|
1064
|
-
const mixer = getMixer(
|
|
1065
|
-
return mixer(
|
|
1065
|
+
const mixer = getMixer(from2);
|
|
1066
|
+
return mixer(from2, to2);
|
|
1066
1067
|
}
|
|
1067
1068
|
const frameloopDriver = (update) => {
|
|
1068
1069
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
@@ -1210,8 +1211,8 @@ function calcAngularFreq(undampedFreq, dampingRatio) {
|
|
|
1210
1211
|
}
|
|
1211
1212
|
const durationKeys = ["duration", "bounce"];
|
|
1212
1213
|
const physicsKeys = ["stiffness", "damping", "mass"];
|
|
1213
|
-
function isSpringType(options,
|
|
1214
|
-
return
|
|
1214
|
+
function isSpringType(options, keys2) {
|
|
1215
|
+
return keys2.some((key) => options[key] !== void 0);
|
|
1215
1216
|
}
|
|
1216
1217
|
function getSpringOptions(options) {
|
|
1217
1218
|
let springOptions = {
|
|
@@ -1319,19 +1320,19 @@ spring.applyToOptions = (options) => {
|
|
|
1319
1320
|
options.type = "keyframes";
|
|
1320
1321
|
return options;
|
|
1321
1322
|
};
|
|
1322
|
-
function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed }) {
|
|
1323
|
+
function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min: min2, max: max2, restDelta = 0.5, restSpeed }) {
|
|
1323
1324
|
const origin = keyframes2[0];
|
|
1324
1325
|
const state = {
|
|
1325
1326
|
done: false,
|
|
1326
1327
|
value: origin
|
|
1327
1328
|
};
|
|
1328
|
-
const isOutOfBounds = (v) =>
|
|
1329
|
+
const isOutOfBounds = (v) => min2 !== void 0 && v < min2 || max2 !== void 0 && v > max2;
|
|
1329
1330
|
const nearestBoundary = (v) => {
|
|
1330
|
-
if (
|
|
1331
|
-
return
|
|
1332
|
-
if (
|
|
1333
|
-
return
|
|
1334
|
-
return Math.abs(
|
|
1331
|
+
if (min2 === void 0)
|
|
1332
|
+
return max2;
|
|
1333
|
+
if (max2 === void 0)
|
|
1334
|
+
return min2;
|
|
1335
|
+
return Math.abs(min2 - v) < Math.abs(max2 - v) ? min2 : max2;
|
|
1335
1336
|
};
|
|
1336
1337
|
let amplitude = power * velocity;
|
|
1337
1338
|
const ideal = origin + amplitude;
|
|
@@ -1424,20 +1425,20 @@ function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer
|
|
|
1424
1425
|
};
|
|
1425
1426
|
return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator;
|
|
1426
1427
|
}
|
|
1427
|
-
function fillOffset(
|
|
1428
|
-
const
|
|
1428
|
+
function fillOffset(offset2, remaining) {
|
|
1429
|
+
const min2 = offset2[offset2.length - 1];
|
|
1429
1430
|
for (let i = 1; i <= remaining; i++) {
|
|
1430
1431
|
const offsetProgress = /* @__PURE__ */ progress(0, remaining, i);
|
|
1431
|
-
|
|
1432
|
+
offset2.push(mixNumber$1(min2, 1, offsetProgress));
|
|
1432
1433
|
}
|
|
1433
1434
|
}
|
|
1434
1435
|
function defaultOffset(arr) {
|
|
1435
|
-
const
|
|
1436
|
-
fillOffset(
|
|
1437
|
-
return
|
|
1436
|
+
const offset2 = [0];
|
|
1437
|
+
fillOffset(offset2, arr.length - 1);
|
|
1438
|
+
return offset2;
|
|
1438
1439
|
}
|
|
1439
|
-
function convertOffsetToTimes(
|
|
1440
|
-
return
|
|
1440
|
+
function convertOffsetToTimes(offset2, duration) {
|
|
1441
|
+
return offset2.map((o) => o * duration);
|
|
1441
1442
|
}
|
|
1442
1443
|
function defaultEasing(values, easing) {
|
|
1443
1444
|
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
|
|
@@ -2459,10 +2460,10 @@ function parseCSSVariable(current) {
|
|
|
2459
2460
|
const maxDepth = 4;
|
|
2460
2461
|
function getVariableValue(current, element, depth = 1) {
|
|
2461
2462
|
invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
2462
|
-
const [
|
|
2463
|
-
if (!
|
|
2463
|
+
const [token2, fallback] = parseCSSVariable(current);
|
|
2464
|
+
if (!token2)
|
|
2464
2465
|
return;
|
|
2465
|
-
const resolved = window.getComputedStyle(element).getPropertyValue(
|
|
2466
|
+
const resolved = window.getComputedStyle(element).getPropertyValue(token2);
|
|
2466
2467
|
if (resolved) {
|
|
2467
2468
|
const trimmed = resolved.trim();
|
|
2468
2469
|
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
@@ -2737,7 +2738,7 @@ const getValueAsType = (value, type) => {
|
|
|
2737
2738
|
return type && typeof value === "number" ? type.transform(value) : value;
|
|
2738
2739
|
};
|
|
2739
2740
|
function isHTMLElement(element) {
|
|
2740
|
-
return isObject(element) && "offsetHeight" in element;
|
|
2741
|
+
return isObject$1(element) && "offsetHeight" in element;
|
|
2741
2742
|
}
|
|
2742
2743
|
const MAX_VELOCITY_DELTA = 30;
|
|
2743
2744
|
const isFloat = (value) => {
|
|
@@ -3182,7 +3183,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
3182
3183
|
return cancelEvents;
|
|
3183
3184
|
}
|
|
3184
3185
|
function isSVGElement(element) {
|
|
3185
|
-
return isObject(element) && "ownerSVGElement" in element;
|
|
3186
|
+
return isObject$1(element) && "ownerSVGElement" in element;
|
|
3186
3187
|
}
|
|
3187
3188
|
function isSVGSVGElement(element) {
|
|
3188
3189
|
return isSVGElement(element) && element.tagName === "svg";
|
|
@@ -3662,13 +3663,13 @@ const camelKeys = {
|
|
|
3662
3663
|
offset: "strokeDashoffset",
|
|
3663
3664
|
array: "strokeDasharray"
|
|
3664
3665
|
};
|
|
3665
|
-
function buildSVGPath(attrs, length, spacing = 1,
|
|
3666
|
+
function buildSVGPath(attrs, length, spacing = 1, offset2 = 0, useDashCase = true) {
|
|
3666
3667
|
attrs.pathLength = 1;
|
|
3667
|
-
const
|
|
3668
|
-
attrs[
|
|
3668
|
+
const keys2 = useDashCase ? dashKeys : camelKeys;
|
|
3669
|
+
attrs[keys2.offset] = px.transform(-offset2);
|
|
3669
3670
|
const pathLength = px.transform(length);
|
|
3670
3671
|
const pathSpacing = px.transform(spacing);
|
|
3671
|
-
attrs[
|
|
3672
|
+
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
3672
3673
|
}
|
|
3673
3674
|
function buildSVGAttrs(state, {
|
|
3674
3675
|
attrX,
|
|
@@ -4842,7 +4843,7 @@ const getDefaultTransition = (valueKey, { keyframes: keyframes2 }) => {
|
|
|
4842
4843
|
}
|
|
4843
4844
|
return ease;
|
|
4844
4845
|
};
|
|
4845
|
-
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
|
|
4846
|
+
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from: from2, elapsed, ...transition }) {
|
|
4846
4847
|
return !!Object.keys(transition).length;
|
|
4847
4848
|
}
|
|
4848
4849
|
const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
|
|
@@ -5505,18 +5506,18 @@ function getVelocity(history, timeDelta) {
|
|
|
5505
5506
|
}
|
|
5506
5507
|
return currentVelocity;
|
|
5507
5508
|
}
|
|
5508
|
-
function applyConstraints(point, { min, max }, elastic) {
|
|
5509
|
-
if (
|
|
5510
|
-
point = elastic ? mixNumber$1(
|
|
5511
|
-
} else if (
|
|
5512
|
-
point = elastic ? mixNumber$1(
|
|
5509
|
+
function applyConstraints(point, { min: min2, max: max2 }, elastic) {
|
|
5510
|
+
if (min2 !== void 0 && point < min2) {
|
|
5511
|
+
point = elastic ? mixNumber$1(min2, point, elastic.min) : Math.max(point, min2);
|
|
5512
|
+
} else if (max2 !== void 0 && point > max2) {
|
|
5513
|
+
point = elastic ? mixNumber$1(max2, point, elastic.max) : Math.min(point, max2);
|
|
5513
5514
|
}
|
|
5514
5515
|
return point;
|
|
5515
5516
|
}
|
|
5516
|
-
function calcRelativeAxisConstraints(axis,
|
|
5517
|
+
function calcRelativeAxisConstraints(axis, min2, max2) {
|
|
5517
5518
|
return {
|
|
5518
|
-
min:
|
|
5519
|
-
max:
|
|
5519
|
+
min: min2 !== void 0 ? axis.min + min2 : void 0,
|
|
5520
|
+
max: max2 !== void 0 ? axis.max + max2 - (axis.max - axis.min) : void 0
|
|
5520
5521
|
};
|
|
5521
5522
|
}
|
|
5522
5523
|
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
@@ -5526,12 +5527,12 @@ function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
|
5526
5527
|
};
|
|
5527
5528
|
}
|
|
5528
5529
|
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
|
|
5529
|
-
let
|
|
5530
|
-
let
|
|
5530
|
+
let min2 = constraintsAxis.min - layoutAxis.min;
|
|
5531
|
+
let max2 = constraintsAxis.max - layoutAxis.max;
|
|
5531
5532
|
if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) {
|
|
5532
|
-
[
|
|
5533
|
+
[min2, max2] = [max2, min2];
|
|
5533
5534
|
}
|
|
5534
|
-
return { min, max };
|
|
5535
|
+
return { min: min2, max: max2 };
|
|
5535
5536
|
}
|
|
5536
5537
|
function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
5537
5538
|
return {
|
|
@@ -5651,16 +5652,16 @@ class VisualElementDragControls {
|
|
|
5651
5652
|
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps();
|
|
5652
5653
|
if (!dragPropagation && !this.openDragLock)
|
|
5653
5654
|
return;
|
|
5654
|
-
const { offset } = info;
|
|
5655
|
+
const { offset: offset2 } = info;
|
|
5655
5656
|
if (dragDirectionLock && this.currentDirection === null) {
|
|
5656
|
-
this.currentDirection = getCurrentDirection(
|
|
5657
|
+
this.currentDirection = getCurrentDirection(offset2);
|
|
5657
5658
|
if (this.currentDirection !== null) {
|
|
5658
5659
|
onDirectionLock && onDirectionLock(this.currentDirection);
|
|
5659
5660
|
}
|
|
5660
5661
|
return;
|
|
5661
5662
|
}
|
|
5662
|
-
this.updateAxis("x", info.point,
|
|
5663
|
-
this.updateAxis("y", info.point,
|
|
5663
|
+
this.updateAxis("x", info.point, offset2);
|
|
5664
|
+
this.updateAxis("y", info.point, offset2);
|
|
5664
5665
|
this.visualElement.render();
|
|
5665
5666
|
onDrag && onDrag(event, info);
|
|
5666
5667
|
};
|
|
@@ -5721,12 +5722,12 @@ class VisualElementDragControls {
|
|
|
5721
5722
|
}
|
|
5722
5723
|
animationState && animationState.setActive("whileDrag", false);
|
|
5723
5724
|
}
|
|
5724
|
-
updateAxis(axis, _point,
|
|
5725
|
+
updateAxis(axis, _point, offset2) {
|
|
5725
5726
|
const { drag: drag2 } = this.getProps();
|
|
5726
|
-
if (!
|
|
5727
|
+
if (!offset2 || !shouldDrag(axis, drag2, this.currentDirection))
|
|
5727
5728
|
return;
|
|
5728
5729
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5729
|
-
let next = this.originPoint[axis] +
|
|
5730
|
+
let next = this.originPoint[axis] + offset2[axis];
|
|
5730
5731
|
if (this.constraints && this.constraints[axis]) {
|
|
5731
5732
|
next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
|
|
5732
5733
|
}
|
|
@@ -5837,8 +5838,8 @@ class VisualElementDragControls {
|
|
|
5837
5838
|
const { projection } = this.visualElement;
|
|
5838
5839
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5839
5840
|
if (projection && projection.layout) {
|
|
5840
|
-
const { min, max } = projection.layout.layoutBox[axis];
|
|
5841
|
-
axisValue.set(point[axis] - mixNumber$1(
|
|
5841
|
+
const { min: min2, max: max2 } = projection.layout.layoutBox[axis];
|
|
5842
|
+
axisValue.set(point[axis] - mixNumber$1(min2, max2, 0.5));
|
|
5842
5843
|
}
|
|
5843
5844
|
});
|
|
5844
5845
|
}
|
|
@@ -5872,8 +5873,8 @@ class VisualElementDragControls {
|
|
|
5872
5873
|
if (!shouldDrag(axis, drag2, null))
|
|
5873
5874
|
return;
|
|
5874
5875
|
const axisValue = this.getAxisMotionValue(axis);
|
|
5875
|
-
const { min, max } = this.constraints[axis];
|
|
5876
|
-
axisValue.set(mixNumber$1(
|
|
5876
|
+
const { min: min2, max: max2 } = this.constraints[axis];
|
|
5877
|
+
axisValue.set(mixNumber$1(min2, max2, boxProgress[axis]));
|
|
5877
5878
|
});
|
|
5878
5879
|
}
|
|
5879
5880
|
addListeners() {
|
|
@@ -5935,11 +5936,11 @@ class VisualElementDragControls {
|
|
|
5935
5936
|
function shouldDrag(direction, drag2, currentDirection) {
|
|
5936
5937
|
return (drag2 === true || drag2 === direction) && (currentDirection === null || currentDirection === direction);
|
|
5937
5938
|
}
|
|
5938
|
-
function getCurrentDirection(
|
|
5939
|
+
function getCurrentDirection(offset2, lockThreshold = 10) {
|
|
5939
5940
|
let direction = null;
|
|
5940
|
-
if (Math.abs(
|
|
5941
|
+
if (Math.abs(offset2.y) > lockThreshold) {
|
|
5941
5942
|
direction = "y";
|
|
5942
|
-
} else if (Math.abs(
|
|
5943
|
+
} else if (Math.abs(offset2.x) > lockThreshold) {
|
|
5943
5944
|
direction = "x";
|
|
5944
5945
|
}
|
|
5945
5946
|
return direction;
|
|
@@ -6044,16 +6045,16 @@ const correctBoxShadow = {
|
|
|
6044
6045
|
if (shadow.length > 5)
|
|
6045
6046
|
return original;
|
|
6046
6047
|
const template = complex.createTransformer(latest);
|
|
6047
|
-
const
|
|
6048
|
+
const offset2 = typeof shadow[0] !== "number" ? 1 : 0;
|
|
6048
6049
|
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
6049
6050
|
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
6050
|
-
shadow[0 +
|
|
6051
|
-
shadow[1 +
|
|
6051
|
+
shadow[0 + offset2] /= xScale;
|
|
6052
|
+
shadow[1 + offset2] /= yScale;
|
|
6052
6053
|
const averageScale = mixNumber$1(xScale, yScale, 0.5);
|
|
6053
|
-
if (typeof shadow[2 +
|
|
6054
|
-
shadow[2 +
|
|
6055
|
-
if (typeof shadow[3 +
|
|
6056
|
-
shadow[3 +
|
|
6054
|
+
if (typeof shadow[2 + offset2] === "number")
|
|
6055
|
+
shadow[2 + offset2] /= averageScale;
|
|
6056
|
+
if (typeof shadow[3 + offset2] === "number")
|
|
6057
|
+
shadow[3 + offset2] /= averageScale;
|
|
6057
6058
|
return template(shadow);
|
|
6058
6059
|
}
|
|
6059
6060
|
};
|
|
@@ -6239,13 +6240,13 @@ function getRadius(values, radiusName) {
|
|
|
6239
6240
|
}
|
|
6240
6241
|
const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut);
|
|
6241
6242
|
const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop);
|
|
6242
|
-
function compress(
|
|
6243
|
+
function compress(min2, max2, easing) {
|
|
6243
6244
|
return (p) => {
|
|
6244
|
-
if (p <
|
|
6245
|
+
if (p < min2)
|
|
6245
6246
|
return 0;
|
|
6246
|
-
if (p >
|
|
6247
|
+
if (p > max2)
|
|
6247
6248
|
return 1;
|
|
6248
|
-
return easing(/* @__PURE__ */ progress(
|
|
6249
|
+
return easing(/* @__PURE__ */ progress(min2, max2, p));
|
|
6249
6250
|
};
|
|
6250
6251
|
}
|
|
6251
6252
|
function copyAxisInto(axis, originAxis) {
|
|
@@ -7449,13 +7450,13 @@ function mixAxisDelta(output, delta, p) {
|
|
|
7449
7450
|
output.origin = delta.origin;
|
|
7450
7451
|
output.originPoint = delta.originPoint;
|
|
7451
7452
|
}
|
|
7452
|
-
function mixAxis(output,
|
|
7453
|
-
output.min = mixNumber$1(
|
|
7454
|
-
output.max = mixNumber$1(
|
|
7453
|
+
function mixAxis(output, from2, to2, p) {
|
|
7454
|
+
output.min = mixNumber$1(from2.min, to2.min, p);
|
|
7455
|
+
output.max = mixNumber$1(from2.max, to2.max, p);
|
|
7455
7456
|
}
|
|
7456
|
-
function mixBox(output,
|
|
7457
|
-
mixAxis(output.x,
|
|
7458
|
-
mixAxis(output.y,
|
|
7457
|
+
function mixBox(output, from2, to2, p) {
|
|
7458
|
+
mixAxis(output.x, from2.x, to2.x, p);
|
|
7459
|
+
mixAxis(output.y, from2.y, to2.y, p);
|
|
7459
7460
|
}
|
|
7460
7461
|
function hasOpacityCrossfade(node) {
|
|
7461
7462
|
return node.animationValues && node.animationValues.opacityExit !== void 0;
|
|
@@ -7781,5 +7782,4502 @@ const CustomTransition = ({
|
|
|
7781
7782
|
}
|
|
7782
7783
|
);
|
|
7783
7784
|
};
|
|
7785
|
+
const MountedTeleport = ({
|
|
7786
|
+
to: to2,
|
|
7787
|
+
children,
|
|
7788
|
+
disabled = false
|
|
7789
|
+
}) => {
|
|
7790
|
+
const [isMounted, setIsMounted] = React.useState(false);
|
|
7791
|
+
const [targetElement, setTargetElement] = React.useState(null);
|
|
7792
|
+
React.useEffect(() => {
|
|
7793
|
+
setIsMounted(true);
|
|
7794
|
+
return () => {
|
|
7795
|
+
setIsMounted(false);
|
|
7796
|
+
};
|
|
7797
|
+
}, []);
|
|
7798
|
+
React.useEffect(() => {
|
|
7799
|
+
if (!isMounted || disabled) {
|
|
7800
|
+
setTargetElement(null);
|
|
7801
|
+
return;
|
|
7802
|
+
}
|
|
7803
|
+
let target = null;
|
|
7804
|
+
if (typeof to2 === "string") {
|
|
7805
|
+
target = document.querySelector(to2);
|
|
7806
|
+
if (!target) {
|
|
7807
|
+
console.warn(
|
|
7808
|
+
`MountedTeleport: Target element not found for selector "${to2}"`
|
|
7809
|
+
);
|
|
7810
|
+
setTargetElement(null);
|
|
7811
|
+
return;
|
|
7812
|
+
}
|
|
7813
|
+
} else if (to2 instanceof HTMLElement) {
|
|
7814
|
+
target = to2;
|
|
7815
|
+
} else {
|
|
7816
|
+
console.warn(
|
|
7817
|
+
"MountedTeleport: Invalid target type. Expected string selector or HTMLElement."
|
|
7818
|
+
);
|
|
7819
|
+
setTargetElement(null);
|
|
7820
|
+
return;
|
|
7821
|
+
}
|
|
7822
|
+
setTargetElement(target);
|
|
7823
|
+
}, [to2, isMounted, disabled]);
|
|
7824
|
+
if (!isMounted || disabled || !targetElement) {
|
|
7825
|
+
return null;
|
|
7826
|
+
}
|
|
7827
|
+
return reactDom.createPortal(children, targetElement);
|
|
7828
|
+
};
|
|
7829
|
+
const ReadMore = ({
|
|
7830
|
+
moreStr = "Read more",
|
|
7831
|
+
lessStr = "Read less",
|
|
7832
|
+
link = "#",
|
|
7833
|
+
maxChars = 100,
|
|
7834
|
+
text,
|
|
7835
|
+
className = "",
|
|
7836
|
+
linkClassName = ""
|
|
7837
|
+
}) => {
|
|
7838
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
7839
|
+
const formattedText = () => {
|
|
7840
|
+
if (!isExpanded && text.length > maxChars) {
|
|
7841
|
+
return text.substring(0, maxChars).trim() + "...";
|
|
7842
|
+
}
|
|
7843
|
+
return text;
|
|
7844
|
+
};
|
|
7845
|
+
const handleToggle = (event) => {
|
|
7846
|
+
event.preventDefault();
|
|
7847
|
+
setIsExpanded(!isExpanded);
|
|
7848
|
+
};
|
|
7849
|
+
if (!text) {
|
|
7850
|
+
return null;
|
|
7851
|
+
}
|
|
7852
|
+
const shouldShowToggle = text.length > maxChars;
|
|
7853
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className, children: [
|
|
7854
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formattedText() }),
|
|
7855
|
+
shouldShowToggle && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7856
|
+
" ",
|
|
7857
|
+
!isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7858
|
+
"a",
|
|
7859
|
+
{
|
|
7860
|
+
href: link,
|
|
7861
|
+
onClick: handleToggle,
|
|
7862
|
+
className: linkClassName,
|
|
7863
|
+
role: "button",
|
|
7864
|
+
tabIndex: 0,
|
|
7865
|
+
onKeyDown: (e) => {
|
|
7866
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7867
|
+
e.preventDefault();
|
|
7868
|
+
setIsExpanded(true);
|
|
7869
|
+
}
|
|
7870
|
+
},
|
|
7871
|
+
children: moreStr
|
|
7872
|
+
}
|
|
7873
|
+
) : lessStr && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7874
|
+
"a",
|
|
7875
|
+
{
|
|
7876
|
+
href: link,
|
|
7877
|
+
onClick: handleToggle,
|
|
7878
|
+
className: linkClassName,
|
|
7879
|
+
role: "button",
|
|
7880
|
+
tabIndex: 0,
|
|
7881
|
+
onKeyDown: (e) => {
|
|
7882
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7883
|
+
e.preventDefault();
|
|
7884
|
+
setIsExpanded(false);
|
|
7885
|
+
}
|
|
7886
|
+
},
|
|
7887
|
+
children: lessStr
|
|
7888
|
+
}
|
|
7889
|
+
)
|
|
7890
|
+
] })
|
|
7891
|
+
] });
|
|
7892
|
+
};
|
|
7893
|
+
const StickyBottom = ({
|
|
7894
|
+
bottom = 0,
|
|
7895
|
+
zIndex = 1,
|
|
7896
|
+
className = "",
|
|
7897
|
+
children = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Sticky Bottom" })
|
|
7898
|
+
}) => {
|
|
7899
|
+
const elRef = React.useRef(null);
|
|
7900
|
+
const [isSticky, setIsSticky] = React.useState(false);
|
|
7901
|
+
const [width, setWidth] = React.useState("auto");
|
|
7902
|
+
const [height, setHeight] = React.useState("auto");
|
|
7903
|
+
React.useEffect(() => {
|
|
7904
|
+
const handleScroll = () => {
|
|
7905
|
+
if (!elRef.current) return;
|
|
7906
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7907
|
+
const viewportHeight = window.innerHeight;
|
|
7908
|
+
const shouldStick = rect.bottom <= viewportHeight - bottom;
|
|
7909
|
+
if (shouldStick && !isSticky) {
|
|
7910
|
+
setWidth(rect.width + "px");
|
|
7911
|
+
setHeight(rect.height + "px");
|
|
7912
|
+
setIsSticky(true);
|
|
7913
|
+
} else if (!shouldStick && isSticky) {
|
|
7914
|
+
setIsSticky(false);
|
|
7915
|
+
setWidth("auto");
|
|
7916
|
+
}
|
|
7917
|
+
};
|
|
7918
|
+
const handleResize = () => {
|
|
7919
|
+
if (!isSticky && elRef.current) {
|
|
7920
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7921
|
+
setHeight(rect.height + "px");
|
|
7922
|
+
}
|
|
7923
|
+
};
|
|
7924
|
+
if (elRef.current) {
|
|
7925
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7926
|
+
setHeight(rect.height + "px");
|
|
7927
|
+
}
|
|
7928
|
+
window.addEventListener("scroll", handleScroll);
|
|
7929
|
+
window.addEventListener("resize", handleResize);
|
|
7930
|
+
handleScroll();
|
|
7931
|
+
return () => {
|
|
7932
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7933
|
+
window.removeEventListener("resize", handleResize);
|
|
7934
|
+
};
|
|
7935
|
+
}, [bottom, isSticky]);
|
|
7936
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7937
|
+
"div",
|
|
7938
|
+
{
|
|
7939
|
+
ref: elRef,
|
|
7940
|
+
style: {
|
|
7941
|
+
height: isSticky ? height : "auto",
|
|
7942
|
+
zIndex
|
|
7943
|
+
},
|
|
7944
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7945
|
+
"div",
|
|
7946
|
+
{
|
|
7947
|
+
className,
|
|
7948
|
+
style: {
|
|
7949
|
+
position: isSticky ? "fixed" : "static",
|
|
7950
|
+
bottom: isSticky ? `${bottom}px` : "auto",
|
|
7951
|
+
width: isSticky ? width : "auto",
|
|
7952
|
+
zIndex
|
|
7953
|
+
},
|
|
7954
|
+
children
|
|
7955
|
+
}
|
|
7956
|
+
)
|
|
7957
|
+
}
|
|
7958
|
+
);
|
|
7959
|
+
};
|
|
7960
|
+
const StickyTop = ({
|
|
7961
|
+
top = 0,
|
|
7962
|
+
zIndex = 1,
|
|
7963
|
+
className = "",
|
|
7964
|
+
children = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Sticky Top" })
|
|
7965
|
+
}) => {
|
|
7966
|
+
const elRef = React.useRef(null);
|
|
7967
|
+
const [isSticky, setIsSticky] = React.useState(false);
|
|
7968
|
+
const [width, setWidth] = React.useState("auto");
|
|
7969
|
+
const [height, setHeight] = React.useState("auto");
|
|
7970
|
+
React.useEffect(() => {
|
|
7971
|
+
const handleScroll = () => {
|
|
7972
|
+
if (!elRef.current) return;
|
|
7973
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7974
|
+
const shouldStick = rect.top <= top;
|
|
7975
|
+
if (shouldStick && !isSticky) {
|
|
7976
|
+
setWidth(rect.width + "px");
|
|
7977
|
+
setHeight(rect.height + "px");
|
|
7978
|
+
setIsSticky(true);
|
|
7979
|
+
} else if (!shouldStick && isSticky) {
|
|
7980
|
+
setIsSticky(false);
|
|
7981
|
+
setWidth("auto");
|
|
7982
|
+
}
|
|
7983
|
+
};
|
|
7984
|
+
const handleResize = () => {
|
|
7985
|
+
if (!isSticky && elRef.current) {
|
|
7986
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7987
|
+
setHeight(rect.height + "px");
|
|
7988
|
+
}
|
|
7989
|
+
};
|
|
7990
|
+
if (elRef.current) {
|
|
7991
|
+
const rect = elRef.current.getBoundingClientRect();
|
|
7992
|
+
setHeight(rect.height + "px");
|
|
7993
|
+
}
|
|
7994
|
+
window.addEventListener("scroll", handleScroll);
|
|
7995
|
+
window.addEventListener("resize", handleResize);
|
|
7996
|
+
handleScroll();
|
|
7997
|
+
return () => {
|
|
7998
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7999
|
+
window.removeEventListener("resize", handleResize);
|
|
8000
|
+
};
|
|
8001
|
+
}, [top, isSticky]);
|
|
8002
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8003
|
+
"div",
|
|
8004
|
+
{
|
|
8005
|
+
ref: elRef,
|
|
8006
|
+
style: {
|
|
8007
|
+
height: isSticky ? height : "auto",
|
|
8008
|
+
zIndex
|
|
8009
|
+
},
|
|
8010
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8011
|
+
"div",
|
|
8012
|
+
{
|
|
8013
|
+
className,
|
|
8014
|
+
style: {
|
|
8015
|
+
position: isSticky ? "fixed" : "static",
|
|
8016
|
+
top: isSticky ? `${top}px` : "auto",
|
|
8017
|
+
width: isSticky ? width : "auto",
|
|
8018
|
+
zIndex
|
|
8019
|
+
},
|
|
8020
|
+
children
|
|
8021
|
+
}
|
|
8022
|
+
)
|
|
8023
|
+
}
|
|
8024
|
+
);
|
|
8025
|
+
};
|
|
8026
|
+
var MediaFileType;
|
|
8027
|
+
(function(MediaFileType2) {
|
|
8028
|
+
MediaFileType2[MediaFileType2["DOCUMENT"] = 1] = "DOCUMENT";
|
|
8029
|
+
MediaFileType2[MediaFileType2["IMAGE"] = 2] = "IMAGE";
|
|
8030
|
+
MediaFileType2[MediaFileType2["VIDEO"] = 3] = "VIDEO";
|
|
8031
|
+
MediaFileType2[MediaFileType2["AUDIO"] = 4] = "AUDIO";
|
|
8032
|
+
MediaFileType2[MediaFileType2["OTHER"] = 5] = "OTHER";
|
|
8033
|
+
})(MediaFileType || (MediaFileType = {}));
|
|
8034
|
+
var NewsArticleStatus;
|
|
8035
|
+
(function(NewsArticleStatus2) {
|
|
8036
|
+
NewsArticleStatus2[NewsArticleStatus2["DRAFT"] = 1] = "DRAFT";
|
|
8037
|
+
NewsArticleStatus2[NewsArticleStatus2["PENDING"] = 2] = "PENDING";
|
|
8038
|
+
NewsArticleStatus2[NewsArticleStatus2["PUBLISHED"] = 3] = "PUBLISHED";
|
|
8039
|
+
NewsArticleStatus2[NewsArticleStatus2["TRASH"] = 4] = "TRASH";
|
|
8040
|
+
})(NewsArticleStatus || (NewsArticleStatus = {}));
|
|
8041
|
+
var VideoDisplayType;
|
|
8042
|
+
(function(VideoDisplayType2) {
|
|
8043
|
+
VideoDisplayType2["VERTICAL"] = "vertical";
|
|
8044
|
+
VideoDisplayType2["HORIZONTAL"] = "horizontal";
|
|
8045
|
+
})(VideoDisplayType || (VideoDisplayType = {}));
|
|
8046
|
+
var VideoItemSource;
|
|
8047
|
+
(function(VideoItemSource2) {
|
|
8048
|
+
VideoItemSource2["SELF_HOSTED"] = "self-hosted";
|
|
8049
|
+
VideoItemSource2["YOUTUBE"] = "youtube";
|
|
8050
|
+
})(VideoItemSource || (VideoItemSource = {}));
|
|
8051
|
+
function slideToId(id2) {
|
|
8052
|
+
const element = document.getElementById(id2);
|
|
8053
|
+
if (element) {
|
|
8054
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
8055
|
+
} else {
|
|
8056
|
+
console.error(`Element with ID "${id2}" not found.`);
|
|
8057
|
+
}
|
|
8058
|
+
}
|
|
8059
|
+
//! moment.js
|
|
8060
|
+
//! version : 2.30.1
|
|
8061
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
8062
|
+
//! license : MIT
|
|
8063
|
+
//! momentjs.com
|
|
8064
|
+
var hookCallback;
|
|
8065
|
+
function hooks() {
|
|
8066
|
+
return hookCallback.apply(null, arguments);
|
|
8067
|
+
}
|
|
8068
|
+
function setHookCallback(callback) {
|
|
8069
|
+
hookCallback = callback;
|
|
8070
|
+
}
|
|
8071
|
+
function isArray(input) {
|
|
8072
|
+
return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
|
|
8073
|
+
}
|
|
8074
|
+
function isObject(input) {
|
|
8075
|
+
return input != null && Object.prototype.toString.call(input) === "[object Object]";
|
|
8076
|
+
}
|
|
8077
|
+
function hasOwnProp(a, b) {
|
|
8078
|
+
return Object.prototype.hasOwnProperty.call(a, b);
|
|
8079
|
+
}
|
|
8080
|
+
function isObjectEmpty(obj) {
|
|
8081
|
+
if (Object.getOwnPropertyNames) {
|
|
8082
|
+
return Object.getOwnPropertyNames(obj).length === 0;
|
|
8083
|
+
} else {
|
|
8084
|
+
var k;
|
|
8085
|
+
for (k in obj) {
|
|
8086
|
+
if (hasOwnProp(obj, k)) {
|
|
8087
|
+
return false;
|
|
8088
|
+
}
|
|
8089
|
+
}
|
|
8090
|
+
return true;
|
|
8091
|
+
}
|
|
8092
|
+
}
|
|
8093
|
+
function isUndefined(input) {
|
|
8094
|
+
return input === void 0;
|
|
8095
|
+
}
|
|
8096
|
+
function isNumber(input) {
|
|
8097
|
+
return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
|
|
8098
|
+
}
|
|
8099
|
+
function isDate(input) {
|
|
8100
|
+
return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
|
|
8101
|
+
}
|
|
8102
|
+
function map(arr, fn) {
|
|
8103
|
+
var res = [], i, arrLen = arr.length;
|
|
8104
|
+
for (i = 0; i < arrLen; ++i) {
|
|
8105
|
+
res.push(fn(arr[i], i));
|
|
8106
|
+
}
|
|
8107
|
+
return res;
|
|
8108
|
+
}
|
|
8109
|
+
function extend(a, b) {
|
|
8110
|
+
for (var i in b) {
|
|
8111
|
+
if (hasOwnProp(b, i)) {
|
|
8112
|
+
a[i] = b[i];
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
if (hasOwnProp(b, "toString")) {
|
|
8116
|
+
a.toString = b.toString;
|
|
8117
|
+
}
|
|
8118
|
+
if (hasOwnProp(b, "valueOf")) {
|
|
8119
|
+
a.valueOf = b.valueOf;
|
|
8120
|
+
}
|
|
8121
|
+
return a;
|
|
8122
|
+
}
|
|
8123
|
+
function createUTC(input, format2, locale2, strict) {
|
|
8124
|
+
return createLocalOrUTC(input, format2, locale2, strict, true).utc();
|
|
8125
|
+
}
|
|
8126
|
+
function defaultParsingFlags() {
|
|
8127
|
+
return {
|
|
8128
|
+
empty: false,
|
|
8129
|
+
unusedTokens: [],
|
|
8130
|
+
unusedInput: [],
|
|
8131
|
+
overflow: -2,
|
|
8132
|
+
charsLeftOver: 0,
|
|
8133
|
+
nullInput: false,
|
|
8134
|
+
invalidEra: null,
|
|
8135
|
+
invalidMonth: null,
|
|
8136
|
+
invalidFormat: false,
|
|
8137
|
+
userInvalidated: false,
|
|
8138
|
+
iso: false,
|
|
8139
|
+
parsedDateParts: [],
|
|
8140
|
+
era: null,
|
|
8141
|
+
meridiem: null,
|
|
8142
|
+
rfc2822: false,
|
|
8143
|
+
weekdayMismatch: false
|
|
8144
|
+
};
|
|
8145
|
+
}
|
|
8146
|
+
function getParsingFlags(m) {
|
|
8147
|
+
if (m._pf == null) {
|
|
8148
|
+
m._pf = defaultParsingFlags();
|
|
8149
|
+
}
|
|
8150
|
+
return m._pf;
|
|
8151
|
+
}
|
|
8152
|
+
var some;
|
|
8153
|
+
if (Array.prototype.some) {
|
|
8154
|
+
some = Array.prototype.some;
|
|
8155
|
+
} else {
|
|
8156
|
+
some = function(fun) {
|
|
8157
|
+
var t = Object(this), len = t.length >>> 0, i;
|
|
8158
|
+
for (i = 0; i < len; i++) {
|
|
8159
|
+
if (i in t && fun.call(this, t[i], i, t)) {
|
|
8160
|
+
return true;
|
|
8161
|
+
}
|
|
8162
|
+
}
|
|
8163
|
+
return false;
|
|
8164
|
+
};
|
|
8165
|
+
}
|
|
8166
|
+
function isValid(m) {
|
|
8167
|
+
var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
|
|
8168
|
+
if (isNowValid) {
|
|
8169
|
+
flags = getParsingFlags(m);
|
|
8170
|
+
parsedParts = some.call(flags.parsedDateParts, function(i) {
|
|
8171
|
+
return i != null;
|
|
8172
|
+
});
|
|
8173
|
+
isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
|
8174
|
+
if (m._strict) {
|
|
8175
|
+
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8178
|
+
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
|
8179
|
+
m._isValid = isNowValid;
|
|
8180
|
+
} else {
|
|
8181
|
+
return isNowValid;
|
|
8182
|
+
}
|
|
8183
|
+
return m._isValid;
|
|
8184
|
+
}
|
|
8185
|
+
function createInvalid(flags) {
|
|
8186
|
+
var m = createUTC(NaN);
|
|
8187
|
+
if (flags != null) {
|
|
8188
|
+
extend(getParsingFlags(m), flags);
|
|
8189
|
+
} else {
|
|
8190
|
+
getParsingFlags(m).userInvalidated = true;
|
|
8191
|
+
}
|
|
8192
|
+
return m;
|
|
8193
|
+
}
|
|
8194
|
+
var momentProperties = hooks.momentProperties = [], updateInProgress = false;
|
|
8195
|
+
function copyConfig(to2, from2) {
|
|
8196
|
+
var i, prop, val, momentPropertiesLen = momentProperties.length;
|
|
8197
|
+
if (!isUndefined(from2._isAMomentObject)) {
|
|
8198
|
+
to2._isAMomentObject = from2._isAMomentObject;
|
|
8199
|
+
}
|
|
8200
|
+
if (!isUndefined(from2._i)) {
|
|
8201
|
+
to2._i = from2._i;
|
|
8202
|
+
}
|
|
8203
|
+
if (!isUndefined(from2._f)) {
|
|
8204
|
+
to2._f = from2._f;
|
|
8205
|
+
}
|
|
8206
|
+
if (!isUndefined(from2._l)) {
|
|
8207
|
+
to2._l = from2._l;
|
|
8208
|
+
}
|
|
8209
|
+
if (!isUndefined(from2._strict)) {
|
|
8210
|
+
to2._strict = from2._strict;
|
|
8211
|
+
}
|
|
8212
|
+
if (!isUndefined(from2._tzm)) {
|
|
8213
|
+
to2._tzm = from2._tzm;
|
|
8214
|
+
}
|
|
8215
|
+
if (!isUndefined(from2._isUTC)) {
|
|
8216
|
+
to2._isUTC = from2._isUTC;
|
|
8217
|
+
}
|
|
8218
|
+
if (!isUndefined(from2._offset)) {
|
|
8219
|
+
to2._offset = from2._offset;
|
|
8220
|
+
}
|
|
8221
|
+
if (!isUndefined(from2._pf)) {
|
|
8222
|
+
to2._pf = getParsingFlags(from2);
|
|
8223
|
+
}
|
|
8224
|
+
if (!isUndefined(from2._locale)) {
|
|
8225
|
+
to2._locale = from2._locale;
|
|
8226
|
+
}
|
|
8227
|
+
if (momentPropertiesLen > 0) {
|
|
8228
|
+
for (i = 0; i < momentPropertiesLen; i++) {
|
|
8229
|
+
prop = momentProperties[i];
|
|
8230
|
+
val = from2[prop];
|
|
8231
|
+
if (!isUndefined(val)) {
|
|
8232
|
+
to2[prop] = val;
|
|
8233
|
+
}
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
return to2;
|
|
8237
|
+
}
|
|
8238
|
+
function Moment(config) {
|
|
8239
|
+
copyConfig(this, config);
|
|
8240
|
+
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
|
8241
|
+
if (!this.isValid()) {
|
|
8242
|
+
this._d = /* @__PURE__ */ new Date(NaN);
|
|
8243
|
+
}
|
|
8244
|
+
if (updateInProgress === false) {
|
|
8245
|
+
updateInProgress = true;
|
|
8246
|
+
hooks.updateOffset(this);
|
|
8247
|
+
updateInProgress = false;
|
|
8248
|
+
}
|
|
8249
|
+
}
|
|
8250
|
+
function isMoment(obj) {
|
|
8251
|
+
return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
|
|
8252
|
+
}
|
|
8253
|
+
function warn(msg) {
|
|
8254
|
+
if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
|
|
8255
|
+
console.warn("Deprecation warning: " + msg);
|
|
8256
|
+
}
|
|
8257
|
+
}
|
|
8258
|
+
function deprecate(msg, fn) {
|
|
8259
|
+
var firstTime = true;
|
|
8260
|
+
return extend(function() {
|
|
8261
|
+
if (hooks.deprecationHandler != null) {
|
|
8262
|
+
hooks.deprecationHandler(null, msg);
|
|
8263
|
+
}
|
|
8264
|
+
if (firstTime) {
|
|
8265
|
+
var args = [], arg, i, key, argLen = arguments.length;
|
|
8266
|
+
for (i = 0; i < argLen; i++) {
|
|
8267
|
+
arg = "";
|
|
8268
|
+
if (typeof arguments[i] === "object") {
|
|
8269
|
+
arg += "\n[" + i + "] ";
|
|
8270
|
+
for (key in arguments[0]) {
|
|
8271
|
+
if (hasOwnProp(arguments[0], key)) {
|
|
8272
|
+
arg += key + ": " + arguments[0][key] + ", ";
|
|
8273
|
+
}
|
|
8274
|
+
}
|
|
8275
|
+
arg = arg.slice(0, -2);
|
|
8276
|
+
} else {
|
|
8277
|
+
arg = arguments[i];
|
|
8278
|
+
}
|
|
8279
|
+
args.push(arg);
|
|
8280
|
+
}
|
|
8281
|
+
warn(
|
|
8282
|
+
msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
|
|
8283
|
+
);
|
|
8284
|
+
firstTime = false;
|
|
8285
|
+
}
|
|
8286
|
+
return fn.apply(this, arguments);
|
|
8287
|
+
}, fn);
|
|
8288
|
+
}
|
|
8289
|
+
var deprecations = {};
|
|
8290
|
+
function deprecateSimple(name, msg) {
|
|
8291
|
+
if (hooks.deprecationHandler != null) {
|
|
8292
|
+
hooks.deprecationHandler(name, msg);
|
|
8293
|
+
}
|
|
8294
|
+
if (!deprecations[name]) {
|
|
8295
|
+
warn(msg);
|
|
8296
|
+
deprecations[name] = true;
|
|
8297
|
+
}
|
|
8298
|
+
}
|
|
8299
|
+
hooks.suppressDeprecationWarnings = false;
|
|
8300
|
+
hooks.deprecationHandler = null;
|
|
8301
|
+
function isFunction(input) {
|
|
8302
|
+
return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
|
|
8303
|
+
}
|
|
8304
|
+
function set(config) {
|
|
8305
|
+
var prop, i;
|
|
8306
|
+
for (i in config) {
|
|
8307
|
+
if (hasOwnProp(config, i)) {
|
|
8308
|
+
prop = config[i];
|
|
8309
|
+
if (isFunction(prop)) {
|
|
8310
|
+
this[i] = prop;
|
|
8311
|
+
} else {
|
|
8312
|
+
this["_" + i] = prop;
|
|
8313
|
+
}
|
|
8314
|
+
}
|
|
8315
|
+
}
|
|
8316
|
+
this._config = config;
|
|
8317
|
+
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
|
8318
|
+
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
|
|
8319
|
+
);
|
|
8320
|
+
}
|
|
8321
|
+
function mergeConfigs(parentConfig, childConfig) {
|
|
8322
|
+
var res = extend({}, parentConfig), prop;
|
|
8323
|
+
for (prop in childConfig) {
|
|
8324
|
+
if (hasOwnProp(childConfig, prop)) {
|
|
8325
|
+
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
|
8326
|
+
res[prop] = {};
|
|
8327
|
+
extend(res[prop], parentConfig[prop]);
|
|
8328
|
+
extend(res[prop], childConfig[prop]);
|
|
8329
|
+
} else if (childConfig[prop] != null) {
|
|
8330
|
+
res[prop] = childConfig[prop];
|
|
8331
|
+
} else {
|
|
8332
|
+
delete res[prop];
|
|
8333
|
+
}
|
|
8334
|
+
}
|
|
8335
|
+
}
|
|
8336
|
+
for (prop in parentConfig) {
|
|
8337
|
+
if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
|
8338
|
+
res[prop] = extend({}, res[prop]);
|
|
8339
|
+
}
|
|
8340
|
+
}
|
|
8341
|
+
return res;
|
|
8342
|
+
}
|
|
8343
|
+
function Locale(config) {
|
|
8344
|
+
if (config != null) {
|
|
8345
|
+
this.set(config);
|
|
8346
|
+
}
|
|
8347
|
+
}
|
|
8348
|
+
var keys;
|
|
8349
|
+
if (Object.keys) {
|
|
8350
|
+
keys = Object.keys;
|
|
8351
|
+
} else {
|
|
8352
|
+
keys = function(obj) {
|
|
8353
|
+
var i, res = [];
|
|
8354
|
+
for (i in obj) {
|
|
8355
|
+
if (hasOwnProp(obj, i)) {
|
|
8356
|
+
res.push(i);
|
|
8357
|
+
}
|
|
8358
|
+
}
|
|
8359
|
+
return res;
|
|
8360
|
+
};
|
|
8361
|
+
}
|
|
8362
|
+
var defaultCalendar = {
|
|
8363
|
+
sameDay: "[Today at] LT",
|
|
8364
|
+
nextDay: "[Tomorrow at] LT",
|
|
8365
|
+
nextWeek: "dddd [at] LT",
|
|
8366
|
+
lastDay: "[Yesterday at] LT",
|
|
8367
|
+
lastWeek: "[Last] dddd [at] LT",
|
|
8368
|
+
sameElse: "L"
|
|
8369
|
+
};
|
|
8370
|
+
function calendar(key, mom, now2) {
|
|
8371
|
+
var output = this._calendar[key] || this._calendar["sameElse"];
|
|
8372
|
+
return isFunction(output) ? output.call(mom, now2) : output;
|
|
8373
|
+
}
|
|
8374
|
+
function zeroFill(number2, targetLength, forceSign) {
|
|
8375
|
+
var absNumber = "" + Math.abs(number2), zerosToFill = targetLength - absNumber.length, sign2 = number2 >= 0;
|
|
8376
|
+
return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
|
8377
|
+
}
|
|
8378
|
+
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
|
|
8379
|
+
function addFormatToken(token2, padded, ordinal2, callback) {
|
|
8380
|
+
var func = callback;
|
|
8381
|
+
if (typeof callback === "string") {
|
|
8382
|
+
func = function() {
|
|
8383
|
+
return this[callback]();
|
|
8384
|
+
};
|
|
8385
|
+
}
|
|
8386
|
+
if (token2) {
|
|
8387
|
+
formatTokenFunctions[token2] = func;
|
|
8388
|
+
}
|
|
8389
|
+
if (padded) {
|
|
8390
|
+
formatTokenFunctions[padded[0]] = function() {
|
|
8391
|
+
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
|
8392
|
+
};
|
|
8393
|
+
}
|
|
8394
|
+
if (ordinal2) {
|
|
8395
|
+
formatTokenFunctions[ordinal2] = function() {
|
|
8396
|
+
return this.localeData().ordinal(
|
|
8397
|
+
func.apply(this, arguments),
|
|
8398
|
+
token2
|
|
8399
|
+
);
|
|
8400
|
+
};
|
|
8401
|
+
}
|
|
8402
|
+
}
|
|
8403
|
+
function removeFormattingTokens(input) {
|
|
8404
|
+
if (input.match(/\[[\s\S]/)) {
|
|
8405
|
+
return input.replace(/^\[|\]$/g, "");
|
|
8406
|
+
}
|
|
8407
|
+
return input.replace(/\\/g, "");
|
|
8408
|
+
}
|
|
8409
|
+
function makeFormatFunction(format2) {
|
|
8410
|
+
var array = format2.match(formattingTokens), i, length;
|
|
8411
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
8412
|
+
if (formatTokenFunctions[array[i]]) {
|
|
8413
|
+
array[i] = formatTokenFunctions[array[i]];
|
|
8414
|
+
} else {
|
|
8415
|
+
array[i] = removeFormattingTokens(array[i]);
|
|
8416
|
+
}
|
|
8417
|
+
}
|
|
8418
|
+
return function(mom) {
|
|
8419
|
+
var output = "", i2;
|
|
8420
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
8421
|
+
output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2];
|
|
8422
|
+
}
|
|
8423
|
+
return output;
|
|
8424
|
+
};
|
|
8425
|
+
}
|
|
8426
|
+
function formatMoment(m, format2) {
|
|
8427
|
+
if (!m.isValid()) {
|
|
8428
|
+
return m.localeData().invalidDate();
|
|
8429
|
+
}
|
|
8430
|
+
format2 = expandFormat(format2, m.localeData());
|
|
8431
|
+
formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
|
|
8432
|
+
return formatFunctions[format2](m);
|
|
8433
|
+
}
|
|
8434
|
+
function expandFormat(format2, locale2) {
|
|
8435
|
+
var i = 5;
|
|
8436
|
+
function replaceLongDateFormatTokens(input) {
|
|
8437
|
+
return locale2.longDateFormat(input) || input;
|
|
8438
|
+
}
|
|
8439
|
+
localFormattingTokens.lastIndex = 0;
|
|
8440
|
+
while (i >= 0 && localFormattingTokens.test(format2)) {
|
|
8441
|
+
format2 = format2.replace(
|
|
8442
|
+
localFormattingTokens,
|
|
8443
|
+
replaceLongDateFormatTokens
|
|
8444
|
+
);
|
|
8445
|
+
localFormattingTokens.lastIndex = 0;
|
|
8446
|
+
i -= 1;
|
|
8447
|
+
}
|
|
8448
|
+
return format2;
|
|
8449
|
+
}
|
|
8450
|
+
var defaultLongDateFormat = {
|
|
8451
|
+
LTS: "h:mm:ss A",
|
|
8452
|
+
LT: "h:mm A",
|
|
8453
|
+
L: "MM/DD/YYYY",
|
|
8454
|
+
LL: "MMMM D, YYYY",
|
|
8455
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
8456
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
8457
|
+
};
|
|
8458
|
+
function longDateFormat(key) {
|
|
8459
|
+
var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
|
|
8460
|
+
if (format2 || !formatUpper) {
|
|
8461
|
+
return format2;
|
|
8462
|
+
}
|
|
8463
|
+
this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
|
|
8464
|
+
if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
|
|
8465
|
+
return tok.slice(1);
|
|
8466
|
+
}
|
|
8467
|
+
return tok;
|
|
8468
|
+
}).join("");
|
|
8469
|
+
return this._longDateFormat[key];
|
|
8470
|
+
}
|
|
8471
|
+
var defaultInvalidDate = "Invalid date";
|
|
8472
|
+
function invalidDate() {
|
|
8473
|
+
return this._invalidDate;
|
|
8474
|
+
}
|
|
8475
|
+
var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
|
8476
|
+
function ordinal(number2) {
|
|
8477
|
+
return this._ordinal.replace("%d", number2);
|
|
8478
|
+
}
|
|
8479
|
+
var defaultRelativeTime = {
|
|
8480
|
+
future: "in %s",
|
|
8481
|
+
past: "%s ago",
|
|
8482
|
+
s: "a few seconds",
|
|
8483
|
+
ss: "%d seconds",
|
|
8484
|
+
m: "a minute",
|
|
8485
|
+
mm: "%d minutes",
|
|
8486
|
+
h: "an hour",
|
|
8487
|
+
hh: "%d hours",
|
|
8488
|
+
d: "a day",
|
|
8489
|
+
dd: "%d days",
|
|
8490
|
+
w: "a week",
|
|
8491
|
+
ww: "%d weeks",
|
|
8492
|
+
M: "a month",
|
|
8493
|
+
MM: "%d months",
|
|
8494
|
+
y: "a year",
|
|
8495
|
+
yy: "%d years"
|
|
8496
|
+
};
|
|
8497
|
+
function relativeTime(number2, withoutSuffix, string, isFuture) {
|
|
8498
|
+
var output = this._relativeTime[string];
|
|
8499
|
+
return isFunction(output) ? output(number2, withoutSuffix, string, isFuture) : output.replace(/%d/i, number2);
|
|
8500
|
+
}
|
|
8501
|
+
function pastFuture(diff2, output) {
|
|
8502
|
+
var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
|
|
8503
|
+
return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
|
|
8504
|
+
}
|
|
8505
|
+
var aliases = {
|
|
8506
|
+
D: "date",
|
|
8507
|
+
dates: "date",
|
|
8508
|
+
date: "date",
|
|
8509
|
+
d: "day",
|
|
8510
|
+
days: "day",
|
|
8511
|
+
day: "day",
|
|
8512
|
+
e: "weekday",
|
|
8513
|
+
weekdays: "weekday",
|
|
8514
|
+
weekday: "weekday",
|
|
8515
|
+
E: "isoWeekday",
|
|
8516
|
+
isoweekdays: "isoWeekday",
|
|
8517
|
+
isoweekday: "isoWeekday",
|
|
8518
|
+
DDD: "dayOfYear",
|
|
8519
|
+
dayofyears: "dayOfYear",
|
|
8520
|
+
dayofyear: "dayOfYear",
|
|
8521
|
+
h: "hour",
|
|
8522
|
+
hours: "hour",
|
|
8523
|
+
hour: "hour",
|
|
8524
|
+
ms: "millisecond",
|
|
8525
|
+
milliseconds: "millisecond",
|
|
8526
|
+
millisecond: "millisecond",
|
|
8527
|
+
m: "minute",
|
|
8528
|
+
minutes: "minute",
|
|
8529
|
+
minute: "minute",
|
|
8530
|
+
M: "month",
|
|
8531
|
+
months: "month",
|
|
8532
|
+
month: "month",
|
|
8533
|
+
Q: "quarter",
|
|
8534
|
+
quarters: "quarter",
|
|
8535
|
+
quarter: "quarter",
|
|
8536
|
+
s: "second",
|
|
8537
|
+
seconds: "second",
|
|
8538
|
+
second: "second",
|
|
8539
|
+
gg: "weekYear",
|
|
8540
|
+
weekyears: "weekYear",
|
|
8541
|
+
weekyear: "weekYear",
|
|
8542
|
+
GG: "isoWeekYear",
|
|
8543
|
+
isoweekyears: "isoWeekYear",
|
|
8544
|
+
isoweekyear: "isoWeekYear",
|
|
8545
|
+
w: "week",
|
|
8546
|
+
weeks: "week",
|
|
8547
|
+
week: "week",
|
|
8548
|
+
W: "isoWeek",
|
|
8549
|
+
isoweeks: "isoWeek",
|
|
8550
|
+
isoweek: "isoWeek",
|
|
8551
|
+
y: "year",
|
|
8552
|
+
years: "year",
|
|
8553
|
+
year: "year"
|
|
8554
|
+
};
|
|
8555
|
+
function normalizeUnits(units) {
|
|
8556
|
+
return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
|
|
8557
|
+
}
|
|
8558
|
+
function normalizeObjectUnits(inputObject) {
|
|
8559
|
+
var normalizedInput = {}, normalizedProp, prop;
|
|
8560
|
+
for (prop in inputObject) {
|
|
8561
|
+
if (hasOwnProp(inputObject, prop)) {
|
|
8562
|
+
normalizedProp = normalizeUnits(prop);
|
|
8563
|
+
if (normalizedProp) {
|
|
8564
|
+
normalizedInput[normalizedProp] = inputObject[prop];
|
|
8565
|
+
}
|
|
8566
|
+
}
|
|
8567
|
+
}
|
|
8568
|
+
return normalizedInput;
|
|
8569
|
+
}
|
|
8570
|
+
var priorities = {
|
|
8571
|
+
date: 9,
|
|
8572
|
+
day: 11,
|
|
8573
|
+
weekday: 11,
|
|
8574
|
+
isoWeekday: 11,
|
|
8575
|
+
dayOfYear: 4,
|
|
8576
|
+
hour: 13,
|
|
8577
|
+
millisecond: 16,
|
|
8578
|
+
minute: 14,
|
|
8579
|
+
month: 8,
|
|
8580
|
+
quarter: 7,
|
|
8581
|
+
second: 15,
|
|
8582
|
+
weekYear: 1,
|
|
8583
|
+
isoWeekYear: 1,
|
|
8584
|
+
week: 5,
|
|
8585
|
+
isoWeek: 5,
|
|
8586
|
+
year: 1
|
|
8587
|
+
};
|
|
8588
|
+
function getPrioritizedUnits(unitsObj) {
|
|
8589
|
+
var units = [], u;
|
|
8590
|
+
for (u in unitsObj) {
|
|
8591
|
+
if (hasOwnProp(unitsObj, u)) {
|
|
8592
|
+
units.push({ unit: u, priority: priorities[u] });
|
|
8593
|
+
}
|
|
8594
|
+
}
|
|
8595
|
+
units.sort(function(a, b) {
|
|
8596
|
+
return a.priority - b.priority;
|
|
8597
|
+
});
|
|
8598
|
+
return units;
|
|
8599
|
+
}
|
|
8600
|
+
var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
|
|
8601
|
+
regexes = {};
|
|
8602
|
+
function addRegexToken(token2, regex, strictRegex) {
|
|
8603
|
+
regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
|
|
8604
|
+
return isStrict && strictRegex ? strictRegex : regex;
|
|
8605
|
+
};
|
|
8606
|
+
}
|
|
8607
|
+
function getParseRegexForToken(token2, config) {
|
|
8608
|
+
if (!hasOwnProp(regexes, token2)) {
|
|
8609
|
+
return new RegExp(unescapeFormat(token2));
|
|
8610
|
+
}
|
|
8611
|
+
return regexes[token2](config._strict, config._locale);
|
|
8612
|
+
}
|
|
8613
|
+
function unescapeFormat(s) {
|
|
8614
|
+
return regexEscape(
|
|
8615
|
+
s.replace("\\", "").replace(
|
|
8616
|
+
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
8617
|
+
function(matched, p1, p2, p3, p4) {
|
|
8618
|
+
return p1 || p2 || p3 || p4;
|
|
8619
|
+
}
|
|
8620
|
+
)
|
|
8621
|
+
);
|
|
8622
|
+
}
|
|
8623
|
+
function regexEscape(s) {
|
|
8624
|
+
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
8625
|
+
}
|
|
8626
|
+
function absFloor(number2) {
|
|
8627
|
+
if (number2 < 0) {
|
|
8628
|
+
return Math.ceil(number2) || 0;
|
|
8629
|
+
} else {
|
|
8630
|
+
return Math.floor(number2);
|
|
8631
|
+
}
|
|
8632
|
+
}
|
|
8633
|
+
function toInt(argumentForCoercion) {
|
|
8634
|
+
var coercedNumber = +argumentForCoercion, value = 0;
|
|
8635
|
+
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
|
8636
|
+
value = absFloor(coercedNumber);
|
|
8637
|
+
}
|
|
8638
|
+
return value;
|
|
8639
|
+
}
|
|
8640
|
+
var tokens = {};
|
|
8641
|
+
function addParseToken(token2, callback) {
|
|
8642
|
+
var i, func = callback, tokenLen;
|
|
8643
|
+
if (typeof token2 === "string") {
|
|
8644
|
+
token2 = [token2];
|
|
8645
|
+
}
|
|
8646
|
+
if (isNumber(callback)) {
|
|
8647
|
+
func = function(input, array) {
|
|
8648
|
+
array[callback] = toInt(input);
|
|
8649
|
+
};
|
|
8650
|
+
}
|
|
8651
|
+
tokenLen = token2.length;
|
|
8652
|
+
for (i = 0; i < tokenLen; i++) {
|
|
8653
|
+
tokens[token2[i]] = func;
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
function addWeekParseToken(token2, callback) {
|
|
8657
|
+
addParseToken(token2, function(input, array, config, token3) {
|
|
8658
|
+
config._w = config._w || {};
|
|
8659
|
+
callback(input, config._w, config, token3);
|
|
8660
|
+
});
|
|
8661
|
+
}
|
|
8662
|
+
function addTimeToArrayFromToken(token2, input, config) {
|
|
8663
|
+
if (input != null && hasOwnProp(tokens, token2)) {
|
|
8664
|
+
tokens[token2](input, config._a, config, token2);
|
|
8665
|
+
}
|
|
8666
|
+
}
|
|
8667
|
+
function isLeapYear(year) {
|
|
8668
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
8669
|
+
}
|
|
8670
|
+
var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
|
|
8671
|
+
addFormatToken("Y", 0, 0, function() {
|
|
8672
|
+
var y = this.year();
|
|
8673
|
+
return y <= 9999 ? zeroFill(y, 4) : "+" + y;
|
|
8674
|
+
});
|
|
8675
|
+
addFormatToken(0, ["YY", 2], 0, function() {
|
|
8676
|
+
return this.year() % 100;
|
|
8677
|
+
});
|
|
8678
|
+
addFormatToken(0, ["YYYY", 4], 0, "year");
|
|
8679
|
+
addFormatToken(0, ["YYYYY", 5], 0, "year");
|
|
8680
|
+
addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
|
|
8681
|
+
addRegexToken("Y", matchSigned);
|
|
8682
|
+
addRegexToken("YY", match1to2, match2);
|
|
8683
|
+
addRegexToken("YYYY", match1to4, match4);
|
|
8684
|
+
addRegexToken("YYYYY", match1to6, match6);
|
|
8685
|
+
addRegexToken("YYYYYY", match1to6, match6);
|
|
8686
|
+
addParseToken(["YYYYY", "YYYYYY"], YEAR);
|
|
8687
|
+
addParseToken("YYYY", function(input, array) {
|
|
8688
|
+
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
|
8689
|
+
});
|
|
8690
|
+
addParseToken("YY", function(input, array) {
|
|
8691
|
+
array[YEAR] = hooks.parseTwoDigitYear(input);
|
|
8692
|
+
});
|
|
8693
|
+
addParseToken("Y", function(input, array) {
|
|
8694
|
+
array[YEAR] = parseInt(input, 10);
|
|
8695
|
+
});
|
|
8696
|
+
function daysInYear(year) {
|
|
8697
|
+
return isLeapYear(year) ? 366 : 365;
|
|
8698
|
+
}
|
|
8699
|
+
hooks.parseTwoDigitYear = function(input) {
|
|
8700
|
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
|
|
8701
|
+
};
|
|
8702
|
+
var getSetYear = makeGetSet("FullYear", true);
|
|
8703
|
+
function getIsLeapYear() {
|
|
8704
|
+
return isLeapYear(this.year());
|
|
8705
|
+
}
|
|
8706
|
+
function makeGetSet(unit, keepTime) {
|
|
8707
|
+
return function(value) {
|
|
8708
|
+
if (value != null) {
|
|
8709
|
+
set$1(this, unit, value);
|
|
8710
|
+
hooks.updateOffset(this, keepTime);
|
|
8711
|
+
return this;
|
|
8712
|
+
} else {
|
|
8713
|
+
return get(this, unit);
|
|
8714
|
+
}
|
|
8715
|
+
};
|
|
8716
|
+
}
|
|
8717
|
+
function get(mom, unit) {
|
|
8718
|
+
if (!mom.isValid()) {
|
|
8719
|
+
return NaN;
|
|
8720
|
+
}
|
|
8721
|
+
var d = mom._d, isUTC = mom._isUTC;
|
|
8722
|
+
switch (unit) {
|
|
8723
|
+
case "Milliseconds":
|
|
8724
|
+
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
8725
|
+
case "Seconds":
|
|
8726
|
+
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
|
8727
|
+
case "Minutes":
|
|
8728
|
+
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
|
8729
|
+
case "Hours":
|
|
8730
|
+
return isUTC ? d.getUTCHours() : d.getHours();
|
|
8731
|
+
case "Date":
|
|
8732
|
+
return isUTC ? d.getUTCDate() : d.getDate();
|
|
8733
|
+
case "Day":
|
|
8734
|
+
return isUTC ? d.getUTCDay() : d.getDay();
|
|
8735
|
+
case "Month":
|
|
8736
|
+
return isUTC ? d.getUTCMonth() : d.getMonth();
|
|
8737
|
+
case "FullYear":
|
|
8738
|
+
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
|
8739
|
+
default:
|
|
8740
|
+
return NaN;
|
|
8741
|
+
}
|
|
8742
|
+
}
|
|
8743
|
+
function set$1(mom, unit, value) {
|
|
8744
|
+
var d, isUTC, year, month, date;
|
|
8745
|
+
if (!mom.isValid() || isNaN(value)) {
|
|
8746
|
+
return;
|
|
8747
|
+
}
|
|
8748
|
+
d = mom._d;
|
|
8749
|
+
isUTC = mom._isUTC;
|
|
8750
|
+
switch (unit) {
|
|
8751
|
+
case "Milliseconds":
|
|
8752
|
+
return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
|
|
8753
|
+
case "Seconds":
|
|
8754
|
+
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
|
8755
|
+
case "Minutes":
|
|
8756
|
+
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
|
8757
|
+
case "Hours":
|
|
8758
|
+
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
|
8759
|
+
case "Date":
|
|
8760
|
+
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
|
8761
|
+
// case 'Day': // Not real
|
|
8762
|
+
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
|
8763
|
+
// case 'Month': // Not used because we need to pass two variables
|
|
8764
|
+
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
|
8765
|
+
case "FullYear":
|
|
8766
|
+
break;
|
|
8767
|
+
// See below ...
|
|
8768
|
+
default:
|
|
8769
|
+
return;
|
|
8770
|
+
}
|
|
8771
|
+
year = value;
|
|
8772
|
+
month = mom.month();
|
|
8773
|
+
date = mom.date();
|
|
8774
|
+
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
|
8775
|
+
void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
|
|
8776
|
+
}
|
|
8777
|
+
function stringGet(units) {
|
|
8778
|
+
units = normalizeUnits(units);
|
|
8779
|
+
if (isFunction(this[units])) {
|
|
8780
|
+
return this[units]();
|
|
8781
|
+
}
|
|
8782
|
+
return this;
|
|
8783
|
+
}
|
|
8784
|
+
function stringSet(units, value) {
|
|
8785
|
+
if (typeof units === "object") {
|
|
8786
|
+
units = normalizeObjectUnits(units);
|
|
8787
|
+
var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
|
|
8788
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
8789
|
+
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
8790
|
+
}
|
|
8791
|
+
} else {
|
|
8792
|
+
units = normalizeUnits(units);
|
|
8793
|
+
if (isFunction(this[units])) {
|
|
8794
|
+
return this[units](value);
|
|
8795
|
+
}
|
|
8796
|
+
}
|
|
8797
|
+
return this;
|
|
8798
|
+
}
|
|
8799
|
+
function mod(n, x) {
|
|
8800
|
+
return (n % x + x) % x;
|
|
8801
|
+
}
|
|
8802
|
+
var indexOf;
|
|
8803
|
+
if (Array.prototype.indexOf) {
|
|
8804
|
+
indexOf = Array.prototype.indexOf;
|
|
8805
|
+
} else {
|
|
8806
|
+
indexOf = function(o) {
|
|
8807
|
+
var i;
|
|
8808
|
+
for (i = 0; i < this.length; ++i) {
|
|
8809
|
+
if (this[i] === o) {
|
|
8810
|
+
return i;
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
return -1;
|
|
8814
|
+
};
|
|
8815
|
+
}
|
|
8816
|
+
function daysInMonth(year, month) {
|
|
8817
|
+
if (isNaN(year) || isNaN(month)) {
|
|
8818
|
+
return NaN;
|
|
8819
|
+
}
|
|
8820
|
+
var modMonth = mod(month, 12);
|
|
8821
|
+
year += (month - modMonth) / 12;
|
|
8822
|
+
return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
|
|
8823
|
+
}
|
|
8824
|
+
addFormatToken("M", ["MM", 2], "Mo", function() {
|
|
8825
|
+
return this.month() + 1;
|
|
8826
|
+
});
|
|
8827
|
+
addFormatToken("MMM", 0, 0, function(format2) {
|
|
8828
|
+
return this.localeData().monthsShort(this, format2);
|
|
8829
|
+
});
|
|
8830
|
+
addFormatToken("MMMM", 0, 0, function(format2) {
|
|
8831
|
+
return this.localeData().months(this, format2);
|
|
8832
|
+
});
|
|
8833
|
+
addRegexToken("M", match1to2, match1to2NoLeadingZero);
|
|
8834
|
+
addRegexToken("MM", match1to2, match2);
|
|
8835
|
+
addRegexToken("MMM", function(isStrict, locale2) {
|
|
8836
|
+
return locale2.monthsShortRegex(isStrict);
|
|
8837
|
+
});
|
|
8838
|
+
addRegexToken("MMMM", function(isStrict, locale2) {
|
|
8839
|
+
return locale2.monthsRegex(isStrict);
|
|
8840
|
+
});
|
|
8841
|
+
addParseToken(["M", "MM"], function(input, array) {
|
|
8842
|
+
array[MONTH] = toInt(input) - 1;
|
|
8843
|
+
});
|
|
8844
|
+
addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
|
|
8845
|
+
var month = config._locale.monthsParse(input, token2, config._strict);
|
|
8846
|
+
if (month != null) {
|
|
8847
|
+
array[MONTH] = month;
|
|
8848
|
+
} else {
|
|
8849
|
+
getParsingFlags(config).invalidMonth = input;
|
|
8850
|
+
}
|
|
8851
|
+
});
|
|
8852
|
+
var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
|
|
8853
|
+
"_"
|
|
8854
|
+
), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
|
|
8855
|
+
function localeMonths(m, format2) {
|
|
8856
|
+
if (!m) {
|
|
8857
|
+
return isArray(this._months) ? this._months : this._months["standalone"];
|
|
8858
|
+
}
|
|
8859
|
+
return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()];
|
|
8860
|
+
}
|
|
8861
|
+
function localeMonthsShort(m, format2) {
|
|
8862
|
+
if (!m) {
|
|
8863
|
+
return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
|
|
8864
|
+
}
|
|
8865
|
+
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
|
|
8866
|
+
}
|
|
8867
|
+
function handleStrictParse(monthName, format2, strict) {
|
|
8868
|
+
var i, ii, mom, llc = monthName.toLocaleLowerCase();
|
|
8869
|
+
if (!this._monthsParse) {
|
|
8870
|
+
this._monthsParse = [];
|
|
8871
|
+
this._longMonthsParse = [];
|
|
8872
|
+
this._shortMonthsParse = [];
|
|
8873
|
+
for (i = 0; i < 12; ++i) {
|
|
8874
|
+
mom = createUTC([2e3, i]);
|
|
8875
|
+
this._shortMonthsParse[i] = this.monthsShort(
|
|
8876
|
+
mom,
|
|
8877
|
+
""
|
|
8878
|
+
).toLocaleLowerCase();
|
|
8879
|
+
this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase();
|
|
8880
|
+
}
|
|
8881
|
+
}
|
|
8882
|
+
if (strict) {
|
|
8883
|
+
if (format2 === "MMM") {
|
|
8884
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8885
|
+
return ii !== -1 ? ii : null;
|
|
8886
|
+
} else {
|
|
8887
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8888
|
+
return ii !== -1 ? ii : null;
|
|
8889
|
+
}
|
|
8890
|
+
} else {
|
|
8891
|
+
if (format2 === "MMM") {
|
|
8892
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8893
|
+
if (ii !== -1) {
|
|
8894
|
+
return ii;
|
|
8895
|
+
}
|
|
8896
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8897
|
+
return ii !== -1 ? ii : null;
|
|
8898
|
+
} else {
|
|
8899
|
+
ii = indexOf.call(this._longMonthsParse, llc);
|
|
8900
|
+
if (ii !== -1) {
|
|
8901
|
+
return ii;
|
|
8902
|
+
}
|
|
8903
|
+
ii = indexOf.call(this._shortMonthsParse, llc);
|
|
8904
|
+
return ii !== -1 ? ii : null;
|
|
8905
|
+
}
|
|
8906
|
+
}
|
|
8907
|
+
}
|
|
8908
|
+
function localeMonthsParse(monthName, format2, strict) {
|
|
8909
|
+
var i, mom, regex;
|
|
8910
|
+
if (this._monthsParseExact) {
|
|
8911
|
+
return handleStrictParse.call(this, monthName, format2, strict);
|
|
8912
|
+
}
|
|
8913
|
+
if (!this._monthsParse) {
|
|
8914
|
+
this._monthsParse = [];
|
|
8915
|
+
this._longMonthsParse = [];
|
|
8916
|
+
this._shortMonthsParse = [];
|
|
8917
|
+
}
|
|
8918
|
+
for (i = 0; i < 12; i++) {
|
|
8919
|
+
mom = createUTC([2e3, i]);
|
|
8920
|
+
if (strict && !this._longMonthsParse[i]) {
|
|
8921
|
+
this._longMonthsParse[i] = new RegExp(
|
|
8922
|
+
"^" + this.months(mom, "").replace(".", "") + "$",
|
|
8923
|
+
"i"
|
|
8924
|
+
);
|
|
8925
|
+
this._shortMonthsParse[i] = new RegExp(
|
|
8926
|
+
"^" + this.monthsShort(mom, "").replace(".", "") + "$",
|
|
8927
|
+
"i"
|
|
8928
|
+
);
|
|
8929
|
+
}
|
|
8930
|
+
if (!strict && !this._monthsParse[i]) {
|
|
8931
|
+
regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
|
|
8932
|
+
this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
8933
|
+
}
|
|
8934
|
+
if (strict && format2 === "MMMM" && this._longMonthsParse[i].test(monthName)) {
|
|
8935
|
+
return i;
|
|
8936
|
+
} else if (strict && format2 === "MMM" && this._shortMonthsParse[i].test(monthName)) {
|
|
8937
|
+
return i;
|
|
8938
|
+
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
|
8939
|
+
return i;
|
|
8940
|
+
}
|
|
8941
|
+
}
|
|
8942
|
+
}
|
|
8943
|
+
function setMonth(mom, value) {
|
|
8944
|
+
if (!mom.isValid()) {
|
|
8945
|
+
return mom;
|
|
8946
|
+
}
|
|
8947
|
+
if (typeof value === "string") {
|
|
8948
|
+
if (/^\d+$/.test(value)) {
|
|
8949
|
+
value = toInt(value);
|
|
8950
|
+
} else {
|
|
8951
|
+
value = mom.localeData().monthsParse(value);
|
|
8952
|
+
if (!isNumber(value)) {
|
|
8953
|
+
return mom;
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8956
|
+
}
|
|
8957
|
+
var month = value, date = mom.date();
|
|
8958
|
+
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
|
8959
|
+
void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
|
|
8960
|
+
return mom;
|
|
8961
|
+
}
|
|
8962
|
+
function getSetMonth(value) {
|
|
8963
|
+
if (value != null) {
|
|
8964
|
+
setMonth(this, value);
|
|
8965
|
+
hooks.updateOffset(this, true);
|
|
8966
|
+
return this;
|
|
8967
|
+
} else {
|
|
8968
|
+
return get(this, "Month");
|
|
8969
|
+
}
|
|
8970
|
+
}
|
|
8971
|
+
function getDaysInMonth() {
|
|
8972
|
+
return daysInMonth(this.year(), this.month());
|
|
8973
|
+
}
|
|
8974
|
+
function monthsShortRegex(isStrict) {
|
|
8975
|
+
if (this._monthsParseExact) {
|
|
8976
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
8977
|
+
computeMonthsParse.call(this);
|
|
8978
|
+
}
|
|
8979
|
+
if (isStrict) {
|
|
8980
|
+
return this._monthsShortStrictRegex;
|
|
8981
|
+
} else {
|
|
8982
|
+
return this._monthsShortRegex;
|
|
8983
|
+
}
|
|
8984
|
+
} else {
|
|
8985
|
+
if (!hasOwnProp(this, "_monthsShortRegex")) {
|
|
8986
|
+
this._monthsShortRegex = defaultMonthsShortRegex;
|
|
8987
|
+
}
|
|
8988
|
+
return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
|
|
8989
|
+
}
|
|
8990
|
+
}
|
|
8991
|
+
function monthsRegex$1(isStrict) {
|
|
8992
|
+
if (this._monthsParseExact) {
|
|
8993
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
8994
|
+
computeMonthsParse.call(this);
|
|
8995
|
+
}
|
|
8996
|
+
if (isStrict) {
|
|
8997
|
+
return this._monthsStrictRegex;
|
|
8998
|
+
} else {
|
|
8999
|
+
return this._monthsRegex;
|
|
9000
|
+
}
|
|
9001
|
+
} else {
|
|
9002
|
+
if (!hasOwnProp(this, "_monthsRegex")) {
|
|
9003
|
+
this._monthsRegex = defaultMonthsRegex;
|
|
9004
|
+
}
|
|
9005
|
+
return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
|
|
9006
|
+
}
|
|
9007
|
+
}
|
|
9008
|
+
function computeMonthsParse() {
|
|
9009
|
+
function cmpLenRev(a, b) {
|
|
9010
|
+
return b.length - a.length;
|
|
9011
|
+
}
|
|
9012
|
+
var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP;
|
|
9013
|
+
for (i = 0; i < 12; i++) {
|
|
9014
|
+
mom = createUTC([2e3, i]);
|
|
9015
|
+
shortP = regexEscape(this.monthsShort(mom, ""));
|
|
9016
|
+
longP = regexEscape(this.months(mom, ""));
|
|
9017
|
+
shortPieces.push(shortP);
|
|
9018
|
+
longPieces.push(longP);
|
|
9019
|
+
mixedPieces.push(longP);
|
|
9020
|
+
mixedPieces.push(shortP);
|
|
9021
|
+
}
|
|
9022
|
+
shortPieces.sort(cmpLenRev);
|
|
9023
|
+
longPieces.sort(cmpLenRev);
|
|
9024
|
+
mixedPieces.sort(cmpLenRev);
|
|
9025
|
+
this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
9026
|
+
this._monthsShortRegex = this._monthsRegex;
|
|
9027
|
+
this._monthsStrictRegex = new RegExp(
|
|
9028
|
+
"^(" + longPieces.join("|") + ")",
|
|
9029
|
+
"i"
|
|
9030
|
+
);
|
|
9031
|
+
this._monthsShortStrictRegex = new RegExp(
|
|
9032
|
+
"^(" + shortPieces.join("|") + ")",
|
|
9033
|
+
"i"
|
|
9034
|
+
);
|
|
9035
|
+
}
|
|
9036
|
+
function createDate(y, m, d, h, M, s, ms) {
|
|
9037
|
+
var date;
|
|
9038
|
+
if (y < 100 && y >= 0) {
|
|
9039
|
+
date = new Date(y + 400, m, d, h, M, s, ms);
|
|
9040
|
+
if (isFinite(date.getFullYear())) {
|
|
9041
|
+
date.setFullYear(y);
|
|
9042
|
+
}
|
|
9043
|
+
} else {
|
|
9044
|
+
date = new Date(y, m, d, h, M, s, ms);
|
|
9045
|
+
}
|
|
9046
|
+
return date;
|
|
9047
|
+
}
|
|
9048
|
+
function createUTCDate(y) {
|
|
9049
|
+
var date, args;
|
|
9050
|
+
if (y < 100 && y >= 0) {
|
|
9051
|
+
args = Array.prototype.slice.call(arguments);
|
|
9052
|
+
args[0] = y + 400;
|
|
9053
|
+
date = new Date(Date.UTC.apply(null, args));
|
|
9054
|
+
if (isFinite(date.getUTCFullYear())) {
|
|
9055
|
+
date.setUTCFullYear(y);
|
|
9056
|
+
}
|
|
9057
|
+
} else {
|
|
9058
|
+
date = new Date(Date.UTC.apply(null, arguments));
|
|
9059
|
+
}
|
|
9060
|
+
return date;
|
|
9061
|
+
}
|
|
9062
|
+
function firstWeekOffset(year, dow, doy) {
|
|
9063
|
+
var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
|
9064
|
+
return -fwdlw + fwd - 1;
|
|
9065
|
+
}
|
|
9066
|
+
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
|
9067
|
+
var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
|
|
9068
|
+
if (dayOfYear <= 0) {
|
|
9069
|
+
resYear = year - 1;
|
|
9070
|
+
resDayOfYear = daysInYear(resYear) + dayOfYear;
|
|
9071
|
+
} else if (dayOfYear > daysInYear(year)) {
|
|
9072
|
+
resYear = year + 1;
|
|
9073
|
+
resDayOfYear = dayOfYear - daysInYear(year);
|
|
9074
|
+
} else {
|
|
9075
|
+
resYear = year;
|
|
9076
|
+
resDayOfYear = dayOfYear;
|
|
9077
|
+
}
|
|
9078
|
+
return {
|
|
9079
|
+
year: resYear,
|
|
9080
|
+
dayOfYear: resDayOfYear
|
|
9081
|
+
};
|
|
9082
|
+
}
|
|
9083
|
+
function weekOfYear(mom, dow, doy) {
|
|
9084
|
+
var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
|
|
9085
|
+
if (week < 1) {
|
|
9086
|
+
resYear = mom.year() - 1;
|
|
9087
|
+
resWeek = week + weeksInYear(resYear, dow, doy);
|
|
9088
|
+
} else if (week > weeksInYear(mom.year(), dow, doy)) {
|
|
9089
|
+
resWeek = week - weeksInYear(mom.year(), dow, doy);
|
|
9090
|
+
resYear = mom.year() + 1;
|
|
9091
|
+
} else {
|
|
9092
|
+
resYear = mom.year();
|
|
9093
|
+
resWeek = week;
|
|
9094
|
+
}
|
|
9095
|
+
return {
|
|
9096
|
+
week: resWeek,
|
|
9097
|
+
year: resYear
|
|
9098
|
+
};
|
|
9099
|
+
}
|
|
9100
|
+
function weeksInYear(year, dow, doy) {
|
|
9101
|
+
var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
|
9102
|
+
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
|
9103
|
+
}
|
|
9104
|
+
addFormatToken("w", ["ww", 2], "wo", "week");
|
|
9105
|
+
addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
|
|
9106
|
+
addRegexToken("w", match1to2, match1to2NoLeadingZero);
|
|
9107
|
+
addRegexToken("ww", match1to2, match2);
|
|
9108
|
+
addRegexToken("W", match1to2, match1to2NoLeadingZero);
|
|
9109
|
+
addRegexToken("WW", match1to2, match2);
|
|
9110
|
+
addWeekParseToken(
|
|
9111
|
+
["w", "ww", "W", "WW"],
|
|
9112
|
+
function(input, week, config, token2) {
|
|
9113
|
+
week[token2.substr(0, 1)] = toInt(input);
|
|
9114
|
+
}
|
|
9115
|
+
);
|
|
9116
|
+
function localeWeek(mom) {
|
|
9117
|
+
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
|
9118
|
+
}
|
|
9119
|
+
var defaultLocaleWeek = {
|
|
9120
|
+
dow: 0,
|
|
9121
|
+
// Sunday is the first day of the week.
|
|
9122
|
+
doy: 6
|
|
9123
|
+
// The week that contains Jan 6th is the first week of the year.
|
|
9124
|
+
};
|
|
9125
|
+
function localeFirstDayOfWeek() {
|
|
9126
|
+
return this._week.dow;
|
|
9127
|
+
}
|
|
9128
|
+
function localeFirstDayOfYear() {
|
|
9129
|
+
return this._week.doy;
|
|
9130
|
+
}
|
|
9131
|
+
function getSetWeek(input) {
|
|
9132
|
+
var week = this.localeData().week(this);
|
|
9133
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
9134
|
+
}
|
|
9135
|
+
function getSetISOWeek(input) {
|
|
9136
|
+
var week = weekOfYear(this, 1, 4).week;
|
|
9137
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
9138
|
+
}
|
|
9139
|
+
addFormatToken("d", 0, "do", "day");
|
|
9140
|
+
addFormatToken("dd", 0, 0, function(format2) {
|
|
9141
|
+
return this.localeData().weekdaysMin(this, format2);
|
|
9142
|
+
});
|
|
9143
|
+
addFormatToken("ddd", 0, 0, function(format2) {
|
|
9144
|
+
return this.localeData().weekdaysShort(this, format2);
|
|
9145
|
+
});
|
|
9146
|
+
addFormatToken("dddd", 0, 0, function(format2) {
|
|
9147
|
+
return this.localeData().weekdays(this, format2);
|
|
9148
|
+
});
|
|
9149
|
+
addFormatToken("e", 0, 0, "weekday");
|
|
9150
|
+
addFormatToken("E", 0, 0, "isoWeekday");
|
|
9151
|
+
addRegexToken("d", match1to2);
|
|
9152
|
+
addRegexToken("e", match1to2);
|
|
9153
|
+
addRegexToken("E", match1to2);
|
|
9154
|
+
addRegexToken("dd", function(isStrict, locale2) {
|
|
9155
|
+
return locale2.weekdaysMinRegex(isStrict);
|
|
9156
|
+
});
|
|
9157
|
+
addRegexToken("ddd", function(isStrict, locale2) {
|
|
9158
|
+
return locale2.weekdaysShortRegex(isStrict);
|
|
9159
|
+
});
|
|
9160
|
+
addRegexToken("dddd", function(isStrict, locale2) {
|
|
9161
|
+
return locale2.weekdaysRegex(isStrict);
|
|
9162
|
+
});
|
|
9163
|
+
addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) {
|
|
9164
|
+
var weekday = config._locale.weekdaysParse(input, token2, config._strict);
|
|
9165
|
+
if (weekday != null) {
|
|
9166
|
+
week.d = weekday;
|
|
9167
|
+
} else {
|
|
9168
|
+
getParsingFlags(config).invalidWeekday = input;
|
|
9169
|
+
}
|
|
9170
|
+
});
|
|
9171
|
+
addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
|
|
9172
|
+
week[token2] = toInt(input);
|
|
9173
|
+
});
|
|
9174
|
+
function parseWeekday(input, locale2) {
|
|
9175
|
+
if (typeof input !== "string") {
|
|
9176
|
+
return input;
|
|
9177
|
+
}
|
|
9178
|
+
if (!isNaN(input)) {
|
|
9179
|
+
return parseInt(input, 10);
|
|
9180
|
+
}
|
|
9181
|
+
input = locale2.weekdaysParse(input);
|
|
9182
|
+
if (typeof input === "number") {
|
|
9183
|
+
return input;
|
|
9184
|
+
}
|
|
9185
|
+
return null;
|
|
9186
|
+
}
|
|
9187
|
+
function parseIsoWeekday(input, locale2) {
|
|
9188
|
+
if (typeof input === "string") {
|
|
9189
|
+
return locale2.weekdaysParse(input) % 7 || 7;
|
|
9190
|
+
}
|
|
9191
|
+
return isNaN(input) ? null : input;
|
|
9192
|
+
}
|
|
9193
|
+
function shiftWeekdays(ws, n) {
|
|
9194
|
+
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
9195
|
+
}
|
|
9196
|
+
var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
|
|
9197
|
+
function localeWeekdays(m, format2) {
|
|
9198
|
+
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
|
|
9199
|
+
return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
|
9200
|
+
}
|
|
9201
|
+
function localeWeekdaysShort(m) {
|
|
9202
|
+
return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
|
|
9203
|
+
}
|
|
9204
|
+
function localeWeekdaysMin(m) {
|
|
9205
|
+
return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
|
9206
|
+
}
|
|
9207
|
+
function handleStrictParse$1(weekdayName, format2, strict) {
|
|
9208
|
+
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
|
|
9209
|
+
if (!this._weekdaysParse) {
|
|
9210
|
+
this._weekdaysParse = [];
|
|
9211
|
+
this._shortWeekdaysParse = [];
|
|
9212
|
+
this._minWeekdaysParse = [];
|
|
9213
|
+
for (i = 0; i < 7; ++i) {
|
|
9214
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9215
|
+
this._minWeekdaysParse[i] = this.weekdaysMin(
|
|
9216
|
+
mom,
|
|
9217
|
+
""
|
|
9218
|
+
).toLocaleLowerCase();
|
|
9219
|
+
this._shortWeekdaysParse[i] = this.weekdaysShort(
|
|
9220
|
+
mom,
|
|
9221
|
+
""
|
|
9222
|
+
).toLocaleLowerCase();
|
|
9223
|
+
this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase();
|
|
9224
|
+
}
|
|
9225
|
+
}
|
|
9226
|
+
if (strict) {
|
|
9227
|
+
if (format2 === "dddd") {
|
|
9228
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9229
|
+
return ii !== -1 ? ii : null;
|
|
9230
|
+
} else if (format2 === "ddd") {
|
|
9231
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9232
|
+
return ii !== -1 ? ii : null;
|
|
9233
|
+
} else {
|
|
9234
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9235
|
+
return ii !== -1 ? ii : null;
|
|
9236
|
+
}
|
|
9237
|
+
} else {
|
|
9238
|
+
if (format2 === "dddd") {
|
|
9239
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9240
|
+
if (ii !== -1) {
|
|
9241
|
+
return ii;
|
|
9242
|
+
}
|
|
9243
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9244
|
+
if (ii !== -1) {
|
|
9245
|
+
return ii;
|
|
9246
|
+
}
|
|
9247
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9248
|
+
return ii !== -1 ? ii : null;
|
|
9249
|
+
} else if (format2 === "ddd") {
|
|
9250
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9251
|
+
if (ii !== -1) {
|
|
9252
|
+
return ii;
|
|
9253
|
+
}
|
|
9254
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9255
|
+
if (ii !== -1) {
|
|
9256
|
+
return ii;
|
|
9257
|
+
}
|
|
9258
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9259
|
+
return ii !== -1 ? ii : null;
|
|
9260
|
+
} else {
|
|
9261
|
+
ii = indexOf.call(this._minWeekdaysParse, llc);
|
|
9262
|
+
if (ii !== -1) {
|
|
9263
|
+
return ii;
|
|
9264
|
+
}
|
|
9265
|
+
ii = indexOf.call(this._weekdaysParse, llc);
|
|
9266
|
+
if (ii !== -1) {
|
|
9267
|
+
return ii;
|
|
9268
|
+
}
|
|
9269
|
+
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
|
9270
|
+
return ii !== -1 ? ii : null;
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9273
|
+
}
|
|
9274
|
+
function localeWeekdaysParse(weekdayName, format2, strict) {
|
|
9275
|
+
var i, mom, regex;
|
|
9276
|
+
if (this._weekdaysParseExact) {
|
|
9277
|
+
return handleStrictParse$1.call(this, weekdayName, format2, strict);
|
|
9278
|
+
}
|
|
9279
|
+
if (!this._weekdaysParse) {
|
|
9280
|
+
this._weekdaysParse = [];
|
|
9281
|
+
this._minWeekdaysParse = [];
|
|
9282
|
+
this._shortWeekdaysParse = [];
|
|
9283
|
+
this._fullWeekdaysParse = [];
|
|
9284
|
+
}
|
|
9285
|
+
for (i = 0; i < 7; i++) {
|
|
9286
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9287
|
+
if (strict && !this._fullWeekdaysParse[i]) {
|
|
9288
|
+
this._fullWeekdaysParse[i] = new RegExp(
|
|
9289
|
+
"^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
|
|
9290
|
+
"i"
|
|
9291
|
+
);
|
|
9292
|
+
this._shortWeekdaysParse[i] = new RegExp(
|
|
9293
|
+
"^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
|
|
9294
|
+
"i"
|
|
9295
|
+
);
|
|
9296
|
+
this._minWeekdaysParse[i] = new RegExp(
|
|
9297
|
+
"^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
|
|
9298
|
+
"i"
|
|
9299
|
+
);
|
|
9300
|
+
}
|
|
9301
|
+
if (!this._weekdaysParse[i]) {
|
|
9302
|
+
regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
|
|
9303
|
+
this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i");
|
|
9304
|
+
}
|
|
9305
|
+
if (strict && format2 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) {
|
|
9306
|
+
return i;
|
|
9307
|
+
} else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) {
|
|
9308
|
+
return i;
|
|
9309
|
+
} else if (strict && format2 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) {
|
|
9310
|
+
return i;
|
|
9311
|
+
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
|
9312
|
+
return i;
|
|
9313
|
+
}
|
|
9314
|
+
}
|
|
9315
|
+
}
|
|
9316
|
+
function getSetDayOfWeek(input) {
|
|
9317
|
+
if (!this.isValid()) {
|
|
9318
|
+
return input != null ? this : NaN;
|
|
9319
|
+
}
|
|
9320
|
+
var day = get(this, "Day");
|
|
9321
|
+
if (input != null) {
|
|
9322
|
+
input = parseWeekday(input, this.localeData());
|
|
9323
|
+
return this.add(input - day, "d");
|
|
9324
|
+
} else {
|
|
9325
|
+
return day;
|
|
9326
|
+
}
|
|
9327
|
+
}
|
|
9328
|
+
function getSetLocaleDayOfWeek(input) {
|
|
9329
|
+
if (!this.isValid()) {
|
|
9330
|
+
return input != null ? this : NaN;
|
|
9331
|
+
}
|
|
9332
|
+
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
|
|
9333
|
+
return input == null ? weekday : this.add(input - weekday, "d");
|
|
9334
|
+
}
|
|
9335
|
+
function getSetISODayOfWeek(input) {
|
|
9336
|
+
if (!this.isValid()) {
|
|
9337
|
+
return input != null ? this : NaN;
|
|
9338
|
+
}
|
|
9339
|
+
if (input != null) {
|
|
9340
|
+
var weekday = parseIsoWeekday(input, this.localeData());
|
|
9341
|
+
return this.day(this.day() % 7 ? weekday : weekday - 7);
|
|
9342
|
+
} else {
|
|
9343
|
+
return this.day() || 7;
|
|
9344
|
+
}
|
|
9345
|
+
}
|
|
9346
|
+
function weekdaysRegex(isStrict) {
|
|
9347
|
+
if (this._weekdaysParseExact) {
|
|
9348
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9349
|
+
computeWeekdaysParse.call(this);
|
|
9350
|
+
}
|
|
9351
|
+
if (isStrict) {
|
|
9352
|
+
return this._weekdaysStrictRegex;
|
|
9353
|
+
} else {
|
|
9354
|
+
return this._weekdaysRegex;
|
|
9355
|
+
}
|
|
9356
|
+
} else {
|
|
9357
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9358
|
+
this._weekdaysRegex = defaultWeekdaysRegex;
|
|
9359
|
+
}
|
|
9360
|
+
return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
|
|
9361
|
+
}
|
|
9362
|
+
}
|
|
9363
|
+
function weekdaysShortRegex(isStrict) {
|
|
9364
|
+
if (this._weekdaysParseExact) {
|
|
9365
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9366
|
+
computeWeekdaysParse.call(this);
|
|
9367
|
+
}
|
|
9368
|
+
if (isStrict) {
|
|
9369
|
+
return this._weekdaysShortStrictRegex;
|
|
9370
|
+
} else {
|
|
9371
|
+
return this._weekdaysShortRegex;
|
|
9372
|
+
}
|
|
9373
|
+
} else {
|
|
9374
|
+
if (!hasOwnProp(this, "_weekdaysShortRegex")) {
|
|
9375
|
+
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
|
9376
|
+
}
|
|
9377
|
+
return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
|
|
9378
|
+
}
|
|
9379
|
+
}
|
|
9380
|
+
function weekdaysMinRegex(isStrict) {
|
|
9381
|
+
if (this._weekdaysParseExact) {
|
|
9382
|
+
if (!hasOwnProp(this, "_weekdaysRegex")) {
|
|
9383
|
+
computeWeekdaysParse.call(this);
|
|
9384
|
+
}
|
|
9385
|
+
if (isStrict) {
|
|
9386
|
+
return this._weekdaysMinStrictRegex;
|
|
9387
|
+
} else {
|
|
9388
|
+
return this._weekdaysMinRegex;
|
|
9389
|
+
}
|
|
9390
|
+
} else {
|
|
9391
|
+
if (!hasOwnProp(this, "_weekdaysMinRegex")) {
|
|
9392
|
+
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
|
9393
|
+
}
|
|
9394
|
+
return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
|
|
9395
|
+
}
|
|
9396
|
+
}
|
|
9397
|
+
function computeWeekdaysParse() {
|
|
9398
|
+
function cmpLenRev(a, b) {
|
|
9399
|
+
return b.length - a.length;
|
|
9400
|
+
}
|
|
9401
|
+
var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp;
|
|
9402
|
+
for (i = 0; i < 7; i++) {
|
|
9403
|
+
mom = createUTC([2e3, 1]).day(i);
|
|
9404
|
+
minp = regexEscape(this.weekdaysMin(mom, ""));
|
|
9405
|
+
shortp = regexEscape(this.weekdaysShort(mom, ""));
|
|
9406
|
+
longp = regexEscape(this.weekdays(mom, ""));
|
|
9407
|
+
minPieces.push(minp);
|
|
9408
|
+
shortPieces.push(shortp);
|
|
9409
|
+
longPieces.push(longp);
|
|
9410
|
+
mixedPieces.push(minp);
|
|
9411
|
+
mixedPieces.push(shortp);
|
|
9412
|
+
mixedPieces.push(longp);
|
|
9413
|
+
}
|
|
9414
|
+
minPieces.sort(cmpLenRev);
|
|
9415
|
+
shortPieces.sort(cmpLenRev);
|
|
9416
|
+
longPieces.sort(cmpLenRev);
|
|
9417
|
+
mixedPieces.sort(cmpLenRev);
|
|
9418
|
+
this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
9419
|
+
this._weekdaysShortRegex = this._weekdaysRegex;
|
|
9420
|
+
this._weekdaysMinRegex = this._weekdaysRegex;
|
|
9421
|
+
this._weekdaysStrictRegex = new RegExp(
|
|
9422
|
+
"^(" + longPieces.join("|") + ")",
|
|
9423
|
+
"i"
|
|
9424
|
+
);
|
|
9425
|
+
this._weekdaysShortStrictRegex = new RegExp(
|
|
9426
|
+
"^(" + shortPieces.join("|") + ")",
|
|
9427
|
+
"i"
|
|
9428
|
+
);
|
|
9429
|
+
this._weekdaysMinStrictRegex = new RegExp(
|
|
9430
|
+
"^(" + minPieces.join("|") + ")",
|
|
9431
|
+
"i"
|
|
9432
|
+
);
|
|
9433
|
+
}
|
|
9434
|
+
function hFormat() {
|
|
9435
|
+
return this.hours() % 12 || 12;
|
|
9436
|
+
}
|
|
9437
|
+
function kFormat() {
|
|
9438
|
+
return this.hours() || 24;
|
|
9439
|
+
}
|
|
9440
|
+
addFormatToken("H", ["HH", 2], 0, "hour");
|
|
9441
|
+
addFormatToken("h", ["hh", 2], 0, hFormat);
|
|
9442
|
+
addFormatToken("k", ["kk", 2], 0, kFormat);
|
|
9443
|
+
addFormatToken("hmm", 0, 0, function() {
|
|
9444
|
+
return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
|
|
9445
|
+
});
|
|
9446
|
+
addFormatToken("hmmss", 0, 0, function() {
|
|
9447
|
+
return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
|
9448
|
+
});
|
|
9449
|
+
addFormatToken("Hmm", 0, 0, function() {
|
|
9450
|
+
return "" + this.hours() + zeroFill(this.minutes(), 2);
|
|
9451
|
+
});
|
|
9452
|
+
addFormatToken("Hmmss", 0, 0, function() {
|
|
9453
|
+
return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
|
|
9454
|
+
});
|
|
9455
|
+
function meridiem(token2, lowercase) {
|
|
9456
|
+
addFormatToken(token2, 0, 0, function() {
|
|
9457
|
+
return this.localeData().meridiem(
|
|
9458
|
+
this.hours(),
|
|
9459
|
+
this.minutes(),
|
|
9460
|
+
lowercase
|
|
9461
|
+
);
|
|
9462
|
+
});
|
|
9463
|
+
}
|
|
9464
|
+
meridiem("a", true);
|
|
9465
|
+
meridiem("A", false);
|
|
9466
|
+
function matchMeridiem(isStrict, locale2) {
|
|
9467
|
+
return locale2._meridiemParse;
|
|
9468
|
+
}
|
|
9469
|
+
addRegexToken("a", matchMeridiem);
|
|
9470
|
+
addRegexToken("A", matchMeridiem);
|
|
9471
|
+
addRegexToken("H", match1to2, match1to2HasZero);
|
|
9472
|
+
addRegexToken("h", match1to2, match1to2NoLeadingZero);
|
|
9473
|
+
addRegexToken("k", match1to2, match1to2NoLeadingZero);
|
|
9474
|
+
addRegexToken("HH", match1to2, match2);
|
|
9475
|
+
addRegexToken("hh", match1to2, match2);
|
|
9476
|
+
addRegexToken("kk", match1to2, match2);
|
|
9477
|
+
addRegexToken("hmm", match3to4);
|
|
9478
|
+
addRegexToken("hmmss", match5to6);
|
|
9479
|
+
addRegexToken("Hmm", match3to4);
|
|
9480
|
+
addRegexToken("Hmmss", match5to6);
|
|
9481
|
+
addParseToken(["H", "HH"], HOUR);
|
|
9482
|
+
addParseToken(["k", "kk"], function(input, array, config) {
|
|
9483
|
+
var kInput = toInt(input);
|
|
9484
|
+
array[HOUR] = kInput === 24 ? 0 : kInput;
|
|
9485
|
+
});
|
|
9486
|
+
addParseToken(["a", "A"], function(input, array, config) {
|
|
9487
|
+
config._isPm = config._locale.isPM(input);
|
|
9488
|
+
config._meridiem = input;
|
|
9489
|
+
});
|
|
9490
|
+
addParseToken(["h", "hh"], function(input, array, config) {
|
|
9491
|
+
array[HOUR] = toInt(input);
|
|
9492
|
+
getParsingFlags(config).bigHour = true;
|
|
9493
|
+
});
|
|
9494
|
+
addParseToken("hmm", function(input, array, config) {
|
|
9495
|
+
var pos = input.length - 2;
|
|
9496
|
+
array[HOUR] = toInt(input.substr(0, pos));
|
|
9497
|
+
array[MINUTE] = toInt(input.substr(pos));
|
|
9498
|
+
getParsingFlags(config).bigHour = true;
|
|
9499
|
+
});
|
|
9500
|
+
addParseToken("hmmss", function(input, array, config) {
|
|
9501
|
+
var pos1 = input.length - 4, pos2 = input.length - 2;
|
|
9502
|
+
array[HOUR] = toInt(input.substr(0, pos1));
|
|
9503
|
+
array[MINUTE] = toInt(input.substr(pos1, 2));
|
|
9504
|
+
array[SECOND] = toInt(input.substr(pos2));
|
|
9505
|
+
getParsingFlags(config).bigHour = true;
|
|
9506
|
+
});
|
|
9507
|
+
addParseToken("Hmm", function(input, array, config) {
|
|
9508
|
+
var pos = input.length - 2;
|
|
9509
|
+
array[HOUR] = toInt(input.substr(0, pos));
|
|
9510
|
+
array[MINUTE] = toInt(input.substr(pos));
|
|
9511
|
+
});
|
|
9512
|
+
addParseToken("Hmmss", function(input, array, config) {
|
|
9513
|
+
var pos1 = input.length - 4, pos2 = input.length - 2;
|
|
9514
|
+
array[HOUR] = toInt(input.substr(0, pos1));
|
|
9515
|
+
array[MINUTE] = toInt(input.substr(pos1, 2));
|
|
9516
|
+
array[SECOND] = toInt(input.substr(pos2));
|
|
9517
|
+
});
|
|
9518
|
+
function localeIsPM(input) {
|
|
9519
|
+
return (input + "").toLowerCase().charAt(0) === "p";
|
|
9520
|
+
}
|
|
9521
|
+
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
|
|
9522
|
+
function localeMeridiem(hours2, minutes2, isLower) {
|
|
9523
|
+
if (hours2 > 11) {
|
|
9524
|
+
return isLower ? "pm" : "PM";
|
|
9525
|
+
} else {
|
|
9526
|
+
return isLower ? "am" : "AM";
|
|
9527
|
+
}
|
|
9528
|
+
}
|
|
9529
|
+
var baseConfig = {
|
|
9530
|
+
calendar: defaultCalendar,
|
|
9531
|
+
longDateFormat: defaultLongDateFormat,
|
|
9532
|
+
invalidDate: defaultInvalidDate,
|
|
9533
|
+
ordinal: defaultOrdinal,
|
|
9534
|
+
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
|
|
9535
|
+
relativeTime: defaultRelativeTime,
|
|
9536
|
+
months: defaultLocaleMonths,
|
|
9537
|
+
monthsShort: defaultLocaleMonthsShort,
|
|
9538
|
+
week: defaultLocaleWeek,
|
|
9539
|
+
weekdays: defaultLocaleWeekdays,
|
|
9540
|
+
weekdaysMin: defaultLocaleWeekdaysMin,
|
|
9541
|
+
weekdaysShort: defaultLocaleWeekdaysShort,
|
|
9542
|
+
meridiemParse: defaultLocaleMeridiemParse
|
|
9543
|
+
};
|
|
9544
|
+
var locales = {}, localeFamilies = {}, globalLocale;
|
|
9545
|
+
function commonPrefix(arr1, arr2) {
|
|
9546
|
+
var i, minl = Math.min(arr1.length, arr2.length);
|
|
9547
|
+
for (i = 0; i < minl; i += 1) {
|
|
9548
|
+
if (arr1[i] !== arr2[i]) {
|
|
9549
|
+
return i;
|
|
9550
|
+
}
|
|
9551
|
+
}
|
|
9552
|
+
return minl;
|
|
9553
|
+
}
|
|
9554
|
+
function normalizeLocale(key) {
|
|
9555
|
+
return key ? key.toLowerCase().replace("_", "-") : key;
|
|
9556
|
+
}
|
|
9557
|
+
function chooseLocale(names) {
|
|
9558
|
+
var i = 0, j, next, locale2, split;
|
|
9559
|
+
while (i < names.length) {
|
|
9560
|
+
split = normalizeLocale(names[i]).split("-");
|
|
9561
|
+
j = split.length;
|
|
9562
|
+
next = normalizeLocale(names[i + 1]);
|
|
9563
|
+
next = next ? next.split("-") : null;
|
|
9564
|
+
while (j > 0) {
|
|
9565
|
+
locale2 = loadLocale(split.slice(0, j).join("-"));
|
|
9566
|
+
if (locale2) {
|
|
9567
|
+
return locale2;
|
|
9568
|
+
}
|
|
9569
|
+
if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
|
|
9570
|
+
break;
|
|
9571
|
+
}
|
|
9572
|
+
j--;
|
|
9573
|
+
}
|
|
9574
|
+
i++;
|
|
9575
|
+
}
|
|
9576
|
+
return globalLocale;
|
|
9577
|
+
}
|
|
9578
|
+
function isLocaleNameSane(name) {
|
|
9579
|
+
return !!(name && name.match("^[^/\\\\]*$"));
|
|
9580
|
+
}
|
|
9581
|
+
function loadLocale(name) {
|
|
9582
|
+
var oldLocale = null, aliasedRequire;
|
|
9583
|
+
if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
|
|
9584
|
+
try {
|
|
9585
|
+
oldLocale = globalLocale._abbr;
|
|
9586
|
+
aliasedRequire = require;
|
|
9587
|
+
aliasedRequire("./locale/" + name);
|
|
9588
|
+
getSetGlobalLocale(oldLocale);
|
|
9589
|
+
} catch (e) {
|
|
9590
|
+
locales[name] = null;
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
return locales[name];
|
|
9594
|
+
}
|
|
9595
|
+
function getSetGlobalLocale(key, values) {
|
|
9596
|
+
var data;
|
|
9597
|
+
if (key) {
|
|
9598
|
+
if (isUndefined(values)) {
|
|
9599
|
+
data = getLocale(key);
|
|
9600
|
+
} else {
|
|
9601
|
+
data = defineLocale(key, values);
|
|
9602
|
+
}
|
|
9603
|
+
if (data) {
|
|
9604
|
+
globalLocale = data;
|
|
9605
|
+
} else {
|
|
9606
|
+
if (typeof console !== "undefined" && console.warn) {
|
|
9607
|
+
console.warn(
|
|
9608
|
+
"Locale " + key + " not found. Did you forget to load it?"
|
|
9609
|
+
);
|
|
9610
|
+
}
|
|
9611
|
+
}
|
|
9612
|
+
}
|
|
9613
|
+
return globalLocale._abbr;
|
|
9614
|
+
}
|
|
9615
|
+
function defineLocale(name, config) {
|
|
9616
|
+
if (config !== null) {
|
|
9617
|
+
var locale2, parentConfig = baseConfig;
|
|
9618
|
+
config.abbr = name;
|
|
9619
|
+
if (locales[name] != null) {
|
|
9620
|
+
deprecateSimple(
|
|
9621
|
+
"defineLocaleOverride",
|
|
9622
|
+
"use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
|
|
9623
|
+
);
|
|
9624
|
+
parentConfig = locales[name]._config;
|
|
9625
|
+
} else if (config.parentLocale != null) {
|
|
9626
|
+
if (locales[config.parentLocale] != null) {
|
|
9627
|
+
parentConfig = locales[config.parentLocale]._config;
|
|
9628
|
+
} else {
|
|
9629
|
+
locale2 = loadLocale(config.parentLocale);
|
|
9630
|
+
if (locale2 != null) {
|
|
9631
|
+
parentConfig = locale2._config;
|
|
9632
|
+
} else {
|
|
9633
|
+
if (!localeFamilies[config.parentLocale]) {
|
|
9634
|
+
localeFamilies[config.parentLocale] = [];
|
|
9635
|
+
}
|
|
9636
|
+
localeFamilies[config.parentLocale].push({
|
|
9637
|
+
name,
|
|
9638
|
+
config
|
|
9639
|
+
});
|
|
9640
|
+
return null;
|
|
9641
|
+
}
|
|
9642
|
+
}
|
|
9643
|
+
}
|
|
9644
|
+
locales[name] = new Locale(mergeConfigs(parentConfig, config));
|
|
9645
|
+
if (localeFamilies[name]) {
|
|
9646
|
+
localeFamilies[name].forEach(function(x) {
|
|
9647
|
+
defineLocale(x.name, x.config);
|
|
9648
|
+
});
|
|
9649
|
+
}
|
|
9650
|
+
getSetGlobalLocale(name);
|
|
9651
|
+
return locales[name];
|
|
9652
|
+
} else {
|
|
9653
|
+
delete locales[name];
|
|
9654
|
+
return null;
|
|
9655
|
+
}
|
|
9656
|
+
}
|
|
9657
|
+
function updateLocale(name, config) {
|
|
9658
|
+
if (config != null) {
|
|
9659
|
+
var locale2, tmpLocale, parentConfig = baseConfig;
|
|
9660
|
+
if (locales[name] != null && locales[name].parentLocale != null) {
|
|
9661
|
+
locales[name].set(mergeConfigs(locales[name]._config, config));
|
|
9662
|
+
} else {
|
|
9663
|
+
tmpLocale = loadLocale(name);
|
|
9664
|
+
if (tmpLocale != null) {
|
|
9665
|
+
parentConfig = tmpLocale._config;
|
|
9666
|
+
}
|
|
9667
|
+
config = mergeConfigs(parentConfig, config);
|
|
9668
|
+
if (tmpLocale == null) {
|
|
9669
|
+
config.abbr = name;
|
|
9670
|
+
}
|
|
9671
|
+
locale2 = new Locale(config);
|
|
9672
|
+
locale2.parentLocale = locales[name];
|
|
9673
|
+
locales[name] = locale2;
|
|
9674
|
+
}
|
|
9675
|
+
getSetGlobalLocale(name);
|
|
9676
|
+
} else {
|
|
9677
|
+
if (locales[name] != null) {
|
|
9678
|
+
if (locales[name].parentLocale != null) {
|
|
9679
|
+
locales[name] = locales[name].parentLocale;
|
|
9680
|
+
if (name === getSetGlobalLocale()) {
|
|
9681
|
+
getSetGlobalLocale(name);
|
|
9682
|
+
}
|
|
9683
|
+
} else if (locales[name] != null) {
|
|
9684
|
+
delete locales[name];
|
|
9685
|
+
}
|
|
9686
|
+
}
|
|
9687
|
+
}
|
|
9688
|
+
return locales[name];
|
|
9689
|
+
}
|
|
9690
|
+
function getLocale(key) {
|
|
9691
|
+
var locale2;
|
|
9692
|
+
if (key && key._locale && key._locale._abbr) {
|
|
9693
|
+
key = key._locale._abbr;
|
|
9694
|
+
}
|
|
9695
|
+
if (!key) {
|
|
9696
|
+
return globalLocale;
|
|
9697
|
+
}
|
|
9698
|
+
if (!isArray(key)) {
|
|
9699
|
+
locale2 = loadLocale(key);
|
|
9700
|
+
if (locale2) {
|
|
9701
|
+
return locale2;
|
|
9702
|
+
}
|
|
9703
|
+
key = [key];
|
|
9704
|
+
}
|
|
9705
|
+
return chooseLocale(key);
|
|
9706
|
+
}
|
|
9707
|
+
function listLocales() {
|
|
9708
|
+
return keys(locales);
|
|
9709
|
+
}
|
|
9710
|
+
function checkOverflow(m) {
|
|
9711
|
+
var overflow, a = m._a;
|
|
9712
|
+
if (a && getParsingFlags(m).overflow === -2) {
|
|
9713
|
+
overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
|
|
9714
|
+
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
|
|
9715
|
+
overflow = DATE;
|
|
9716
|
+
}
|
|
9717
|
+
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
|
9718
|
+
overflow = WEEK;
|
|
9719
|
+
}
|
|
9720
|
+
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
|
|
9721
|
+
overflow = WEEKDAY;
|
|
9722
|
+
}
|
|
9723
|
+
getParsingFlags(m).overflow = overflow;
|
|
9724
|
+
}
|
|
9725
|
+
return m;
|
|
9726
|
+
}
|
|
9727
|
+
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
|
|
9728
|
+
["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
|
|
9729
|
+
["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
|
|
9730
|
+
["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
|
|
9731
|
+
["GGGG-[W]WW", /\d{4}-W\d\d/, false],
|
|
9732
|
+
["YYYY-DDD", /\d{4}-\d{3}/],
|
|
9733
|
+
["YYYY-MM", /\d{4}-\d\d/, false],
|
|
9734
|
+
["YYYYYYMMDD", /[+-]\d{10}/],
|
|
9735
|
+
["YYYYMMDD", /\d{8}/],
|
|
9736
|
+
["GGGG[W]WWE", /\d{4}W\d{3}/],
|
|
9737
|
+
["GGGG[W]WW", /\d{4}W\d{2}/, false],
|
|
9738
|
+
["YYYYDDD", /\d{7}/],
|
|
9739
|
+
["YYYYMM", /\d{6}/, false],
|
|
9740
|
+
["YYYY", /\d{4}/, false]
|
|
9741
|
+
], isoTimes = [
|
|
9742
|
+
["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
|
|
9743
|
+
["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
|
|
9744
|
+
["HH:mm:ss", /\d\d:\d\d:\d\d/],
|
|
9745
|
+
["HH:mm", /\d\d:\d\d/],
|
|
9746
|
+
["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
|
|
9747
|
+
["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
|
|
9748
|
+
["HHmmss", /\d\d\d\d\d\d/],
|
|
9749
|
+
["HHmm", /\d\d\d\d/],
|
|
9750
|
+
["HH", /\d\d/]
|
|
9751
|
+
], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
|
|
9752
|
+
UT: 0,
|
|
9753
|
+
GMT: 0,
|
|
9754
|
+
EDT: -4 * 60,
|
|
9755
|
+
EST: -5 * 60,
|
|
9756
|
+
CDT: -5 * 60,
|
|
9757
|
+
CST: -6 * 60,
|
|
9758
|
+
MDT: -6 * 60,
|
|
9759
|
+
MST: -7 * 60,
|
|
9760
|
+
PDT: -7 * 60,
|
|
9761
|
+
PST: -8 * 60
|
|
9762
|
+
};
|
|
9763
|
+
function configFromISO(config) {
|
|
9764
|
+
var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
|
|
9765
|
+
if (match) {
|
|
9766
|
+
getParsingFlags(config).iso = true;
|
|
9767
|
+
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
9768
|
+
if (isoDates[i][1].exec(match[1])) {
|
|
9769
|
+
dateFormat = isoDates[i][0];
|
|
9770
|
+
allowTime = isoDates[i][2] !== false;
|
|
9771
|
+
break;
|
|
9772
|
+
}
|
|
9773
|
+
}
|
|
9774
|
+
if (dateFormat == null) {
|
|
9775
|
+
config._isValid = false;
|
|
9776
|
+
return;
|
|
9777
|
+
}
|
|
9778
|
+
if (match[3]) {
|
|
9779
|
+
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
9780
|
+
if (isoTimes[i][1].exec(match[3])) {
|
|
9781
|
+
timeFormat = (match[2] || " ") + isoTimes[i][0];
|
|
9782
|
+
break;
|
|
9783
|
+
}
|
|
9784
|
+
}
|
|
9785
|
+
if (timeFormat == null) {
|
|
9786
|
+
config._isValid = false;
|
|
9787
|
+
return;
|
|
9788
|
+
}
|
|
9789
|
+
}
|
|
9790
|
+
if (!allowTime && timeFormat != null) {
|
|
9791
|
+
config._isValid = false;
|
|
9792
|
+
return;
|
|
9793
|
+
}
|
|
9794
|
+
if (match[4]) {
|
|
9795
|
+
if (tzRegex.exec(match[4])) {
|
|
9796
|
+
tzFormat = "Z";
|
|
9797
|
+
} else {
|
|
9798
|
+
config._isValid = false;
|
|
9799
|
+
return;
|
|
9800
|
+
}
|
|
9801
|
+
}
|
|
9802
|
+
config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
|
|
9803
|
+
configFromStringAndFormat(config);
|
|
9804
|
+
} else {
|
|
9805
|
+
config._isValid = false;
|
|
9806
|
+
}
|
|
9807
|
+
}
|
|
9808
|
+
function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
|
|
9809
|
+
var result = [
|
|
9810
|
+
untruncateYear(yearStr),
|
|
9811
|
+
defaultLocaleMonthsShort.indexOf(monthStr),
|
|
9812
|
+
parseInt(dayStr, 10),
|
|
9813
|
+
parseInt(hourStr, 10),
|
|
9814
|
+
parseInt(minuteStr, 10)
|
|
9815
|
+
];
|
|
9816
|
+
if (secondStr) {
|
|
9817
|
+
result.push(parseInt(secondStr, 10));
|
|
9818
|
+
}
|
|
9819
|
+
return result;
|
|
9820
|
+
}
|
|
9821
|
+
function untruncateYear(yearStr) {
|
|
9822
|
+
var year = parseInt(yearStr, 10);
|
|
9823
|
+
if (year <= 49) {
|
|
9824
|
+
return 2e3 + year;
|
|
9825
|
+
} else if (year <= 999) {
|
|
9826
|
+
return 1900 + year;
|
|
9827
|
+
}
|
|
9828
|
+
return year;
|
|
9829
|
+
}
|
|
9830
|
+
function preprocessRFC2822(s) {
|
|
9831
|
+
return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
|
|
9832
|
+
}
|
|
9833
|
+
function checkWeekday(weekdayStr, parsedInput, config) {
|
|
9834
|
+
if (weekdayStr) {
|
|
9835
|
+
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
|
|
9836
|
+
parsedInput[0],
|
|
9837
|
+
parsedInput[1],
|
|
9838
|
+
parsedInput[2]
|
|
9839
|
+
).getDay();
|
|
9840
|
+
if (weekdayProvided !== weekdayActual) {
|
|
9841
|
+
getParsingFlags(config).weekdayMismatch = true;
|
|
9842
|
+
config._isValid = false;
|
|
9843
|
+
return false;
|
|
9844
|
+
}
|
|
9845
|
+
}
|
|
9846
|
+
return true;
|
|
9847
|
+
}
|
|
9848
|
+
function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
|
9849
|
+
if (obsOffset) {
|
|
9850
|
+
return obsOffsets[obsOffset];
|
|
9851
|
+
} else if (militaryOffset) {
|
|
9852
|
+
return 0;
|
|
9853
|
+
} else {
|
|
9854
|
+
var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100;
|
|
9855
|
+
return h * 60 + m;
|
|
9856
|
+
}
|
|
9857
|
+
}
|
|
9858
|
+
function configFromRFC2822(config) {
|
|
9859
|
+
var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
|
|
9860
|
+
if (match) {
|
|
9861
|
+
parsedArray = extractFromRFC2822Strings(
|
|
9862
|
+
match[4],
|
|
9863
|
+
match[3],
|
|
9864
|
+
match[2],
|
|
9865
|
+
match[5],
|
|
9866
|
+
match[6],
|
|
9867
|
+
match[7]
|
|
9868
|
+
);
|
|
9869
|
+
if (!checkWeekday(match[1], parsedArray, config)) {
|
|
9870
|
+
return;
|
|
9871
|
+
}
|
|
9872
|
+
config._a = parsedArray;
|
|
9873
|
+
config._tzm = calculateOffset(match[8], match[9], match[10]);
|
|
9874
|
+
config._d = createUTCDate.apply(null, config._a);
|
|
9875
|
+
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
|
9876
|
+
getParsingFlags(config).rfc2822 = true;
|
|
9877
|
+
} else {
|
|
9878
|
+
config._isValid = false;
|
|
9879
|
+
}
|
|
9880
|
+
}
|
|
9881
|
+
function configFromString(config) {
|
|
9882
|
+
var matched = aspNetJsonRegex.exec(config._i);
|
|
9883
|
+
if (matched !== null) {
|
|
9884
|
+
config._d = /* @__PURE__ */ new Date(+matched[1]);
|
|
9885
|
+
return;
|
|
9886
|
+
}
|
|
9887
|
+
configFromISO(config);
|
|
9888
|
+
if (config._isValid === false) {
|
|
9889
|
+
delete config._isValid;
|
|
9890
|
+
} else {
|
|
9891
|
+
return;
|
|
9892
|
+
}
|
|
9893
|
+
configFromRFC2822(config);
|
|
9894
|
+
if (config._isValid === false) {
|
|
9895
|
+
delete config._isValid;
|
|
9896
|
+
} else {
|
|
9897
|
+
return;
|
|
9898
|
+
}
|
|
9899
|
+
if (config._strict) {
|
|
9900
|
+
config._isValid = false;
|
|
9901
|
+
} else {
|
|
9902
|
+
hooks.createFromInputFallback(config);
|
|
9903
|
+
}
|
|
9904
|
+
}
|
|
9905
|
+
hooks.createFromInputFallback = deprecate(
|
|
9906
|
+
"value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
|
|
9907
|
+
function(config) {
|
|
9908
|
+
config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
|
|
9909
|
+
}
|
|
9910
|
+
);
|
|
9911
|
+
function defaults(a, b, c) {
|
|
9912
|
+
if (a != null) {
|
|
9913
|
+
return a;
|
|
9914
|
+
}
|
|
9915
|
+
if (b != null) {
|
|
9916
|
+
return b;
|
|
9917
|
+
}
|
|
9918
|
+
return c;
|
|
9919
|
+
}
|
|
9920
|
+
function currentDateArray(config) {
|
|
9921
|
+
var nowValue = new Date(hooks.now());
|
|
9922
|
+
if (config._useUTC) {
|
|
9923
|
+
return [
|
|
9924
|
+
nowValue.getUTCFullYear(),
|
|
9925
|
+
nowValue.getUTCMonth(),
|
|
9926
|
+
nowValue.getUTCDate()
|
|
9927
|
+
];
|
|
9928
|
+
}
|
|
9929
|
+
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
|
9930
|
+
}
|
|
9931
|
+
function configFromArray(config) {
|
|
9932
|
+
var i, date, input = [], currentDate, expectedWeekday, yearToUse;
|
|
9933
|
+
if (config._d) {
|
|
9934
|
+
return;
|
|
9935
|
+
}
|
|
9936
|
+
currentDate = currentDateArray(config);
|
|
9937
|
+
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
|
9938
|
+
dayOfYearFromWeekInfo(config);
|
|
9939
|
+
}
|
|
9940
|
+
if (config._dayOfYear != null) {
|
|
9941
|
+
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
|
9942
|
+
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
|
9943
|
+
getParsingFlags(config)._overflowDayOfYear = true;
|
|
9944
|
+
}
|
|
9945
|
+
date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
|
9946
|
+
config._a[MONTH] = date.getUTCMonth();
|
|
9947
|
+
config._a[DATE] = date.getUTCDate();
|
|
9948
|
+
}
|
|
9949
|
+
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
|
9950
|
+
config._a[i] = input[i] = currentDate[i];
|
|
9951
|
+
}
|
|
9952
|
+
for (; i < 7; i++) {
|
|
9953
|
+
config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
|
|
9954
|
+
}
|
|
9955
|
+
if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
|
|
9956
|
+
config._nextDay = true;
|
|
9957
|
+
config._a[HOUR] = 0;
|
|
9958
|
+
}
|
|
9959
|
+
config._d = (config._useUTC ? createUTCDate : createDate).apply(
|
|
9960
|
+
null,
|
|
9961
|
+
input
|
|
9962
|
+
);
|
|
9963
|
+
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
|
|
9964
|
+
if (config._tzm != null) {
|
|
9965
|
+
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
|
9966
|
+
}
|
|
9967
|
+
if (config._nextDay) {
|
|
9968
|
+
config._a[HOUR] = 24;
|
|
9969
|
+
}
|
|
9970
|
+
if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
|
|
9971
|
+
getParsingFlags(config).weekdayMismatch = true;
|
|
9972
|
+
}
|
|
9973
|
+
}
|
|
9974
|
+
function dayOfYearFromWeekInfo(config) {
|
|
9975
|
+
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
|
|
9976
|
+
w = config._w;
|
|
9977
|
+
if (w.GG != null || w.W != null || w.E != null) {
|
|
9978
|
+
dow = 1;
|
|
9979
|
+
doy = 4;
|
|
9980
|
+
weekYear = defaults(
|
|
9981
|
+
w.GG,
|
|
9982
|
+
config._a[YEAR],
|
|
9983
|
+
weekOfYear(createLocal(), 1, 4).year
|
|
9984
|
+
);
|
|
9985
|
+
week = defaults(w.W, 1);
|
|
9986
|
+
weekday = defaults(w.E, 1);
|
|
9987
|
+
if (weekday < 1 || weekday > 7) {
|
|
9988
|
+
weekdayOverflow = true;
|
|
9989
|
+
}
|
|
9990
|
+
} else {
|
|
9991
|
+
dow = config._locale._week.dow;
|
|
9992
|
+
doy = config._locale._week.doy;
|
|
9993
|
+
curWeek = weekOfYear(createLocal(), dow, doy);
|
|
9994
|
+
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
|
9995
|
+
week = defaults(w.w, curWeek.week);
|
|
9996
|
+
if (w.d != null) {
|
|
9997
|
+
weekday = w.d;
|
|
9998
|
+
if (weekday < 0 || weekday > 6) {
|
|
9999
|
+
weekdayOverflow = true;
|
|
10000
|
+
}
|
|
10001
|
+
} else if (w.e != null) {
|
|
10002
|
+
weekday = w.e + dow;
|
|
10003
|
+
if (w.e < 0 || w.e > 6) {
|
|
10004
|
+
weekdayOverflow = true;
|
|
10005
|
+
}
|
|
10006
|
+
} else {
|
|
10007
|
+
weekday = dow;
|
|
10008
|
+
}
|
|
10009
|
+
}
|
|
10010
|
+
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
|
10011
|
+
getParsingFlags(config)._overflowWeeks = true;
|
|
10012
|
+
} else if (weekdayOverflow != null) {
|
|
10013
|
+
getParsingFlags(config)._overflowWeekday = true;
|
|
10014
|
+
} else {
|
|
10015
|
+
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
|
10016
|
+
config._a[YEAR] = temp.year;
|
|
10017
|
+
config._dayOfYear = temp.dayOfYear;
|
|
10018
|
+
}
|
|
10019
|
+
}
|
|
10020
|
+
hooks.ISO_8601 = function() {
|
|
10021
|
+
};
|
|
10022
|
+
hooks.RFC_2822 = function() {
|
|
10023
|
+
};
|
|
10024
|
+
function configFromStringAndFormat(config) {
|
|
10025
|
+
if (config._f === hooks.ISO_8601) {
|
|
10026
|
+
configFromISO(config);
|
|
10027
|
+
return;
|
|
10028
|
+
}
|
|
10029
|
+
if (config._f === hooks.RFC_2822) {
|
|
10030
|
+
configFromRFC2822(config);
|
|
10031
|
+
return;
|
|
10032
|
+
}
|
|
10033
|
+
config._a = [];
|
|
10034
|
+
getParsingFlags(config).empty = true;
|
|
10035
|
+
var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
|
|
10036
|
+
tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
10037
|
+
tokenLen = tokens2.length;
|
|
10038
|
+
for (i = 0; i < tokenLen; i++) {
|
|
10039
|
+
token2 = tokens2[i];
|
|
10040
|
+
parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
|
|
10041
|
+
if (parsedInput) {
|
|
10042
|
+
skipped = string.substr(0, string.indexOf(parsedInput));
|
|
10043
|
+
if (skipped.length > 0) {
|
|
10044
|
+
getParsingFlags(config).unusedInput.push(skipped);
|
|
10045
|
+
}
|
|
10046
|
+
string = string.slice(
|
|
10047
|
+
string.indexOf(parsedInput) + parsedInput.length
|
|
10048
|
+
);
|
|
10049
|
+
totalParsedInputLength += parsedInput.length;
|
|
10050
|
+
}
|
|
10051
|
+
if (formatTokenFunctions[token2]) {
|
|
10052
|
+
if (parsedInput) {
|
|
10053
|
+
getParsingFlags(config).empty = false;
|
|
10054
|
+
} else {
|
|
10055
|
+
getParsingFlags(config).unusedTokens.push(token2);
|
|
10056
|
+
}
|
|
10057
|
+
addTimeToArrayFromToken(token2, parsedInput, config);
|
|
10058
|
+
} else if (config._strict && !parsedInput) {
|
|
10059
|
+
getParsingFlags(config).unusedTokens.push(token2);
|
|
10060
|
+
}
|
|
10061
|
+
}
|
|
10062
|
+
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
|
|
10063
|
+
if (string.length > 0) {
|
|
10064
|
+
getParsingFlags(config).unusedInput.push(string);
|
|
10065
|
+
}
|
|
10066
|
+
if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
|
|
10067
|
+
getParsingFlags(config).bigHour = void 0;
|
|
10068
|
+
}
|
|
10069
|
+
getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
|
10070
|
+
getParsingFlags(config).meridiem = config._meridiem;
|
|
10071
|
+
config._a[HOUR] = meridiemFixWrap(
|
|
10072
|
+
config._locale,
|
|
10073
|
+
config._a[HOUR],
|
|
10074
|
+
config._meridiem
|
|
10075
|
+
);
|
|
10076
|
+
era = getParsingFlags(config).era;
|
|
10077
|
+
if (era !== null) {
|
|
10078
|
+
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
|
|
10079
|
+
}
|
|
10080
|
+
configFromArray(config);
|
|
10081
|
+
checkOverflow(config);
|
|
10082
|
+
}
|
|
10083
|
+
function meridiemFixWrap(locale2, hour, meridiem2) {
|
|
10084
|
+
var isPm;
|
|
10085
|
+
if (meridiem2 == null) {
|
|
10086
|
+
return hour;
|
|
10087
|
+
}
|
|
10088
|
+
if (locale2.meridiemHour != null) {
|
|
10089
|
+
return locale2.meridiemHour(hour, meridiem2);
|
|
10090
|
+
} else if (locale2.isPM != null) {
|
|
10091
|
+
isPm = locale2.isPM(meridiem2);
|
|
10092
|
+
if (isPm && hour < 12) {
|
|
10093
|
+
hour += 12;
|
|
10094
|
+
}
|
|
10095
|
+
if (!isPm && hour === 12) {
|
|
10096
|
+
hour = 0;
|
|
10097
|
+
}
|
|
10098
|
+
return hour;
|
|
10099
|
+
} else {
|
|
10100
|
+
return hour;
|
|
10101
|
+
}
|
|
10102
|
+
}
|
|
10103
|
+
function configFromStringAndArray(config) {
|
|
10104
|
+
var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
|
|
10105
|
+
if (configfLen === 0) {
|
|
10106
|
+
getParsingFlags(config).invalidFormat = true;
|
|
10107
|
+
config._d = /* @__PURE__ */ new Date(NaN);
|
|
10108
|
+
return;
|
|
10109
|
+
}
|
|
10110
|
+
for (i = 0; i < configfLen; i++) {
|
|
10111
|
+
currentScore = 0;
|
|
10112
|
+
validFormatFound = false;
|
|
10113
|
+
tempConfig = copyConfig({}, config);
|
|
10114
|
+
if (config._useUTC != null) {
|
|
10115
|
+
tempConfig._useUTC = config._useUTC;
|
|
10116
|
+
}
|
|
10117
|
+
tempConfig._f = config._f[i];
|
|
10118
|
+
configFromStringAndFormat(tempConfig);
|
|
10119
|
+
if (isValid(tempConfig)) {
|
|
10120
|
+
validFormatFound = true;
|
|
10121
|
+
}
|
|
10122
|
+
currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
|
10123
|
+
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
|
|
10124
|
+
getParsingFlags(tempConfig).score = currentScore;
|
|
10125
|
+
if (!bestFormatIsValid) {
|
|
10126
|
+
if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
|
|
10127
|
+
scoreToBeat = currentScore;
|
|
10128
|
+
bestMoment = tempConfig;
|
|
10129
|
+
if (validFormatFound) {
|
|
10130
|
+
bestFormatIsValid = true;
|
|
10131
|
+
}
|
|
10132
|
+
}
|
|
10133
|
+
} else {
|
|
10134
|
+
if (currentScore < scoreToBeat) {
|
|
10135
|
+
scoreToBeat = currentScore;
|
|
10136
|
+
bestMoment = tempConfig;
|
|
10137
|
+
}
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
extend(config, bestMoment || tempConfig);
|
|
10141
|
+
}
|
|
10142
|
+
function configFromObject(config) {
|
|
10143
|
+
if (config._d) {
|
|
10144
|
+
return;
|
|
10145
|
+
}
|
|
10146
|
+
var i = normalizeObjectUnits(config._i), dayOrDate = i.day === void 0 ? i.date : i.day;
|
|
10147
|
+
config._a = map(
|
|
10148
|
+
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
|
|
10149
|
+
function(obj) {
|
|
10150
|
+
return obj && parseInt(obj, 10);
|
|
10151
|
+
}
|
|
10152
|
+
);
|
|
10153
|
+
configFromArray(config);
|
|
10154
|
+
}
|
|
10155
|
+
function createFromConfig(config) {
|
|
10156
|
+
var res = new Moment(checkOverflow(prepareConfig(config)));
|
|
10157
|
+
if (res._nextDay) {
|
|
10158
|
+
res.add(1, "d");
|
|
10159
|
+
res._nextDay = void 0;
|
|
10160
|
+
}
|
|
10161
|
+
return res;
|
|
10162
|
+
}
|
|
10163
|
+
function prepareConfig(config) {
|
|
10164
|
+
var input = config._i, format2 = config._f;
|
|
10165
|
+
config._locale = config._locale || getLocale(config._l);
|
|
10166
|
+
if (input === null || format2 === void 0 && input === "") {
|
|
10167
|
+
return createInvalid({ nullInput: true });
|
|
10168
|
+
}
|
|
10169
|
+
if (typeof input === "string") {
|
|
10170
|
+
config._i = input = config._locale.preparse(input);
|
|
10171
|
+
}
|
|
10172
|
+
if (isMoment(input)) {
|
|
10173
|
+
return new Moment(checkOverflow(input));
|
|
10174
|
+
} else if (isDate(input)) {
|
|
10175
|
+
config._d = input;
|
|
10176
|
+
} else if (isArray(format2)) {
|
|
10177
|
+
configFromStringAndArray(config);
|
|
10178
|
+
} else if (format2) {
|
|
10179
|
+
configFromStringAndFormat(config);
|
|
10180
|
+
} else {
|
|
10181
|
+
configFromInput(config);
|
|
10182
|
+
}
|
|
10183
|
+
if (!isValid(config)) {
|
|
10184
|
+
config._d = null;
|
|
10185
|
+
}
|
|
10186
|
+
return config;
|
|
10187
|
+
}
|
|
10188
|
+
function configFromInput(config) {
|
|
10189
|
+
var input = config._i;
|
|
10190
|
+
if (isUndefined(input)) {
|
|
10191
|
+
config._d = new Date(hooks.now());
|
|
10192
|
+
} else if (isDate(input)) {
|
|
10193
|
+
config._d = new Date(input.valueOf());
|
|
10194
|
+
} else if (typeof input === "string") {
|
|
10195
|
+
configFromString(config);
|
|
10196
|
+
} else if (isArray(input)) {
|
|
10197
|
+
config._a = map(input.slice(0), function(obj) {
|
|
10198
|
+
return parseInt(obj, 10);
|
|
10199
|
+
});
|
|
10200
|
+
configFromArray(config);
|
|
10201
|
+
} else if (isObject(input)) {
|
|
10202
|
+
configFromObject(config);
|
|
10203
|
+
} else if (isNumber(input)) {
|
|
10204
|
+
config._d = new Date(input);
|
|
10205
|
+
} else {
|
|
10206
|
+
hooks.createFromInputFallback(config);
|
|
10207
|
+
}
|
|
10208
|
+
}
|
|
10209
|
+
function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
|
|
10210
|
+
var c = {};
|
|
10211
|
+
if (format2 === true || format2 === false) {
|
|
10212
|
+
strict = format2;
|
|
10213
|
+
format2 = void 0;
|
|
10214
|
+
}
|
|
10215
|
+
if (locale2 === true || locale2 === false) {
|
|
10216
|
+
strict = locale2;
|
|
10217
|
+
locale2 = void 0;
|
|
10218
|
+
}
|
|
10219
|
+
if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
|
|
10220
|
+
input = void 0;
|
|
10221
|
+
}
|
|
10222
|
+
c._isAMomentObject = true;
|
|
10223
|
+
c._useUTC = c._isUTC = isUTC;
|
|
10224
|
+
c._l = locale2;
|
|
10225
|
+
c._i = input;
|
|
10226
|
+
c._f = format2;
|
|
10227
|
+
c._strict = strict;
|
|
10228
|
+
return createFromConfig(c);
|
|
10229
|
+
}
|
|
10230
|
+
function createLocal(input, format2, locale2, strict) {
|
|
10231
|
+
return createLocalOrUTC(input, format2, locale2, strict, false);
|
|
10232
|
+
}
|
|
10233
|
+
var prototypeMin = deprecate(
|
|
10234
|
+
"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
|
|
10235
|
+
function() {
|
|
10236
|
+
var other = createLocal.apply(null, arguments);
|
|
10237
|
+
if (this.isValid() && other.isValid()) {
|
|
10238
|
+
return other < this ? this : other;
|
|
10239
|
+
} else {
|
|
10240
|
+
return createInvalid();
|
|
10241
|
+
}
|
|
10242
|
+
}
|
|
10243
|
+
), prototypeMax = deprecate(
|
|
10244
|
+
"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
|
|
10245
|
+
function() {
|
|
10246
|
+
var other = createLocal.apply(null, arguments);
|
|
10247
|
+
if (this.isValid() && other.isValid()) {
|
|
10248
|
+
return other > this ? this : other;
|
|
10249
|
+
} else {
|
|
10250
|
+
return createInvalid();
|
|
10251
|
+
}
|
|
10252
|
+
}
|
|
10253
|
+
);
|
|
10254
|
+
function pickBy(fn, moments) {
|
|
10255
|
+
var res, i;
|
|
10256
|
+
if (moments.length === 1 && isArray(moments[0])) {
|
|
10257
|
+
moments = moments[0];
|
|
10258
|
+
}
|
|
10259
|
+
if (!moments.length) {
|
|
10260
|
+
return createLocal();
|
|
10261
|
+
}
|
|
10262
|
+
res = moments[0];
|
|
10263
|
+
for (i = 1; i < moments.length; ++i) {
|
|
10264
|
+
if (!moments[i].isValid() || moments[i][fn](res)) {
|
|
10265
|
+
res = moments[i];
|
|
10266
|
+
}
|
|
10267
|
+
}
|
|
10268
|
+
return res;
|
|
10269
|
+
}
|
|
10270
|
+
function min() {
|
|
10271
|
+
var args = [].slice.call(arguments, 0);
|
|
10272
|
+
return pickBy("isBefore", args);
|
|
10273
|
+
}
|
|
10274
|
+
function max() {
|
|
10275
|
+
var args = [].slice.call(arguments, 0);
|
|
10276
|
+
return pickBy("isAfter", args);
|
|
10277
|
+
}
|
|
10278
|
+
var now = function() {
|
|
10279
|
+
return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
|
|
10280
|
+
};
|
|
10281
|
+
var ordering = [
|
|
10282
|
+
"year",
|
|
10283
|
+
"quarter",
|
|
10284
|
+
"month",
|
|
10285
|
+
"week",
|
|
10286
|
+
"day",
|
|
10287
|
+
"hour",
|
|
10288
|
+
"minute",
|
|
10289
|
+
"second",
|
|
10290
|
+
"millisecond"
|
|
10291
|
+
];
|
|
10292
|
+
function isDurationValid(m) {
|
|
10293
|
+
var key, unitHasDecimal = false, i, orderLen = ordering.length;
|
|
10294
|
+
for (key in m) {
|
|
10295
|
+
if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
|
|
10296
|
+
return false;
|
|
10297
|
+
}
|
|
10298
|
+
}
|
|
10299
|
+
for (i = 0; i < orderLen; ++i) {
|
|
10300
|
+
if (m[ordering[i]]) {
|
|
10301
|
+
if (unitHasDecimal) {
|
|
10302
|
+
return false;
|
|
10303
|
+
}
|
|
10304
|
+
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
|
|
10305
|
+
unitHasDecimal = true;
|
|
10306
|
+
}
|
|
10307
|
+
}
|
|
10308
|
+
}
|
|
10309
|
+
return true;
|
|
10310
|
+
}
|
|
10311
|
+
function isValid$1() {
|
|
10312
|
+
return this._isValid;
|
|
10313
|
+
}
|
|
10314
|
+
function createInvalid$1() {
|
|
10315
|
+
return createDuration(NaN);
|
|
10316
|
+
}
|
|
10317
|
+
function Duration(duration) {
|
|
10318
|
+
var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
|
|
10319
|
+
this._isValid = isDurationValid(normalizedInput);
|
|
10320
|
+
this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
|
|
10321
|
+
minutes2 * 6e4 + // 1000 * 60
|
|
10322
|
+
hours2 * 1e3 * 60 * 60;
|
|
10323
|
+
this._days = +days2 + weeks2 * 7;
|
|
10324
|
+
this._months = +months2 + quarters * 3 + years2 * 12;
|
|
10325
|
+
this._data = {};
|
|
10326
|
+
this._locale = getLocale();
|
|
10327
|
+
this._bubble();
|
|
10328
|
+
}
|
|
10329
|
+
function isDuration(obj) {
|
|
10330
|
+
return obj instanceof Duration;
|
|
10331
|
+
}
|
|
10332
|
+
function absRound(number2) {
|
|
10333
|
+
if (number2 < 0) {
|
|
10334
|
+
return Math.round(-1 * number2) * -1;
|
|
10335
|
+
} else {
|
|
10336
|
+
return Math.round(number2);
|
|
10337
|
+
}
|
|
10338
|
+
}
|
|
10339
|
+
function compareArrays(array1, array2, dontConvert) {
|
|
10340
|
+
var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
|
|
10341
|
+
for (i = 0; i < len; i++) {
|
|
10342
|
+
if (toInt(array1[i]) !== toInt(array2[i])) {
|
|
10343
|
+
diffs++;
|
|
10344
|
+
}
|
|
10345
|
+
}
|
|
10346
|
+
return diffs + lengthDiff;
|
|
10347
|
+
}
|
|
10348
|
+
function offset(token2, separator) {
|
|
10349
|
+
addFormatToken(token2, 0, 0, function() {
|
|
10350
|
+
var offset2 = this.utcOffset(), sign2 = "+";
|
|
10351
|
+
if (offset2 < 0) {
|
|
10352
|
+
offset2 = -offset2;
|
|
10353
|
+
sign2 = "-";
|
|
10354
|
+
}
|
|
10355
|
+
return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
|
|
10356
|
+
});
|
|
10357
|
+
}
|
|
10358
|
+
offset("Z", ":");
|
|
10359
|
+
offset("ZZ", "");
|
|
10360
|
+
addRegexToken("Z", matchShortOffset);
|
|
10361
|
+
addRegexToken("ZZ", matchShortOffset);
|
|
10362
|
+
addParseToken(["Z", "ZZ"], function(input, array, config) {
|
|
10363
|
+
config._useUTC = true;
|
|
10364
|
+
config._tzm = offsetFromString(matchShortOffset, input);
|
|
10365
|
+
});
|
|
10366
|
+
var chunkOffset = /([\+\-]|\d\d)/gi;
|
|
10367
|
+
function offsetFromString(matcher, string) {
|
|
10368
|
+
var matches = (string || "").match(matcher), chunk, parts, minutes2;
|
|
10369
|
+
if (matches === null) {
|
|
10370
|
+
return null;
|
|
10371
|
+
}
|
|
10372
|
+
chunk = matches[matches.length - 1] || [];
|
|
10373
|
+
parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
|
|
10374
|
+
minutes2 = +(parts[1] * 60) + toInt(parts[2]);
|
|
10375
|
+
return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
|
|
10376
|
+
}
|
|
10377
|
+
function cloneWithOffset(input, model) {
|
|
10378
|
+
var res, diff2;
|
|
10379
|
+
if (model._isUTC) {
|
|
10380
|
+
res = model.clone();
|
|
10381
|
+
diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
|
|
10382
|
+
res._d.setTime(res._d.valueOf() + diff2);
|
|
10383
|
+
hooks.updateOffset(res, false);
|
|
10384
|
+
return res;
|
|
10385
|
+
} else {
|
|
10386
|
+
return createLocal(input).local();
|
|
10387
|
+
}
|
|
10388
|
+
}
|
|
10389
|
+
function getDateOffset(m) {
|
|
10390
|
+
return -Math.round(m._d.getTimezoneOffset());
|
|
10391
|
+
}
|
|
10392
|
+
hooks.updateOffset = function() {
|
|
10393
|
+
};
|
|
10394
|
+
function getSetOffset(input, keepLocalTime, keepMinutes) {
|
|
10395
|
+
var offset2 = this._offset || 0, localAdjust;
|
|
10396
|
+
if (!this.isValid()) {
|
|
10397
|
+
return input != null ? this : NaN;
|
|
10398
|
+
}
|
|
10399
|
+
if (input != null) {
|
|
10400
|
+
if (typeof input === "string") {
|
|
10401
|
+
input = offsetFromString(matchShortOffset, input);
|
|
10402
|
+
if (input === null) {
|
|
10403
|
+
return this;
|
|
10404
|
+
}
|
|
10405
|
+
} else if (Math.abs(input) < 16 && !keepMinutes) {
|
|
10406
|
+
input = input * 60;
|
|
10407
|
+
}
|
|
10408
|
+
if (!this._isUTC && keepLocalTime) {
|
|
10409
|
+
localAdjust = getDateOffset(this);
|
|
10410
|
+
}
|
|
10411
|
+
this._offset = input;
|
|
10412
|
+
this._isUTC = true;
|
|
10413
|
+
if (localAdjust != null) {
|
|
10414
|
+
this.add(localAdjust, "m");
|
|
10415
|
+
}
|
|
10416
|
+
if (offset2 !== input) {
|
|
10417
|
+
if (!keepLocalTime || this._changeInProgress) {
|
|
10418
|
+
addSubtract(
|
|
10419
|
+
this,
|
|
10420
|
+
createDuration(input - offset2, "m"),
|
|
10421
|
+
1,
|
|
10422
|
+
false
|
|
10423
|
+
);
|
|
10424
|
+
} else if (!this._changeInProgress) {
|
|
10425
|
+
this._changeInProgress = true;
|
|
10426
|
+
hooks.updateOffset(this, true);
|
|
10427
|
+
this._changeInProgress = null;
|
|
10428
|
+
}
|
|
10429
|
+
}
|
|
10430
|
+
return this;
|
|
10431
|
+
} else {
|
|
10432
|
+
return this._isUTC ? offset2 : getDateOffset(this);
|
|
10433
|
+
}
|
|
10434
|
+
}
|
|
10435
|
+
function getSetZone(input, keepLocalTime) {
|
|
10436
|
+
if (input != null) {
|
|
10437
|
+
if (typeof input !== "string") {
|
|
10438
|
+
input = -input;
|
|
10439
|
+
}
|
|
10440
|
+
this.utcOffset(input, keepLocalTime);
|
|
10441
|
+
return this;
|
|
10442
|
+
} else {
|
|
10443
|
+
return -this.utcOffset();
|
|
10444
|
+
}
|
|
10445
|
+
}
|
|
10446
|
+
function setOffsetToUTC(keepLocalTime) {
|
|
10447
|
+
return this.utcOffset(0, keepLocalTime);
|
|
10448
|
+
}
|
|
10449
|
+
function setOffsetToLocal(keepLocalTime) {
|
|
10450
|
+
if (this._isUTC) {
|
|
10451
|
+
this.utcOffset(0, keepLocalTime);
|
|
10452
|
+
this._isUTC = false;
|
|
10453
|
+
if (keepLocalTime) {
|
|
10454
|
+
this.subtract(getDateOffset(this), "m");
|
|
10455
|
+
}
|
|
10456
|
+
}
|
|
10457
|
+
return this;
|
|
10458
|
+
}
|
|
10459
|
+
function setOffsetToParsedOffset() {
|
|
10460
|
+
if (this._tzm != null) {
|
|
10461
|
+
this.utcOffset(this._tzm, false, true);
|
|
10462
|
+
} else if (typeof this._i === "string") {
|
|
10463
|
+
var tZone = offsetFromString(matchOffset, this._i);
|
|
10464
|
+
if (tZone != null) {
|
|
10465
|
+
this.utcOffset(tZone);
|
|
10466
|
+
} else {
|
|
10467
|
+
this.utcOffset(0, true);
|
|
10468
|
+
}
|
|
10469
|
+
}
|
|
10470
|
+
return this;
|
|
10471
|
+
}
|
|
10472
|
+
function hasAlignedHourOffset(input) {
|
|
10473
|
+
if (!this.isValid()) {
|
|
10474
|
+
return false;
|
|
10475
|
+
}
|
|
10476
|
+
input = input ? createLocal(input).utcOffset() : 0;
|
|
10477
|
+
return (this.utcOffset() - input) % 60 === 0;
|
|
10478
|
+
}
|
|
10479
|
+
function isDaylightSavingTime() {
|
|
10480
|
+
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
|
|
10481
|
+
}
|
|
10482
|
+
function isDaylightSavingTimeShifted() {
|
|
10483
|
+
if (!isUndefined(this._isDSTShifted)) {
|
|
10484
|
+
return this._isDSTShifted;
|
|
10485
|
+
}
|
|
10486
|
+
var c = {}, other;
|
|
10487
|
+
copyConfig(c, this);
|
|
10488
|
+
c = prepareConfig(c);
|
|
10489
|
+
if (c._a) {
|
|
10490
|
+
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
|
10491
|
+
this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
|
10492
|
+
} else {
|
|
10493
|
+
this._isDSTShifted = false;
|
|
10494
|
+
}
|
|
10495
|
+
return this._isDSTShifted;
|
|
10496
|
+
}
|
|
10497
|
+
function isLocal() {
|
|
10498
|
+
return this.isValid() ? !this._isUTC : false;
|
|
10499
|
+
}
|
|
10500
|
+
function isUtcOffset() {
|
|
10501
|
+
return this.isValid() ? this._isUTC : false;
|
|
10502
|
+
}
|
|
10503
|
+
function isUtc() {
|
|
10504
|
+
return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
|
10505
|
+
}
|
|
10506
|
+
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
10507
|
+
function createDuration(input, key) {
|
|
10508
|
+
var duration = input, match = null, sign2, ret, diffRes;
|
|
10509
|
+
if (isDuration(input)) {
|
|
10510
|
+
duration = {
|
|
10511
|
+
ms: input._milliseconds,
|
|
10512
|
+
d: input._days,
|
|
10513
|
+
M: input._months
|
|
10514
|
+
};
|
|
10515
|
+
} else if (isNumber(input) || !isNaN(+input)) {
|
|
10516
|
+
duration = {};
|
|
10517
|
+
if (key) {
|
|
10518
|
+
duration[key] = +input;
|
|
10519
|
+
} else {
|
|
10520
|
+
duration.milliseconds = +input;
|
|
10521
|
+
}
|
|
10522
|
+
} else if (match = aspNetRegex.exec(input)) {
|
|
10523
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
10524
|
+
duration = {
|
|
10525
|
+
y: 0,
|
|
10526
|
+
d: toInt(match[DATE]) * sign2,
|
|
10527
|
+
h: toInt(match[HOUR]) * sign2,
|
|
10528
|
+
m: toInt(match[MINUTE]) * sign2,
|
|
10529
|
+
s: toInt(match[SECOND]) * sign2,
|
|
10530
|
+
ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
|
|
10531
|
+
// the millisecond decimal point is included in the match
|
|
10532
|
+
};
|
|
10533
|
+
} else if (match = isoRegex.exec(input)) {
|
|
10534
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
10535
|
+
duration = {
|
|
10536
|
+
y: parseIso(match[2], sign2),
|
|
10537
|
+
M: parseIso(match[3], sign2),
|
|
10538
|
+
w: parseIso(match[4], sign2),
|
|
10539
|
+
d: parseIso(match[5], sign2),
|
|
10540
|
+
h: parseIso(match[6], sign2),
|
|
10541
|
+
m: parseIso(match[7], sign2),
|
|
10542
|
+
s: parseIso(match[8], sign2)
|
|
10543
|
+
};
|
|
10544
|
+
} else if (duration == null) {
|
|
10545
|
+
duration = {};
|
|
10546
|
+
} else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
|
|
10547
|
+
diffRes = momentsDifference(
|
|
10548
|
+
createLocal(duration.from),
|
|
10549
|
+
createLocal(duration.to)
|
|
10550
|
+
);
|
|
10551
|
+
duration = {};
|
|
10552
|
+
duration.ms = diffRes.milliseconds;
|
|
10553
|
+
duration.M = diffRes.months;
|
|
10554
|
+
}
|
|
10555
|
+
ret = new Duration(duration);
|
|
10556
|
+
if (isDuration(input) && hasOwnProp(input, "_locale")) {
|
|
10557
|
+
ret._locale = input._locale;
|
|
10558
|
+
}
|
|
10559
|
+
if (isDuration(input) && hasOwnProp(input, "_isValid")) {
|
|
10560
|
+
ret._isValid = input._isValid;
|
|
10561
|
+
}
|
|
10562
|
+
return ret;
|
|
10563
|
+
}
|
|
10564
|
+
createDuration.fn = Duration.prototype;
|
|
10565
|
+
createDuration.invalid = createInvalid$1;
|
|
10566
|
+
function parseIso(inp, sign2) {
|
|
10567
|
+
var res = inp && parseFloat(inp.replace(",", "."));
|
|
10568
|
+
return (isNaN(res) ? 0 : res) * sign2;
|
|
10569
|
+
}
|
|
10570
|
+
function positiveMomentsDifference(base, other) {
|
|
10571
|
+
var res = {};
|
|
10572
|
+
res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
|
|
10573
|
+
if (base.clone().add(res.months, "M").isAfter(other)) {
|
|
10574
|
+
--res.months;
|
|
10575
|
+
}
|
|
10576
|
+
res.milliseconds = +other - +base.clone().add(res.months, "M");
|
|
10577
|
+
return res;
|
|
10578
|
+
}
|
|
10579
|
+
function momentsDifference(base, other) {
|
|
10580
|
+
var res;
|
|
10581
|
+
if (!(base.isValid() && other.isValid())) {
|
|
10582
|
+
return { milliseconds: 0, months: 0 };
|
|
10583
|
+
}
|
|
10584
|
+
other = cloneWithOffset(other, base);
|
|
10585
|
+
if (base.isBefore(other)) {
|
|
10586
|
+
res = positiveMomentsDifference(base, other);
|
|
10587
|
+
} else {
|
|
10588
|
+
res = positiveMomentsDifference(other, base);
|
|
10589
|
+
res.milliseconds = -res.milliseconds;
|
|
10590
|
+
res.months = -res.months;
|
|
10591
|
+
}
|
|
10592
|
+
return res;
|
|
10593
|
+
}
|
|
10594
|
+
function createAdder(direction, name) {
|
|
10595
|
+
return function(val, period) {
|
|
10596
|
+
var dur, tmp;
|
|
10597
|
+
if (period !== null && !isNaN(+period)) {
|
|
10598
|
+
deprecateSimple(
|
|
10599
|
+
name,
|
|
10600
|
+
"moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
|
|
10601
|
+
);
|
|
10602
|
+
tmp = val;
|
|
10603
|
+
val = period;
|
|
10604
|
+
period = tmp;
|
|
10605
|
+
}
|
|
10606
|
+
dur = createDuration(val, period);
|
|
10607
|
+
addSubtract(this, dur, direction);
|
|
10608
|
+
return this;
|
|
10609
|
+
};
|
|
10610
|
+
}
|
|
10611
|
+
function addSubtract(mom, duration, isAdding, updateOffset) {
|
|
10612
|
+
var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
|
|
10613
|
+
if (!mom.isValid()) {
|
|
10614
|
+
return;
|
|
10615
|
+
}
|
|
10616
|
+
updateOffset = updateOffset == null ? true : updateOffset;
|
|
10617
|
+
if (months2) {
|
|
10618
|
+
setMonth(mom, get(mom, "Month") + months2 * isAdding);
|
|
10619
|
+
}
|
|
10620
|
+
if (days2) {
|
|
10621
|
+
set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
|
|
10622
|
+
}
|
|
10623
|
+
if (milliseconds2) {
|
|
10624
|
+
mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
|
|
10625
|
+
}
|
|
10626
|
+
if (updateOffset) {
|
|
10627
|
+
hooks.updateOffset(mom, days2 || months2);
|
|
10628
|
+
}
|
|
10629
|
+
}
|
|
10630
|
+
var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
|
|
10631
|
+
function isString(input) {
|
|
10632
|
+
return typeof input === "string" || input instanceof String;
|
|
10633
|
+
}
|
|
10634
|
+
function isMomentInput(input) {
|
|
10635
|
+
return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
|
|
10636
|
+
}
|
|
10637
|
+
function isMomentInputObject(input) {
|
|
10638
|
+
var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
|
|
10639
|
+
"years",
|
|
10640
|
+
"year",
|
|
10641
|
+
"y",
|
|
10642
|
+
"months",
|
|
10643
|
+
"month",
|
|
10644
|
+
"M",
|
|
10645
|
+
"days",
|
|
10646
|
+
"day",
|
|
10647
|
+
"d",
|
|
10648
|
+
"dates",
|
|
10649
|
+
"date",
|
|
10650
|
+
"D",
|
|
10651
|
+
"hours",
|
|
10652
|
+
"hour",
|
|
10653
|
+
"h",
|
|
10654
|
+
"minutes",
|
|
10655
|
+
"minute",
|
|
10656
|
+
"m",
|
|
10657
|
+
"seconds",
|
|
10658
|
+
"second",
|
|
10659
|
+
"s",
|
|
10660
|
+
"milliseconds",
|
|
10661
|
+
"millisecond",
|
|
10662
|
+
"ms"
|
|
10663
|
+
], i, property, propertyLen = properties.length;
|
|
10664
|
+
for (i = 0; i < propertyLen; i += 1) {
|
|
10665
|
+
property = properties[i];
|
|
10666
|
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
10667
|
+
}
|
|
10668
|
+
return objectTest && propertyTest;
|
|
10669
|
+
}
|
|
10670
|
+
function isNumberOrStringArray(input) {
|
|
10671
|
+
var arrayTest = isArray(input), dataTypeTest = false;
|
|
10672
|
+
if (arrayTest) {
|
|
10673
|
+
dataTypeTest = input.filter(function(item) {
|
|
10674
|
+
return !isNumber(item) && isString(input);
|
|
10675
|
+
}).length === 0;
|
|
10676
|
+
}
|
|
10677
|
+
return arrayTest && dataTypeTest;
|
|
10678
|
+
}
|
|
10679
|
+
function isCalendarSpec(input) {
|
|
10680
|
+
var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
|
|
10681
|
+
"sameDay",
|
|
10682
|
+
"nextDay",
|
|
10683
|
+
"lastDay",
|
|
10684
|
+
"nextWeek",
|
|
10685
|
+
"lastWeek",
|
|
10686
|
+
"sameElse"
|
|
10687
|
+
], i, property;
|
|
10688
|
+
for (i = 0; i < properties.length; i += 1) {
|
|
10689
|
+
property = properties[i];
|
|
10690
|
+
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
10691
|
+
}
|
|
10692
|
+
return objectTest && propertyTest;
|
|
10693
|
+
}
|
|
10694
|
+
function getCalendarFormat(myMoment, now2) {
|
|
10695
|
+
var diff2 = myMoment.diff(now2, "days", true);
|
|
10696
|
+
return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
|
|
10697
|
+
}
|
|
10698
|
+
function calendar$1(time2, formats) {
|
|
10699
|
+
if (arguments.length === 1) {
|
|
10700
|
+
if (!arguments[0]) {
|
|
10701
|
+
time2 = void 0;
|
|
10702
|
+
formats = void 0;
|
|
10703
|
+
} else if (isMomentInput(arguments[0])) {
|
|
10704
|
+
time2 = arguments[0];
|
|
10705
|
+
formats = void 0;
|
|
10706
|
+
} else if (isCalendarSpec(arguments[0])) {
|
|
10707
|
+
formats = arguments[0];
|
|
10708
|
+
time2 = void 0;
|
|
10709
|
+
}
|
|
10710
|
+
}
|
|
10711
|
+
var now2 = time2 || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
|
|
10712
|
+
return this.format(
|
|
10713
|
+
output || this.localeData().calendar(format2, this, createLocal(now2))
|
|
10714
|
+
);
|
|
10715
|
+
}
|
|
10716
|
+
function clone() {
|
|
10717
|
+
return new Moment(this);
|
|
10718
|
+
}
|
|
10719
|
+
function isAfter(input, units) {
|
|
10720
|
+
var localInput = isMoment(input) ? input : createLocal(input);
|
|
10721
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10722
|
+
return false;
|
|
10723
|
+
}
|
|
10724
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10725
|
+
if (units === "millisecond") {
|
|
10726
|
+
return this.valueOf() > localInput.valueOf();
|
|
10727
|
+
} else {
|
|
10728
|
+
return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
|
10729
|
+
}
|
|
10730
|
+
}
|
|
10731
|
+
function isBefore(input, units) {
|
|
10732
|
+
var localInput = isMoment(input) ? input : createLocal(input);
|
|
10733
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10734
|
+
return false;
|
|
10735
|
+
}
|
|
10736
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10737
|
+
if (units === "millisecond") {
|
|
10738
|
+
return this.valueOf() < localInput.valueOf();
|
|
10739
|
+
} else {
|
|
10740
|
+
return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
|
10741
|
+
}
|
|
10742
|
+
}
|
|
10743
|
+
function isBetween(from2, to2, units, inclusivity) {
|
|
10744
|
+
var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
|
|
10745
|
+
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
|
10746
|
+
return false;
|
|
10747
|
+
}
|
|
10748
|
+
inclusivity = inclusivity || "()";
|
|
10749
|
+
return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
|
|
10750
|
+
}
|
|
10751
|
+
function isSame(input, units) {
|
|
10752
|
+
var localInput = isMoment(input) ? input : createLocal(input), inputMs;
|
|
10753
|
+
if (!(this.isValid() && localInput.isValid())) {
|
|
10754
|
+
return false;
|
|
10755
|
+
}
|
|
10756
|
+
units = normalizeUnits(units) || "millisecond";
|
|
10757
|
+
if (units === "millisecond") {
|
|
10758
|
+
return this.valueOf() === localInput.valueOf();
|
|
10759
|
+
} else {
|
|
10760
|
+
inputMs = localInput.valueOf();
|
|
10761
|
+
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
|
|
10762
|
+
}
|
|
10763
|
+
}
|
|
10764
|
+
function isSameOrAfter(input, units) {
|
|
10765
|
+
return this.isSame(input, units) || this.isAfter(input, units);
|
|
10766
|
+
}
|
|
10767
|
+
function isSameOrBefore(input, units) {
|
|
10768
|
+
return this.isSame(input, units) || this.isBefore(input, units);
|
|
10769
|
+
}
|
|
10770
|
+
function diff(input, units, asFloat) {
|
|
10771
|
+
var that, zoneDelta, output;
|
|
10772
|
+
if (!this.isValid()) {
|
|
10773
|
+
return NaN;
|
|
10774
|
+
}
|
|
10775
|
+
that = cloneWithOffset(input, this);
|
|
10776
|
+
if (!that.isValid()) {
|
|
10777
|
+
return NaN;
|
|
10778
|
+
}
|
|
10779
|
+
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
|
10780
|
+
units = normalizeUnits(units);
|
|
10781
|
+
switch (units) {
|
|
10782
|
+
case "year":
|
|
10783
|
+
output = monthDiff(this, that) / 12;
|
|
10784
|
+
break;
|
|
10785
|
+
case "month":
|
|
10786
|
+
output = monthDiff(this, that);
|
|
10787
|
+
break;
|
|
10788
|
+
case "quarter":
|
|
10789
|
+
output = monthDiff(this, that) / 3;
|
|
10790
|
+
break;
|
|
10791
|
+
case "second":
|
|
10792
|
+
output = (this - that) / 1e3;
|
|
10793
|
+
break;
|
|
10794
|
+
// 1000
|
|
10795
|
+
case "minute":
|
|
10796
|
+
output = (this - that) / 6e4;
|
|
10797
|
+
break;
|
|
10798
|
+
// 1000 * 60
|
|
10799
|
+
case "hour":
|
|
10800
|
+
output = (this - that) / 36e5;
|
|
10801
|
+
break;
|
|
10802
|
+
// 1000 * 60 * 60
|
|
10803
|
+
case "day":
|
|
10804
|
+
output = (this - that - zoneDelta) / 864e5;
|
|
10805
|
+
break;
|
|
10806
|
+
// 1000 * 60 * 60 * 24, negate dst
|
|
10807
|
+
case "week":
|
|
10808
|
+
output = (this - that - zoneDelta) / 6048e5;
|
|
10809
|
+
break;
|
|
10810
|
+
// 1000 * 60 * 60 * 24 * 7, negate dst
|
|
10811
|
+
default:
|
|
10812
|
+
output = this - that;
|
|
10813
|
+
}
|
|
10814
|
+
return asFloat ? output : absFloor(output);
|
|
10815
|
+
}
|
|
10816
|
+
function monthDiff(a, b) {
|
|
10817
|
+
if (a.date() < b.date()) {
|
|
10818
|
+
return -monthDiff(b, a);
|
|
10819
|
+
}
|
|
10820
|
+
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
|
|
10821
|
+
if (b - anchor < 0) {
|
|
10822
|
+
anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
|
|
10823
|
+
adjust = (b - anchor) / (anchor - anchor2);
|
|
10824
|
+
} else {
|
|
10825
|
+
anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
|
|
10826
|
+
adjust = (b - anchor) / (anchor2 - anchor);
|
|
10827
|
+
}
|
|
10828
|
+
return -(wholeMonthDiff + adjust) || 0;
|
|
10829
|
+
}
|
|
10830
|
+
hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
|
|
10831
|
+
hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
|
|
10832
|
+
function toString() {
|
|
10833
|
+
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
|
|
10834
|
+
}
|
|
10835
|
+
function toISOString(keepOffset) {
|
|
10836
|
+
if (!this.isValid()) {
|
|
10837
|
+
return null;
|
|
10838
|
+
}
|
|
10839
|
+
var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
|
|
10840
|
+
if (m.year() < 0 || m.year() > 9999) {
|
|
10841
|
+
return formatMoment(
|
|
10842
|
+
m,
|
|
10843
|
+
utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
|
|
10844
|
+
);
|
|
10845
|
+
}
|
|
10846
|
+
if (isFunction(Date.prototype.toISOString)) {
|
|
10847
|
+
if (utc) {
|
|
10848
|
+
return this.toDate().toISOString();
|
|
10849
|
+
} else {
|
|
10850
|
+
return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
|
|
10851
|
+
}
|
|
10852
|
+
}
|
|
10853
|
+
return formatMoment(
|
|
10854
|
+
m,
|
|
10855
|
+
utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
|
|
10856
|
+
);
|
|
10857
|
+
}
|
|
10858
|
+
function inspect() {
|
|
10859
|
+
if (!this.isValid()) {
|
|
10860
|
+
return "moment.invalid(/* " + this._i + " */)";
|
|
10861
|
+
}
|
|
10862
|
+
var func = "moment", zone = "", prefix, year, datetime, suffix;
|
|
10863
|
+
if (!this.isLocal()) {
|
|
10864
|
+
func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
|
|
10865
|
+
zone = "Z";
|
|
10866
|
+
}
|
|
10867
|
+
prefix = "[" + func + '("]';
|
|
10868
|
+
year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
|
|
10869
|
+
datetime = "-MM-DD[T]HH:mm:ss.SSS";
|
|
10870
|
+
suffix = zone + '[")]';
|
|
10871
|
+
return this.format(prefix + year + datetime + suffix);
|
|
10872
|
+
}
|
|
10873
|
+
function format(inputString) {
|
|
10874
|
+
if (!inputString) {
|
|
10875
|
+
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
|
|
10876
|
+
}
|
|
10877
|
+
var output = formatMoment(this, inputString);
|
|
10878
|
+
return this.localeData().postformat(output);
|
|
10879
|
+
}
|
|
10880
|
+
function from(time2, withoutSuffix) {
|
|
10881
|
+
if (this.isValid() && (isMoment(time2) && time2.isValid() || createLocal(time2).isValid())) {
|
|
10882
|
+
return createDuration({ to: this, from: time2 }).locale(this.locale()).humanize(!withoutSuffix);
|
|
10883
|
+
} else {
|
|
10884
|
+
return this.localeData().invalidDate();
|
|
10885
|
+
}
|
|
10886
|
+
}
|
|
10887
|
+
function fromNow(withoutSuffix) {
|
|
10888
|
+
return this.from(createLocal(), withoutSuffix);
|
|
10889
|
+
}
|
|
10890
|
+
function to(time2, withoutSuffix) {
|
|
10891
|
+
if (this.isValid() && (isMoment(time2) && time2.isValid() || createLocal(time2).isValid())) {
|
|
10892
|
+
return createDuration({ from: this, to: time2 }).locale(this.locale()).humanize(!withoutSuffix);
|
|
10893
|
+
} else {
|
|
10894
|
+
return this.localeData().invalidDate();
|
|
10895
|
+
}
|
|
10896
|
+
}
|
|
10897
|
+
function toNow(withoutSuffix) {
|
|
10898
|
+
return this.to(createLocal(), withoutSuffix);
|
|
10899
|
+
}
|
|
10900
|
+
function locale(key) {
|
|
10901
|
+
var newLocaleData;
|
|
10902
|
+
if (key === void 0) {
|
|
10903
|
+
return this._locale._abbr;
|
|
10904
|
+
} else {
|
|
10905
|
+
newLocaleData = getLocale(key);
|
|
10906
|
+
if (newLocaleData != null) {
|
|
10907
|
+
this._locale = newLocaleData;
|
|
10908
|
+
}
|
|
10909
|
+
return this;
|
|
10910
|
+
}
|
|
10911
|
+
}
|
|
10912
|
+
var lang = deprecate(
|
|
10913
|
+
"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
|
|
10914
|
+
function(key) {
|
|
10915
|
+
if (key === void 0) {
|
|
10916
|
+
return this.localeData();
|
|
10917
|
+
} else {
|
|
10918
|
+
return this.locale(key);
|
|
10919
|
+
}
|
|
10920
|
+
}
|
|
10921
|
+
);
|
|
10922
|
+
function localeData() {
|
|
10923
|
+
return this._locale;
|
|
10924
|
+
}
|
|
10925
|
+
var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
|
10926
|
+
function mod$1(dividend, divisor) {
|
|
10927
|
+
return (dividend % divisor + divisor) % divisor;
|
|
10928
|
+
}
|
|
10929
|
+
function localStartOfDate(y, m, d) {
|
|
10930
|
+
if (y < 100 && y >= 0) {
|
|
10931
|
+
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
|
10932
|
+
} else {
|
|
10933
|
+
return new Date(y, m, d).valueOf();
|
|
10934
|
+
}
|
|
10935
|
+
}
|
|
10936
|
+
function utcStartOfDate(y, m, d) {
|
|
10937
|
+
if (y < 100 && y >= 0) {
|
|
10938
|
+
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
|
10939
|
+
} else {
|
|
10940
|
+
return Date.UTC(y, m, d);
|
|
10941
|
+
}
|
|
10942
|
+
}
|
|
10943
|
+
function startOf(units) {
|
|
10944
|
+
var time2, startOfDate;
|
|
10945
|
+
units = normalizeUnits(units);
|
|
10946
|
+
if (units === void 0 || units === "millisecond" || !this.isValid()) {
|
|
10947
|
+
return this;
|
|
10948
|
+
}
|
|
10949
|
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
|
10950
|
+
switch (units) {
|
|
10951
|
+
case "year":
|
|
10952
|
+
time2 = startOfDate(this.year(), 0, 1);
|
|
10953
|
+
break;
|
|
10954
|
+
case "quarter":
|
|
10955
|
+
time2 = startOfDate(
|
|
10956
|
+
this.year(),
|
|
10957
|
+
this.month() - this.month() % 3,
|
|
10958
|
+
1
|
|
10959
|
+
);
|
|
10960
|
+
break;
|
|
10961
|
+
case "month":
|
|
10962
|
+
time2 = startOfDate(this.year(), this.month(), 1);
|
|
10963
|
+
break;
|
|
10964
|
+
case "week":
|
|
10965
|
+
time2 = startOfDate(
|
|
10966
|
+
this.year(),
|
|
10967
|
+
this.month(),
|
|
10968
|
+
this.date() - this.weekday()
|
|
10969
|
+
);
|
|
10970
|
+
break;
|
|
10971
|
+
case "isoWeek":
|
|
10972
|
+
time2 = startOfDate(
|
|
10973
|
+
this.year(),
|
|
10974
|
+
this.month(),
|
|
10975
|
+
this.date() - (this.isoWeekday() - 1)
|
|
10976
|
+
);
|
|
10977
|
+
break;
|
|
10978
|
+
case "day":
|
|
10979
|
+
case "date":
|
|
10980
|
+
time2 = startOfDate(this.year(), this.month(), this.date());
|
|
10981
|
+
break;
|
|
10982
|
+
case "hour":
|
|
10983
|
+
time2 = this._d.valueOf();
|
|
10984
|
+
time2 -= mod$1(
|
|
10985
|
+
time2 + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
10986
|
+
MS_PER_HOUR
|
|
10987
|
+
);
|
|
10988
|
+
break;
|
|
10989
|
+
case "minute":
|
|
10990
|
+
time2 = this._d.valueOf();
|
|
10991
|
+
time2 -= mod$1(time2, MS_PER_MINUTE);
|
|
10992
|
+
break;
|
|
10993
|
+
case "second":
|
|
10994
|
+
time2 = this._d.valueOf();
|
|
10995
|
+
time2 -= mod$1(time2, MS_PER_SECOND);
|
|
10996
|
+
break;
|
|
10997
|
+
}
|
|
10998
|
+
this._d.setTime(time2);
|
|
10999
|
+
hooks.updateOffset(this, true);
|
|
11000
|
+
return this;
|
|
11001
|
+
}
|
|
11002
|
+
function endOf(units) {
|
|
11003
|
+
var time2, startOfDate;
|
|
11004
|
+
units = normalizeUnits(units);
|
|
11005
|
+
if (units === void 0 || units === "millisecond" || !this.isValid()) {
|
|
11006
|
+
return this;
|
|
11007
|
+
}
|
|
11008
|
+
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
|
11009
|
+
switch (units) {
|
|
11010
|
+
case "year":
|
|
11011
|
+
time2 = startOfDate(this.year() + 1, 0, 1) - 1;
|
|
11012
|
+
break;
|
|
11013
|
+
case "quarter":
|
|
11014
|
+
time2 = startOfDate(
|
|
11015
|
+
this.year(),
|
|
11016
|
+
this.month() - this.month() % 3 + 3,
|
|
11017
|
+
1
|
|
11018
|
+
) - 1;
|
|
11019
|
+
break;
|
|
11020
|
+
case "month":
|
|
11021
|
+
time2 = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
|
11022
|
+
break;
|
|
11023
|
+
case "week":
|
|
11024
|
+
time2 = startOfDate(
|
|
11025
|
+
this.year(),
|
|
11026
|
+
this.month(),
|
|
11027
|
+
this.date() - this.weekday() + 7
|
|
11028
|
+
) - 1;
|
|
11029
|
+
break;
|
|
11030
|
+
case "isoWeek":
|
|
11031
|
+
time2 = startOfDate(
|
|
11032
|
+
this.year(),
|
|
11033
|
+
this.month(),
|
|
11034
|
+
this.date() - (this.isoWeekday() - 1) + 7
|
|
11035
|
+
) - 1;
|
|
11036
|
+
break;
|
|
11037
|
+
case "day":
|
|
11038
|
+
case "date":
|
|
11039
|
+
time2 = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
|
11040
|
+
break;
|
|
11041
|
+
case "hour":
|
|
11042
|
+
time2 = this._d.valueOf();
|
|
11043
|
+
time2 += MS_PER_HOUR - mod$1(
|
|
11044
|
+
time2 + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
11045
|
+
MS_PER_HOUR
|
|
11046
|
+
) - 1;
|
|
11047
|
+
break;
|
|
11048
|
+
case "minute":
|
|
11049
|
+
time2 = this._d.valueOf();
|
|
11050
|
+
time2 += MS_PER_MINUTE - mod$1(time2, MS_PER_MINUTE) - 1;
|
|
11051
|
+
break;
|
|
11052
|
+
case "second":
|
|
11053
|
+
time2 = this._d.valueOf();
|
|
11054
|
+
time2 += MS_PER_SECOND - mod$1(time2, MS_PER_SECOND) - 1;
|
|
11055
|
+
break;
|
|
11056
|
+
}
|
|
11057
|
+
this._d.setTime(time2);
|
|
11058
|
+
hooks.updateOffset(this, true);
|
|
11059
|
+
return this;
|
|
11060
|
+
}
|
|
11061
|
+
function valueOf() {
|
|
11062
|
+
return this._d.valueOf() - (this._offset || 0) * 6e4;
|
|
11063
|
+
}
|
|
11064
|
+
function unix() {
|
|
11065
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
11066
|
+
}
|
|
11067
|
+
function toDate() {
|
|
11068
|
+
return new Date(this.valueOf());
|
|
11069
|
+
}
|
|
11070
|
+
function toArray() {
|
|
11071
|
+
var m = this;
|
|
11072
|
+
return [
|
|
11073
|
+
m.year(),
|
|
11074
|
+
m.month(),
|
|
11075
|
+
m.date(),
|
|
11076
|
+
m.hour(),
|
|
11077
|
+
m.minute(),
|
|
11078
|
+
m.second(),
|
|
11079
|
+
m.millisecond()
|
|
11080
|
+
];
|
|
11081
|
+
}
|
|
11082
|
+
function toObject() {
|
|
11083
|
+
var m = this;
|
|
11084
|
+
return {
|
|
11085
|
+
years: m.year(),
|
|
11086
|
+
months: m.month(),
|
|
11087
|
+
date: m.date(),
|
|
11088
|
+
hours: m.hours(),
|
|
11089
|
+
minutes: m.minutes(),
|
|
11090
|
+
seconds: m.seconds(),
|
|
11091
|
+
milliseconds: m.milliseconds()
|
|
11092
|
+
};
|
|
11093
|
+
}
|
|
11094
|
+
function toJSON() {
|
|
11095
|
+
return this.isValid() ? this.toISOString() : null;
|
|
11096
|
+
}
|
|
11097
|
+
function isValid$2() {
|
|
11098
|
+
return isValid(this);
|
|
11099
|
+
}
|
|
11100
|
+
function parsingFlags() {
|
|
11101
|
+
return extend({}, getParsingFlags(this));
|
|
11102
|
+
}
|
|
11103
|
+
function invalidAt() {
|
|
11104
|
+
return getParsingFlags(this).overflow;
|
|
11105
|
+
}
|
|
11106
|
+
function creationData() {
|
|
11107
|
+
return {
|
|
11108
|
+
input: this._i,
|
|
11109
|
+
format: this._f,
|
|
11110
|
+
locale: this._locale,
|
|
11111
|
+
isUTC: this._isUTC,
|
|
11112
|
+
strict: this._strict
|
|
11113
|
+
};
|
|
11114
|
+
}
|
|
11115
|
+
addFormatToken("N", 0, 0, "eraAbbr");
|
|
11116
|
+
addFormatToken("NN", 0, 0, "eraAbbr");
|
|
11117
|
+
addFormatToken("NNN", 0, 0, "eraAbbr");
|
|
11118
|
+
addFormatToken("NNNN", 0, 0, "eraName");
|
|
11119
|
+
addFormatToken("NNNNN", 0, 0, "eraNarrow");
|
|
11120
|
+
addFormatToken("y", ["y", 1], "yo", "eraYear");
|
|
11121
|
+
addFormatToken("y", ["yy", 2], 0, "eraYear");
|
|
11122
|
+
addFormatToken("y", ["yyy", 3], 0, "eraYear");
|
|
11123
|
+
addFormatToken("y", ["yyyy", 4], 0, "eraYear");
|
|
11124
|
+
addRegexToken("N", matchEraAbbr);
|
|
11125
|
+
addRegexToken("NN", matchEraAbbr);
|
|
11126
|
+
addRegexToken("NNN", matchEraAbbr);
|
|
11127
|
+
addRegexToken("NNNN", matchEraName);
|
|
11128
|
+
addRegexToken("NNNNN", matchEraNarrow);
|
|
11129
|
+
addParseToken(
|
|
11130
|
+
["N", "NN", "NNN", "NNNN", "NNNNN"],
|
|
11131
|
+
function(input, array, config, token2) {
|
|
11132
|
+
var era = config._locale.erasParse(input, token2, config._strict);
|
|
11133
|
+
if (era) {
|
|
11134
|
+
getParsingFlags(config).era = era;
|
|
11135
|
+
} else {
|
|
11136
|
+
getParsingFlags(config).invalidEra = input;
|
|
11137
|
+
}
|
|
11138
|
+
}
|
|
11139
|
+
);
|
|
11140
|
+
addRegexToken("y", matchUnsigned);
|
|
11141
|
+
addRegexToken("yy", matchUnsigned);
|
|
11142
|
+
addRegexToken("yyy", matchUnsigned);
|
|
11143
|
+
addRegexToken("yyyy", matchUnsigned);
|
|
11144
|
+
addRegexToken("yo", matchEraYearOrdinal);
|
|
11145
|
+
addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
|
|
11146
|
+
addParseToken(["yo"], function(input, array, config, token2) {
|
|
11147
|
+
var match;
|
|
11148
|
+
if (config._locale._eraYearOrdinalRegex) {
|
|
11149
|
+
match = input.match(config._locale._eraYearOrdinalRegex);
|
|
11150
|
+
}
|
|
11151
|
+
if (config._locale.eraYearOrdinalParse) {
|
|
11152
|
+
array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
|
|
11153
|
+
} else {
|
|
11154
|
+
array[YEAR] = parseInt(input, 10);
|
|
11155
|
+
}
|
|
11156
|
+
});
|
|
11157
|
+
function localeEras(m, format2) {
|
|
11158
|
+
var i, l, date, eras = this._eras || getLocale("en")._eras;
|
|
11159
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11160
|
+
switch (typeof eras[i].since) {
|
|
11161
|
+
case "string":
|
|
11162
|
+
date = hooks(eras[i].since).startOf("day");
|
|
11163
|
+
eras[i].since = date.valueOf();
|
|
11164
|
+
break;
|
|
11165
|
+
}
|
|
11166
|
+
switch (typeof eras[i].until) {
|
|
11167
|
+
case "undefined":
|
|
11168
|
+
eras[i].until = Infinity;
|
|
11169
|
+
break;
|
|
11170
|
+
case "string":
|
|
11171
|
+
date = hooks(eras[i].until).startOf("day").valueOf();
|
|
11172
|
+
eras[i].until = date.valueOf();
|
|
11173
|
+
break;
|
|
11174
|
+
}
|
|
11175
|
+
}
|
|
11176
|
+
return eras;
|
|
11177
|
+
}
|
|
11178
|
+
function localeErasParse(eraName, format2, strict) {
|
|
11179
|
+
var i, l, eras = this.eras(), name, abbr, narrow;
|
|
11180
|
+
eraName = eraName.toUpperCase();
|
|
11181
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11182
|
+
name = eras[i].name.toUpperCase();
|
|
11183
|
+
abbr = eras[i].abbr.toUpperCase();
|
|
11184
|
+
narrow = eras[i].narrow.toUpperCase();
|
|
11185
|
+
if (strict) {
|
|
11186
|
+
switch (format2) {
|
|
11187
|
+
case "N":
|
|
11188
|
+
case "NN":
|
|
11189
|
+
case "NNN":
|
|
11190
|
+
if (abbr === eraName) {
|
|
11191
|
+
return eras[i];
|
|
11192
|
+
}
|
|
11193
|
+
break;
|
|
11194
|
+
case "NNNN":
|
|
11195
|
+
if (name === eraName) {
|
|
11196
|
+
return eras[i];
|
|
11197
|
+
}
|
|
11198
|
+
break;
|
|
11199
|
+
case "NNNNN":
|
|
11200
|
+
if (narrow === eraName) {
|
|
11201
|
+
return eras[i];
|
|
11202
|
+
}
|
|
11203
|
+
break;
|
|
11204
|
+
}
|
|
11205
|
+
} else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
|
|
11206
|
+
return eras[i];
|
|
11207
|
+
}
|
|
11208
|
+
}
|
|
11209
|
+
}
|
|
11210
|
+
function localeErasConvertYear(era, year) {
|
|
11211
|
+
var dir = era.since <= era.until ? 1 : -1;
|
|
11212
|
+
if (year === void 0) {
|
|
11213
|
+
return hooks(era.since).year();
|
|
11214
|
+
} else {
|
|
11215
|
+
return hooks(era.since).year() + (year - era.offset) * dir;
|
|
11216
|
+
}
|
|
11217
|
+
}
|
|
11218
|
+
function getEraName() {
|
|
11219
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11220
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11221
|
+
val = this.clone().startOf("day").valueOf();
|
|
11222
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11223
|
+
return eras[i].name;
|
|
11224
|
+
}
|
|
11225
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11226
|
+
return eras[i].name;
|
|
11227
|
+
}
|
|
11228
|
+
}
|
|
11229
|
+
return "";
|
|
11230
|
+
}
|
|
11231
|
+
function getEraNarrow() {
|
|
11232
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11233
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11234
|
+
val = this.clone().startOf("day").valueOf();
|
|
11235
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11236
|
+
return eras[i].narrow;
|
|
11237
|
+
}
|
|
11238
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11239
|
+
return eras[i].narrow;
|
|
11240
|
+
}
|
|
11241
|
+
}
|
|
11242
|
+
return "";
|
|
11243
|
+
}
|
|
11244
|
+
function getEraAbbr() {
|
|
11245
|
+
var i, l, val, eras = this.localeData().eras();
|
|
11246
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11247
|
+
val = this.clone().startOf("day").valueOf();
|
|
11248
|
+
if (eras[i].since <= val && val <= eras[i].until) {
|
|
11249
|
+
return eras[i].abbr;
|
|
11250
|
+
}
|
|
11251
|
+
if (eras[i].until <= val && val <= eras[i].since) {
|
|
11252
|
+
return eras[i].abbr;
|
|
11253
|
+
}
|
|
11254
|
+
}
|
|
11255
|
+
return "";
|
|
11256
|
+
}
|
|
11257
|
+
function getEraYear() {
|
|
11258
|
+
var i, l, dir, val, eras = this.localeData().eras();
|
|
11259
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11260
|
+
dir = eras[i].since <= eras[i].until ? 1 : -1;
|
|
11261
|
+
val = this.clone().startOf("day").valueOf();
|
|
11262
|
+
if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {
|
|
11263
|
+
return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;
|
|
11264
|
+
}
|
|
11265
|
+
}
|
|
11266
|
+
return this.year();
|
|
11267
|
+
}
|
|
11268
|
+
function erasNameRegex(isStrict) {
|
|
11269
|
+
if (!hasOwnProp(this, "_erasNameRegex")) {
|
|
11270
|
+
computeErasParse.call(this);
|
|
11271
|
+
}
|
|
11272
|
+
return isStrict ? this._erasNameRegex : this._erasRegex;
|
|
11273
|
+
}
|
|
11274
|
+
function erasAbbrRegex(isStrict) {
|
|
11275
|
+
if (!hasOwnProp(this, "_erasAbbrRegex")) {
|
|
11276
|
+
computeErasParse.call(this);
|
|
11277
|
+
}
|
|
11278
|
+
return isStrict ? this._erasAbbrRegex : this._erasRegex;
|
|
11279
|
+
}
|
|
11280
|
+
function erasNarrowRegex(isStrict) {
|
|
11281
|
+
if (!hasOwnProp(this, "_erasNarrowRegex")) {
|
|
11282
|
+
computeErasParse.call(this);
|
|
11283
|
+
}
|
|
11284
|
+
return isStrict ? this._erasNarrowRegex : this._erasRegex;
|
|
11285
|
+
}
|
|
11286
|
+
function matchEraAbbr(isStrict, locale2) {
|
|
11287
|
+
return locale2.erasAbbrRegex(isStrict);
|
|
11288
|
+
}
|
|
11289
|
+
function matchEraName(isStrict, locale2) {
|
|
11290
|
+
return locale2.erasNameRegex(isStrict);
|
|
11291
|
+
}
|
|
11292
|
+
function matchEraNarrow(isStrict, locale2) {
|
|
11293
|
+
return locale2.erasNarrowRegex(isStrict);
|
|
11294
|
+
}
|
|
11295
|
+
function matchEraYearOrdinal(isStrict, locale2) {
|
|
11296
|
+
return locale2._eraYearOrdinalRegex || matchUnsigned;
|
|
11297
|
+
}
|
|
11298
|
+
function computeErasParse() {
|
|
11299
|
+
var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
|
|
11300
|
+
for (i = 0, l = eras.length; i < l; ++i) {
|
|
11301
|
+
erasName = regexEscape(eras[i].name);
|
|
11302
|
+
erasAbbr = regexEscape(eras[i].abbr);
|
|
11303
|
+
erasNarrow = regexEscape(eras[i].narrow);
|
|
11304
|
+
namePieces.push(erasName);
|
|
11305
|
+
abbrPieces.push(erasAbbr);
|
|
11306
|
+
narrowPieces.push(erasNarrow);
|
|
11307
|
+
mixedPieces.push(erasName);
|
|
11308
|
+
mixedPieces.push(erasAbbr);
|
|
11309
|
+
mixedPieces.push(erasNarrow);
|
|
11310
|
+
}
|
|
11311
|
+
this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
11312
|
+
this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
|
|
11313
|
+
this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
|
|
11314
|
+
this._erasNarrowRegex = new RegExp(
|
|
11315
|
+
"^(" + narrowPieces.join("|") + ")",
|
|
11316
|
+
"i"
|
|
11317
|
+
);
|
|
11318
|
+
}
|
|
11319
|
+
addFormatToken(0, ["gg", 2], 0, function() {
|
|
11320
|
+
return this.weekYear() % 100;
|
|
11321
|
+
});
|
|
11322
|
+
addFormatToken(0, ["GG", 2], 0, function() {
|
|
11323
|
+
return this.isoWeekYear() % 100;
|
|
11324
|
+
});
|
|
11325
|
+
function addWeekYearFormatToken(token2, getter) {
|
|
11326
|
+
addFormatToken(0, [token2, token2.length], 0, getter);
|
|
11327
|
+
}
|
|
11328
|
+
addWeekYearFormatToken("gggg", "weekYear");
|
|
11329
|
+
addWeekYearFormatToken("ggggg", "weekYear");
|
|
11330
|
+
addWeekYearFormatToken("GGGG", "isoWeekYear");
|
|
11331
|
+
addWeekYearFormatToken("GGGGG", "isoWeekYear");
|
|
11332
|
+
addRegexToken("G", matchSigned);
|
|
11333
|
+
addRegexToken("g", matchSigned);
|
|
11334
|
+
addRegexToken("GG", match1to2, match2);
|
|
11335
|
+
addRegexToken("gg", match1to2, match2);
|
|
11336
|
+
addRegexToken("GGGG", match1to4, match4);
|
|
11337
|
+
addRegexToken("gggg", match1to4, match4);
|
|
11338
|
+
addRegexToken("GGGGG", match1to6, match6);
|
|
11339
|
+
addRegexToken("ggggg", match1to6, match6);
|
|
11340
|
+
addWeekParseToken(
|
|
11341
|
+
["gggg", "ggggg", "GGGG", "GGGGG"],
|
|
11342
|
+
function(input, week, config, token2) {
|
|
11343
|
+
week[token2.substr(0, 2)] = toInt(input);
|
|
11344
|
+
}
|
|
11345
|
+
);
|
|
11346
|
+
addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
|
|
11347
|
+
week[token2] = hooks.parseTwoDigitYear(input);
|
|
11348
|
+
});
|
|
11349
|
+
function getSetWeekYear(input) {
|
|
11350
|
+
return getSetWeekYearHelper.call(
|
|
11351
|
+
this,
|
|
11352
|
+
input,
|
|
11353
|
+
this.week(),
|
|
11354
|
+
this.weekday() + this.localeData()._week.dow,
|
|
11355
|
+
this.localeData()._week.dow,
|
|
11356
|
+
this.localeData()._week.doy
|
|
11357
|
+
);
|
|
11358
|
+
}
|
|
11359
|
+
function getSetISOWeekYear(input) {
|
|
11360
|
+
return getSetWeekYearHelper.call(
|
|
11361
|
+
this,
|
|
11362
|
+
input,
|
|
11363
|
+
this.isoWeek(),
|
|
11364
|
+
this.isoWeekday(),
|
|
11365
|
+
1,
|
|
11366
|
+
4
|
|
11367
|
+
);
|
|
11368
|
+
}
|
|
11369
|
+
function getISOWeeksInYear() {
|
|
11370
|
+
return weeksInYear(this.year(), 1, 4);
|
|
11371
|
+
}
|
|
11372
|
+
function getISOWeeksInISOWeekYear() {
|
|
11373
|
+
return weeksInYear(this.isoWeekYear(), 1, 4);
|
|
11374
|
+
}
|
|
11375
|
+
function getWeeksInYear() {
|
|
11376
|
+
var weekInfo = this.localeData()._week;
|
|
11377
|
+
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
|
11378
|
+
}
|
|
11379
|
+
function getWeeksInWeekYear() {
|
|
11380
|
+
var weekInfo = this.localeData()._week;
|
|
11381
|
+
return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
|
|
11382
|
+
}
|
|
11383
|
+
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
|
11384
|
+
var weeksTarget;
|
|
11385
|
+
if (input == null) {
|
|
11386
|
+
return weekOfYear(this, dow, doy).year;
|
|
11387
|
+
} else {
|
|
11388
|
+
weeksTarget = weeksInYear(input, dow, doy);
|
|
11389
|
+
if (week > weeksTarget) {
|
|
11390
|
+
week = weeksTarget;
|
|
11391
|
+
}
|
|
11392
|
+
return setWeekAll.call(this, input, week, weekday, dow, doy);
|
|
11393
|
+
}
|
|
11394
|
+
}
|
|
11395
|
+
function setWeekAll(weekYear, week, weekday, dow, doy) {
|
|
11396
|
+
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
|
|
11397
|
+
this.year(date.getUTCFullYear());
|
|
11398
|
+
this.month(date.getUTCMonth());
|
|
11399
|
+
this.date(date.getUTCDate());
|
|
11400
|
+
return this;
|
|
11401
|
+
}
|
|
11402
|
+
addFormatToken("Q", 0, "Qo", "quarter");
|
|
11403
|
+
addRegexToken("Q", match1);
|
|
11404
|
+
addParseToken("Q", function(input, array) {
|
|
11405
|
+
array[MONTH] = (toInt(input) - 1) * 3;
|
|
11406
|
+
});
|
|
11407
|
+
function getSetQuarter(input) {
|
|
11408
|
+
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
|
|
11409
|
+
}
|
|
11410
|
+
addFormatToken("D", ["DD", 2], "Do", "date");
|
|
11411
|
+
addRegexToken("D", match1to2, match1to2NoLeadingZero);
|
|
11412
|
+
addRegexToken("DD", match1to2, match2);
|
|
11413
|
+
addRegexToken("Do", function(isStrict, locale2) {
|
|
11414
|
+
return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
|
|
11415
|
+
});
|
|
11416
|
+
addParseToken(["D", "DD"], DATE);
|
|
11417
|
+
addParseToken("Do", function(input, array) {
|
|
11418
|
+
array[DATE] = toInt(input.match(match1to2)[0]);
|
|
11419
|
+
});
|
|
11420
|
+
var getSetDayOfMonth = makeGetSet("Date", true);
|
|
11421
|
+
addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
|
|
11422
|
+
addRegexToken("DDD", match1to3);
|
|
11423
|
+
addRegexToken("DDDD", match3);
|
|
11424
|
+
addParseToken(["DDD", "DDDD"], function(input, array, config) {
|
|
11425
|
+
config._dayOfYear = toInt(input);
|
|
11426
|
+
});
|
|
11427
|
+
function getSetDayOfYear(input) {
|
|
11428
|
+
var dayOfYear = Math.round(
|
|
11429
|
+
(this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
|
|
11430
|
+
) + 1;
|
|
11431
|
+
return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
|
|
11432
|
+
}
|
|
11433
|
+
addFormatToken("m", ["mm", 2], 0, "minute");
|
|
11434
|
+
addRegexToken("m", match1to2, match1to2HasZero);
|
|
11435
|
+
addRegexToken("mm", match1to2, match2);
|
|
11436
|
+
addParseToken(["m", "mm"], MINUTE);
|
|
11437
|
+
var getSetMinute = makeGetSet("Minutes", false);
|
|
11438
|
+
addFormatToken("s", ["ss", 2], 0, "second");
|
|
11439
|
+
addRegexToken("s", match1to2, match1to2HasZero);
|
|
11440
|
+
addRegexToken("ss", match1to2, match2);
|
|
11441
|
+
addParseToken(["s", "ss"], SECOND);
|
|
11442
|
+
var getSetSecond = makeGetSet("Seconds", false);
|
|
11443
|
+
addFormatToken("S", 0, 0, function() {
|
|
11444
|
+
return ~~(this.millisecond() / 100);
|
|
11445
|
+
});
|
|
11446
|
+
addFormatToken(0, ["SS", 2], 0, function() {
|
|
11447
|
+
return ~~(this.millisecond() / 10);
|
|
11448
|
+
});
|
|
11449
|
+
addFormatToken(0, ["SSS", 3], 0, "millisecond");
|
|
11450
|
+
addFormatToken(0, ["SSSS", 4], 0, function() {
|
|
11451
|
+
return this.millisecond() * 10;
|
|
11452
|
+
});
|
|
11453
|
+
addFormatToken(0, ["SSSSS", 5], 0, function() {
|
|
11454
|
+
return this.millisecond() * 100;
|
|
11455
|
+
});
|
|
11456
|
+
addFormatToken(0, ["SSSSSS", 6], 0, function() {
|
|
11457
|
+
return this.millisecond() * 1e3;
|
|
11458
|
+
});
|
|
11459
|
+
addFormatToken(0, ["SSSSSSS", 7], 0, function() {
|
|
11460
|
+
return this.millisecond() * 1e4;
|
|
11461
|
+
});
|
|
11462
|
+
addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
|
|
11463
|
+
return this.millisecond() * 1e5;
|
|
11464
|
+
});
|
|
11465
|
+
addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
|
|
11466
|
+
return this.millisecond() * 1e6;
|
|
11467
|
+
});
|
|
11468
|
+
addRegexToken("S", match1to3, match1);
|
|
11469
|
+
addRegexToken("SS", match1to3, match2);
|
|
11470
|
+
addRegexToken("SSS", match1to3, match3);
|
|
11471
|
+
var token, getSetMillisecond;
|
|
11472
|
+
for (token = "SSSS"; token.length <= 9; token += "S") {
|
|
11473
|
+
addRegexToken(token, matchUnsigned);
|
|
11474
|
+
}
|
|
11475
|
+
function parseMs(input, array) {
|
|
11476
|
+
array[MILLISECOND] = toInt(("0." + input) * 1e3);
|
|
11477
|
+
}
|
|
11478
|
+
for (token = "S"; token.length <= 9; token += "S") {
|
|
11479
|
+
addParseToken(token, parseMs);
|
|
11480
|
+
}
|
|
11481
|
+
getSetMillisecond = makeGetSet("Milliseconds", false);
|
|
11482
|
+
addFormatToken("z", 0, 0, "zoneAbbr");
|
|
11483
|
+
addFormatToken("zz", 0, 0, "zoneName");
|
|
11484
|
+
function getZoneAbbr() {
|
|
11485
|
+
return this._isUTC ? "UTC" : "";
|
|
11486
|
+
}
|
|
11487
|
+
function getZoneName() {
|
|
11488
|
+
return this._isUTC ? "Coordinated Universal Time" : "";
|
|
11489
|
+
}
|
|
11490
|
+
var proto = Moment.prototype;
|
|
11491
|
+
proto.add = add;
|
|
11492
|
+
proto.calendar = calendar$1;
|
|
11493
|
+
proto.clone = clone;
|
|
11494
|
+
proto.diff = diff;
|
|
11495
|
+
proto.endOf = endOf;
|
|
11496
|
+
proto.format = format;
|
|
11497
|
+
proto.from = from;
|
|
11498
|
+
proto.fromNow = fromNow;
|
|
11499
|
+
proto.to = to;
|
|
11500
|
+
proto.toNow = toNow;
|
|
11501
|
+
proto.get = stringGet;
|
|
11502
|
+
proto.invalidAt = invalidAt;
|
|
11503
|
+
proto.isAfter = isAfter;
|
|
11504
|
+
proto.isBefore = isBefore;
|
|
11505
|
+
proto.isBetween = isBetween;
|
|
11506
|
+
proto.isSame = isSame;
|
|
11507
|
+
proto.isSameOrAfter = isSameOrAfter;
|
|
11508
|
+
proto.isSameOrBefore = isSameOrBefore;
|
|
11509
|
+
proto.isValid = isValid$2;
|
|
11510
|
+
proto.lang = lang;
|
|
11511
|
+
proto.locale = locale;
|
|
11512
|
+
proto.localeData = localeData;
|
|
11513
|
+
proto.max = prototypeMax;
|
|
11514
|
+
proto.min = prototypeMin;
|
|
11515
|
+
proto.parsingFlags = parsingFlags;
|
|
11516
|
+
proto.set = stringSet;
|
|
11517
|
+
proto.startOf = startOf;
|
|
11518
|
+
proto.subtract = subtract;
|
|
11519
|
+
proto.toArray = toArray;
|
|
11520
|
+
proto.toObject = toObject;
|
|
11521
|
+
proto.toDate = toDate;
|
|
11522
|
+
proto.toISOString = toISOString;
|
|
11523
|
+
proto.inspect = inspect;
|
|
11524
|
+
if (typeof Symbol !== "undefined" && Symbol.for != null) {
|
|
11525
|
+
proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
|
|
11526
|
+
return "Moment<" + this.format() + ">";
|
|
11527
|
+
};
|
|
11528
|
+
}
|
|
11529
|
+
proto.toJSON = toJSON;
|
|
11530
|
+
proto.toString = toString;
|
|
11531
|
+
proto.unix = unix;
|
|
11532
|
+
proto.valueOf = valueOf;
|
|
11533
|
+
proto.creationData = creationData;
|
|
11534
|
+
proto.eraName = getEraName;
|
|
11535
|
+
proto.eraNarrow = getEraNarrow;
|
|
11536
|
+
proto.eraAbbr = getEraAbbr;
|
|
11537
|
+
proto.eraYear = getEraYear;
|
|
11538
|
+
proto.year = getSetYear;
|
|
11539
|
+
proto.isLeapYear = getIsLeapYear;
|
|
11540
|
+
proto.weekYear = getSetWeekYear;
|
|
11541
|
+
proto.isoWeekYear = getSetISOWeekYear;
|
|
11542
|
+
proto.quarter = proto.quarters = getSetQuarter;
|
|
11543
|
+
proto.month = getSetMonth;
|
|
11544
|
+
proto.daysInMonth = getDaysInMonth;
|
|
11545
|
+
proto.week = proto.weeks = getSetWeek;
|
|
11546
|
+
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
|
11547
|
+
proto.weeksInYear = getWeeksInYear;
|
|
11548
|
+
proto.weeksInWeekYear = getWeeksInWeekYear;
|
|
11549
|
+
proto.isoWeeksInYear = getISOWeeksInYear;
|
|
11550
|
+
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
|
11551
|
+
proto.date = getSetDayOfMonth;
|
|
11552
|
+
proto.day = proto.days = getSetDayOfWeek;
|
|
11553
|
+
proto.weekday = getSetLocaleDayOfWeek;
|
|
11554
|
+
proto.isoWeekday = getSetISODayOfWeek;
|
|
11555
|
+
proto.dayOfYear = getSetDayOfYear;
|
|
11556
|
+
proto.hour = proto.hours = getSetHour;
|
|
11557
|
+
proto.minute = proto.minutes = getSetMinute;
|
|
11558
|
+
proto.second = proto.seconds = getSetSecond;
|
|
11559
|
+
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
|
11560
|
+
proto.utcOffset = getSetOffset;
|
|
11561
|
+
proto.utc = setOffsetToUTC;
|
|
11562
|
+
proto.local = setOffsetToLocal;
|
|
11563
|
+
proto.parseZone = setOffsetToParsedOffset;
|
|
11564
|
+
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
|
11565
|
+
proto.isDST = isDaylightSavingTime;
|
|
11566
|
+
proto.isLocal = isLocal;
|
|
11567
|
+
proto.isUtcOffset = isUtcOffset;
|
|
11568
|
+
proto.isUtc = isUtc;
|
|
11569
|
+
proto.isUTC = isUtc;
|
|
11570
|
+
proto.zoneAbbr = getZoneAbbr;
|
|
11571
|
+
proto.zoneName = getZoneName;
|
|
11572
|
+
proto.dates = deprecate(
|
|
11573
|
+
"dates accessor is deprecated. Use date instead.",
|
|
11574
|
+
getSetDayOfMonth
|
|
11575
|
+
);
|
|
11576
|
+
proto.months = deprecate(
|
|
11577
|
+
"months accessor is deprecated. Use month instead",
|
|
11578
|
+
getSetMonth
|
|
11579
|
+
);
|
|
11580
|
+
proto.years = deprecate(
|
|
11581
|
+
"years accessor is deprecated. Use year instead",
|
|
11582
|
+
getSetYear
|
|
11583
|
+
);
|
|
11584
|
+
proto.zone = deprecate(
|
|
11585
|
+
"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
|
|
11586
|
+
getSetZone
|
|
11587
|
+
);
|
|
11588
|
+
proto.isDSTShifted = deprecate(
|
|
11589
|
+
"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
|
|
11590
|
+
isDaylightSavingTimeShifted
|
|
11591
|
+
);
|
|
11592
|
+
function createUnix(input) {
|
|
11593
|
+
return createLocal(input * 1e3);
|
|
11594
|
+
}
|
|
11595
|
+
function createInZone() {
|
|
11596
|
+
return createLocal.apply(null, arguments).parseZone();
|
|
11597
|
+
}
|
|
11598
|
+
function preParsePostFormat(string) {
|
|
11599
|
+
return string;
|
|
11600
|
+
}
|
|
11601
|
+
var proto$1 = Locale.prototype;
|
|
11602
|
+
proto$1.calendar = calendar;
|
|
11603
|
+
proto$1.longDateFormat = longDateFormat;
|
|
11604
|
+
proto$1.invalidDate = invalidDate;
|
|
11605
|
+
proto$1.ordinal = ordinal;
|
|
11606
|
+
proto$1.preparse = preParsePostFormat;
|
|
11607
|
+
proto$1.postformat = preParsePostFormat;
|
|
11608
|
+
proto$1.relativeTime = relativeTime;
|
|
11609
|
+
proto$1.pastFuture = pastFuture;
|
|
11610
|
+
proto$1.set = set;
|
|
11611
|
+
proto$1.eras = localeEras;
|
|
11612
|
+
proto$1.erasParse = localeErasParse;
|
|
11613
|
+
proto$1.erasConvertYear = localeErasConvertYear;
|
|
11614
|
+
proto$1.erasAbbrRegex = erasAbbrRegex;
|
|
11615
|
+
proto$1.erasNameRegex = erasNameRegex;
|
|
11616
|
+
proto$1.erasNarrowRegex = erasNarrowRegex;
|
|
11617
|
+
proto$1.months = localeMonths;
|
|
11618
|
+
proto$1.monthsShort = localeMonthsShort;
|
|
11619
|
+
proto$1.monthsParse = localeMonthsParse;
|
|
11620
|
+
proto$1.monthsRegex = monthsRegex$1;
|
|
11621
|
+
proto$1.monthsShortRegex = monthsShortRegex;
|
|
11622
|
+
proto$1.week = localeWeek;
|
|
11623
|
+
proto$1.firstDayOfYear = localeFirstDayOfYear;
|
|
11624
|
+
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
|
11625
|
+
proto$1.weekdays = localeWeekdays;
|
|
11626
|
+
proto$1.weekdaysMin = localeWeekdaysMin;
|
|
11627
|
+
proto$1.weekdaysShort = localeWeekdaysShort;
|
|
11628
|
+
proto$1.weekdaysParse = localeWeekdaysParse;
|
|
11629
|
+
proto$1.weekdaysRegex = weekdaysRegex;
|
|
11630
|
+
proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
|
11631
|
+
proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
|
11632
|
+
proto$1.isPM = localeIsPM;
|
|
11633
|
+
proto$1.meridiem = localeMeridiem;
|
|
11634
|
+
function get$1(format2, index, field, setter) {
|
|
11635
|
+
var locale2 = getLocale(), utc = createUTC().set(setter, index);
|
|
11636
|
+
return locale2[field](utc, format2);
|
|
11637
|
+
}
|
|
11638
|
+
function listMonthsImpl(format2, index, field) {
|
|
11639
|
+
if (isNumber(format2)) {
|
|
11640
|
+
index = format2;
|
|
11641
|
+
format2 = void 0;
|
|
11642
|
+
}
|
|
11643
|
+
format2 = format2 || "";
|
|
11644
|
+
if (index != null) {
|
|
11645
|
+
return get$1(format2, index, field, "month");
|
|
11646
|
+
}
|
|
11647
|
+
var i, out = [];
|
|
11648
|
+
for (i = 0; i < 12; i++) {
|
|
11649
|
+
out[i] = get$1(format2, i, field, "month");
|
|
11650
|
+
}
|
|
11651
|
+
return out;
|
|
11652
|
+
}
|
|
11653
|
+
function listWeekdaysImpl(localeSorted, format2, index, field) {
|
|
11654
|
+
if (typeof localeSorted === "boolean") {
|
|
11655
|
+
if (isNumber(format2)) {
|
|
11656
|
+
index = format2;
|
|
11657
|
+
format2 = void 0;
|
|
11658
|
+
}
|
|
11659
|
+
format2 = format2 || "";
|
|
11660
|
+
} else {
|
|
11661
|
+
format2 = localeSorted;
|
|
11662
|
+
index = format2;
|
|
11663
|
+
localeSorted = false;
|
|
11664
|
+
if (isNumber(format2)) {
|
|
11665
|
+
index = format2;
|
|
11666
|
+
format2 = void 0;
|
|
11667
|
+
}
|
|
11668
|
+
format2 = format2 || "";
|
|
11669
|
+
}
|
|
11670
|
+
var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i, out = [];
|
|
11671
|
+
if (index != null) {
|
|
11672
|
+
return get$1(format2, (index + shift) % 7, field, "day");
|
|
11673
|
+
}
|
|
11674
|
+
for (i = 0; i < 7; i++) {
|
|
11675
|
+
out[i] = get$1(format2, (i + shift) % 7, field, "day");
|
|
11676
|
+
}
|
|
11677
|
+
return out;
|
|
11678
|
+
}
|
|
11679
|
+
function listMonths(format2, index) {
|
|
11680
|
+
return listMonthsImpl(format2, index, "months");
|
|
11681
|
+
}
|
|
11682
|
+
function listMonthsShort(format2, index) {
|
|
11683
|
+
return listMonthsImpl(format2, index, "monthsShort");
|
|
11684
|
+
}
|
|
11685
|
+
function listWeekdays(localeSorted, format2, index) {
|
|
11686
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdays");
|
|
11687
|
+
}
|
|
11688
|
+
function listWeekdaysShort(localeSorted, format2, index) {
|
|
11689
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdaysShort");
|
|
11690
|
+
}
|
|
11691
|
+
function listWeekdaysMin(localeSorted, format2, index) {
|
|
11692
|
+
return listWeekdaysImpl(localeSorted, format2, index, "weekdaysMin");
|
|
11693
|
+
}
|
|
11694
|
+
getSetGlobalLocale("en", {
|
|
11695
|
+
eras: [
|
|
11696
|
+
{
|
|
11697
|
+
since: "0001-01-01",
|
|
11698
|
+
until: Infinity,
|
|
11699
|
+
offset: 1,
|
|
11700
|
+
name: "Anno Domini",
|
|
11701
|
+
narrow: "AD",
|
|
11702
|
+
abbr: "AD"
|
|
11703
|
+
},
|
|
11704
|
+
{
|
|
11705
|
+
since: "0000-12-31",
|
|
11706
|
+
until: -Infinity,
|
|
11707
|
+
offset: 1,
|
|
11708
|
+
name: "Before Christ",
|
|
11709
|
+
narrow: "BC",
|
|
11710
|
+
abbr: "BC"
|
|
11711
|
+
}
|
|
11712
|
+
],
|
|
11713
|
+
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
|
11714
|
+
ordinal: function(number2) {
|
|
11715
|
+
var b = number2 % 10, output = toInt(number2 % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
|
|
11716
|
+
return number2 + output;
|
|
11717
|
+
}
|
|
11718
|
+
});
|
|
11719
|
+
hooks.lang = deprecate(
|
|
11720
|
+
"moment.lang is deprecated. Use moment.locale instead.",
|
|
11721
|
+
getSetGlobalLocale
|
|
11722
|
+
);
|
|
11723
|
+
hooks.langData = deprecate(
|
|
11724
|
+
"moment.langData is deprecated. Use moment.localeData instead.",
|
|
11725
|
+
getLocale
|
|
11726
|
+
);
|
|
11727
|
+
var mathAbs = Math.abs;
|
|
11728
|
+
function abs() {
|
|
11729
|
+
var data = this._data;
|
|
11730
|
+
this._milliseconds = mathAbs(this._milliseconds);
|
|
11731
|
+
this._days = mathAbs(this._days);
|
|
11732
|
+
this._months = mathAbs(this._months);
|
|
11733
|
+
data.milliseconds = mathAbs(data.milliseconds);
|
|
11734
|
+
data.seconds = mathAbs(data.seconds);
|
|
11735
|
+
data.minutes = mathAbs(data.minutes);
|
|
11736
|
+
data.hours = mathAbs(data.hours);
|
|
11737
|
+
data.months = mathAbs(data.months);
|
|
11738
|
+
data.years = mathAbs(data.years);
|
|
11739
|
+
return this;
|
|
11740
|
+
}
|
|
11741
|
+
function addSubtract$1(duration, input, value, direction) {
|
|
11742
|
+
var other = createDuration(input, value);
|
|
11743
|
+
duration._milliseconds += direction * other._milliseconds;
|
|
11744
|
+
duration._days += direction * other._days;
|
|
11745
|
+
duration._months += direction * other._months;
|
|
11746
|
+
return duration._bubble();
|
|
11747
|
+
}
|
|
11748
|
+
function add$1(input, value) {
|
|
11749
|
+
return addSubtract$1(this, input, value, 1);
|
|
11750
|
+
}
|
|
11751
|
+
function subtract$1(input, value) {
|
|
11752
|
+
return addSubtract$1(this, input, value, -1);
|
|
11753
|
+
}
|
|
11754
|
+
function absCeil(number2) {
|
|
11755
|
+
if (number2 < 0) {
|
|
11756
|
+
return Math.floor(number2);
|
|
11757
|
+
} else {
|
|
11758
|
+
return Math.ceil(number2);
|
|
11759
|
+
}
|
|
11760
|
+
}
|
|
11761
|
+
function bubble() {
|
|
11762
|
+
var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
|
|
11763
|
+
if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
|
|
11764
|
+
milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
|
|
11765
|
+
days2 = 0;
|
|
11766
|
+
months2 = 0;
|
|
11767
|
+
}
|
|
11768
|
+
data.milliseconds = milliseconds2 % 1e3;
|
|
11769
|
+
seconds2 = absFloor(milliseconds2 / 1e3);
|
|
11770
|
+
data.seconds = seconds2 % 60;
|
|
11771
|
+
minutes2 = absFloor(seconds2 / 60);
|
|
11772
|
+
data.minutes = minutes2 % 60;
|
|
11773
|
+
hours2 = absFloor(minutes2 / 60);
|
|
11774
|
+
data.hours = hours2 % 24;
|
|
11775
|
+
days2 += absFloor(hours2 / 24);
|
|
11776
|
+
monthsFromDays = absFloor(daysToMonths(days2));
|
|
11777
|
+
months2 += monthsFromDays;
|
|
11778
|
+
days2 -= absCeil(monthsToDays(monthsFromDays));
|
|
11779
|
+
years2 = absFloor(months2 / 12);
|
|
11780
|
+
months2 %= 12;
|
|
11781
|
+
data.days = days2;
|
|
11782
|
+
data.months = months2;
|
|
11783
|
+
data.years = years2;
|
|
11784
|
+
return this;
|
|
11785
|
+
}
|
|
11786
|
+
function daysToMonths(days2) {
|
|
11787
|
+
return days2 * 4800 / 146097;
|
|
11788
|
+
}
|
|
11789
|
+
function monthsToDays(months2) {
|
|
11790
|
+
return months2 * 146097 / 4800;
|
|
11791
|
+
}
|
|
11792
|
+
function as(units) {
|
|
11793
|
+
if (!this.isValid()) {
|
|
11794
|
+
return NaN;
|
|
11795
|
+
}
|
|
11796
|
+
var days2, months2, milliseconds2 = this._milliseconds;
|
|
11797
|
+
units = normalizeUnits(units);
|
|
11798
|
+
if (units === "month" || units === "quarter" || units === "year") {
|
|
11799
|
+
days2 = this._days + milliseconds2 / 864e5;
|
|
11800
|
+
months2 = this._months + daysToMonths(days2);
|
|
11801
|
+
switch (units) {
|
|
11802
|
+
case "month":
|
|
11803
|
+
return months2;
|
|
11804
|
+
case "quarter":
|
|
11805
|
+
return months2 / 3;
|
|
11806
|
+
case "year":
|
|
11807
|
+
return months2 / 12;
|
|
11808
|
+
}
|
|
11809
|
+
} else {
|
|
11810
|
+
days2 = this._days + Math.round(monthsToDays(this._months));
|
|
11811
|
+
switch (units) {
|
|
11812
|
+
case "week":
|
|
11813
|
+
return days2 / 7 + milliseconds2 / 6048e5;
|
|
11814
|
+
case "day":
|
|
11815
|
+
return days2 + milliseconds2 / 864e5;
|
|
11816
|
+
case "hour":
|
|
11817
|
+
return days2 * 24 + milliseconds2 / 36e5;
|
|
11818
|
+
case "minute":
|
|
11819
|
+
return days2 * 1440 + milliseconds2 / 6e4;
|
|
11820
|
+
case "second":
|
|
11821
|
+
return days2 * 86400 + milliseconds2 / 1e3;
|
|
11822
|
+
// Math.floor prevents floating point math errors here
|
|
11823
|
+
case "millisecond":
|
|
11824
|
+
return Math.floor(days2 * 864e5) + milliseconds2;
|
|
11825
|
+
default:
|
|
11826
|
+
throw new Error("Unknown unit " + units);
|
|
11827
|
+
}
|
|
11828
|
+
}
|
|
11829
|
+
}
|
|
11830
|
+
function makeAs(alias) {
|
|
11831
|
+
return function() {
|
|
11832
|
+
return this.as(alias);
|
|
11833
|
+
};
|
|
11834
|
+
}
|
|
11835
|
+
var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf$1 = asMilliseconds;
|
|
11836
|
+
function clone$1() {
|
|
11837
|
+
return createDuration(this);
|
|
11838
|
+
}
|
|
11839
|
+
function get$2(units) {
|
|
11840
|
+
units = normalizeUnits(units);
|
|
11841
|
+
return this.isValid() ? this[units + "s"]() : NaN;
|
|
11842
|
+
}
|
|
11843
|
+
function makeGetter(name) {
|
|
11844
|
+
return function() {
|
|
11845
|
+
return this.isValid() ? this._data[name] : NaN;
|
|
11846
|
+
};
|
|
11847
|
+
}
|
|
11848
|
+
var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
|
|
11849
|
+
function weeks() {
|
|
11850
|
+
return absFloor(this.days() / 7);
|
|
11851
|
+
}
|
|
11852
|
+
var round = Math.round, thresholds = {
|
|
11853
|
+
ss: 44,
|
|
11854
|
+
// a few seconds to seconds
|
|
11855
|
+
s: 45,
|
|
11856
|
+
// seconds to minute
|
|
11857
|
+
m: 45,
|
|
11858
|
+
// minutes to hour
|
|
11859
|
+
h: 22,
|
|
11860
|
+
// hours to day
|
|
11861
|
+
d: 26,
|
|
11862
|
+
// days to month/week
|
|
11863
|
+
w: null,
|
|
11864
|
+
// weeks to month
|
|
11865
|
+
M: 11
|
|
11866
|
+
// months to year
|
|
11867
|
+
};
|
|
11868
|
+
function substituteTimeAgo(string, number2, withoutSuffix, isFuture, locale2) {
|
|
11869
|
+
return locale2.relativeTime(number2 || 1, !!withoutSuffix, string, isFuture);
|
|
11870
|
+
}
|
|
11871
|
+
function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
|
|
11872
|
+
var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
|
|
11873
|
+
if (thresholds2.w != null) {
|
|
11874
|
+
a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
|
|
11875
|
+
}
|
|
11876
|
+
a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
|
|
11877
|
+
a[2] = withoutSuffix;
|
|
11878
|
+
a[3] = +posNegDuration > 0;
|
|
11879
|
+
a[4] = locale2;
|
|
11880
|
+
return substituteTimeAgo.apply(null, a);
|
|
11881
|
+
}
|
|
11882
|
+
function getSetRelativeTimeRounding(roundingFunction) {
|
|
11883
|
+
if (roundingFunction === void 0) {
|
|
11884
|
+
return round;
|
|
11885
|
+
}
|
|
11886
|
+
if (typeof roundingFunction === "function") {
|
|
11887
|
+
round = roundingFunction;
|
|
11888
|
+
return true;
|
|
11889
|
+
}
|
|
11890
|
+
return false;
|
|
11891
|
+
}
|
|
11892
|
+
function getSetRelativeTimeThreshold(threshold, limit) {
|
|
11893
|
+
if (thresholds[threshold] === void 0) {
|
|
11894
|
+
return false;
|
|
11895
|
+
}
|
|
11896
|
+
if (limit === void 0) {
|
|
11897
|
+
return thresholds[threshold];
|
|
11898
|
+
}
|
|
11899
|
+
thresholds[threshold] = limit;
|
|
11900
|
+
if (threshold === "s") {
|
|
11901
|
+
thresholds.ss = limit - 1;
|
|
11902
|
+
}
|
|
11903
|
+
return true;
|
|
11904
|
+
}
|
|
11905
|
+
function humanize(argWithSuffix, argThresholds) {
|
|
11906
|
+
if (!this.isValid()) {
|
|
11907
|
+
return this.localeData().invalidDate();
|
|
11908
|
+
}
|
|
11909
|
+
var withSuffix = false, th = thresholds, locale2, output;
|
|
11910
|
+
if (typeof argWithSuffix === "object") {
|
|
11911
|
+
argThresholds = argWithSuffix;
|
|
11912
|
+
argWithSuffix = false;
|
|
11913
|
+
}
|
|
11914
|
+
if (typeof argWithSuffix === "boolean") {
|
|
11915
|
+
withSuffix = argWithSuffix;
|
|
11916
|
+
}
|
|
11917
|
+
if (typeof argThresholds === "object") {
|
|
11918
|
+
th = Object.assign({}, thresholds, argThresholds);
|
|
11919
|
+
if (argThresholds.s != null && argThresholds.ss == null) {
|
|
11920
|
+
th.ss = argThresholds.s - 1;
|
|
11921
|
+
}
|
|
11922
|
+
}
|
|
11923
|
+
locale2 = this.localeData();
|
|
11924
|
+
output = relativeTime$1(this, !withSuffix, th, locale2);
|
|
11925
|
+
if (withSuffix) {
|
|
11926
|
+
output = locale2.pastFuture(+this, output);
|
|
11927
|
+
}
|
|
11928
|
+
return locale2.postformat(output);
|
|
11929
|
+
}
|
|
11930
|
+
var abs$1 = Math.abs;
|
|
11931
|
+
function sign(x) {
|
|
11932
|
+
return (x > 0) - (x < 0) || +x;
|
|
11933
|
+
}
|
|
11934
|
+
function toISOString$1() {
|
|
11935
|
+
if (!this.isValid()) {
|
|
11936
|
+
return this.localeData().invalidDate();
|
|
11937
|
+
}
|
|
11938
|
+
var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
|
|
11939
|
+
if (!total) {
|
|
11940
|
+
return "P0D";
|
|
11941
|
+
}
|
|
11942
|
+
minutes2 = absFloor(seconds2 / 60);
|
|
11943
|
+
hours2 = absFloor(minutes2 / 60);
|
|
11944
|
+
seconds2 %= 60;
|
|
11945
|
+
minutes2 %= 60;
|
|
11946
|
+
years2 = absFloor(months2 / 12);
|
|
11947
|
+
months2 %= 12;
|
|
11948
|
+
s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
|
|
11949
|
+
totalSign = total < 0 ? "-" : "";
|
|
11950
|
+
ymSign = sign(this._months) !== sign(total) ? "-" : "";
|
|
11951
|
+
daysSign = sign(this._days) !== sign(total) ? "-" : "";
|
|
11952
|
+
hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
|
|
11953
|
+
return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
|
|
11954
|
+
}
|
|
11955
|
+
var proto$2 = Duration.prototype;
|
|
11956
|
+
proto$2.isValid = isValid$1;
|
|
11957
|
+
proto$2.abs = abs;
|
|
11958
|
+
proto$2.add = add$1;
|
|
11959
|
+
proto$2.subtract = subtract$1;
|
|
11960
|
+
proto$2.as = as;
|
|
11961
|
+
proto$2.asMilliseconds = asMilliseconds;
|
|
11962
|
+
proto$2.asSeconds = asSeconds;
|
|
11963
|
+
proto$2.asMinutes = asMinutes;
|
|
11964
|
+
proto$2.asHours = asHours;
|
|
11965
|
+
proto$2.asDays = asDays;
|
|
11966
|
+
proto$2.asWeeks = asWeeks;
|
|
11967
|
+
proto$2.asMonths = asMonths;
|
|
11968
|
+
proto$2.asQuarters = asQuarters;
|
|
11969
|
+
proto$2.asYears = asYears;
|
|
11970
|
+
proto$2.valueOf = valueOf$1;
|
|
11971
|
+
proto$2._bubble = bubble;
|
|
11972
|
+
proto$2.clone = clone$1;
|
|
11973
|
+
proto$2.get = get$2;
|
|
11974
|
+
proto$2.milliseconds = milliseconds;
|
|
11975
|
+
proto$2.seconds = seconds;
|
|
11976
|
+
proto$2.minutes = minutes;
|
|
11977
|
+
proto$2.hours = hours;
|
|
11978
|
+
proto$2.days = days;
|
|
11979
|
+
proto$2.weeks = weeks;
|
|
11980
|
+
proto$2.months = months;
|
|
11981
|
+
proto$2.years = years;
|
|
11982
|
+
proto$2.humanize = humanize;
|
|
11983
|
+
proto$2.toISOString = toISOString$1;
|
|
11984
|
+
proto$2.toString = toISOString$1;
|
|
11985
|
+
proto$2.toJSON = toISOString$1;
|
|
11986
|
+
proto$2.locale = locale;
|
|
11987
|
+
proto$2.localeData = localeData;
|
|
11988
|
+
proto$2.toIsoString = deprecate(
|
|
11989
|
+
"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
|
|
11990
|
+
toISOString$1
|
|
11991
|
+
);
|
|
11992
|
+
proto$2.lang = lang;
|
|
11993
|
+
addFormatToken("X", 0, 0, "unix");
|
|
11994
|
+
addFormatToken("x", 0, 0, "valueOf");
|
|
11995
|
+
addRegexToken("x", matchSigned);
|
|
11996
|
+
addRegexToken("X", matchTimestamp);
|
|
11997
|
+
addParseToken("X", function(input, array, config) {
|
|
11998
|
+
config._d = new Date(parseFloat(input) * 1e3);
|
|
11999
|
+
});
|
|
12000
|
+
addParseToken("x", function(input, array, config) {
|
|
12001
|
+
config._d = new Date(toInt(input));
|
|
12002
|
+
});
|
|
12003
|
+
//! moment.js
|
|
12004
|
+
hooks.version = "2.30.1";
|
|
12005
|
+
setHookCallback(createLocal);
|
|
12006
|
+
hooks.fn = proto;
|
|
12007
|
+
hooks.min = min;
|
|
12008
|
+
hooks.max = max;
|
|
12009
|
+
hooks.now = now;
|
|
12010
|
+
hooks.utc = createUTC;
|
|
12011
|
+
hooks.unix = createUnix;
|
|
12012
|
+
hooks.months = listMonths;
|
|
12013
|
+
hooks.isDate = isDate;
|
|
12014
|
+
hooks.locale = getSetGlobalLocale;
|
|
12015
|
+
hooks.invalid = createInvalid;
|
|
12016
|
+
hooks.duration = createDuration;
|
|
12017
|
+
hooks.isMoment = isMoment;
|
|
12018
|
+
hooks.weekdays = listWeekdays;
|
|
12019
|
+
hooks.parseZone = createInZone;
|
|
12020
|
+
hooks.localeData = getLocale;
|
|
12021
|
+
hooks.isDuration = isDuration;
|
|
12022
|
+
hooks.monthsShort = listMonthsShort;
|
|
12023
|
+
hooks.weekdaysMin = listWeekdaysMin;
|
|
12024
|
+
hooks.defineLocale = defineLocale;
|
|
12025
|
+
hooks.updateLocale = updateLocale;
|
|
12026
|
+
hooks.locales = listLocales;
|
|
12027
|
+
hooks.weekdaysShort = listWeekdaysShort;
|
|
12028
|
+
hooks.normalizeUnits = normalizeUnits;
|
|
12029
|
+
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
|
12030
|
+
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
|
12031
|
+
hooks.calendarFormat = getCalendarFormat;
|
|
12032
|
+
hooks.prototype = proto;
|
|
12033
|
+
hooks.HTML5_FMT = {
|
|
12034
|
+
DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
|
|
12035
|
+
// <input type="datetime-local" />
|
|
12036
|
+
DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
|
|
12037
|
+
// <input type="datetime-local" step="1" />
|
|
12038
|
+
DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
|
|
12039
|
+
// <input type="datetime-local" step="0.001" />
|
|
12040
|
+
DATE: "YYYY-MM-DD",
|
|
12041
|
+
// <input type="date" />
|
|
12042
|
+
TIME: "HH:mm",
|
|
12043
|
+
// <input type="time" />
|
|
12044
|
+
TIME_SECONDS: "HH:mm:ss",
|
|
12045
|
+
// <input type="time" step="1" />
|
|
12046
|
+
TIME_MS: "HH:mm:ss.SSS",
|
|
12047
|
+
// <input type="time" step="0.001" />
|
|
12048
|
+
WEEK: "GGGG-[W]WW",
|
|
12049
|
+
// <input type="week" />
|
|
12050
|
+
MONTH: "YYYY-MM"
|
|
12051
|
+
// <input type="month" />
|
|
12052
|
+
};
|
|
12053
|
+
//! moment.js locale configuration
|
|
12054
|
+
//! locale : French [fr]
|
|
12055
|
+
//! author : John Fischer : https://github.com/jfroffice
|
|
12056
|
+
var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, monthsParse = [
|
|
12057
|
+
/^janv/i,
|
|
12058
|
+
/^févr/i,
|
|
12059
|
+
/^mars/i,
|
|
12060
|
+
/^avr/i,
|
|
12061
|
+
/^mai/i,
|
|
12062
|
+
/^juin/i,
|
|
12063
|
+
/^juil/i,
|
|
12064
|
+
/^août/i,
|
|
12065
|
+
/^sept/i,
|
|
12066
|
+
/^oct/i,
|
|
12067
|
+
/^nov/i,
|
|
12068
|
+
/^déc/i
|
|
12069
|
+
];
|
|
12070
|
+
hooks.defineLocale("fr", {
|
|
12071
|
+
months: "janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split(
|
|
12072
|
+
"_"
|
|
12073
|
+
),
|
|
12074
|
+
monthsShort: "janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split(
|
|
12075
|
+
"_"
|
|
12076
|
+
),
|
|
12077
|
+
monthsRegex,
|
|
12078
|
+
monthsShortRegex: monthsRegex,
|
|
12079
|
+
monthsStrictRegex,
|
|
12080
|
+
monthsShortStrictRegex,
|
|
12081
|
+
monthsParse,
|
|
12082
|
+
longMonthsParse: monthsParse,
|
|
12083
|
+
shortMonthsParse: monthsParse,
|
|
12084
|
+
weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),
|
|
12085
|
+
weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"),
|
|
12086
|
+
weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"),
|
|
12087
|
+
weekdaysParseExact: true,
|
|
12088
|
+
longDateFormat: {
|
|
12089
|
+
LT: "HH:mm",
|
|
12090
|
+
LTS: "HH:mm:ss",
|
|
12091
|
+
L: "DD/MM/YYYY",
|
|
12092
|
+
LL: "D MMMM YYYY",
|
|
12093
|
+
LLL: "D MMMM YYYY HH:mm",
|
|
12094
|
+
LLLL: "dddd D MMMM YYYY HH:mm"
|
|
12095
|
+
},
|
|
12096
|
+
calendar: {
|
|
12097
|
+
sameDay: "[Aujourd’hui à] LT",
|
|
12098
|
+
nextDay: "[Demain à] LT",
|
|
12099
|
+
nextWeek: "dddd [à] LT",
|
|
12100
|
+
lastDay: "[Hier à] LT",
|
|
12101
|
+
lastWeek: "dddd [dernier à] LT",
|
|
12102
|
+
sameElse: "L"
|
|
12103
|
+
},
|
|
12104
|
+
relativeTime: {
|
|
12105
|
+
future: "dans %s",
|
|
12106
|
+
past: "il y a %s",
|
|
12107
|
+
s: "quelques secondes",
|
|
12108
|
+
ss: "%d secondes",
|
|
12109
|
+
m: "une minute",
|
|
12110
|
+
mm: "%d minutes",
|
|
12111
|
+
h: "une heure",
|
|
12112
|
+
hh: "%d heures",
|
|
12113
|
+
d: "un jour",
|
|
12114
|
+
dd: "%d jours",
|
|
12115
|
+
w: "une semaine",
|
|
12116
|
+
ww: "%d semaines",
|
|
12117
|
+
M: "un mois",
|
|
12118
|
+
MM: "%d mois",
|
|
12119
|
+
y: "un an",
|
|
12120
|
+
yy: "%d ans"
|
|
12121
|
+
},
|
|
12122
|
+
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
|
|
12123
|
+
ordinal: function(number2, period) {
|
|
12124
|
+
switch (period) {
|
|
12125
|
+
// TODO: Return 'e' when day of month > 1. Move this case inside
|
|
12126
|
+
// block for masculine words below.
|
|
12127
|
+
// See https://github.com/moment/moment/issues/3375
|
|
12128
|
+
case "D":
|
|
12129
|
+
return number2 + (number2 === 1 ? "er" : "");
|
|
12130
|
+
// Words with masculine grammatical gender: mois, trimestre, jour
|
|
12131
|
+
default:
|
|
12132
|
+
case "M":
|
|
12133
|
+
case "Q":
|
|
12134
|
+
case "DDD":
|
|
12135
|
+
case "d":
|
|
12136
|
+
return number2 + (number2 === 1 ? "er" : "e");
|
|
12137
|
+
// Words with feminine grammatical gender: semaine
|
|
12138
|
+
case "w":
|
|
12139
|
+
case "W":
|
|
12140
|
+
return number2 + (number2 === 1 ? "re" : "e");
|
|
12141
|
+
}
|
|
12142
|
+
},
|
|
12143
|
+
week: {
|
|
12144
|
+
dow: 1,
|
|
12145
|
+
// Monday is the first day of the week.
|
|
12146
|
+
doy: 4
|
|
12147
|
+
// The week that contains Jan 4th is the first week of the year.
|
|
12148
|
+
}
|
|
12149
|
+
});
|
|
12150
|
+
var AccountStatus;
|
|
12151
|
+
(function(AccountStatus2) {
|
|
12152
|
+
AccountStatus2[AccountStatus2["DISABLED"] = 0] = "DISABLED";
|
|
12153
|
+
AccountStatus2[AccountStatus2["ENABLED"] = 1] = "ENABLED";
|
|
12154
|
+
})(AccountStatus || (AccountStatus = {}));
|
|
12155
|
+
var AdContentType;
|
|
12156
|
+
(function(AdContentType2) {
|
|
12157
|
+
AdContentType2["IMAGE"] = "image";
|
|
12158
|
+
AdContentType2["VIDEO"] = "video";
|
|
12159
|
+
})(AdContentType || (AdContentType = {}));
|
|
12160
|
+
var AuthType;
|
|
12161
|
+
(function(AuthType2) {
|
|
12162
|
+
AuthType2[AuthType2["UNDEFINED"] = 0] = "UNDEFINED";
|
|
12163
|
+
AuthType2[AuthType2["EMAIL_PASSWORD"] = 1] = "EMAIL_PASSWORD";
|
|
12164
|
+
AuthType2[AuthType2["PHONE"] = 2] = "PHONE";
|
|
12165
|
+
AuthType2[AuthType2["GOOGLE"] = 3] = "GOOGLE";
|
|
12166
|
+
AuthType2[AuthType2["FACEBOOK"] = 4] = "FACEBOOK";
|
|
12167
|
+
AuthType2[AuthType2["TWITTER"] = 5] = "TWITTER";
|
|
12168
|
+
})(AuthType || (AuthType = {}));
|
|
12169
|
+
var Bool;
|
|
12170
|
+
(function(Bool2) {
|
|
12171
|
+
Bool2[Bool2["FALSE"] = 0] = "FALSE";
|
|
12172
|
+
Bool2[Bool2["TRUE"] = 1] = "TRUE";
|
|
12173
|
+
})(Bool || (Bool = {}));
|
|
12174
|
+
var ContentType;
|
|
12175
|
+
(function(ContentType2) {
|
|
12176
|
+
ContentType2["NEWS_TAG"] = "news-tag";
|
|
12177
|
+
ContentType2["NEWS_CATEGORY"] = "news-category";
|
|
12178
|
+
ContentType2["NEWS_ARTICLE"] = "news-article";
|
|
12179
|
+
ContentType2["CONTENT_MODEL"] = "content-model";
|
|
12180
|
+
})(ContentType || (ContentType = {}));
|
|
12181
|
+
var MenuItemTargetType;
|
|
12182
|
+
(function(MenuItemTargetType2) {
|
|
12183
|
+
MenuItemTargetType2["EXTERNAL_LINK"] = "external-link";
|
|
12184
|
+
MenuItemTargetType2["PAGE_LINK"] = "page-link";
|
|
12185
|
+
MenuItemTargetType2["CONTENT_LINK"] = "content-link";
|
|
12186
|
+
})(MenuItemTargetType || (MenuItemTargetType = {}));
|
|
12187
|
+
var NotificationSource;
|
|
12188
|
+
(function(NotificationSource2) {
|
|
12189
|
+
NotificationSource2[NotificationSource2["SYSTEM"] = 1] = "SYSTEM";
|
|
12190
|
+
NotificationSource2[NotificationSource2["USER"] = 2] = "USER";
|
|
12191
|
+
})(NotificationSource || (NotificationSource = {}));
|
|
12192
|
+
var NotificationType;
|
|
12193
|
+
(function(NotificationType2) {
|
|
12194
|
+
NotificationType2["WELCOME_USER"] = "App\\Notifications\\WelcomeUser";
|
|
12195
|
+
})(NotificationType || (NotificationType = {}));
|
|
12196
|
+
var PermalinkContentType;
|
|
12197
|
+
(function(PermalinkContentType2) {
|
|
12198
|
+
PermalinkContentType2["NEWS_TAG"] = "news-tag";
|
|
12199
|
+
PermalinkContentType2["NEWS_CATEGORY"] = "news-category";
|
|
12200
|
+
PermalinkContentType2["NEWS_ARTICLE"] = "news-article";
|
|
12201
|
+
PermalinkContentType2["CONTENT_MODEL"] = "content-model";
|
|
12202
|
+
})(PermalinkContentType || (PermalinkContentType = {}));
|
|
12203
|
+
var ProfileType;
|
|
12204
|
+
(function(ProfileType2) {
|
|
12205
|
+
ProfileType2["SUBSCRIBER"] = "App\\Models\\SubscriberProfile";
|
|
12206
|
+
})(ProfileType || (ProfileType = {}));
|
|
12207
|
+
var ResponseErrorCode;
|
|
12208
|
+
(function(ResponseErrorCode2) {
|
|
12209
|
+
ResponseErrorCode2["FORM_INVALID_DATA"] = "form/invalid_data";
|
|
12210
|
+
ResponseErrorCode2["AUTH_LOGIN_FAILED"] = "auth/login_failed";
|
|
12211
|
+
ResponseErrorCode2["AUTH_REGISTRATION_FAILED"] = "auth/registration_failed";
|
|
12212
|
+
ResponseErrorCode2["AUTH_MISSING_DATA"] = "auth/missing_data";
|
|
12213
|
+
ResponseErrorCode2["AUTH_WRONG_PASSWORD"] = "auth/wrong_password";
|
|
12214
|
+
ResponseErrorCode2["AUTH_USER_DISABLED"] = "auth/user_disabled";
|
|
12215
|
+
ResponseErrorCode2["AUTH_USER_NOT_FOUND"] = "auth/user_not_found";
|
|
12216
|
+
ResponseErrorCode2["AUTH_PROFILE_TYPE_NOT_FOUND"] = "auth/profile_type_not_found";
|
|
12217
|
+
ResponseErrorCode2["AUTH_EMAIL_ALREADY_USED"] = "auth/email_already_used";
|
|
12218
|
+
ResponseErrorCode2["AUTH_EMAIL_ALREADY_VERIFIED"] = "auth/email_already_verified";
|
|
12219
|
+
ResponseErrorCode2["AUTH_PROFILE_ALREADY_EXISTS"] = "auth/profile_already_exists";
|
|
12220
|
+
ResponseErrorCode2["AUTH_PROFILE_NOT_FOUND"] = "auth/profile_not_found";
|
|
12221
|
+
ResponseErrorCode2["AUTH_INVALID_TOKEN"] = "auth/invalid_token";
|
|
12222
|
+
ResponseErrorCode2["AUTH_CODE_SENDING_FAILED"] = "auth/code_sending_failed";
|
|
12223
|
+
ResponseErrorCode2["AUTH_CODE_VERIFICATION_FAILED"] = "auth/code_verification_failed";
|
|
12224
|
+
ResponseErrorCode2["AUTH_CODE_EXPIRED"] = "auth/code_expired";
|
|
12225
|
+
})(ResponseErrorCode || (ResponseErrorCode = {}));
|
|
12226
|
+
var UserRole;
|
|
12227
|
+
(function(UserRole2) {
|
|
12228
|
+
UserRole2["SUPER_ADMIN"] = "super-admin";
|
|
12229
|
+
UserRole2["ADMIN"] = "admin";
|
|
12230
|
+
UserRole2["USER"] = "user";
|
|
12231
|
+
})(UserRole || (UserRole = {}));
|
|
12232
|
+
const RootContainer = ({
|
|
12233
|
+
page,
|
|
12234
|
+
sections = [],
|
|
12235
|
+
components = {}
|
|
12236
|
+
}) => {
|
|
12237
|
+
React.useEffect(() => {
|
|
12238
|
+
const timeout = setTimeout(() => {
|
|
12239
|
+
const sectionData = page.props?.sectionData;
|
|
12240
|
+
if (sectionData && sections.find(
|
|
12241
|
+
(section) => section.slug === sectionData.slug && section.pivot?.linkId === sectionData.pivot?.linkId
|
|
12242
|
+
)) {
|
|
12243
|
+
slideToId(`${sectionData.slug}__${sectionData.pivot?.linkId}-container`);
|
|
12244
|
+
}
|
|
12245
|
+
}, 1e3);
|
|
12246
|
+
return () => clearTimeout(timeout);
|
|
12247
|
+
}, [page, sections]);
|
|
12248
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: sections.map((section, i) => {
|
|
12249
|
+
const Component = components[section.name];
|
|
12250
|
+
if (!Component) return null;
|
|
12251
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12252
|
+
"section",
|
|
12253
|
+
{
|
|
12254
|
+
id: `${section.slug}__${section.pivot?.linkId}-container`,
|
|
12255
|
+
className: "reset-styles",
|
|
12256
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12257
|
+
Component,
|
|
12258
|
+
{
|
|
12259
|
+
data: section.pivot?.data,
|
|
12260
|
+
settings: section.pivot?.settings,
|
|
12261
|
+
sectionKey: `${section.slug}__${section.pivot?.linkId}`,
|
|
12262
|
+
metadata: {
|
|
12263
|
+
slug: section.slug,
|
|
12264
|
+
name: section.name,
|
|
12265
|
+
title: section.title,
|
|
12266
|
+
linkId: section.pivot?.linkId,
|
|
12267
|
+
createdAt: section.createdAt,
|
|
12268
|
+
updatedAt: section.updatedAt
|
|
12269
|
+
}
|
|
12270
|
+
}
|
|
12271
|
+
)
|
|
12272
|
+
},
|
|
12273
|
+
`section-${i}`
|
|
12274
|
+
);
|
|
12275
|
+
}) });
|
|
12276
|
+
};
|
|
7784
12277
|
exports.AsyncImg = AsyncImg;
|
|
7785
12278
|
exports.CustomTransition = CustomTransition;
|
|
12279
|
+
exports.MountedTeleport = MountedTeleport;
|
|
12280
|
+
exports.ReadMore = ReadMore;
|
|
12281
|
+
exports.RootContainer = RootContainer;
|
|
12282
|
+
exports.StickyBottom = StickyBottom;
|
|
12283
|
+
exports.StickyTop = StickyTop;
|