@efficiency-point/design-system 0.1.8 → 0.1.10
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 +37 -25
- package/dist/components/DSFloating/DSFloating.d.ts.map +1 -1
- package/dist/components/DSIcon/DSIcon.d.ts +0 -1
- package/dist/components/DSIcon/DSIcon.d.ts.map +1 -1
- package/dist/components/DSModal/DSModal.d.ts +1 -1
- package/dist/components/DSModal/DSModal.d.ts.map +1 -1
- package/dist/components/DSModal/builtins.d.ts +2 -0
- package/dist/components/DSModal/builtins.d.ts.map +1 -1
- package/dist/components/DSModal/modal.store.d.ts +4 -0
- package/dist/components/DSModal/modal.store.d.ts.map +1 -1
- package/dist/components/DSModal/modal.types.d.ts +3 -0
- package/dist/components/DSModal/modal.types.d.ts.map +1 -1
- package/dist/components/DSModal/useModals.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +1026 -986
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,34 +69,34 @@ export function Example() {
|
|
|
69
69
|
/>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
### DSCheckbox
|
|
72
|
+
### DSCheckbox
|
|
73
73
|
|
|
74
74
|
Поддерживает controlled state, `indeterminate`, `readOnly`, `disabled`, hint/error и нативные form-атрибуты.
|
|
75
75
|
|
|
76
76
|
```tsx
|
|
77
77
|
<DSCheckbox checked={enabled} onChange={setEnabled} label="Активен" />
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### DSTextarea
|
|
81
|
-
|
|
82
|
-
Контролируемое многострочное поле в стилистике `DSInput`. По умолчанию
|
|
83
|
-
показывает две строки и автоматически увеличивается по содержимому. `maxRows`
|
|
84
|
-
ограничивает рост и включает внутреннюю прокрутку; `autoResize={false}` включает
|
|
85
|
-
ручное изменение высоты.
|
|
86
|
-
|
|
87
|
-
```tsx
|
|
88
|
-
<DSTextarea
|
|
89
|
-
label="Комментарий"
|
|
90
|
-
value={comment}
|
|
91
|
-
onChange={setComment}
|
|
92
|
-
minRows={2}
|
|
93
|
-
maxRows={8}
|
|
94
|
-
maxLength={500}
|
|
95
|
-
showCount
|
|
96
|
-
/>
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### DSRadioButton
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### DSTextarea
|
|
81
|
+
|
|
82
|
+
Контролируемое многострочное поле в стилистике `DSInput`. По умолчанию
|
|
83
|
+
показывает две строки и автоматически увеличивается по содержимому. `maxRows`
|
|
84
|
+
ограничивает рост и включает внутреннюю прокрутку; `autoResize={false}` включает
|
|
85
|
+
ручное изменение высоты.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<DSTextarea
|
|
89
|
+
label="Комментарий"
|
|
90
|
+
value={comment}
|
|
91
|
+
onChange={setComment}
|
|
92
|
+
minRows={2}
|
|
93
|
+
maxRows={8}
|
|
94
|
+
maxLength={500}
|
|
95
|
+
showCount
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### DSRadioButton
|
|
100
100
|
|
|
101
101
|
Двухпозиционный switch. Несмотря на историческое имя, в DOM используется checkbox с `role="switch"`.
|
|
102
102
|
|
|
@@ -197,7 +197,7 @@ export function Example() {
|
|
|
197
197
|
|
|
198
198
|
### DSVideoPlayerFrame
|
|
199
199
|
|
|
200
|
-
Адаптивный видеоплеер с собственными controls, несколькими sources/tracks, poster, loading/error-состояниями, горячими клавишами, настройкой скорости, субтитров, loop, Picture-in-Picture и fullscreen. Редкие действия собраны в меню настроек; `controls={false}` скрывает панель управления.
|
|
200
|
+
Адаптивный видеоплеер с собственными controls, несколькими sources/tracks, poster, loading/error-состояниями, горячими клавишами, настройкой скорости, субтитров, loop, Picture-in-Picture и fullscreen. Редкие действия собраны в меню настроек; `controls={false}` скрывает панель управления.
|
|
201
201
|
|
|
202
202
|
```tsx
|
|
203
203
|
<DSVideoPlayerFrame title="Обучение" sources={[{ src: '/video.mp4', type: 'video/mp4' }]} />
|
|
@@ -329,9 +329,21 @@ import { modalRegistry } from '@/shared/ui/modal/modal.registry';
|
|
|
329
329
|
|
|
330
330
|
```tsx
|
|
331
331
|
const { openModal } = useModals<typeof modalRegistry>();
|
|
332
|
-
openModal(
|
|
332
|
+
openModal(
|
|
333
|
+
'EmployeeModal',
|
|
334
|
+
{ employeeId: '42' },
|
|
335
|
+
{
|
|
336
|
+
title: 'Карточка сотрудника',
|
|
337
|
+
description: 'Заголовок и описание автоматически получит DSModalFrame.',
|
|
338
|
+
},
|
|
339
|
+
);
|
|
333
340
|
```
|
|
334
341
|
|
|
342
|
+
`title` и `description` в третьем аргументе `openModal` доступны любой модалке:
|
|
343
|
+
их не нужно вручную прокидывать через renderer в `DSModalFrame`. Явно заданные
|
|
344
|
+
props самого `DSModalFrame` имеют приоритет. Старый вариант с передачей заголовка
|
|
345
|
+
через payload модалки также поддерживается.
|
|
346
|
+
|
|
335
347
|
Modal host поддерживает stack, закрытие верхней модалки по Escape, backdrop-close, focus trap и восстановление focus. Поведение Escape/backdrop настраивается в `openModal`.
|
|
336
348
|
|
|
337
349
|
Встроенные `ConfirmModal` и `ErrorModal` доступны через `builtInModalRegistry`, `useConfirmModal` и `useErrorModal`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSFloating.d.ts","sourceRoot":"","sources":["../../../src/components/DSFloating/DSFloating.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DSFloating.d.ts","sourceRoot":"","sources":["../../../src/components/DSFloating/DSFloating.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAGf,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,+DAM5B,mBAAmB,gCAsFrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSIcon.d.ts","sourceRoot":"","sources":["../../../src/components/DSIcon/DSIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,oBAAoB,WAAW,gCAGrD,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"DSIcon.d.ts","sourceRoot":"","sources":["../../../src/components/DSIcon/DSIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,oBAAoB,WAAW,gCAGrD,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DSModalFrameProps, ModalRegistry } from './modal.types';
|
|
2
|
-
export declare const DSModalFrame: ({ children, title, description, modalId, closeLabel, className, role, }: DSModalFrameProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const DSModalFrame: ({ children, title: titleProp, description: descriptionProp, modalId, closeLabel, className, role, }: DSModalFrameProps) => import("react").JSX.Element;
|
|
3
3
|
export type DSModalProps = {
|
|
4
4
|
registry: ModalRegistry;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSModal.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/DSModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DSModal.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/DSModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAqCtE,eAAO,MAAM,YAAY,GAAI,qGAQ1B,iBAAiB,gCAwDnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,cAAc,YAAY,uCA4DjD,CAAC"}
|
|
@@ -28,7 +28,9 @@ export type UseErrorModalResult = {
|
|
|
28
28
|
export declare const getErrorMessage: (error: unknown) => string;
|
|
29
29
|
export declare const useErrorModal: () => UseErrorModalResult;
|
|
30
30
|
export type LegacyConfirmModalState = ConfirmModalOptions;
|
|
31
|
+
/** @deprecated Use useConfirmModal instead. */
|
|
31
32
|
export declare const useConfirmModalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ConfirmModalOptions>>;
|
|
32
33
|
export type LegacyErrorModalState = Partial<ErrorModalPayload>;
|
|
34
|
+
/** @deprecated Use useErrorModal instead. */
|
|
33
35
|
export declare const useErrorModalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<Partial<ErrorModalPayload>>>;
|
|
34
36
|
//# sourceMappingURL=builtins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/builtins.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAIxE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAMzE,eAAO,MAAM,YAAY,GAAI,iFAS1B,mBAAmB,GAAG,aAAa,gCA2BrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iDAMxB,iBAAiB,GAAG,aAAa,gCAWnC,CAAC;AAEF,eAAO,MAAM,oBAAoB;oGAtD9B,mBAAmB,GAAG,aAAa;kEAyCnC,iBAAiB,GAAG,aAAa;CAgBlC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAExF,eAAO,MAAM,eAAe,QAAO,
|
|
1
|
+
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/builtins.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAIxE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAMzE,eAAO,MAAM,YAAY,GAAI,iFAS1B,mBAAmB,GAAG,aAAa,gCA2BrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iDAMxB,iBAAiB,GAAG,aAAa,gCAWnC,CAAC;AAEF,eAAO,MAAM,oBAAoB;oGAtD9B,mBAAmB,GAAG,aAAa;kEAyCnC,iBAAiB,GAAG,aAAa;CAgBlC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAExF,eAAO,MAAM,eAAe,QAAO,qBAclC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,MAKhD,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,mBAGhC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAC1D,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,kFAA8C,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC/D,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,yFAA4C,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { ModalEntry, ModalId, ModalPayload } from './modal.types';
|
|
2
3
|
export type OpenModalOptions = {
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
3
6
|
closeOnEscape?: boolean;
|
|
4
7
|
closeOnBackdrop?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
5
9
|
};
|
|
6
10
|
export type ModalStoreState = {
|
|
7
11
|
modals: ModalEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.store.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.store.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACzF,UAAU,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAIF,eAAO,MAAM,cAAc,8EA0CxB,CAAC;AAEJ,eAAO,MAAM,eAAe,YAG3B,CAAC"}
|
|
@@ -14,8 +14,11 @@ export type ModalEntry = {
|
|
|
14
14
|
id: ModalId;
|
|
15
15
|
name: string;
|
|
16
16
|
payload: ModalPayload;
|
|
17
|
+
title?: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
17
19
|
closeOnEscape: boolean;
|
|
18
20
|
closeOnBackdrop: boolean;
|
|
21
|
+
onClose?: () => void;
|
|
19
22
|
};
|
|
20
23
|
export type DSModalFrameProps = {
|
|
21
24
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,aAAa,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;AAGpG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC;AAErI,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,aAAa,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;AAGpG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC;AAErI,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,aAAa,EAAE,UAAU,CAAC,MAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModals.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/useModals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useModals.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/useModals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,IAAI;IACnD,SAAS,EAAE,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,MAAM,CAAC;IACpH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,aAAa,GAAG,aAAa,OAAK,eAAe,CAAC,CAAC,CA+BtF,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_1pk53_1`,sm:`_sm_1pk53_3`,md:`_md_1pk53_5`,neutral:`_neutral_1pk53_7`,info:`_info_1pk53_9`,success:`_success_1pk53_11`,warning:`_warning_1pk53_13`,error:`_error_1pk53_15`,dot:`_dot_1pk53_17`,icon:`_icon_1pk53_19`,label:`_label_1pk53_21`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={container:`_container_1h2c4_1`,inner:`_inner_1h2c4_21`,line:`_line_1h2c4_39`,primary:`_primary_1h2c4_57`,secondary:`_secondary_1h2c4_65`,outline:`_outline_1h2c4_73`,ghost:`_ghost_1h2c4_81`,empty:`_empty_1h2c4_89`,destructive:`_destructive_1h2c4_97`,destructiveOutline:`_destructiveOutline_1h2c4_105`,grow:`_grow_1h2c4_1`},c=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${s.container} ${s[t]}`,children:(0,e.jsxs)(`div`,{className:`${s.inner} ${s[t]}`,children:[(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`})]})}),l={button:`_button_1gql6_1`,sm:`_sm_1gql6_43`,md:`_md_1gql6_55`,lg:`_lg_1gql6_67`,primary:`_primary_1gql6_79`,secondary:`_secondary_1gql6_91`,outline:`_outline_1gql6_103`,ghost:`_ghost_1gql6_115`,empty:`_empty_1gql6_127`,destructive:`_destructive_1gql6_139`,destructiveOutline:`_destructiveOutline_1gql6_147`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...u},d)=>(0,e.jsx)(`button`,{ref:d,className:`${l.button} ${l[n]} ${l[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...u,type:o,children:i?(0,e.jsx)(c,{variant:n}):t}));u.displayName=`DSButton`;var d={label:`_label_fa00b_1`,required:`_required_fa00b_23`,error:`_error_fa00b_25`,optional:`_optional_fa00b_33`,hint:`_hint_fa00b_35`,disabled:`_disabled_fa00b_47`,message:`_message_fa00b_55`,success:`_success_fa00b_71`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),h={IconBasket:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),IconCheck:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),IconChevron:t=>(0,e.jsx)(m,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),IconCross:({strokeWidth:t=2,...n})=>(0,e.jsx)(m,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),IconEdit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),IconErrorCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),IconEye:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),IconEyeOff:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),IconInfo:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),IconInfoCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),IconMinus:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),IconPause:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),IconPictureInPicture:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),IconPlay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),IconReplay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),IconSettings:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),IconFullscreen:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),IconFullscreenExit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),IconCaptions:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),IconVolume:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),IconVolumeMuted:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),IconSort:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),IconSortAscending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconSortDescending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),IconSuccessCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),IconUpload:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconWarning:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]})},g=({name:t,...n})=>{let r=h[t];return(0,e.jsx)(r,{...n})},_={wrapper:`_wrapper_1gq36_1`,label:`_label_1gq36_3`,input:`_input_1gq36_5`,control:`_control_1gq36_7`,disabled:`_disabled_1gq36_13`,controlError:`_controlError_1gq36_17`},v=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...m})=>{let h=(0,t.useId)(),v=d??`ds-checkbox-${u??h}`,y=(0,t.useRef)(null),b=a?`${v}-hint`:void 0,x=o?`${v}-error`:void 0;return(0,t.useEffect)(()=>{y.current&&(y.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${_.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${_.label} ${s?_.disabled:``}`,htmlFor:v,children:[(0,e.jsx)(`input`,{ref:y,id:v,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[b,x].filter(Boolean).join(` `)||void 0,className:_.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${_.control} ${o?_.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(g,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:b,children:a}),o&&(0,e.jsx)(p,{id:x,variant:`error`,children:o})]})},y={wrapper:`_wrapper_15bor_1`,trigger:`_trigger_15bor_17`,lg:`_lg_15bor_51`,chevron:`_chevron_15bor_63`,chevronOpen:`_chevronOpen_15bor_89`,nav:`_nav_15bor_99`,day:`_day_15bor_101`,monthSelect:`_monthSelect_15bor_103`,yearInput:`_yearInput_15bor_105`,timeInput:`_timeInput_15bor_107`,value:`_value_15bor_131`,placeholder:`_placeholder_15bor_139`,error:`_error_15bor_147`,panel:`_panel_15bor_155`,calendarHeader:`_calendarHeader_15bor_181`,weekdays:`_weekdays_15bor_270`,days:`_days_15bor_272`,outside:`_outside_15bor_308`,selected:`_selected_15bor_316`,timeLabel:`_timeLabel_15bor_336`,previousMonth:`_previousMonth_15bor_382`,nextMonth:`_nextMonth_15bor_386`},b=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],x=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],S=e=>String(e).padStart(2,`0`),C=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),w=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${S(e.getMonth()+1)}-${S(e.getDate())}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},T=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},E=(e,t)=>{if(!e)return``;let n=`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},D=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},O=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),k=(e,t,n)=>{let r=C(e).getTime();return!!(t&&r<C(t).getTime()||n&&r>C(n).getTime())},A=8,j=6,M=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:m=!1,min:h,max:_,size:v=`md`,id:S,name:C,className:M=``})=>{let N=(0,t.useId)(),P=S??`ds-date-time-${C??N}`,F=c?`${P}-hint`:void 0,I=l?`${P}-error`:void 0,L=(0,t.useRef)(null),R=(0,t.useRef)(null),z=(0,t.useRef)(null),[B,V]=(0,t.useState)(!1),[H,U]=(0,t.useState)(r??new Date),[W,G]=(0,t.useState)(w(r,`time`)),[K,q]=(0,t.useState)(null),ee=(0,t.useMemo)(()=>D(H),[H]),te=a!==`time`,ne=a!==`date`;(0,t.useEffect)(()=>{r&&U(r),G(w(r,`time`))},[r]);let J=(0,t.useCallback)(()=>{let e=R.current,t=z.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-A,o=n.top-A,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(A,n.top-r.height-j):n.bottom+j,u=n.left,d=i-r.width-A;q({top:l,left:Math.max(A,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!B){q(null);return}return J(),window.addEventListener(`resize`,J),window.addEventListener(`scroll`,J,!0),()=>{window.removeEventListener(`resize`,J),window.removeEventListener(`scroll`,J,!0)}},[B,J,H,W]),(0,t.useEffect)(()=>{if(!B)return;let e=e=>{let t=e.target,n=L.current?.contains(t),r=z.current?.contains(t);!n&&!r&&V(!1)},t=e=>{e.key===`Escape`&&(V(!1),R.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[B]);let re=e=>{if(k(e,h,_))return;let t=a===`date`?T(w(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),a===`date`&&V(!1))},ie=e=>{if(G(e),!e){i?.(null);return}let t=T(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??H:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(h&&n<h||_&&n>_)&&i?.(n)},ae=s??(a===`date`?`--.--.----`:a===`time`?`--:--`:`--.--.---- --:--`),oe=[F,I].filter(Boolean).join(` `)||void 0,se=B&&!d?(0,e.jsxs)(`div`,{ref:z,className:y.panel,role:`dialog`,"aria-label":o??ae,style:K?{top:K.top,left:K.left,maxHeight:K.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[te&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:y.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Предыдущий месяц`,onClick:()=>U(new Date(H.getFullYear(),H.getMonth()-1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.previousMonth})}),(0,e.jsx)(`select`,{className:y.monthSelect,"aria-label":`Месяц`,value:H.getMonth(),onChange:e=>U(new Date(H.getFullYear(),Number(e.target.value),1)),children:x.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:y.yearInput,type:`number`,"aria-label":`Год`,value:H.getFullYear(),onChange:e=>U(new Date(Number(e.target.value),H.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Следующий месяц`,onClick:()=>U(new Date(H.getFullYear(),H.getMonth()+1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.nextMonth})})]}),(0,e.jsx)(`div`,{className:y.weekdays,children:b.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:y.days,children:ee.map(t=>{let n=O(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${y.day} ${t.getMonth()===H.getMonth()?``:y.outside} ${n?y.selected:``}`,disabled:k(t,h,_),"aria-pressed":n,onClick:()=>re(t),children:t.getDate()},t.toISOString())})})]}),ne&&(0,e.jsxs)(`label`,{className:y.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:y.timeInput,type:`time`,value:W,onChange:e=>ie(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:L,className:`${y.wrapper} ${M}`,children:[o&&(0,e.jsx)(f,{htmlFor:P,required:m,disabled:u,children:o}),(0,e.jsxs)(`button`,{ref:R,id:P,name:C,type:`button`,className:`${y.trigger} ${y[v]} ${l?y.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":B,"aria-haspopup":`dialog`,"aria-describedby":oe,onClick:()=>{d||V(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?y.value:y.placeholder,children:E(r,a)||ae}),(0,e.jsx)(`span`,{className:[y.chevron,se?y.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),se&&(0,n.createPortal)(se,document.body),c&&!l&&(0,e.jsx)(p,{id:F,children:c}),l&&(0,e.jsx)(p,{id:I,variant:`error`,children:l})]})},N={root:`_root_1q42e_1`,legend:`_legend_1q42e_3`,range:`_range_1q42e_5`},P=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),F=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),P(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${N.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:N.range,children:[(0,e.jsx)(M,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(M,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},I={group:`_group_1fs9e_1`,skeleton:`_skeleton_1fs9e_3`,text:`_text_1fs9e_5`,rectangular:`_rectangular_1fs9e_7`,circular:`_circular_1fs9e_9`,animated:`_animated_1fs9e_11`,"ds-skeleton":`_ds-skeleton_1fs9e_1`},L=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${I.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${I.skeleton} ${I[t]} ${a?I.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),R={wrapper:`_wrapper_jmtfp_1`,label:`_label_jmtfp_17`,container:`_container_jmtfp_29`,trigger:`_trigger_jmtfp_37`,disabledText:`_disabledText_jmtfp_39`,sm:`_sm_jmtfp_61`,md:`_md_jmtfp_71`,lg:`_lg_jmtfp_81`,value:`_value_jmtfp_141`,placeholder:`_placeholder_jmtfp_143`,chevron:`_chevron_jmtfp_199`,chevronOpen:`_chevronOpen_jmtfp_225`,menu:`_menu_jmtfp_233`,option:`_option_jmtfp_263`,selected:`_selected_jmtfp_333`,message:`_message_jmtfp_353`,error:`_error_jmtfp_355`,errorState:`_errorState_jmtfp_381`},z=8,B=6,V=120,H=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},U=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},W=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:p,className:m=``,required:h=!1,name:_,id:v,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=v??`ds-dropdown-${_??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,F=[N,P].filter(Boolean).join(` `)||void 0,I=s&&c,L=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-z,o=n.top-z,s=a<r.height&&o>a,c=Math.max(V,s?o:a),l=U(b),u=Math.min(c,l),d=n.left,f=i-n.width-z,p=Math.max(z,Math.min(d,f)),m=s?Math.max(z,n.top-r.height-B):n.bottom+B;D({top:m,left:p,width:n.width,maxHeight:u})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return L(),window.addEventListener(`resize`,L),window.addEventListener(`scroll`,L,!0),()=>{window.removeEventListener(`resize`,L),window.removeEventListener(`scroll`,L,!0)}},[w,L,r.length]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target,n=O.current?.contains(t),r=A.current?.contains(t);!n&&!r&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let W=(e,t)=>{let n=H(r,e,t);if(n===-1)return;let i=j.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},G=e=>{e.disabled||(a?.(e.value,e),T(!1),k.current?.focus())},K=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:R.menu,role:`listbox`,"aria-label":l,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[R[d],R.option,a?R.selected:``].filter(Boolean).join(` `),onClick:()=>G(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;W(n+t,t)}if(e.key===`Tab`&&T(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;W(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),G(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[R.wrapper,u?R.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{required:h,disabled:s,htmlFor:I?void 0:S,children:l}),(0,e.jsx)(`div`,{className:R.container,children:I?(0,e.jsx)(`div`,{id:S,className:R.disabledText,"aria-describedby":F,children:M?.label??o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:_,className:`${R.trigger} ${R[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":F,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{W(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&w){e.preventDefault();let t=r.findIndex(e=>e.value===i);W(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${M?R.value:R.placeholder}
|
|
2
|
-
${R[d]}`,children:M?.label??o}),(0,e.jsx)(`span`,{className:[R.chevron,w?R.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(K,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:R.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:R.error,children:u})]})},G=e=>`${e.id}:${e.direction}`,K=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:G({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:G({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(W,{options:c,value:n?G(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},q={root:`_root_osyhx_1`,tableWrap:`_tableWrap_osyhx_3`,table:`_table_osyhx_3`,sticky:`_sticky_osyhx_15`,sortButton:`_sortButton_osyhx_17`,state:`_state_osyhx_21`,cards:`_cards_osyhx_23`,mobileSort:`_mobileSort_osyhx_23`,card:`_card_osyhx_23`,spanTwo:`_spanTwo_osyhx_37`,clickableRow:`_clickableRow_osyhx_39`,pagination:`_pagination_osyhx_43`,paginationRange:`_paginationRange_osyhx_56`,paginationControls:`_paginationControls_osyhx_62`,pageNumbers:`_pageNumbers_osyhx_63`,pageButton:`_pageButton_osyhx_69`,ellipsis:`_ellipsis_osyhx_74`,previousIcon:`_previousIcon_osyhx_80`,nextIcon:`_nextIcon_osyhx_84`,default:`_default_osyhx_104`,tableOnMobile:`_tableOnMobile_osyhx_104`,wide:`_wide_osyhx_108`},ee=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),te=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],ne=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},J=(e,t)=>typeof e==`function`?e(t):t[e],re=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},ie=(e,t,n)=>{let r=re(e.getValue(n)),i=re(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},ae=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},oe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},se=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},ce=e=>{switch(e){case`date`:return ie;case`number`:return ae;case`boolean`:return oe;case`text`:case void 0:return se;case`custom`:return}},le=e=>{let t=t=>J(e.accessor,t),n=e.sortFn??ce(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},ue=({columns:n,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:d,caption:f,ariaLabel:p,loading:m=!1,error:h,emptyState:_=`Нет данных`,stickyHeader:v=!1,maxHeight:y,className:b=``,onRowClick:x,pagination:S=!1,pageSize:C=30,visibleColumnIds:w})=>{let[T,E]=(0,t.useState)([]),[D,O]=(0,t.useState)(0),k=s??T,A=k.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),j=Number.isFinite(C)&&C>0?Math.floor(C):30,M=(0,t.useMemo)(()=>{if(w===void 0)return n;let e=new Set(w);return n.filter(t=>e.has(t.id))},[n,w]),N=(0,t.useMemo)(()=>M.length===0?`Должна быть видима хотя бы одна колонка`:ne(M,i),[i,M]),P=(0,t.useMemo)(()=>M.map(le),[M]),F=(0,r.useTable)({features:ee,columns:P,data:i,state:{sorting:k},onSortingChange:e=>{let t=typeof e==`function`?e(k):e;s===void 0&&E(t),O(0),c?.(t)},getRowId:d}),I=F.getRowModel().rows,R=S?Math.max(1,Math.ceil(I.length/j)):1,z=Math.min(D,R-1),B=(0,t.useMemo)(()=>S?I.slice(z*j,(z+1)*j):I,[j,S,z,I]),V=(0,t.useMemo)(()=>M.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[M]),H=(0,t.useMemo)(()=>te(z,R),[R,z]),U=[q.root,o===`wide`?q.wide:q.default,a?q.tableOnMobile:``,b].filter(Boolean).join(` `),W=N??h,G=S&&!m&&!W&&I.length>j,re=z*j+1,ie=Math.min((z+1)*j,I.length);return(0,t.useEffect)(()=>{O(0)},[i,j,S,A]),(0,t.useEffect)(()=>{D>=R&&O(R-1)},[R,D]),(0,e.jsxs)(`section`,{className:U,"aria-busy":m,children:[!a&&!m&&!W&&B.length>0&&V.length>0&&(0,e.jsx)(K,{className:q.mobileSort,options:V,value:k[0]?{id:k[0].id,direction:k[0].desc?`desc`:`asc`}:null,onChange:e=>F.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:q.tableWrap,style:{maxHeight:y},children:(0,e.jsxs)(`table`,{className:q.table,"aria-label":p,children:[f&&(0,e.jsx)(`caption`,{children:f}),(0,e.jsx)(`thead`,{className:v?q.sticky:``,children:F.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,children:(0,e.jsxs)(`button`,{type:`button`,className:q.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(F.FlexRender,{header:t}),(0,e.jsx)(g,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:m?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:M.length,children:(0,e.jsx)(L,{lines:3})})}):W?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:q.state,colSpan:M.length,children:W})}):B.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:q.state,colSpan:M.length,children:_})}):B.map(t=>(0,e.jsx)(`tr`,{className:x?q.clickableRow:void 0,onClick:()=>x?.(t.original),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x?.(t.original))},tabIndex:x?0:void 0,role:x?`button`:void 0,children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{children:(0,e.jsx)(F.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:q.cards,role:`list`,"aria-label":p??f,children:m?(0,e.jsx)(L,{lines:4}):W?(0,e.jsx)(`div`,{className:q.state,children:W}):B.length===0?(0,e.jsx)(`div`,{className:q.state,children:_}):B.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:M})},t.id);let n=M.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),r=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),i=e=>J(e.accessor,t.original),a=e=>e.mobile?.renderMobile?.(t.original,i(e))??e.cell?.(t.original,i(e))??String(i(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:q.card,children:[(0,e.jsx)(`h3`,{children:r?a(r):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==r&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?q.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:a(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:a(t)},t.id))]},t.id)})}),G&&(0,e.jsxs)(`nav`,{className:q.pagination,"aria-label":`Пагинация таблицы`,children:[(0,e.jsxs)(`span`,{className:q.paginationRange,"aria-live":`polite`,children:[re,`–`,ie,` из `,I.length]}),(0,e.jsxs)(`div`,{className:q.paginationControls,children:[(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===0,"aria-label":`Предыдущая страница`,onClick:()=>{O(e=>Math.max(0,e-1))},children:[(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:q.previousIcon}),(0,e.jsx)(`span`,{className:q.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:q.pageNumbers,children:H.map(t=>typeof t==`number`?(0,e.jsx)(u,{variant:t===z?`secondary`:`empty`,size:`md`,className:q.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===z?`page`:void 0,onClick:()=>{O(t)},children:t+1},t):(0,e.jsx)(`span`,{className:q.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===R-1,"aria-label":`Следующая страница`,onClick:()=>{O(e=>Math.min(R-1,e+1))},children:[(0,e.jsx)(`span`,{className:q.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:q.nextIcon})]})]})]})]})},de=8,fe=6,pe=120,me=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},he=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:p=!1,hint:m,className:h=``,name:_,id:v,closeOnSelect:y=!1,needMark:b=!0,maxMenuHeight:x})=>{let S=(0,t.useId)(),C=v??`ds-dropdown-multiple-${_??S}`,w=`${C}-listbox`,[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),N=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),P=m?`${C}-hint`:void 0,F=u?`${C}-error`:void 0,I=[P,F].filter(Boolean).join(` `)||void 0,L=s&&c,z=(0,t.useCallback)(()=>{let e=A.current,t=j.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-de,a=n.top-de,o=i<r.height&&a>i,s=Math.max(pe,o?a:i),c=window.innerWidth-n.width-de;O({top:o?Math.max(de,n.top-r.height-fe):n.bottom+fe,left:Math.max(de,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,me(x))})},[x]);(0,t.useLayoutEffect)(()=>{if(!T){O(null);return}return z(),window.addEventListener(`resize`,z),window.addEventListener(`scroll`,z,!0),()=>{window.removeEventListener(`resize`,z),window.removeEventListener(`scroll`,z,!0)}},[T,r.length,z]),(0,t.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&E(!1)},t=e=>{e.key===`Escape`&&(E(!1),A.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]);let B=(e,t)=>{let n=H(r,e,t);n!==-1&&(M.current[n]?.focus(),M.current[n]?.scrollIntoView({block:`nearest`}))},V=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),y&&(E(!1),A.current?.focus())},U=T?(0,e.jsx)(`ul`,{ref:j,id:w,className:R.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:D?{position:`fixed`,top:D.top,left:D.left,width:D.width,maxHeight:D.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[R[d],R.option,a?R.selected:``].filter(Boolean).join(` `),onClick:()=>V(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;B(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;B(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),V(t)),e.key===`Tab`&&E(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&b&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[R.wrapper,u?R.errorState:``,h].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{htmlFor:L?void 0:C,required:p,disabled:s,children:l}),(0,e.jsx)(`div`,{className:R.container,children:L?(0,e.jsx)(`div`,{id:C,className:`${R.disabledText} ${R[d]}`,"aria-describedby":I,children:N||o}):(0,e.jsxs)(`button`,{ref:A,id:C,type:`button`,name:_,className:`${R.trigger} ${R[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":T,"aria-controls":w,"aria-describedby":I,"aria-invalid":!!u,onClick:()=>E(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),E(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>B(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${N?R.value:R.placeholder} ${R[d]}`,children:N||o}),(0,e.jsx)(`span`,{className:[R.chevron,T?R.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),T&&(0,n.createPortal)(U,document.body),m&&!u&&(0,e.jsx)(`span`,{id:P,className:R.message,children:m}),u&&(0,e.jsx)(`span`,{id:F,className:R.error,children:u})]})},ge={wrapper:`_wrapper_yuep3_1`,control:`_control_yuep3_3`,input:`_input_yuep3_7`,disabledText:`_disabledText_yuep3_7`,sm:`_sm_yuep3_45`,md:`_md_yuep3_57`,lg:`_lg_yuep3_69`,inputError:`_inputError_yuep3_81`,trailingAction:`_trailingAction_yuep3_83`},_e=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:_,size:v=`md`,clearable:y=!0,required:b=!1,selectTextOnFocus:x=!1,isPassword:S=!1,passwordVisibleLabel:C=`Скрыть пароль`,passwordHiddenLabel:w=`Показать пароль`,onFocus:T,...E})=>{let D=(0,t.useId)(),O=_??`ds-input-${h??D}`,k=(0,t.useRef)(null),[A,j]=(0,t.useState)(!1),M=d?`${O}-hint`:void 0,N=u?`${O}-error`:void 0,P=String(n??``),F=[M,N].filter(Boolean).join(` `)||void 0,I=S?A?`text`:`password`:i;return(0,t.useEffect)(()=>{S||j(!1)},[S]),(0,e.jsxs)(`div`,{className:`${ge.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:O,required:b,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:O,className:ge.disabledText,"aria-describedby":F,children:P||a}):(0,e.jsxs)(`div`,{className:ge.control,children:[(0,e.jsx)(`input`,{ref:k,id:O,name:h,type:I,value:P,placeholder:a,disabled:o,readOnly:s,required:b,"aria-invalid":!!u,"aria-describedby":F,className:`${ge.input} ${ge[v]} ${u?ge.inputError:``}`,onChange:e=>{if(i===`number`&&!S){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{x&&e.currentTarget.value&&e.currentTarget.select(),T?.(e)},...E}),S&&(0,e.jsx)(`button`,{type:`button`,className:ge.trailingAction,disabled:o,"aria-label":A?C:w,"aria-pressed":A,onClick:()=>j(e=>!e),children:(0,e.jsx)(g,{name:A?`IconEyeOff`:`IconEye`,width:20,height:20})}),!S&&y&&P&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:ge.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=k.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(p,{id:M,children:d}),u&&(0,e.jsx)(p,{id:N,variant:`error`,children:u})]})},ve=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},ye=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},Y={wrapper:`_wrapper_bwlwb_1`,control:`_control_bwlwb_3`,inputHost:`_inputHost_bwlwb_5`,sm:`_sm_bwlwb_13`,md:`_md_bwlwb_18`,lg:`_lg_bwlwb_22`,errorState:`_errorState_bwlwb_29`,disabledText:`_disabledText_bwlwb_33`,chevron:`_chevron_bwlwb_53`,chevronOpen:`_chevronOpen_bwlwb_65`,menu:`_menu_bwlwb_67`,option:`_option_bwlwb_81`,empty:`_empty_bwlwb_81`,selected:`_selected_bwlwb_103`,active:`_active_bwlwb_103`,visuallyHidden:`_visuallyHidden_bwlwb_109`},be=8,xe=6,Se=5,Ce={sm:20,md:30,lg:40},we=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:m,hint:h,size:_=`md`,required:v=!1,className:y=``,name:b,id:x,needMark:S=!0})=>{let C=(0,t.useId)(),w=x??`ds-search-dropdown-${b??C}`,T=`${w}-listbox`,E=`${w}-status`,D=h?`${w}-hint`:void 0,O=m?`${w}-error`:void 0,k=[E,D,O].filter(Boolean).join(` `),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),[N,P]=(0,t.useState)(!1),[F,I]=(0,t.useState)(``),[L,R]=(0,t.useState)(-1),[z,B]=(0,t.useState)(null),V=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),H=(0,t.useMemo)(()=>ve(r,F),[r,F]),U=c&&u,W=L>=0?H[L]:void 0;(0,t.useEffect)(()=>I(V?.label??``),[V?.label,i]);let G=(0,t.useCallback)(()=>A.current?.querySelector(`input`)??null,[]),K=(0,t.useCallback)((e,t)=>ye(H,e,t),[H]),q=(0,t.useCallback)(e=>{R(e),!(e<0)&&requestAnimationFrame(()=>M.current[e]?.scrollIntoView({block:`nearest`}))},[]),ee=(0,t.useCallback)(()=>{let e=G();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(H.length,Se))*Ce[_]+2,r=window.innerHeight-t.bottom-be,i=t.top-be,a=r<n&&i>r,o=a?i:r,s=Math.max(Ce[_]+2,Math.min(n,o)),c=window.innerWidth-t.width-be,l=Math.max(be,Math.min(t.left,c)),u=a?Math.max(be,t.top-s-xe):t.bottom+xe;B({top:u,left:l,width:t.width,maxHeight:s})},[H.length,G,_]);(0,t.useLayoutEffect)(()=>{if(!N){B(null);return}return ee(),window.addEventListener(`resize`,ee),window.addEventListener(`scroll`,ee,!0),()=>{window.removeEventListener(`resize`,ee),window.removeEventListener(`scroll`,ee,!0)}},[N,ee]),(0,t.useEffect)(()=>{if(!N)return;let e=e=>{let t=e.target;!A.current?.contains(t)&&!j.current?.contains(t)&&(P(!1),R(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[N]);let te=()=>{c||l||(P(!0),R(K(0,1)))},ne=e=>{e.disabled||(I(e.label),P(!1),R(-1),a?.(e.value,e),G()?.focus())},J=N?(0,e.jsx)(`ul`,{ref:j,id:T,className:Y.menu,role:`listbox`,"aria-label":d,style:z?{top:z.top,left:z.left,width:z.width,maxHeight:z.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:H.length===0?(0,e.jsx)(`li`,{className:`${Y.empty} ${Y[_]}`,children:s}):H.map((t,n)=>{let r=t.value===i,a=n===L;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},id:`${w}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,className:[Y.option,Y[_],r?Y.selected:``,a?Y.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||R(n)},onClick:()=>ne(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&S&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:A,className:[Y.wrapper,m?Y.errorState:``,y].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(f,{htmlFor:U?void 0:w,required:v,disabled:c,children:d}),U?(0,e.jsx)(`div`,{className:`${Y.disabledText} ${Y[_]}`,children:V?.label??o}):(0,e.jsxs)(`div`,{className:Y.control,children:[(0,e.jsx)(_e,{id:w,name:b,value:F,placeholder:o,disabled:c,readOnly:l,required:v,size:_,clearable:!1,autoComplete:`off`,className:`${Y.inputHost} ${Y[_]}`,onFocus:te,onChange:e=>{let t=String(e),n=ve(r,t);I(t),P(!0),R(ye(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":T,"aria-activedescendant":W?`${w}-option-${L}`:void 0,"aria-invalid":!!m,"aria-describedby":k,onClick:te,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=L>=0?L+t:t===1?0:H.length-1;P(!0),q(K(n,t))}else if(e.key===`Home`||e.key===`End`){if(!N)return;e.preventDefault();let t=e.key===`Home`?1:-1;q(K(e.key===`Home`?0:H.length-1,t))}else e.key===`Enter`&&N&&W?(e.preventDefault(),ne(W)):e.key===`Escape`&&N?(e.preventDefault(),P(!1),R(-1)):e.key===`Tab`&&(P(!1),R(-1))}}}),(0,e.jsx)(`span`,{className:`${Y.chevron} ${N?Y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),N&&typeof document<`u`&&(0,n.createPortal)(J,document.body),(0,e.jsxs)(`span`,{id:E,className:Y.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,H.length]}),h&&!m&&(0,e.jsx)(p,{id:D,children:h}),m&&(0,e.jsx)(p,{id:O,variant:`error`,children:m})]})},Te={root:`_root_1gjqg_1`,header:`_header_1gjqg_21`,title:`_title_1gjqg_41`,dismiss:`_dismiss_1gjqg_55`,content:`_content_1gjqg_65`},Ee=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Te.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Te.header,children:[(0,e.jsx)(s,{id:l,className:Te.title,children:n}),i&&(0,e.jsx)(u,{className:Te.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Te.content,children:r})]})},De={wrapper:`_wrapper_ecmvo_1`,input:`_input_ecmvo_21`,switch:`_switch_ecmvo_35`,thumb:`_thumb_ecmvo_67`,label:`_label_ecmvo_113`,disabled:`_disabled_ecmvo_125`},Oe=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${De.wrapper} ${a?De.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:De.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:De.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:De.thumb})}),i&&(0,e.jsx)(`span`,{className:De.label,children:i})]})},ke={root:`_root_13nj5_1`,grid:`_grid_13nj5_3`,actions:`_actions_13nj5_5`},Ae=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${ke.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:ke.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(_e,{...n,type:`number`,value:i??``,onChange:e=>d(t.id,e)},t.id):(0,e.jsx)(_e,{...n,type:`text`,value:String(i??``),onChange:e=>d(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(W,{size:`lg`,label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(he,{size:`lg`,label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(v,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(Oe,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(F,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:ke.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},X={wrapper:`_wrapper_8w6xl_1`,dropzone:`_dropzone_8w6xl_3`,dragActive:`_dragActive_8w6xl_5`,disabled:`_disabled_8w6xl_7`,error:`_error_8w6xl_9`,nativeInput:`_nativeInput_8w6xl_11`,empty:`_empty_8w6xl_13`,uploadIcon:`_uploadIcon_8w6xl_15`,files:`_files_8w6xl_17`,file:`_file_8w6xl_17`,fileName:`_fileName_8w6xl_21`,fileSize:`_fileSize_8w6xl_23`},je=e=>`${e.name}:${e.size}:${e.lastModified}`,Me=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Ne=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),Pe=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:d,required:m=!1,disabled:h=!1,readOnly:_=!1,name:v,id:y,className:b=``,dropLabel:x=`Перетащите файлы в эту область`,browseLabel:S=`Выбрать файлы`,addMoreLabel:C=`Добавить ещё`,onReject:w})=>{let T=(0,t.useId)(),E=y??`ds-file-input-${v??T}`,D=(0,t.useRef)(null),O=(0,t.useRef)(0),[k,A]=(0,t.useState)(!1),j=l?`${E}-hint`:void 0,M=d?`${E}-error`:void 0,N=[j,M].filter(Boolean).join(` `)||void 0,P=!h&&!_,F=e=>{let t=[],c=new Set(n.map(je)),l=e.filter(e=>Ne(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(je(e))&&(c.add(je(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&w?.(t),l.length&&r?.(d),D.current&&(D.current.value=``)};return(0,e.jsxs)(`div`,{className:`${X.wrapper} ${b}`,children:[c&&(0,e.jsx)(f,{htmlFor:E,required:m,disabled:h,children:c}),(0,e.jsxs)(`div`,{className:`${X.dropzone} ${k?X.dragActive:``} ${h?X.disabled:``} ${d?X.error:``}`,onDragEnter:e=>{e.preventDefault(),P&&++O.current===1&&A(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--O.current<=0&&(O.current=0,A(!1))},onDrop:e=>{e.preventDefault(),O.current=0,A(!1),P&&F(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:D,id:E,name:v,className:X.nativeInput,type:`file`,multiple:i,accept:a,required:m&&n.length===0,disabled:!P,"aria-describedby":N,"aria-invalid":!!d,onChange:e=>F(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:X.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:X.file,children:[(0,e.jsx)(`span`,{className:X.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:X.fileSize,children:Me(t.size)}),P&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(g,{name:`IconCross`,width:16,height:16})})]},je(t)))}),P&&(i||n.length===0)&&(0,e.jsx)(u,{className:X.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:C}),P&&!i&&(0,e.jsx)(u,{className:X.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:S})]}):(0,e.jsxs)(`div`,{className:X.empty,children:[(0,e.jsx)(`span`,{className:X.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:k?`Отпустите файлы здесь`:x}),!k&&P&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(u,{onClick:()=>D.current?.click(),children:S})]})]})]}),l&&!d&&(0,e.jsx)(p,{id:j,children:l}),d&&(0,e.jsx)(p,{id:M,variant:`error`,live:!0,children:d})]})},Z={wrapper:`_wrapper_8osw8_1`,control:`_control_8osw8_8`,textarea:`_textarea_8osw8_13`,disabledText:`_disabledText_8osw8_14`,sm:`_sm_8osw8_52`,md:`_md_8osw8_59`,lg:`_lg_8osw8_66`,autoResize:`_autoResize_8osw8_73`,manualResize:`_manualResize_8osw8_78`,textareaError:`_textareaError_8osw8_82`,clearAction:`_clearAction_8osw8_86`,messages:`_messages_8osw8_126`,counter:`_counter_8osw8_133`},Fe=2;function Ie(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function Le({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:m,id:h,size:_=`md`,clearable:v=!1,required:y=!1,maxLength:b,showCount:x=!1,minRows:S=Fe,maxRows:C,autoResize:w=!0,...T}){let E=(0,t.useId)(),D=h??`ds-textarea-${m??E}`,O=(0,t.useRef)(null),k=u?`${D}-hint`:void 0,A=l?`${D}-error`:void 0,j=x&&b?`${D}-count`:void 0,M=[k,A,j].filter(Boolean).join(` `)||void 0,N=Math.max(1,S),P=C===void 0?void 0:Math.max(N,C),F=(0,t.useCallback)(()=>{let e=O.current;if(!e||!w)return;let t=window.getComputedStyle(e),n=Ie(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*N+r,a=P===void 0?1/0:n*P+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[w,P,N]);(0,t.useEffect)(()=>{F()},[F,n]),(0,t.useEffect)(()=>{if(!w)return;window.addEventListener(`resize`,F);let e=O.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,F())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,F),t?.disconnect()}},[w,F]);let I=e=>{r?.(e.target.value,e),F()},L=()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),F())},R={"--ds-textarea-min-rows":N};return(0,e.jsxs)(`div`,{className:`${Z.wrapper} ${d}`,children:[c&&(0,e.jsx)(f,{htmlFor:D,required:y,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:D,className:`${Z.disabledText} ${Z[_]}`,style:R,"aria-describedby":M,children:n||i}):(0,e.jsxs)(`div`,{className:Z.control,children:[(0,e.jsx)(`textarea`,{ref:O,id:D,name:m,value:n,placeholder:i,disabled:a,readOnly:o,required:y,maxLength:b,rows:N,style:R,"aria-invalid":!!l,"aria-describedby":M,className:`${Z.textarea} ${Z[_]} ${w?Z.autoResize:Z.manualResize} ${l?Z.textareaError:``}`,onChange:I,...T}),v&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:Z.clearAction,"aria-label":`Очистить поле`,onClick:L,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(u||l||j)&&(0,e.jsxs)(`div`,{className:Z.messages,children:[u&&!l&&(0,e.jsx)(p,{id:k,children:u}),l&&(0,e.jsx)(p,{id:A,variant:`error`,children:l}),j&&(0,e.jsxs)(`span`,{id:j,className:Z.counter,children:[n.length,` / `,b]})]})]})}var Re=0,Q=(0,i.create)(e=>({modals:[],openModal:(t,n={},r={})=>{Re+=1;let i=`ds-modal-${Re}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0}]})),i},closeModal:t=>e(e=>({modals:e.modals.filter(e=>e.id!==t)})),closeTopModal:()=>e(e=>({modals:e.modals.slice(0,-1)})),closeAllModals:()=>e({modals:[]})})),ze=()=>Q.setState({modals:[]}),Be={layer:`_layer_1opno_1`,backdrop:`_backdrop_1opno_3`,panel:`_panel_1opno_5`,header:`_header_1opno_9`,title:`_title_1opno_11`,description:`_description_1opno_13`,content:`_content_1opno_15`,close:`_close_1opno_17`},Ve=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,He=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useId)(),d=(0,t.useId)(),f=(0,t.useRef)(null),p=Q(e=>e.closeModal);return(0,t.useEffect)(()=>{let e=document.activeElement,t=f.current;return(t?.querySelector(Ve)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:f,className:`${Be.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":r?l:void 0,"aria-describedby":i?d:void 0,tabIndex:-1,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(f.current?.querySelectorAll(Ve)??[]);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(r||o)&&(0,e.jsxs)(`header`,{className:Be.header,children:[r&&(0,e.jsx)(`h2`,{id:l,className:Be.title,children:r}),(0,e.jsx)(u,{className:Be.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:()=>p(a),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]}),i&&(0,e.jsx)(`p`,{id:d,className:Be.description,children:i}),(0,e.jsx)(`div`,{className:Be.content,children:n})]})},Ue=({registry:r})=>{let i=Q(e=>e.modals),a=Q(e=>e.closeModal),o=Q(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=Q.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:Be.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let s=r[t.name];return s?(0,e.jsx)(`div`,{className:Be.backdrop,"aria-hidden":n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})},t.id):null})}),document.body)},We=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=Q(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(Ue,{registry:n})]})},Ge=e=>e,Ke={message:`_message_1vtru_1`,actions:`_actions_1vtru_3`},qe=new Map,Je=0,Ye=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{qe.get(c)?.(e),qe.delete(c),n()};return(0,e.jsxs)(He,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Ke.message,children:i}),(0,e.jsxs)(`div`,{className:Ke.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},Xe=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(He,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Ke.message,children:i}),(0,e.jsx)(`div`,{className:Ke.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),Ze=Ge({ConfirmModal:Ye,ErrorModal:Xe}),Qe=()=>{let e=Q(e=>e.openModal);return(t={})=>new Promise(n=>{Je+=1;let r=`confirm-${Je}`;qe.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1})})},$e=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,et=()=>{let e=Q(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:$e(t)})}},tt=(0,i.create)(()=>({})),nt=(0,i.create)(()=>({})),rt=()=>{let e=Q(e=>e.modals),t=Q(e=>e.openModal);return{openModal:(e,n={},r)=>t(e,n,r),closeModal:Q(e=>e.closeModal),closeTopModal:Q(e=>e.closeTopModal),closeAllModals:Q(e=>e.closeAllModals),isOpen:t=>e.some(e=>e.name===t),count:e.length}},it={wrapper:`_wrapper_1qbyz_1`,container:`_container_1qbyz_15`,inner:`_inner_1qbyz_35`,cube:`_cube_1qbyz_53`,jump:`_jump_1qbyz_1`,cube__inner:`_cube__inner_1qbyz_67`,morph:`_morph_1qbyz_1`},at=()=>(0,e.jsx)(`div`,{className:it.wrapper,children:(0,e.jsx)(`div`,{className:it.container,children:(0,e.jsxs)(`div`,{className:it.inner,children:[(0,e.jsx)(`div`,{className:it.cube,children:(0,e.jsx)(`div`,{className:it.cube__inner})}),(0,e.jsx)(`div`,{className:it.cube,children:(0,e.jsx)(`div`,{className:it.cube__inner})}),(0,e.jsx)(`div`,{className:it.cube,children:(0,e.jsx)(`div`,{className:it.cube__inner})})]})})}),ot={viewport:`_viewport_15mi5_1`,"top-right":`_top-right_15mi5_3`,"top-left":`_top-left_15mi5_5`,"bottom-right":`_bottom-right_15mi5_7`,"bottom-left":`_bottom-left_15mi5_9`,toast:`_toast_15mi5_11`,body:`_body_15mi5_13`,icon:`_icon_15mi5_15`,info:`_info_15mi5_17`,success:`_success_15mi5_19`,warning:`_warning_15mi5_21`,error:`_error_15mi5_23`},st={info:{name:`IconInfoCircle`,color:`var(--color-primary)`},success:{name:`IconSuccessCircle`,color:`var(--color-success)`},warning:{name:`IconWarning`,color:`var(--color-warning)`},error:{name:`IconWarning`,color:`var(--color-error)`}},ct=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${ot.toast} ${ot[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{children:(0,e.jsx)(g,{...st[n.variant],width:24,height:24})}),(0,e.jsxs)(`div`,{className:ot.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]})},lt=0,ut=(0,i.create)(e=>({toasts:[],showToast:t=>{lt+=1;let n=`ds-toast-${lt}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),dt=()=>ut.setState({toasts:[]}),ft=({position:t=`top-right`})=>{let n=ut(e=>e.toasts),r=ut(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${ot.viewport} ${ot[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(ct,{toast:t,onClose:r},t.id))})},pt=()=>{let e=ut(e=>e.showToast),n=ut(e=>e.removeToast),r=ut(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},mt={root:`_root_s9o0g_1`,tooltip:`_tooltip_s9o0g_3`,"ds-tooltip-in":`_ds-tooltip-in_s9o0g_1`,top:`_top_s9o0g_5`,bottom:`_bottom_s9o0g_7`,left:`_left_s9o0g_9`,right:`_right_s9o0g_11`},ht=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${mt.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${mt.tooltip} ${mt[i]}`,style:{maxWidth:s},children:n})]})},gt=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},$={root:`_root_16v7i_1`,frame:`_frame_16v7i_18`,video:`_video_16v7i_33`,overlay:`_overlay_16v7i_40`,state:`_state_16v7i_41`,buffering:`_buffering_16v7i_42`,loaderViewport:`_loaderViewport_16v7i_72`,loaderScale:`_loaderScale_16v7i_78`,stateIcon:`_stateIcon_16v7i_85`,empty:`_empty_16v7i_101`,error:`_error_16v7i_106`,replay:`_replay_16v7i_112`,controlsLayer:`_controlsLayer_16v7i_130`,controlsVisible:`_controlsVisible_16v7i_143`,controls:`_controls_16v7i_130`,controlGroup:`_controlGroup_16v7i_155`,controlButton:`_controlButton_16v7i_168`,settingsAction:`_settingsAction_16v7i_184`,timeline:`_timeline_16v7i_193`,volume:`_volume_16v7i_194`,settings:`_settings_16v7i_184`,playButton:`_playButton_16v7i_201`,volumeGroup:`_volumeGroup_16v7i_208`,timelineGroup:`_timelineGroup_16v7i_220`,time:`_time_16v7i_193`,settingsActionLabel:`_settingsActionLabel_16v7i_339`,caption:`_caption_16v7i_345`,fullscreen:`_fullscreen_16v7i_352`},_t=2500,vt=5,yt=.05,bt=[.5,.75,1,1.25,1.5,2],xt=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:d,className:f=``,controls:p=!0,playsInline:m=!0,...h})=>{let _=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(void 0),[x,S]=(0,t.useState)(!1),[C,w]=(0,t.useState)(n.length>0),[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(!1),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(0),[N,P]=(0,t.useState)(0),[F,I]=(0,t.useState)(0),[L,R]=(0,t.useState)(1),[z,B]=(0,t.useState)(!!h.muted),[V,H]=(0,t.useState)(1),[U,W]=(0,t.useState)(!!h.loop),[G,K]=(0,t.useState)(-1),[q,ee]=(0,t.useState)(!1),[te,ne]=(0,t.useState)(!0),[J,re]=(0,t.useState)(!1),[ie,ae]=(0,t.useState)(!1),oe=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),se=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),ce=l??(x?`Не удалось воспроизвести видео`:void 0),le=s||C&&!ce&&n.length>0,ue=!le&&!ce&&n.length===0,de=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,fe=(0,t.useCallback)(()=>{ne(!0),window.clearTimeout(b.current),D&&!q&&(b.current=window.setTimeout(()=>ne(!1),_t))},[D,q]);(0,t.useEffect)(()=>{S(!1),w(n.length>0),E(!1),O(!1),A(!1),M(0),P(0),I(0)},[oe,n.length]),(0,t.useEffect)(()=>(fe(),()=>window.clearTimeout(b.current)),[fe]),(0,t.useEffect)(()=>{let e=()=>re(document.fullscreenElement===v.current),t=()=>ae(document.pictureInPictureElement===y.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!q)return;let e=e=>{_.current?.contains(e.target)||ee(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[q]);let pe=async()=>{let e=y.current;if(!(!e||ce||le)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{S(!0)}}else e.pause()}},me=()=>{let e=y.current;e&&(e.muted=!e.muted)},he=e=>{let t=y.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},ge=e=>{let t=y.current;!t||!N||(t.currentTime=Math.min(N,Math.max(0,e)),M(t.currentTime))},_e=async()=>{if(v.current)try{document.fullscreenElement?await document.exitFullscreen():await v.current.requestFullscreen()}catch{re(!1)}},ve=async()=>{let e=y.current;if(!(!e||!de))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{ae(!1)}},ye=e=>{let t=y.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),K(e))},Y=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),pe()):n===`m`?(e.preventDefault(),me()):n===`f`?(e.preventDefault(),_e()):n===`c`&&se.length?(e.preventDefault(),ye(G===-1?se[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),ge(j+(e.key===`ArrowRight`?vt:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),he(L+(e.key===`ArrowUp`?yt:-.05))):e.key===`Escape`&&ee(!1),fe()},be=()=>{let e=y.current;S(!1),w(!0),e?.load()},xe={"--video-progress":`${N?j/N*100:0}%`,"--video-buffered":`${F*100}%`};return(0,e.jsxs)(`figure`,{ref:_,className:`${$.root} ${f}`,onKeyDown:Y,children:[(0,e.jsxs)(`div`,{ref:v,className:`${$.frame} ${J?$.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":le||void 0,tabIndex:p&&n.length?0:void 0,onPointerMove:fe,onPointerDown:fe,onFocusCapture:fe,onMouseLeave:()=>{D&&!q&&ne(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:y,"aria-label":i,controls:!1,playsInline:m,loop:U,className:$.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),pe()},onDoubleClick:e=>{h.onDoubleClick?.(e),_e()},onLoadStart:e=>{w(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{P(e.currentTarget.duration||0);let t=se.find(({track:e})=>e.default);ye(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{P(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{M(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&I(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{w(!1),E(!1),h.onLoadedData?.(e)},onCanPlay:e=>{w(!1),E(!1),h.onCanPlay?.(e)},onWaiting:e=>{E(!0),h.onWaiting?.(e)},onPlaying:e=>{O(!0),A(!1),E(!1),h.onPlaying?.(e)},onPlay:e=>{O(!0),h.onPlay?.(e)},onPause:e=>{O(!1),h.onPause?.(e)},onEnded:e=>{O(!1),A(!0),ne(!0),h.onEnded?.(e)},onVolumeChange:e=>{R(e.currentTarget.volume),B(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{H(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{w(!1),E(!1),S(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),le&&(0,e.jsxs)(`div`,{className:$.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:$.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:$.loaderScale,children:(0,e.jsx)(at,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!le&&T&&!ce&&(0,e.jsx)(`div`,{className:$.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(c,{variant:`empty`})}),ue&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.empty}`,role:`status`,children:[(0,e.jsx)(g,{name:`IconInfoCircle`,className:$.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),d??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!le&&ce&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.error}`,role:`alert`,children:[(0,e.jsx)(g,{name:`IconWarning`,className:$.stateIcon,width:40,height:40}),d??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:ce})]}),n.length>0&&(0,e.jsx)(u,{size:`sm`,variant:`secondary`,onClick:be,children:`Повторить`})]}),!le&&!ce&&k&&(0,e.jsx)(`button`,{type:`button`,className:$.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void pe(),children:(0,e.jsx)(g,{name:`IconReplay`,width:28,height:28})}),p&&n.length>0&&!le&&!ce&&(0,e.jsxs)(`div`,{className:`${$.controlsLayer} ${te||!D?$.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[q&&(0,e.jsxs)(`div`,{className:$.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:V,onChange:e=>{let t=Number(e.target.value);y.current&&(y.current.playbackRate=t)},children:bt.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),se.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:G,onChange:e=>ye(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),se.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":U,onClick:()=>W(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:U?`Вкл.`:`Выкл.`})]}),de&&(0,e.jsx)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ie,onClick:()=>void ve(),children:(0,e.jsxs)(`span`,{className:$.settingsActionLabel,children:[(0,e.jsx)(g,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:$.controls,children:[(0,e.jsx)(`div`,{className:$.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${$.controlButton} ${$.playButton}`,"aria-label":D?`Пауза`:`Воспроизвести`,title:D?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void pe(),children:(0,e.jsx)(g,{name:D?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":z?`Включить звук`:`Выключить звук`,"aria-pressed":z,title:`Звук (M)`,onClick:me,children:(0,e.jsx)(g,{name:z||L===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:$.volume,type:`range`,min:0,max:1,step:.05,value:z?0:L,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((z?0:L)*100)}%`,onChange:e=>he(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:$.time,children:gt(j)}),(0,e.jsx)(`input`,{className:$.timeline,style:xe,type:`range`,min:0,max:N||0,step:.01,value:Math.min(j,N||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${gt(j)} из ${gt(N)}`,onChange:e=>ge(Number(e.target.value))}),(0,e.jsx)(`span`,{className:$.time,children:gt(N)})]}),(0,e.jsxs)(`div`,{className:$.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":`Настройки`,"aria-expanded":q,title:`Настройки`,onClick:()=>ee(e=>!e),children:(0,e.jsx)(g,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":J?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void _e(),children:(0,e.jsx)(g,{name:J?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})},St={root:`_root_1tdda_1`,trigger:`_trigger_1tdda_15`,heading:`_heading_1tdda_41`,title:`_title_1tdda_51`,subtitle:`_subtitle_1tdda_59`,icon:`_icon_1tdda_69`,open:`_open_1tdda_91`,content:`_content_1tdda_99`,contentInner:`_contentInner_1tdda_119`},Ct=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},wt=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=v.current;if(v.current=m,!m||e||!c)return;let t=h.current,n=_.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=Ct(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${St.root} ${m?St.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:St.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:St.heading,children:[(0,e.jsx)(`span`,{className:St.title,children:n}),r&&(0,e.jsx)(`span`,{className:St.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:St.icon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:_,id:d,className:St.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:St.contentInner,children:i})})]})},Tt=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null};exports.ConfirmModal=Ye,exports.DSAccordion=wt,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=v,exports.DSDataTable=ue,exports.DSDateRange=F,exports.DSDateTimePicker=M,exports.DSDropDown=W,exports.DSDropDownMultiple=he,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFileInput=Pe,exports.DSFilters=Ae,exports.DSIcon=g,exports.DSInfoBlock=Ee,exports.DSInput=_e,exports.DSLoader=c,exports.DSModal=Ue,exports.DSModalFrame=He,exports.DSPageLoader=at,exports.DSPortal=Tt,exports.DSRadioButton=Oe,exports.DSSearchDropDown=we,exports.DSSkeleton=L,exports.DSSort=K,exports.DSTextarea=Le,exports.DSToast=ct,exports.DSToastProvider=ft,exports.DSTooltip=ht,exports.DSVideoPlayerFrame=xt,exports.ErrorModal=Xe,exports.ModalSystemProvider=We,exports.builtInModalRegistry=Ze,exports.defineModalRegistry=Ge,exports.formatDateTimeLocalValue=w,exports.getDSAccordionScrollTarget=Ct,exports.getDSDataTablePaginationItems=te,exports.getErrorMessage=$e,exports.getNextEnabledOptionIndex=H,exports.isValidDateRange=P,exports.parseDateTimeLocalValue=T,exports.resetModalStore=ze,exports.resetToastStore=dt,exports.useConfirmModal=Qe,exports.useConfirmModalStore=tt,exports.useErrorModal=et,exports.useErrorModalStore=nt,exports.useModals=rt,exports.useModalsStore=Q,exports.useToast=pt,exports.useToastStore=ut,exports.validateDSDataTableData=ne;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_1pk53_1`,sm:`_sm_1pk53_3`,md:`_md_1pk53_5`,neutral:`_neutral_1pk53_7`,info:`_info_1pk53_9`,success:`_success_1pk53_11`,warning:`_warning_1pk53_13`,error:`_error_1pk53_15`,dot:`_dot_1pk53_17`,icon:`_icon_1pk53_19`,label:`_label_1pk53_21`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={container:`_container_1h2c4_1`,inner:`_inner_1h2c4_21`,line:`_line_1h2c4_39`,primary:`_primary_1h2c4_57`,secondary:`_secondary_1h2c4_65`,outline:`_outline_1h2c4_73`,ghost:`_ghost_1h2c4_81`,empty:`_empty_1h2c4_89`,destructive:`_destructive_1h2c4_97`,destructiveOutline:`_destructiveOutline_1h2c4_105`,grow:`_grow_1h2c4_1`},c=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${s.container} ${s[t]}`,children:(0,e.jsxs)(`div`,{className:`${s.inner} ${s[t]}`,children:[(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`})]})}),l={button:`_button_1gql6_1`,sm:`_sm_1gql6_43`,md:`_md_1gql6_55`,lg:`_lg_1gql6_67`,primary:`_primary_1gql6_79`,secondary:`_secondary_1gql6_91`,outline:`_outline_1gql6_103`,ghost:`_ghost_1gql6_115`,empty:`_empty_1gql6_127`,destructive:`_destructive_1gql6_139`,destructiveOutline:`_destructiveOutline_1gql6_147`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...u},d)=>(0,e.jsx)(`button`,{ref:d,className:`${l.button} ${l[n]} ${l[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...u,type:o,children:i?(0,e.jsx)(c,{variant:n}):t}));u.displayName=`DSButton`;var d={label:`_label_fa00b_1`,required:`_required_fa00b_23`,error:`_error_fa00b_25`,optional:`_optional_fa00b_33`,hint:`_hint_fa00b_35`,disabled:`_disabled_fa00b_47`,message:`_message_fa00b_55`,success:`_success_fa00b_71`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),h={IconBasket:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),IconCheck:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),IconChevron:t=>(0,e.jsx)(m,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),IconCross:({strokeWidth:t=2,...n})=>(0,e.jsx)(m,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),IconEdit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),IconErrorCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),IconEye:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),IconEyeOff:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),IconInfo:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),IconInfoCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),IconMinus:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),IconPause:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),IconPictureInPicture:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),IconPlay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),IconReplay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),IconSettings:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),IconFullscreen:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),IconFullscreenExit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),IconCaptions:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),IconVolume:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),IconVolumeMuted:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),IconSort:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),IconSortAscending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconSortDescending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),IconSuccessCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),IconUpload:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconWarning:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]})},g=({name:t,...n})=>{let r=h[t];return(0,e.jsx)(r,{...n})},_={wrapper:`_wrapper_1gq36_1`,label:`_label_1gq36_3`,input:`_input_1gq36_5`,control:`_control_1gq36_7`,disabled:`_disabled_1gq36_13`,controlError:`_controlError_1gq36_17`},v=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...m})=>{let h=(0,t.useId)(),v=d??`ds-checkbox-${u??h}`,y=(0,t.useRef)(null),b=a?`${v}-hint`:void 0,x=o?`${v}-error`:void 0;return(0,t.useEffect)(()=>{y.current&&(y.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${_.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${_.label} ${s?_.disabled:``}`,htmlFor:v,children:[(0,e.jsx)(`input`,{ref:y,id:v,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[b,x].filter(Boolean).join(` `)||void 0,className:_.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${_.control} ${o?_.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(g,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:b,children:a}),o&&(0,e.jsx)(p,{id:x,variant:`error`,children:o})]})},y={wrapper:`_wrapper_1kcfm_1`,trigger:`_trigger_1kcfm_17`,lg:`_lg_1kcfm_51`,chevron:`_chevron_1kcfm_63`,chevronOpen:`_chevronOpen_1kcfm_89`,nav:`_nav_1kcfm_99`,day:`_day_1kcfm_101`,monthSelect:`_monthSelect_1kcfm_103`,yearInput:`_yearInput_1kcfm_105`,timeInput:`_timeInput_1kcfm_107`,value:`_value_1kcfm_131`,placeholder:`_placeholder_1kcfm_139`,error:`_error_1kcfm_147`,panel:`_panel_1kcfm_155`,calendarHeader:`_calendarHeader_1kcfm_181`,weekdays:`_weekdays_1kcfm_271`,days:`_days_1kcfm_273`,outside:`_outside_1kcfm_309`,selected:`_selected_1kcfm_317`,timeLabel:`_timeLabel_1kcfm_337`,previousMonth:`_previousMonth_1kcfm_385`,nextMonth:`_nextMonth_1kcfm_393`},b=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],x=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],S=e=>String(e).padStart(2,`0`),C=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),w=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${S(e.getMonth()+1)}-${S(e.getDate())}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},T=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},E=(e,t)=>{if(!e)return``;let n=`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},D=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},O=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),k=(e,t,n)=>{let r=C(e).getTime();return!!(t&&r<C(t).getTime()||n&&r>C(n).getTime())},A=8,j=6,M=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:m=!1,min:h,max:_,size:v=`md`,id:S,name:C,className:M=``})=>{let N=(0,t.useId)(),P=S??`ds-date-time-${C??N}`,F=c?`${P}-hint`:void 0,I=l?`${P}-error`:void 0,L=(0,t.useRef)(null),R=(0,t.useRef)(null),z=(0,t.useRef)(null),[B,V]=(0,t.useState)(!1),[H,U]=(0,t.useState)(r??new Date),[W,G]=(0,t.useState)(w(r,`time`)),[K,q]=(0,t.useState)(null),ee=(0,t.useMemo)(()=>D(H),[H]),te=a!==`time`,ne=a!==`date`;(0,t.useEffect)(()=>{r&&U(r),G(w(r,`time`))},[r]);let J=(0,t.useCallback)(()=>{let e=R.current,t=z.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-A,o=n.top-A,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(A,n.top-r.height-j):n.bottom+j,u=n.left,d=i-r.width-A;q({top:l,left:Math.max(A,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!B){q(null);return}return J(),window.addEventListener(`resize`,J),window.addEventListener(`scroll`,J,!0),()=>{window.removeEventListener(`resize`,J),window.removeEventListener(`scroll`,J,!0)}},[B,J,H,W]),(0,t.useEffect)(()=>{if(!B)return;let e=e=>{let t=e.target,n=L.current?.contains(t),r=z.current?.contains(t);!n&&!r&&V(!1)},t=e=>{e.key===`Escape`&&(V(!1),R.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[B]);let re=e=>{if(k(e,h,_))return;let t=a===`date`?T(w(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),a===`date`&&V(!1))},ie=e=>{if(G(e),!e){i?.(null);return}let t=T(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??H:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(h&&n<h||_&&n>_)&&i?.(n)},ae=s??(a===`date`?`--.--.----`:a===`time`?`--:--`:`--.--.---- --:--`),oe=[F,I].filter(Boolean).join(` `)||void 0,se=B&&!d?(0,e.jsxs)(`div`,{ref:z,className:y.panel,role:`dialog`,"aria-label":o??ae,style:K?{top:K.top,left:K.left,maxHeight:K.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[te&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:y.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Предыдущий месяц`,onClick:()=>U(new Date(H.getFullYear(),H.getMonth()-1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.previousMonth})}),(0,e.jsx)(`select`,{className:y.monthSelect,"aria-label":`Месяц`,value:H.getMonth(),onChange:e=>U(new Date(H.getFullYear(),Number(e.target.value),1)),children:x.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:y.yearInput,type:`number`,"aria-label":`Год`,value:H.getFullYear(),onChange:e=>U(new Date(Number(e.target.value),H.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Следующий месяц`,onClick:()=>U(new Date(H.getFullYear(),H.getMonth()+1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.nextMonth})})]}),(0,e.jsx)(`div`,{className:y.weekdays,children:b.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:y.days,children:ee.map(t=>{let n=O(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${y.day} ${t.getMonth()===H.getMonth()?``:y.outside} ${n?y.selected:``}`,disabled:k(t,h,_),"aria-pressed":n,onClick:()=>re(t),children:t.getDate()},t.toISOString())})})]}),ne&&(0,e.jsxs)(`label`,{className:y.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:y.timeInput,type:`time`,value:W,onChange:e=>ie(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:L,className:`${y.wrapper} ${M}`,children:[o&&(0,e.jsx)(f,{htmlFor:P,required:m,disabled:u,children:o}),(0,e.jsxs)(`button`,{ref:R,id:P,name:C,type:`button`,className:`${y.trigger} ${y[v]} ${l?y.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":B,"aria-haspopup":`dialog`,"aria-describedby":oe,onClick:()=>{d||V(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?y.value:y.placeholder,children:E(r,a)||ae}),(0,e.jsx)(`span`,{className:[y.chevron,se?y.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),se&&(0,n.createPortal)(se,document.body),c&&!l&&(0,e.jsx)(p,{id:F,children:c}),l&&(0,e.jsx)(p,{id:I,variant:`error`,children:l})]})},N={root:`_root_q0cvp_1`,range:`_range_q0cvp_3`},P=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),F=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),P(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${N.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:N.range,children:[(0,e.jsx)(M,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(M,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},I={group:`_group_1fs9e_1`,skeleton:`_skeleton_1fs9e_3`,text:`_text_1fs9e_5`,rectangular:`_rectangular_1fs9e_7`,circular:`_circular_1fs9e_9`,animated:`_animated_1fs9e_11`,"ds-skeleton":`_ds-skeleton_1fs9e_1`},L=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${I.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${I.skeleton} ${I[t]} ${a?I.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),R={wrapper:`_wrapper_2x315_1`,container:`_container_2x315_17`,trigger:`_trigger_2x315_25`,disabledText:`_disabledText_2x315_27`,sm:`_sm_2x315_49`,md:`_md_2x315_59`,lg:`_lg_2x315_71`,value:`_value_2x315_131`,placeholder:`_placeholder_2x315_133`,chevron:`_chevron_2x315_189`,chevronOpen:`_chevronOpen_2x315_215`,menu:`_menu_2x315_223`,option:`_option_2x315_253`,selected:`_selected_2x315_323`,message:`_message_2x315_343`,error:`_error_2x315_345`,errorState:`_errorState_2x315_371`},z=8,B=6,V=120,H=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},U=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},W=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:p,className:m=``,required:h=!1,name:_,id:v,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=v??`ds-dropdown-${_??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,F=[N,P].filter(Boolean).join(` `)||void 0,I=s&&c,L=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-z,o=n.top-z,s=a<r.height&&o>a,c=Math.max(V,s?o:a),l=U(b),u=Math.min(c,l),d=n.left,f=i-n.width-z,p=Math.max(z,Math.min(d,f)),m=s?Math.max(z,n.top-r.height-B):n.bottom+B;D({top:m,left:p,width:n.width,maxHeight:u})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return L(),window.addEventListener(`resize`,L),window.addEventListener(`scroll`,L,!0),()=>{window.removeEventListener(`resize`,L),window.removeEventListener(`scroll`,L,!0)}},[w,L,r.length]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target,n=O.current?.contains(t),r=A.current?.contains(t);!n&&!r&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let W=(e,t)=>{let n=H(r,e,t);if(n===-1)return;let i=j.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},G=e=>{e.disabled||(a?.(e.value,e),T(!1),k.current?.focus())},K=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:R.menu,role:`listbox`,"aria-label":l,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[R[d],R.option,a?R.selected:``].filter(Boolean).join(` `),onClick:()=>G(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;W(n+t,t)}if(e.key===`Tab`&&T(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;W(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),G(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[R.wrapper,u?R.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{required:h,disabled:s,htmlFor:I?void 0:S,children:l}),(0,e.jsx)(`div`,{className:R.container,children:I?(0,e.jsx)(`div`,{id:S,className:R.disabledText,"aria-describedby":F,children:M?.label??o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:_,className:`${R.trigger} ${R[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":F,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{W(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&w){e.preventDefault();let t=r.findIndex(e=>e.value===i);W(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${M?R.value:R.placeholder}
|
|
2
|
+
${R[d]}`,children:M?.label??o}),(0,e.jsx)(`span`,{className:[R.chevron,w?R.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(K,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:R.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:R.error,children:u})]})},G=e=>`${e.id}:${e.direction}`,K=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:G({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:G({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(W,{options:c,value:n?G(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},q={root:`_root_l2civ_1`,tableWrap:`_tableWrap_l2civ_3`,table:`_table_l2civ_3`,sticky:`_sticky_l2civ_15`,sortButton:`_sortButton_l2civ_17`,state:`_state_l2civ_21`,cards:`_cards_l2civ_23`,mobileSort:`_mobileSort_l2civ_23`,card:`_card_l2civ_23`,spanTwo:`_spanTwo_l2civ_37`,clickableRow:`_clickableRow_l2civ_41`,pagination:`_pagination_l2civ_49`,paginationRange:`_paginationRange_l2civ_75`,paginationControls:`_paginationControls_l2civ_87`,pageNumbers:`_pageNumbers_l2civ_89`,pageButton:`_pageButton_l2civ_101`,ellipsis:`_ellipsis_l2civ_111`,previousIcon:`_previousIcon_l2civ_123`,nextIcon:`_nextIcon_l2civ_131`,default:`_default_l2civ_169`,tableOnMobile:`_tableOnMobile_l2civ_169`,wide:`_wide_l2civ_173`},ee=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),te=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],ne=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},J=(e,t)=>typeof e==`function`?e(t):t[e],re=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},ie=(e,t,n)=>{let r=re(e.getValue(n)),i=re(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},ae=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},oe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},se=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},ce=e=>{switch(e){case`date`:return ie;case`number`:return ae;case`boolean`:return oe;case`text`:case void 0:return se;case`custom`:return}},le=e=>{let t=t=>J(e.accessor,t),n=e.sortFn??ce(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},ue=({columns:n,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:d,caption:f,ariaLabel:p,loading:m=!1,error:h,emptyState:_=`Нет данных`,stickyHeader:v=!1,maxHeight:y,className:b=``,onRowClick:x,pagination:S=!1,pageSize:C=30,visibleColumnIds:w})=>{let[T,E]=(0,t.useState)([]),[D,O]=(0,t.useState)(0),k=s??T,A=k.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),j=Number.isFinite(C)&&C>0?Math.floor(C):30,M=(0,t.useMemo)(()=>{if(w===void 0)return n;let e=new Set(w);return n.filter(t=>e.has(t.id))},[n,w]),N=(0,t.useMemo)(()=>M.length===0?`Должна быть видима хотя бы одна колонка`:ne(M,i),[i,M]),P=(0,t.useMemo)(()=>M.map(le),[M]),F=(0,r.useTable)({features:ee,columns:P,data:i,state:{sorting:k},onSortingChange:e=>{let t=typeof e==`function`?e(k):e;s===void 0&&E(t),O(0),c?.(t)},getRowId:d}),I=F.getRowModel().rows,R=S?Math.max(1,Math.ceil(I.length/j)):1,z=Math.min(D,R-1),B=(0,t.useMemo)(()=>S?I.slice(z*j,(z+1)*j):I,[j,S,z,I]),V=(0,t.useMemo)(()=>M.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[M]),H=(0,t.useMemo)(()=>te(z,R),[R,z]),U=[q.root,o===`wide`?q.wide:q.default,a?q.tableOnMobile:``,b].filter(Boolean).join(` `),W=N??h,G=S&&!m&&!W&&I.length>j,re=z*j+1,ie=Math.min((z+1)*j,I.length);return(0,t.useEffect)(()=>{O(0)},[i,j,S,A]),(0,t.useEffect)(()=>{D>=R&&O(R-1)},[R,D]),(0,e.jsxs)(`section`,{className:U,"aria-busy":m,children:[!a&&!m&&!W&&B.length>0&&V.length>0&&(0,e.jsx)(K,{className:q.mobileSort,options:V,value:k[0]?{id:k[0].id,direction:k[0].desc?`desc`:`asc`}:null,onChange:e=>F.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:q.tableWrap,style:{maxHeight:y},children:(0,e.jsxs)(`table`,{className:q.table,"aria-label":p,children:[f&&(0,e.jsx)(`caption`,{children:f}),(0,e.jsx)(`thead`,{className:v?q.sticky:``,children:F.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,children:(0,e.jsxs)(`button`,{type:`button`,className:q.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(F.FlexRender,{header:t}),(0,e.jsx)(g,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:m?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:M.length,children:(0,e.jsx)(L,{lines:3})})}):W?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:q.state,colSpan:M.length,children:W})}):B.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:q.state,colSpan:M.length,children:_})}):B.map(t=>(0,e.jsx)(`tr`,{className:x?q.clickableRow:void 0,onClick:()=>x?.(t.original),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x?.(t.original))},tabIndex:x?0:void 0,role:x?`button`:void 0,children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{children:(0,e.jsx)(F.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:q.cards,role:`list`,"aria-label":p??f,children:m?(0,e.jsx)(L,{lines:4}):W?(0,e.jsx)(`div`,{className:q.state,children:W}):B.length===0?(0,e.jsx)(`div`,{className:q.state,children:_}):B.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:M})},t.id);let n=M.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),r=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),i=e=>J(e.accessor,t.original),a=e=>e.mobile?.renderMobile?.(t.original,i(e))??e.cell?.(t.original,i(e))??String(i(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:q.card,children:[(0,e.jsx)(`h3`,{children:r?a(r):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==r&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?q.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:a(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:a(t)},t.id))]},t.id)})}),G&&(0,e.jsxs)(`nav`,{className:q.pagination,"aria-label":`Пагинация таблицы`,children:[(0,e.jsxs)(`span`,{className:q.paginationRange,"aria-live":`polite`,children:[re,`–`,ie,` из `,I.length]}),(0,e.jsxs)(`div`,{className:q.paginationControls,children:[(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===0,"aria-label":`Предыдущая страница`,onClick:()=>{O(e=>Math.max(0,e-1))},children:[(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:q.previousIcon}),(0,e.jsx)(`span`,{className:q.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:q.pageNumbers,children:H.map(t=>typeof t==`number`?(0,e.jsx)(u,{variant:t===z?`secondary`:`empty`,size:`md`,className:q.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===z?`page`:void 0,onClick:()=>{O(t)},children:t+1},t):(0,e.jsx)(`span`,{className:q.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===R-1,"aria-label":`Следующая страница`,onClick:()=>{O(e=>Math.min(R-1,e+1))},children:[(0,e.jsx)(`span`,{className:q.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:q.nextIcon})]})]})]})]})},de=8,fe=6,pe=120,me=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},he=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:p=!1,hint:m,className:h=``,name:_,id:v,closeOnSelect:y=!1,needMark:b=!0,maxMenuHeight:x})=>{let S=(0,t.useId)(),C=v??`ds-dropdown-multiple-${_??S}`,w=`${C}-listbox`,[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),N=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),P=m?`${C}-hint`:void 0,F=u?`${C}-error`:void 0,I=[P,F].filter(Boolean).join(` `)||void 0,L=s&&c,z=(0,t.useCallback)(()=>{let e=A.current,t=j.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-de,a=n.top-de,o=i<r.height&&a>i,s=Math.max(pe,o?a:i),c=window.innerWidth-n.width-de;O({top:o?Math.max(de,n.top-r.height-fe):n.bottom+fe,left:Math.max(de,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,me(x))})},[x]);(0,t.useLayoutEffect)(()=>{if(!T){O(null);return}return z(),window.addEventListener(`resize`,z),window.addEventListener(`scroll`,z,!0),()=>{window.removeEventListener(`resize`,z),window.removeEventListener(`scroll`,z,!0)}},[T,r.length,z]),(0,t.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&E(!1)},t=e=>{e.key===`Escape`&&(E(!1),A.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]);let B=(e,t)=>{let n=H(r,e,t);n!==-1&&(M.current[n]?.focus(),M.current[n]?.scrollIntoView({block:`nearest`}))},V=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),y&&(E(!1),A.current?.focus())},U=T?(0,e.jsx)(`ul`,{ref:j,id:w,className:R.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:D?{position:`fixed`,top:D.top,left:D.left,width:D.width,maxHeight:D.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[R[d],R.option,a?R.selected:``].filter(Boolean).join(` `),onClick:()=>V(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;B(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;B(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),V(t)),e.key===`Tab`&&E(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&b&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[R.wrapper,u?R.errorState:``,h].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{htmlFor:L?void 0:C,required:p,disabled:s,children:l}),(0,e.jsx)(`div`,{className:R.container,children:L?(0,e.jsx)(`div`,{id:C,className:`${R.disabledText} ${R[d]}`,"aria-describedby":I,children:N||o}):(0,e.jsxs)(`button`,{ref:A,id:C,type:`button`,name:_,className:`${R.trigger} ${R[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":T,"aria-controls":w,"aria-describedby":I,"aria-invalid":!!u,onClick:()=>E(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),E(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>B(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${N?R.value:R.placeholder} ${R[d]}`,children:N||o}),(0,e.jsx)(`span`,{className:[R.chevron,T?R.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),T&&(0,n.createPortal)(U,document.body),m&&!u&&(0,e.jsx)(`span`,{id:P,className:R.message,children:m}),u&&(0,e.jsx)(`span`,{id:F,className:R.error,children:u})]})},ge={wrapper:`_wrapper_yuep3_1`,control:`_control_yuep3_3`,input:`_input_yuep3_7`,disabledText:`_disabledText_yuep3_7`,sm:`_sm_yuep3_45`,md:`_md_yuep3_57`,lg:`_lg_yuep3_69`,inputError:`_inputError_yuep3_81`,trailingAction:`_trailingAction_yuep3_83`},_e=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:_,size:v=`md`,clearable:y=!0,required:b=!1,selectTextOnFocus:x=!1,isPassword:S=!1,passwordVisibleLabel:C=`Скрыть пароль`,passwordHiddenLabel:w=`Показать пароль`,onFocus:T,...E})=>{let D=(0,t.useId)(),O=_??`ds-input-${h??D}`,k=(0,t.useRef)(null),[A,j]=(0,t.useState)(!1),M=d?`${O}-hint`:void 0,N=u?`${O}-error`:void 0,P=String(n??``),F=[M,N].filter(Boolean).join(` `)||void 0,I=S?A?`text`:`password`:i;return(0,t.useEffect)(()=>{S||j(!1)},[S]),(0,e.jsxs)(`div`,{className:`${ge.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:O,required:b,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:O,className:ge.disabledText,"aria-describedby":F,children:P||a}):(0,e.jsxs)(`div`,{className:ge.control,children:[(0,e.jsx)(`input`,{ref:k,id:O,name:h,type:I,value:P,placeholder:a,disabled:o,readOnly:s,required:b,"aria-invalid":!!u,"aria-describedby":F,className:`${ge.input} ${ge[v]} ${u?ge.inputError:``}`,onChange:e=>{if(i===`number`&&!S){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{x&&e.currentTarget.value&&e.currentTarget.select(),T?.(e)},...E}),S&&(0,e.jsx)(`button`,{type:`button`,className:ge.trailingAction,disabled:o,"aria-label":A?C:w,"aria-pressed":A,onClick:()=>j(e=>!e),children:(0,e.jsx)(g,{name:A?`IconEyeOff`:`IconEye`,width:20,height:20})}),!S&&y&&P&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:ge.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=k.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(p,{id:M,children:d}),u&&(0,e.jsx)(p,{id:N,variant:`error`,children:u})]})},ve=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},ye=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},Y={wrapper:`_wrapper_1uxs8_1`,control:`_control_1uxs8_5`,inputHost:`_inputHost_1uxs8_9`,sm:`_sm_1uxs8_25`,md:`_md_1uxs8_35`,lg:`_lg_1uxs8_43`,errorState:`_errorState_1uxs8_57`,disabledText:`_disabledText_1uxs8_65`,chevron:`_chevron_1uxs8_105`,chevronOpen:`_chevronOpen_1uxs8_129`,menu:`_menu_1uxs8_133`,option:`_option_1uxs8_161`,empty:`_empty_1uxs8_161`,selected:`_selected_1uxs8_205`,active:`_active_1uxs8_205`,visuallyHidden:`_visuallyHidden_1uxs8_217`},be=8,xe=6,Se=5,Ce={sm:20,md:30,lg:40},we=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:m,hint:h,size:_=`md`,required:v=!1,className:y=``,name:b,id:x,needMark:S=!0})=>{let C=(0,t.useId)(),w=x??`ds-search-dropdown-${b??C}`,T=`${w}-listbox`,E=`${w}-status`,D=h?`${w}-hint`:void 0,O=m?`${w}-error`:void 0,k=[E,D,O].filter(Boolean).join(` `),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),[N,P]=(0,t.useState)(!1),[F,I]=(0,t.useState)(``),[L,R]=(0,t.useState)(-1),[z,B]=(0,t.useState)(null),V=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),H=(0,t.useMemo)(()=>ve(r,F),[r,F]),U=c&&u,W=L>=0?H[L]:void 0;(0,t.useEffect)(()=>I(V?.label??``),[V?.label,i]);let G=(0,t.useCallback)(()=>A.current?.querySelector(`input`)??null,[]),K=(0,t.useCallback)((e,t)=>ye(H,e,t),[H]),q=(0,t.useCallback)(e=>{R(e),!(e<0)&&requestAnimationFrame(()=>M.current[e]?.scrollIntoView({block:`nearest`}))},[]),ee=(0,t.useCallback)(()=>{let e=G();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(H.length,Se))*Ce[_]+2,r=window.innerHeight-t.bottom-be,i=t.top-be,a=r<n&&i>r,o=a?i:r,s=Math.max(Ce[_]+2,Math.min(n,o)),c=window.innerWidth-t.width-be,l=Math.max(be,Math.min(t.left,c)),u=a?Math.max(be,t.top-s-xe):t.bottom+xe;B({top:u,left:l,width:t.width,maxHeight:s})},[H.length,G,_]);(0,t.useLayoutEffect)(()=>{if(!N){B(null);return}return ee(),window.addEventListener(`resize`,ee),window.addEventListener(`scroll`,ee,!0),()=>{window.removeEventListener(`resize`,ee),window.removeEventListener(`scroll`,ee,!0)}},[N,ee]),(0,t.useEffect)(()=>{if(!N)return;let e=e=>{let t=e.target;!A.current?.contains(t)&&!j.current?.contains(t)&&(P(!1),R(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[N]);let te=()=>{c||l||(P(!0),R(K(0,1)))},ne=e=>{e.disabled||(I(e.label),P(!1),R(-1),a?.(e.value,e),G()?.focus())},J=N?(0,e.jsx)(`ul`,{ref:j,id:T,className:Y.menu,role:`listbox`,"aria-label":d,style:z?{top:z.top,left:z.left,width:z.width,maxHeight:z.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:H.length===0?(0,e.jsx)(`li`,{className:`${Y.empty} ${Y[_]}`,children:s}):H.map((t,n)=>{let r=t.value===i,a=n===L;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},id:`${w}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,className:[Y.option,Y[_],r?Y.selected:``,a?Y.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||R(n)},onClick:()=>ne(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&S&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:A,className:[Y.wrapper,m?Y.errorState:``,y].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(f,{htmlFor:U?void 0:w,required:v,disabled:c,children:d}),U?(0,e.jsx)(`div`,{className:`${Y.disabledText} ${Y[_]}`,children:V?.label??o}):(0,e.jsxs)(`div`,{className:Y.control,children:[(0,e.jsx)(_e,{id:w,name:b,value:F,placeholder:o,disabled:c,readOnly:l,required:v,size:_,clearable:!1,autoComplete:`off`,className:`${Y.inputHost} ${Y[_]}`,onFocus:te,onChange:e=>{let t=String(e),n=ve(r,t);I(t),P(!0),R(ye(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":T,"aria-activedescendant":W?`${w}-option-${L}`:void 0,"aria-invalid":!!m,"aria-describedby":k,onClick:te,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=L>=0?L+t:t===1?0:H.length-1;P(!0),q(K(n,t))}else if(e.key===`Home`||e.key===`End`){if(!N)return;e.preventDefault();let t=e.key===`Home`?1:-1;q(K(e.key===`Home`?0:H.length-1,t))}else e.key===`Enter`&&N&&W?(e.preventDefault(),ne(W)):e.key===`Escape`&&N?(e.preventDefault(),P(!1),R(-1)):e.key===`Tab`&&(P(!1),R(-1))}}}),(0,e.jsx)(`span`,{className:`${Y.chevron} ${N?Y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),N&&typeof document<`u`&&(0,n.createPortal)(J,document.body),(0,e.jsxs)(`span`,{id:E,className:Y.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,H.length]}),h&&!m&&(0,e.jsx)(p,{id:D,children:h}),m&&(0,e.jsx)(p,{id:O,variant:`error`,children:m})]})},Te={root:`_root_1gjqg_1`,header:`_header_1gjqg_21`,title:`_title_1gjqg_41`,dismiss:`_dismiss_1gjqg_55`,content:`_content_1gjqg_65`},Ee=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Te.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Te.header,children:[(0,e.jsx)(s,{id:l,className:Te.title,children:n}),i&&(0,e.jsx)(u,{className:Te.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Te.content,children:r})]})},De={wrapper:`_wrapper_ecmvo_1`,input:`_input_ecmvo_21`,switch:`_switch_ecmvo_35`,thumb:`_thumb_ecmvo_67`,label:`_label_ecmvo_113`,disabled:`_disabled_ecmvo_125`},Oe=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${De.wrapper} ${a?De.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:De.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:De.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:De.thumb})}),i&&(0,e.jsx)(`span`,{className:De.label,children:i})]})},ke={root:`_root_13nj5_1`,grid:`_grid_13nj5_3`,actions:`_actions_13nj5_5`},Ae=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${ke.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:ke.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(_e,{...n,type:`number`,value:i??``,onChange:e=>d(t.id,e)},t.id):(0,e.jsx)(_e,{...n,type:`text`,value:String(i??``),onChange:e=>d(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(W,{size:`lg`,label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(he,{size:`lg`,label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(v,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(Oe,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(F,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:ke.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},X={wrapper:`_wrapper_8w6xl_1`,dropzone:`_dropzone_8w6xl_3`,dragActive:`_dragActive_8w6xl_5`,disabled:`_disabled_8w6xl_7`,error:`_error_8w6xl_9`,nativeInput:`_nativeInput_8w6xl_11`,empty:`_empty_8w6xl_13`,uploadIcon:`_uploadIcon_8w6xl_15`,files:`_files_8w6xl_17`,file:`_file_8w6xl_17`,fileName:`_fileName_8w6xl_21`,fileSize:`_fileSize_8w6xl_23`},je=e=>`${e.name}:${e.size}:${e.lastModified}`,Me=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Ne=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),Pe=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:d,required:m=!1,disabled:h=!1,readOnly:_=!1,name:v,id:y,className:b=``,dropLabel:x=`Перетащите файлы в эту область`,browseLabel:S=`Выбрать файлы`,addMoreLabel:C=`Добавить ещё`,onReject:w})=>{let T=(0,t.useId)(),E=y??`ds-file-input-${v??T}`,D=(0,t.useRef)(null),O=(0,t.useRef)(0),[k,A]=(0,t.useState)(!1),j=l?`${E}-hint`:void 0,M=d?`${E}-error`:void 0,N=[j,M].filter(Boolean).join(` `)||void 0,P=!h&&!_,F=e=>{let t=[],c=new Set(n.map(je)),l=e.filter(e=>Ne(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(je(e))&&(c.add(je(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&w?.(t),l.length&&r?.(d),D.current&&(D.current.value=``)};return(0,e.jsxs)(`div`,{className:`${X.wrapper} ${b}`,children:[c&&(0,e.jsx)(f,{htmlFor:E,required:m,disabled:h,children:c}),(0,e.jsxs)(`div`,{className:`${X.dropzone} ${k?X.dragActive:``} ${h?X.disabled:``} ${d?X.error:``}`,onDragEnter:e=>{e.preventDefault(),P&&++O.current===1&&A(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--O.current<=0&&(O.current=0,A(!1))},onDrop:e=>{e.preventDefault(),O.current=0,A(!1),P&&F(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:D,id:E,name:v,className:X.nativeInput,type:`file`,multiple:i,accept:a,required:m&&n.length===0,disabled:!P,"aria-describedby":N,"aria-invalid":!!d,onChange:e=>F(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:X.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:X.file,children:[(0,e.jsx)(`span`,{className:X.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:X.fileSize,children:Me(t.size)}),P&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(g,{name:`IconCross`,width:16,height:16})})]},je(t)))}),P&&(i||n.length===0)&&(0,e.jsx)(u,{className:X.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:C}),P&&!i&&(0,e.jsx)(u,{className:X.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:S})]}):(0,e.jsxs)(`div`,{className:X.empty,children:[(0,e.jsx)(`span`,{className:X.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:k?`Отпустите файлы здесь`:x}),!k&&P&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(u,{onClick:()=>D.current?.click(),children:S})]})]})]}),l&&!d&&(0,e.jsx)(p,{id:j,children:l}),d&&(0,e.jsx)(p,{id:M,variant:`error`,live:!0,children:d})]})},Z={wrapper:`_wrapper_1bwdq_1`,control:`_control_1bwdq_15`,textarea:`_textarea_1bwdq_25`,disabledText:`_disabledText_1bwdq_27`,sm:`_sm_1bwdq_103`,md:`_md_1bwdq_117`,lg:`_lg_1bwdq_131`,autoResize:`_autoResize_1bwdq_145`,manualResize:`_manualResize_1bwdq_155`,textareaError:`_textareaError_1bwdq_163`,clearAction:`_clearAction_1bwdq_171`,messages:`_messages_1bwdq_251`,counter:`_counter_1bwdq_265`},Fe=2;function Ie(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function Le({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:m,id:h,size:_=`md`,clearable:v=!1,required:y=!1,maxLength:b,showCount:x=!1,minRows:S=Fe,maxRows:C,autoResize:w=!0,...T}){let E=(0,t.useId)(),D=h??`ds-textarea-${m??E}`,O=(0,t.useRef)(null),k=u?`${D}-hint`:void 0,A=l?`${D}-error`:void 0,j=x&&b?`${D}-count`:void 0,M=[k,A,j].filter(Boolean).join(` `)||void 0,N=Math.max(1,S),P=C===void 0?void 0:Math.max(N,C),F=(0,t.useCallback)(()=>{let e=O.current;if(!e||!w)return;let t=window.getComputedStyle(e),n=Ie(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*N+r,a=P===void 0?1/0:n*P+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[w,P,N]);(0,t.useEffect)(()=>{F()},[F,n]),(0,t.useEffect)(()=>{if(!w)return;window.addEventListener(`resize`,F);let e=O.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,F())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,F),t?.disconnect()}},[w,F]);let I=e=>{r?.(e.target.value,e),F()},L=()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),F())},R={"--ds-textarea-min-rows":N};return(0,e.jsxs)(`div`,{className:`${Z.wrapper} ${d}`,children:[c&&(0,e.jsx)(f,{htmlFor:D,required:y,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:D,className:`${Z.disabledText} ${Z[_]}`,style:R,"aria-describedby":M,children:n||i}):(0,e.jsxs)(`div`,{className:Z.control,children:[(0,e.jsx)(`textarea`,{ref:O,id:D,name:m,value:n,placeholder:i,disabled:a,readOnly:o,required:y,maxLength:b,rows:N,style:R,"aria-invalid":!!l,"aria-describedby":M,className:`${Z.textarea} ${Z[_]} ${w?Z.autoResize:Z.manualResize} ${l?Z.textareaError:``}`,onChange:I,...T}),v&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:Z.clearAction,"aria-label":`Очистить поле`,onClick:L,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(u||l||j)&&(0,e.jsxs)(`div`,{className:Z.messages,children:[u&&!l&&(0,e.jsx)(p,{id:k,children:u}),l&&(0,e.jsx)(p,{id:A,variant:`error`,children:l}),j&&(0,e.jsxs)(`span`,{id:j,className:Z.counter,children:[n.length,` / `,b]})]})]})}var Re=0,Q=(0,i.create)((e,t)=>({modals:[],openModal:(t,n={},r={})=>{Re+=1;let i=`ds-modal-${Re}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,title:r.title,description:r.description,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0,onClose:r.onClose}]})),i},closeModal:n=>{let r=t().modals.find(e=>e.id===n);r&&(e(e=>({modals:e.modals.filter(e=>e.id!==n)})),r.onClose?.())},closeTopModal:()=>{let n=t().modals.at(-1);n&&(e(e=>({modals:e.modals.slice(0,-1)})),n.onClose?.())},closeAllModals:()=>{let n=t().modals;n.length&&(e({modals:[]}),n.forEach(e=>e.onClose?.()))}})),ze=()=>{Q.getState().closeAllModals(),Re=0},Be={layer:`_layer_d4mga_1`,backdrop:`_backdrop_d4mga_3`,panel:`_panel_d4mga_5`,header:`_header_d4mga_9`,title:`_title_d4mga_11`,description:`_description_d4mga_13`,content:`_content_d4mga_15`,close:`_close_d4mga_19`},Ve=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,He=(0,t.createContext)({});function Ue(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(Ve));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}var We=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useContext)(He),d=r??l.title,f=i??l.description,p=(0,t.useId)(),m=(0,t.useId)(),h=(0,t.useRef)(null),_=Q(e=>e.closeModal),v=d!=null,y=f!=null;return(0,t.useEffect)(()=>{let e=document.activeElement,t=h.current;return(t?.querySelector(Ve)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:h,className:`${Be.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":v?p:void 0,"aria-describedby":y?m:void 0,tabIndex:-1,onKeyDown:Ue,children:[(v||o)&&(0,e.jsxs)(`header`,{className:Be.header,children:[v&&(0,e.jsx)(`h2`,{id:p,className:Be.title,children:d}),(0,e.jsx)(u,{className:Be.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:()=>_(a),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]}),y&&(0,e.jsx)(`p`,{id:m,className:Be.description,children:f}),(0,e.jsx)(`div`,{className:Be.content,children:n})]})},Ge=({registry:r})=>{let i=Q(e=>e.modals),a=Q(e=>e.closeModal),o=Q(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=Q.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),(0,t.useEffect)(()=>{i.forEach(e=>{r[e.name]||a(e.id)})},[a,i,r]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:Be.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let s=r[t.name];return s?(0,e.jsx)(`div`,{className:Be.backdrop,"aria-hidden":n!==i.length-1||void 0,inert:n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(He.Provider,{value:{title:t.title??t.payload.title,description:t.description??t.payload.description},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})})},t.id):null})}),document.body)},Ke=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=Q(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(Ge,{registry:n})]})},qe=e=>e,Je={message:`_message_1vtru_1`,actions:`_actions_1vtru_3`},Ye=new Map,Xe=0,Ze=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{Ye.get(c)?.(e),Ye.delete(c),n()};return(0,e.jsxs)(We,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Je.message,children:i}),(0,e.jsxs)(`div`,{className:Je.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},Qe=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(We,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Je.message,children:i}),(0,e.jsx)(`div`,{className:Je.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),$e=qe({ConfirmModal:Ze,ErrorModal:Qe}),et=()=>{let e=Q(e=>e.openModal);return(t={})=>new Promise(n=>{Xe+=1;let r=`confirm-${Xe}`;Ye.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1,onClose:()=>{Ye.get(r)?.(!1),Ye.delete(r)}})})},tt=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,nt=()=>{let e=Q(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:tt(t)})}},rt=(0,i.create)(()=>({})),it=(0,i.create)(()=>({})),at=()=>{let e=Q(e=>e.modals),n=Q(e=>e.openModal),r=Q(e=>e.closeModal),i=Q(e=>e.closeTopModal),a=Q(e=>e.closeAllModals),o=(0,t.useCallback)((e,t={},r)=>n(e,t,r),[n]),s=(0,t.useCallback)(t=>e.some(e=>e.name===t),[e]);return(0,t.useMemo)(()=>({openModal:o,closeModal:r,closeTopModal:i,closeAllModals:a,isOpen:s,count:e.length}),[a,r,i,s,e.length,o])},ot={wrapper:`_wrapper_1qbyz_1`,container:`_container_1qbyz_15`,inner:`_inner_1qbyz_35`,cube:`_cube_1qbyz_53`,jump:`_jump_1qbyz_1`,cube__inner:`_cube__inner_1qbyz_67`,morph:`_morph_1qbyz_1`},st=()=>(0,e.jsx)(`div`,{className:ot.wrapper,children:(0,e.jsx)(`div`,{className:ot.container,children:(0,e.jsxs)(`div`,{className:ot.inner,children:[(0,e.jsx)(`div`,{className:ot.cube,children:(0,e.jsx)(`div`,{className:ot.cube__inner})}),(0,e.jsx)(`div`,{className:ot.cube,children:(0,e.jsx)(`div`,{className:ot.cube__inner})}),(0,e.jsx)(`div`,{className:ot.cube,children:(0,e.jsx)(`div`,{className:ot.cube__inner})})]})})}),ct={viewport:`_viewport_joq18_1`,"top-right":`_top-right_joq18_3`,"top-left":`_top-left_joq18_5`,"bottom-right":`_bottom-right_joq18_7`,"bottom-left":`_bottom-left_joq18_9`,toast:`_toast_joq18_11`,body:`_body_joq18_13`,info:`_info_joq18_15`,success:`_success_joq18_17`,warning:`_warning_joq18_19`,error:`_error_joq18_21`},lt={info:{name:`IconInfoCircle`,color:`var(--color-primary)`},success:{name:`IconSuccessCircle`,color:`var(--color-success)`},warning:{name:`IconWarning`,color:`var(--color-warning)`},error:{name:`IconWarning`,color:`var(--color-error)`}},ut=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${ct.toast} ${ct[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{children:(0,e.jsx)(g,{...lt[n.variant],width:24,height:24})}),(0,e.jsxs)(`div`,{className:ct.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]})},dt=0,ft=(0,i.create)(e=>({toasts:[],showToast:t=>{dt+=1;let n=`ds-toast-${dt}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),pt=()=>ft.setState({toasts:[]}),mt=({position:t=`top-right`})=>{let n=ft(e=>e.toasts),r=ft(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${ct.viewport} ${ct[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(ut,{toast:t,onClose:r},t.id))})},ht=()=>{let e=ft(e=>e.showToast),n=ft(e=>e.removeToast),r=ft(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},gt={root:`_root_s9o0g_1`,tooltip:`_tooltip_s9o0g_3`,"ds-tooltip-in":`_ds-tooltip-in_s9o0g_1`,top:`_top_s9o0g_5`,bottom:`_bottom_s9o0g_7`,left:`_left_s9o0g_9`,right:`_right_s9o0g_11`},_t=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${gt.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${gt.tooltip} ${gt[i]}`,style:{maxWidth:s},children:n})]})},vt=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},$={root:`_root_1oxvl_1`,frame:`_frame_1oxvl_35`,video:`_video_1oxvl_65`,overlay:`_overlay_1oxvl_79`,state:`_state_1oxvl_81`,buffering:`_buffering_1oxvl_83`,loaderViewport:`_loaderViewport_1oxvl_143`,loaderScale:`_loaderScale_1oxvl_155`,stateIcon:`_stateIcon_1oxvl_169`,empty:`_empty_1oxvl_201`,error:`_error_1oxvl_211`,replay:`_replay_1oxvl_223`,controlsLayer:`_controlsLayer_1oxvl_259`,controlsVisible:`_controlsVisible_1oxvl_285`,controls:`_controls_1oxvl_259`,controlGroup:`_controlGroup_1oxvl_309`,controlButton:`_controlButton_1oxvl_335`,settingsAction:`_settingsAction_1oxvl_367`,timeline:`_timeline_1oxvl_385`,volume:`_volume_1oxvl_387`,settings:`_settings_1oxvl_367`,playButton:`_playButton_1oxvl_401`,volumeGroup:`_volumeGroup_1oxvl_415`,timelineGroup:`_timelineGroup_1oxvl_439`,time:`_time_1oxvl_385`,settingsActionLabel:`_settingsActionLabel_1oxvl_677`,caption:`_caption_1oxvl_689`,fullscreen:`_fullscreen_1oxvl_703`},yt=2500,bt=5,xt=.05,St=[.5,.75,1,1.25,1.5,2],Ct=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:d,className:f=``,controls:p=!0,playsInline:m=!0,...h})=>{let _=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(void 0),[x,S]=(0,t.useState)(!1),[C,w]=(0,t.useState)(n.length>0),[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(!1),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(0),[N,P]=(0,t.useState)(0),[F,I]=(0,t.useState)(0),[L,R]=(0,t.useState)(1),[z,B]=(0,t.useState)(!!h.muted),[V,H]=(0,t.useState)(1),[U,W]=(0,t.useState)(!!h.loop),[G,K]=(0,t.useState)(-1),[q,ee]=(0,t.useState)(!1),[te,ne]=(0,t.useState)(!0),[J,re]=(0,t.useState)(!1),[ie,ae]=(0,t.useState)(!1),oe=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),se=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),ce=l??(x?`Не удалось воспроизвести видео`:void 0),le=s||C&&!ce&&n.length>0,ue=!le&&!ce&&n.length===0,de=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,fe=(0,t.useCallback)(()=>{ne(!0),window.clearTimeout(b.current),D&&!q&&(b.current=window.setTimeout(()=>ne(!1),yt))},[D,q]);(0,t.useEffect)(()=>{S(!1),w(n.length>0),E(!1),O(!1),A(!1),M(0),P(0),I(0)},[oe,n.length]),(0,t.useEffect)(()=>(fe(),()=>window.clearTimeout(b.current)),[fe]),(0,t.useEffect)(()=>{let e=()=>re(document.fullscreenElement===v.current),t=()=>ae(document.pictureInPictureElement===y.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!q)return;let e=e=>{_.current?.contains(e.target)||ee(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[q]);let pe=async()=>{let e=y.current;if(!(!e||ce||le)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{S(!0)}}else e.pause()}},me=()=>{let e=y.current;e&&(e.muted=!e.muted)},he=e=>{let t=y.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},ge=e=>{let t=y.current;!t||!N||(t.currentTime=Math.min(N,Math.max(0,e)),M(t.currentTime))},_e=async()=>{if(v.current)try{document.fullscreenElement?await document.exitFullscreen():await v.current.requestFullscreen()}catch{re(!1)}},ve=async()=>{let e=y.current;if(!(!e||!de))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{ae(!1)}},ye=e=>{let t=y.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),K(e))},Y=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),pe()):n===`m`?(e.preventDefault(),me()):n===`f`?(e.preventDefault(),_e()):n===`c`&&se.length?(e.preventDefault(),ye(G===-1?se[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),ge(j+(e.key===`ArrowRight`?bt:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),he(L+(e.key===`ArrowUp`?xt:-.05))):e.key===`Escape`&&ee(!1),fe()},be=()=>{let e=y.current;S(!1),w(!0),e?.load()},xe={"--video-progress":`${N?j/N*100:0}%`,"--video-buffered":`${F*100}%`};return(0,e.jsxs)(`figure`,{ref:_,className:`${$.root} ${f}`,onKeyDown:Y,children:[(0,e.jsxs)(`div`,{ref:v,className:`${$.frame} ${J?$.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":le||void 0,tabIndex:p&&n.length?0:void 0,onPointerMove:fe,onPointerDown:fe,onFocusCapture:fe,onMouseLeave:()=>{D&&!q&&ne(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:y,"aria-label":i,controls:!1,playsInline:m,loop:U,className:$.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),pe()},onDoubleClick:e=>{h.onDoubleClick?.(e),_e()},onLoadStart:e=>{w(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{P(e.currentTarget.duration||0);let t=se.find(({track:e})=>e.default);ye(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{P(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{M(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&I(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{w(!1),E(!1),h.onLoadedData?.(e)},onCanPlay:e=>{w(!1),E(!1),h.onCanPlay?.(e)},onWaiting:e=>{E(!0),h.onWaiting?.(e)},onPlaying:e=>{O(!0),A(!1),E(!1),h.onPlaying?.(e)},onPlay:e=>{O(!0),h.onPlay?.(e)},onPause:e=>{O(!1),h.onPause?.(e)},onEnded:e=>{O(!1),A(!0),ne(!0),h.onEnded?.(e)},onVolumeChange:e=>{R(e.currentTarget.volume),B(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{H(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{w(!1),E(!1),S(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),le&&(0,e.jsxs)(`div`,{className:$.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:$.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:$.loaderScale,children:(0,e.jsx)(st,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!le&&T&&!ce&&(0,e.jsx)(`div`,{className:$.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(c,{variant:`empty`})}),ue&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.empty}`,role:`status`,children:[(0,e.jsx)(g,{name:`IconInfoCircle`,className:$.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),d??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!le&&ce&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.error}`,role:`alert`,children:[(0,e.jsx)(g,{name:`IconWarning`,className:$.stateIcon,width:40,height:40}),d??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:ce})]}),n.length>0&&(0,e.jsx)(u,{size:`sm`,variant:`secondary`,onClick:be,children:`Повторить`})]}),!le&&!ce&&k&&(0,e.jsx)(`button`,{type:`button`,className:$.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void pe(),children:(0,e.jsx)(g,{name:`IconReplay`,width:28,height:28})}),p&&n.length>0&&!le&&!ce&&(0,e.jsxs)(`div`,{className:`${$.controlsLayer} ${te||!D?$.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[q&&(0,e.jsxs)(`div`,{className:$.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:V,onChange:e=>{let t=Number(e.target.value);y.current&&(y.current.playbackRate=t)},children:St.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),se.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:G,onChange:e=>ye(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),se.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":U,onClick:()=>W(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:U?`Вкл.`:`Выкл.`})]}),de&&(0,e.jsx)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ie,onClick:()=>void ve(),children:(0,e.jsxs)(`span`,{className:$.settingsActionLabel,children:[(0,e.jsx)(g,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:$.controls,children:[(0,e.jsx)(`div`,{className:$.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${$.controlButton} ${$.playButton}`,"aria-label":D?`Пауза`:`Воспроизвести`,title:D?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void pe(),children:(0,e.jsx)(g,{name:D?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":z?`Включить звук`:`Выключить звук`,"aria-pressed":z,title:`Звук (M)`,onClick:me,children:(0,e.jsx)(g,{name:z||L===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:$.volume,type:`range`,min:0,max:1,step:.05,value:z?0:L,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((z?0:L)*100)}%`,onChange:e=>he(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:$.time,children:vt(j)}),(0,e.jsx)(`input`,{className:$.timeline,style:xe,type:`range`,min:0,max:N||0,step:.01,value:Math.min(j,N||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${vt(j)} из ${vt(N)}`,onChange:e=>ge(Number(e.target.value))}),(0,e.jsx)(`span`,{className:$.time,children:vt(N)})]}),(0,e.jsxs)(`div`,{className:$.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":`Настройки`,"aria-expanded":q,title:`Настройки`,onClick:()=>ee(e=>!e),children:(0,e.jsx)(g,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":J?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void _e(),children:(0,e.jsx)(g,{name:J?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})},wt={root:`_root_1tdda_1`,trigger:`_trigger_1tdda_15`,heading:`_heading_1tdda_41`,title:`_title_1tdda_51`,subtitle:`_subtitle_1tdda_59`,icon:`_icon_1tdda_69`,open:`_open_1tdda_91`,content:`_content_1tdda_99`,contentInner:`_contentInner_1tdda_119`},Tt=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},Et=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=v.current;if(v.current=m,!m||e||!c)return;let t=h.current,n=_.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=Tt(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${wt.root} ${m?wt.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:wt.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:wt.heading,children:[(0,e.jsx)(`span`,{className:wt.title,children:n}),r&&(0,e.jsx)(`span`,{className:wt.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:wt.icon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:_,id:d,className:wt.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:wt.contentInner,children:i})})]})},Dt=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null};exports.ConfirmModal=Ze,exports.DSAccordion=Et,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=v,exports.DSDataTable=ue,exports.DSDateRange=F,exports.DSDateTimePicker=M,exports.DSDropDown=W,exports.DSDropDownMultiple=he,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFileInput=Pe,exports.DSFilters=Ae,exports.DSIcon=g,exports.DSInfoBlock=Ee,exports.DSInput=_e,exports.DSLoader=c,exports.DSModal=Ge,exports.DSModalFrame=We,exports.DSPageLoader=st,exports.DSPortal=Dt,exports.DSRadioButton=Oe,exports.DSSearchDropDown=we,exports.DSSkeleton=L,exports.DSSort=K,exports.DSTextarea=Le,exports.DSToast=ut,exports.DSToastProvider=mt,exports.DSTooltip=_t,exports.DSVideoPlayerFrame=Ct,exports.ErrorModal=Qe,exports.ModalSystemProvider=Ke,exports.builtInModalRegistry=$e,exports.defineModalRegistry=qe,exports.formatDateTimeLocalValue=w,exports.getDSAccordionScrollTarget=Tt,exports.getDSDataTablePaginationItems=te,exports.getErrorMessage=tt,exports.getNextEnabledOptionIndex=H,exports.isValidDateRange=P,exports.parseDateTimeLocalValue=T,exports.resetModalStore=ze,exports.resetToastStore=pt,exports.useConfirmModal=et,exports.useConfirmModalStore=rt,exports.useErrorModal=nt,exports.useErrorModalStore=it,exports.useModals=at,exports.useModalsStore=Q,exports.useToast=ht,exports.useToastStore=ft,exports.validateDSDataTableData=ne;
|