yummies 5.15.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/async.cjs +45 -1
- package/async.cjs.map +1 -1
- package/async.d.ts +7 -6
- package/common.cjs +11 -1
- package/common.cjs.map +1 -1
- package/common.d.ts +8 -5
- package/common.js.map +1 -1
- package/complex.cjs +88 -1
- package/complex.cjs.map +1 -1
- package/{complex/modules-factory.d.ts → complex.d.ts} +31 -4
- package/complex.js.map +1 -1
- package/cookie.cjs +9 -1
- package/cookie.cjs.map +1 -1
- package/cookie.d.ts +5 -3
- package/cookie.js.map +1 -1
- package/css.cjs +45 -1
- package/css.cjs.map +1 -1
- package/css.d.ts +11 -8
- package/css.js.map +1 -1
- package/data.cjs +43 -1
- package/data.cjs.map +1 -1
- package/data.d.ts +5 -4
- package/data.js.map +1 -1
- package/date-time.cjs +395 -1
- package/date-time.cjs.map +1 -1
- package/date-time.d.ts +12 -10
- package/date-time.js.map +1 -1
- package/device.cjs +32 -1
- package/device.cjs.map +1 -1
- package/device.d.ts +9 -8
- package/encodings.cjs +270 -1
- package/encodings.cjs.map +1 -1
- package/encodings.d.ts +3 -2
- package/encodings.js.map +1 -1
- package/errors.cjs +23 -1
- package/errors.cjs.map +1 -1
- package/errors.d.ts +5 -4
- package/errors.js.map +1 -1
- package/file.cjs +28 -1
- package/file.cjs.map +1 -1
- package/file.d.ts +4 -3
- package/format.cjs +75 -1
- package/format.cjs.map +1 -1
- package/format.d.ts +74 -0
- package/format.js.map +1 -1
- package/html.cjs +167 -1
- package/html.cjs.map +1 -1
- package/html.d.ts +19 -17
- package/html.js.map +1 -1
- package/id.cjs +25 -1
- package/id.cjs.map +1 -1
- package/id.d.ts +9 -8
- package/imports.cjs +33 -1
- package/imports.cjs.map +1 -1
- package/imports.d.ts +6 -4
- package/math.cjs +14 -1
- package/math.cjs.map +1 -1
- package/math.d.ts +7 -5
- package/math.js.map +1 -1
- package/media.cjs +105 -1
- package/media.cjs.map +1 -1
- package/media.d.ts +11 -11
- package/mobx.cjs +184 -1
- package/mobx.cjs.map +1 -1
- package/mobx.d.ts +66 -0
- package/mobx.js +16 -12
- package/mobx.js.map +1 -1
- package/ms.cjs +13 -1
- package/ms.cjs.map +1 -1
- package/ms.d.ts +4 -3
- package/number.cjs +10 -1
- package/number.cjs.map +1 -1
- package/number.d.ts +3 -2
- package/package.json +39 -113
- package/parser.cjs +68 -1
- package/parser.cjs.map +1 -1
- package/parser.d.ts +41 -0
- package/parser.js.map +1 -1
- package/price.cjs +20 -1
- package/price.cjs.map +1 -1
- package/price.d.ts +5 -3
- package/random.cjs +24 -1
- package/random.cjs.map +1 -1
- package/random.d.ts +10 -9
- package/react.cjs +216 -1
- package/react.cjs.map +1 -1
- package/react.d.ts +113 -0
- package/react.js.map +1 -1
- package/sound.cjs +11 -1
- package/sound.cjs.map +1 -1
- package/sound.d.ts +3 -2
- package/text.cjs +37 -1
- package/text.cjs.map +1 -1
- package/text.d.ts +4 -3
- package/type-guard.cjs +75 -1
- package/type-guard.cjs.map +1 -1
- package/type-guard.d.ts +121 -0
- package/type-guard.js.map +1 -1
- package/{utils/types.d.ts → types.d.ts} +54 -53
- package/types.global.cjs +2 -0
- package/types.global.cjs.map +1 -0
- package/{utility-types.d.ts → types.global.d.ts} +1 -1
- package/types.global.js +2 -0
- package/types.global.js.map +1 -0
- package/vibrate.cjs +8 -1
- package/vibrate.cjs.map +1 -1
- package/vibrate.d.ts +3 -2
- package/async.d.ts.map +0 -1
- package/common.d.ts.map +0 -1
- package/complex/counter.d.ts +0 -15
- package/complex/counter.d.ts.map +0 -1
- package/complex/global-config.d.ts +0 -11
- package/complex/global-config.d.ts.map +0 -1
- package/complex/index.d.ts +0 -4
- package/complex/index.d.ts.map +0 -1
- package/complex/modules-factory.d.ts.map +0 -1
- package/cookie.d.ts.map +0 -1
- package/css.d.ts.map +0 -1
- package/data.d.ts.map +0 -1
- package/date-time.d.ts.map +0 -1
- package/device.d.ts.map +0 -1
- package/encodings.d.ts.map +0 -1
- package/errors.d.ts.map +0 -1
- package/file.d.ts.map +0 -1
- package/format/_exports.d.ts +0 -5
- package/format/_exports.d.ts.map +0 -1
- package/format/constants.d.ts +0 -4
- package/format/constants.d.ts.map +0 -1
- package/format/index.d.ts +0 -3
- package/format/index.d.ts.map +0 -1
- package/format/number.d.ts +0 -36
- package/format/number.d.ts.map +0 -1
- package/format/percent.d.ts +0 -15
- package/format/percent.d.ts.map +0 -1
- package/format/skip-spaces.d.ts +0 -5
- package/format/skip-spaces.d.ts.map +0 -1
- package/html.d.ts.map +0 -1
- package/id.d.ts.map +0 -1
- package/imports.d.ts.map +0 -1
- package/math.d.ts.map +0 -1
- package/media.d.ts.map +0 -1
- package/mobx/apply-observable.d.ts +0 -4
- package/mobx/apply-observable.d.ts.map +0 -1
- package/mobx/create-enhanced-atom.d.ts +0 -11
- package/mobx/create-enhanced-atom.d.ts.map +0 -1
- package/mobx/create-ref.d.ts +0 -25
- package/mobx/create-ref.d.ts.map +0 -1
- package/mobx/deep-observable-struct.d.ts +0 -7
- package/mobx/deep-observable-struct.d.ts.map +0 -1
- package/mobx/get-mobx-administration.d.ts +0 -6
- package/mobx/get-mobx-administration.d.ts.map +0 -1
- package/mobx/index.d.ts +0 -7
- package/mobx/index.d.ts.map +0 -1
- package/mobx/lazy-observe.d.ts +0 -14
- package/mobx/lazy-observe.d.ts.map +0 -1
- package/ms.d.ts.map +0 -1
- package/number.d.ts.map +0 -1
- package/parser/_exports.d.ts +0 -4
- package/parser/_exports.d.ts.map +0 -1
- package/parser/index.d.ts +0 -3
- package/parser/index.d.ts.map +0 -1
- package/parser/number.d.ts +0 -21
- package/parser/number.d.ts.map +0 -1
- package/parser/percent.d.ts +0 -4
- package/parser/percent.d.ts.map +0 -1
- package/parser/string.d.ts +0 -7
- package/parser/string.d.ts.map +0 -1
- package/price.d.ts.map +0 -1
- package/random.d.ts.map +0 -1
- package/react/hooks/index.d.ts +0 -22
- package/react/hooks/index.d.ts.map +0 -1
- package/react/hooks/use-abort-controller.d.ts +0 -2
- package/react/hooks/use-abort-controller.d.ts.map +0 -1
- package/react/hooks/use-abort-signal.d.ts +0 -2
- package/react/hooks/use-abort-signal.d.ts.map +0 -1
- package/react/hooks/use-click-outside.d.ts +0 -9
- package/react/hooks/use-click-outside.d.ts.map +0 -1
- package/react/hooks/use-constant.d.ts +0 -9
- package/react/hooks/use-constant.d.ts.map +0 -1
- package/react/hooks/use-define-ref.d.ts +0 -10
- package/react/hooks/use-define-ref.d.ts.map +0 -1
- package/react/hooks/use-element-ref.d.ts +0 -2
- package/react/hooks/use-element-ref.d.ts.map +0 -1
- package/react/hooks/use-event-listener.d.ts +0 -8
- package/react/hooks/use-event-listener.d.ts.map +0 -1
- package/react/hooks/use-event.d.ts +0 -3
- package/react/hooks/use-event.d.ts.map +0 -1
- package/react/hooks/use-flag.d.ts +0 -8
- package/react/hooks/use-flag.d.ts.map +0 -1
- package/react/hooks/use-force-update.d.ts +0 -2
- package/react/hooks/use-force-update.d.ts.map +0 -1
- package/react/hooks/use-initial-height.d.ts +0 -5
- package/react/hooks/use-initial-height.d.ts.map +0 -1
- package/react/hooks/use-instance.d.ts +0 -27
- package/react/hooks/use-instance.d.ts.map +0 -1
- package/react/hooks/use-intersection-observer.d.ts +0 -2
- package/react/hooks/use-intersection-observer.d.ts.map +0 -1
- package/react/hooks/use-last-defined-value.d.ts +0 -2
- package/react/hooks/use-last-defined-value.d.ts.map +0 -1
- package/react/hooks/use-last-value-ref.d.ts +0 -2
- package/react/hooks/use-last-value-ref.d.ts.map +0 -1
- package/react/hooks/use-life-cycle.d.ts +0 -5
- package/react/hooks/use-life-cycle.d.ts.map +0 -1
- package/react/hooks/use-resize-observer.d.ts +0 -2
- package/react/hooks/use-resize-observer.d.ts.map +0 -1
- package/react/hooks/use-sync-ref.d.ts +0 -2
- package/react/hooks/use-sync-ref.d.ts.map +0 -1
- package/react/hooks/use-toggle.d.ts +0 -2
- package/react/hooks/use-toggle.d.ts.map +0 -1
- package/react/hooks/use-value.d.ts +0 -5
- package/react/hooks/use-value.d.ts.map +0 -1
- package/react/hooks/use-visibility-state.d.ts +0 -2
- package/react/hooks/use-visibility-state.d.ts.map +0 -1
- package/react/index.d.ts +0 -2
- package/react/index.d.ts.map +0 -1
- package/sound.d.ts.map +0 -1
- package/storage.d.ts +0 -39
- package/storage.d.ts.map +0 -1
- package/text.d.ts.map +0 -1
- package/type-guard/_exports.d.ts +0 -86
- package/type-guard/_exports.d.ts.map +0 -1
- package/type-guard/index.d.ts +0 -3
- package/type-guard/index.d.ts.map +0 -1
- package/utility-types.cjs +0 -2
- package/utility-types.cjs.map +0 -1
- package/utility-types.d.ts.map +0 -1
- package/utility-types.js +0 -2
- package/utility-types.js.map +0 -1
- package/utils/types.d.ts.map +0 -1
- package/vibrate.d.ts.map +0 -1
- /package/{utils/types.cjs → types.cjs} +0 -0
- /package/{utils/types.cjs.map → types.cjs.map} +0 -0
- /package/{utils/types.js → types.js} +0 -0
- /package/{utils/types.js.map → types.js.map} +0 -0
package/data.cjs
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const isShallowEqual = (a, b) => {
|
|
4
|
+
if (a === b) return true;
|
|
5
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (a.constructor !== b.constructor) return false;
|
|
9
|
+
const isArrayA = Array.isArray(a);
|
|
10
|
+
if (isArrayA !== Array.isArray(b)) return false;
|
|
11
|
+
if (isArrayA) {
|
|
12
|
+
const arrA = a;
|
|
13
|
+
const arrB = b;
|
|
14
|
+
if (arrA.length !== arrB.length) return false;
|
|
15
|
+
for (const [i, element] of arrA.entries()) {
|
|
16
|
+
if (element !== arrB[i]) return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (a instanceof Date) return a.getTime() === b.getTime();
|
|
21
|
+
if (a instanceof RegExp) return a.toString() === b.toString();
|
|
22
|
+
const aKeys = Object.keys(a);
|
|
23
|
+
const bKeys = Object.keys(b);
|
|
24
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
25
|
+
const bObj = b;
|
|
26
|
+
for (const key of aKeys) {
|
|
27
|
+
if (!Object.hasOwn(bObj, key) || a[key] !== bObj[key]) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
const flatMapDeep = (arr, fn) => Array.isArray(arr) ? arr.flatMap((c) => flatMapDeep(c, fn)) : [fn(arr, 0, [arr])];
|
|
34
|
+
const safeJsonParse = (json) => {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(json);
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.flatMapDeep = flatMapDeep;
|
|
42
|
+
exports.isShallowEqual = isShallowEqual;
|
|
43
|
+
exports.safeJsonParse = safeJsonParse;
|
|
2
44
|
//# sourceMappingURL=data.cjs.map
|
package/data.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.cjs","sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject } from 'yummies/
|
|
1
|
+
{"version":3,"file":"data.cjs","sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject } from 'yummies/types';\n\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: TSource | TSource[],\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] =>\n Array.isArray(arr)\n ? arr.flatMap((c: TSource): TNewValue[] => flatMapDeep(c, fn))\n : [fn(arr, 0, [arr])];\n\nexport const safeJsonParse = (json: string) => {\n try {\n return JSON.parse(json);\n } catch {\n return null;\n }\n};\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAiB,CAAC,GAAY,MAAwB;AACjE,MAAI,MAAM,EAAG,QAAO;AAEpB,MACE,OAAO,MAAM,YACb,OAAO,MAAM,YACb,MAAM,QACN,MAAM,MACN;AACA,WAAO;AAAA,EACT;AAEA,MAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;AAE5C,QAAM,WAAW,MAAM,QAAQ,CAAC;AAEhC,MAAI,aAAa,MAAM,QAAQ,CAAC,EAAG,QAAO;AAE1C,MAAI,UAAU;AACZ,UAAM,OAAO;AACb,UAAM,OAAO;AACb,QAAI,KAAK,WAAW,KAAK,OAAQ,QAAO;AAExC,eAAW,CAAC,GAAG,OAAO,KAAK,KAAK,WAAW;AACzC,UAAI,YAAY,KAAK,CAAC,EAAG,QAAO;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,KAAM,QAAO,EAAE,QAAA,MAAe,EAAW,QAAA;AAE1D,MAAI,aAAa,OAAQ,QAAO,EAAE,SAAA,MAAgB,EAAa,SAAA;AAE/D,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM,OAAQ,QAAO;AAE1C,QAAM,OAAO;AACb,aAAW,OAAO,OAAO;AACvB,QAAI,CAAC,OAAO,OAAO,MAAM,GAAG,KAAM,EAAgB,GAAG,MAAM,KAAK,GAAG,GAAG;AACpE,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,cAAc,CACzB,KACA,OAEA,MAAM,QAAQ,GAAG,IACb,IAAI,QAAQ,CAAC,MAA4B,YAAY,GAAG,EAAE,CAAC,IAC3D,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjB,MAAM,gBAAgB,CAAC,SAAiB;AAC7C,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;;;;"}
|
package/data.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare const isShallowEqual: (a: unknown, b: unknown) => boolean;
|
|
2
|
+
declare const flatMapDeep: <TSource, TNewValue>(arr: TSource | TSource[], fn: (value: TSource, i: number, arr: TSource[]) => TNewValue) => TNewValue[];
|
|
3
|
+
declare const safeJsonParse: (json: string) => any;
|
|
4
|
+
|
|
5
|
+
export { flatMapDeep, isShallowEqual, safeJsonParse };
|
package/data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject } from 'yummies/
|
|
1
|
+
{"version":3,"file":"data.js","sources":["../src/data.ts"],"sourcesContent":["import type { AnyObject } from 'yummies/types';\n\nexport const isShallowEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (\n typeof a !== 'object' ||\n typeof b !== 'object' ||\n a === null ||\n b === null\n ) {\n return false;\n }\n\n if (a.constructor !== b.constructor) return false;\n\n const isArrayA = Array.isArray(a);\n\n if (isArrayA !== Array.isArray(b)) return false;\n\n if (isArrayA) {\n const arrA = a as unknown[];\n const arrB = b as unknown[];\n if (arrA.length !== arrB.length) return false;\n\n for (const [i, element] of arrA.entries()) {\n if (element !== arrB[i]) return false;\n }\n return true;\n }\n\n if (a instanceof Date) return a.getTime() === (b as Date).getTime();\n\n if (a instanceof RegExp) return a.toString() === (b as RegExp).toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) return false;\n\n const bObj = b as AnyObject;\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || (a as AnyObject)[key] !== bObj[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const flatMapDeep = <TSource, TNewValue>(\n arr: TSource | TSource[],\n fn: (value: TSource, i: number, arr: TSource[]) => TNewValue,\n): TNewValue[] =>\n Array.isArray(arr)\n ? arr.flatMap((c: TSource): TNewValue[] => flatMapDeep(c, fn))\n : [fn(arr, 0, [arr])];\n\nexport const safeJsonParse = (json: string) => {\n try {\n return JSON.parse(json);\n } catch {\n return null;\n }\n};\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,CAAC,GAAY,MAAwB;AACjE,MAAI,MAAM,EAAG,QAAO;AAEpB,MACE,OAAO,MAAM,YACb,OAAO,MAAM,YACb,MAAM,QACN,MAAM,MACN;AACA,WAAO;AAAA,EACT;AAEA,MAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;AAE5C,QAAM,WAAW,MAAM,QAAQ,CAAC;AAEhC,MAAI,aAAa,MAAM,QAAQ,CAAC,EAAG,QAAO;AAE1C,MAAI,UAAU;AACZ,UAAM,OAAO;AACb,UAAM,OAAO;AACb,QAAI,KAAK,WAAW,KAAK,OAAQ,QAAO;AAExC,eAAW,CAAC,GAAG,OAAO,KAAK,KAAK,WAAW;AACzC,UAAI,YAAY,KAAK,CAAC,EAAG,QAAO;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,KAAM,QAAO,EAAE,QAAA,MAAe,EAAW,QAAA;AAE1D,MAAI,aAAa,OAAQ,QAAO,EAAE,SAAA,MAAgB,EAAa,SAAA;AAE/D,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM,OAAQ,QAAO;AAE1C,QAAM,OAAO;AACb,aAAW,OAAO,OAAO;AACvB,QAAI,CAAC,OAAO,OAAO,MAAM,GAAG,KAAM,EAAgB,GAAG,MAAM,KAAK,GAAG,GAAG;AACpE,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,cAAc,CACzB,KACA,OAEA,MAAM,QAAQ,GAAG,IACb,IAAI,QAAQ,CAAC,MAA4B,YAAY,GAAG,EAAE,CAAC,IAC3D,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjB,MAAM,gBAAgB,CAAC,SAAiB;AAC7C,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
|
package/date-time.cjs
CHANGED
|
@@ -1,2 +1,396 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const dayjs = require("dayjs");
|
|
4
|
+
const format = require("yummies/format");
|
|
5
|
+
const ms = require("yummies/ms");
|
|
6
|
+
const text = require("yummies/text");
|
|
7
|
+
const typeGuard = require("yummies/type-guard");
|
|
8
|
+
function getDefaultExportFromCjs(x) {
|
|
9
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
10
|
+
}
|
|
11
|
+
var duration$2 = { exports: {} };
|
|
12
|
+
var duration$1 = duration$2.exports;
|
|
13
|
+
var hasRequiredDuration;
|
|
14
|
+
function requireDuration() {
|
|
15
|
+
if (hasRequiredDuration) return duration$2.exports;
|
|
16
|
+
hasRequiredDuration = 1;
|
|
17
|
+
(function(module2, exports2) {
|
|
18
|
+
!function(t, s) {
|
|
19
|
+
module2.exports = s();
|
|
20
|
+
}(duration$1, function() {
|
|
21
|
+
var t, s, n = 1e3, i = 6e4, e = 36e5, r = 864e5, o = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u = 31536e6, d = 2628e6, a = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h = { years: u, months: d, days: r, hours: e, minutes: i, seconds: n, milliseconds: 1, weeks: 6048e5 }, c = function(t2) {
|
|
22
|
+
return t2 instanceof g;
|
|
23
|
+
}, f = function(t2, s2, n2) {
|
|
24
|
+
return new g(t2, n2, s2.$l);
|
|
25
|
+
}, m = function(t2) {
|
|
26
|
+
return s.p(t2) + "s";
|
|
27
|
+
}, l = function(t2) {
|
|
28
|
+
return t2 < 0;
|
|
29
|
+
}, $ = function(t2) {
|
|
30
|
+
return l(t2) ? Math.ceil(t2) : Math.floor(t2);
|
|
31
|
+
}, y = function(t2) {
|
|
32
|
+
return Math.abs(t2);
|
|
33
|
+
}, v = function(t2, s2) {
|
|
34
|
+
return t2 ? l(t2) ? { negative: true, format: "" + y(t2) + s2 } : { negative: false, format: "" + t2 + s2 } : { negative: false, format: "" };
|
|
35
|
+
}, g = function() {
|
|
36
|
+
function l2(t2, s2, n2) {
|
|
37
|
+
var i2 = this;
|
|
38
|
+
if (this.$d = {}, this.$l = n2, void 0 === t2 && (this.$ms = 0, this.parseFromMilliseconds()), s2) return f(t2 * h[m(s2)], this);
|
|
39
|
+
if ("number" == typeof t2) return this.$ms = t2, this.parseFromMilliseconds(), this;
|
|
40
|
+
if ("object" == typeof t2) return Object.keys(t2).forEach(function(s3) {
|
|
41
|
+
i2.$d[m(s3)] = t2[s3];
|
|
42
|
+
}), this.calMilliseconds(), this;
|
|
43
|
+
if ("string" == typeof t2) {
|
|
44
|
+
var e2 = t2.match(a);
|
|
45
|
+
if (e2) {
|
|
46
|
+
var r2 = e2.slice(2).map(function(t3) {
|
|
47
|
+
return null != t3 ? Number(t3) : 0;
|
|
48
|
+
});
|
|
49
|
+
return this.$d.years = r2[0], this.$d.months = r2[1], this.$d.weeks = r2[2], this.$d.days = r2[3], this.$d.hours = r2[4], this.$d.minutes = r2[5], this.$d.seconds = r2[6], this.calMilliseconds(), this;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
var y2 = l2.prototype;
|
|
55
|
+
return y2.calMilliseconds = function() {
|
|
56
|
+
var t2 = this;
|
|
57
|
+
this.$ms = Object.keys(this.$d).reduce(function(s2, n2) {
|
|
58
|
+
return s2 + (t2.$d[n2] || 0) * h[n2];
|
|
59
|
+
}, 0);
|
|
60
|
+
}, y2.parseFromMilliseconds = function() {
|
|
61
|
+
var t2 = this.$ms;
|
|
62
|
+
this.$d.years = $(t2 / u), t2 %= u, this.$d.months = $(t2 / d), t2 %= d, this.$d.days = $(t2 / r), t2 %= r, this.$d.hours = $(t2 / e), t2 %= e, this.$d.minutes = $(t2 / i), t2 %= i, this.$d.seconds = $(t2 / n), t2 %= n, this.$d.milliseconds = t2;
|
|
63
|
+
}, y2.toISOString = function() {
|
|
64
|
+
var t2 = v(this.$d.years, "Y"), s2 = v(this.$d.months, "M"), n2 = +this.$d.days || 0;
|
|
65
|
+
this.$d.weeks && (n2 += 7 * this.$d.weeks);
|
|
66
|
+
var i2 = v(n2, "D"), e2 = v(this.$d.hours, "H"), r2 = v(this.$d.minutes, "M"), o2 = this.$d.seconds || 0;
|
|
67
|
+
this.$d.milliseconds && (o2 += this.$d.milliseconds / 1e3, o2 = Math.round(1e3 * o2) / 1e3);
|
|
68
|
+
var u2 = v(o2, "S"), d2 = t2.negative || s2.negative || i2.negative || e2.negative || r2.negative || u2.negative, a2 = e2.format || r2.format || u2.format ? "T" : "", h2 = (d2 ? "-" : "") + "P" + t2.format + s2.format + i2.format + a2 + e2.format + r2.format + u2.format;
|
|
69
|
+
return "P" === h2 || "-P" === h2 ? "P0D" : h2;
|
|
70
|
+
}, y2.toJSON = function() {
|
|
71
|
+
return this.toISOString();
|
|
72
|
+
}, y2.format = function(t2) {
|
|
73
|
+
var n2 = t2 || "YYYY-MM-DDTHH:mm:ss", i2 = { Y: this.$d.years, YY: s.s(this.$d.years, 2, "0"), YYYY: s.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s.s(this.$d.seconds, 2, "0"), SSS: s.s(this.$d.milliseconds, 3, "0") };
|
|
74
|
+
return n2.replace(o, function(t3, s2) {
|
|
75
|
+
return s2 || String(i2[t3]);
|
|
76
|
+
});
|
|
77
|
+
}, y2.as = function(t2) {
|
|
78
|
+
return this.$ms / h[m(t2)];
|
|
79
|
+
}, y2.get = function(t2) {
|
|
80
|
+
var s2 = this.$ms, n2 = m(t2);
|
|
81
|
+
return "milliseconds" === n2 ? s2 %= 1e3 : s2 = "weeks" === n2 ? $(s2 / h[n2]) : this.$d[n2], s2 || 0;
|
|
82
|
+
}, y2.add = function(t2, s2, n2) {
|
|
83
|
+
var i2;
|
|
84
|
+
return i2 = s2 ? t2 * h[m(s2)] : c(t2) ? t2.$ms : f(t2, this).$ms, f(this.$ms + i2 * (n2 ? -1 : 1), this);
|
|
85
|
+
}, y2.subtract = function(t2, s2) {
|
|
86
|
+
return this.add(t2, s2, true);
|
|
87
|
+
}, y2.locale = function(t2) {
|
|
88
|
+
var s2 = this.clone();
|
|
89
|
+
return s2.$l = t2, s2;
|
|
90
|
+
}, y2.clone = function() {
|
|
91
|
+
return f(this.$ms, this);
|
|
92
|
+
}, y2.humanize = function(s2) {
|
|
93
|
+
return t().add(this.$ms, "ms").locale(this.$l).fromNow(!s2);
|
|
94
|
+
}, y2.valueOf = function() {
|
|
95
|
+
return this.asMilliseconds();
|
|
96
|
+
}, y2.milliseconds = function() {
|
|
97
|
+
return this.get("milliseconds");
|
|
98
|
+
}, y2.asMilliseconds = function() {
|
|
99
|
+
return this.as("milliseconds");
|
|
100
|
+
}, y2.seconds = function() {
|
|
101
|
+
return this.get("seconds");
|
|
102
|
+
}, y2.asSeconds = function() {
|
|
103
|
+
return this.as("seconds");
|
|
104
|
+
}, y2.minutes = function() {
|
|
105
|
+
return this.get("minutes");
|
|
106
|
+
}, y2.asMinutes = function() {
|
|
107
|
+
return this.as("minutes");
|
|
108
|
+
}, y2.hours = function() {
|
|
109
|
+
return this.get("hours");
|
|
110
|
+
}, y2.asHours = function() {
|
|
111
|
+
return this.as("hours");
|
|
112
|
+
}, y2.days = function() {
|
|
113
|
+
return this.get("days");
|
|
114
|
+
}, y2.asDays = function() {
|
|
115
|
+
return this.as("days");
|
|
116
|
+
}, y2.weeks = function() {
|
|
117
|
+
return this.get("weeks");
|
|
118
|
+
}, y2.asWeeks = function() {
|
|
119
|
+
return this.as("weeks");
|
|
120
|
+
}, y2.months = function() {
|
|
121
|
+
return this.get("months");
|
|
122
|
+
}, y2.asMonths = function() {
|
|
123
|
+
return this.as("months");
|
|
124
|
+
}, y2.years = function() {
|
|
125
|
+
return this.get("years");
|
|
126
|
+
}, y2.asYears = function() {
|
|
127
|
+
return this.as("years");
|
|
128
|
+
}, l2;
|
|
129
|
+
}(), p = function(t2, s2, n2) {
|
|
130
|
+
return t2.add(s2.years() * n2, "y").add(s2.months() * n2, "M").add(s2.days() * n2, "d").add(s2.hours() * n2, "h").add(s2.minutes() * n2, "m").add(s2.seconds() * n2, "s").add(s2.milliseconds() * n2, "ms");
|
|
131
|
+
};
|
|
132
|
+
return function(n2, i2, e2) {
|
|
133
|
+
t = e2, s = e2().$utils(), e2.duration = function(t2, s2) {
|
|
134
|
+
var n3 = e2.locale();
|
|
135
|
+
return f(t2, { $l: n3 }, s2);
|
|
136
|
+
}, e2.isDuration = c;
|
|
137
|
+
var r2 = i2.prototype.add, o2 = i2.prototype.subtract;
|
|
138
|
+
i2.prototype.add = function(t2, s2) {
|
|
139
|
+
return c(t2) ? p(this, t2, 1) : r2.bind(this)(t2, s2);
|
|
140
|
+
}, i2.prototype.subtract = function(t2, s2) {
|
|
141
|
+
return c(t2) ? p(this, t2, -1) : o2.bind(this)(t2, s2);
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
})(duration$2);
|
|
146
|
+
return duration$2.exports;
|
|
147
|
+
}
|
|
148
|
+
var durationExports = requireDuration();
|
|
149
|
+
const duration = /* @__PURE__ */ getDefaultExportFromCjs(durationExports);
|
|
150
|
+
var relativeTime$2 = { exports: {} };
|
|
151
|
+
var relativeTime$1 = relativeTime$2.exports;
|
|
152
|
+
var hasRequiredRelativeTime;
|
|
153
|
+
function requireRelativeTime() {
|
|
154
|
+
if (hasRequiredRelativeTime) return relativeTime$2.exports;
|
|
155
|
+
hasRequiredRelativeTime = 1;
|
|
156
|
+
(function(module2, exports2) {
|
|
157
|
+
!function(r, e) {
|
|
158
|
+
module2.exports = e();
|
|
159
|
+
}(relativeTime$1, function() {
|
|
160
|
+
return function(r, e, t) {
|
|
161
|
+
r = r || {};
|
|
162
|
+
var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
163
|
+
function i(r2, e2, t2, o2) {
|
|
164
|
+
return n.fromToBase(r2, e2, t2, o2);
|
|
165
|
+
}
|
|
166
|
+
t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
|
|
167
|
+
for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
|
|
168
|
+
var y = h[c];
|
|
169
|
+
y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
|
|
170
|
+
var p = (r.rounding || Math.round)(Math.abs(f));
|
|
171
|
+
if (s = f > 0, p <= y.r || !y.r) {
|
|
172
|
+
p <= 1 && c > 0 && (y = h[c - 1]);
|
|
173
|
+
var v = l[y.l];
|
|
174
|
+
u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (n2) return a;
|
|
179
|
+
var M = s ? l.future : l.past;
|
|
180
|
+
return "function" == typeof M ? M(a) : M.replace("%s", a);
|
|
181
|
+
}, n.to = function(r2, e2) {
|
|
182
|
+
return i(r2, e2, this, true);
|
|
183
|
+
}, n.from = function(r2, e2) {
|
|
184
|
+
return i(r2, e2, this);
|
|
185
|
+
};
|
|
186
|
+
var d = function(r2) {
|
|
187
|
+
return r2.$u ? t.utc() : t();
|
|
188
|
+
};
|
|
189
|
+
n.toNow = function(r2) {
|
|
190
|
+
return this.to(d(this), r2);
|
|
191
|
+
}, n.fromNow = function(r2) {
|
|
192
|
+
return this.from(d(this), r2);
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
})(relativeTime$2);
|
|
197
|
+
return relativeTime$2.exports;
|
|
198
|
+
}
|
|
199
|
+
var relativeTimeExports = requireRelativeTime();
|
|
200
|
+
const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
|
|
201
|
+
var ru$1 = { exports: {} };
|
|
202
|
+
var ru = ru$1.exports;
|
|
203
|
+
var hasRequiredRu;
|
|
204
|
+
function requireRu() {
|
|
205
|
+
if (hasRequiredRu) return ru$1.exports;
|
|
206
|
+
hasRequiredRu = 1;
|
|
207
|
+
(function(module2, exports2) {
|
|
208
|
+
!function(_, t) {
|
|
209
|
+
module2.exports = t(dayjs);
|
|
210
|
+
}(ru, function(_) {
|
|
211
|
+
function t(_2) {
|
|
212
|
+
return _2 && "object" == typeof _2 && "default" in _2 ? _2 : { default: _2 };
|
|
213
|
+
}
|
|
214
|
+
var e = t(_), n = "января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"), s = "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), r = "янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"), o = "янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"), i = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
|
|
215
|
+
function d(_2, t2, e2) {
|
|
216
|
+
var n2, s2;
|
|
217
|
+
return "m" === e2 ? t2 ? "минута" : "минуту" : _2 + " " + (n2 = +_2, s2 = { mm: t2 ? "минута_минуты_минут" : "минуту_минуты_минут", hh: "час_часа_часов", dd: "день_дня_дней", MM: "месяц_месяца_месяцев", yy: "год_года_лет" }[e2].split("_"), n2 % 10 == 1 && n2 % 100 != 11 ? s2[0] : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? s2[1] : s2[2]);
|
|
218
|
+
}
|
|
219
|
+
var u = function(_2, t2) {
|
|
220
|
+
return i.test(t2) ? n[_2.month()] : s[_2.month()];
|
|
221
|
+
};
|
|
222
|
+
u.s = s, u.f = n;
|
|
223
|
+
var a = function(_2, t2) {
|
|
224
|
+
return i.test(t2) ? r[_2.month()] : o[_2.month()];
|
|
225
|
+
};
|
|
226
|
+
a.s = o, a.f = r;
|
|
227
|
+
var m = { name: "ru", weekdays: "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"), weekdaysShort: "вск_пнд_втр_срд_чтв_птн_сбт".split("_"), weekdaysMin: "вс_пн_вт_ср_чт_пт_сб".split("_"), months: u, monthsShort: a, weekStart: 1, yearStart: 4, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY г.", LLL: "D MMMM YYYY г., H:mm", LLLL: "dddd, D MMMM YYYY г., H:mm" }, relativeTime: { future: "через %s", past: "%s назад", s: "несколько секунд", m: d, mm: d, h: "час", hh: d, d: "день", dd: d, M: "месяц", MM: d, y: "год", yy: d }, ordinal: function(_2) {
|
|
228
|
+
return _2;
|
|
229
|
+
}, meridiem: function(_2) {
|
|
230
|
+
return _2 < 4 ? "ночи" : _2 < 12 ? "утра" : _2 < 17 ? "дня" : "вечера";
|
|
231
|
+
} };
|
|
232
|
+
return e.default.locale(m, null, true), m;
|
|
233
|
+
});
|
|
234
|
+
})(ru$1);
|
|
235
|
+
return ru$1.exports;
|
|
236
|
+
}
|
|
237
|
+
requireRu();
|
|
238
|
+
dayjs.extend(relativeTime);
|
|
239
|
+
dayjs.extend(duration);
|
|
240
|
+
dayjs.locale("ru");
|
|
241
|
+
const toLibFormat = (value, asTime) => {
|
|
242
|
+
if (typeGuard.typeGuard.isNumber(value)) {
|
|
243
|
+
if (asTime) {
|
|
244
|
+
return dayjs.duration(value);
|
|
245
|
+
}
|
|
246
|
+
return dayjs(value);
|
|
247
|
+
} else if (dayjs.isDayjs(value)) {
|
|
248
|
+
return value;
|
|
249
|
+
} else {
|
|
250
|
+
return dayjs(value);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const formatDate = (value, settings) => {
|
|
254
|
+
const dateFormat = settings?.format;
|
|
255
|
+
const datePattern = settings?.pattern;
|
|
256
|
+
const asTime = settings?.asTime;
|
|
257
|
+
value = toLibFormat(value, asTime);
|
|
258
|
+
if (typeGuard.typeGuard.isUndefined(value) || !value.isValid()) {
|
|
259
|
+
return format.format.NO_VALUE;
|
|
260
|
+
}
|
|
261
|
+
if (datePattern) {
|
|
262
|
+
return value.format(datePattern);
|
|
263
|
+
}
|
|
264
|
+
switch (dateFormat) {
|
|
265
|
+
case "human": {
|
|
266
|
+
return value.fromNow();
|
|
267
|
+
}
|
|
268
|
+
case "spent-time": {
|
|
269
|
+
return value.fromNow(true);
|
|
270
|
+
}
|
|
271
|
+
case "full": {
|
|
272
|
+
return value.format("DD MMM YYYY HH:mm:ss");
|
|
273
|
+
}
|
|
274
|
+
case "short": {
|
|
275
|
+
return value.format("DD MMM HH:mm");
|
|
276
|
+
}
|
|
277
|
+
case "time": {
|
|
278
|
+
return value.format("HH:mm:ss");
|
|
279
|
+
}
|
|
280
|
+
case "time-short": {
|
|
281
|
+
return value.format("HH:mm");
|
|
282
|
+
}
|
|
283
|
+
case "day": {
|
|
284
|
+
return value.format("DD MMM YYYY");
|
|
285
|
+
}
|
|
286
|
+
case "month": {
|
|
287
|
+
return value.format("MMMM YYYY");
|
|
288
|
+
}
|
|
289
|
+
default: {
|
|
290
|
+
return value.format("DD.MM.YYYY");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
const dayTimeDuration = (timeInMs) => {
|
|
295
|
+
let left = Math.max(timeInMs, 0);
|
|
296
|
+
const days = Math.floor(left / ms.unitsToMs.day);
|
|
297
|
+
left = left % ms.unitsToMs.day;
|
|
298
|
+
const hours = Math.floor(left / ms.unitsToMs.hour);
|
|
299
|
+
left = left % ms.unitsToMs.hour;
|
|
300
|
+
const minutes = Math.floor(left / ms.unitsToMs.min);
|
|
301
|
+
left = left % ms.unitsToMs.min;
|
|
302
|
+
const seconds = Math.floor(left / ms.unitsToMs.sec);
|
|
303
|
+
left = left % ms.unitsToMs.sec;
|
|
304
|
+
const milliseconds = Math.floor(left);
|
|
305
|
+
return {
|
|
306
|
+
days,
|
|
307
|
+
hours,
|
|
308
|
+
minutes,
|
|
309
|
+
seconds,
|
|
310
|
+
milliseconds
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
const changeDate = (date, ...args) => {
|
|
314
|
+
let wrappedDate = toLibFormat(date);
|
|
315
|
+
for (let i = 0; i < args.length; i += 2) {
|
|
316
|
+
const amount = args[i];
|
|
317
|
+
const unit = args[i + 1];
|
|
318
|
+
if (unit != null) {
|
|
319
|
+
wrappedDate = wrappedDate.add(amount, unit);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return wrappedDate.toDate();
|
|
323
|
+
};
|
|
324
|
+
const timeDuration = (timeInMs) => {
|
|
325
|
+
const { days, hours, milliseconds, minutes, seconds } = dayTimeDuration(timeInMs);
|
|
326
|
+
return {
|
|
327
|
+
hours: hours + ms.unitsToMs.day * days,
|
|
328
|
+
milliseconds,
|
|
329
|
+
minutes,
|
|
330
|
+
seconds
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
const durationFormatLabels = {
|
|
334
|
+
days: { compact: "д", full: ["день", "дня", "дней"] },
|
|
335
|
+
hours: { compact: "ч", full: ["час", "часа", "часов"] },
|
|
336
|
+
minutes: { compact: "мин", full: ["минута", "минуты", "минут"] },
|
|
337
|
+
seconds: { compact: "сек", full: ["секунда", "секунды", "секунд"] }
|
|
338
|
+
};
|
|
339
|
+
function getFormatDuration(...args) {
|
|
340
|
+
let compact = false;
|
|
341
|
+
let diff = 0;
|
|
342
|
+
if (args[0] instanceof Date) {
|
|
343
|
+
const startedDate = dayjs(args[0]);
|
|
344
|
+
const endedDate = dayjs(args[1]);
|
|
345
|
+
diff = endedDate.diff(startedDate, "ms");
|
|
346
|
+
compact = args[2] === true;
|
|
347
|
+
} else {
|
|
348
|
+
diff = args[0];
|
|
349
|
+
compact = args[1] === true;
|
|
350
|
+
}
|
|
351
|
+
const { days, hours, minutes, seconds } = dayTimeDuration(diff);
|
|
352
|
+
const formattedParts = [];
|
|
353
|
+
if (days) {
|
|
354
|
+
if (compact) {
|
|
355
|
+
formattedParts.push(`${days} ${durationFormatLabels.days.compact}`);
|
|
356
|
+
} else {
|
|
357
|
+
formattedParts.push(
|
|
358
|
+
`${days} ${text.declension(days, durationFormatLabels.days.full)}`
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (hours) {
|
|
363
|
+
if (compact) {
|
|
364
|
+
formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);
|
|
365
|
+
} else {
|
|
366
|
+
formattedParts.push(
|
|
367
|
+
`${hours} ${text.declension(hours, durationFormatLabels.hours.full)}`
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (minutes) {
|
|
372
|
+
if (compact) {
|
|
373
|
+
formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);
|
|
374
|
+
} else {
|
|
375
|
+
formattedParts.push(
|
|
376
|
+
`${minutes} ${text.declension(minutes, durationFormatLabels.minutes.full)}`
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (seconds) {
|
|
381
|
+
if (compact) {
|
|
382
|
+
formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);
|
|
383
|
+
} else {
|
|
384
|
+
formattedParts.push(
|
|
385
|
+
`${seconds} ${text.declension(seconds, durationFormatLabels.seconds.full)}`
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return formattedParts.join(" ");
|
|
390
|
+
}
|
|
391
|
+
exports.changeDate = changeDate;
|
|
392
|
+
exports.dayTimeDuration = dayTimeDuration;
|
|
393
|
+
exports.formatDate = formatDate;
|
|
394
|
+
exports.getFormatDuration = getFormatDuration;
|
|
395
|
+
exports.timeDuration = timeDuration;
|
|
2
396
|
//# sourceMappingURL=date-time.cjs.map
|