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