@ioca/react 1.0.8 → 1.0.9

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.
@@ -1,4 +1,6 @@
1
- import { HTMLAttributes, ReactNode, CSSProperties, ButtonHTMLAttributes, AnchorHTMLAttributes, ForwardRefExoticComponent, RefAttributes, ChangeEvent, InputHTMLAttributes, MouseEvent, TextareaHTMLAttributes, Ref } from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { HTMLAttributes, ReactNode, CSSProperties, ForwardRefExoticComponent, RefAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, ChangeEvent, InputHTMLAttributes, MouseEvent, TextareaHTMLAttributes, FC, Ref } from 'react';
2
4
  import { LinkProps } from 'react-router-dom';
3
5
  import { Dayjs } from 'dayjs';
4
6
  import { ListProps } from 'rc-virtual-list';
@@ -13,6 +15,13 @@ interface IAffix extends HTMLAttributes<HTMLElement> {
13
15
  getContainer?: () => HTMLElement | null;
14
16
  }
15
17
 
18
+ declare function ToTop(props: IAffix): react_jsx_runtime.JSX.Element;
19
+
20
+ declare const Affix: {
21
+ (props: IAffix): JSX.Element;
22
+ ToTop: typeof ToTop;
23
+ };
24
+
16
25
  interface IBadge {
17
26
  content?: ReactNode;
18
27
  contentClass?: string;
@@ -25,6 +34,12 @@ interface IBadge {
25
34
  children?: ReactNode;
26
35
  }
27
36
 
37
+ declare const Badge: (props: IBadge) => JSX.Element;
38
+
39
+ declare function Group(props: IButtonGroup): react_jsx_runtime.JSX.Element;
40
+
41
+ declare function Toggle(props: IButtonToggle): react_jsx_runtime.JSX.Element;
42
+
28
43
  interface BaseButtonProps {
29
44
  as?: "a" | "button" | ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
30
45
  children?: ReactNode | string;
@@ -55,6 +70,12 @@ interface IButtonGroup {
55
70
  className?: string;
56
71
  style?: CSSProperties;
57
72
  }
73
+ interface CompositionButton extends ForwardRefExoticComponent<IButton & RefAttributes<HTMLElement>> {
74
+ Toggle: typeof Toggle;
75
+ Group: typeof Group;
76
+ }
77
+
78
+ declare const Button: CompositionButton;
58
79
 
59
80
  interface ICard {
60
81
  shadow?: boolean;
@@ -64,6 +85,14 @@ interface ICard {
64
85
  children?: ReactNode;
65
86
  }
66
87
 
88
+ declare const Card: {
89
+ (props: ICard): JSX.Element;
90
+ Header: any;
91
+ Footer: any;
92
+ Banner: any;
93
+ Tailer: any;
94
+ };
95
+
67
96
  type TStatus = "normal" | "success" | "warning" | "error";
68
97
  type TOption = {
69
98
  label: ReactNode;
@@ -104,6 +133,13 @@ interface ICheckboxItem extends Omit<InputHTMLAttributes<HTMLElement>, "value" |
104
133
  onChange?: (value: boolean, e: ChangeEvent<HTMLInputElement>) => void;
105
134
  }
106
135
 
136
+ declare function CheckboxItem(props: ICheckboxItem): react_jsx_runtime.JSX.Element;
137
+
138
+ declare function Checkbox(props: ICheckbox): react_jsx_runtime.JSX.Element;
139
+ declare namespace Checkbox {
140
+ var Item: typeof CheckboxItem;
141
+ }
142
+
107
143
  type TKey = string | number;
108
144
  interface ICollapse extends HTMLAttributes<HTMLDivElement> {
109
145
  active?: TKey | TKey[];
@@ -124,6 +160,13 @@ interface ICollapseItem {
124
160
  style?: CSSProperties;
125
161
  }
126
162
 
163
+ declare function Item$3(props: ICollapseItem): react_jsx_runtime.JSX.Element;
164
+
165
+ declare const Collapse: {
166
+ (props: ICollapse): JSX.Element;
167
+ Item: typeof Item$3;
168
+ };
169
+
127
170
  type IData$1 = Record<string, any>;
128
171
  interface IColumn {
129
172
  id: string;
@@ -160,6 +203,14 @@ interface IDatagrid {
160
203
  onResize?: (column?: IColumn, width?: number) => void;
161
204
  }
162
205
 
206
+ declare const Datagrid: (props: IDatagrid) => JSX.Element;
207
+
208
+ declare const Number$2: react.ForwardRefExoticComponent<IInputNumber & react.RefAttributes<HTMLInputElement>>;
209
+
210
+ declare const Range: (props: IInputRange) => react_jsx_runtime.JSX.Element;
211
+
212
+ declare const Textarea: react.ForwardRefExoticComponent<ITextarea & react.RefAttributes<HTMLTextAreaElement>>;
213
+
163
214
  interface IInput extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
164
215
  prepend?: ReactNode;
165
216
  append?: ReactNode;
@@ -192,6 +243,11 @@ interface IInputRange extends Omit<BaseInput, "value" | "onChange">, Omit<InputH
192
243
  hideControl?: boolean;
193
244
  onChange?: (value: (number | string | undefined)[], e?: ChangeEvent<HTMLInputElement> | MouseEvent<Element>) => void;
194
245
  }
246
+ type CompositionInput = ForwardRefExoticComponent<IInput & RefAttributes<HTMLInputElement>> & {
247
+ Textarea: typeof Textarea;
248
+ Number: typeof Number$2;
249
+ Range: typeof Range;
250
+ };
195
251
 
196
252
  interface IPopup {
197
253
  visible?: boolean;
@@ -234,6 +290,8 @@ interface IBaseDates {
234
290
  disabledDate?: (date: Dayjs) => boolean;
235
291
  }
236
292
 
293
+ declare const Datepicker: (props: IDatePicker) => JSX.Element;
294
+
237
295
  type IData = {
238
296
  label: ReactNode;
239
297
  value: ReactNode;
@@ -256,6 +314,8 @@ interface IDescription {
256
314
  className?: string;
257
315
  }
258
316
 
317
+ declare const Description: (props: IDescription) => JSX.Element;
318
+
259
319
  interface IDrawer extends HTMLAttributes<HTMLDivElement> {
260
320
  visible?: boolean;
261
321
  position?: "top" | "left" | "right" | "bottom";
@@ -267,6 +327,8 @@ interface IDrawer extends HTMLAttributes<HTMLDivElement> {
267
327
  onClose?: () => void;
268
328
  }
269
329
 
330
+ declare function Drawer(props: IDrawer): react.ReactPortal;
331
+
270
332
  interface IList extends HTMLAttributes<HTMLUListElement> {
271
333
  label?: ReactNode | ((i: number) => ReactNode);
272
334
  type?: "option" | "default";
@@ -289,6 +351,11 @@ interface IDropItem extends IListItem {
289
351
  moreProps?: IDropdown;
290
352
  }
291
353
 
354
+ declare const Dropdown: {
355
+ (props: IDropdown): JSX.Element;
356
+ Item: (props: IDropItem) => react_jsx_runtime.JSX.Element;
357
+ };
358
+
292
359
  interface IFlex {
293
360
  as?: keyof JSX.IntrinsicElements;
294
361
  align?: string;
@@ -302,6 +369,8 @@ interface IFlex {
302
369
  children?: ReactNode;
303
370
  }
304
371
 
372
+ declare const Flex: (props: IFlex) => JSX.Element;
373
+
305
374
  declare class IFormInstance {
306
375
  readonly id?: string;
307
376
  data: {
@@ -316,6 +385,7 @@ declare class IFormInstance {
316
385
  [key: string]: any;
317
386
  }>;
318
387
  }
388
+ declare function useForm(form?: IFormInstance): IFormInstance;
319
389
 
320
390
  type TValidator = (value: any, form: IFormInstance) => boolean;
321
391
  type TRule = {
@@ -336,6 +406,14 @@ interface IField {
336
406
  required?: boolean;
337
407
  }
338
408
 
409
+ declare function Field(props: IField): react.ReactNode;
410
+
411
+ declare const Form: {
412
+ (props: IForm): JSX.Element;
413
+ useForm: typeof useForm;
414
+ Field: typeof Field;
415
+ };
416
+
339
417
  interface IIcon extends HTMLAttributes<HTMLElement> {
340
418
  icon: ReactNode;
341
419
  size?: string;
@@ -344,6 +422,10 @@ interface IIcon extends HTMLAttributes<HTMLElement> {
344
422
  className?: string;
345
423
  }
346
424
 
425
+ declare const Icon: react.ForwardRefExoticComponent<IIcon & react.RefAttributes<HTMLElement>>;
426
+
427
+ declare function List$1(props: IImageList): react_jsx_runtime.JSX.Element | "";
428
+
347
429
  interface IImage extends HTMLAttributes<HTMLImageElement> {
348
430
  src?: string;
349
431
  alt?: string;
@@ -362,6 +444,19 @@ interface IImageList extends Omit<IImage, "src" | "alt"> {
362
444
  wrap?: any;
363
445
  direction?: any;
364
446
  }
447
+ interface CompositionImage extends FC<IImage> {
448
+ List: typeof List$1;
449
+ }
450
+
451
+ declare const _default$2: CompositionImage;
452
+
453
+ declare const Input: CompositionInput;
454
+
455
+ declare const List: {
456
+ (props: IList): JSX.Element;
457
+ Virtual: (props: IVirtual) => react_jsx_runtime.JSX.Element;
458
+ Item: react.ForwardRefExoticComponent<IListItem & react.RefAttributes<HTMLLIElement>>;
459
+ };
365
460
 
366
461
  interface ILoading extends HTMLAttributes<HTMLDivElement> {
367
462
  icon?: ReactNode;
@@ -369,6 +464,8 @@ interface ILoading extends HTMLAttributes<HTMLDivElement> {
369
464
  size?: number | string;
370
465
  }
371
466
 
467
+ declare const Loading: (props: ILoading) => JSX.Element;
468
+
372
469
  interface IMessage {
373
470
  id?: string;
374
471
  content?: ReactNode;
@@ -385,14 +482,13 @@ interface IMessage {
385
482
  onShow?: () => void;
386
483
  onHide?: () => void;
387
484
  }
388
- interface IMessageItem {
389
- active?: boolean;
390
- content?: ReactNode;
391
- top?: number;
392
- className?: string;
393
- style?: CSSProperties;
394
- onClick?: (e: MouseEvent<Element>) => void;
395
- }
485
+
486
+ declare function message(config: IMessage | ReactNode): () => void;
487
+
488
+ declare function useModal(): {
489
+ open: (props: IModal) => void;
490
+ update: (props: IModal) => void;
491
+ };
396
492
 
397
493
  interface IModal extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
398
494
  visible?: boolean;
@@ -414,10 +510,12 @@ interface IModal extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
414
510
  onOk?: () => void;
415
511
  onClose?: () => void;
416
512
  }
417
- interface RefHookModal {
418
- update: (props: IModal) => void;
513
+ interface CompositionModal extends FC<IModal> {
514
+ useModal: typeof useModal;
419
515
  }
420
516
 
517
+ declare const _default$1: CompositionModal;
518
+
421
519
  interface IPagination extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
422
520
  page?: number;
423
521
  total?: number;
@@ -433,6 +531,8 @@ interface IPagination extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
433
531
  onChange?: (page: number) => Promise<void> | void;
434
532
  }
435
533
 
534
+ declare const Pagination: (props: IPagination) => JSX.Element;
535
+
436
536
  interface IPopconfirm extends IPopup {
437
537
  icon?: ReactNode;
438
538
  okButtonProps?: IButton;
@@ -442,6 +542,10 @@ interface IPopconfirm extends IPopup {
442
542
  onClose?: () => Promise<void> | void;
443
543
  }
444
544
 
545
+ declare const Popconfirm: (props: IPopconfirm) => JSX.Element;
546
+
547
+ declare function Popup(props: IPopup): react_jsx_runtime.JSX.Element;
548
+
445
549
  interface IProgress extends Omit<BaseInput, "value" | "hideClear" | "onChange"> {
446
550
  name?: string;
447
551
  value?: number;
@@ -457,6 +561,8 @@ interface IProgress extends Omit<BaseInput, "value" | "hideClear" | "onChange">
457
561
  onChange?: (value: number) => void;
458
562
  }
459
563
 
564
+ declare const Progress: (props: IProgress) => JSX.Element;
565
+
460
566
  interface IRadioItem extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
461
567
  type?: "default" | "button";
462
568
  onChange?: (value: any, e: ChangeEvent) => void;
@@ -470,6 +576,13 @@ interface IRadio extends IRadioItem {
470
576
  message?: string;
471
577
  }
472
578
 
579
+ declare function RadioItem(props: IRadioItem): react_jsx_runtime.JSX.Element;
580
+
581
+ declare function Radio(props: IRadio): react_jsx_runtime.JSX.Element;
582
+ declare namespace Radio {
583
+ var Item: typeof RadioItem;
584
+ }
585
+
473
586
  interface ISelect extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onSelect" | "onChange">, BaseInput {
474
587
  options: TOptions;
475
588
  multiple?: boolean;
@@ -485,11 +598,8 @@ interface ISelect extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" |
485
598
  onSelect?: (v: any, option?: TOption) => void;
486
599
  onChange?: (v: any) => void;
487
600
  }
488
- interface ISelectOptions extends Pick<ISelect, "multiple" | "empty" | "filter" | "filterPlaceholder" | "onSelect"> {
489
- value: any;
490
- options: TOption[];
491
- onFilter?: (e: ChangeEvent<HTMLInputElement>) => void;
492
- }
601
+
602
+ declare const Select: react.ForwardRefExoticComponent<ISelect & react.RefAttributes<HTMLInputElement>>;
493
603
 
494
604
  interface IStep {
495
605
  active?: number;
@@ -506,6 +616,15 @@ interface IStepItem extends IStep {
506
616
  title?: ReactNode;
507
617
  }
508
618
 
619
+ declare function Item$2(props: IStepItem): react_jsx_runtime.JSX.Element;
620
+
621
+ declare const Step: {
622
+ (props: IStep): JSX.Element;
623
+ Item: typeof Item$2;
624
+ };
625
+
626
+ declare function Item$1(props: ISwiperItem): react_jsx_runtime.JSX.Element;
627
+
509
628
  interface ISwiper {
510
629
  initial?: number;
511
630
  type?: "normal" | "fade" | "flow";
@@ -546,6 +665,13 @@ interface RefSwiper {
546
665
  swipeNext: () => void;
547
666
  swipePrev: () => void;
548
667
  }
668
+ interface CompositionSwiper extends ForwardRefExoticComponent<ISwiper & RefAttributes<RefSwiper>> {
669
+ Item: typeof Item$1;
670
+ }
671
+
672
+ declare const Swiper: CompositionSwiper;
673
+
674
+ declare const Item: (props: ITabItem) => react_jsx_runtime.JSX.Element;
549
675
 
550
676
  type TTabKey = string | number;
551
677
  interface ITabItem {
@@ -581,6 +707,11 @@ interface RefTabs {
581
707
  add: (tab: ITabItem, position?: number) => void;
582
708
  navs: Ref<HTMLDivElement>;
583
709
  }
710
+ interface CompositionTabs extends ForwardRefExoticComponent<ITabs & RefAttributes<RefTabs>> {
711
+ Item: typeof Item;
712
+ }
713
+
714
+ declare const Tabs: CompositionTabs;
584
715
 
585
716
  interface ITag extends HTMLAttributes<HTMLSpanElement> {
586
717
  dot?: boolean;
@@ -592,6 +723,12 @@ interface ITag extends HTMLAttributes<HTMLSpanElement> {
592
723
  onClose?: (e: MouseEvent) => void;
593
724
  }
594
725
 
726
+ declare const Tag: (props: ITag) => JSX.Element;
727
+
728
+ declare function Number$1(props: ITextNumber): react_jsx_runtime.JSX.Element;
729
+
730
+ declare function Number(props: ITextTime): react_jsx_runtime.JSX.Element;
731
+
595
732
  interface IText {
596
733
  as?: keyof JSX.IntrinsicElements;
597
734
  size?: string | number;
@@ -615,6 +752,12 @@ interface ITextTime extends IText {
615
752
  zero?: boolean;
616
753
  units?: string[];
617
754
  }
755
+ interface CompositionText extends FC<IText> {
756
+ Number: typeof Number$1;
757
+ Time: typeof Number;
758
+ }
759
+
760
+ declare const _default: CompositionText;
618
761
 
619
762
  interface ITreeItem {
620
763
  as?: "a" | "button" | ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
@@ -659,6 +802,8 @@ interface RefTree {
659
802
  getPartofs: () => [string[], ITreeItem[]];
660
803
  }
661
804
 
805
+ declare const Tree: react.ForwardRefExoticComponent<ITree & react.RefAttributes<RefTree>>;
806
+
662
807
  interface IUpload extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
663
808
  files?: IFile[];
664
809
  accept?: string;
@@ -681,14 +826,12 @@ interface IFile extends File {
681
826
  src?: string;
682
827
  [key: string]: any;
683
828
  }
684
- interface IUploadItem extends Pick<IUpload, "mode"> {
685
- file?: IFile;
686
- index: number;
687
- status?: string;
688
- onRemove: (i: number) => void;
689
- onPreview?: (i: number) => void;
829
+ interface RefUpload {
830
+ getFileList: () => IFile[];
690
831
  }
691
832
 
833
+ declare const Upload: react.ForwardRefExoticComponent<IUpload & react.RefAttributes<RefUpload>>;
834
+
692
835
  interface IVideo extends HTMLAttributes<HTMLVideoElement> {
693
836
  src?: string;
694
837
  hideControls?: boolean;
@@ -702,6 +845,15 @@ interface IVideo extends HTMLAttributes<HTMLVideoElement> {
702
845
  volumeProgressProps?: IProgress;
703
846
  onFullScreenChange?: (fullscreen: boolean) => void;
704
847
  }
848
+ interface RefVideo {
849
+ play: () => void;
850
+ pause: () => void;
851
+ stop: () => void;
852
+ fullscreen: (full?: boolean) => void;
853
+ getVideo: () => HTMLVideoElement | null;
854
+ }
855
+
856
+ declare const Video: react.ForwardRefExoticComponent<IVideo & react.RefAttributes<RefVideo>>;
705
857
 
706
858
  type TPreviewItem = {
707
859
  src: string;
@@ -738,4 +890,6 @@ interface IPreview {
738
890
  onRotate?: (deg: number) => void;
739
891
  }
740
892
 
741
- export type { IAffix, IBadge, IButton, IButtonGroup, IButtonToggle, ICard, ICheckbox, ICheckboxItem, ICollapse, ICollapseItem, IDatagrid, IDatePicker, IDescription, IDrawer, IDropItem, IDropdown, IField, IFlex, IForm, IIcon, IImage, IImageList, IInput, IInputNumber, IInputRange, IList, IListItem, ILoading, IMessage, IMessageItem, IModal, IPagination, IPopconfirm, IPopup, IPreview, IProgress, IRadio, IRadioItem, ISelect, ISelectOptions, IStep, IStepItem, ISwiper, ISwiperItem, ITabItem, ITabs, ITag, IText, ITextNumber, ITextTime, ITextarea, ITree, ITreeItem, IUpload, IUploadItem, IVideo, IVirtual, RefHookModal, RefSwiper, RefTabs, RefTree, TPreviewItem };
893
+ declare function usePreview(): (config: IPreview) => void;
894
+
895
+ export { Affix, Badge, Button, Card, Checkbox, Collapse, Datagrid, Datepicker, Description, Drawer, Dropdown, Flex, Form, Icon, _default$2 as Image, Input, List, Loading, message as Message, _default$1 as Modal, Pagination, Popconfirm, Popup, Progress, Radio, Select, Step, Swiper, Tabs, Tag, _default as Text, Tree, Upload, Video, usePreview };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ioca/react",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -49,12 +49,11 @@
49
49
  "react-dom": ">=18.3.1"
50
50
  },
51
51
  "main": "lib/index.js",
52
- "module": "lib/index.mjs",
53
- "types": "lib/types/index.d.ts",
52
+ "module": "lib/index.js",
54
53
  "exports": {
55
54
  ".": {
56
55
  "types": "./lib/types/index.d.ts",
57
- "import": "./lib/index.mjs"
56
+ "import": "./lib/index.js"
58
57
  },
59
58
  "./index.css": {
60
59
  "import": "./lib/css/index.css"
package/lib/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"classnames";import{debounce as a,uid as r,throttle as s,pick as l,title as o}from"radash";import{forwardRef as c,createElement as d,useEffect as u,useCallback as p,isValidElement as m,cloneElement as h,useState as g,useMemo as f,Children as v,useRef as b,useLayoutEffect as y,Fragment as N,createContext as k,useContext as C,useImperativeHandle as w}from"react";import{SkipPreviousRound as x,CloseRound as $,MinusRound as T,PlusRound as I,InboxTwotone as P,VisibilityRound as z,VisibilityOffRound as O,SyncAltRound as M,KeyboardArrowLeftRound as D,KeyboardArrowRightRound as S,CalendarMonthTwotone as j,PauseRound as E,PlayArrowRound as B,StopRound as Y,FullscreenExitRound as A,FullscreenRound as L,VolumeOffRound as V,VolumeDownRound as W,FeedOutlined as q,AspectRatioRound as F,OpenInNewRound as H,FileDownloadOutlined as R,RotateRightRound as X,RotateLeftRound as U,HideImageTwotone as G,MoreHorizRound as K,InfoOutlined as Z,SearchRound as _,CheckRound as J,UnfoldMoreRound as Q,KeyboardArrowDownRound as ee,ListAltRound as te,CloudUploadTwotone as ne,PlusSharp as ie}from"@ricons/material";import{useReactive as ae,useMemoizedFn as re,useClickAway as se,useCreation as le,useSize as oe}from"ahooks";import{createRoot as ce}from"react-dom/client";import de from"react-custom-scrollbars-2";import ue from"dayjs";import pe from"dayjs/plugin/customParseFormat";import{createPortal as me}from"react-dom";import he from"rc-virtual-list";import ge from"pubsub-js";const fe=500;function ve(e){const t=e.target,n=t.closest("[data-ripple]");t&&n&&function(e,t){const[n,i]=function(){const e=document.createElement("SPAN"),t=document.createElement("SPAN");return e.className="i-ripple-container",t.className="i-ripple",e.append(t),[e,t]}(),a=e.getBoundingClientRect(),r=2*Math.max(a.width,a.height);i.style.cssText=`\n left: ${t.pageX-a.left}px;\n top: ${t.pageY-a.top}px;\n width: ${r}px;\n height: ${r}px;\n transition: all 0.5s;\n `,e.insertAdjacentElement("afterbegin",n),e.offsetHeight,i.classList.add("i-ripple-active"),setTimeout((()=>{n.remove()}),fe)}(n,e)}const be=n=>{const{icon:a,text:r,size:s,style:l,className:o,...c}=n;return e("div",{className:i("i-loading-container",o),style:{fontSize:s,...l},...c,children:[a??t("svg",{width:"24",height:"24",stroke:"#000",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"i-loading-icon",children:t("circle",{cx:"12",cy:"12",r:"9.5",fill:"none",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:40,strokeDashoffset:0})}),r]})},ye=({outline:e,flat:t,loading:n,disabled:a,size:r="normal",block:s,round:l,square:o,secondary:c,className:d})=>i("i-btn",d,{"i-btn-outline":e,"i-btn-flat":t,"i-btn-block":s,"i-btn-loading":n,"i-btn-square":o,"i-btn-secondary":c,[`i-btn-${r}`]:"normal"!==r,round:l,disabled:a}),Ne=c(((e,i)=>{const{as:a="a",children:r,className:s,loading:l,flat:o,outline:c,square:p,secondary:m,size:h,round:g,href:f,ripple:v=!0,onClick:b,...y}=e;if(!r)return t(n,{});const N=[l&&t(be,{},"loading"),d("span",{key:"content",className:"i-btn-content"},r)],k={className:ye(e),"data-ripple":v,onClick:e=>{l||y.disabled?e.stopPropagation():b?.(e)}};return u((()=>{v&&(document.documentElement.dataset.useripple||(document.documentElement.dataset.useripple="enable",document.addEventListener("mousedown",ve)))}),[v]),d(a,"string"==typeof a?{ref:i,href:f,...k,...y}:{to:f||"",...k,...y},N)}));Ne.Toggle=function(e){const{active:n,activeClass:a,after:r,disabled:s,children:l,className:o,onClick:c,onToggle:d,...m}=e,h=ae({active:n,done:!0}),g=p((()=>{const e=void 0!==r,t=!h.active;Object.assign(h,{active:t,done:!e}),d?.(t),e&&setTimeout((()=>{h.done=!0}),16)}),[r]);return u((()=>{h.active!==n&&g()}),[n]),t(Ne,{className:i(o,{[a||""]:h.active},"i-btn-toggle"),...m,onClick:e=>{c?.(e),!s&&g()},children:t("div",{className:i("i-btn-toggle-content",{"i-btn-toggle-active":h.done}),children:h.active?r??l:l})})},Ne.Group=function(e){const{children:n,vertical:a,className:r,style:s}=e;return t("div",{className:i(r,a?"i-btn-group-vertical":"i-btn-group-horizonal"),style:s,children:n})};const ke=c(((e,t)=>{const{icon:n,size:a="1.425em",rotate:r,style:s,className:l,...o}=e;if(!m(n))return n;const c={ref:t,style:{transform:r?`rotate(${r}deg)`:void 0,...s,width:a,height:a},className:i("i-icon",l),...o};return h(n,c)}));function Ce(e){const{style:n,className:a,onClick:r}=e;return t(Ne,{square:!0,className:i("i-affix-totop",a),style:{...n},onClick:r,children:t(ke,{icon:t(x,{}),rotate:90})})}const we=e=>{const{position:n="fixed",left:r,top:s,right:l,bottom:o,offset:c,style:d,className:p,children:m,getContainer:b=()=>document.body}=e,[y,N]=g(!1),k=f((()=>v.map(m,(e=>{if(e.type===Ce){const{onClick:t}=e.props;return h(e,{key:e.key,...e.props,onClick:e=>{const n=b();t?.(e),n?.scrollTo({top:0,left:0,behavior:"smooth"})}})}return e}))),[m,b]);return u((()=>{const e=b();if(!c||!e)return;const t=a({delay:160},(()=>{const t=e.scrollTop;N(t<c)}));return e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[c,b]),t("div",{className:i("i-affix",p,{"i-affix-hidden":y}),style:{...d,position:n,left:r,top:s,right:l,bottom:o},children:k})};we.ToTop=Ce;const xe=n=>{const{content:a,contentClass:r,dot:s,dotSize:l,round:o,disabled:c,style:d,className:u,children:p}=n;return e("div",{style:d,className:i("i-badge",{rounded:o},u),children:[p,t("div",{className:i("i-badge-content",r,{"i-badge-dot":s,"i-badge-hidden":c}),style:{fontSize:l},children:a})]})},$e=e=>n=>t("div",{style:n.style,className:i("i-card-"+e,n.className),children:n.children}),Te=$e("header"),Ie=$e("footer"),Pe=$e("banner"),ze=$e("tail"),Oe=n=>{const{shadow:a=!0,border:r,style:s,className:l,children:o}=n,c=f((()=>{const e={};return v.map(o,(t=>{switch(t.type){case Te:e.header=t;break;case Ie:e.footer=t;break;case Pe:e.banner=t;break;case ze:e.tailer=t;break;default:e.content=[...e.content||[],t]}})),e}),[o]),{header:d,banner:u,content:p,footer:m,tailer:h}=c;return e("div",{style:s,className:i("i-card",l,{shadow:a,"i-card-bordered":r}),children:[u,d,p&&t("div",{className:"i-card-content",children:p}),m,h]})};var Me;function De(e,t,n={}){const{refWindow:i,gap:a=0,offset:r=0,position:s="top",align:l}=n;if(!e||!t)return[0,0,{arrowX:0,arrowY:0,arrowPos:"bottom"}];const o=e.getBoundingClientRect(),c=t.getBoundingClientRect();let d=window.innerWidth,u=window.innerHeight,{left:p,top:m,right:h,bottom:g,width:f,height:v}=o;const{height:b,width:y}=c;if(!i){const t=e.offsetParent?.getBoundingClientRect();d=t?.width||d,u=t?.height||u,p=e.offsetLeft,m=e.offsetTop,h=p+o.width,g=m+o.height}let N=0,k=0,C=0,w=0,x="bottom";switch(s){case"left":case"right":N=v!==b?je({containerSize:u,targetSize:v,targetOffset:m,contentSize:b,gap:a,align:l}):m,w=N<m?m-N+v/2:v/2;const e=p-r-y,t=h+r+y;"left"===s?(k=e<0?h+r:e,C=e<0?0:y,x=e<0?"left":"right"):(k=d>t?h+r:e,C=d>t?0:y,x=d>t?"left":"right");break;case"top":case"bottom":k=f!==y?je({containerSize:d,targetOffset:p,targetSize:f,contentSize:y,gap:a,align:l}):p,C=k>p?y/2:p-k+f/2;const n=m-r-b,i=g+r+b;"top"===s?(N=n<0?g+r:n,w=n<0?0:b,x=n<0?"top":"bottom"):(N=u>i?g+r:n,w=u>i?0:b,x=u>i?"top":"bottom")}return[k,N,{arrowX:C,arrowY:w,arrowPos:x}]}function Se(e,t){const{pageX:n,pageY:i}=e,{width:a,height:r}=t.getBoundingClientRect(),{innerHeight:s,innerWidth:l}=window;return[n+a>=l&&n-a>0?n-a:n,i+r>=s&&i-r>0?i-r:i]}function je({containerSize:e,targetSize:t,targetOffset:n,contentSize:i,gap:a,align:r="center"}){const s=n+t/2;switch(r){case"start":return n+i>e?n+t:n;case"center":return t>=i?s-i/2:s+i/2+a>e?n+t-i:s-i/2-a<0?a:s-i/2;case"end":const r=n+t-i;return r>0?r:a;default:return s-i/2}}function Ee(e){return e.map((e=>["string","number"].includes(typeof e)?{label:e,value:e}:e))}function Be(e,t={}){const{precision:n,thousand:i}=t,a=e.toFixed(n);if(!i)return a;const r=a.split("."),s=r[0].replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,`$&${i}`);return 1===r.length?s:`${s}.${r[1]}`}function Ye(e,t=document.body){const n=document.createElement("div");t.append(n);const i=ce(n),a=setTimeout((()=>{i?.render(e)}),0);return()=>{n?.remove(),i?.unmount(),a&&clearTimeout(a)}}function Ae(e){return e.match(/\.([^\./\?]+)($|\?)/)?.[1]}function Le(e,t){switch(!0){case["jpg","jpeg","png","webp","svg"].includes(e)||t?.startsWith("image/"):return Me.IMAGE;case["mp4","avi"].includes(e)||t?.startsWith("video/"):return Me.VIDEO;default:return Me.UNKNOWN}}function Ve(e,t=2){if(!+e)return"0 Bytes";const n=t<0?0:t,i=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,i)).toFixed(n))} ${["B","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}`}function We(e,t,n){return e<t?t:e>n?n:e}function qe(n){const{type:a="default",label:r,name:s,value:l=!1,className:o,status:c="normal",message:d,disabled:p,partof:m,children:h,onChange:g,...f}=n,v=ae({value:l,status:c,message:d}),b=re((e=>{const t=e.target.checked;Object.assign(v,{value:t,status:c,message:d}),g?.(t,e)}));return u((()=>{v.value=l}),[l]),e("label",{className:i("i-checkbox-item",{[`i-checkbox-${v.status}`]:"normal"!==v.status,disabled:p},o),...f,children:[t("input",{type:"checkbox",name:s,className:i("i-checkbox-input",{[`i-checkbox-${a}`]:!m,"i-checkbox-partof":m}),checked:v.value,disabled:p,onChange:b}),t("span",{className:"i-checkbox-text",children:h||r}),v.message&&e("span",{className:"i-checkbox-message",children:["*",v.message]})]})}function Fe(n){const{label:a,name:r,options:s=[],value:l="",type:o="default",optionInline:c=!0,labelInline:d,disabled:p,status:m="normal",message:h,required:g,className:v,onChange:b,...y}=n,N=ae({value:l}),k=f((()=>Ee(s)),[s]),C=re(((e,t,n)=>{const i=[...N.value],a=i.findIndex((e=>e===t.value));e&&a<0?i.push(t.value):!e&&a>-1&&i.splice(a,1),N.value=i,b?.(i,t,n)}));return u((()=>{N.value=l}),[l]),e("div",{className:i("i-checkbox i-input-label",{[`i-checkbox-${m}`]:"normal"!==m,"i-input-inline":d},v),...y,children:[a&&e("span",{className:"i-input-label-text",children:[g&&t("span",{className:"error",children:"*"}),a,h&&t("p",{className:"i-checkbox-message",children:h})]}),t("div",{className:i("i-checkbox-options",{"i-options-block":!c,"i-checkbox-options-button":"button"===o}),children:k.map((e=>t(qe,{name:r,value:N.value.includes(e.value),type:o,disabled:p||e.disabled,onChange:(t,n)=>C(t,e,n),children:e.label},e.value)))})]})}Oe.Header=Te,Oe.Footer=Ie,Oe.Banner=Pe,Oe.Tailer=ze,function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.PDF="PDF",e.EXCEL="EXCEL",e.TXT="TXT",e.UNKNOWN="UNKNOWN"}(Me||(Me={})),Fe.Item=qe;const He=e=>{const{as:a="a",active:s,className:l,icon:o=t($,{}),...c}=e;return s?d(a,{className:i("i-helpericon",l),...c},[d(ke,{key:r(3),icon:o})]):t(n,{})};const Re=n=>{const{active:a,items:r,multiple:s,border:l,headerClickable:o,className:c,children:d,renderToggle:u=e=>t(e?T:I,{}),onCollapse:p,...m}=n,h=ae({active:a}),g=f((()=>r||(d&&v.map(d,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,disabled:l,...o}=i;return{...o,key:n||t,title:a,content:r||s,disabled:l}}))||[])),[d]),b=e=>{const{key:t,disabled:n}=e;if(n)return;if(!s)return h.active=h.active===t?void 0:t,void p?.(t,void 0!==h.active);Array.isArray(h.active)||(h.active=[]);const i=h.active.findIndex((e=>e===t));i>-1?h.active.splice(i,1):void 0!==t&&h.active.push(t),p?.(t,i<0)};return t("div",{className:i("i-collapse",{"i-collapse-bordered":l},c),...m,children:g.map((n=>{const{key:a,title:r,content:l,disabled:c,className:d,...p}=n,m=s?(h.active||[]).includes(a):h.active===a;return e("div",{className:i("i-collapse-item",d,{"i-collapse-active":m,"i-collapse-disabled":c}),...p,children:[e("div",{className:"i-collapse-header",onClick:()=>(e=>{o&&b(e)})(n),children:[r,t(He,{active:!0,className:"i-collapse-toggle",icon:u(m),onClick:()=>b(n)})]}),t("div",{className:"i-collapse-content",children:l})]},a)}))})};function Xe(e){const{className:n,...a}=e;return t(P,{className:i("i-empty",n),...a})}function Ue({justify:e,col:t,row:n,colSpan:i=1,rowSpan:a=1}){return{"--datagrid-justify":e,gridArea:`${n+1} / ${t+1} / ${n+1+a} / ${t+1+i}`,insetInline:`var(--datagrid-cell-inset-${t})`}}function Ge(e){const{column:n,row:a,col:r,data:s,onCellClick:l,onCellDoubleClick:o}=e,{id:c,fixed:d,justify:u,rowSpan:p,render:m}=n,h=Ue({justify:u,fixed:d,col:r,row:a,rowSpan:p});return t("div",{className:i("i-datagrid-cell",{[`i-datagrid-cell-fixed-${d}`]:d}),"data-col":c,style:h,onClick:e=>l?.(s,n,a,r,e),onDoubleClick:e=>o?.(s,n,a,r,e),children:m?.(s[c],s,r)??t("div",{className:"i-datagrid-cell-content",children:s[c]})})}Re.Item=function(e){return t(n,{})};const Ke=new Set,Ze=new Set;function _e(e){u((()=>(Ke.add(e),()=>{Ke.delete(e)})),[e])}function Je(e){u((()=>(Ze.add(e),()=>{Ze.delete(e)})),[e])}function Qe(e){const t=new WeakMap,n=new IntersectionObserver((e=>{e.map((e=>{const n=t.get(e.target);n?.(e.target,e.isIntersecting)}))}),e);return{observe:function(e,i){t.get(e)||(t.set(e,i),e&&n.observe(e))},unobserve:function(e){e&&n.unobserve(e),t.delete(e)},disconnect:function(){n.disconnect()}}}function et(e){const{index:n,onWidthChange:i}=e,a=ae({resizing:!1,x:0,width:0}),r=re((e=>{const t=e.target.offsetParent.offsetWidth;Object.assign(a,{x:e.pageX,resizing:!0,width:t})}));return _e(re((e=>{if(!a.resizing)return;e.preventDefault();const t=a.width+e.pageX-a.x;t<=24||i(n,t)}))),Je((()=>{a.resizing&&(a.resizing=!1)})),t("i",{className:"i-datagrid-resizor",onMouseDown:r,onClick:e=>e.stopPropagation()})}document.addEventListener("mousemove",(e=>{for(const t of Ke.values())t(e)})),document.addEventListener("mouseup",(e=>{for(const t of Ze.values())t(e)}));const tt=e=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...e,children:t("g",{fill:"none",children:t("path",{d:"M9 17.898c0 1.074 1.265 1.648 2.073.941l6.31-5.522a1.75 1.75 0 0 0 0-2.634l-6.31-5.522C10.265 4.454 9 5.028 9 6.102v11.796z",fill:"currentColor"})})});function nt(n){const{type:a}=n;return e("a",{className:i("i-datagrid-sorter",{[`i-datagrid-sorter-${a}`]:a}),children:[t(tt,{className:"i-datagrid-sorter-caret"}),t(tt,{className:"i-datagrid-sorter-caret"})]})}function it(e){const{row:n,data:i,columns:a,onRowClick:r,onCellClick:s,onCellDoubleClick:l}=e;return t("div",{className:"i-datagrid-row",onClick:()=>r?.(i,n),children:a.map(((e,a)=>t(Ge,{column:e,col:a,row:n,data:i,onCellClick:s,onCellDoubleClick:l},a)))})}function at(n){const{columns:a,resizable:r,sortBy:s,sortType:l,onWidthChange:o,onHeaderClick:c}=n;return t("div",{className:"i-datagrid-header i-datagrid-row",children:a.map(((n,a)=>{const{id:d,title:u,fixed:p,colSpan:m,sorter:h,justify:g,renderHeader:f}=n,v=Ue({justify:g,row:0,col:a,colSpan:m}),b=s===d?l:"";return e("div",{"data-col":d,className:i("i-datagrid-cell",{"i-datagrid-has-sorter":h,"i-datagrid-cell-fixed":p}),style:{...v,insetBlockStart:0},onClick:e=>c?.(n,e),children:[f?.(n,a)??t("div",{className:"i-datagrid-cell-content",children:u||d}),h&&t(nt,{type:b}),r&&t(et,{index:a,onWidthChange:o})]},a)}))})}const rt=n=>{const{data:a=[],columns:r=[],border:s,striped:l,header:o=!0,resizable:c,cellPadding:d=".5em",empty:m=t(Xe,{}),loading:h,height:g="unset",style:v,className:y,renderLoading:N=()=>t(be,{size:"1.5em",className:"color-3"}),onCellClick:k,onRowClick:C,onHeaderClick:w,onSort:x,onScroll:$,onResize:T}=n,I=b(null),P=b(null),z=ae({rows:a,widths:r.map((e=>e.width??"auto")),sortBy:"",sortType:""}),O=f((()=>{const{widths:e}=z,t={...v,"--grid-template-columns":e.map((e=>"number"==typeof e?`${e}px`:e)).join(" ")};if(!c)return t;const n=r.map(((t,n)=>{const{fixed:i}=t;return i?e[n]:0}));return r.map(((e,i)=>{const{fixed:a}=e;if(a)if(0===i)t["--datagrid-cell-inset-0"]=0;else if(i===n.length-1)t["--datagrid-cell-inset-"+(n.length-1)]="auto 0";else{const e="left"===a,r=(e?n.slice(0,i):n.slice(i+1)).reduce(((e,t)=>e+t))+"px",s=e?`${r} auto`:`auto ${r}`;t[`--datagrid-cell-inset-${i}`]=s}})),t}),[z.widths,c]),M=p(((e,t)=>{if(!c)return;const[...n]=z.widths;n[e]=t,z.widths=n,T?.(r[e],t)}),[c]),D=p(((e,t)=>{if(e?.sorter){const[t,n]=function(e,t,n){const i=["desc","asc"];if(e===n){const e=i.findIndex((e=>e===t))+1,a=i[e]||"";return[""===a?"":n,a]}return[n,"desc"]}(z.sortBy,z.sortType,e.id);Object.assign(z,{sortBy:t,sortType:n}),x?.(t,n)}w?.(e,t)}),[]),S=f((()=>{const{sortBy:e,sortType:t}=z;if(e&&!x){const n=r.find((t=>t.id===e))?.sorter,i="function"==typeof n?n:(t,n)=>n[e]-t[e],s=[...a].sort(i);return"desc"===t?s:s.reverse()}return a}),[a,r,z.sortBy,z.sortType]);u((()=>{if(!I.current)return;const{current:e}=I,t=e.querySelector(".i-datagrid-row")?.children;t?.length&&(z.widths=Array.from(t).map((e=>e.offsetWidth)))}),[r,c]),u((()=>{h&&P.current?.scrollTop(0)}),[h]);const j={"--padding":d,...O};return e(de,{ref:P,autoHide:!0,autoHeight:!0,autoHeightMax:g,style:j,className:i("i-datagrid-container",y,{"i-datagrid-bordered":s,"i-datagrid-striped":l}),renderView:e=>t("div",{...e,className:i({"i-datagrid-loading":h})}),onScroll:$,children:[e("div",{ref:I,className:"i-datagrid",children:[o&&t(at,{columns:r,resizable:c,sortType:z.sortType,sortBy:z.sortBy,onWidthChange:M,onHeaderClick:D}),S.map(((e,n)=>t(it,{row:n+(o?1:0),data:e,columns:r,onCellClick:k,onRowClick:C},n))),S.length<1&&m]}),h&&N()]})};function st(n){const{label:a,className:r,labelInline:s,style:l,children:o,status:c,tip:d,required:u}=n;return e("label",{className:i("i-input-label",r,{"i-input-inline":s}),style:l,children:[a&&e("span",{className:"i-input-label-text",children:[u&&t("span",{className:"error",children:"*"}),a]}),o,d&&t("span",{className:i("i-input-message",{[`i-input-${c}`]:"normal"!==c}),children:d})]})}const lt=c(((n,a)=>{const{type:r="text",label:s,name:l,value:o=n.initValue??"",initValue:c="",prepend:d,append:m,labelInline:h,className:g,status:v="normal",message:b,tip:y,clear:N,hideVisible:k,border:C,required:w,onChange:x,onEnter:$,style:T,...I}=n,P=ae({value:o,type:r,visible:!1}),M=p((e=>{const t=e.target.value;P.value=t,x?.(t,e)}),[]),D=re((e=>{"Enter"===e.code&&$?.()})),S=f((()=>{if("password"===r)return P.visible?t(z,{}):t(O,{})}),[P.visible]);u((()=>{P.value=o}),[o]);const j={ref:a,type:P.type,name:l,value:P.value,className:i("i-input",`i-input-${r}`),onChange:M,onKeyDown:D,...I},E=N&&P.value,B="password"===r&&!!P.value;return t(st,{label:s,labelInline:h,className:g,style:T,tip:b??y,status:v,required:w,children:e("div",{className:i("i-input-item",{[`i-input-${v}`]:"normal"!==v,"i-input-borderless":!C}),children:[d&&t("div",{className:"i-input-prepend",children:d}),t("input",{...j}),t(He,{active:!!E||B,icon:S,onClick:()=>{if("password"===r&&!k)return void Object.assign(P,{visible:!P.visible,type:P.visible?"password":"text"});x?.("")}}),m&&t("div",{className:"i-input-append",children:m})]})})})),ot=c(((n,a)=>{const{label:r,name:s,value:l=n.initValue??"",initValue:o,labelInline:c,step:d=1,min:m=-1/0,max:h=1/0,thousand:g,precision:f,type:v,className:b,status:y="normal",append:N,border:k,prepend:C,message:w,tip:x,hideControl:$,style:P,onChange:z,onEnter:O,onInput:M,onBlur:D,...S}=n,j=ae({value:l}),E=p((e=>We(e,m,h)),[m,h]),B=p((e=>Be(e,{precision:f,thousand:g})),[f,g]),Y=p((e=>e?"number"!=typeof e&&g?e.replaceAll(g,""):e:""),[g]),A=re((e=>{const{value:t}=e.target,n=Y(t.replace(/[^\d\.-]/g,""));j.value=n,z?.(+n,e)})),L=re((e=>{const t=Y(j.value)??0,n=E(+t+e);j.value=B(n),z?.(n)}));u((()=>{j.value=l}),[l]);const V={ref:a,name:s,value:j.value,className:"i-input i-input-number",onChange:A,...S};return t(st,{label:r,labelInline:c,className:b,style:P,tip:w??x,status:y,children:e("div",{className:i("i-input-item",{[`i-input-${y}`]:"normal"!==y,"i-input-borderless":!k}),children:[C&&t("div",{className:"i-input-prepend",children:C}),!$&&t(He,{active:!0,icon:t(T,{}),onClick:()=>L(-d)}),t("input",{...V}),!$&&t(He,{active:!0,icon:t(I,{}),onClick:()=>L(d)}),N&&t("div",{className:"i-input-append",children:N})]})})})),ct=c(((e,n)=>{const{label:a,name:r,value:s=e.initValue??"",initValue:l,labelInline:o,className:c,status:d="normal",message:m,tip:h,autoSize:g,border:f,style:v,onChange:y,onEnter:N,...k}=e,C=ae({value:s}),w=b(null),x=p((e=>{const t=e.target.value;C.value=t;const n=w.current?.firstChild;g&&n&&(n.style.height=`${n.scrollHeight}px`),y?.(t,e)}),[]),$=re((e=>{"Enter"===e.code&&N?.()}));u((()=>{C.value=s}),[s]);const T={ref:n,name:r,value:C.value,className:"i-input i-textarea",onChange:x,onKeyDown:$,...k};return t(st,{label:a,labelInline:o,className:c,style:v,tip:m??h,status:d,children:t("div",{ref:w,className:i("i-input-item",{[`i-input-${d}`]:"normal"!==d,"i-input-borderless":!f}),children:t("textarea",{...T})})})}));lt.Textarea=ct,lt.Number=ot,lt.Range=n=>{const{label:a,name:r,value:s=n.initValue??"",initValue:l,labelInline:o,min:c=-1/0,max:d=1/0,type:m,className:h,status:g="normal",message:f,tip:v,append:b,prepend:y,step:N=1,thousand:k,precision:C,hideControl:w,placeholder:x,border:$,onChange:P,onBlur:z,style:O,...D}=n,S=ae({value:s}),j=p((e=>We(e,c,d)),[c,d]),E=p((e=>Be(e,{precision:C,thousand:k})),[C,k]),B=p((e=>e?"number"!=typeof e&&k?e.replaceAll(k,""):e:""),[k]),Y=re(((e,t)=>{const{value:n}=e.target,i=B(n.replace(/[^\d\.-]/g,"")),a=Array.isArray(S.value)?S.value:[];a[t]=+i,S.value=a,P?.(a,e)})),A=re(((e,t,n)=>{e.preventDefault(),e.stopPropagation();const i=Array.isArray(S.value)?S.value:[],a=B(i[n])??0,r=j(+a+t);i[n]=E(r),S.value=i,P?.(i,e)})),L=re((e=>{e.preventDefault(),e.stopPropagation();const t=S.value??[],n=t[0];t[0]=t[1],t[1]=n,S.value=t,P?.(t)}));u((()=>{S.value=s}),[s]);const V={name:r,className:"i-input i-input-number",...D};return t(st,{label:a,labelInline:o,className:h,style:O,tip:f??v,status:g,children:e("div",{className:i("i-input-item",{[`i-input-${g}`]:"normal"!==g,"i-input-borderless":!$}),children:[y&&t("div",{className:"i-input-prepend",children:y}),!w&&t(He,{active:!0,icon:t(T,{}),onClick:e=>A(e,-N,0)}),t("input",{value:S.value?.[0]||"",placeholder:x?.[0],...V,onChange:e=>Y(e,0)}),!w&&t(He,{active:!0,icon:t(I,{}),onClick:e=>A(e,N,0)}),t(He,{active:!0,icon:t(M,{}),style:{margin:0},onClick:L}),!w&&t(He,{active:!0,icon:t(T,{}),onClick:e=>A(e,-N,1)}),t("input",{value:S.value?.[1]||"",placeholder:x?.[1],...V,onChange:e=>Y(e,1)}),!w&&t(He,{active:!0,icon:t(I,{}),onClick:e=>A(e,N,1)}),b&&t("div",{className:"i-input-append",children:b})]})})};const dt=c(((n,a)=>{const{getContainer:r=e=>e?.offsetParent??document.body,trigger:s,arrow:l,arrowProps:o={},className:c,children:d,...u}=n,p=f((()=>{let{left:e,top:t,pos:n}=o,i="";switch(n){case"left":e+=2,i="translate(-100%, -50%) rotate(180deg)";break;case"right":e-=2,i="translate(0, -50%)";break;case"top":t-=2,i="translate(-50%, -50%) rotate(-90deg)";break;case"bottom":t+=2,i="translate(-50%, -50%) rotate(90deg)"}return{left:e,top:t,transform:i}}),[o]),m=e("div",{ref:a,className:i("i-popup",c),...u,children:[l&&t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"i-popup-arrow",style:p,children:t("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z"})}),d]});return me(m,r(s))}));function ut(i){const{visible:a=!1,content:r,trigger:s="hover",gap:l=12,offset:o=8,fixed:c,position:d="top",showDelay:p=16,hideDelay:g=12,touchable:N,arrow:k=!0,align:C,fitSize:w,watchResize:x,clickOutside:$=!0,disabled:T,referToWindow:I,style:P,className:z,getContainer:O,children:M,onVisibleChange:D}=i,S=b(null),j=b(null),E=ae({show:!1,toggling:!1,style:{position:c?"fixed":"absolute"},arrowProps:{}});se((e=>{if(!$)return;const t=e.target,n=S.current?.contains(t);E.show&&(!n||"contextmenu"===s)&&A(!1)}),j);const B=()=>{T||E.show&&("hover"!==s||"hover"===s&&!N)||(E.show=!0,E.toggling&&clearTimeout(E.toggling),E.toggling=setTimeout((()=>{const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=De(S.current,j.current,{position:d,gap:l,offset:o,align:C,refWindow:I});E.style={...E.style,opacity:1,transform:"none",left:e,top:t},E.arrowProps={left:n,top:i,pos:a},E.toggling&&clearTimeout(E.toggling),D?.(!0)}),p))},Y=()=>{E.show&&(E.toggling=setTimeout((()=>{E.style={...E.style,opacity:0,transform:"translate(0, 2px)"},setTimeout((()=>{E.show=!1,E.toggling&&clearTimeout(E.toggling),D?.(!1)}),160)}),g))},A=e=>{void 0===e?E.show?Y():B():e?B():Y()},L=le((()=>({click:{onClick:()=>A(!0)},hover:{onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},focus:{onFocus:()=>A(!0),onBlur:()=>A(!1)},contextmenu:{onContextMenu:e=>{if(e.preventDefault(),e.stopPropagation(),E.show){const[t,n]=Se(e,j.current);E.style={...E.style,left:t,top:n}}else E.show=!0,E.toggling=setTimeout((()=>{const[t,n]=Se(e,j.current);E.style={...E.style,opacity:1,transform:"none",left:t,top:n},E.toggling&&clearTimeout(E.toggling),D?.(!0)}),p)}},none:{}})),[]),V=f((()=>{if(!N)return{};const e={};return"hover"===s&&(e.onMouseEnter=()=>A(!0),e.onMouseLeave=()=>A(!1)),e}),[N,s]),W=()=>{if(!E.show)return;const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=De(S.current,j.current,{position:d,gap:l,offset:o,align:C,refWindow:I});Object.assign(E,{style:{...E.style,left:e,top:t},arrowProps:{left:n,top:i,pos:a}})};return u((()=>{if("contextmenu"===s)return;const{observe:e,unobserve:t,disconnect:n}=function(){const e=new WeakMap,t=new ResizeObserver((t=>{t.map((t=>{const n=e.get(t.target);n?.(t.target)}))}));return{observe:function(n,i){e.get(n)||(n&&t.observe(n),e.set(n,i))},unobserve:function(n){n&&t.unobserve(n),e.delete(n)},disconnect:function(){t.disconnect()}}}();return S.current&&e(S.current,W),x&&j.current?(e(j.current,W),()=>{x&&j.current&&(t(j.current),S.current&&t(S.current),n())}):void 0}),[x,j.current,S.current]),y((()=>{if(!w||!E.show)return;const e=["top","bottom"].includes(d),t=S.current?.[e?"offsetWidth":"offsetHeight"];E.style={...E.style,[e?"width":"height"]:t}}),[E.show,w]),y((()=>{A(a)}),[a]),e(n,{children:[v.map(M,(e=>{if(!m(e))return;const{type:t,props:n}=e;if("function"==typeof t)return e;const{className:i,...a}=n;return h(e,{ref:S,className:i,...L[s],...a})})),E.show&&t(dt,{ref:j,arrow:k&&"contextmenu"!==s,style:{...P,...E.style},arrowProps:E.arrowProps,className:z,...V,trigger:S.current,getContainer:O,children:r})]})}const pt=a=>{const{value:r,month:s,weeks:l=["一","二","三","四","五","六","日"],renderDate:o=e=>e.date(),disabledDate:c,onDateClick:d}=a,u=ue(),p=f((()=>{const e=[],t=s.add(-1,"month").endOf("month");let{$W:n,$D:i}=t;if(0!==n){const i=Array.from({length:n}).map(((e,i)=>t.add(i+1-n,"day")));e.push(...i)}const a=s.endOf("month");return i=a.$D,n=a.$W,e.push(...Array.from({length:i}).map(((e,t)=>a.add(t+1-i,"day")))),0!==n&&e.push(...Array.from({length:7-n}).map(((e,t)=>a.add(t+1,"day")))),e}),[s]),m=re((e=>{c?.(e)||d?.(e)}));return e(n,{children:[t("div",{className:"i-datepicker-weeks",children:l.map(((e,n)=>t("span",{className:"i-datepicker-week",children:e},n)))}),t("div",{className:"i-datepicker-dates",children:p.map(((e,n)=>{const a=e.isSame(r,"day"),l=e.isSame(s,"month"),d=e.isSame(u,"day"),p=c?.(e);return t("div",{className:i("i-datepicker-item",{"i-datepicker-active":a,"i-datepicker-same-month":l,"i-datepicker-today":d,"i-datepicker-disabled":p}),onClick:()=>m(e),children:o(e)},n)}))})]})},mt=[1,2,3,4,5,6,7,8,9,10,11,12],ht=n=>{const{value:i,unitMonth:a="月",unitYear:r="年",renderYear:s,renderMonth:l,onClick:o}=n;return e("a",{className:"i-datepicker-action","data-ripple":!0,onClick:o,children:[t("span",{children:s?.(i.year())}),r,t("span",{children:l?.(i.month()+1)}),a]})},gt=n=>{const{value:a,unitYear:r,unitMonth:l,renderDate:o,renderMonth:c=e=>e,renderYear:d=e=>e,disabledDate:m,onDateClick:h}=n,g=ae({today:a,month:a||ue(),selectedYear:ue(),years:[],selectable:!1}),f=b(null),v=p((e=>{g.month=g.month[e?"add":"subtract"](1,"month")}),[]),y=s({interval:100},(e=>{const t=e.deltaY<0;g.years=g.years.map((e=>e+(t?-1:1)))}));return u((()=>{if(!g.selectable)return;g.selectedYear=g.month;const e=g.selectedYear.year(),t=Array.from({length:7}).map(((t,n)=>e-3+n));g.years=[...t]}),[g.selectable]),u((()=>{g.today=a,g.month=a||ue()}),[a]),e("div",{className:"i-datepicker",children:[e("div",{className:"i-datepicker-units",children:[t(ht,{value:g.month,unitYear:r,unitMonth:l,renderMonth:c,renderYear:d,onClick:()=>g.selectable=!0}),t("a",{className:"ml-auto i-datepicker-action","data-ripple":!0,onClick:()=>v(!1),children:t(ke,{icon:t(D,{})})}),t("a",{className:"i-datepicker-action","data-ripple":!0,onClick:()=>v(!0),children:t(ke,{icon:t(S,{})})})]}),e("div",{className:i("i-datepicker-ym",{"i-datepicker-active":g.selectable}),children:[t(He,{active:!0,className:"i-datepicker-close",onClick:()=>g.selectable=!1}),t("div",{ref:f,className:"i-datepicker-years",onWheel:y,children:g.years.map((e=>t("a",{className:i("i-datepicker-year",{"i-datepicker-active":e===g.selectedYear.year()}),onClick:()=>g.selectedYear=g.selectedYear.year(e),children:d(e)},e)))}),t("div",{className:"i-datepicker-months",children:mt.map((e=>t("a",{className:i("i-datepicker-month",{"i-datepicker-active":e===g.month.month()+1}),onClick:()=>{return t=e,g.month=g.month.year(g.selectedYear.year()).month(t-1),void(g.selectable=!1);var t},children:c(e)},e)))})]}),t(pt,{value:g.today,month:g.month,disabledDate:m,onDateClick:e=>{e.isSame(g.today,"day")||(e.isSame(g.month,"month")||(g.month=e),g.today=e,h?.(e))},renderDate:o})]})};ue.extend(pe);const ft=["YYYY-MM-DD","YYYY-M-D","YYYY/MM/DD","YYYY/M/D"],vt=e=>{const{name:n,value:i,weeks:a,format:r="YYYY-MM-DD",renderDate:s,renderMonth:l,renderYear:o,popupProps:c,disabledDate:d,onDateClick:p,onChange:m,onBlur:h,...v}=e,b=ae({value:i}),[y,N]=g(!1),k=f((()=>{if(!b.value)return null;const e=ue(b.value,r,!0);return e.isValid()?e:null}),[b.value]),C=e=>{b.value=e,m?.(e)},w=()=>{if(!b.value)return;const e=ue(b.value,ft,!0);e.isValid()?C(e.format(r)):C("")};return u((()=>{b.value=i}),[i]),t(ut,{visible:y,trigger:"click",position:"bottom",arrow:!1,align:"start",content:t(gt,{value:k,weeks:a,renderDate:s,renderMonth:l,renderYear:o,disabledDate:d,onDateClick:e=>{C(e.format(r))}}),...c,watchResize:!0,onVisibleChange:N,children:t(lt,{value:b.value,prepend:t(ke,{icon:t(j,{}),className:"i-datepicker-icon",size:"1em"}),onChange:C,onBlur:e=>{h?.(e),w()},onEnter:w,...v})})},bt=n=>{const{data:a,colon:r,columns:s=1,gap:l=".5em",align:o,labelWidth:c,labelAlign:d,vertical:u,equally:p,style:m,className:h}=n;return t("div",{className:i("i-description",h),style:{"--description-label-width":c,gridTemplateColumns:`repeat(${s}, ${p?"1fr":"auto"})`,gap:l,textAlign:o,...m},children:a.map(((n,a)=>{const{label:s,value:l,style:o,hidden:c,rowSpan:p=1,colSpan:m=1}=n;return c?t(N,{},a):e("div",{className:i("i-description-item",{"i-description-item-vertical":u}),style:{gridColumn:`span ${m}`,gridRow:`span ${p}`,...o},children:[s&&e("div",{className:"i-description-label",style:{textAlign:d},children:[s,r]}),t("div",{className:"i-description-value",children:l})]},a)}))})};function yt(n){const{visible:a,position:r="left",header:s,footer:l,backdropClosable:o=!0,hideCloseButton:c,className:d,children:m,onVisibleChange:h,onClose:f,...v}=n,[y,N]=g(a),[k,C]=g(a),w=b(!0);u((()=>{a?x():$()}),[a]);const x=p((()=>{w.current&&(N(!0),h?.(!0),w.current=!1,setTimeout((()=>{C(!0),w.current=!0}),24))}),[]),$=p((()=>{w.current&&(w.current=!1,C(!1),setTimeout((()=>{N(!1),h?.(!1),w.current=!0,f?.()}),240))}),[]),T=p((function(){o&&$()}),[]);return me(y&&t("div",{className:i("i-backdrop-drawer",d,{"i-active":k}),onClick:T,...v,children:e("div",{className:i("i-drawer",`i-drawer-${r}`),onClick:e=>e.stopPropagation(),children:[e("header",{className:"i-drawer-header",children:[s,t(He,{active:!c,className:"i-drawer-close",onClick:$})]}),t("div",{className:"i-drawer-content",children:m}),t("div",{className:"i-drawer-footer",children:l})]})}),document.body)}const Nt=c(((n,a)=>{const{active:r,type:s,align:l,disabled:o,label:c,style:d,className:u,children:p,...m}=n;return e("li",{ref:a,className:i("i-list-item",u,{"i-list-item-active":r,"i-list-option":"option"===s,disabled:o}),style:{alignItems:l,...d},...m,children:[void 0!==c&&t("span",{className:"i-list-item-label",children:c}),p]})})),kt=e=>{const{label:n,type:a,className:r,children:s,...l}=e;return t("ul",{className:i("i-list",r),...l,children:v.map(s,((e,t)=>{const i="function"==typeof n?n(t):n;return h(e,{label:i,...e.props,type:a})}))})};kt.Virtual=e=>{const{data:n,itemKey:i,renderItem:a,...r}=e;return t(he,{data:n,itemKey:i,...r,children:(e,t)=>a?.(e,t)})},kt.Item=Nt;const{Item:Ct}=kt,wt=e=>{const{width:n,content:i,children:a,...r}=e;return t(ut,{trigger:"click",position:"bottom",touchable:!0,content:t(kt,{className:"i-dropdown-content",style:{minWidth:n},children:i}),...r,children:a})};wt.Item=e=>{const{more:n,moreProps:i,...a}=e,r=t(Ct,{...a});return n?t(ut,{position:"right",touchable:!0,arrow:!1,align:"start",offset:10,...i,content:t(kt,{className:"i-dropdown-content",onClick:e=>e.stopPropagation(),children:n}),children:r}):r};const xt=e=>{const{as:n="div",align:a,justify:r,direction:s,wrap:l,gap:o,columns:c,className:d,style:u,...p}=e,m=f((()=>{if(c)return"number"==typeof c?`repeat(${c}, 1fr)`:c}),[c]);return t(n,{...p,style:{alignItems:a,justifyContent:r,gap:o,flexDirection:s,flexWrap:!0===l?"wrap":l,gridTemplateColumns:m,...u},className:i(d,{[c?"grid":"flex"]:!0})})},$t=k({});class Tt{id;data={};rules={};constructor(){this.id=r(8),this.data={}}get(e){return e?this.data[e]:this.data}set(e,t){const n=this.id;if(this.data)return"string"==typeof e?(this.data[e]=t,void ge.publish(`${n}:set:${e}`,t)):void Object.keys(e).map((t=>{this.data[t]=e[t],ge.publish(`${n}:set:${t}`,e[t])}))}clear(){this.data&&Object.keys(this.data).map((e=>{ge.publish(`${this.id}:set:${e}`,void 0),this.data[e]=void 0}))}async validate(e){const{id:t,rules:n,data:i}=this;if(!n)return i;if(e){const a=n[e],r={validator:e=>Array.isArray(e)?e.length>0:![void 0,null,""].includes(e),message:void 0};"function"==typeof a?r.validator=a:!0===a?r.message="required":Object.assign(r,a);const s=r.validator?.(i[e],this);return s?(ge.publish(`${t}:invalid:${name}`,{message:null,status:"normal"}),!0):(ge.publish(`${t}:invalid:${e}`,{message:r.message,status:"error"}),!1)}let a=!0;return Object.keys(i).map((e=>{const r=n[e];if(void 0===r)return;const s={validator:e=>Array.isArray(e)?e.length>0:!!e,message:void 0};"function"==typeof r?s.validator=r:!0===r?s.message="required":Object.assign(s,r);const l=s.validator?.(i[e],this);l?ge.publish(`${t}:invalid:${e}`,{message:null,status:"normal"}):(ge.publish(`${t}:invalid:${e}`,{message:s.message,status:"error"}),a=!1)})),!!a&&i}}const It=e=>{const{form:n={},rules:a={},initialValues:r={},style:s,className:l,width:o,children:c,...d}=e;return u((()=>{Object.assign(n,{data:{...r},rules:{...a}})}),[n,a]),t($t.Provider,{value:n,children:t("form",{style:{...s,width:o},className:i("i-form",l),...d,children:c})})};function Pt(i){const{title:a,footer:r,hideCloseButton:s,footerLeft:l,okButtonProps:o={children:"确定",onClick:i.onOk},cancelButtonProps:c={secondary:!0,children:"关闭",onClick:i.onClose},children:d,onClose:u}=i,p=a||!s,m=f((()=>{if(r||null===r)return r;const i=Object.assign({},o),a=Object.assign({},c);return e(n,{children:[l,t(Ne,{...i}),t(Ne,{...a})]})}),[r,o,c]);return e(n,{children:[p&&e("header",{className:"i-modal-header",children:[a&&t("b",{children:a}),t(He,{active:!s,className:"i-modal-close",onClick:u})]}),t("div",{className:"i-modal-content",children:d}),t("footer",{className:"i-modal-footer",children:m})]})}function zt(n){const{visible:a,title:r,footer:s,okButtonProps:l,cancelButtonProps:o,closable:c=!0,hideBackdrop:d,backdropClosable:m=!0,hideCloseButton:h,width:f,height:v,customized:y,fixed:N,shadow:k=!0,children:C,style:w,className:x,footerLeft:$,onVisibleChange:T,onClose:I,onOk:P,...z}=n,[O,M]=g(a),[D,S]=g(!1),[j,E]=g(!1),B=b(!0),Y=p((()=>{B.current&&(M(!0),B.current=!1,setTimeout((()=>{S(!0),T?.(!0),B.current=!0}),24))}),[]),A=p((()=>{if(B.current){if(B.current=!1,!c)return E(!0),void setTimeout((()=>{E(!1),B.current=!0}),400);S(!1),setTimeout((()=>{M(!1),B.current=!0,T?.(!1),I?.()}),240)}}),[c]),L=p((function(){m&&A()}),[c,m]);return u((()=>{a?Y():A()}),[a]),O?me(t("div",{className:i("i-modal-container",{"i-modal-backdrop":!d,"i-modal-customized":y,"i-modal-active":D,fixed:N},x),style:w,onClick:L,children:e("div",{className:i("i-modal",{bounced:j,shadow:k}),style:{width:f,height:v},onClick:e=>e.stopPropagation(),...z,children:[y&&C,!y&&t(Pt,{title:r,hideCloseButton:h,footer:s,okButtonProps:l,cancelButtonProps:o,children:C,footerLeft:$,onOk:P,onClose:A})]})}),document.body):null}It.useForm=function(e){const t=b();return t.current||(t.current=e??new Tt),t.current},It.Field=function(e){const{name:t,required:n,children:i}=e,a=ae({value:void 0,status:"normal",message:void 0,update:0}),r=C($t),{id:s}=r,l=p((e=>{t&&r.set(t,e)}),[t]),o=f((()=>v.map(i,(e=>{if(!m(e))return null;const{onChange:t}=e.props,{value:i,status:r,message:s}=a;return h(e,{value:i,status:r,message:s,required:n,onChange:(...e)=>{l(e[0]),t?.(...e),Object.assign(a,{status:"normal",message:void 0})}})}))),[i,a.update]);return u((()=>{if(t)return ge.subscribe(`${s}:set:${t}`,((e,t)=>{a.value=t,a.update+=1})),ge.subscribe(`${s}:invalid:${t}`,((e,t)=>{Object.assign(a,t),a.update+=1})),setTimeout((()=>{r.data[t]=r.data[t]??void 0}),0),()=>{ge.unsubscribe(`${s}:set:${t}`),ge.unsubscribe(`${s}:invalid:${t}`)}}),[t]),t?o:i};const Ot=c(((e,n)=>{const i=ae({});return w(n,(()=>({update:(e={})=>{Object.assign(i,e)}}))),t(zt,{...e,...i})})),Mt=e=>{const{as:n="span",size:a,weight:r,decoration:s,gradient:l,style:o,className:c,children:d}=e,u=f((()=>l&&Array.isArray(l)?{background:`-webkit-linear-gradient(${l.join(",")})`,backgroundClip:"text"}:{}),[l]);return t(n,{style:{fontSize:a,fontWeight:r,textDecoration:s,...u,...o},className:i(c,{"i-text-gradient":l}),children:d})};function Dt(n){const{value:i,height:a=40,size:r=8}=n;return e("div",{className:"i-progress-circle",children:[e("svg",{width:a,height:a,children:[t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--background-opacity-2)",strokeWidth:r}),t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--color-main)",strokeWidth:r,strokeDasharray:100,pathLength:100,className:"i-progress-circle-path",strokeLinecap:"round",style:{strokeDashoffset:`calc(100 - ${i})`}})]}),e("span",{className:"i-progress-circle-value",children:[t("span",{children:i}),t(Mt,{size:".81em",className:"color-7",children:"%"})]})]})}Mt.Number=function(e){const{count:n,to:i,decimal:a,thousand:r=",",duration:s=2400,easing:l,...o}=e,[c,d]=g(n),p=f((()=>{if(void 0===c)return;const e=c.toFixed(a);return r?Be(c,{precision:a,thousand:r}):e}),[c,r]);return u((()=>{void 0!==n&&void 0!==i&&function(e,t,n=1e3,i,a=e=>1-Math.pow(1-e,4)){const r=performance.now(),s=t-e;let l=requestAnimationFrame((function e(){l=requestAnimationFrame(e);let t=(performance.now()-r)/n;t>=1&&(t=1,cancelAnimationFrame(l));const o=s*a(t);i?.(o)}))}(n,i,s,(e=>d(n+e)),l)}),[i]),u((()=>d(n)),[n]),t(Mt,{...o,children:p})},Mt.Time=function(e){const{seconds:n,zero:i,units:a,...r}=e,s=f((()=>void 0===n?"":function(e,t){const n=[],{zero:i=!0,units:a=["",":",":"]}=t||{},r=a.length;let s=0;for(;s<r&&!(e<=0&&s>1);){const t=Math.round(e%60);e=Math.floor(e/60),n.unshift((i&&t<10?`0${t}`:t)+a[s++])}return n.join("")}(n,{zero:i,units:a})),[n]);return t(Mt,{...r,children:s})};const St=c(((e,n)=>{const{value:a,size:r,barClass:s,dragging:l,renderCursor:o,onMouseDown:c}=e;return t("div",{ref:n,className:"i-progress",style:{height:r},onMouseDown:c,children:t("div",{className:i("i-progress-bar",s,{"no-transition":l}),style:{width:`${a}%`},children:o&&t("a",{className:"i-progress-cursor",children:o(a??0)})})})})),jt=n=>{const{value:a=0,size:r=8,height:s=40,precision:l=0,style:o,draggable:c=!0,type:d="line",barClass:p,label:m,labelInline:h,className:g,renderCursor:v,onChange:y}=n,N=b(null),k=ae({value:a,dragging:!1,width:0,start:0}),C=f((()=>{let e=+k.value.toFixed(l);return e=Math.min(100,e),e=Math.max(0,e),e}),[k.value,l]),w=re((e=>{if(!N.current||!c)return;const t=N.current.getBoundingClientRect(),n=100*(e.pageX-t.left)/t.width;Object.assign(k,{value:n,width:t.width,start:t.left,dragging:!0})})),x=re((e=>{if(!k.dragging||!c)return;e.preventDefault();const{start:t,width:n}=k,i=e.pageX-t;i<0||i>n||(k.value=100*(e.pageX-t)/n)})),$=re((()=>{k.dragging&&c&&(y?.(C),k.dragging=!1)}));return _e(x),Je($),u((()=>{k.value=a>100?100:a<0?0:a}),[a]),e("div",{className:i("i-input-label",g,{"i-input-inline":h}),style:o,children:[m&&t("span",{className:"i-input-label-text",children:m}),"line"===d&&t(St,{ref:N,size:r,barClass:p,dragging:k.dragging,value:k.value,renderCursor:v,onMouseDown:w}),"circle"===d&&t(Dt,{value:k.value,height:s,size:r})]})},Et=c(((n,a)=>{const{style:r,hideControls:s,autoplay:l,muted:o,volume:c=50,height:d,width:p,useOriginControls:m,timeProgressProps:h={barClass:"bg-2"},volumeProgressProps:g={barClass:"bg-1"},className:f,onFullScreenChange:v,...y}=n,N=ae({playing:l,volume:o?0:c,volumeCache:0,muted:o,current:0,duration:0,isFullscreen:!1}),k=b(null),C=e=>{const t=e.target;t.paused||Object.assign(N,{current:t.currentTime})},x=e=>{N.playing=!e.target.paused},$=()=>{const e=k.current?.parentElement;e&&(N.isFullscreen=document.fullscreenElement===e)},T=e=>{const t=e.target;Object.assign(N,{volume:100*t.volume,muted:0===t.volume})},I=()=>{const e=k.current;e&&(e.paused?e.play():e.pause())},P=()=>{const e=k.current;e&&(e.currentTime=0,e.pause())},z=()=>{const e=k.current?.parentElement;var t;e&&(N.isFullscreen?document.exitFullscreen?.():(t=e,t.requestFullscreen?.()),v?.(!N.isFullscreen))};return w(a,(()=>({play:()=>{const e=k.current;e&&e.play()},pause:()=>{const e=k.current;e&&e.pause()},stop:P,fullscreen:z,getVideo:()=>k.current}))),u((()=>{const e=k.current;if(e)return e.addEventListener("timeupdate",C),e.addEventListener("play",x),e.addEventListener("pause",x),e.addEventListener("volumechange",T),document.addEventListener("fullscreenchange",$),()=>{e.removeEventListener("timeupdate",C),e.removeEventListener("play",x),e.removeEventListener("pause",x),e.removeEventListener("volumechange",T),document.removeEventListener("fullscreenchange",$)}}),[]),e("div",{className:i("i-video",f),style:{height:d,width:p,...r},onClick:I,onDoubleClick:()=>z(),children:[t("video",{ref:k,onCanPlay:e=>{const t=e.target;Object.assign(N,{duration:t.duration,current:t.currentTime}),t.volume=N.volume/100},...y,controls:m}),!s&&!m&&e("div",{className:"i-video-controls",onClick:e=>e.stopPropagation(),children:[e("div",{className:"i-video-control flex-1",children:[t(Ne.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(ke,{icon:t(E,{})}),active:N.playing,onClick:I,children:t(ke,{icon:t(B,{})})}),t(Ne,{className:"i-video-btn",flat:!0,square:!0,onClick:P,children:t(ke,{icon:t(Y,{})})}),e("span",{className:"i-video-times",children:[t(Mt.Time,{seconds:N.current})," /",t(Mt.Time,{seconds:N.duration})]}),t(jt,{className:"mr-8",...h,value:N.current/N.duration*100,onChange:e=>{const t=k.current;t&&(t.currentTime=N.duration*e/100)}})]}),t("div",{className:"i-video-control",children:t(Ne.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(ke,{icon:t(A,{})}),active:N.isFullscreen,onClick:()=>z(),children:t(ke,{icon:t(L,{})})})}),e("div",{className:"i-video-control",children:[t(Ne.Toggle,{className:"i-video-btn",flat:!0,square:!0,active:N.volume<=0,after:t(ke,{icon:t(V,{}),size:"1.2em"}),onClick:()=>{const e=k.current;if(e)return e.volume>0?(N.volumeCache=e.volume,void(e.volume=0)):void(e.volume=0===N.volumeCache?.5:N.volumeCache)},children:t(ke,{icon:t(W,{})})}),t(jt,{style:{width:100},className:"mr-8",...g,value:N.volume,onChange:e=>{const t=k.current;t&&(t.volume=e/100)}})]})]})]})}));function Bt(n){const{name:i,suffix:a,type:r}=n;switch(r){case Me.IMAGE:return t("img",{src:n.src});case Me.VIDEO:return t(Et,{...n});default:return e("div",{className:"i-preview-unknown",children:[t(ke,{icon:t(q,{}),size:"3em"}),t("h5",{className:"mt-4",children:i||a||"?"})]})}}function Yt(i){const{items:a=[],initial:r=0,renderFile:l=Bt,onRotate:o,onChange:c,onClose:d,onZoom:u}=i,p=ae({current:r,rotate:0,scale:1,translate:"0, 0"}),m=b(null),h=f((()=>a.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Ae(t.src)||"",t.type=Le(t.suffix,e.type),t}))),[a]),{file:g,content:v}=f((()=>{const e=h[p.current];return{file:e,content:l(e)}}),[p.current,a]),y=g.type===Me.IMAGE,N=e=>{const t=h.length,{current:n}=p;p.current=e>=t?0:e<0?t-1:e,c?.(p.current,n),p.rotate=h[p.current].rotate||0,1!==p.scale&&(p.scale=1,u?.(1)),o?.(p.rotate)},k=e=>{p.rotate+=e,o?.(p.rotate)},C=s({interval:60},(e=>{if(!y)return;let t=p.scale+(e.deltaY<0?.05:-.05);t>2&&(t=2),t<.25&&(t=.25),u?.(t),p.scale=t}));return e(n,{children:[t("div",{ref:m,className:"i-preview-content",style:{transform:`rotate(${p.rotate}deg) scale(${p.scale})`},onWheel:C,onClick:e=>e.stopPropagation(),children:v}),e("div",{className:"i-preview-controls",children:[t(Ne,{square:!0,flat:!0,onClick:d,children:t(ke,{icon:t($,{})})}),h.length>1&&e("span",{className:"px-8",children:[p.current+1," / ",h.length]}),1!==p.scale&&e(Ne,{flat:!0,onClick:()=>p.scale=1,children:[t(ke,{icon:t(F,{})}),e("span",{className:"mt-4",children:[(100*p.scale).toFixed(0),"%"]})]}),t(Ne,{square:!0,flat:!0,href:g.src,target:"_blank",children:t(ke,{icon:t(H,{})})}),t(Ne,{square:!0,flat:!0,href:g.src,download:!0,target:"_blank",children:t(ke,{icon:t(R,{})})}),t(Ne,{square:!0,flat:!0,onClick:()=>k(90),children:t(ke,{icon:t(X,{})})}),t(Ne,{square:!0,flat:!0,onClick:()=>k(-90),children:t(ke,{icon:t(U,{})})}),h.length>1&&e(n,{children:[t(Ne,{square:!0,flat:!0,onClick:()=>N(p.current-1),children:t(ke,{icon:t(D,{})})}),t(Ne,{square:!0,flat:!0,onClick:()=>N(p.current+1),children:t(ke,{icon:t(S,{})})})]})]})]})}function At(){const e=b(null);return n=>{const{items:i,modalProps:a,onClose:r,...s}=n,l=Ye(t(Ot,{ref:e,visible:!0,className:"i-preview",customized:!0,shadow:!1,...a,children:t(Yt,{...s,items:i,onClose:()=>{e.current?.update({visible:!1})}}),fixed:!0,onClose:()=>{r?.(),l?.()}}))}}const Lt=a=>{const{src:r,round:s,size:l,initSize:o,lazyload:c,fallback:d=t(ke,{icon:t(G,{}),size:"2em",className:"color-5"}),fit:p,style:m,className:h,children:g,usePreview:f,onLoad:v,onError:y,onClick:N,...k}=a,C=ae({status:"loading"}),w=b(null),x=p?"100%":void 0,{observe:$,unobserve:T}=Qe(),I=At();u((()=>{if(r&&(C.status="loading",c&&w.current))return $(w.current,((e,t)=>{t&&(e.setAttribute("src",e.dataset.src||""),T(e))})),()=>{w.current&&T(w.current)}}),[r]),k[c?"data-src":"src"]=r;const P="loading"===C.status?o:void 0;return t("div",{style:{width:l??P,height:l??P,...m},className:i("i-image",h,{rounded:s,[`i-image-${C.status}`]:C.status}),children:"error"===C.status?d:e(n,{children:[r&&t("img",{ref:w,style:{objectFit:p,width:x,height:x},...k,onLoad:e=>{v?.(e),C.status=void 0},onError:e=>{y?.(e),C.status="error"},onClick:e=>{N?.(e),f&&r&&I({items:[{src:r,type:Me.IMAGE}]})}}),r&&"loading"===C.status&&t(be,{}),g&&t("div",{className:"i-image-text",children:g})]})})};Lt.List=function(e){const{items:n=[],gap:i=8,columns:a,wrap:r,direction:s,usePreview:l,onClick:o,...c}=e,d=At(),u=f((()=>n.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Ae(t.src)||"",t.type=Le(t.suffix,e.type),t}))),[n]);return u.length?t(xt,{className:"i-image-list",gap:i,columns:a,wrap:r,direction:s,children:u.map(((e,n)=>t(Lt,{src:e.src,size:60,usePreview:!1,onClick:e=>((e,t)=>{o?.(e),l&&d({items:u,initial:t})})(e,n),...c},n)))}):""};const Vt={left:"flex-start",center:"center",right:"flex-end"},Wt=12,qt={duration:3e3,closable:!0,active:!1},Ft=function(){const e=document.createElement("div");return e.dataset.id="messages",document.body.append(e),e}(),Ht={callout(e){},close(){}},Rt={left:[],center:[],right:[]},Xt={left:[],center:[],right:[]};ce(Ft).render(t((function(){const i=b(null),a=ae({items:{left:[],center:[],right:[]},tops:{left:[],center:[],right:[]}}),r={left:0,center:0,right:0};u((()=>{Object.assign(Ht,{callout:function(e){const{align:t="center",unshift:n,onShow:r}=e,s=Rt[t][n?"unshift":"push"](e);a.items[t]=[...Rt[t]],setTimeout((()=>{const e=i.current?.offsetHeight||0;Rt[t][n?0:s-1].active=!0,a.items[t]=[...Rt[t]],Xt[t][n?"unshift":"push"](e),a.tops[t]=[...Xt[t]],r?.()}),0),0!==e.duration&&setTimeout(this.close.bind(e),e.duration)},close:function(){const e=this,{align:t="center",onHide:n}=e,i=Rt[t].findIndex((t=>t.id===e.id));i<0||(Rt[t][i].active=!1,a.items[t]=[...Rt[t]],e.timer=setTimeout((()=>{const i=Rt[t].findIndex((t=>t.id===e.id));Rt[t].splice(i,1),Xt[t].splice(i,1),a.tops[t]=[...Xt[t]],a.items[t]=[...Rt[t]],e.timer&&clearTimeout(e.timer),n?.()}),240))}})}),[]);const s=(e,s)=>{if(!e)return t(n,{});const{id:l,active:o,content:c,align:d="center",className:u}=e;r[d]+=a.tops[d][s-1]||0;const p=Wt*s+r[d];return t(Ut,{ref:i,active:o,content:c,top:p,className:u,style:{alignSelf:Vt[d]},onClick:Ht.close.bind(e)},l)};return e("div",{className:"i-messages",children:[a.items.left.map(s),a.items.center.map(s),a.items.right.map(s)]})}),{}));const Ut=c((function({active:e,content:n,top:a,className:r,style:s,onClick:l},o){return t("div",{ref:o,className:i("i-message",r,{"i-message-active":e}),style:{...s,top:a},onClick:l,children:n})}));function Gt(e){return(["string","number"].includes(typeof e)||m(e))&&(e={content:e}),e=Object.assign({id:r(7)},qt,e),Ht.callout(e),Ht.close.bind(e)}zt.useModal=function(){const e=b(null);return{open:n=>{const i=Ye(t(Ot,{ref:e,visible:!0,...n,onClose:()=>{n.onClose?.(),i?.()}}))},update:t=>{if(!e.current)return;const{update:n}=e.current;n(t)}}};const Kt=n=>{const{page:a,active:r,children:s,onChange:l}=n,[o,c]=g(!1);return e("a",{className:i("i-page",{"i-page-active":r,"i-page-loading":o,"i-page-disabled":!1}),"data-page":a,onClick:async()=>{r||o||(c(!0),await(l?.(a)),c(!1))},children:[o&&t(be,{}),s]})},Zt=a=>{const{page:r=1,size:s=10,total:l=0,sibling:o=2,prev:c=t(ke,{icon:t(D,{})}),next:d=t(ke,{icon:t(S,{})}),simple:p,jumper:m,className:h,renderEllipsis:v=()=>t(ke,{icon:t(K,{}),className:"color-7"}),renderPage:b=e=>e,onChange:y,...N}=a,[k,C]=g(r),[w,x]=g(!1),$=f((()=>Math.ceil(l/s)),[s,l]),[T,I,P]=f((()=>{const e=Math.max(1,k-o),t=Math.min($,k+o);return[e,t,Array.from({length:t-e+1}).map(((t,n)=>e+n))]}),[k,$,o]);if($<=k&&1===k)return t(n,{});const z=async e=>{if(y&&!w)return x(!0),new Promise((async t=>{void 0!==e&&(await y(e),C(e),x(!1),t())}))};return u((()=>C(r)),[r]),e("div",{className:i("i-pagination",h),...N,children:[c&&t(Kt,{page:k-1||1,onChange:z,children:c}),T>1&&t(Kt,{page:1,onChange:z,children:b(1)}),T>2&&v(),P.map((e=>t(Kt,{page:e,active:e===k,onChange:z,children:b(e)},e))),I<$-1&&v(),I<$&&t(Kt,{page:$,onChange:z,children:b($)}),d&&t(Kt,{page:k+1,onChange:z,children:d})]})},_t={children:"确定"},Jt={children:"取消",secondary:!0},Qt=n=>{const{trigger:i="click",visible:a,icon:r=t(ke,{icon:t(Z,{}),className:"error"}),content:s,okButtonProps:l,cancelButtonProps:o,children:c,align:d="end",position:u="top",offset:p=12,extra:m,onOk:h,onClose:g,...f}=n,v=ae({loading:!1,visible:a}),b=l?Object.assign({},_t,l):_t,y=o?Object.assign({},Jt,o):Jt,N=e("div",{className:"i-popconfirm",children:[e(xt,{gap:12,children:[r,t("div",{className:"i-popconfirm-content",children:s})]}),e(xt,{gap:12,justify:"flex-end",className:"mt-8 i-popconfirm-footer",children:[null!==o&&t(Ne,{...y,onClick:async e=>{y.onClick?.(e),await(g?.()),v.visible=!1}}),m,null!==l&&t(Ne,{loading:v.loading,...b,onClick:async e=>{v.loading=!0,b.onClick?.(e),await(h?.()),v.loading=!1,v.visible=!1}})]})]});return t(ut,{content:N,...f,trigger:i,visible:v.visible,align:d,offset:p,position:u,onVisibleChange:e=>{v.visible=e,f.onVisibleChange?.(e)},children:c})};function en(n){const{type:a="default",name:r,value:s,checked:l,disabled:o,children:c,onChange:d}=n;return e("label",{className:i("i-radio-item",{disabled:o}),children:[t("input",{type:"radio",name:r,checked:l,className:i("i-radio-input",`i-radio-${a}`),disabled:o,onChange:e=>{d?.(s,e)}}),t("span",{className:"i-radio-text",children:c})]})}function tn(n){const{label:a,name:r,options:s,value:l,type:o="default",status:c="normal",message:d,optionInline:p=!0,labelInline:m,disabled:h,required:g,className:v,onChange:b}=n,y=ae({value:l}),N=f((()=>Ee(s)),[s]),k=re(((e,t)=>{y.value=e,b?.(e,t)}));return u((()=>{y.value=l}),[l]),e("div",{className:i("i-radio i-input-label",{[`i-radio-${c}`]:"normal"!==c,"i-input-inline":m},v),children:[a&&e("span",{className:"i-input-label-text",children:[g&&t("span",{className:"error",children:"*"}),a,d&&t("p",{className:"i-radio-message",children:d})]}),t("div",{className:i("i-radio-options",{"i-options-block":!p,"i-radio-options-button":"button"===o}),children:N.map((e=>t(en,{name:r,value:e.value,checked:y.value===e.value,type:o,disabled:h||e.disabled,onChange:k,children:e.label},e.value)))})]})}tn.Item=en;const nn=n=>{const{dot:a,dotClass:r,outline:s,round:l,size:o="normal",className:c,children:d,onClose:u,onClick:p,...m}=n;return e("span",{className:i("i-tag",{"i-tag-outline":s,"i-tag-clickable":p,[`i-tag-${o}`]:"normal"!==o,round:l},c),onClick:p,...m,children:[a&&t("span",{className:i("i-tag-dot",r)}),d,u&&t(He,{active:!0,className:"i-tag-close",onClick:u})]})},an=n=>{const{value:a,options:r,filter:s,filterPlaceholder:l,multiple:o,empty:c=t(Xe,{}),onSelect:d,onFilter:u}=n;return e("div",{className:i("i-select-options",{"i-select-options-multiple":o}),children:[s&&o&&e("div",{className:"i-select-filter",children:[t(ke,{icon:t(_,{}),className:"color-8 ml-8 my-auto",size:"1.2em"}),t("input",{type:"text",className:"i-input",placeholder:l,onChange:u})]}),0===r.length&&c,r.map(((n,i)=>{const{label:r,value:s,disabled:l}=n,c=o?a?.includes(s):a===s;return e(kt.Item,{active:c,type:"option",onClick:()=>d?.(s,n),disabled:l,children:[o&&t(ke,{icon:t(J,{}),className:"i-select-option-check",size:"1em"}),r]},s||i)}))]})},rn=n=>{const{options:i,value:a,maxDisplay:r,multiple:s,onSelect:l}=n;return s?((e=[],t=[],n=3)=>{const i=e.flatMap((e=>t.includes(e.value)?[e]:[]));if(n>=i.length)return i;const a=i.length-n,r=i.slice(0,n);return r.push(a),r})(i,a,r).map(((n,i)=>{if("number"==typeof n)return e(nn,{children:["+",n]},i);const{label:a,value:r}=n;return t(nn,{onClose:e=>{e?.stopPropagation(),l?.(r,n)},children:a},r)})):i.find((e=>e.value===a))?.label},sn=c(((n,r)=>{const{type:s="text",name:l,label:o,value:c="",placeholder:d,options:m=[],multiple:h,prepend:v,append:b,labelInline:y,style:N,className:k,message:C,status:w="normal",hideClear:x,maxDisplay:$,border:T,filter:I,tip:P,filterPlaceholder:z="...",popupProps:O,onSelect:M,onChange:D,...S}=n,j=ae({inputValue:"",filterValue:"",value:c,loading:!1}),[E,B]=g(!1),Y=f((()=>Ee(m)),[m]),A=f((()=>{const{filterValue:e}=j;if(!e||!I)return Y;const t="function"==typeof I?I:t=>t.value.includes(e)||t.label.includes(e);return Y.filter(t)}),[Y,I,j.filterValue]),L=e=>{j.value=e,D?.(e)},V=p(((e,t)=>{if(M?.(e,t),h){const t=[...j.value],n=t.findIndex((t=>t===e));return n>-1?t.splice(n,1):t.push(e),void L(t)}B(!1),L(e)}),[]),W=re(a({delay:400},(e=>{const t=e.target.value;j.filterValue=t})));u((()=>{j.value=c}),[c]);const q=h?j.value.length>0:!!j.value,F=!x&&E&&q,H=C??P;return e("label",{className:i("i-input-label",k,{"i-input-inline":y}),style:N,children:[o&&t("span",{className:"i-input-label-text",children:o}),t(ut,{position:"bottom",arrow:!1,fitSize:!0,...O,visible:E,trigger:"none",onVisibleChange:e=>{B(e),I&&(j.filterValue="")},content:t(an,{options:A,value:j.value,multiple:h,filter:!!I,filterPlaceholder:z,onSelect:V,onFilter:W}),children:e("div",{className:i("i-input-item",{[`i-input-${w}`]:"normal"!==w,"i-input-borderless":!T,"i-input-focus":E}),onClick:()=>B(!0),children:[v,t("input",{ref:r,type:"hidden",value:j.value,...S}),h?q?t("div",{className:i("i-input i-select",{"i-select-multiple":h}),children:rn({options:Y,value:j.value,multiple:h,maxDisplay:$,onSelect:V})}):t("input",{className:"i-input i-select",placeholder:d,readOnly:!0}):null,!h&&t("input",{value:E?j.filterValue:j.value,className:"i-input i-select",placeholder:j.value||d,onChange:e=>{j.filterValue=e.target.value},readOnly:!I}),t(He,{active:!0,icon:F?void 0:t(Q,{}),onClick:e=>{E&&L(h?[]:"")}}),b]})}),H&&t("span",{className:"i-input-message",children:H})]})}));function ln(){return t("i",{className:"i-step-divider"})}const on=["finished","active","pending"];function cn(e,n){return t("span",{className:"i-step-item-index",children:"finished"===n?t(J,{style:{width:"1em",height:"1.5em"}}):e+1})}function dn(a){const{index:r=0,active:s=0,renderIcon:l=cn,title:o,vertical:c,line:d=t(ln,{}),style:u,className:p,children:m,onClick:h}=a,g=on[r===s?1:r<s?0:2];return t("div",{style:u,className:i("i-step-item",`i-step-item-${g}`,p),onClick:()=>{h?.(r)},children:e(n,c?{children:[e("div",{className:"i-step-item-left",children:[l?.(r,g),d]}),e("div",{className:"i-step-item-right",children:[t("div",{className:"i-step-item-title",children:o}),m&&t("div",{className:"i-step-item-content",children:m})]})]}:{children:[e("div",{className:"i-step-item-title",children:[l?.(r,g),t("span",{children:o}),d]}),m&&t("div",{className:"i-step-item-content",children:m})]})})}const un=e=>{const{active:n=0,vertical:a,renderIcon:r,line:s,style:l,className:o,children:c,onClick:d}=e,u=f((()=>{const e=[];let t=0;return v.map(c,(i=>{if(!i||i.type!==dn)return;const{props:l}=i;e.push({...i,props:{renderIcon:r,line:s,onClick:d,...l,vertical:a,active:n,index:t++}})})),e}),[n,c]);return t("div",{className:i("i-step",{"i-step-vertical":a},o),style:l,children:u})};function pn(e){const{index:n=0,active:a,type:r,transition:s,gap:l=0,itemHeight:o,vertical:c,style:d,className:u,children:p}=e,m=f((()=>"normal"===r?{[c?"paddingBlock":"paddingInline"]:l/2,height:o}:{transform:`translate(-${100*n}%, 0)`,transition:s}),[n,l,o,c,r]);return t("div",{style:{...d,...m},className:i("i-swiper-item",u,{"i-swiper-active":a}),"data-index":n,children:p})}un.Item=dn;const mn=c(((a,r)=>{const{type:s="normal",initial:l=0,display:o=1,scroll:c=1,loop:d=!0,vertical:m,prev:h=t(ke,{icon:t(D,{}),size:"2em"}),next:g=t(ke,{icon:t(S,{}),size:"2em"}),duration:y=600,interval:N=3e3,autoplay:k,pauseOnHover:C,arrow:x=!0,reverse:$,draggable:T,dragOffset:I=40,gap:P=0,itemHeight:z,indicator:O,style:M,className:j,children:E,renderIndicator:B,onBeforeSwipe:Y,onAfterSwipe:A}=a,L=b(null),V=b(null),W=`all ${y/1e3}s`,q=ae({current:l,swipable:!0,transition:"fade"===s?"none":W,dragStart:0,dragging:!1,initialized:!1}),F=f((()=>v.map(E,(e=>{if(e.type===pn)return e}))),[E]),[H,R,X,U,G]=f((()=>{const e="normal"===s&&d&&F.length>o?o+1:0;let t=[];if(e<=0)t=[...F];else{const n=F.slice(0,e);t=[...F.slice(-e),...F,...n]}const n=t.length/o*100+"%";return[t,e,F.length,t.length,n]}),[o,d,s,F]),K=f((()=>-100*(q.current+R)/U),[q.current,U]),Z=f((()=>{if(X<=o||"fade"===s)return;return`translate3d(${m?`0, ${K}%`:`${K}%, 0`}, 0)`}),[K,m,o,X,s]),_=f((()=>{if(m&&z)return{height:z*o}}),[m,z,o]),J=f((()=>Array.from({length:Math.ceil((X-o)/c)+1})),[d,O]),Q=()=>{clearTimeout(V.current),V.current=null},ee=p((e=>{if(!q.swipable||e===q.current)return;q.swipable=!1,Y?.(q.current);let t=!1,n=e;const i=X-o;return d?e>i?(t=!0,e=X,n=0):e<0&&(t=!0,e=-o,n=i):(n=We(n,0,i),e=n),setTimeout((()=>{q.swipable=!0}),y+32),"fade"===s?(q.current=n,void A?.(n)):(q.current=e,t?void setTimeout((()=>{q.transition="none",q.current=n,A?.(n),k&&(V.current=setTimeout(te,N)),setTimeout((()=>{q.transition=W}),60)}),y+20):(k&&(V.current=setTimeout(te,N)),void setTimeout((()=>{A?.(n)}),y+12)))}),[y,k]),te=()=>{ee($?q.current-c:q.current+c)},ne=()=>{ee($?q.current+c:q.current-c)},ie=p((e=>{T&&q.swipable&&"fade"!==s&&(e.stopPropagation(),Object.assign(q,{dragStart:m?e.clientY:e.clientX,dragging:!0,transition:"none"}))}),[T,m]),re=p((e=>{if(!q.dragging||!L.current)return;e.preventDefault();const t=61.8*((m?e.clientY:e.clientX)-q.dragStart)/L.current[m?"offsetHeight":"offsetWidth"]+K;L.current.style.transform=`translate3d(${m?`0, ${t}%`:`${t}%, 0`}, 0)`}),[m,L.current,K]),se=p((e=>{if(!q.dragging||!L.current)return;const t=m?e.clientY:e.clientX,n=L.current[m?"offsetHeight":"offsetWidth"]/U,i=.618*(t-q.dragStart),a=Math.abs(i);if(a>I){const e=Math.floor(a/n)+(a%n-I>0?1:0);let t=q.current+(i>0?-e:e);ee(t)}L.current.style.transform=Z||"",Object.assign(q,{dragging:!1,transition:W})}),[m,L.current,K]);return _e(re),Je(se),w(r,(()=>({swipeTo:ee,swipeNext:te,swipePrev:ne}))),u((()=>{if(k)return V.current=setTimeout(te,N),()=>{clearTimeout(V.current),V.current=null}}),[k,N]),e("div",{style:M,className:i("i-swiper",{"i-swiper-vertical":m,"i-swiper-initialized":q.initialized},j),children:[e("div",{className:"i-swiper-track",style:_,onMouseOver:()=>{C&&Q()},onMouseLeave:()=>{C&&(Q(),V.current=setTimeout(te,N))},children:[t("div",{ref:L,className:i("i-swiper-list",{"i-swiper-fade":"fade"===s}),style:{[m?"height":"width"]:G,transform:Z,transition:q.transition},onMouseDown:ie,children:H.map(((e,n)=>{const{props:i}=e;return t(pn,{index:n,active:n-R===q.current,type:s,gap:P,transition:W,itemHeight:z,vertical:m,...i},n)}))}),x&&e(n,{children:[t("a",{className:"i-swiper-arrow i-swiper-prev",onClick:ne,children:h}),t("a",{className:"i-swiper-arrow i-swiper-next",onClick:te,children:g})]})]}),O&&t("div",{className:"i-swiper-indicators",children:J.map(((e,n)=>t("a",{className:i("i-swiper-indicator",{"i-indicator-active":n===Math[d?"floor":"ceil"]((q.current+X)%X/c)}),onClick:()=>ee(n*c),children:B?.(n)},n)))})]})}));mn.Item=pn;const hn=c(((n,a)=>{const{active:r,tabs:s,type:o="default",prepend:c,append:d,children:p,className:m,vertical:h,toggable:g,bar:f=!0,hideMore:y,barClass:N,renderMore:k=()=>t(Ne,{flat:!0,square:!0,size:"small",children:t(ke,{icon:t(K,{})})}),onTabChange:C,...x}=n,$=b([]),T=b(null),I=b(null),P=ae({active:r,prevActive:void 0,barStyle:{},cachedTabs:[],overflow:!1,more:[],tabs:[]}),{observe:z,unobserve:O}=Qe(),M=oe(I);u((()=>{if(!s)return p?void(P.tabs=v.map(p,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,keepDOM:o}=i,c=r?l(r,["props","type","$$typeof","ref"]):s;return{key:n||String(t),title:a,content:c,keepDOM:o}}))):void(P.tabs=[]);P.tabs=s.map(((e,t)=>["string","number"].includes(typeof e)?{key:e,title:e}:(void 0===e.key&&(e.key=t),e)))}),[p,s]);const D=e=>{const{key:t}=e,n=P.tabs.findIndex((e=>e.key===t));if(n>-1)return void j(P.tabs[n].key??n);const i=P.tabs.length,a=e.key??i;P.tabs.push({...e,key:a}),j(a)},S=e=>{const t=P.tabs.findIndex((t=>t.key===e));if(t<0)return;if(P.tabs.splice(t,1),P.active!==e)return;const n=P.tabs[t]||P.tabs[t-1];j(P.prevActive??n?.key??"")},j=e=>{if(e===P.active){if(!g)return;return C?.(void 0,e),P.active=void 0,void(P.barStyle={height:0,width:0})}P.prevActive=P.active,C?.(e,P.active),P.active=e},E=e=>{e.stopPropagation(),e.preventDefault(),h||I.current?.scrollBy({left:e.deltaY+e.deltaX})};return u((()=>{if(!M||y)return;const{scrollHeight:e,scrollWidth:t}=I.current,{width:n,height:i}=M;P.overflow=e>i||t>n,P.overflow&&$.current.map(((e,t)=>{e&&z(e,((e,n)=>{P.tabs[t]&&(P.tabs[t].intersecting=n,P.more=P.tabs.filter((e=>!e.intersecting)))}))}))}),[M,y,P.tabs.length]),u((()=>{if(!f||"pane"===o||void 0===P.active)return;const e=P.tabs.findIndex((e=>e.key===P.active));setTimeout((()=>{const t=$.current[e];if(!t)return;if(P.tabs[e].keepDOM&&P.active){P.cachedTabs.findIndex((e=>e===P.active))<0&&P.cachedTabs.unshift(P.active)}const{offsetHeight:n,offsetLeft:i,offsetTop:a,offsetWidth:r}=t,s="line"===o;P.barStyle={height:!h&&s?".25em":n,width:h&&s?".25em":r,transform:`translate(${i}px, ${a}px)`}}),16)}),[P.active,f]),u((()=>{void 0!==r&&P.active!==r&&j(r)}),[r]),u((()=>{if(!y)return()=>{$.current?.map(O)}}),[P.tabs.length]),u((()=>{if(I.current&&!h)return I.current.addEventListener("wheel",E,{passive:!1}),()=>{I.current&&I.current.removeEventListener("wheel",E)}}),[I.current]),w(a,(()=>({open:j,close:S,add:D,navs:I}))),e("div",{className:i("i-tabs",{flex:h,[`i-tabs-${o}`]:"default"!==o},m),...x,children:[e("div",{className:i("i-tab-navs-container",{"i-tab-navs-vertical":h}),children:[c,e("div",{ref:I,className:"i-tab-navs",children:[P.tabs.map(((n,a)=>{const{title:r,key:s=a,closable:l}=n;return e("a",{ref:e=>$.current[a]=e,className:i("i-tab-nav",{"i-tab-active":P.active===s}),onClick:()=>j(s),children:[r,l&&t(He,{as:"i",active:!0,className:"i-tab-nav-close",onClick:e=>{e.stopPropagation(),S(s)}})]},s)})),f&&t("span",{ref:T,className:i("i-tab-navs-bar",N),style:P.barStyle})]}),!y&&P.overflow&&P.more.length>0&&t(ut,{arrow:!1,position:h?"right":"bottom",align:"end",touchable:!0,hideDelay:500,content:t("div",{className:"i-tabs-morelist pd-4",children:P.more.map(((e,n)=>{const{key:a=n,title:r}=e,s=P.active===a;return t("a",{className:i("i-tab-nav",{"i-tab-active":s}),onClick:()=>j(a),children:r},a)}))}),children:k(P.more)}),d]}),t("div",{className:"i-tab-contents",children:P.tabs.map(((e,n)=>{const{key:a=n,content:r}=e,s=P.active===a;return(s||void 0!==a&&P.cachedTabs.includes(a))&&t("div",{className:i("i-tab-content",{"i-tab-active":s}),children:r},a)}))})]})}));function gn(e){const{data:a=[],depth:r=0,round:s,style:l,className:o,parent:c,nodeProps:d,...u}=e,p=a.map(((e,n)=>{const{type:i}=e,a=e[d.title],s=e[d.key]||(void 0!==c?.key?`${c.key}-${n}`:`${n}`);return e.key=s,e.parent=c,"title"===i?t("div",{className:"i-tree-group-title",children:a},n):i&&"item"!==i?t("div",{className:`i-tree-type-${i}`,children:a},n):t(vn,{index:n,item:e,depth:r,nodeProps:d,...u},s)}));return r>0?t(n,{children:p}):t("div",{className:i("i-tree",o,{"i-tree-round":s}),style:l,children:p})}hn.Item=e=>t(n,{});const fn=e=>{const{as:n="a",href:a,selected:r,children:s,...l}=e,o=i("i-tree-item-header",{"i-tree-item-selected":r});return t(n,"string"==typeof n?{href:a,className:o,...l,children:s}:{to:a||"",className:o,...l,children:s})},vn=n=>{const{item:a,depth:r=0,index:s,selected:l,checked:o=[],partofs:c={},checkable:d,nodeProps:u,renderExtra:p,onItemClick:m,onItemSelect:h,onItemCheck:f,...v}=n,{as:b,key:y="",href:N,icon:k,title:C,expanded:w,disabled:x}=a,$=a[u.children],[T,I]=g(w),P=re(((e,t)=>{t&&(e.preventDefault(),e.stopPropagation()),!x&&$?.length&&I((e=>!e))})),z=re((e=>{if(x)return e.preventDefault(),void e.stopPropagation();P(e),m?.(a,e),h?.(y,a)})),O=o.includes(y);return e("div",{className:i("i-tree-item",{"i-tree-expand":T}),children:[e(fn,{as:b,href:N,style:{paddingLeft:1.5*r+.5+"em"},selected:l===y,onClick:z,children:[d&&t(Fe.Item,{value:O,partof:!O&&c[y],className:"i-tree-checkbox",onChange:e=>f?.(a,e,[]),onClick:e=>e.stopPropagation()}),k&&t("span",{className:"i-tree-item-icon",children:k}),t("span",{className:"i-tree-item-title",children:C}),p?.(a),$&&t(ke,{icon:t(ee,{}),className:"i-tree-toggle",onClick:e=>P(e,!0)})]}),$?.length&&t("div",{className:"i-tree-item-content",children:t(gn,{data:$,depth:r+1,selected:l,checkable:d,parent:a,partofs:c,checked:o,nodeProps:u,renderExtra:p,onItemClick:m,onItemSelect:h,onItemCheck:f,...v})})]})},bn={key:"key",title:"title",children:"children"},yn=c(((e,n)=>{const{data:i=[],selected:a,checked:r=[],disabledRelated:s,nodeProps:l,onItemSelect:o,onItemCheck:c,...d}=e,p=ae({selected:a,checked:r,partofs:{},nodeMaps:new Map}),m=Object.assign({},bn,l),h=e=>p.checked.includes(e||""),g=re(((e,t,n)=>{const{key:i="",parent:a,children:r}=e,l={[i]:t},o={[i]:!1};if(s)return[l];if(t){if(a&&"leaf"!==n){const e=a.children?.some((e=>e.key!==i&&!h(e.key))),[t,n]=g(a,!0,"root");e||Object.assign(l,t),Object.assign(o,e?n:{},{[a.key]:!0})}return r?.length&&"root"!==n&&r.map((e=>{if(h(e.key))return;const[t]=g(e,!0,"leaf");Object.assign(l,t),o[e.key]=!1})),[l,o]}if(a&&"leaf"!==n){const[e,t]=g(a,!1,"root");Object.assign(l,e);const n=a.children?.some((e=>h(e.key)&&e.key!==i));Object.assign(o,n?{}:t,{[a.key]:n,[i]:!1})}return r?.length&&"root"!==n&&r.map((e=>{const[t]=g(e,!1,"leaf");h(e.key)&&(Object.assign(l,t),o[e.key]=!1)})),[l,o]}));return u((()=>{void 0!==a&&(p.selected=a)}),[a]),u((()=>{p.nodeMaps.clear();const{key:e,children:t}=m,n=i=>{i.map((i=>{p.nodeMaps.set(i[e],i),i[t]?.length>0&&n(i[t])}))};n(i)}),[i]),w(n,(()=>({getChecked:()=>{const e=[];return p.checked.map((t=>{const n=p.nodeMaps.get(t);e.push(n)})),[p.checked,e]},getSelected:()=>{const e=p.nodeMaps.get(p.selected);return[p.selected,e]},getPartofs:()=>{const e=[];return[Object.keys(p.partofs).filter((t=>{const n=p.partofs[t];if(n){const n=p.nodeMaps.get(t);e.push(n)}return n})),e]}}))),t(gn,{data:i,selected:p.selected,checked:p.checked,partofs:p.partofs,nodeProps:m,onItemCheck:(e,t)=>{const[n,i]=g(e,t),a=Object.keys(n);p.checked=t?Array.from(new Set([...p.checked,...a])):p.checked.filter((e=>!a.includes(e))),Object.assign(p.partofs,i),c?.(e,t,p.checked)},onItemSelect:(t,n)=>{e.selectable&&(p.selected=t,o?.(t,n))},...d})}));function Nn(i){const{mode:a,index:r,file:s,onRemove:l,onPreview:c}=i;if(!s)return"";const{name:d,size:u,url:p,src:m}=s,h=Le(d,s.type),g=t(He,{active:!0,className:"i-upload-delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),l(r)}});if("card"===a){let i=t(n,{});switch(h){case Me.IMAGE:i=t(Lt,{lazyload:!0,src:p||m,fit:"cover",usePreview:!1});break;case Me.VIDEO:i=t("video",{src:p||m,preload:"none"});break;default:i=e(n,{children:[t(ke,{icon:t(te,{})}),t("span",{className:"i-upload-file-name",children:o(d)})]})}return e("div",{title:d,className:"i-upload-item-card",onClick:()=>c?.(r),children:[i,g]})}return e("div",{className:"i-upload-item",onClick:()=>c?.(r),children:[t("span",{children:d}),t("i",{className:"i-upload-size",children:Ve(u??0)}),g]})}const kn=c(((n,a)=>{const{label:s,labelInline:l,value:o,files:c=[],placeholder:d,status:p="normal",message:m,className:h,style:g,children:v,mode:y="default",cardSize:k="4em",disabled:C,limit:x=(n.multiple?1/0:1),multiple:$,renderItem:T=Nn,shouldUpload:I=()=>!0,uploader:P,onChange:z,onFilesChange:O,onUpload:M,...D}=n,S=ae({files:c,value:o,status:p,message:m,update:0}),j=b(null),E=At(),B=f((()=>v||("card"===y?t(Ne,{className:"i-upload-card-btn color-5",square:!0,flat:!0,outline:!0,disabled:C,children:t(ke,{icon:t(ie,{})})}):e(Ne,{className:"i-upload-btn",disabled:C,children:[t(ke,{icon:t(ne,{})})," Upload"]}))),[y,v]),Y=e=>{const[...t]=S.files,n=t.splice(e,1);URL.revokeObjectURL(n[0]?.src||""),S.files=t,O?.(t,n),z?.(t),j.current&&(j.current.value="")},A=async e=>{P&&e.forEach((async e=>{if(!I(e))return;const t=await P(e),n=S.files.findIndex((e=>e.uid===t.uid));n>-1&&(S.files[n]=t),"completed"===t?.status&&M?.(t)}))},L=e=>{E({items:S.files,initial:e})};u((()=>{Object.assign(S,{status:p,message:m})}),[p,m]),u((()=>{S.value=o}),[o]),w(a,(()=>({getFileList:()=>S.files})),[]);const{message:V,files:W}=S;return e(st,{label:s,labelInline:l,className:i("i-input-label-file",h),style:g,children:[t("input",{...D,disabled:C,ref:j,type:"file",className:"i-input-file-hidden",multiple:$,onChange:e=>{const t=Array.from(e.target.files||[]),{files:n}=S,i=[];t.map((e=>{const{name:t,size:a,type:s}=e,l=n.find((e=>{const{name:n,size:i,type:r}=e;return n===t&&i===a&&r===s})),o=URL.createObjectURL(e);e.src=o,S.update+=1,Object.assign(e,{uid:r(7),src:e.src||e.name}),!l&&i.push(e)}));const a=[...n,...i];Object.assign(S,{files:$?a.slice(0,x):[a.at(-1)],status:p,message:m}),O?.(S.files,i,e),z?.(S.files,e),A(i),j.current&&(j.current.value="")}}),e("div",{className:i("i-upload-inner",{[`i-upload-${y}`]:"default"!==y}),style:{"--upload-card-size":k},children:[t("div",{className:"i-upload-list",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:W?.map(((e,n)=>t(N,{children:Nn({index:n,file:e,mode:y,onRemove:Y,onPreview:L})},n)))}),V&&t("span",{className:"i-upload-message",children:V}),W.length<x&&B]})]})}));export{we as Affix,xe as Badge,Ne as Button,Oe as Card,Fe as Checkbox,Re as Collapse,rt as Datagrid,vt as Datepicker,bt as Description,yt as Drawer,wt as Dropdown,xt as Flex,It as Form,ke as Icon,Lt as Image,lt as Input,kt as List,be as Loading,Gt as Message,zt as Modal,Zt as Pagination,Qt as Popconfirm,ut as Popup,jt as Progress,tn as Radio,sn as Select,un as Step,mn as Swiper,hn as Tabs,nn as Tag,Mt as Text,yn as Tree,kn as Upload,Et as Video,At as usePreview};
2
- //# sourceMappingURL=index.mjs.map