@ceed/ads 0.0.159 → 0.0.161-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,137 @@
1
1
  import React, { ComponentProps, ReactNode } from "react";
2
+ import { Link } from "@mui/joy";
2
3
  import { Table } from "../Table";
3
- export type ColumnDef<T extends Record<string, V>, V = unknown> = {
4
- type?: "number" | "string" | "date";
4
+ import CurrencyInput from "../CurrencyInput";
5
+ import DatePicker from "../DatePicker";
6
+ import Input from "../Input";
7
+ import Textarea from "../Textarea";
8
+ import Chip from "../Chip";
9
+ import Autocomplete from "../Autocomplete";
10
+ import Select from "../Select";
11
+ export type RenderCellHandler<T extends Record<string, V>, V = unknown> = (params: {
12
+ row: T;
13
+ value?: V;
14
+ id: string;
15
+ }) => ReactNode;
16
+ export type CellEditStartEvent<T extends Record<string, V>, V = unknown> = (params: {
17
+ originalRow: T;
18
+ row: T;
19
+ value?: V;
20
+ id: string;
21
+ }) => void;
22
+ export type CellEditStopEvent<T extends Record<string, V>, V = unknown> = (params: {
23
+ originalRow: T;
24
+ row: T;
25
+ value?: V;
26
+ id: string;
27
+ }) => void;
28
+ type BaseColumnDef<T extends Record<string, V>, V = unknown> = {
5
29
  field: keyof T;
6
30
  headerName?: string;
7
31
  width?: string;
8
32
  minWidth?: string;
9
33
  maxWidth?: string;
10
34
  resizable?: boolean;
11
- renderCell?: (params: {
35
+ renderCell?: RenderCellHandler<T, V>;
36
+ isCellEditable?: ((params: {
12
37
  row: T;
13
38
  value?: V;
14
39
  id: string;
15
- }) => ReactNode;
40
+ }) => boolean) | boolean;
41
+ onCellEditStart?: CellEditStartEvent<T, V>;
42
+ onCellEditStop?: CellEditStopEvent<T, V>;
16
43
  };
44
+ type AutocompleteColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
45
+ type: "autocomplete";
46
+ componentProps?: ComponentProps<typeof Autocomplete> | ((params: {
47
+ row: T;
48
+ value?: V;
49
+ id: string;
50
+ }) => ComponentProps<typeof Autocomplete>);
51
+ };
52
+ type CurrencyColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
53
+ type: "currency";
54
+ componentProps?: ComponentProps<typeof CurrencyInput> | ((params: {
55
+ row: T;
56
+ value?: V;
57
+ id: string;
58
+ }) => ComponentProps<typeof CurrencyInput>);
59
+ };
60
+ type DateColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
61
+ type: "date";
62
+ componentProps?: ComponentProps<typeof DatePicker> | ((params: {
63
+ row: T;
64
+ value?: V;
65
+ id: string;
66
+ }) => ComponentProps<typeof DatePicker>);
67
+ };
68
+ type NumberColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
69
+ type: "number";
70
+ componentProps?: ComponentProps<typeof Input> | ((params: {
71
+ row: T;
72
+ value?: V;
73
+ id: string;
74
+ }) => ComponentProps<typeof Input>);
75
+ };
76
+ type TextColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
77
+ type: "text";
78
+ componentProps?: ComponentProps<typeof Input> | ((params: {
79
+ row: T;
80
+ value?: V;
81
+ id: string;
82
+ }) => ComponentProps<typeof Input>);
83
+ };
84
+ type LongTextColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
85
+ type: "longText";
86
+ componentProps?: ComponentProps<typeof Textarea> | ((params: {
87
+ row: T;
88
+ value?: V;
89
+ id: string;
90
+ }) => ComponentProps<typeof Textarea>);
91
+ };
92
+ type SelectColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
93
+ type: "select";
94
+ componentProps?: ComponentProps<typeof Select<string, false>> | ((params: {
95
+ row: T;
96
+ value?: V;
97
+ id: string;
98
+ }) => ComponentProps<typeof Select<string, false>>);
99
+ };
100
+ type MultiSelectColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
101
+ type: "multiSelect";
102
+ componentProps?: ComponentProps<typeof Select<string, true>> | ((params: {
103
+ row: T;
104
+ value?: V;
105
+ id: string;
106
+ }) => ComponentProps<typeof Select<string, true>>);
107
+ };
108
+ type LinkColumnDef<T extends Record<string, V>, V = unknown, C extends React.ElementType = typeof Link> = BaseColumnDef<T, V> & {
109
+ type: "link";
110
+ component?: C;
111
+ componentProps?: ComponentProps<C> | ((params: {
112
+ row: T;
113
+ value?: V;
114
+ id: string;
115
+ }) => ComponentProps<C>);
116
+ };
117
+ type ChipColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
118
+ type: "chip";
119
+ componentProps?: ComponentProps<typeof Chip> | ((params: {
120
+ row: T;
121
+ value?: V;
122
+ id: string;
123
+ }) => ComponentProps<typeof Chip>);
124
+ };
125
+ type OtherColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
126
+ type?: "string";
127
+ componentProps?: {};
128
+ };
129
+ export type ColumnDef<T extends Record<string, V>, V = unknown> = AutocompleteColumnDef<T, V> | CurrencyColumnDef<T, V> | DateColumnDef<T, V> | NumberColumnDef<T, V> | TextColumnDef<T, V> | LongTextColumnDef<T, V> | LinkColumnDef<T, V> | ChipColumnDef<T, V> | SelectColumnDef<T, V> | MultiSelectColumnDef<T, V> | OtherColumnDef<T, V>;
17
130
  export type DataTableProps<T extends Record<string, unknown>> = {
18
131
  rows: T[];
19
132
  checkboxSelection?: boolean;
20
133
  columns: ColumnDef<T>[];
134
+ editMode?: boolean;
21
135
  /**
22
136
  * 체크박스가 있는 경우, 체크박스를 클릭했을 때 선택된 row의 index를 지정한다.
23
137
  */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{useTheme as nh,useColorScheme as ah,useThemeProps as ih,alertClasses as lh,boxClasses as sh,buttonClasses as mh,checkboxClasses as ph,dividerClasses as dh,iconButtonClasses as ch,inputClasses as uh,menuClasses as gh,menuButtonClasses as fh,menuItemClasses as hh,optionClasses as bh,radioClasses as Ch,radioGroupClasses as yh,selectClasses as xh,switchClasses as vh,tableClasses as Mh,textareaClasses as kh,typographyClasses as Dh,formControlClasses as Ph,formLabelClasses as Th,formHelperTextClasses as wh,gridClasses as Ih,stackClasses as Ah,sheetClasses as Fh,modalClasses as Bh,modalCloseClasses as Nh,modalDialogClasses as Lh,modalOverflowClasses as Sh,dialogTitleClasses as Hh,dialogContentClasses as Eh,dialogActionsClasses as zh,tooltipClasses as Oh,tabsClasses as Vh,tabListClasses as Jh,tabPanelClasses as Yh,accordionClasses as $h,accordionDetailsClasses as qh,accordionGroupClasses as Wh,accordionSummaryClasses as Uh,AutocompleteListbox as Gh,AutocompleteOption as _h,autocompleteClasses as Rh,autocompleteListboxClasses as jh,autocompleteOptionClasses as Zh,Avatar as Xh,avatarClasses as Qh,AvatarGroup as Kh,avatarGroupClasses as eb,AspectRatio as ob,aspectRatioClasses as tb,Badge as rb,badgeClasses as nb,breadcrumbsClasses as ab,cardClasses as ib,cardActionsClasses as lb,cardContentClasses as sb,cardCoverClasses as mb,cardOverflowClasses as pb,chipClasses as db,CircularProgress as cb,circularProgressClasses as ub,Drawer as gb,drawerClasses as fb,LinearProgress as hb,linearProgressClasses as bb,List as Cb,listClasses as yb,ListDivider as xb,listDividerClasses as vb,ListItem as Mb,listItemClasses as kb,ListItemButton as Db,listItemButtonClasses as Pb,ListItemContent as Tb,listItemContentClasses as wb,ListItemDecorator as Ib,listItemDecoratorClasses as Ab,ListSubheader as Fb,listSubheaderClasses as Bb,Link as Nb,linkClasses as Lb,Slider as Sb,sliderClasses as Hb,Step as Eb,stepClasses as zb,StepButton as Ob,stepButtonClasses as Vb,StepIndicator as Jb,Stepper as Yb,stepperClasses as $b,Skeleton as qb,skeletonClasses as Wb}from"@mui/joy";import le from"react";import{AccordionGroup as ir,Accordion as lr,AccordionSummary as sr,AccordionDetails as mr}from"@mui/joy";import{motion as Ve}from"framer-motion";var pr=Ve(sr),Je=pr;Je.displayName="AccordionSummary";var dr=Ve(mr),Ye=dr;Ye.displayName="AccordionDetails";var cr=Ve(lr);function $e(e){let{summary:o,details:t,variant:n,color:i,...a}=e,r=n==="solid"?"solid":void 0;return le.createElement(cr,{variant:r,color:i,...a},le.createElement(Je,{variant:r,color:i},o),le.createElement(Ye,{variant:r,color:i},t))}$e.displayName="Accordion";var ur=Ve(ir);function lo(e){let{variant:o,color:t,items:n,...i}=e;return le.createElement(ur,{variant:o,color:t,...i},n.map((a,r)=>le.createElement($e,{key:r,summary:a.summary,details:a.details,index:r,variant:o,color:t})))}lo.displayName="Accordions";import qe from"react";import{Alert as vr,styled as Mr}from"@mui/joy";import{motion as kr}from"framer-motion";import gr from"react";import{Typography as fr}from"@mui/joy";import{motion as hr}from"framer-motion";var br=hr(fr),$=e=>gr.createElement(br,{...e});$.displayName="Typography";var Y=$;import{Stack as Cr}from"@mui/joy";import{motion as yr}from"framer-motion";var xr=yr(Cr),se=xr;se.displayName="Stack";var J=se;var Dr=Mr(kr(vr))({alignItems:"flex-start",fontWeight:"unset"});function so(e){let{title:o,content:t,actions:n,color:i="primary",...a}=e,r=e.invertedColors||e.variant==="solid";return qe.createElement(Dr,{...a,color:i,endDecorator:n,invertedColors:r},qe.createElement(J,null,o&&qe.createElement(Y,{level:"title-sm",color:i},o),qe.createElement(Y,{level:"body-sm",color:i},t)))}so.displayName="Alert";import L,{useCallback as Hr,useEffect as Er,useMemo as ce,useRef as zr,useState as Or}from"react";import{Autocomplete as Vr,AutocompleteOption as Jr,ListSubheader as Yr,AutocompleteListbox as $r,ListItemDecorator as it,CircularProgress as qr,styled as Wr}from"@mui/joy";import{useVirtualizer as Ur}from"@tanstack/react-virtual";import{Popper as Gr}from"@mui/base";import{FormControl as Pr,styled as Tr}from"@mui/joy";import{motion as wr}from"framer-motion";var Ir=Tr(wr(Pr))({width:"100%"}),me=Ir;me.displayName="FormControl";var B=me;import{FormLabel as Ar}from"@mui/joy";import{motion as Fr}from"framer-motion";var Br=Fr(Ar),pe=Br;pe.displayName="FormLabel";var N=pe;import{FormHelperText as Nr}from"@mui/joy";import{motion as Lr}from"framer-motion";var Sr=Lr(Nr),de=Sr;de.displayName="FormHelperText";var w=de;var _r=Wr(Gr,{name:"Autocomplete",slot:"Popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Rr=L.forwardRef((e,o)=>{let{anchorEl:t,open:n,modifiers:i,children:a,ownerState:{loading:r,size:l="md"},...m}=e,u=zr(null),g=a[0].every(h=>h.hasOwnProperty("group")),d=r?[a[1]]:a[0].length===0?[a[2]]:g?a[0].flatMap(h=>[L.createElement(Yr,{key:h.key,component:"li"},h.group),...h.children]):a[0],y=Ur({count:d.length,estimateSize:()=>36,getScrollElement:()=>u.current,overscan:5}),s=y.getVirtualItems();return Er(()=>{n&&y.measure()},[n]),L.createElement(_r,{ref:o,anchorEl:t,open:!0,modifiers:i},L.createElement($r,{...m},L.createElement("div",{ref:u,style:{overflow:"auto"}},L.createElement("div",{style:{height:`${y.getTotalSize()}px`,position:"relative"}},s.map(({index:h,size:p,start:c,key:v})=>L.cloneElement(d[h],{key:v,style:{position:"absolute",top:0,left:0,width:"100%",fontSize:`var(--ceed-fontSize-${l})`,height:`${p}px`,transform:`translateY(${c}px)`,overflow:"visible"},children:L.createElement("div",{style:{textOverflow:"ellipsis",textWrap:"nowrap",overflow:"hidden",width:"100%"}},d[h].props.children)}))))))});function lt(e){let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,onChange:m,onChangeComplete:u,...g}=e,[d,y]=Or(e.value||e.defaultValue),s=ce(()=>e.options.map(f=>typeof f!="object"?{value:f,label:f}:f),[e.options]),h=ce(()=>new Set(s.map(f=>f.value)),[e.options]),p=ce(()=>e.loading?{value:"",label:"",startDecorator:L.createElement(qr,{size:"sm",color:"neutral",variant:"plain",thickness:3})}:typeof d=="string"?s.find(f=>f.value===d)??d:d,[d,e.options,e.loading]),c=Hr(f=>L.isValidElement(f)&&!e.loading?L.cloneElement(f,{size:a}):f,[a,e.loading]),v=ce(()=>c(p?.startDecorator||e.startDecorator),[p,c]),P=ce(()=>c(p?.endDecorator||e.endDecorator),[p,c]),A=L.createElement(Vr,{...g,required:l,onChange:(f,b)=>{y(b);let D=b;m?.({...f,target:{...f.target,value:D?.value}}),h.has(D.value)&&u?.({...f,target:{...f.target,value:D?.value}})},color:i,value:p,options:s,size:a,disabled:r,startDecorator:v,endDecorator:P,getOptionLabel:f=>`${f.value??""}`,slots:{listbox:Rr},renderOption:(f,b)=>L.createElement(Jr,{...f},b.startDecorator&&L.createElement(it,{sx:D=>({marginInlineEnd:`var(--Input-gap, ${D.spacing(1)})`})},c(b.startDecorator)),c(b.label),b.endDecorator&&L.createElement(it,{sx:D=>({marginInlineStart:`var(--Input-gap, ${D.spacing(1)})`})},c(b.endDecorator))),renderGroup:f=>f});return o?L.createElement(B,{required:l,color:i,size:a,error:t,disabled:r},L.createElement(N,null,o),A,n&&L.createElement(w,null,n)):A}import{Box as jr}from"@mui/joy";import{motion as Zr}from"framer-motion";var Xr=Zr(jr),ue=Xr;ue.displayName="Box";var We=ue;import q from"react";import{Breadcrumbs as pt,Link as sn}from"@mui/joy";import mo from"react";import{Menu as Qr,MenuButton as Kr,MenuItem as en}from"@mui/joy";import{motion as po}from"framer-motion";var on=po(Qr),ge=e=>mo.createElement(on,{...e});ge.displayName="Menu";var tn=po(Kr),fe=e=>mo.createElement(tn,{...e});fe.displayName="MenuButton";var rn=po(en),he=e=>mo.createElement(rn,{...e});he.displayName="MenuItem";var st=ge;import{Dropdown as nn}from"@mui/joy";import{motion as an}from"framer-motion";var ln=an(nn),be=ln;be.displayName="Dropdown";var mt=be;function co(e){let{crumbs:o,size:t,startCrumbCount:n=1,endCrumbCount:i=3,slots:{link:a,...r}={link:sn},slotProps:{link:l,...m}={link:{color:"neutral"}},collapsed:u=!0,...g}=e,d=c=>c.type==="link"&&a?q.createElement(a,{to:c.linkHref,href:c.linkHref,...l},c.label):q.createElement(Y,null,c.label);if(!u)return q.createElement(pt,{size:t,slots:r,slotProps:m,...g},o.map(c=>q.createElement(d,{...c})));let y=Math.max(1,i),s=o.slice(0,n).map(c=>q.createElement(d,{...c})),h=(n+y>o.length?o.slice(n):o.slice(-y)).map(c=>q.createElement(d,{...c})),p=o.slice(n,-y).map(c=>q.createElement(he,null,q.createElement(d,{...c})));return q.createElement(pt,{size:t,slots:r,slotProps:m,...g},s,p.length&&q.createElement(mt,null,q.createElement(fe,{size:t,variant:"plain"},"..."),q.createElement(st,{size:t},p)),h)}co.displayName="Breadcrumbs";import mn,{forwardRef as pn}from"react";import{Button as dn}from"@mui/joy";import{motion as cn}from"framer-motion";var un=cn(dn),Ce=pn((e,o)=>mn.createElement(un,{ref:o,...e}));Ce.displayName="Button";var I=Ce;import x,{Fragment as xe,forwardRef as Mn,useMemo as Ct}from"react";import{styled as U}from"@mui/joy";import kn from"@mui/icons-material/esm/ChevronLeft.js";import Dn from"@mui/icons-material/esm/ChevronRight.js";import{AnimatePresence as yt,motion as Pn}from"framer-motion";var dt=e=>{let o=[],t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0),i=Math.ceil((t.getDay()+1)/7),a=Math.ceil((n.getDate()+t.getDay())/7),r=1;for(let l=1;l<=a;l++){let m=[];for(let u=1;u<=7;u++)l===i&&u<t.getDay()+1||r>n.getDate()?m.push(void 0):(m.push(r),r++);o.push(m)}return o},ct=(e,o)=>e.toLocaleString(o,{year:"numeric"}),uo=(e,o)=>e.toLocaleString(o,{year:"numeric",month:"long"}),ut=(e,o)=>new Date(0,e).toLocaleString(o,{month:"short"}),gt=e=>{let o=new Date().getDay(),t=new Date;return t.setDate(t.getDate()-o),Array.from({length:7}).map(()=>{let n=t.toLocaleString(e,{weekday:"short"});return t.setDate(t.getDate()+1),n})},ft=e=>{let o=new Date,t=new Date(e);return t.setHours(0,0,0,0),o.setHours(0,0,0,0),t.getTime()===o.getTime()},go=(e,o)=>{let t=new Date(e),n=new Date(o);return t.setHours(0,0,0,0),n.setHours(0,0,0,0),t.getTime()===n.getTime()},Z=(e,o,t)=>{let n=new Date(t);n.setHours(0,0,0,0);let i=new Date(Math.min(e.getTime(),o.getTime())),a=new Date(Math.max(e.getTime(),o.getTime()));return n>=i&&n<=a},Ue=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth();import gn from"react";import{IconButton as fn}from"@mui/joy";import{motion as hn}from"framer-motion";var bn=hn(fn),ye=e=>gn.createElement(bn,{...e});ye.displayName="IconButton";var V=ye;import{useCallback as Cn,useMemo as yn,useState as Ge}from"react";import{useThemeProps as xn}from"@mui/joy";var vn=(e,o)=>o.includes(e)?e:o[0],ht=e=>{let[o,t]=Ge(()=>vn(e.view||"day",e.views||["day","month"])),[n,i]=Ge(e.defaultValue),[a,r]=Ge(()=>{let p=new Date;return p.setDate(1),p.setHours(0,0,0,0),e.value?.[0]||e.defaultValue?.[0]||p}),[[l,m],u]=Ge([0,0]),g=e.view??o,d=p=>{u([l+p,p])},y=Cn(p=>{r(p),g==="month"?a.getFullYear()!==p.getFullYear()&&d(p>a?1:-1):d(p>a?1:-1),e.onMonthChange?.(p)},[e.onMonthChange,a,g]),s=xn({props:{locale:"default",views:["day","month"],view:g,value:e.value??n,...e,onChange:e.value?e.onChange:p=>{i(p),e.onChange?.(p)},onMonthChange:y,onViewChange:()=>{let p=g==="month"?"day":"month";!(!e.views||e.views.includes(p))||e.view===p||(e.onViewChange?e.onViewChange(p):t(p))}},name:"Calendar"}),h=yn(()=>({...s,viewMonth:a,direction:m}),[s,a,m]);return[s,h]};import{useCallback as ne,useState as bt}from"react";var _e=e=>{let[o,t]=bt(null),[n,i]=bt(null);return{calendarTitle:e.view==="month"?ct(e.viewMonth,e.locale||"default"):uo(e.viewMonth,e.locale||"default"),onPrev:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()-1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()-1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),onNext:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()+1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()+1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),getDayCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":l?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,o]),getMonthCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let m=!e.views?.find(u=>u==="day")&&e.rangeSelection&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":m?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,n]),getPickerDayProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=!!e.value&&(go(r,e.value[0])||e.value[1]&&go(r,e.value[1])),m=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),u=()=>{e.rangeSelection?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]),t(null)};return{isToday:ft(r),isSelected:l,onClick:u,onMouseEnter:e.rangeSelection&&e.value?.[0]&&!e.value?.[1]?()=>t(r):void 0,disabled:e.minDate&&r<e.minDate||e.maxDate&&r>e.maxDate||e.disableFuture&&r>new Date||e.disablePast&&r<(()=>{let g=new Date;return g.setHours(0,0,0,0),g})(),tabIndex:-1,"aria-label":r.toLocaleDateString(),"aria-selected":l?"true":void 0,"aria-current":m?"date":void 0}},[e.onChange,e.value,e.viewMonth,e.rangeSelection,e.minDate,e.maxDate,e.disableFuture,e.disablePast,o]),getPickerMonthProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let l=!e.views?.find(y=>y==="day"),m=l&&e.rangeSelection,u=!!e.value&&(Ue(r,e.value[0])||e.value[1]&&Ue(r,e.value[1])),g=m&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),d=()=>{m?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):l?e.onChange?.([r,void 0]):(e.onViewChange?.("day"),e.onMonthChange?.(r)),i(null)};return{isSelected:u,onMouseEnter:m&&e.value?.[0]&&!e.value?.[1]?()=>i(r):void 0,disabled:e.minDate&&(()=>{let y=new Date(r);return y.setMonth(y.getMonth()+1),y.setDate(0),y<e.minDate})()||e.maxDate&&(()=>{let y=new Date(r);return y.setDate(0),y>e.maxDate})()||e.disableFuture&&r>new Date||e.disablePast&&r<new Date&&!Ue(r,new Date),onClick:d,tabIndex:-1,"aria-label":uo(r,e.locale||"default"),"aria-selected":u?"true":void 0,"aria-current":g?"date":void 0}},[e.onMonthChange,e.onViewChange,e.onChange,e.viewMonth,e.locale,e.value,e.minDate,e.maxDate,e.disableFuture,e.disablePast,n])}};var Tn=U("div",{name:"Calendar",slot:"root"})({maxWidth:"264px"}),wn=U("div",{name:"Calendar",slot:"calendarHeader"})(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing(2)})),xt=U("div",{name:"Calendar",slot:"viewContainer"})(({theme:e,calendarType:o})=>({paddingLeft:e.spacing(2),paddingRight:e.spacing(2),position:"relative",overflow:"hidden",minHeight:o==="datePicker"?"250px":"unset"})),vt=U(Pn.table,{name:"Calendar",slot:"viewTable"})(({theme:e})=>({borderSpacing:0,"& td, & th":{padding:0},"& th":{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),In=U("thead",{name:"Calendar",slot:"weekHeaderContainer"})({}),An=U("tbody",{name:"Calendar",slot:"dayPickerContainer"})({}),Fn=U(I,{name:"Calendar",slot:"switchViewButton"})(({ownerState:e})=>[e.view==="month"&&{pointerEvents:"none"}]),Bn=U("td",{name:"Calendar",slot:"dayCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Nn=U("td",{name:"Calendar",slot:"monthCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Ln=U(I,{name:"Calendar",slot:"month"})(({theme:e,isSelected:o,disabled:t})=>[{width:"59px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},t&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Sn=U(I,{name:"Calendar",slot:"day"})(({theme:e,isToday:o,isSelected:t,disabled:n})=>[{width:"32px",height:"32px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&!t&&{"&:not([aria-current=date]):not(:hover)":{border:`1px solid ${e.palette.neutral.outlinedBorder}`}},t&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},n&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Mt={enter:e=>({x:e>0?300:-300,opacity:0}),center:{position:"relative",zIndex:1,x:0,opacity:1},exit:e=>({position:"absolute",zIndex:0,x:e<0?300:-300,opacity:0})},Re=1e4,kt=(e,o)=>Math.abs(e)*o,Hn=e=>{let{ownerState:o}=e,{getPickerDayProps:t,getDayCellProps:n}=_e(o),i=Ct(()=>dt(o.viewMonth),[o.viewMonth]),a=Ct(()=>gt(o.locale||"default"),[o.locale]);return x.createElement(xt,{calendarType:"datePicker"},x.createElement(yt,{initial:!1,custom:o.direction},x.createElement(vt,{key:`${o.viewMonth.toString()}_${o.direction}`,custom:o.direction,variants:Mt,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:m})=>{let u=kt(l.x,m.x);if(u<-Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(u>Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement(In,null,x.createElement("tr",null,a.map((r,l)=>x.createElement(x.Fragment,null,x.createElement("th",null,x.createElement(Y,{level:"body-xs",textAlign:"center"},r)),l<6&&x.createElement("th",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"}))))),x.createElement(An,null,i.map((r,l)=>x.createElement(xe,{key:`${o.viewMonth}_${l}`},x.createElement("tr",null,r.map((m,u)=>m?x.createElement(xe,{key:u},x.createElement(Bn,{...n(m)},x.createElement(Sn,{size:"sm",variant:"plain",color:"neutral",...t(m)},m)),u<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})):x.createElement(xe,{key:u},x.createElement("td",null),u<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:13,style:{height:4}}))))))))},En=e=>{let{ownerState:o}=e,{getPickerMonthProps:t,getMonthCellProps:n}=_e(o),i=Array.from({length:12},(r,l)=>l).reduce((r,l)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(l),r),[[]]),a=!o.views?.find(r=>r==="day");return x.createElement(xt,{calendarType:a?"monthPicker":"datePicker"},x.createElement(yt,{initial:!1,custom:o.direction},x.createElement(vt,{key:`${o.viewMonth.getFullYear()}_${o.direction}`,custom:o.direction,variants:Mt,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:m})=>{let u=kt(l.x,m.x);if(u<-Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(u>Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement("tbody",null,i.map((r,l)=>x.createElement(xe,{key:l},x.createElement("tr",null,r.map((m,u)=>x.createElement(xe,{key:m},x.createElement(Nn,{...n(m)},x.createElement(Ln,{size:"sm",variant:"plain",color:"neutral",...t(m)},ut(m,o.locale))),u<3&&x.createElement("td",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:7,style:{height:4}}))))))))},ve=Mn((e,o)=>{let[t,n]=ht(e),{value:i,defaultValue:a,onChange:r,locale:l,onViewChange:m,onMonthChange:u,view:g,views:d,rangeSelection:y,...s}=t,{calendarTitle:h,onPrev:p,onNext:c}=_e(n);return x.createElement(Tn,{ref:o,...s},x.createElement(wn,null,x.createElement(V,{size:"sm",onClick:p},x.createElement(kn,null)),x.createElement(Fn,{ownerState:n,variant:"plain",color:"neutral",onClick:m},h),x.createElement(V,{size:"sm",onClick:c},x.createElement(Dn,null))),g==="day"&&x.createElement(Hn,{ownerState:n}),g==="month"&&x.createElement(En,{ownerState:n}))});ve.displayName="Calendar";var K=ve;import{Card as zn,CardContent as On,CardCover as Vn,CardActions as Jn,CardOverflow as Yn}from"@mui/joy";import{motion as Me}from"framer-motion";var $n=Me(zn),ke=$n;ke.displayName="Card";var qn=Me(On),fo=qn;fo.displayName="CardContent";var Wn=Me(Vn),ho=Wn;ho.displayName="CardCover";var Un=Me(Jn),bo=Un;bo.displayName="CardActions";var Gn=Me(Yn),Co=Gn;Co.displayName="CardOverflow";import _n from"react";import{Checkbox as Rn}from"@mui/joy";import{motion as jn}from"framer-motion";var Zn=jn(Rn),De=e=>_n.createElement(Zn,{...e});De.displayName="Checkbox";var Pe=De;import{Chip as Xn}from"@mui/joy";import{motion as Qn}from"framer-motion";var Kn=Qn(Xn),yo=Kn;yo.displayName="Chip";import{styled as ea}from"@mui/joy";import oa,{forwardRef as ta}from"react";var ra=ea("div",{name:"Container",slot:"root",shouldForwardProp:e=>e!=="maxWidth"})(({theme:e,maxWidth:o="lg"})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block",paddingLeft:e.spacing(4),paddingRight:e.spacing(4),...o==="sm"&&{[e.breakpoints.up("xs")]:{maxWidth:e.breakpoints.values.sm}},...o==="md"&&{[e.breakpoints.up("sm")]:{maxWidth:e.breakpoints.values.md}},...o==="lg"&&{[e.breakpoints.up("md")]:{maxWidth:e.breakpoints.values.lg}},...o==="xl"&&{[e.breakpoints.up("lg")]:{maxWidth:e.breakpoints.values.xl}}})),xo=ta(function(o,t){return oa.createElement(ra,{ref:t,...o})});xo.displayName="Container";import X,{useCallback as la,useMemo as sa,useState as Tt}from"react";import{IntlMessageFormat as ma}from"intl-messageformat";import{NumericFormat as pa}from"react-number-format";import da from"@mui/icons-material/esm/InfoOutlined.js";import Te from"react";import{Input as na}from"@mui/joy";import{motion as aa}from"framer-motion";var Dt=aa(na),we=e=>{let{label:o,helperText:t,error:n,style:i,size:a,color:r,disabled:l,required:m,...u}=e;return o?Te.createElement(B,{required:m,color:r,size:a,error:n,disabled:l},Te.createElement(N,null,o),Te.createElement(Dt,{...u}),t&&Te.createElement(w,null,t)):Te.createElement(Dt,{required:m,color:r,size:a,disabled:l,...u})};we.displayName="Input";var R=we;import ia from"intl-messageformat";var Pt=(e="usd")=>{let[o,t,n]=new ia(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split("");return{symbol:`${o} `,thousandSeparator:t,decimalSeparator:n,placeholder:n?`${o} 0${n}00`:`${o} 0`,fixedDecimalScale:!!n}};var ca=X.forwardRef(function(o,t){let{onChange:n,...i}=o;return X.createElement(pa,{...i,onValueChange:({value:a})=>{n?.({target:{name:o.name,value:a}})},valueIsNumericString:!0,getInputRef:t,decimalScale:2})}),wt=X.forwardRef(function(o,t){let{currency:n="usd",max:i=1e5,name:a,onChange:r,label:l,error:m,helperText:u,required:g,disabled:d,useMinorUnit:y,...s}=o,{symbol:h,thousandSeparator:p,decimalSeparator:c,placeholder:v,fixedDecimalScale:P}=Pt(n),[k,A]=Tt(o.value),[f,b]=Tt(!!i&&!!o.value&&o.value>i),D=sa(()=>k&&y?k/100:k,[k,y]),M=la(O=>{let te=Number(y?O.target.value?.replace(c,""):O.target.value);A(te),r?.({...O,target:{name:a,value:te}}),i&&te>i?b(!0):b(!1)},[]),T=X.createElement(R,{...s,size:"sm",ref:t,value:D,placeholder:v,onChange:M,disabled:d,required:g,slotProps:{input:{component:ca,decimalSeparator:c,thousandSeparator:p,prefix:h,fixedDecimalScale:P}},sx:{fontFamily:"monospace"}});return l?X.createElement(B,{size:"sm",disabled:d,required:g,error:m||f},X.createElement(N,null,l),T,f?X.createElement(w,null,X.createElement(da,null),new ma(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:i})):u&&X.createElement(w,null,u)):T});import C,{useCallback as ae,useEffect as ko,useMemo as ie,useRef as ba,useState as Ca}from"react";import{styled as ya,LinearProgress as xa}from"@mui/joy";import va from"@mui/icons-material/esm/ChevronLeft.js";import Ma from"@mui/icons-material/esm/ChevronRight.js";import{Sheet as ua}from"@mui/joy";import{motion as ga}from"framer-motion";var fa=ga(ua),Ie=fa;Ie.displayName="Sheet";var W=Ie;import G from"react";import{Table as ha}from"@mui/joy";var Ae=e=>{let{children:o,...t}=e;return G.createElement(ha,{...t},o)};Ae.displayName="Table";function vo(e){let{headCells:o,showCheckbox:t,onCheckboxChange:n,slots:{checkbox:i=Pe}={},slotProps:{checkbox:a={}}={}}=e;return G.createElement("thead",null,G.createElement("tr",null,t&&G.createElement("th",{style:{width:"40px",textAlign:"center"}},G.createElement(i,{onChange:n,...a})),o.map(r=>G.createElement("th",{key:r.label,style:{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,textAlign:r.numeric?"right":"left"}},r.label))))}vo.displayName="TableHead";function Mo(e){let{rows:o,cellOrder:t,rowOptions:n,showCheckbox:i,onCheckboxChange:a,slots:{checkbox:r=Pe}={},slotProps:{checkbox:l={}}={}}=e;return G.createElement("tbody",null,o.map((m,u)=>G.createElement("tr",{key:u},i&&G.createElement("td",{style:{textAlign:"center"}},G.createElement(r,{onChange:g=>a?.(g,u),...l})),t.map(g=>G.createElement("td",{key:g,style:{textAlign:n?.[g]?.numeric?"right":"left"}},m[g])))))}Mo.displayName="TableBody";var It=ya("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),je=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function ka(e){let{paginationModel:{page:o,pageSize:t},rowCount:n,onPageChange:i}=e,a=1,r=Math.ceil(n/t),l=[o-2,o-1].filter(d=>d>1),m=[o+1,o+2].filter(d=>d<=r-1),u=r>1&&o<r-3,g=r>1&&o>4;return C.createElement(J,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center"},C.createElement(J,{direction:"row",spacing:.5,alignItems:"center"},C.createElement(V,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-1),disabled:o===a,"aria-label":"Previous page"},C.createElement(va,null)),o!==a&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(a)},a),g&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-3)},"..."),l.map(d=>C.createElement(I,{key:d,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(d)},d)),C.createElement(I,{variant:"soft",size:"sm"},o),m.map(d=>C.createElement(I,{key:d,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(d)},d)),u&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+3)},"..."),o!==r&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(r)},r),C.createElement(V,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+1),disabled:o===r,"aria-label":"Next page"},C.createElement(Ma,null))))}var Da=e=>C.createElement(We,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:o=>{let t=o.clientX,n=e.current?.getBoundingClientRect().width,i=r=>{n&&t&&(e.current.style.width=`${n+(r.clientX-t)}px`)},a=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",a)}}),Pa=e=>{let o=ba(null),t={width:e.width,minWidth:e.minWidth??"50px",maxWidth:e.maxWidth,textAlign:e.type==="number"?"end":"start",position:e.stickyHeader?void 0:"relative"},n=e.resizable??!0?Da(o):null;return C.createElement("th",{ref:o,key:e.field,style:t},e.headerName??e.field,n)};function Ta({rows:e,columns:o,rowCount:t,pagination:n,paginationMode:i,paginationModel:a,onPaginationModelChange:r,selectionModel:l=[],onSelectionModelChange:m,getId:u,isTotalSelected:g}){let[d,y]=Ca(a?.page||1),s=a?.pageSize||20,h=ae((f,b)=>u?.(f)??f?.id??`${(b||0)+(d-1)*s}`,[u??d,s]),p=ie(()=>new Set(l),[l]),c=ie(()=>!n||i==="server"?e:e.slice((d-1)*s,(d-1)*s+s),[e,d,s,i,n]),v=ie(()=>c.length>0&&c.every((f,b)=>p.has(h(f,b))),[c,p,d,s,h]),P=t||e.length,k=ie(()=>g??(P>0&&l.length===P),[g,l,P]),A=ae(f=>{y(f),r?.({page:f,pageSize:s})},[r]);return ko(()=>{A(1)},[P]),ko(()=>{let f=Math.max(1,Math.ceil(P/s));d>f&&A(f)},[d,P,s]),ko(()=>{m?.([])},[d]),{rowCount:P,page:d,pageSize:s,onPaginationModelChange:A,getId:h,HeadCell:Pa,dataInPage:c,isAllSelected:v,isTotalSelected:k,isSelectedRow:ae(f=>p.has(f),[p]),onAllCheckboxChange:ae(()=>{m?.(v?[]:c.map(h))},[v,c,m]),onCheckboxChange:ae((f,b)=>{if(p.has(b)){let D=l.filter(M=>M!==b);m?.(D)}else{let D=[...l,b];m?.(D)}},[l,m]),columns:ie(()=>o||Object.keys(e[0]||{}).map(f=>({field:f})),[e,o]),onTotalSelect:ae(()=>{m?.(k?[]:e.map(h),!k)},[k,e,m])}}function Do(e){let{rows:o,checkboxSelection:t,selectionModel:n,onSelectionModelChange:i,rowCount:a,columns:r,onPaginationModelChange:l,pagination:m,paginationMode:u,paginationModel:g,loading:d,slots:{checkbox:y=Pe,toolbar:s,footer:h,loadingOverlay:p=()=>C.createElement(xa,{value:8,variant:"plain"})}={},slotProps:{checkbox:c={},toolbar:v,background:P={}}={},...k}=e,{columns:A,isAllSelected:f,isSelectedRow:b,onAllCheckboxChange:D,onCheckboxChange:M,getId:T,rowCount:O,page:te,pageSize:io,onPaginationModelChange:or,dataInPage:tr,isTotalSelected:nt,onTotalSelect:at,HeadCell:rr}=Ta(e),nr=ie(()=>({page:te,pageSize:io}),[te,io]);return C.createElement(We,null,C.createElement(J,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center"},!!t&&C.createElement(J,{direction:"row",spacing:1},!f&&C.createElement(Y,{level:"body-xs"},je(n?.length||0)," items selected"),f&&!nt&&C.createElement(J,{direction:"row",spacing:1,alignItems:"center"},C.createElement(Y,{level:"body-xs"},"All ",je(n?.length||0)," items on this page are selected."),C.createElement(I,{size:"sm",variant:"plain",onClick:at},"Select all ",je(O??o.length)," items")),nt&&C.createElement(J,{direction:"row",spacing:1,alignItems:"center"},C.createElement(Y,{level:"body-xs"},"All ",je(O??o.length)," items are selected."),C.createElement(I,{size:"sm",variant:"plain",color:"danger",onClick:at},"Cancel"))),s&&C.createElement(s,{...v||{}})),C.createElement(W,{variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},...P},C.createElement(Ae,{...k},C.createElement("thead",null,C.createElement("tr",null,t&&C.createElement("th",{style:{width:"40px",textAlign:"center"}},C.createElement(y,{onChange:D,checked:f,indeterminate:(n||[]).length>0&&!f,...c})),A.map(oe=>C.createElement(rr,{key:oe.field,stickyHeader:e.stickyHeader,...oe})))),C.createElement("tbody",null,C.createElement(It,null,!!d&&C.createElement("td",null,C.createElement(We,{sx:{position:"absolute",top:0,left:0,right:0}},C.createElement(p,null)))),C.createElement(It,null),tr.map((oe,ar)=>{let re=T(oe,ar);return C.createElement("tr",{key:re,role:t?"checkbox":void 0,tabIndex:t?-1:void 0,onClick:t?_=>M(_,re):void 0,"aria-checked":t?b(re):void 0},t&&C.createElement("th",{scope:"row",style:{textAlign:"center"}},C.createElement(y,{onChange:_=>M(_,re),checked:b(re),...c})),A.map(_=>C.createElement("td",{key:_.field,style:{textAlign:_.type&&["number","date"].includes(_.type)?"end":"start"}},_.renderCell?.({row:oe,value:oe[_.field],id:re})??oe[_.field])))})),h&&C.createElement(h,null))),io<O&&m&&C.createElement(ka,{paginationModel:nr,rowCount:O,onPageChange:or}))}Do.displayName="DataTable";import S,{forwardRef as Na,useCallback as At,useEffect as La,useImperativeHandle as Sa,useRef as Ha,useState as Ft}from"react";import{IMaskInput as Ea,IMask as Po}from"react-imask";import za from"@mui/icons-material/esm/CalendarToday.js";import{styled as To}from"@mui/joy";import{FocusTrap as Oa,ClickAwayListener as Va,Popper as Ja}from"@mui/base";import{DialogActions as wa,styled as Ia}from"@mui/joy";import{motion as Aa}from"framer-motion";var Fa=Aa(wa),Ba=Ia(Fa)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Fe=Ba;Fe.displayName="DialogActions";var j=Fe;var Ya=To(Ja,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),$a=To(W,{name:"DatePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),qa=To("div",{name:"DatePicker",slot:"container"})({width:"100%"}),Bt=e=>{let o=`${e.getDate()}`,t=`${e.getMonth()+1}`,n=e.getFullYear();return Number(o)<10&&(o="0"+o),Number(t)<10&&(t="0"+t),[n,t,o].join("/")},Wa=S.forwardRef(function(o,t){let{onChange:n,...i}=o;return S.createElement(Ea,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:Po.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Po.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Po.MaskedRange,from:1900,to:9999}},format:Bt,parse:a=>{let r=a.split("/");return new Date(Number(r[0]),Number(r[1])-1,Number(r[2]))},autofix:"pad",overwrite:!0})}),Nt=Na((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=Ha(null),[h,p]=Ft(e.value||""),[c,v]=Ft(null),P=!!c;La(()=>{p(e.value||"")},[e.value]),Sa(o,()=>s.current,[s.current]);let k=At(b=>{p(b.target.value),t?.(b)},[]),A=At(b=>{v(c?null:b.currentTarget),s.current?.focus()},[c,v,s]),f=S.createElement(qa,null,S.createElement(Oa,{open:!0},S.createElement(S.Fragment,null,S.createElement(R,{...y,ref:s,size:"sm",value:h,onChange:k,placeholder:"YYYY/MM/DD",disabled:n,required:d,slotProps:{input:{component:Wa,ref:s}},sx:{fontFamily:"monospace"},endDecorator:S.createElement(V,{variant:"plain",onClick:A},S.createElement(za,null))}),P&&S.createElement(Va,{onClickAway:()=>v(null)},S.createElement(Ya,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},S.createElement($a,{tabIndex:-1,role:"presentation"},S.createElement(K,{value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([b])=>{k({target:{name:e.name,value:Bt(b)}}),v(null),s.current?.blur()},minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),S.createElement(j,{sx:{p:1}},S.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return i?S.createElement(B,{required:d,disabled:n,error:a,size:"sm"},S.createElement(N,null,i),f,r&&S.createElement(w,null,r)):f});import H,{forwardRef as Ua,useCallback as wo,useEffect as Ga,useImperativeHandle as _a,useMemo as Ra,useRef as ja,useState as Lt}from"react";import{IMaskInput as Za,IMask as Io}from"react-imask";import Xa from"@mui/icons-material/esm/CalendarToday.js";import{styled as Ao}from"@mui/joy";import{FocusTrap as Qa,ClickAwayListener as Ka,Popper as ei}from"@mui/base";var oi=Ao(ei,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),ti=Ao(W,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),ri=Ao("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),St=([e,o])=>{let t=n=>{let i=`${n.getDate()}`,a=`${n.getMonth()+1}`,r=n.getFullYear();return Number(i)<10&&(i="0"+i),Number(a)<10&&(a="0"+a),[r,a,i].join("/")};return[t(e),o?t(o):""].join(" - ")},Ht=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"",n=o.split("/"),i=t.split("/");return[new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),new Date(Number(i[0]),Number(i[1])-1,Number(i[2]))]},ni=H.forwardRef(function(o,t){let{onChange:n,...i}=o;return H.createElement(Za,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:Io.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Io.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Io.MaskedRange,from:1900,to:9999}},format:St,parse:Ht,autofix:"pad",overwrite:!0})}),Fo=Ua((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=ja(null),[h,p]=Lt(e.value||""),[c,v]=Lt(null),P=!!c,k=Ra(()=>h?Ht(h):void 0,[h]);Ga(()=>{p(e.value||"")},[e.value]),_a(o,()=>s.current,[s.current]);let A=wo(M=>{p(M.target.value),t?.(M)},[t]),f=wo(M=>{v(c?null:M.currentTarget),s.current?.focus()},[c,v,s]),b=wo(([M,T])=>{!M||!T||(s.current?.blur(),p(St([M,T])),v(null))},[p,v,s]),D=H.createElement(ri,null,H.createElement(Qa,{open:!0},H.createElement(H.Fragment,null,H.createElement(R,{...y,ref:o,size:"sm",value:h,onChange:A,disabled:n,required:d,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:ni,ref:s}},sx:{fontFamily:"monospace"},endDecorator:H.createElement(V,{variant:"plain",onClick:f},H.createElement(Xa,null))}),P&&H.createElement(Ka,{onClickAway:()=>v(null)},H.createElement(oi,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:M=>M.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},H.createElement(ti,{tabIndex:-1,role:"presentation"},H.createElement(K,{rangeSelection:!0,defaultValue:k,onChange:b,minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),H.createElement(j,{sx:{p:1}},H.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return i?H.createElement(B,{required:d,disabled:n,error:a,size:"sm"},H.createElement(N,null,i),D,r&&H.createElement(w,null,r)):D});Fo.displayName="DateRangePicker";import{DialogContent as ai,styled as ii}from"@mui/joy";import{motion as li}from"framer-motion";var si=li(ai),mi=ii(si)(({theme:e})=>({padding:e.spacing(0,6,5)})),Be=mi;Be.displayName="DialogContent";var Ze=Be;import{DialogTitle as pi,styled as di}from"@mui/joy";import{motion as ci}from"framer-motion";var ui=ci(pi),gi=di(ui)(({theme:e})=>({padding:e.spacing(4,6)})),Ne=gi;Ne.displayName="DialogTitle";var Xe=Ne;import Se from"react";import Qe from"react";import{Modal as fi,ModalDialog as hi,ModalClose as bi,ModalOverflow as Ci,styled as Et}from"@mui/joy";import{motion as Ke}from"framer-motion";var yi=Ke(fi),Bo=yi;Bo.displayName="Modal";var xi=Ke(hi),zt=Et(xi)({padding:0}),Le=zt;Le.displayName="ModalDialog";var vi=Et(Ke(bi))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),eo=vi;eo.displayName="ModalClose";var Mi=Ke(Ci),No=Mi;No.displayName="ModalOverflow";function Lo(e){let{title:o,children:t,...n}=e;return Qe.createElement(zt,{...n},Qe.createElement(eo,null),Qe.createElement(Xe,null,o),Qe.createElement(Ze,null,t))}Lo.displayName="ModalFrame";import{styled as ki}from"@mui/joy";var Di=ki(Le)(({theme:e})=>({padding:0})),So=Se.forwardRef((e,o)=>{let{title:t,children:n,actions:i,...a}=e;return Se.createElement(Di,{ref:o,...a},Se.createElement(Xe,null,t),Se.createElement(Ze,null,n),Se.createElement(j,null,i))});So.displayName="DialogFrame";import Pi from"react";import{Divider as Ti}from"@mui/joy";import{motion as wi}from"framer-motion";var Ii=wi(Ti),He=e=>Pi.createElement(Ii,{...e});He.displayName="Divider";import Ai from"react";import{Drawer as Fi}from"@mui/joy";import{motion as Bi}from"framer-motion";var Ni=Bi(Fi),Ho=e=>{let{children:o,...t}=e;return Ai.createElement(Ni,{...t,slotProps:{...t.slotProps,content:{...t.slotProps?.content,sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}}}},o)};Ho.displayName="InsetDrawer";import F,{useCallback as oo,useEffect as Li,useMemo as Ot,useRef as Vt,useState as Eo}from"react";import{styled as ee}from"@mui/joy";import Si from"@mui/icons-material/esm/InfoOutlined.js";import Hi from"@mui/icons-material/esm/CloudUploadRounded.js";import Ei from"@mui/icons-material/esm/UploadFileRounded.js";import zi from"@mui/icons-material/esm/ClearRounded.js";import{combine as Oi}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js";import{dropTargetForExternal as Vi,monitorForExternal as Ji}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/adapter.js";import{containsFiles as Jt,getFiles as Yi}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/file.js";import{preventUnhandled as Yt}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js";var $i=ee("input")({width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",position:"absolute"}),qi=ee(J,{name:"Uploader",slot:"PreviewRoot"})({}),Wi=ee(ke,{name:"Uploader",slot:"UploadCard"})(({theme:e})=>({padding:e.spacing(2.5),border:`1px solid ${e.palette.neutral.outlinedBorder}`})),Ui=ee(Ei,{name:"Uploader",slot:"UploadFileIcon"})(({theme:e})=>({color:e.palette.neutral[400],width:"32px",height:"32px"})),Gi=ee(zi,{name:"Uploader",slot:"ClearIcon"})(({theme:e})=>({color:e.palette.neutral.plainColor,width:"18px",height:"18px"})),_i=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"],$t=e=>{let o=e==0?0:Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,o),n=_i[o];return Intl.NumberFormat("en-us",{style:"unit",unit:n,unitDisplay:"narrow"}).format(t)},Ri=e=>{let{files:o,onDelete:t}=e;return F.createElement(qi,{gap:1},o.map(n=>F.createElement(Wi,{key:n.name,size:"sm",color:"neutral"},F.createElement(J,{direction:"row",alignItems:"center",gap:2},F.createElement(Ui,null),F.createElement(J,{flex:"1"},F.createElement(Y,{level:"body-sm",textColor:"common.black"},n.name),F.createElement(Y,{level:"body-xs",fontWeight:"300",lineHeight:"1.33",textColor:"text.tertiary"},$t(n.size))),F.createElement(V,{onClick:()=>t?.(n)},F.createElement(Gi,null))))))},ji=ee(J,{name:"Uploader",slot:"root"})(({theme:e})=>({gap:e.spacing(2)})),Zi=ee(W,{name:"Uploader",slot:"dropZone"})(({theme:e,state:o,error:t})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:e.spacing(5),gap:e.spacing(4),cursor:"pointer",backgroundColor:e.palette.background.surface,border:t?`1px solid ${e.palette.danger.outlinedBorder}`:o==="idle"?`1px solid ${e.palette.neutral.outlinedBorder}`:`1px solid ${e.palette.primary.outlinedBorder}`})),Xi=ee(Hi,{name:"Uploader",slot:"iconContainer"})(({theme:e,state:o,error:t})=>({color:t?`rgba(${e.vars.palette.danger.mainChannel} / 0.6)`:o==="over"?`rgba(${e.palette.primary.mainChannel} / 0.6)`:e.palette.neutral.softActiveBg,width:"32px",height:"32px"})),zo=F.memo(e=>{let{accept:o,maxCount:t,name:n,size:i,maxSize:a,onChange:r,label:l,helperText:m}=e,u=Vt(null),g=Vt(null),[d,y]=Eo(),[s,h]=Eo([]),[p,c]=Eo("idle"),v=Ot(()=>!!d||e.error,[e.error,d]),P=Ot(()=>!t||t&&s.length!==t,[s,t]),k=oo(M=>{try{a&&M.forEach(O=>{if(O.size>a)throw new Error(`File size exceeds the limit: ${$t(a)}`)});let T=[...s,...M];if(t&&T.length>t)throw new Error(`File count exceeds the limit: ${t}`);r?.({target:{name:n,value:T}}),h(T)}catch(T){y(T.message)}},[s]);Li(()=>{let M=u.current;if(M)return Oi(Vi({element:M,canDrop:Jt,onDragEnter:()=>c("over"),onDragLeave:()=>c("potential"),onDrop:async({source:T})=>{let O=await Yi({source:T});k(O)}}),Ji({canMonitor:Jt,onDragStart:()=>{c("potential"),Yt.start()},onDrop:()=>{c("idle"),Yt.stop()}}))});let A=oo(M=>{let T=Array.from(M.target.files||[]);k(T)},[k]),f=oo(M=>{h(T=>(r?.({target:{name:n,value:T.filter(O=>O!==M)}}),T.filter(O=>O!==M)))},[]),b=oo(()=>{g.current?.click()},[]),D=F.createElement(Zi,{state:p,error:v,ref:u,onClick:b},F.createElement(J,{alignItems:"center",gap:1},F.createElement(Xi,{state:p,error:v})),F.createElement($i,{type:"file",onChange:A,multiple:!0,accept:o,ref:g}));return F.createElement(ji,null,P&&(l?F.createElement(B,{size:i,error:!!v},F.createElement(N,null,l),D,d?F.createElement(w,null,F.createElement(Si,null),d):m&&F.createElement(w,null,m)):D),s.length>0&&F.createElement(Ri,{files:s,onDelete:f}))});zo.displayName="Uploader";import{Grid as Qi}from"@mui/joy";import{motion as Ki}from"framer-motion";var el=Ki(Qi),Oo=el;Oo.displayName="Grid";import Q from"react";import ol from"react-markdown";import{Link as tl}from"@mui/joy";var Vo=e=>{let{children:o,color:t,textColor:n,defaultLevel:i="body-md",markdownOptions:a,...r}=e;return Q.createElement($,{color:t,textColor:n,...r},Q.createElement(ol,{...a,children:o,components:{h1:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h1"},l),h2:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h2"},l),h3:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h3"},l),h4:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h4"},l),p:({children:l})=>Q.createElement($,{color:t,textColor:n,level:i},l),a:({children:l,href:m})=>Q.createElement(tl,{href:m},l),hr:()=>Q.createElement(He,null),...a?.components}}))};Vo.displayName="Markdown";import E,{forwardRef as rl,useCallback as qt,useEffect as nl,useImperativeHandle as al,useRef as il,useState as Wt}from"react";import{IMaskInput as ll,IMask as Ut}from"react-imask";import sl from"@mui/icons-material/esm/CalendarToday.js";import{styled as Yo}from"@mui/joy";import{FocusTrap as ml,ClickAwayListener as pl,Popper as dl}from"@mui/base";var cl=Yo(dl,{name:"MonthPicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),ul=Yo(W,{name:"MonthPicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),gl=Yo("div",{name:"MonthPicker",slot:"container"})({width:"100%"}),Gt=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Jo=e=>(t=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(t))return t;let n=t.split("/"),i=new Date(Number(n[0]),Number(n[1])-1);return Gt(i)})(e),_t=e=>e.split(" - ")[0]||"",fl=E.forwardRef(function(o,t){let{onChange:n,...i}=o;return E.createElement(ll,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m",blocks:{m:{mask:Ut.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ut.MaskedRange,from:1900,to:9999}},format:Jo,parse:_t})}),Rt=rl((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=il(null),[h,p]=Wt(e.value||""),[c,v]=Wt(null),P=!!c;nl(()=>{p(e.value?Jo(_t(e.value)):"")},[e.value]),al(o,()=>s.current,[s.current]);let k=qt(b=>{p(b.target.value),t?.(b)},[]),A=qt(b=>{v(c?null:b.currentTarget),s.current?.focus()},[c,v,s]),f=E.createElement(gl,null,E.createElement(ml,{open:!0},E.createElement(E.Fragment,null,E.createElement(R,{...y,ref:s,size:"sm",value:h,onChange:k,placeholder:"YYYY/MM",disabled:n,required:d,slotProps:{input:{component:fl,ref:s}},sx:{fontFamily:"monospace"},endDecorator:E.createElement(V,{variant:"plain",onClick:A},E.createElement(sl,null))}),P&&E.createElement(pl,{onClickAway:()=>v(null)},E.createElement(cl,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},E.createElement(ul,{tabIndex:-1,role:"presentation"},E.createElement(K,{view:"month",views:["month"],value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([b])=>{k({target:{name:e.name,value:Jo(Gt(b))}}),v(null),s.current?.blur()},minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),E.createElement(j,{sx:{p:1}},E.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return i?E.createElement(B,{required:d,disabled:n,error:a,size:"sm"},E.createElement(N,null,i),f,r&&E.createElement(w,null,r)):f});import z,{forwardRef as hl,useCallback as $o,useEffect as bl,useImperativeHandle as Cl,useMemo as yl,useRef as xl,useState as jt}from"react";import{IMaskInput as vl,IMask as Zt}from"react-imask";import Ml from"@mui/icons-material/esm/CalendarToday.js";import{styled as Go}from"@mui/joy";import{FocusTrap as kl,ClickAwayListener as Dl,Popper as Pl}from"@mui/base";var Tl=Go(Pl,{name:"MonthRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),wl=Go(W,{name:"MonthRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Il=Go("div",{name:"MonthRangePicker",slot:"container"})({width:"100%"}),qo=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Wo=([e,o])=>{let t=n=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(n))return n;let i=n.split("/"),a=new Date(Number(i[0]),Number(i[1])-1);return qo(a)};return[t(e),t(o)].join(" - ")},Uo=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"";return[o,t]},Al=z.forwardRef(function(o,t){let{onChange:n,...i}=o;return z.createElement(vl,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m - Y/m",blocks:{m:{mask:Zt.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Zt.MaskedRange,from:1900,to:9999}},format:Wo,parse:Uo})}),_o=hl((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=xl(null),[h,p]=jt(""),[c,v]=jt(null),P=!!c,k=yl(()=>h?Uo(h).map(M=>new Date(M)):void 0,[h]);bl(()=>{p(e.value?Wo(Uo(e.value)):"")},[e.value]),Cl(o,()=>s.current,[s.current]);let A=$o(M=>{p(M.target.value),t?.(M)},[t]),f=$o(M=>{v(c?null:M.currentTarget),s.current?.focus()},[c,v,s]),b=$o(([M,T])=>{!M||!T||(p(Wo([qo(M),qo(T)])),v(null),s.current?.blur())},[p,v,s]),D=z.createElement(Il,null,z.createElement(kl,{open:!0},z.createElement(z.Fragment,null,z.createElement(R,{...y,ref:o,size:"sm",value:h,onChange:A,disabled:n,required:d,placeholder:"YYYY/MM - YYYY/MM",slotProps:{input:{component:Al,ref:s}},sx:{fontFamily:"monospace"},endDecorator:z.createElement(V,{variant:"plain",onClick:f},z.createElement(Ml,null))}),P&&z.createElement(Dl,{onClickAway:()=>v(null)},z.createElement(Tl,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:M=>M.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},z.createElement(wl,{tabIndex:-1,role:"presentation"},z.createElement(K,{view:"month",views:["month"],rangeSelection:!0,defaultValue:k,onChange:b,minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),z.createElement(j,{sx:{p:1}},z.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return i?z.createElement(B,{required:d,disabled:n,error:a,size:"sm"},z.createElement(N,null,i),D,r&&z.createElement(w,null,r)):D});_o.displayName="MonthRangePicker";import{Radio as Fl,RadioGroup as Bl}from"@mui/joy";import{motion as Xt}from"framer-motion";var Nl=Xt(Fl),Ee=Nl;Ee.displayName="Radio";var Ll=Xt(Bl),ze=Ll;ze.displayName="RadioGroup";import Qt from"react";function Ro(e){let{items:o,...t}=e;return Qt.createElement(ze,{...t},o.map(n=>Qt.createElement(Ee,{key:`${n.value}`,value:n.value,label:n.label})))}Ro.displayName="RadioList";import Oe,{useMemo as Sl}from"react";import{Select as Hl,Option as El}from"@mui/joy";import{motion as zl}from"framer-motion";var Ol=zl(El),to=Ol;to.displayName="Option";function jo(e){let{label:o,helperText:t,error:n,size:i,color:a,disabled:r,required:l,onChange:m,...u}=e,g=Sl(()=>e.options.map(s=>typeof s!="object"?{value:s,label:s}:s),[e.options]),y=Oe.createElement(Hl,{...u,required:l,disabled:r,size:i,color:a,onChange:(s,h)=>{let p=s||{target:{}},c={...p,target:{name:p.target?.name||e.name,value:h||void 0}};m?.(c)}},g.map(s=>Oe.createElement(to,{key:s.value,value:s.value},s.label)));return o?Oe.createElement(B,{required:l,disabled:r,size:i,color:a,error:n},Oe.createElement(N,null,o),y,t&&Oe.createElement(w,null,t)):y}jo.displayName="Select";import Kt from"react";import{Switch as Vl,styled as Jl,switchClasses as Yl}from"@mui/joy";import{motion as er}from"framer-motion";var $l=er(Vl),ql=Jl(er.div)({"--Icon-fontSize":"calc(var(--Switch-thumbSize) * 0.75)",display:"inline-flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"var(--Switch-thumbOffset)",width:"var(--Switch-thumbWidth)",height:"var(--Switch-thumbSize)",borderRadius:"var(--Switch-thumbRadius)",boxShadow:"var(--Switch-thumbShadow)",color:"var(--Switch-thumbColor)",backgroundColor:"var(--Switch-thumbBackground)",[`&.${Yl.checked}`]:{left:"unset",right:"var(--Switch-thumbOffset)"}}),Wl=e=>Kt.createElement(ql,{...e,layout:!0,transition:Ul}),Ul={type:"spring",stiffness:700,damping:30},Zo=e=>Kt.createElement($l,{...e,slots:{thumb:Wl,...e.slots}});Zo.displayName="Switch";import{Tabs as Gl,Tab as _l,TabList as Rl,TabPanel as jl,styled as Zl,tabClasses as Xl}from"@mui/joy";import{motion as ro}from"framer-motion";var Ql=ro(Gl),Xo=Ql;Xo.displayName="Tabs";var Kl=Zl(ro(_l))(({theme:e})=>({[`&:not(.${Xl.selected})`]:{color:e.palette.neutral[700]}})),Qo=Kl;Qo.displayName="Tab";var es=ro(Rl),Ko=es;Ko.displayName="TabList";var os=ro(jl),et=os;et.displayName="TabPanel";import no from"react";import{Textarea as ts}from"@mui/joy";import{motion as rs}from"framer-motion";var ns=rs(ts),ot=e=>{let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,...m}=e,u=no.createElement(ns,{required:l,disabled:r,color:i,size:a,...m});return o?no.createElement(B,{required:l,disabled:r,color:i,size:a,error:t},no.createElement(N,null,o),u,n&&no.createElement(w,null,n)):u};ot.displayName="Textarea";import ao from"react";import{CssBaseline as as,CssVarsProvider as is,checkboxClasses as ls,extendTheme as ss}from"@mui/joy";var ms=ss({cssVarPrefix:"ceed",spacing:4,zIndex:{popup:1500},components:{JoyTable:{defaultProps:{size:"sm",borderAxis:"bothBetween"},styleOverrides:{root:({theme:e})=>({"--TableRow-stripeBackground":e.palette.background.level1,"--TableCell-selectedBackground":e.palette.background.level2,"--TableRow-hoverBackground":e.palette.background.level3,"& tbody tr[aria-checked=false] th":{"--TableCell-headBackground":"transparent"},"& tbody tr[aria-checked=true]:hover th":{"--TableCell-headBackground":"var(--TableRow-hoverBackground)"},"& tbody tr[aria-checked=true]:not(:hover) th":{"--TableCell-headBackground":"var(--TableCell-selectedBackground)"},"& tbody tr[aria-checked=true]:not(:hover) td":{"--TableCell-dataBackground":"var(--TableCell-selectedBackground)"},[`& .${ls.root}`]:{verticalAlign:"middle"}})}},JoyTooltip:{defaultProps:{size:"sm",placement:"top"}}}});function tt(e){return ao.createElement(ao.Fragment,null,ao.createElement(is,{theme:ms},ao.createElement(as,null),e.children))}tt.displayName="ThemeProvider";import ps from"react";import{Tooltip as ds}from"@mui/joy";import{motion as cs}from"framer-motion";var us=cs(ds),rt=e=>ps.createElement(us,{...e});rt.displayName="Tooltip";export{$e as Accordion,Ye as AccordionDetails,Je as AccordionSummary,lo as Accordions,so as Alert,ob as AspectRatio,lt as Autocomplete,Gh as AutocompleteListbox,_h as AutocompleteOption,Xh as Avatar,Kh as AvatarGroup,rb as Badge,ue as Box,co as Breadcrumbs,Ce as Button,ve as Calendar,ke as Card,bo as CardActions,fo as CardContent,ho as CardCover,Co as CardOverflow,De as Checkbox,yo as Chip,cb as CircularProgress,xo as Container,wt as CurrencyInput,Do as DataTable,Nt as DatePicker,Fo as DateRangePicker,Fe as DialogActions,Be as DialogContent,So as DialogFrame,Ne as DialogTitle,He as Divider,gb as Drawer,be as Dropdown,me as FormControl,de as FormHelperText,pe as FormLabel,Oo as Grid,ye as IconButton,we as Input,Ho as InsetDrawer,hb as LinearProgress,Nb as Link,Cb as List,xb as ListDivider,Mb as ListItem,Db as ListItemButton,Tb as ListItemContent,Ib as ListItemDecorator,Fb as ListSubheader,Vo as Markdown,ge as Menu,fe as MenuButton,he as MenuItem,Bo as Modal,eo as ModalClose,Le as ModalDialog,Lo as ModalFrame,No as ModalOverflow,Rt as MonthPicker,_o as MonthRangePicker,to as Option,Ee as Radio,ze as RadioGroup,Ro as RadioList,jo as Select,Ie as Sheet,qb as Skeleton,Sb as Slider,se as Stack,Eb as Step,Ob as StepButton,Jb as StepIndicator,Yb as Stepper,Zo as Switch,Qo as Tab,Ko as TabList,et as TabPanel,Ae as Table,Mo as TableBody,vo as TableHead,Xo as Tabs,ot as Textarea,tt as ThemeProvider,rt as Tooltip,$ as Typography,zo as Uploader,$h as accordionClasses,qh as accordionDetailsClasses,Uh as accordionSummaryClasses,Wh as accordionsClasses,lh as alertClasses,tb as aspectRatioClasses,Rh as autocompleteClasses,jh as autocompleteListboxClasses,Zh as autocompleteOptionClasses,Qh as avatarClasses,eb as avatarGroupClasses,nb as badgeClasses,sh as boxClasses,ab as breadcrumbsClasses,mh as buttonClasses,lb as cardActionsClasses,ib as cardClasses,sb as cardContentClasses,mb as cardCoverClasses,pb as cardOverflowClasses,ph as checkboxClasses,db as chipClasses,ub as circularProgressClasses,zh as dialogActionsClasses,Eh as dialogContentClasses,Hh as dialogTitleClasses,dh as dividerClasses,fb as drawerClasses,Ph as formControlClasses,wh as formHelperTextClasses,Th as formLabelClasses,Ih as gridClasses,ch as iconButtonClasses,uh as inputClasses,bb as linearProgressClasses,Lb as linkClasses,yb as listClasses,vb as listDividerClasses,Pb as listItemButtonClasses,kb as listItemClasses,wb as listItemContentClasses,Ab as listItemDecoratorClasses,Bb as listSubheaderClasses,fh as menuButtonClasses,gh as menuClasses,hh as menuItemClasses,Bh as modalClasses,Nh as modalCloseClasses,Lh as modalDialogClasses,Sh as modalOverflowClasses,bh as optionClasses,Ch as radioClasses,yh as radioGroupClasses,xh as selectClasses,Fh as sheetClasses,Wb as skeletonClasses,Hb as sliderClasses,Ah as stackClasses,Vb as stepButtonClasses,zb as stepClasses,$b as stepperClasses,vh as switchClasses,Jh as tabListClasses,Yh as tabPanelClasses,Mh as tableClasses,Vh as tabsClasses,kh as textareaClasses,Oh as tooltipClasses,Dh as typographyClasses,ah as useColorScheme,nh as useTheme,ih as useThemeProps};
1
+ import{useTheme as Jh,useColorScheme as Yh,useThemeProps as $h,alertClasses as Rh,boxClasses as qh,buttonClasses as Wh,checkboxClasses as Uh,dividerClasses as Gh,iconButtonClasses as _h,inputClasses as jh,menuClasses as Zh,menuButtonClasses as Xh,menuItemClasses as Qh,optionClasses as Kh,radioClasses as eC,radioGroupClasses as oC,selectClasses as tC,switchClasses as rC,tableClasses as nC,textareaClasses as aC,typographyClasses as iC,formControlClasses as lC,formLabelClasses as sC,formHelperTextClasses as pC,gridClasses as mC,stackClasses as dC,sheetClasses as cC,modalClasses as uC,modalCloseClasses as gC,modalDialogClasses as fC,modalOverflowClasses as hC,dialogTitleClasses as CC,dialogContentClasses as yC,dialogActionsClasses as bC,tooltipClasses as xC,tabsClasses as vC,tabListClasses as DC,tabPanelClasses as kC,accordionClasses as MC,accordionDetailsClasses as TC,accordionGroupClasses as PC,accordionSummaryClasses as wC,AutocompleteListbox as IC,AutocompleteOption as AC,autocompleteClasses as FC,autocompleteListboxClasses as BC,autocompleteOptionClasses as VC,Avatar as NC,avatarClasses as LC,AvatarGroup as SC,avatarGroupClasses as EC,AspectRatio as HC,aspectRatioClasses as zC,Badge as OC,badgeClasses as JC,breadcrumbsClasses as YC,cardClasses as $C,cardActionsClasses as RC,cardContentClasses as qC,cardCoverClasses as WC,cardOverflowClasses as UC,chipClasses as GC,CircularProgress as _C,circularProgressClasses as jC,Drawer as ZC,drawerClasses as XC,LinearProgress as QC,linearProgressClasses as KC,List as ey,listClasses as oy,ListDivider as ty,listDividerClasses as ry,ListItem as ny,listItemClasses as ay,ListItemButton as iy,listItemButtonClasses as ly,ListItemContent as sy,listItemContentClasses as py,ListItemDecorator as my,listItemDecoratorClasses as dy,ListSubheader as cy,listSubheaderClasses as uy,Link as gy,linkClasses as fy,Slider as hy,sliderClasses as Cy,Step as yy,stepClasses as by,StepButton as xy,stepButtonClasses as vy,StepIndicator as Dy,Stepper as ky,stepperClasses as My,Skeleton as Ty,skeletonClasses as Py}from"@mui/joy";import ie from"react";import{AccordionGroup as fr,Accordion as hr,AccordionSummary as Cr,AccordionDetails as yr}from"@mui/joy";import{motion as Ye}from"framer-motion";var br=Ye(Cr),$e=br;$e.displayName="AccordionSummary";var xr=Ye(yr),Re=xr;Re.displayName="AccordionDetails";var vr=Ye(hr);function qe(e){let{summary:o,details:t,variant:n,color:l,...a}=e,r=n==="solid"?"solid":void 0;return ie.createElement(vr,{variant:r,color:l,...a},ie.createElement($e,{variant:r,color:l},o),ie.createElement(Re,{variant:r,color:l},t))}qe.displayName="Accordion";var Dr=Ye(fr);function fo(e){let{variant:o,color:t,items:n,...l}=e;return ie.createElement(Dr,{variant:o,color:t,...l},n.map((a,r)=>ie.createElement(qe,{key:r,summary:a.summary,details:a.details,index:r,variant:o,color:t})))}fo.displayName="Accordions";import We from"react";import{Alert as Fr,styled as Br}from"@mui/joy";import{motion as Vr}from"framer-motion";import kr from"react";import{Typography as Mr}from"@mui/joy";import{motion as Tr}from"framer-motion";var Pr=Tr(Mr),R=e=>kr.createElement(Pr,{...e});R.displayName="Typography";var Y=R;import{Stack as wr}from"@mui/joy";import{motion as Ir}from"framer-motion";var Ar=Ir(wr),le=Ar;le.displayName="Stack";var O=le;var Nr=Br(Vr(Fr))({alignItems:"flex-start",fontWeight:"unset"});function ho(e){let{title:o,content:t,actions:n,color:l="primary",...a}=e,r=e.invertedColors||e.variant==="solid";return We.createElement(Nr,{...a,color:l,endDecorator:n,invertedColors:r},We.createElement(O,null,o&&We.createElement(Y,{level:"title-sm",color:l},o),We.createElement(Y,{level:"body-sm",color:l},t)))}ho.displayName="Alert";import N,{useCallback as qr,useEffect as Wr,useMemo as de,useRef as Ur,useState as Gr}from"react";import{Autocomplete as _r,AutocompleteOption as jr,ListSubheader as Zr,AutocompleteListbox as Xr,ListItemDecorator as ct,CircularProgress as Qr,styled as Kr}from"@mui/joy";import{useVirtualizer as en}from"@tanstack/react-virtual";import{Popper as on}from"@mui/base";import{FormControl as Lr,styled as Sr}from"@mui/joy";import{motion as Er}from"framer-motion";var Hr=Sr(Er(Lr))({width:"100%"}),se=Hr;se.displayName="FormControl";var B=se;import{FormLabel as zr}from"@mui/joy";import{motion as Or}from"framer-motion";var Jr=Or(zr),pe=Jr;pe.displayName="FormLabel";var V=pe;import{FormHelperText as Yr}from"@mui/joy";import{motion as $r}from"framer-motion";var Rr=$r(Yr),me=Rr;me.displayName="FormHelperText";var w=me;var tn=Kr(on,{name:"Autocomplete",slot:"Popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),rn=N.forwardRef((e,o)=>{let{anchorEl:t,open:n,modifiers:l,children:a,ownerState:{loading:r,size:i="md"},...m}=e,d=Ur(null),g=a[0].every(y=>y.hasOwnProperty("group")),c=r?[a[1]]:a[0].length===0?[a[2]]:g?a[0].flatMap(y=>[N.createElement(Zr,{key:y.key,component:"li"},y.group),...y.children]):a[0],C=en({count:c.length,estimateSize:()=>36,getScrollElement:()=>d.current,overscan:5}),s=C.getVirtualItems();return Wr(()=>{n&&C.measure()},[n]),N.createElement(tn,{ref:o,anchorEl:t,open:n,modifiers:l},N.createElement(Xr,{...m},N.createElement("div",{ref:d,style:{overflow:"auto"}},N.createElement("div",{style:{height:`${C.getTotalSize()}px`,position:"relative"}},s.map(({index:y,size:p,start:u,key:v})=>N.cloneElement(c[y],{key:v,style:{position:"absolute",top:0,left:0,width:"100%",fontSize:`var(--ceed-fontSize-${i})`,height:`${p}px`,transform:`translateY(${u}px)`,overflow:"visible"},children:N.createElement("div",{style:{textOverflow:"ellipsis",textWrap:"nowrap",overflow:"hidden",width:"100%"}},c[y].props.children)}))))))});function Ue(e){let{label:o,error:t,helperText:n,color:l,size:a,disabled:r,required:i,onChange:m,onChangeComplete:d,...g}=e,[c,C]=Gr(e.value||e.defaultValue),s=de(()=>e.options.map(h=>typeof h!="object"?{value:h,label:h}:h),[e.options]),y=de(()=>new Set(s.map(h=>h.value)),[e.options]),p=de(()=>e.loading?{value:"",label:"",startDecorator:N.createElement(Qr,{size:"sm",color:"neutral",variant:"plain",thickness:3})}:typeof c=="string"?s.find(h=>h.value===c)??c:c,[c,e.options,e.loading]),u=qr(h=>N.isValidElement(h)&&!e.loading?N.cloneElement(h,{size:a}):h,[a,e.loading]),v=de(()=>u(p?.startDecorator||e.startDecorator),[p,u]),P=de(()=>u(p?.endDecorator||e.endDecorator),[p,u]),F=N.createElement(_r,{...g,required:i,onChange:(h,b)=>{C(b);let M=b;m?.({...h,target:{...h.target,value:M?.value}}),y.has(M.value)&&d?.({...h,target:{...h.target,value:M?.value}})},color:l,value:p,options:s,size:a,disabled:r,startDecorator:v,endDecorator:P,getOptionLabel:h=>`${h.value??""}`,slots:{listbox:rn},renderOption:(h,b)=>N.createElement(jr,{...h},b.startDecorator&&N.createElement(ct,{sx:M=>({marginInlineEnd:`var(--Input-gap, ${M.spacing(1)})`})},u(b.startDecorator)),u(b.label),b.endDecorator&&N.createElement(ct,{sx:M=>({marginInlineStart:`var(--Input-gap, ${M.spacing(1)})`})},u(b.endDecorator))),renderGroup:h=>h});return o?N.createElement(B,{required:i,color:l,size:a,error:t,disabled:r},N.createElement(V,null,o),F,n&&N.createElement(w,null,n)):F}var ut=Ue;import{Box as nn}from"@mui/joy";import{motion as an}from"framer-motion";var ln=an(nn),ce=ln;ce.displayName="Box";var Ge=ce;import q from"react";import{Breadcrumbs as ht,Link as Cn}from"@mui/joy";import Co from"react";import{Menu as sn,MenuButton as pn,MenuItem as mn}from"@mui/joy";import{motion as yo}from"framer-motion";var dn=yo(sn),ue=e=>Co.createElement(dn,{...e});ue.displayName="Menu";var cn=yo(pn),ge=e=>Co.createElement(cn,{...e});ge.displayName="MenuButton";var un=yo(mn),fe=e=>Co.createElement(un,{...e});fe.displayName="MenuItem";var gt=ue;import{Dropdown as gn}from"@mui/joy";import{motion as fn}from"framer-motion";var hn=fn(gn),he=hn;he.displayName="Dropdown";var ft=he;function bo(e){let{crumbs:o,size:t,startCrumbCount:n=1,endCrumbCount:l=3,slots:{link:a,...r}={link:Cn},slotProps:{link:i,...m}={link:{color:"neutral"}},collapsed:d=!0,...g}=e,c=u=>u.type==="link"&&a?q.createElement(a,{to:u.linkHref,href:u.linkHref,...i},u.label):q.createElement(Y,null,u.label);if(!d)return q.createElement(ht,{size:t,slots:r,slotProps:m,...g},o.map(u=>q.createElement(c,{...u})));let C=Math.max(1,l),s=o.slice(0,n).map(u=>q.createElement(c,{...u})),y=(n+C>o.length?o.slice(n):o.slice(-C)).map(u=>q.createElement(c,{...u})),p=o.slice(n,-C).map(u=>q.createElement(fe,null,q.createElement(c,{...u})));return q.createElement(ht,{size:t,slots:r,slotProps:m,...g},s,p.length&&q.createElement(ft,null,q.createElement(ge,{size:t,variant:"plain"},"..."),q.createElement(gt,{size:t},p)),y)}bo.displayName="Breadcrumbs";import yn,{forwardRef as bn}from"react";import{Button as xn}from"@mui/joy";import{motion as vn}from"framer-motion";var Dn=vn(xn),Ce=bn((e,o)=>yn.createElement(Dn,{ref:o,...e}));Ce.displayName="Button";var I=Ce;import x,{Fragment as be,forwardRef as Bn,useMemo as Mt}from"react";import{styled as G}from"@mui/joy";import Vn from"@mui/icons-material/esm/ChevronLeft.js";import Nn from"@mui/icons-material/esm/ChevronRight.js";import{AnimatePresence as Tt,motion as Ln}from"framer-motion";var Ct=e=>{let o=[],t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0),l=Math.ceil((t.getDay()+1)/7),a=Math.ceil((n.getDate()+t.getDay())/7),r=1;for(let i=1;i<=a;i++){let m=[];for(let d=1;d<=7;d++)i===l&&d<t.getDay()+1||r>n.getDate()?m.push(void 0):(m.push(r),r++);o.push(m)}return o},yt=(e,o)=>e.toLocaleString(o,{year:"numeric"}),xo=(e,o)=>e.toLocaleString(o,{year:"numeric",month:"long"}),bt=(e,o)=>new Date(0,e).toLocaleString(o,{month:"short"}),xt=e=>{let o=new Date().getDay(),t=new Date;return t.setDate(t.getDate()-o),Array.from({length:7}).map(()=>{let n=t.toLocaleString(e,{weekday:"short"});return t.setDate(t.getDate()+1),n})},vt=e=>{let o=new Date,t=new Date(e);return t.setHours(0,0,0,0),o.setHours(0,0,0,0),t.getTime()===o.getTime()},vo=(e,o)=>{let t=new Date(e),n=new Date(o);return t.setHours(0,0,0,0),n.setHours(0,0,0,0),t.getTime()===n.getTime()},Z=(e,o,t)=>{let n=new Date(t);n.setHours(0,0,0,0);let l=new Date(Math.min(e.getTime(),o.getTime())),a=new Date(Math.max(e.getTime(),o.getTime()));return n>=l&&n<=a},_e=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth();import kn from"react";import{IconButton as Mn}from"@mui/joy";import{motion as Tn}from"framer-motion";var Pn=Tn(Mn),ye=e=>kn.createElement(Pn,{...e});ye.displayName="IconButton";var z=ye;import{useCallback as wn,useMemo as In,useState as je}from"react";import{useThemeProps as An}from"@mui/joy";var Fn=(e,o)=>o.includes(e)?e:o[0],Dt=e=>{let[o,t]=je(()=>Fn(e.view||"day",e.views||["day","month"])),[n,l]=je(e.defaultValue),[a,r]=je(()=>{let p=new Date;return p.setDate(1),p.setHours(0,0,0,0),e.value?.[0]||e.defaultValue?.[0]||p}),[[i,m],d]=je([0,0]),g=e.view??o,c=p=>{d([i+p,p])},C=wn(p=>{r(p),g==="month"?a.getFullYear()!==p.getFullYear()&&c(p>a?1:-1):c(p>a?1:-1),e.onMonthChange?.(p)},[e.onMonthChange,a,g]),s=An({props:{locale:"default",views:["day","month"],view:g,value:e.value??n,...e,onChange:e.value?e.onChange:p=>{l(p),e.onChange?.(p)},onMonthChange:C,onViewChange:()=>{let p=g==="month"?"day":"month";!(!e.views||e.views.includes(p))||e.view===p||(e.onViewChange?e.onViewChange(p):t(p))}},name:"Calendar"}),y=In(()=>({...s,viewMonth:a,direction:m}),[s,a,m]);return[s,y]};import{useCallback as ne,useState as kt}from"react";var Ze=e=>{let[o,t]=kt(null),[n,l]=kt(null);return{calendarTitle:e.view==="month"?yt(e.viewMonth,e.locale||"default"):xo(e.viewMonth,e.locale||"default"),onPrev:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()-1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()-1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),onNext:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()+1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()+1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),getDayCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let i=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":i?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,o]),getMonthCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let m=!e.views?.find(d=>d==="day")&&e.rangeSelection&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":m?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,n]),getPickerDayProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let i=!!e.value&&(vo(r,e.value[0])||e.value[1]&&vo(r,e.value[1])),m=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),d=()=>{e.rangeSelection?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]),t(null)};return{isToday:vt(r),isSelected:i,onClick:d,onMouseEnter:e.rangeSelection&&e.value?.[0]&&!e.value?.[1]?()=>t(r):void 0,disabled:e.minDate&&r<e.minDate||e.maxDate&&r>e.maxDate||e.disableFuture&&r>new Date||e.disablePast&&r<(()=>{let g=new Date;return g.setHours(0,0,0,0),g})(),tabIndex:-1,"aria-label":r.toLocaleDateString(),"aria-selected":i?"true":void 0,"aria-current":m?"date":void 0}},[e.onChange,e.value,e.viewMonth,e.rangeSelection,e.minDate,e.maxDate,e.disableFuture,e.disablePast,o]),getPickerMonthProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let i=!e.views?.find(C=>C==="day"),m=i&&e.rangeSelection,d=!!e.value&&(_e(r,e.value[0])||e.value[1]&&_e(r,e.value[1])),g=m&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),c=()=>{m?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):i?e.onChange?.([r,void 0]):(e.onViewChange?.("day"),e.onMonthChange?.(r)),l(null)};return{isSelected:d,onMouseEnter:m&&e.value?.[0]&&!e.value?.[1]?()=>l(r):void 0,disabled:e.minDate&&(()=>{let C=new Date(r);return C.setMonth(C.getMonth()+1),C.setDate(0),C<e.minDate})()||e.maxDate&&(()=>{let C=new Date(r);return C.setDate(0),C>e.maxDate})()||e.disableFuture&&r>new Date||e.disablePast&&r<new Date&&!_e(r,new Date),onClick:c,tabIndex:-1,"aria-label":xo(r,e.locale||"default"),"aria-selected":d?"true":void 0,"aria-current":g?"date":void 0}},[e.onMonthChange,e.onViewChange,e.onChange,e.viewMonth,e.locale,e.value,e.minDate,e.maxDate,e.disableFuture,e.disablePast,n])}};var Sn=G("div",{name:"Calendar",slot:"root"})({maxWidth:"264px"}),En=G("div",{name:"Calendar",slot:"calendarHeader"})(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing(2)})),Pt=G("div",{name:"Calendar",slot:"viewContainer"})(({theme:e,calendarType:o})=>({paddingLeft:e.spacing(2),paddingRight:e.spacing(2),position:"relative",overflow:"hidden",minHeight:o==="datePicker"?"250px":"unset"})),wt=G(Ln.table,{name:"Calendar",slot:"viewTable"})(({theme:e})=>({borderSpacing:0,"& td, & th":{padding:0},"& th":{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),Hn=G("thead",{name:"Calendar",slot:"weekHeaderContainer"})({}),zn=G("tbody",{name:"Calendar",slot:"dayPickerContainer"})({}),On=G(I,{name:"Calendar",slot:"switchViewButton"})(({ownerState:e})=>[e.view==="month"&&{pointerEvents:"none"}]),Jn=G("td",{name:"Calendar",slot:"dayCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Yn=G("td",{name:"Calendar",slot:"monthCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),$n=G(I,{name:"Calendar",slot:"month"})(({theme:e,isSelected:o,disabled:t})=>[{width:"59px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},t&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Rn=G(I,{name:"Calendar",slot:"day"})(({theme:e,isToday:o,isSelected:t,disabled:n})=>[{width:"32px",height:"32px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&!t&&{"&:not([aria-current=date]):not(:hover)":{border:`1px solid ${e.palette.neutral.outlinedBorder}`}},t&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},n&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),It={enter:e=>({x:e>0?300:-300,opacity:0}),center:{position:"relative",zIndex:1,x:0,opacity:1},exit:e=>({position:"absolute",zIndex:0,x:e<0?300:-300,opacity:0})},Xe=1e4,At=(e,o)=>Math.abs(e)*o,qn=e=>{let{ownerState:o}=e,{getPickerDayProps:t,getDayCellProps:n}=Ze(o),l=Mt(()=>Ct(o.viewMonth),[o.viewMonth]),a=Mt(()=>xt(o.locale||"default"),[o.locale]);return x.createElement(Pt,{calendarType:"datePicker"},x.createElement(Tt,{initial:!1,custom:o.direction},x.createElement(wt,{key:`${o.viewMonth.toString()}_${o.direction}`,custom:o.direction,variants:It,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:i,velocity:m})=>{let d=At(i.x,m.x);if(d<-Xe){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(d>Xe){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement(Hn,null,x.createElement("tr",null,a.map((r,i)=>x.createElement(x.Fragment,null,x.createElement("th",null,x.createElement(Y,{level:"body-xs",textAlign:"center"},r)),i<6&&x.createElement("th",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"}))))),x.createElement(zn,null,l.map((r,i)=>x.createElement(be,{key:`${o.viewMonth}_${i}`},x.createElement("tr",null,r.map((m,d)=>m?x.createElement(be,{key:d},x.createElement(Jn,{...n(m)},x.createElement(Rn,{size:"sm",variant:"plain",color:"neutral",...t(m)},m)),d<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})):x.createElement(be,{key:d},x.createElement("td",null),d<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})))),i<l.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:13,style:{height:4}}))))))))},Wn=e=>{let{ownerState:o}=e,{getPickerMonthProps:t,getMonthCellProps:n}=Ze(o),l=Array.from({length:12},(r,i)=>i).reduce((r,i)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(i),r),[[]]),a=!o.views?.find(r=>r==="day");return x.createElement(Pt,{calendarType:a?"monthPicker":"datePicker"},x.createElement(Tt,{initial:!1,custom:o.direction},x.createElement(wt,{key:`${o.viewMonth.getFullYear()}_${o.direction}`,custom:o.direction,variants:It,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:i,velocity:m})=>{let d=At(i.x,m.x);if(d<-Xe){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(d>Xe){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement("tbody",null,l.map((r,i)=>x.createElement(be,{key:i},x.createElement("tr",null,r.map((m,d)=>x.createElement(be,{key:m},x.createElement(Yn,{...n(m)},x.createElement($n,{size:"sm",variant:"plain",color:"neutral",...t(m)},bt(m,o.locale))),d<3&&x.createElement("td",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"})))),i<l.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:7,style:{height:4}}))))))))},xe=Bn((e,o)=>{let[t,n]=Dt(e),{value:l,defaultValue:a,onChange:r,locale:i,onViewChange:m,onMonthChange:d,view:g,views:c,rangeSelection:C,...s}=t,{calendarTitle:y,onPrev:p,onNext:u}=Ze(n);return x.createElement(Sn,{ref:o,...s},x.createElement(En,null,x.createElement(z,{size:"sm",onClick:p},x.createElement(Vn,null)),x.createElement(On,{ownerState:n,variant:"plain",color:"neutral",onClick:m},y),x.createElement(z,{size:"sm",onClick:u},x.createElement(Nn,null))),g==="day"&&x.createElement(qn,{ownerState:n}),g==="month"&&x.createElement(Wn,{ownerState:n}))});xe.displayName="Calendar";var ee=xe;import{Card as Un,CardContent as Gn,CardCover as _n,CardActions as jn,CardOverflow as Zn}from"@mui/joy";import{motion as ve}from"framer-motion";var Xn=ve(Un),De=Xn;De.displayName="Card";var Qn=ve(Gn),Do=Qn;Do.displayName="CardContent";var Kn=ve(_n),ko=Kn;ko.displayName="CardCover";var ea=ve(jn),Mo=ea;Mo.displayName="CardActions";var oa=ve(Zn),To=oa;To.displayName="CardOverflow";import ta from"react";import{Checkbox as ra}from"@mui/joy";import{motion as na}from"framer-motion";var aa=na(ra),ke=e=>ta.createElement(aa,{...e});ke.displayName="Checkbox";var Me=ke;import{Chip as ia}from"@mui/joy";import{motion as la}from"framer-motion";var sa=la(ia),Te=sa;Te.displayName="Chip";var Ft=Te;import{styled as pa}from"@mui/joy";import ma,{forwardRef as da}from"react";var ca=pa("div",{name:"Container",slot:"root",shouldForwardProp:e=>e!=="maxWidth"})(({theme:e,maxWidth:o="lg"})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block",paddingLeft:e.spacing(4),paddingRight:e.spacing(4),...o==="sm"&&{[e.breakpoints.up("xs")]:{maxWidth:e.breakpoints.values.sm}},...o==="md"&&{[e.breakpoints.up("sm")]:{maxWidth:e.breakpoints.values.md}},...o==="lg"&&{[e.breakpoints.up("md")]:{maxWidth:e.breakpoints.values.lg}},...o==="xl"&&{[e.breakpoints.up("lg")]:{maxWidth:e.breakpoints.values.xl}}})),Po=da(function(o,t){return ma.createElement(ca,{ref:t,...o})});Po.displayName="Container";import X,{useCallback as ha,useMemo as Ca,useState as Nt}from"react";import{IntlMessageFormat as ya}from"intl-messageformat";import{NumericFormat as ba}from"react-number-format";import xa from"@mui/icons-material/esm/InfoOutlined.js";import Pe from"react";import{Input as ua}from"@mui/joy";import{motion as ga}from"framer-motion";var Bt=ga(ua),we=e=>{let{label:o,helperText:t,error:n,style:l,size:a,color:r,disabled:i,required:m,...d}=e;return o?Pe.createElement(B,{required:m,color:r,size:a,error:n,disabled:i},Pe.createElement(V,null,o),Pe.createElement(Bt,{...d}),t&&Pe.createElement(w,null,t)):Pe.createElement(Bt,{required:m,color:r,size:a,disabled:i,...d})};we.displayName="Input";var $=we;import fa from"intl-messageformat";var Vt=(e="usd")=>{let[o,t,n]=new fa(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split("");return{symbol:`${o} `,thousandSeparator:t,decimalSeparator:n,placeholder:n?`${o} 0${n}00`:`${o} 0`,fixedDecimalScale:!!n}};var va=X.forwardRef(function(o,t){let{onChange:n,...l}=o;return X.createElement(ba,{...l,onValueChange:({value:a})=>{n?.({target:{name:o.name,value:a}})},valueIsNumericString:!0,getInputRef:t,decimalScale:2})}),Qe=X.forwardRef(function(o,t){let{currency:n="usd",max:l=1e5,name:a,onChange:r,label:i,error:m,helperText:d,required:g,disabled:c,useMinorUnit:C,...s}=o,{symbol:y,thousandSeparator:p,decimalSeparator:u,placeholder:v,fixedDecimalScale:P}=Vt(n),[k,F]=Nt(o.value),[h,b]=Nt(!!l&&!!o.value&&o.value>l),M=Ca(()=>k&&C?k/100:k,[k,C]),D=ha(J=>{let K=Number(C?J.target.value?.replace(u,""):J.target.value);F(K),r?.({...J,target:{name:a,value:K}}),l&&K>l?b(!0):b(!1)},[]),T=X.createElement($,{...s,size:"sm",ref:t,value:M,placeholder:v,onChange:D,disabled:c,required:g,slotProps:{input:{component:va,decimalSeparator:u,thousandSeparator:p,prefix:y,fixedDecimalScale:P}},sx:{fontFamily:"monospace"}});return i?X.createElement(B,{size:"sm",disabled:c,required:g,error:m||h},X.createElement(V,null,i),T,h?X.createElement(w,null,X.createElement(xa,null),new ya(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:l})):d&&X.createElement(w,null,d)):T});var Lt=Qe;import f,{useCallback as te,useEffect as ro,useMemo as U,useRef as Qa,useState as Vo}from"react";import{styled as Ka,LinearProgress as ei,Link as oi}from"@mui/joy";import ti from"@mui/icons-material/esm/ChevronLeft.js";import ri from"@mui/icons-material/esm/ChevronRight.js";import{Sheet as Da}from"@mui/joy";import{motion as ka}from"framer-motion";var Ma=ka(Da),Ie=Ma;Ie.displayName="Sheet";var W=Ie;import _ from"react";import{Table as Ta}from"@mui/joy";var Ae=e=>{let{children:o,...t}=e;return _.createElement(Ta,{...t},o)};Ae.displayName="Table";function wo(e){let{headCells:o,showCheckbox:t,onCheckboxChange:n,slots:{checkbox:l=Me}={},slotProps:{checkbox:a={}}={}}=e;return _.createElement("thead",null,_.createElement("tr",null,t&&_.createElement("th",{style:{width:"40px",textAlign:"center"}},_.createElement(l,{onChange:n,...a})),o.map(r=>_.createElement("th",{key:r.label,style:{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,textAlign:r.numeric?"right":"left"}},r.label))))}wo.displayName="TableHead";function Io(e){let{rows:o,cellOrder:t,rowOptions:n,showCheckbox:l,onCheckboxChange:a,slots:{checkbox:r=Me}={},slotProps:{checkbox:i={}}={}}=e;return _.createElement("tbody",null,o.map((m,d)=>_.createElement("tr",{key:d},l&&_.createElement("td",{style:{textAlign:"center"}},_.createElement(r,{onChange:g=>a?.(g,d),...i})),t.map(g=>_.createElement("td",{key:g,style:{textAlign:n?.[g]?.numeric?"right":"left"}},m[g])))))}Io.displayName="TableBody";import L,{forwardRef as Ba,useCallback as St,useEffect as Va,useImperativeHandle as Na,useRef as La,useState as Et}from"react";import{IMaskInput as Sa,IMask as Ao}from"react-imask";import Ea from"@mui/icons-material/esm/CalendarToday.js";import{styled as Fo}from"@mui/joy";import{FocusTrap as Ha,ClickAwayListener as za,Popper as Oa}from"@mui/base";import{DialogActions as Pa,styled as wa}from"@mui/joy";import{motion as Ia}from"framer-motion";var Aa=Ia(Pa),Fa=wa(Aa)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Fe=Fa;Fe.displayName="DialogActions";var j=Fe;var Ja=Fo(Oa,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Ya=Fo(W,{name:"DatePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),$a=Fo("div",{name:"DatePicker",slot:"container"})({width:"100%"}),Ht=e=>{let o=`${e.getDate()}`,t=`${e.getMonth()+1}`,n=e.getFullYear();return Number(o)<10&&(o="0"+o),Number(t)<10&&(t="0"+t),[n,t,o].join("/")},Ra=L.forwardRef(function(o,t){let{onChange:n,...l}=o;return L.createElement(Sa,{...l,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:Ao.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Ao.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ao.MaskedRange,from:1900,to:9999}},format:Ht,parse:a=>{let r=a.split("/");return new Date(Number(r[0]),Number(r[1])-1,Number(r[2]))},autofix:"pad",overwrite:!0})}),Ke=Ba((e,o)=>{let{onChange:t,disabled:n,label:l,error:a,helperText:r,minDate:i,maxDate:m,disableFuture:d,disablePast:g,required:c,...C}=e,s=La(null),[y,p]=Et(e.value||""),[u,v]=Et(null),P=!!u;Va(()=>{p(e.value||"")},[e.value]),Na(o,()=>s.current,[s.current]);let k=St(b=>{p(b.target.value),t?.(b)},[]),F=St(b=>{v(u?null:b.currentTarget),s.current?.focus()},[u,v,s]),h=L.createElement($a,null,L.createElement(Ha,{open:!0},L.createElement(L.Fragment,null,L.createElement($,{...C,ref:s,size:"sm",value:y,onChange:k,placeholder:"YYYY/MM/DD",disabled:n,required:c,slotProps:{input:{component:Ra,ref:s}},sx:{fontFamily:"monospace"},endDecorator:L.createElement(z,{variant:"plain",onClick:F},L.createElement(Ea,null))}),P&&L.createElement(za,{onClickAway:()=>v(null)},L.createElement(Ja,{id:"date-picker-popper",open:!0,anchorEl:u,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},L.createElement(Ya,{tabIndex:-1,role:"presentation"},L.createElement(ee,{value:Number.isNaN(new Date(y).getTime())?void 0:[new Date(y),void 0],onChange:([b])=>{k({target:{name:e.name,value:Ht(b)}}),v(null),s.current?.blur()},minDate:i?new Date(i):void 0,maxDate:m?new Date(m):void 0,disableFuture:d,disablePast:g}),L.createElement(j,{sx:{p:1}},L.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return l?L.createElement(B,{required:c,disabled:n,error:a,size:"sm"},L.createElement(V,null,l),h,r&&L.createElement(w,null,r)):h});var zt=Ke;import eo from"react";import{Textarea as qa}from"@mui/joy";import{motion as Wa}from"framer-motion";var Ua=Wa(qa),Be=e=>{let{label:o,error:t,helperText:n,color:l,size:a,disabled:r,required:i,...m}=e,d=eo.createElement(Ua,{required:i,disabled:r,color:l,size:a,...m});return o?eo.createElement(B,{required:i,disabled:r,color:l,size:a,error:t},eo.createElement(V,null,o),d,n&&eo.createElement(w,null,n)):d};Be.displayName="Textarea";var Ot=Be;import Ve,{useMemo as Ga}from"react";import{Select as _a,Option as ja}from"@mui/joy";import{motion as Za}from"framer-motion";var Xa=Za(ja),oo=Xa;oo.displayName="Option";function Ne(e){let{label:o,helperText:t,error:n,size:l,color:a,disabled:r,required:i,onChange:m,...d}=e,g=Ga(()=>e.options.map(s=>typeof s!="object"?{value:s,label:s}:s),[e.options]),C=Ve.createElement(_a,{...d,required:i,disabled:r,size:l,color:a,onChange:(s,y)=>{let p=s||{target:{}},u={...p,target:{name:p.target?.name||e.name,value:y||void 0}};m?.(u)}},g.map(s=>Ve.createElement(oo,{key:s.value,value:s.value},s.label)));return o?Ve.createElement(B,{required:i,disabled:r,size:l,color:a,error:n},Ve.createElement(V,null,o),C,t&&Ve.createElement(w,null,t)):C}Ne.displayName="Select";var Bo=Ne;var Jt=Ka("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),to=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function ni(e){let{paginationModel:{page:o,pageSize:t},rowCount:n,onPageChange:l}=e,a=1,r=Math.ceil(n/t),i=[o-2,o-1].filter(c=>c>1),m=[o+1,o+2].filter(c=>c<=r-1),d=r>1&&o<r-3,g=r>1&&o>4;return f.createElement(O,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center"},f.createElement(O,{direction:"row",spacing:.5,alignItems:"center"},f.createElement(z,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(o-1),disabled:o===a,"aria-label":"Previous page"},f.createElement(ti,null)),o!==a&&f.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(a)},a),g&&f.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(o-3)},"..."),i.map(c=>f.createElement(I,{key:c,size:"sm",variant:"plain",color:"neutral",onClick:()=>l(c)},c)),f.createElement(I,{variant:"soft",size:"sm"},o),m.map(c=>f.createElement(I,{key:c,size:"sm",variant:"plain",color:"neutral",onClick:()=>l(c)},c)),d&&f.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(o+3)},"..."),o!==r&&f.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(r)},r),f.createElement(z,{size:"sm",variant:"plain",color:"neutral",onClick:()=>l(o+1),disabled:o===r,"aria-label":"Next page"},f.createElement(ri,null))))}var ai=e=>f.createElement(Ge,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:o=>{let t=o.clientX,n=e.current?.getBoundingClientRect().width,l=r=>{n&&t&&(e.current.style.width=`${n+(r.clientX-t)}px`)},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}),ii=e=>{let o=Qa(null),t={width:e.width,minWidth:e.minWidth??"50px",maxWidth:e.maxWidth,textAlign:e.type==="number"?"end":"start",position:e.stickyHeader?void 0:"relative"},n=e.resizable??!0?ai(o):null;return f.createElement("th",{ref:o,key:e.field,style:t},e.headerName??e.field,n)},li=e=>{let{field:o,type:t,renderCell:n,isCellEditable:l,row:a,rowId:r}=e,[i,m]=Vo(a[o]),d=U(()=>({row:a,value:i,id:r}),[a,o,r,i]),g=U(()=>!!((typeof l=="function"&&l(d)||typeof l=="boolean"&&l)&&e.editMode),[e.editMode,l,a]),c=U(()=>({...typeof e.componentProps=="function"?e.componentProps(d):e.componentProps||{},size:"sm"}),[i,e.componentProps,d]),C=U(()=>({...c,onChange:p=>{c.onChange?.(p),m(p.target.value),t&&["select","multiSelect"].includes(t)&&e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:p.target.value},value:p.target.value})},onFocus:p=>{c.onFocus?.(p),e.onCellEditStart?.({...d,originalRow:a,row:{...d.row,value:i},value:i})},onBlur:p=>{c.onBlur?.(p),t&&["number","text","longText","currency","date"].includes(t)&&e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:i},value:i})},...t==="autocomplete"&&{onChangeComplete:p=>{c.onChangeComplete?.(p),m(p.target.value),e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:p.target.value},value:p.target.value})}}}),[i,c]),s=U(()=>({date:f.createElement(zt,{...C,value:i}),currency:f.createElement(Lt,{...C,value:i}),number:f.createElement($,{...C,value:i,type:"number"}),text:f.createElement($,{...C,value:i,type:"text"}),longText:f.createElement(Ot,{...C,value:i}),autocomplete:f.createElement(ut,{...C,value:i,options:C.options||[i]}),select:f.createElement(Bo,{...C,value:i,options:C.options||[i]}),multiSelect:f.createElement(Bo,{...C,value:Array.isArray(i)?i:[i],options:C.options||[i],multiple:!0})})[t||"text"],[i,c]),y=U(()=>{if(n)return n(d);let p=i;return{chip:f.createElement(Ft,{color:"primary",children:p,...c}),link:f.createElement(e.component||oi,{children:p,...c})}[t||"text"]||p},[i,n,a]);return ro(()=>{m(a[o])},[a]),f.createElement("td",{key:o,style:{textAlign:t&&["number","date","currency"].includes(t)?"end":"start"}},g&&s?s:y)},si=e=>{let{columns:o,rowId:t,editMode:n}=e,[l,a]=Vo(e.row),r=te(({row:i})=>{a(i)},[]);return f.createElement(f.Fragment,null,o.map(i=>f.createElement(li,{...i,row:l,rowId:t,editMode:n,onCellEditStop:m=>{i.onCellEditStop?.(m),r(m)}})))};function pi({rows:e,columns:o,rowCount:t,pagination:n,paginationMode:l,paginationModel:a,onPaginationModelChange:r,selectionModel:i=[],onSelectionModelChange:m,getId:d,isTotalSelected:g}){let[c,C]=Vo(a?.page||1),s=a?.pageSize||20,y=te((h,b)=>d?.(h)??h?.id??`${(b||0)+(c-1)*s}`,[d??c,s]),p=U(()=>new Set(i),[i]),u=U(()=>!n||l==="server"?e:e.slice((c-1)*s,(c-1)*s+s),[e,c,s,l,n]),v=U(()=>u.length>0&&u.every((h,b)=>p.has(y(h,b))),[u,p,c,s,y]),P=t||e.length,k=U(()=>g??(P>0&&i.length===P),[g,i,P]),F=te(h=>{C(h),r?.({page:h,pageSize:s})},[r]);return ro(()=>{F(1)},[P]),ro(()=>{let h=Math.max(1,Math.ceil(P/s));c>h&&F(h)},[c,P,s]),ro(()=>{m?.([])},[c]),{rowCount:P,page:c,pageSize:s,onPaginationModelChange:F,getId:y,HeadCell:ii,BodyRow:si,dataInPage:u,isAllSelected:v,isTotalSelected:k,isSelectedRow:te(h=>p.has(h),[p]),onAllCheckboxChange:te(()=>{m?.(v?[]:u.map(y))},[v,u,m]),onCheckboxChange:te((h,b)=>{if(p.has(b)){let M=i.filter(D=>D!==b);m?.(M)}else{let M=[...i,b];m?.(M)}},[i,m]),columns:U(()=>o||Object.keys(e[0]||{}).map(h=>({field:h})),[e,o]),onTotalSelect:te(()=>{m?.(k?[]:e.map(y),!k)},[k,e,m])}}function No(e){let{rows:o,checkboxSelection:t,editMode:n,selectionModel:l,onSelectionModelChange:a,rowCount:r,columns:i,onPaginationModelChange:m,pagination:d,paginationMode:g,paginationModel:c,loading:C,slots:{checkbox:s=Me,toolbar:y,footer:p,loadingOverlay:u=()=>f.createElement(ei,{value:8,variant:"plain"})}={},slotProps:{checkbox:v={},toolbar:P,background:k={}}={},...F}=e,{columns:h,isAllSelected:b,isSelectedRow:M,onAllCheckboxChange:D,onCheckboxChange:T,getId:J,rowCount:K,page:pt,pageSize:uo,onPaginationModelChange:pr,dataInPage:mr,isTotalSelected:mt,onTotalSelect:dt,HeadCell:dr,BodyRow:cr}=pi(e),ur=U(()=>({page:pt,pageSize:uo}),[pt,uo]);return f.createElement(Ge,null,f.createElement(O,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center"},!!t&&f.createElement(O,{direction:"row",spacing:1},!b&&f.createElement(Y,{level:"body-xs"},to(l?.length||0)," items selected"),b&&!mt&&f.createElement(O,{direction:"row",spacing:1,alignItems:"center"},f.createElement(Y,{level:"body-xs"},"All ",to(l?.length||0)," items on this page are selected."),f.createElement(I,{size:"sm",variant:"plain",onClick:dt},"Select all ",to(K??o.length)," items")),mt&&f.createElement(O,{direction:"row",spacing:1,alignItems:"center"},f.createElement(Y,{level:"body-xs"},"All ",to(K??o.length)," items are selected."),f.createElement(I,{size:"sm",variant:"plain",color:"danger",onClick:dt},"Cancel"))),y&&f.createElement(y,{...P||{}})),f.createElement(W,{variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},...k},f.createElement(Ae,{...F},f.createElement("thead",null,f.createElement("tr",null,t&&f.createElement("th",{style:{width:"40px",textAlign:"center"}},f.createElement(s,{onChange:D,checked:b,indeterminate:(l||[]).length>0&&!b,...v})),h.map(ae=>f.createElement(dr,{key:ae.field,stickyHeader:e.stickyHeader,...ae})))),f.createElement("tbody",null,f.createElement(Jt,null,!!C&&f.createElement("td",null,f.createElement(Ge,{sx:{position:"absolute",top:0,left:0,right:0}},f.createElement(u,null)))),f.createElement(Jt,null),mr.map((ae,gr)=>{let re=J(ae,gr);return f.createElement("tr",{key:re,role:t?"checkbox":void 0,tabIndex:t?-1:void 0,onClick:t?go=>T(go,re):void 0,"aria-checked":t?M(re):void 0},t&&f.createElement("th",{scope:"row",style:{textAlign:"center"}},f.createElement(s,{onChange:go=>T(go,re),checked:M(re),...v})),f.createElement(cr,{columns:h,row:ae,rowId:re,editMode:n}))})),p&&f.createElement(p,null))),uo<K&&d&&f.createElement(ni,{paginationModel:ur,rowCount:K,onPageChange:pr}))}No.displayName="DataTable";import S,{forwardRef as mi,useCallback as Lo,useEffect as di,useImperativeHandle as ci,useMemo as ui,useRef as gi,useState as Yt}from"react";import{IMaskInput as fi,IMask as So}from"react-imask";import hi from"@mui/icons-material/esm/CalendarToday.js";import{styled as Eo}from"@mui/joy";import{FocusTrap as Ci,ClickAwayListener as yi,Popper as bi}from"@mui/base";var xi=Eo(bi,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),vi=Eo(W,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Di=Eo("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),$t=([e,o])=>{let t=n=>{let l=`${n.getDate()}`,a=`${n.getMonth()+1}`,r=n.getFullYear();return Number(l)<10&&(l="0"+l),Number(a)<10&&(a="0"+a),[r,a,l].join("/")};return[t(e),o?t(o):""].join(" - ")},Rt=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"",n=o.split("/"),l=t.split("/");return[new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),new Date(Number(l[0]),Number(l[1])-1,Number(l[2]))]},ki=S.forwardRef(function(o,t){let{onChange:n,...l}=o;return S.createElement(fi,{...l,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:So.MaskedRange,from:1,to:31,maxLength:2},m:{mask:So.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:So.MaskedRange,from:1900,to:9999}},format:$t,parse:Rt,autofix:"pad",overwrite:!0})}),Ho=mi((e,o)=>{let{onChange:t,disabled:n,label:l,error:a,helperText:r,minDate:i,maxDate:m,disableFuture:d,disablePast:g,required:c,...C}=e,s=gi(null),[y,p]=Yt(e.value||""),[u,v]=Yt(null),P=!!u,k=ui(()=>y?Rt(y):void 0,[y]);di(()=>{p(e.value||"")},[e.value]),ci(o,()=>s.current,[s.current]);let F=Lo(D=>{p(D.target.value),t?.(D)},[t]),h=Lo(D=>{v(u?null:D.currentTarget),s.current?.focus()},[u,v,s]),b=Lo(([D,T])=>{!D||!T||(s.current?.blur(),p($t([D,T])),v(null))},[p,v,s]),M=S.createElement(Di,null,S.createElement(Ci,{open:!0},S.createElement(S.Fragment,null,S.createElement($,{...C,ref:o,size:"sm",value:y,onChange:F,disabled:n,required:c,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:ki,ref:s}},sx:{fontFamily:"monospace"},endDecorator:S.createElement(z,{variant:"plain",onClick:h},S.createElement(hi,null))}),P&&S.createElement(yi,{onClickAway:()=>v(null)},S.createElement(xi,{id:"date-range-picker-popper",open:!0,anchorEl:u,placement:"bottom-end",onMouseDown:D=>D.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},S.createElement(vi,{tabIndex:-1,role:"presentation"},S.createElement(ee,{rangeSelection:!0,defaultValue:k,onChange:b,minDate:i?new Date(i):void 0,maxDate:m?new Date(m):void 0,disableFuture:d,disablePast:g}),S.createElement(j,{sx:{p:1}},S.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return l?S.createElement(B,{required:c,disabled:n,error:a,size:"sm"},S.createElement(V,null,l),M,r&&S.createElement(w,null,r)):M});Ho.displayName="DateRangePicker";import{DialogContent as Mi,styled as Ti}from"@mui/joy";import{motion as Pi}from"framer-motion";var wi=Pi(Mi),Ii=Ti(wi)(({theme:e})=>({padding:e.spacing(0,6,5)})),Le=Ii;Le.displayName="DialogContent";var no=Le;import{DialogTitle as Ai,styled as Fi}from"@mui/joy";import{motion as Bi}from"framer-motion";var Vi=Bi(Ai),Ni=Fi(Vi)(({theme:e})=>({padding:e.spacing(4,6)})),Se=Ni;Se.displayName="DialogTitle";var ao=Se;import He from"react";import io from"react";import{Modal as Li,ModalDialog as Si,ModalClose as Ei,ModalOverflow as Hi,styled as qt}from"@mui/joy";import{motion as lo}from"framer-motion";var zi=lo(Li),zo=zi;zo.displayName="Modal";var Oi=lo(Si),Wt=qt(Oi)({padding:0}),Ee=Wt;Ee.displayName="ModalDialog";var Ji=qt(lo(Ei))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),so=Ji;so.displayName="ModalClose";var Yi=lo(Hi),Oo=Yi;Oo.displayName="ModalOverflow";function Jo(e){let{title:o,children:t,...n}=e;return io.createElement(Wt,{...n},io.createElement(so,null),io.createElement(ao,null,o),io.createElement(no,null,t))}Jo.displayName="ModalFrame";import{styled as $i}from"@mui/joy";var Ri=$i(Ee)(({theme:e})=>({padding:0})),Yo=He.forwardRef((e,o)=>{let{title:t,children:n,actions:l,...a}=e;return He.createElement(Ri,{ref:o,...a},He.createElement(ao,null,t),He.createElement(no,null,n),He.createElement(j,null,l))});Yo.displayName="DialogFrame";import qi from"react";import{Divider as Wi}from"@mui/joy";import{motion as Ui}from"framer-motion";var Gi=Ui(Wi),ze=e=>qi.createElement(Gi,{...e});ze.displayName="Divider";import _i from"react";import{Drawer as ji}from"@mui/joy";import{motion as Zi}from"framer-motion";var Xi=Zi(ji),$o=e=>{let{children:o,...t}=e;return _i.createElement(Xi,{...t,slotProps:{...t.slotProps,content:{...t.slotProps?.content,sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}}}},o)};$o.displayName="InsetDrawer";import A,{useCallback as po,useEffect as Qi,useMemo as Ut,useRef as Gt,useState as Ro}from"react";import{styled as oe}from"@mui/joy";import Ki from"@mui/icons-material/esm/InfoOutlined.js";import el from"@mui/icons-material/esm/CloudUploadRounded.js";import ol from"@mui/icons-material/esm/UploadFileRounded.js";import tl from"@mui/icons-material/esm/ClearRounded.js";import{combine as rl}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js";import{dropTargetForExternal as nl,monitorForExternal as al}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/adapter.js";import{containsFiles as _t,getFiles as il}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/file.js";import{preventUnhandled as jt}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js";var ll=oe("input")({width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",position:"absolute"}),sl=oe(O,{name:"Uploader",slot:"PreviewRoot"})({}),pl=oe(De,{name:"Uploader",slot:"UploadCard"})(({theme:e})=>({padding:e.spacing(2.5),border:`1px solid ${e.palette.neutral.outlinedBorder}`})),ml=oe(ol,{name:"Uploader",slot:"UploadFileIcon"})(({theme:e})=>({color:e.palette.neutral[400],width:"32px",height:"32px"})),dl=oe(tl,{name:"Uploader",slot:"ClearIcon"})(({theme:e})=>({color:e.palette.neutral.plainColor,width:"18px",height:"18px"})),cl=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"],Zt=e=>{let o=e==0?0:Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,o),n=cl[o];return Intl.NumberFormat("en-us",{style:"unit",unit:n,unitDisplay:"narrow"}).format(t)},ul=e=>{let{files:o,onDelete:t}=e;return A.createElement(sl,{gap:1},o.map(n=>A.createElement(pl,{key:n.name,size:"sm",color:"neutral"},A.createElement(O,{direction:"row",alignItems:"center",gap:2},A.createElement(ml,null),A.createElement(O,{flex:"1"},A.createElement(Y,{level:"body-sm",textColor:"common.black"},n.name),A.createElement(Y,{level:"body-xs",fontWeight:"300",lineHeight:"1.33",textColor:"text.tertiary"},Zt(n.size))),A.createElement(z,{onClick:()=>t?.(n)},A.createElement(dl,null))))))},gl=oe(O,{name:"Uploader",slot:"root"})(({theme:e})=>({gap:e.spacing(2)})),fl=oe(W,{name:"Uploader",slot:"dropZone"})(({theme:e,state:o,error:t})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:e.spacing(5),gap:e.spacing(4),cursor:"pointer",backgroundColor:e.palette.background.surface,border:t?`1px solid ${e.palette.danger.outlinedBorder}`:o==="idle"?`1px solid ${e.palette.neutral.outlinedBorder}`:`1px solid ${e.palette.primary.outlinedBorder}`})),hl=oe(el,{name:"Uploader",slot:"iconContainer"})(({theme:e,state:o,error:t})=>({color:t?`rgba(${e.vars.palette.danger.mainChannel} / 0.6)`:o==="over"?`rgba(${e.palette.primary.mainChannel} / 0.6)`:e.palette.neutral.softActiveBg,width:"32px",height:"32px"})),qo=A.memo(e=>{let{accept:o,maxCount:t,name:n,size:l,maxSize:a,onChange:r,label:i,helperText:m}=e,d=Gt(null),g=Gt(null),[c,C]=Ro(),[s,y]=Ro([]),[p,u]=Ro("idle"),v=Ut(()=>!!c||e.error,[e.error,c]),P=Ut(()=>!t||t&&s.length!==t,[s,t]),k=po(D=>{try{a&&D.forEach(J=>{if(J.size>a)throw new Error(`File size exceeds the limit: ${Zt(a)}`)});let T=[...s,...D];if(t&&T.length>t)throw new Error(`File count exceeds the limit: ${t}`);r?.({target:{name:n,value:T}}),y(T)}catch(T){C(T.message)}},[s]);Qi(()=>{let D=d.current;if(D)return rl(nl({element:D,canDrop:_t,onDragEnter:()=>u("over"),onDragLeave:()=>u("potential"),onDrop:async({source:T})=>{let J=await il({source:T});k(J)}}),al({canMonitor:_t,onDragStart:()=>{u("potential"),jt.start()},onDrop:()=>{u("idle"),jt.stop()}}))});let F=po(D=>{let T=Array.from(D.target.files||[]);k(T)},[k]),h=po(D=>{y(T=>(r?.({target:{name:n,value:T.filter(J=>J!==D)}}),T.filter(J=>J!==D)))},[]),b=po(()=>{g.current?.click()},[]),M=A.createElement(fl,{state:p,error:v,ref:d,onClick:b},A.createElement(O,{alignItems:"center",gap:1},A.createElement(hl,{state:p,error:v})),A.createElement(ll,{type:"file",onChange:F,multiple:!0,accept:o,ref:g}));return A.createElement(gl,null,P&&(i?A.createElement(B,{size:l,error:!!v},A.createElement(V,null,i),M,c?A.createElement(w,null,A.createElement(Ki,null),c):m&&A.createElement(w,null,m)):M),s.length>0&&A.createElement(ul,{files:s,onDelete:h}))});qo.displayName="Uploader";import{Grid as Cl}from"@mui/joy";import{motion as yl}from"framer-motion";var bl=yl(Cl),Wo=bl;Wo.displayName="Grid";import Q from"react";import xl from"react-markdown";import{Link as vl}from"@mui/joy";var Uo=e=>{let{children:o,color:t,textColor:n,defaultLevel:l="body-md",markdownOptions:a,...r}=e;return Q.createElement(R,{color:t,textColor:n,...r},Q.createElement(xl,{...a,children:o,components:{h1:({children:i})=>Q.createElement(R,{color:t,textColor:n,level:"h1"},i),h2:({children:i})=>Q.createElement(R,{color:t,textColor:n,level:"h2"},i),h3:({children:i})=>Q.createElement(R,{color:t,textColor:n,level:"h3"},i),h4:({children:i})=>Q.createElement(R,{color:t,textColor:n,level:"h4"},i),p:({children:i})=>Q.createElement(R,{color:t,textColor:n,level:l},i),a:({children:i,href:m})=>Q.createElement(vl,{href:m},i),hr:()=>Q.createElement(ze,null),...a?.components}}))};Uo.displayName="Markdown";import E,{forwardRef as Dl,useCallback as Xt,useEffect as kl,useImperativeHandle as Ml,useRef as Tl,useState as Qt}from"react";import{IMaskInput as Pl,IMask as Kt}from"react-imask";import wl from"@mui/icons-material/esm/CalendarToday.js";import{styled as _o}from"@mui/joy";import{FocusTrap as Il,ClickAwayListener as Al,Popper as Fl}from"@mui/base";var Bl=_o(Fl,{name:"MonthPicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Vl=_o(W,{name:"MonthPicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Nl=_o("div",{name:"MonthPicker",slot:"container"})({width:"100%"}),er=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Go=e=>(t=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(t))return t;let n=t.split("/"),l=new Date(Number(n[0]),Number(n[1])-1);return er(l)})(e),or=e=>e.split(" - ")[0]||"",Ll=E.forwardRef(function(o,t){let{onChange:n,...l}=o;return E.createElement(Pl,{...l,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m",blocks:{m:{mask:Kt.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Kt.MaskedRange,from:1900,to:9999}},format:Go,parse:or})}),tr=Dl((e,o)=>{let{onChange:t,disabled:n,label:l,error:a,helperText:r,minDate:i,maxDate:m,disableFuture:d,disablePast:g,required:c,...C}=e,s=Tl(null),[y,p]=Qt(e.value||""),[u,v]=Qt(null),P=!!u;kl(()=>{p(e.value?Go(or(e.value)):"")},[e.value]),Ml(o,()=>s.current,[s.current]);let k=Xt(b=>{p(b.target.value),t?.(b)},[]),F=Xt(b=>{v(u?null:b.currentTarget),s.current?.focus()},[u,v,s]),h=E.createElement(Nl,null,E.createElement(Il,{open:!0},E.createElement(E.Fragment,null,E.createElement($,{...C,ref:s,size:"sm",value:y,onChange:k,placeholder:"YYYY/MM",disabled:n,required:c,slotProps:{input:{component:Ll,ref:s}},sx:{fontFamily:"monospace"},endDecorator:E.createElement(z,{variant:"plain",onClick:F},E.createElement(wl,null))}),P&&E.createElement(Al,{onClickAway:()=>v(null)},E.createElement(Bl,{id:"date-picker-popper",open:!0,anchorEl:u,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},E.createElement(Vl,{tabIndex:-1,role:"presentation"},E.createElement(ee,{view:"month",views:["month"],value:Number.isNaN(new Date(y).getTime())?void 0:[new Date(y),void 0],onChange:([b])=>{k({target:{name:e.name,value:Go(er(b))}}),v(null),s.current?.blur()},minDate:i?new Date(i):void 0,maxDate:m?new Date(m):void 0,disableFuture:d,disablePast:g}),E.createElement(j,{sx:{p:1}},E.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return l?E.createElement(B,{required:c,disabled:n,error:a,size:"sm"},E.createElement(V,null,l),h,r&&E.createElement(w,null,r)):h});import H,{forwardRef as Sl,useCallback as jo,useEffect as El,useImperativeHandle as Hl,useMemo as zl,useRef as Ol,useState as rr}from"react";import{IMaskInput as Jl,IMask as nr}from"react-imask";import Yl from"@mui/icons-material/esm/CalendarToday.js";import{styled as Ko}from"@mui/joy";import{FocusTrap as $l,ClickAwayListener as Rl,Popper as ql}from"@mui/base";var Wl=Ko(ql,{name:"MonthRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Ul=Ko(W,{name:"MonthRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Gl=Ko("div",{name:"MonthRangePicker",slot:"container"})({width:"100%"}),Zo=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Xo=([e,o])=>{let t=n=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(n))return n;let l=n.split("/"),a=new Date(Number(l[0]),Number(l[1])-1);return Zo(a)};return[t(e),t(o)].join(" - ")},Qo=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"";return[o,t]},_l=H.forwardRef(function(o,t){let{onChange:n,...l}=o;return H.createElement(Jl,{...l,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m - Y/m",blocks:{m:{mask:nr.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:nr.MaskedRange,from:1900,to:9999}},format:Xo,parse:Qo})}),et=Sl((e,o)=>{let{onChange:t,disabled:n,label:l,error:a,helperText:r,minDate:i,maxDate:m,disableFuture:d,disablePast:g,required:c,...C}=e,s=Ol(null),[y,p]=rr(""),[u,v]=rr(null),P=!!u,k=zl(()=>y?Qo(y).map(D=>new Date(D)):void 0,[y]);El(()=>{p(e.value?Xo(Qo(e.value)):"")},[e.value]),Hl(o,()=>s.current,[s.current]);let F=jo(D=>{p(D.target.value),t?.(D)},[t]),h=jo(D=>{v(u?null:D.currentTarget),s.current?.focus()},[u,v,s]),b=jo(([D,T])=>{!D||!T||(p(Xo([Zo(D),Zo(T)])),v(null),s.current?.blur())},[p,v,s]),M=H.createElement(Gl,null,H.createElement($l,{open:!0},H.createElement(H.Fragment,null,H.createElement($,{...C,ref:o,size:"sm",value:y,onChange:F,disabled:n,required:c,placeholder:"YYYY/MM - YYYY/MM",slotProps:{input:{component:_l,ref:s}},sx:{fontFamily:"monospace"},endDecorator:H.createElement(z,{variant:"plain",onClick:h},H.createElement(Yl,null))}),P&&H.createElement(Rl,{onClickAway:()=>v(null)},H.createElement(Wl,{id:"date-range-picker-popper",open:!0,anchorEl:u,placement:"bottom-end",onMouseDown:D=>D.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},H.createElement(Ul,{tabIndex:-1,role:"presentation"},H.createElement(ee,{view:"month",views:["month"],rangeSelection:!0,defaultValue:k,onChange:b,minDate:i?new Date(i):void 0,maxDate:m?new Date(m):void 0,disableFuture:d,disablePast:g}),H.createElement(j,{sx:{p:1}},H.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return l?H.createElement(B,{required:c,disabled:n,error:a,size:"sm"},H.createElement(V,null,l),M,r&&H.createElement(w,null,r)):M});et.displayName="MonthRangePicker";import{Radio as jl,RadioGroup as Zl}from"@mui/joy";import{motion as ar}from"framer-motion";var Xl=ar(jl),Oe=Xl;Oe.displayName="Radio";var Ql=ar(Zl),Je=Ql;Je.displayName="RadioGroup";import ir from"react";function ot(e){let{items:o,...t}=e;return ir.createElement(Je,{...t},o.map(n=>ir.createElement(Oe,{key:`${n.value}`,value:n.value,label:n.label})))}ot.displayName="RadioList";import lr from"react";import{Switch as Kl,styled as es,switchClasses as os}from"@mui/joy";import{motion as sr}from"framer-motion";var ts=sr(Kl),rs=es(sr.div)({"--Icon-fontSize":"calc(var(--Switch-thumbSize) * 0.75)",display:"inline-flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"var(--Switch-thumbOffset)",width:"var(--Switch-thumbWidth)",height:"var(--Switch-thumbSize)",borderRadius:"var(--Switch-thumbRadius)",boxShadow:"var(--Switch-thumbShadow)",color:"var(--Switch-thumbColor)",backgroundColor:"var(--Switch-thumbBackground)",[`&.${os.checked}`]:{left:"unset",right:"var(--Switch-thumbOffset)"}}),ns=e=>lr.createElement(rs,{...e,layout:!0,transition:as}),as={type:"spring",stiffness:700,damping:30},tt=e=>lr.createElement(ts,{...e,slots:{thumb:ns,...e.slots}});tt.displayName="Switch";import{Tabs as is,Tab as ls,TabList as ss,TabPanel as ps,styled as ms,tabClasses as ds}from"@mui/joy";import{motion as mo}from"framer-motion";var cs=mo(is),rt=cs;rt.displayName="Tabs";var us=ms(mo(ls))(({theme:e})=>({[`&:not(.${ds.selected})`]:{color:e.palette.neutral[700]}})),nt=us;nt.displayName="Tab";var gs=mo(ss),at=gs;at.displayName="TabList";var fs=mo(ps),it=fs;it.displayName="TabPanel";import co from"react";import{CssBaseline as hs,CssVarsProvider as Cs,checkboxClasses as ys,extendTheme as bs}from"@mui/joy";var xs=bs({cssVarPrefix:"ceed",spacing:4,zIndex:{popup:1500},components:{JoyTable:{defaultProps:{size:"sm",borderAxis:"bothBetween"},styleOverrides:{root:({theme:e})=>({"--TableRow-stripeBackground":e.palette.background.level1,"--TableCell-selectedBackground":e.palette.background.level2,"--TableRow-hoverBackground":e.palette.background.level3,"& tbody tr[aria-checked=false] th":{"--TableCell-headBackground":"transparent"},"& tbody tr[aria-checked=true]:hover th":{"--TableCell-headBackground":"var(--TableRow-hoverBackground)"},"& tbody tr[aria-checked=true]:not(:hover) th":{"--TableCell-headBackground":"var(--TableCell-selectedBackground)"},"& tbody tr[aria-checked=true]:not(:hover) td":{"--TableCell-dataBackground":"var(--TableCell-selectedBackground)"},[`& .${ys.root}`]:{verticalAlign:"middle"}})}},JoyTooltip:{defaultProps:{size:"sm",placement:"top"}}}});function lt(e){return co.createElement(co.Fragment,null,co.createElement(Cs,{theme:xs},co.createElement(hs,null),e.children))}lt.displayName="ThemeProvider";import vs from"react";import{Tooltip as Ds}from"@mui/joy";import{motion as ks}from"framer-motion";var Ms=ks(Ds),st=e=>vs.createElement(Ms,{...e});st.displayName="Tooltip";export{qe as Accordion,Re as AccordionDetails,$e as AccordionSummary,fo as Accordions,ho as Alert,HC as AspectRatio,Ue as Autocomplete,IC as AutocompleteListbox,AC as AutocompleteOption,NC as Avatar,SC as AvatarGroup,OC as Badge,ce as Box,bo as Breadcrumbs,Ce as Button,xe as Calendar,De as Card,Mo as CardActions,Do as CardContent,ko as CardCover,To as CardOverflow,ke as Checkbox,Te as Chip,_C as CircularProgress,Po as Container,Qe as CurrencyInput,No as DataTable,Ke as DatePicker,Ho as DateRangePicker,Fe as DialogActions,Le as DialogContent,Yo as DialogFrame,Se as DialogTitle,ze as Divider,ZC as Drawer,he as Dropdown,se as FormControl,me as FormHelperText,pe as FormLabel,Wo as Grid,ye as IconButton,we as Input,$o as InsetDrawer,QC as LinearProgress,gy as Link,ey as List,ty as ListDivider,ny as ListItem,iy as ListItemButton,sy as ListItemContent,my as ListItemDecorator,cy as ListSubheader,Uo as Markdown,ue as Menu,ge as MenuButton,fe as MenuItem,zo as Modal,so as ModalClose,Ee as ModalDialog,Jo as ModalFrame,Oo as ModalOverflow,tr as MonthPicker,et as MonthRangePicker,oo as Option,Oe as Radio,Je as RadioGroup,ot as RadioList,Ne as Select,Ie as Sheet,Ty as Skeleton,hy as Slider,le as Stack,yy as Step,xy as StepButton,Dy as StepIndicator,ky as Stepper,tt as Switch,nt as Tab,at as TabList,it as TabPanel,Ae as Table,Io as TableBody,wo as TableHead,rt as Tabs,Be as Textarea,lt as ThemeProvider,st as Tooltip,R as Typography,qo as Uploader,MC as accordionClasses,TC as accordionDetailsClasses,wC as accordionSummaryClasses,PC as accordionsClasses,Rh as alertClasses,zC as aspectRatioClasses,FC as autocompleteClasses,BC as autocompleteListboxClasses,VC as autocompleteOptionClasses,LC as avatarClasses,EC as avatarGroupClasses,JC as badgeClasses,qh as boxClasses,YC as breadcrumbsClasses,Wh as buttonClasses,RC as cardActionsClasses,$C as cardClasses,qC as cardContentClasses,WC as cardCoverClasses,UC as cardOverflowClasses,Uh as checkboxClasses,GC as chipClasses,jC as circularProgressClasses,bC as dialogActionsClasses,yC as dialogContentClasses,CC as dialogTitleClasses,Gh as dividerClasses,XC as drawerClasses,lC as formControlClasses,pC as formHelperTextClasses,sC as formLabelClasses,mC as gridClasses,_h as iconButtonClasses,jh as inputClasses,KC as linearProgressClasses,fy as linkClasses,oy as listClasses,ry as listDividerClasses,ly as listItemButtonClasses,ay as listItemClasses,py as listItemContentClasses,dy as listItemDecoratorClasses,uy as listSubheaderClasses,Xh as menuButtonClasses,Zh as menuClasses,Qh as menuItemClasses,uC as modalClasses,gC as modalCloseClasses,fC as modalDialogClasses,hC as modalOverflowClasses,Kh as optionClasses,eC as radioClasses,oC as radioGroupClasses,tC as selectClasses,cC as sheetClasses,Py as skeletonClasses,Cy as sliderClasses,dC as stackClasses,vy as stepButtonClasses,by as stepClasses,My as stepperClasses,rC as switchClasses,DC as tabListClasses,kC as tabPanelClasses,nC as tableClasses,vC as tabsClasses,aC as textareaClasses,xC as tooltipClasses,iC as typographyClasses,Yh as useColorScheme,Jh as useTheme,$h as useThemeProps};