prlg-ui 1.8.302 → 1.8.304
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/blocks/index.cjs.js +1 -1
- package/dist/blocks/index.es.js +1 -1
- package/dist/prlg-ui.css +1 -1
- package/dist/reka-ui/index.cjs.js +7 -4
- package/dist/reka-ui/index.es.js +7981 -6672
- package/dist/rekaUI.d.ts +74 -2
- package/dist/uploadFile.util-C-KPiLD9.cjs +1 -0
- package/dist/uploadFile.util-CaG3C2Ri.js +70 -0
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.es.js +1 -1
- package/dist/utils/uploadFile.util.ts +70 -23
- package/dist/utils.d.ts +17 -14
- package/package.json +1 -1
- package/dist/uploadFile.util-CVNZsSl4.js +0 -46
- package/dist/uploadFile.util-DRxx7S8i.cjs +0 -1
package/dist/rekaUI.d.ts
CHANGED
|
@@ -117,6 +117,14 @@ import { FunctionalComponent } from 'vue';
|
|
|
117
117
|
import { GlobalComponents } from 'vue';
|
|
118
118
|
import { GlobalDirectives } from 'vue';
|
|
119
119
|
import { LabelProps } from 'reka-ui';
|
|
120
|
+
import { ListboxContent } from 'reka-ui';
|
|
121
|
+
import { ListboxFilter } from 'reka-ui';
|
|
122
|
+
import { ListboxGroup } from 'reka-ui';
|
|
123
|
+
import { ListboxGroupLabel } from 'reka-ui';
|
|
124
|
+
import { ListboxItem } from 'reka-ui';
|
|
125
|
+
import { ListboxItemIndicator } from 'reka-ui';
|
|
126
|
+
import { ListboxRoot } from 'reka-ui';
|
|
127
|
+
import { ListboxVirtualizer } from 'reka-ui';
|
|
120
128
|
import { LooseRequired } from '@vue/shared';
|
|
121
129
|
import { MaybeRefOrGetter } from 'vue';
|
|
122
130
|
import { MethodOptions } from 'vue';
|
|
@@ -172,6 +180,8 @@ import { SelectViewportProps } from 'reka-ui';
|
|
|
172
180
|
import { ShallowUnwrapRef } from 'vue';
|
|
173
181
|
import { Slot } from 'vue';
|
|
174
182
|
import { SortingState } from '@tanstack/vue-table';
|
|
183
|
+
import { StepperItemProps } from 'reka-ui';
|
|
184
|
+
import { StepperRootProps } from 'reka-ui';
|
|
175
185
|
import { SwitchRootProps } from 'reka-ui';
|
|
176
186
|
import { SwitchThumbProps } from 'reka-ui';
|
|
177
187
|
import { TabsContent } from 'reka-ui';
|
|
@@ -721,7 +731,15 @@ maxSelectedLabels: number;
|
|
|
721
731
|
|
|
722
732
|
declare const __VLS_component_72: DefineComponent<SelectViewportProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SelectViewportProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
723
733
|
|
|
724
|
-
declare const __VLS_component_73: DefineComponent<
|
|
734
|
+
declare const __VLS_component_73: DefineComponent<StepperItemProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<StepperItemProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
735
|
+
|
|
736
|
+
declare const __VLS_component_74: DefineComponent<StepperRootProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
737
|
+
"update:modelValue": (payload: number | undefined) => any;
|
|
738
|
+
}, string, PublicProps, Readonly<StepperRootProps> & Readonly<{
|
|
739
|
+
"onUpdate:modelValue"?: ((payload: number | undefined) => any) | undefined;
|
|
740
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
741
|
+
|
|
742
|
+
declare const __VLS_component_75: DefineComponent<SwitchRootProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
725
743
|
"update:modelValue": (payload: boolean) => any;
|
|
726
744
|
}, string, PublicProps, Readonly<SwitchRootProps> & Readonly<{
|
|
727
745
|
"onUpdate:modelValue"?: ((payload: boolean) => any) | undefined;
|
|
@@ -1605,6 +1623,24 @@ declare function __VLS_template_73(): {
|
|
|
1605
1623
|
rootEl: any;
|
|
1606
1624
|
};
|
|
1607
1625
|
|
|
1626
|
+
declare function __VLS_template_74(): {
|
|
1627
|
+
attrs: Partial<{}>;
|
|
1628
|
+
slots: {
|
|
1629
|
+
default?(_: {}): any;
|
|
1630
|
+
};
|
|
1631
|
+
refs: {};
|
|
1632
|
+
rootEl: any;
|
|
1633
|
+
};
|
|
1634
|
+
|
|
1635
|
+
declare function __VLS_template_75(): {
|
|
1636
|
+
attrs: Partial<{}>;
|
|
1637
|
+
slots: {
|
|
1638
|
+
default?(_: {}): any;
|
|
1639
|
+
};
|
|
1640
|
+
refs: {};
|
|
1641
|
+
rootEl: any;
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1608
1644
|
declare function __VLS_template_8(): {
|
|
1609
1645
|
attrs: Partial<{}>;
|
|
1610
1646
|
slots: {
|
|
@@ -1765,6 +1801,10 @@ declare type __VLS_TemplateResult_72 = ReturnType<typeof __VLS_template_72>;
|
|
|
1765
1801
|
|
|
1766
1802
|
declare type __VLS_TemplateResult_73 = ReturnType<typeof __VLS_template_73>;
|
|
1767
1803
|
|
|
1804
|
+
declare type __VLS_TemplateResult_74 = ReturnType<typeof __VLS_template_74>;
|
|
1805
|
+
|
|
1806
|
+
declare type __VLS_TemplateResult_75 = ReturnType<typeof __VLS_template_75>;
|
|
1807
|
+
|
|
1768
1808
|
declare type __VLS_TemplateResult_8 = ReturnType<typeof __VLS_template_8>;
|
|
1769
1809
|
|
|
1770
1810
|
declare type __VLS_TemplateResult_9 = ReturnType<typeof __VLS_template_9>;
|
|
@@ -2195,6 +2235,18 @@ declare type __VLS_WithTemplateSlots_73<T, S> = T & {
|
|
|
2195
2235
|
};
|
|
2196
2236
|
};
|
|
2197
2237
|
|
|
2238
|
+
declare type __VLS_WithTemplateSlots_74<T, S> = T & {
|
|
2239
|
+
new (): {
|
|
2240
|
+
$slots: S;
|
|
2241
|
+
};
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
declare type __VLS_WithTemplateSlots_75<T, S> = T & {
|
|
2245
|
+
new (): {
|
|
2246
|
+
$slots: S;
|
|
2247
|
+
};
|
|
2248
|
+
};
|
|
2249
|
+
|
|
2198
2250
|
declare type __VLS_WithTemplateSlots_8<T, S> = T & {
|
|
2199
2251
|
new (): {
|
|
2200
2252
|
$slots: S;
|
|
@@ -2912,6 +2964,22 @@ declare interface ITooltipContentProps extends TooltipContentProps {
|
|
|
2912
2964
|
|
|
2913
2965
|
export declare const Label: __VLS_WithTemplateSlots_52<typeof __VLS_component_52, __VLS_TemplateResult_52["slots"]>;
|
|
2914
2966
|
|
|
2967
|
+
export { ListboxContent }
|
|
2968
|
+
|
|
2969
|
+
export { ListboxFilter }
|
|
2970
|
+
|
|
2971
|
+
export { ListboxGroup }
|
|
2972
|
+
|
|
2973
|
+
export { ListboxGroupLabel }
|
|
2974
|
+
|
|
2975
|
+
export { ListboxItem }
|
|
2976
|
+
|
|
2977
|
+
export { ListboxItemIndicator }
|
|
2978
|
+
|
|
2979
|
+
export { ListboxRoot }
|
|
2980
|
+
|
|
2981
|
+
export { ListboxVirtualizer }
|
|
2982
|
+
|
|
2915
2983
|
declare interface LoadingElement extends HTMLElement {
|
|
2916
2984
|
dataset: DOMStringMap & {
|
|
2917
2985
|
loading?: string;
|
|
@@ -3030,9 +3098,13 @@ export declare const SelectViewport: __VLS_WithTemplateSlots_72<typeof __VLS_com
|
|
|
3030
3098
|
|
|
3031
3099
|
export declare const Spinner: DefineComponent<ISpinnerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ISpinnerProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
3032
3100
|
|
|
3101
|
+
export declare const StepperItem: __VLS_WithTemplateSlots_73<typeof __VLS_component_73, __VLS_TemplateResult_73["slots"]>;
|
|
3102
|
+
|
|
3103
|
+
export declare const StepperRoot: __VLS_WithTemplateSlots_74<typeof __VLS_component_74, __VLS_TemplateResult_74["slots"]>;
|
|
3104
|
+
|
|
3033
3105
|
declare type StringOrVNode = string | VNode | (() => VNode);
|
|
3034
3106
|
|
|
3035
|
-
export declare const SwitchRoot:
|
|
3107
|
+
export declare const SwitchRoot: __VLS_WithTemplateSlots_75<typeof __VLS_component_75, __VLS_TemplateResult_75["slots"]>;
|
|
3036
3108
|
|
|
3037
3109
|
export declare const SwitchThumb: DefineComponent<SwitchThumbProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SwitchThumbProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3038
3110
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=require("./parseFileSize.util-zKz6zjwq.cjs");function g(e){if(!e)return;const r=Array.isArray(e)?e:[e],n={image:["image/*"],pdf:["application/pdf"],excel:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],word:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],all:["*/*"]};return r.flatMap(t=>n[t]||[]).join(",")}function h(e={}){return new Promise((r,n)=>{const t=document.createElement("input");t.type="file",t.style.display="none",e.multiple&&e.maxFiles&&e.maxFiles>1&&(t.multiple=!0);const m=g(e.accept);m&&(t.accept=m),t.addEventListener("change",async d=>{const c=d.target;let a=[];if(c.files&&c.files.length>0&&(a=Array.from(c.files),e.maxFiles&&a.length>e.maxFiles&&(a=a.slice(0,e.maxFiles)),e.maxFileSize)){const i=p.parseFileSize(e.maxFileSize);a=a.filter(s=>s.size<=i)}if(document.body.removeChild(t),"url"in e&&e.url){if(a.length===0){r([]);return}try{const i=new FormData,s=e.fieldName??(a.length>1?"files":"file");for(const u of a)i.append(s,u);const l=await fetch(e.url,{method:"POST",body:i,headers:e.headers,credentials:e.withCredentials?"include":"same-origin"});if(!l.ok)throw new Error(`Upload failed: ${l.status} ${l.statusText}`);const o=await l.json();r(o)}catch(i){n(i)}return}const f=a.map(i=>({id:crypto.randomUUID(),url:URL.createObjectURL(i),name:i.name,mime:i.type,size:i.size}));r(f)}),document.body.appendChild(t),t.click()})}exports.openFileDialog=h;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { p as u } from "./parseFileSize.util-BAG-MLFl.js";
|
|
2
|
+
function h(e) {
|
|
3
|
+
if (!e) return;
|
|
4
|
+
const r = Array.isArray(e) ? e : [e], n = {
|
|
5
|
+
image: ["image/*"],
|
|
6
|
+
pdf: ["application/pdf"],
|
|
7
|
+
excel: [
|
|
8
|
+
"application/vnd.ms-excel",
|
|
9
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
10
|
+
],
|
|
11
|
+
word: [
|
|
12
|
+
"application/msword",
|
|
13
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
14
|
+
],
|
|
15
|
+
all: ["*/*"]
|
|
16
|
+
};
|
|
17
|
+
return r.flatMap((a) => n[a] || []).join(",");
|
|
18
|
+
}
|
|
19
|
+
function x(e = {}) {
|
|
20
|
+
return new Promise((r, n) => {
|
|
21
|
+
const a = document.createElement("input");
|
|
22
|
+
a.type = "file", a.style.display = "none", e.multiple && e.maxFiles && e.maxFiles > 1 && (a.multiple = !0);
|
|
23
|
+
const s = h(e.accept);
|
|
24
|
+
s && (a.accept = s), a.addEventListener("change", async (d) => {
|
|
25
|
+
const c = d.target;
|
|
26
|
+
let i = [];
|
|
27
|
+
if (c.files && c.files.length > 0 && (i = Array.from(c.files), e.maxFiles && i.length > e.maxFiles && (i = i.slice(0, e.maxFiles)), e.maxFileSize)) {
|
|
28
|
+
const t = u(e.maxFileSize);
|
|
29
|
+
i = i.filter((m) => m.size <= t);
|
|
30
|
+
}
|
|
31
|
+
if (document.body.removeChild(a), "url" in e && e.url) {
|
|
32
|
+
if (i.length === 0) {
|
|
33
|
+
r([]);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const t = new FormData(), m = e.fieldName ?? (i.length > 1 ? "files" : "file");
|
|
38
|
+
for (const p of i)
|
|
39
|
+
t.append(m, p);
|
|
40
|
+
const l = await fetch(e.url, {
|
|
41
|
+
method: "POST",
|
|
42
|
+
body: t,
|
|
43
|
+
headers: e.headers,
|
|
44
|
+
credentials: e.withCredentials ? "include" : "same-origin"
|
|
45
|
+
});
|
|
46
|
+
if (!l.ok)
|
|
47
|
+
throw new Error(
|
|
48
|
+
`Upload failed: ${l.status} ${l.statusText}`
|
|
49
|
+
);
|
|
50
|
+
const o = await l.json();
|
|
51
|
+
r(o);
|
|
52
|
+
} catch (t) {
|
|
53
|
+
n(t);
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const f = i.map((t) => ({
|
|
58
|
+
id: crypto.randomUUID(),
|
|
59
|
+
url: URL.createObjectURL(t),
|
|
60
|
+
name: t.name,
|
|
61
|
+
mime: t.type,
|
|
62
|
+
size: t.size
|
|
63
|
+
}));
|
|
64
|
+
r(f);
|
|
65
|
+
}), document.body.appendChild(a), a.click();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
x as o
|
|
70
|
+
};
|
package/dist/utils/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../eventBus.util-K9Yq6hZm.cjs"),z=require("../dayjs.util-DVNMZ0pw.cjs"),I=require("../uploadFile.util-DRxx7S8i.cjs"),J=require("../parseFileSize.util-zKz6zjwq.cjs"),X=6048e5,U=864e5,Y=Symbol.for("constructDateFrom");function b(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Y in t?t[Y](e):t instanceof Date?new t.constructor(e):new Date(e)}function m(t,e){return b(e||t,t)}let K={};function D(){return K}function p(t,e){const n=D(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=m(t,e?.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function k(t,e){return p(t,{...e,weekStartsOn:1})}function L(t,e){const n=m(t,e?.in),r=n.getFullYear(),a=b(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=k(a),o=b(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const u=k(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function N(t){const e=m(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function S(t,...e){const n=b.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function T(t,e){const n=m(t,e?.in);return n.setHours(0,0,0,0),n}function Q(t,e,n){const[r,a]=S(n?.in,t,e),i=T(r),o=T(a),u=+i-N(i),d=+o-N(o);return Math.round((u-d)/U)}function Z(t,e){const n=L(t,e),r=b(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),k(r)}function tt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function et(t){return!(!tt(t)&&typeof t!="number"||isNaN(+m(t)))}function nt(t,e,n){const[r,a]=S(n?.in,t,e),i=F(r,a),o=Math.abs(Q(r,a));r.setDate(r.getDate()-i*o);const u=+(F(r,a)===-i),d=i*(o-u);return d===0?0:d}function F(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function rt(t,e){const n=m(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function M(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:M({formats:ot,defaultWidth:"full"}),time:M({formats:st,defaultWidth:"full"}),dateTime:M({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function h(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):o;a=t.formattingValues[u]||t.formattingValues[o]}else{const o=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;a=t.values[u]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},vt={ordinalNumber:bt,era:h({values:ft,defaultWidth:"wide"}),quarter:h({values:mt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:h({values:ht,defaultWidth:"wide"}),day:h({values:gt,defaultWidth:"wide"}),dayPeriod:h({values:wt,defaultWidth:"wide",formattingValues:yt,defaultFormattingWidth:"wide"})};function g(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?Pt(u,c=>c.test(o)):pt(u,c=>c.test(o));let w;w=t.valueCallback?t.valueCallback(d):d,w=n.valueCallback?n.valueCallback(w):w;const l=e.slice(o.length);return{value:w,rest:l}}}function pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Pt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function B(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const u=e.slice(a.length);return{value:o,rest:u}}}const Mt=/^(\d+)(th|st|nd|rd)?/i,Wt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dt={any:[/^b/i,/^(a|c)/i]},Ot={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Nt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Tt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ft={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Et={ordinalNumber:B({matchPattern:Mt,parsePattern:Wt,valueCallback:t=>parseInt(t,10)}),era:g({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Dt,defaultParseWidth:"any"}),quarter:g({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:g({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),day:g({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Nt,defaultParseWidth:"any"}),dayPeriod:g({matchPatterns:Tt,defaultMatchWidth:"any",parsePatterns:Ft,defaultParseWidth:"any"})},Ct={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:vt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qt(t,e){const n=m(t,e?.in);return Q(n,rt(n))+1}function $t(t,e){const n=m(t,e?.in),r=+k(n)-+Z(n);return Math.round(r/X)+1}function V(t,e){const n=m(t,e?.in),r=n.getFullYear(),a=D(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=b(e?.in||t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const u=p(o,e),d=b(e?.in||t,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const w=p(d,e);return+n>=+u?r+1:+n>=+w?r:r-1}function Ht(t,e){const n=D(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=V(t,e),i=b(e?.in||t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),p(i,e)}function _t(t,e){const n=m(t,e?.in),r=+p(n,e)-+Ht(n,e);return Math.round(r/X)+1}function s(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return s(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):s(n+1,2)},d(t,e){return s(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return s(t.getHours()%12||12,e.length)},H(t,e){return s(t.getHours(),e.length)},m(t,e){return s(t.getMinutes(),e.length)},s(t,e){return s(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return s(a,e.length)}},P={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=V(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return s(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):s(i,e.length)},R:function(t,e){const n=L(t);return s(n,e.length)},u:function(t,e){const n=t.getFullYear();return s(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return s(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return s(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return s(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=_t(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):s(a,e.length)},I:function(t,e,n){const r=$t(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):s(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=qt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):s(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return s(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return s(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return s(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=P.noon:r===0?a=P.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=P.evening:r>=12?a=P.afternoon:r>=4?a=P.morning:a=P.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return q(r);case"XXXX":case"XX":return v(r);case"XXXXX":case"XXX":default:return v(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return q(r);case"xxxx":case"xx":return v(r);case"xxxxx":case"xxx":default:return v(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+C(r,":");case"OOOO":default:return"GMT"+v(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+C(r,":");case"zzzz":default:return"GMT"+v(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return s(r,e.length)},T:function(t,e,n){return s(+t,e.length)}};function C(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+s(i,2)}function q(t,e){return t%60===0?(t>0?"-":"+")+s(Math.abs(t)/60,2):v(t,e)}function v(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=s(Math.trunc(r/60),2),i=s(r%60,2);return n+a+e+i}const $=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},j=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Xt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return $(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",$(r,e)).replace("{{time}}",j(a,e))},Lt={p:j,P:Xt},Qt=/^D+$/,Bt=/^Y+$/,Vt=["D","DD","YY","YYYY"];function jt(t){return Qt.test(t)}function Rt(t){return Bt.test(t)}function At(t,e,n){const r=zt(t,e,n);if(console.warn(r),Vt.includes(t))throw new RangeError(r)}function zt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const It=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ut=/^'([^]*?)'?$/,Kt=/''/g,Zt=/[a-zA-Z]/;function R(t,e,n){const r=D(),a=n?.locale??r.locale??Ct,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=m(t,n?.in);if(!et(u))throw new RangeError("Invalid time value");let d=e.match(Jt).map(l=>{const c=l[0];if(c==="p"||c==="P"){const O=Lt[c];return O(l,a.formatLong)}return l}).join("").match(It).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const c=l[0];if(c==="'")return{isToken:!1,value:te(l)};if(E[c])return{isToken:!0,value:l};if(c.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+c+"`");return{isToken:!1,value:l}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const w={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return d.map(l=>{if(!l.isToken)return l.value;const c=l.value;(!n?.useAdditionalWeekYearTokens&&Rt(c)||!n?.useAdditionalDayOfYearTokens&&jt(c))&&At(c,e,String(t));const O=E[c[0]];return O(u,c,a.localize,w)}).join("")}function te(t){const e=t.match(Ut);return e?e[1].replace(Kt,"'"):t}function ee(t,e){return+m(t)>+m(e)}function H(t,e,n){const[r,a]=S(n?.in,t,e);return+p(r,n)==+p(a,n)}function W(t,e){if(t.one!==void 0&&e===1)return t.one;const n=e%10,r=e%100;return n===1&&r!==11?t.singularNominative.replace("{{count}}",String(e)):n>=2&&n<=4&&(r<10||r>20)?t.singularGenitive.replace("{{count}}",String(e)):t.pluralGenitive.replace("{{count}}",String(e))}function f(t){return(e,n)=>n?.addSuffix?n.comparison&&n.comparison>0?t.future?W(t.future,e):"через "+W(t.regular,e):t.past?W(t.past,e):W(t.regular,e)+" назад":W(t.regular,e)}const ne={lessThanXSeconds:f({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:f({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(t,e)=>e?.addSuffix?e.comparison&&e.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:f({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:f({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:f({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:f({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:f({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:f({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:f({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:f({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:f({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:f({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:f({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:f({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:f({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},re=(t,e,n)=>ne[t](e,n),ae={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},ie={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},oe={any:"{{date}}, {{time}}"},se={date:M({formats:ae,defaultWidth:"full"}),time:M({formats:ie,defaultWidth:"full"}),dateTime:M({formats:oe,defaultWidth:"any"})},G=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function ue(t){const e=G[t];switch(t){case 0:return"'в прошлое "+e+" в' p";case 1:case 2:case 4:return"'в прошлый "+e+" в' p";case 3:case 5:case 6:return"'в прошлую "+e+" в' p"}}function _(t){const e=G[t];return t===2?"'во "+e+" в' p":"'в "+e+" в' p"}function ce(t){const e=G[t];switch(t){case 0:return"'в следующее "+e+" в' p";case 1:case 2:case 4:return"'в следующий "+e+" в' p";case 3:case 5:case 6:return"'в следующую "+e+" в' p"}}const de={lastWeek:(t,e,n)=>{const r=t.getDay();return H(t,e,n)?_(r):ue(r)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(t,e,n)=>{const r=t.getDay();return H(t,e,n)?_(r):ce(r)},other:"P"},le=(t,e,n,r)=>{const a=de[t];return typeof a=="function"?a(e,n,r):a},fe={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},me={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},he={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},ge={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},we={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},ye={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},be={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},ve=(t,e)=>{const n=Number(t),r=e?.unit;let a;return r==="date"?a="-е":r==="week"||r==="minute"||r==="second"?a="-я":a="-й",n+a},pe={ordinalNumber:ve,era:h({values:fe,defaultWidth:"wide"}),quarter:h({values:me,defaultWidth:"wide",argumentCallback:t=>t-1}),month:h({values:he,defaultWidth:"wide",formattingValues:ge,defaultFormattingWidth:"wide"}),day:h({values:we,defaultWidth:"wide"}),dayPeriod:h({values:ye,defaultWidth:"any",formattingValues:be,defaultFormattingWidth:"wide"})},Pe=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,Me=/\d+/i,We={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},ke={any:[/^д/i,/^н/i]},De={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},xe={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},Se={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},Ge={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},Ye={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},Ne={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},Te={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},Fe={ordinalNumber:B({matchPattern:Pe,parsePattern:Me,valueCallback:t=>parseInt(t,10)}),era:g({matchPatterns:We,defaultMatchWidth:"wide",parsePatterns:ke,defaultParseWidth:"any"}),quarter:g({matchPatterns:De,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:g({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),day:g({matchPatterns:Ge,defaultMatchWidth:"wide",parsePatterns:Ye,defaultParseWidth:"any"}),dayPeriod:g({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Te,defaultParseWidth:"any"})},A={code:"ru",formatDistance:re,formatLong:se,formatRelative:le,localize:pe,match:Fe,options:{weekStartsOn:1,firstWeekContainsDate:1}};function Ee(t){return R(new Date(t),"d MMMM yyyy",{locale:A})}function Ce(t){return R(new Date(t),"d MMMM, HH:mm",{locale:A})}function qe(t,e){return nt(new Date(e),new Date(t))}function $e(t){return ee(new Date,new Date(t))}function He(t,e="₽",n=2){return`${t.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).replace(/,/g," ")} ${e}`}function _e(t){return t.reduce((e,n)=>e+n,0)}function Xe(t){const e=t.replace(/[^\d.,]/g,"").replace(",",".");return parseFloat(e)||0}exports.EventBus=x.EventBus;exports.Portal=x._sfc_main;exports.useBodyScroll=x.useBodyScroll;exports.onClickOutside=z.onClickOutside;exports.openFileDialog=I.openFileDialog;exports.dayjs=J.dayjs;exports.formatDateReadable=Ee;exports.formatDateWithTime=Ce;exports.formatPrice=He;exports.getDaysBetween=qe;exports.isExpired=$e;exports.parsePrice=Xe;exports.sumPrices=_e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../eventBus.util-K9Yq6hZm.cjs"),z=require("../dayjs.util-DVNMZ0pw.cjs"),I=require("../uploadFile.util-C-KPiLD9.cjs"),J=require("../parseFileSize.util-zKz6zjwq.cjs"),X=6048e5,U=864e5,Y=Symbol.for("constructDateFrom");function b(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Y in t?t[Y](e):t instanceof Date?new t.constructor(e):new Date(e)}function m(t,e){return b(e||t,t)}let K={};function D(){return K}function p(t,e){const n=D(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=m(t,e?.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function k(t,e){return p(t,{...e,weekStartsOn:1})}function L(t,e){const n=m(t,e?.in),r=n.getFullYear(),a=b(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=k(a),o=b(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const u=k(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function N(t){const e=m(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function S(t,...e){const n=b.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function T(t,e){const n=m(t,e?.in);return n.setHours(0,0,0,0),n}function Q(t,e,n){const[r,a]=S(n?.in,t,e),i=T(r),o=T(a),u=+i-N(i),d=+o-N(o);return Math.round((u-d)/U)}function Z(t,e){const n=L(t,e),r=b(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),k(r)}function tt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function et(t){return!(!tt(t)&&typeof t!="number"||isNaN(+m(t)))}function nt(t,e,n){const[r,a]=S(n?.in,t,e),i=F(r,a),o=Math.abs(Q(r,a));r.setDate(r.getDate()-i*o);const u=+(F(r,a)===-i),d=i*(o-u);return d===0?0:d}function F(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function rt(t,e){const n=m(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},it=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function M(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:M({formats:ot,defaultWidth:"full"}),time:M({formats:st,defaultWidth:"full"}),dateTime:M({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function h(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):o;a=t.formattingValues[u]||t.formattingValues[o]}else{const o=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;a=t.values[u]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},vt={ordinalNumber:bt,era:h({values:ft,defaultWidth:"wide"}),quarter:h({values:mt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:h({values:ht,defaultWidth:"wide"}),day:h({values:gt,defaultWidth:"wide"}),dayPeriod:h({values:wt,defaultWidth:"wide",formattingValues:yt,defaultFormattingWidth:"wide"})};function g(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?Pt(u,c=>c.test(o)):pt(u,c=>c.test(o));let w;w=t.valueCallback?t.valueCallback(d):d,w=n.valueCallback?n.valueCallback(w):w;const l=e.slice(o.length);return{value:w,rest:l}}}function pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Pt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function B(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const u=e.slice(a.length);return{value:o,rest:u}}}const Mt=/^(\d+)(th|st|nd|rd)?/i,Wt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dt={any:[/^b/i,/^(a|c)/i]},Ot={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},St={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Nt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Tt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ft={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Et={ordinalNumber:B({matchPattern:Mt,parsePattern:Wt,valueCallback:t=>parseInt(t,10)}),era:g({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Dt,defaultParseWidth:"any"}),quarter:g({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:g({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),day:g({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Nt,defaultParseWidth:"any"}),dayPeriod:g({matchPatterns:Tt,defaultMatchWidth:"any",parsePatterns:Ft,defaultParseWidth:"any"})},Ct={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:vt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qt(t,e){const n=m(t,e?.in);return Q(n,rt(n))+1}function $t(t,e){const n=m(t,e?.in),r=+k(n)-+Z(n);return Math.round(r/X)+1}function V(t,e){const n=m(t,e?.in),r=n.getFullYear(),a=D(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=b(e?.in||t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const u=p(o,e),d=b(e?.in||t,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const w=p(d,e);return+n>=+u?r+1:+n>=+w?r:r-1}function Ht(t,e){const n=D(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=V(t,e),i=b(e?.in||t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),p(i,e)}function _t(t,e){const n=m(t,e?.in),r=+p(n,e)-+Ht(n,e);return Math.round(r/X)+1}function s(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return s(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):s(n+1,2)},d(t,e){return s(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return s(t.getHours()%12||12,e.length)},H(t,e){return s(t.getHours(),e.length)},m(t,e){return s(t.getMinutes(),e.length)},s(t,e){return s(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return s(a,e.length)}},P={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=V(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return s(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):s(i,e.length)},R:function(t,e){const n=L(t);return s(n,e.length)},u:function(t,e){const n=t.getFullYear();return s(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return s(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return s(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return s(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=_t(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):s(a,e.length)},I:function(t,e,n){const r=$t(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):s(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=qt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):s(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return s(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return s(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return s(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=P.noon:r===0?a=P.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=P.evening:r>=12?a=P.afternoon:r>=4?a=P.morning:a=P.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return q(r);case"XXXX":case"XX":return v(r);case"XXXXX":case"XXX":default:return v(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return q(r);case"xxxx":case"xx":return v(r);case"xxxxx":case"xxx":default:return v(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+C(r,":");case"OOOO":default:return"GMT"+v(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+C(r,":");case"zzzz":default:return"GMT"+v(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return s(r,e.length)},T:function(t,e,n){return s(+t,e.length)}};function C(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+s(i,2)}function q(t,e){return t%60===0?(t>0?"-":"+")+s(Math.abs(t)/60,2):v(t,e)}function v(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=s(Math.trunc(r/60),2),i=s(r%60,2);return n+a+e+i}const $=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},j=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Xt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return $(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",$(r,e)).replace("{{time}}",j(a,e))},Lt={p:j,P:Xt},Qt=/^D+$/,Bt=/^Y+$/,Vt=["D","DD","YY","YYYY"];function jt(t){return Qt.test(t)}function Rt(t){return Bt.test(t)}function At(t,e,n){const r=zt(t,e,n);if(console.warn(r),Vt.includes(t))throw new RangeError(r)}function zt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const It=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ut=/^'([^]*?)'?$/,Kt=/''/g,Zt=/[a-zA-Z]/;function R(t,e,n){const r=D(),a=n?.locale??r.locale??Ct,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=m(t,n?.in);if(!et(u))throw new RangeError("Invalid time value");let d=e.match(Jt).map(l=>{const c=l[0];if(c==="p"||c==="P"){const O=Lt[c];return O(l,a.formatLong)}return l}).join("").match(It).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const c=l[0];if(c==="'")return{isToken:!1,value:te(l)};if(E[c])return{isToken:!0,value:l};if(c.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+c+"`");return{isToken:!1,value:l}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const w={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return d.map(l=>{if(!l.isToken)return l.value;const c=l.value;(!n?.useAdditionalWeekYearTokens&&Rt(c)||!n?.useAdditionalDayOfYearTokens&&jt(c))&&At(c,e,String(t));const O=E[c[0]];return O(u,c,a.localize,w)}).join("")}function te(t){const e=t.match(Ut);return e?e[1].replace(Kt,"'"):t}function ee(t,e){return+m(t)>+m(e)}function H(t,e,n){const[r,a]=S(n?.in,t,e);return+p(r,n)==+p(a,n)}function W(t,e){if(t.one!==void 0&&e===1)return t.one;const n=e%10,r=e%100;return n===1&&r!==11?t.singularNominative.replace("{{count}}",String(e)):n>=2&&n<=4&&(r<10||r>20)?t.singularGenitive.replace("{{count}}",String(e)):t.pluralGenitive.replace("{{count}}",String(e))}function f(t){return(e,n)=>n?.addSuffix?n.comparison&&n.comparison>0?t.future?W(t.future,e):"через "+W(t.regular,e):t.past?W(t.past,e):W(t.regular,e)+" назад":W(t.regular,e)}const ne={lessThanXSeconds:f({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:f({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(t,e)=>e?.addSuffix?e.comparison&&e.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:f({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:f({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:f({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:f({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:f({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:f({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:f({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:f({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:f({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:f({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:f({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:f({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:f({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},re=(t,e,n)=>ne[t](e,n),ae={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},ie={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},oe={any:"{{date}}, {{time}}"},se={date:M({formats:ae,defaultWidth:"full"}),time:M({formats:ie,defaultWidth:"full"}),dateTime:M({formats:oe,defaultWidth:"any"})},G=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function ue(t){const e=G[t];switch(t){case 0:return"'в прошлое "+e+" в' p";case 1:case 2:case 4:return"'в прошлый "+e+" в' p";case 3:case 5:case 6:return"'в прошлую "+e+" в' p"}}function _(t){const e=G[t];return t===2?"'во "+e+" в' p":"'в "+e+" в' p"}function ce(t){const e=G[t];switch(t){case 0:return"'в следующее "+e+" в' p";case 1:case 2:case 4:return"'в следующий "+e+" в' p";case 3:case 5:case 6:return"'в следующую "+e+" в' p"}}const de={lastWeek:(t,e,n)=>{const r=t.getDay();return H(t,e,n)?_(r):ue(r)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(t,e,n)=>{const r=t.getDay();return H(t,e,n)?_(r):ce(r)},other:"P"},le=(t,e,n,r)=>{const a=de[t];return typeof a=="function"?a(e,n,r):a},fe={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},me={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},he={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},ge={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},we={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},ye={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},be={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},ve=(t,e)=>{const n=Number(t),r=e?.unit;let a;return r==="date"?a="-е":r==="week"||r==="minute"||r==="second"?a="-я":a="-й",n+a},pe={ordinalNumber:ve,era:h({values:fe,defaultWidth:"wide"}),quarter:h({values:me,defaultWidth:"wide",argumentCallback:t=>t-1}),month:h({values:he,defaultWidth:"wide",formattingValues:ge,defaultFormattingWidth:"wide"}),day:h({values:we,defaultWidth:"wide"}),dayPeriod:h({values:ye,defaultWidth:"any",formattingValues:be,defaultFormattingWidth:"wide"})},Pe=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,Me=/\d+/i,We={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},ke={any:[/^д/i,/^н/i]},De={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},xe={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},Se={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},Ge={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},Ye={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},Ne={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},Te={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},Fe={ordinalNumber:B({matchPattern:Pe,parsePattern:Me,valueCallback:t=>parseInt(t,10)}),era:g({matchPatterns:We,defaultMatchWidth:"wide",parsePatterns:ke,defaultParseWidth:"any"}),quarter:g({matchPatterns:De,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:g({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),day:g({matchPatterns:Ge,defaultMatchWidth:"wide",parsePatterns:Ye,defaultParseWidth:"any"}),dayPeriod:g({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Te,defaultParseWidth:"any"})},A={code:"ru",formatDistance:re,formatLong:se,formatRelative:le,localize:pe,match:Fe,options:{weekStartsOn:1,firstWeekContainsDate:1}};function Ee(t){return R(new Date(t),"d MMMM yyyy",{locale:A})}function Ce(t){return R(new Date(t),"d MMMM, HH:mm",{locale:A})}function qe(t,e){return nt(new Date(e),new Date(t))}function $e(t){return ee(new Date,new Date(t))}function He(t,e="₽",n=2){return`${t.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).replace(/,/g," ")} ${e}`}function _e(t){return t.reduce((e,n)=>e+n,0)}function Xe(t){const e=t.replace(/[^\d.,]/g,"").replace(",",".");return parseFloat(e)||0}exports.EventBus=x.EventBus;exports.Portal=x._sfc_main;exports.useBodyScroll=x.useBodyScroll;exports.onClickOutside=z.onClickOutside;exports.openFileDialog=I.openFileDialog;exports.dayjs=J.dayjs;exports.formatDateReadable=Ee;exports.formatDateWithTime=Ce;exports.formatPrice=He;exports.getDaysBetween=qe;exports.isExpired=$e;exports.parsePrice=Xe;exports.sumPrices=_e;
|
package/dist/utils/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as Xe, _ as _e, u as Le } from "../eventBus.util-msbJpg6N.js";
|
|
2
2
|
import { o as Ve } from "../dayjs.util-DSjkslnJ.js";
|
|
3
|
-
import { o as Re } from "../uploadFile.util-
|
|
3
|
+
import { o as Re } from "../uploadFile.util-CaG3C2Ri.js";
|
|
4
4
|
import { d as Ae } from "../parseFileSize.util-BAG-MLFl.js";
|
|
5
5
|
const X = 6048e5, A = 864e5, G = Symbol.for("constructDateFrom");
|
|
6
6
|
function b(t, e) {
|
|
@@ -3,13 +3,28 @@ import { parseFileSize } from "@/utils/parseFileSize.util";
|
|
|
3
3
|
|
|
4
4
|
type FileType = "image" | "pdf" | "excel" | "word" | "all";
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
interface OpenFileDialogOptionsBase {
|
|
7
7
|
accept?: FileType | FileType[];
|
|
8
|
-
maxFileSize?: string;
|
|
8
|
+
maxFileSize?: string;
|
|
9
9
|
maxFiles?: number;
|
|
10
10
|
multiple?: boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
interface OpenFileDialogOptionsLocal extends OpenFileDialogOptionsBase {
|
|
14
|
+
url?: undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface OpenFileDialogOptionsUpload extends OpenFileDialogOptionsBase {
|
|
18
|
+
url: string;
|
|
19
|
+
fieldName?: string; // имя поля для файла(ов), по умолчанию "file" или "files"
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
withCredentials?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type OpenFileDialogOptions =
|
|
25
|
+
| OpenFileDialogOptionsLocal
|
|
26
|
+
| OpenFileDialogOptionsUpload;
|
|
27
|
+
|
|
13
28
|
/**
|
|
14
29
|
* Преобразует типы файлов в accept-строку для input[type="file"]
|
|
15
30
|
*/
|
|
@@ -34,24 +49,20 @@ function getAcceptString(accept?: FileType | FileType[]): string | undefined {
|
|
|
34
49
|
|
|
35
50
|
/**
|
|
36
51
|
* Открывает окно выбора файла для загрузки с ограничениями.
|
|
37
|
-
* @param options - настройки выбора файлов
|
|
38
|
-
* @returns {Promise<IFile[]>} - промис с выбранными файлами
|
|
39
52
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* openFileDialog({
|
|
43
|
-
* accept: ['image', 'pdf'],
|
|
44
|
-
* maxFileSize: '5mb',
|
|
45
|
-
* maxFiles: 3
|
|
46
|
-
* }).then((files) => {
|
|
47
|
-
* // files — массив выбранных файлов, соответствующих ограничениям
|
|
48
|
-
* console.log(files);
|
|
49
|
-
* });
|
|
53
|
+
* Без url — возвращает IFile[] с локальными blob-ссылками.
|
|
54
|
+
* С url — загружает файлы на сервер и возвращает ответ сервера.
|
|
50
55
|
*/
|
|
51
56
|
export function openFileDialog(
|
|
57
|
+
options?: OpenFileDialogOptionsLocal
|
|
58
|
+
): Promise<IFile[]>;
|
|
59
|
+
export function openFileDialog<T = unknown>(
|
|
60
|
+
options: OpenFileDialogOptionsUpload
|
|
61
|
+
): Promise<T>;
|
|
62
|
+
export function openFileDialog<T = unknown>(
|
|
52
63
|
options: OpenFileDialogOptions = {}
|
|
53
|
-
): Promise<IFile[]> {
|
|
54
|
-
return new Promise((resolve) => {
|
|
64
|
+
): Promise<IFile[] | T> {
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
55
66
|
const input = document.createElement("input");
|
|
56
67
|
input.type = "file";
|
|
57
68
|
input.style.display = "none";
|
|
@@ -65,36 +76,72 @@ export function openFileDialog(
|
|
|
65
76
|
input.accept = acceptString;
|
|
66
77
|
}
|
|
67
78
|
|
|
68
|
-
input.addEventListener("change", (event: Event) => {
|
|
79
|
+
input.addEventListener("change", async (event: Event) => {
|
|
69
80
|
const target = event.target as HTMLInputElement;
|
|
70
81
|
let files: File[] = [];
|
|
71
82
|
|
|
72
83
|
if (target.files && target.files.length > 0) {
|
|
73
84
|
files = Array.from(target.files);
|
|
74
85
|
|
|
75
|
-
// Ограничение по количеству файлов
|
|
76
86
|
if (options.maxFiles && files.length > options.maxFiles) {
|
|
77
87
|
files = files.slice(0, options.maxFiles);
|
|
78
88
|
}
|
|
79
89
|
|
|
80
|
-
// Ограничение по размеру файла
|
|
81
90
|
if (options.maxFileSize) {
|
|
82
91
|
const maxSize = parseFileSize(options.maxFileSize);
|
|
83
92
|
files = files.filter((file) => file.size <= maxSize);
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
95
|
|
|
87
|
-
|
|
96
|
+
document.body.removeChild(input);
|
|
97
|
+
|
|
98
|
+
// Режим загрузки на сервер
|
|
99
|
+
if ("url" in options && options.url) {
|
|
100
|
+
if (files.length === 0) {
|
|
101
|
+
resolve([] as unknown as T);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
const formData = new FormData();
|
|
107
|
+
const fieldName =
|
|
108
|
+
options.fieldName ?? (files.length > 1 ? "files" : "file");
|
|
109
|
+
|
|
110
|
+
for (const file of files) {
|
|
111
|
+
formData.append(fieldName, file);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const response = await fetch(options.url, {
|
|
115
|
+
method: "POST",
|
|
116
|
+
body: formData,
|
|
117
|
+
headers: options.headers,
|
|
118
|
+
credentials: options.withCredentials ? "include" : "same-origin",
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (!response.ok) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`Upload failed: ${response.status} ${response.statusText}`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const data = await response.json();
|
|
128
|
+
resolve(data as T);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
reject(error);
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Локальный режим — возвращаем IFile[]
|
|
88
136
|
const iFiles: IFile[] = files.map((file) => ({
|
|
89
|
-
id: crypto.randomUUID(),
|
|
90
|
-
url: URL.createObjectURL(file),
|
|
137
|
+
id: crypto.randomUUID(),
|
|
138
|
+
url: URL.createObjectURL(file),
|
|
91
139
|
name: file.name,
|
|
92
140
|
mime: file.type,
|
|
93
141
|
size: file.size,
|
|
94
142
|
}));
|
|
95
143
|
|
|
96
144
|
resolve(iFiles);
|
|
97
|
-
document.body.removeChild(input);
|
|
98
145
|
});
|
|
99
146
|
|
|
100
147
|
document.body.appendChild(input);
|
package/dist/utils.d.ts
CHANGED
|
@@ -89,29 +89,32 @@ export declare interface OnClickOutsideOptions {
|
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Открывает окно выбора файла для загрузки с ограничениями.
|
|
92
|
-
* @param options - настройки выбора файлов
|
|
93
|
-
* @returns {Promise<IFile[]>} - промис с выбранными файлами
|
|
94
92
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* openFileDialog({
|
|
98
|
-
* accept: ['image', 'pdf'],
|
|
99
|
-
* maxFileSize: '5mb',
|
|
100
|
-
* maxFiles: 3
|
|
101
|
-
* }).then((files) => {
|
|
102
|
-
* // files — массив выбранных файлов, соответствующих ограничениям
|
|
103
|
-
* console.log(files);
|
|
104
|
-
* });
|
|
93
|
+
* Без url — возвращает IFile[] с локальными blob-ссылками.
|
|
94
|
+
* С url — загружает файлы на сервер и возвращает ответ сервера.
|
|
105
95
|
*/
|
|
106
|
-
export declare function openFileDialog(options?:
|
|
96
|
+
export declare function openFileDialog(options?: OpenFileDialogOptionsLocal): Promise<IFile[]>;
|
|
97
|
+
|
|
98
|
+
export declare function openFileDialog<T = unknown>(options: OpenFileDialogOptionsUpload): Promise<T>;
|
|
107
99
|
|
|
108
|
-
declare interface
|
|
100
|
+
declare interface OpenFileDialogOptionsBase {
|
|
109
101
|
accept?: FileType | FileType[];
|
|
110
102
|
maxFileSize?: string;
|
|
111
103
|
maxFiles?: number;
|
|
112
104
|
multiple?: boolean;
|
|
113
105
|
}
|
|
114
106
|
|
|
107
|
+
declare interface OpenFileDialogOptionsLocal extends OpenFileDialogOptionsBase {
|
|
108
|
+
url?: undefined;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare interface OpenFileDialogOptionsUpload extends OpenFileDialogOptionsBase {
|
|
112
|
+
url: string;
|
|
113
|
+
fieldName?: string;
|
|
114
|
+
headers?: Record<string, string>;
|
|
115
|
+
withCredentials?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
115
118
|
declare type OverlayType = 'modal' | 'drawer' | 'popover' | 'tooltip' | 'confirm';
|
|
116
119
|
|
|
117
120
|
/**
|