@simoncomputing/mui-bueno-v2 0.32.4 → 0.32.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/Tooltips/HelpTooltip/HelpTooltip.d.ts +1 -1
- package/dist/components/Tooltips/IconTooltip/IconTooltip.d.ts +5 -9
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +167 -157
- package/dist/index.umd.js +62 -62
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require('./index.css');var l5=Object.defineProperty;var c5=(t,e,n)=>e in t?l5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var mc=(t,e,n)=>c5(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("@mui/material"),g=require("react/jsx-runtime"),J=require("react"),Ht=require("formik"),ko=require("react-router-dom"),u5=require("@emotion/styled"),ri=require("@emotion/react"),ta=require("react-dom");function PO(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const D=PO(J),d5=PO(ta),f5="0px",p5="600px",h5="960px",m5="1100px",g5="1536px",y5="#4c98d7",b5="#005ea2",v5="#1a4480",x5="#9bb672",w5="#607f35",C5="#3c4a29",S5="rgba(0, 0, 0, 0.8705882353)",T5="rgba(0, 0, 0, 0.6)",k5="rgba(0, 0, 0, 0.3803921569)",E5="#dc5b52",O5="#d83933",M5="#b50909",_5="#ffbe2e",R5="#e5a000",I5="#c2850c",D5="#4c98d7",A5="#005ea2",P5="#1a4480",N5="#9bb672",$5="#607f35",j5="#3c4a29",L5="#f9f9f9",B5="#fff",F5="#252f3e",V5="#c9c9c9",z5="#98cbfb",H5="#4c98d7",W5="#005ea2",U5="#b8d293",q5="#9bb672",K5="#607f35",Y5="#fff",G5="rgba(255, 255, 255, 0.7019607843)",J5="rgba(255, 255, 255, 0.5019607843)",X5="#f1928b",Z5="#dc5b52",Q5="#d83933",e3="#ffe396",t3="#ffbe2e",n3="#e5a000",r3="#98cbfb",o3="#4c98d7",i3="#005ea2",s3="#b8d293",a3="#9bb672",l3="#607f35",c3="#121212",u3="#1b1b1b",d3="#2f3b4e",f3="#2e2e2e",p3="#f0f0f0",h3="#e6e6e6",m3="#c9c9c9",g3="#adadad",y3="#919191",b3="#757575",v3="#5c5c5c",x3="#454545",w3="#2e2e2e",C3="#1b1b1b",S3="#e6e6e6",T3="#c9c9c9",k3="#919191",E3="#454545",O3="#fff",M3="#000",_3="2px 2px 5px 0px rgba(0, 0, 0, 0.05)",R3="2px 2px 7px 0px rgba(0, 0, 0, 0.075)",I3="2px 3px 7px 0px rgba(0, 0, 0, 0.075), 0px 1px 10px 0px rgba(0, 0, 0, 0.05)",D3="2px 4px 8px 0px rgba(0, 0, 0, 0.075), 0px 1px 12px 0px rgba(0, 0, 0, 0.075)",A3="2px 5px 8px 0px rgba(0, 0, 0, 0.075), 0px 2px 14px 0px rgba(0, 0, 0, 0.1)",P3="2px 6px 10px 0px rgba(0, 0, 0, 0.1), 0px 2px 18px 0px rgba(0, 0, 0, 0.1)",N3="2px 7px 10px 1px rgba(0, 0, 0, 0.1), 0px 2px 16px 1px rgba(0, 0, 0, 0.12)",$3="2px 8px 10px 1px rgba(0, 0, 0, 0.1), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)",j3="2px 9px 12px 1px rgba(0, 0, 0, 0.1), 0px 3px 16px 2px rgba(0, 0, 0, 0.12)",L3="2px 10px 14px 1px rgba(0, 0, 0, 0.12), 0px 4px 18px 3px rgba(0, 0, 0, 0.12)",B3="2px 11px 15px 1px rgba(0, 0, 0, 0.12), 0px 4px 20px 3px rgba(0, 0, 0, 0.12)",F3="2px 12px 17px 2px rgba(0, 0, 0, 0.12), 0px 5px 22px 4px rgba(0, 0, 0, 0.12)",V3="2px 13px 19px 2px rgba(0, 0, 0, 0.12), 0px 5px 24px 4px rgba(0, 0, 0, 0.12)",z3="2px 14px 21px 2px rgba(0, 0, 0, 0.12), 0px 5px 26px 4px rgba(0, 0, 0, 0.12)",H3="2px 15px 22px 2px rgba(0, 0, 0, 0.12), 0px 6px 28px 5px rgba(0, 0, 0, 0.12)",W3="2px 16px 24px 2px rgba(0, 0, 0, 0.12), 0px 6px 30px 5px rgba(0, 0, 0, 0.12)",U3="2px 17px 26px 2px rgba(0, 0, 0, 0.14), 0px 6px 32px 5px rgba(0, 0, 0, 0.12)",q3="2px 18px 28px 2px rgba(0, 0, 0, 0.14), 0px 7px 34px 6px rgba(0, 0, 0, 0.12)",K3="2px 19px 29px 2px rgba(0, 0, 0, 0.14), 0px 7px 36px 6px rgba(0, 0, 0, 0.12)",Y3="2px 20px 31px 3px rgba(0, 0, 0, 0.14), 0px 8px 38px 7px rgba(0, 0, 0, 0.12)",G3="2px 21px 33px 3px rgba(0, 0, 0, 0.14), 0px 8px 40px 7px rgba(0, 0, 0, 0.12)",J3="2px 22px 35px 3px rgba(0, 0, 0, 0.14), 0px 8px 42px 7px rgba(0, 0, 0, 0.12)",X3="2px 23px 36px 3px rgba(0, 0, 0, 0.14), 0px 9px 44px 8px rgba(0, 0, 0, 0.12)",Z3="2px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12)",Q3="3px",eV="1px",tV="2px",nV='"source-sans-pro", "helvetica", "arial", sans-serif',rV='"source-sans-pro", "helvetica", "arial", sans-serif',oV="700",iV="2rem",sV="normal",aV="normal",lV='"source-sans-pro", "helvetica", "arial", sans-serif',cV="700",uV="1.75rem",dV="normal",fV="normal",pV='"source-sans-pro", "helvetica", "arial", sans-serif',hV="700",mV="1.5rem",gV="normal",yV="normal",bV='"source-sans-pro", "helvetica", "arial", sans-serif',vV="700",xV="1.35rem",wV="normal",CV="normal",SV='"source-sans-pro", "helvetica", "arial", sans-serif',TV="700",kV="1.25rem",EV="normal",OV="normal",MV='"source-sans-pro", "helvetica", "arial", sans-serif',_V="700",RV="1.1rem",IV="normal",DV="normal",AV='"source-sans-pro", "helvetica", "arial", sans-serif',PV="600",NV="1.25rem",$V="normal",jV="normal",LV='"source-sans-pro", "helvetica", "arial", sans-serif',BV="600",FV="1.125rem",VV="normal",zV="normal",HV='"source-sans-pro", "helvetica", "arial", sans-serif',WV="400",UV="1.125rem",qV="normal",KV="normal",YV='"source-sans-pro", "helvetica", "arial", sans-serif',GV="400",JV="1rem",XV="normal",ZV="normal",QV='"source-sans-pro", "helvetica", "arial", sans-serif',ez="600",tz="1rem",nz="normal",rz="normal",oz='"source-sans-pro", "helvetica", "arial", sans-serif',iz="400",sz="0.75rem",az="normal",lz="normal",cz='"source-sans-pro", "helvetica", "arial", sans-serif',uz="400",dz="0.75rem",fz="normal",pz="normal",he={breakpoints_xs:f5,breakpoints_sm:p5,breakpoints_md:h5,breakpoints_lg:m5,breakpoints_xl:g5,light_palette_primary_light:y5,light_palette_primary_main:b5,light_palette_primary_dark:v5,light_palette_secondary_light:x5,light_palette_secondary_main:w5,light_palette_secondary_dark:C5,light_palette_text_primary:S5,light_palette_text_secondary:T5,light_palette_text_disabled:k5,light_palette_error_light:E5,light_palette_error_main:O5,light_palette_error_dark:M5,light_palette_warning_light:_5,light_palette_warning_main:R5,light_palette_warning_dark:I5,light_palette_info_light:D5,light_palette_info_main:A5,light_palette_info_dark:P5,light_palette_success_light:N5,light_palette_success_main:$5,light_palette_success_dark:j5,light_palette_background_default:L5,light_palette_background_paper:B5,light_palette_background_appBar:F5,light_palette_divider_default:V5,dark_palette_primary_light:z5,dark_palette_primary_main:H5,dark_palette_primary_dark:W5,dark_palette_secondary_light:U5,dark_palette_secondary_main:q5,dark_palette_secondary_dark:K5,dark_palette_text_primary:Y5,dark_palette_text_secondary:G5,dark_palette_text_disabled:J5,dark_palette_error_light:X5,dark_palette_error_main:Z5,dark_palette_error_dark:Q5,dark_palette_warning_light:e3,dark_palette_warning_main:t3,dark_palette_warning_dark:n3,dark_palette_info_light:r3,dark_palette_info_main:o3,dark_palette_info_dark:i3,dark_palette_success_light:s3,dark_palette_success_main:a3,dark_palette_success_dark:l3,dark_palette_background_default:c3,dark_palette_background_paper:u3,dark_palette_background_appBar:d3,dark_palette_divider_default:f3,common_palette_grey_50:p3,common_palette_grey_100:h3,common_palette_grey_200:m3,common_palette_grey_300:g3,common_palette_grey_400:y3,common_palette_grey_500:b3,common_palette_grey_600:v3,common_palette_grey_700:x3,common_palette_grey_800:w3,common_palette_grey_900:C3,common_palette_grey_A100:S3,common_palette_grey_A200:T3,common_palette_grey_A400:k3,common_palette_grey_A700:E3,common_palette_common_white:O3,common_palette_common_black:M3,shadows_1:_3,shadows_2:R3,shadows_3:I3,shadows_4:D3,shadows_5:A3,shadows_6:P3,shadows_7:N3,shadows_8:$3,shadows_9:j3,shadows_10:L3,shadows_11:B3,shadows_12:F3,shadows_13:V3,shadows_14:z3,shadows_15:H3,shadows_16:W3,shadows_17:U3,shadows_18:q3,shadows_19:K3,shadows_20:Y3,shadows_21:G3,shadows_22:J3,shadows_23:X3,shadows_24:Z3,shape_borderRadius:Q3,shape_borderWidth:eV,shape_buttonBorderWidth:tV,typography_fontFamily_default:nV,typography_h1_fontFamily:rV,typography_h1_fontWeight:oV,typography_h1_fontSize:iV,typography_h1_lineHeight:sV,typography_h1_letterSpacing:aV,typography_h2_fontFamily:lV,typography_h2_fontWeight:cV,typography_h2_fontSize:uV,typography_h2_lineHeight:dV,typography_h2_letterSpacing:fV,typography_h3_fontFamily:pV,typography_h3_fontWeight:hV,typography_h3_fontSize:mV,typography_h3_lineHeight:gV,typography_h3_letterSpacing:yV,typography_h4_fontFamily:bV,typography_h4_fontWeight:vV,typography_h4_fontSize:xV,typography_h4_lineHeight:wV,typography_h4_letterSpacing:CV,typography_h5_fontFamily:SV,typography_h5_fontWeight:TV,typography_h5_fontSize:kV,typography_h5_lineHeight:EV,typography_h5_letterSpacing:OV,typography_h6_fontFamily:MV,typography_h6_fontWeight:_V,typography_h6_fontSize:RV,typography_h6_lineHeight:IV,typography_h6_letterSpacing:DV,typography_subtitle1_fontFamily:AV,typography_subtitle1_fontWeight:PV,typography_subtitle1_fontSize:NV,typography_subtitle1_lineHeight:$V,typography_subtitle1_letterSpacing:jV,typography_subtitle2_fontFamily:LV,typography_subtitle2_fontWeight:BV,typography_subtitle2_fontSize:FV,typography_subtitle2_lineHeight:VV,typography_subtitle2_letterSpacing:zV,typography_body1_fontFamily:HV,typography_body1_fontWeight:WV,typography_body1_fontSize:UV,typography_body1_lineHeight:qV,typography_body1_letterSpacing:KV,typography_body2_fontFamily:YV,typography_body2_fontWeight:GV,typography_body2_fontSize:JV,typography_body2_lineHeight:XV,typography_body2_letterSpacing:ZV,typography_button_fontFamily:QV,typography_button_fontWeight:ez,typography_button_fontSize:tz,typography_button_lineHeight:nz,typography_button_letterSpacing:rz,typography_caption_fontFamily:oz,typography_caption_fontWeight:iz,typography_caption_fontSize:sz,typography_caption_lineHeight:az,typography_caption_letterSpacing:lz,typography_overline_fontFamily:cz,typography_overline_fontWeight:uz,typography_overline_fontSize:dz,typography_overline_lineHeight:fz,typography_overline_letterSpacing:pz},In={breakpoints:{values:{xs:parseInt(he.breakpoints_xs),sm:parseInt(he.breakpoints_sm),md:parseInt(he.breakpoints_md),lg:parseInt(he.breakpoints_lg),xl:parseInt(he.breakpoints_xl)}},shadows:["none",he.shadows_1,he.shadows_2,he.shadows_3,he.shadows_4,he.shadows_5,he.shadows_6,he.shadows_7,he.shadows_8,he.shadows_9,he.shadows_10,he.shadows_11,he.shadows_12,he.shadows_13,he.shadows_14,he.shadows_15,he.shadows_16,he.shadows_17,he.shadows_18,he.shadows_19,he.shadows_20,he.shadows_21,he.shadows_22,he.shadows_23,he.shadows_24],shape:{borderRadius:parseInt(he.shape_borderRadius)},typography:{fontFamily:he.typography_fontFamily_default,h1:{fontFamily:he.typography_h1_fontFamily,fontWeight:parseInt(he.typography_h1_fontWeight),fontSize:he.typography_h1_fontSize,lineHeight:he.typography_h1_lineHeight,letterSpacing:he.typography_h1_letterSpacing},h2:{fontFamily:he.typography_h2_fontFamily,fontWeight:parseInt(he.typography_h2_fontWeight),fontSize:he.typography_h2_fontSize,lineHeight:he.typography_h2_lineHeight,letterSpacing:he.typography_h2_letterSpacing},h3:{fontFamily:he.typography_h3_fontFamily,fontWeight:parseInt(he.typography_h3_fontWeight),fontSize:he.typography_h3_fontSize,lineHeight:he.typography_h3_lineHeight,letterSpacing:he.typography_h3_letterSpacing},h4:{fontFamily:he.typography_h4_fontFamily,fontWeight:parseInt(he.typography_h4_fontWeight),fontSize:he.typography_h4_fontSize,lineHeight:he.typography_h4_lineHeight,letterSpacing:he.typography_h4_letterSpacing},h5:{fontFamily:he.typography_h5_fontFamily,fontWeight:parseInt(he.typography_h5_fontWeight),fontSize:he.typography_h5_fontSize,lineHeight:he.typography_h5_lineHeight,letterSpacing:he.typography_h5_letterSpacing},h6:{fontFamily:he.typography_h6_fontFamily,fontWeight:parseInt(he.typography_h6_fontWeight),fontSize:he.typography_h6_fontSize,lineHeight:he.typography_h6_lineHeight,letterSpacing:he.typography_h6_letterSpacing},subtitle1:{fontFamily:he.typography_subtitle1_fontFamily,fontWeight:parseInt(he.typography_subtitle1_fontWeight),fontSize:he.typography_subtitle1_fontSize,lineHeight:he.typography_subtitle1_lineHeight,letterSpacing:he.typography_subtitle1_letterSpacing},subtitle2:{fontFamily:he.typography_subtitle2_fontFamily,fontWeight:parseInt(he.typography_subtitle2_fontWeight),fontSize:he.typography_subtitle2_fontSize,lineHeight:he.typography_subtitle2_lineHeight,letterSpacing:he.typography_subtitle2_letterSpacing},body1:{fontFamily:he.typography_body1_fontFamily,fontWeight:parseInt(he.typography_body1_fontWeight),fontSize:he.typography_body1_fontSize,lineHeight:he.typography_body1_lineHeight,letterSpacing:he.typography_body1_letterSpacing},body2:{fontFamily:he.typography_body2_fontFamily,fontWeight:parseInt(he.typography_body2_fontWeight),fontSize:he.typography_body2_fontSize,lineHeight:he.typography_body2_lineHeight,letterSpacing:he.typography_body2_letterSpacing},button:{fontFamily:he.typography_button_fontFamily,fontWeight:parseInt(he.typography_button_fontWeight),fontSize:he.typography_button_fontSize,lineHeight:he.typography_button_lineHeight,letterSpacing:he.typography_button_letterSpacing,textTransform:"none"},caption:{fontFamily:he.typography_caption_fontFamily,fontWeight:parseInt(he.typography_caption_fontWeight),fontSize:he.typography_caption_fontSize,lineHeight:he.typography_caption_lineHeight,letterSpacing:he.typography_caption_letterSpacing},overline:{fontFamily:he.typography_overline_fontFamily,fontWeight:parseInt(he.typography_overline_fontWeight),fontSize:he.typography_overline_fontSize,lineHeight:he.typography_overline_lineHeight,letterSpacing:he.typography_overline_letterSpacing}},palette:{grey:{50:he.common_palette_grey_50,100:he.common_palette_grey_100,200:he.common_palette_grey_200,300:he.common_palette_grey_300,400:he.common_palette_grey_400,500:he.common_palette_grey_500,600:he.common_palette_grey_600,700:he.common_palette_grey_700,800:he.common_palette_grey_800,900:he.common_palette_grey_900,A100:he.common_palette_grey_A100,A200:he.common_palette_grey_A200,A400:he.common_palette_grey_A400,A700:he.common_palette_grey_A700},common:{black:he.common_palette_common_black,white:he.common_palette_common_white},white:he.common_palette_common_white},components:{MuiCard:{defaultProps:{elevation:0},styleOverrides:{root:{borderStyle:"solid",borderWidth:he.shape_borderWidth}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}},MuiButton:{styleOverrides:{outlined:{borderWidth:he.shape_buttonBorderWidth,":hover":{borderWidth:he.shape_buttonBorderWidth}}}},MuiTable:{styleOverrides:{root:({ownerState:t})=>({...t.size==="x-small"&&{"& .MuiTableCell-root":{padding:"0px 16px"}}})}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:".9rem"}}}}};var uO,dO,fO,pO,hO,mO,gO,yO,bO,vO,xO,wO;const hz=V.createTheme({...In,palette:{...In.palette,mode:"light",primary:{light:he.light_palette_primary_light,main:he.light_palette_primary_main,dark:he.light_palette_primary_dark},secondary:{light:he.light_palette_secondary_light,main:he.light_palette_secondary_main,dark:he.light_palette_secondary_dark},text:{primary:he.light_palette_text_primary,secondary:he.light_palette_text_secondary,disabled:he.light_palette_text_disabled},background:{default:he.light_palette_background_default,paper:he.light_palette_background_paper,appBar:he.light_palette_background_appBar},error:{light:he.light_palette_error_light,main:he.light_palette_error_main,dark:he.light_palette_error_dark},success:{light:he.light_palette_success_light,main:he.light_palette_success_main,dark:he.light_palette_success_dark},info:{light:he.light_palette_info_light,main:he.light_palette_info_main,dark:he.light_palette_info_dark},warning:{light:he.light_palette_warning_light,main:he.light_palette_warning_main,dark:he.light_palette_warning_dark}},components:{...In.components,MuiAppBar:{...(uO=In.components)==null?void 0:uO.MuiAppBar,styleOverrides:{...(fO=(dO=In.components)==null?void 0:dO.MuiAppBar)==null?void 0:fO.styleOverrides,root:{...(mO=(hO=(pO=In.components)==null?void 0:pO.MuiAppBar)==null?void 0:hO.styleOverrides)==null?void 0:mO.root,backgroundColor:he.light_palette_background_appBar}}},MuiCard:{...(gO=In.components)==null?void 0:gO.MuiCard,styleOverrides:{...(bO=(yO=In.components)==null?void 0:yO.MuiCard)==null?void 0:bO.styleOverrides,root:{...(wO=(xO=(vO=In.components)==null?void 0:vO.MuiCard)==null?void 0:xO.styleOverrides)==null?void 0:wO.root,borderColor:he.light_palette_divider_default}}}}});var CO,SO,TO,kO,EO,OO,MO,_O,RO,IO,DO,AO;const mz=V.createTheme({...In,palette:{...In.palette,mode:"dark",primary:{light:he.dark_palette_primary_light,main:he.dark_palette_primary_main,dark:he.dark_palette_primary_dark},secondary:{light:he.dark_palette_secondary_light,main:he.dark_palette_secondary_main,dark:he.dark_palette_secondary_dark},text:{primary:he.dark_palette_text_primary,secondary:he.dark_palette_text_secondary,disabled:he.dark_palette_text_disabled},background:{default:he.dark_palette_background_default,paper:he.dark_palette_background_paper,appBar:he.dark_palette_background_appBar},error:{light:he.dark_palette_error_light,main:he.dark_palette_error_main,dark:he.dark_palette_error_dark},success:{light:he.dark_palette_success_light,main:he.dark_palette_success_main,dark:he.dark_palette_success_dark},info:{light:he.dark_palette_info_light,main:he.dark_palette_info_main,dark:he.dark_palette_info_dark},warning:{light:he.dark_palette_warning_light,main:he.dark_palette_warning_main,dark:he.dark_palette_warning_dark}},components:{...In.components,MuiAppBar:{...(CO=In.components)==null?void 0:CO.MuiAppBar,styleOverrides:{...(TO=(SO=In.components)==null?void 0:SO.MuiAppBar)==null?void 0:TO.styleOverrides,root:{...(OO=(EO=(kO=In.components)==null?void 0:kO.MuiAppBar)==null?void 0:EO.styleOverrides)==null?void 0:OO.root,backgroundColor:he.dark_palette_background_appBar,backgroundImage:"none"}}},MuiCard:{...(MO=In.components)==null?void 0:MO.MuiCard,styleOverrides:{...(RO=(_O=In.components)==null?void 0:_O.MuiCard)==null?void 0:RO.styleOverrides,root:{...(AO=(DO=(IO=In.components)==null?void 0:IO.MuiCard)==null?void 0:DO.styleOverrides)==null?void 0:AO.root,borderColor:he.dark_palette_divider_default}}}}}),gz=["w","xs","sm","md","lg","xl","alignment","justify","noMP","noGrid","gridClassName","gridStyle"],oC=t=>t>47&&t<58,iC=t=>t>64&&t<123&&(t<91||t>96),yz=(t,e,n,r)=>{let o="",i=0,s=0,a=0,l=0;const u=r.selectionStart;let f=!1;if(t.length<=e.length){for(let T=0;T<t.length&&T<e.length;T++){for(;i<e.length&&e[i]!=="X"&&e[i]!=="9";)a++,s++,i++;(oC(t.charCodeAt(T))&&e[i]==="9"||iC(t.charCodeAt(T))&&e[i]==="X")&&(a>0&&(l=a,a=0),o+=t[T],i++)}const p=oC(t.charCodeAt(u-1))?"number":iC(t.charCodeAt(u-1))?"letter":"something else",m=p!=="number"&&e[u-1]==="9",b=p!=="letter"&&e[u-1]==="X";(m||b||p==="something else")&&(f=!0);let y="",x=0;Math.abs(n.length-t.length)<=1&&(s=0);let C=u+s;for(let T=0;T<o.length;T++){for(;x<e.length&&e[x]!=="X"&&e[x]!=="9";)y+=e[x],x++;y+=o[T],x++}t.length<n.length?window.requestAnimationFrame(()=>{r.selectionStart=C,r.selectionEnd=C}):e[C-1]!=="X"&&e[C-1]!=="9"?window.requestAnimationFrame(()=>{r.selectionStart=C+l,r.selectionEnd=C+l}):(f&&(C-=1),window.requestAnimationFrame(()=>{r.selectionStart=C,r.selectionEnd=C}));const k=e.slice(x);return k.indexOf("X")===-1&&k.indexOf("9")===-1&&(y+=k),y}return window.requestAnimationFrame(()=>{r.selectionStart=u-1,r.selectionEnd=u-1}),n};function hr(t,e){const r=Object.keys(t).filter(i=>e.includes(i)),o={...t};for(const i of gz)delete o[i];for(const i of r)delete o[i];return o}const Fn=t=>t.split(/(?=[A-Z])|[.\-_\s]+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).filter(Boolean).join(" ");function sC(t,e,n=!1,r=""){let o="";if(e==null||e.length==0)return r;if(n){let i="";const s=e.toString().split(",");let a=0;t.forEach(l=>{s.includes(String(l.value).toString())&&(i+=l.label,a<s.length-1&&(i+=", "),a++)}),o=i}else{const i=t.find(s=>e==s.value);i!=null&&(o=i.label)}return o}function Hl(t,e,n){return t.onClick?{onClick:()=>{t.onClick(),t.openInNewTab&&window.open(t.externalUrl??t.path,"_blank","noopener"),t.path&&!t.openInNewTab&&e(t.path),n&&n()}}:t.path&&!t.openInNewTab?{component:ko.Link,to:t.path}:t.externalUrl||t.path?{component:"a",href:t.externalUrl??t.path,target:"_blank",rel:"noopener noreferrer"}:{}}function Fi(t,e){return process.env.NODE_ENV==="production"?()=>null:function(...r){return t(...r)||e(...r)}}var ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function er(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wd={exports:{}},Nt={};/**
|
|
1
|
+
"use strict";require('./index.css');var l5=Object.defineProperty;var c5=(t,e,n)=>e in t?l5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var mc=(t,e,n)=>c5(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("@mui/material"),g=require("react/jsx-runtime"),J=require("react"),Ht=require("formik"),ko=require("react-router-dom"),u5=require("@emotion/styled"),ri=require("@emotion/react"),ta=require("react-dom");function PO(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const D=PO(J),d5=PO(ta),f5="0px",p5="600px",h5="960px",m5="1100px",g5="1536px",y5="#4c98d7",b5="#005ea2",v5="#1a4480",x5="#9bb672",w5="#607f35",C5="#3c4a29",S5="rgba(0, 0, 0, 0.8705882353)",T5="rgba(0, 0, 0, 0.6)",k5="rgba(0, 0, 0, 0.3803921569)",E5="#dc5b52",O5="#d83933",M5="#b50909",_5="#ffbe2e",R5="#e5a000",I5="#c2850c",D5="#4c98d7",A5="#005ea2",P5="#1a4480",N5="#9bb672",$5="#607f35",j5="#3c4a29",L5="#f9f9f9",B5="#fff",F5="#252f3e",V5="#c9c9c9",z5="#98cbfb",H5="#4c98d7",W5="#005ea2",U5="#b8d293",q5="#9bb672",K5="#607f35",Y5="#fff",G5="rgba(255, 255, 255, 0.7019607843)",J5="rgba(255, 255, 255, 0.5019607843)",X5="#f1928b",Z5="#dc5b52",Q5="#d83933",e3="#ffe396",t3="#ffbe2e",n3="#e5a000",r3="#98cbfb",o3="#4c98d7",i3="#005ea2",s3="#b8d293",a3="#9bb672",l3="#607f35",c3="#121212",u3="#1b1b1b",d3="#2f3b4e",f3="#2e2e2e",p3="#f0f0f0",h3="#e6e6e6",m3="#c9c9c9",g3="#adadad",y3="#919191",b3="#757575",v3="#5c5c5c",x3="#454545",w3="#2e2e2e",C3="#1b1b1b",S3="#e6e6e6",T3="#c9c9c9",k3="#919191",E3="#454545",O3="#fff",M3="#000",_3="2px 2px 5px 0px rgba(0, 0, 0, 0.05)",R3="2px 2px 7px 0px rgba(0, 0, 0, 0.075)",I3="2px 3px 7px 0px rgba(0, 0, 0, 0.075), 0px 1px 10px 0px rgba(0, 0, 0, 0.05)",D3="2px 4px 8px 0px rgba(0, 0, 0, 0.075), 0px 1px 12px 0px rgba(0, 0, 0, 0.075)",A3="2px 5px 8px 0px rgba(0, 0, 0, 0.075), 0px 2px 14px 0px rgba(0, 0, 0, 0.1)",P3="2px 6px 10px 0px rgba(0, 0, 0, 0.1), 0px 2px 18px 0px rgba(0, 0, 0, 0.1)",N3="2px 7px 10px 1px rgba(0, 0, 0, 0.1), 0px 2px 16px 1px rgba(0, 0, 0, 0.12)",$3="2px 8px 10px 1px rgba(0, 0, 0, 0.1), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)",j3="2px 9px 12px 1px rgba(0, 0, 0, 0.1), 0px 3px 16px 2px rgba(0, 0, 0, 0.12)",L3="2px 10px 14px 1px rgba(0, 0, 0, 0.12), 0px 4px 18px 3px rgba(0, 0, 0, 0.12)",B3="2px 11px 15px 1px rgba(0, 0, 0, 0.12), 0px 4px 20px 3px rgba(0, 0, 0, 0.12)",F3="2px 12px 17px 2px rgba(0, 0, 0, 0.12), 0px 5px 22px 4px rgba(0, 0, 0, 0.12)",V3="2px 13px 19px 2px rgba(0, 0, 0, 0.12), 0px 5px 24px 4px rgba(0, 0, 0, 0.12)",z3="2px 14px 21px 2px rgba(0, 0, 0, 0.12), 0px 5px 26px 4px rgba(0, 0, 0, 0.12)",H3="2px 15px 22px 2px rgba(0, 0, 0, 0.12), 0px 6px 28px 5px rgba(0, 0, 0, 0.12)",W3="2px 16px 24px 2px rgba(0, 0, 0, 0.12), 0px 6px 30px 5px rgba(0, 0, 0, 0.12)",U3="2px 17px 26px 2px rgba(0, 0, 0, 0.14), 0px 6px 32px 5px rgba(0, 0, 0, 0.12)",q3="2px 18px 28px 2px rgba(0, 0, 0, 0.14), 0px 7px 34px 6px rgba(0, 0, 0, 0.12)",K3="2px 19px 29px 2px rgba(0, 0, 0, 0.14), 0px 7px 36px 6px rgba(0, 0, 0, 0.12)",Y3="2px 20px 31px 3px rgba(0, 0, 0, 0.14), 0px 8px 38px 7px rgba(0, 0, 0, 0.12)",G3="2px 21px 33px 3px rgba(0, 0, 0, 0.14), 0px 8px 40px 7px rgba(0, 0, 0, 0.12)",J3="2px 22px 35px 3px rgba(0, 0, 0, 0.14), 0px 8px 42px 7px rgba(0, 0, 0, 0.12)",X3="2px 23px 36px 3px rgba(0, 0, 0, 0.14), 0px 9px 44px 8px rgba(0, 0, 0, 0.12)",Z3="2px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12)",Q3="3px",eV="1px",tV="2px",nV='"source-sans-pro", "helvetica", "arial", sans-serif',rV='"source-sans-pro", "helvetica", "arial", sans-serif',oV="700",iV="2rem",sV="normal",aV="normal",lV='"source-sans-pro", "helvetica", "arial", sans-serif',cV="700",uV="1.75rem",dV="normal",fV="normal",pV='"source-sans-pro", "helvetica", "arial", sans-serif',hV="700",mV="1.5rem",gV="normal",yV="normal",bV='"source-sans-pro", "helvetica", "arial", sans-serif',vV="700",xV="1.35rem",wV="normal",CV="normal",SV='"source-sans-pro", "helvetica", "arial", sans-serif',TV="700",kV="1.25rem",EV="normal",OV="normal",MV='"source-sans-pro", "helvetica", "arial", sans-serif',_V="700",RV="1.1rem",IV="normal",DV="normal",AV='"source-sans-pro", "helvetica", "arial", sans-serif',PV="600",NV="1.25rem",$V="normal",jV="normal",LV='"source-sans-pro", "helvetica", "arial", sans-serif',BV="600",FV="1.125rem",VV="normal",zV="normal",HV='"source-sans-pro", "helvetica", "arial", sans-serif',WV="400",UV="1.125rem",qV="normal",KV="normal",YV='"source-sans-pro", "helvetica", "arial", sans-serif',GV="400",JV="1rem",XV="normal",ZV="normal",QV='"source-sans-pro", "helvetica", "arial", sans-serif',ez="600",tz="1rem",nz="normal",rz="normal",oz='"source-sans-pro", "helvetica", "arial", sans-serif',iz="400",sz="0.75rem",az="normal",lz="normal",cz='"source-sans-pro", "helvetica", "arial", sans-serif',uz="400",dz="0.75rem",fz="normal",pz="normal",he={breakpoints_xs:f5,breakpoints_sm:p5,breakpoints_md:h5,breakpoints_lg:m5,breakpoints_xl:g5,light_palette_primary_light:y5,light_palette_primary_main:b5,light_palette_primary_dark:v5,light_palette_secondary_light:x5,light_palette_secondary_main:w5,light_palette_secondary_dark:C5,light_palette_text_primary:S5,light_palette_text_secondary:T5,light_palette_text_disabled:k5,light_palette_error_light:E5,light_palette_error_main:O5,light_palette_error_dark:M5,light_palette_warning_light:_5,light_palette_warning_main:R5,light_palette_warning_dark:I5,light_palette_info_light:D5,light_palette_info_main:A5,light_palette_info_dark:P5,light_palette_success_light:N5,light_palette_success_main:$5,light_palette_success_dark:j5,light_palette_background_default:L5,light_palette_background_paper:B5,light_palette_background_appBar:F5,light_palette_divider_default:V5,dark_palette_primary_light:z5,dark_palette_primary_main:H5,dark_palette_primary_dark:W5,dark_palette_secondary_light:U5,dark_palette_secondary_main:q5,dark_palette_secondary_dark:K5,dark_palette_text_primary:Y5,dark_palette_text_secondary:G5,dark_palette_text_disabled:J5,dark_palette_error_light:X5,dark_palette_error_main:Z5,dark_palette_error_dark:Q5,dark_palette_warning_light:e3,dark_palette_warning_main:t3,dark_palette_warning_dark:n3,dark_palette_info_light:r3,dark_palette_info_main:o3,dark_palette_info_dark:i3,dark_palette_success_light:s3,dark_palette_success_main:a3,dark_palette_success_dark:l3,dark_palette_background_default:c3,dark_palette_background_paper:u3,dark_palette_background_appBar:d3,dark_palette_divider_default:f3,common_palette_grey_50:p3,common_palette_grey_100:h3,common_palette_grey_200:m3,common_palette_grey_300:g3,common_palette_grey_400:y3,common_palette_grey_500:b3,common_palette_grey_600:v3,common_palette_grey_700:x3,common_palette_grey_800:w3,common_palette_grey_900:C3,common_palette_grey_A100:S3,common_palette_grey_A200:T3,common_palette_grey_A400:k3,common_palette_grey_A700:E3,common_palette_common_white:O3,common_palette_common_black:M3,shadows_1:_3,shadows_2:R3,shadows_3:I3,shadows_4:D3,shadows_5:A3,shadows_6:P3,shadows_7:N3,shadows_8:$3,shadows_9:j3,shadows_10:L3,shadows_11:B3,shadows_12:F3,shadows_13:V3,shadows_14:z3,shadows_15:H3,shadows_16:W3,shadows_17:U3,shadows_18:q3,shadows_19:K3,shadows_20:Y3,shadows_21:G3,shadows_22:J3,shadows_23:X3,shadows_24:Z3,shape_borderRadius:Q3,shape_borderWidth:eV,shape_buttonBorderWidth:tV,typography_fontFamily_default:nV,typography_h1_fontFamily:rV,typography_h1_fontWeight:oV,typography_h1_fontSize:iV,typography_h1_lineHeight:sV,typography_h1_letterSpacing:aV,typography_h2_fontFamily:lV,typography_h2_fontWeight:cV,typography_h2_fontSize:uV,typography_h2_lineHeight:dV,typography_h2_letterSpacing:fV,typography_h3_fontFamily:pV,typography_h3_fontWeight:hV,typography_h3_fontSize:mV,typography_h3_lineHeight:gV,typography_h3_letterSpacing:yV,typography_h4_fontFamily:bV,typography_h4_fontWeight:vV,typography_h4_fontSize:xV,typography_h4_lineHeight:wV,typography_h4_letterSpacing:CV,typography_h5_fontFamily:SV,typography_h5_fontWeight:TV,typography_h5_fontSize:kV,typography_h5_lineHeight:EV,typography_h5_letterSpacing:OV,typography_h6_fontFamily:MV,typography_h6_fontWeight:_V,typography_h6_fontSize:RV,typography_h6_lineHeight:IV,typography_h6_letterSpacing:DV,typography_subtitle1_fontFamily:AV,typography_subtitle1_fontWeight:PV,typography_subtitle1_fontSize:NV,typography_subtitle1_lineHeight:$V,typography_subtitle1_letterSpacing:jV,typography_subtitle2_fontFamily:LV,typography_subtitle2_fontWeight:BV,typography_subtitle2_fontSize:FV,typography_subtitle2_lineHeight:VV,typography_subtitle2_letterSpacing:zV,typography_body1_fontFamily:HV,typography_body1_fontWeight:WV,typography_body1_fontSize:UV,typography_body1_lineHeight:qV,typography_body1_letterSpacing:KV,typography_body2_fontFamily:YV,typography_body2_fontWeight:GV,typography_body2_fontSize:JV,typography_body2_lineHeight:XV,typography_body2_letterSpacing:ZV,typography_button_fontFamily:QV,typography_button_fontWeight:ez,typography_button_fontSize:tz,typography_button_lineHeight:nz,typography_button_letterSpacing:rz,typography_caption_fontFamily:oz,typography_caption_fontWeight:iz,typography_caption_fontSize:sz,typography_caption_lineHeight:az,typography_caption_letterSpacing:lz,typography_overline_fontFamily:cz,typography_overline_fontWeight:uz,typography_overline_fontSize:dz,typography_overline_lineHeight:fz,typography_overline_letterSpacing:pz},In={breakpoints:{values:{xs:parseInt(he.breakpoints_xs),sm:parseInt(he.breakpoints_sm),md:parseInt(he.breakpoints_md),lg:parseInt(he.breakpoints_lg),xl:parseInt(he.breakpoints_xl)}},shadows:["none",he.shadows_1,he.shadows_2,he.shadows_3,he.shadows_4,he.shadows_5,he.shadows_6,he.shadows_7,he.shadows_8,he.shadows_9,he.shadows_10,he.shadows_11,he.shadows_12,he.shadows_13,he.shadows_14,he.shadows_15,he.shadows_16,he.shadows_17,he.shadows_18,he.shadows_19,he.shadows_20,he.shadows_21,he.shadows_22,he.shadows_23,he.shadows_24],shape:{borderRadius:parseInt(he.shape_borderRadius)},typography:{fontFamily:he.typography_fontFamily_default,h1:{fontFamily:he.typography_h1_fontFamily,fontWeight:parseInt(he.typography_h1_fontWeight),fontSize:he.typography_h1_fontSize,lineHeight:he.typography_h1_lineHeight,letterSpacing:he.typography_h1_letterSpacing},h2:{fontFamily:he.typography_h2_fontFamily,fontWeight:parseInt(he.typography_h2_fontWeight),fontSize:he.typography_h2_fontSize,lineHeight:he.typography_h2_lineHeight,letterSpacing:he.typography_h2_letterSpacing},h3:{fontFamily:he.typography_h3_fontFamily,fontWeight:parseInt(he.typography_h3_fontWeight),fontSize:he.typography_h3_fontSize,lineHeight:he.typography_h3_lineHeight,letterSpacing:he.typography_h3_letterSpacing},h4:{fontFamily:he.typography_h4_fontFamily,fontWeight:parseInt(he.typography_h4_fontWeight),fontSize:he.typography_h4_fontSize,lineHeight:he.typography_h4_lineHeight,letterSpacing:he.typography_h4_letterSpacing},h5:{fontFamily:he.typography_h5_fontFamily,fontWeight:parseInt(he.typography_h5_fontWeight),fontSize:he.typography_h5_fontSize,lineHeight:he.typography_h5_lineHeight,letterSpacing:he.typography_h5_letterSpacing},h6:{fontFamily:he.typography_h6_fontFamily,fontWeight:parseInt(he.typography_h6_fontWeight),fontSize:he.typography_h6_fontSize,lineHeight:he.typography_h6_lineHeight,letterSpacing:he.typography_h6_letterSpacing},subtitle1:{fontFamily:he.typography_subtitle1_fontFamily,fontWeight:parseInt(he.typography_subtitle1_fontWeight),fontSize:he.typography_subtitle1_fontSize,lineHeight:he.typography_subtitle1_lineHeight,letterSpacing:he.typography_subtitle1_letterSpacing},subtitle2:{fontFamily:he.typography_subtitle2_fontFamily,fontWeight:parseInt(he.typography_subtitle2_fontWeight),fontSize:he.typography_subtitle2_fontSize,lineHeight:he.typography_subtitle2_lineHeight,letterSpacing:he.typography_subtitle2_letterSpacing},body1:{fontFamily:he.typography_body1_fontFamily,fontWeight:parseInt(he.typography_body1_fontWeight),fontSize:he.typography_body1_fontSize,lineHeight:he.typography_body1_lineHeight,letterSpacing:he.typography_body1_letterSpacing},body2:{fontFamily:he.typography_body2_fontFamily,fontWeight:parseInt(he.typography_body2_fontWeight),fontSize:he.typography_body2_fontSize,lineHeight:he.typography_body2_lineHeight,letterSpacing:he.typography_body2_letterSpacing},button:{fontFamily:he.typography_button_fontFamily,fontWeight:parseInt(he.typography_button_fontWeight),fontSize:he.typography_button_fontSize,lineHeight:he.typography_button_lineHeight,letterSpacing:he.typography_button_letterSpacing,textTransform:"none"},caption:{fontFamily:he.typography_caption_fontFamily,fontWeight:parseInt(he.typography_caption_fontWeight),fontSize:he.typography_caption_fontSize,lineHeight:he.typography_caption_lineHeight,letterSpacing:he.typography_caption_letterSpacing},overline:{fontFamily:he.typography_overline_fontFamily,fontWeight:parseInt(he.typography_overline_fontWeight),fontSize:he.typography_overline_fontSize,lineHeight:he.typography_overline_lineHeight,letterSpacing:he.typography_overline_letterSpacing}},palette:{grey:{50:he.common_palette_grey_50,100:he.common_palette_grey_100,200:he.common_palette_grey_200,300:he.common_palette_grey_300,400:he.common_palette_grey_400,500:he.common_palette_grey_500,600:he.common_palette_grey_600,700:he.common_palette_grey_700,800:he.common_palette_grey_800,900:he.common_palette_grey_900,A100:he.common_palette_grey_A100,A200:he.common_palette_grey_A200,A400:he.common_palette_grey_A400,A700:he.common_palette_grey_A700},common:{black:he.common_palette_common_black,white:he.common_palette_common_white},white:he.common_palette_common_white},components:{MuiCard:{defaultProps:{elevation:0},styleOverrides:{root:{borderStyle:"solid",borderWidth:he.shape_borderWidth}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}},MuiButton:{styleOverrides:{outlined:{borderWidth:he.shape_buttonBorderWidth,":hover":{borderWidth:he.shape_buttonBorderWidth}}}},MuiTable:{styleOverrides:{root:({ownerState:t})=>({...t.size==="x-small"&&{"& .MuiTableCell-root":{padding:"0px 16px"}}})}},MuiTableCell:{styleOverrides:{head:({theme:t})=>({"& .MuiSvgIcon-root":{color:t.palette.grey[300]}})}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:".9rem"}}}}};var uO,dO,fO,pO,hO,mO,gO,yO,bO,vO,xO,wO;const hz=V.createTheme({...In,palette:{...In.palette,mode:"light",primary:{light:he.light_palette_primary_light,main:he.light_palette_primary_main,dark:he.light_palette_primary_dark},secondary:{light:he.light_palette_secondary_light,main:he.light_palette_secondary_main,dark:he.light_palette_secondary_dark},text:{primary:he.light_palette_text_primary,secondary:he.light_palette_text_secondary,disabled:he.light_palette_text_disabled},background:{default:he.light_palette_background_default,paper:he.light_palette_background_paper,appBar:he.light_palette_background_appBar},error:{light:he.light_palette_error_light,main:he.light_palette_error_main,dark:he.light_palette_error_dark},success:{light:he.light_palette_success_light,main:he.light_palette_success_main,dark:he.light_palette_success_dark},info:{light:he.light_palette_info_light,main:he.light_palette_info_main,dark:he.light_palette_info_dark},warning:{light:he.light_palette_warning_light,main:he.light_palette_warning_main,dark:he.light_palette_warning_dark}},components:{...In.components,MuiAppBar:{...(uO=In.components)==null?void 0:uO.MuiAppBar,styleOverrides:{...(fO=(dO=In.components)==null?void 0:dO.MuiAppBar)==null?void 0:fO.styleOverrides,root:{...(mO=(hO=(pO=In.components)==null?void 0:pO.MuiAppBar)==null?void 0:hO.styleOverrides)==null?void 0:mO.root,backgroundColor:he.light_palette_background_appBar}}},MuiCard:{...(gO=In.components)==null?void 0:gO.MuiCard,styleOverrides:{...(bO=(yO=In.components)==null?void 0:yO.MuiCard)==null?void 0:bO.styleOverrides,root:{...(wO=(xO=(vO=In.components)==null?void 0:vO.MuiCard)==null?void 0:xO.styleOverrides)==null?void 0:wO.root,borderColor:he.light_palette_divider_default}}}}});var CO,SO,TO,kO,EO,OO,MO,_O,RO,IO,DO,AO;const mz=V.createTheme({...In,palette:{...In.palette,mode:"dark",primary:{light:he.dark_palette_primary_light,main:he.dark_palette_primary_main,dark:he.dark_palette_primary_dark},secondary:{light:he.dark_palette_secondary_light,main:he.dark_palette_secondary_main,dark:he.dark_palette_secondary_dark},text:{primary:he.dark_palette_text_primary,secondary:he.dark_palette_text_secondary,disabled:he.dark_palette_text_disabled},background:{default:he.dark_palette_background_default,paper:he.dark_palette_background_paper,appBar:he.dark_palette_background_appBar},error:{light:he.dark_palette_error_light,main:he.dark_palette_error_main,dark:he.dark_palette_error_dark},success:{light:he.dark_palette_success_light,main:he.dark_palette_success_main,dark:he.dark_palette_success_dark},info:{light:he.dark_palette_info_light,main:he.dark_palette_info_main,dark:he.dark_palette_info_dark},warning:{light:he.dark_palette_warning_light,main:he.dark_palette_warning_main,dark:he.dark_palette_warning_dark}},components:{...In.components,MuiAppBar:{...(CO=In.components)==null?void 0:CO.MuiAppBar,styleOverrides:{...(TO=(SO=In.components)==null?void 0:SO.MuiAppBar)==null?void 0:TO.styleOverrides,root:{...(OO=(EO=(kO=In.components)==null?void 0:kO.MuiAppBar)==null?void 0:EO.styleOverrides)==null?void 0:OO.root,backgroundColor:he.dark_palette_background_appBar,backgroundImage:"none"}}},MuiCard:{...(MO=In.components)==null?void 0:MO.MuiCard,styleOverrides:{...(RO=(_O=In.components)==null?void 0:_O.MuiCard)==null?void 0:RO.styleOverrides,root:{...(AO=(DO=(IO=In.components)==null?void 0:IO.MuiCard)==null?void 0:DO.styleOverrides)==null?void 0:AO.root,borderColor:he.dark_palette_divider_default}}}}}),gz=["w","xs","sm","md","lg","xl","alignment","justify","noMP","noGrid","gridClassName","gridStyle"],oC=t=>t>47&&t<58,iC=t=>t>64&&t<123&&(t<91||t>96),yz=(t,e,n,r)=>{let o="",i=0,s=0,a=0,l=0;const u=r.selectionStart;let f=!1;if(t.length<=e.length){for(let T=0;T<t.length&&T<e.length;T++){for(;i<e.length&&e[i]!=="X"&&e[i]!=="9";)a++,s++,i++;(oC(t.charCodeAt(T))&&e[i]==="9"||iC(t.charCodeAt(T))&&e[i]==="X")&&(a>0&&(l=a,a=0),o+=t[T],i++)}const p=oC(t.charCodeAt(u-1))?"number":iC(t.charCodeAt(u-1))?"letter":"something else",m=p!=="number"&&e[u-1]==="9",b=p!=="letter"&&e[u-1]==="X";(m||b||p==="something else")&&(f=!0);let y="",x=0;Math.abs(n.length-t.length)<=1&&(s=0);let C=u+s;for(let T=0;T<o.length;T++){for(;x<e.length&&e[x]!=="X"&&e[x]!=="9";)y+=e[x],x++;y+=o[T],x++}t.length<n.length?window.requestAnimationFrame(()=>{r.selectionStart=C,r.selectionEnd=C}):e[C-1]!=="X"&&e[C-1]!=="9"?window.requestAnimationFrame(()=>{r.selectionStart=C+l,r.selectionEnd=C+l}):(f&&(C-=1),window.requestAnimationFrame(()=>{r.selectionStart=C,r.selectionEnd=C}));const k=e.slice(x);return k.indexOf("X")===-1&&k.indexOf("9")===-1&&(y+=k),y}return window.requestAnimationFrame(()=>{r.selectionStart=u-1,r.selectionEnd=u-1}),n};function hr(t,e){const r=Object.keys(t).filter(i=>e.includes(i)),o={...t};for(const i of gz)delete o[i];for(const i of r)delete o[i];return o}const Fn=t=>t.split(/(?=[A-Z])|[.\-_\s]+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).filter(Boolean).join(" ");function sC(t,e,n=!1,r=""){let o="";if(e==null||e.length==0)return r;if(n){let i="";const s=e.toString().split(",");let a=0;t.forEach(l=>{s.includes(String(l.value).toString())&&(i+=l.label,a<s.length-1&&(i+=", "),a++)}),o=i}else{const i=t.find(s=>e==s.value);i!=null&&(o=i.label)}return o}function Hl(t,e,n){return t.onClick?{onClick:()=>{t.onClick(),t.openInNewTab&&window.open(t.externalUrl??t.path,"_blank","noopener"),t.path&&!t.openInNewTab&&e(t.path),n&&n()}}:t.path&&!t.openInNewTab?{component:ko.Link,to:t.path}:t.externalUrl||t.path?{component:"a",href:t.externalUrl??t.path,target:"_blank",rel:"noopener noreferrer"}:{}}function Fi(t,e){return process.env.NODE_ENV==="production"?()=>null:function(...r){return t(...r)||e(...r)}}var ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function er(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wd={exports:{}},Nt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.js
|
|
4
4
|
*
|
|
@@ -401,7 +401,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
401
401
|
`,Wce="️",Uce="",fb="";let Cf=null,Sf=null;function qce(t=[]){const e={};Sr.groups=e;const n=new Sr;Cf==null&&(Cf=zE(Lce)),Sf==null&&(Sf=zE(Bce)),Ae(n,"'",Kp),Ae(n,"{",ou),Ae(n,"}",iu),Ae(n,"[",Dp),Ae(n,"]",Ap),Ae(n,"(",Pp),Ae(n,")",Np),Ae(n,"<",$p),Ae(n,">",jp),Ae(n,"(",Lp),Ae(n,")",Bp),Ae(n,"「",Fp),Ae(n,"」",Vp),Ae(n,"『",zp),Ae(n,"』",Hp),Ae(n,"<",Wp),Ae(n,">",Up),Ae(n,"&",qp),Ae(n,"*",Yp),Ae(n,"@",as),Ae(n,"`",Jp),Ae(n,"^",Xp),Ae(n,":",us),Ae(n,",",xx),Ae(n,"$",Zp),Ae(n,".",Bo),Ae(n,"=",Qp),Ae(n,"!",wx),Ae(n,"-",to),Ae(n,"%",su),Ae(n,"|",eh),Ae(n,"+",th),Ae(n,"#",nh),Ae(n,"?",au),Ae(n,'"',Cx),Ae(n,"/",Fo),Ae(n,";",Sx),Ae(n,"~",lu),Ae(n,"_",rh),Ae(n,"\\",Gp),Ae(n,"・",UD);const r=ln(n,xi,bx,{[g0]:!0});ln(r,xi,r);const o=ln(r,vi,HD,{[ru]:!0}),i=ln(r,Ic,WD,{[Vc]:!0}),s=ln(n,vi,Si,{[y0]:!0});ln(s,xi,o),ln(s,vi,s),ln(o,xi,o),ln(o,vi,o);const a=ln(n,Ic,x0,{[b0]:!0});ln(a,vi),ln(a,xi,i),ln(a,Ic,a),ln(i,xi,i),ln(i,vi),ln(i,Ic,i);const l=Ae(n,db,vx,{[lb]:!0}),u=Ae(n,VE,S0,{[lb]:!0}),f=ln(n,ub,S0,{[lb]:!0});Ae(n,fb,f),Ae(u,db,l),Ae(u,fb,f),ln(u,ub,f),Ae(f,VE),Ae(f,db),ln(f,ub,f),Ae(f,fb,f);const p=ln(n,cb,qD,{[zD]:!0});Ae(p,"#"),ln(p,cb,p),Ae(p,Wce,p);const m=Ae(p,Uce);Ae(m,"#"),ln(m,cb,p);const b=[[vi,s],[xi,o]],v=[[vi,null],[Ic,a],[xi,i]];for(let y=0;y<Cf.length;y++)ns(n,Cf[y],w0,Si,b);for(let y=0;y<Sf.length;y++)ns(n,Sf[y],C0,x0,v);aa(w0,{tld:!0,ascii:!0},e),aa(C0,{utld:!0,alpha:!0},e),ns(n,"file",Yf,Si,b),ns(n,"mailto",Yf,Si,b),ns(n,"http",pl,Si,b),ns(n,"https",pl,Si,b),ns(n,"ftp",pl,Si,b),ns(n,"ftps",pl,Si,b),aa(Yf,{scheme:!0,ascii:!0},e),aa(pl,{slashscheme:!0,ascii:!0},e),t=t.sort((y,x)=>y[0]>x[0]?1:-1);for(let y=0;y<t.length;y++){const x=t[y][0],k=t[y][1]?{[Fce]:!0}:{[Vce]:!0};x.indexOf("-")>=0?k[v0]=!0:vi.test(x)?xi.test(x)?k[ru]=!0:k[y0]=!0:k[g0]=!0,FE(n,x,x,k)}return FE(n,"localhost",_u,{ascii:!0}),n.jd=new Sr(oh),{start:n,tokens:Object.assign({groups:e},KD)}}function YD(t,e){const n=Kce(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,u=0,f=null,p=-1,m=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,m=0,f=a):p>=0&&(p+=n[s].length,m++),u+=n[s].length,i+=n[s].length,s++;i-=p,s-=m,u-=p,o.push({t:f.t,v:e.slice(i-u,i),s:i-u,e:i})}return o}function Kce(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function ns(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new Sr(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new Sr(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function zE(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ru={defaultProtocol:"http",events:null,format:HE,formatHref:HE,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Tx(t,e=null){let n=Object.assign({},Ru);t&&(n=Object.assign(n,t instanceof Tx?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Tx.prototype={o:Ru,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Ru[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function HE(t){return t}function GD(t,e){this.t="token",this.v=t,this.tk=e}GD.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ru.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),f&&Object.assign(s,f),{tagName:o,attributes:s,content:i,eventListeners:p}}};function bm(t,e){class n extends GD{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const WE=bm("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),UE=bm("text"),Yce=bm("nl"),Tf=bm("url",{isLink:!0,toHref(t=Ru.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_u&&t[1].t===us}}),Qr=t=>new Sr(t);function Gce({groups:t}){const e=t.domain.concat([qp,Yp,as,Gp,Jp,Xp,Zp,Qp,to,bx,su,eh,th,nh,Fo,oh,lu,rh]),n=[Kp,us,xx,Bo,wx,su,au,Cx,Sx,$p,jp,ou,iu,Ap,Dp,Pp,Np,Lp,Bp,Fp,Vp,zp,Hp,Wp,Up],r=[qp,Kp,Yp,Gp,Jp,Xp,Zp,Qp,to,ou,iu,su,eh,th,nh,au,Fo,oh,lu,rh],o=Qr(),i=Ae(o,lu);ft(i,r,i),ft(i,t.domain,i);const s=Qr(),a=Qr(),l=Qr();ft(o,t.domain,s),ft(o,t.scheme,a),ft(o,t.slashscheme,l),ft(s,r,i),ft(s,t.domain,s);const u=Ae(s,as);Ae(i,as,u),Ae(a,as,u),Ae(l,as,u);const f=Ae(i,Bo);ft(f,r,i),ft(f,t.domain,i);const p=Qr();ft(u,t.domain,p),ft(p,t.domain,p);const m=Ae(p,Bo);ft(m,t.domain,p);const b=Qr(WE);ft(m,t.tld,b),ft(m,t.utld,b),Ae(u,_u,b);const v=Ae(p,to);Ae(v,to,v),ft(v,t.domain,p),ft(b,t.domain,p),Ae(b,Bo,m),Ae(b,to,v);const y=Ae(b,us);ft(y,t.numeric,WE);const x=Ae(s,to),C=Ae(s,Bo);Ae(x,to,x),ft(x,t.domain,s),ft(C,r,i),ft(C,t.domain,s);const k=Qr(Tf);ft(C,t.tld,k),ft(C,t.utld,k),ft(k,t.domain,s),ft(k,r,i),Ae(k,Bo,C),Ae(k,to,x),Ae(k,as,u);const T=Ae(k,us),S=Qr(Tf);ft(T,t.numeric,S);const O=Qr(Tf),R=Qr();ft(O,e,O),ft(O,n,R),ft(R,e,O),ft(R,n,R),Ae(k,Fo,O),Ae(S,Fo,O);const P=Ae(a,us),$=Ae(l,us),F=Ae($,Fo),M=Ae(F,Fo);ft(a,t.domain,s),Ae(a,Bo,C),Ae(a,to,x),ft(l,t.domain,s),Ae(l,Bo,C),Ae(l,to,x),ft(P,t.domain,O),Ae(P,Fo,O),Ae(P,au,O),ft(M,t.domain,O),ft(M,e,O),Ae(M,Fo,O);const j=[[ou,iu],[Dp,Ap],[Pp,Np],[$p,jp],[Lp,Bp],[Fp,Vp],[zp,Hp],[Wp,Up]];for(let z=0;z<j.length;z++){const[L,A]=j[z],_=Ae(O,L);Ae(R,L,_),Ae(_,A,O);const I=Qr(Tf);ft(_,e,I);const B=Qr();ft(_,n),ft(I,e,I),ft(I,n,B),ft(B,e,I),ft(B,n,B),Ae(I,A,O),Ae(B,A,O)}return Ae(o,_u,k),Ae(o,vx,Yce),{start:o,tokens:KD}}function Jce(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,u=null,f=0,p=null,m=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(u=l||a.go(n[o].t));)l=null,a=u,a.accepts()?(m=0,p=a):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(pb(UE,e,s)),s=[]),o-=m,f-=m;const b=p.t,v=n.slice(o-f,o);i.push(pb(b,e,v))}}return s.length>0&&i.push(pb(UE,e,s)),i}function pb(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const Xce=typeof console<"u"&&console&&console.warn||(()=>{}),Zce="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ut={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Qce(){return Sr.groups={},Ut.scanner=null,Ut.parser=null,Ut.tokenQueue=[],Ut.pluginQueue=[],Ut.customSchemes=[],Ut.initialized=!1,Ut}function qE(t,e=!1){if(Ut.initialized&&Xce(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Zce}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
402
402
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
403
403
|
2. Cannot start or end with "-"
|
|
404
|
-
3. "-" cannot repeat`);Ut.customSchemes.push([t,e])}function eue(){Ut.scanner=qce(Ut.customSchemes);for(let t=0;t<Ut.tokenQueue.length;t++)Ut.tokenQueue[t][1]({scanner:Ut.scanner});Ut.parser=Gce(Ut.scanner.tokens);for(let t=0;t<Ut.pluginQueue.length;t++)Ut.pluginQueue[t][1]({scanner:Ut.scanner,parser:Ut.parser});return Ut.initialized=!0,Ut}function kx(t){return Ut.initialized||eue(),Jce(Ut.parser.start,t,YD(Ut.scanner.start,t))}kx.scan=YD;function JD(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Tx(n),o=kx(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}const Ex="[\0- -\u2029 ]",tue=new RegExp(Ex),nue=new RegExp(`${Ex}$`),rue=new RegExp(Ex,"g");function oue(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function iue(t){return new on({key:new On("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=e.some(u=>u.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=S7(n.doc,[...e]);if(_7(a).forEach(({newRange:u})=>{const f=k7(r.doc,u,b=>b.isTextblock);let p,m;if(f.length>1)p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(f.length){const b=r.doc.textBetween(u.from,u.to," "," ");if(!nue.test(b))return;p=f[0],m=r.doc.textBetween(p.pos,u.to,void 0," ")}if(p&&m){const b=m.split(tue).filter(Boolean);if(b.length<=0)return!1;const v=b[b.length-1],y=p.pos+m.lastIndexOf(v);if(!v)return!1;const x=kx(v).map(C=>C.toObject(t.defaultProtocol));if(!oue(x))return!1;x.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>t.validate(C.value)).filter(C=>t.shouldAutoLink(C.value)).forEach(C=>{av(C.from,C.to,r.doc).some(k=>k.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function sue(t){return new on({key:new On("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(m=>m.nodeName==="A"))return!1;const l=sv(e.state,t.type.name),u=r.target,f=(o=u==null?void 0:u.href)!==null&&o!==void 0?o:l.href,p=(i=u==null?void 0:u.target)!==null&&i!==void 0?i:l.target;return u&&f?(window.open(f,p),!0):!1}}})}function aue(t){return new on({key:new On("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=JD(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function Ys(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(rue,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const lue=Mr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qE(t);return}qE(t.scheme,t.optionalSlashes)})},onDestroy(){Qce()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Ys(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ys(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Tt(this.options.HTMLAttributes,t),0]:["a",Tt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ys(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ys(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ks({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=JD(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!Ys(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(iue({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Ys(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(sue({type:this.type})),this.options.linkOnPaste&&t.push(aue({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function cue(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=uU(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,b=l?new RegExp(`${p}${u}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${u}[^\\s${m}]*`,"gm"),v=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!v)return null;const y=a.pos-v.length,x=Array.from(v.matchAll(b)).pop();if(!x||x.input===void 0||x.index===void 0)return null;const C=x.input.slice(Math.max(0,x.index-1),x.index),k=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!k)return null;const T=y+x.index;let S=T+x[0].length;return l&&f.test(v.slice(S-1,S+1))&&(x[0]+=" ",S+=1),T<a.pos&&S>=a.pos?{range:{from:T,to:S},query:x[0].slice(n.length),text:x[0]}:null}const uue=new On("suggestion");function due({pluginKey:t=uue,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:f="is-empty",command:p=()=>null,items:m=()=>[],render:b=()=>({}),allow:v=()=>!0,findSuggestionMatch:y=cue}){let x;const C=b==null?void 0:b(),k=new on({key:t,view(){return{update:async(T,S)=>{var O,R,P,$,F,M,j;const z=(O=this.key)===null||O===void 0?void 0:O.getState(S),L=(R=this.key)===null||R===void 0?void 0:R.getState(T.state),A=z.active&&L.active&&z.range.from!==L.range.from,_=!z.active&&L.active,I=z.active&&!L.active,B=!_&&!I&&z.query!==L.query,W=_||A&&B,K=B||A,U=I||A&&B;if(!W&&!K&&!U)return;const Y=U&&!W?z:L,pe=T.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);x={editor:e,range:Y.range,query:Y.query,text:Y.text,items:[],command:ce=>p({editor:e,range:Y.range,props:ce}),decorationNode:pe,clientRect:pe?()=>{var ce;const{decorationId:le}=(ce=this.key)===null||ce===void 0?void 0:ce.getState(e.state),X=T.dom.querySelector(`[data-decoration-id="${le}"]`);return(X==null?void 0:X.getBoundingClientRect())||null}:null},W&&((P=C==null?void 0:C.onBeforeStart)===null||P===void 0||P.call(C,x)),K&&(($=C==null?void 0:C.onBeforeUpdate)===null||$===void 0||$.call(C,x)),(K||W)&&(x.items=await m({editor:e,query:Y.query})),U&&((F=C==null?void 0:C.onExit)===null||F===void 0||F.call(C,x)),K&&((M=C==null?void 0:C.onUpdate)===null||M===void 0||M.call(C,x)),W&&((j=C==null?void 0:C.onStart)===null||j===void 0||j.call(C,x))},destroy:()=>{var T;x&&((T=C==null?void 0:C.onExit)===null||T===void 0||T.call(C,x))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(T,S,O,R){const{isEditable:P}=e,{composing:$}=e.view,{selection:F}=T,{empty:M,from:j}=F,z={...S};if(z.composing=$,P&&(M||e.view.composing)){(j<S.range.from||j>S.range.to)&&!$&&!S.composing&&(z.active=!1);const L=y({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:F.$from}),A=`id_${Math.floor(Math.random()*4294967295)}`;L&&v({editor:e,state:R,range:L.range,isActive:S.active})?(z.active=!0,z.decorationId=S.decorationId?S.decorationId:A,z.range=L.range,z.query=L.query,z.text=L.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(T,S){var O;const{active:R,range:P}=k.getState(T.state);return R&&((O=C==null?void 0:C.onKeyDown)===null||O===void 0?void 0:O.call(C,{view:T,event:S,range:P}))||!1},decorations(T){const{active:S,range:O,decorationId:R,query:P}=k.getState(T);if(!S)return null;const $=!(P!=null&&P.length),F=[l];return $&&F.push(f),Xt.create(T.doc,[Qn.inline(O.from,O.to,{nodeName:a,class:F.join(" "),"data-decoration-id":R,"data-decoration-content":u})])}}});return k}function fue({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const o=new On;return{editor:t,char:r,pluginKey:o,command:({editor:i,range:s,props:a})=>{var l,u,f;const p=i.view.state.selection.$to.nodeAfter;((l=p==null?void 0:p.text)===null||l===void 0?void 0:l.startsWith(" "))&&(s.to+=1),i.chain().focus().insertContentAt(s,[{type:n,attrs:{...a,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(f=(u=i.view.dom.ownerDocument.defaultView)===null||u===void 0?void 0:u.getSelection())===null||f===void 0||f.collapseToEnd()},allow:({state:i,range:s})=>{const a=i.doc.resolve(s.from),l=i.schema.nodes[n];return!!a.parent.type.contentMatch.matchType(l)},...e}}function XD(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>fue({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function KE(t,e){const n=XD(t),r=n.find(o=>o.char===e);return r||(n.length?n[0]:null)}const pue=rn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!==null&&n!==void 0?n:"@"}${(r=t.attrs.label)!==null&&r!==void 0?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,o;return["span",Tt(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!==null&&r!==void 0?r:"@"}${(o=e.attrs.label)!==null&&o!==void 0?o:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=KE(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Tt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=Tt({"data-type":this.name},this.options.HTMLAttributes,e);const o=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof o=="string"?["span",Tt({"data-type":this.name},this.options.HTMLAttributes,e),o]:o},renderText({node:t}){const e={options:this.options,node:t,suggestion:KE(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:o,anchor:i}=r;if(!o)return!1;e.doc.nodesBetween(i-1,i,(l,u)=>{if(l.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",u,u+l.nodeSize),!1});let s=new Ii,a=0;return e.doc.nodesBetween(i-1,i,(l,u)=>{if(l.type.name===this.name)return n=!0,s=l,a=u,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":s.attrs.mentionSuggestionChar,a,a+s.nodeSize),n})}},addProseMirrorPlugins(){return XD(this).map(due)}}),ZD=gn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new on({key:new On("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,u=!s.isLeaf&&Ph(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=Qn.node(a,a+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),Xt.create(t,o)}}})]}}),hue=Mr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Tt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),mue=rn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Tt(this.options.HTMLAttributes,t),0]}}),gue=rn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Tt(this.options.HTMLAttributes,t),0]}}),yue=rn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Tt(this.options.HTMLAttributes,t),0]}}),bue=/^\s*(\[([( |x])?\])\s$/,vue=rn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Tt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=()=>{var f,p;a.ariaLabel=((p=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||p===void 0?void 0:p.call(f,t,a.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};return u(),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const b=n();if(typeof b!="number")return!1;const v=m.doc.nodeAt(b);return m.setNodeMarkup(b,void 0,{...v==null?void 0:v.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,p])=>{o.setAttribute(f,p)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(e).forEach(([f,p])=>{o.setAttribute(f,p)}),{dom:o,contentDOM:l,update:f=>f.type!==this.type?!1:(o.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[Pl({find:bue,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),xue=rn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Tt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),wue=gn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),QD=J.forwardRef((t,e)=>{const[n,r]=J.useState(0),o=l=>{if(l>=t.items.length)return;const u=t.items[l],f={id:u.id,label:u.mentionLabel};t.command(f)},i=()=>{r((n+t.items.length-1)%t.items.length)},s=()=>{r((n+1)%t.items.length)},a=()=>{o(n)};return J.useEffect(()=>r(0),[t.items]),J.useImperativeHandle(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(i(),!0):l.key==="ArrowDown"?(s(),!0):l.key==="Enter"?(a(),!0):!1})),t.items.length>0?g.jsx(V.Paper,{elevation:5,children:g.jsx(V.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>g.jsx(V.ListItem,{disablePadding:!0,children:g.jsx(V.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});QD.displayName="SuggestionList";const YE={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Cue={items:async({query:t})=>Promise.resolve(["Lea Thompson","Cyndi Lauper","Tom Cruise","Madonna","Jerry Hall","Joan Collins","Winona Ryder","Christina Applegate","Alyssa Milano","Molly Ringwald","Ally Sheedy","Debbie Harry","Olivia Newton-John","Elton John","Michael J. Fox","Axl Rose","Emilio Estevez","Ralph Macchio","Rob Lowe","Jennifer Grey","Mickey Rourke","John Cusack","Matthew Broderick","Justine Bateman","Lisa Bonet","Benicio Monserrate Rafael del Toro Sánchez"].map((e,n)=>({mentionLabel:e,id:n.toString()})).filter(e=>e.mentionLabel.toLowerCase().startsWith(t.toLowerCase())).slice(0,5)),render:()=>{let t,e;return{onStart:n=>{t=new nI(QD,{props:n,editor:n.editor}),e=Ku("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??YE},appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})[0]},onUpdate(n){t==null||t.updateProps(n),e==null||e.setProps({getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??YE}})},onKeyDown(n){return n.event.key==="Escape"?(e==null||e.hide(),!0):t!=null&&t.ref?t.ref.onKeyDown(n):!1},onExit(){e==null||e.destroy(),t==null||t.destroy(),e=void 0,t=void 0}}}},Sue=lue.extend({inclusive:!1}),Tue=hue.extend({excludes:"superscript"}),kue=OI.extend({excludes:"subscript"});function Eue({placeholder:t}={}){return J.useMemo(()=>[pte.configure({resizable:!0}),yue,gue,mue,yR,vR,xR,TR,AR,PR,NR,Tue,kue,jR,gR,mR,bR,DR,EI,$R,Sue.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),JQ,SR,YQ,wue.configure({types:["heading","paragraph","image"]}),Nce,$ce,jce,WZ,BR.configure({multicolor:!0}),IR,dee,wR,xue,vue.configure({nested:!0}),pue.configure({suggestion:Cue}),ZD.configure({placeholder:t}),RR],[t])}function GE(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Oue=t=>{const e=Eue({placeholder:"Add your own content here..."});if(t.renderContentOnly)return g.jsx(TI,{content:t.renderContentOnly,extensions:e});const{name:n,label:r,labelProps:o={fontSize:"0.9em",color:"#808080",fontWeight:"400"},onUploadFiles:i,readOnly:s=!1}=t,[a,l,u]=Ht.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,k,T;(T=(k=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:k.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),b=J.useCallback((C,k)=>{var S;const T=(S=m.current)==null?void 0:S.editor;if(!(!T||!i))if(i instanceof Promise)i(C).then(O=>{t0({images:O,editor:T,position:k})});else{const O=i(C);t0({images:O,editor:T,position:k})}},[]),v=J.useCallback((C,k,T,S)=>{var R;if(!(k instanceof DragEvent)||!k.dataTransfer)return!1;const O=GE(k.dataTransfer.files);if(O.length>0){const P=(R=C.posAtCoords({left:k.clientX,top:k.clientY}))==null?void 0:R.pos;return b(O,P),k.preventDefault(),!0}return!1},[b]),y=J.useCallback((C,k,T)=>{if(!k.clipboardData)return!1;const S=GE(k.clipboardData.files);return S.length>0?(b(S),!0):!1},[b]),x=g.jsx(V.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:g.jsx(SI,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:v,handlePaste:y},renderControls:s?void 0:()=>g.jsx(Ace,{onUploadFiles:i}),onBlur:()=>{var C,k;return f(((k=(C=m.current)==null?void 0:C.editor)==null?void 0:k.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>g.jsxs(g.Fragment,{children:[g.jsx(Pte,{}),g.jsx(Yte,{})]})})});return g.jsxs(V.Box,{display:"flex",flexDirection:"column",children:[r&&g.jsx(V.Typography,{...o,children:r}),x]})},JE=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]);const p={"&:last-child > td":{borderBottom:"unset"}};return i?g.jsx(V.Collapse,{in:n,children:u}):g.jsx(V.TableRow,{sx:p,children:g.jsx(V.TableCell,{sx:{paddingBottom:0,paddingTop:0},colSpan:e,children:g.jsx(V.Collapse,{in:n,children:u})})})},Ox=({isLoading:t,children:e})=>{const[n,r]=J.useState(!1);return J.useEffect(()=>{let o,i;return t?o=setTimeout(()=>r(!0),300):n?i=setTimeout(()=>r(!1),200):(o&&clearTimeout(o),r(!1)),()=>{o&&clearTimeout(o),i&&clearTimeout(i)}},[t,n]),g.jsxs(V.Box,{position:"relative","data-testid":`loading-overlay_${t?"active":"inactive"}`,children:[e,g.jsx(V.Box,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,pointerEvents:n?"auto":"none",opacity:n?1:0,transition:"opacity 0.3s ease"},children:g.jsx(V.CircularProgress,{})})]})},Yo=t=>{const{gap:e=1,alignItems:n="center",...r}=t;return g.jsx(V.Box,{display:"flex",flexDirection:"row",gap:e,alignItems:n,...r})},Iu=t=>{const{gap:e=1,...n}=t;return g.jsx(V.Box,{display:"flex",flexDirection:"column",gap:e,...n})};function eA({icon:t,color:e="inherit",children:n}){return n?g.jsx(V.Tooltip,{title:n,children:g.jsx(V.IconButton,{disableTouchRipple:!0,size:"small",children:g.jsx(t,{"data-testid":"MBv2_table-tooltip",fontSize:"small",sx:{color:e}})})}):null}function tA(t){return g.jsx(eA,{icon:Une,...t})}const Mx=t=>{const{id:e,getRowKey:n=me=>"id"in me&&(typeof me.id=="string"||typeof me.id=="number")&&me.id!=null?me.id:(console.warn(`Table: "id" not found or undefined in ${JSON.stringify(me)}. If provided, id must have a value and be type string or number. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),String(JSON.stringify(me))),columns:r,data:o=[],onRowClick:i,onRowClickObj:s,checkedKeys:a,setCheckedKeys:l,renderExpand:u,sortField:f,sortOrder:p,onSortChange:m,allowSortCols:b,fixedLayout:v=!1,className:y,emptyTableMsg:x="No items to display",errorTableMsg:C,retryCallback:k,isLoading:T=!1,disableMobileCards:S=!1,highlightSelectedRow:O=!1,selectedRowColor:R,selectedRowKey:P,headerRowStyle:$={},stickyHeader:F,reRenderExpand:M=!1,expandOnRowClick:j=!1,tooltipColor:z,...L}=t,{palette:A}=V.useTheme(),_=A.grey[A.mode=="dark"?600:50],[I,B]=J.useState(void 0),[W,K]=J.useState(typeof O=="string"||typeof O=="number"?O:void 0);Mue(t);const U=me=>{me!==f?m&&m(me,"asc"):m&&m(f,p==="asc"?"desc":"asc")},Y=me=>f===me?p:null,pe=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),ce=r.filter(me=>!me.hideCol&&(!pe||!me.hideOnMobile));u&&!pe&&ce.unshift({key:"MBv2_Expandable_Column",fieldName:"id",label:"",render:(me,$e)=>{const Ie=n($e),gt=I===Ie;return g.jsx(V.IconButton,{"data-testid":"expand-collapse-btn","aria-label":gt?"collapse row":"expand row",size:"small",onClick:()=>Z(Ie),children:gt?g.jsx(Bf,{"data-testid":"collapse-up"}):g.jsx(ib,{"data-testid":"expand-down"})})}}),a&&l&&ce.unshift({key:"MBv2_Checkbox_Column",fieldName:"id",label:"",hideOnMobile:!0,render:(me,$e)=>{const Ie=n($e);return g.jsx(V.Checkbox,{onChange:()=>{const gt=a.includes(Ie);l(gt?a.filter(lt=>lt!==Ie):[...a,Ie])},checked:a.includes(Ie)})}});const le=m!==void 0,X=me=>le?b?b.includes(me):!0:!1,oe=g.jsxs(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[g.jsx(qne,{})," ",x]}),fe=g.jsxs(V.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[g.jsx(SM,{color:"error"})," ",C,k&&g.jsx(V.Button,{variant:"text",onClick:k,children:"Retry?"})]}),te=()=>{if(C)return g.jsx(V.TableRow,{children:g.jsx(V.TableCell,{colSpan:r.length,align:"center",sx:{borderBottom:"unset"},children:fe})});if(o.length===0)return g.jsx(V.TableRow,{children:g.jsx(V.TableCell,{colSpan:r.length,align:"center",sx:{borderBottom:"unset"},children:oe})})},re=()=>{if(C)return fe;if(o.length===0)return oe},ue=me=>{O&&K(me)},ge=me=>{const $e=n(me);if((i||s)&&(i==null||i($e),s==null||s(me),ue($e)),u&&j){const Ie=I===$e?void 0:$e;B(Ie),ue(Ie)}},Z=me=>{const $e=I===me?void 0:me;B($e),ue($e)},ee=me=>{if(!u)return;const $e=I===n(me);return g.jsxs(g.Fragment,{children:[g.jsxs(V.Button,{"data-testid":"show-more-less-btn",variant:"text",onClick:()=>Z(n(me)),children:[$e?g.jsx(Bf,{}):g.jsx(ib,{})," Show"," ",$e?"Less":"More"]}),g.jsx(JE,{colSpan:r.length,isExpanded:n(me)===I,obj:me,renderExpand:Ie=>u(Ie),asMobileCard:!0})]})},ie=R??_,Ce=me=>{const Ie=(O?W:P)===n(me)?ie:"inherit",gt=i||s||j;return{cursor:gt?"pointer":"default",backgroundColor:Ie,...u?{"& > td":{borderBottom:"unset"}}:{"&:last-child td":{borderBottom:"unset"}},...gt&&{"&:hover":{backgroundColor:Ie===ie?fse(Ie,.1):ie}}}},Se=me=>g.jsx(tA,{color:z,children:me}),De=(me,$e)=>{const Ie=me.find(lt=>lt.key==="MBv2_Checkbox_Column"),gt=ce.filter(lt=>lt.key!=="MBv2_Checkbox_Column");return g.jsxs(Yo,{alignItems:"flex-start",children:[Ie&&g.jsx(Iu,{children:kl(Ie,$e,pe)}),g.jsxs(Iu,{width:"100%",children:[g.jsx("table",{className:"MBv2_Table_Stack",children:g.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:gt.map(lt=>g.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[g.jsxs("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${wn(lt)}`,style:{textWrap:"nowrap"},children:[lt.label??Fn(wn(lt)),Se(lt.tooltip)]}),g.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${wn(lt)}`,style:{paddingLeft:"10px"},children:kl(lt,$e,pe)})]},`row-${n($e)}-${wn(lt)}`))})}),ee($e)]})]})},Me=()=>g.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:y,"data-testid":"mui-table-mobile",children:[le&&g.jsxs(g.Fragment,{children:[g.jsxs(V.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[g.jsx(V.TextField,{select:!0,sx:{flexGrow:1},size:"small",value:f??"",label:"Sort By...",onChange:me=>U(me.target.value),fullWidth:!0,children:ce.map(me=>{if(X(wn(me)))return g.jsx(V.MenuItem,{value:wn(me),children:me.label??Fn(wn(me))},`rowHeader-${wn(me)}`)})}),g.jsx(V.IconButton,{onClick:()=>{f&&U(f)},children:g.jsx(Qne,{className:`sort-icon-${p}`})})]}),g.jsx(V.Divider,{sx:{margin:"10px 0"}})]}),re()??o.map(me=>g.jsx(V.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",overflowX:"auto",...Ce(me)},onClick:()=>ge(me),"data-testid":`card-${n(me)}`,children:De(ce,me)},n(me)))]}),Re=()=>g.jsx(V.TableContainer,{component:V.Card,"data-testid":"mui-table",...e?{tableId:`table-${e}`}:{},className:y,style:F?{maxHeight:F,overflow:"auto"}:{},children:g.jsxs(V.Table,{stickyHeader:F!=="undefined",style:{tableLayout:v?"fixed":"auto"},className:"MBv2_Table",sx:$?{"& .MuiTableCell-head":{...$}}:{},...L,children:[g.jsx(V.TableHead,{className:"MBv2_Table_Head",children:g.jsx(V.TableRow,{className:"MBv2_Table_Head_Row",children:ce.map((me,$e)=>{const Ie=X(wn(me));return g.jsx(V.TableCell,{width:Array.isArray(v)?v[$e]:"auto",sx:me.tableCellSx??{},children:g.jsx(V.Box,{style:{display:"flex",alignItems:"center"},children:g.jsxs(V.Box,{sx:[Ie&&{"&:hover":{cursor:"pointer",backgroundColor:A.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:Ie?()=>U(wn(me)):void 0,children:[g.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},"data-testid":"column-title",children:me.label??Fn(wn(me))}),Se(me.tooltip),Ie&&Y(wn(me))==="asc"&&g.jsx(Bf,{style:{marginLeft:"5px"}}),Ie&&Y(wn(me))==="desc"&&g.jsx(ib,{style:{marginLeft:"5px"}}),Ie&&Y(wn(me))!=="asc"&&Y(wn(me))!=="desc"&&g.jsx(Xne,{style:{marginLeft:"5px"}})]})})},`rowHeader-${wn(me)}`)})})}),g.jsx(V.TableBody,{className:"MBv2_Table_Body",children:te()??o.map(me=>g.jsxs(J.Fragment,{children:[g.jsx(V.TableRow,{"data-testid":`row-${n(me)}`,className:"MBv2_Table_Body_Row",onClick:()=>ge(me),sx:Ce(me),children:ce.map($e=>g.jsx(V.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${wn($e)}`,children:kl($e,me,pe)},`row-${n(me)}-${wn($e)}`))}),u&&g.jsx(JE,{colSpan:ce.length,isExpanded:n(me)===I,obj:me,renderExpand:$e=>u($e),reRenderExpand:M})]},n(me)))})]})});return g.jsx(Ox,{isLoading:T,children:pe&&!S?Me():Re()})},Mue=t=>{const{fixedLayout:e,checkedKeys:n,setCheckedKeys:r,renderExpand:o,columns:i,expandOnRowClick:s,onRowClick:a,onRowClickObj:l,selectedRowKey:u,highlightSelectedRow:f}=t,p="Table component:";Array.isArray(e)&&(!o&&e.length!==i.length&&console.warn(`${p} Length of "fixedLayout" is not equal to the length of "columns". Got=${e.length}. Expected=${i.length}`),o&&e.length!==i.length+1&&console.warn(`${p} Length of "fixedLayout" is not equal to the length of "columns"+1. Make sure you're including a percentage for the expand/collapse column AND each column in "columns".`)),s&&!o&&console.warn(`${p} renderExpand should be defined when expandOnRowClick is defined`),a&&l&&console.warn(`${p} 'onRowClick' and 'onRowClickObj' are both defined. Only one should be defined.`),(n||r)&&o&&console.warn(`${p} checkedKeys/setCheckedKeys & renderExpand cannot both be defined`),n&&!r&&console.warn(`${p} if checkedKeys is defined, setCheckedKeys must also be defined`),!n&&r&&console.warn(`${p} if setCheckedKeys is defined, checkedKeys must also be defined`);const m=i.map(y=>wn(y)),b=m.filter((y,x)=>m.indexOf(y)!==x),v=[...new Set(b)];v.length>0&&console.warn(`${p} duplicate key/fieldName found in 'columns': ${v.join(", ")}. Make sure to define a unique 'key' if you have multiple column definitions with the same 'fieldName'.`),f&&u&&console.warn(`${p} must choose 'highlightSelectedRow' (uncontrolled) or 'selectedRowKey' (controlled)`)},wn=t=>t.key??t.fieldName,_ue=(t,e)=>e.split(".").reduce((n,r)=>{if(n&&typeof n=="object")return n[r]},t),kl=(t,e,n=!1)=>{const r=_ue(e,t.fieldName);return t.render?t.render(r,e,n):r},nA=t=>{const{paginationState:e,onPageChange:n,onRowsPerPageChange:r,hidePaginationControls:o=!1,rowsPerPageOptions:i=[5,10,25],...s}=t,{pageNo:a,pageSize:l,totalCount:u,sortField:f,sortOrder:p}=e,m=x=>{n(x)},b=x=>{r(parseInt(x.target.value,10))},v=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return g.jsxs(V.Box,{children:[g.jsx(Mx,{sortOrder:p,sortField:f,...s}),!o&&!y&&g.jsx(V.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:v?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(x,C)=>m(C),onRowsPerPageChange:b,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},XE=()=>({height:window.innerHeight,width:window.innerWidth}),rA=()=>{const[t,e]=J.useState(XE());return J.useEffect(()=>{const n=()=>{e(XE())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Tr=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=rA(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return g.jsx(V.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...hr({...t},a)})},Rue=t=>{const{citation:e,anchorEl:n,onDeleteCitation:r,onClose:o}=t;if(r)return g.jsx(V.Popper,{open:e!==null,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&g.jsxs(V.Box,{component:V.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${e.id}`,children:[g.jsxs(V.Typography,{variant:"body2",children:["Are you sure you want to delete this ",e.fileName?"attachment":"citation","?"]}),g.jsxs(V.Box,{display:"flex",flexDirection:"row",children:[g.jsx(Tr,{size:"small",variant:"text",onClick:o,"data-testid":`citation-table_delete-prompt-${e.id}-noBtn`,children:"No"}),g.jsx(Tr,{size:"small",color:"error",startIcon:g.jsx(Zv,{}),onClick:()=>r(e.id).finally(o),"data-testid":`citation-table_delete-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})},Iue=t=>{const{citation:e,anchorEl:n,onClose:r,open:o}=t;return g.jsx(V.Popper,{open:o,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&g.jsxs(V.Box,{component:V.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_launch-link-prompt-${e.id}`,flexDirection:"column",alignItems:"end",children:[g.jsxs(V.Typography,{variant:"body2",sx:{wordBreak:"break-all",maxWidth:"350px"},children:["Are you sure you want to go to ",g.jsx("br",{}),g.jsx("b",{children:e.url}),"?"]}),g.jsxs(V.Box,{display:"flex",flexDirection:"row",children:[g.jsx(Tr,{size:"small",variant:"text",onClick:r,"data-testid":`citation-table_launch-prompt-${e.id}-noBtn`,children:"No"}),g.jsx(Tr,{size:"small",startIcon:g.jsx(ex,{}),onClick:()=>{window.open(e.url,"_blank","noopener,noreferrer"),r()},"data-testid":`citation-table_launch-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})};function T0({canLaunchUrl:t,citation:e,asLink:n}){const r=J.useRef(null),[o,i]=J.useState(!1),s=()=>{i(!1)};return!t||e.fileName?null:g.jsxs(g.Fragment,{children:[n?g.jsx(V.Link,{ref:r,component:"button",sx:{cursor:"pointer"},type:"button",onClick:()=>i(!0),children:e.url}):g.jsx(V.Tooltip,{title:"Open URL",children:g.jsx(V.IconButton,{ref:r,color:"primary",onClick:()=>{i(!0)},"data-testid":`citation-table_launch-link-btn-${e.id}`,sx:{visibility:t!=null&&t(e)?"visible":"hidden"},children:g.jsx(ex,{})})}),g.jsx(Iue,{citation:e,anchorEl:r.current,onClose:s,open:o})]})}function oA({onDownloadAttachment:t,citation:e}){if(!(!t||!e.fileName))return g.jsx(V.Tooltip,{title:"Download",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>t==null?void 0:t(e),"data-testid":`citation-table_download-btn-${e.id}`,children:g.jsx(Hne,{})})})}function iA({onPreviewAttachment:t,citation:e}){if(!t||!e.fileName)return;const n=["pdf","png","jpg","jpeg","gif","bmp","svg","webp","mp3","wav","mp4","webm","html","htm","txt","xml","json","csv"],r=e.fileName.split(".").pop();if(!(!r||!n.includes(r)))return g.jsx(V.Tooltip,{title:"View File",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>t==null?void 0:t(e),"data-testid":`citation-table_view-file-btn-${e.id}`,children:g.jsx(ex,{})})})}const Due=t=>{const{refreshKey:e,title:n,onCancel:r,onNewCitation:o,onNewAttachment:i,onEditCitation:s,onEditAttachment:a,onViewCitation:l,onViewAttachment:u,onDeleteCitation:f,onDownloadAttachment:p,onPreviewAttachment:m,onSelect:b,getCitationsPaginated:v,selectedIds:y,setSelectedIds:x,onError:C=()=>{},condenseTable:k=!1,canSelect:T=!1,canLaunchUrl:S,addlActions:O,readOnly:R=!1,showCloseBtn:P=!1,canSearch:$=!1}=t,F=!!t.canCreate&&!R,M=!!a&&!!s&&!R,j=!!u&&!!l&&R&&k,z=!!f&&!R,{palette:L}=V.useTheme(),[A,_]=J.useState([]),[I,B]=J.useState(!1),[W,K]=J.useState(!0),[U,Y]=J.useState(null),[pe,ce]=J.useState(null),[le,X]=J.useState({pageNo:0,pageSize:k?5:10,totalCount:0,search:$?"":void 0}),oe=()=>{B(!1),K(!0),v({pageNo:le.pageNo,pageSize:le.pageSize,search:le.search},y).then(Re=>(_(Re.data),X(me=>({...me,totalCount:Re.totalCount})),Re)).catch(Re=>{C(Re),B(!0),_([])}).finally(()=>K(!1))};J.useEffect(oe,[le.pageNo,le.pageSize,e,le.search]);const fe=()=>{ce(null),Y(null)},te=g.jsx(Tr,{variant:T?"outlined":"contained",size:T?"small":"medium",onClick:o,startIcon:g.jsx(Kh,{}),children:"Add Citation"}),re=g.jsx(Tr,{variant:T?"outlined":"contained",size:T?"small":"medium",onClick:i,startIcon:g.jsx(LI,{}),children:"Add Attachment"}),ue=Re=>{if(!(!M&&!j)){if(M)return g.jsx(V.Tooltip,{title:"Edit",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>Re.fileName?a(Re.id):s(Re.id),"data-testid":`citation-table_edit-btn-${Re.id}`,children:g.jsx(Wne,{})})});if(j)return g.jsx(V.Tooltip,{title:"View",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>Re.fileName?u(Re.id):l(Re.id),"data-testid":`citation-table_view-btn-${Re.id}`,children:g.jsx(ere,{})})})}},ge=Re=>{if(!(!z||R))return g.jsx(V.Tooltip,{title:"Delete",children:g.jsx(V.IconButton,{color:"error",onClick:me=>{ce(Re),Y(me.currentTarget)},"data-testid":`citation-table_delete-btn-${Re.id}`,children:g.jsx(Zv,{})})})},Z=Re=>g.jsx(T0,{citation:Re,canLaunchUrl:S}),ee=Re=>g.jsx(iA,{citation:Re,onPreviewAttachment:m}),ie=Re=>g.jsx(oA,{citation:Re,onDownloadAttachment:p}),Ce=j||M||z||S||m||p||O,Se=[...sA(L,k),{fieldName:"id",key:"Action",label:"Action",hideCol:!Ce,render:(Re,me)=>g.jsxs(V.Box,{display:"flex",flexDirection:"row-reverse",children:[O==null?void 0:O(me),ge(me),ue(me),ee(me),Z(me),ie(me)]})}],De=J.useCallback(Re=>{X(me=>({...me,pageNo:0,search:Re}))},[]),Me=()=>$?g.jsx(VI,{onSearch:De}):null;return g.jsxs(Iu,{children:[g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(V.Typography,{variant:k?"h6":"h2",children:n}),!T&&F&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",gap:1,children:[te,re]}),P&&g.jsx(V.IconButton,{onClick:r,children:g.jsx(tm,{})})]}),Me(),g.jsx(nA,{"data-testid":"citation-table",size:k?"x-small":"medium",isLoading:W,columns:Se,data:A,paginationState:le,onPageChange:Re=>X(me=>({...me,pageNo:Re})),onRowsPerPageChange:Re=>X(me=>({...me,pageSize:Re,pageNo:0})),errorTableMsg:I?"Failed to load citations.":void 0,retryCallback:oe,setCheckedKeys:T?x:void 0,checkedKeys:T?y:void 0}),T&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[g.jsx(V.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:F&&g.jsxs(g.Fragment,{children:[te,re]})}),!R&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[g.jsx(Tr,{variant:"outlined",size:"small",onClick:r,children:"Cancel"}),g.jsxs(Tr,{variant:"contained",size:"small",onClick:()=>b(y),children:["Select",y.length>0&&` (${y.length})`]})]})]}),g.jsx(Rue,{citation:pe,anchorEl:U,onDeleteCitation:f,onClose:fe})]})},ZE=(t,e)=>{const n=t?Ea.truncate(e,{length:30,omission:"..."}):e,r=n==null?void 0:n.endsWith("...");return g.jsx("span",{style:{wordBreak:"break-all"},children:r?g.jsx(V.Tooltip,{title:e,children:g.jsx("span",{children:n})}):e})},sA=(t,e=!1)=>[{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:(n,r)=>g.jsx(V.Tooltip,{title:n?"Attachment":"URL",children:n?g.jsx(LI,{sx:{color:t.grey[500],marginTop:"4px"},"data-testid":`attachment-icon-${r.id}`}):g.jsx(Kh,{sx:{color:t.grey[500],marginTop:"6px"},"data-testid":`url-icon-${r.id}`})}),ignoreDiff:!0},{fieldName:"title",render:n=>ZE(e,n)},{fieldName:"fileName",key:"URL/File Name",label:"URL/Other Identifier/File Name",render:(n,r)=>ZE(e,n||r.url),isEqual:(n,r)=>n.fileName&&r.fileName?n.fileName===r.fileName:n.url===r.url},{fieldName:"source",hideCol:e},{fieldName:"details",hideCol:e},{fieldName:"accessedAt",hideCol:e,render:(n,r)=>{if(!r.fileName)return(n==null?void 0:n.slice(0,10))??""}},{fieldName:"classification",hideCol:e}];var hb,QE;function Aue(){if(QE)return hb;QE=1;function t(C){this._maxSize=C,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(C){return this._values[C]},t.prototype.set=function(C,k){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=k};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,a=new t(s),l=new t(s),u=new t(s);hb={Cache:t,split:p,normalizePath:f,setter:function(C){var k=f(C);return l.get(C)||l.set(C,function(S,O){for(var R=0,P=k.length,$=S;R<P-1;){var F=k[R];if(F==="__proto__"||F==="constructor"||F==="prototype")return S;$=$[k[R++]]}$[k[R]]=O})},getter:function(C,k){var T=f(C);return u.get(C)||u.set(C,function(O){for(var R=0,P=T.length;R<P;)if(O!=null||!k)O=O[T[R++]];else return;return O})},join:function(C){return C.reduce(function(k,T){return k+(b(T)||n.test(T)?"["+T+"]":(k?".":"")+T)},"")},forEach:function(C,k,T){m(Array.isArray(C)?C:p(C),k,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(k){return k.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,k,T){var S=C.length,O,R,P,$;for(R=0;R<S;R++)O=C[R],O&&(x(O)&&(O='"'+O+'"'),$=b(O),P=!$&&/^\d+$/.test(O),k.call(T,O,$,P,R,C))}function b(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function v(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function x(C){return!b(C)&&(v(C)||y(C))}return hb}var ma=Aue(),mb,eO;function Pue(){if(eO)return mb;eO=1;const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=f=>f.match(t)||[],n=f=>f[0].toUpperCase()+f.slice(1),r=(f,p)=>e(f).join(p).toLowerCase(),o=f=>e(f).reduce((p,m)=>`${p}${p?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return mb={words:e,upperFirst:n,camelCase:o,pascalCase:f=>n(o(f)),snakeCase:f=>r(f,"_"),kebabCase:f=>r(f,"-"),sentenceCase:f=>n(r(f," ")),titleCase:f=>e(f).map(n).join(" ")},mb}var gb=Pue(),kf={exports:{}},tO;function Nue(){if(tO)return kf.exports;tO=1,kf.exports=function(o){return t(e(o),o)},kf.exports.array=t;function t(o,i){var s=o.length,a=new Array(s),l={},u=s,f=n(i),p=r(o);for(i.forEach(function(b){if(!p.has(b[0])||!p.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)l[u]||m(o[u],u,new Set);return a;function m(b,v,y){if(y.has(b)){var x;try{x=", node was:"+JSON.stringify(b)}catch{x=""}throw new Error("Cyclic dependency"+x)}if(!p.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!l[v]){l[v]=!0;var C=f.get(b)||new Set;if(C=Array.from(C),v=C.length){y.add(b);do{var k=C[--v];m(k,p.get(k),y)}while(v);y.delete(b)}a[--s]=b}}}function e(o){for(var i=new Set,s=0,a=o.length;s<a;s++){var l=o[s];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,s=0,a=o.length;s<a;s++){var l=o[s];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,s=0,a=o.length;s<a;s++)i.set(o[s],s);return i}return kf.exports}var $ue=Nue();const jue=er($ue),Lue=Object.prototype.toString,Bue=Error.prototype.toString,Fue=RegExp.prototype.toString,Vue=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",zue=/^Symbol\((.*)\)(.*)$/;function Hue(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function nO(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Hue(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Vue.call(t).replace(zue,"Symbol($1)");const r=Lue.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+Bue.call(t)+"]":r==="RegExp"?Fue.call(t):null}function Ss(t,e){let n=nO(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=nO(this[r],e);return i!==null?i:o},2)}function aA(t){return t==null?[]:[].concat(t)}let lA,cA,uA,Wue=/\$\{\s*(\w+)\s*\}/g;lA=Symbol.toStringTag;class rO{constructor(e,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[lA]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],aA(e).forEach(i=>{if(pr.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}cA=Symbol.hasInstance;uA=Symbol.toStringTag;class pr extends Error{static formatError(e,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof e=="string"?e.replace(Wue,(o,i)=>Ss(n[i])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,r,o,i){const s=new rO(e,n,r,o);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[uA]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,pr)}static[cA](e){return rO[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Vo={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${Ss(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ss(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Ss(n,!0)}\``+o}},wr={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Uue={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},k0={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},que={isValue:"${path} field must be ${value}"},Gf={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Kue={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Yue={notType:t=>{const{path:e,value:n,spec:r}=t,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Ss(n,!0)}\``;if(n.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Ss(n,!0)}\``}return pr.formatError(Vo.notType,t)}};Object.assign(Object.create(null),{mixed:Vo,string:wr,number:Uue,date:k0,object:Gf,array:Kue,boolean:que,tuple:Yue});const _x=t=>t&&t.__isYupSchema__;class ih{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,s=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new ih(e,(a,l)=>{var u;let f=s(...a)?o:i;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,e,n);if(o===void 0||o===e)return e;if(!_x(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Ef={context:"$",value:"."};class Na{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ef.context,this.isValue=this.key[0]===Ef.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Ef.context:this.isValue?Ef.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&ma.getter(this.path,!0),this.map=n.map}getValue(e,n,r){let o=this.isContext?r:this.isValue?e:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Na.prototype.__isYupRef=!0;const la=t=>t==null;function al(t){function e({value:n,path:r="",options:o,originalValue:i,schema:s},a,l){const{name:u,test:f,params:p,message:m,skipAbsent:b}=t;let{parent:v,context:y,abortEarly:x=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;const k={value:n,parent:v,context:y};function T(j={}){const z=dA(Object.assign({value:n,originalValue:i,label:s.spec.label,path:j.path||r,spec:s.spec,disableStackTrace:j.disableStackTrace||C},p,j.params),k),L=new pr(pr.formatError(j.message||m,z),n,z.path,j.type||u,z.disableStackTrace);return L.params=z,L}const S=x?a:l;let O={path:r,parent:v,type:u,from:o.from,createError:T,resolve(j){return fA(j,k)},options:o,originalValue:i,schema:s};const R=j=>{pr.isError(j)?S(j):j?l(null):S(T())},P=j=>{pr.isError(j)?S(j):a(j)};if(b&&la(n))return R(!0);let F;try{var M;if(F=f.call(O,n,O),typeof((M=F)==null?void 0:M.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${O.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(F).then(R,P)}}catch(j){P(j);return}R(F)}return e.OPTIONS=t,e}function dA(t,e){if(!t)return t;for(const n of Object.keys(t))t[n]=fA(t[n],e);return t}function fA(t,e){return Na.isRef(t)?t.getValue(e.value,e.parent,e.context):t}function Gue(t,e,n,r=n){let o,i,s;return e?(ma.forEach(e,(a,l,u)=>{let f=l?a.slice(1,a.length-1):a;t=t.resolve({context:r,parent:o,value:n});let p=t.type==="tuple",m=u?parseInt(f,10):0;if(t.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);o=n,n=n&&n[m],t=p?t.spec.types[m]:t.innerType}if(!u){if(!t.fields||!t.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=n,n=n&&n[f],t=t.fields[f]}i=f,s=l?"["+a+"]":"."+a}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}class sh extends Set{describe(){const e=[];for(const n of this.values())e.push(Na.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const r of this.values())n.push(e(r));return n}clone(){return new sh(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function yl(t,e=new Map){if(_x(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let r=0;r<t.length;r++)n[r]=yl(t[r],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[r,o]of t.entries())n.set(r,yl(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(yl(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=yl(o,e)}else throw Error(`Unable to clone ${t}`);return n}function Jue(t){if(!(t!=null&&t.length))return;const e=[];let n="",r=!1,o=!1;for(let i=0;i<t.length;i++){const s=t[i];if(s==="["&&!o){n&&(e.push(...n.split(".").filter(Boolean)),n=""),r=!0;continue}if(s==="]"&&!o){n&&(/^\d+$/.test(n)?e.push(n):e.push(n.replace(/^"|"$/g,"")),n=""),r=!1;continue}if(s==='"'){o=!o;continue}if(s==="."&&!r&&!o){n&&(e.push(n),n="");continue}n+=s}return n&&e.push(...n.split(".").filter(Boolean)),e}function Xue(t,e){const n=e?`${e}.${t.path}`:t.path;return t.errors.map(r=>({message:r,path:Jue(n)}))}function pA(t,e){var n;if(!((n=t.inner)!=null&&n.length)&&t.errors.length)return Xue(t,e);const r=e?`${e}.${t.path}`:t.path;return t.inner.flatMap(o=>pA(o,r))}class ni{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new sh,this._blacklist=new sh,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Vo.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=yl(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=n,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,r=e.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,r,o,i;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,n={}){let r=this.resolve(Object.assign({},n,{value:e})),o=n.assert==="ignore-optionality",i=r._cast(e,n);if(n.assert!==!1&&!r.isType(i)){if(o&&la(i))return i;let s=Ss(e),a=Ss(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
404
|
+
3. "-" cannot repeat`);Ut.customSchemes.push([t,e])}function eue(){Ut.scanner=qce(Ut.customSchemes);for(let t=0;t<Ut.tokenQueue.length;t++)Ut.tokenQueue[t][1]({scanner:Ut.scanner});Ut.parser=Gce(Ut.scanner.tokens);for(let t=0;t<Ut.pluginQueue.length;t++)Ut.pluginQueue[t][1]({scanner:Ut.scanner,parser:Ut.parser});return Ut.initialized=!0,Ut}function kx(t){return Ut.initialized||eue(),Jce(Ut.parser.start,t,YD(Ut.scanner.start,t))}kx.scan=YD;function JD(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Tx(n),o=kx(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}const Ex="[\0- -\u2029 ]",tue=new RegExp(Ex),nue=new RegExp(`${Ex}$`),rue=new RegExp(Ex,"g");function oue(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function iue(t){return new on({key:new On("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=e.some(u=>u.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=S7(n.doc,[...e]);if(_7(a).forEach(({newRange:u})=>{const f=k7(r.doc,u,b=>b.isTextblock);let p,m;if(f.length>1)p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(f.length){const b=r.doc.textBetween(u.from,u.to," "," ");if(!nue.test(b))return;p=f[0],m=r.doc.textBetween(p.pos,u.to,void 0," ")}if(p&&m){const b=m.split(tue).filter(Boolean);if(b.length<=0)return!1;const v=b[b.length-1],y=p.pos+m.lastIndexOf(v);if(!v)return!1;const x=kx(v).map(C=>C.toObject(t.defaultProtocol));if(!oue(x))return!1;x.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>t.validate(C.value)).filter(C=>t.shouldAutoLink(C.value)).forEach(C=>{av(C.from,C.to,r.doc).some(k=>k.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function sue(t){return new on({key:new On("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(m=>m.nodeName==="A"))return!1;const l=sv(e.state,t.type.name),u=r.target,f=(o=u==null?void 0:u.href)!==null&&o!==void 0?o:l.href,p=(i=u==null?void 0:u.target)!==null&&i!==void 0?i:l.target;return u&&f?(window.open(f,p),!0):!1}}})}function aue(t){return new on({key:new On("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=JD(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function Ys(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(rue,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const lue=Mr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qE(t);return}qE(t.scheme,t.optionalSlashes)})},onDestroy(){Qce()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Ys(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ys(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Tt(this.options.HTMLAttributes,t),0]:["a",Tt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ys(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ys(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ks({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=JD(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!Ys(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(iue({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Ys(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(sue({type:this.type})),this.options.linkOnPaste&&t.push(aue({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function cue(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=uU(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,b=l?new RegExp(`${p}${u}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${u}[^\\s${m}]*`,"gm"),v=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!v)return null;const y=a.pos-v.length,x=Array.from(v.matchAll(b)).pop();if(!x||x.input===void 0||x.index===void 0)return null;const C=x.input.slice(Math.max(0,x.index-1),x.index),k=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!k)return null;const T=y+x.index;let S=T+x[0].length;return l&&f.test(v.slice(S-1,S+1))&&(x[0]+=" ",S+=1),T<a.pos&&S>=a.pos?{range:{from:T,to:S},query:x[0].slice(n.length),text:x[0]}:null}const uue=new On("suggestion");function due({pluginKey:t=uue,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:f="is-empty",command:p=()=>null,items:m=()=>[],render:b=()=>({}),allow:v=()=>!0,findSuggestionMatch:y=cue}){let x;const C=b==null?void 0:b(),k=new on({key:t,view(){return{update:async(T,S)=>{var O,R,P,$,F,M,j;const z=(O=this.key)===null||O===void 0?void 0:O.getState(S),L=(R=this.key)===null||R===void 0?void 0:R.getState(T.state),A=z.active&&L.active&&z.range.from!==L.range.from,_=!z.active&&L.active,I=z.active&&!L.active,B=!_&&!I&&z.query!==L.query,W=_||A&&B,K=B||A,U=I||A&&B;if(!W&&!K&&!U)return;const Y=U&&!W?z:L,pe=T.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);x={editor:e,range:Y.range,query:Y.query,text:Y.text,items:[],command:ce=>p({editor:e,range:Y.range,props:ce}),decorationNode:pe,clientRect:pe?()=>{var ce;const{decorationId:le}=(ce=this.key)===null||ce===void 0?void 0:ce.getState(e.state),X=T.dom.querySelector(`[data-decoration-id="${le}"]`);return(X==null?void 0:X.getBoundingClientRect())||null}:null},W&&((P=C==null?void 0:C.onBeforeStart)===null||P===void 0||P.call(C,x)),K&&(($=C==null?void 0:C.onBeforeUpdate)===null||$===void 0||$.call(C,x)),(K||W)&&(x.items=await m({editor:e,query:Y.query})),U&&((F=C==null?void 0:C.onExit)===null||F===void 0||F.call(C,x)),K&&((M=C==null?void 0:C.onUpdate)===null||M===void 0||M.call(C,x)),W&&((j=C==null?void 0:C.onStart)===null||j===void 0||j.call(C,x))},destroy:()=>{var T;x&&((T=C==null?void 0:C.onExit)===null||T===void 0||T.call(C,x))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(T,S,O,R){const{isEditable:P}=e,{composing:$}=e.view,{selection:F}=T,{empty:M,from:j}=F,z={...S};if(z.composing=$,P&&(M||e.view.composing)){(j<S.range.from||j>S.range.to)&&!$&&!S.composing&&(z.active=!1);const L=y({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:F.$from}),A=`id_${Math.floor(Math.random()*4294967295)}`;L&&v({editor:e,state:R,range:L.range,isActive:S.active})?(z.active=!0,z.decorationId=S.decorationId?S.decorationId:A,z.range=L.range,z.query=L.query,z.text=L.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(T,S){var O;const{active:R,range:P}=k.getState(T.state);return R&&((O=C==null?void 0:C.onKeyDown)===null||O===void 0?void 0:O.call(C,{view:T,event:S,range:P}))||!1},decorations(T){const{active:S,range:O,decorationId:R,query:P}=k.getState(T);if(!S)return null;const $=!(P!=null&&P.length),F=[l];return $&&F.push(f),Xt.create(T.doc,[Qn.inline(O.from,O.to,{nodeName:a,class:F.join(" "),"data-decoration-id":R,"data-decoration-content":u})])}}});return k}function fue({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const o=new On;return{editor:t,char:r,pluginKey:o,command:({editor:i,range:s,props:a})=>{var l,u,f;const p=i.view.state.selection.$to.nodeAfter;((l=p==null?void 0:p.text)===null||l===void 0?void 0:l.startsWith(" "))&&(s.to+=1),i.chain().focus().insertContentAt(s,[{type:n,attrs:{...a,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(f=(u=i.view.dom.ownerDocument.defaultView)===null||u===void 0?void 0:u.getSelection())===null||f===void 0||f.collapseToEnd()},allow:({state:i,range:s})=>{const a=i.doc.resolve(s.from),l=i.schema.nodes[n];return!!a.parent.type.contentMatch.matchType(l)},...e}}function XD(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>fue({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function KE(t,e){const n=XD(t),r=n.find(o=>o.char===e);return r||(n.length?n[0]:null)}const pue=rn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!==null&&n!==void 0?n:"@"}${(r=t.attrs.label)!==null&&r!==void 0?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,o;return["span",Tt(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!==null&&r!==void 0?r:"@"}${(o=e.attrs.label)!==null&&o!==void 0?o:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=KE(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Tt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=Tt({"data-type":this.name},this.options.HTMLAttributes,e);const o=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof o=="string"?["span",Tt({"data-type":this.name},this.options.HTMLAttributes,e),o]:o},renderText({node:t}){const e={options:this.options,node:t,suggestion:KE(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:o,anchor:i}=r;if(!o)return!1;e.doc.nodesBetween(i-1,i,(l,u)=>{if(l.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",u,u+l.nodeSize),!1});let s=new Ii,a=0;return e.doc.nodesBetween(i-1,i,(l,u)=>{if(l.type.name===this.name)return n=!0,s=l,a=u,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":s.attrs.mentionSuggestionChar,a,a+s.nodeSize),n})}},addProseMirrorPlugins(){return XD(this).map(due)}}),ZD=gn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new on({key:new On("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,u=!s.isLeaf&&Ph(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=Qn.node(a,a+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),Xt.create(t,o)}}})]}}),hue=Mr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Tt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),mue=rn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Tt(this.options.HTMLAttributes,t),0]}}),gue=rn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Tt(this.options.HTMLAttributes,t),0]}}),yue=rn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Tt(this.options.HTMLAttributes,t),0]}}),bue=/^\s*(\[([( |x])?\])\s$/,vue=rn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Tt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=()=>{var f,p;a.ariaLabel=((p=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||p===void 0?void 0:p.call(f,t,a.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};return u(),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const b=n();if(typeof b!="number")return!1;const v=m.doc.nodeAt(b);return m.setNodeMarkup(b,void 0,{...v==null?void 0:v.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,p])=>{o.setAttribute(f,p)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(e).forEach(([f,p])=>{o.setAttribute(f,p)}),{dom:o,contentDOM:l,update:f=>f.type!==this.type?!1:(o.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[Pl({find:bue,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),xue=rn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Tt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),wue=gn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),QD=J.forwardRef((t,e)=>{const[n,r]=J.useState(0),o=l=>{if(l>=t.items.length)return;const u=t.items[l],f={id:u.id,label:u.mentionLabel};t.command(f)},i=()=>{r((n+t.items.length-1)%t.items.length)},s=()=>{r((n+1)%t.items.length)},a=()=>{o(n)};return J.useEffect(()=>r(0),[t.items]),J.useImperativeHandle(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(i(),!0):l.key==="ArrowDown"?(s(),!0):l.key==="Enter"?(a(),!0):!1})),t.items.length>0?g.jsx(V.Paper,{elevation:5,children:g.jsx(V.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>g.jsx(V.ListItem,{disablePadding:!0,children:g.jsx(V.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});QD.displayName="SuggestionList";const YE={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Cue={items:async({query:t})=>Promise.resolve(["Lea Thompson","Cyndi Lauper","Tom Cruise","Madonna","Jerry Hall","Joan Collins","Winona Ryder","Christina Applegate","Alyssa Milano","Molly Ringwald","Ally Sheedy","Debbie Harry","Olivia Newton-John","Elton John","Michael J. Fox","Axl Rose","Emilio Estevez","Ralph Macchio","Rob Lowe","Jennifer Grey","Mickey Rourke","John Cusack","Matthew Broderick","Justine Bateman","Lisa Bonet","Benicio Monserrate Rafael del Toro Sánchez"].map((e,n)=>({mentionLabel:e,id:n.toString()})).filter(e=>e.mentionLabel.toLowerCase().startsWith(t.toLowerCase())).slice(0,5)),render:()=>{let t,e;return{onStart:n=>{t=new nI(QD,{props:n,editor:n.editor}),e=Ku("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??YE},appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})[0]},onUpdate(n){t==null||t.updateProps(n),e==null||e.setProps({getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??YE}})},onKeyDown(n){return n.event.key==="Escape"?(e==null||e.hide(),!0):t!=null&&t.ref?t.ref.onKeyDown(n):!1},onExit(){e==null||e.destroy(),t==null||t.destroy(),e=void 0,t=void 0}}}},Sue=lue.extend({inclusive:!1}),Tue=hue.extend({excludes:"superscript"}),kue=OI.extend({excludes:"subscript"});function Eue({placeholder:t}={}){return J.useMemo(()=>[pte.configure({resizable:!0}),yue,gue,mue,yR,vR,xR,TR,AR,PR,NR,Tue,kue,jR,gR,mR,bR,DR,EI,$R,Sue.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),JQ,SR,YQ,wue.configure({types:["heading","paragraph","image"]}),Nce,$ce,jce,WZ,BR.configure({multicolor:!0}),IR,dee,wR,xue,vue.configure({nested:!0}),pue.configure({suggestion:Cue}),ZD.configure({placeholder:t}),RR],[t])}function GE(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Oue=t=>{const e=Eue({placeholder:"Add your own content here..."});if(t.renderContentOnly)return g.jsx(TI,{content:t.renderContentOnly,extensions:e});const{name:n,label:r,labelProps:o={fontSize:"0.9em",color:"#808080",fontWeight:"400"},onUploadFiles:i,readOnly:s=!1}=t,[a,l,u]=Ht.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,k,T;(T=(k=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:k.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),b=J.useCallback((C,k)=>{var S;const T=(S=m.current)==null?void 0:S.editor;if(!(!T||!i))if(i instanceof Promise)i(C).then(O=>{t0({images:O,editor:T,position:k})});else{const O=i(C);t0({images:O,editor:T,position:k})}},[]),v=J.useCallback((C,k,T,S)=>{var R;if(!(k instanceof DragEvent)||!k.dataTransfer)return!1;const O=GE(k.dataTransfer.files);if(O.length>0){const P=(R=C.posAtCoords({left:k.clientX,top:k.clientY}))==null?void 0:R.pos;return b(O,P),k.preventDefault(),!0}return!1},[b]),y=J.useCallback((C,k,T)=>{if(!k.clipboardData)return!1;const S=GE(k.clipboardData.files);return S.length>0?(b(S),!0):!1},[b]),x=g.jsx(V.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:g.jsx(SI,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:v,handlePaste:y},renderControls:s?void 0:()=>g.jsx(Ace,{onUploadFiles:i}),onBlur:()=>{var C,k;return f(((k=(C=m.current)==null?void 0:C.editor)==null?void 0:k.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>g.jsxs(g.Fragment,{children:[g.jsx(Pte,{}),g.jsx(Yte,{})]})})});return g.jsxs(V.Box,{display:"flex",flexDirection:"column",children:[r&&g.jsx(V.Typography,{...o,children:r}),x]})},JE=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]);const p={"&:last-child > td":{borderBottom:"unset"}};return i?g.jsx(V.Collapse,{in:n,children:u}):g.jsx(V.TableRow,{sx:p,children:g.jsx(V.TableCell,{sx:{paddingBottom:0,paddingTop:0},colSpan:e,children:g.jsx(V.Collapse,{in:n,children:u})})})},Ox=({isLoading:t,children:e})=>{const[n,r]=J.useState(!1);return J.useEffect(()=>{let o,i;return t?o=setTimeout(()=>r(!0),300):n?i=setTimeout(()=>r(!1),200):(o&&clearTimeout(o),r(!1)),()=>{o&&clearTimeout(o),i&&clearTimeout(i)}},[t,n]),g.jsxs(V.Box,{position:"relative","data-testid":`loading-overlay_${t?"active":"inactive"}`,children:[e,g.jsx(V.Box,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,pointerEvents:n?"auto":"none",opacity:n?1:0,transition:"opacity 0.3s ease"},children:g.jsx(V.CircularProgress,{})})]})},Yo=t=>{const{gap:e=1,alignItems:n="center",...r}=t;return g.jsx(V.Box,{display:"flex",flexDirection:"row",gap:e,alignItems:n,...r})},Iu=t=>{const{gap:e=1,...n}=t;return g.jsx(V.Box,{display:"flex",flexDirection:"column",gap:e,...n})};function eA({icon:t,children:e,sx:n,...r}){return e?g.jsx(V.Tooltip,{title:e,children:g.jsx(t,{"data-testid":"MBv2_table-tooltip",fontSize:"small",sx:n??{ml:.5},...r})}):null}function tA(t){return g.jsx(eA,{icon:Une,...t})}const Mx=t=>{const{id:e,getRowKey:n=me=>"id"in me&&(typeof me.id=="string"||typeof me.id=="number")&&me.id!=null?me.id:(console.warn(`Table: "id" not found or undefined in ${JSON.stringify(me)}. If provided, id must have a value and be type string or number. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),String(JSON.stringify(me))),columns:r,data:o=[],onRowClick:i,onRowClickObj:s,checkedKeys:a,setCheckedKeys:l,renderExpand:u,sortField:f,sortOrder:p,onSortChange:m,allowSortCols:b,fixedLayout:v=!1,className:y,emptyTableMsg:x="No items to display",errorTableMsg:C,retryCallback:k,isLoading:T=!1,disableMobileCards:S=!1,highlightSelectedRow:O=!1,selectedRowColor:R,selectedRowKey:P,headerRowStyle:$={},stickyHeader:F,reRenderExpand:M=!1,expandOnRowClick:j=!1,tooltipProps:z={},...L}=t,{palette:A}=V.useTheme(),_=A.grey[A.mode=="dark"?600:50],[I,B]=J.useState(void 0),[W,K]=J.useState(typeof O=="string"||typeof O=="number"?O:void 0);Mue(t);const U=me=>{me!==f?m&&m(me,"asc"):m&&m(f,p==="asc"?"desc":"asc")},Y=me=>f===me?p:null,pe=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),ce=r.filter(me=>!me.hideCol&&(!pe||!me.hideOnMobile));u&&!pe&&ce.unshift({key:"MBv2_Expandable_Column",fieldName:"id",label:"",render:(me,$e)=>{const Ie=n($e),gt=I===Ie;return g.jsx(V.IconButton,{"data-testid":"expand-collapse-btn","aria-label":gt?"collapse row":"expand row",size:"small",onClick:()=>Z(Ie),children:gt?g.jsx(Bf,{"data-testid":"collapse-up"}):g.jsx(ib,{"data-testid":"expand-down"})})}}),a&&l&&ce.unshift({key:"MBv2_Checkbox_Column",fieldName:"id",label:"",hideOnMobile:!0,render:(me,$e)=>{const Ie=n($e);return g.jsx(V.Checkbox,{onChange:()=>{const gt=a.includes(Ie);l(gt?a.filter(lt=>lt!==Ie):[...a,Ie])},checked:a.includes(Ie)})}});const le=m!==void 0,X=me=>le?b?b.includes(me):!0:!1,oe=g.jsxs(V.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[g.jsx(qne,{})," ",x]}),fe=g.jsxs(V.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[g.jsx(SM,{color:"error"})," ",C,k&&g.jsx(V.Button,{variant:"text",onClick:k,children:"Retry?"})]}),te=()=>{if(C)return g.jsx(V.TableRow,{children:g.jsx(V.TableCell,{colSpan:r.length,align:"center",sx:{borderBottom:"unset"},children:fe})});if(o.length===0)return g.jsx(V.TableRow,{children:g.jsx(V.TableCell,{colSpan:r.length,align:"center",sx:{borderBottom:"unset"},children:oe})})},re=()=>{if(C)return fe;if(o.length===0)return oe},ue=me=>{O&&K(me)},ge=me=>{const $e=n(me);if((i||s)&&(i==null||i($e),s==null||s(me),ue($e)),u&&j){const Ie=I===$e?void 0:$e;B(Ie),ue(Ie)}},Z=me=>{const $e=I===me?void 0:me;B($e),ue($e)},ee=me=>{if(!u)return;const $e=I===n(me);return g.jsxs(g.Fragment,{children:[g.jsxs(V.Button,{"data-testid":"show-more-less-btn",variant:"text",onClick:()=>Z(n(me)),children:[$e?g.jsx(Bf,{}):g.jsx(ib,{})," Show"," ",$e?"Less":"More"]}),g.jsx(JE,{colSpan:r.length,isExpanded:n(me)===I,obj:me,renderExpand:Ie=>u(Ie),asMobileCard:!0})]})},ie=R??_,Ce=me=>{const Ie=(O?W:P)===n(me)?ie:"inherit",gt=i||s||j;return{cursor:gt?"pointer":"default",backgroundColor:Ie,...u?{"& > td":{borderBottom:"unset"}}:{"&:last-child td":{borderBottom:"unset"}},...gt&&{"&:hover":{backgroundColor:Ie===ie?fse(Ie,.1):ie}}}},Se=me=>g.jsx(tA,{...z,children:me}),De=(me,$e)=>{const Ie=me.find(lt=>lt.key==="MBv2_Checkbox_Column"),gt=ce.filter(lt=>lt.key!=="MBv2_Checkbox_Column");return g.jsxs(Yo,{alignItems:"flex-start",children:[Ie&&g.jsx(Iu,{children:kl(Ie,$e,pe)}),g.jsxs(Iu,{width:"100%",children:[g.jsx("table",{className:"MBv2_Table_Stack",children:g.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:gt.map(lt=>g.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[g.jsxs("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${wn(lt)}`,style:{textWrap:"nowrap"},children:[lt.label??Fn(wn(lt)),Se(lt.tooltip)]}),g.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${wn(lt)}`,style:{paddingLeft:"10px"},children:kl(lt,$e,pe)})]},`row-${n($e)}-${wn(lt)}`))})}),ee($e)]})]})},Me=()=>g.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:y,"data-testid":"mui-table-mobile",children:[le&&g.jsxs(g.Fragment,{children:[g.jsxs(V.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[g.jsx(V.TextField,{select:!0,sx:{flexGrow:1},size:"small",value:f??"",label:"Sort By...",onChange:me=>U(me.target.value),fullWidth:!0,children:ce.map(me=>{if(X(wn(me)))return g.jsx(V.MenuItem,{value:wn(me),children:me.label??Fn(wn(me))},`rowHeader-${wn(me)}`)})}),g.jsx(V.IconButton,{onClick:()=>{f&&U(f)},children:g.jsx(Qne,{className:`sort-icon-${p}`})})]}),g.jsx(V.Divider,{sx:{margin:"10px 0"}})]}),re()??o.map(me=>g.jsx(V.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",overflowX:"auto",...Ce(me)},onClick:()=>ge(me),"data-testid":`card-${n(me)}`,children:De(ce,me)},n(me)))]}),Re=()=>g.jsx(V.TableContainer,{component:V.Card,"data-testid":"mui-table",...e?{tableId:`table-${e}`}:{},className:y,style:F?{maxHeight:F,overflow:"auto"}:{},children:g.jsxs(V.Table,{stickyHeader:F!=="undefined",style:{tableLayout:v?"fixed":"auto"},className:"MBv2_Table",sx:$?{"& .MuiTableCell-head":{...$}}:{},...L,children:[g.jsx(V.TableHead,{className:"MBv2_Table_Head",children:g.jsx(V.TableRow,{className:"MBv2_Table_Head_Row",children:ce.map((me,$e)=>{const Ie=X(wn(me));return g.jsx(V.TableCell,{width:Array.isArray(v)?v[$e]:"auto",sx:me.tableCellSx??{},children:g.jsx(V.Box,{style:{display:"flex",alignItems:"center"},children:g.jsxs(V.Box,{sx:[Ie&&{"&:hover":{cursor:"pointer",backgroundColor:A.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:Ie?()=>U(wn(me)):void 0,children:[g.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},"data-testid":"column-title",children:me.label??Fn(wn(me))}),Se(me.tooltip),Ie&&Y(wn(me))==="asc"&&g.jsx(Bf,{style:{marginLeft:"5px"}}),Ie&&Y(wn(me))==="desc"&&g.jsx(ib,{style:{marginLeft:"5px"}}),Ie&&Y(wn(me))!=="asc"&&Y(wn(me))!=="desc"&&g.jsx(Xne,{style:{marginLeft:"5px"}})]})})},`rowHeader-${wn(me)}`)})})}),g.jsx(V.TableBody,{className:"MBv2_Table_Body",children:te()??o.map(me=>g.jsxs(J.Fragment,{children:[g.jsx(V.TableRow,{"data-testid":`row-${n(me)}`,className:"MBv2_Table_Body_Row",onClick:()=>ge(me),sx:Ce(me),children:ce.map($e=>g.jsx(V.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${wn($e)}`,children:kl($e,me,pe)},`row-${n(me)}-${wn($e)}`))}),u&&g.jsx(JE,{colSpan:ce.length,isExpanded:n(me)===I,obj:me,renderExpand:$e=>u($e),reRenderExpand:M})]},n(me)))})]})});return g.jsx(Ox,{isLoading:T,children:pe&&!S?Me():Re()})},Mue=t=>{const{fixedLayout:e,checkedKeys:n,setCheckedKeys:r,renderExpand:o,columns:i,expandOnRowClick:s,onRowClick:a,onRowClickObj:l,selectedRowKey:u,highlightSelectedRow:f}=t,p="Table component:";Array.isArray(e)&&(!o&&e.length!==i.length&&console.warn(`${p} Length of "fixedLayout" is not equal to the length of "columns". Got=${e.length}. Expected=${i.length}`),o&&e.length!==i.length+1&&console.warn(`${p} Length of "fixedLayout" is not equal to the length of "columns"+1. Make sure you're including a percentage for the expand/collapse column AND each column in "columns".`)),s&&!o&&console.warn(`${p} renderExpand should be defined when expandOnRowClick is defined`),a&&l&&console.warn(`${p} 'onRowClick' and 'onRowClickObj' are both defined. Only one should be defined.`),(n||r)&&o&&console.warn(`${p} checkedKeys/setCheckedKeys & renderExpand cannot both be defined`),n&&!r&&console.warn(`${p} if checkedKeys is defined, setCheckedKeys must also be defined`),!n&&r&&console.warn(`${p} if setCheckedKeys is defined, checkedKeys must also be defined`);const m=i.map(y=>wn(y)),b=m.filter((y,x)=>m.indexOf(y)!==x),v=[...new Set(b)];v.length>0&&console.warn(`${p} duplicate key/fieldName found in 'columns': ${v.join(", ")}. Make sure to define a unique 'key' if you have multiple column definitions with the same 'fieldName'.`),f&&u&&console.warn(`${p} must choose 'highlightSelectedRow' (uncontrolled) or 'selectedRowKey' (controlled)`)},wn=t=>t.key??t.fieldName,_ue=(t,e)=>e.split(".").reduce((n,r)=>{if(n&&typeof n=="object")return n[r]},t),kl=(t,e,n=!1)=>{const r=_ue(e,t.fieldName);return t.render?t.render(r,e,n):r},nA=t=>{const{paginationState:e,onPageChange:n,onRowsPerPageChange:r,hidePaginationControls:o=!1,rowsPerPageOptions:i=[5,10,25],...s}=t,{pageNo:a,pageSize:l,totalCount:u,sortField:f,sortOrder:p}=e,m=x=>{n(x)},b=x=>{r(parseInt(x.target.value,10))},v=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return g.jsxs(V.Box,{children:[g.jsx(Mx,{sortOrder:p,sortField:f,...s}),!o&&!y&&g.jsx(V.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:v?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(x,C)=>m(C),onRowsPerPageChange:b,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},XE=()=>({height:window.innerHeight,width:window.innerWidth}),rA=()=>{const[t,e]=J.useState(XE());return J.useEffect(()=>{const n=()=>{e(XE())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Tr=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=rA(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return g.jsx(V.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...hr({...t},a)})},Rue=t=>{const{citation:e,anchorEl:n,onDeleteCitation:r,onClose:o}=t;if(r)return g.jsx(V.Popper,{open:e!==null,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&g.jsxs(V.Box,{component:V.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${e.id}`,children:[g.jsxs(V.Typography,{variant:"body2",children:["Are you sure you want to delete this ",e.fileName?"attachment":"citation","?"]}),g.jsxs(V.Box,{display:"flex",flexDirection:"row",children:[g.jsx(Tr,{size:"small",variant:"text",onClick:o,"data-testid":`citation-table_delete-prompt-${e.id}-noBtn`,children:"No"}),g.jsx(Tr,{size:"small",color:"error",startIcon:g.jsx(Zv,{}),onClick:()=>r(e.id).finally(o),"data-testid":`citation-table_delete-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})},Iue=t=>{const{citation:e,anchorEl:n,onClose:r,open:o}=t;return g.jsx(V.Popper,{open:o,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&g.jsxs(V.Box,{component:V.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_launch-link-prompt-${e.id}`,flexDirection:"column",alignItems:"end",children:[g.jsxs(V.Typography,{variant:"body2",sx:{wordBreak:"break-all",maxWidth:"350px"},children:["Are you sure you want to go to ",g.jsx("br",{}),g.jsx("b",{children:e.url}),"?"]}),g.jsxs(V.Box,{display:"flex",flexDirection:"row",children:[g.jsx(Tr,{size:"small",variant:"text",onClick:r,"data-testid":`citation-table_launch-prompt-${e.id}-noBtn`,children:"No"}),g.jsx(Tr,{size:"small",startIcon:g.jsx(ex,{}),onClick:()=>{window.open(e.url,"_blank","noopener,noreferrer"),r()},"data-testid":`citation-table_launch-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})};function T0({canLaunchUrl:t,citation:e,asLink:n}){const r=J.useRef(null),[o,i]=J.useState(!1),s=()=>{i(!1)};return!t||e.fileName?null:g.jsxs(g.Fragment,{children:[n?g.jsx(V.Link,{ref:r,component:"button",sx:{cursor:"pointer"},type:"button",onClick:()=>i(!0),children:e.url}):g.jsx(V.Tooltip,{title:"Open URL",children:g.jsx(V.IconButton,{ref:r,color:"primary",onClick:()=>{i(!0)},"data-testid":`citation-table_launch-link-btn-${e.id}`,sx:{visibility:t!=null&&t(e)?"visible":"hidden"},children:g.jsx(ex,{})})}),g.jsx(Iue,{citation:e,anchorEl:r.current,onClose:s,open:o})]})}function oA({onDownloadAttachment:t,citation:e}){if(!(!t||!e.fileName))return g.jsx(V.Tooltip,{title:"Download",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>t==null?void 0:t(e),"data-testid":`citation-table_download-btn-${e.id}`,children:g.jsx(Hne,{})})})}function iA({onPreviewAttachment:t,citation:e}){if(!t||!e.fileName)return;const n=["pdf","png","jpg","jpeg","gif","bmp","svg","webp","mp3","wav","mp4","webm","html","htm","txt","xml","json","csv"],r=e.fileName.split(".").pop();if(!(!r||!n.includes(r)))return g.jsx(V.Tooltip,{title:"View File",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>t==null?void 0:t(e),"data-testid":`citation-table_view-file-btn-${e.id}`,children:g.jsx(ex,{})})})}const Due=t=>{const{refreshKey:e,title:n,onCancel:r,onNewCitation:o,onNewAttachment:i,onEditCitation:s,onEditAttachment:a,onViewCitation:l,onViewAttachment:u,onDeleteCitation:f,onDownloadAttachment:p,onPreviewAttachment:m,onSelect:b,getCitationsPaginated:v,selectedIds:y,setSelectedIds:x,onError:C=()=>{},condenseTable:k=!1,canSelect:T=!1,canLaunchUrl:S,addlActions:O,readOnly:R=!1,showCloseBtn:P=!1,canSearch:$=!1}=t,F=!!t.canCreate&&!R,M=!!a&&!!s&&!R,j=!!u&&!!l&&R&&k,z=!!f&&!R,{palette:L}=V.useTheme(),[A,_]=J.useState([]),[I,B]=J.useState(!1),[W,K]=J.useState(!0),[U,Y]=J.useState(null),[pe,ce]=J.useState(null),[le,X]=J.useState({pageNo:0,pageSize:k?5:10,totalCount:0,search:$?"":void 0}),oe=()=>{B(!1),K(!0),v({pageNo:le.pageNo,pageSize:le.pageSize,search:le.search},y).then(Re=>(_(Re.data),X(me=>({...me,totalCount:Re.totalCount})),Re)).catch(Re=>{C(Re),B(!0),_([])}).finally(()=>K(!1))};J.useEffect(oe,[le.pageNo,le.pageSize,e,le.search]);const fe=()=>{ce(null),Y(null)},te=g.jsx(Tr,{variant:T?"outlined":"contained",size:T?"small":"medium",onClick:o,startIcon:g.jsx(Kh,{}),children:"Add Citation"}),re=g.jsx(Tr,{variant:T?"outlined":"contained",size:T?"small":"medium",onClick:i,startIcon:g.jsx(LI,{}),children:"Add Attachment"}),ue=Re=>{if(!(!M&&!j)){if(M)return g.jsx(V.Tooltip,{title:"Edit",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>Re.fileName?a(Re.id):s(Re.id),"data-testid":`citation-table_edit-btn-${Re.id}`,children:g.jsx(Wne,{})})});if(j)return g.jsx(V.Tooltip,{title:"View",children:g.jsx(V.IconButton,{color:"primary",onClick:()=>Re.fileName?u(Re.id):l(Re.id),"data-testid":`citation-table_view-btn-${Re.id}`,children:g.jsx(ere,{})})})}},ge=Re=>{if(!(!z||R))return g.jsx(V.Tooltip,{title:"Delete",children:g.jsx(V.IconButton,{color:"error",onClick:me=>{ce(Re),Y(me.currentTarget)},"data-testid":`citation-table_delete-btn-${Re.id}`,children:g.jsx(Zv,{})})})},Z=Re=>g.jsx(T0,{citation:Re,canLaunchUrl:S}),ee=Re=>g.jsx(iA,{citation:Re,onPreviewAttachment:m}),ie=Re=>g.jsx(oA,{citation:Re,onDownloadAttachment:p}),Ce=j||M||z||S||m||p||O,Se=[...sA(L,k),{fieldName:"id",key:"Action",label:"Action",hideCol:!Ce,render:(Re,me)=>g.jsxs(V.Box,{display:"flex",flexDirection:"row-reverse",children:[O==null?void 0:O(me),ge(me),ue(me),ee(me),Z(me),ie(me)]})}],De=J.useCallback(Re=>{X(me=>({...me,pageNo:0,search:Re}))},[]),Me=()=>$?g.jsx(VI,{onSearch:De}):null;return g.jsxs(Iu,{children:[g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(V.Typography,{variant:k?"h6":"h2",children:n}),!T&&F&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",gap:1,children:[te,re]}),P&&g.jsx(V.IconButton,{onClick:r,children:g.jsx(tm,{})})]}),Me(),g.jsx(nA,{"data-testid":"citation-table",size:k?"x-small":"medium",isLoading:W,columns:Se,data:A,paginationState:le,onPageChange:Re=>X(me=>({...me,pageNo:Re})),onRowsPerPageChange:Re=>X(me=>({...me,pageSize:Re,pageNo:0})),errorTableMsg:I?"Failed to load citations.":void 0,retryCallback:oe,setCheckedKeys:T?x:void 0,checkedKeys:T?y:void 0}),T&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[g.jsx(V.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:F&&g.jsxs(g.Fragment,{children:[te,re]})}),!R&&g.jsxs(V.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[g.jsx(Tr,{variant:"outlined",size:"small",onClick:r,children:"Cancel"}),g.jsxs(Tr,{variant:"contained",size:"small",onClick:()=>b(y),children:["Select",y.length>0&&` (${y.length})`]})]})]}),g.jsx(Rue,{citation:pe,anchorEl:U,onDeleteCitation:f,onClose:fe})]})},ZE=(t,e)=>{const n=t?Ea.truncate(e,{length:30,omission:"..."}):e,r=n==null?void 0:n.endsWith("...");return g.jsx("span",{style:{wordBreak:"break-all"},children:r?g.jsx(V.Tooltip,{title:e,children:g.jsx("span",{children:n})}):e})},sA=(t,e=!1)=>[{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:(n,r)=>g.jsx(V.Tooltip,{title:n?"Attachment":"URL",children:n?g.jsx(LI,{sx:{color:t.grey[500],marginTop:"4px"},"data-testid":`attachment-icon-${r.id}`}):g.jsx(Kh,{sx:{color:t.grey[500],marginTop:"6px"},"data-testid":`url-icon-${r.id}`})}),ignoreDiff:!0},{fieldName:"title",render:n=>ZE(e,n)},{fieldName:"fileName",key:"URL/File Name",label:"URL/Other Identifier/File Name",render:(n,r)=>ZE(e,n||r.url),isEqual:(n,r)=>n.fileName&&r.fileName?n.fileName===r.fileName:n.url===r.url},{fieldName:"source",hideCol:e},{fieldName:"details",hideCol:e},{fieldName:"accessedAt",hideCol:e,render:(n,r)=>{if(!r.fileName)return(n==null?void 0:n.slice(0,10))??""}},{fieldName:"classification",hideCol:e}];var hb,QE;function Aue(){if(QE)return hb;QE=1;function t(C){this._maxSize=C,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(C){return this._values[C]},t.prototype.set=function(C,k){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=k};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,a=new t(s),l=new t(s),u=new t(s);hb={Cache:t,split:p,normalizePath:f,setter:function(C){var k=f(C);return l.get(C)||l.set(C,function(S,O){for(var R=0,P=k.length,$=S;R<P-1;){var F=k[R];if(F==="__proto__"||F==="constructor"||F==="prototype")return S;$=$[k[R++]]}$[k[R]]=O})},getter:function(C,k){var T=f(C);return u.get(C)||u.set(C,function(O){for(var R=0,P=T.length;R<P;)if(O!=null||!k)O=O[T[R++]];else return;return O})},join:function(C){return C.reduce(function(k,T){return k+(b(T)||n.test(T)?"["+T+"]":(k?".":"")+T)},"")},forEach:function(C,k,T){m(Array.isArray(C)?C:p(C),k,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(k){return k.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,k,T){var S=C.length,O,R,P,$;for(R=0;R<S;R++)O=C[R],O&&(x(O)&&(O='"'+O+'"'),$=b(O),P=!$&&/^\d+$/.test(O),k.call(T,O,$,P,R,C))}function b(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function v(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function x(C){return!b(C)&&(v(C)||y(C))}return hb}var ma=Aue(),mb,eO;function Pue(){if(eO)return mb;eO=1;const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=f=>f.match(t)||[],n=f=>f[0].toUpperCase()+f.slice(1),r=(f,p)=>e(f).join(p).toLowerCase(),o=f=>e(f).reduce((p,m)=>`${p}${p?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return mb={words:e,upperFirst:n,camelCase:o,pascalCase:f=>n(o(f)),snakeCase:f=>r(f,"_"),kebabCase:f=>r(f,"-"),sentenceCase:f=>n(r(f," ")),titleCase:f=>e(f).map(n).join(" ")},mb}var gb=Pue(),kf={exports:{}},tO;function Nue(){if(tO)return kf.exports;tO=1,kf.exports=function(o){return t(e(o),o)},kf.exports.array=t;function t(o,i){var s=o.length,a=new Array(s),l={},u=s,f=n(i),p=r(o);for(i.forEach(function(b){if(!p.has(b[0])||!p.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)l[u]||m(o[u],u,new Set);return a;function m(b,v,y){if(y.has(b)){var x;try{x=", node was:"+JSON.stringify(b)}catch{x=""}throw new Error("Cyclic dependency"+x)}if(!p.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!l[v]){l[v]=!0;var C=f.get(b)||new Set;if(C=Array.from(C),v=C.length){y.add(b);do{var k=C[--v];m(k,p.get(k),y)}while(v);y.delete(b)}a[--s]=b}}}function e(o){for(var i=new Set,s=0,a=o.length;s<a;s++){var l=o[s];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,s=0,a=o.length;s<a;s++){var l=o[s];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,s=0,a=o.length;s<a;s++)i.set(o[s],s);return i}return kf.exports}var $ue=Nue();const jue=er($ue),Lue=Object.prototype.toString,Bue=Error.prototype.toString,Fue=RegExp.prototype.toString,Vue=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",zue=/^Symbol\((.*)\)(.*)$/;function Hue(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function nO(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Hue(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Vue.call(t).replace(zue,"Symbol($1)");const r=Lue.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+Bue.call(t)+"]":r==="RegExp"?Fue.call(t):null}function Ss(t,e){let n=nO(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=nO(this[r],e);return i!==null?i:o},2)}function aA(t){return t==null?[]:[].concat(t)}let lA,cA,uA,Wue=/\$\{\s*(\w+)\s*\}/g;lA=Symbol.toStringTag;class rO{constructor(e,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[lA]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],aA(e).forEach(i=>{if(pr.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}cA=Symbol.hasInstance;uA=Symbol.toStringTag;class pr extends Error{static formatError(e,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof e=="string"?e.replace(Wue,(o,i)=>Ss(n[i])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,r,o,i){const s=new rO(e,n,r,o);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[uA]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,pr)}static[cA](e){return rO[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Vo={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${Ss(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ss(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Ss(n,!0)}\``+o}},wr={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Uue={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},k0={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},que={isValue:"${path} field must be ${value}"},Gf={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Kue={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Yue={notType:t=>{const{path:e,value:n,spec:r}=t,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Ss(n,!0)}\``;if(n.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Ss(n,!0)}\``}return pr.formatError(Vo.notType,t)}};Object.assign(Object.create(null),{mixed:Vo,string:wr,number:Uue,date:k0,object:Gf,array:Kue,boolean:que,tuple:Yue});const _x=t=>t&&t.__isYupSchema__;class ih{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,s=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new ih(e,(a,l)=>{var u;let f=s(...a)?o:i;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,e,n);if(o===void 0||o===e)return e;if(!_x(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Ef={context:"$",value:"."};class Na{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ef.context,this.isValue=this.key[0]===Ef.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Ef.context:this.isValue?Ef.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&ma.getter(this.path,!0),this.map=n.map}getValue(e,n,r){let o=this.isContext?r:this.isValue?e:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Na.prototype.__isYupRef=!0;const la=t=>t==null;function al(t){function e({value:n,path:r="",options:o,originalValue:i,schema:s},a,l){const{name:u,test:f,params:p,message:m,skipAbsent:b}=t;let{parent:v,context:y,abortEarly:x=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;const k={value:n,parent:v,context:y};function T(j={}){const z=dA(Object.assign({value:n,originalValue:i,label:s.spec.label,path:j.path||r,spec:s.spec,disableStackTrace:j.disableStackTrace||C},p,j.params),k),L=new pr(pr.formatError(j.message||m,z),n,z.path,j.type||u,z.disableStackTrace);return L.params=z,L}const S=x?a:l;let O={path:r,parent:v,type:u,from:o.from,createError:T,resolve(j){return fA(j,k)},options:o,originalValue:i,schema:s};const R=j=>{pr.isError(j)?S(j):j?l(null):S(T())},P=j=>{pr.isError(j)?S(j):a(j)};if(b&&la(n))return R(!0);let F;try{var M;if(F=f.call(O,n,O),typeof((M=F)==null?void 0:M.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${O.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(F).then(R,P)}}catch(j){P(j);return}R(F)}return e.OPTIONS=t,e}function dA(t,e){if(!t)return t;for(const n of Object.keys(t))t[n]=fA(t[n],e);return t}function fA(t,e){return Na.isRef(t)?t.getValue(e.value,e.parent,e.context):t}function Gue(t,e,n,r=n){let o,i,s;return e?(ma.forEach(e,(a,l,u)=>{let f=l?a.slice(1,a.length-1):a;t=t.resolve({context:r,parent:o,value:n});let p=t.type==="tuple",m=u?parseInt(f,10):0;if(t.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);o=n,n=n&&n[m],t=p?t.spec.types[m]:t.innerType}if(!u){if(!t.fields||!t.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=n,n=n&&n[f],t=t.fields[f]}i=f,s=l?"["+a+"]":"."+a}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}class sh extends Set{describe(){const e=[];for(const n of this.values())e.push(Na.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const r of this.values())n.push(e(r));return n}clone(){return new sh(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function yl(t,e=new Map){if(_x(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let r=0;r<t.length;r++)n[r]=yl(t[r],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[r,o]of t.entries())n.set(r,yl(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(yl(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=yl(o,e)}else throw Error(`Unable to clone ${t}`);return n}function Jue(t){if(!(t!=null&&t.length))return;const e=[];let n="",r=!1,o=!1;for(let i=0;i<t.length;i++){const s=t[i];if(s==="["&&!o){n&&(e.push(...n.split(".").filter(Boolean)),n=""),r=!0;continue}if(s==="]"&&!o){n&&(/^\d+$/.test(n)?e.push(n):e.push(n.replace(/^"|"$/g,"")),n=""),r=!1;continue}if(s==='"'){o=!o;continue}if(s==="."&&!r&&!o){n&&(e.push(n),n="");continue}n+=s}return n&&e.push(...n.split(".").filter(Boolean)),e}function Xue(t,e){const n=e?`${e}.${t.path}`:t.path;return t.errors.map(r=>({message:r,path:Jue(n)}))}function pA(t,e){var n;if(!((n=t.inner)!=null&&n.length)&&t.errors.length)return Xue(t,e);const r=e?`${e}.${t.path}`:t.path;return t.inner.flatMap(o=>pA(o,r))}class ni{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new sh,this._blacklist=new sh,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Vo.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=yl(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=n,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,r=e.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,r,o,i;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,n={}){let r=this.resolve(Object.assign({},n,{value:e})),o=n.assert==="ignore-optionality",i=r._cast(e,n);if(n.assert!==!1&&!r.isType(i)){if(o&&la(i))return i;let s=Ss(e),a=Ss(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
405
405
|
|
|
406
406
|
attempted value: ${s}
|
|
407
407
|
`+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,n){let r=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this,n),e);return r===void 0&&(r=this.getDefault(n)),r}_validate(e,n={},r,o){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=n,l=e;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:i,value:l,originalValue:s,options:n,tests:u},r,f=>{if(f.length)return o(f,l);this.runTests({path:i,value:l,originalValue:s,options:n,tests:this.tests},r,o)})}runTests(e,n,r){let o=!1,{tests:i,value:s,originalValue:a,path:l,options:u}=e,f=y=>{o||(o=!0,n(y,s))},p=y=>{o||(o=!0,r(y,s))},m=i.length,b=[];if(!m)return p([]);let v={value:s,originalValue:a,path:l,options:u,schema:this};for(let y=0;y<i.length;y++){const x=i[y];x(v,f,function(k){k&&(Array.isArray(k)?b.push(...k):b.push(k)),--m<=0&&p(b)})}}asNestedTest({key:e,index:n,parent:r,parentPath:o,originalParent:i,options:s}){const a=e??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const f=Object.assign({},s,{strict:!0,parent:r,value:u,originalValue:i[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${o||""}[${l?a:`"${a}"`}]`:(o?`${o}.`:"")+e});return(p,m,b)=>this.resolve(f)._validate(u,f,m,b)}validate(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((s,a)=>o._validate(e,n,(l,u)=>{pr.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new pr(l,u,void 0,void 0,i)):s(u)}))}validateSync(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i,s=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(e,Object.assign({},n,{sync:!0}),(a,l)=>{throw pr.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new pr(a,e,void 0,void 0,s);i=l}),i}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(pr.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(pr.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):yl(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const r=this.clone({nullable:e});return r.internalTests.nullable=al({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(e,n){const r=this.clone({optional:e});return r.internalTests.optionality=al({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=Vo.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Vo.notNull){return this.nullability(!1,e)}required(e=Vo.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=Vo.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=al(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(s=>!(s.OPTIONS.name===n.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let r=this.clone(),o=aA(e).map(i=>new Na(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new ih(o,n):ih.fromOptions(o,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=al({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=Vo.oneOf){let r=this.clone();return e.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=al({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),r}notOneOf(e,n=Vo.notOneOf){let r=this.clone();return e.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=al({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),r}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:r,meta:o,optional:i,nullable:s}=n.spec;return{meta:o,label:r,optional:i,nullable:s,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((l,u,f)=>f.findIndex(p=>p.OPTIONS.name===l.OPTIONS.name)===u).map(l=>{const u=l.OPTIONS.params&&e?dA(Object.assign({},l.OPTIONS.params),e):l.OPTIONS.params;return{name:l.OPTIONS.name,params:u}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await e.validate(r,{abortEarly:!1})}}catch(o){if(o instanceof pr)return{issues:pA(o)};throw o}}}}}ni.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])ni.prototype[`${t}At`]=function(e,n,r={}){const{parent:o,parentPath:i,schema:s}=Gue(this,e,n,r.context);return s[t](o&&o[i],Object.assign({},r,{parent:o,path:e}))};for(const t of["equals","is"])ni.prototype[t]=ni.prototype.oneOf;for(const t of["not","nope"])ni.prototype[t]=ni.prototype.notOneOf;const Zue=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Que(t){const e=E0(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function E0(t){var e,n;const r=Zue.exec(t);return r?{year:wi(r[1]),month:wi(r[2],1)-1,day:wi(r[3],1),hour:wi(r[4]),minute:wi(r[5]),second:wi(r[6]),millisecond:r[7]?wi(r[7].substring(0,3)):0,precision:(e=(n=r[7])==null?void 0:n.length)!=null?e:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:wi(r[10]),minuteOffset:wi(r[11])}:null}function wi(t,e=0){return Number(t)||e}let ede=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tde=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,nde=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,rde="^\\d{4}-\\d{2}-\\d{2}",ode="\\d{2}:\\d{2}:\\d{2}",ide="(([+-]\\d{2}(:?\\d{2})?)|Z)",sde=new RegExp(`${rde}T${ode}(\\.\\d+)?${ide}$`),ade=t=>la(t)||t===t.trim(),lde={}.toString();function El(){return new hA}class hA extends ni{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const r=e!=null&&e.toString?e.toString():e;return r===lde?e:r})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||Vo.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=wr.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,n=wr.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,n=wr.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||wr.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&r||s.search(e)!==-1})}email(e=wr.email){return this.matches(ede,{name:"email",message:e,excludeEmptyString:!0})}url(e=wr.url){return this.matches(tde,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=wr.uuid){return this.matches(nde,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",r,o;return e&&(typeof e=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=e:n=e),this.matches(sde,{name:"datetime",message:n||wr.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||wr.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const s=E0(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||wr.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const s=E0(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=wr.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:ade})}lowercase(e=wr.lowercase){return this.transform(n=>la(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>la(n)||n===n.toLowerCase()})}uppercase(e=wr.uppercase){return this.transform(n=>la(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>la(n)||n===n.toUpperCase()})}}El.prototype=hA.prototype;let mA=new Date(""),cde=t=>Object.prototype.toString.call(t)==="[object Date]";function Rx(){return new Qu}class Qu extends ni{constructor(){super({type:"date",check(e){return cde(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=Que(e),isNaN(e)?Qu.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(Na.isRef(e))r=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(e,n=k0.min){let r=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(e,n=k0.max){let r=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}Qu.INVALID_DATE=mA;Rx.prototype=Qu.prototype;Rx.INVALID_DATE=mA;function ude(t,e=[]){let n=[],r=new Set,o=new Set(e.map(([s,a])=>`${s}-${a}`));function i(s,a){let l=ma.split(s)[0];r.add(l),o.has(`${a}-${l}`)||n.push([a,l])}for(const s of Object.keys(t)){let a=t[s];r.add(s),Na.isRef(a)&&a.isSibling?i(a.path,s):_x(a)&&"deps"in a&&a.deps.forEach(l=>i(l,s))}return jue.array(Array.from(r),n).reverse()}function oO(t,e){let n=1/0;return t.some((r,o)=>{var i;if((i=e.path)!=null&&i.includes(r))return n=o,!0}),n}function gA(t){return(e,n)=>oO(t,e)-oO(t,n)}const dde=(t,e,n)=>{if(typeof t!="string")return t;let r=t;try{r=JSON.parse(t)}catch{}return n.isType(r)?r:t};function Jf(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=Jf(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=Jf(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(Jf)}):"optional"in t?t.optional():t}const fde=(t,e)=>{const n=[...ma.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),o=ma.getter(ma.join(n),!0)(t);return!!(o&&r in o)};let iO=t=>Object.prototype.toString.call(t)==="[object Object]";function sO(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const pde=gA([]);function Ix(t){return new yA(t)}class yA extends ni{constructor(e){super({type:"object",check(n){return iO(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=pde,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var r;let o=super._cast(e,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,s=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(o).filter(p=>!this._nodes.includes(p))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),f=!1;for(const p of a){let m=i[p],b=p in o,v=o[p];if(m){let y;u.path=(n.path?`${n.path}.`:"")+p,m=m.resolve({value:v,context:n.context,parent:l});let x=m instanceof ni?m.spec:void 0,C=x==null?void 0:x.strict;if(x!=null&&x.strip){f=f||p in o;continue}y=!n.__validating||!C?m.cast(v,u):v,y!==void 0&&(l[p]=y)}else b&&!s&&(l[p]=v);(b!==p in l||l[p]!==v)&&(f=!0)}return f?l:o}_validate(e,n={},r,o){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:s},...i],n.__validating=!0,n.originalValue=s,super._validate(e,n,r,(l,u)=>{if(!a||!iO(u)){o(l,u);return}s=s||u;let f=[];for(let p of this._nodes){let m=this.fields[p];!m||Na.isRef(m)||f.push(m.asNestedTest({options:n,key:p,parent:u,parentPath:n.path,originalParent:s}))}this.runTests({tests:f,value:u,originalValue:s,options:n},r,p=>{o(p.sort(this._sortErrors).concat(l),u)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const s=r[o];r[o]=s===void 0?i:s}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(s):void 0}),n}setFields(e,n){let r=this.clone();return r.fields=e,r._nodes=ude(e,n),r._sortErrors=gA(Object.keys(e)),n&&(r._excludedEdges=n),r}shape(e,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,e),o)})}partial(){const e={};for(const[n,r]of Object.entries(this.fields))e[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Jf(this)}pick(e){const n={};for(const r of e)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>e.includes(r)&&e.includes(o)))}omit(e){const n=[];for(const r of Object.keys(this.fields))e.includes(r)||n.push(r);return this.pick(n)}from(e,n,r){let o=ma.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return fde(i,e)&&(s=Object.assign({},i),r||delete s[e],s[n]=o(i)),s})}json(){return this.transform(dde)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Gf.exact,test(n){if(n==null)return!0;const r=sO(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=Gf.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=sO(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=Gf.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[e(o)]=n[o];return r})}camelCase(){return this.transformKeys(gb.camelCase)}snakeCase(){return this.transformKeys(gb.snakeCase)}constantCase(){return this.transformKeys(e=>gb.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[i,s]of Object.entries(n.fields)){var o;let a=e;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=s.describe(a)}return r}}Ix.prototype=yA.prototype;const hde=t=>{const{open:e,anchorEl:n,onGenerateCitation:r,onClose:o}=t;return g.jsx(V.Popper,{open:e,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},sx:{maxWidth:"500px"},children:g.jsxs(Iu,{component:V.Paper,p:1,boxShadow:9,gap:.25,children:[g.jsx(V.Typography,{variant:"body1",children:"Paste in a preformatted citation"}),g.jsx(V.Typography,{variant:"body2",color:"text.secondary",fontStyle:"italic",fontSize:".8em",children:"For best results, ensure your citations use a vertical bar ( | ) to separate the title, source, url, etc. Incomplete citations are allowed but may result in incompletely filled fields."}),g.jsx(Ht.Formik,{initialValues:{pasteExistingCitation:""},onSubmit:({pasteExistingCitation:i})=>{r(yde(i)),o()},children:({values:i,submitForm:s,setFieldValue:a})=>g.jsxs(Yo,{flexWrap:"wrap",justifyContent:"flex-end",children:[g.jsx($I,{name:"pasteExistingCitation",errorMode:"collapse",label:"",placeholder:"Scientific News Today | How to Organize Your Workspace for Maximum Efficiency | https://mock-news-site.com | ACCESSED 2 JAN 2026 | Public Source",endIcon:g.jsx(V.Tooltip,{title:"Paste from Clipboard",children:g.jsx(V.IconButton,{"data-testid":"paste-content-button",onClick:()=>{navigator.clipboard.readText().then(l=>a("pasteExistingCitation",l))},children:g.jsx(zne,{})})})}),g.jsxs(Yo,{children:[g.jsx(Tr,{size:"small",variant:"outlined",onClick:o,"data-testid":"citation-table_paste-prompt_cancel",children:"Cancel"}),g.jsx(Tr,{size:"small",type:"submit",onClick:s,"data-testid":"citation-table_paste-prompt_submit",disabled:!i.pasteExistingCitation,children:"Prefill Citation"})]})]})})]})})},mde=["https://","http://","www."],gde=new RegExp(mde.join("|")),yde=t=>{const e=t.replace(/\.\s*$/,"").split("|").map(f=>f.trim()).filter(Boolean),n=e.findIndex(f=>f.match(gde)),r=e.findIndex(f=>f.toUpperCase().startsWith("ACCESSED")),o=e.findIndex(f=>/\bSOURCE\b/.test(f.toUpperCase()));let s=[n,r,o].find(f=>f!==-1)??e.length;const a=s-1,l=s-2;return{type:"Url",source:Of(e,l),title:Of(e,a),url:Of(e,n),accessedAt:bde(e,r),classification:vde(e,o),details:Of(e,o)}},Of=(t,e)=>e<0||e>=t.length?"":t[e],bde=(t,e)=>e<0||e>=t.length?"":_ce(t[e].toUpperCase().replace(/^ACCESSED\s+/,"")),vde=(t,e)=>e<0||e>=t.length?"":t[e].toUpperCase().includes("PUBLIC")?"Public Source":"Proprietary Source",bA=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return g.jsx(Tr,{type:n,disabled:e,size:r,startIcon:e?g.jsx(V.CircularProgress,{size:s,color:"inherit"}):null,...o})},vA=t=>{const{onCancel:e,onViewCitationTable:n,readOnly:r=!1,showViewAllCitationsBtn:o=!1,isLoading:i,onSaveClicked:s}=t;return r&&!o?null:r?g.jsx(V.DialogActions,{sx:{px:0},children:g.jsx(V.Button,{onClick:n,size:"small",variant:"outlined",children:"Back To Table"})}):g.jsxs(V.DialogActions,{sx:{px:0,justifyContent:"space-between"},children:[g.jsx(V.Box,{children:o&&g.jsx(V.Button,{onClick:n,size:"small",variant:"outlined",children:"View All Citations"})}),g.jsxs(Yo,{children:[g.jsx(V.Button,{onClick:e,variant:"outlined",size:"small",children:"Cancel"}),g.jsx(bA,{size:"small",loading:i,type:"button",onClick:s,children:"Save"})]})]})},xde=t=>{const{onSave:e,onCancel:n,onViewCitationTable:r,onClose:o,modifyCitation:i,readOnly:s=!1,showViewAllCitationsBtn:a=!1,canLaunchUrl:l}=t,u=J.useRef(null),[f,p]=J.useState(!1),[m,b]=J.useState(!1),v=J.useRef(null),[y,x]=J.useState(!1),[C,k]=J.useState({type:"Url",source:"",title:"",accessedAt:null,url:"",classification:"",details:""});J.useEffect(()=>{i&&k({...i,type:"Url"})},[]);const T={disabled:f,margin:"none",readOnly:s},S=!s;return g.jsxs(V.Box,{minWidth:"400px",maxWidth:"500px",children:[g.jsxs(Yo,{justifyContent:"space-between",children:[g.jsxs(Yo,{gap:2,children:[g.jsxs(V.Typography,{variant:"h6",margin:"10px 0",children:[s?"View":"Edit"," Citation"]}),S&&g.jsx(V.Button,{variant:"outlined",size:"small",ref:v,onClick:()=>x(!0),children:"Paste & Prefill"})]}),g.jsx(V.IconButton,{onClick:o,children:g.jsx(tm,{})})]}),g.jsx(Ht.Formik,{innerRef:u,enableReinitialize:!0,initialValues:C,onSubmit:async O=>{p(!0),e(O).catch(R=>{throw p(!1),R}).finally(()=>p(!1))},validationSchema:Ix({title:El().required("Title is required"),accessedAt:Rx().required("Accessed At is required"),url:El().required("URL is required"),classification:El().required("Classification is required")}),validateOnBlur:m,validateOnChange:m,children:({submitForm:O,setValues:R,values:P})=>g.jsxs(Ht.Form,{autoComplete:"off",children:[g.jsxs(V.Box,{display:"flex",flexDirection:"column",gap:s?1:0,alignItems:"flex-start",children:[g.jsx(Ri,{...T,name:"title",required:!0}),g.jsx(Ri,{...T,name:"source"}),g.jsx(Ri,{...T,name:"details",label:"Details (e.g. Source Description)"}),g.jsx(Ip,{...T,name:"accessedAt",required:!0,isDatePicker:!0}),s&&(l!=null&&l(P))?g.jsx(g.Fragment,{children:g.jsx(Vi,{label:"URL / Other Identifier",readOnlyValue:g.jsx(T0,{citation:P,canLaunchUrl:l,asLink:!0}),value:P.url??""})}):g.jsx(Ri,{...T,name:"url",label:"URL / Other Identifier",required:!0,endIcon:g.jsx(T0,{citation:P,canLaunchUrl:l})}),g.jsx(NI,{...T,name:"classification",row:!0,required:!0,radios:wde})]}),g.jsx(vA,{isLoading:f,onSaveClicked:()=>{b(!0),O()},readOnly:s,showViewAllCitationsBtn:a,onViewCitationTable:r,onCancel:n}),g.jsx(hde,{open:y,onGenerateCitation:$=>{R($,!0)},anchorEl:v.current,onClose:()=>x(!1)})]})})]})},wde=[{label:"Public Source",value:"Public Source",helperText:"URL is accessible to anyone from any location without special permissions. You can safely access this URL on any computer, including public or shared devices."},{label:"Proprietary Source",value:"Proprietary Source",helperText:"For private, sensitive, or access-controlled content. Use a VPN, or take extra precautions, when accessing to protect your privacy."}],Cde=t=>{const{onSave:e,onCancel:n,onViewCitationTable:r,onClose:o,modifyCitation:i,readOnly:s=!1,showViewAllCitationsBtn:a=!1,onDownloadAttachment:l,onPreviewAttachment:u}=t,f=J.useRef(null),[p,m]=J.useState(!1),[b,v]=J.useState(!1),[y,x]=J.useState({type:"Attachment",title:"",file:void 0,fileName:""});return J.useEffect(()=>{i&&x({...i,type:"Attachment",file:void 0})},[]),g.jsxs(V.Box,{minWidth:"400px",maxWidth:"500px",children:[g.jsxs(V.Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[g.jsxs(V.Typography,{variant:"h6",margin:"10px 0",children:[s?"View":"Edit"," Attachment"]}),g.jsx(V.IconButton,{onClick:o,children:g.jsx(tm,{})})]}),g.jsx(Ht.Formik,{innerRef:f,enableReinitialize:!0,initialValues:y,validationSchema:Ix().shape({title:El().required("Title is required"),fileName:El().required("A file is required")}),validateOnBlur:b,validateOnChange:b,onSubmit:async C=>{m(!0),e(C).catch(k=>{throw m(!1),k}).finally(()=>m(!1))},children:({values:C,setFieldValue:k,handleSubmit:T})=>{var O;const S=!s&&!C.id;return J.useEffect(()=>{var R,P;(R=C.file)!=null&&R.name&&k("fileName",(P=C.file)==null?void 0:P.name)},[(O=C.file)==null?void 0:O.name]),g.jsxs(Ht.Form,{autoComplete:"off",children:[g.jsx(Ri,{name:"title",disabled:p,required:!0,margin:"none",readOnly:s}),g.jsxs(V.Box,{marginTop:S?1:0,children:[g.jsxs(Yo,{alignItems:"flex-start",children:[S&&g.jsx(DI,{name:"file",errorMode:"hidden"}),g.jsxs(Yo,{alignItems:"flex-end",children:[g.jsx(Ri,{readOnly:!0,name:"fileName",label:S?"":"File Name"}),!S&&g.jsxs(Yo,{children:[g.jsx(oA,{citation:C,onDownloadAttachment:l}),g.jsx(iA,{citation:C,onPreviewAttachment:u})]})]})]}),g.jsx(_r,{name:"fileName"})]}),g.jsx(vA,{isLoading:p,onSaveClicked:()=>{v(!0),T()},readOnly:s,showViewAllCitationsBtn:a,onViewCitationTable:r,onCancel:n})]})}})]})},ed=t=>{const{open:e=!1,onClose:n,title:r,children:o,actions:i,closeBtnLabel:s,closeButtonPosition:a,closeButtonProps:l={},disableDismiss:u=!1,...f}=t;if(!e)return null;const p=a==="bottom"||a==="top-and-bottom",m=a==="top"||a==="top-and-bottom",b=()=>{if(s&&p)return g.jsx(V.Button,{className:"MBv2_Modal_Close",onClick:t.onClose,...l,children:s})},v=()=>{if(i)return g.jsx(V.DialogActions,{className:"MBv2_Modal_Actions",children:g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"0.25rem",children:[g.jsx(V.Box,{children:b()}),g.jsxs(V.Box,{display:"flex",gap:".25rem",children:[...i]})]})});if(s&&p)return g.jsx(V.DialogActions,{className:"MBv2_Modal_Actions",children:g.jsx(V.Box,{children:b()})})};return g.jsxs(V.Dialog,{className:"MBv2_Modal",open:e,onClose:()=>{u||n==null||n()},...f,children:[typeof r=="string"?g.jsx(V.DialogTitle,{className:"MBv2_Modal_Title",children:g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[r,m&&g.jsx(V.IconButton,{"data-testid":"modal-header-close-btn",onClick:n,children:g.jsx(tm,{})})]})}):r,o&&(typeof o=="string"?g.jsx(V.DialogContent,{className:"MBv2_Modal_Content",children:g.jsx(V.DialogContentText,{className:"MBv2_Modal_Content_Text",children:o})}):o),v()]})};function Sde(t){return qe("MuiAlert",t)}const aO=He("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),Tde=Ne(g.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),kde=Ne(g.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Ede=Ne(g.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Ode=Ne(g.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Mde=Ne(g.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),_de=t=>{const{variant:e,color:n,severity:r,classes:o}=t,i={root:["root",`color${Pe(n||r)}`,`${e}${Pe(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return Ue(i,Sde,o)},Rde=ne(Rs,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Pe(n.color||n.severity)}`]]}})(vt(({theme:t})=>{const e=t.palette.mode==="light"?ba:_l,n=t.palette.mode==="light"?_l:ba;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(Ln(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${r}StandardBg`]:n(t.palette[r].light,.9),[`& .${aO.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Ln(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),border:`1px solid ${(t.vars||t).palette[r].light}`,[`& .${aO.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Ln(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}))]}})),Ide=ne("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Dde=ne("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Ade=ne("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),lO={success:g.jsx(Tde,{fontSize:"inherit"}),warning:g.jsx(kde,{fontSize:"inherit"}),error:g.jsx(Ede,{fontSize:"inherit"}),info:g.jsx(Ode,{fontSize:"inherit"})},xA=D.forwardRef(function(e,n){const r=mt({props:e,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:a="Close",color:l,components:u={},componentsProps:f={},icon:p,iconMapping:m=lO,onClose:b,role:v="alert",severity:y="success",slotProps:x={},slots:C={},variant:k="standard",...T}=r,S={...r,color:l,severity:y,variant:k,colorSeverity:l||y},O=_de(S),R={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...C},slotProps:{...f,...x}},[P,$]=Mt("root",{ref:n,shouldForwardComponentProp:!0,className:ye(O.root,s),elementType:Rde,externalForwardedProps:{...R,...T},ownerState:S,additionalProps:{role:v,elevation:0}}),[F,M]=Mt("icon",{className:O.icon,elementType:Ide,externalForwardedProps:R,ownerState:S}),[j,z]=Mt("message",{className:O.message,elementType:Dde,externalForwardedProps:R,ownerState:S}),[L,A]=Mt("action",{className:O.action,elementType:Ade,externalForwardedProps:R,ownerState:S}),[_,I]=Mt("closeButton",{elementType:Ql,externalForwardedProps:R,ownerState:S}),[B,W]=Mt("closeIcon",{elementType:Mde,externalForwardedProps:R,ownerState:S});return g.jsxs(P,{...$,children:[p!==!1?g.jsx(F,{...M,children:p||m[y]||lO[y]}):null,g.jsx(j,{...z,children:i}),o!=null?g.jsx(L,{...A,children:o}):null,o==null&&b?g.jsx(L,{...A,children:g.jsx(_,{size:"small","aria-label":a,title:a,color:"inherit",onClick:b,...I,children:g.jsx(B,{fontSize:"small",...W})})}):null]})});process.env.NODE_ENV!=="production"&&(xA.propTypes={action:c.node,children:c.node,classes:c.object,className:c.string,closeText:c.string,color:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),components:c.shape({CloseButton:c.elementType,CloseIcon:c.elementType}),componentsProps:c.shape({closeButton:c.object,closeIcon:c.object}),icon:c.node,iconMapping:c.shape({error:c.node,info:c.node,success:c.node,warning:c.node}),onClose:c.func,role:c.string,severity:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),slotProps:c.shape({action:c.oneOfType([c.func,c.object]),closeButton:c.oneOfType([c.func,c.object]),closeIcon:c.oneOfType([c.func,c.object]),icon:c.oneOfType([c.func,c.object]),message:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({action:c.elementType,closeButton:c.elementType,closeIcon:c.elementType,icon:c.elementType,message:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["filled","outlined","standard"]),c.string])});const td=t=>{var b;const{noIcon:e=!1,children:n,severity:r="success",variant:o="leftBorder",sx:i,title:s,...a}=t,{palette:l}=V.useTheme(),u=e?{icon:!1}:{},f=o==="leftBorder"?"standard":o,p=o==="leftBorder"?{...i,borderLeft:`4px solid ${(b=l[r])==null?void 0:b.main}`}:i,m=s?{icon:{sx:{mt:"6px"}}}:{};return g.jsxs(xA,{severity:r,variant:f,sx:p,slotProps:m,...u,...a,children:[s&&g.jsx(V.Typography,{variant:"h3",children:s}),n]})},wA=t=>g.jsx(td,{severity:"error",...t}),CA=t=>g.jsx(td,{severity:"success",...t}),Pde=t=>{const{alert:e,setAlert:n}=t,r=()=>n(void 0);return g.jsxs(g.Fragment,{children:[(e==null?void 0:e.type)==="Error"&&g.jsx(wA,{"data-testid":"citation-menu-error",onClose:r,title:e.title,children:e.message.toString()}),(e==null?void 0:e.type)==="Success"&&g.jsx(CA,{"data-testid":"citation-menu-success",onClose:r,children:e.message})]})};function SA({getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,onPreviewAttachment:s,onSelectCitations:a,onClose:l,initialSelectedIds:u=[],onContentChange:f,onError:p=()=>{},renderAsPopup:m=!1,canSelect:b=!1,tableTitle:v="Attachments & Citations",addlActions:y,canLaunchUrl:x,readOnly:C,canSearch:k=!1}){const[T,S]=J.useState("Insert Citation/Attachment(s)"),[O,R]=J.useState(u),[P,$]=J.useState(void 0),[F,M]=J.useState(void 0),[j,z]=J.useState(!1),[L,A]=J.useState(!1),_=ee=>{M(void 0),S(ee)},[I,B]=J.useState(0);J.useEffect(()=>{f==null||f()},[T,F,f]);const W=(ee=!1)=>{(!m||ee)&&B(ie=>ie+1)},K=(ee,ie)=>{var Me;const Ce=typeof((Me=ie.response)==null?void 0:Me.data)=="string"&&ie.response.data,Se=typeof ie.message=="string"&&ie.message;M({type:"Error",title:ee,message:Ce??Se}),p(ie)},U=ee=>M({type:"Success",title:"",message:ee}),Y=async ee=>{if(T==="Insert Citation/Attachment(s)")throw Error("onSave called with invalid state");ee.id?await(n==null?void 0:n(ee).then(()=>{j?l():(_("Insert Citation/Attachment(s)"),W())}).catch(ie=>{K("Failed to update",ie)})):await(e==null?void 0:e(ee).then(ie=>{R([...O,ie.id]),_("Insert Citation/Attachment(s)"),W()}).catch(ie=>{K("Failed to create",ie)}))},pe=r&&(async ee=>r(ee).then(()=>{W(!0),R(O.filter(ie=>ie!==ee)),U("Successfully deleted")}).catch(ie=>K("Failed to delete",ie))),ce=o&&(ee=>{o(ee).then(ie=>{const Ce=!!ie.fileName;$(ie),_(Ce?"Attachment":"Citation")}).catch(ie=>{K("Failed to load",ie)}).finally(()=>A(!1))}),le=n&&ce,X=n&&ce,oe=i&&(async ee=>i(ee).catch(ie=>{K(`Failed to download ${ee.fileName}`,ie)})),fe=s&&(async ee=>s(ee).catch(ie=>{K(`Failed to view ${ee.fileName}`,ie)})),te=g.jsx(Due,{refreshKey:I,getCitationsPaginated:(ee,ie)=>t(ee,ie).then(Ce=>(f==null||f(),Ce)),onCancel:l,onNewCitation:()=>{$(void 0),_("Citation")},onNewAttachment:()=>{$(void 0),_("Attachment")},onEditCitation:le,onEditAttachment:X,onViewCitation:ce,onViewAttachment:ce,onDeleteCitation:pe,onDownloadAttachment:oe,onPreviewAttachment:fe,onSelect:a,setSelectedIds:R,selectedIds:O,onError:p,condenseTable:m,canSelect:b,title:v,addlActions:y,canCreate:!!e,canLaunchUrl:x,readOnly:C,showCloseBtn:m,canSearch:k}),re=g.jsx(xde,{modifyCitation:P,onSave:Y,onCancel:()=>j?l():_("Insert Citation/Attachment(s)"),onViewCitationTable:()=>{_("Insert Citation/Attachment(s)"),z(!1)},onClose:()=>m?l():_("Insert Citation/Attachment(s)"),readOnly:C,showViewAllCitationsBtn:C&&!j||!C&&j,canLaunchUrl:x}),ue=g.jsx(Cde,{onSave:Y,onCancel:()=>j?l():_("Insert Citation/Attachment(s)"),onViewCitationTable:()=>{_("Insert Citation/Attachment(s)"),z(!1)},onClose:()=>m?l():_("Insert Citation/Attachment(s)"),modifyCitation:P,readOnly:C,showViewAllCitationsBtn:C&&!j||!C&&j,onDownloadAttachment:oe,onPreviewAttachment:fe}),ge=g.jsx(Pde,{alert:F,setAlert:M});J.useEffect(()=>{m&&u.length===1&&ce&&(A(!0),z(!0),ce(u[0]))},[]);const Z=()=>{switch(T){case"Insert Citation/Attachment(s)":return te;case"Citation":return re;case"Attachment":return ue}};return m?g.jsxs(V.Box,{children:[ge,g.jsx(V.Box,{paddingTop:"8px",children:g.jsx(Ox,{isLoading:L,children:Z()})})]}):g.jsxs(V.Box,{width:"100%",children:[T==="Insert Citation/Attachment(s)"&&ge,g.jsx(V.Box,{paddingTop:"8px",children:te}),g.jsx(ed,{open:T!=="Insert Citation/Attachment(s)",children:g.jsxs(V.Box,{padding:"10px 20px",minWidth:"400px","data-testid":"citation-form-modal",children:[ge,T==="Citation"?re:ue]})})]})}function TA({getSelectedCitationsPaginated:t,getCitationsPaginated:e,readOnly:n,initialSelectedIds:r=[],...o}){const i=(s,a)=>n?t(s,r):e(s,a);return g.jsx(SA,{renderAsPopup:!0,canSelect:!n,getCitationsPaginated:i,readOnly:n,tableTitle:`${n?"Selected":"Insert"} Citation/Attachment(s)`,initialSelectedIds:r,...o})}const Nde=V.styled("div",{name:"CitationBubbleMenu",slot:"content",overridesResolver:(t,e)=>e.content})(({theme:t})=>{const e=t.palette.mode==="dark";return{padding:t.spacing(1.5,2,.5),backgroundColor:e?"#101010":"#f9f9f9",border:`1px solid ${t.palette.grey[e?700:200]}`}});function $de({getCitationsPaginated:t,getSelectedCitationsPaginated:e,onCreateCitation:n,onUpdateCitation:r,onDeleteCitation:o,getCitationById:i,onDownloadAttachment:s,onPreviewAttachment:a,canLaunchUrl:l,readOnly:u,canSearch:f,...p}){const m=kt();if(m&&!("citationBubbleMenuHandler"in(m==null?void 0:m.storage)))throw new Error("You must add the CitationBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!");const b=m==null?void 0:m.storage.citationBubbleMenuHandler,v=b.isOpen,y=b.selectedIds,x=b.selectedNodePos,C=O=>{m&&(O.length===0?m.commands.deleteCitation(x):y.length===0?m.commands.insertCitation({ids:O}):m.commands.updateCitation({ids:O},x))},k=O=>{C(O),m==null||m.commands.closeCitationBubbleMenu()},T=()=>{C(y),m==null||m.commands.closeCitationBubbleMenu()},S=J.useCallback(()=>{requestAnimationFrame(()=>{m!=null&&m.view&&m.view.dispatch(m.view.state.tr)})},[m]);return m?g.jsx(wv,{editor:m,open:v,...b.bubbleMenuOptions,...p,children:g.jsx(Nde,{children:g.jsx(TA,{getCitationsPaginated:t,getSelectedCitationsPaginated:O=>e(O,y),onCreateCitation:n,onUpdateCitation:r,onDeleteCitation:o,getCitationById:i,onDownloadAttachment:s,onPreviewAttachment:a,onSelectCitations:k,onClose:T,initialSelectedIds:y,onContentChange:S,canLaunchUrl:l,readOnly:u,canSearch:f})})}):null}const jde=()=>gn.create({name:"citationBubbleMenuHandler",addStorage(){return{isOpen:!1,selectedIds:[],bubbleMenuOptions:void 0,selectedNodePos:0}},addCommands(){return{openCitationBubbleMenu:(t={},e)=>({editor:n,dispatch:r})=>{var a;const{doc:o}=n.state,i=o.nodeAt(e??0),s=((a=i==null?void 0:i.attrs)==null?void 0:a.ids)??[];return r&&(this.storage.isOpen=!0,this.storage.selectedIds=s,this.storage.bubbleMenuOptions=t,this.storage.selectedNodePos=e??0),!0},closeCitationBubbleMenu:()=>({commands:t,dispatch:e})=>this.storage.isOpen?(t.focus(),e&&(this.storage.isOpen=!1,this.storage.selectedIds=[],this.storage.selectedNodePos=0),!0):!1}},onSelectionUpdate(){this.storage.isOpen&&!this.editor.isActive("citation")&&this.editor.commands.closeCitationBubbleMenu()},addKeyboardShortcuts(){return{"Mod-Shift-c":()=>(this.editor.commands.openCitationBubbleMenu(),!0)}}});function Lde(t){const e=kt(),n=J.useRef(null);return g.jsx(St,{buttonRef:n,tooltipLabel:"Insert Citation/Attachment",tooltipShortcutKeys:["mod","Shift","C"],disabled:!(e!=null&&e.isEditable),onClick:()=>e==null?void 0:e.commands.openCitationBubbleMenu({anchorEl:n.current,placement:"bottom"}),...t,children:g.jsxs(V.Box,{display:"flex",flexDirection:"row",gap:"4px",alignItems:"center",children:[g.jsx(Bne,{fontSize:"small"}),g.jsx(V.Typography,{variant:"body2",children:"Insert Citation/Attachment"})]})})}const kA=J.createContext(void 0),EA=()=>{const t=J.useContext(kA);if(!t)throw new Error("useSync must be used inside CitationFieldProvider");return t},Bde=({node:t,HTMLAttributes:e,selected:n,extension:r,updateAttributes:o,deleteNode:i})=>{const s=t.attrs.ids||[],{citations:a,isLoaded:l}=EA(),[u,f]=J.useState(s?String(s):""),[p,m]=J.useState([]),b=r.options.citationMaxLength;if(J.useEffect(()=>{if(!l)return;const v=a.filter(C=>s.includes(C.id)),y=v.map(C=>Ea.truncate(C.title,{length:b,omission:"..."})).join(", ");f(y),m(v);const x=v.map(C=>C.id);x.length===0?setTimeout(i,0):x.length!==s.length&&setTimeout(()=>o({ids:v.map(C=>C.id)}),0)},[a,s,l]),p.length!==0)return g.jsx(Uv,{as:"span",...e,"data-testid":"citation-node-component",children:g.jsx(V.Tooltip,{title:g.jsx(V.Box,{className:"citation-tooltip",children:p.map((v,y)=>{var k;const C=!!v.fileName?[v.title,v.fileName]:[v.title,v.source,v.details,(k=v.accessedAt)==null?void 0:k.slice(0,10),v.url,v.classification];return g.jsxs(V.Typography,{variant:"subtitle2",children:[C.filter(Boolean).join(" | "),y<p.length-1&&g.jsx(V.Divider,{className:"citation-tooltip-divider"})]},v.id)})}),slotProps:{tooltip:{sx:{maxWidth:500}}},children:g.jsx("a",{href:"#",onClick:v=>{v.preventDefault(),v.stopPropagation()},className:n?"selected-citation-link":"citation-link",children:u})})})},Fde=rn.create({name:"citation",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{ids:{default:[],parseHTML:t=>{const e=t.getAttribute("ids");return e?e.split(",").map(n=>parseInt(n.trim(),10)).filter(n=>!isNaN(n)):[]},renderHTML:t=>({ids:Array.isArray(t.ids)?t.ids.join(","):""})}}},parseHTML(){return[{tag:"citation"}]},renderHTML({HTMLAttributes:t}){return["citation",Tt(t)]},addNodeView(){return qv(Bde)},addProseMirrorPlugins(){return[new on({props:{handleClickOn:(t,e,n,r,o,i)=>n&&n.type.name==="citation"?(this.editor.commands.openCitationBubbleMenu({},r),!0):!1}})]},addCommands(){return{insertCitation:t=>({commands:e})=>e.insertContent({type:"citation",attrs:t}),updateCitation:(t,e)=>({state:n,dispatch:r,tr:o})=>{const i=n.doc.nodeAt(e);return!i||i.type.name!=="citation"?!1:(o.setNodeMarkup(e,void 0,t),r&&r(o),!0)},deleteCitation:t=>({tr:e,dispatch:n})=>{if(typeof t!="number")return!1;const r=t,o=t+1;return n&&n(e.delete(r,o)),!0}}}}),OA=t=>g.jsx(II,{name:t.name,label:"Not Applicable",errorMode:"hidden"}),Vde=t=>{const{name:e,label:n=Fn(e),hideLabel:r=!1,required:o=!1,readOnly:i,margin:s="dense",citationMaxLength:a=24,getCitationsPaginated:l,getSelectedCitationsPaginated:u,onCreateCitation:f,onUpdateCitation:p,onDeleteCitation:m,getCitationById:b,onDownloadAttachment:v,onPreviewAttachment:y,onError:x=()=>{},placeholder:C="Start typing here...",notApplicableName:k,errorMode:T="normal",canLaunchUrl:S,canSearch:O=!1}=t,R=[LR,ZD.configure({placeholder:C}),jde(),Fde.configure({citationMaxLength:a})],[P,$,F]=Ht.useField({name:e}),{setValue:M}=F,{value:j}=P,{addUpdateCitation:z,deleteCitation:L,batchUpdate:A,citations:_}=EA();J.useEffect(()=>{var oe;const le=(oe=I==null?void 0:I.current)==null?void 0:oe.editor;if(!le)return;le.getHTML()!==j&&setTimeout(()=>{le.commands.setContent(j)},0)},[j]);const I=J.useRef(null),B={normal:{marginTop:"16px",marginBottom:"8px"},dense:{marginTop:"8px",marginBottom:"4px"},none:{margin:0}},W=(le=void 0)=>{var fe,te;const X=((te=(fe=I.current)==null?void 0:fe.editor)==null?void 0:te.getHTML())??"",oe=!X.replace(/<\/?p>|<br>/g,"").trim();M(oe?"":X,le)},K=J.useMemo(()=>Ea.debounce(()=>W(!1),500),[M]),U=Ra(),{showDiff:Y,getPreviousValue:pe}=Ia(),ce=i??U;if(Y){const le=pe(e)??"",X=j,oe=/<citation\s+ids="([^"]*)"><\/citation>/g,fe=(ue,ge)=>{const Z=ge.split(",").map(Number);return`<sup>${_.filter(ee=>Z.includes(ee.id)).map(ee=>ee.title)}</sup>`},te=le.replace(oe,fe),re=X.replace(oe,fe);return g.jsx(Vi,{label:n,value:re,showDiff:!0,diffSnapshot:te,mode:"html"})}return g.jsxs(V.Box,{id:`citation-field_${e}`,sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:ce?0:50}},".MuiTiptap-RichTextContent-readonly ":{padding:0}},...B[s],display:"flex",flexDirection:"column",width:"100%",children:[g.jsxs(V.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[!r&&g.jsx(V.InputLabel,{htmlFor:`citation-field_${e}`,required:o,children:n}),k&&g.jsx(OA,{name:k})]}),g.jsx(SI,{ref:I,extensions:R,content:j,editable:!ce,renderControls:ce?void 0:()=>g.jsx(Fv,{children:g.jsx(Lde,{})}),onBlur:()=>W(),onUpdate:K,RichTextFieldProps:{variant:ce?"standard":"outlined",MenuBarProps:{hide:ce}},children:()=>g.jsx($de,{getCitationsPaginated:(le,X)=>l(le,X).then(oe=>(A(oe.data),oe)),getSelectedCitationsPaginated:u,onCreateCitation:f&&(le=>f(le).then(X=>(z(X),X))),onUpdateCitation:p&&(le=>p(le).then(X=>(z(X),X))),onDeleteCitation:m&&(le=>m(le).then(()=>L(le))),getCitationById:b,onDownloadAttachment:v,onPreviewAttachment:y,onError:x,canLaunchUrl:S,readOnly:ce,canSearch:O})}),g.jsx(_r,{name:e,id:`${e}-err`,errorMode:T})]})},zde=t=>{const{name:e="submit"}=t;return g.jsx(Tr,{name:e,type:"submit",...t})},Hde=t=>{const{label:e="Return to Top",icon:n=Bf,scrollThresholdPx:r=100}=t,o=V.useScrollTrigger({threshold:r}),i=J.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return g.jsx(V.Zoom,{in:o,children:g.jsx(V.Box,{sx:{position:"fixed",bottom:32,right:32,zIndex:1},children:g.jsxs(V.Fab,{onClick:i,color:"primary",size:"small",variant:"extended","aria-label":"Scroll back to top",children:[g.jsx(n,{fontSize:"medium"}),e]})})})},MA=t=>{const{label:e,menuOptions:n=[],icon:r}=t,o=ko.useNavigate(),[i,s]=D.useState(null),a=!!i,l=p=>{s(p.currentTarget)},u=()=>{s(null)};if(n.length===0)return null;const f=r&&!e;return g.jsxs(g.Fragment,{children:[g.jsx(V.Button,{startIcon:f?void 0:r,variant:"outlined",color:"inherit",sx:{minWidth:0,...f&&{paddingLeft:"6px",paddingRight:"6px"}},onClick:l,children:f?r:e}),g.jsx(V.Menu,{anchorEl:i,open:a,onClick:u,children:n.map(p=>g.jsxs(V.MenuItem,{...Hl(p,o),children:[p.icon&&g.jsx(V.ListItemIcon,{children:p.icon}),g.jsx(V.ListItemText,{primary:p.label})]},p.label))})]})},Wde=()=>{const{values:t,errors:e,status:n}=Ht.useFormikContext(),{palette:r}=V.useTheme();return g.jsx(V.Paper,{style:{backgroundColor:r.mode==="dark"?"#303030":"#f0f0f0",margin:"10px 0"},children:g.jsxs(V.List,{children:[g.jsxs(V.ListItem,{children:[g.jsx(V.Typography,{display:"block",variant:"h6",children:"Values"}),g.jsx("br",{}),g.jsx(V.Divider,{variant:"inset"}),g.jsx("pre",{children:JSON.stringify(t,null,2)})]}),g.jsx(V.Divider,{variant:"inset",component:"li"}),g.jsxs(V.ListItem,{id:"testing",children:[g.jsx(V.Typography,{display:"block",variant:"h6",children:"Errors"}),g.jsx("br",{}),g.jsx(V.Divider,{variant:"inset"}),g.jsx("pre",{children:JSON.stringify(e,null,2)})]}),g.jsxs(V.ListItem,{children:[g.jsx(V.Typography,{display:"block",variant:"h6",children:"Status"}),g.jsx("br",{}),g.jsx(V.Divider,{variant:"inset"}),g.jsx("pre",{children:JSON.stringify(n,null,2)})]})]})})},Ude=t=>{const{steps:e,orientation:n,inlineLabel:r=n=="vertical",isResponsive:o=!1}=t,{width:i}=rA();let s=!r,a=n;o&&(n&&console.warn("Stepper: Ignoring orientation. isResponsive is set to true, so the orientation is determined automatically based on the window size."),a=i<600?"vertical":"horizontal",a=="vertical"?s=!1:s=!r),n=="vertical"&&!r&&(console.warn("Stepper: ignoring inlineLabel={false}. Must use inline labels when orientation is vertical"),s=!1);const l=["steps","inlineLabel","orientation","isResponsive"],u={alternativeLabel:s,orientation:a,...hr({...t},l)};return g.jsx(V.Stepper,{...u,children:e.map(f=>g.jsx(V.Step,{children:g.jsx(V.StepLabel,{children:f})},f))})},qde=t=>{const{name:e,label:n=Fn(e),labelProps:r={fontSize:"1.1em",color:"#808080",fontWeight:"600"},initialState:o,renderFormGroup:i,addButtonContent:s="Add Another",removeButtonContent:a=t.removePosition==="right"?g.jsx(FI,{}):"Remove",variant:l="card",addButtonSx:u,removeButtonSx:f,allowRemoveAll:p=!1,readOnly:m=!1,emptyListMsg:b="None",showDivider:v=!1,removePosition:y="bottom"}=t,[x]=Ht.useField({name:e}),{value:C}=x,k=T=>({display:"flex",flexDirection:T==="bottom"?"column":"row",alignItems:T==="bottom"?"flex-start":"center"});return g.jsxs(V.FormControl,{fullWidth:!0,children:[g.jsx(V.Typography,{...r,children:n}),m&&x.value.length===0?g.jsx(V.Typography,{children:b}):g.jsx(Ht.FieldArray,{name:e,render:T=>g.jsxs("div",{children:[C.map((S,O)=>g.jsx(J.Fragment,{children:g.jsx(Kde,{variant:l,content:g.jsxs(V.Box,{"data-testid":"form-group-container",sx:typeof y=="string"?k(y):{...y},children:[g.jsxs(V.Box,{width:"100%",children:[i(`${e}.${O}`,O),v&&O!==C.length-1&&g.jsx(V.Divider,{"data-testid":"divider"})]}),!m&&C.length>(p?0:1)&&g.jsx(V.Button,{"data-testid":"repeatable-form-group_remove-btn",sx:f,onClick:()=>T.remove(O),children:a})]})})},`${e}-${O}`)),!m&&g.jsx(V.Button,{"data-testid":"repeatable-form-group_add-btn",onClick:()=>T.push(o),sx:u,children:s})]})})]})},Kde=({variant:t,content:e})=>{switch(t){case"card":return g.jsx(V.Card,{"data-testid":"repeatable-form-group_card",sx:{padding:"8px",marginBottom:"8px"},children:g.jsx(V.CardContent,{children:e})});case"elevatedCard":return g.jsx(V.Card,{"data-testid":"repeatable-form-group_elevated-card",elevation:4,sx:{border:"unset",padding:"8px",marginBottom:"8px"},children:g.jsx(V.CardContent,{children:e})});case"none":return e}},Yde=t=>{const{confirmBtnLabel:e,onConfirm:n,confirmButtonProps:r={color:"primary",variant:"contained"},closeBtnLabel:o="Cancel",closeButtonPosition:i="bottom",...s}=t;return g.jsx(ed,{actions:[g.jsx(V.Button,{className:"MBv2_ConfirmationModal_ConfirmBtn",onClick:n,...r,children:e})],closeBtnLabel:o,closeButtonPosition:i,...s})},Gde=t=>{const{closeBtnLabel:e="OK",closeButtonPosition:n="bottom",closeButtonProps:r={color:"primary",variant:"contained"},...o}=t;return g.jsx(ed,{closeBtnLabel:e,closeButtonPosition:n,closeButtonProps:r,...o})},Jde=t=>{const{primaryBtnLabel:e,onPrimaryAction:n,primaryActionProps:r={color:"primary",variant:"contained"},secondaryBtnLabel:o,onSecondaryAction:i,secondaryActionProps:s={color:"primary",variant:"outlined"},closeBtnLabel:a="Cancel",closeButtonPosition:l="bottom",...u}=t;return g.jsx(ed,{actions:[g.jsx(V.Button,{className:"MBv2_DecisionModal_SecondaryAction",onClick:i,...s,children:o}),g.jsx(V.Button,{className:"MBv2_DecisionModal_PrimaryAction",onClick:n,...r,children:e})],closeBtnLabel:a,closeButtonPosition:l,...u})},Xde={added:{icon:jne,label:"Added",color:"success"},deleted:{icon:FI,label:"Deleted",color:"error"},modified:{icon:Fne,label:"Modified",color:"info"},unmodified:{label:"Unmodified",color:"default"}},Zde=(t,e)=>g.jsxs(g.Fragment,{children:[g.jsx(V.Box,{"data-testid":"diff-table-cell-removed",sx:{backgroundColor:kp},children:g.jsx("s",{children:t})}),g.jsx(V.Box,{"data-testid":"diff-table-cell-added",sx:{backgroundColor:Tp},children:g.jsx("u",{children:e})})]}),Qde=(t,e,n,r=!1)=>{var i;let o={};for(const s of t)if(!s.ignoreDiff){const a=kl(s,e,r),l=kl(s,n,r);(((i=s.isEqual)==null?void 0:i.call(s,e,n))??RI.isEqual(a,l))||(o[wn(s)]=Zde(a,l))}return o},_A=(t,e,n,r=!1,o)=>{const i=[],s=[];let a=0,l=0;for(e.sort((u,f)=>u.id-f.id),n.sort((u,f)=>u.id-f.id);a<e.length&&l<n.length;){const u=e[a],f=n[l];if(u.id===f.id){const p=Qde(t,u,f,r);(o==null?void 0:o(u,f))??Object.keys(p).length===0?s.push({...f,changeType:"unmodified"}):i.push({...f,changeType:"modified",modifiedDiff:p}),a++,l++}else u.id<f.id?(i.push({...u,changeType:"deleted"}),a++):(i.push({...f,changeType:"added"}),l++)}for(;a<e.length;)i.push({...e[a],changeType:"deleted"}),a++;for(;l<n.length;)i.push({...n[l],changeType:"added"}),l++;return{dataDiff:i,dataUnmodified:s}},RA=t=>{const{beforeData:e,afterData:n,columns:r,isEqual:o,size:i,isMobileScreen:s}=t;t.renderExpand!=null&&o==null&&console.warn("DiffTable: isEqual prop should be provided when renderExpand is provided");const{dataDiff:a,dataUnmodified:l}=_A(r,e,n,s,o);return{columns:[{fieldName:"changeType",render:f=>{const p=Xde[f];return g.jsx(V.Chip,{color:p.color,size:i=="small"||i=="x-small"?"small":"medium",label:g.jsxs(V.Typography,{children:[p.icon&&g.jsx(P0,{icon:p.icon}),p.label]})})}},...r.map(f=>({...f,render:(p,m)=>{var b;return((b=m.modifiedDiff)==null?void 0:b[wn(f)])??kl(f,m,s)}}))],data:a,unmodifiedData:l,renderExpand:t.renderExpand?f=>{const p=e.find(m=>m.id===f.id);return g.jsx(OM,{previousSnapshot:p,currentSnapshot:f,showDiff:f.changeType==="modified",children:t.renderExpand(f)})}:void 0}},IA=({columns:t,data:e,unmodifiedData:n=[],emptyTableMsg:r="No changes to display",renderExpand:o,size:i})=>{const[s,a]=J.useState(!1),l=()=>a(!s),u=`${s?"Hide":"Show"} ${n.length} unmodified row${n.length>1?"s":""}`;return g.jsxs(V.Box,{children:[g.jsx(Mx,{columns:t,data:[...e,...s?n:[]],emptyTableMsg:r,renderExpand:o,size:i}),n.length>0&&g.jsx(V.Box,{children:g.jsx(V.Button,{onClick:l,children:u})})]})},efe=t=>{const{emptyTableMsg:e="No changes to display",...n}=t,r=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),o="beforeData"in n?RA({...n,isMobileScreen:r}):n;return g.jsx(IA,{...o,size:t.size})},tfe=t=>{const{featureMenuOptions:e=[],copyright:n,logo:r,sx:o={},fontColor:i="primary"}=t,{palette:s}=V.useTheme(),a=ko.useNavigate();return g.jsxs(V.Box,{className:"MBv2_Footer",sx:{backgroundColor:s.mode==="dark"?"#222222":"#ededed",padding:"25px 30px",...o},children:[g.jsx(V.Box,{className:"MBv2_Footer_Logo",sx:{display:"flex",gap:2,alignItems:"center",paddingBottom:1},children:typeof r=="string"?g.jsx("img",{draggable:"false",src:r,style:{width:"200px"},alt:"logo"}):r}),g.jsxs(V.Box,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",className:"MBv2_Footer_Nav_Links_Container",gap:2,children:[g.jsx(V.Box,{sx:{flexGrow:1},className:"MBv2_Footer_Nav_Links",display:"flex",flexDirection:"row",justifyContent:"flex-start",gap:3,children:e==null?void 0:e.map(l=>g.jsx(V.Link,{"data-testid":l.label,sx:{cursor:"pointer",fontSize:15},color:i,...Hl(l,a),children:l.label},l.label))}),n&&g.jsx(V.Typography,{style:{fontSize:15},"data-testid":"copyright",className:"MBv2_Footer_Copyright",color:i,children:n})]})]})},DA=t=>{const{menuOptionLists:e,anchor:n="left",children:r}=t,{pathname:o}=ko.useLocation(),i=ko.useNavigate(),[s,a]=J.useState(!1),l=(m,b)=>g.jsx(V.MenuList,{children:m.map(v=>g.jsxs(V.MenuItem,{...Hl(v,i,()=>a(!1)),children:[v.icon&&g.jsx(V.ListItemIcon,{children:v.icon}),g.jsx(V.ListItemText,{primary:v.label})]},`mobile-drawer-group-${b}-item-${v.path}`))}),f=(()=>{if(e){const m=e.filter(b=>b&&b.length>0);return m.length===0?null:m.map((b,v)=>g.jsxs(J.Fragment,{children:[l(b,v),v<m.length-1&&g.jsx(V.Divider,{})]},`mobile-drawer-group-${v}`))}return r?g.jsx(V.Box,{role:"presentation",onClick:()=>a(!1),children:r}):null})(),p=f??!1;return J.useEffect(()=>{a(!1)},[o]),p&&g.jsxs(g.Fragment,{children:[g.jsx(V.IconButton,{onClick:()=>a(!0),color:"inherit",title:"Menu",children:g.jsx(Yne,{})}),g.jsx(V.Drawer,{"data-testid":"mobile-drawer",anchor:n,open:s,onClose:()=>a(!1),children:g.jsx(V.Box,{sx:{width:300},display:"flex",flexDirection:"column",justifyContent:"space-between",children:g.jsx(V.Box,{display:"flex",justifyContent:"start",flexDirection:"column",children:f})})})]})},AA=t=>{const{env:e,isProd:n}=t;return n?null:g.jsx(V.Paper,{sx:{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsxs(V.Typography,{variant:"h6",color:"error",children:[e," Environment - Test Data Only"]})})},PA=t=>{const{displayName:e,userMenuOptions:n}=t;return g.jsx(MA,{label:e,menuOptions:n,icon:g.jsx(Jne,{})})},vm=t=>{const{menuOptions:e,orientation:n="horizontal",activeTabIdx:r,sx:o=n=="vertical"?{"& .MuiTabs-indicator":{left:0}}:void 0,slotProps:i={indicator:{sx:n=="horizontal"?{height:4}:{width:4}}}}=t,{palette:s}=V.useTheme(),a=ko.useNavigate();return g.jsx(V.Tabs,{orientation:n,value:r??!1,sx:o,slotProps:i,children:e.map((l,u)=>g.jsx(V.Tab,{icon:l.icon,label:l.label,value:u,...Hl(l,a),sx:{alignItems:n=="vertical"?"flex-start":void 0,borderBottom:n=="vertical"?"1px solid":void 0,borderColor:"divider","&.Mui-selected":{backgroundColor:n=="vertical"?s.grey[s.mode=="dark"?800:50]:void 0,color:"inherit"}}},l.label))})},NA=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t;return e.length>0&&g.jsx(V.Paper,{sx:{pl:4,pr:4,borderRadius:0},"data-testid":"navBar",children:g.jsx(vm,{menuOptions:e,activeTabIdx:n,sx:r})})},$A=t=>{const{onToggle:e}=t,{palette:n}=V.useTheme(),r=n.mode==="dark";return g.jsx(V.IconButton,{onClick:e,color:"inherit",title:"Dark Mode Toggle",children:r?g.jsx(BI,{}):g.jsx(jI,{})})},nfe=t=>{const{envInfo:e,headerRef:n,logo:r,featureMenuOptions:o=[],userMenuOptions:i=[],onToggleDarkMode:s,quickLinks:a=[],displayName:l,banner:u,position:f="fixed",children:p,sx:m,navBarSx:b}=t,v=ko.useNavigate(),y=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),{palette:x}=V.useTheme(),{pathname:C}=ko.useLocation(),k=x.mode==="dark",[T,S]=D.useState(void 0);D.useEffect(()=>{const P=o.findIndex($=>$.path&&C.startsWith($.path));S(P>=0?P:void 0)},[C,o]);const O=s&&g.jsx($A,{onToggle:s}),R=s&&(y||!y&&l)?[{icon:k?g.jsx(BI,{}):g.jsx(jI,{}),label:`Switch to ${k?"Light":"Dark"} mode`,onClick:s},...i]:i;return g.jsxs(V.AppBar,{ref:n,position:f,sx:m,elevation:4,children:[e&&g.jsx(AA,{...e}),u,g.jsxs(V.Toolbar,{sx:{color:"white",display:"flex",justifyContent:"space-between",gap:2},children:[g.jsx(V.Button,{disableRipple:!0,component:ko.Link,to:"/",children:r&&typeof r=="string"?g.jsx("img",{draggable:"false",src:r,style:{width:"200px",filter:"brightness(0) invert(1)"},alt:"logo"}):r}),g.jsxs(V.Box,{display:"flex",gap:2,alignItems:"center",children:[!l&&!y&&O,y&&g.jsx(DA,{menuOptionLists:[o,a,R],anchor:"right"}),!y&&g.jsxs(g.Fragment,{children:[g.jsx(V.Box,{display:"flex",gap:0,children:a==null?void 0:a.map((P,$)=>g.jsxs(V.Box,{display:"flex",alignItems:"center",children:[$>0&&g.jsx(V.Typography,{className:"quickLink-divider",color:x.primary.contrastText,children:"|"}),g.jsx(V.Button,{variant:"text",sx:{color:"white"},...Hl(P,v),children:g.jsxs(V.Box,{display:"flex",gap:"3px",alignItems:"center",children:[P.icon,P.label]})})]},P.label))}),p,l&&g.jsx(PA,{displayName:l,userMenuOptions:R})]})]})]}),!y&&g.jsx(NA,{featureMenuOptions:o,activeTabIdx:T,sx:b})]})},rfe=t=>{const{sx:e,menuOptions:n=[]}=t,{pathname:r}=ko.useLocation(),o=V.useMediaQuery(V.useTheme().breakpoints.down("sm")),[i,s]=J.useState(void 0);return J.useEffect(()=>{const a=n.findIndex(l=>l.path&&r.startsWith(l.path))??-1;s(a>=0?a:void 0)},[r,n]),!o&&n.length>0&&g.jsx(V.Box,{sx:e,children:g.jsx(V.Card,{sx:{height:"100%",width:200},children:g.jsx(vm,{orientation:"vertical",menuOptions:n,activeTabIdx:i})})})},ofe=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t,{palette:o}=V.useTheme();return e.length>0&&g.jsx(vm,{menuOptions:e,activeTabIdx:n,sx:{margin:"8px",backgroundColor:o.primary.dark,borderRadius:"8px","& .MuiTab-root":{color:o.secondary.light,flexDirection:"row",gap:"2px","& .MuiTab-icon":{marginBottom:"unset"},minHeight:"58px"},"& .MuiTab-root.Mui-selected":{color:o.primary.contrastText,fontSize:"120%"},"& .MuiTabs-indicator":{display:"none"},...r}})},ife=({children:t,getCitations:e})=>{const[n,r]=J.useState([]),[o,i]=J.useState(!1);J.useEffect(()=>{(async()=>e().then(f=>{r(p=>{const m=new Set(p.map(v=>v.id));return[...p.filter(v=>!m.has(v.id)),...f]}),i(!0)}).catch(f=>{console.error(`Error fetching citations: ${f==null?void 0:f.toString()}`)}))()},[]);const s=J.useCallback(u=>{r(f=>{const p=f.map(v=>{const y=u.find(x=>x.id===v.id);return y||v}),m=new Set(f.map(v=>v.id)),b=u.filter(v=>!m.has(v.id));return[...p,...b]})},[]),a=J.useCallback(u=>{const f=n.findIndex(p=>p.id===u.id);r(f!==-1?p=>{const m=[...p];return m[f]=u,m}:[...n,u])},[n]),l=J.useCallback(u=>r(n.filter(f=>f.id!==u)),[n]);return g.jsx(kA.Provider,{value:{citations:n,isLoaded:o,addUpdateCitation:a,deleteCitation:l,batchUpdate:s},children:t})},sfe=t=>g.jsx(td,{severity:"info",...t}),afe=t=>g.jsx(td,{severity:"warning",...t}),jA=t=>{const{crumbs:e}=t,n=ko.useNavigate(),r=e.map(o=>({label:o.label,onClick:()=>{var i;o.path?n(o.path):(i=o.onClick)==null||i.call(o)}}));return g.jsx(V.Breadcrumbs,{"aria-label":"breadcrumb",separator:g.jsx(Gne,{}),sx:{marginBottom:2},children:r.map(({label:o,...i},s)=>s<e.length-1?g.jsx(V.Link,{color:"primary",sx:{cursor:"pointer",fontWeight:"600"},underline:"hover",...Hl(i,n),children:o},o):g.jsx(V.Typography,{color:"text.primary",children:o},o))})},lfe=t=>{const{title:e,message:n,type:r,onClose:o,autoHideDuration:i,variant:s="leftBorder",elevation:a=6}=t,l=cfe(r);return g.jsx(V.Snackbar,{"data-testid":"message-snackbar",anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!0,onClose:u=>{u==null&&o()},autoHideDuration:i,children:g.jsx(td,{"data-testid":"message-snackbar-alert",severity:l,iconMapping:{info:cO(r),warning:cO(r)},onClose:o,elevation:a,variant:s,children:n?g.jsxs(g.Fragment,{children:[g.jsx(V.AlertTitle,{"data-testid":"alertTitle",sx:{fontWeight:"bold"},children:e}),n]}):e})})},cfe=t=>t=="logout"?"info":t=="timeout"?"warning":t,cO=t=>{if(t=="timeout")return g.jsx($ne,{});if(t=="logout")return g.jsx(Kne,{})},ufe=t=>{dfe(t);const{title:e,createButtonLabel:n="Add Item",showAddButton:r=!1,onAdd:o=()=>alert("Not implemented yet"),breadcrumbs:i=[],children:s,sx:a={},bottomGutter:l=!1}=t,u=V.useMediaQuery(V.useTheme().breakpoints.down("sm"));return!e&&(!r||!n)?null:g.jsxs(V.Box,{"data-testid":"MBv2-Page-Header",sx:{...a,...l&&{marginBottom:"4px"}},children:[i.length>0&&g.jsx(jA,{crumbs:i}),g.jsxs(V.Box,{className:"MBv2_PageHeader_Header",display:"flex",flexDirection:u?"column":"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[g.jsxs(V.Box,{className:"MBv2_PageHeader_TitleAndCreateBtn",display:"flex",flexDirection:"row",justifyContent:u||!s?"space-between":"start",alignItems:"center",width:"100%",gap:1,children:[typeof e=="string"?g.jsx(V.Typography,{className:"MBv2_PageHeader_Title",variant:"h2",children:e}):e,r&&g.jsxs(Tr,{className:"MBv2_PageHeader_CreateBtn",onClick:()=>o(),children:[g.jsx(Lne,{style:{marginRight:"0.5rem"}}),n]})]}),s&&g.jsx(V.Box,{width:u?"100%":"50%",children:s})]})]})},dfe=t=>{const{showAddButton:e,onAdd:n,createButtonLabel:r}=t,o="PageHeader component:";e&&!n&&console.warn(`${o} "showAddButton" is true but "onAdd" is not defined.`),e&&!r&&console.warn(`${o} "showAddButton" is true but "createButtonLabel" is not defined`)},ffe=t=>{const{title:e,titleIcon:n,fullWidthIcon:r=!1,children:o,actionLabel:i,action:s,sx:a}=t,l=V.useMediaQuery(V.useTheme().breakpoints.down("sm"));return g.jsxs(V.Card,{sx:a||{padding:"30px 40px",display:"flex",flexDirection:"column",gap:"1rem"},children:[n&&g.jsx(V.Box,{className:"MBv2_SingleActionCard_Img",sx:[r?{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"20px",marginBottom:"10px"}:{display:"inline"}],children:n}),g.jsx(V.Typography,{variant:"h1",display:"inline",fontSize:"calc(20px + .9vw)",className:"MBv2_SingleActionCard_Title",children:e}),o,g.jsx(V.Button,{variant:"contained",color:"primary",onClick:s,fullWidth:l,className:"MBv2_SingleActionCard_ActionButton",children:i})]})},pfe=t=>{const{title:e="Loading...",message:n}=t;return g.jsxs(V.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[g.jsxs(V.Box,{className:"text-content",children:[g.jsx(V.Typography,{variant:"h1","data-testid":"title",children:e}),n&&g.jsx(V.Typography,{"data-testid":"message",children:n})]}),g.jsx(V.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})};function hfe({...t}){return g.jsx(SA,{onSelectCitations:()=>{},onClose:()=>{},...t})}const mfe=t=>{const{size:e="small"}=t;let n=`${e}px`;switch(e){case"x-small":n="6px";break;case"small":n="10px";break;case"medium":n="14px";break;case"large":n="18px";break;case"x-large":n="22px";break}return g.jsx(V.Box,{height:n})};exports.AlertModal=Gde;exports.Autocomplete=_I;exports.Breadcrumbs=jA;exports.Button=Tr;exports.Checkbox=II;exports.CheckboxGroup=ane;exports.CitationField=Vde;exports.CitationFieldProvider=ife;exports.CitationManager=hfe;exports.Column=Iu;exports.ConfirmationModal=Yde;exports.DarkModeToggle=$A;exports.DateField=Ip;exports.DateRangeField=Dce;exports.DecisionModal=Jde;exports.Diff=MI;exports.DiffProvider=OM;exports.DiffTable=efe;exports.DiffTableView=IA;exports.Drawer=DA;exports.DynamicAutocomplete=ine;exports.EnvironmentBanner=AA;exports.ErrorAlert=wA;exports.FileList=une;exports.FileUpload=DI;exports.FloatingNavBar=ofe;exports.Footer=tfe;exports.FormDebugger=Wde;exports.Header=nfe;exports.HelpTooltip=tA;exports.IconTooltip=eA;exports.InfoAlert=sfe;exports.LoadingButton=bA;exports.LoadingIndicator=pfe;exports.LoadingOverlay=Ox;exports.Location=Dne;exports.MenuButton=MA;exports.Modal=ed;exports.MultiAutocomplete=sne;exports.NavBar=NA;exports.NotApplicableCheckbox=OA;exports.PageHeader=ufe;exports.PaginatedTable=nA;exports.ProfileMenu=PA;exports.RadioGroup=NI;exports.RangeSlider=Ane;exports.ReadOnly=Vi;exports.ReadOnlyProvider=kM;exports.RepeatableFormGroup=qde;exports.RichTextField=Oue;exports.Row=Yo;exports.ScrollToTop=Hde;exports.SearchField=VI;exports.Select=Pne;exports.SelectableCitationManager=TA;exports.Sidebar=rfe;exports.SingleActionCard=ffe;exports.Snackbar=lfe;exports.Spacer=mfe;exports.Stepper=Ude;exports.Submit=zde;exports.SuccessAlert=CA;exports.Switch=Nne;exports.Table=Mx;exports.Tabs=vm;exports.TextArea=$I;exports.TextField=Ri;exports.TextIcon=P0;exports.ValidationError=_r;exports.WarningAlert=afe;exports.baseCitationTableColumns=sA;exports.buildDiffData=_A;exports.buildTableDiff=RA;exports.commonTheme=In;exports.darkTheme=mz;exports.lightTheme=hz;exports.useDiff=Ia;exports.useReadOnly=Ra;
|