eehitus-my-task-list-ui 1.1.44 → 1.1.45

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/dist/index.cjs.js CHANGED
@@ -72,4 +72,4 @@
72
72
  animation-iteration-count: infinite;
73
73
  animation-delay: 200ms;
74
74
  }
75
- `),tC.rippleVisible,xC,550,(({theme:e})=>e.transitions.easing.easeInOut),tC.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),tC.child,tC.childLeaving,SC,550,(({theme:e})=>e.transitions.easing.easeInOut),tC.childPulsate,wC,(({theme:e})=>e.transitions.easing.easeInOut)),TC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiTouchRipple"}),{center:o=!1,classes:r={},className:i}=n,a=Go(n,mC),[s,l]=yo.useState([]),c=yo.useRef(0),d=yo.useRef(null);yo.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[s]);const u=yo.useRef(!1),p=iC(),f=yo.useRef(null),m=yo.useRef(null),g=yo.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:o,rippleSize:i,cb:a}=e;l((e=>[...e,(0,Eo.jsx)(EC,{classes:{ripple:cT(r.ripple,tC.ripple),rippleVisible:cT(r.rippleVisible,tC.rippleVisible),ripplePulsate:cT(r.ripplePulsate,tC.ripplePulsate),child:cT(r.child,tC.child),childLeaving:cT(r.childLeaving,tC.childLeaving),childPulsate:cT(r.childPulsate,tC.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:o,rippleSize:i},c.current)])),c.current+=1,d.current=a}),[r]),h=yo.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:r=!1,center:i=o||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&u.current)return void(u.current=!1);"touchstart"===(null==e?void 0:e.type)&&(u.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,d,h;if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),d=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),d=Math.round(n-l.top)}if(i)h=Math.sqrt((2*l.width**2+l.height**2)/3),h%2==0&&(h+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-d),d)+2;h=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===f.current&&(f.current=()=>{g({pulsate:r,rippleX:c,rippleY:d,rippleSize:h,cb:n})},p.start(80,(()=>{f.current&&(f.current(),f.current=null)}))):g({pulsate:r,rippleX:c,rippleY:d,rippleSize:h,cb:n})}),[o,g,p]),b=yo.useCallback((()=>{h({},{pulsate:!0})}),[h]),v=yo.useCallback(((e,t)=>{if(p.clear(),"touchend"===(null==e?void 0:e.type)&&f.current)return f.current(),f.current=null,void p.start(0,(()=>{v(e,t)}));f.current=null,l((e=>e.length>0?e.slice(1):e)),d.current=t}),[p]);return yo.useImperativeHandle(t,(()=>({pulsate:b,start:h,stop:v})),[b,h,v]),(0,Eo.jsx)(_C,Yo({className:cT(tC.root,r.root,i),ref:m},a,{children:(0,Eo.jsx)(fC,{component:null,exit:!0,children:s})}))}));function IC(e){return bI("MuiButtonBase",e)}const CC=vI("MuiButtonBase",["root","disabled","focusVisible"]);function MC(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function OC(...e){return yo.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{MC(e,t)}))}),e)}let DC=!0,kC=!1;const jC=new rC,AC={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function PC(e){e.metaKey||e.altKey||e.ctrlKey||(DC=!0)}function NC(){DC=!1}function RC(){"hidden"===this.visibilityState&&kC&&(DC=!0)}function LC(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return DC||function(e){const{type:t,tagName:n}=e;return!!("INPUT"===n&&AC[t]&&!e.readOnly||"TEXTAREA"===n&&!e.readOnly||e.isContentEditable)}(t)}function FC(){const e=yo.useCallback((e=>{null!=e&&function(e){e.addEventListener("keydown",PC,!0),e.addEventListener("mousedown",NC,!0),e.addEventListener("pointerdown",NC,!0),e.addEventListener("touchstart",NC,!0),e.addEventListener("visibilitychange",RC,!0)}(e.ownerDocument)}),[]),t=yo.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!LC(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(kC=!0,jC.start(100,(()=>{kC=!1})),t.current=!1,!0)},ref:e}}function UC(e){const t=yo.useRef(e);return zE((()=>{t.current=e})),yo.useRef(((...e)=>(0,t.current)(...e))).current}const VC=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],$C=fI("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${CC.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),BC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiButtonBase"}),{action:o,centerRipple:r=!1,children:i,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:u=!1,LinkComponent:p="a",onBlur:f,onClick:m,onContextMenu:g,onDragLeave:h,onFocus:b,onFocusVisible:v,onKeyDown:y,onKeyUp:x,onMouseDown:S,onMouseLeave:w,onMouseUp:_,onTouchEnd:E,onTouchMove:T,onTouchStart:I,tabIndex:C=0,TouchRippleProps:M,touchRippleRef:O,type:D}=n,k=Go(n,VC),j=yo.useRef(null),A=yo.useRef(null),P=OC(A,O),{isFocusVisibleRef:N,onFocus:R,onBlur:L,ref:F}=FC(),[U,V]=yo.useState(!1);l&&U&&V(!1),yo.useImperativeHandle(o,(()=>({focusVisible:()=>{V(!0),j.current.focus()}})),[]);const[$,B]=yo.useState(!1);yo.useEffect((()=>{B(!0)}),[]);const K=$&&!c&&!l;function z(e,t,n=d){return UC((o=>(t&&t(o),!n&&A.current&&A.current[e](o),!0)))}yo.useEffect((()=>{U&&u&&!c&&$&&A.current.pulsate()}),[c,u,U,$]);const H=z("start",S),Y=z("stop",g),G=z("stop",h),W=z("stop",_),q=z("stop",(e=>{U&&e.preventDefault(),w&&w(e)})),J=z("start",I),X=z("stop",E),Z=z("stop",T),Q=z("stop",(e=>{L(e),!1===N.current&&V(!1),f&&f(e)}),!1),ee=UC((e=>{j.current||(j.current=e.currentTarget),R(e),!0===N.current&&(V(!0),v&&v(e)),b&&b(e)})),te=()=>{const e=j.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ne=yo.useRef(!1),oe=UC((e=>{u&&!ne.current&&U&&A.current&&" "===e.key&&(ne.current=!0,A.current.stop(e,(()=>{A.current.start(e)}))),e.target===e.currentTarget&&te()&&" "===e.key&&e.preventDefault(),y&&y(e),e.target===e.currentTarget&&te()&&"Enter"===e.key&&!l&&(e.preventDefault(),m&&m(e))})),re=UC((e=>{u&&" "===e.key&&A.current&&U&&!e.defaultPrevented&&(ne.current=!1,A.current.stop(e,(()=>{A.current.pulsate(e)}))),x&&x(e),m&&e.target===e.currentTarget&&te()&&" "===e.key&&!e.defaultPrevented&&m(e)}));let ie=s;"button"===ie&&(k.href||k.to)&&(ie=p);const ae={};"button"===ie?(ae.type=void 0===D?"button":D,ae.disabled=l):(!k.href&&!k.to&&(ae.role="button"),l&&(ae["aria-disabled"]=l));const se=OC(t,F,j),le=Yo({},n,{centerRipple:r,component:s,disabled:l,disableRipple:c,disableTouchRipple:d,focusRipple:u,tabIndex:C,focusVisible:U}),ce=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:o,classes:r}=e,i=_I({root:["root",t&&"disabled",n&&"focusVisible"]},IC,r);return n&&o&&(i.root+=` ${o}`),i})(le);return(0,Eo.jsxs)($C,Yo({as:ie,className:cT(ce.root,a),ownerState:le,onBlur:Q,onClick:m,onContextMenu:Y,onFocus:ee,onKeyDown:oe,onKeyUp:re,onMouseDown:H,onMouseLeave:q,onMouseUp:W,onDragLeave:G,onTouchEnd:X,onTouchMove:Z,onTouchStart:J,ref:se,tabIndex:l?-1:C,type:D},ae,k,{children:[i,K?(0,Eo.jsx)(TC,Yo({ref:P,center:r},M)):null]}))})),KC=["edge","children","className","color","disabled","disableFocusRipple","size"],zC=fI(BC,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${Ai(n.color)}`],n.edge&&t[`edge${Ai(n.edge)}`],t[`size${Ai(n.size)}`]]}})((({theme:e,ownerState:t})=>Yo({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const o=null==(n=(e.vars||e).palette)?void 0:n[t.color];return Yo({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&Yo({color:null==o?void 0:o.main},!t.disableRipple&&{"&:hover":Yo({},o&&{backgroundColor:e.vars?`rgba(${o.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(o.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${eC.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),HC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiIconButton"}),{edge:o=!1,children:r,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:c="medium"}=n,d=Go(n,KC),u=Yo({},n,{edge:o,color:a,disabled:s,disableFocusRipple:l,size:c}),p=(e=>{const{classes:t,disabled:n,color:o,edge:r,size:i}=e;return _I({root:["root",n&&"disabled","default"!==o&&`color${Ai(o)}`,r&&`edge${Ai(r)}`,`size${Ai(i)}`]},QI,t)})(u);return(0,Eo.jsx)(zC,Yo({className:cT(p.root,i),centerRipple:!0,focusRipple:!l,disabled:s,ref:t},d,{ownerState:u,children:r}))})),YC=fI("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e,ownerState:t})=>Yo({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3)},t.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}))),GC=fI(ZI,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})((({ownerState:e})=>Yo({flex:1},!e.isLandscape&&{alignItems:"center"}))),WC=fI(HC,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(e,t)=>[{[`&.${NI.penIconButtonLandscape}`]:t.penIconButtonLandscape},t.penIconButton]})({}),qC=e=>"clock"===e?(0,Eo.jsx)(jI,{color:"inherit"}):(0,Eo.jsx)(kI,{color:"inherit"}),JC=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersToolbar"}),{children:o,className:r,getMobileKeyboardInputViewButtonText:i,isLandscape:a,isMobileKeyboardViewOpen:s,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:d,viewType:u="calendar"}=n,p=n,f=ZE(),m=(e=>{const{classes:t,isLandscape:n}=e;return _I({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},PI,t)})(p);return(0,Eo.jsxs)(YC,{ref:t,className:sT(m.root,r),ownerState:p,children:[(0,Eo.jsx)($I,{color:"text.secondary",variant:"overline",children:d}),(0,Eo.jsxs)(GC,{container:!0,justifyContent:"space-between",className:m.content,ownerState:p,direction:a?l:"row",alignItems:a?"flex-start":"flex-end",children:[o,(0,Eo.jsx)(WC,{onClick:c,className:m.penIconButton,ownerState:p,color:"inherit","aria-label":i?i(s,u):f.inputModeToggleButtonAriaLabel(s,u),children:s?qC(u):(0,Eo.jsx)(AI,{color:"inherit"})})]})]})}));function XC(e){return bI("MuiDatePickerToolbar",e)}vI("MuiDatePickerToolbar",["root","title"]);const ZC=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],QC=fI(JC,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),eM=fI($I,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})((({ownerState:e})=>Yo({},e.isLandscape&&{margin:"auto 16px auto auto"}))),tM=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiDatePickerToolbar"}),{parsedValue:o,isLandscape:r,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:a,toolbarFormat:s,toolbarPlaceholder:l="––",toolbarTitle:c,views:d}=n,u=Go(n,ZC),p=JE(),f=ZE(),m=(e=>{const{classes:t}=e;return _I({root:["root"],title:["title"]},XC,t)})(n),g=c??f.datePickerDefaultToolbarTitle,h=yo.useMemo((()=>o?s?p.formatByString(o,s):nT(d)?p.format(o,"year"):oT(d)?p.format(o,"month"):/en/.test(p.getCurrentLocaleCode())?p.format(o,"normalDateWithWeekday"):p.format(o,"normalDate"):l),[o,s,l,p,d]),b=n;return(0,Eo.jsx)(QC,Yo({ref:t,toolbarTitle:g,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:a,isLandscape:r,className:m.root},u,{children:(0,Eo.jsx)(eM,{variant:"h4",align:r?"left":"center",ownerState:b,className:m.title,children:h})}))})),nM=yo.createContext(null);function oM(e){return bI("MuiPickersPopper",e)}function rM(e,t){return Array.isArray(t)?t.every((t=>-1!==e.indexOf(t))):-1!==e.indexOf(t)}vI("MuiPickersPopper",["root","paper"]);const iM=(e,t)=>t=>{("Enter"===t.key||" "===t.key)&&(e(t),t.preventDefault(),t.stopPropagation())},aM=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?aM(t.shadowRoot):t:null},sM=e=>e.scrollTop;function lM(e,t){var n,o;const{timeout:r,easing:i,style:a={}}=e;return{duration:null!=(n=a.transitionDuration)?n:"number"==typeof r?r:r[t.mode]||0,easing:null!=(o=a.transitionTimingFunction)?o:"object"==typeof i?i[t.mode]:i,delay:a.transitionDelay}}const cM=!1;var dM=function(e){return e.scrollTop},uM="unmounted",pM="exited",fM="entering",mM="entered",gM="exiting",hM=function(e){function t(t,n){var o;o=e.call(this,t,n)||this;var r,i=n&&!n.isMounting?t.enter:t.appear;return o.appearStatus=null,t.in?i?(r=pM,o.appearStatus=fM):r=mM:r=t.unmountOnExit||t.mountOnEnter?uM:pM,o.state={status:r},o.nextCallback=null,o}aC(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===uM?{status:pM}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==fM&&n!==mM&&(t=fM):(n===fM||n===mM)&&(t=gM)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,o=this.props.timeout;return e=t=n=o,null!=o&&"number"!=typeof o&&(e=o.exit,t=o.enter,n=void 0!==o.appear?o.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===fM){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:qf.findDOMNode(this);n&&dM(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pM&&this.setState({status:uM})},n.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,r=this.props.nodeRef?[o]:[qf.findDOMNode(this),o],i=r[0],a=r[1],s=this.getTimeouts(),l=o?s.appear:s.enter;!e&&!n||cM?this.safeSetState({status:mM},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:fM},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:mM},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:qf.findDOMNode(this);t&&!cM?(this.props.onExit(o),this.safeSetState({status:gM},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:pM},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:pM},(function(){e.props.onExited(o)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:qf.findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=r[0],a=r[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===uM)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var o=Go(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return yo.createElement(sC.Provider,{value:null},"function"==typeof n?n(e,o):yo.cloneElement(yo.Children.only(n),o))},t}(yo.Component);function bM(){}function vM(e){var t;return parseInt(yo.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}hM.contextType=sC,hM.propTypes={},hM.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:bM,onEntering:bM,onEntered:bM,onExit:bM,onExiting:bM,onExited:bM},hM.UNMOUNTED=uM,hM.EXITED=pM,hM.ENTERING=fM,hM.ENTERED=mM,hM.EXITING=gM;const yM=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function xM(e){return`scale(${e}, ${e**2})`}const SM={entering:{opacity:1,transform:xM(1)},entered:{opacity:1,transform:"none"}},wM=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),_M=yo.forwardRef((function(e,t){const{addEndListener:n,appear:o=!0,children:r,easing:i,in:a,onEnter:s,onEntered:l,onEntering:c,onExit:d,onExited:u,onExiting:p,style:f,timeout:m="auto",TransitionComponent:g=hM}=e,h=Go(e,yM),b=iC(),v=yo.useRef(),y=BI(),x=yo.useRef(null),S=OC(x,vM(r),t),w=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},_=w(c),E=w(((e,t)=>{sM(e);const{duration:n,delay:o,easing:r}=lM({style:f,timeout:m,easing:i},{mode:"enter"});let a;"auto"===m?(a=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[y.transitions.create("opacity",{duration:a,delay:o}),y.transitions.create("transform",{duration:wM?a:.666*a,delay:o,easing:r})].join(","),s&&s(e,t)})),T=w(l),I=w(p),C=w((e=>{const{duration:t,delay:n,easing:o}=lM({style:f,timeout:m,easing:i},{mode:"exit"});let r;"auto"===m?(r=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=r):r=t,e.style.transition=[y.transitions.create("opacity",{duration:r,delay:n}),y.transitions.create("transform",{duration:wM?r:.666*r,delay:wM?n:n||.333*r,easing:o})].join(","),e.style.opacity=0,e.style.transform=xM(.75),d&&d(e)})),M=w(u);return(0,Eo.jsx)(g,Yo({appear:o,in:a,nodeRef:x,onEnter:E,onEntered:T,onEntering:_,onExit:C,onExited:M,onExiting:I,addEndListener:e=>{"auto"===m&&b.start(v.current||0,e),n&&n(x.current,e)},timeout:"auto"===m?null:m},h,{children:(e,t)=>yo.cloneElement(r,Yo({style:Yo({opacity:0,transform:xM(.75),visibility:"exited"!==e||a?void 0:"hidden"},SM[e],f,r.props.style),ref:S},t))}))}));function EM(e){return bI("MuiButton",e)}_M.muiSupportAuto=!0;const TM=vI("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),IM=yo.createContext({}),CM=yo.createContext(void 0),MM=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],OM=e=>Yo({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),DM=fI(BC,{shouldForwardProp:e=>pI(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ai(n.color)}`],t[`size${Ai(n.size)}`],t[`${n.variant}Size${Ai(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})((({theme:e,ownerState:t})=>{var n,o;const r="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],i="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return Yo({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Yo({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Yo({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${TM.focusVisible}`]:Yo({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${TM.disabled}`]:Yo({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${rr(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(n=(o=e.palette).getContrastText)?void 0:n.call(o,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:r,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})}),(({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${TM.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${TM.disabled}`]:{boxShadow:"none"}})),kM=fI("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${Ai(n.size)}`]]}})((({ownerState:e})=>Yo({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},OM(e)))),jM=fI("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${Ai(n.size)}`]]}})((({ownerState:e})=>Yo({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},OM(e)))),AM=yo.forwardRef((function(e,t){const n=yo.useContext(IM),o=yo.useContext(CM),r=wI({props:Aa(n,e),name:"MuiButton"}),{children:i,color:a="primary",component:s="button",className:l,disabled:c=!1,disableElevation:d=!1,disableFocusRipple:u=!1,endIcon:p,focusVisibleClassName:f,fullWidth:m=!1,size:g="medium",startIcon:h,type:b,variant:v="text"}=r,y=Go(r,MM),x=Yo({},r,{color:a,component:s,disabled:c,disableElevation:d,disableFocusRipple:u,fullWidth:m,size:g,type:b,variant:v}),S=(e=>{const{color:t,disableElevation:n,fullWidth:o,size:r,variant:i,classes:a}=e;return Yo({},a,_I({root:["root",i,`${i}${Ai(t)}`,`size${Ai(r)}`,`${i}Size${Ai(r)}`,`color${Ai(t)}`,n&&"disableElevation",o&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Ai(r)}`],endIcon:["icon","endIcon",`iconSize${Ai(r)}`]},EM,a))})(x),w=h&&(0,Eo.jsx)(kM,{className:S.startIcon,ownerState:x,children:h}),_=p&&(0,Eo.jsx)(jM,{className:S.endIcon,ownerState:x,children:p}),E=o||"";return(0,Eo.jsxs)(DM,Yo({ownerState:x,className:cT(n.className,S.root,l,E),component:s,disabled:c,focusRipple:!u,focusVisibleClassName:cT(S.focusVisible,f),ref:t,type:b},y,{classes:S,children:[w,i,_]}))}));function PM(e){return bI("MuiDialogActions",e)}vI("MuiDialogActions",["root","spacing"]);const NM=["className","disableSpacing"],RM=fI("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((({ownerState:e})=>Yo({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}}))),LM=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialogActions"}),{className:o,disableSpacing:r=!1}=n,i=Go(n,NM),a=Yo({},n,{disableSpacing:r}),s=(e=>{const{classes:t,disableSpacing:n}=e;return _I({root:["root",!n&&"spacing"]},PM,t)})(a);return(0,Eo.jsx)(RM,Yo({className:cT(s.root,o),ownerState:a,ref:t},i))})),FM=["onAccept","onClear","onCancel","onSetToday","actions"],UM=e=>{const{onAccept:t,onClear:n,onCancel:o,onSetToday:r,actions:i}=e,a=Go(e,FM),s=yo.useContext(nM),l=ZE(),c="function"==typeof i?i(s):i;if(null==c||0===c.length)return null;const d=null==c?void 0:c.map((e=>{switch(e){case"clear":return(0,Eo.jsx)(AM,{onClick:n,children:l.clearButtonLabel},e);case"cancel":return(0,Eo.jsx)(AM,{onClick:o,children:l.cancelButtonLabel},e);case"accept":return(0,Eo.jsx)(AM,{onClick:t,children:l.okButtonLabel},e);case"today":return(0,Eo.jsx)(AM,{onClick:r,children:l.todayButtonLabel},e);default:return null}}));return(0,Eo.jsx)(LM,Yo({},a,{children:d}))};function VM(e){return e&&e.ownerDocument||document}const $M=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function BM(e){const t=[],n=[];return Array.from(e.querySelectorAll($M)).forEach(((e,o)=>{const r=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1===r||!function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)||(0===r?t.push(e):n.push({documentOrder:o,tabIndex:r,node:e}))})),n.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function KM(){return!0}function zM(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:o=!1,disableRestoreFocus:r=!1,getTabbable:i=BM,isEnabled:a=KM,open:s}=e,l=yo.useRef(!1),c=yo.useRef(null),d=yo.useRef(null),u=yo.useRef(null),p=yo.useRef(null),f=yo.useRef(!1),m=yo.useRef(null),g=OC(vM(t),m),h=yo.useRef(null);yo.useEffect((()=>{!s||!m.current||(f.current=!n)}),[n,s]),yo.useEffect((()=>{if(!s||!m.current)return;const e=VM(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),f.current&&m.current.focus()),()=>{r||(u.current&&u.current.focus&&(l.current=!0,u.current.focus()),u.current=null)}}),[s]),yo.useEffect((()=>{if(!s||!m.current)return;const e=VM(m.current),t=t=>{h.current=t,!o&&a()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(l.current=!0,d.current&&d.current.focus())},n=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current)return void(l.current=!1);if(t.contains(e.activeElement)||o&&e.activeElement!==c.current&&e.activeElement!==d.current)return;if(e.activeElement!==p.current)p.current=null;else if(null!==p.current)return;if(!f.current)return;let n=[];if((e.activeElement===c.current||e.activeElement===d.current)&&(n=i(m.current)),n.length>0){var r,s;const e=!(null==(r=h.current)||!r.shiftKey||"Tab"!==(null==(s=h.current)?void 0:s.key)),t=n[0],o=n[n.length-1];"string"!=typeof t&&"string"!=typeof o&&(e?o.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const r=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()}),50);return()=>{clearInterval(r),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}}),[n,o,r,a,s,i]);const b=e=>{null===u.current&&(u.current=e.relatedTarget),f.current=!0};return(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:c,"data-testid":"sentinelStart"}),yo.cloneElement(t,{ref:g,onFocus:e=>{null===u.current&&(u.current=e.relatedTarget),f.current=!0,p.current=e.target;const n=t.props.onFocus;n&&n(e)}}),(0,Eo.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:d,"data-testid":"sentinelEnd"})]})}var HM={};Object.defineProperty(HM,"__esModule",{value:!0});var YM=HM.default=void 0,GM=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=qM(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}(yo),WM=OT;function qM(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(qM=function(e){return e?n:t})(e)}function JM(e){return bI("MuiPopper",e)}YM=HM.default=function(e=null){const t=GM.useContext(WM.ThemeContext);return!t||function(e){return 0===Object.keys(e).length}(t)?e:t},vI("MuiPopper",["root"]);const XM=yo.forwardRef((function(e,t){const{children:n,container:o,disablePortal:r=!1}=e,[i,a]=yo.useState(null),s=OC(yo.isValidElement(n)?vM(n):null,t);if(zE((()=>{r||a(function(e){return"function"==typeof e?e():e}(o)||document.body)}),[o,r]),zE((()=>{if(i&&!r)return MC(t,i),()=>{MC(t,null)}}),[t,i,r]),r){if(yo.isValidElement(n)){const e={ref:s};return yo.cloneElement(n,e)}return(0,Eo.jsx)(yo.Fragment,{children:n})}return(0,Eo.jsx)(yo.Fragment,{children:i&&qf.createPortal(n,i)})}));function ZM(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function QM(e){return e instanceof ZM(e).Element||e instanceof Element}function eO(e){return e instanceof ZM(e).HTMLElement||e instanceof HTMLElement}function tO(e){return!(typeof ShadowRoot>"u")&&(e instanceof ZM(e).ShadowRoot||e instanceof ShadowRoot)}var nO=Math.max,oO=Math.min,rO=Math.round;function iO(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function aO(){return!/^((?!chrome|android).)*safari/i.test(iO())}function sO(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&eO(e)&&(r=e.offsetWidth>0&&rO(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&rO(o.height)/e.offsetHeight||1);var a=(QM(e)?ZM(e):window).visualViewport,s=!aO()&&n,l=(o.left+(s&&a?a.offsetLeft:0))/r,c=(o.top+(s&&a?a.offsetTop:0))/i,d=o.width/r,u=o.height/i;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function lO(e){var t=ZM(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function cO(e){return e?(e.nodeName||"").toLowerCase():null}function dO(e){return((QM(e)?e.ownerDocument:e.document)||window.document).documentElement}function uO(e){return sO(dO(e)).left+lO(e).scrollLeft}function pO(e){return ZM(e).getComputedStyle(e)}function fO(e){var t=pO(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function mO(e,t,n){void 0===n&&(n=!1);var o=eO(t),r=eO(t)&&function(e){var t=e.getBoundingClientRect(),n=rO(t.width)/e.offsetWidth||1,o=rO(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),i=dO(t),a=sO(e,r,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!n)&&(("body"!==cO(t)||fO(i))&&(s=function(e){return e!==ZM(e)&&eO(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):lO(e)}(t)),eO(t)?((l=sO(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=uO(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function gO(e){var t=sO(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function hO(e){return"html"===cO(e)?e:e.assignedSlot||e.parentNode||(tO(e)?e.host:null)||dO(e)}function bO(e){return["html","body","#document"].indexOf(cO(e))>=0?e.ownerDocument.body:eO(e)&&fO(e)?e:bO(hO(e))}function vO(e,t){var n;void 0===t&&(t=[]);var o=bO(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=ZM(o),a=r?[i].concat(i.visualViewport||[],fO(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(vO(hO(a)))}function yO(e){return["table","td","th"].indexOf(cO(e))>=0}function xO(e){return eO(e)&&"fixed"!==pO(e).position?e.offsetParent:null}function SO(e){for(var t=ZM(e),n=xO(e);n&&yO(n)&&"static"===pO(n).position;)n=xO(n);return n&&("html"===cO(n)||"body"===cO(n)&&"static"===pO(n).position)?t:n||function(e){var t=/firefox/i.test(iO());if(/Trident/i.test(iO())&&eO(e)&&"fixed"===pO(e).position)return null;var n=hO(e);for(tO(n)&&(n=n.host);eO(n)&&["html","body"].indexOf(cO(n))<0;){var o=pO(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}var wO="top",_O="bottom",EO="right",TO="left",IO="auto",CO=[wO,_O,EO,TO],MO="start",OO="end",DO="viewport",kO="popper",jO=CO.reduce((function(e,t){return e.concat([t+"-"+MO,t+"-"+OO])}),[]),AO=[].concat(CO,[IO]).reduce((function(e,t){return e.concat([t,t+"-"+MO,t+"-"+OO])}),[]),PO=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function NO(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}function RO(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var LO={placement:"bottom",modifiers:[],strategy:"absolute"};function FO(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function UO(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?LO:r;return function(e,t,n){void 0===n&&(n=i);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},LO,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){var s="function"==typeof n?n(r.options):n;c(),r.options=Object.assign({},i,r.options,s),r.scrollParents={reference:QM(e)?vO(e):e.contextElement?vO(e.contextElement):[],popper:vO(t)};var d=function(e){var t=NO(e);return PO.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,r.options.modifiers)));return r.orderedModifiers=d.filter((function(e){return e.enabled})),r.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var s=i({state:r,name:t,instance:l,options:o}),c=function(){};a.push(s||c)}})),l.update()},forceUpdate:function(){if(!s){var e=r.elements,t=e.reference,n=e.popper;if(FO(t,n)){r.rects={reference:mO(t,SO(n),"fixed"===r.options.strategy),popper:gO(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(e){return r.modifiersData[e.name]=Object.assign({},e.data)}));for(var o=0;o<r.orderedModifiers.length;o++)if(!0!==r.reset){var i=r.orderedModifiers[o],a=i.fn,c=i.options,d=void 0===c?{}:c,u=i.name;"function"==typeof a&&(r=a({state:r,options:d,name:u,instance:l})||r)}else r.reset=!1,o=-1}}},update:RO((function(){return new Promise((function(e){l.forceUpdate(),e(r)}))})),destroy:function(){c(),s=!0}};if(!FO(e,t))return l;function c(){a.forEach((function(e){return e()})),a=[]}return l.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}var VO={passive:!0};const $O={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,a=o.resize,s=void 0===a||a,l=ZM(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,VO)})),s&&l.addEventListener("resize",n.update,VO),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,VO)})),s&&l.removeEventListener("resize",n.update,VO)}},data:{}};function BO(e){return e.split("-")[0]}function KO(e){return e.split("-")[1]}function zO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function HO(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?BO(r):null,a=r?KO(r):null,s=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(i){case wO:t={x:s,y:n.y-o.height};break;case _O:t={x:s,y:n.y+n.height};break;case EO:t={x:n.x+n.width,y:l};break;case TO:t={x:n.x-o.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?zO(i):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case MO:t[c]=t[c]-(n[d]/2-o[d]/2);break;case OO:t[c]=t[c]+(n[d]/2-o[d]/2)}}return t}const YO={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=HO({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var GO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WO(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,p=a.x,f=void 0===p?0:p,m=a.y,g=void 0===m?0:m,h="function"==typeof d?d({x:f,y:g}):{x:f,y:g};f=h.x,g=h.y;var b=a.hasOwnProperty("x"),v=a.hasOwnProperty("y"),y=TO,x=wO,S=window;if(c){var w=SO(n),_="clientHeight",E="clientWidth";if(w===ZM(n)&&("static"!==pO(w=dO(n)).position&&"absolute"===s&&(_="scrollHeight",E="scrollWidth")),r===wO||(r===TO||r===EO)&&i===OO)x=_O,g-=(u&&w===S&&S.visualViewport?S.visualViewport.height:w[_])-o.height,g*=l?1:-1;if(r===TO||(r===wO||r===_O)&&i===OO)y=EO,f-=(u&&w===S&&S.visualViewport?S.visualViewport.width:w[E])-o.width,f*=l?1:-1}var T,I=Object.assign({position:s},c&&GO),C=!0===d?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:rO(n*r)/r||0,y:rO(o*r)/r||0}}({x:f,y:g},ZM(n)):{x:f,y:g};return f=C.x,g=C.y,l?Object.assign({},I,((T={})[x]=v?"0":"",T[y]=b?"0":"",T.transform=(S.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",T)):Object.assign({},I,((t={})[x]=v?g+"px":"",t[y]=b?f+"px":"",t.transform="",t))}const qO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:BO(t.placement),variation:KO(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,WO(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,WO(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};const JO={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!eO(r)||!cO(r)||(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});!eO(o)||!cO(o)||(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};const XO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=void 0===r?[0,0]:r,a=AO.reduce((function(e,n){return e[n]=function(e,t,n){var o=BO(e),r=[TO,wO].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[TO,EO].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=a}};var ZO={left:"right",right:"left",bottom:"top",top:"bottom"};function QO(e){return e.replace(/left|right|bottom|top/g,(function(e){return ZO[e]}))}var eD={start:"end",end:"start"};function tD(e){return e.replace(/start|end/g,(function(e){return eD[e]}))}function nD(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tO(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function oD(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rD(e,t,n){return t===DO?oD(function(e,t){var n=ZM(e),o=dO(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;var c=aO();(c||!c&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s+uO(e),y:l}}(e,n)):QM(t)?function(e,t){var n=sO(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):oD(function(e){var t,n=dO(e),o=lO(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=nO(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=nO(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+uO(e),l=-o.scrollTop;return"rtl"===pO(r||n).direction&&(s+=nO(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(dO(e)))}function iD(e,t,n,o){var r="clippingParents"===t?function(e){var t=vO(hO(e)),n=["absolute","fixed"].indexOf(pO(e).position)>=0&&eO(e)?SO(e):e;return QM(n)?t.filter((function(e){return QM(e)&&nD(e,n)&&"body"!==cO(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce((function(t,n){var r=rD(e,n,o);return t.top=nO(r.top,t.top),t.right=oO(r.right,t.right),t.bottom=oO(r.bottom,t.bottom),t.left=nO(r.left,t.left),t}),rD(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function aD(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function sD(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function lD(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=void 0===o?e.placement:o,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,d=void 0===c?DO:c,u=n.elementContext,p=void 0===u?kO:u,f=n.altBoundary,m=void 0!==f&&f,g=n.padding,h=void 0===g?0:g,b=aD("number"!=typeof h?h:sD(h,CO)),v=p===kO?"reference":kO,y=e.rects.popper,x=e.elements[m?v:p],S=iD(QM(x)?x:x.contextElement||dO(e.elements.popper),l,d,a),w=sO(e.elements.reference),_=HO({reference:w,element:y,placement:r}),E=oD(Object.assign({},y,_)),T=p===kO?E:w,I={top:S.top-T.top+b.top,bottom:T.bottom-S.bottom+b.bottom,left:S.left-T.left+b.left,right:T.right-S.right+b.right},C=e.modifiersData.offset;if(p===kO&&C){var M=C[r];Object.keys(I).forEach((function(e){var t=[EO,_O].indexOf(e)>=0?1:-1,n=[wO,_O].indexOf(e)>=0?"y":"x";I[e]+=M[n]*t}))}return I}const cD={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,m=void 0===f||f,g=n.allowedAutoPlacements,h=t.options.placement,b=BO(h),v=l||(b===h||!m?[QO(h)]:function(e){if(BO(e)===IO)return[];var t=QO(e);return[tD(e),t,tD(t)]}(h)),y=[h].concat(v).reduce((function(e,n){return e.concat(BO(n)===IO?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?AO:l,d=KO(o),u=d?s?jO:jO.filter((function(e){return KO(e)===d})):CO,p=u.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=u);var f=p.reduce((function(t,n){return t[n]=lD(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[BO(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:d,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:g}):n)}),[]),x=t.rects.reference,S=t.rects.popper,w=new Map,_=!0,E=y[0],T=0;T<y.length;T++){var I=y[T],C=BO(I),M=KO(I)===MO,O=[wO,_O].indexOf(C)>=0,D=O?"width":"height",k=lD(t,{placement:I,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),j=O?M?EO:TO:M?_O:wO;x[D]>S[D]&&(j=QO(j));var A=QO(j),P=[];if(i&&P.push(k[C]<=0),s&&P.push(k[j]<=0,k[A]<=0),P.every((function(e){return e}))){E=I,_=!1;break}w.set(I,P)}if(_)for(var N=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},R=m?3:1;R>0;R--){if("break"===N(R))break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dD(e,t,n){return nO(e,oO(t,n))}const uD={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,p=n.tether,f=void 0===p||p,m=n.tetherOffset,g=void 0===m?0:m,h=lD(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),b=BO(t.placement),v=KO(t.placement),y=!v,x=zO(b),S=function(e){return"x"===e?"y":"x"}(x),w=t.modifiersData.popperOffsets,_=t.rects.reference,E=t.rects.popper,T="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,I="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(w){if(i){var O,D="y"===x?wO:TO,k="y"===x?_O:EO,j="y"===x?"height":"width",A=w[x],P=A+h[D],N=A-h[k],R=f?-E[j]/2:0,L=v===MO?_[j]:E[j],F=v===MO?-E[j]:-_[j],U=t.elements.arrow,V=f&&U?gO(U):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=$[D],K=$[k],z=dD(0,_[j],V[j]),H=y?_[j]/2-R-z-B-I.mainAxis:L-z-B-I.mainAxis,Y=y?-_[j]/2+R+z+K+I.mainAxis:F+z+K+I.mainAxis,G=t.elements.arrow&&SO(t.elements.arrow),W=G?"y"===x?G.clientTop||0:G.clientLeft||0:0,q=null!=(O=null==C?void 0:C[x])?O:0,J=A+Y-q,X=dD(f?oO(P,A+H-q-W):P,A,f?nO(N,J):N);w[x]=X,M[x]=X-A}if(s){var Z,Q="x"===x?wO:TO,ee="x"===x?_O:EO,te=w[S],ne="y"===S?"height":"width",oe=te+h[Q],re=te-h[ee],ie=-1!==[wO,TO].indexOf(b),ae=null!=(Z=null==C?void 0:C[S])?Z:0,se=ie?oe:te-_[ne]-E[ne]-ae+I.altAxis,le=ie?te+_[ne]+E[ne]-ae-I.altAxis:re,ce=f&&ie?function(e,t,n){var o=dD(e,t,n);return o>n?n:o}(se,te,le):dD(f?se:oe,te,f?le:re);w[S]=ce,M[S]=ce-te}t.modifiersData[o]=M}},requiresIfExists:["offset"]};const pD={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=BO(n.placement),l=zO(s),c=[TO,EO].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(e,t){return aD("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:sD(e,CO))}(r.padding,n),u=gO(i),p="y"===l?wO:TO,f="y"===l?_O:EO,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],h=SO(i),b=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,v=m/2-g/2,y=d[p],x=b-u[c]-d[f],S=b/2-u[c]/2+v,w=dD(y,S,x),_=l;n.modifiersData[o]=((t={})[_]=w,t.centerOffset=w-S,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"==typeof o&&!(o=t.elements.popper.querySelector(o))||nD(t.elements.popper,o)&&(t.elements.arrow=o))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fD(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function mD(e){return[wO,EO,_O,TO].some((function(t){return e[t]>=0}))}const gD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=lD(t,{elementContext:"reference"}),s=lD(t,{altBoundary:!0}),l=fD(a,o),c=fD(s,r,i),d=mD(l),u=mD(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var hD=UO({defaultModifiers:[$O,YO,qO,JO,XO,cD,uD,pD,gD]});function bD(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}function vD(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}const yD=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function xD(e){var t;const{elementType:n,externalSlotProps:o,ownerState:r,skipResolvingSlotProps:i=!1}=e,a=Go(e,yD),s=i?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(o,r),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:o,externalForwardedProps:r,className:i}=e;if(!t){const e=cT(null==n?void 0:n.className,i,null==r?void 0:r.className,null==o?void 0:o.className),t=Yo({},null==n?void 0:n.style,null==r?void 0:r.style,null==o?void 0:o.style),a=Yo({},n,r,o);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=bD(Yo({},r,o)),s=vD(o),l=vD(r),c=t(a),d=cT(null==c?void 0:c.className,null==n?void 0:n.className,i,null==r?void 0:r.className,null==o?void 0:o.className),u=Yo({},null==c?void 0:c.style,null==n?void 0:n.style,null==r?void 0:r.style,null==o?void 0:o.style),p=Yo({},c,n,l,s);return d.length>0&&(p.className=d),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:c.ref}}(Yo({},a,{externalSlotProps:s}));return function(e,t,n){return void 0===e||function(e){return"string"==typeof e}(e)?t:Yo({},t,{ownerState:Yo({},t.ownerState,n)})}(n,Yo({},l,{ref:OC(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),r)}const SD=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],wD=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function _D(e){return"function"==typeof e?e():e}function ED(e){return void 0!==e.nodeType}const TD={},ID=yo.forwardRef((function(e,t){var n;const{anchorEl:o,children:r,direction:i,disablePortal:a,modifiers:s,open:l,placement:c,popperOptions:d,popperRef:u,slotProps:p={},slots:f={},TransitionProps:m}=e,g=Go(e,SD),h=yo.useRef(null),b=OC(h,t),v=yo.useRef(null),y=OC(v,u),x=yo.useRef(y);zE((()=>{x.current=y}),[y]),yo.useImperativeHandle(u,(()=>v.current),[]);const S=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(c,i),[w,_]=yo.useState(S),[E,T]=yo.useState(_D(o));yo.useEffect((()=>{v.current&&v.current.forceUpdate()})),yo.useEffect((()=>{o&&T(_D(o))}),[o]),zE((()=>{if(!E||!l)return;let e=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:e})=>{(e=>{_(e.placement)})(e)}}];null!=s&&(e=e.concat(s)),d&&null!=d.modifiers&&(e=e.concat(d.modifiers));const t=hD(E,h.current,Yo({placement:S},d,{modifiers:e}));return x.current(t),()=>{t.destroy(),x.current(null)}}),[E,a,s,l,d,S]);const I={placement:w};null!==m&&(I.TransitionProps=m);const C=(e=>{const{classes:t}=e;return _I({root:["root"]},JM,t)})(e),M=null!=(n=f.root)?n:"div",O=xD({elementType:M,externalSlotProps:p.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:b},ownerState:e,className:C.root});return(0,Eo.jsx)(M,Yo({},O,{children:"function"==typeof r?r(I):r}))})),CD=yo.forwardRef((function(e,t){const{anchorEl:n,children:o,container:r,direction:i="ltr",disablePortal:a=!1,keepMounted:s=!1,modifiers:l,open:c,placement:d="bottom",popperOptions:u=TD,popperRef:p,style:f,transition:m=!1,slotProps:g={},slots:h={}}=e,b=Go(e,wD),[v,y]=yo.useState(!0);if(!s&&!c&&(!m||v))return null;let x;if(r)x=r;else if(n){const e=_D(n);x=e&&ED(e)?VM(e).body:VM(null).body}const S=c||!s||m&&!v?void 0:"none",w=m?{in:c,onEnter:()=>{y(!1)},onExited:()=>{y(!0)}}:void 0;return(0,Eo.jsx)(XM,{disablePortal:a,container:x,children:(0,Eo.jsx)(ID,Yo({anchorEl:n,direction:i,disablePortal:a,modifiers:l,ref:t,open:m?!v:c,placement:d,popperOptions:u,popperRef:p,slotProps:g,slots:h},b,{style:Yo({position:"fixed",top:0,left:0,display:S},f),TransitionProps:w,children:o}))})})),MD=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],OD=fI(CD,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),DD=yo.forwardRef((function(e,t){var n;const o=YM(),r=wI({props:e,name:"MuiPopper"}),{anchorEl:i,component:a,components:s,componentsProps:l,container:c,disablePortal:d,keepMounted:u,modifiers:p,open:f,placement:m,popperOptions:g,popperRef:h,transition:b,slots:v,slotProps:y}=r,x=Go(r,MD),S=null!=(n=null==v?void 0:v.root)?n:null==s?void 0:s.Root,w=Yo({anchorEl:i,container:c,disablePortal:d,keepMounted:u,modifiers:p,open:f,placement:m,popperOptions:g,popperRef:h,transition:b},x);return(0,Eo.jsx)(OD,Yo({as:a,direction:null==o?void 0:o.direction,slots:{root:S},slotProps:y??l},w,{ref:t}))})),kD=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function jD(e){return bI("MuiPaper",e)}vI("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const AD=["className","component","elevation","square","variant"],PD=fI("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})((({theme:e,ownerState:t})=>{var n;return Yo({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.divider}`},"elevation"===t.variant&&Yo({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${rr("#fff",kD(t.elevation))}, ${rr("#fff",kD(t.elevation))})`},e.vars&&{backgroundImage:null==(n=e.vars.overlays)?void 0:n[t.elevation]}))})),ND=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiPaper"}),{className:o,component:r="div",elevation:i=1,square:a=!1,variant:s="elevation"}=n,l=Go(n,AD),c=Yo({},n,{component:r,elevation:i,square:a,variant:s}),d=(e=>{const{square:t,elevation:n,variant:o,classes:r}=e;return _I({root:["root",o,!t&&"rounded","elevation"===o&&`elevation${n}`]},jD,r)})(c);return(0,Eo.jsx)(PD,Yo({as:r,ownerState:c,className:cT(d.root,o),ref:t},l))})),RD=["onClick","onTouchStart"],LD=fI(DD,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e})=>({zIndex:e.zIndex.modal}))),FD=fI(ND,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})((({ownerState:e})=>Yo({transformOrigin:"top center",outline:0},"top"===e.placement&&{transformOrigin:"bottom center"})));function UD(e){var t;const n=fl({props:e,name:"MuiPickersPopper"}),{anchorEl:o,children:r,containerRef:i=null,onBlur:a,onClose:s,onClear:l,onAccept:c,onCancel:d,onSetToday:u,open:p,PopperProps:f,role:m,TransitionComponent:g=_M,TrapFocusProps:h,PaperProps:b={},components:v,componentsProps:y}=n;yo.useEffect((()=>{function e(e){p&&("Escape"===e.key||"Esc"===e.key)&&s()}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[s,p]);const x=yo.useRef(null);yo.useEffect((()=>{"tooltip"!==m&&(p?x.current=aM(document):x.current&&x.current instanceof HTMLElement&&setTimeout((()=>{x.current instanceof HTMLElement&&x.current.focus()})))}),[p,m]);const[S,w,_]=function(e,t){const n=yo.useRef(!1),o=yo.useRef(!1),r=yo.useRef(null),i=yo.useRef(!1);yo.useEffect((()=>{if(e)return document.addEventListener("mousedown",t,!0),document.addEventListener("touchstart",t,!0),()=>{document.removeEventListener("mousedown",t,!0),document.removeEventListener("touchstart",t,!0),i.current=!1};function t(){i.current=!0}}),[e]);const a=UC((e=>{if(!i.current)return;const a=o.current;o.current=!1;const s=VM(r.current);if(!r.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,s))return;if(n.current)return void(n.current=!1);let l;l=e.composedPath?e.composedPath().indexOf(r.current)>-1:!s.documentElement.contains(e.target)||r.current.contains(e.target),!l&&!a&&t(e)})),s=()=>{o.current=!0};return yo.useEffect((()=>{if(e){const e=VM(r.current),t=()=>{n.current=!0};return e.addEventListener("touchstart",a),e.addEventListener("touchmove",t),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",t)}}}),[e,a]),yo.useEffect((()=>{if(e){const e=VM(r.current);return e.addEventListener("click",a),()=>{e.removeEventListener("click",a),o.current=!1}}}),[e,a]),[r,s,s]}(p,a??s),E=OC(yo.useRef(null),i),T=OC(E,S),I=n,C=(e=>{const{classes:t}=e;return _I({root:["root"],paper:["paper"]},oM,t)})(I),{onClick:M,onTouchStart:O}=b,D=Go(b,RD),k=null!=(t=null==v?void 0:v.ActionBar)?t:UM,j=(null==v?void 0:v.PaperContent)||yo.Fragment;return(0,Eo.jsx)(LD,Yo({transition:!0,role:m,open:p,anchorEl:o,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),s())},className:C.root},f,{children:({TransitionProps:e,placement:t})=>(0,Eo.jsx)(zM,Yo({open:p,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:"tooltip"===m,isEnabled:()=>!0},h,{children:(0,Eo.jsx)(g,Yo({},e,{children:(0,Eo.jsx)(FD,Yo({tabIndex:-1,elevation:8,ref:T,onClick:e=>{w(e),M&&M(e)},onTouchStart:e=>{_(e),O&&O(e)},ownerState:Yo({},I,{placement:t}),className:C.paper},D,{children:(0,Eo.jsxs)(j,Yo({},null==y?void 0:y.paperContent,{children:[r,(0,Eo.jsx)(k,Yo({onAccept:c,onClear:l,onCancel:d,onSetToday:u,actions:[]},null==y?void 0:y.actionBar))]}))}))}))}))}))}function VD(e){const{children:t,DateInputProps:n,KeyboardDateInputComponent:o,onClear:r,onDismiss:i,onCancel:a,onAccept:s,onSetToday:l,open:c,PopperProps:d,PaperProps:u,TransitionComponent:p,components:f,componentsProps:m}=e,g=yo.useRef(null),h=OC(n.inputRef,g);return(0,Eo.jsxs)(nM.Provider,{value:"desktop",children:[(0,Eo.jsx)(o,Yo({},n,{inputRef:h})),(0,Eo.jsx)(UD,{role:"dialog",open:c,anchorEl:g.current,TransitionComponent:p,PopperProps:d,PaperProps:u,onClose:i,onCancel:a,onClear:r,onAccept:s,onSetToday:l,components:f,componentsProps:m,children:t})]})}const $D=({props:e,value:t,adapter:n})=>{const o=n.utils.date(),r=n.utils.date(t),i=tT(n.utils,e.minDate,n.defaultDates.minDate),a=tT(n.utils,e.maxDate,n.defaultDates.maxDate);if(null===r)return null;switch(!0){case!n.utils.isValid(t):return"invalidDate";case!(!e.shouldDisableDate||!e.shouldDisableDate(r)):return"shouldDisableDate";case!(!e.disableFuture||!n.utils.isAfterDay(r,o)):return"disableFuture";case!(!e.disablePast||!n.utils.isBeforeDay(r,o)):return"disablePast";case!(!i||!n.utils.isBeforeDay(r,i)):return"minDate";case!(!a||!n.utils.isAfterDay(r,a)):return"maxDate";default:return null}},BD=({shouldDisableDate:e,minDate:t,maxDate:n,disableFuture:o,disablePast:r})=>{const i=qE();return yo.useCallback((a=>null!==$D({adapter:i,value:a,props:{shouldDisableDate:e,minDate:t,maxDate:n,disableFuture:o,disablePast:r}})),[i,e,t,n,o,r])},KD=(e,t)=>e===t,zD=e=>function(e,t,n){const{value:o,onError:r}=e,i=qE(),a=yo.useRef(null),s=t({adapter:i,value:o,props:e});return yo.useEffect((()=>{r&&!n(s,a.current)&&r(s,o),a.current=s}),[n,r,a,s,o]),s}(e,$D,KD),HD=(e,t,n)=>{const o=e.date(t);return null===t?"":e.isValid(o)?e.formatByString(o,n):""},YD="_",GD="2019-11-21T22:30:00.000",WD="2019-01-01T09:00:00.000";function qD(e,t,n,o){if(!e)return!1;const r=o.formatByString(o.date(WD),t).replace(n,YD),i=o.formatByString(o.date(GD),t).replace(n,"_"),a=i===r&&e===i;return!a&&o.lib,a}const JD=({acceptRegex:e=/[\d]/gi,disabled:t,disableMaskedInput:n,ignoreInvalidInputs:o,inputFormat:r,inputProps:i,label:a,mask:s,onChange:l,rawValue:c,readOnly:d,rifmFormatter:u,TextFieldProps:p,validationError:f})=>{const m=JE(),g=m.getFormatHelperText(r),{shouldUseMaskedInput:h,maskToUse:b}=yo.useMemo((()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const t=function(e,t,n,o){if(e)return e;const r=o.formatByString(o.date(WD),t).replace(n,YD);return r===o.formatByString(o.date(GD),t).replace(n,"_")?r:""}(s,r,e,m);return{shouldUseMaskedInput:qD(t,r,e,m),maskToUse:t}}),[e,n,r,s,m]),v=yo.useMemo((()=>h&&b?((e,t)=>n=>{let o=0;return n.split("").map(((r,i)=>{if(t.lastIndex=0,o>e.length-1)return"";const a=e[o],s=e[o+1],l=t.test(r)?r:"",c=a===YD?l:a+l;return o+=c.length,i===n.length-1&&s&&s!==YD?c?c+s:"":c})).join("")})(b,e):e=>e),[e,b,h]),y=null===c?null:m.date(c),[x,S]=yo.useState(y),[w,_]=yo.useState(HD(m,c,r)),E=yo.useRef(),T=yo.useRef(m.locale),I=yo.useRef(r);yo.useEffect((()=>{const e=c!==E.current,t=m.locale!==T.current,n=r!==I.current;if(E.current=c,T.current=m.locale,I.current=r,!e&&!t&&!n)return;const o=null===c?null:m.date(c),i=null===c||m.isValid(o);let a=null===x&&null===o;if(null!==x&&null!==o){const e=m.isEqual(x,o);if(e)a=!0;else{const t=Math.abs(m.getDiff(x,o));a=0===t?e:t<1e3}}if(!t&&!n&&(!i||a))return;const s=HD(m,c,r);S(o),_(s)}),[m,c,r,x]);const C=e=>{const t=""===e||e===s?"":e;_(t);const n=null===t?null:m.parse(t,r);o&&!m.isValid(n)||(S(n),l(n,t||void 0))},M=(e=>{const[,t]=(0,yo.useReducer)((e=>e+1),0),n=(0,yo.useRef)(null),{replace:o,append:r}=e,i=o?o(e.format(e.value)):e.format(e.value),a=(0,yo.useRef)(!1);return(0,yo.useLayoutEffect)((()=>{if(null==n.current)return;let[a,s,l,c,d]=n.current;n.current=null;const u=c&&d,p=a.slice(s.selectionStart).search(e.accept||/\d/g),f=-1!==p?p:0,m=t=>(t.match(e.accept||/\d/g)||[]).join(""),g=m(a.substr(0,s.selectionStart)),h=e=>{let t=0,n=0;for(let o=0;o!==g.length;++o){let r=e.indexOf(g[o],t)+1,i=m(e).indexOf(g[o],n)+1;i-n>1&&(r=t,i=n),n=Math.max(i,n),t=Math.max(t,r)}return t};if(!0===e.mask&&l&&!d){let e=h(a);const t=m(a.substr(e))[0];e=a.indexOf(t,e),a=`${a.substr(0,e)}${a.substr(e+1)}`}let b=e.format(a);null!=r&&s.selectionStart===a.length&&!d&&(l?b=r(b):""===m(b.slice(-1))&&(b=b.slice(0,-1)));const v=o?o(b):b;return i===v?t():e.onChange(v),()=>{let t=h(b);if(null!=e.mask&&(l||c&&!u))for(;b[t]&&""===m(b[t]);)t+=1;s.selectionStart=s.selectionEnd=t+(u?1+f:0)}})),(0,yo.useEffect)((()=>{const e=e=>{"Delete"===e.code&&(a.current=!0)},t=e=>{"Delete"===e.code&&(a.current=!1)};return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),{value:null!=n.current?n.current[0]:i,onChange:o=>{const r=o.target.value;n.current=[r,o.target,r.length>i.length,a.current,i===e.format(r)],t()}}})({value:w,onChange:C,format:u||v});return Yo({label:a,disabled:t,error:f,inputProps:Yo({},h?M:{value:w,onChange:e=>{C(e.currentTarget.value)}},{disabled:t,placeholder:g,readOnly:d,type:h?"tel":"text"},i)},p)},XD=yo.createContext(void 0);function ZD(e){return bI("MuiInputAdornment",e)}const QD=vI("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var ek;const tk=["children","className","component","disablePointerEvents","disableTypography","position","variant"],nk=fI("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ai(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((({theme:e,ownerState:t})=>Yo({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},"filled"===t.variant&&{[`&.${QD.positionStart}&:not(.${QD.hiddenLabel})`]:{marginTop:16}},"start"===t.position&&{marginRight:8},"end"===t.position&&{marginLeft:8},!0===t.disablePointerEvents&&{pointerEvents:"none"}))),ok=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiInputAdornment"}),{children:o,className:r,component:i="div",disablePointerEvents:a=!1,disableTypography:s=!1,position:l,variant:c}=n,d=Go(n,tk),u=yo.useContext(XD)||{};let p=c;c&&u.variant,u&&!p&&(p=u.variant);const f=Yo({},n,{hiddenLabel:u.hiddenLabel,size:u.size,disablePointerEvents:a,position:l,variant:p}),m=(e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:o,position:r,size:i,variant:a}=e;return _I({root:["root",n&&"disablePointerEvents",r&&`position${Ai(r)}`,a,o&&"hiddenLabel",i&&`size${Ai(i)}`]},ZD,t)})(f);return(0,Eo.jsx)(XD.Provider,{value:null,children:(0,Eo.jsx)(nk,Yo({as:i,ownerState:f,className:cT(m.root,r),ref:t},d,{children:"string"!=typeof o||s?(0,Eo.jsxs)(yo.Fragment,{children:["start"===l?ek||(ek=(0,Eo.jsx)("span",{className:"notranslate",children:"​"})):null,o]}):(0,Eo.jsx)($I,{color:"text.secondary",children:o})}))})})),rk=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],ik=yo.forwardRef((function(e,t){const{className:n,components:o={},disableOpenPicker:r,getOpenDialogAriaText:i,InputAdornmentProps:a,InputProps:s,inputRef:l,openPicker:c,OpenPickerButtonProps:d,renderInput:u}=e,p=Go(e,rk),f=ZE(),m=i??f.openDatePickerDialogue,g=JE(),h=JD(p),b=(null==a?void 0:a.position)||"end",v=o.OpenPickerIcon||kI;return u(Yo({ref:t,inputRef:l,className:n},h,{InputProps:Yo({},s,{[`${b}Adornment`]:r?void 0:(0,Eo.jsx)(ok,Yo({position:b},a,{children:(0,Eo.jsx)(HC,Yo({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},d,{onClick:c,children:(0,Eo.jsx)(v,{})}))}))})}))})),ak=(e,t)=>{const{onAccept:n,onChange:o,value:r,closeOnSelect:i}=e,a=JE(),{isOpen:s,setIsOpen:l}=(({open:e,onOpen:t,onClose:n})=>{const o=yo.useRef("boolean"==typeof e).current,[r,i]=yo.useState(!1);yo.useEffect((()=>{if(o){if("boolean"!=typeof e)throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}}),[o,e]);const a=yo.useCallback((e=>{o||i(e),e&&t&&t(),!e&&n&&n()}),[o,t,n]);return{isOpen:r,setIsOpen:a}})(e),c=yo.useMemo((()=>t.parseInput(a,r)),[t,a,r]),[d,u]=yo.useState(c),[p,f]=yo.useState((()=>({committed:c,draft:c,resetFallback:c}))),m=yo.useCallback((e=>{f((t=>{switch(e.action){case"setAll":case"acceptAndClose":return{draft:e.value,committed:e.value,resetFallback:e.value};case"setCommitted":return Yo({},t,{draft:e.value,committed:e.value});case"setDraft":return Yo({},t,{draft:e.value});default:return t}})),(e.forceOnChangeCall||!e.skipOnChangeCall&&!t.areValuesEqual(a,p.committed,e.value))&&o(e.value),"acceptAndClose"===e.action&&(l(!1),n&&!t.areValuesEqual(a,p.resetFallback,e.value)&&n(e.value))}),[n,o,l,p,a,t]);yo.useEffect((()=>{a.isValid(c)&&u(c)}),[a,c]),yo.useEffect((()=>{s&&m({action:"setAll",value:c,skipOnChangeCall:!0})}),[s]),t.areValuesEqual(a,p.committed,c)||m({action:"setCommitted",value:c,skipOnChangeCall:!0});const g=yo.useMemo((()=>({open:s,onClear:()=>{m({value:t.emptyValue,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(a,r,t.emptyValue)})},onAccept:()=>{m({value:p.draft,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(a,r,c)})},onDismiss:()=>{m({value:p.committed,action:"acceptAndClose"})},onCancel:()=>{m({value:p.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{m({value:t.getTodayValue(a),action:"acceptAndClose"})}})),[m,s,a,p,t,r,c]),[h,b]=yo.useState(!1),v=yo.useMemo((()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:h,toggleMobileKeyboardView:()=>b(!h),onDateChange:(e,t,n="partial")=>{switch(n){case"shallow":return m({action:"setDraft",value:e,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:e});case"finish":return m(i??"desktop"===t?{value:e,action:"acceptAndClose"}:{value:e,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}})),[m,h,p.draft,i]),y=yo.useCallback(((e,n)=>{const r=t.valueReducer?t.valueReducer(a,d,e):e;o(r,n)}),[o,t,d,a]),x={pickerProps:v,inputProps:yo.useMemo((()=>({onChange:y,open:s,rawValue:r,openPicker:()=>l(!0)})),[y,s,r,l]),wrapperProps:g};return yo.useDebugValue(x,(()=>({MuiPickerState:{dateState:p,other:x}}))),x};function sk({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=yo.useRef(void 0!==e),[i,a]=yo.useState(t),s=r?e:i;const l=yo.useCallback((e=>{r||a(e)}),[]);return[s,l]}function lk({onChange:e,onViewChange:t,openTo:n,view:o,views:r}){var i,a;const[s,l]=sk({name:"Picker",state:"view",controlled:o,default:n&&rM(r,n)?n:r[0]}),c=null!=(i=r[r.indexOf(s)-1])?i:null,d=null!=(a=r[r.indexOf(s)+1])?a:null,u=yo.useCallback((e=>{l(e),t&&t(e)}),[l,t]),p=yo.useCallback((()=>{d&&u(d)}),[d,u]);return{handleChangeAndOpenNext:yo.useCallback(((t,n)=>{const o="finish"===n;e(t,o&&d?"partial":n),o&&p()}),[d,e,p]),nextView:d,previousView:c,openNext:p,openView:s,setOpenView:u}}const ck=36,dk=110,uk=110,pk=dk-dk,fk=0-uk,mk=(e,t,n)=>{const o=t-dk,r=n-uk;let i=(e=>e*(180/Math.PI))(Math.atan2(pk,fk)-Math.atan2(o,r));i=Math.round(i/e)*e,i%=360;const a=o**2+r**2;return{value:Math.floor(i/e)||0,distance:Math.sqrt(a)}};function gk(e){return bI("MuiClockPointer",e)}vI("MuiClockPointer",["root","thumb"]);const hk=["className","hasSelected","isInner","type","value"],bk=fI("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e,ownerState:t})=>Yo({width:2,backgroundColor:e.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},t.shouldAnimate&&{transition:e.transitions.create(["transform","height"])}))),vk=fI("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})((({theme:e,ownerState:t})=>Yo({width:4,height:4,backgroundColor:e.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${e.palette.primary.main}`,boxSizing:"content-box"},t.hasSelected&&{backgroundColor:e.palette.primary.main})));function yk(e){const t=fl({props:e,name:"MuiClockPointer"}),{className:n,isInner:o,type:r,value:i}=t,a=Go(t,hk),s=yo.useRef(r);yo.useEffect((()=>{s.current=r}),[r]);const l=Yo({},t,{shouldAnimate:s.current!==r}),c=(e=>{const{classes:t}=e;return _I({root:["root"],thumb:["thumb"]},gk,t)})(l);return(0,Eo.jsx)(bk,Yo({style:(()=>{let e=360/("hours"===r?12:60)*i;return"hours"===r&&i>12&&(e-=360),{height:Math.round(220*(o?.26:.4)),transform:`rotateZ(${e}deg)`}})(),className:sT(n,c.root),ownerState:l},a,{children:(0,Eo.jsx)(vk,{ownerState:l,className:c.thumb})}))}function xk(e){return bI("MuiClock",e)}vI("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const Sk=fI("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)}))),wk=fI("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),_k=fI("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),Ek=fI("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})((({ownerState:e})=>Yo({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},e.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}))),Tk=fI("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})((({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:e.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}))),Ik=fI(HC,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})((({theme:e,ownerState:t})=>Yo({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,left:8},"am"===t.meridiemMode&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}}))),Ck=fI(HC,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})((({theme:e,ownerState:t})=>Yo({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,right:8},"pm"===t.meridiemMode&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}})));function Mk(e){const t=fl({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:o,autoFocus:r,children:i,date:a,getClockLabelText:s,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:d,minutesStep:u=1,onChange:p,selectedId:f,type:m,value:g,disabled:h,readOnly:b,className:v}=t,y=t,x=JE(),S=yo.useContext(nM),w=yo.useRef(!1),_=(e=>{const{classes:t}=e;return _I({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},xk,t)})(y),E=c(g,m),T=!n&&"hours"===m&&(g<1||g>12),I=(e,t)=>{h||b||c(e,m)||p(e,t)},C=(e,t)=>{let{offsetX:o,offsetY:r}=e;if(void 0===o){const t=e.target.getBoundingClientRect();o=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}const i="seconds"===m||"minutes"===m?((e,t,n=1)=>{const o=6*n;let{value:r}=mk(o,e,t);return r=r*n%60,r})(o,r,u):((e,t,n)=>{const{value:o,distance:r}=mk(30,e,t);let i=o||12;return n?i%=12:r<74&&(i+=12,i%=24),i})(o,r,!!n);I(i,t)},M=yo.useMemo((()=>"hours"===m||g%5==0),[m,g]),O="minutes"===m?u:1,D=yo.useRef(null);zE((()=>{r&&D.current.focus()}),[r]);return(0,Eo.jsxs)(Sk,{className:sT(v,_.root),children:[(0,Eo.jsxs)(wk,{className:_.clock,children:[(0,Eo.jsx)(Ek,{onTouchMove:e=>{w.current=!0,C(e,"shallow")},onTouchEnd:e=>{w.current&&(C(e,"finish"),w.current=!1)},onMouseUp:e=>{w.current&&(w.current=!1),C(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&C(e.nativeEvent,"shallow")},ownerState:{disabled:h},className:_.squareMask}),!E&&(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)(Tk,{className:_.pin}),a&&(0,Eo.jsx)(yk,{type:m,value:g,isInner:T,hasSelected:M})]}),(0,Eo.jsx)(_k,{"aria-activedescendant":f,"aria-label":s(m,a,x),ref:D,role:"listbox",onKeyDown:e=>{if(!w.current)switch(e.key){case"Home":I(0,"partial"),e.preventDefault();break;case"End":I("minutes"===m?59:23,"partial"),e.preventDefault();break;case"ArrowUp":I(g+O,"partial"),e.preventDefault();break;case"ArrowDown":I(g-O,"partial"),e.preventDefault()}},tabIndex:0,className:_.wrapper,children:i})]}),n&&("desktop"===S||o)&&(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)(Ik,{onClick:b?void 0:()=>l("am"),disabled:h||null===d,ownerState:y,className:_.amButton,children:(0,Eo.jsx)($I,{variant:"caption",children:"AM"})}),(0,Eo.jsx)(Ck,{disabled:h||null===d,onClick:b?void 0:()=>l("pm"),ownerState:y,className:_.pmButton,children:(0,Eo.jsx)($I,{variant:"caption",children:"PM"})})]})]})}function Ok(e){return bI("MuiClockNumber",e)}const Dk=vI("MuiClockNumber",["root","selected","disabled"]),kk=["className","disabled","index","inner","label","selected"],jk=fI("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Dk.disabled}`]:t.disabled},{[`&.${Dk.selected}`]:t.selected}]})((({theme:e,ownerState:t})=>Yo({height:ck,width:ck,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:e.palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:e.palette.background.paper},[`&.${Dk.selected}`]:{color:e.palette.primary.contrastText},[`&.${Dk.disabled}`]:{pointerEvents:"none",color:e.palette.text.disabled}},t.inner&&Yo({},e.typography.body2,{color:e.palette.text.secondary}))));function Ak(e){const t=fl({props:e,name:"MuiClockNumber"}),{className:n,disabled:o,index:r,inner:i,label:a,selected:s}=t,l=Go(t,kk),c=t,d=(e=>{const{classes:t,selected:n,disabled:o}=e;return _I({root:["root",n&&"selected",o&&"disabled"]},Ok,t)})(c),u=r%12/12*Math.PI*2-Math.PI/2,p=91*(i?.65:1),f=Math.round(Math.cos(u)*p),m=Math.round(Math.sin(u)*p);return(0,Eo.jsx)(jk,Yo({className:sT(n,d.root),"aria-disabled":!!o||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${f}px, ${m+92}px`},ownerState:c},l,{children:a}))}const Pk=({ampm:e,date:t,getClockNumberText:n,isDisabled:o,selectedId:r,utils:i})=>{const a=t?i.getHours(t):null,s=[],l=e?12:23,c=t=>null!==a&&(e?12===t?12===a||0===a:a===t||a-12===t:a===t);for(let t=e?1:0;t<=l;t+=1){let a=t.toString();0===t&&(a="00");const l=!e&&(0===t||t>12);a=i.formatNumber(a);const d=c(t);s.push((0,Eo.jsx)(Ak,{id:d?r:void 0,index:t,inner:l,selected:d,disabled:o(t),label:a,"aria-label":n(a)},t))}return s},Nk=({utils:e,value:t,isDisabled:n,getClockNumberText:o,selectedId:r})=>{const i=e.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map((([e,i],a)=>{const s=e===t;return(0,Eo.jsx)(Ak,{label:i,id:s?r:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":o(i)},e)}))};function Rk(e){return bI("MuiPickersArrowSwitcher",e)}vI("MuiPickersArrowSwitcher",["root","spacer","button"]);const Lk=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],Fk=fI("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Uk=fI("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})((({theme:e})=>({width:e.spacing(3)}))),Vk=fI(HC,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})((({ownerState:e})=>Yo({},e.hidden&&{visibility:"hidden"}))),$k=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:r,components:i,componentsProps:a,isLeftDisabled:s,isLeftHidden:l,isRightDisabled:c,isRightHidden:d,leftArrowButtonText:u,onLeftClick:p,onRightClick:f,rightArrowButtonText:m}=n,g=Go(n,Lk),h="rtl"===BI().direction,b=(null==a?void 0:a.leftArrowButton)||{},v=(null==i?void 0:i.LeftArrowIcon)||OI,y=(null==a?void 0:a.rightArrowButton)||{},x=(null==i?void 0:i.RightArrowIcon)||DI,S=n,w=(e=>{const{classes:t}=e;return _I({root:["root"],spacer:["spacer"],button:["button"]},Rk,t)})(S);return(0,Eo.jsxs)(Fk,Yo({ref:t,className:sT(w.root,r),ownerState:S},g,{children:[(0,Eo.jsx)(Vk,Yo({as:null==i?void 0:i.LeftArrowButton,size:"small","aria-label":u,title:u,disabled:s,edge:"end",onClick:p},b,{className:sT(w.button,b.className),ownerState:Yo({},S,b,{hidden:l}),children:h?(0,Eo.jsx)(x,{}):(0,Eo.jsx)(v,{})})),o?(0,Eo.jsx)($I,{variant:"subtitle1",component:"span",children:o}):(0,Eo.jsx)(Uk,{className:w.spacer,ownerState:S}),(0,Eo.jsx)(Vk,Yo({as:null==i?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},y,{className:sT(w.button,y.className),ownerState:Yo({},S,y,{hidden:d}),children:h?(0,Eo.jsx)(v,{}):(0,Eo.jsx)(x,{})}))]}))})),Bk=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Kk=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e);function zk(e,t,n){const o=JE(),r=((e,t)=>e?t.getHours(e)>=12?"pm":"am":null)(e,o),i=yo.useCallback((r=>{const i=null==e?null:((e,t,n,o)=>{const r=Bk(o.getHours(e),t,n);return o.setHours(e,r)})(e,r,!!t,o);n(i,"partial")}),[t,e,n,o]);return{meridiemMode:r,handleMeridiemChange:i}}function Hk(e){return bI("MuiClockPicker",e)}vI("MuiClockPicker",["root","arrowSwitcher"]);let Yk=0;const Gk=yo.useId;function Wk(e){if(void 0!==Gk){const t=Gk();return e??t}return function(e){const[t,n]=yo.useState(e),o=e||t;return yo.useEffect((()=>{null==t&&(Yk+=1,n(`mui-${Yk}`))}),[t]),o}(e)}const qk=fI("div")({overflowX:"hidden",width:320,maxHeight:358,display:"flex",flexDirection:"column",margin:"0 auto"}),Jk=fI(qk,{name:"MuiClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),Xk=fI($k,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),Zk=()=>{},Qk=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiClockPicker"}),{ampm:o=!1,ampmInClock:r=!1,autoFocus:i,components:a,componentsProps:s,date:l,disableIgnoringDatePartForTimeValidation:c,getClockLabelText:d,getHoursClockNumberText:u,getMinutesClockNumberText:p,getSecondsClockNumberText:f,leftArrowButtonText:m,maxTime:g,minTime:h,minutesStep:b=1,rightArrowButtonText:v,shouldDisableTime:y,showViewSwitcher:x,onChange:S,view:w,views:_=["hours","minutes"],openTo:E,onViewChange:T,className:I,disabled:C,readOnly:M}=n;Zk({leftArrowButtonText:m,rightArrowButtonText:v,getClockLabelText:d,getHoursClockNumberText:u,getMinutesClockNumberText:p,getSecondsClockNumberText:f});const O=ZE(),D=m??O.openPreviousView,k=v??O.openNextView,j=d??O.clockLabelText,A=u??O.hoursClockNumberText,P=p??O.minutesClockNumberText,N=f??O.secondsClockNumberText,{openView:R,setOpenView:L,nextView:F,previousView:U,handleChangeAndOpenNext:V}=lk({view:w,views:_,openTo:E,onViewChange:T,onChange:S}),$=QE(),B=JE(),K=yo.useMemo((()=>l||B.setSeconds(B.setMinutes(B.setHours($,0),0),0)),[l,$,B]),{meridiemMode:z,handleMeridiemChange:H}=zk(K,o,V),Y=yo.useCallback(((e,t)=>{const n=((e=!1,t)=>(n,o)=>e?t.isAfter(n,o):Kk(n,t)>Kk(o,t))(c,B),r=({start:e,end:t})=>!(h&&n(h,t)||g&&n(e,g)),i=(e,n=1)=>e%n==0&&(!y||!y(e,t));switch(t){case"hours":{const t=Bk(e,z,o),n=B.setHours(K,t);return!r({start:B.setSeconds(B.setMinutes(n,0),0),end:B.setSeconds(B.setMinutes(n,59),59)})||!i(t)}case"minutes":{const t=B.setMinutes(K,e);return!r({start:B.setSeconds(t,0),end:B.setSeconds(t,59)})||!i(e,b)}case"seconds":{const t=B.setSeconds(K,e);return!r({start:t,end:t})||!i(e)}default:throw new Error("not supported")}}),[o,K,c,g,z,h,b,y,B]),G=Wk(),W=yo.useMemo((()=>{switch(R){case"hours":return{onChange:(e,t)=>{const n=Bk(e,z,o);V(B.setHours(K,n),t)},value:B.getHours(K),children:Pk({date:l,utils:B,ampm:o,getClockNumberText:A,isDisabled:e=>C||Y(e,"hours"),selectedId:G})};case"minutes":{const e=B.getMinutes(K);return{value:e,onChange:(e,t)=>{V(B.setMinutes(K,e),t)},children:Nk({utils:B,value:e,getClockNumberText:P,isDisabled:e=>C||Y(e,"minutes"),selectedId:G})}}case"seconds":{const e=B.getSeconds(K);return{value:e,onChange:(e,t)=>{V(B.setSeconds(K,e),t)},children:Nk({utils:B,value:e,getClockNumberText:N,isDisabled:e=>C||Y(e,"seconds"),selectedId:G})}}default:throw new Error("You must provide the type for ClockView")}}),[R,B,l,o,A,P,N,z,V,K,Y,G,C]),q=n,J=(e=>{const{classes:t}=e;return _I({root:["root"],arrowSwitcher:["arrowSwitcher"]},Hk,t)})(q);return(0,Eo.jsxs)(Jk,{ref:t,className:sT(J.root,I),ownerState:q,children:[x&&(0,Eo.jsx)(Xk,{className:J.arrowSwitcher,leftArrowButtonText:D,rightArrowButtonText:k,components:a,componentsProps:s,onLeftClick:()=>L(U),onRightClick:()=>L(F),isLeftDisabled:!U,isRightDisabled:!F,ownerState:q}),(0,Eo.jsx)(Mk,Yo({autoFocus:i,date:l,ampmInClock:r,type:R,ampm:o,getClockLabelText:j,minutesStep:b,isTimeDisabled:Y,meridiemMode:z,handleMeridiemChange:H,selectedId:G,disabled:C,readOnly:M},W))]})}));function ej(e){return bI("PrivatePickersMonth",e)}const tj=vI("PrivatePickersMonth",["root","selected"]);function nj(e){if(e.type)return e;if("#"===e.charAt(0))return nj(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error(Qo(9,e));let o,r=e.substring(t+1,e.length-1);if("color"===n){if(r=r.split(" "),o=r.shift(),4===r.length&&"/"===r[3].charAt(0)&&(r[3]=r[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o))throw new Error(Qo(10,o))}else r=r.split(",");return r=r.map((e=>parseFloat(e))),{type:n,values:r,colorSpace:o}}function oj(e,t){return e=nj(e),t=function(e,t=0,n=1){return tr(e,t,n)}(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,function(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return-1!==t.indexOf("rgb")?o=o.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=-1!==t.indexOf("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}(e)}const rj=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],ij=fI($I,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${tj.selected}`]:t.selected}]})((({theme:e})=>Yo({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:e.palette.text.secondary},[`&.${tj.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}}))),aj=()=>{},sj=e=>{const{disabled:t,onSelect:n,selected:o,value:r,tabIndex:i,hasFocus:a,onFocus:s=aj,onBlur:l=aj}=e,c=Go(e,rj),d=(e=>{const{classes:t,selected:n}=e;return _I({root:["root",n&&"selected"]},ej,t)})(e),u=()=>{n(r)},p=yo.useRef(null);return zE((()=>{var e;a&&(null==(e=p.current)||e.focus())}),[a]),(0,Eo.jsx)(ij,Yo({ref:p,component:"button",type:"button",className:d.root,tabIndex:i,onClick:u,onKeyDown:iM(u),color:o?"primary":void 0,variant:o?"h5":"subtitle1",disabled:t,onFocus:e=>s(e,r),onBlur:e=>l(e,r)},c))};function lj(e){return bI("MuiMonthPicker",e)}vI("MuiMonthPicker",["root"]);const cj=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"];const dj=fI("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),uj=yo.forwardRef((function(e,t){const n=JE(),o=QE(),r=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({disableFuture:!1,disablePast:!1},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiMonthPicker"),{className:i,date:a,disabled:s,disableFuture:l,disablePast:c,maxDate:d,minDate:u,onChange:p,shouldDisableMonth:f,readOnly:m,disableHighlightToday:g,autoFocus:h=!1,onMonthFocus:b,hasFocus:v,onFocusedViewChange:y}=r,x=Go(r,cj),S=r,w=(e=>{const{classes:t}=e;return _I({root:["root"]},lj,t)})(S),_=pl(),E=yo.useMemo((()=>a??n.startOfMonth(o)),[o,n,a]),T=yo.useMemo((()=>null!=a?n.getMonth(a):g?null:n.getMonth(o)),[o,a,n,g]),[I,C]=yo.useState((()=>T||n.getMonth(o))),M=yo.useCallback((e=>{const t=n.startOfMonth(c&&n.isAfter(o,u)?o:u),r=n.startOfMonth(l&&n.isBefore(o,d)?o:d);return!(!n.isBefore(e,t)&&!n.isAfter(e,r))||!!f&&f(e)}),[l,c,d,u,o,f,n]),O=e=>{if(m)return;const t=n.setMonth(E,e);p(t,"finish")},[D,k]=sk({name:"MonthPicker",state:"hasFocus",controlled:v,default:h}),j=yo.useCallback((e=>{k(e),y&&y(e)}),[k,y]),A=yo.useCallback((e=>{M(n.setMonth(E,e))||(C(e),j(!0),b&&b(e))}),[M,n,E,j,b]);yo.useEffect((()=>{C((e=>null!==T&&e!==T?T:e))}),[T]);const P=UC((e=>{switch(e.key){case"ArrowUp":A((12+I-3)%12),e.preventDefault();break;case"ArrowDown":A((12+I+3)%12),e.preventDefault();break;case"ArrowLeft":A((12+I+("ltr"===_.direction?-1:1))%12),e.preventDefault();break;case"ArrowRight":A((12+I+("ltr"===_.direction?1:-1))%12),e.preventDefault()}})),N=yo.useCallback(((e,t)=>{A(t)}),[A]),R=yo.useCallback((()=>{j(!1)}),[j]),L=n.getMonth(o);return(0,Eo.jsx)(dj,Yo({ref:t,className:sT(w.root,i),ownerState:S,onKeyDown:P},x,{children:n.getMonthArray(E).map((e=>{const t=n.getMonth(e),o=n.format(e,"monthShort"),r=s||M(e);return(0,Eo.jsx)(sj,{value:t,selected:t===T,tabIndex:t!==I||r?-1:0,hasFocus:D&&t===I,onSelect:O,onFocus:N,onBlur:R,disabled:r,"aria-current":L===t?"date":void 0,children:o},o)}))}))})),pj=({date:e,defaultCalendarMonth:t,disableFuture:n,disablePast:o,disableSwitchToMonthOnDayFocus:r=!1,maxDate:i,minDate:a,onMonthChange:s,reduceAnimations:l,shouldDisableDate:c})=>{var d;const u=QE(),p=JE(),f=yo.useRef(((e,t,n)=>(o,r)=>{switch(r.type){case"changeMonth":return Yo({},o,{slideDirection:r.direction,currentMonth:r.newMonth,isMonthSwitchingAnimating:!e});case"finishMonthSwitchingAnimation":return Yo({},o,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=o.focusedDay&&null!=r.focusedDay&&n.isSameDay(r.focusedDay,o.focusedDay))return o;const i=null!=r.focusedDay&&!t&&!n.isSameMonth(o.currentMonth,r.focusedDay);return Yo({},o,{focusedDay:r.focusedDay,isMonthSwitchingAnimating:i&&!e&&!r.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(r.focusedDay):o.currentMonth,slideDirection:null!=r.focusedDay&&n.isAfterDay(r.focusedDay,o.currentMonth)?"left":"right"})}default:throw new Error("missing support")}})(!!l,r,p)).current,[m,g]=yo.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:e||u,currentMonth:p.startOfMonth(null!=(d=e??t)?d:u),slideDirection:"left"}),h=yo.useCallback((e=>{g(Yo({type:"changeMonth"},e)),s&&s(e.newMonth)}),[s]),b=yo.useCallback((e=>{const t=e??u;p.isSameMonth(t,m.currentMonth)||h({newMonth:p.startOfMonth(t),direction:p.isAfterDay(t,m.currentMonth)?"left":"right"})}),[m.currentMonth,h,u,p]),v=BD({shouldDisableDate:c,minDate:a,maxDate:i,disableFuture:n,disablePast:o}),y=yo.useCallback((()=>{g({type:"finishMonthSwitchingAnimation"})}),[]),x=yo.useCallback(((e,t)=>{v(e)||g({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),[v]);return{calendarState:m,changeMonth:b,changeFocusedDay:x,isDateDisabled:v,onMonthSwitchingAnimationEnd:y,handleChangeMonth:h}},fj=e=>bI("MuiPickersFadeTransitionGroup",e);vI("MuiPickersFadeTransitionGroup",["root"]);const mj=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],gj={entering:{opacity:1},entered:{opacity:1}},hj=yo.forwardRef((function(e,t){const n=BI(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:r,appear:i=!0,children:a,easing:s,in:l,onEnter:c,onEntered:d,onEntering:u,onExit:p,onExited:f,onExiting:m,style:g,timeout:h=o,TransitionComponent:b=hM}=e,v=Go(e,mj),y=yo.useRef(null),x=OC(y,vM(a),t),S=e=>t=>{if(e){const n=y.current;void 0===t?e(n):e(n,t)}},w=S(u),_=S(((e,t)=>{sM(e);const o=lM({style:g,timeout:h,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",o),e.style.transition=n.transitions.create("opacity",o),c&&c(e,t)})),E=S(d),T=S(m),I=S((e=>{const t=lM({style:g,timeout:h,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),p&&p(e)})),C=S(f);return(0,Eo.jsx)(b,Yo({appear:i,in:l,nodeRef:y,onEnter:_,onEntered:E,onEntering:w,onExit:I,onExited:C,onExiting:T,addEndListener:e=>{r&&r(y.current,e)},timeout:h},v,{children:(e,t)=>yo.cloneElement(a,Yo({style:Yo({opacity:0,visibility:"exited"!==e||l?void 0:"hidden"},gj[e],g,a.props.style),ref:x},t))}))})),bj=fI(fC,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function vj(e){const t=fl({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:o,reduceAnimations:r,transKey:i}=t,a=(e=>{const{classes:t}=e;return _I({root:["root"]},fj,t)})(t);return r?n:(0,Eo.jsx)(bj,{className:sT(a.root,o),children:(0,Eo.jsx)(hj,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:500,enter:250,exit:0},children:n},i)})}function yj(e){return bI("MuiPickersDay",e)}const xj=vI("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Sj=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],wj=({theme:e,ownerState:t})=>Yo({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:e.palette.background.paper,color:e.palette.text.primary,"&:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},"&:focus":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity),[`&.${xj.selected}`]:{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${xj.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium,transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${xj.disabled}`]:{color:e.palette.text.disabled}},!t.disableMargin&&{margin:"0 2px"},t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&{color:e.palette.text.secondary},!t.disableHighlightToday&&t.today&&{[`&:not(.${xj.selected})`]:{border:`1px solid ${e.palette.text.secondary}`}}),_j=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},Ej=fI(BC,{name:"MuiPickersDay",slot:"Root",overridesResolver:_j})(wj),Tj=fI("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:_j})((({theme:e,ownerState:t})=>Yo({},wj({theme:e,ownerState:t}),{opacity:0,pointerEvents:"none"}))),Ij=()=>{},Cj=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersDay"}),{autoFocus:o=!1,className:r,day:i,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:c,onClick:d,onDaySelect:u,onFocus:p=Ij,onBlur:f=Ij,onKeyDown:m=Ij,onMouseDown:g,outsideCurrentMonth:h,selected:b=!1,showDaysOutsideCurrentMonth:v=!1,children:y,today:x=!1}=n,S=Go(n,Sj),w=Yo({},n,{autoFocus:o,disabled:a,disableHighlightToday:s,disableMargin:l,selected:b,showDaysOutsideCurrentMonth:v,today:x}),_=(e=>{const{selected:t,disableMargin:n,disableHighlightToday:o,today:r,disabled:i,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e;return _I({root:["root",t&&"selected",i&&"disabled",!n&&"dayWithMargin",!o&&r&&"today",a&&s&&"dayOutsideMonth",a&&!s&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},yj,l)})(w),E=JE(),T=yo.useRef(null),I=OC(T,t);zE((()=>{o&&!a&&!c&&!h&&T.current.focus()}),[o,a,c,h]);return h&&!v?(0,Eo.jsx)(Tj,{className:sT(_.root,_.hiddenDaySpacingFiller,r),ownerState:w,role:S.role}):(0,Eo.jsx)(Ej,Yo({className:sT(_.root,r),ownerState:w,ref:I,centerRipple:!0,disabled:a,tabIndex:b?0:-1,onKeyDown:e=>m(e,i),onFocus:e=>p(e,i),onBlur:e=>f(e,i),onClick:e=>{a||u(i,"finish"),h&&e.currentTarget.focus(),d&&d(e)},onMouseDown:e=>{g&&g(e),h&&e.preventDefault()}},S,{children:y||E.format(i,"dayOfMonth")}))})),Mj=(e,t)=>e.autoFocus===t.autoFocus&&e.isAnimating===t.isAnimating&&e.today===t.today&&e.disabled===t.disabled&&e.selected===t.selected&&e.disableMargin===t.disableMargin&&e.showDaysOutsideCurrentMonth===t.showDaysOutsideCurrentMonth&&e.disableHighlightToday===t.disableHighlightToday&&e.className===t.className&&e.sx===t.sx&&e.outsideCurrentMonth===t.outsideCurrentMonth&&e.onFocus===t.onFocus&&e.onBlur===t.onBlur&&e.onDaySelect===t.onDaySelect,Oj=yo.memo(Cj,Mj),Dj=e=>bI("PrivatePickersSlideTransition",e),kj=vI("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]);function jj(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Aj=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return function(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=jj(e.className,t):e.setAttribute("class",jj(e.className&&e.className.baseVal||"",t))}(e,t)}))},Pj=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1];t.removeClasses(r,"exit"),t.addClass(r,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.addClass(r,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.removeClasses(r,i),t.addClass(r,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,o="string"==typeof n,r=o?""+(o&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:o?r+"-active":n[e+"Active"],doneClassName:o?r+"-done":n[e+"Done"]}},t}aC(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var o=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(o+=" "+r),"active"===n&&e&&dM(e),o&&(this.appliedClasses[t][n]=o,function(e,t){e&&t&&t.split(" ").forEach((function(t){return function(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}(e,t)}))}(e,o))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],o=n.base,r=n.active,i=n.done;this.appliedClasses[t]={},o&&Aj(e,o),r&&Aj(e,r),i&&Aj(e,i)},n.render=function(){var e=this.props;e.classNames;var t=Go(e,["classNames"]);return yo.createElement(hM,Yo({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(yo.Component);Pj.defaultProps={classNames:""},Pj.propTypes={};const Nj=["children","className","reduceAnimations","slideDirection","transKey"],Rj=fI(fC,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${kj["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${kj["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${kj.slideEnterActive}`]:t.slideEnterActive},{[`.${kj.slideExit}`]:t.slideExit},{[`.${kj["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${kj["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})((({theme:e})=>{const t=e.transitions.create("transform",{duration:350,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${kj["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${kj["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${kj.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${kj.slideExit}`]:{transform:"translate(0%)"},[`& .${kj["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${kj["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}})),Lj=e=>bI("MuiDayPicker",e);vI("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const Fj=e=>e.charAt(0).toUpperCase(),Uj=fI("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Vj=fI($I,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})((({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.secondary}))),$j=fI("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),Bj=fI((e=>{const{children:t,className:n,reduceAnimations:o,slideDirection:r,transKey:i}=e,a=Go(e,Nj),s=(e=>{const{classes:t}=e;return _I({root:["root"]},Dj,t)})(e);if(o)return(0,Eo.jsx)("div",{className:sT(s.root,n),children:t});const l={exit:kj.slideExit,enterActive:kj.slideEnterActive,enter:kj[`slideEnter-${r}`],exitActive:kj[`slideExitActiveLeft-${r}`]};return(0,Eo.jsx)(Rj,{className:sT(s.root,n),childFactory:e=>yo.cloneElement(e,{classNames:l}),role:"presentation",children:(0,Eo.jsx)(Pj,Yo({mountOnEnter:!0,unmountOnExit:!0,timeout:350,classNames:l},a,{children:t}),i)})}),{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),Kj=fI("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),zj=fI("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function Hj(e){const t=QE(),n=JE(),o=fl({props:e,name:"MuiDayPicker"}),r=(e=>{const{classes:t}=e;return _I({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},Lj,t)})(o),{onFocusedDayChange:i,className:a,currentMonth:s,selectedDays:l,disabled:c,disableHighlightToday:d,focusedDay:u,isMonthSwitchingAnimating:p,loading:f,onSelectedDaysChange:m,onMonthSwitchingAnimationEnd:g,readOnly:h,reduceAnimations:b,renderDay:v,renderLoading:y=()=>(0,Eo.jsx)("span",{children:"..."}),showDaysOutsideCurrentMonth:x,slideDirection:S,TransitionProps:w,disablePast:_,disableFuture:E,minDate:T,maxDate:I,shouldDisableDate:C,dayOfWeekFormatter:M=Fj,hasFocus:O,onFocusedViewChange:D,gridLabelId:k}=o,j=BD({shouldDisableDate:C,minDate:T,maxDate:I,disablePast:_,disableFuture:E}),[A,P]=yo.useState((()=>u||t)),N=yo.useCallback((e=>{D&&D(e)}),[D]),R=yo.useCallback(((e,t="finish")=>{h||m(e,t)}),[m,h]),L=yo.useCallback((e=>{j(e)||(i(e),P(e),N(!0))}),[j,i,N]),F=BI();function U(e,t){switch(e.key){case"ArrowUp":L(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":L(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{const o=n.addDays(t,"ltr"===F.direction?-1:1),r="ltr"===F.direction?n.getPreviousMonth(t):n.getNextMonth(t),i=eT({utils:n,date:o,minDate:"ltr"===F.direction?n.startOfMonth(r):o,maxDate:"ltr"===F.direction?o:n.endOfMonth(r),isDateDisabled:j});L(i||o),e.preventDefault();break}case"ArrowRight":{const o=n.addDays(t,"ltr"===F.direction?1:-1),r="ltr"===F.direction?n.getNextMonth(t):n.getPreviousMonth(t),i=eT({utils:n,date:o,minDate:"ltr"===F.direction?o:n.startOfMonth(r),maxDate:"ltr"===F.direction?n.endOfMonth(r):o,isDateDisabled:j});L(i||o),e.preventDefault();break}case"Home":L(n.startOfWeek(t)),e.preventDefault();break;case"End":L(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":L(n.getNextMonth(t)),e.preventDefault();break;case"PageDown":L(n.getPreviousMonth(t)),e.preventDefault()}}function V(e,t){L(t)}function $(e,t){O&&n.isSameDay(A,t)&&N(!1)}const B=n.getMonth(s),K=l.filter((e=>!!e)).map((e=>n.startOfDay(e))),z=B,H=yo.useMemo((()=>yo.createRef()),[z]),Y=n.startOfWeek(t),G=yo.useMemo((()=>{const e=n.startOfMonth(s),t=n.endOfMonth(s);return j(A)||n.isAfterDay(A,t)||n.isBeforeDay(A,e)?eT({utils:n,date:A,minDate:e,maxDate:t,disablePast:_,disableFuture:E,isDateDisabled:j}):A}),[s,E,_,A,j,n]);return(0,Eo.jsxs)("div",{role:"grid","aria-labelledby":k,children:[(0,Eo.jsx)(Uj,{role:"row",className:r.header,children:n.getWeekdays().map(((e,t)=>{var o;return(0,Eo.jsx)(Vj,{variant:"caption",role:"columnheader","aria-label":n.format(n.addDays(Y,t),"weekday"),className:r.weekDayLabel,children:null!=(o=null==M?void 0:M(e))?o:e},e+t.toString())}))}),f?(0,Eo.jsx)($j,{className:r.loadingContainer,children:y()}):(0,Eo.jsx)(Bj,Yo({transKey:z,onExited:g,reduceAnimations:b,slideDirection:S,className:sT(a,r.slideTransition)},w,{nodeRef:H,children:(0,Eo.jsx)(Kj,{ref:H,role:"rowgroup",className:r.monthContainer,children:n.getWeekArray(s).map((e=>(0,Eo.jsx)(zj,{role:"row",className:r.weekContainer,children:e.map((e=>{const o=null!==G&&n.isSameDay(e,G),r=K.some((t=>n.isSameDay(t,e))),i=n.isSameDay(e,t),a={key:null==e?void 0:e.toString(),day:e,isAnimating:p,disabled:c||j(e),autoFocus:O&&o,today:i,outsideCurrentMonth:n.getMonth(e)!==B,selected:r,disableHighlightToday:d,showDaysOutsideCurrentMonth:x,onKeyDown:U,onFocus:V,onBlur:$,onDaySelect:R,tabIndex:o?0:-1,role:"gridcell","aria-selected":r};return i&&(a["aria-current"]="date"),v?v(e,K,a):(0,yo.createElement)(Oj,Yo({},a,{key:a.key}))}))},`week-${e[0]}`)))})}))]})}const Yj=e=>bI("MuiPickersCalendarHeader",e);vI("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const Gj=fI("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),Wj=fI("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})((({theme:e})=>Yo({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium}))),qj=fI("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Jj=fI(HC,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto"}),Xj=fI(MI,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})((({theme:e,ownerState:t})=>Yo({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"},"year"===t.openView&&{transform:"rotate(180deg)"}))),Zj=()=>{};function Qj(e){const t=fl({props:e,name:"MuiPickersCalendarHeader"}),{components:n={},componentsProps:o={},currentMonth:r,disabled:i,disableFuture:a,disablePast:s,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:d,minDate:u,onMonthChange:p,onViewChange:f,openView:m,reduceAnimations:g,rightArrowButtonText:h,views:b,labelId:v}=t;Zj({leftArrowButtonText:c,rightArrowButtonText:h,getViewSwitchingButtonText:l});const y=ZE(),x=c??y.previousMonth,S=h??y.nextMonth,w=l??y.calendarViewSwitchingButtonAriaLabel,_=JE(),E=(e=>{const{classes:t}=e;return _I({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Yj,t)})(t),T=o.switchViewButton||{},I=function(e,{disableFuture:t,maxDate:n}){const o=JE();return yo.useMemo((()=>{const r=o.date(),i=o.startOfMonth(t&&o.isBefore(r,n)?r:n);return!o.isAfter(i,e)}),[t,n,e,o])}(r,{disableFuture:a,maxDate:d}),C=function(e,{disablePast:t,minDate:n}){const o=JE();return yo.useMemo((()=>{const r=o.date(),i=o.startOfMonth(t&&o.isAfter(r,n)?r:n);return!o.isBefore(i,e)}),[t,n,e,o])}(r,{disablePast:s,minDate:u});if(1===b.length&&"year"===b[0])return null;const M=t;return(0,Eo.jsxs)(Gj,{ownerState:M,className:E.root,children:[(0,Eo.jsxs)(Wj,{role:"presentation",onClick:()=>{if(1!==b.length&&f&&!i)if(2===b.length)f(b.find((e=>e!==m))||b[0]);else{const e=0!==b.indexOf(m)?0:1;f(b[e])}},ownerState:M,"aria-live":"polite",className:E.labelContainer,children:[(0,Eo.jsx)(vj,{reduceAnimations:g,transKey:_.format(r,"monthAndYear"),children:(0,Eo.jsx)(qj,{id:v,ownerState:M,className:E.label,children:_.format(r,"monthAndYear")})}),b.length>1&&!i&&(0,Eo.jsx)(Jj,Yo({size:"small",as:n.SwitchViewButton,"aria-label":w(m),className:E.switchViewButton},T,{children:(0,Eo.jsx)(Xj,{as:n.SwitchViewIcon,ownerState:M,className:E.switchViewIcon})}))]}),(0,Eo.jsx)(hj,{in:"day"===m,children:(0,Eo.jsx)($k,{leftArrowButtonText:x,rightArrowButtonText:S,components:n,componentsProps:o,onLeftClick:()=>p(_.getPreviousMonth(r),"right"),onRightClick:()=>p(_.getNextMonth(r),"left"),isLeftDisabled:C,isRightDisabled:I})})]})}function eA(e){return bI("PrivatePickersYear",e)}const tA=vI("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),nA=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],oA=fI("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${tA.modeDesktop}`]:t.modeDesktop},{[`&.${tA.modeMobile}`]:t.modeMobile}]})((({ownerState:e})=>Yo({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},"desktop"===(null==e?void 0:e.wrapperVariant)&&{flexBasis:"25%"}))),rA=fI("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${tA.disabled}`]:t.disabled},{[`&.${tA.selected}`]:t.selected}]})((({theme:e})=>Yo({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},[`&.${tA.disabled}`]:{color:e.palette.text.secondary},[`&.${tA.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}}))),iA=()=>{},aA=yo.forwardRef((function(e,t){const{autoFocus:n,className:o,children:r,disabled:i,onClick:a,onKeyDown:s,value:l,tabIndex:c,onFocus:d=iA,onBlur:u=iA}=e,p=Go(e,nA),f=yo.useRef(null),m=OC(f,t),g=Yo({},e,{wrapperVariant:yo.useContext(nM)}),h=(e=>{const{wrapperVariant:t,disabled:n,selected:o,classes:r}=e;return _I({root:["root",t&&`mode${Ai(t)}`],yearButton:["yearButton",n&&"disabled",o&&"selected"]},eA,r)})(g);return yo.useEffect((()=>{n&&f.current.focus()}),[n]),(0,Eo.jsx)(oA,{className:sT(h.root,o),ownerState:g,children:(0,Eo.jsx)(rA,Yo({ref:m,disabled:i,type:"button",tabIndex:i?-1:c,onClick:e=>a(e,l),onKeyDown:e=>s(e,l),onFocus:e=>d(e,l),onBlur:e=>u(e,l),className:h.yearButton,ownerState:g},p,{children:r}))})}));function sA(e){return bI("MuiYearPicker",e)}vI("MuiYearPicker",["root"]);const lA=fI("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),cA=yo.forwardRef((function(e,t){const n=QE(),o=BI(),r=JE(),i=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({disablePast:!1,disableFuture:!1},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiYearPicker"),{autoFocus:a,className:s,date:l,disabled:c,disableFuture:d,disablePast:u,maxDate:p,minDate:f,onChange:m,readOnly:g,shouldDisableYear:h,disableHighlightToday:b,onYearFocus:v,hasFocus:y,onFocusedViewChange:x}=i,S=i,w=(e=>{const{classes:t}=e;return _I({root:["root"]},sA,t)})(S),_=yo.useMemo((()=>l??r.startOfYear(n)),[n,r,l]),E=yo.useMemo((()=>null!=l?r.getYear(l):b?null:r.getYear(n)),[n,l,r,b]),T=yo.useContext(nM),I=yo.useRef(null),[C,M]=yo.useState((()=>E||r.getYear(n))),[O,D]=sk({name:"YearPicker",state:"hasFocus",controlled:y,default:a}),k=yo.useCallback((e=>{D(e),x&&x(e)}),[D,x]),j=yo.useCallback((e=>!!(u&&r.isBeforeYear(e,n)||d&&r.isAfterYear(e,n)||f&&r.isBeforeYear(e,f)||p&&r.isAfterYear(e,p)||h&&h(e))),[d,u,p,f,n,h,r]),A=(e,t,n="finish")=>{if(g)return;const o=r.setYear(_,t);m(o,n)},P=yo.useCallback((e=>{j(r.setYear(_,e))||(M(e),k(!0),null==v||v(e))}),[j,r,_,k,v]);yo.useEffect((()=>{M((e=>null!==E&&e!==E?E:e))}),[E]);const N="desktop"===T?4:3,R=yo.useCallback(((e,t)=>{switch(e.key){case"ArrowUp":P(t-N),e.preventDefault();break;case"ArrowDown":P(t+N),e.preventDefault();break;case"ArrowLeft":P(t+("ltr"===o.direction?-1:1)),e.preventDefault();break;case"ArrowRight":P(t+("ltr"===o.direction?1:-1)),e.preventDefault()}}),[P,o.direction,N]),L=yo.useCallback(((e,t)=>{P(t)}),[P]),F=yo.useCallback(((e,t)=>{C===t&&k(!1)}),[C,k]),U=r.getYear(n),V=yo.useRef(null),$=OC(t,V);return yo.useEffect((()=>{if(a||null===V.current)return;const e=V.current.querySelector('[tabindex="0"]');if(!e)return;const t=e.offsetHeight,n=e.offsetTop,o=V.current.clientHeight,r=V.current.scrollTop,i=n+t;t>o||n<r||(V.current.scrollTop=i-o/2-t/2)}),[a]),(0,Eo.jsx)(lA,{ref:$,className:sT(w.root,s),ownerState:S,children:r.getYearRange(f,p).map((e=>{const t=r.getYear(e),n=t===E;return(0,Eo.jsx)(aA,{selected:n,value:t,onClick:A,onKeyDown:R,autoFocus:O&&t===C,ref:n?I:void 0,disabled:c||j(e),tabIndex:t===C?0:-1,onFocus:L,onBlur:F,"aria-current":U===t?"date":void 0,children:r.format(e,"year")},r.format(e,"year"))}))})})),dA=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),uA=e=>bI("MuiCalendarPicker",e);vI("MuiCalendarPicker",["root","viewTransitionContainer"]);const pA=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"];const fA=fI(qk,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),mA=fI(vj,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),gA=yo.forwardRef((function(e,t){const n=JE(),o=Wk(),r=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:dA,renderLoading:()=>(0,Eo.jsx)("span",{children:"..."})},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiCalendarPicker"),{autoFocus:i,onViewChange:a,date:s,disableFuture:l,disablePast:c,defaultCalendarMonth:d,onChange:u,onYearChange:p,onMonthChange:f,reduceAnimations:m,shouldDisableDate:g,shouldDisableMonth:h,shouldDisableYear:b,view:v,views:y,openTo:x,className:S,disabled:w,readOnly:_,minDate:E,maxDate:T,disableHighlightToday:I,focusedView:C,onFocusedViewChange:M}=r,O=Go(r,pA),{openView:D,setOpenView:k,openNext:j}=lk({view:v,views:y,openTo:x,onChange:u,onViewChange:a}),{calendarState:A,changeFocusedDay:P,changeMonth:N,handleChangeMonth:R,isDateDisabled:L,onMonthSwitchingAnimationEnd:F}=pj({date:s,defaultCalendarMonth:d,reduceAnimations:m,onMonthChange:f,minDate:E,maxDate:T,shouldDisableDate:g,disablePast:c,disableFuture:l}),U=yo.useCallback(((e,t)=>{const o=n.startOfMonth(e),r=n.endOfMonth(e),i=L(e)?eT({utils:n,date:e,minDate:n.isBefore(E,o)?o:E,maxDate:n.isAfter(T,r)?r:T,disablePast:c,disableFuture:l,isDateDisabled:L}):e;i?(u(i,t),null==f||f(o)):(j(),N(o)),P(i,!0)}),[P,l,c,L,T,E,u,f,N,j,n]),V=yo.useCallback(((e,t)=>{const o=n.startOfYear(e),r=n.endOfYear(e),i=L(e)?eT({utils:n,date:e,minDate:n.isBefore(E,o)?o:E,maxDate:n.isAfter(T,r)?r:T,disablePast:c,disableFuture:l,isDateDisabled:L}):e;i?(u(i,t),null==p||p(i)):(j(),N(o)),P(i,!0)}),[P,l,c,L,T,E,u,p,j,n,N]),$=yo.useCallback(((e,t)=>u(s&&e?n.mergeDateAndTime(e,s):e,t)),[n,s,u]);yo.useEffect((()=>{s&&N(s)}),[s]);const B=r,K=(e=>{const{classes:t}=e;return _I({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},uA,t)})(B),z={disablePast:c,disableFuture:l,maxDate:T,minDate:E},H=w&&s||E,Y=w&&s||T,G={disableHighlightToday:I,readOnly:_,disabled:w},W=`${o}-grid-label`,[q,J]=sk({name:"DayPicker",state:"focusedView",controlled:C,default:i?D:null}),X=null!==q,Z=UC((e=>t=>{M?M(e)(t):J(t?e:t=>t===e?null:t)})),Q=yo.useRef(D);return yo.useEffect((()=>{Q.current!==D&&(Q.current=D,Z(D)(!0))}),[D,Z]),(0,Eo.jsxs)(fA,{ref:t,className:sT(K.root,S),ownerState:B,children:[(0,Eo.jsx)(Qj,Yo({},O,{views:y,openView:D,currentMonth:A.currentMonth,onViewChange:k,onMonthChange:(e,t)=>R({newMonth:e,direction:t}),minDate:H,maxDate:Y,disabled:w,disablePast:c,disableFuture:l,reduceAnimations:m,labelId:W})),(0,Eo.jsx)(mA,{reduceAnimations:m,className:K.viewTransitionContainer,transKey:D,ownerState:B,children:(0,Eo.jsxs)("div",{children:["year"===D&&(0,Eo.jsx)(cA,Yo({},O,z,G,{autoFocus:i,date:s,onChange:V,shouldDisableYear:b,hasFocus:X,onFocusedViewChange:Z("year")})),"month"===D&&(0,Eo.jsx)(uj,Yo({},z,G,{autoFocus:i,hasFocus:X,className:S,date:s,onChange:U,shouldDisableMonth:h,onFocusedViewChange:Z("month")})),"day"===D&&(0,Eo.jsx)(Hj,Yo({},O,A,z,G,{autoFocus:i,onMonthSwitchingAnimationEnd:F,onFocusedDayChange:P,reduceAnimations:m,selectedDays:[s],onSelectedDaysChange:$,shouldDisableDate:g,hasFocus:X,onFocusedViewChange:Z("day"),gridLabelId:W}))]})})]})}));function hA(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function bA(e){return bI("MuiCalendarOrClockPicker",e)}vI("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const vA=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],yA=fI("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(e,t)=>t.mobileKeyboardInputView})({padding:"16px 24px"}),xA=fI("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})((({ownerState:e})=>Yo({display:"flex",flexDirection:"column"},e.isLandscape&&{flexDirection:"row"}))),SA={fullWidth:!0},wA=e=>"year"===e||"month"===e||"day"===e,_A=e=>"hours"===e||"minutes"===e||"seconds"===e;function EA(e){var t,n;const o=fl({props:e,name:"MuiCalendarOrClockPicker"}),{autoFocus:r,parsedValue:i,DateInputProps:a,isMobileKeyboardViewOpen:s,onDateChange:l,onViewChange:c,openTo:d,orientation:u,showToolbar:p,toggleMobileKeyboardView:f,ToolbarComponent:m=()=>null,toolbarFormat:g,toolbarPlaceholder:h,toolbarTitle:b,views:v,dateRangeIcon:y,timeIcon:x,hideTabs:S}=o,w=Go(o,vA),_=null==(t=w.components)?void 0:t.Tabs,E=((e,t)=>{const[n,o]=yo.useState(hA);return zE((()=>{const e=()=>{o(hA())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}}),[]),!rM(e,["hours","minutes","seconds"])&&"landscape"===(t||n)})(v,u),T=yo.useContext(nM),I=(e=>{const{classes:t}=e;return _I({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},bA,t)})(o),C=p??"desktop"!==T,M=!S&&typeof window<"u"&&window.innerHeight>667,O=yo.useCallback(((e,t)=>{l(e,T,t)}),[l,T]),D=yo.useCallback((e=>{s&&f(),c&&c(e)}),[s,c,f]),{openView:k,setOpenView:j,handleChangeAndOpenNext:A}=lk({view:void 0,views:v,openTo:d,onChange:O,onViewChange:D}),{focusedView:P,setFocusedView:N}=(({autoFocus:e,openView:t})=>{const[n,o]=yo.useState(e?t:null),r=yo.useCallback((e=>t=>{o(t?e:t=>e===t?null:t)}),[]);return{focusedView:n,setFocusedView:r}})({autoFocus:r,openView:k});return(0,Eo.jsxs)(xA,{ownerState:{isLandscape:E},className:I.root,children:[C&&(0,Eo.jsx)(m,Yo({},w,{views:v,isLandscape:E,parsedValue:i,onChange:O,setOpenView:j,openView:k,toolbarTitle:b,toolbarFormat:g,toolbarPlaceholder:h,isMobileKeyboardViewOpen:s,toggleMobileKeyboardView:f})),M&&!!_&&(0,Eo.jsx)(_,Yo({dateRangeIcon:y,timeIcon:x,view:k,onChange:j},null==(n=w.componentsProps)?void 0:n.tabs)),(0,Eo.jsx)(qk,{children:s?(0,Eo.jsx)(yA,{className:I.mobileKeyboardInputView,children:(0,Eo.jsx)(ik,Yo({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:SA}))}):(0,Eo.jsxs)(yo.Fragment,{children:[wA(k)&&(0,Eo.jsx)(gA,Yo({autoFocus:r,date:i,onViewChange:j,onChange:A,view:k,views:v.filter(wA),focusedView:P,onFocusedViewChange:N},w)),_A(k)&&(0,Eo.jsx)(Qk,Yo({},w,{autoFocus:r,date:i,view:k,views:v.filter(_A),onChange:A,onViewChange:j,showViewSwitcher:"desktop"===T}))]})})]})}const TA=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],IA=yo.forwardRef((function(e,t){const n=rT(e,"MuiDesktopDatePicker"),o=null!==zD(n),{pickerProps:r,inputProps:i,wrapperProps:a}=ak(n,iT),{PopperProps:s,PaperProps:l,ToolbarComponent:c=tM,TransitionComponent:d,components:u,componentsProps:p}=n,f=Go(n,TA),m=Yo({},i,f,{components:u,componentsProps:p,ref:t,validationError:o});return(0,Eo.jsx)(VD,Yo({},a,{DateInputProps:m,KeyboardDateInputComponent:ik,PopperProps:s,PaperProps:l,TransitionComponent:d,components:u,componentsProps:p,children:(0,Eo.jsx)(EA,Yo({},r,{autoFocus:!0,toolbarTitle:n.label||n.toolbarTitle,ToolbarComponent:c,DateInputProps:m,components:u,componentsProps:p},f))}))}));function CA(e){return bI("MuiDialog",e)}const MA=vI("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),OA=yo.createContext({});function DA(e){return VM(e).defaultView||window}function kA(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function jA(e){return parseInt(DA(e).getComputedStyle(e).paddingRight,10)||0}function AA(e,t,n,o,r){const i=[t,n,...o];[].forEach.call(e.children,(e=>{const t=-1===i.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&kA(e,r)}))}function PA(e,t){let n=-1;return e.some(((e,o)=>!!t(e)&&(n=o,!0))),n}function NA(e,t){const n=[],o=e.container;if(!t.disableScrollLock){if(function(e){const t=VM(e);return t.body===e?DA(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(VM(o));n.push({value:o.style.paddingRight,property:"padding-right",el:o}),o.style.paddingRight=`${jA(o)+e}px`;const t=VM(o).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${jA(t)+e}px`}))}let e;if(o.parentNode instanceof DocumentFragment)e=VM(o).body;else{const t=o.parentElement,n=DA(o);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:o}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)}))}}function RA(...e){return e.reduce(((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)}),(()=>{}))}const LA=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&kA(e.modalRef,!1);const o=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);AA(t,e.mount,e.modalRef,o,!0);const r=PA(this.containers,(e=>e.container===t));return-1!==r?(this.containers[r].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:o}),n)}mount(e,t){const n=PA(this.containers,(t=>-1!==t.modals.indexOf(e))),o=this.containers[n];o.restore||(o.restore=NA(o,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const o=PA(this.containers,(t=>-1!==t.modals.indexOf(e))),r=this.containers[o];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(n,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&kA(e.modalRef,t),AA(r.container,e.mount,e.modalRef,r.hiddenSiblings,!1),this.containers.splice(o,1);else{const e=r.modals[r.modals.length-1];e.modalRef&&kA(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function FA(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,manager:r=LA,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:d,rootRef:u}=e,p=yo.useRef({}),f=yo.useRef(null),m=yo.useRef(null),g=OC(m,u),[h,b]=yo.useState(!d),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let y=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(y=!1);const x=()=>(p.current.modalRef=m.current,p.current.mount=f.current,p.current),S=()=>{r.mount(x(),{disableScrollLock:o}),m.current&&(m.current.scrollTop=0)},w=UC((()=>{const e=function(e){return"function"==typeof e?e():e}(t)||VM(f.current).body;r.add(x(),e),m.current&&S()})),_=yo.useCallback((()=>r.isTopModal(x())),[r]),E=UC((e=>{f.current=e,e&&(d&&_()?S():m.current&&kA(m.current,y))})),T=yo.useCallback((()=>{r.remove(x(),y)}),[y,r]);yo.useEffect((()=>()=>{T()}),[T]),yo.useEffect((()=>{d?w():(!v||!i)&&T()}),[d,T,v,i,w]);const I=e=>t=>{var o;null==(o=e.onKeyDown)||o.call(e,t),"Escape"===t.key&&229!==t.which&&_()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},C=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:(t={})=>{const n=bD(e);delete n.onTransitionEnter,delete n.onTransitionExited;const o=Yo({},n,t);return Yo({role:"presentation"},o,{onKeyDown:I(o),ref:g})},getBackdropProps:(e={})=>Yo({"aria-hidden":!0},e,{onClick:C(e),open:d}),getTransitionProps:()=>({onEnter:RA((()=>{b(!1),a&&a()}),null==l?void 0:l.props.onEnter),onExited:RA((()=>{b(!0),s&&s(),i&&T()}),null==l?void 0:l.props.onExited)}),rootRef:g,portalRef:E,isTopModal:_,exited:h,hasTransition:v}}function UA(e){return bI("MuiModal",e)}function VA(e){return bI("MuiBackdrop",e)}vI("MuiModal",["root","hidden","backdrop"]),vI("MuiBackdrop",["root","invisible"]);const $A=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],BA=fI("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})((({ownerState:e})=>Yo({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"}))),KA=yo.forwardRef((function(e,t){var n,o,r;const i=wI({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:d={},invisible:u=!1,open:p,slotProps:f={},slots:m={},TransitionComponent:g=hj,transitionDuration:h}=i,b=Go(i,$A),v=Yo({},i,{component:l,invisible:u}),y=(e=>{const{classes:t,invisible:n}=e;return _I({root:["root",n&&"invisible"]},VA,t)})(v),x=null!=(n=f.root)?n:d.root;return(0,Eo.jsx)(g,Yo({in:p,timeout:h},b,{children:(0,Eo.jsx)(BA,Yo({"aria-hidden":!0},x,{as:null!=(o=null!=(r=m.root)?r:c.Root)?o:l,className:cT(y.root,s,null==x?void 0:x.className),ownerState:Yo({},v,null==x?void 0:x.ownerState),classes:y,ref:t,children:a}))}))})),zA=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],HA=fI("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((({theme:e,ownerState:t})=>Yo({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"}))),YA=fI(KA,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),GA=yo.forwardRef((function(e,t){var n,o,r,i,a,s;const l=wI({name:"MuiModal",props:e}),{BackdropComponent:c=YA,BackdropProps:d,className:u,closeAfterTransition:p=!1,children:f,container:m,component:g,components:h={},componentsProps:b={},disableAutoFocus:v=!1,disableEnforceFocus:y=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:w=!1,disableScrollLock:_=!1,hideBackdrop:E=!1,keepMounted:T=!1,onBackdropClick:I,open:C,slotProps:M,slots:O}=l,D=Go(l,zA),k=Yo({},l,{closeAfterTransition:p,disableAutoFocus:v,disableEnforceFocus:y,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:w,disableScrollLock:_,hideBackdrop:E,keepMounted:T}),{getRootProps:j,getBackdropProps:A,getTransitionProps:P,portalRef:N,isTopModal:R,exited:L,hasTransition:F}=FA(Yo({},k,{rootRef:t})),U=Yo({},k,{exited:L}),V=(e=>{const{open:t,exited:n,classes:o}=e;return _I({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},UA,o)})(U),$={};if(void 0===f.props.tabIndex&&($.tabIndex="-1"),F){const{onEnter:e,onExited:t}=P();$.onEnter=e,$.onExited=t}const B=null!=(n=null!=(o=null==O?void 0:O.root)?o:h.Root)?n:HA,K=null!=(r=null!=(i=null==O?void 0:O.backdrop)?i:h.Backdrop)?r:c,z=null!=(a=null==M?void 0:M.root)?a:b.root,H=null!=(s=null==M?void 0:M.backdrop)?s:b.backdrop,Y=xD({elementType:B,externalSlotProps:z,externalForwardedProps:D,getSlotProps:j,additionalProps:{ref:t,as:g},ownerState:U,className:cT(u,null==z?void 0:z.className,null==V?void 0:V.root,!U.open&&U.exited&&(null==V?void 0:V.hidden))}),G=xD({elementType:K,externalSlotProps:H,additionalProps:d,getSlotProps:e=>A(Yo({},e,{onClick:t=>{I&&I(t),null!=e&&e.onClick&&e.onClick(t)}})),className:cT(null==H?void 0:H.className,null==d?void 0:d.className,null==V?void 0:V.backdrop),ownerState:U});return T||C||F&&!L?(0,Eo.jsx)(XM,{ref:N,container:m,disablePortal:S,children:(0,Eo.jsxs)(B,Yo({},Y,{children:[!E&&c?(0,Eo.jsx)(K,Yo({},G)):null,(0,Eo.jsx)(zM,{disableEnforceFocus:y,disableAutoFocus:v,disableRestoreFocus:w,isEnabled:R,open:C,children:yo.cloneElement(f,$)})]}))}):null})),WA=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],qA=fI(KA,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),JA=fI(GA,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),XA=fI("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ai(n.scroll)}`]]}})((({ownerState:e})=>Yo({height:"100%","@media print":{height:"auto"},outline:0},"paper"===e.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===e.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}))),ZA=fI(ND,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ai(n.scroll)}`],t[`paperWidth${Ai(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((({theme:e,ownerState:t})=>Yo({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===t.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===t.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!t.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===t.maxWidth&&{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${MA.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}},t.maxWidth&&"xs"!==t.maxWidth&&{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`,[`&.${MA.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t.maxWidth]+64)]:{maxWidth:"calc(100% - 64px)"}}},t.fullWidth&&{width:"calc(100% - 64px)"},t.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${MA.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}))),QA=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialog"}),o=BI(),r={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":a,BackdropComponent:s,BackdropProps:l,children:c,className:d,disableEscapeKeyDown:u=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:m="sm",onBackdropClick:g,onClick:h,onClose:b,open:v,PaperComponent:y=ND,PaperProps:x={},scroll:S="paper",TransitionComponent:w=hj,transitionDuration:_=r,TransitionProps:E}=n,T=Go(n,WA),I=Yo({},n,{disableEscapeKeyDown:u,fullScreen:p,fullWidth:f,maxWidth:m,scroll:S}),C=(e=>{const{classes:t,scroll:n,maxWidth:o,fullWidth:r,fullScreen:i}=e;return _I({root:["root"],container:["container",`scroll${Ai(n)}`],paper:["paper",`paperScroll${Ai(n)}`,`paperWidth${Ai(String(o))}`,r&&"paperFullWidth",i&&"paperFullScreen"]},CA,t)})(I),M=yo.useRef(),O=Wk(a),D=yo.useMemo((()=>({titleId:O})),[O]);return(0,Eo.jsx)(JA,Yo({className:cT(C.root,d),closeAfterTransition:!0,components:{Backdrop:qA},componentsProps:{backdrop:Yo({transitionDuration:_,as:s},l)},disableEscapeKeyDown:u,onClose:b,open:v,ref:t,onClick:e=>{h&&h(e),M.current&&(M.current=null,g&&g(e),b&&b(e,"backdropClick"))},ownerState:I},T,{children:(0,Eo.jsx)(w,Yo({appear:!0,in:v,timeout:_,role:"presentation"},E,{children:(0,Eo.jsx)(XA,{className:cT(C.container),onMouseDown:e=>{M.current=e.target===e.currentTarget},ownerState:I,children:(0,Eo.jsx)(ZA,Yo({as:y,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":O},x,{className:cT(C.paper,x.className),ownerState:I,children:(0,Eo.jsx)(OA.Provider,{value:D,children:c})}))})}))}))}));function eP(e){return bI("MuiDialogContent",e)}vI("MuiDialogContent",["root","dividers"]);const tP=vI("MuiDialogTitle",["root"]),nP=["className","dividers"],oP=fI("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((({theme:e,ownerState:t})=>Yo({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},t.dividers?{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}:{[`.${tP.root} + &`]:{paddingTop:0}}))),rP=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialogContent"}),{className:o,dividers:r=!1}=n,i=Go(n,nP),a=Yo({},n,{dividers:r}),s=(e=>{const{classes:t,dividers:n}=e;return _I({root:["root",n&&"dividers"]},eP,t)})(a);return(0,Eo.jsx)(oP,Yo({className:cT(s.root,o),ownerState:a,ref:t},i))})),iP=fI(QA)({[`& .${MA.container}`]:{outline:0},[`& .${MA.paper}`]:{outline:0,minWidth:320}}),aP=fI(rP)({"&:first-of-type":{padding:0}}),sP=e=>{var t;const{children:n,DialogProps:o={},onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:d,componentsProps:u}=e,p=null!=(t=null==d?void 0:d.ActionBar)?t:UM;return(0,Eo.jsxs)(iP,Yo({open:c,onClose:a},o,{children:[(0,Eo.jsx)(aP,{children:n}),(0,Eo.jsx)(p,Yo({onAccept:r,onClear:i,onCancel:s,onSetToday:l,actions:["cancel","accept"]},null==u?void 0:u.actionBar))]}))},lP=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function cP(e){const{children:t,DateInputProps:n,DialogProps:o,onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,PureDateInputComponent:d,components:u,componentsProps:p}=e,f=Go(e,lP);return(0,Eo.jsxs)(nM.Provider,{value:"mobile",children:[(0,Eo.jsx)(d,Yo({components:u},f,n)),(0,Eo.jsx)(sP,{DialogProps:o,onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:u,componentsProps:p,children:t})]})}const dP=yo.forwardRef((function(e,t){const{disabled:n,getOpenDialogAriaText:o,inputFormat:r,InputProps:i,inputRef:a,label:s,openPicker:l,rawValue:c,renderInput:d,TextFieldProps:u={},validationError:p,className:f}=e,m=ZE(),g=o??m.openDatePickerDialogue,h=JE(),b=yo.useMemo((()=>Yo({},i,{readOnly:!0})),[i]),v=HD(h,c,r),y=UC((e=>{e.stopPropagation(),l()}));return d(Yo({label:s,disabled:n,ref:t,inputRef:a,error:p,InputProps:b,className:f},!e.readOnly&&!e.disabled&&{onClick:y},{inputProps:Yo({disabled:n,readOnly:!0,"aria-readonly":!0,"aria-label":g(c,h),value:v},!e.readOnly&&{onClick:y},{onKeyDown:iM(l)})},u))})),uP=["ToolbarComponent","value","onChange","components","componentsProps"],pP=yo.forwardRef((function(e,t){const n=rT(e,"MuiMobileDatePicker"),o=null!==zD(n),{pickerProps:r,inputProps:i,wrapperProps:a}=ak(n,iT),{ToolbarComponent:s=tM,components:l,componentsProps:c}=n,d=Go(n,uP),u=Yo({},i,d,{components:l,componentsProps:c,ref:t,validationError:o});return(0,Eo.jsx)(cP,Yo({},d,a,{DateInputProps:u,PureDateInputComponent:dP,components:l,componentsProps:c,children:(0,Eo.jsx)(EA,Yo({},r,{autoFocus:!0,toolbarTitle:n.label||n.toolbarTitle,ToolbarComponent:s,DateInputProps:u,components:l,componentsProps:c},d))}))})),fP=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],mP=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:r,PopperProps:i,TransitionComponent:a}=n,s=Go(n,fP);return WE(o,{defaultMatches:!0})?(0,Eo.jsx)(IA,Yo({ref:t,PopperProps:i,TransitionComponent:a},s)):(0,Eo.jsx)(pP,Yo({ref:t,DialogProps:r},s))})),gP=e=>{const{value:t,defaultValue:n,onChange:o,minDate:r,maxDate:i,disabled:a,readOnly:s,toolbarTitle:l,disableFuture:c,disablePast:d,shouldDisableDate:u,shouldDisableMonth:p,shouldDisableYear:f,disableHighlightToday:m,referenceDate:g,inputFormat:h="DD.MM.YYYY",views:b=["year","day"],onError:v,loading:y,onClose:x,...S}=e,[w,_]=yo.useState(n||null),[E,T]=yo.useState(!1),I=yo.useMemo((()=>o&&typeof t<"u"?t:w),[w,o,t]),C=e=>{(null==e||!e.isValid())&&null!==e||(typeof t>"u"&&_(e),null==o||o(e))};return(0,Eo.jsx)(mP,{"data-name":"datepicker",value:I,onChange:C,renderInput:e=>(0,Eo.jsx)(KE,{muiTextfieldProps:e,inputFormat:h,onChangeHandler:C,textfieldProps:{...S,onClear:()=>C(null),onIconClick:s?void 0:()=>T((e=>!e))}}),open:E,inputFormat:h,onOpen:()=>T(!0),onClose:()=>{T(!1),null==x||x()},defaultCalendarMonth:g,disabled:a,disableFuture:c,disablePast:d,shouldDisableDate:u,shouldDisableMonth:p,shouldDisableYear:f,disableHighlightToday:m,readOnly:s,minDate:r,maxDate:i,toolbarTitle:l,onError:v,loading:y,views:b})},hP=()=>{var e,t,n,o,r;const{getLabel:i}=_p(),{column:a,open:s,setOpen:l,values:c}=yo.useContext(VE),d={dateRangeField:null==c?void 0:c.dateRange},u=null==(e=null==a?void 0:a.columnDef)?void 0:e.meta,p=(null==u?void 0:u.startDatePicker)??{},f=(null==u?void 0:u.endDatePicker)??{},m=i("table.filter"),g=i("table.filter.from"),h=i("table.filter.to"),b=`filter-date-${null==a?void 0:a.id}-from`,v=`filter-date-${null==a?void 0:a.id}-to`,y=i("table.filter.validation.to-before-from"),x=FE().shape({dateRangeField:FE().shape({from:CE().defined().nullable(),to:CE().defined().nullable().test("to-before-from",y,(function(e){const{from:t}=this.parent;return!(e&&t&&Ao(e).isBefore(Ao(t),"day"))}))})}),{values:S,errors:w,setFieldValue:_,handleReset:E,handleSubmit:T}=l_({initialValues:d,validationSchema:x,onSubmit:e=>{null==a||a.setFilterValue(e.dateRangeField),null==l||l(!1)},onReset:()=>{null==a||a.setFilterValue(""),null==l||l(!1)}});return yo.useEffect((()=>{var e;if(s&&!S.dateRangeField){const t=document.getElementById(b);null==(e=null==t?void 0:t.focus)||e.call(t,{preventScroll:!0})}}),[null==a?void 0:a.id,S.dateRangeField,s,b]),(0,Eo.jsx)("form",{onSubmit:T,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(Sp,{modifiers:"h5",children:m}),(0,Eo.jsx)(gP,{id:b,label:g,...p,name:g,value:null!=(t=S.dateRangeField)&&t.from?Ao(S.dateRangeField.from):null,input:{autoComplete:"off"},onChange:e=>{var t,n;_("dateRangeField.from",(null==e?void 0:e.toISOString())??null),e&&null!=(t=S.dateRangeField)&&t.to&&Ao(e).isAfter(Ao(null==(n=S.dateRangeField)?void 0:n.to),"day")&&_("dateRangeField.to",null)}}),(0,Eo.jsx)(gP,{id:v,label:h,shouldDisableDate:e=>{var t,n;return!(null==(t=S.dateRangeField)||!t.from||!Ao(e).isBefore(Ao(null==(n=S.dateRangeField)?void 0:n.from),"day"))},...f,name:h,value:null!=(n=S.dateRangeField)&&n.to?Ao(null==(o=S.dateRangeField)?void 0:o.to):null,input:{autoComplete:"off"},onChange:e=>_("dateRangeField.to",(null==e?void 0:e.toISOString())??null),helper:null!=(r=w.dateRangeField)&&r.to?{text:w.dateRangeField.to,type:"error"}:void 0}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:E,children:i("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:i("table.filter")})})]})]})})},bP={"choice-group":"choice-group-7127bc4c","choice-group__inner--indented":"choice-group__inner--indented-095d03f8","choice-group__item--extra-padding":"choice-group__item--extra-padding-defa3089"},vP=yo.createContext({name:"",inputType:"radio",onChange:()=>null,currentValue:[]}),yP=e=>{const{id:t,label:n,value:o,className:r,direction:i="column",disabled:a,colProps:s=("column"===i?{width:12}:{width:"auto",grow:1}),onChange:l,hideLabel:c,extraContent:d,tooltip:u}=e,{currentValue:p,inputType:f,name:m,onChange:g}=yo.useContext(vP),h=!!p&&("checkbox"===f?o===p||-1!==p.indexOf(o):o===p);return(0,Eo.jsx)(Ml,{...s,children:(0,Eo.jsx)(dw,{id:t,label:n,value:o,name:m,className:r,disabled:a,checked:h,onChange:(e,t)=>{null==g||g(e,t),null==l||l(e,t)},hideLabel:c,extraContent:d,tooltip:u})})},xP="radio-4b3e1d44",SP="radio--disabled-8a5be211",wP="radio__input-c3c0efa1",_P="radio__indicator-cb82800d",EP="radio__indicator--hover-a273c5aa",TP="radio__tooltip-icon-dc07bb33",IP="radio__extra-content-465c7a50",CP=e=>{const{id:t,label:n,value:o,className:r,disabled:i,onChange:a,hideLabel:s,extraContent:l,checked:c,defaultChecked:d,hover:u,name:p,tooltip:f,...m}=e,[g,h]=yo.useState(d||!1),b=yo.useRef(null),v=yo.useMemo((()=>a&&typeof c<"u"?c:g),[a,g,c]),y=_l(xP,{[SP]:i});return(0,Eo.jsxs)("div",{"data-name":"radio",className:r,...m,children:[(0,Eo.jsxs)(Cl,{gutter:0,children:[(0,Eo.jsxs)(Ml,{width:"auto",children:[(0,Eo.jsx)("input",{id:t,value:o,name:p,type:"radio",disabled:i,checked:v,onChange:e=>{typeof c>"u"&&h(null==e?void 0:e.target.checked),null==a||a(o,null==e?void 0:e.target.checked)},className:wP}),(0,Eo.jsx)("div",{"aria-hidden":"true",onClick:()=>{var e;return null==(e=b.current)?void 0:e.click()},className:_l(_P,{[EP]:u})})]}),(0,Eo.jsx)(Ml,{children:(0,Eo.jsxs)("label",{ref:b,className:y,htmlFor:t,children:[(0,Eo.jsx)("span",{className:_l({"visually-hidden":s}),children:n}),f&&(0,Eo.jsxs)(aw,{children:[(0,Eo.jsx)(lw,{children:(0,Eo.jsx)(Rp,{name:"info",color:"brand",size:16,display:"inline",className:TP})}),(0,Eo.jsx)(cw,{children:f})]})]})})]}),l&&(0,Eo.jsx)("div",{className:IP,children:l})]})},MP=e=>{const{id:t,label:n,value:o,className:r,direction:i="column",disabled:a,colProps:s=("column"===i?{width:12}:{width:"auto",grow:1}),onChange:l,hideLabel:c,extraContent:d,tooltip:u}=e,{currentValue:p,inputType:f,name:m,onChange:g}=yo.useContext(vP),h=!!p&&("checkbox"===f?o===p||-1!==p.indexOf(o):o===p);return(0,Eo.jsx)(Ml,{...s,children:(0,Eo.jsx)(CP,{id:t,label:n,value:o,name:m,className:r,disabled:a,checked:h,onChange:(e,t)=>{null==g||g(e,t),null==l||l(e,t)},hideLabel:c,extraContent:d,tooltip:u})})},OP={"filter-item__input":"filter-item__input-7c8ed8cf","filter-item__label":"filter-item__label-057b50f5","filter-item--disabled":"filter-item--disabled-ad10dc42","filter-item--checked":"filter-item--checked-9af66168","filter-item--positive-main":"filter-item--positive-main-a40378b9","filter-item--important-main":"filter-item--important-main-f57d26aa","filter-item--warning-main":"filter-item--warning-main-5629af6e"},DP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i,background:a}=e,{currentValue:s,inputType:l,name:c,onChange:d}=yo.useContext(vP),u=!!s&&("checkbox"===l?o===s||-1!==s.indexOf(o):o===s),p=_l(OP["filter-item"],null==i?void 0:i.className,{[OP["filter-item--disabled"]]:r},{[OP["filter-item--checked"]]:u},{[OP[`filter-item--${a}`]]:!!a});return(0,Eo.jsxs)(Ml,{...i,className:p,children:[(0,Eo.jsx)("input",{id:t,value:o,name:c,type:l,disabled:r,checked:u,onChange:e=>d(o,null==e?void 0:e.target.checked),className:OP["filter-item__input"]}),(0,Eo.jsx)("label",{htmlFor:t,className:OP["filter-item__label"],children:n})]})},kP="light-item__input-db1bda86",jP="light-item__label-4502df50",AP="light-item--disabled-ea5955c3",PP="light-item--checked-19c9facc",NP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i}=e,{currentValue:a,inputType:s,name:l,onChange:c}=yo.useContext(vP),d=!!a&&("checkbox"===s?o===a||-1!==a.indexOf(o):o===a),u=_l(null==i?void 0:i.className,{[AP]:r},{[PP]:d});return(0,Eo.jsxs)(Ml,{...i,className:u,children:[(0,Eo.jsx)("input",{id:t,value:o,name:l,type:s,disabled:r,checked:d,onChange:e=>c(o,null==e?void 0:e.target.checked),className:kP}),(0,Eo.jsx)("label",{htmlFor:t,className:jP,children:n})]})},RP={"selector-item":"selector-item-afa6036a","selector-item__input":"selector-item__input-d671bb71","selector-item__label":"selector-item__label-15347301","selector-item--disabled":"selector-item--disabled-133d2c07","selector-item--checked":"selector-item--checked-3caf6414","selector-item--column":"selector-item--column-cb724fe9","selector-item--column-reverse":"selector-item--column-reverse-1d916d7a","selector-item--row":"selector-item--row-733fd28b","selector-item--row-reverse":"selector-item--row-reverse-89fd4a76"},LP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i,direction:a}=e,{currentValue:s,inputType:l,name:c,onChange:d}=yo.useContext(vP),u=!!s&&("checkbox"===l?o===s||-1!==s.indexOf(o):o===s),p=_l(RP["selector-item"],null==i?void 0:i.className,RP[`selector-item--${a}`],{[RP["selector-item--disabled"]]:r},{[RP["selector-item--checked"]]:u});return(0,Eo.jsxs)(Ml,{...i,className:p,children:[(0,Eo.jsx)("input",{id:t,value:o,name:c,type:l,disabled:r,checked:u,onChange:e=>{null==d||d(o,null==e?void 0:e.target.checked)},className:RP["selector-item__input"]}),(0,Eo.jsx)("label",{htmlFor:t,className:RP["selector-item__label"],children:n})]})},FP=e=>{const{getLabel:t}=_p(),{id:n,className:o,label:r,required:i,helper:a,items:s,type:l="default",direction:c=("default"===l?"column":"row"),rowProps:d,name:u,inputType:p="radio",value:f,defaultValue:m,onChange:g,hideLabel:h,indeterminateCheck:b,indeterminateCheckProps:v={},...y}=e,{indented:x,...S}=v,w=(null==v?void 0:v.indented)??!0,_=a?(null==a?void 0:a.id)??`${n}-helper`:void 0,E=b&&"default"===l&&"checkbox"===p,[T,I]=yo.useState((()=>m||("checkbox"===p?[]:null))),C=(t=e.value)=>!!g&&typeof t<"u",M=C(f)?f:T,O=yo.useMemo((()=>0===(null==M?void 0:M.length)),[null==M?void 0:M.length]),D=yo.useMemo((()=>{var e;return(null==M?void 0:M.length)===(null==(e=null==s?void 0:s.filter((e=>!e.disabled)))?void 0:e.length)}),[null==M?void 0:M.length,s]),k=yo.useMemo((()=>!O&&!D),[D,O]),j=yo.useMemo((()=>{const e=D?"all":O?"none":"some";return"string"==typeof b?b:"function"==typeof b?b(e):b?t("all"===e?"table.filter.remove-all":"table.filter.select-all"):""}),[t,b,D,O]),A={name:u,inputType:p,onChange:(e,t)=>{let n=M;n="checkbox"===p&&n?Array.isArray(n)?t?[...n,e]:n.filter((t=>t!==e)):t?[n,e]:[n].filter((t=>t!==e)):e,C()||I(Array.isArray(n)?[...n]:n),null==g||g(n)},currentValue:M};let P,N,R=NP;switch(l){case"default":P=2,N=1,R="checkbox"===p?yP:MP;break;case"selector":P=0,N=0,R=LP;break;case"filter":P=2,N=2,R=DP;break;case"light":P=1,N=1,R=NP}const L=_l(bP["choice-group"],o),F=_l(bP["choice-group__inner"],null==d?void 0:d.className,{[bP["choice-group__inner--indented"]]:E&&w});return(0,Eo.jsx)(vP.Provider,{value:A,children:(0,Eo.jsxs)("fieldset",{"data-name":"choice-group",...y,className:L,id:n,name:u,"aria-describedby":_,children:[(0,Eo.jsx)("legend",{children:(0,Eo.jsx)(Vh,{id:n,label:r,required:i,hideLabel:h,renderWithoutLabel:!0})}),null!=s&&s.length?(0,Eo.jsxs)(Eo.Fragment,{children:[E&&(0,Eo.jsx)(dw,{id:`${n}-indeterminate`,value:"indeterminate",name:"indeterminate",...S,label:j,indeterminate:k,checked:D,onChange:(e,t)=>{var n;const o=D?[]:null==(n=null==s?void 0:s.filter((e=>!e.disabled)))?void 0:n.map((e=>e.value));C()||I([...o]),null==g||g(o)}}),(0,Eo.jsx)(Cl,{direction:c,gutterX:P,gutterY:N,...d,className:F,children:s.map(((e,t)=>(0,yo.createElement)(R,{...e,className:_l(e.className,{[bP["choice-group__item--extra-padding"]]:e.extraContent&&t!==s.length-1}),direction:c,key:e.id})))})]}):(0,Eo.jsx)("p",{children:t("table.filter.no-options")}),a&&(0,Eo.jsx)(Pp,{...a,id:_})]})})},UP=e=>{var t,n;return null==(n=null==(t=null==e?void 0:e.filter(Boolean))?void 0:t.filter(((e,t,n)=>(null==n?void 0:n.indexOf(e))===t)))?void 0:n.sort(((e,t)=>{var n;return"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?null==(n=null==e?void 0:e.localeCompare)?void 0:n.call(e,t):0}))},VP=()=>{var e,t,n,o;const{getLabel:r}=_p(),{column:i,rows:a,setOpen:s,values:l}=yo.useContext(VE),c=r("table.filter"),d=null==(e=null==i?void 0:i.columnDef)?void 0:e.filterFn,u="select"===d?"selectFilter":"multiSelectFilter",p={inputType:d,selectFilter:null==l?void 0:l.selectField,multiSelectFilter:null==l?void 0:l.multiSelectField},f=null==(t=null==i?void 0:i.columnDef)?void 0:t.meta,m=null==f?void 0:f.filterOptions,g=e=>"object"==typeof e&&null!==e&&"id"in e&&"label"in e&&"value"in e,h=null!=a&&a.length&&"string"==typeof(null==(n=null==i?void 0:i.columnDef)?void 0:n.id)?a.map((e=>{var t,n;return null==(n=null==e?void 0:e.getValue)?void 0:n.call(e,null==(t=null==i?void 0:i.columnDef)?void 0:t.id)})):[],b=null!=m&&m.length?g(m[0])?m:UP(m):UP(h),v=null==b?void 0:b.map(((e,t)=>{var n;return g(e)?e:{id:`${null==(n=null==i?void 0:i.columnDef)?void 0:n.id}-choice-${t}`,label:String(e),value:String(e)}})),{values:y,setFieldValue:x,handleReset:S,handleSubmit:w,errors:_}=l_({initialValues:p,onSubmit:e=>{var t;null==i||i.setFilterValue(null!=(t=e[u])&&t.length?e[u]:""),null==s||s(!1)},onReset:()=>{null==i||i.setFilterValue(""),null==s||s(!1)}});return(0,Eo.jsx)("form",{onSubmit:w,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(fb,{element:"h6",children:r("table.filter")}),(0,Eo.jsx)(sb,{className:jw.filter__content,children:(0,Eo.jsx)(Tb,{children:(0,Eo.jsx)(FP,{id:`filter-${u}-${null==i?void 0:i.id}`,name:c,label:c,hideLabel:!0,inputType:"select"===d?"radio":"checkbox",size:"small",value:y[u],indeterminateCheck:!0,indeterminateCheckProps:{indented:!1,className:jw.filter__indeterminate},items:v,onChange:e=>x(u,e),helper:0!==(null==(o=_[u])?void 0:o.length)?{text:_[u],type:"error"}:{text:""}})})}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:S,children:r("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:r("table.filter")})})]})]})})},$P=()=>{const{getLabel:e}=_p(),{column:t,open:n,setOpen:o,values:r}=yo.useContext(VE),i={filter:null==r?void 0:r.filter},a=`text-filter-${null==t?void 0:t.id}`,s=e("table.filter"),l=e("search"),c=e("table.filter.validation.min-length",3),d=FE().shape({filter:CE().notRequired().matches(/^(?!\s+$).*/,e("table.filter.validation.no-spaces")).min(3,c).nullable().transform((e=>e||null))}),{values:u,setFieldValue:p,handleReset:f,handleSubmit:m,touched:g,errors:h}=l_({initialValues:i,validationSchema:d,onSubmit:e=>{null==t||t.setFilterValue(e.filter),null==o||o(!1)},onReset:()=>{null==t||t.setFilterValue(""),null==o||o(!1)}});return yo.useEffect((()=>{var e;if(n&&!u.filter){const t=document.getElementById(a);null==(e=null==t?void 0:t.focus)||e.call(t,{preventScroll:!0})}}),[null==t?void 0:t.id,u.filter,n,a]),(0,Eo.jsx)("form",{onSubmit:m,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(BE,{id:a,label:s,placeholder:l,icon:"close",onIconClick:f,value:u.filter||"",onChange:e=>p("filter",e),helper:g.filter&&h.filter?{text:h.filter,type:"error"}:{text:c},input:{autoComplete:"off"}}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:f,children:e("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:e("table.filter")})})]})]})})},BP=e=>{const{column:t,rows:n}=e,[o,r]=yo.useState(!1),{getLabel:i}=_p(),a=t.columnDef.filterFn,s=t.getFilterValue(),l=e=>"string"==typeof e,c=e=>Array.isArray(e),d=e=>"object"==typeof e&&null!==e&&("from"in e||"to"in e),u=yo.useMemo((()=>({filter:"auto"!==a&&"text"!==a||!l(s)?"":s,selectField:"select"===a&&l(s)?s:"",multiSelectField:"multi-select"===a&&c(s)?s:[],dateRange:["date-range","date-range-period"].includes(a)&&d(s)?s:{from:null,to:null}})),[a,s]);return(0,Eo.jsx)(VE.Provider,{value:{column:t,rows:n,values:u,open:o,setOpen:r},children:(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsxs)(aw,{openWith:"click",open:o,onToggle:r,focusManager:{order:["content"],initialFocus:0,modal:!0},children:[(0,Eo.jsx)(lw,{children:(0,Eo.jsx)(jp,{visualType:"link",icon:{filled:!!t.getFilterValue()||o,name:"filter_alt",className:_l(jw.filter__icon,{[jw["filter__icon--active"]]:!!t.getFilterValue()||o})},className:_l(jw.filter__button,"show-print"),children:(0,Eo.jsx)("span",{className:"sr-only",children:i("table.filter")})})}),(0,Eo.jsx)(cw,{maxWidth:"large",cardProps:{padding:{horizontal:1,vertical:.5}},children:(()=>{switch(a){case"date-range":case"date-range-period":return(0,Eo.jsx)(hP,{});case"multi-select":case"select":return(0,Eo.jsx)(VP,{});default:return(0,Eo.jsx)($P,{})}})()})]})})})},KP=()=>{const{table:e,loadingLabel:t}=yo.useContext(bw),n=(null==e?void 0:e.getState().pagination.pageSize)||10,o=n===HP?10:n;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)("tr",{className:"sr-only",children:(0,Eo.jsx)("td",{children:t})}),Array.from(Array(o).keys()).map((t=>(0,Eo.jsx)("tr",{"aria-hidden":!0,children:Array.from(Array(null==e?void 0:e.getAllColumns().length).keys()).map((e=>(0,Eo.jsx)("td",{children:(0,Eo.jsx)(HS,{width:100,height:21})},e)))},t)))]})},zP=()=>{var e;const{getLabel:t}=_p(),{table:n,id:o,caption:r,renderSubComponent:i,isFooterVisible:a,renderGroupHeading:s,onRowClick:l,isLoading:c,isError:d,hideRowBorder:u,placeholder:p,errorPlaceholder:f,size:m}=yo.useContext(bw);if(null===n)return null;const{getHeaderGroups:g,getFooterGroups:h,getRowModel:b}=n,v=(e,n)=>{const o=t("table.sort",e),r=_l(jw.sort__icon,{[jw["sort__icon--active"]]:!!e,[jw["sort__icon--desc"]]:"desc"===e,[jw["sort__icon--asc"]]:"asc"===e});return(0,Eo.jsx)(Tp,{visibility:"show",children:(0,Eo.jsx)(jp,{visualType:"link",icon:{name:e?"expand_more":"unfold_more",className:r},className:_l(jw.sort__button),onClick:n,children:(0,Eo.jsx)("span",{className:"sr-only",children:o})})})},y=e=>{const t=null==e?void 0:e.findIndex((e=>e.column.columnDef.footer));return(-1!==t?t:null==e?void 0:e.length)+1},x=()=>{let e;return b().rows.map(((t,n)=>{const{rowGroupKey:o,...r}=t.original,i=o=>{var r;return{...t,original:{...o,rowClassName:_l(o.rowClassName,jw["table__row--group-item"],{[jw["table__row--last-group-item"]]:(null==(r=b().rows[n+1])?void 0:r.original.rowGroupKey)!==e})}}};return o&&e!==o?(e=o,i(t.original)):o?i(r):(e=o,t)}))},S=e=>{var t;return(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsxs)(Cl,{justifyContent:"end",alignItems:"center",gutter:1,children:[e.column.getCanFilter()?(0,Eo.jsx)(BP,{column:e.column,rows:null==(t=null==n?void 0:n.getCoreRowModel())?void 0:t.rows}):null,e.column.getCanSort()&&(0,Eo.jsx)(Ml,{align:"center",width:"auto",children:v(e.column.getIsSorted(),e.column.getToggleSortingHandler())})]})})},w=e=>{var t;const n=e.original.CustomRowComponent;return(0,Eo.jsxs)(yo.Fragment,{children:[e.original.rowGroupKey&&(0,Eo.jsx)(Tp,{breakAfter:"avoid",children:(0,Eo.jsx)("tr",{className:_l(null==(t=e.original.rowClassName)?void 0:t.replace(jw["table__row--group-item"],"").replace(jw["table__row--last-group-item"],""),jw["table__row--group-header"],{[jw["table__row--border-hidden"]]:u}),children:s?s(e):(0,Eo.jsx)("td",{colSpan:e.getVisibleCells().length,children:e.original.rowGroupKey})})}),n?(0,Eo.jsx)(Tp,{breakInside:"avoid",children:(0,Eo.jsx)(n,{...e})}):(0,Eo.jsx)(Tp,{breakInside:"avoid",children:(0,Eo.jsx)("tr",{className:_l(e.original.rowClassName,{[jw["table__row--clickable"]]:!!e.original.onClick||!!l,[jw["table__row--border-hidden"]]:u}),onClick:()=>(e=>{var t,n;null==(n=(t=e.original).onClick)||n.call(t,e.original),null==l||l(e.original)})(e),children:e.getVisibleCells().map((e=>(0,Eo.jsx)("td",{style:{width:e.column.getSize()},className:_l({[jw["sticky-column"]]:e.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===e.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===e.column.getIsPinned()}),children:my(e.column.columnDef.cell,e.getContext())},e.id)))})}),e.getIsExpanded()&&i?(0,Eo.jsx)(Tp,{breakBefore:"avoid",children:null==i?void 0:i(e)}):null]},e.id)};return(0,Eo.jsxs)("table",{id:o,children:[r&&(0,Eo.jsx)("caption",{className:"sr-only",children:r}),(0,Eo.jsx)("thead",{children:g().map((e=>(0,Eo.jsx)("tr",{children:e.headers.map((e=>(0,Eo.jsx)("th",{scope:"col",style:{width:e.getSize()},className:_l({[jw["th--sortable"]]:e.column.getCanSort(),[jw["sticky-column"]]:e.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===e.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===e.column.getIsPinned()}),"aria-sort":"asc"===e.column.getIsSorted()?"ascending":"desc"===e.column.getIsSorted()?"descending":void 0,children:e.isPlaceholder?null:(0,Eo.jsxs)(Cl,{gutter:"small"===m?2:void 0,alignItems:"center",justifyContent:"between",wrap:"nowrap",children:[(0,Eo.jsx)(Ml,{onClick:e.column.getToggleSortingHandler(),children:my(e.column.columnDef.header,e.getContext())}),(e.column.getCanFilter()||e.column.getCanSort())&&S(e)]})},e.id)))},e.id)))}),(0,Eo.jsx)("tbody",{children:c?(0,Eo.jsx)(KP,{}):null!=(e=x())&&e.length?x().map((e=>w(e))):(()=>{const e=d?(0,Eo.jsx)(kw,{...f}):(0,Eo.jsx)(kw,{...p});return(0,Eo.jsx)("tr",{children:(0,Eo.jsx)("td",{colSpan:null==n?void 0:n.getAllColumns().length,children:e})})})()}),a&&(0,Eo.jsx)("tfoot",{children:h().map((e=>(0,Eo.jsx)("tr",{children:e.headers.map(((t,n)=>t.column.columnDef.footer?(0,Eo.jsx)("th",{scope:"col",colSpan:y(e.headers.slice(n+1)),className:_l({[jw["sticky-column"]]:t.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===t.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===t.column.getIsPinned()}),children:t.isPlaceholder?null:my(t.column.columnDef.footer,t.getContext())},t.id):null))},e.id)))})]})},HP=1e4,YP=[];function GP(e){const{getLabel:t}=_p(),{id:n,data:o,columns:r,caption:i,columnFilters:a,onColumnFiltersChange:s,cardProps:{padding:l=0,...c}={},hidePagination:d,defaultPagination:u={pageIndex:0,pageSize:d?HP:10},pagination:p,manualPagination:f=!!e.pagination,manualSorting:m=!!e.sorting,manualFiltering:g=!!e.columnFilters,sorting:h,defaultSorting:b=[],defaultExpanded:v={},autoResetPageIndex:y,onPaginationChange:x,onSortingChange:S,rowSelection:w,onRowSelectionChange:_,enableRowSelection:E,defaultColumnVisibility:T={},columnVisibility:I,onColumnVisibilityChange:C,columnPinning:M,onColumnPinningChange:O,getRowId:D,onRowClick:k,defaultRowSelection:j,totalRows:A,renderSubComponent:P,getRowCanExpand:N,groupRowsBy:R,renderGroupHeading:L,isLoading:F=!1,isError:U=!1,placeholder:V,errorPlaceholder:$,loadingLabel:B=t("table.loading"),verticalAlign:K="middle",enableFilters:z=!1,enableSorting:H=!0,hideRowBorder:Y=!1,size:G="medium",hideCardBorder:W,...q}=e,J=yo.useMemo((()=>(null!=o&&o.length?o:YP)??YP),[o]),X=wb(),[{pageIndex:Z,pageSize:Q},ee]=yo.useState(u),[te,ne]=yo.useState(b),[oe,re]=yo.useState(v),[ie,ae]=yo.useState(j||{}),[se,le]=yo.useState([]),[ce,de]=yo.useState(T),[ue,pe]=yo.useState({left:[],right:[]}),fe=yo.useMemo((()=>!!X||oe),[oe,X]),me=yo.useMemo((()=>p||{pageIndex:Z,pageSize:Q}),[Z,Q,p]),ge=yo.useMemo((()=>h||te),[te,h]),he=yo.useMemo((()=>a||se),[se,a]),be=yo.useMemo((()=>w||ie),[ie,w]),ve=yo.useMemo((()=>I||ce),[ce,I]),ye=yo.useMemo((()=>M||ue),[ue,M]),xe=yo.useMemo((()=>{const e=(null==J?void 0:J.map((e=>"string"==typeof R?{...e,rowGroupKey:e[R]}:R?{...e,rowGroupKey:R(e)}:e)))??[];return e.reduce(((t,n)=>(n.rowGroupKey&&t.keys.includes(n.rowGroupKey)||(n.rowGroupKey?(t.keys=[...t.keys,n.rowGroupKey],t.list=[...t.list,...e.filter((e=>e.rowGroupKey===n.rowGroupKey))]):t.list=[...t.list,n]),t)),{keys:[],list:[]}).list}),[J,R]),Se=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=yo.useState((()=>({current:cy(t)}))),[o,r]=yo.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:xe,columns:r,state:{rowSelection:be,columnFilters:he,pagination:me,sorting:ge,expanded:fe,columnVisibility:ve,columnPinning:ye},manualSorting:m,manualFiltering:g,pageCount:p&&A?Math.ceil(A/p.pageSize):void 0,autoResetPageIndex:y,onRowSelectionChange:e=>{if("function"!=typeof e)return;const t=e(be);w&&_?_(t):ae(t)},enableRowSelection:E,onExpandedChange:re,onPaginationChange:e=>{if("function"!=typeof e)return;const t=e(me);p&&x?x(t):ee(t)},onSortingChange:e=>{if("function"!=typeof e)return;const t=e(ge);h&&S?S(t):ne(t)},onColumnFiltersChange:e=>{if("function"!=typeof e)return;const t=e(he);a&&s?s(t):le(t)},onColumnVisibilityChange:e=>{if("function"!=typeof e)return;const t=e(ve);I&&C?C(t):de(t)},onColumnPinningChange:e=>{if("function"!=typeof e)return;const t=e(ye);M&&O?O(t):pe(t)},getCoreRowModel:e=>gv((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const a=[];for(let l=0;l<t.length;l++){const c=Sv(e,e._getRowId(t[l],l,i),t[l],l,r,0,null==i?void 0:i.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=o(c.originalSubRows,r+1,c)))}return a};return n.rows=o(t),n}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>gv((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),a={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],s=a[r.id],l=s.sortUndefined,c=null!=(n=null==r?void 0:r.desc)&&n;let d=0;if(l){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);if(n||o){if("first"===l)return n?-1:1;if("last"===l)return n?1:-1;d=n&&o?0:n?l:-l}}if(0===d&&(d=s.sortingFn(e,t,r.id)),0!==d)return c&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getPaginationRowModel:fy(),getFilteredRowModel:e=>gv((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&r.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const a=(n??[]).map((e=>e.id)),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,d;o&&s&&l.length&&(a.push("__global__"),l.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){c=r[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return py(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getExpandedRowModel:dy(),getRowCanExpand:N,getSubRows:e=>e.subRows,manualPagination:f,enableFilters:z,enableSorting:H,getRowId:D,filterFns:{text:(e,t,n)=>Cw(e,t,n,ww),select:(e,t,n)=>Cw(e,t,n,_w),"multi-select":(e,t,n)=>Cw(e,t,n,Ew),"date-range":(e,t,n)=>Cw(e,t,n,Tw),"date-range-period":(e,t,n)=>Cw(e,t,n,Iw)}}),we=!!Se.getFooterGroups().find((e=>!!e.headers.find((e=>e.column.columnDef.footer)))),_e=!(W||!d||we),Ee=!Y&&we&&!d,Te=_l(jw.table,jw[`table--vertical-align-${K}`],jw[`table--${G}`],{[jw["table--hidden-bottom-border"]]:_e,[jw["table--footer-bottom-border"]]:Ee}),Ie=(e,n)=>{const{children:o=t(`table.${e}`),isNested:r=!0,icon:i=("error"===e?"error":void 0),cardProps:{padding:a=1,...s}={},...l}=n||{cardProps:{}};return{children:o,isNested:r,icon:i,cardProps:{padding:a,...s},...l}};return(0,Eo.jsx)(bw.Provider,{value:{table:Se,id:n,caption:i,onRowClick:k,renderSubComponent:P,isFooterVisible:we,renderGroupHeading:L,placeholder:Ie("empty",V),errorPlaceholder:Ie("error",$),loadingLabel:B,isLoading:F,isError:U,hideRowBorder:Y,size:G},children:(0,Eo.jsx)(sb,{"data-name":"table",...q,borderless:W,padding:l,...c,children:(0,Eo.jsxs)(Tb,{children:[(0,Eo.jsx)("div",{className:Te,children:(0,Eo.jsx)(zP,{})}),!d&&Se&&(0,Eo.jsx)(Sw,{totalRows:A||Se.getFilteredRowModel().rows.length})]})})})}const WP=()=>(0,Eo.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Eo.jsxs)("g",{"clip-path":"url(#clip0_28747_2860)",children:[(0,Eo.jsx)("path",{d:"M28.8511 26.8C28.1722 27.9772 27.0884 28.8674 25.8017 29.3048C24.515 29.7422 23.1132 29.6969 21.8574 29.1773C20.6016 28.6578 19.5776 27.6994 18.9761 26.4808C18.3745 25.2621 18.2365 23.8664 18.5878 22.5536C18.9391 21.2407 19.7557 20.1004 20.8854 19.345C22.0151 18.5896 23.3809 18.2707 24.7283 18.4477C26.0758 18.6246 27.3129 19.2854 28.2093 20.3069C29.1056 21.3284 29.6 22.641 29.6003 24H18.4003",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M24.0049 8V10.4",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M10.1465 15.9954L12.225 17.1954",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M10.1406 31.9954L12.2191 30.7954",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M23.9951 40V37.6",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M37.8539 32.0046L35.7754 30.8046",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M37.8588 16.0045L35.7803 17.2045",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M28 46.8493C33.8841 45.8139 39.1414 42.5469 42.6753 37.7296C46.2092 32.9123 47.7468 26.9166 46.9675 20.9932C46.1882 15.0697 43.1521 9.67575 38.4925 5.9364C33.8329 2.19704 27.9095 0.40098 21.9578 0.922824C16.0061 1.44467 10.4857 4.24412 6.54787 8.7373C2.61007 13.2305 0.558967 19.0705 0.822366 25.0392C1.08576 31.0079 3.64332 36.6445 7.96161 40.7733C12.2799 44.9022 18.0255 47.2044 24 47.2",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]}),(0,Eo.jsx)("defs",{children:(0,Eo.jsx)("clipPath",{id:"clip0_28747_2860",children:(0,Eo.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]}),qP=e=>{let{...t}=e;return(0,Eo.jsx)(GP,{columnPinning:{right:["actions"]},placeholder:{icon:(0,Eo.jsx)(WP,{})},...t})},JP=()=>{const e=(0,wo.useIntl)(),{linkGen:t}=(0,yo.useContext)(Ub),{proceedings:n,isLoading:o,isError:r}=(0,xl.useSelector)(Zn),[i,a]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{a(((e,t)=>[uv.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Proceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),uv.accessor((e=>e.planningName),{id:"planningName",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),uv.accessor((e=>e.stateCode),{id:"stateCode",cell:t=>{const n=t.row.original,o=n.stateCode?cv(n.stateCode,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_state"})}),uv.accessor((e=>e.dateStart),{id:"dateStart",cell:e=>{const t=e.row.original;return t.dateStart?rv.dateToStr(t.dateStart):"-"},header:e.formatMessage({id:"my_plannings.table.header.proceeding_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),uv.accessor((e=>e.document),{id:"document",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.document,void 0,!0),children:n.document})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),uv.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),uv.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})])(e,t))}),[n]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:n,columns:i,id:"plannings-proceedings-table"})},XP=()=>{const e=(0,wo.useIntl)();return(0,Eo.jsxs)(cb,{id:mn.PlanningsProceedings,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsProceedings}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(JP,{})})]})};function ZP(e,t){const n=(e,t,n)=>({name:e,oldType:t,newType:n});switch(Un[e]){case Un.DO_DOKUSEIS_ESITATUD:return n(t.formatMessage({id:"document.status.submitted"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_KEHTETU:return n(t.formatMessage({id:"document.status.void"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_KOOSTAMISEL:case Un.DO_DOKUSEIS_EELNOU_AKTIIVNE:return n(t.formatMessage({id:"document.status.being_created"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_ALLKIRJASTAMISEL:return n(t.formatMessage({id:"document.status.waiting_signatures"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MENETLUSES:return n(t.formatMessage({id:"document.status.being_processed"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MUUTMISEL:return n(t.formatMessage({id:"document.status.being_edited"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_TAIENDAMISEL:return n(t.formatMessage({id:"document.status.being_revised"}),nn.Warning,on.Warning);case Un.DO_DOKUSEIS_TYHISTATUD:return n(t.formatMessage({id:"document.status.canceled"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_VANA_VERSIOON:return n(t.formatMessage({id:"document.status.old_version"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_LOOBUTUD:return n(t.formatMessage({id:"document.status.withdrawn"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_ALLKIRJASTATUD:return n(t.formatMessage({id:"document.status.signed"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MENETLETUD:return n(t.formatMessage({id:"document.status.processed"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_LUBATUD:return n(t.formatMessage({id:"document.status.allowed"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_LUB_TEAV:return n(t.formatMessage({id:"document.status.allowed"}),nn.Warning,on.Warning);case Un.DO_DOKUSEIS_KEELDUTUD:return n(t.formatMessage({id:"document.status.denied"}),nn.Danger,on.Danger);case Un.DO_DOKUSEIS_TEAVITATUD:return n(t.formatMessage({id:"document.status.notified"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_REG_KANTUD:return n(t.formatMessage({id:"document.status.registered"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_ANTUD:return n(t.formatMessage({id:"document.status.given"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_EM_KINNITATUD_AKTUAL:case Un.DO_DOKUSEIS_KEHTIV:return n(t.formatMessage({id:"document.status.valid"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS:return n(t.formatMessage({id:"document.status.voided"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_KOOSK_RINGIL:return n(t.formatMessage({id:"document.status.waiting_approval"}),nn.Info,on.Info);default:return n(e,nn.Default,on.Default)}}const QP={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},eN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r}=e;const i=(0,wo.useIntl)(),{linkGen:a}=(0,yo.useContext)(Ub),[s,l]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{l(((e,t)=>{const n=[QP.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),QP.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),QP.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),QP.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),QP.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),QP.accessor((e=>e),{id:"interestedPerson",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(i,a))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:s,id:`plannings-table-${n}`})},tN=()=>{const e=(0,wo.useIntl)(),{documents:t,isLoading:n,isError:o}=(0,xl.useSelector)(to);return(0,Eo.jsxs)(cb,{id:mn.PlanningsIncoming,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsIncoming}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(eN,{documents:t,isLoading:n,isError:o,documentType:tn.Incoming})})]})},nN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},oN=e=>{var t,n;let{documents:o,documentType:r,isLoading:i,isError:a,pagination:s,sorting:l,userInfo:c}=e;const d=(0,wo.useIntl)(),u=(0,xl.useDispatch)(),{linkGen:p}=(0,yo.useContext)(Ub),[f,m]=(0,yo.useState)([]);(0,yo.useEffect)((()=>{m(((e,t)=>{const n=[nN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),nN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),nN.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.proceeding_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),nN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),nN.accessor((e=>e),{id:"planningCode",cell:e=>e.row.original.areaCode,header:e.formatMessage({id:"my_plannings.table.header.planning_code"})}),nN.accessor((e=>e),{id:"planningName",cell:e=>e.row.original.areaName,header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),nN.accessor((e=>e),{id:"interestedPerson",cell:e=>e.row.original.interestedPerson,header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(d,p))}),[o]);return(0,Eo.jsx)(qP,{isLoading:i,isError:a,data:null!==(t=null==o?void 0:o.content)&&void 0!==t?t:[],columns:f,id:`plannings-table-${r}`,manualPagination:!0,pagination:s,onPaginationChange:e=>{u(ro(e)),u(Hn({userInfo:c,pagination:e}))},onSortingChange:e=>{u(io(e)),u(Hn({userInfo:c,sorting:e}))},manualSorting:!0,sorting:l,totalRows:null!==(n=null==o?void 0:o.totalElements)&&void 0!==n?n:0})},rN=e=>{let{userInfo:t}=e;const n=(0,wo.useIntl)(),{documents:o,isLoading:r,isError:i,pagination:a,sorting:s}=(0,xl.useSelector)(no);return(0,Eo.jsxs)(cb,{id:mn.PlanningsOngoing,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:n.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsOngoing}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(oN,{isLoading:r,isError:i,documents:o,documentType:tn.Working,pagination:a,sorting:s,userInfo:t})})]})},iN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},aN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r,showDefaultVersion:i}=e;const a=(0,wo.useIntl)(),{linkGen:s}=(0,yo.useContext)(Ub),[l,c]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{c(i?((e,t)=>{const n=[iN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),iN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),iN.accessor((e=>e.regDate),{id:"regDate",cell:e=>{const t=e.row.original;return t.regDate?rv.dateToStr(t.regDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),iN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),iN.accessor((e=>e),{id:"planningCode",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.planning_code"})}),iN.accessor((e=>e),{id:"proceedingName",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.proceeding_name"})}),iN.accessor((e=>e),{id:"interestedPerson",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(a,s):((e,t)=>{const n=[iN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),iN.accessor((e=>e),{id:"proceedingName",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.proceeding_name"})}),iN.accessor((e=>e.regDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.regDate?rv.dateToStr(t.regDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),iN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),iN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),iN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),iN.accessor((e=>e),{id:"interestedPerson",cell:e=>(0,Eo.jsx)(Eo.Fragment,{}),header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(a,s))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:l,id:`plannings-table-${n}`})},sN=e=>{let{showDefaultVersion:t}=e;const n=(0,wo.useIntl)(),{documents:o,isLoading:r,isError:i}=(0,xl.useSelector)(oo);return(0,Eo.jsxs)(cb,{id:mn.PlanningsCompleted,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:n.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsCompleted}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(aN,{isLoading:r,isError:i,documents:o,documentType:tn.Finished,showDefaultVersion:t})})]})},lN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},cN=()=>{const e=(0,wo.useIntl)(),{linkGen:t}=(0,yo.useContext)(Ub),{operations:n,isLoading:o,isError:r}=(0,xl.useSelector)(eo),[i,a]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{a(((e,t)=>{const n=[lN.accessor((e=>e.deadline),{id:"deadline",cell:e=>{const t=e.row.original;return t.deadline?rv.dateToStr(t.deadline):"-"},header:e.formatMessage({id:"my_plannings.table.header.deadline"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),lN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),lN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=n.state?cv(n.state,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.comment_state"})}),lN.accessor((e=>e.operationExecutor),{id:"proceeder",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.proceeder"})}),lN.accessor((e=>e.doty),{id:"documentType",cell:e=>{var t,n;const o=e.row.original;return(0,Eo.jsx)(Eo.Fragment,{children:null!==(t=null===(n=Rn.find((e=>e.code===o.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""})},header:e.formatMessage({id:"my_plannings.table.header.document_type"})})];return n})(e,t))}),[n]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:n,columns:i,id:"plannings-operations-table"})},dN=()=>{const e=(0,wo.useIntl)();return(0,Eo.jsxs)(cb,{id:mn.PlanningsToComment,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsToComment}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(cN,{})})]})},uN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},pN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r}=e;const i=(0,wo.useIntl)(),{linkGen:a}=(0,yo.useContext)(Ub),[s,l]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{l(((e,t,n)=>{const o=[uN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const t=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>n(e,iv.Document,t.docNr,void 0,!0),children:t.docNr})},header:e.formatMessage({id:"my_plannings.table.header.document_nr"})}),uN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),uN.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),uN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),uN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const t=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>n(e,iv.PlanningProceeding,t.proceedingNr,void 0,!0),children:t.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),uN.accessor((e=>e.presenter),{id:"proceeder",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.proceeder"})})];return o})(i,0,a))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:s,id:`plannings-table-${n}`})},fN=()=>{const e=(0,wo.useIntl)(),{documents:t,isLoading:n,isError:o}=(0,xl.useSelector)(Qn);return(0,Eo.jsxs)(cb,{id:mn.PlanningsToSign,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsToSign}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(pN,{documents:t,isLoading:n,isError:o,documentType:tn.Signing})})]})},mN=(0,u.createAsyncThunk)("myPlannings/getAllPlanningsData",(async(e,t)=>{let{userInfo:n}=e,{dispatch:o}=t;o(Fn({userInfo:n})),o(Kn({userInfo:n})),o(Jn({userInfo:n})),o(zn({userInfo:n})),o(Hn({userInfo:n})),o(Yn({userInfo:n}))})),gN=e=>[cn,dn].includes(e),hN=e=>{let{userInfo:t}=e;const n=(0,wo.useIntl)(),{linkGen:o}=(0,yo.useContext)(Ub),[r,i]=(0,yo.useState)(!1),[a,s]=(0,yo.useState)([]),[l,c]=(0,yo.useState)("");(0,yo.useEffect)((()=>{u()}),[t]);const d=()=>{i((e=>!e))},u=()=>{const e=(null===(o=t.activeRole)||void 0===o?void 0:o.businessType)===ln.KOV?[Cn,Mn.code,On.code]:4406958===(null===(r=t.activeRole)||void 0===r?void 0:r.businessId)?[Dn.code,kn.code]:gN(null===(i=t.activeRole)||void 0===i?void 0:i.businessId)?[kn.code]:[];var o,r,i;c(e[0]||"");const a=e.map((e=>({id:e,key:e,title:n.formatMessage({id:`plannings.type.${e}`}),description:(0,Eo.jsx)(Cl,{children:(0,Eo.jsxs)(Sp,{children:[(0,Eo.jsx)(wo.FormattedMessage,{id:`plannings.type.${e}.description`}),(0,Eo.jsx)("br",{})]})})})));s(a)};return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(jp,{id:"modal-new-plan",visualType:"primary",iconLeft:"add",onClick:d,children:n.formatMessage({id:"my_plannings.page.button.existing_planning"})}),(0,Eo.jsx)(Fb,{toggleVisible:d,primaryText:"button.begin",secondaryText:"button.cancel",onPrimary:()=>{var e;(e=l)&&o(void 0,fn.Document,"",{doty:e},!0)},onSecondary:()=>{var e;c((null===(e=a[0])||void 0===e?void 0:e.key)||""),d()},size:6,visible:r,title:"my_plannings.modal.title.add_existing_planning",cardProps:{border:"top-positive-main"},children:(0,Eo.jsx)(Cb,{selectItems:a,value:l,onChange:c})})]})},bN=[mn.PlanningsProceedings,mn.PlanningsToSign,mn.PlanningsToComment,mn.PlanningsIncoming,mn.PlanningsOngoing,mn.PlanningsCompleted],vN=e=>{var t,n;let{userInfo:o,linkGen:r}=e;const i=(0,xl.useDispatch)(),a=(0,yo.useMemo)((()=>({linkGen:r})),[r]);(0,yo.useEffect)((()=>{o&&i(mN({userInfo:o}))}),[]);const s=[ln.MKM,ln.KOV,ln.RPLAN].includes(null===(t=o.activeRole)||void 0===t?void 0:t.businessType)||gN(null===(n=o.activeRole)||void 0===n?void 0:n.businessId);return(0,Eo.jsx)(Cl,{id:"MyPlanningsPage",gutter:0,children:(0,Eo.jsx)(Ml,{children:(0,Eo.jsx)(Ub.Provider,{value:a,children:(0,Eo.jsxs)(pp,{size:.5,children:[(0,Eo.jsx)(bp,{title:"my_plannings.page_title"}),(0,Eo.jsxs)(Cl,{justifyContent:"end",gutter:0,gap:2,children:[s&&(0,Eo.jsx)(hN,{userInfo:o}),window.PLANIS_DEV&&(0,Eo.jsx)($b,{})]}),(0,Eo.jsxs)(gp,{defaultOpenItem:bN,gutter:1,children:[s&&(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(XP,{}),(0,Eo.jsx)(fN,{}),(0,Eo.jsx)(dN,{}),(0,Eo.jsx)(tN,{})]}),(0,Eo.jsx)(rN,{userInfo:o}),(0,Eo.jsx)(sN,{showDefaultVersion:!s})]})]})})})})},yN=e=>(0,Eo.jsx)(yl,{locale:"et",children:(0,Eo.jsx)(vN,{...e})});function xN(e,t,n){const o=n(e).trim(),r=n(t).trim();return o.toLowerCase()===r.toLowerCase()?0:""===o?1:""===r?-1:o.toLowerCase()>r.toLowerCase()?1:-1}function SN(e,t,n){const o=n(e),r=n(t);return o===r?0:o>r?1:-1}function wN(e){if("0"===e.done&&"0"===e.all)return 15;if(e.done===e.all)return 9;let t=parseInt(e.done)/parseInt(e.all);return 1===t&&(t+=parseInt(e.all)/1e4),t}function _N(e,t,n){const o=n(e),r=n(t),i=wN(o),a=wN(r);return a===i?0:i>a?1:-1}function EN(e,t,n){const o=n(e),r=n(t);return o===r?0:o>r?1:-1}function TN(e,t,n){if(0===e.length)return e;const o={string:xN,number:SN,object:_N,date:EN}[typeof t(e[0])],r=[...e].sort(((e,r)=>o(e,r,t)*n));return r}const IN=0,CN=1,MN=-1;function ON(e,t){return{column:e,direction:e===t.column?function(e){switch(e){case IN:return CN;case CN:return MN;case MN:return CN}}(t.direction):CN}}const DN=e=>-1===e.sortDirection?(0,Eo.jsx)("svg",{width:"10",height:"8",viewBox:"0 8 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}):1===e.sortDirection?(0,Eo.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}):(0,Eo.jsx)("svg",{width:"10",height:"16",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}),kN=e=>{const[t,n]=(0,yo.useState)(!1);return(0,Eo.jsx)(Eo.Fragment,{children:e.fileId&&(0,Eo.jsx)(_o.ControlledPopover,{content:(0,Eo.jsxs)("div",{style:{width:"250px"},children:[(0,Eo.jsx)("h4",{children:(0,Eo.jsx)(wo.FormattedMessage,{id:"download.file"})}),(0,Eo.jsx)("br",{}),(0,Eo.jsxs)("div",{className:"d-flex justify-content-between mt-2",children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",type:"reset",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",onClick:()=>{e.fileId&&e.fileApi.downloadFile(e.fileId,{responseType:"blob"}).then((e=>{const o=e.headers["content-disposition"];let r="download";if(o){const e=o.match(/filename\*=UTF-8''(.+?)(;|$)/);e&&e.length>=2&&(r=decodeURIComponent(e[1].replace(/\+/g," ")))}const i=new Blob([e.data],{}),a=document.createElement("a");a.download=r,a.href=URL.createObjectURL(i),a.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(a.href)),3e4)})),a.click(),n(!t)})).catch((e=>console.log(e)))},squared:!0,type:"submit",children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.download"})})]})]}),open:t,placement:"bottom-end",toggle:()=>n(!t),children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.download"}),type:"download"})})})},jN=[{code:Un.DO_DOKUSEIS_ESITATUD,value:"Esitatud"},{code:Un.DO_DOKUSEIS_KOOSTAMISEL,value:"Koostamisel"},{code:Un.DO_DOKUSEIS_MENETLUSES,value:"Menetluses"},{code:Un.DO_DOKUSEIS_MUUTMISEL,value:"Muutmisel"},{code:Un.DO_DOKUSEIS_TAIENDAMISEL,value:"Täiendamisel"}],AN=[{code:Un.DO_DOKUSEIS_KEHTETU,value:"Kehtetu"},{code:Un.DO_DOKUSEIS_REG_KANTUD,value:"Registrisse kantud"},{code:Un.DO_DOKUSEIS_TYHISTATUD,value:"Tühistatud"},{code:Un.DO_DOKUSEIS_LOOBUTUD,value:"Tagasi võetud"}];function PN(e){let t=[];e===Kt?t=jN:e===zt&&(t=AN);const n=t.sort(((e,t)=>e.value.localeCompare(t.value)));return function(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}(n)}function NN(e,t){if(t.documentTypes.length>0&&(e=e.filter((e=>void 0!==e.doty&&t.documentTypes.includes(e.doty)))),t.ehrCode.length>0&&(e=e.filter((e=>{var n;return null===(n=e.ehrCode)||void 0===n?void 0:n.some((e=>{var n;return null!==(n=e.startsWith(t.ehrCode.trim()))&&void 0!==n&&n}))}))),t.buildingName.length>0&&(e=e.filter((e=>{var n;return null===(n=e.buildingName)||void 0===n?void 0:n.some((e=>{var n,o;return null!==(n=null==e||null===(o=e.toLocaleLowerCase())||void 0===o?void 0:o.includes(t.buildingName.toLocaleLowerCase()))&&void 0!==n&&n}))}))),t.wordInAddress.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.buildingAddress)||void 0===o?void 0:o.some((e=>null==e?void 0:e.toLocaleLowerCase().includes(t.wordInAddress.trim().toLocaleLowerCase()))))&&void 0!==n&&n}))),t.documentNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.docNr)||void 0===o?void 0:o.includes(t.documentNumber.trim()))&&void 0!==n&&n}))),t.documentStates.length>0&&(e=e.filter((e=>{return(n=e.stateCode)&&[Un.DO_DOKUSEIS_MENETLETUD,Un.DO_DOKUSEIS_LUBATUD,Un.DO_DOKUSEIS_LUB_TEAV,Un.DO_DOKUSEIS_KEELDUTUD,Un.DO_DOKUSEIS_TEAVITATUD,Un.DO_DOKUSEIS_REG_KANTUD,Un.DO_DOKUSEIS_ANTUD,Un.DO_DOKUSEIS_KEHTIV].includes(n)?t.documentStates.includes(Un.DO_DOKUSEIS_REG_KANTUD):e.stateCode&&t.documentStates.includes(e.stateCode);var n}))),t.institutionUsers.length>0&&(e=e.filter((e=>(void 0!==e.presenter||null!==e.presenter)&&t.institutionUsers.find((t=>{var n;return!0===(null===(n=e.connectedPersonId)||void 0===n?void 0:n.includes(t))}))))),t.proceedingNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.proceedingNr)||void 0===o?void 0:o.includes(t.proceedingNumber.trim()))&&void 0!==n&&n}))),t.institutions.length>0&&(e=e.filter((e=>void 0!==e.institutionId&&t.institutions.includes(e.institutionId)))),!0===t.proceedingMissing&&(e=e.filter((e=>null===e.proceedingNr||void 0===e.proceedingNr))),t.documentDate.from.length>0&&0===t.documentDate.to.length){const n=new Date(t.documentDate.from).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.documentDate.to.length>0&&0===t.documentDate.from.length){const n=new Date(t.documentDate.to).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.documentDate.from.length>0&&t.documentDate.to.length>0){const n=new Date(t.documentDate.from).getTime(),o=new Date(t.documentDate.to).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n&&new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=o))}return e}function RN(e){var t,n,o,r;const[i,a]=(0,yo.useState)(!1);function s(){a(!i)}const l=(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("h4",{children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kas olete kindel, et soovite selle rea kustutada?",id:null!==(t=e.titleText)&&void 0!==t?t:"common.confirmation.modal.header"})}),(0,Eo.jsx)("p",{children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kustutatud ridu ei ole võimalik hiljem taastada",id:null!==(n=e.messageText)&&void 0!==n?n:"common.confirmation.modal.description"})}),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",squared:!0,type:"reset",children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Loobun",id:"common.confirmation.modal.no"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"danger",onClick:()=>(e.onConfirm(),void s()),squared:!0,type:"submit",children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kustutan",id:"common.confirmation.modal.yes"})})]})]});return(0,Eo.jsx)(_o.ControlledPopover,{delegateFocusOnOpen:null===(o=e.delegateFocusOnOpen)||void 0===o||o,className:"popover-confirm",content:e.content||l,open:i,placement:"top-end",theme:"danger",toggle:()=>s(),wrapperClassName:null!==(r=e.wrapperClassName)&&void 0!==r?r:"",children:e.children})}function LN(e){return(0,Eo.jsx)(RN,{titleText:e.titleText,messageText:e.messageText,onConfirm:e.onConfirm,children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.delete"}),type:"delete"})})}const FN=e=>{let{linkName:t,functionCall:n,tooltipText:o}=e;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(_o.Link,{onClick:e=>null==n?void 0:n(e),text:(0,Eo.jsx)(_o.Text,{raw:t})}),(0,Eo.jsx)(_o.Info,{tooltipText:o})]})};var UN,VN=new Uint8Array(16);function $N(){if(!UN&&!(UN="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return UN(VN)}const BN=/^(?:[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;const KN=function(e){return"string"==typeof e&&BN.test(e)};for(var zN=[],HN=0;HN<256;++HN)zN.push((HN+256).toString(16).substr(1));const YN=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(zN[e[t+0]]+zN[e[t+1]]+zN[e[t+2]]+zN[e[t+3]]+"-"+zN[e[t+4]]+zN[e[t+5]]+"-"+zN[e[t+6]]+zN[e[t+7]]+"-"+zN[e[t+8]]+zN[e[t+9]]+"-"+zN[e[t+10]]+zN[e[t+11]]+zN[e[t+12]]+zN[e[t+13]]+zN[e[t+14]]+zN[e[t+15]]).toLowerCase();if(!KN(n))throw TypeError("Stringified UUID is invalid");return n};const GN=function(e,t,n){var o=(e=e||{}).random||(e.rng||$N)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=o[r];return t}return YN(o)},WN=e=>{let{notificationStyle:t,header:n,link:o,body:r,onCloseNotification:i,isNotClosable:a,customBody:s}=e;const l=(0,wo.useIntl)(),c=null!=s?s:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("h3",{className:"alert-heading",children:n}),(0,Eo.jsx)("p",{className:"alert-body mb-0",children:r}),o&&(0,Eo.jsx)("div",{className:"mx-2",children:(0,Eo.jsx)(_o.Link,{onClick:o.onClick,text:l.formatMessage({id:o.text})})})]});return a?(0,Eo.jsx)("div",{id:"danger-toast",className:`alert ${t}`,children:c}):(0,Eo.jsxs)("div",{id:"danger-toast",className:`alert alert-toast-box ${t}`,children:[(0,Eo.jsx)("a",{className:"toast-close icon-close",role:"button","data-toggle":"tooltip","data-tooltip-placement":"bottom","data-tooltip-class":"tooltip-icon","data-tooltip-trigger":"hover focus","data-tooltip-title":"Sulgen","aria-label":"Sulgen","data-animation":"false",onClick:i}),c]})};let qN=function(e){return e.Danger="danger",e.Warning="warning",e.Info="info",e.Success="success",e}({});const JN=()=>{const e=(0,wo.useIntl)(),t=(0,xl.useDispatch)(),n=(0,xl.useSelector)(Lt),[o,r]=(0,yo.useState)();(0,yo.useEffect)((()=>{n&&r(n)}),[n]);const i=t=>{if(t)return"string"==typeof t?e.formatMessage({id:t}):t.values?e.formatMessage({id:t.id},{...t.values}):e.formatMessage({id:t.id})};return(0,Eo.jsx)(Eo.Fragment,{children:(0,Eo.jsx)("div",{className:"notification-alert-box",children:(0,Eo.jsx)("ul",{children:(null==o?void 0:o.length)>0&&o.map((e=>{var n;return(0,Eo.jsx)("li",{children:e.theme&&(0,Eo.jsx)(WN,{notificationStyle:"alert-"+e.theme+" show",header:i(null!==(n=e.messageCode)&&void 0!==n?n:e.header),body:e.messageCode?void 0:i(e.body),onCloseNotification:()=>{return n=e.id,void t(Vt(n));var n},link:e.link})},e.id)}))})})})},XN=(0,u.createAsyncThunk)("globalUI/handleNotification",(async(e,t)=>{let{dispatch:n,getState:o}=t;const r=o().myViewsPage.notifications.notices,i=GN(),a={...e,id:i};n(Ut([...r,a])),e.theme!==qN.Danger&&setTimeout((()=>{n(Vt(i))}),7e3)})),ZN=(0,u.createAsyncThunk)("document/createDocument",(async(e,t)=>{let{addEntityDto:n,successCallback:o}=e,{dispatch:r}=t;try{const e=await ft.documentApiService.createDocument(n.documentType,n);return o&&o(e.data),r(Ft()),e.data}catch(e){r(XN({header:"request.error.create_document.title",body:"request.error.create_document.message",theme:qN.Danger}))}})),QN=e=>{var t;let{doty:n,documentId:o,linkGen:r,userInfo:i}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!1),c=(null==i||null===(t=i.activeRole)||void 0===t?void 0:t.businessType)===ln.TJA,d=(e,t)=>{if(!t)return;a(ZN({addEntityDto:{documentType:t,baseDocumentId:o},successCallback:t=>((e,t)=>{const n=`${e.documentTypeWithYear}/${e.documentNumber}`;e&&r(!0,t,sn,n)})(t,e)}))};return(0,Eo.jsx)(_o.ControlledPopover,{content:(()=>{const e=n,t=An[e],o=Pn[e];return(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)("ul",{children:[(0,Eo.jsx)("li",{className:"d-flex justify-content-between",children:(0,Eo.jsx)(FN,{linkName:"my_documents.document_table.more_actions.request_document_cancellation",tooltipText:`my_documents.document_table.more_actions.request_document_cancellation.tooltip.${e}`,functionCall:e=>{d(e,o),l(!s)}})}),c&&(0,Eo.jsx)("li",{className:"d-flex justify-content-between",children:(0,Eo.jsx)(FN,{linkName:"my_documents.document_table.more_actions.cancel_document",tooltipText:`my_documents.document_table.more_actions.cancel_document.tooltip.${e}`,functionCall:e=>{d(e,t),l(!s)}})})]}),(0,Eo.jsx)(_o.Button,{onClick:()=>{l(!1)},squared:!0,colourScheme:"light",children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})})]})})(),open:s,placement:"bottom-end",toggle:()=>l(!s),children:(0,Eo.jsx)("div",{className:"pl-2",children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.more_actions"}),type:"more"})})})},eR=e=>{var t;let{linkGen:n,userInfo:o,documentType:r,onAllUsersChecked:i,isAllUsersChecked:a,filter:s,onDocumentDelete:l,fileApi:c,hidePresenter:d}=e;const u=(0,wo.useIntl)(),[p,f]=(0,yo.useState)({offset:0,limit:10}),[m,g]=(0,yo.useState)([]),[h,b]=(0,yo.useState)({column:0,direction:IN}),[v,y]=(0,yo.useState)(!1),[x,S]=(0,yo.useState)(!1),[w,_]=(0,yo.useState)(!1),E=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.workingDocuments)),T=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.signingDocuments)),I=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.finishedDocuments)),C=(0,xl.useSelector)((e=>e.myViewsPage.myProceedings.incomingDocuments)),M=(null===(t=o.activeRole)||void 0===t?void 0:t.businessType)!==ln.A;(0,yo.useEffect)((()=>{E&&r===Kt&&(Object.keys(s).length>0?(g(NN(E,s)),f({offset:0,limit:10})):g(E))}),[E,s]),(0,yo.useEffect)((()=>{T&&r===Bt&&(Object.keys(s).length>0?(g(NN(T,s)),f({offset:0,limit:10})):g(T))}),[T,s]),(0,yo.useEffect)((()=>{I&&r===zt&&(Object.keys(s).length>0?(g(NN(I,s)),f({offset:0,limit:10})):g(I))}),[I,s]),(0,yo.useEffect)((()=>{C&&r===Ht&&(Object.keys(s).length>0?(g(NN(C,s)),f({offset:0,limit:10})):g(C))}),[C,s]);const O=["my_documents.doc_date","my_documents.reg_date","my_documents.doc_nr","my_documents.document_type","my_documents.building_name","my_documents.ehr_code","my_documents.building_address","my_documents.state","my_documents.proceeding_nr"];d||O.push("my_documents.presenter");const D=[e=>sv(e.docDate)?new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>r===Ht?sv(e.deadlineDate)?new Date(tv()(e.deadlineDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER:sv(e.regDate)?new Date(tv()(e.regDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""},e=>e.buildingName&&sv(e.buildingName[0])?e.buildingName[0]:"",e=>e.ehrCode&&sv(e.ehrCode[0])?e.ehrCode[0]:"",e=>e.buildingAddress&&sv(e.buildingAddress[0])?e.buildingAddress[0]:"",e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>e.presenter?e.presenter.join(","):""];const k=e=>{var t;const i=[(0,Eo.jsx)(kN,{fileApi:c,fileId:e.generatedFileId,docNr:null!==(t=e.docNr)&&void 0!==t?t:""},e.docId+"download")];return r===Kt&&e.stateCode===Un.DO_DOKUSEIS_KOOSTAMISEL?i.push((0,Eo.jsx)(LN,{onConfirm:()=>{l(e.docNr)},titleText:"my_documents.delete_document_confirmation.modal.header",messageText:"my_documents.delete_document_confirmation.modal.message"},e.docNr)):r===zt&&e.doty&&jn.includes(e.doty)&&![Un.DO_DOKUSEIS_TYHISTATUD,Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS].includes(e.stateCode)&&i.push((0,Eo.jsx)(QN,{doty:e.doty,documentId:e.docId,linkGen:n,userInfo:o})),i};return(0,Eo.jsxs)(_o.Section,{form:!0,children:[m&&(0,Eo.jsx)(_o.CollapseTable,{content:m.slice(p.offset,p.offset+p.limit).map((e=>{var t,o,i,a,s,l,c;return(0,Eo.jsx)(_o.CollapseTableRow,{fields:[e.docDate,r===Ht?tv()(e.deadlineDate,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:null===(t=e.deadlineDate)||void 0===t?void 0:t.toString()}):e.deadlineDate:e.regDate,(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_documents.tooltip.open_document"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:t=>{n(!0,t,sn,e.docNr)},text:e.docNr,href:n(!1,void 0,sn,e.docNr)})},e.docNr),e.documentType,e.buildingName?(0,Eo.jsx)("div",{children:w?(0,Eo.jsxs)("div",{children:[e.buildingName.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),e.buildingName.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),_(!w)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_building_names"})})]}):1===e.buildingName.length?e.buildingName:(0,Eo.jsxs)("div",{children:[null===(o=e.buildingName)||void 0===o?void 0:o.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(i=e.buildingName)||void 0===i?void 0:i.slice(4,5),e.buildingName.length>5?" ...":"",e.buildingName.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),_(!w)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_building_names"})})})]})}):"",e.ehrCode?(0,Eo.jsx)("div",{children:x?(0,Eo.jsxs)("div",{children:[e.ehrCode.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}),(0,Eo.jsx)("br",{})]},t))),e.ehrCode.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),S(!x)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[null===(a=e.ehrCode)||void 0===a?void 0:a.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}),(0,Eo.jsx)("br",{})]},t))),null===(s=e.ehrCode)||void 0===s?void 0:s.slice(4,5).map((e=>(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}))),e.ehrCode.length>5?" ...":"",e.ehrCode.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),S(!x)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_ehrCodes"})})})]})}):"",e.buildingAddress?(0,Eo.jsx)("div",{children:v?(0,Eo.jsxs)("div",{children:[e.buildingAddress.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),e.buildingAddress.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),y(!v)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_addresses"})})]}):1===e.buildingAddress.length?e.buildingAddress:(0,Eo.jsxs)("div",{children:[null===(l=e.buildingAddress)||void 0===l?void 0:l.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(c=e.buildingAddress)||void 0===c?void 0:c.slice(4,5),e.buildingAddress.length>5?" ...":"",e.buildingAddress.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),y(!v)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_addresses"})})})]})}):"",e.stateCode?(0,Eo.jsx)(_o.Status,{type:ZP(e.stateCode,u).oldType,children:ZP(e.stateCode,u).name}):"",r===Bt?(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_documents.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:t=>{n(!0,t,an,e.proceedingNr)},text:e.proceedingNr,href:n(!1,void 0,an,e.proceedingNr)})},e.proceedingNr):e.proceedingNr,e.presenter?e.presenter.map(((t,n)=>(0,Eo.jsxs)("div",{children:[t,n!==e.presenter.length-1?(0,Eo.jsx)("span",{children:", "}):""]}))):""],tools:k(e),editable:!0},e.docId)})),headers:function(){const e=[...O];return e[1]="my_documents.deadline",(r===Ht?e:O).map(((e,t)=>(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(t,h);b(e),e.direction!==IN&&g(TN(m,D[t],e.direction))},children:h.column===t?(0,Eo.jsx)(DN,{sortDirection:h.direction}):(0,Eo.jsx)(DN,{sortDirection:IN})}),u.formatMessage({id:e})]})))}(),paginationEnabled:!0,pager:{offset:p.offset,limit:p.limit,total:m.length},onPaginationReload:f,editable:!0}),(0,Eo.jsx)(_o.Row,{children:M&&r!==Ht?(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:e=>i(e),text:(0,Eo.jsx)(_o.Text,{raw:"my_documents.view_all_institution_documents"}),checked:a})}):(0,Eo.jsx)(_o.Col,{})})]})},tR=require("reactstrap");function nR(e,t,n,o,r){return o?(0,Eo.jsx)(_o.FieldWrapper,{labelCol:r,component:(0,Eo.jsxs)(tR.Row,{className:"w-100 px-0 mx-0",children:[(0,Eo.jsx)(tR.Col,{xs:"auto",md:1.5,className:"pl-0 px-0",children:(0,Eo.jsx)(_o.Checkbox,{"data-testid":"checkbox",info:{content:o,placement:"top-start"},name:"checkbox",text:"",checked:e})}),(0,Eo.jsx)(tR.Col,{className:"px-0",children:(0,Eo.jsx)(_o.Text,{raw:(0,Eo.jsx)(wo.FormattedMessage,{id:n})})})]}),label:" "}):(0,Eo.jsx)(_o.FieldWrapper,{labelCol:r,component:(0,Eo.jsx)(_o.Checkbox,{"data-testid":"checkbox",name:"checkbox",onChange:e=>t(e),text:(0,Eo.jsx)(_o.Text,{raw:(0,Eo.jsx)(wo.FormattedMessage,{id:n})}),checked:e}),label:" "})}const oR=["110","11002","111","11119","11129","11139","11149","11158","11159","11191","11199","112","11201","11202","11203","11204","11205","11206","11211","11212","11213","11214","11219","11229","11231","11232","11233","11234","11239","11241","11249","11251","11271","11272","11273","11274","11275","11291","11299","113","11301","11302","11303","11304","11305","11306","11311","11312","11313","11314","11318","11319","11328","11329","11331","11332","11333","11334","11338","11339","11341","11348","11349","11351","11359","11371","11381","11391","11399","114","11411","11412","11413","11430","115","11511","11512","11513","11514","11515","11516","11518","11521","11522","11523","11524","11525","11526","11527","11531","11542","11551","11561","11563","11564","11565","11566","11567","11569","11571","11573","11574","11576","11577","11578","11581","11582","11584","11601","118","11802","11811","11821","11831","120","121","12119","12129","12139","12149","12158","12159","12199","122","12211","12212","12213","12214","12219","12229","12231","12232","12233","12234","12239","12241","12249","12251","12271","12291","12299","123","12311","12312","12313","12314","12318","12319","12328","12329","12331","12332","12333","12334","12338","12339","12341","12348","12349","12351","12359","12371","12381","12391","12399","127","12711","12731","12741","12742","12743","12744","12745","12899","129","12902","12911","12912","12921","12922","12931","12932","12942","12972","12973","12971","12974","12975","12976","12977","12978","12994","12999","130","13001","13002","13003","13009","131","13101","900","91511","91561","92731","92741","92743","92744","92745","11583"];function rR(e){const t=e.filter((e=>oR.includes(e.id.toString()))).sort(((e,t)=>e.id-t.id));return function(e){let t={id:"0",label:"00000",parentId:"0",level:1,value:!1,selectable:!1,children:[]};for(let n of e){let e=n.id.toString(),o=t;for(let t=1;t<=n.id;t++)if(o.children){let n=o.children.find((n=>n.id.toString()===e.slice(0,t)));n&&(o=n)}o.children&&o.children.push({id:e+"",parentId:o.id,label:n.name+(null!==n.validTo&&tv()(n.validTo).isBefore(tv()(new Date))?" (kuni "+tv()(n.validTo).format("DD.MM.YYYY")+")":""),level:o.level+1,children:[],selectable:!0,value:!1})}return t.children?t.children:[]}(t)}function iR(e){const t=e.sort(((e,t)=>e.firstName.localeCompare(t.firstName)));return function(e){return e.map((e=>({id:e.id+"",label:e.firstName+" "+e.lastName+" ("+e.personalCode+")",level:2,children:[],selectable:!0,value:!1})))}(t)}function aR(e){const t=e.sort(((e,t)=>e.regName.localeCompare(t.regName)));return function(e){return e.map((e=>({id:e.id+"",label:e.regName,level:2,children:[],selectable:!0,value:!1})))}(t)}function sR(e){var t,n,o,r;return(0,Eo.jsxs)("div",{className:"d-flex align-items-center",children:[(0,Eo.jsx)("div",{className:"range--from",style:{flexGrow:1},children:(0,Eo.jsx)(_o.DatePicker,{disabled:null!==(t=e.disabled)&&void 0!==t&&t,maxLength:e.maxLength,onBlur:(t,n)=>e.onBlur?e.onBlur(t,n):null,onChange:(t,n)=>function(t,n){const o={...e.value};o.from=t,e.onChange(o,n)}(t,n),onFocus:(t,n)=>e.onFocus?e.onFocus(t,n):null,value:null===(n=e.value)||void 0===n?void 0:n.from})}),(0,Eo.jsx)("span",{className:"px-1",children:"—"}),(0,Eo.jsx)("div",{className:"range--to",style:{flexGrow:1},children:(0,Eo.jsx)(_o.DatePicker,{disabled:null!==(o=e.disabled)&&void 0!==o&&o,maxLength:e.maxLength,onBlur:(t,n)=>e.onBlur?e.onBlur(t,n):null,onChange:(t,n)=>function(t,n){const o={...e.value};o.to=t,e.onChange(o,n)}(t,n),onFocus:(t,n)=>e.onFocus?e.onFocus(t,n):null,value:null===(r=e.value)||void 0===r?void 0:r.to})})]})}const lR=e=>{const t=(0,wo.useIntl)(),n=/^[\\s0-9]{0,9}$/,o=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,r={documentTypes:[],ehrCode:"",buildingName:"",wordInAddress:"",documentNumber:"",cadastralNumber:"",documentStates:[],institutionUsers:[],proceedingNumber:"",institutions:[],proceedingMissing:!1,documentDate:{from:"",to:""}},[i,a]=(0,yo.useState)(r);(0,yo.useEffect)((()=>{Object.keys(e.filterState).length>0&&a(e.filterState)}),[e.documentType]);const[s,l]=(0,yo.useState)(!0),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(""),[f,m]=(0,yo.useState)([]),[g,h]=(0,yo.useState)([]),[b,v]=(0,yo.useState)([]),[y,x]=(0,yo.useState)(PN(e.documentType)),[S,w]=(0,yo.useState)([]),_=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),E=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers)),T=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function I(e){return n.test(e)}function C(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],i[t]=n,a((e=>({...e})))}function M(e,t){var n;i[t]=e,"ehrCode"===t&&I(e)?l(!0):"cadastralNumber"===t&&(0===(n=e).length||o.test(n))&&d(!0),a((e=>({...e})))}(0,yo.useEffect)((()=>{x(PN(e.documentType))}),[e.documentType]),(0,yo.useEffect)((()=>{if(_){const e=rR(_);m(e)}if(E&&e.isKov){const e=iR(E?[...E]:[]);v(e)}if(T){const e=aR([...T]);h(e)}}),[_,E,T]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(i),children:[(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>C(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>C(e,"documentTypes"),value:i.documentTypes,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.building_name"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"documentNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.documentNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_number",placement:"top-start"}}),e.documentType!==Ht&&e.documentType!==Bt&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:y,onSelect:e=>C(e,"documentStates"),allSelection:!0,onRemoveItem:e=>C(e,"documentStates"),value:i.documentStates,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_state"}),labelCol:{sm:20,md:8,lg:8}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"proceedingNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.proceeding_number",placement:"top-start"}}),nR(i.proceedingMissing,(function(e){a((t=>({...t,proceedingMissing:e})))}),"my_documents.filter.label.proceeding_missing","my_documents.filter.tooltip.proceeding_missing"),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?p(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?p(t.formatMessage({id:"filter.invalid_date_range"})):p(""),a((t=>({...t,documentDate:e})))})(e),value:i.documentDate}),errorMessage:u.length>0?u:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"ehrCode"),onBlur:e=>l(I(e.trim())),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.ehrCode}),errorMessage:!s&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.ehrCode",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"wordInAddress"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.word_in_address",placement:"top-start"}}),e.documentType!==Ht&&e.documentType!==Bt&&e.isKov&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>C(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>C(e,"institutionUsers"),value:i.institutionUsers,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.institution_users",placement:"top-start"}}),e.documentType!==Ht&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:g,onSelect:e=>C(e,"institutions"),allSelection:!0,onRemoveItem:e=>C(e,"institutions"),value:i.institutions,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8}}),e.isKov&&e.documentType===Bt&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>C(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>C(e,"institutionUsers"),value:i.institutionUsers,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.institution_users",placement:"top-start"}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(w([]),void a(r)),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(s&&c),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},cR=["11566","11567","11569","11576","11577"],dR=[bn,vn,yn,xn],uR=e=>{const[t,n]=(0,yo.useState)(!1),[o,r]=(0,yo.useState)(""),[i,a]=(0,yo.useState)(!1),[s,l]=(0,yo.useState)([]),c=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.allowedDocumentTypesToStart)),d=e=>null==e||Number.isNaN(e)||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length;(0,yo.useEffect)((()=>{if(c){const e=c.filter((e=>!cR.includes(e.code)&&!dR.includes(e.code)));l(e.map((e=>({code:e.code,texts:e.value}))))}}),[c]);return(0,Eo.jsx)(_o.ControlledPopover,{maxWidth:900,open:t,content:(0,Eo.jsx)("div",{style:{width:"600px"},children:(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{a(!0)},children:[(0,Eo.jsx)("h2",{children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.popover.title.composing_new_document"})}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Select,{filterable:!0,placeholder:"placeholder.choose",name:"role",onChange:e=>r(e),options:s,value:o}),errorMessage:i&&d(o)&&(0,Eo.jsx)(_o.Text,{raw:"common.select.required"}),label:(0,Eo.jsx)(_o.Text,{raw:"my_documents.popover.label.new_document_type"}),name:"documentType",info:{content:"my_documents.popover.tooltip.document_type"}}),(0,Eo.jsxs)("div",{className:"d-flex justify-content-between mt-2",children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",onClick:()=>{a(!1),r("")},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",onClick:t=>{d(o)||(e.linkGen(!0,t,"DOCUMENT","",{doty:o}),n(!1))},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.popover.button.compose_new_document"})})]})]})}),placement:"bottom-end",toggle:()=>{n(!t)},children:(0,Eo.jsx)(_o.Button,{withPlus:!0,colourScheme:"info",onClick:()=>{n(!t)},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.button.start_new_document"})})})},pR=["11273","11272","11274","11275","11002","11051","11201","11271","11301","11371","11412","11413","11430","11522","11525","11527","11542","11566","11567","11569","11571","11576","11577","11581","11582","11584","11831","12731","12743","12744","12745","12899","12922","12932","12942","12973","12975","12976","12977","12978","12999","11526","11601","11583"],fR=["11273","11272","11274","11275","11002","11051","11201","11271","11301","11371","11412","11413","11430","11522","11525","11527","11542","11566","11567","11569","11571","11573","11574","11576","11577","11581","11582","11584","11831","12731","12743","12744","12745","12899","12922","12932","12942","12951","12952","12953","12973","12975","12976","12977","12978","12999","11526","11601","11583"],mR=["11273","11272","11582","11525","11271","11201","11301","11371","11002","11581","12271","12371","12921","12931","12995","12996","12902","11802","12999","12922","12932","12942","12899","11526","12972","12973"],gR=e=>{var t,n,o,r,i,a,s;let{linkGen:l,userInfo:c}=e;const d=(0,xl.useDispatch)(),[u,p]=(0,yo.useState)({signingDocs:!1,workingDocs:!1,finishedDocs:!1}),[f,b]=(0,yo.useState)(!1),[v,y]=(0,yo.useState)(!0),[x,I]=(0,yo.useState)(!0),[C,M]=(0,yo.useState)([]),[O,D]=(0,yo.useState)([]),[k,j]=(0,yo.useState)([]),[A,P]=(0,yo.useState)({}),[N,R]=(0,yo.useState)({}),[L,F]=(0,yo.useState)({}),U="A"!==(null===(t=c.activeRole)||void 0===t?void 0:t.businessType);const V={userId:null===(n=c.activeRole)||void 0===n?void 0:n.userId,personId:null===(o=c.activeRole)||void 0===o?void 0:o.businessId,dotys:pR,states:[Un.DO_DOKUSEIS_ESITATUD,Un.DO_DOKUSEIS_KOOSTAMISEL,Un.DO_DOKUSEIS_EELNOU_AKTIIVNE,Un.DO_DOKUSEIS_ALLKIRJASTAMISEL,Un.DO_DOKUSEIS_MENETLUSES,Un.DO_DOKUSEIS_TAIENDAMISEL,Un.DO_DOKUSEIS_MUUTMISEL]},$={userId:null===(r=c.activeRole)||void 0===r?void 0:r.userId,personId:null===(i=c.activeRole)||void 0===i?void 0:i.businessId,dotys:fR,states:[Un.DO_DOKUSEIS_KEHTETU,Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS,Un.DO_DOKUSEIS_REG_KANTUD,"DO_DOKUSEIS_TAGASTATUD",Un.DO_DOKUSEIS_KEELDUTUD,Un.DO_DOKUSEIS_TYHISTATUD,Un.DO_DOKUSEIS_LOOBUTUD,Un.DO_DOKUSEIS_ALLKIRJASTATUD,Un.DO_DOKUSEIS_MENETLETUD,Un.DO_DOKUSEIS_LUBATUD,Un.DO_DOKUSEIS_LUB_TEAV,Un.DO_DOKUSEIS_TEAVITATUD,Un.DO_DOKUSEIS_ANTUD,Un.DO_DOKUSEIS_KEHTIV]},B={userId:null===(a=c.activeRole)||void 0===a?void 0:a.userId,personId:null===(s=c.activeRole)||void 0===s?void 0:s.businessId,roles:[un],dotys:mR,states:[Un.DO_DOKUSEIS_ALLKIRJASTAMISEL]};return(0,yo.useEffect)((()=>{var e,t;ft.classifierApiService.getAllDocumentTypes().then((e=>{d(m(e.data))})).catch((e=>{console.log(e)})),ft.institutionKovEndpointApi.getJurKovPersons().then((e=>{d(h(e.data))})).catch((e=>{console.log(e)})),U&&ft.userApiService.getJurUsers(null!==(e=null===(t=c.activeRole)||void 0===t?void 0:t.businessId)&&void 0!==e?e:0).then((e=>{d(g(e.data))})).catch((e=>{console.log(e)})),ft.documentApiService.getDotysBasedOnUserRights().then((e=>{const t=e.data.filter((e=>"12922"!==e.code&&"11412"!==e.code&&"11413"!==e.code&&"12932"!==e.code&&"11430"!==e.code&&"12942"!==e.code));d(T(t))})).catch((e=>{console.log("Following error occured:",e)}))}),[c]),(0,yo.useEffect)((()=>{(()=>{const e=V;u.workingDocs&&(e.userId=void 0),y(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(S(e.data)),y(!1),D(e.data)})).catch((e=>{console.log("Following error occured:",e),y(!1)}))})()}),[u.workingDocs,c]),(0,yo.useEffect)((()=>{!function(){const e=$;u.finishedDocs&&(e.userId=void 0),I(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(_(e.data)),I(!1),j(e.data)})).catch((e=>{console.log("Following error occured:",e),I(!1)}))}()}),[u.finishedDocs,c]),(0,yo.useEffect)((()=>{!function(){const e=B;u.signingDocs&&(e.userId=void 0),b(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(w(e.data)),b(!1),M(e.data)})).catch((e=>{console.log("Following error occured:",e),b(!1)}))}()}),[u.signingDocs,c]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(JN,{}),(0,Eo.jsx)("div",{className:"d-flex justify-content-end mt-2",children:(0,Eo.jsx)(uR,{linkGen:l})}),U&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.my_documents_to_sign",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Bt,filterState:A,onSubmit:e=>P(e),isKov:U}),children:f?(0,Eo.jsx)(_o.SectionLoader,{}):0===C.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.signing_documents.no_docs"})}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:Bt,onAllUsersChecked:e=>{p({signingDocs:e,workingDocs:u.workingDocs,finishedDocs:u.finishedDocs})},isAllUsersChecked:u.signingDocs,filter:A,fileApi:ft.fileApiService,hidePresenter:!0})}),(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.working_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Kt,filterState:N,onSubmit:e=>R(e),isKov:U}),children:v?(0,Eo.jsx)(_o.SectionLoader,{}):0===O.length?(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.working_documents.no_docs"})}),U&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_documents.view_all_institution_documents",onClick:()=>{p({signingDocs:u.signingDocs,workingDocs:!0,finishedDocs:u.finishedDocs})}})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(uR,{linkGen:l})})]}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:Kt,onAllUsersChecked:e=>{p({signingDocs:u.signingDocs,workingDocs:e,finishedDocs:u.finishedDocs})},isAllUsersChecked:u.workingDocs,filter:N,onDocumentDelete:e=>function(e){const t=e.slice(0,e.indexOf("/")),n=e.slice(e.indexOf("/")+1);ft.documentApiService.deleteApplicationByNumber(t,n),d(E(e))}(e),fileApi:ft.fileApiService})}),(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.finished_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:zt,filterState:L,onSubmit:e=>F(e),isKov:U}),children:x?(0,Eo.jsx)(_o.SectionLoader,{}):0===k.length?(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.finished_documents.no_docs"})}),U&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_documents.view_all_institution_documents",onClick:()=>{p({signingDocs:u.signingDocs,workingDocs:u.workingDocs,finishedDocs:!0})}})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(uR,{linkGen:l})})]}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:zt,onAllUsersChecked:e=>{p({signingDocs:u.signingDocs,workingDocs:u.workingDocs,finishedDocs:e}),I(!0)},isAllUsersChecked:u.finishedDocs,filter:L,fileApi:ft.fileApiService})})]})};let hR=function(e){return e.Document="DOCUMENT",e.Proceeding="PROCEEDING",e.ProceedingDecision="PROCEEDING_DECISION",e.Operation="OPERATION",e.MyDocuments="MY_DOCUMENTS",e.MyProceedings="MY_PROCEEDINGS",e.MyPlannings="MY_PLANNINGS",e.MyAdministrativeProceedings="MY_ADMIN_PROCEEDINGS",e.Building="BUILDING",e.NewEnergy="NEW_ENERGY",e.ArchiveBuildingRegistryFile="ARCHIVE_BUILDINGREGISTRYFILE",e.ArchiveBuildingDatasOf2003="ARCHIVE_BUILDINGDATAASOF2003",e.ArchiveBuildingDatasOf2014="ARCHIVE_BUILDINGDATAASOF2014",e.Restriction="RESTRICTION",e.NotFound="404",e.AdminProceeding="ADMIN_PROCEEDING",e.PlanningProceeding="PLANNING_PROCEEDING",e}({});hR.Proceeding,hR.PlanningProceeding,hR.AdminProceeding;const bR=e=>e?hR.Proceeding:hR.NotFound,vR={0:"dateStart",1:"deadline",2:"proceedingNr",3:"stateCode",4:"proceedingCircleNr",5:"operationsCount",6:"innerCommentDeadline",7:"lastEventDate",8:"document",9:"documentType",10:"buildingName",11:"ehrCode",12:"address",13:"proceedingName",14:"supervisor",15:"documentPresenter",16:"archived",17:"proceedingLength"},yR=e=>{let{buildingNames:t}=e;const[n,o]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Eo.Fragment,{children:t}):(0,Eo.jsx)("div",{children:n?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_building_names"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.slice(2,3),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_building_names"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},xR=e=>{let{ehrCodes:t,linkGen:n}=e;const[o,r]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Mo,{linkName:t[0],tooltipText:"my_proceedings.tooltip.open_building",functionCall:e=>{n(!0,e,"BUILDING",t)},href:n(!1,void 0,"BUILDING",t)}):(0,Eo.jsx)("div",{children:o?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)}),(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),r(!o)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)}),(0,Eo.jsx)("br",{})]},e))),t.slice(2,3).map((e=>(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)},e))),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),r(!o)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_ehrCodes"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},SR=e=>{let{addresses:t}=e;const[n,o]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Eo.Fragment,{children:t}):(0,Eo.jsx)("div",{style:{width:125},children:n?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_addresses"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.slice(2,3),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_addresses"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},wR=e=>{let{deadline:t}=e;if(!t)return(0,Eo.jsx)(Eo.Fragment,{});return tv()(t,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:t}):(0,Eo.jsx)(Eo.Fragment,{children:t})},_R=e=>{let{deadline:t}=e;if(!t)return(0,Eo.jsx)(Eo.Fragment,{});return tv()(t).valueOf()<=tv()().valueOf()?(0,Eo.jsx)("div",{style:{color:"#00b649"},children:tv()(t).format("DD.MM.YYYY")}):(0,Eo.jsx)(Eo.Fragment,{children:tv()(t).format("DD.MM.YYYY")})},ER=e=>{let{proceedingNr:t,linkGenType:n,linkGen:o}=e;return t?(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:e=>{o(!0,e,n,t)},text:t,href:o(!1,void 0,n,t)})},t):(0,Eo.jsx)(Eo.Fragment,{})},TR=e=>{let{document:t,linkGen:n}=e;return t?(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_proceedings.tooltip.open_document",functionCall:e=>{n(!0,e,"DOCUMENT",t)}}):(0,Eo.jsx)(Eo.Fragment,{})},IR=e=>{let{stateCode:t}=e;const n=(0,wo.useIntl)();if(!t)return(0,Eo.jsx)(Eo.Fragment,{});const o=cv(t,n);return(0,Eo.jsx)(_o.Status,{type:o.oldType,children:o.name})},CR=e=>{var t,n;let{linkGen:o,isKov:r,onAllUsersChecked:i,isAllUsersChecked:a,userInfo:s}=e;const l=(0,wo.useIntl)(),c=(0,xl.useDispatch)(),{proceedings:d,isLoading:u,pagination:p,sorting:f}=(0,xl.useSelector)(bt),m=null!==(t=null==d?void 0:d.content)&&void 0!==t?t:[],g=null!==(n=null==d?void 0:d.totalElements)&&void 0!==n?n:0,h=["my_proceedings.date_start","my_proceedings.deadline","my_proceedings.proceeding_nr","my_proceedings.state","my_proceedings.proceeding_circle_nr","my_proceedings.operations_count","my_proceedings.inner_comment_deadline","my_proceedings.last_event","my_proceedings.document","my_proceedings.document_type","my_proceedings.building_name","my_proceedings.ehr_code","my_proceedings.address","my_proceedings.proceeding_name","my_proceedings.supervisor","my_proceedings.document_presenter","my_proceedings.archived","my_proceedings.proceeding_length"];return u?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsxs)(_o.Section,{form:!0,children:[(0,Eo.jsx)(_o.CollapseTable,{content:(b=m,b.map((e=>{var t,n,r,i;const a=(null!==(t=null===(n=e.address)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>1?function(e,t,n){let o={addresses:[],ehrCodes:[],buildingNames:[]};if(e&&e.length>1){let r=[];for(let o=0;o<e.length;o++){let i=e[o].split(",");r.push({county:i[0],city:i[1]?i[1].trimStart():"",other:i[2]?i[2].trimStart()+","+i[3]:"",ehrCode:t?t[o]:"",buildingName:n?n[o]:""})}const i=r.reduce(((e,t)=>{var n;const{county:o}=t;return e[o]=null!==(n=e[o])&&void 0!==n?n:[],e[o].push(t),e}),{});let a=[];r.forEach((e=>{const t=e.county;a.includes(t)||a.push(t)}));let s=[];r.forEach((e=>{const t=e.city;s.includes(t)||s.push(t)})),a.forEach((e=>{const t=i[e].reduce(((e,t)=>{var n;const{city:o}=t;return e[o]=null!==(n=e[o])&&void 0!==n?n:[],e[o].push(t),e}),{});i[e]=t}));let l=[],c=[],d=[];a.forEach((e=>{s.forEach((t=>{let n="";if(i[e][t]){n+=e+", "+t;for(let o=0;o<i[e][t].length;o++){const r=i[e][t][o];n+=", "+r.other,0===o?l.push(n):l.push(r.other),c.push(r.ehrCode),d.push(r.buildingName)}}}))})),o={addresses:l,ehrCodes:c,buildingNames:d}}return o}(e.address,e.ehrCode,e.buildingName):{addresses:[],ehrCodes:[],buildingNames:[]},s=bR(e.doty);return(0,Eo.jsx)(_o.CollapseTableRow,{fields:[e.dateStart,(0,Eo.jsx)(wR,{deadline:null===(r=e.deadline)||void 0===r?void 0:r.toString()},`${e.id}-deadline`),(0,Eo.jsx)(ER,{proceedingNr:e.proceedingNr,linkGenType:s,linkGen:o},`${e.id}-proceedingLink`),(0,Eo.jsx)(IR,{stateCode:e.stateCode},`${e.id}-state`),e.proceedingCircleNr,e.operationsCount,(0,Eo.jsx)(_R,{deadline:null===(i=e.innerCommentDeadline)||void 0===i?void 0:i.toString()},`${e.id}-comment`),e.lastEventDate?tv()(e.lastEventDate).format("DD.MM.YYYY"):"",(0,Eo.jsx)(TR,{document:e.document,linkGen:o},`${e.id}-documentlink`),e.documentType,(0,Eo.jsx)(yR,{buildingNames:a.buildingNames},`${e.id}-buildingname`),(0,Eo.jsx)(xR,{ehrCodes:a.ehrCodes,linkGen:o},`${e.id}-ehrcode`),(0,Eo.jsx)(SR,{addresses:a.addresses},`${e.id}-addressCell`),e.proceedingName,e.supervisor,e.documentPresenter,e.archived,e.proceedingLength]},e.id)}))),headers:h.map(((e,t)=>{const n=(null==f?void 0:f.field)===vR[t],o=f.desc?MN:CN,r=n?o:IN;return(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(t,{column:t,direction:r}),n=vR[t];if(e.direction===IN)c(yt({field:"",desc:!1})),c(gt({userInfo:s}));else{const t={field:n,desc:e.direction===MN};c(yt(t)),c(gt({userInfo:s,sorting:t}))}},children:(0,Eo.jsx)(DN,{sortDirection:r})}),l.formatMessage({id:e})]},e)})),paginationEnabled:!0,pager:{offset:p.page*p.size,limit:p.size,total:g},onPaginationReload:e=>{const t={page:Math.floor(e.offset/e.limit),size:e.limit};c(vt(t)),c(gt({userInfo:s,pagination:t,isAllUsersChecked:a}))}}),(0,Eo.jsx)(Eo.Fragment,{children:r?(0,Eo.jsx)("div",{className:"d-flex justify-content-start",children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:e=>i(e),text:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.view_all_institution_proceedings"}),checked:a})}):null})]});var b},MR=[{code:"MENSEIS_TAIENDAMISEL",value:"Algdokument täiendamisel"},{code:"MENSEIS_ALGATATUD",value:"Algatatud"},{code:"MENSEIS_KAIMASOLEV",value:"Käimasolev"},{code:"MENSEIS_LOPETATUD",value:"Lõpetatud"},{code:"MENSEIS_MUUTMISEL",value:"Algdokument muutmisel"},{code:"MENSEIS_PEATATUD",value:"Peatatud"}];function OR(){return MR.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}function DR(){return MR.filter((e=>"MENSEIS_TAIENDAMISEL"!==e.code&&"MENSEIS_MUUTMISEL"!==e.code&&"MENSEIS_LOPETATUD"!==e.code&&"MENSEIS_PEATATUD"!==e.code)).map((e=>({id:e.code})))}const kR={documentTypes:[],ehrCode:"",buildingName:"",wordInAddress:"",proceedingNumber:"",cadastralNumber:"",proceedingStates:["MENSEIS_ALGATATUD","MENSEIS_KAIMASOLEV"],connectedPerson:"",showProceedingInArchive:!1,supervisors:[],proceedingDate:{from:"",to:""},lastEventDate:""},jR=e=>{let{onSubmit:t,isKov:n,filterState:o}=e;const r=(0,wo.useIntl)(),i=/^[\\s0-9]{0,9}$/,a=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,[s,l]=(0,yo.useState)(o),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(!0),[f,m]=(0,yo.useState)(""),[g,h]=(0,yo.useState)(""),[b,v]=(0,yo.useState)([]),[y,x]=(0,yo.useState)([]),[S]=(0,yo.useState)(OR()),[w,_]=(0,yo.useState)([]),[E,T]=(0,yo.useState)(DR()),I=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),C=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers));function M(e){return i.test(e)}function O(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],T(n.map((e=>({id:e})))),l((e=>({...e,[t]:n})))}function D(e,t){var n;"ehrCode"===t&&M(e)?d(!0):"cadastralNumber"===t&&(0===(n=e).length||a.test(n))&&p(!0),l((n=>({...n,[t]:e})))}(0,yo.useEffect)((()=>{if(I){const e=rR(I);v(e)}if(C&&n){const e=iR([...C]);x(e)}}),[I,C]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>t(s),children:[(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>O(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>O(e,"documentTypes"),value:s.documentTypes,selectedOptions:w}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"proceedingNumber"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:S,onSelect:e=>{O(e,"proceedingStates")},allSelection:!0,onRemoveItem:e=>O(e,"proceedingStates"),value:s.proceedingStates,selectedOptions:E}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_state"}),labelCol:{sm:20,md:8,lg:8}}),nR(s.showProceedingInArchive,(function(e){l((t=>({...t,showProceedingInArchive:e})))}),"my_proceedings.filter.label.show_archived_proceedings"),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{name:"daterange",onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?m(r.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?m(r.formatMessage({id:"filter.invalid_date_range"})):m(""),l((t=>({...t,proceedingDate:e})))})(e),value:s.proceedingDate})}),errorMessage:f.length>0?f:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.proceeding_date",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.DatePicker,{name:"datepicker-field",value:s.lastEventDate,onChange:e=>function(e){""===e||tv()(e,"YYYY-MM-DD",!0).isValid()?h(""):h(r.formatMessage({id:"filter.invalid_date_format"})),l((t=>({...t,lastEventDate:e})))}(e)}),errorMessage:g.length>0?g:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.last_event_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.last_event_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"ehrCode"),onBlur:e=>d(M(e.trim())),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.ehrCode}),errorMessage:!c&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.ehrCode",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"buildingName"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.building_name"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"wordInAddress"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.word_in_address",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"connectedPerson"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.connectedPerson}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.connected_person"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.connected_person",placement:"top-start"}}),n&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:y,onSelect:e=>O(e,"supervisors"),allSelection:!0,onRemoveItem:e=>O(e,"supervisors"),value:s.supervisors,selectedOptions:w}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.supervisor"}),labelCol:{sm:20,md:8,lg:8}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(_([]),l(kR),void T(DR())),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(c&&u),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})};function AR(e){return lv(Gn,e)}Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD;const PR={[Wn.MENTOIMSEIS_OOTEL]:"my_operations.operation.state.idle",[Wn.MENTOIMSEIS_TEOSTAMISEL]:"my_operations.operation.state.in_process",[Wn.MENTOIMSEIS_TYHISTATUD]:"my_operations.operation.state.cancelled",[Wn.MENTOIMSEIS_TEOSTATUD]:"my_operations.operation.state.done",[Wn.MENTOIMSEIS_LOOBUTUD]:"my_operations.operation.state.abandoned",[Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD]:"my_operations.operation.state.expired"};function NR(e,t){const n=AR(e);return n?function(e,t){switch(e){case Wn.MENTOIMSEIS_OOTEL:return{name:t.formatMessage({id:"my_operations.operation.state.idle"}),oldType:nn.Info,newType:on.Info};case Wn.MENTOIMSEIS_TEOSTAMISEL:return{name:t.formatMessage({id:"my_operations.operation.state.in_process"}),oldType:nn.Info,newType:on.Info};case Wn.MENTOIMSEIS_TYHISTATUD:return{name:t.formatMessage({id:"my_operations.operation.state.cancelled"}),oldType:nn.Default,newType:on.Default};case Wn.MENTOIMSEIS_TEOSTATUD:return{name:t.formatMessage({id:"my_operations.operation.state.done"}),oldType:nn.Success,newType:on.Success};case Wn.MENTOIMSEIS_LOOBUTUD:return{name:t.formatMessage({id:"my_operations.operation.state.abandoned"}),oldType:nn.Default,newType:on.Default};case Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD:return{name:t.formatMessage({id:"my_operations.operation.state.expired"}),oldType:nn.Default,newType:on.Default};default:return{name:e,oldType:nn.Default,newType:on.Default}}}(n,t):{name:e,oldType:nn.Default,newType:on.Default}}const RR=(e,t)=>({code:e,value:t.formatMessage({id:PR[e]})});function LR(e,t){let n;return n=e===Wt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))):e===Xt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))):e===Zt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD].map((e=>RR(e,t))):[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))),function(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}(n)}function FR(){return[{code:"11271",value:"Ehitusluba"},{code:"11201",value:"Ehitusteatis"},{code:"11371",value:"Kasutusluba"},{code:"11301",value:"Kasutusteatis"},{code:"11002",value:"Projekteerimistingimused"},{code:"11051",value:"5G pääsupunkti taotlus"}].map((e=>({id:`${e.code}`,label:e.value,level:2,children:[],selectable:!0,value:!1})))}function UR(e,t){if(t.documentTypes.length>0&&(e=e.filter((e=>e.doty&&void 0!==e.doty&&t.documentTypes.includes(e.doty)))),t.ehrCode.length>0&&(e=e.filter((e=>{var n;return null===(n=e.ehrCode)||void 0===n?void 0:n.some((e=>{var n;return null!==(n=e.startsWith(t.ehrCode.trim()))&&void 0!==n&&n}))}))),t.institutions.length>0&&(e=e.filter((e=>{var n;return e.supervisorJurId&&void 0!==e.supervisorJurId&&t.institutions.includes(null===(n=e.supervisorJurId)||void 0===n?void 0:n.toString())}))),t.wordInAddress.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.address)||void 0===o?void 0:o.some((e=>null==e?void 0:e.toLocaleLowerCase().includes(t.wordInAddress.trim().toLocaleLowerCase()))))&&void 0!==n&&n}))),t.proceedingNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.proceedingNr)||void 0===o?void 0:o.includes(t.proceedingNumber.trim()))&&void 0!==n&&n}))),t.operationStates.length>0&&(e=e.filter((e=>e.stateCode&&void 0!==e.stateCode&&t.operationStates.includes(AR(e.stateCode))))),t.institutionUsers&&t.institutionUsers.length>0&&(e=e.filter((e=>e.operationExecutorId&&void 0!==e.operationExecutorId&&t.institutionUsers.includes(e.operationExecutorId.toString())))),t.operationDate.from.length>0&&0===t.operationDate.to.length){const n=new Date(t.operationDate.from).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.operationDate.to.length>0&&0===t.operationDate.from.length){const n=new Date(t.operationDate.to).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.operationDeadline.from.length>0){const n=new Date(t.operationDeadline.from).getTime();e=e.filter((e=>!e.deadline||new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.operationDeadline.to.length>0){const n=new Date(t.operationDeadline.to).getTime();e=e.filter((e=>!e.deadline||new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.operationDate.from.length>0&&t.operationDate.to.length>0){const n=new Date(t.operationDate.from).getTime(),o=new Date(t.operationDate.to).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n&&new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=o))}return e}function VR(e){return[{id:Wn.MENTOIMSEIS_OOTEL},{id:Wn.MENTOIMSEIS_TEOSTAMISEL},{id:Wn.MENTOIMSEIS_TEOSTATUD},{id:Wn.MENTOIMSEIS_LOOBUTUD}].filter((t=>e.includes(t.id)))}const $R=e=>{const t=(0,wo.useIntl)(),[n,o]=(0,yo.useState)({offset:0,limit:10}),[r,i]=(0,yo.useState)([]),[a,s]=(0,yo.useState)({column:1,direction:MN}),[l,c]=(0,yo.useState)(!1),[d,u]=(0,yo.useState)(!1),[p,f]=(0,yo.useState)(!1),m=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.myOperations)),g=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.toCommentOperations)),h=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.operationInvitations)),b=(0,xl.useSelector)((e=>e.myViewsPage.myProceedings.proceedingsToComment)),v=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),y=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),x=[e=>sv(e.invitationDate)?new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>sv(e.deadline)?new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.operationExecutor)&&void 0!==t?t:""},e=>{var t,n;return null!==(t=null===(n=y.find((t=>t.id.toString()===e.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""},e=>void 0!==e.buildingName&&null!==e.buildingName&&sv(e.buildingName[0])?e.buildingName[0]:"",e=>void 0!==e.ehrCode&&null!==e.ehrCode&&sv(e.ehrCode[0])?e.ehrCode[0]:"",e=>void 0!==e.address&&null!==e.address&&sv(e.address[0])?e.address[0]:"",e=>{var t,n;return null!==(t=null===(n=v.find((t=>t.id===e.supervisorJurId)))||void 0===n?void 0:n.regName)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.supervisor)&&void 0!==t?t:""}];(0,yo.useEffect)((()=>{!m||e.viewType!==Gt&&e.viewType!==Yt||(i(UR(m,e.filter)),o({offset:0,limit:10}))}),[m,e.filter]),(0,yo.useEffect)((()=>{m&&e.viewType===Wt&&(i(TN(UR(m,e.filter),x[0],MN)),o({offset:0,limit:10}))}),[m,e.filter]),(0,yo.useEffect)((()=>{g&&e.viewType===Jt&&(a.direction===IN?i(UR(g,e.filter)):i(TN(UR(g,e.filter),x[a.column],a.direction)),o({offset:0,limit:10}))}),[g,e.filter]),(0,yo.useEffect)((()=>{h&&e.viewType===Xt&&(i(UR(h,e.filter)),o({offset:0,limit:10}))}),[h,e.filter]),(0,yo.useEffect)((()=>{b&&e.viewType===Zt&&(a.direction===IN?i(UR(b,e.filter)):i(TN(UR(b,e.filter),x[a.column],a.direction)))}),[b,e.filter]);const S=["my_operations.invitation_date","my_operations.deadline","my_operations.proceeding_nr","my_operations.state","my_operations.operation_executor","my_operations.connected_document_type","my_operations.building_name","my_operations.ehr_code","my_operations.building_address","my_operations.institution","my_operations.supervisor"],w=["my_operations.deadline","my_operations.proceeding_nr","my_operations.state","my_operations.supervisor","my_operations.connected_document_type","my_operations.building_address"],_=[e=>sv(e.deadline)?new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.supervisor)&&void 0!==t?t:""},e=>{var t,n;return null!==(t=null===(n=y.find((t=>t.id.toString()===e.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""},e=>void 0!==e.address&&null!==e.address&&sv(e.address[0])?e.address[0]:""];const E=t=>{let n=iv.Operation;return e.viewType===Zt?(n=iv.Proceeding,e.linkGen(!1,void 0,n,t.proceedingNr)):e.linkGen(!1,void 0,n,t.id)};return(0,Eo.jsxs)(_o.Section,{form:!0,children:[r&&(0,Eo.jsx)(_o.CollapseTable,{content:(o=>o.slice(n.offset,n.offset+n.limit).map((n=>{var o,r,i,a,s,m,g,h;const b=[n.invitationDate,tv()(n.deadline,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:n.deadline}):n.deadline,(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_operations.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{text:n.proceedingNr,href:E(n)})},n.proceedingNr),n.stateCode?(0,Eo.jsx)(_o.Status,{type:NR(n.stateCode,t).oldType,children:NR(n.stateCode,t).name}):"",n.operationExecutor,n.doty?null===(o=y.find((e=>e.id.toString()===n.doty)))||void 0===o?void 0:o.name:"",n.buildingName?(0,Eo.jsx)("div",{children:p?(0,Eo.jsxs)("div",{children:[n.buildingName.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),n.buildingName.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),f(!p)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_building_names"})})]}):1===n.buildingName.length?n.buildingName:(0,Eo.jsxs)("div",{children:[null===(r=n.buildingName)||void 0===r?void 0:r.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(i=n.buildingName)||void 0===i?void 0:i.slice(4,5),n.buildingName.length>5?" ...":"",n.buildingName.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),f(!p)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_building_names"})})})]})}):"",n.ehrCode?(0,Eo.jsx)("div",{children:d?(0,Eo.jsxs)("div",{children:[n.ehrCode.map(((t,n)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}),(0,Eo.jsx)("br",{})]},n))),n.ehrCode.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),u(!d)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[null===(a=n.ehrCode)||void 0===a?void 0:a.slice(0,4).map(((t,n)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}),(0,Eo.jsx)("br",{})]},n))),null===(s=n.ehrCode)||void 0===s?void 0:s.slice(4,5).map((t=>(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}))),n.ehrCode.length>5?" ...":"",n.ehrCode.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),u(!d)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_ehrCodes"})})})]})}):"",n.address?(0,Eo.jsx)("div",{children:l?(0,Eo.jsxs)("div",{children:[n.address.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),n.address.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),c(!l)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_addresses"})})]}):1===n.address.length?n.address:(0,Eo.jsxs)("div",{children:[null===(m=n.address)||void 0===m?void 0:m.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(g=n.address)||void 0===g?void 0:g.slice(4,5),n.address.length>5?" ...":"",n.address.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),c(!l)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_addresses"})})})]})}):"",n.supervisorJurId?null===(h=v.find((e=>e.id===n.supervisorJurId)))||void 0===h?void 0:h.regName:"",n.supervisor],x=[...b];x.splice(4,1);const S=[...b].slice(1,4).concat(b[10]).concat(b[5]).concat(b[8]);return(0,Eo.jsx)(_o.CollapseTableRow,{fields:e.viewType===Wt?x:e.viewType===Zt?S:b},n.id)})))(r),headers:function(){const n=[...S];n.splice(4,1);const o=e.viewType===Wt?n:e.viewType===Zt?w:S,l=[...x];l.splice(4,1);const c=e.viewType===Wt?l:e.viewType===Zt?_:x;return o.map(((e,n)=>(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(n,a);s(e),e.direction!==IN&&i(TN(r,c[n],e.direction))},children:a.column===n?(0,Eo.jsx)(DN,{sortDirection:a.direction}):(0,Eo.jsx)(DN,{sortDirection:IN})}),t.formatMessage({id:e})]})))}(),paginationEnabled:!0,pager:{offset:n.offset,limit:n.limit,total:r.length},onPaginationReload:o}),(e.viewType===Yt||e.viewType===Gt)&&(0,Eo.jsx)("div",{className:"d-flex justify-content-start",children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:t=>e.onAllUsersChecked(t),text:e.viewType===Yt?(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.view_all_institution_coordinations"}):(0,Eo.jsx)(_o.Text,{raw:"my_opinions.view_all_institution_opinions"}),checked:e.isAllUsersChecked})})]})},BR=e=>{var t;const n=(0,wo.useIntl)(),o=/^[\\s0-9]{0,9}$/,r=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,i=null!==(t=e.initialFilter)&&void 0!==t?t:{documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},a={...i,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},s={...i,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},l={...i,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[c,d]=(0,yo.useState)(e.filterState),[u,p]=(0,yo.useState)(VR(c.operationStates)),[f,m]=(0,yo.useState)(!0),[g,h]=(0,yo.useState)(!0),[b,v]=(0,yo.useState)(""),[y,x]=(0,yo.useState)(""),S=(0,yo.useMemo)((()=>FR()),[]),[w,_]=(0,yo.useState)([]),[E,T]=(0,yo.useState)([]),I=(0,yo.useMemo)((()=>LR(e.viewType,n)),[e.viewType]),[C,M]=(0,yo.useState)([]),O=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers)),D=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function k(e){return o.test(e)}function j(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],c[t]=n,d((e=>({...e})))}function A(e,t){var n;c[t]=e,"ehrCode"===t&&k(e)?m(!0):"cadastralNumber"===t&&(0===(n=e).length||r.test(n))&&h(!0),d((e=>({...e})))}(0,yo.useEffect)((()=>{if(O){const e=iR(O?[...O]:[]);T(e)}if(D){const e=aR([...D]);_(e)}}),[O,D]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(c),children:[(0,Eo.jsx)(_o.Row,{className:"align-items-start",children:(0,Eo.jsx)(_o.Col,{sm:10,className:"mx-0 px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:S,onSelect:e=>j(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>j(e,"documentTypes"),value:c.documentTypes,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})}),(0,Eo.jsx)(_o.Row,{className:"align-items-start",children:(0,Eo.jsx)(_o.Col,{sm:10,className:"mx-0 px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"ehrCode"),onBlur:e=>h(k(e.trim())),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.ehrCode}),errorMessage:!f&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:w,onSelect:e=>j(e,"institutions"),allSelection:!0,onRemoveItem:e=>j(e,"institutions"),value:c.institutions,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"proceedingNumber"),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:I,onSelect:e=>j(e,"operationStates"),allSelection:!0,onRemoveItem:e=>j(e,"operationStates"),value:c.operationStates,selectedOptions:u}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_state"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?v(n.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?v(n.formatMessage({id:"filter.invalid_date_range"})):v(""),d((t=>({...t,operationDate:e})))})(e),value:c.operationDate}),errorMessage:b.length>0?b:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"wordInAddress"),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:E,onSelect:e=>j(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>j(e,"institutionUsers"),value:c.institutionUsers,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?x(n.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?x(n.formatMessage({id:"filter.invalid_date_range"})):x(""),d((t=>({...t,operationDeadline:e})))})(e),value:c.operationDeadline}),errorMessage:y.length>0?y:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_deadline"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>function(){let t;switch(M([]),e.viewType){case qt:t=a;break;case Jt:case Zt:t=s;break;case Xt:t=l;break;default:t=i}d(t),p(VR(t.operationStates))}(),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(f&&g),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},KR=e=>{var t,n,o,r,i;let{classifierApiEndpoint:a,fileUploadApiEndpoint:s,linkGen:l,myViewsApiEndpoint:c,userInfo:d,userApiEndpoint:u}=e;const p=(0,xl.useDispatch)(),[f,h]=(0,yo.useState)({proceedings:!1}),[b,v]=(0,yo.useState)(!0),[y,x]=(0,yo.useState)(!0),[S,w]=(0,yo.useState)([]),[_,E]=(0,yo.useState)([]),{proceedings:T,isLoading:I,filter:C}=(0,xl.useSelector)(bt),M=null!==(t=null==T?void 0:T.content)&&void 0!==t?t:[],O=new F(new _e({basePath:a})),D=new oe(new _e({basePath:u})),k=new he(new _e({basePath:c})),j=new xe(new _e({basePath:c})),A=new Xe(new Ze({basePath:s})),P="A"!==(null===(n=d.activeRole)||void 0===n?void 0:n.businessType);let N=new Date;N.setDate(N.getDate()-7);const R={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:["MENTOIMSEIS_OOTEL","MENTOIMSEIS_TEOSTAMISEL"],institutionUsers:[(null===(o=d.activeRole)||void 0===o?void 0:o.userId)+""],operationDate:{from:"",to:""},operationDeadline:{from:N.toISOString().split("T")[0],to:""}},[L,U]=(0,yo.useState)(R),[V,$]=(0,yo.useState)({});const B={userId:null===(r=d.activeRole)||void 0===r?void 0:r.userId,personId:null===(i=d.activeRole)||void 0===i?void 0:i.businessId,dotys:["11525","11271","11201","11301","11271","11371","11002","11582","11581","12271","12371","11413","11412","11430","11583","11274","11275"],states:[Un.DO_DOKUSEIS_ESITATUD,Un.DO_DOKUSEIS_MENETLUSES]};return(0,yo.useEffect)((()=>{!function(e){var t,n;const o={userId:e.institutionUsers?Number(e.institutionUsers[0]):null===(t=d.activeRole)||void 0===t?void 0:t.userId,personId:null===(n=d.activeRole)||void 0===n?void 0:n.businessId,states:e.operationStates,type:[pn.MENTOIMLIIK_MEN_MARKUS]};v(!0),j.findOperationsToComment(o).then((e=>{p(St(e.data)),w(e.data),v(!1)})).catch((e=>{console.log("Following error occured:",e),v(!1)}))}(L)}),[d,L]),(0,yo.useEffect)((()=>{p(gt({userInfo:d,isAllUsersChecked:f.proceedings}))}),[d,f.proceedings]),(0,yo.useEffect)((()=>{!function(){const e=B;e.userId=void 0,x(!0),k.findBaseIncomingDocuments(e).then((e=>{p(wt(e.data)),x(!1),E(e.data)})).catch((e=>{console.log("Following error occured:",e),x(!1)}))}()}),[d]),(0,yo.useEffect)((()=>{var e,t;O.getAllDocumentTypes().then((e=>{p(m(e.data))})).catch((e=>{console.log(e)})),P&&D.getJurUsers(null!==(e=null===(t=d.activeRole)||void 0===t?void 0:t.businessId)&&void 0!==e?e:0).then((e=>{p(g(e.data))})).catch((e=>{console.log(e)}))}),[d]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_proceedings.my_proceedings",showSettings:!0,filterContents:(0,Eo.jsx)(jR,{onSubmit:e=>{p(xt(e)),p(gt({userInfo:d,filter:e,isAllUsersChecked:f.proceedings}))},isKov:P,filterState:C}),children:I||0!==M.length?(0,Eo.jsx)(CR,{linkGen:l,isKov:P,onAllUsersChecked:e=>{h({proceedings:e}),p(gt({userInfo:d,isAllUsersChecked:e}))},isAllUsersChecked:f.proceedings,filter:C,userInfo:d}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.no_proceedings"})}),P&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_proceedings.view_all_institution_proceedings",onClick:()=>{h({proceedings:!0}),p(gt({userInfo:d,isAllUsersChecked:!0}))}})})]})}),P&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_proceedings.section_title.proceedings_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Zt,initialFilter:R,filterState:L,onSubmit:e=>U(e)}),children:b?(0,Eo.jsx)(_o.SectionLoader,{}):0===S.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.proceedings_to_comment.no_proceedings"})}):(0,Eo.jsx)($R,{linkGen:l,viewType:Zt,filter:L})}),P&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.incoming_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Ht,filterState:V,onSubmit:e=>$(e),isKov:P}),children:y?(0,Eo.jsx)(_o.SectionLoader,{}):0===_.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.incoming_documents.no_docs"})}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:d,documentType:Ht,filter:V,fileApi:A})})]})},zR=e=>{let{classifierApiEndpoint:t,linkGen:n,myViewsApiEndpoint:o,userApiEndpoint:r,userInfo:{activeRole:i}}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!0),[c,d]=(0,yo.useState)(!1),[u,p]=(0,yo.useState)(!1),[f,b]=(0,yo.useState)(null),[v,y]=(0,yo.useState)(null),[x,S]=(0,yo.useState)(null),w={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},_={...w,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},E={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},T={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[I,C]=(0,yo.useState)(_),[M,O]=(0,yo.useState)(E),[D,k]=(0,yo.useState)(T),[j,A]=(0,yo.useState)(!1),P=new X(new _e({basePath:r})),N=new oe(new _e({basePath:r})),R=new xe(new _e({basePath:o})),L=new F(new _e({basePath:t}));return(0,yo.useEffect)((()=>{var e;P.getJurKovPersons().then((e=>{a(h(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),N.getJurUsers(null!==(e=null==i?void 0:i.businessId)&&void 0!==e?e:0).then((e=>{a(g(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),L.getAllDocumentTypes().then((e=>{a(m(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)}))}),[]),(0,yo.useEffect)((()=>{!function(){const e={userId:null==i?void 0:i.userId,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)};j&&(e.userId=void 0),l(!0),R.findOperations(e).then((e=>{a(It(e.data)),b(e.data),l(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),l(!1)}))}()}),[j]),(0,yo.useEffect)((()=>{d(!0),R.findOperationsToComment({userId:null==i?void 0:i.userId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Ct(e.data)),y(e.data),d(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),d(!1)})),p(!0),R.findOperationInvitations({userId:void 0,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_OOTEL.concat(Gn.MENTOIMSEIS_TEOSTAMISEL,Gn.MENTOIMSEIS_TYHISTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Mt(e.data)),S(e.data),p(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),p(!1)}))}),[]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.my_coordinations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:qt,filterState:I,onSubmit:e=>C(e)}),children:[s&&(0,Eo.jsx)(_o.SectionLoader,{}),s||f?(0,Eo.jsx)($R,{linkGen:n,viewType:Yt,filter:I,isAllUsersChecked:j,onAllUsersChecked:e=>{A(e)}}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_coordinations"})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_coordinations.view_all_institution_coordinations",onClick:()=>{A(!0)}})})]})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.coordinations_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Jt,filterState:M,onSubmit:e=>O(e)}),children:[c&&(0,Eo.jsx)(_o.SectionLoader,{}),c||v?(0,Eo.jsx)($R,{linkGen:n,viewType:Jt,filter:M}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_coordinations_to_comment"})})})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.coordination_invitations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Xt,filterState:D,onSubmit:e=>k(e)}),children:[u&&(0,Eo.jsx)(_o.SectionLoader,{}),u||x?(0,Eo.jsx)($R,{linkGen:n,viewType:Xt,filter:D}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_approval_invitations"})})})]})]})},HR=(0,u.createAsyncThunk)("myApprovals/getAllApprovalsData",(async(e,t)=>{let{userInfo:n}=e,{dispatch:o}=t;o(co({userInfo:n})),o(so({userInfo:n})),o(lo({userInfo:n}))})),YR={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},GR=e=>{let{operations:t,isLoading:n,isError:o}=e;const r=(0,wo.useIntl)(),{linkGen:i}=(0,yo.useContext)(Ub),[a,s]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{s(((e,t)=>[YR.accessor((e=>e.invitationDate),{id:"invitationDate",cell:e=>{const t=e.row.original;return t.invitationDate?rv.dateToStr(t.invitationDate):"-"},header:e.formatMessage({id:"my_approvals.table.header.invitation_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),YR.accessor((e=>e.deadline),{id:"deadline",cell:e=>{const t=e.row.original;return t.deadline?rv.dateToStr(t.deadline):"-"},header:e.formatMessage({id:"my_approvals.table.header.deadline"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),YR.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_approvals.table.header.proceeding_nr"})}),YR.accessor((e=>e.stateCode),{id:"state",cell:t=>{const n=t.row.original,o=n.stateCode?NR(n.stateCode,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_approvals.table.header.state"})}),YR.accessor((e=>e.doty),{id:"documentType",cell:e=>{var t,n;const o=e.row.original;return(0,Eo.jsx)(Eo.Fragment,{children:null!==(t=null===(n=Rn.find((e=>e.code===o.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:"-"})},header:e.formatMessage({id:"my_approvals.table.header.document_type"})}),YR.accessor((e=>e.institution),{id:"institution",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_approvals.table.header.institution"})}),YR.accessor((e=>e.supervisor),{id:"supervisor",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_approvals.table.header.supervisor"})})])(r,i))}),[t]),(0,Eo.jsx)(qP,{isLoading:n,isError:o,data:t,columns:a,id:"approvals-operations-table"})},WR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(go);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsToComment,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsToComment}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},qR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(fo);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsOngoing,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsOngoing}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},JR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(ho);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsIncoming,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsIncoming}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},XR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(mo);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsAllAssigned,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsAllAssigned}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},ZR=[mn.ApprovalsOngoing,mn.ApprovalsToComment,mn.ApprovalsIncoming],QR=e=>{let{userInfo:t,linkGen:n}=e;const o=(0,xl.useDispatch)(),r=(0,yo.useMemo)((()=>({linkGen:n})),[n]);return(0,yo.useEffect)((()=>{t&&o(HR({userInfo:t}))}),[]),(0,Eo.jsx)(Cl,{id:"MyApprovalsPage",gutter:0,children:(0,Eo.jsx)(Ml,{children:(0,Eo.jsx)(Ub.Provider,{value:r,children:(0,Eo.jsxs)(pp,{size:.5,children:[(0,Eo.jsx)(bp,{title:"my_approvals.page_title"}),(0,Eo.jsxs)(gp,{defaultOpenItem:ZR,gutter:1,children:[(0,Eo.jsx)(qR,{}),(0,Eo.jsx)(XR,{}),(0,Eo.jsx)(WR,{}),(0,Eo.jsx)(JR,{})]})]})})})})},eL=e=>(0,Eo.jsx)(yl,{locale:"et",children:(0,Eo.jsx)(QR,{...e})}),tL=e=>{let{classifierApiEndpoint:t,linkGen:n,myViewsApiEndpoint:o,userApiEndpoint:r,userInfo:{activeRole:i}}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!1),[c,d]=(0,yo.useState)(!1),[u,p]=(0,yo.useState)(!1),[f,b]=(0,yo.useState)(null),[v,y]=(0,yo.useState)(null),[x,S]=(0,yo.useState)(null),w={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},_={...w,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},E={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},T={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[I,C]=(0,yo.useState)(_),[M,O]=(0,yo.useState)(E),[D,k]=(0,yo.useState)(T),[j,A]=(0,yo.useState)(!1),P=new X(new _e({basePath:r})),N=new oe(new _e({basePath:r})),R=new xe(new _e({basePath:o})),L=new F(new _e({basePath:t}));return(0,yo.useEffect)((()=>{var e;P.getJurKovPersons().then((e=>{a(h(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),N.getJurUsers(null!==(e=null==i?void 0:i.businessId)&&void 0!==e?e:0).then((e=>{a(g(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),L.getAllDocumentTypes().then((e=>{a(m(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)}))}),[]),(0,yo.useEffect)((()=>{!function(){const e=j?null==i?void 0:i.businessId:null==i?void 0:i.userId;l(!0),R.findOperations({personId:j?e:void 0,userId:j?void 0:e,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(It(e.data)),b(e.data),l(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),l(!1)}))}()}),[j]),(0,yo.useEffect)((()=>{d(!0),R.findOperationsToComment({userId:null==i?void 0:i.userId,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Ct(e.data)),y(e.data),d(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),d(!1)})),p(!0),R.findOperationInvitations({userId:void 0,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_OOTEL.concat(Gn.MENTOIMSEIS_TEOSTAMISEL,Gn.MENTOIMSEIS_TYHISTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Mt(e.data)),S(e.data),p(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),p(!1)}))}),[]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.my_opinions",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:qt,filterState:I,onSubmit:e=>C(e)}),children:[s&&(0,Eo.jsx)(_o.SectionLoader,{}),s||f?(0,Eo.jsx)($R,{linkGen:n,viewType:Gt,filter:I,isAllUsersChecked:j,onAllUsersChecked:e=>{A(e)}}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinions"})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_opinions.view_all_institution_opinions",onClick:()=>{A(!0)}})})]})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.opinions_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Jt,filterState:M,onSubmit:e=>O(e)}),children:[c&&(0,Eo.jsx)(_o.SectionLoader,{}),c||v?(0,Eo.jsx)($R,{linkGen:n,viewType:Jt,filter:M}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinions_to_comment"})})})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.opinion_invitations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Xt,filterState:D,onSubmit:e=>k(e)}),children:[u&&(0,Eo.jsx)(_o.SectionLoader,{}),u||x?(0,Eo.jsx)($R,{linkGen:n,viewType:Xt,filter:D}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinion_invitations"})})})]})]})},nL=e=>{const t=(0,wo.useIntl)(),n=/^[\\s0-9]{0,9}$/,o=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,r={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},[i,a]=(0,yo.useState)(e.filterState),[s,l]=(0,yo.useState)(VR(i.operationStates)),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(!0),[f,m]=(0,yo.useState)(""),g=(0,yo.useMemo)((()=>FR()),[]),[h,b]=(0,yo.useState)([]),v=(0,yo.useMemo)((()=>LR(Wt,t)),[]),[y,x]=(0,yo.useState)([]),S=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function w(e){return n.test(e)}function _(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],i[t]=n,a((e=>({...e})))}function E(e,t){var n;i[t]=e,"ehrCode"===t&&w(e)?d(!0):"cadastralNumber"===t&&(0===(n=e).length||o.test(n))&&p(!0),a((e=>({...e})))}(0,yo.useEffect)((()=>{if(S){const e=aR([...S]);b(e)}}),[S]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(i),children:[(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:g,onSelect:e=>_(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>_(e,"documentTypes"),value:i.documentTypes,selectedOptions:y}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"ehrCode"),onBlur:e=>d(w(e.trim())),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.ehrCode}),errorMessage:!c&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"wordInAddress"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:h,onSelect:e=>_(e,"institutions"),allSelection:!0,onRemoveItem:e=>_(e,"institutions"),value:i.institutions,selectedOptions:y}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"proceedingNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:v,onSelect:e=>_(e,"operationStates"),allSelection:!0,onRemoveItem:e=>_(e,"operationStates"),value:i.operationStates,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_involvements.filter.label.involvement_state"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?m(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?m(t.formatMessage({id:"filter.invalid_date_range"})):m(""),a((t=>({...t,operationDate:e})))})(e),value:i.operationDate}),errorMessage:f.length>0?f:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_involvements.filter.label.involvement_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(x([]),a(r),void l(VR(r.operationStates))),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(c&&u),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},oL=e=>{var t;let{classifierApiEndpoint:n,linkGen:o,myViewsApiEndpoint:r,userInfo:i,userApiEndpoint:a}=e;const s=(0,xl.useDispatch)(),[l,c]=(0,yo.useState)(!1),[d,u]=(0,yo.useState)([]),p=!(void 0===i||"A"===(null==i||null===(t=i.activeRole)||void 0===t?void 0:t.businessType)),f={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},[g,b]=(0,yo.useState)(f),v=new X(new _e({basePath:a})),y=new xe(new _e({basePath:r})),x=new F(new _e({basePath:n}));return(0,yo.useEffect)((()=>{var e;v.getJurKovPersons().then((e=>{s(h(e.data))})).catch((e=>{console.log(e)})),x.getAllDocumentTypes().then((e=>{s(m(e.data))})).catch((e=>{console.log(e)})),c(!0),y.findOperations({userId:void 0,personId:p?null===(e=i.activeRole)||void 0===e?void 0:e.businessId:i.personId,type:[pn.MENTOIMLIIK_KAASAMINE,pn.MENTOIMLIIK_KAAS_TAGASISIDE],states:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_VALMIS,Wn.MENTOIMSEIS_JATKAMINE,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_KEELDUTUD,Wn.MENTOIMSEIS_TAGASI_LYKATUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD]}).then((e=>{s(It(e.data)),u(e.data),c(!1)})).catch((e=>{console.log("Following error occured:",e),c(!1)}))}),[i]),(0,Eo.jsx)("div",{children:(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_involvements.my_involvements",showSettings:!0,filterContents:(0,Eo.jsx)(nL,{filterState:g,onSubmit:e=>b(e)}),children:l?(0,Eo.jsx)(_o.SectionLoader,{}):0===d.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_involvements.no_involvements"})}):(0,Eo.jsx)($R,{linkGen:o,viewType:Wt,filter:g})})})};function rL(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}function iL(e){let t=rL([{code:"EHITIS_SEISUND_KAVAN",value:"Kavandatav"},{code:"EHITIS_SEISUND_PYSTI",value:"Püstitamisel"},{code:"EHITIS_SEISUND_OLEMA",value:"Olemas"},{code:"EHITIS_SEISUND_LAMEL",value:"Lammutamisel"},{code:"EHITIS_SEISUND_LAMUT",value:"Lammutatud"},{code:"EHITIS_SEISUND_REATA",value:"Realiseerimata"},{code:"EHITIS_SEISUND_KUSTU",value:"Kustutatud"}]);return e?t:t.slice(0,-1)}function aL(e){return e.map((e=>{var t;return{id:String(e.value),label:null!==(t=e.description)&&void 0!==t?t:"",level:2,children:[],selectable:!0,value:!1}}))}const sL=[{code:"EHITIS_OMANDI_LIIK_KINNIS",value:"Kinnisasi"},{code:"EHITIS_OMANDI_LIIK_VALLAS",value:"Vallasasi"},{code:"EHITIS_OMANDI_LIIK_VALLASRO",value:"Reaalosa kui vallasasi"}];function lL(){return rL(sL)}function cL(e){let t=[];for(let n of e)t.push(n.id),t.push(...cL(n.children?n.children:[]));return t}const dL=e=>{const t=(0,wo.useIntl)(),n={buildingLocation:"",buildingName:"",buildingStates:[],firstUseDate:{from:"",to:""},firstUseMissing:!1,buildingType:[],purposeOfUse:[],ownershipType:[],heritage:[],owner:void 0,isPrivatePerson:!1,searchType:Qt},o=(0,xl.useSelector)((e=>e.myViewsPage.filter.usageClassifierTypes)),r=(0,xl.useSelector)((e=>e.myViewsPage.filter.heritageClassifierTypes)),i=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.buildings)),[a,s]=(0,yo.useState)(n),[l,c]=(0,yo.useState)([]),[d,u]=(0,yo.useState)(iL(e.isAdminRole)),[p]=(0,yo.useState)(rL([{code:"H",value:"Hoone"},{code:"R",value:"Rajatis"}])),[f]=(0,yo.useState)(lL()),[m,g]=(0,yo.useState)([]),[h,b]=(0,yo.useState)([]),[v,y]=(0,yo.useState)({}),[x,S]=(0,yo.useState)(""),[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)(""),[I,C]=(0,yo.useState)(!1),[M,O]=(0,yo.useState)({code:"",value:""}),D=(0,yo.useRef)(),[k,j]=(0,yo.useState)({});function A(e,t){let n;n=e.selectedData.length>0?void 0!==e.selectedData[0].data?e.selectedData[0].data.map((e=>e.id)):e.selectedData.map((e=>e.id)).flat():[],a[t]=n,s((e=>({...e})))}function P(e,t){let n;if(e.selectedData.length>0){n=cL(void 0===e.selectedData[0].data?e.selectedData:e.selectedData[0].data)}else n=[];a[t]=n,s((e=>({...e})))}function N(e,t){a[t]=e,s((e=>({...e})))}(0,yo.useEffect)((()=>{if(o.length>0){const e=function(e){let t=e.sort(((e,t)=>Number(e.code)-Number(t.code)));return function(e){let t={id:"00000",label:"00000",parentId:"0",level:1,value:!1,selectable:!1,children:[]};for(let n of e){const{code:e,name:o,validTo:r}=n;let i=e.replace(/0/g,""),a=i.slice(0,i.length-1),s=t;for(let e=2;e<=a.length;e++)if(s.children){let t=s.children.find((t=>t.id.replace(/0/g,"")===a.slice(0,e)));t&&(s=t)}if(s.children){const t=`${e} ${o}${null!=r&&r.trim()?` (kuni ${r})`:""}`;s.children.push({id:n.id+"",parentId:s.id,label:t,level:s.level+1,children:[],selectable:!0,value:!1})}}return t.children?t.children:[]}(t)}([...o]);g(e)}}),[o]),(0,yo.useEffect)((()=>{if(r.length>0){const e=aL(r);b(e)}}),[r]),(0,yo.useEffect)((()=>{u(iL(e.isAdminRole))}),[e.isAdminRole]);const R={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>function(){if(JSON.stringify(n)===JSON.stringify(a))_({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"});else if(a.firstUseMissing){let t={...a};t.firstUseDate={from:"",to:""},e.onSubmit(t)}else _({header:"",message:""}),e.onSubmit(a)}(),children:[w.header&&w.header.length>0&&w.message&&w.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:w.header}),onDismiss:()=>_({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:w.message})]}),i&&i.length>=500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>N(e,"buildingLocation"),placeholder:t.formatMessage({id:"detailssearch.filter.placeholder.address"}),value:a.buildingLocation}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_location"}),info:{content:"detailsearch.filter.tooltip.building_location",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>N(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:a.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_name"}),info:{content:"detailsearch.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:d,onSelect:e=>A(e,"buildingStates"),allSelection:!0,onRemoveItem:e=>A(e,"buildingStates"),value:a.buildingStates,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_state"}),info:{content:"detailsearch.filter.tooltip.building_state",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.NumberRangeExtended,{value:{from:a.firstUseDate.from,to:a.firstUseDate.to},onChange:e=>function(e){S(""),_({header:"",message:""});let t=null!==e.from?e.from:"",n=null!==e.to?e.to:"";s((e=>({...e,firstUseDate:{from:t,to:n}})))}(e),onBlur:e=>function(e){let n=Number(e.from),o=Number(e.to);n<0||n>2100||o<0||o>2100?S(t.formatMessage({id:"detailsearch.error_field.year-between"})):null!==e.from&&null!==e.to&&n>o?S(t.formatMessage({id:"detailsearch.error_field.beginning-bigger"})):(S(""),_({header:"",message:""}))}(e),onlyPositive:!0,disabled:a.firstUseMissing})}),errorMessage:x,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.first_use"}),info:{content:"detailsearch.filter.tooltip.first_use",placement:"top-start"}}),(0,Eo.jsx)(Eo.Fragment,{children:nR(a.firstUseMissing,(function(e){s((t=>({...t,firstUseMissing:e})))}),"detailsearch.filter.label.checkbox.first_use_missing","detailsearch.filter.tooltip.checkbox.first_use_missing",R)})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:p,onSelect:e=>A(e,"buildingType"),allSelection:!0,onRemoveItem:e=>A(e,"buildingType"),value:a.buildingType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_type"}),info:{content:"detailsearch.filter.tooltip.building_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:m,onSelect:e=>P(e,"purposeOfUse"),allSelection:!0,onRemoveItem:e=>P(e,"purposeOfUse"),value:a.purposeOfUse,selectedOptions:l,isSearchExactMatch:!0}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.purpose_of_use"}),info:{content:"detailsearch.filter.tooltip.purpose_of_use",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>A(e,"ownershipType"),allSelection:!0,onRemoveItem:e=>A(e,"ownershipType"),value:a.ownershipType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.ownershiptype"}),info:{content:"detailsearch.filter.tooltip.ownershiptype",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:h,onSelect:e=>A(e,"heritage"),allSelection:!0,onRemoveItem:e=>A(e,"heritage"),value:a.ownershipType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.heritage"}),info:{content:"detailsearch.filter.tooltip.heritage",placement:"top-start"}})]}),e.isAdminPlusRole&&(0,Eo.jsx)(Eo.Fragment,{children:(0,Eo.jsxs)(_o.Row,{className:"align-items-center w-100",children:[(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.PersonSearchPageExtended,{person:v,disabled:!1,labelKey:"code",valueKey:"value",onInputChange:e=>{!function(e){T(e)}(e)},updatedFromAR:()=>{},onPersonUpdate:e=>function(e){var t,n,o;if(y(e),e&&e.id&&e.id>0&&j(e),e&&(E===e.idCode||E===(null===(t=e.id)||void 0===t?void 0:t.toString())||E===e.regCode)||e&&M.code===e.regCode)a.owner=null===(o=e.id)||void 0===o?void 0:o.toString(),s((e=>({...e})));else if(e||E.substring(4)!==(null===(n=k.id)||void 0===n?void 0:n.toString()))e||(a.owner=void 0,s((e=>({...e}))));else{var r;a.owner=null===(r=k.id)||void 0===r?void 0:r.toString(),s((e=>({...e})))}}(e),searchPerson:e.callSearchPerson,handlePersonSelection:e=>O(e),isShowError:e=>{C(e),e||_({header:"",message:""})},searchOnBlur:!0,ref:D,isOptionalField:!0,isPrivateOwner:a.isPrivatePerson}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.owner"}),info:{content:"detailsearch.filter.tooltip.owner.extended",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,children:nR(a.isPrivatePerson,(function(e){s((t=>({...t,isPrivatePerson:e})))}),"detailsearch.filter.label.checkbox.owner.private","",{xs:20,md:1})})]})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(c([]),s(n),D.current.clearTypeahead(),void y({})),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(x.length>0||I),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},uL=e=>{const t=(0,wo.useIntl)(),n={buildingLocation:"",buildingName:"",institutions:[],documentDate:{from:"",to:""},documentType:[],documentNr:"",documentState:[],connectedPerson:void 0},[o,r]=(0,yo.useState)(n),[i,a]=(0,yo.useState)(""),[s,l]=(0,yo.useState)([]),[c,d]=(0,yo.useState)([]),[u,p]=(0,yo.useState)([]),[f]=(0,yo.useState)(function(){const e=[{code:Un.DO_DOKUSEIS_ESITATUD,value:"Esitatud"},{code:Un.DO_DOKUSEIS_KOOSTAMISEL,value:"Koostamisel"},{code:Un.DO_DOKUSEIS_MENETLUSES,value:"Menetluses"},{code:Un.DO_DOKUSEIS_MUUTMISEL,value:"Muutmisel"},{code:Un.DO_DOKUSEIS_TAIENDAMISEL,value:"Täiendamisel"},{code:Un.DO_DOKUSEIS_KEHTETU,value:"Kehtetu"},{code:Un.DO_DOKUSEIS_REG_KANTUD,value:"Registrisse kantud"},{code:Un.DO_DOKUSEIS_TYHISTATUD,value:"Tühistatud"},{code:Un.DO_DOKUSEIS_LOOBUTUD,value:"Tagasi võetud"},{code:Un.DO_DOKUSEIS_ALLKIRJASTAMISEL,value:"Allkirjastamisel"},{code:Un.DO_DOKUSEIS_VANA_VERSIOON,value:"Vana versioon"}].sort(((e,t)=>e.value.localeCompare(t.value)));return rL(e)}()),[m,g]=(0,yo.useState)({}),[h,b]=(0,yo.useState)(""),[v,y]=(0,yo.useState)(!1),[x,S]=(0,yo.useState)({code:"",value:""}),[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)(!1),I=(0,yo.useRef)(),C=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),M=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),O=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.documents));function D(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],o[t]=n,r((e=>({...e})))}function k(e,t){o[t]=e.trim(),r((e=>({...e})))}function j(e){return!(!tv()(e,"YYYY-MM-DD",!0).isValid()&&!tv()(e,"D.M.YYYY",!0).isValid())}(0,yo.useEffect)((()=>{if(C){const e=rR(C);d(e)}if(M){const e=aR([...M]);p(e)}}),[C,M]);const A={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{i.length>0?T(!0):JSON.stringify(n)===JSON.stringify(o)?_({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"}):(e.onSubmit(o),_({header:"",message:""}))},children:[w.header&&w.header.length>0&&w.message&&w.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:w.header}),onDismiss:()=>_({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:w.message})]}),O&&O.length>500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"buildingLocation"),placeholder:t.formatMessage({id:"detailsearch.filter.placeholder.address_catastralUnit_ehrCode"}),value:o.buildingLocation}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_location"}),info:{content:"detailsearch.filter.tooltip.address_catastralUnit_ehrCode.extended",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_name"}),info:{content:"detailsearch.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:u,onSelect:e=>D(e,"institutions"),allSelection:!0,onRemoveItem:e=>D(e,"institutions"),value:o.institutions,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.institution"})}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{onBlur:()=>{T(!0)},value:o.documentDate,onChange:e=>(e=>{""!==e.from&&!j(e.from)||""!==e.to&&!j(e.to)?a(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&tv()(e.from)>tv()(e.to)?a(t.formatMessage({id:"filter.invalid_date_range"})):""!==e.from&&(tv()(e.from)<tv()("01.01.1990")||tv()(e.from)>tv()())||""!==e.to&&(tv()(e.to)<tv()("01.01.1990")||tv()(e.to)>tv()())?a(t.formatMessage({id:"detailsearch.document.date_range_error.message"},{dateToday:tv()().format("DD.MM.YYYY")})):tv()(e.to).diff(tv()(e.from),"days")>367?a(t.formatMessage({id:"detailsearch.filter_error_message.date_range_too_long"})):(a(""),T(!1)),r((t=>({...t,documentDate:e})))})(e)})}),errorMessage:E&&i.length>0?i:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_date"}),info:{content:"detailsearch.filter.tooltip.document_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:c,onSelect:e=>D(e,"documentType"),allSelection:!0,onRemoveItem:e=>D(e,"documentType"),value:o.documentType,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_type"}),info:{content:"detailsearch.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"documentNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.documentNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_nr"}),info:{content:"detailsearch.filter.tooltip.document_nr",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>D(e,"documentState"),allSelection:!0,onRemoveItem:e=>D(e,"documentState"),value:o.documentState,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_state"})})]})]}),!e.isNonAuthenticatedUser&&(0,Eo.jsx)(_o.Row,{children:(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.PersonSearchPageExtended,{person:m,disabled:!1,labelKey:"code",valueKey:"value",onInputChange:e=>{!function(e){b(e),x.code.length>0&&S({code:"",value:""})}(e)},updatedFromAR:()=>{},onPersonUpdate:e=>function(e){var t;g(e),e&&(h===e.idCode||h===(null===(t=e.id)||void 0===t?void 0:t.toString())||h===e.regCode)||e&&x.code===e.regCode?(o.connectedPerson=e.id,r((e=>({...e})))):e||(o.connectedPerson=void 0,r((e=>({...e}))))}(e),searchPerson:e.callSearchPerson,handlePersonSelection:e=>S(e),isShowError:e=>{y(e),e||_({header:"",message:""})},searchOnBlur:!0,ref:I,isOptionalField:!0}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.connected_person"}),info:{content:"detailsearch.filter.tooltip.connected_person.extended",placement:"top-start"}})})}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(l([]),r(n),I.current.clearTypeahead(),void g({})),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(E&&i.length>0||v),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},pL=e=>{const t=(0,wo.useIntl)(),n={documentType:[],documentNr:"",proceedingDate:{from:"",to:""},proceedingNr:"",institutions:[]},[o,r]=(0,yo.useState)(n),[i,a]=(0,yo.useState)([]),[s,l]=(0,yo.useState)([]),[c,d]=(0,yo.useState)([]),[u,p]=(0,yo.useState)(""),[f,m]=(0,yo.useState)({}),[g,h]=(0,yo.useState)(!1),b=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),v=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),y=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.proceedings));function x(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],o[t]=n,r((e=>({...e})))}function S(e,t){o[t]=e,r((e=>({...e})))}function w(e){return!(!tv()(e,"YYYY-MM-DD",!0).isValid()&&!tv()(e,"D.M.YYYY",!0).isValid())}(0,yo.useEffect)((()=>{if(b){const e=rR(b);l(e)}if(v){const e=aR([...v]);d(e)}}),[b,v]);const _={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{u.length>0?h(!0):JSON.stringify(n)===JSON.stringify(o)?m({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"}):(e.onSubmit(o),m({header:"",message:""}))},children:[f.header&&f.header.length>0&&f.message&&f.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:f.header}),onDismiss:()=>m({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:f.message})]}),y&&y.length>500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:s,onSelect:e=>x(e,"documentType"),allSelection:!0,onRemoveItem:e=>x(e,"documentType"),value:o.documentType,selectedOptions:i}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_type"}),info:{content:"detailsearch.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>S(e,"documentNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.documentNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_nr"}),info:{content:"detailsearch.filter.tooltip.document_nr",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{onChange:e=>(e=>{""!==e.from&&!w(e.from)||""!==e.to&&!w(e.to)?p(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&tv()(e.from)>tv()(e.to)?p(t.formatMessage({id:"filter.invalid_date_range"})):""!==e.from&&(tv()(e.from)<tv()("01.01.1990")||tv()(e.from)>tv()())||""!==e.to&&(tv()(e.to)<tv()("01.01.1990")||tv()(e.to)>tv()())?p(t.formatMessage({id:"detailsearch.proceeding.date_range_error.message"},{dateToday:tv()().format("DD.MM.YYYY")})):tv()(e.to).diff(tv()(e.from),"days")>367?p(t.formatMessage({id:"detailsearch.filter_error_message.date_range_too_long"})):(p(""),h(!1)),r((t=>({...t,proceedingDate:e})))})(e),value:o.proceedingDate,onBlur:()=>{h(!0)}})}),errorMessage:g&&u.length>0?u:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.proceeding_date"}),info:{content:"detailsearch.filter.tooltip.proceeding_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>S(e,"proceedingNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.proceedingNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.proceeding_nr"})}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:c,onSelect:e=>x(e,"institutions"),allSelection:!0,onRemoveItem:e=>x(e,"institutions"),value:o.institutions,selectedOptions:i}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.institution"})})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(a([]),void r(n)),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(g&&u.length>0),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},fL={EHITIS_SEISUND_KAVAN:["EHITIS_SEISUND_KAVAN","EHITIS_SEISUND_EHITAM_LUBA","EHITIS_SEISUND_MENETLUSES"],EHITIS_SEISUND_PYSTI:["EHITIS_SEISUND_PYSTI","EHITIS_SEISUND_EHITAMISEL"],EHITIS_SEISUND_OLEMA:["EHITIS_SEISUND_OLEMA","EHITIS_SEISUND_KASUTUSEL","EHITIS_SEISUND_KASUT_OSALINE","EHITIS_SEISUND_KASUT_LUBA_EIKEH","EHITIS_SEISUND_LAMMUT_LUBA","EHITIS_SEISUND_KASUT_MAAS","EHITIS_SEISUND_EBASEADUSLIK","EHITIS_SEISUND_MAARAMATA"],EHITIS_SEISUND_LAMEL:["EHITIS_SEISUND_LAMEL","EHITIS_SEISUND_LAMMUTAMISEL"],EHITIS_SEISUND_LAMUT:["EHITIS_SEISUND_LAMUT","EHITIS_SEISUND_LAMMUTATUD"],EHITIS_SEISUND_REATA:["EHITIS_SEISUND_REATA","EHITIS_SEISUND_EHITAM_LUBA_EIKEH"],EHITIS_SEISUND_KUSTU:["EHITIS_SEISUND_KUSTU","EHITIS_SEISUND_KUSTUTATUD","EHITIS_SEISUND_REG_OBJ_LOPP","EHITIS_SEISUND_ARHIIVIS"]};function mL(e){const t=function(e){return lv(fL,e)}(e);return t?function(e){switch(e){case"EHITIS_SEISUND_KAVAN":return{name:"Kavandatav",type:"info"};case"EHITIS_SEISUND_PYSTI":return{name:"EHITIS_SEISUND_PYSTI",type:"info"};case"EHITIS_SEISUND_OLEMA":return{name:"On",type:"success"};case"EHITIS_SEISUND_LAMEL":return{name:"Lammutamisel",type:"info"};case"EHITIS_SEISUND_LAMUT":return{name:"Lammutatud",type:"default"};case"EHITIS_SEISUND_REATA":return{name:"Realiseerimata",type:"default"};case"EHITIS_SEISUND_KUSTU":return{name:"Kustutatud",type:"default"};default:return{name:e,type:"default"}}}(t):{name:e,type:"default"}}const gL=e=>{const t=(0,wo.useIntl)(),[n,o]=(0,yo.useState)([]),r=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.buildings));(0,yo.useEffect)((()=>{if(r&&r.length>0){const t=e.isAdminRole?r:r.filter((e=>"EHITIS_SEISUND_KUSTU"!==e.buildingState.code));o(t)}}),[r]);const i=[{id:"ehr_code",property:"ehrCode",size:130,isFrozen:!0,getValue:e=>e.ehrCode?e.ehrCode:"",getFormattedValue:t=>{const{generateLink:n}=e,o=t.ehrCode?n(rn,String(t.ehrCode),null,!1,!1,null):null;return t.ehrCode&&null!==t.ehrCode?(0,Eo.jsx)(Mo,{linkName:t.ehrCode,tooltipText:"detailsearch.tooltip.open_building",href:o||void 0}):""}},{id:"building_address",property:"buildingaddress",size:160,getValue:e=>{var t;return null!==(t=e.buildingaddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingaddress&&null!==e.buildingaddress?e.buildingaddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""}},{id:"building_state",property:"buildingState",size:130,getValue:e=>{var t;return null!==(t=e.buildingState)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingState&&null!==e.buildingState?(0,Eo.jsx)(_o.Status,{type:mL(e.buildingState.code).type,children:e.buildingState.value}):""},{id:"purpose_of_use",property:"purposeOfUse",size:150,getValue:e=>{var t,n;return null!==(t=null===(n=e.purposeOfUse)||void 0===n?void 0:n.value)&&void 0!==t?t:""}},{id:"first_use_date",property:"firstUseDate",size:150,getValue:e=>{var t;return null!==(t=e.firstUseDate)&&void 0!==t?t:""}},{id:"under_area",property:"underArea",size:130,getValue:e=>e.underArea?e.underArea:""},{id:"floor_count",property:"floorCount",size:130,getValue:e=>e.floorCount?e.floorCount:""},{id:"ownership_type",property:"ownershipType",size:130,getValue:e=>{var t,n;return null!==(t=null===(n=e.ownershipType)||void 0===n?void 0:n.value)&&void 0!==t?t:""}},{id:"heritage",property:"heritage",size:130,getValue:e=>{var t;return null!==(t=e.heritage)&&void 0!==t?t:""},getFormattedValue:e=>e.heritage&&null!==e.heritage?e.heritage.map((e=>(0,Eo.jsxs)("div",{children:[e.name," ",e.value]},e.value))):""},{id:"owner",property:"owner",size:130,getValue:e=>{var t;return null!==(t=e.owner)&&void 0!==t?t:""},getFormattedValue:e=>e.owner?e.owner.map((e=>function(e){var t;const n=e.eesnimi?e.eesnimi+" "+e.perenimi:void 0,o=e.isikukood?(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)("br",{}),"IK "+e.isikukood]}):void 0,r=null!==e.regKood,i=null!==(t=e.jiNimi)&&void 0!==t?t:"";return!0===r?(0,Eo.jsx)("div",{children:i}):n?(0,Eo.jsxs)("div",{children:[n,null!=o?o:""]}):""}(e))):""}];return(0,Eo.jsx)("div",{children:(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:(e.isAdminPlusRole?i:i.slice(0,-1)).map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:t.formatMessage({id:"detailsearch.buildings.table.header."+e.id}),tooltip:{text:t.formatMessage({id:"detailsearch.buildings.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){const t=e.map((e=>({buildingaddress:e.buildingaddress,buildingId:e.buildingId,buildingName:e.buildingName,buildingType:e.buildingType,ehrCode:e.ehrCode,firstUseDate:e.firstUseDate,owner:e.owner,heritage:e.heritage,ownershipType:e.ownershipType,purposeOfUse:e.purposeOfUse,buildingState:e.buildingState,floorCount:e.floorCount,underArea:e.underArea})));return t}(n),handleEvent:()=>!0})})};const hL=e=>{var t,n,o,r,i,a;const s=(0,wo.useIntl)(),[l,c]=(0,yo.useState)([]),d=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.documents)),u=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),p=null!==(t=null===(n=e.userInfo)||void 0===n||null===(o=n.activeRole)||void 0===o?void 0:o.businessType)&&void 0!==t?t:"",f=null!==(r=null===(i=e.userInfo)||void 0===i||null===(a=i.activeRole)||void 0===a?void 0:a.businessId)&&void 0!==r?r:0;(0,yo.useEffect)((()=>{d&&d.length>0&&c(d)}),[d]);const m=e.filterStateDocumentsSearch.buildingLocation,g=e.filterStateDocumentsSearch.buildingName;const h=m?m.toString().toLowerCase().replace(/[&|=;~!$>*%_()?.+:'"\\]/g,"").replace(/\t/g," ").replace(/\s{2,}/g," ").replace(/\s?-\s?/g,"-"):"";function b(e,t){const n=(o=function(e){return e.replace(/\btn\b/g,"").replace(/\btänav\b/g,"").replace(/\btee\b/g,"").replace(/\bmaantee\b/g,"").replace(/\bmnt\b/g,"").replace(/\bküla\b/g,"").replace(/\blinnaosa\b/g,"").replace(/\blinn\b/g,"").replace(/\bpuiestee\b/g,"").replace(/\bpst\b/g,"").replace(/\bvald\b/g,"").replace(/\balevik\b/g,"").replace(/\balev\b/g,"").replace(/\bpõik\b/g,"").replace(/\blõik\b/g,"")}(e),o.replaceAll("//","").replaceAll(",","").split(/\s+/g).reduce(((e,t)=>{if(Number.isNaN(Number(t[0]))&&Number.isNaN(Number(t[1])))e.push(t);else{const n=` ${t}`;e[e.length-1]+=n}return e}),[]));var o;const r=t.replace(/\s+/g," ").split(/\/\/\s+(?=[a-z]+\b)/gi);return n.every((e=>{const t=e.trim().split(/\s+/);return r.some((e=>t.every((t=>new RegExp(`(?<![\\/\\-])\\b${t}\\b`,"i").test(e)))))}))}const v=["tn","tänav","tee","maantee","mnt","küla","linnaosa","linn","puiestee","pst","vald","alevik","alev","põik","lõik"];function y(e,t){var n;const o=null===(n=t.buildingAddress)||void 0===n?void 0:n.map((t=>function(e,t){return v.some((n=>{const o=new RegExp(`\\b(\\w+)\\s+${n}\\b`,"i"),r=e.match(o);if(r){const e=r[1];return new RegExp(`\\b${e}\\s+${n}\\b`,"i").test(t)}return!1}))}(e,t.toLowerCase())));return!!o&&o.indexOf(!0)>-1}function x(e){const t=e.filter((e=>function(e,t){var n;const o=null===(n=t.buildingAddress)||void 0===n?void 0:n.map((t=>b(e,t.toLowerCase())));return!!o&&o.indexOf(!0)>-1}(h,e)));return v.some((e=>function(e){return!new RegExp(`\\b${e}\\b`,"gi").test(e)}(e)))?t.filter((e=>y(h,e))):t}function S(){return!Number.isNaN(Number(h))}function w(){if(h&&h.indexOf(", ")>-1){return h.split(", ").reverse().join(", ")}return h}function _(e){const t=e.buildingName,n=e.buildingAddress;return t&&n&&(n.some((e=>e.toLowerCase().split(" ").some((e=>t.some((t=>t.toLowerCase().includes(e)))))))||t.some((e=>e.toLowerCase().split(" ").some((e=>n.some((t=>t.toLowerCase().includes(e))))))))}function E(e){let t=0;if(e.buildingAddress&&e.buildingAddress.length>0&&e.buildingAddress[0].length<200){const n=h.replace(",","").split(" ");let o=e.buildingAddress[0].toLowerCase().split(", ");const r=new Set;o.forEach((e=>{const t=e.split(" ")[0];return r.add(t)})),o=Array.from(r),o.forEach((e=>(n.includes(e)&&(t+=1),t)))}else t=-1;return t}const T=new RegExp(`\\b${h}\\b(?![\\/\\-])`,"i"),I=new RegExp(`\\b${w()}\\b(?![\\/\\-])`,"i"),C=h.replace(",","").split(/(?:\/|\s)+/g);function M(e){const t=e.buildingAddress;return t?t.findIndex((e=>e.toLowerCase()===h||e.toLowerCase()===w()))>-1?"exact":t.findIndex((e=>T.test(e.toLowerCase())||I.test(e.toLowerCase())))>-1?"partial":t.findIndex((e=>{const t=e.toLowerCase().replace(",","").replace(/\/\//g," ");return C.every((e=>t.includes(e)))}))>-1?"vague":"other":""}const O=["exact","partial","vague","other"];function D(e){const t=e.map((e=>{return t=e,{...t,title:t.docId,addressWithBuilding:_(t),addressMatch:M(t),addressRank:E(t)};var t}));return t.sort(((e,t)=>{const n=O.indexOf(e.addressMatch),o=O.indexOf(t.addressMatch);return n!==o?n-o:e.addressWithBuilding!==t.addressWithBuilding?""===g?e.addressWithBuilding?1:-1:e.addressWithBuilding?-1:1:t.addressRank-e.addressRank}))}const k=[{id:"doc_date",property:"docDate",size:130,getValue:e=>rv.dateToStr(e.docDate),isFrozen:!0},{id:"reg_date",property:"regDate",size:130,getValue:e=>rv.dateToStr(e.regDate)},{id:"doc_nr",property:"docNr",size:160,getValue:e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=t.docNr?n(sn,String(t.docNr),null,!1,!1,{docId:t.docId,ehrCode:t.ehrCode}):null;return t.docNr&&null!==t.docNr?(0,Eo.jsx)(Mo,{linkName:t.docNr,tooltipText:"detailsearch.tooltip.open_document",href:o||void 0}):""}},{id:"document_type",property:"documentType",size:160,getValue:e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""}},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingName&&null!==e.buildingName?e.buildingName.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"ehr_code",property:"ehrCode",size:130,getValue:e=>{var t;return null!==(t=e.ehrCode)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e;return t.ehrCode?t.ehrCode.map(((e,o)=>{const r=t.ehrCode?n(rn,String(e),null,!1,!1,null):null;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"detailsearch.tooltip.open_building",href:r||void 0}),o!==t.ehrCode.length-1?(0,Eo.jsx)("span",{children:", "}):""]})})):""}},{id:"building_address",property:"buildingAddress",size:130,getValue:e=>{var t;return null!==(t=e.buildingAddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingAddress&&null!==e.buildingAddress?e.buildingAddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"doc_state",property:"stateCode",size:180,getValue:e=>{var t;return null!==(t=e.stateCode)&&void 0!==t?t:""},getFormattedValue:e=>e.stateCode&&null!==e.stateCode?(0,Eo.jsx)(_o.Status,{type:ZP(e.stateCode,s).oldType,children:ZP(e.stateCode,s).name}):""},{id:"proceeding_nr",property:"proceedingNr",size:130,getValue:e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},getFormattedValue:t=>{var n;const{generateLink:o}=e,r=bR(null===(n=t.doty)||void 0===n?void 0:n.toString()),i=t.proceedingNr?o(r,String(t.proceedingNr),null,!1,!1,null):null;return t.proceedingNr?p===ln.MKM||t.institutionId&&f===t.institutionId?(0,Eo.jsx)(Mo,{linkName:t.proceedingNr,tooltipText:"detailsearch.tooltip.open_proceeding",href:i||void 0}):t.proceedingNr:""}},{id:"presenter",property:"presenter",size:130,getValue:e=>{var t;return null!==(t=e.presenter)&&void 0!==t?t:""},getFormattedValue:e=>e.presenter?e.presenter.map(((t,n)=>(0,Eo.jsxs)("div",{children:[t,n!==e.presenter.length-1?(0,Eo.jsx)("span",{children:", "}):""]}))):""},{id:"institution",property:"institutionName",size:130,getValue:e=>{var t;return null!==(t=e.institutionName)&&void 0!==t?t:""}}];return(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:k.map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:s.formatMessage({id:"detailsearch.documents.table.header."+e.id}),tooltip:{text:s.formatMessage({id:"detailsearch.documents.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):null==e?void 0:e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){let t;if(0===(null==m?void 0:m.indexOf('"'))&&(null==m?void 0:m.lastIndexOf('"'))===m.length-1){const n=x(e);t=S()||h.length<2?n:D(n)}else t=S()||h.length<2?e:D(e);const n=t.map((e=>{var t,n,o,r;return{docId:e.docId,docDate:null!==(t=rv.dateToMs(nv,e.docDate))&&void 0!==t?t:"",regDate:null!==(n=rv.dateToMs(nv,e.regDate))&&void 0!==n?n:"",deadlineDate:e.deadlineDate,docNr:e.docNr,documentType:e.documentType,doty:e.doty,buildingName:e.buildingName,ehrCode:e.ehrCode,buildingAddress:e.buildingAddress,state:e.state,stateCode:e.stateCode,proceedingNr:e.proceedingNr,presenter:e.presenter,institutionId:e.institutionId,institutionName:null!==(o=null===(r=u.find((t=>t.id===e.institutionId)))||void 0===r?void 0:r.regName)&&void 0!==o?o:""}}));return n}(l),handleEvent:()=>!0})},bL=e=>{var t,n,o,r;const i=(0,wo.useIntl)(),[a,s]=(0,yo.useState)([]),l=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.proceedings)),c=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),d=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),u=e.userInfo&&e.userInfo.activeRole&&null!==(t=e.userInfo.activeRole)&&void 0!==t&&t.businessType?null===(n=e.userInfo.activeRole)||void 0===n?void 0:n.businessType:"",p=e.userInfo&&e.userInfo.activeRole&&null!==(o=e.userInfo.activeRole)&&void 0!==o&&o.businessId?null===(r=e.userInfo.activeRole)||void 0===r?void 0:r.businessId:0;(0,yo.useEffect)((()=>{l&&l.length>0&&s(l)}),[l]);const f=[{id:"date_start",property:"dateStart",size:130,getValue:e=>rv.dateToStr(e.dateStart),isFrozen:!0},{id:"date_end",property:"dateEnd",size:130,getValue:e=>rv.dateToStr(e.dateEnd)},{id:"proceeding_nr",property:"proceedingNr",size:130,getValue:e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=bR(t.doty),r=t.proceedingNr?n(o,String(t.proceedingNr),null,!1,!1,null):null;return t.proceedingNr&&null!==t.proceedingNr?"MKM"===u||t.institutionId&&p===t.institutionId?(0,Eo.jsx)(Mo,{linkName:t.proceedingNr,tooltipText:"detailsearch.tooltip.open_proceeding",href:r||void 0}):t.proceedingNr:""}},{id:"proceeding_state",property:"proceedingState",size:200,getValue:e=>{var t;return null!==(t=e.proceedingStateCode)&&void 0!==t?t:""},getFormattedValue:e=>e.proceedingStateCode&&null!==e.proceedingStateCode?(0,Eo.jsx)(_o.Status,{type:cv(e.proceedingStateCode,i).oldType,children:cv(e.proceedingStateCode,i).name}):""},{id:"document",property:"docNr",size:160,getValue:e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=t.docNr?n(sn,String(t.docNr),null,!1,!1,null):null;return t.docNr&&null!==t.docNr?(0,Eo.jsx)(Mo,{linkName:t.docNr,tooltipText:"detailsearch.tooltip.open_document",href:o||void 0}):""}},{id:"document_type",property:"documentType",size:180,getValue:e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""}},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingName&&null!==e.buildingName?e.buildingName.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"ehr_code",property:"ehrCode",size:130,getValue:e=>{var t;return null!==(t=e.ehrCode)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e;return t.ehrCode&&null!==t.ehrCode?t.ehrCode.map(((e,o)=>{const r=t.ehrCode?n(rn,String(e),null,!1,!1,null):null;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"detailsearch.tooltip.open_building",href:r||void 0}),o!==t.ehrCode.length-1?(0,Eo.jsx)("span",{children:", "}):""]})})):""}},{id:"building_address",property:"buildingAddress",size:160,getValue:e=>{var t;return null!==(t=e.buildingAddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingAddress&&null!==e.buildingAddress?e.buildingAddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"proceeding_name",property:"proceedingName",size:160,getValue:e=>{var t;return null!==(t=e.proceedingName)&&void 0!==t?t:""}},{id:"supervisor",property:"supervisorName",size:130,getValue:e=>{var t;return null!==(t=e.supervisorName)&&void 0!==t?t:""}},{id:"institution",property:"institutionName",size:130,getValue:e=>{var t;return null!==(t=e.institutionName)&&void 0!==t?t:""}},{id:"archived",property:"archived",size:130,getValue:e=>e.archived&&"2"===e.archived?"Jah":"Ei"}];return(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:f.map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:i.formatMessage({id:"detailsearch.proceedings.table.header."+e.id}),tooltip:{text:i.formatMessage({id:"detailsearch.proceedings.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){const t=e.map((e=>{var t,n,o,r,i,a;return{proceedingId:e.proceedingId,dateStart:null!==(t=rv.dateToMs(nv,e.dateStart))&&void 0!==t?t:"",dateEnd:null!==(n=rv.dateToMs(nv,e.dateEnd))&&void 0!==n?n:"",proceedingNr:e.proceedingNr,proceedingState:e.proceedingState,proceedingStateCode:e.proceedingStateCode,docNr:e.docNr,documentType:null!==(o=null===(r=c.find((t=>t.id.toString()===e.documentType)))||void 0===r?void 0:r.name)&&void 0!==o?o:"",doty:e.documentType,proceedingName:e.proceedingName,institutionId:e.institutionId,institutionName:null!==(i=null===(a=d.find((t=>t.id===e.institutionId)))||void 0===a?void 0:a.regName)&&void 0!==i?i:"",supervisorId:e.supervisorId,supervisorName:e.supervisorName,archived:e.archived,buildingName:e.buildingName,ehrCode:e.ehrCode,buildingAddress:e.buildingAddress}}));return t}(a),handleEvent:()=>!0})},vL="https://devkluster.ehr.ee/api/building/v2".replace(/\/+$/,"");class yL{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vL,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M();this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class xL extends Error{constructor(e,t){super(t),this.name="RequiredError",this.field=e}}const SL="https://example.com",wL=function(e,t,n){if(null==n)throw new xL(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},_L=function(e){const t=new URLSearchParams(e.search);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];for(const e of o)for(const n in e)if(Array.isArray(e[n])){t.delete(n);for(const o of e[n])t.append(n,o)}else t.set(n,e[n]);e.search=t.toString()},EL=function(e,t,n){const o="string"!=typeof e;return(o&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):o)?JSON.stringify(void 0!==e?e:{}):e||""},TL=function(e){return e.pathname+e.search+e.hash},IL=function(e,t,n,o){return function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;const a={...e.options,url:((null==o?void 0:o.basePath)||i)+e.url};return r.request(a)}},CL=function(e){const t=function(e){return{buildingChangesGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("buildingChangesGet","ehrCode",t),wL("buildingChangesGet","dokNr",n);const r=new URL("/buildingChanges",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.ehr_code=t),void 0!==n&&(s.dok_nr=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingCompareGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("buildingCompareGet","doEhitisId1",t),wL("buildingCompareGet","doEhitisId2",n);const r=new URL("/buildingCompare",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.do_ehitis_id1=t),void 0!==n&&(s.do_ehitis_id2=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingDataGet:async function(t,n,o,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const a=new URL("/buildingData",SL);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...i},c={};void 0!==t&&(c.ehr_code=t),void 0!==n&&(c.ehr_id=n),void 0!==o&&(c.version=o),void 0!==r&&(c.json=r),_L(a,c,i.query);let d=s&&s.headers?s.headers:{};return l.headers={...d,...i.headers},{url:TL(a),options:l}},buildingDeepCopyPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingDeepCopyPost","deepCopyPostRequest",t);const o=new URL("/buildingDeepCopy",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingOwnerSearchPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingOwnerSearchPost","bSearchOPostRequest",t);const o=new URL("/buildingOwnerSearch",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSearchPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingSearchPost","bSearchPostRequest",t);const o=new URL("/buildingSearch",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSecureDataArrayPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingSecureDataArrayPost","requestBody",t);const o=new URL("/buildingSecureDataArray",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSecureDataGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new URL("/buildingSecureData",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.ehr_code=t),void 0!==n&&(s.ehr_id=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingVersionsGet:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingVersionsGet","ehrCode",t);const o=new URL("/buildingVersions",SL);let r;e&&(r=e.baseOptions);const i={method:"GET",...r,...n},a={};void 0!==t&&(a.ehr_code=t),_L(o,a,n.query);let s=r&&r.headers?r.headers:{};return i.headers={...s,...n.headers},{url:TL(o),options:i}},buildingsDataPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingsDataPost","ehrCodesPostRequest",t);const o=new URL("/buildingsData",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},findEhrcodesDateafterGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("findEhrcodesDateafterGet","timestamp",t);const r=new URL("/find/ehrcodes/dateafter",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.timestamp=t instanceof Date?t.toISOString():t),void 0!==n&&(s.offset=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},findEhrcodesDocIdGet:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("findEhrcodesDocIdGet","id",t);const o=new URL("/find/ehrcodes/docId",SL);let r;e&&(r=e.baseOptions);const i={method:"GET",...r,...n},a={};void 0!==t&&(a.id=t),_L(o,a,n.query);let s=r&&r.headers?r.headers:{};return i.headers={...s,...n.headers},{url:TL(o),options:i}}}}(e);return{async buildingChangesGet(n,o,r){const i=await t.buildingChangesGet(n,o,r);return IL(i,M(),vL,e)},async buildingCompareGet(n,o,r){const i=await t.buildingCompareGet(n,o,r);return IL(i,M(),vL,e)},async buildingDataGet(n,o,r,i,a){const s=await t.buildingDataGet(n,o,r,i,a);return IL(s,M(),vL,e)},async buildingDeepCopyPost(n,o){const r=await t.buildingDeepCopyPost(n,o);return IL(r,M(),vL,e)},async buildingOwnerSearchPost(n,o){const r=await t.buildingOwnerSearchPost(n,o);return IL(r,M(),vL,e)},async buildingSearchPost(n,o){const r=await t.buildingSearchPost(n,o);return IL(r,M(),vL,e)},async buildingSecureDataArrayPost(n,o){const r=await t.buildingSecureDataArrayPost(n,o);return IL(r,M(),vL,e)},async buildingSecureDataGet(n,o,r){const i=await t.buildingSecureDataGet(n,o,r);return IL(i,M(),vL,e)},async buildingVersionsGet(n,o){const r=await t.buildingVersionsGet(n,o);return IL(r,M(),vL,e)},async buildingsDataPost(n,o){const r=await t.buildingsDataPost(n,o);return IL(r,M(),vL,e)},async findEhrcodesDateafterGet(n,o,r){const i=await t.findEhrcodesDateafterGet(n,o,r);return IL(i,M(),vL,e)},async findEhrcodesDocIdGet(n,o){const r=await t.findEhrcodesDocIdGet(n,o);return IL(r,M(),vL,e)}}};class ML extends yL{buildingChangesGet(e,t,n){return CL(this.configuration).buildingChangesGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingCompareGet(e,t,n){return CL(this.configuration).buildingCompareGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingDataGet(e,t,n,o,r){return CL(this.configuration).buildingDataGet(e,t,n,o,r).then((e=>e(this.axios,this.basePath)))}buildingDeepCopyPost(e,t){return CL(this.configuration).buildingDeepCopyPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingOwnerSearchPost(e,t){return CL(this.configuration).buildingOwnerSearchPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSearchPost(e,t){return CL(this.configuration).buildingSearchPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSecureDataArrayPost(e,t){return CL(this.configuration).buildingSecureDataArrayPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSecureDataGet(e,t,n){return CL(this.configuration).buildingSecureDataGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingVersionsGet(e,t){return CL(this.configuration).buildingVersionsGet(e,t).then((e=>e(this.axios,this.basePath)))}buildingsDataPost(e,t){return CL(this.configuration).buildingsDataPost(e,t).then((e=>e(this.axios,this.basePath)))}findEhrcodesDateafterGet(e,t,n){return CL(this.configuration).findEhrcodesDateafterGet(e,t,n).then((e=>e(this.axios,this.basePath)))}findEhrcodesDocIdGet(e,t){return CL(this.configuration).findEhrcodesDocIdGet(e,t).then((e=>e(this.axios,this.basePath)))}}const OL=e=>{var t,n,o,r;let{buildingsActualDataApiEndpoint:i,classifierApiEndpoint:a,documentApiEndpoint:s,linkGen:l,generateLink:c,myViewsApiEndpoint:d,searchType:u,userApiEndpoint:p,userInfo:f}=e;const g=(0,xl.useDispatch)(),y=["MKM","KOV","TJA"].includes(f&&f.activeRole&&null!==(t=f.activeRole)&&void 0!==t&&t.businessType?null===(n=f.activeRole)||void 0===n?void 0:n.businessType:""),x=["MKM","KOV","TJA","N","KT"].includes(f&&f.activeRole&&null!==(o=f.activeRole)&&void 0!==o&&o.businessType?null===(r=f.activeRole)||void 0===r?void 0:r.businessType:""),S=!f,[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)({}),[I,C]=(0,yo.useState)({}),[M,O]=(0,yo.useState)([]),[D,k]=(0,yo.useState)([]),[j,A]=(0,yo.useState)([]),[P,N]=(0,yo.useState)(!1),[R,L]=(0,yo.useState)(!1),[U,V]=(0,yo.useState)(!1),$=new F(new _e({basePath:a})),B=new Fe(new _e({basePath:s})),K=new X(new re({basePath:p})),z=new ve(new _e({basePath:d})),H=new te(new re({basePath:p})),Y=new ML(new _e({basePath:i})),G=async(e,t,n)=>{try{const o=await H.searchPerson(e,t,n);return o.data}catch(e){console.log("= = = callSearchPerson error occured:",e)}};return(0,yo.useEffect)((()=>{$.getAllDocumentTypes().then((e=>{g(m(e.data))})).catch((e=>{console.log(e)})),K.getJurKovPersons().then((e=>{g(h(e.data))})).catch((e=>{console.log(e)})),$.getUsageClassifierTypes().then((e=>{g(b(e.data))})).catch((e=>{console.log(e)})),B.getClassifierByType("EHITIS_MALESTIS").then((e=>{g(v(e.data))})).catch((e=>{console.log(e)}))}),[]),(0,yo.useEffect)((()=>{if(Object.keys(I).length>0){V(!0);z.searchDetailProceedings(I).then((e=>{g(At(e.data)),A(e.data),V(!1)})).catch((e=>{console.log(e),V(!1)}))}}),[I]),(0,yo.useEffect)((()=>{if(Object.keys(E).length>0){L(!0);z.searchDetailDocuments(E).then((e=>{var t,n;g(jt(null!==(t=e.data.content)&&void 0!==t?t:[])),k(null!==(n=e.data.content)&&void 0!==n?n:[]),L(!1)})).catch((e=>{console.log(e),L(!1)}))}}),[E]),(0,yo.useEffect)((()=>{if(Object.keys(w).length>0){let e;N(!0),e=x?Y.buildingOwnerSearchPost(w):Y.buildingSearchPost(w),e.then((e=>{g(kt(e.data)),O(e.data),N(!1)})).catch((e=>{console.log(e),N(!1)}))}}),[w,x]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Section,{collapsed:u!==Qt,title:"detailsearch.buildings_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(dL,{onSubmit:e=>{_(e)},isAdminRole:y,isAdminPlusRole:x,callSearchPerson:G})}),Object.keys(w).length>0&&0===M.length&&!P?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):P?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(gL,{linkGen:l,generateLink:c,isAdminRole:y,isAdminPlusRole:x})]})}),(0,Eo.jsx)(_o.Section,{collapsed:"DOCUMENTS_SEARCH"!==u,title:"detailsearch.documents_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(uL,{onSubmit:e=>{T(e)},callSearchPerson:G,isNonAuthenticatedUser:S})}),Object.keys(E).length>0&&0===D.length&&!R?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):R?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(hL,{linkGen:l,generateLink:c,userInfo:f,filterStateDocumentsSearch:E})]})}),y&&(0,Eo.jsx)(_o.Section,{collapsed:"PROCEEDINGS_SEARCH"!==u,title:"detailsearch.proceedings_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(pL,{onSubmit:e=>{C(e)}})}),Object.keys(I).length>0&&0===j.length&&!U?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):U?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(bL,{linkGen:l,userInfo:f,generateLink:c})]})})]})}})(),module.exports=s})();
75
+ `),tC.rippleVisible,xC,550,(({theme:e})=>e.transitions.easing.easeInOut),tC.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),tC.child,tC.childLeaving,SC,550,(({theme:e})=>e.transitions.easing.easeInOut),tC.childPulsate,wC,(({theme:e})=>e.transitions.easing.easeInOut)),TC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiTouchRipple"}),{center:o=!1,classes:r={},className:i}=n,a=Go(n,mC),[s,l]=yo.useState([]),c=yo.useRef(0),d=yo.useRef(null);yo.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[s]);const u=yo.useRef(!1),p=iC(),f=yo.useRef(null),m=yo.useRef(null),g=yo.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:o,rippleSize:i,cb:a}=e;l((e=>[...e,(0,Eo.jsx)(EC,{classes:{ripple:cT(r.ripple,tC.ripple),rippleVisible:cT(r.rippleVisible,tC.rippleVisible),ripplePulsate:cT(r.ripplePulsate,tC.ripplePulsate),child:cT(r.child,tC.child),childLeaving:cT(r.childLeaving,tC.childLeaving),childPulsate:cT(r.childPulsate,tC.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:o,rippleSize:i},c.current)])),c.current+=1,d.current=a}),[r]),h=yo.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:r=!1,center:i=o||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&u.current)return void(u.current=!1);"touchstart"===(null==e?void 0:e.type)&&(u.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,d,h;if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),d=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),d=Math.round(n-l.top)}if(i)h=Math.sqrt((2*l.width**2+l.height**2)/3),h%2==0&&(h+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-d),d)+2;h=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===f.current&&(f.current=()=>{g({pulsate:r,rippleX:c,rippleY:d,rippleSize:h,cb:n})},p.start(80,(()=>{f.current&&(f.current(),f.current=null)}))):g({pulsate:r,rippleX:c,rippleY:d,rippleSize:h,cb:n})}),[o,g,p]),b=yo.useCallback((()=>{h({},{pulsate:!0})}),[h]),v=yo.useCallback(((e,t)=>{if(p.clear(),"touchend"===(null==e?void 0:e.type)&&f.current)return f.current(),f.current=null,void p.start(0,(()=>{v(e,t)}));f.current=null,l((e=>e.length>0?e.slice(1):e)),d.current=t}),[p]);return yo.useImperativeHandle(t,(()=>({pulsate:b,start:h,stop:v})),[b,h,v]),(0,Eo.jsx)(_C,Yo({className:cT(tC.root,r.root,i),ref:m},a,{children:(0,Eo.jsx)(fC,{component:null,exit:!0,children:s})}))}));function IC(e){return bI("MuiButtonBase",e)}const CC=vI("MuiButtonBase",["root","disabled","focusVisible"]);function MC(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function OC(...e){return yo.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{MC(e,t)}))}),e)}let DC=!0,kC=!1;const jC=new rC,AC={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function PC(e){e.metaKey||e.altKey||e.ctrlKey||(DC=!0)}function NC(){DC=!1}function RC(){"hidden"===this.visibilityState&&kC&&(DC=!0)}function LC(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return DC||function(e){const{type:t,tagName:n}=e;return!!("INPUT"===n&&AC[t]&&!e.readOnly||"TEXTAREA"===n&&!e.readOnly||e.isContentEditable)}(t)}function FC(){const e=yo.useCallback((e=>{null!=e&&function(e){e.addEventListener("keydown",PC,!0),e.addEventListener("mousedown",NC,!0),e.addEventListener("pointerdown",NC,!0),e.addEventListener("touchstart",NC,!0),e.addEventListener("visibilitychange",RC,!0)}(e.ownerDocument)}),[]),t=yo.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!LC(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(kC=!0,jC.start(100,(()=>{kC=!1})),t.current=!1,!0)},ref:e}}function UC(e){const t=yo.useRef(e);return zE((()=>{t.current=e})),yo.useRef(((...e)=>(0,t.current)(...e))).current}const VC=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],$C=fI("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${CC.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),BC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiButtonBase"}),{action:o,centerRipple:r=!1,children:i,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:u=!1,LinkComponent:p="a",onBlur:f,onClick:m,onContextMenu:g,onDragLeave:h,onFocus:b,onFocusVisible:v,onKeyDown:y,onKeyUp:x,onMouseDown:S,onMouseLeave:w,onMouseUp:_,onTouchEnd:E,onTouchMove:T,onTouchStart:I,tabIndex:C=0,TouchRippleProps:M,touchRippleRef:O,type:D}=n,k=Go(n,VC),j=yo.useRef(null),A=yo.useRef(null),P=OC(A,O),{isFocusVisibleRef:N,onFocus:R,onBlur:L,ref:F}=FC(),[U,V]=yo.useState(!1);l&&U&&V(!1),yo.useImperativeHandle(o,(()=>({focusVisible:()=>{V(!0),j.current.focus()}})),[]);const[$,B]=yo.useState(!1);yo.useEffect((()=>{B(!0)}),[]);const K=$&&!c&&!l;function z(e,t,n=d){return UC((o=>(t&&t(o),!n&&A.current&&A.current[e](o),!0)))}yo.useEffect((()=>{U&&u&&!c&&$&&A.current.pulsate()}),[c,u,U,$]);const H=z("start",S),Y=z("stop",g),G=z("stop",h),W=z("stop",_),q=z("stop",(e=>{U&&e.preventDefault(),w&&w(e)})),J=z("start",I),X=z("stop",E),Z=z("stop",T),Q=z("stop",(e=>{L(e),!1===N.current&&V(!1),f&&f(e)}),!1),ee=UC((e=>{j.current||(j.current=e.currentTarget),R(e),!0===N.current&&(V(!0),v&&v(e)),b&&b(e)})),te=()=>{const e=j.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ne=yo.useRef(!1),oe=UC((e=>{u&&!ne.current&&U&&A.current&&" "===e.key&&(ne.current=!0,A.current.stop(e,(()=>{A.current.start(e)}))),e.target===e.currentTarget&&te()&&" "===e.key&&e.preventDefault(),y&&y(e),e.target===e.currentTarget&&te()&&"Enter"===e.key&&!l&&(e.preventDefault(),m&&m(e))})),re=UC((e=>{u&&" "===e.key&&A.current&&U&&!e.defaultPrevented&&(ne.current=!1,A.current.stop(e,(()=>{A.current.pulsate(e)}))),x&&x(e),m&&e.target===e.currentTarget&&te()&&" "===e.key&&!e.defaultPrevented&&m(e)}));let ie=s;"button"===ie&&(k.href||k.to)&&(ie=p);const ae={};"button"===ie?(ae.type=void 0===D?"button":D,ae.disabled=l):(!k.href&&!k.to&&(ae.role="button"),l&&(ae["aria-disabled"]=l));const se=OC(t,F,j),le=Yo({},n,{centerRipple:r,component:s,disabled:l,disableRipple:c,disableTouchRipple:d,focusRipple:u,tabIndex:C,focusVisible:U}),ce=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:o,classes:r}=e,i=_I({root:["root",t&&"disabled",n&&"focusVisible"]},IC,r);return n&&o&&(i.root+=` ${o}`),i})(le);return(0,Eo.jsxs)($C,Yo({as:ie,className:cT(ce.root,a),ownerState:le,onBlur:Q,onClick:m,onContextMenu:Y,onFocus:ee,onKeyDown:oe,onKeyUp:re,onMouseDown:H,onMouseLeave:q,onMouseUp:W,onDragLeave:G,onTouchEnd:X,onTouchMove:Z,onTouchStart:J,ref:se,tabIndex:l?-1:C,type:D},ae,k,{children:[i,K?(0,Eo.jsx)(TC,Yo({ref:P,center:r},M)):null]}))})),KC=["edge","children","className","color","disabled","disableFocusRipple","size"],zC=fI(BC,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${Ai(n.color)}`],n.edge&&t[`edge${Ai(n.edge)}`],t[`size${Ai(n.size)}`]]}})((({theme:e,ownerState:t})=>Yo({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const o=null==(n=(e.vars||e).palette)?void 0:n[t.color];return Yo({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&Yo({color:null==o?void 0:o.main},!t.disableRipple&&{"&:hover":Yo({},o&&{backgroundColor:e.vars?`rgba(${o.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(o.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${eC.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),HC=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiIconButton"}),{edge:o=!1,children:r,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:c="medium"}=n,d=Go(n,KC),u=Yo({},n,{edge:o,color:a,disabled:s,disableFocusRipple:l,size:c}),p=(e=>{const{classes:t,disabled:n,color:o,edge:r,size:i}=e;return _I({root:["root",n&&"disabled","default"!==o&&`color${Ai(o)}`,r&&`edge${Ai(r)}`,`size${Ai(i)}`]},QI,t)})(u);return(0,Eo.jsx)(zC,Yo({className:cT(p.root,i),centerRipple:!0,focusRipple:!l,disabled:s,ref:t},d,{ownerState:u,children:r}))})),YC=fI("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e,ownerState:t})=>Yo({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3)},t.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}))),GC=fI(ZI,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})((({ownerState:e})=>Yo({flex:1},!e.isLandscape&&{alignItems:"center"}))),WC=fI(HC,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(e,t)=>[{[`&.${NI.penIconButtonLandscape}`]:t.penIconButtonLandscape},t.penIconButton]})({}),qC=e=>"clock"===e?(0,Eo.jsx)(jI,{color:"inherit"}):(0,Eo.jsx)(kI,{color:"inherit"}),JC=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersToolbar"}),{children:o,className:r,getMobileKeyboardInputViewButtonText:i,isLandscape:a,isMobileKeyboardViewOpen:s,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:d,viewType:u="calendar"}=n,p=n,f=ZE(),m=(e=>{const{classes:t,isLandscape:n}=e;return _I({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},PI,t)})(p);return(0,Eo.jsxs)(YC,{ref:t,className:sT(m.root,r),ownerState:p,children:[(0,Eo.jsx)($I,{color:"text.secondary",variant:"overline",children:d}),(0,Eo.jsxs)(GC,{container:!0,justifyContent:"space-between",className:m.content,ownerState:p,direction:a?l:"row",alignItems:a?"flex-start":"flex-end",children:[o,(0,Eo.jsx)(WC,{onClick:c,className:m.penIconButton,ownerState:p,color:"inherit","aria-label":i?i(s,u):f.inputModeToggleButtonAriaLabel(s,u),children:s?qC(u):(0,Eo.jsx)(AI,{color:"inherit"})})]})]})}));function XC(e){return bI("MuiDatePickerToolbar",e)}vI("MuiDatePickerToolbar",["root","title"]);const ZC=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],QC=fI(JC,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),eM=fI($I,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})((({ownerState:e})=>Yo({},e.isLandscape&&{margin:"auto 16px auto auto"}))),tM=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiDatePickerToolbar"}),{parsedValue:o,isLandscape:r,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:a,toolbarFormat:s,toolbarPlaceholder:l="––",toolbarTitle:c,views:d}=n,u=Go(n,ZC),p=JE(),f=ZE(),m=(e=>{const{classes:t}=e;return _I({root:["root"],title:["title"]},XC,t)})(n),g=c??f.datePickerDefaultToolbarTitle,h=yo.useMemo((()=>o?s?p.formatByString(o,s):nT(d)?p.format(o,"year"):oT(d)?p.format(o,"month"):/en/.test(p.getCurrentLocaleCode())?p.format(o,"normalDateWithWeekday"):p.format(o,"normalDate"):l),[o,s,l,p,d]),b=n;return(0,Eo.jsx)(QC,Yo({ref:t,toolbarTitle:g,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:a,isLandscape:r,className:m.root},u,{children:(0,Eo.jsx)(eM,{variant:"h4",align:r?"left":"center",ownerState:b,className:m.title,children:h})}))})),nM=yo.createContext(null);function oM(e){return bI("MuiPickersPopper",e)}function rM(e,t){return Array.isArray(t)?t.every((t=>-1!==e.indexOf(t))):-1!==e.indexOf(t)}vI("MuiPickersPopper",["root","paper"]);const iM=(e,t)=>t=>{("Enter"===t.key||" "===t.key)&&(e(t),t.preventDefault(),t.stopPropagation())},aM=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?aM(t.shadowRoot):t:null},sM=e=>e.scrollTop;function lM(e,t){var n,o;const{timeout:r,easing:i,style:a={}}=e;return{duration:null!=(n=a.transitionDuration)?n:"number"==typeof r?r:r[t.mode]||0,easing:null!=(o=a.transitionTimingFunction)?o:"object"==typeof i?i[t.mode]:i,delay:a.transitionDelay}}const cM=!1;var dM=function(e){return e.scrollTop},uM="unmounted",pM="exited",fM="entering",mM="entered",gM="exiting",hM=function(e){function t(t,n){var o;o=e.call(this,t,n)||this;var r,i=n&&!n.isMounting?t.enter:t.appear;return o.appearStatus=null,t.in?i?(r=pM,o.appearStatus=fM):r=mM:r=t.unmountOnExit||t.mountOnEnter?uM:pM,o.state={status:r},o.nextCallback=null,o}aC(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===uM?{status:pM}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==fM&&n!==mM&&(t=fM):(n===fM||n===mM)&&(t=gM)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,o=this.props.timeout;return e=t=n=o,null!=o&&"number"!=typeof o&&(e=o.exit,t=o.enter,n=void 0!==o.appear?o.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===fM){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:qf.findDOMNode(this);n&&dM(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pM&&this.setState({status:uM})},n.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,r=this.props.nodeRef?[o]:[qf.findDOMNode(this),o],i=r[0],a=r[1],s=this.getTimeouts(),l=o?s.appear:s.enter;!e&&!n||cM?this.safeSetState({status:mM},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:fM},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:mM},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:qf.findDOMNode(this);t&&!cM?(this.props.onExit(o),this.safeSetState({status:gM},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:pM},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:pM},(function(){e.props.onExited(o)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:qf.findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=r[0],a=r[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===uM)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var o=Go(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return yo.createElement(sC.Provider,{value:null},"function"==typeof n?n(e,o):yo.cloneElement(yo.Children.only(n),o))},t}(yo.Component);function bM(){}function vM(e){var t;return parseInt(yo.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}hM.contextType=sC,hM.propTypes={},hM.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:bM,onEntering:bM,onEntered:bM,onExit:bM,onExiting:bM,onExited:bM},hM.UNMOUNTED=uM,hM.EXITED=pM,hM.ENTERING=fM,hM.ENTERED=mM,hM.EXITING=gM;const yM=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function xM(e){return`scale(${e}, ${e**2})`}const SM={entering:{opacity:1,transform:xM(1)},entered:{opacity:1,transform:"none"}},wM=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),_M=yo.forwardRef((function(e,t){const{addEndListener:n,appear:o=!0,children:r,easing:i,in:a,onEnter:s,onEntered:l,onEntering:c,onExit:d,onExited:u,onExiting:p,style:f,timeout:m="auto",TransitionComponent:g=hM}=e,h=Go(e,yM),b=iC(),v=yo.useRef(),y=BI(),x=yo.useRef(null),S=OC(x,vM(r),t),w=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},_=w(c),E=w(((e,t)=>{sM(e);const{duration:n,delay:o,easing:r}=lM({style:f,timeout:m,easing:i},{mode:"enter"});let a;"auto"===m?(a=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[y.transitions.create("opacity",{duration:a,delay:o}),y.transitions.create("transform",{duration:wM?a:.666*a,delay:o,easing:r})].join(","),s&&s(e,t)})),T=w(l),I=w(p),C=w((e=>{const{duration:t,delay:n,easing:o}=lM({style:f,timeout:m,easing:i},{mode:"exit"});let r;"auto"===m?(r=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=r):r=t,e.style.transition=[y.transitions.create("opacity",{duration:r,delay:n}),y.transitions.create("transform",{duration:wM?r:.666*r,delay:wM?n:n||.333*r,easing:o})].join(","),e.style.opacity=0,e.style.transform=xM(.75),d&&d(e)})),M=w(u);return(0,Eo.jsx)(g,Yo({appear:o,in:a,nodeRef:x,onEnter:E,onEntered:T,onEntering:_,onExit:C,onExited:M,onExiting:I,addEndListener:e=>{"auto"===m&&b.start(v.current||0,e),n&&n(x.current,e)},timeout:"auto"===m?null:m},h,{children:(e,t)=>yo.cloneElement(r,Yo({style:Yo({opacity:0,transform:xM(.75),visibility:"exited"!==e||a?void 0:"hidden"},SM[e],f,r.props.style),ref:S},t))}))}));function EM(e){return bI("MuiButton",e)}_M.muiSupportAuto=!0;const TM=vI("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),IM=yo.createContext({}),CM=yo.createContext(void 0),MM=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],OM=e=>Yo({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),DM=fI(BC,{shouldForwardProp:e=>pI(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ai(n.color)}`],t[`size${Ai(n.size)}`],t[`${n.variant}Size${Ai(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})((({theme:e,ownerState:t})=>{var n,o;const r="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],i="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return Yo({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Yo({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:rr(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Yo({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${TM.focusVisible}`]:Yo({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${TM.disabled}`]:Yo({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${rr(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(n=(o=e.palette).getContrastText)?void 0:n.call(o,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:r,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})}),(({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${TM.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${TM.disabled}`]:{boxShadow:"none"}})),kM=fI("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${Ai(n.size)}`]]}})((({ownerState:e})=>Yo({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},OM(e)))),jM=fI("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${Ai(n.size)}`]]}})((({ownerState:e})=>Yo({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},OM(e)))),AM=yo.forwardRef((function(e,t){const n=yo.useContext(IM),o=yo.useContext(CM),r=wI({props:Aa(n,e),name:"MuiButton"}),{children:i,color:a="primary",component:s="button",className:l,disabled:c=!1,disableElevation:d=!1,disableFocusRipple:u=!1,endIcon:p,focusVisibleClassName:f,fullWidth:m=!1,size:g="medium",startIcon:h,type:b,variant:v="text"}=r,y=Go(r,MM),x=Yo({},r,{color:a,component:s,disabled:c,disableElevation:d,disableFocusRipple:u,fullWidth:m,size:g,type:b,variant:v}),S=(e=>{const{color:t,disableElevation:n,fullWidth:o,size:r,variant:i,classes:a}=e;return Yo({},a,_I({root:["root",i,`${i}${Ai(t)}`,`size${Ai(r)}`,`${i}Size${Ai(r)}`,`color${Ai(t)}`,n&&"disableElevation",o&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Ai(r)}`],endIcon:["icon","endIcon",`iconSize${Ai(r)}`]},EM,a))})(x),w=h&&(0,Eo.jsx)(kM,{className:S.startIcon,ownerState:x,children:h}),_=p&&(0,Eo.jsx)(jM,{className:S.endIcon,ownerState:x,children:p}),E=o||"";return(0,Eo.jsxs)(DM,Yo({ownerState:x,className:cT(n.className,S.root,l,E),component:s,disabled:c,focusRipple:!u,focusVisibleClassName:cT(S.focusVisible,f),ref:t,type:b},y,{classes:S,children:[w,i,_]}))}));function PM(e){return bI("MuiDialogActions",e)}vI("MuiDialogActions",["root","spacing"]);const NM=["className","disableSpacing"],RM=fI("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((({ownerState:e})=>Yo({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}}))),LM=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialogActions"}),{className:o,disableSpacing:r=!1}=n,i=Go(n,NM),a=Yo({},n,{disableSpacing:r}),s=(e=>{const{classes:t,disableSpacing:n}=e;return _I({root:["root",!n&&"spacing"]},PM,t)})(a);return(0,Eo.jsx)(RM,Yo({className:cT(s.root,o),ownerState:a,ref:t},i))})),FM=["onAccept","onClear","onCancel","onSetToday","actions"],UM=e=>{const{onAccept:t,onClear:n,onCancel:o,onSetToday:r,actions:i}=e,a=Go(e,FM),s=yo.useContext(nM),l=ZE(),c="function"==typeof i?i(s):i;if(null==c||0===c.length)return null;const d=null==c?void 0:c.map((e=>{switch(e){case"clear":return(0,Eo.jsx)(AM,{onClick:n,children:l.clearButtonLabel},e);case"cancel":return(0,Eo.jsx)(AM,{onClick:o,children:l.cancelButtonLabel},e);case"accept":return(0,Eo.jsx)(AM,{onClick:t,children:l.okButtonLabel},e);case"today":return(0,Eo.jsx)(AM,{onClick:r,children:l.todayButtonLabel},e);default:return null}}));return(0,Eo.jsx)(LM,Yo({},a,{children:d}))};function VM(e){return e&&e.ownerDocument||document}const $M=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function BM(e){const t=[],n=[];return Array.from(e.querySelectorAll($M)).forEach(((e,o)=>{const r=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1===r||!function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)||(0===r?t.push(e):n.push({documentOrder:o,tabIndex:r,node:e}))})),n.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function KM(){return!0}function zM(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:o=!1,disableRestoreFocus:r=!1,getTabbable:i=BM,isEnabled:a=KM,open:s}=e,l=yo.useRef(!1),c=yo.useRef(null),d=yo.useRef(null),u=yo.useRef(null),p=yo.useRef(null),f=yo.useRef(!1),m=yo.useRef(null),g=OC(vM(t),m),h=yo.useRef(null);yo.useEffect((()=>{!s||!m.current||(f.current=!n)}),[n,s]),yo.useEffect((()=>{if(!s||!m.current)return;const e=VM(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),f.current&&m.current.focus()),()=>{r||(u.current&&u.current.focus&&(l.current=!0,u.current.focus()),u.current=null)}}),[s]),yo.useEffect((()=>{if(!s||!m.current)return;const e=VM(m.current),t=t=>{h.current=t,!o&&a()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(l.current=!0,d.current&&d.current.focus())},n=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current)return void(l.current=!1);if(t.contains(e.activeElement)||o&&e.activeElement!==c.current&&e.activeElement!==d.current)return;if(e.activeElement!==p.current)p.current=null;else if(null!==p.current)return;if(!f.current)return;let n=[];if((e.activeElement===c.current||e.activeElement===d.current)&&(n=i(m.current)),n.length>0){var r,s;const e=!(null==(r=h.current)||!r.shiftKey||"Tab"!==(null==(s=h.current)?void 0:s.key)),t=n[0],o=n[n.length-1];"string"!=typeof t&&"string"!=typeof o&&(e?o.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const r=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()}),50);return()=>{clearInterval(r),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}}),[n,o,r,a,s,i]);const b=e=>{null===u.current&&(u.current=e.relatedTarget),f.current=!0};return(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:c,"data-testid":"sentinelStart"}),yo.cloneElement(t,{ref:g,onFocus:e=>{null===u.current&&(u.current=e.relatedTarget),f.current=!0,p.current=e.target;const n=t.props.onFocus;n&&n(e)}}),(0,Eo.jsx)("div",{tabIndex:s?0:-1,onFocus:b,ref:d,"data-testid":"sentinelEnd"})]})}var HM={};Object.defineProperty(HM,"__esModule",{value:!0});var YM=HM.default=void 0,GM=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=qM(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}(yo),WM=OT;function qM(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(qM=function(e){return e?n:t})(e)}function JM(e){return bI("MuiPopper",e)}YM=HM.default=function(e=null){const t=GM.useContext(WM.ThemeContext);return!t||function(e){return 0===Object.keys(e).length}(t)?e:t},vI("MuiPopper",["root"]);const XM=yo.forwardRef((function(e,t){const{children:n,container:o,disablePortal:r=!1}=e,[i,a]=yo.useState(null),s=OC(yo.isValidElement(n)?vM(n):null,t);if(zE((()=>{r||a(function(e){return"function"==typeof e?e():e}(o)||document.body)}),[o,r]),zE((()=>{if(i&&!r)return MC(t,i),()=>{MC(t,null)}}),[t,i,r]),r){if(yo.isValidElement(n)){const e={ref:s};return yo.cloneElement(n,e)}return(0,Eo.jsx)(yo.Fragment,{children:n})}return(0,Eo.jsx)(yo.Fragment,{children:i&&qf.createPortal(n,i)})}));function ZM(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function QM(e){return e instanceof ZM(e).Element||e instanceof Element}function eO(e){return e instanceof ZM(e).HTMLElement||e instanceof HTMLElement}function tO(e){return!(typeof ShadowRoot>"u")&&(e instanceof ZM(e).ShadowRoot||e instanceof ShadowRoot)}var nO=Math.max,oO=Math.min,rO=Math.round;function iO(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function aO(){return!/^((?!chrome|android).)*safari/i.test(iO())}function sO(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&eO(e)&&(r=e.offsetWidth>0&&rO(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&rO(o.height)/e.offsetHeight||1);var a=(QM(e)?ZM(e):window).visualViewport,s=!aO()&&n,l=(o.left+(s&&a?a.offsetLeft:0))/r,c=(o.top+(s&&a?a.offsetTop:0))/i,d=o.width/r,u=o.height/i;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function lO(e){var t=ZM(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function cO(e){return e?(e.nodeName||"").toLowerCase():null}function dO(e){return((QM(e)?e.ownerDocument:e.document)||window.document).documentElement}function uO(e){return sO(dO(e)).left+lO(e).scrollLeft}function pO(e){return ZM(e).getComputedStyle(e)}function fO(e){var t=pO(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function mO(e,t,n){void 0===n&&(n=!1);var o=eO(t),r=eO(t)&&function(e){var t=e.getBoundingClientRect(),n=rO(t.width)/e.offsetWidth||1,o=rO(t.height)/e.offsetHeight||1;return 1!==n||1!==o}(t),i=dO(t),a=sO(e,r,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!n)&&(("body"!==cO(t)||fO(i))&&(s=function(e){return e!==ZM(e)&&eO(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):lO(e)}(t)),eO(t)?((l=sO(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=uO(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function gO(e){var t=sO(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function hO(e){return"html"===cO(e)?e:e.assignedSlot||e.parentNode||(tO(e)?e.host:null)||dO(e)}function bO(e){return["html","body","#document"].indexOf(cO(e))>=0?e.ownerDocument.body:eO(e)&&fO(e)?e:bO(hO(e))}function vO(e,t){var n;void 0===t&&(t=[]);var o=bO(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=ZM(o),a=r?[i].concat(i.visualViewport||[],fO(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(vO(hO(a)))}function yO(e){return["table","td","th"].indexOf(cO(e))>=0}function xO(e){return eO(e)&&"fixed"!==pO(e).position?e.offsetParent:null}function SO(e){for(var t=ZM(e),n=xO(e);n&&yO(n)&&"static"===pO(n).position;)n=xO(n);return n&&("html"===cO(n)||"body"===cO(n)&&"static"===pO(n).position)?t:n||function(e){var t=/firefox/i.test(iO());if(/Trident/i.test(iO())&&eO(e)&&"fixed"===pO(e).position)return null;var n=hO(e);for(tO(n)&&(n=n.host);eO(n)&&["html","body"].indexOf(cO(n))<0;){var o=pO(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||t}var wO="top",_O="bottom",EO="right",TO="left",IO="auto",CO=[wO,_O,EO,TO],MO="start",OO="end",DO="viewport",kO="popper",jO=CO.reduce((function(e,t){return e.concat([t+"-"+MO,t+"-"+OO])}),[]),AO=[].concat(CO,[IO]).reduce((function(e,t){return e.concat([t,t+"-"+MO,t+"-"+OO])}),[]),PO=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function NO(e){var t=new Map,n=new Set,o=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var o=t.get(e);o&&r(o)}})),o.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),o}function RO(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var LO={placement:"bottom",modifiers:[],strategy:"absolute"};function FO(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function UO(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,o=void 0===n?[]:n,r=t.defaultOptions,i=void 0===r?LO:r;return function(e,t,n){void 0===n&&(n=i);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},LO,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:r,setOptions:function(n){var s="function"==typeof n?n(r.options):n;c(),r.options=Object.assign({},i,r.options,s),r.scrollParents={reference:QM(e)?vO(e):e.contextElement?vO(e.contextElement):[],popper:vO(t)};var d=function(e){var t=NO(e);return PO.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(o,r.options.modifiers)));return r.orderedModifiers=d.filter((function(e){return e.enabled})),r.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,o=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var s=i({state:r,name:t,instance:l,options:o}),c=function(){};a.push(s||c)}})),l.update()},forceUpdate:function(){if(!s){var e=r.elements,t=e.reference,n=e.popper;if(FO(t,n)){r.rects={reference:mO(t,SO(n),"fixed"===r.options.strategy),popper:gO(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach((function(e){return r.modifiersData[e.name]=Object.assign({},e.data)}));for(var o=0;o<r.orderedModifiers.length;o++)if(!0!==r.reset){var i=r.orderedModifiers[o],a=i.fn,c=i.options,d=void 0===c?{}:c,u=i.name;"function"==typeof a&&(r=a({state:r,options:d,name:u,instance:l})||r)}else r.reset=!1,o=-1}}},update:RO((function(){return new Promise((function(e){l.forceUpdate(),e(r)}))})),destroy:function(){c(),s=!0}};if(!FO(e,t))return l;function c(){a.forEach((function(e){return e()})),a=[]}return l.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}var VO={passive:!0};const $O={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=void 0===r||r,a=o.resize,s=void 0===a||a,l=ZM(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,VO)})),s&&l.addEventListener("resize",n.update,VO),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,VO)})),s&&l.removeEventListener("resize",n.update,VO)}},data:{}};function BO(e){return e.split("-")[0]}function KO(e){return e.split("-")[1]}function zO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function HO(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?BO(r):null,a=r?KO(r):null,s=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2;switch(i){case wO:t={x:s,y:n.y-o.height};break;case _O:t={x:s,y:n.y+n.height};break;case EO:t={x:n.x+n.width,y:l};break;case TO:t={x:n.x-o.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?zO(i):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case MO:t[c]=t[c]-(n[d]/2-o[d]/2);break;case OO:t[c]=t[c]+(n[d]/2-o[d]/2)}}return t}const YO={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=HO({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var GO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WO(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,p=a.x,f=void 0===p?0:p,m=a.y,g=void 0===m?0:m,h="function"==typeof d?d({x:f,y:g}):{x:f,y:g};f=h.x,g=h.y;var b=a.hasOwnProperty("x"),v=a.hasOwnProperty("y"),y=TO,x=wO,S=window;if(c){var w=SO(n),_="clientHeight",E="clientWidth";if(w===ZM(n)&&("static"!==pO(w=dO(n)).position&&"absolute"===s&&(_="scrollHeight",E="scrollWidth")),r===wO||(r===TO||r===EO)&&i===OO)x=_O,g-=(u&&w===S&&S.visualViewport?S.visualViewport.height:w[_])-o.height,g*=l?1:-1;if(r===TO||(r===wO||r===_O)&&i===OO)y=EO,f-=(u&&w===S&&S.visualViewport?S.visualViewport.width:w[E])-o.width,f*=l?1:-1}var T,I=Object.assign({position:s},c&&GO),C=!0===d?function(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:rO(n*r)/r||0,y:rO(o*r)/r||0}}({x:f,y:g},ZM(n)):{x:f,y:g};return f=C.x,g=C.y,l?Object.assign({},I,((T={})[x]=v?"0":"",T[y]=b?"0":"",T.transform=(S.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",T)):Object.assign({},I,((t={})[x]=v?g+"px":"",t[y]=b?f+"px":"",t.transform="",t))}const qO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:BO(t.placement),variation:KO(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,WO(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,WO(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};const JO={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!eO(r)||!cO(r)||(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});!eO(o)||!cO(o)||(Object.assign(o.style,i),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};const XO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=void 0===r?[0,0]:r,a=AO.reduce((function(e,n){return e[n]=function(e,t,n){var o=BO(e),r=[TO,wO].indexOf(o)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[TO,EO].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=a}};var ZO={left:"right",right:"left",bottom:"top",top:"bottom"};function QO(e){return e.replace(/left|right|bottom|top/g,(function(e){return ZO[e]}))}var eD={start:"end",end:"start"};function tD(e){return e.replace(/start|end/g,(function(e){return eD[e]}))}function nD(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tO(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function oD(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rD(e,t,n){return t===DO?oD(function(e,t){var n=ZM(e),o=dO(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;var c=aO();(c||!c&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s+uO(e),y:l}}(e,n)):QM(t)?function(e,t){var n=sO(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):oD(function(e){var t,n=dO(e),o=lO(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=nO(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=nO(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+uO(e),l=-o.scrollTop;return"rtl"===pO(r||n).direction&&(s+=nO(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(dO(e)))}function iD(e,t,n,o){var r="clippingParents"===t?function(e){var t=vO(hO(e)),n=["absolute","fixed"].indexOf(pO(e).position)>=0&&eO(e)?SO(e):e;return QM(n)?t.filter((function(e){return QM(e)&&nD(e,n)&&"body"!==cO(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce((function(t,n){var r=rD(e,n,o);return t.top=nO(r.top,t.top),t.right=oO(r.right,t.right),t.bottom=oO(r.bottom,t.bottom),t.left=nO(r.left,t.left),t}),rD(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function aD(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function sD(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function lD(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=void 0===o?e.placement:o,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,d=void 0===c?DO:c,u=n.elementContext,p=void 0===u?kO:u,f=n.altBoundary,m=void 0!==f&&f,g=n.padding,h=void 0===g?0:g,b=aD("number"!=typeof h?h:sD(h,CO)),v=p===kO?"reference":kO,y=e.rects.popper,x=e.elements[m?v:p],S=iD(QM(x)?x:x.contextElement||dO(e.elements.popper),l,d,a),w=sO(e.elements.reference),_=HO({reference:w,element:y,placement:r}),E=oD(Object.assign({},y,_)),T=p===kO?E:w,I={top:S.top-T.top+b.top,bottom:T.bottom-S.bottom+b.bottom,left:S.left-T.left+b.left,right:T.right-S.right+b.right},C=e.modifiersData.offset;if(p===kO&&C){var M=C[r];Object.keys(I).forEach((function(e){var t=[EO,_O].indexOf(e)>=0?1:-1,n=[wO,_O].indexOf(e)>=0?"y":"x";I[e]+=M[n]*t}))}return I}const cD={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,m=void 0===f||f,g=n.allowedAutoPlacements,h=t.options.placement,b=BO(h),v=l||(b===h||!m?[QO(h)]:function(e){if(BO(e)===IO)return[];var t=QO(e);return[tD(e),t,tD(t)]}(h)),y=[h].concat(v).reduce((function(e,n){return e.concat(BO(n)===IO?function(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?AO:l,d=KO(o),u=d?s?jO:jO.filter((function(e){return KO(e)===d})):CO,p=u.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=u);var f=p.reduce((function(t,n){return t[n]=lD(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[BO(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:d,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:g}):n)}),[]),x=t.rects.reference,S=t.rects.popper,w=new Map,_=!0,E=y[0],T=0;T<y.length;T++){var I=y[T],C=BO(I),M=KO(I)===MO,O=[wO,_O].indexOf(C)>=0,D=O?"width":"height",k=lD(t,{placement:I,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),j=O?M?EO:TO:M?_O:wO;x[D]>S[D]&&(j=QO(j));var A=QO(j),P=[];if(i&&P.push(k[C]<=0),s&&P.push(k[j]<=0,k[A]<=0),P.every((function(e){return e}))){E=I,_=!1;break}w.set(I,P)}if(_)for(var N=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},R=m?3:1;R>0;R--){if("break"===N(R))break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dD(e,t,n){return nO(e,oO(t,n))}const uD={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,p=n.tether,f=void 0===p||p,m=n.tetherOffset,g=void 0===m?0:m,h=lD(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),b=BO(t.placement),v=KO(t.placement),y=!v,x=zO(b),S=function(e){return"x"===e?"y":"x"}(x),w=t.modifiersData.popperOffsets,_=t.rects.reference,E=t.rects.popper,T="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,I="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(w){if(i){var O,D="y"===x?wO:TO,k="y"===x?_O:EO,j="y"===x?"height":"width",A=w[x],P=A+h[D],N=A-h[k],R=f?-E[j]/2:0,L=v===MO?_[j]:E[j],F=v===MO?-E[j]:-_[j],U=t.elements.arrow,V=f&&U?gO(U):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=$[D],K=$[k],z=dD(0,_[j],V[j]),H=y?_[j]/2-R-z-B-I.mainAxis:L-z-B-I.mainAxis,Y=y?-_[j]/2+R+z+K+I.mainAxis:F+z+K+I.mainAxis,G=t.elements.arrow&&SO(t.elements.arrow),W=G?"y"===x?G.clientTop||0:G.clientLeft||0:0,q=null!=(O=null==C?void 0:C[x])?O:0,J=A+Y-q,X=dD(f?oO(P,A+H-q-W):P,A,f?nO(N,J):N);w[x]=X,M[x]=X-A}if(s){var Z,Q="x"===x?wO:TO,ee="x"===x?_O:EO,te=w[S],ne="y"===S?"height":"width",oe=te+h[Q],re=te-h[ee],ie=-1!==[wO,TO].indexOf(b),ae=null!=(Z=null==C?void 0:C[S])?Z:0,se=ie?oe:te-_[ne]-E[ne]-ae+I.altAxis,le=ie?te+_[ne]+E[ne]-ae-I.altAxis:re,ce=f&&ie?function(e,t,n){var o=dD(e,t,n);return o>n?n:o}(se,te,le):dD(f?se:oe,te,f?le:re);w[S]=ce,M[S]=ce-te}t.modifiersData[o]=M}},requiresIfExists:["offset"]};const pD={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=BO(n.placement),l=zO(s),c=[TO,EO].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(e,t){return aD("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:sD(e,CO))}(r.padding,n),u=gO(i),p="y"===l?wO:TO,f="y"===l?_O:EO,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],h=SO(i),b=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,v=m/2-g/2,y=d[p],x=b-u[c]-d[f],S=b/2-u[c]/2+v,w=dD(y,S,x),_=l;n.modifiersData[o]=((t={})[_]=w,t.centerOffset=w-S,t)}},effect:function(e){var t=e.state,n=e.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"==typeof o&&!(o=t.elements.popper.querySelector(o))||nD(t.elements.popper,o)&&(t.elements.arrow=o))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fD(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function mD(e){return[wO,EO,_O,TO].some((function(t){return e[t]>=0}))}const gD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=lD(t,{elementContext:"reference"}),s=lD(t,{altBoundary:!0}),l=fD(a,o),c=fD(s,r,i),d=mD(l),u=mD(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var hD=UO({defaultModifiers:[$O,YO,qO,JO,XO,cD,uD,pD,gD]});function bD(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}function vD(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}const yD=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function xD(e){var t;const{elementType:n,externalSlotProps:o,ownerState:r,skipResolvingSlotProps:i=!1}=e,a=Go(e,yD),s=i?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(o,r),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:o,externalForwardedProps:r,className:i}=e;if(!t){const e=cT(null==n?void 0:n.className,i,null==r?void 0:r.className,null==o?void 0:o.className),t=Yo({},null==n?void 0:n.style,null==r?void 0:r.style,null==o?void 0:o.style),a=Yo({},n,r,o);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=bD(Yo({},r,o)),s=vD(o),l=vD(r),c=t(a),d=cT(null==c?void 0:c.className,null==n?void 0:n.className,i,null==r?void 0:r.className,null==o?void 0:o.className),u=Yo({},null==c?void 0:c.style,null==n?void 0:n.style,null==r?void 0:r.style,null==o?void 0:o.style),p=Yo({},c,n,l,s);return d.length>0&&(p.className=d),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:c.ref}}(Yo({},a,{externalSlotProps:s}));return function(e,t,n){return void 0===e||function(e){return"string"==typeof e}(e)?t:Yo({},t,{ownerState:Yo({},t.ownerState,n)})}(n,Yo({},l,{ref:OC(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),r)}const SD=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],wD=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function _D(e){return"function"==typeof e?e():e}function ED(e){return void 0!==e.nodeType}const TD={},ID=yo.forwardRef((function(e,t){var n;const{anchorEl:o,children:r,direction:i,disablePortal:a,modifiers:s,open:l,placement:c,popperOptions:d,popperRef:u,slotProps:p={},slots:f={},TransitionProps:m}=e,g=Go(e,SD),h=yo.useRef(null),b=OC(h,t),v=yo.useRef(null),y=OC(v,u),x=yo.useRef(y);zE((()=>{x.current=y}),[y]),yo.useImperativeHandle(u,(()=>v.current),[]);const S=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(c,i),[w,_]=yo.useState(S),[E,T]=yo.useState(_D(o));yo.useEffect((()=>{v.current&&v.current.forceUpdate()})),yo.useEffect((()=>{o&&T(_D(o))}),[o]),zE((()=>{if(!E||!l)return;let e=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:e})=>{(e=>{_(e.placement)})(e)}}];null!=s&&(e=e.concat(s)),d&&null!=d.modifiers&&(e=e.concat(d.modifiers));const t=hD(E,h.current,Yo({placement:S},d,{modifiers:e}));return x.current(t),()=>{t.destroy(),x.current(null)}}),[E,a,s,l,d,S]);const I={placement:w};null!==m&&(I.TransitionProps=m);const C=(e=>{const{classes:t}=e;return _I({root:["root"]},JM,t)})(e),M=null!=(n=f.root)?n:"div",O=xD({elementType:M,externalSlotProps:p.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:b},ownerState:e,className:C.root});return(0,Eo.jsx)(M,Yo({},O,{children:"function"==typeof r?r(I):r}))})),CD=yo.forwardRef((function(e,t){const{anchorEl:n,children:o,container:r,direction:i="ltr",disablePortal:a=!1,keepMounted:s=!1,modifiers:l,open:c,placement:d="bottom",popperOptions:u=TD,popperRef:p,style:f,transition:m=!1,slotProps:g={},slots:h={}}=e,b=Go(e,wD),[v,y]=yo.useState(!0);if(!s&&!c&&(!m||v))return null;let x;if(r)x=r;else if(n){const e=_D(n);x=e&&ED(e)?VM(e).body:VM(null).body}const S=c||!s||m&&!v?void 0:"none",w=m?{in:c,onEnter:()=>{y(!1)},onExited:()=>{y(!0)}}:void 0;return(0,Eo.jsx)(XM,{disablePortal:a,container:x,children:(0,Eo.jsx)(ID,Yo({anchorEl:n,direction:i,disablePortal:a,modifiers:l,ref:t,open:m?!v:c,placement:d,popperOptions:u,popperRef:p,slotProps:g,slots:h},b,{style:Yo({position:"fixed",top:0,left:0,display:S},f),TransitionProps:w,children:o}))})})),MD=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],OD=fI(CD,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),DD=yo.forwardRef((function(e,t){var n;const o=YM(),r=wI({props:e,name:"MuiPopper"}),{anchorEl:i,component:a,components:s,componentsProps:l,container:c,disablePortal:d,keepMounted:u,modifiers:p,open:f,placement:m,popperOptions:g,popperRef:h,transition:b,slots:v,slotProps:y}=r,x=Go(r,MD),S=null!=(n=null==v?void 0:v.root)?n:null==s?void 0:s.Root,w=Yo({anchorEl:i,container:c,disablePortal:d,keepMounted:u,modifiers:p,open:f,placement:m,popperOptions:g,popperRef:h,transition:b},x);return(0,Eo.jsx)(OD,Yo({as:a,direction:null==o?void 0:o.direction,slots:{root:S},slotProps:y??l},w,{ref:t}))})),kD=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function jD(e){return bI("MuiPaper",e)}vI("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const AD=["className","component","elevation","square","variant"],PD=fI("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})((({theme:e,ownerState:t})=>{var n;return Yo({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.divider}`},"elevation"===t.variant&&Yo({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${rr("#fff",kD(t.elevation))}, ${rr("#fff",kD(t.elevation))})`},e.vars&&{backgroundImage:null==(n=e.vars.overlays)?void 0:n[t.elevation]}))})),ND=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiPaper"}),{className:o,component:r="div",elevation:i=1,square:a=!1,variant:s="elevation"}=n,l=Go(n,AD),c=Yo({},n,{component:r,elevation:i,square:a,variant:s}),d=(e=>{const{square:t,elevation:n,variant:o,classes:r}=e;return _I({root:["root",o,!t&&"rounded","elevation"===o&&`elevation${n}`]},jD,r)})(c);return(0,Eo.jsx)(PD,Yo({as:r,ownerState:c,className:cT(d.root,o),ref:t},l))})),RD=["onClick","onTouchStart"],LD=fI(DD,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e})=>({zIndex:e.zIndex.modal}))),FD=fI(ND,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})((({ownerState:e})=>Yo({transformOrigin:"top center",outline:0},"top"===e.placement&&{transformOrigin:"bottom center"})));function UD(e){var t;const n=fl({props:e,name:"MuiPickersPopper"}),{anchorEl:o,children:r,containerRef:i=null,onBlur:a,onClose:s,onClear:l,onAccept:c,onCancel:d,onSetToday:u,open:p,PopperProps:f,role:m,TransitionComponent:g=_M,TrapFocusProps:h,PaperProps:b={},components:v,componentsProps:y}=n;yo.useEffect((()=>{function e(e){p&&("Escape"===e.key||"Esc"===e.key)&&s()}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[s,p]);const x=yo.useRef(null);yo.useEffect((()=>{"tooltip"!==m&&(p?x.current=aM(document):x.current&&x.current instanceof HTMLElement&&setTimeout((()=>{x.current instanceof HTMLElement&&x.current.focus()})))}),[p,m]);const[S,w,_]=function(e,t){const n=yo.useRef(!1),o=yo.useRef(!1),r=yo.useRef(null),i=yo.useRef(!1);yo.useEffect((()=>{if(e)return document.addEventListener("mousedown",t,!0),document.addEventListener("touchstart",t,!0),()=>{document.removeEventListener("mousedown",t,!0),document.removeEventListener("touchstart",t,!0),i.current=!1};function t(){i.current=!0}}),[e]);const a=UC((e=>{if(!i.current)return;const a=o.current;o.current=!1;const s=VM(r.current);if(!r.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,s))return;if(n.current)return void(n.current=!1);let l;l=e.composedPath?e.composedPath().indexOf(r.current)>-1:!s.documentElement.contains(e.target)||r.current.contains(e.target),!l&&!a&&t(e)})),s=()=>{o.current=!0};return yo.useEffect((()=>{if(e){const e=VM(r.current),t=()=>{n.current=!0};return e.addEventListener("touchstart",a),e.addEventListener("touchmove",t),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",t)}}}),[e,a]),yo.useEffect((()=>{if(e){const e=VM(r.current);return e.addEventListener("click",a),()=>{e.removeEventListener("click",a),o.current=!1}}}),[e,a]),[r,s,s]}(p,a??s),E=OC(yo.useRef(null),i),T=OC(E,S),I=n,C=(e=>{const{classes:t}=e;return _I({root:["root"],paper:["paper"]},oM,t)})(I),{onClick:M,onTouchStart:O}=b,D=Go(b,RD),k=null!=(t=null==v?void 0:v.ActionBar)?t:UM,j=(null==v?void 0:v.PaperContent)||yo.Fragment;return(0,Eo.jsx)(LD,Yo({transition:!0,role:m,open:p,anchorEl:o,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),s())},className:C.root},f,{children:({TransitionProps:e,placement:t})=>(0,Eo.jsx)(zM,Yo({open:p,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:"tooltip"===m,isEnabled:()=>!0},h,{children:(0,Eo.jsx)(g,Yo({},e,{children:(0,Eo.jsx)(FD,Yo({tabIndex:-1,elevation:8,ref:T,onClick:e=>{w(e),M&&M(e)},onTouchStart:e=>{_(e),O&&O(e)},ownerState:Yo({},I,{placement:t}),className:C.paper},D,{children:(0,Eo.jsxs)(j,Yo({},null==y?void 0:y.paperContent,{children:[r,(0,Eo.jsx)(k,Yo({onAccept:c,onClear:l,onCancel:d,onSetToday:u,actions:[]},null==y?void 0:y.actionBar))]}))}))}))}))}))}function VD(e){const{children:t,DateInputProps:n,KeyboardDateInputComponent:o,onClear:r,onDismiss:i,onCancel:a,onAccept:s,onSetToday:l,open:c,PopperProps:d,PaperProps:u,TransitionComponent:p,components:f,componentsProps:m}=e,g=yo.useRef(null),h=OC(n.inputRef,g);return(0,Eo.jsxs)(nM.Provider,{value:"desktop",children:[(0,Eo.jsx)(o,Yo({},n,{inputRef:h})),(0,Eo.jsx)(UD,{role:"dialog",open:c,anchorEl:g.current,TransitionComponent:p,PopperProps:d,PaperProps:u,onClose:i,onCancel:a,onClear:r,onAccept:s,onSetToday:l,components:f,componentsProps:m,children:t})]})}const $D=({props:e,value:t,adapter:n})=>{const o=n.utils.date(),r=n.utils.date(t),i=tT(n.utils,e.minDate,n.defaultDates.minDate),a=tT(n.utils,e.maxDate,n.defaultDates.maxDate);if(null===r)return null;switch(!0){case!n.utils.isValid(t):return"invalidDate";case!(!e.shouldDisableDate||!e.shouldDisableDate(r)):return"shouldDisableDate";case!(!e.disableFuture||!n.utils.isAfterDay(r,o)):return"disableFuture";case!(!e.disablePast||!n.utils.isBeforeDay(r,o)):return"disablePast";case!(!i||!n.utils.isBeforeDay(r,i)):return"minDate";case!(!a||!n.utils.isAfterDay(r,a)):return"maxDate";default:return null}},BD=({shouldDisableDate:e,minDate:t,maxDate:n,disableFuture:o,disablePast:r})=>{const i=qE();return yo.useCallback((a=>null!==$D({adapter:i,value:a,props:{shouldDisableDate:e,minDate:t,maxDate:n,disableFuture:o,disablePast:r}})),[i,e,t,n,o,r])},KD=(e,t)=>e===t,zD=e=>function(e,t,n){const{value:o,onError:r}=e,i=qE(),a=yo.useRef(null),s=t({adapter:i,value:o,props:e});return yo.useEffect((()=>{r&&!n(s,a.current)&&r(s,o),a.current=s}),[n,r,a,s,o]),s}(e,$D,KD),HD=(e,t,n)=>{const o=e.date(t);return null===t?"":e.isValid(o)?e.formatByString(o,n):""},YD="_",GD="2019-11-21T22:30:00.000",WD="2019-01-01T09:00:00.000";function qD(e,t,n,o){if(!e)return!1;const r=o.formatByString(o.date(WD),t).replace(n,YD),i=o.formatByString(o.date(GD),t).replace(n,"_"),a=i===r&&e===i;return!a&&o.lib,a}const JD=({acceptRegex:e=/[\d]/gi,disabled:t,disableMaskedInput:n,ignoreInvalidInputs:o,inputFormat:r,inputProps:i,label:a,mask:s,onChange:l,rawValue:c,readOnly:d,rifmFormatter:u,TextFieldProps:p,validationError:f})=>{const m=JE(),g=m.getFormatHelperText(r),{shouldUseMaskedInput:h,maskToUse:b}=yo.useMemo((()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const t=function(e,t,n,o){if(e)return e;const r=o.formatByString(o.date(WD),t).replace(n,YD);return r===o.formatByString(o.date(GD),t).replace(n,"_")?r:""}(s,r,e,m);return{shouldUseMaskedInput:qD(t,r,e,m),maskToUse:t}}),[e,n,r,s,m]),v=yo.useMemo((()=>h&&b?((e,t)=>n=>{let o=0;return n.split("").map(((r,i)=>{if(t.lastIndex=0,o>e.length-1)return"";const a=e[o],s=e[o+1],l=t.test(r)?r:"",c=a===YD?l:a+l;return o+=c.length,i===n.length-1&&s&&s!==YD?c?c+s:"":c})).join("")})(b,e):e=>e),[e,b,h]),y=null===c?null:m.date(c),[x,S]=yo.useState(y),[w,_]=yo.useState(HD(m,c,r)),E=yo.useRef(),T=yo.useRef(m.locale),I=yo.useRef(r);yo.useEffect((()=>{const e=c!==E.current,t=m.locale!==T.current,n=r!==I.current;if(E.current=c,T.current=m.locale,I.current=r,!e&&!t&&!n)return;const o=null===c?null:m.date(c),i=null===c||m.isValid(o);let a=null===x&&null===o;if(null!==x&&null!==o){const e=m.isEqual(x,o);if(e)a=!0;else{const t=Math.abs(m.getDiff(x,o));a=0===t?e:t<1e3}}if(!t&&!n&&(!i||a))return;const s=HD(m,c,r);S(o),_(s)}),[m,c,r,x]);const C=e=>{const t=""===e||e===s?"":e;_(t);const n=null===t?null:m.parse(t,r);o&&!m.isValid(n)||(S(n),l(n,t||void 0))},M=(e=>{const[,t]=(0,yo.useReducer)((e=>e+1),0),n=(0,yo.useRef)(null),{replace:o,append:r}=e,i=o?o(e.format(e.value)):e.format(e.value),a=(0,yo.useRef)(!1);return(0,yo.useLayoutEffect)((()=>{if(null==n.current)return;let[a,s,l,c,d]=n.current;n.current=null;const u=c&&d,p=a.slice(s.selectionStart).search(e.accept||/\d/g),f=-1!==p?p:0,m=t=>(t.match(e.accept||/\d/g)||[]).join(""),g=m(a.substr(0,s.selectionStart)),h=e=>{let t=0,n=0;for(let o=0;o!==g.length;++o){let r=e.indexOf(g[o],t)+1,i=m(e).indexOf(g[o],n)+1;i-n>1&&(r=t,i=n),n=Math.max(i,n),t=Math.max(t,r)}return t};if(!0===e.mask&&l&&!d){let e=h(a);const t=m(a.substr(e))[0];e=a.indexOf(t,e),a=`${a.substr(0,e)}${a.substr(e+1)}`}let b=e.format(a);null!=r&&s.selectionStart===a.length&&!d&&(l?b=r(b):""===m(b.slice(-1))&&(b=b.slice(0,-1)));const v=o?o(b):b;return i===v?t():e.onChange(v),()=>{let t=h(b);if(null!=e.mask&&(l||c&&!u))for(;b[t]&&""===m(b[t]);)t+=1;s.selectionStart=s.selectionEnd=t+(u?1+f:0)}})),(0,yo.useEffect)((()=>{const e=e=>{"Delete"===e.code&&(a.current=!0)},t=e=>{"Delete"===e.code&&(a.current=!1)};return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),{value:null!=n.current?n.current[0]:i,onChange:o=>{const r=o.target.value;n.current=[r,o.target,r.length>i.length,a.current,i===e.format(r)],t()}}})({value:w,onChange:C,format:u||v});return Yo({label:a,disabled:t,error:f,inputProps:Yo({},h?M:{value:w,onChange:e=>{C(e.currentTarget.value)}},{disabled:t,placeholder:g,readOnly:d,type:h?"tel":"text"},i)},p)},XD=yo.createContext(void 0);function ZD(e){return bI("MuiInputAdornment",e)}const QD=vI("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var ek;const tk=["children","className","component","disablePointerEvents","disableTypography","position","variant"],nk=fI("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ai(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((({theme:e,ownerState:t})=>Yo({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},"filled"===t.variant&&{[`&.${QD.positionStart}&:not(.${QD.hiddenLabel})`]:{marginTop:16}},"start"===t.position&&{marginRight:8},"end"===t.position&&{marginLeft:8},!0===t.disablePointerEvents&&{pointerEvents:"none"}))),ok=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiInputAdornment"}),{children:o,className:r,component:i="div",disablePointerEvents:a=!1,disableTypography:s=!1,position:l,variant:c}=n,d=Go(n,tk),u=yo.useContext(XD)||{};let p=c;c&&u.variant,u&&!p&&(p=u.variant);const f=Yo({},n,{hiddenLabel:u.hiddenLabel,size:u.size,disablePointerEvents:a,position:l,variant:p}),m=(e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:o,position:r,size:i,variant:a}=e;return _I({root:["root",n&&"disablePointerEvents",r&&`position${Ai(r)}`,a,o&&"hiddenLabel",i&&`size${Ai(i)}`]},ZD,t)})(f);return(0,Eo.jsx)(XD.Provider,{value:null,children:(0,Eo.jsx)(nk,Yo({as:i,ownerState:f,className:cT(m.root,r),ref:t},d,{children:"string"!=typeof o||s?(0,Eo.jsxs)(yo.Fragment,{children:["start"===l?ek||(ek=(0,Eo.jsx)("span",{className:"notranslate",children:"​"})):null,o]}):(0,Eo.jsx)($I,{color:"text.secondary",children:o})}))})})),rk=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],ik=yo.forwardRef((function(e,t){const{className:n,components:o={},disableOpenPicker:r,getOpenDialogAriaText:i,InputAdornmentProps:a,InputProps:s,inputRef:l,openPicker:c,OpenPickerButtonProps:d,renderInput:u}=e,p=Go(e,rk),f=ZE(),m=i??f.openDatePickerDialogue,g=JE(),h=JD(p),b=(null==a?void 0:a.position)||"end",v=o.OpenPickerIcon||kI;return u(Yo({ref:t,inputRef:l,className:n},h,{InputProps:Yo({},s,{[`${b}Adornment`]:r?void 0:(0,Eo.jsx)(ok,Yo({position:b},a,{children:(0,Eo.jsx)(HC,Yo({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},d,{onClick:c,children:(0,Eo.jsx)(v,{})}))}))})}))})),ak=(e,t)=>{const{onAccept:n,onChange:o,value:r,closeOnSelect:i}=e,a=JE(),{isOpen:s,setIsOpen:l}=(({open:e,onOpen:t,onClose:n})=>{const o=yo.useRef("boolean"==typeof e).current,[r,i]=yo.useState(!1);yo.useEffect((()=>{if(o){if("boolean"!=typeof e)throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}}),[o,e]);const a=yo.useCallback((e=>{o||i(e),e&&t&&t(),!e&&n&&n()}),[o,t,n]);return{isOpen:r,setIsOpen:a}})(e),c=yo.useMemo((()=>t.parseInput(a,r)),[t,a,r]),[d,u]=yo.useState(c),[p,f]=yo.useState((()=>({committed:c,draft:c,resetFallback:c}))),m=yo.useCallback((e=>{f((t=>{switch(e.action){case"setAll":case"acceptAndClose":return{draft:e.value,committed:e.value,resetFallback:e.value};case"setCommitted":return Yo({},t,{draft:e.value,committed:e.value});case"setDraft":return Yo({},t,{draft:e.value});default:return t}})),(e.forceOnChangeCall||!e.skipOnChangeCall&&!t.areValuesEqual(a,p.committed,e.value))&&o(e.value),"acceptAndClose"===e.action&&(l(!1),n&&!t.areValuesEqual(a,p.resetFallback,e.value)&&n(e.value))}),[n,o,l,p,a,t]);yo.useEffect((()=>{a.isValid(c)&&u(c)}),[a,c]),yo.useEffect((()=>{s&&m({action:"setAll",value:c,skipOnChangeCall:!0})}),[s]),t.areValuesEqual(a,p.committed,c)||m({action:"setCommitted",value:c,skipOnChangeCall:!0});const g=yo.useMemo((()=>({open:s,onClear:()=>{m({value:t.emptyValue,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(a,r,t.emptyValue)})},onAccept:()=>{m({value:p.draft,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(a,r,c)})},onDismiss:()=>{m({value:p.committed,action:"acceptAndClose"})},onCancel:()=>{m({value:p.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{m({value:t.getTodayValue(a),action:"acceptAndClose"})}})),[m,s,a,p,t,r,c]),[h,b]=yo.useState(!1),v=yo.useMemo((()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:h,toggleMobileKeyboardView:()=>b(!h),onDateChange:(e,t,n="partial")=>{switch(n){case"shallow":return m({action:"setDraft",value:e,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:e});case"finish":return m(i??"desktop"===t?{value:e,action:"acceptAndClose"}:{value:e,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}})),[m,h,p.draft,i]),y=yo.useCallback(((e,n)=>{const r=t.valueReducer?t.valueReducer(a,d,e):e;o(r,n)}),[o,t,d,a]),x={pickerProps:v,inputProps:yo.useMemo((()=>({onChange:y,open:s,rawValue:r,openPicker:()=>l(!0)})),[y,s,r,l]),wrapperProps:g};return yo.useDebugValue(x,(()=>({MuiPickerState:{dateState:p,other:x}}))),x};function sk({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=yo.useRef(void 0!==e),[i,a]=yo.useState(t),s=r?e:i;const l=yo.useCallback((e=>{r||a(e)}),[]);return[s,l]}function lk({onChange:e,onViewChange:t,openTo:n,view:o,views:r}){var i,a;const[s,l]=sk({name:"Picker",state:"view",controlled:o,default:n&&rM(r,n)?n:r[0]}),c=null!=(i=r[r.indexOf(s)-1])?i:null,d=null!=(a=r[r.indexOf(s)+1])?a:null,u=yo.useCallback((e=>{l(e),t&&t(e)}),[l,t]),p=yo.useCallback((()=>{d&&u(d)}),[d,u]);return{handleChangeAndOpenNext:yo.useCallback(((t,n)=>{const o="finish"===n;e(t,o&&d?"partial":n),o&&p()}),[d,e,p]),nextView:d,previousView:c,openNext:p,openView:s,setOpenView:u}}const ck=36,dk=110,uk=110,pk=dk-dk,fk=0-uk,mk=(e,t,n)=>{const o=t-dk,r=n-uk;let i=(e=>e*(180/Math.PI))(Math.atan2(pk,fk)-Math.atan2(o,r));i=Math.round(i/e)*e,i%=360;const a=o**2+r**2;return{value:Math.floor(i/e)||0,distance:Math.sqrt(a)}};function gk(e){return bI("MuiClockPointer",e)}vI("MuiClockPointer",["root","thumb"]);const hk=["className","hasSelected","isInner","type","value"],bk=fI("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e,ownerState:t})=>Yo({width:2,backgroundColor:e.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},t.shouldAnimate&&{transition:e.transitions.create(["transform","height"])}))),vk=fI("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})((({theme:e,ownerState:t})=>Yo({width:4,height:4,backgroundColor:e.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${e.palette.primary.main}`,boxSizing:"content-box"},t.hasSelected&&{backgroundColor:e.palette.primary.main})));function yk(e){const t=fl({props:e,name:"MuiClockPointer"}),{className:n,isInner:o,type:r,value:i}=t,a=Go(t,hk),s=yo.useRef(r);yo.useEffect((()=>{s.current=r}),[r]);const l=Yo({},t,{shouldAnimate:s.current!==r}),c=(e=>{const{classes:t}=e;return _I({root:["root"],thumb:["thumb"]},gk,t)})(l);return(0,Eo.jsx)(bk,Yo({style:(()=>{let e=360/("hours"===r?12:60)*i;return"hours"===r&&i>12&&(e-=360),{height:Math.round(220*(o?.26:.4)),transform:`rotateZ(${e}deg)`}})(),className:sT(n,c.root),ownerState:l},a,{children:(0,Eo.jsx)(vk,{ownerState:l,className:c.thumb})}))}function xk(e){return bI("MuiClock",e)}vI("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const Sk=fI("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)}))),wk=fI("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),_k=fI("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),Ek=fI("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})((({ownerState:e})=>Yo({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},e.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}))),Tk=fI("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})((({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:e.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}))),Ik=fI(HC,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})((({theme:e,ownerState:t})=>Yo({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,left:8},"am"===t.meridiemMode&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}}))),Ck=fI(HC,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})((({theme:e,ownerState:t})=>Yo({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,right:8},"pm"===t.meridiemMode&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}})));function Mk(e){const t=fl({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:o,autoFocus:r,children:i,date:a,getClockLabelText:s,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:d,minutesStep:u=1,onChange:p,selectedId:f,type:m,value:g,disabled:h,readOnly:b,className:v}=t,y=t,x=JE(),S=yo.useContext(nM),w=yo.useRef(!1),_=(e=>{const{classes:t}=e;return _I({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},xk,t)})(y),E=c(g,m),T=!n&&"hours"===m&&(g<1||g>12),I=(e,t)=>{h||b||c(e,m)||p(e,t)},C=(e,t)=>{let{offsetX:o,offsetY:r}=e;if(void 0===o){const t=e.target.getBoundingClientRect();o=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}const i="seconds"===m||"minutes"===m?((e,t,n=1)=>{const o=6*n;let{value:r}=mk(o,e,t);return r=r*n%60,r})(o,r,u):((e,t,n)=>{const{value:o,distance:r}=mk(30,e,t);let i=o||12;return n?i%=12:r<74&&(i+=12,i%=24),i})(o,r,!!n);I(i,t)},M=yo.useMemo((()=>"hours"===m||g%5==0),[m,g]),O="minutes"===m?u:1,D=yo.useRef(null);zE((()=>{r&&D.current.focus()}),[r]);return(0,Eo.jsxs)(Sk,{className:sT(v,_.root),children:[(0,Eo.jsxs)(wk,{className:_.clock,children:[(0,Eo.jsx)(Ek,{onTouchMove:e=>{w.current=!0,C(e,"shallow")},onTouchEnd:e=>{w.current&&(C(e,"finish"),w.current=!1)},onMouseUp:e=>{w.current&&(w.current=!1),C(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&C(e.nativeEvent,"shallow")},ownerState:{disabled:h},className:_.squareMask}),!E&&(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)(Tk,{className:_.pin}),a&&(0,Eo.jsx)(yk,{type:m,value:g,isInner:T,hasSelected:M})]}),(0,Eo.jsx)(_k,{"aria-activedescendant":f,"aria-label":s(m,a,x),ref:D,role:"listbox",onKeyDown:e=>{if(!w.current)switch(e.key){case"Home":I(0,"partial"),e.preventDefault();break;case"End":I("minutes"===m?59:23,"partial"),e.preventDefault();break;case"ArrowUp":I(g+O,"partial"),e.preventDefault();break;case"ArrowDown":I(g-O,"partial"),e.preventDefault()}},tabIndex:0,className:_.wrapper,children:i})]}),n&&("desktop"===S||o)&&(0,Eo.jsxs)(yo.Fragment,{children:[(0,Eo.jsx)(Ik,{onClick:b?void 0:()=>l("am"),disabled:h||null===d,ownerState:y,className:_.amButton,children:(0,Eo.jsx)($I,{variant:"caption",children:"AM"})}),(0,Eo.jsx)(Ck,{disabled:h||null===d,onClick:b?void 0:()=>l("pm"),ownerState:y,className:_.pmButton,children:(0,Eo.jsx)($I,{variant:"caption",children:"PM"})})]})]})}function Ok(e){return bI("MuiClockNumber",e)}const Dk=vI("MuiClockNumber",["root","selected","disabled"]),kk=["className","disabled","index","inner","label","selected"],jk=fI("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Dk.disabled}`]:t.disabled},{[`&.${Dk.selected}`]:t.selected}]})((({theme:e,ownerState:t})=>Yo({height:ck,width:ck,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:e.palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:e.palette.background.paper},[`&.${Dk.selected}`]:{color:e.palette.primary.contrastText},[`&.${Dk.disabled}`]:{pointerEvents:"none",color:e.palette.text.disabled}},t.inner&&Yo({},e.typography.body2,{color:e.palette.text.secondary}))));function Ak(e){const t=fl({props:e,name:"MuiClockNumber"}),{className:n,disabled:o,index:r,inner:i,label:a,selected:s}=t,l=Go(t,kk),c=t,d=(e=>{const{classes:t,selected:n,disabled:o}=e;return _I({root:["root",n&&"selected",o&&"disabled"]},Ok,t)})(c),u=r%12/12*Math.PI*2-Math.PI/2,p=91*(i?.65:1),f=Math.round(Math.cos(u)*p),m=Math.round(Math.sin(u)*p);return(0,Eo.jsx)(jk,Yo({className:sT(n,d.root),"aria-disabled":!!o||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${f}px, ${m+92}px`},ownerState:c},l,{children:a}))}const Pk=({ampm:e,date:t,getClockNumberText:n,isDisabled:o,selectedId:r,utils:i})=>{const a=t?i.getHours(t):null,s=[],l=e?12:23,c=t=>null!==a&&(e?12===t?12===a||0===a:a===t||a-12===t:a===t);for(let t=e?1:0;t<=l;t+=1){let a=t.toString();0===t&&(a="00");const l=!e&&(0===t||t>12);a=i.formatNumber(a);const d=c(t);s.push((0,Eo.jsx)(Ak,{id:d?r:void 0,index:t,inner:l,selected:d,disabled:o(t),label:a,"aria-label":n(a)},t))}return s},Nk=({utils:e,value:t,isDisabled:n,getClockNumberText:o,selectedId:r})=>{const i=e.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map((([e,i],a)=>{const s=e===t;return(0,Eo.jsx)(Ak,{label:i,id:s?r:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":o(i)},e)}))};function Rk(e){return bI("MuiPickersArrowSwitcher",e)}vI("MuiPickersArrowSwitcher",["root","spacer","button"]);const Lk=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],Fk=fI("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Uk=fI("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})((({theme:e})=>({width:e.spacing(3)}))),Vk=fI(HC,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})((({ownerState:e})=>Yo({},e.hidden&&{visibility:"hidden"}))),$k=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:r,components:i,componentsProps:a,isLeftDisabled:s,isLeftHidden:l,isRightDisabled:c,isRightHidden:d,leftArrowButtonText:u,onLeftClick:p,onRightClick:f,rightArrowButtonText:m}=n,g=Go(n,Lk),h="rtl"===BI().direction,b=(null==a?void 0:a.leftArrowButton)||{},v=(null==i?void 0:i.LeftArrowIcon)||OI,y=(null==a?void 0:a.rightArrowButton)||{},x=(null==i?void 0:i.RightArrowIcon)||DI,S=n,w=(e=>{const{classes:t}=e;return _I({root:["root"],spacer:["spacer"],button:["button"]},Rk,t)})(S);return(0,Eo.jsxs)(Fk,Yo({ref:t,className:sT(w.root,r),ownerState:S},g,{children:[(0,Eo.jsx)(Vk,Yo({as:null==i?void 0:i.LeftArrowButton,size:"small","aria-label":u,title:u,disabled:s,edge:"end",onClick:p},b,{className:sT(w.button,b.className),ownerState:Yo({},S,b,{hidden:l}),children:h?(0,Eo.jsx)(x,{}):(0,Eo.jsx)(v,{})})),o?(0,Eo.jsx)($I,{variant:"subtitle1",component:"span",children:o}):(0,Eo.jsx)(Uk,{className:w.spacer,ownerState:S}),(0,Eo.jsx)(Vk,Yo({as:null==i?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},y,{className:sT(w.button,y.className),ownerState:Yo({},S,y,{hidden:d}),children:h?(0,Eo.jsx)(v,{}):(0,Eo.jsx)(x,{})}))]}))})),Bk=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Kk=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e);function zk(e,t,n){const o=JE(),r=((e,t)=>e?t.getHours(e)>=12?"pm":"am":null)(e,o),i=yo.useCallback((r=>{const i=null==e?null:((e,t,n,o)=>{const r=Bk(o.getHours(e),t,n);return o.setHours(e,r)})(e,r,!!t,o);n(i,"partial")}),[t,e,n,o]);return{meridiemMode:r,handleMeridiemChange:i}}function Hk(e){return bI("MuiClockPicker",e)}vI("MuiClockPicker",["root","arrowSwitcher"]);let Yk=0;const Gk=yo.useId;function Wk(e){if(void 0!==Gk){const t=Gk();return e??t}return function(e){const[t,n]=yo.useState(e),o=e||t;return yo.useEffect((()=>{null==t&&(Yk+=1,n(`mui-${Yk}`))}),[t]),o}(e)}const qk=fI("div")({overflowX:"hidden",width:320,maxHeight:358,display:"flex",flexDirection:"column",margin:"0 auto"}),Jk=fI(qk,{name:"MuiClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),Xk=fI($k,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),Zk=()=>{},Qk=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiClockPicker"}),{ampm:o=!1,ampmInClock:r=!1,autoFocus:i,components:a,componentsProps:s,date:l,disableIgnoringDatePartForTimeValidation:c,getClockLabelText:d,getHoursClockNumberText:u,getMinutesClockNumberText:p,getSecondsClockNumberText:f,leftArrowButtonText:m,maxTime:g,minTime:h,minutesStep:b=1,rightArrowButtonText:v,shouldDisableTime:y,showViewSwitcher:x,onChange:S,view:w,views:_=["hours","minutes"],openTo:E,onViewChange:T,className:I,disabled:C,readOnly:M}=n;Zk({leftArrowButtonText:m,rightArrowButtonText:v,getClockLabelText:d,getHoursClockNumberText:u,getMinutesClockNumberText:p,getSecondsClockNumberText:f});const O=ZE(),D=m??O.openPreviousView,k=v??O.openNextView,j=d??O.clockLabelText,A=u??O.hoursClockNumberText,P=p??O.minutesClockNumberText,N=f??O.secondsClockNumberText,{openView:R,setOpenView:L,nextView:F,previousView:U,handleChangeAndOpenNext:V}=lk({view:w,views:_,openTo:E,onViewChange:T,onChange:S}),$=QE(),B=JE(),K=yo.useMemo((()=>l||B.setSeconds(B.setMinutes(B.setHours($,0),0),0)),[l,$,B]),{meridiemMode:z,handleMeridiemChange:H}=zk(K,o,V),Y=yo.useCallback(((e,t)=>{const n=((e=!1,t)=>(n,o)=>e?t.isAfter(n,o):Kk(n,t)>Kk(o,t))(c,B),r=({start:e,end:t})=>!(h&&n(h,t)||g&&n(e,g)),i=(e,n=1)=>e%n==0&&(!y||!y(e,t));switch(t){case"hours":{const t=Bk(e,z,o),n=B.setHours(K,t);return!r({start:B.setSeconds(B.setMinutes(n,0),0),end:B.setSeconds(B.setMinutes(n,59),59)})||!i(t)}case"minutes":{const t=B.setMinutes(K,e);return!r({start:B.setSeconds(t,0),end:B.setSeconds(t,59)})||!i(e,b)}case"seconds":{const t=B.setSeconds(K,e);return!r({start:t,end:t})||!i(e)}default:throw new Error("not supported")}}),[o,K,c,g,z,h,b,y,B]),G=Wk(),W=yo.useMemo((()=>{switch(R){case"hours":return{onChange:(e,t)=>{const n=Bk(e,z,o);V(B.setHours(K,n),t)},value:B.getHours(K),children:Pk({date:l,utils:B,ampm:o,getClockNumberText:A,isDisabled:e=>C||Y(e,"hours"),selectedId:G})};case"minutes":{const e=B.getMinutes(K);return{value:e,onChange:(e,t)=>{V(B.setMinutes(K,e),t)},children:Nk({utils:B,value:e,getClockNumberText:P,isDisabled:e=>C||Y(e,"minutes"),selectedId:G})}}case"seconds":{const e=B.getSeconds(K);return{value:e,onChange:(e,t)=>{V(B.setSeconds(K,e),t)},children:Nk({utils:B,value:e,getClockNumberText:N,isDisabled:e=>C||Y(e,"seconds"),selectedId:G})}}default:throw new Error("You must provide the type for ClockView")}}),[R,B,l,o,A,P,N,z,V,K,Y,G,C]),q=n,J=(e=>{const{classes:t}=e;return _I({root:["root"],arrowSwitcher:["arrowSwitcher"]},Hk,t)})(q);return(0,Eo.jsxs)(Jk,{ref:t,className:sT(J.root,I),ownerState:q,children:[x&&(0,Eo.jsx)(Xk,{className:J.arrowSwitcher,leftArrowButtonText:D,rightArrowButtonText:k,components:a,componentsProps:s,onLeftClick:()=>L(U),onRightClick:()=>L(F),isLeftDisabled:!U,isRightDisabled:!F,ownerState:q}),(0,Eo.jsx)(Mk,Yo({autoFocus:i,date:l,ampmInClock:r,type:R,ampm:o,getClockLabelText:j,minutesStep:b,isTimeDisabled:Y,meridiemMode:z,handleMeridiemChange:H,selectedId:G,disabled:C,readOnly:M},W))]})}));function ej(e){return bI("PrivatePickersMonth",e)}const tj=vI("PrivatePickersMonth",["root","selected"]);function nj(e){if(e.type)return e;if("#"===e.charAt(0))return nj(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error(Qo(9,e));let o,r=e.substring(t+1,e.length-1);if("color"===n){if(r=r.split(" "),o=r.shift(),4===r.length&&"/"===r[3].charAt(0)&&(r[3]=r[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o))throw new Error(Qo(10,o))}else r=r.split(",");return r=r.map((e=>parseFloat(e))),{type:n,values:r,colorSpace:o}}function oj(e,t){return e=nj(e),t=function(e,t=0,n=1){return tr(e,t,n)}(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,function(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return-1!==t.indexOf("rgb")?o=o.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=-1!==t.indexOf("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}(e)}const rj=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],ij=fI($I,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${tj.selected}`]:t.selected}]})((({theme:e})=>Yo({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:e.palette.text.secondary},[`&.${tj.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}}))),aj=()=>{},sj=e=>{const{disabled:t,onSelect:n,selected:o,value:r,tabIndex:i,hasFocus:a,onFocus:s=aj,onBlur:l=aj}=e,c=Go(e,rj),d=(e=>{const{classes:t,selected:n}=e;return _I({root:["root",n&&"selected"]},ej,t)})(e),u=()=>{n(r)},p=yo.useRef(null);return zE((()=>{var e;a&&(null==(e=p.current)||e.focus())}),[a]),(0,Eo.jsx)(ij,Yo({ref:p,component:"button",type:"button",className:d.root,tabIndex:i,onClick:u,onKeyDown:iM(u),color:o?"primary":void 0,variant:o?"h5":"subtitle1",disabled:t,onFocus:e=>s(e,r),onBlur:e=>l(e,r)},c))};function lj(e){return bI("MuiMonthPicker",e)}vI("MuiMonthPicker",["root"]);const cj=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"];const dj=fI("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),uj=yo.forwardRef((function(e,t){const n=JE(),o=QE(),r=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({disableFuture:!1,disablePast:!1},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiMonthPicker"),{className:i,date:a,disabled:s,disableFuture:l,disablePast:c,maxDate:d,minDate:u,onChange:p,shouldDisableMonth:f,readOnly:m,disableHighlightToday:g,autoFocus:h=!1,onMonthFocus:b,hasFocus:v,onFocusedViewChange:y}=r,x=Go(r,cj),S=r,w=(e=>{const{classes:t}=e;return _I({root:["root"]},lj,t)})(S),_=pl(),E=yo.useMemo((()=>a??n.startOfMonth(o)),[o,n,a]),T=yo.useMemo((()=>null!=a?n.getMonth(a):g?null:n.getMonth(o)),[o,a,n,g]),[I,C]=yo.useState((()=>T||n.getMonth(o))),M=yo.useCallback((e=>{const t=n.startOfMonth(c&&n.isAfter(o,u)?o:u),r=n.startOfMonth(l&&n.isBefore(o,d)?o:d);return!(!n.isBefore(e,t)&&!n.isAfter(e,r))||!!f&&f(e)}),[l,c,d,u,o,f,n]),O=e=>{if(m)return;const t=n.setMonth(E,e);p(t,"finish")},[D,k]=sk({name:"MonthPicker",state:"hasFocus",controlled:v,default:h}),j=yo.useCallback((e=>{k(e),y&&y(e)}),[k,y]),A=yo.useCallback((e=>{M(n.setMonth(E,e))||(C(e),j(!0),b&&b(e))}),[M,n,E,j,b]);yo.useEffect((()=>{C((e=>null!==T&&e!==T?T:e))}),[T]);const P=UC((e=>{switch(e.key){case"ArrowUp":A((12+I-3)%12),e.preventDefault();break;case"ArrowDown":A((12+I+3)%12),e.preventDefault();break;case"ArrowLeft":A((12+I+("ltr"===_.direction?-1:1))%12),e.preventDefault();break;case"ArrowRight":A((12+I+("ltr"===_.direction?1:-1))%12),e.preventDefault()}})),N=yo.useCallback(((e,t)=>{A(t)}),[A]),R=yo.useCallback((()=>{j(!1)}),[j]),L=n.getMonth(o);return(0,Eo.jsx)(dj,Yo({ref:t,className:sT(w.root,i),ownerState:S,onKeyDown:P},x,{children:n.getMonthArray(E).map((e=>{const t=n.getMonth(e),o=n.format(e,"monthShort"),r=s||M(e);return(0,Eo.jsx)(sj,{value:t,selected:t===T,tabIndex:t!==I||r?-1:0,hasFocus:D&&t===I,onSelect:O,onFocus:N,onBlur:R,disabled:r,"aria-current":L===t?"date":void 0,children:o},o)}))}))})),pj=({date:e,defaultCalendarMonth:t,disableFuture:n,disablePast:o,disableSwitchToMonthOnDayFocus:r=!1,maxDate:i,minDate:a,onMonthChange:s,reduceAnimations:l,shouldDisableDate:c})=>{var d;const u=QE(),p=JE(),f=yo.useRef(((e,t,n)=>(o,r)=>{switch(r.type){case"changeMonth":return Yo({},o,{slideDirection:r.direction,currentMonth:r.newMonth,isMonthSwitchingAnimating:!e});case"finishMonthSwitchingAnimation":return Yo({},o,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=o.focusedDay&&null!=r.focusedDay&&n.isSameDay(r.focusedDay,o.focusedDay))return o;const i=null!=r.focusedDay&&!t&&!n.isSameMonth(o.currentMonth,r.focusedDay);return Yo({},o,{focusedDay:r.focusedDay,isMonthSwitchingAnimating:i&&!e&&!r.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(r.focusedDay):o.currentMonth,slideDirection:null!=r.focusedDay&&n.isAfterDay(r.focusedDay,o.currentMonth)?"left":"right"})}default:throw new Error("missing support")}})(!!l,r,p)).current,[m,g]=yo.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:e||u,currentMonth:p.startOfMonth(null!=(d=e??t)?d:u),slideDirection:"left"}),h=yo.useCallback((e=>{g(Yo({type:"changeMonth"},e)),s&&s(e.newMonth)}),[s]),b=yo.useCallback((e=>{const t=e??u;p.isSameMonth(t,m.currentMonth)||h({newMonth:p.startOfMonth(t),direction:p.isAfterDay(t,m.currentMonth)?"left":"right"})}),[m.currentMonth,h,u,p]),v=BD({shouldDisableDate:c,minDate:a,maxDate:i,disableFuture:n,disablePast:o}),y=yo.useCallback((()=>{g({type:"finishMonthSwitchingAnimation"})}),[]),x=yo.useCallback(((e,t)=>{v(e)||g({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),[v]);return{calendarState:m,changeMonth:b,changeFocusedDay:x,isDateDisabled:v,onMonthSwitchingAnimationEnd:y,handleChangeMonth:h}},fj=e=>bI("MuiPickersFadeTransitionGroup",e);vI("MuiPickersFadeTransitionGroup",["root"]);const mj=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],gj={entering:{opacity:1},entered:{opacity:1}},hj=yo.forwardRef((function(e,t){const n=BI(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:r,appear:i=!0,children:a,easing:s,in:l,onEnter:c,onEntered:d,onEntering:u,onExit:p,onExited:f,onExiting:m,style:g,timeout:h=o,TransitionComponent:b=hM}=e,v=Go(e,mj),y=yo.useRef(null),x=OC(y,vM(a),t),S=e=>t=>{if(e){const n=y.current;void 0===t?e(n):e(n,t)}},w=S(u),_=S(((e,t)=>{sM(e);const o=lM({style:g,timeout:h,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",o),e.style.transition=n.transitions.create("opacity",o),c&&c(e,t)})),E=S(d),T=S(m),I=S((e=>{const t=lM({style:g,timeout:h,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),p&&p(e)})),C=S(f);return(0,Eo.jsx)(b,Yo({appear:i,in:l,nodeRef:y,onEnter:_,onEntered:E,onEntering:w,onExit:I,onExited:C,onExiting:T,addEndListener:e=>{r&&r(y.current,e)},timeout:h},v,{children:(e,t)=>yo.cloneElement(a,Yo({style:Yo({opacity:0,visibility:"exited"!==e||l?void 0:"hidden"},gj[e],g,a.props.style),ref:x},t))}))})),bj=fI(fC,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function vj(e){const t=fl({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:o,reduceAnimations:r,transKey:i}=t,a=(e=>{const{classes:t}=e;return _I({root:["root"]},fj,t)})(t);return r?n:(0,Eo.jsx)(bj,{className:sT(a.root,o),children:(0,Eo.jsx)(hj,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:500,enter:250,exit:0},children:n},i)})}function yj(e){return bI("MuiPickersDay",e)}const xj=vI("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Sj=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],wj=({theme:e,ownerState:t})=>Yo({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:e.palette.background.paper,color:e.palette.text.primary,"&:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},"&:focus":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity),[`&.${xj.selected}`]:{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${xj.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium,transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${xj.disabled}`]:{color:e.palette.text.disabled}},!t.disableMargin&&{margin:"0 2px"},t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&{color:e.palette.text.secondary},!t.disableHighlightToday&&t.today&&{[`&:not(.${xj.selected})`]:{border:`1px solid ${e.palette.text.secondary}`}}),_j=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},Ej=fI(BC,{name:"MuiPickersDay",slot:"Root",overridesResolver:_j})(wj),Tj=fI("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:_j})((({theme:e,ownerState:t})=>Yo({},wj({theme:e,ownerState:t}),{opacity:0,pointerEvents:"none"}))),Ij=()=>{},Cj=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiPickersDay"}),{autoFocus:o=!1,className:r,day:i,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:c,onClick:d,onDaySelect:u,onFocus:p=Ij,onBlur:f=Ij,onKeyDown:m=Ij,onMouseDown:g,outsideCurrentMonth:h,selected:b=!1,showDaysOutsideCurrentMonth:v=!1,children:y,today:x=!1}=n,S=Go(n,Sj),w=Yo({},n,{autoFocus:o,disabled:a,disableHighlightToday:s,disableMargin:l,selected:b,showDaysOutsideCurrentMonth:v,today:x}),_=(e=>{const{selected:t,disableMargin:n,disableHighlightToday:o,today:r,disabled:i,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e;return _I({root:["root",t&&"selected",i&&"disabled",!n&&"dayWithMargin",!o&&r&&"today",a&&s&&"dayOutsideMonth",a&&!s&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},yj,l)})(w),E=JE(),T=yo.useRef(null),I=OC(T,t);zE((()=>{o&&!a&&!c&&!h&&T.current.focus()}),[o,a,c,h]);return h&&!v?(0,Eo.jsx)(Tj,{className:sT(_.root,_.hiddenDaySpacingFiller,r),ownerState:w,role:S.role}):(0,Eo.jsx)(Ej,Yo({className:sT(_.root,r),ownerState:w,ref:I,centerRipple:!0,disabled:a,tabIndex:b?0:-1,onKeyDown:e=>m(e,i),onFocus:e=>p(e,i),onBlur:e=>f(e,i),onClick:e=>{a||u(i,"finish"),h&&e.currentTarget.focus(),d&&d(e)},onMouseDown:e=>{g&&g(e),h&&e.preventDefault()}},S,{children:y||E.format(i,"dayOfMonth")}))})),Mj=(e,t)=>e.autoFocus===t.autoFocus&&e.isAnimating===t.isAnimating&&e.today===t.today&&e.disabled===t.disabled&&e.selected===t.selected&&e.disableMargin===t.disableMargin&&e.showDaysOutsideCurrentMonth===t.showDaysOutsideCurrentMonth&&e.disableHighlightToday===t.disableHighlightToday&&e.className===t.className&&e.sx===t.sx&&e.outsideCurrentMonth===t.outsideCurrentMonth&&e.onFocus===t.onFocus&&e.onBlur===t.onBlur&&e.onDaySelect===t.onDaySelect,Oj=yo.memo(Cj,Mj),Dj=e=>bI("PrivatePickersSlideTransition",e),kj=vI("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]);function jj(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Aj=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return function(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=jj(e.className,t):e.setAttribute("class",jj(e.className&&e.className.baseVal||"",t))}(e,t)}))},Pj=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1];t.removeClasses(r,"exit"),t.addClass(r,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.addClass(r,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var o=t.resolveArguments(e,n),r=o[0],i=o[1]?"appear":"enter";t.removeClasses(r,i),t.addClass(r,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,o="string"==typeof n,r=o?""+(o&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:o?r+"-active":n[e+"Active"],doneClassName:o?r+"-done":n[e+"Done"]}},t}aC(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var o=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(o+=" "+r),"active"===n&&e&&dM(e),o&&(this.appliedClasses[t][n]=o,function(e,t){e&&t&&t.split(" ").forEach((function(t){return function(e,t){e.classList?e.classList.add(t):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}(e,t)}))}(e,o))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],o=n.base,r=n.active,i=n.done;this.appliedClasses[t]={},o&&Aj(e,o),r&&Aj(e,r),i&&Aj(e,i)},n.render=function(){var e=this.props;e.classNames;var t=Go(e,["classNames"]);return yo.createElement(hM,Yo({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(yo.Component);Pj.defaultProps={classNames:""},Pj.propTypes={};const Nj=["children","className","reduceAnimations","slideDirection","transKey"],Rj=fI(fC,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${kj["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${kj["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${kj.slideEnterActive}`]:t.slideEnterActive},{[`.${kj.slideExit}`]:t.slideExit},{[`.${kj["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${kj["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})((({theme:e})=>{const t=e.transitions.create("transform",{duration:350,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${kj["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${kj["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${kj.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${kj.slideExit}`]:{transform:"translate(0%)"},[`& .${kj["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${kj["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}})),Lj=e=>bI("MuiDayPicker",e);vI("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const Fj=e=>e.charAt(0).toUpperCase(),Uj=fI("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Vj=fI($I,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})((({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.secondary}))),$j=fI("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),Bj=fI((e=>{const{children:t,className:n,reduceAnimations:o,slideDirection:r,transKey:i}=e,a=Go(e,Nj),s=(e=>{const{classes:t}=e;return _I({root:["root"]},Dj,t)})(e);if(o)return(0,Eo.jsx)("div",{className:sT(s.root,n),children:t});const l={exit:kj.slideExit,enterActive:kj.slideEnterActive,enter:kj[`slideEnter-${r}`],exitActive:kj[`slideExitActiveLeft-${r}`]};return(0,Eo.jsx)(Rj,{className:sT(s.root,n),childFactory:e=>yo.cloneElement(e,{classNames:l}),role:"presentation",children:(0,Eo.jsx)(Pj,Yo({mountOnEnter:!0,unmountOnExit:!0,timeout:350,classNames:l},a,{children:t}),i)})}),{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),Kj=fI("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),zj=fI("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function Hj(e){const t=QE(),n=JE(),o=fl({props:e,name:"MuiDayPicker"}),r=(e=>{const{classes:t}=e;return _I({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},Lj,t)})(o),{onFocusedDayChange:i,className:a,currentMonth:s,selectedDays:l,disabled:c,disableHighlightToday:d,focusedDay:u,isMonthSwitchingAnimating:p,loading:f,onSelectedDaysChange:m,onMonthSwitchingAnimationEnd:g,readOnly:h,reduceAnimations:b,renderDay:v,renderLoading:y=()=>(0,Eo.jsx)("span",{children:"..."}),showDaysOutsideCurrentMonth:x,slideDirection:S,TransitionProps:w,disablePast:_,disableFuture:E,minDate:T,maxDate:I,shouldDisableDate:C,dayOfWeekFormatter:M=Fj,hasFocus:O,onFocusedViewChange:D,gridLabelId:k}=o,j=BD({shouldDisableDate:C,minDate:T,maxDate:I,disablePast:_,disableFuture:E}),[A,P]=yo.useState((()=>u||t)),N=yo.useCallback((e=>{D&&D(e)}),[D]),R=yo.useCallback(((e,t="finish")=>{h||m(e,t)}),[m,h]),L=yo.useCallback((e=>{j(e)||(i(e),P(e),N(!0))}),[j,i,N]),F=BI();function U(e,t){switch(e.key){case"ArrowUp":L(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":L(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{const o=n.addDays(t,"ltr"===F.direction?-1:1),r="ltr"===F.direction?n.getPreviousMonth(t):n.getNextMonth(t),i=eT({utils:n,date:o,minDate:"ltr"===F.direction?n.startOfMonth(r):o,maxDate:"ltr"===F.direction?o:n.endOfMonth(r),isDateDisabled:j});L(i||o),e.preventDefault();break}case"ArrowRight":{const o=n.addDays(t,"ltr"===F.direction?1:-1),r="ltr"===F.direction?n.getNextMonth(t):n.getPreviousMonth(t),i=eT({utils:n,date:o,minDate:"ltr"===F.direction?o:n.startOfMonth(r),maxDate:"ltr"===F.direction?n.endOfMonth(r):o,isDateDisabled:j});L(i||o),e.preventDefault();break}case"Home":L(n.startOfWeek(t)),e.preventDefault();break;case"End":L(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":L(n.getNextMonth(t)),e.preventDefault();break;case"PageDown":L(n.getPreviousMonth(t)),e.preventDefault()}}function V(e,t){L(t)}function $(e,t){O&&n.isSameDay(A,t)&&N(!1)}const B=n.getMonth(s),K=l.filter((e=>!!e)).map((e=>n.startOfDay(e))),z=B,H=yo.useMemo((()=>yo.createRef()),[z]),Y=n.startOfWeek(t),G=yo.useMemo((()=>{const e=n.startOfMonth(s),t=n.endOfMonth(s);return j(A)||n.isAfterDay(A,t)||n.isBeforeDay(A,e)?eT({utils:n,date:A,minDate:e,maxDate:t,disablePast:_,disableFuture:E,isDateDisabled:j}):A}),[s,E,_,A,j,n]);return(0,Eo.jsxs)("div",{role:"grid","aria-labelledby":k,children:[(0,Eo.jsx)(Uj,{role:"row",className:r.header,children:n.getWeekdays().map(((e,t)=>{var o;return(0,Eo.jsx)(Vj,{variant:"caption",role:"columnheader","aria-label":n.format(n.addDays(Y,t),"weekday"),className:r.weekDayLabel,children:null!=(o=null==M?void 0:M(e))?o:e},e+t.toString())}))}),f?(0,Eo.jsx)($j,{className:r.loadingContainer,children:y()}):(0,Eo.jsx)(Bj,Yo({transKey:z,onExited:g,reduceAnimations:b,slideDirection:S,className:sT(a,r.slideTransition)},w,{nodeRef:H,children:(0,Eo.jsx)(Kj,{ref:H,role:"rowgroup",className:r.monthContainer,children:n.getWeekArray(s).map((e=>(0,Eo.jsx)(zj,{role:"row",className:r.weekContainer,children:e.map((e=>{const o=null!==G&&n.isSameDay(e,G),r=K.some((t=>n.isSameDay(t,e))),i=n.isSameDay(e,t),a={key:null==e?void 0:e.toString(),day:e,isAnimating:p,disabled:c||j(e),autoFocus:O&&o,today:i,outsideCurrentMonth:n.getMonth(e)!==B,selected:r,disableHighlightToday:d,showDaysOutsideCurrentMonth:x,onKeyDown:U,onFocus:V,onBlur:$,onDaySelect:R,tabIndex:o?0:-1,role:"gridcell","aria-selected":r};return i&&(a["aria-current"]="date"),v?v(e,K,a):(0,yo.createElement)(Oj,Yo({},a,{key:a.key}))}))},`week-${e[0]}`)))})}))]})}const Yj=e=>bI("MuiPickersCalendarHeader",e);vI("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const Gj=fI("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),Wj=fI("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})((({theme:e})=>Yo({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium}))),qj=fI("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Jj=fI(HC,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto"}),Xj=fI(MI,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})((({theme:e,ownerState:t})=>Yo({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"},"year"===t.openView&&{transform:"rotate(180deg)"}))),Zj=()=>{};function Qj(e){const t=fl({props:e,name:"MuiPickersCalendarHeader"}),{components:n={},componentsProps:o={},currentMonth:r,disabled:i,disableFuture:a,disablePast:s,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:d,minDate:u,onMonthChange:p,onViewChange:f,openView:m,reduceAnimations:g,rightArrowButtonText:h,views:b,labelId:v}=t;Zj({leftArrowButtonText:c,rightArrowButtonText:h,getViewSwitchingButtonText:l});const y=ZE(),x=c??y.previousMonth,S=h??y.nextMonth,w=l??y.calendarViewSwitchingButtonAriaLabel,_=JE(),E=(e=>{const{classes:t}=e;return _I({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Yj,t)})(t),T=o.switchViewButton||{},I=function(e,{disableFuture:t,maxDate:n}){const o=JE();return yo.useMemo((()=>{const r=o.date(),i=o.startOfMonth(t&&o.isBefore(r,n)?r:n);return!o.isAfter(i,e)}),[t,n,e,o])}(r,{disableFuture:a,maxDate:d}),C=function(e,{disablePast:t,minDate:n}){const o=JE();return yo.useMemo((()=>{const r=o.date(),i=o.startOfMonth(t&&o.isAfter(r,n)?r:n);return!o.isBefore(i,e)}),[t,n,e,o])}(r,{disablePast:s,minDate:u});if(1===b.length&&"year"===b[0])return null;const M=t;return(0,Eo.jsxs)(Gj,{ownerState:M,className:E.root,children:[(0,Eo.jsxs)(Wj,{role:"presentation",onClick:()=>{if(1!==b.length&&f&&!i)if(2===b.length)f(b.find((e=>e!==m))||b[0]);else{const e=0!==b.indexOf(m)?0:1;f(b[e])}},ownerState:M,"aria-live":"polite",className:E.labelContainer,children:[(0,Eo.jsx)(vj,{reduceAnimations:g,transKey:_.format(r,"monthAndYear"),children:(0,Eo.jsx)(qj,{id:v,ownerState:M,className:E.label,children:_.format(r,"monthAndYear")})}),b.length>1&&!i&&(0,Eo.jsx)(Jj,Yo({size:"small",as:n.SwitchViewButton,"aria-label":w(m),className:E.switchViewButton},T,{children:(0,Eo.jsx)(Xj,{as:n.SwitchViewIcon,ownerState:M,className:E.switchViewIcon})}))]}),(0,Eo.jsx)(hj,{in:"day"===m,children:(0,Eo.jsx)($k,{leftArrowButtonText:x,rightArrowButtonText:S,components:n,componentsProps:o,onLeftClick:()=>p(_.getPreviousMonth(r),"right"),onRightClick:()=>p(_.getNextMonth(r),"left"),isLeftDisabled:C,isRightDisabled:I})})]})}function eA(e){return bI("PrivatePickersYear",e)}const tA=vI("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),nA=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],oA=fI("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${tA.modeDesktop}`]:t.modeDesktop},{[`&.${tA.modeMobile}`]:t.modeMobile}]})((({ownerState:e})=>Yo({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},"desktop"===(null==e?void 0:e.wrapperVariant)&&{flexBasis:"25%"}))),rA=fI("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${tA.disabled}`]:t.disabled},{[`&.${tA.selected}`]:t.selected}]})((({theme:e})=>Yo({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:oj(e.palette.action.active,e.palette.action.hoverOpacity)},[`&.${tA.disabled}`]:{color:e.palette.text.secondary},[`&.${tA.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}}))),iA=()=>{},aA=yo.forwardRef((function(e,t){const{autoFocus:n,className:o,children:r,disabled:i,onClick:a,onKeyDown:s,value:l,tabIndex:c,onFocus:d=iA,onBlur:u=iA}=e,p=Go(e,nA),f=yo.useRef(null),m=OC(f,t),g=Yo({},e,{wrapperVariant:yo.useContext(nM)}),h=(e=>{const{wrapperVariant:t,disabled:n,selected:o,classes:r}=e;return _I({root:["root",t&&`mode${Ai(t)}`],yearButton:["yearButton",n&&"disabled",o&&"selected"]},eA,r)})(g);return yo.useEffect((()=>{n&&f.current.focus()}),[n]),(0,Eo.jsx)(oA,{className:sT(h.root,o),ownerState:g,children:(0,Eo.jsx)(rA,Yo({ref:m,disabled:i,type:"button",tabIndex:i?-1:c,onClick:e=>a(e,l),onKeyDown:e=>s(e,l),onFocus:e=>d(e,l),onBlur:e=>u(e,l),className:h.yearButton,ownerState:g},p,{children:r}))})}));function sA(e){return bI("MuiYearPicker",e)}vI("MuiYearPicker",["root"]);const lA=fI("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),cA=yo.forwardRef((function(e,t){const n=QE(),o=BI(),r=JE(),i=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({disablePast:!1,disableFuture:!1},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiYearPicker"),{autoFocus:a,className:s,date:l,disabled:c,disableFuture:d,disablePast:u,maxDate:p,minDate:f,onChange:m,readOnly:g,shouldDisableYear:h,disableHighlightToday:b,onYearFocus:v,hasFocus:y,onFocusedViewChange:x}=i,S=i,w=(e=>{const{classes:t}=e;return _I({root:["root"]},sA,t)})(S),_=yo.useMemo((()=>l??r.startOfYear(n)),[n,r,l]),E=yo.useMemo((()=>null!=l?r.getYear(l):b?null:r.getYear(n)),[n,l,r,b]),T=yo.useContext(nM),I=yo.useRef(null),[C,M]=yo.useState((()=>E||r.getYear(n))),[O,D]=sk({name:"YearPicker",state:"hasFocus",controlled:y,default:a}),k=yo.useCallback((e=>{D(e),x&&x(e)}),[D,x]),j=yo.useCallback((e=>!!(u&&r.isBeforeYear(e,n)||d&&r.isAfterYear(e,n)||f&&r.isBeforeYear(e,f)||p&&r.isAfterYear(e,p)||h&&h(e))),[d,u,p,f,n,h,r]),A=(e,t,n="finish")=>{if(g)return;const o=r.setYear(_,t);m(o,n)},P=yo.useCallback((e=>{j(r.setYear(_,e))||(M(e),k(!0),null==v||v(e))}),[j,r,_,k,v]);yo.useEffect((()=>{M((e=>null!==E&&e!==E?E:e))}),[E]);const N="desktop"===T?4:3,R=yo.useCallback(((e,t)=>{switch(e.key){case"ArrowUp":P(t-N),e.preventDefault();break;case"ArrowDown":P(t+N),e.preventDefault();break;case"ArrowLeft":P(t+("ltr"===o.direction?-1:1)),e.preventDefault();break;case"ArrowRight":P(t+("ltr"===o.direction?1:-1)),e.preventDefault()}}),[P,o.direction,N]),L=yo.useCallback(((e,t)=>{P(t)}),[P]),F=yo.useCallback(((e,t)=>{C===t&&k(!1)}),[C,k]),U=r.getYear(n),V=yo.useRef(null),$=OC(t,V);return yo.useEffect((()=>{if(a||null===V.current)return;const e=V.current.querySelector('[tabindex="0"]');if(!e)return;const t=e.offsetHeight,n=e.offsetTop,o=V.current.clientHeight,r=V.current.scrollTop,i=n+t;t>o||n<r||(V.current.scrollTop=i-o/2-t/2)}),[a]),(0,Eo.jsx)(lA,{ref:$,className:sT(w.root,s),ownerState:S,children:r.getYearRange(f,p).map((e=>{const t=r.getYear(e),n=t===E;return(0,Eo.jsx)(aA,{selected:n,value:t,onClick:A,onKeyDown:R,autoFocus:O&&t===C,ref:n?I:void 0,disabled:c||j(e),tabIndex:t===C?0:-1,onFocus:L,onBlur:F,"aria-current":U===t?"date":void 0,children:r.format(e,"year")},r.format(e,"year"))}))})})),dA=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),uA=e=>bI("MuiCalendarPicker",e);vI("MuiCalendarPicker",["root","viewTransitionContainer"]);const pA=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"];const fA=fI(qk,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),mA=fI(vj,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),gA=yo.forwardRef((function(e,t){const n=JE(),o=Wk(),r=function(e,t){const n=JE(),o=XE(),r=fl({props:e,name:t});return Yo({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:dA,renderLoading:()=>(0,Eo.jsx)("span",{children:"..."})},r,{minDate:tT(n,r.minDate,o.minDate),maxDate:tT(n,r.maxDate,o.maxDate)})}(e,"MuiCalendarPicker"),{autoFocus:i,onViewChange:a,date:s,disableFuture:l,disablePast:c,defaultCalendarMonth:d,onChange:u,onYearChange:p,onMonthChange:f,reduceAnimations:m,shouldDisableDate:g,shouldDisableMonth:h,shouldDisableYear:b,view:v,views:y,openTo:x,className:S,disabled:w,readOnly:_,minDate:E,maxDate:T,disableHighlightToday:I,focusedView:C,onFocusedViewChange:M}=r,O=Go(r,pA),{openView:D,setOpenView:k,openNext:j}=lk({view:v,views:y,openTo:x,onChange:u,onViewChange:a}),{calendarState:A,changeFocusedDay:P,changeMonth:N,handleChangeMonth:R,isDateDisabled:L,onMonthSwitchingAnimationEnd:F}=pj({date:s,defaultCalendarMonth:d,reduceAnimations:m,onMonthChange:f,minDate:E,maxDate:T,shouldDisableDate:g,disablePast:c,disableFuture:l}),U=yo.useCallback(((e,t)=>{const o=n.startOfMonth(e),r=n.endOfMonth(e),i=L(e)?eT({utils:n,date:e,minDate:n.isBefore(E,o)?o:E,maxDate:n.isAfter(T,r)?r:T,disablePast:c,disableFuture:l,isDateDisabled:L}):e;i?(u(i,t),null==f||f(o)):(j(),N(o)),P(i,!0)}),[P,l,c,L,T,E,u,f,N,j,n]),V=yo.useCallback(((e,t)=>{const o=n.startOfYear(e),r=n.endOfYear(e),i=L(e)?eT({utils:n,date:e,minDate:n.isBefore(E,o)?o:E,maxDate:n.isAfter(T,r)?r:T,disablePast:c,disableFuture:l,isDateDisabled:L}):e;i?(u(i,t),null==p||p(i)):(j(),N(o)),P(i,!0)}),[P,l,c,L,T,E,u,p,j,n,N]),$=yo.useCallback(((e,t)=>u(s&&e?n.mergeDateAndTime(e,s):e,t)),[n,s,u]);yo.useEffect((()=>{s&&N(s)}),[s]);const B=r,K=(e=>{const{classes:t}=e;return _I({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},uA,t)})(B),z={disablePast:c,disableFuture:l,maxDate:T,minDate:E},H=w&&s||E,Y=w&&s||T,G={disableHighlightToday:I,readOnly:_,disabled:w},W=`${o}-grid-label`,[q,J]=sk({name:"DayPicker",state:"focusedView",controlled:C,default:i?D:null}),X=null!==q,Z=UC((e=>t=>{M?M(e)(t):J(t?e:t=>t===e?null:t)})),Q=yo.useRef(D);return yo.useEffect((()=>{Q.current!==D&&(Q.current=D,Z(D)(!0))}),[D,Z]),(0,Eo.jsxs)(fA,{ref:t,className:sT(K.root,S),ownerState:B,children:[(0,Eo.jsx)(Qj,Yo({},O,{views:y,openView:D,currentMonth:A.currentMonth,onViewChange:k,onMonthChange:(e,t)=>R({newMonth:e,direction:t}),minDate:H,maxDate:Y,disabled:w,disablePast:c,disableFuture:l,reduceAnimations:m,labelId:W})),(0,Eo.jsx)(mA,{reduceAnimations:m,className:K.viewTransitionContainer,transKey:D,ownerState:B,children:(0,Eo.jsxs)("div",{children:["year"===D&&(0,Eo.jsx)(cA,Yo({},O,z,G,{autoFocus:i,date:s,onChange:V,shouldDisableYear:b,hasFocus:X,onFocusedViewChange:Z("year")})),"month"===D&&(0,Eo.jsx)(uj,Yo({},z,G,{autoFocus:i,hasFocus:X,className:S,date:s,onChange:U,shouldDisableMonth:h,onFocusedViewChange:Z("month")})),"day"===D&&(0,Eo.jsx)(Hj,Yo({},O,A,z,G,{autoFocus:i,onMonthSwitchingAnimationEnd:F,onFocusedDayChange:P,reduceAnimations:m,selectedDays:[s],onSelectedDaysChange:$,shouldDisableDate:g,hasFocus:X,onFocusedViewChange:Z("day"),gridLabelId:W}))]})})]})}));function hA(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function bA(e){return bI("MuiCalendarOrClockPicker",e)}vI("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const vA=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],yA=fI("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(e,t)=>t.mobileKeyboardInputView})({padding:"16px 24px"}),xA=fI("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})((({ownerState:e})=>Yo({display:"flex",flexDirection:"column"},e.isLandscape&&{flexDirection:"row"}))),SA={fullWidth:!0},wA=e=>"year"===e||"month"===e||"day"===e,_A=e=>"hours"===e||"minutes"===e||"seconds"===e;function EA(e){var t,n;const o=fl({props:e,name:"MuiCalendarOrClockPicker"}),{autoFocus:r,parsedValue:i,DateInputProps:a,isMobileKeyboardViewOpen:s,onDateChange:l,onViewChange:c,openTo:d,orientation:u,showToolbar:p,toggleMobileKeyboardView:f,ToolbarComponent:m=()=>null,toolbarFormat:g,toolbarPlaceholder:h,toolbarTitle:b,views:v,dateRangeIcon:y,timeIcon:x,hideTabs:S}=o,w=Go(o,vA),_=null==(t=w.components)?void 0:t.Tabs,E=((e,t)=>{const[n,o]=yo.useState(hA);return zE((()=>{const e=()=>{o(hA())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}}),[]),!rM(e,["hours","minutes","seconds"])&&"landscape"===(t||n)})(v,u),T=yo.useContext(nM),I=(e=>{const{classes:t}=e;return _I({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},bA,t)})(o),C=p??"desktop"!==T,M=!S&&typeof window<"u"&&window.innerHeight>667,O=yo.useCallback(((e,t)=>{l(e,T,t)}),[l,T]),D=yo.useCallback((e=>{s&&f(),c&&c(e)}),[s,c,f]),{openView:k,setOpenView:j,handleChangeAndOpenNext:A}=lk({view:void 0,views:v,openTo:d,onChange:O,onViewChange:D}),{focusedView:P,setFocusedView:N}=(({autoFocus:e,openView:t})=>{const[n,o]=yo.useState(e?t:null),r=yo.useCallback((e=>t=>{o(t?e:t=>e===t?null:t)}),[]);return{focusedView:n,setFocusedView:r}})({autoFocus:r,openView:k});return(0,Eo.jsxs)(xA,{ownerState:{isLandscape:E},className:I.root,children:[C&&(0,Eo.jsx)(m,Yo({},w,{views:v,isLandscape:E,parsedValue:i,onChange:O,setOpenView:j,openView:k,toolbarTitle:b,toolbarFormat:g,toolbarPlaceholder:h,isMobileKeyboardViewOpen:s,toggleMobileKeyboardView:f})),M&&!!_&&(0,Eo.jsx)(_,Yo({dateRangeIcon:y,timeIcon:x,view:k,onChange:j},null==(n=w.componentsProps)?void 0:n.tabs)),(0,Eo.jsx)(qk,{children:s?(0,Eo.jsx)(yA,{className:I.mobileKeyboardInputView,children:(0,Eo.jsx)(ik,Yo({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:SA}))}):(0,Eo.jsxs)(yo.Fragment,{children:[wA(k)&&(0,Eo.jsx)(gA,Yo({autoFocus:r,date:i,onViewChange:j,onChange:A,view:k,views:v.filter(wA),focusedView:P,onFocusedViewChange:N},w)),_A(k)&&(0,Eo.jsx)(Qk,Yo({},w,{autoFocus:r,date:i,view:k,views:v.filter(_A),onChange:A,onViewChange:j,showViewSwitcher:"desktop"===T}))]})})]})}const TA=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],IA=yo.forwardRef((function(e,t){const n=rT(e,"MuiDesktopDatePicker"),o=null!==zD(n),{pickerProps:r,inputProps:i,wrapperProps:a}=ak(n,iT),{PopperProps:s,PaperProps:l,ToolbarComponent:c=tM,TransitionComponent:d,components:u,componentsProps:p}=n,f=Go(n,TA),m=Yo({},i,f,{components:u,componentsProps:p,ref:t,validationError:o});return(0,Eo.jsx)(VD,Yo({},a,{DateInputProps:m,KeyboardDateInputComponent:ik,PopperProps:s,PaperProps:l,TransitionComponent:d,components:u,componentsProps:p,children:(0,Eo.jsx)(EA,Yo({},r,{autoFocus:!0,toolbarTitle:n.label||n.toolbarTitle,ToolbarComponent:c,DateInputProps:m,components:u,componentsProps:p},f))}))}));function CA(e){return bI("MuiDialog",e)}const MA=vI("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),OA=yo.createContext({});function DA(e){return VM(e).defaultView||window}function kA(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function jA(e){return parseInt(DA(e).getComputedStyle(e).paddingRight,10)||0}function AA(e,t,n,o,r){const i=[t,n,...o];[].forEach.call(e.children,(e=>{const t=-1===i.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&kA(e,r)}))}function PA(e,t){let n=-1;return e.some(((e,o)=>!!t(e)&&(n=o,!0))),n}function NA(e,t){const n=[],o=e.container;if(!t.disableScrollLock){if(function(e){const t=VM(e);return t.body===e?DA(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(VM(o));n.push({value:o.style.paddingRight,property:"padding-right",el:o}),o.style.paddingRight=`${jA(o)+e}px`;const t=VM(o).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${jA(t)+e}px`}))}let e;if(o.parentNode instanceof DocumentFragment)e=VM(o).body;else{const t=o.parentElement,n=DA(o);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:o}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)}))}}function RA(...e){return e.reduce(((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)}),(()=>{}))}const LA=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&kA(e.modalRef,!1);const o=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);AA(t,e.mount,e.modalRef,o,!0);const r=PA(this.containers,(e=>e.container===t));return-1!==r?(this.containers[r].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:o}),n)}mount(e,t){const n=PA(this.containers,(t=>-1!==t.modals.indexOf(e))),o=this.containers[n];o.restore||(o.restore=NA(o,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const o=PA(this.containers,(t=>-1!==t.modals.indexOf(e))),r=this.containers[o];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(n,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&kA(e.modalRef,t),AA(r.container,e.mount,e.modalRef,r.hiddenSiblings,!1),this.containers.splice(o,1);else{const e=r.modals[r.modals.length-1];e.modalRef&&kA(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function FA(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,manager:r=LA,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:d,rootRef:u}=e,p=yo.useRef({}),f=yo.useRef(null),m=yo.useRef(null),g=OC(m,u),[h,b]=yo.useState(!d),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let y=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(y=!1);const x=()=>(p.current.modalRef=m.current,p.current.mount=f.current,p.current),S=()=>{r.mount(x(),{disableScrollLock:o}),m.current&&(m.current.scrollTop=0)},w=UC((()=>{const e=function(e){return"function"==typeof e?e():e}(t)||VM(f.current).body;r.add(x(),e),m.current&&S()})),_=yo.useCallback((()=>r.isTopModal(x())),[r]),E=UC((e=>{f.current=e,e&&(d&&_()?S():m.current&&kA(m.current,y))})),T=yo.useCallback((()=>{r.remove(x(),y)}),[y,r]);yo.useEffect((()=>()=>{T()}),[T]),yo.useEffect((()=>{d?w():(!v||!i)&&T()}),[d,T,v,i,w]);const I=e=>t=>{var o;null==(o=e.onKeyDown)||o.call(e,t),"Escape"===t.key&&229!==t.which&&_()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},C=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:(t={})=>{const n=bD(e);delete n.onTransitionEnter,delete n.onTransitionExited;const o=Yo({},n,t);return Yo({role:"presentation"},o,{onKeyDown:I(o),ref:g})},getBackdropProps:(e={})=>Yo({"aria-hidden":!0},e,{onClick:C(e),open:d}),getTransitionProps:()=>({onEnter:RA((()=>{b(!1),a&&a()}),null==l?void 0:l.props.onEnter),onExited:RA((()=>{b(!0),s&&s(),i&&T()}),null==l?void 0:l.props.onExited)}),rootRef:g,portalRef:E,isTopModal:_,exited:h,hasTransition:v}}function UA(e){return bI("MuiModal",e)}function VA(e){return bI("MuiBackdrop",e)}vI("MuiModal",["root","hidden","backdrop"]),vI("MuiBackdrop",["root","invisible"]);const $A=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],BA=fI("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})((({ownerState:e})=>Yo({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"}))),KA=yo.forwardRef((function(e,t){var n,o,r;const i=wI({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:d={},invisible:u=!1,open:p,slotProps:f={},slots:m={},TransitionComponent:g=hj,transitionDuration:h}=i,b=Go(i,$A),v=Yo({},i,{component:l,invisible:u}),y=(e=>{const{classes:t,invisible:n}=e;return _I({root:["root",n&&"invisible"]},VA,t)})(v),x=null!=(n=f.root)?n:d.root;return(0,Eo.jsx)(g,Yo({in:p,timeout:h},b,{children:(0,Eo.jsx)(BA,Yo({"aria-hidden":!0},x,{as:null!=(o=null!=(r=m.root)?r:c.Root)?o:l,className:cT(y.root,s,null==x?void 0:x.className),ownerState:Yo({},v,null==x?void 0:x.ownerState),classes:y,ref:t,children:a}))}))})),zA=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],HA=fI("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((({theme:e,ownerState:t})=>Yo({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"}))),YA=fI(KA,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),GA=yo.forwardRef((function(e,t){var n,o,r,i,a,s;const l=wI({name:"MuiModal",props:e}),{BackdropComponent:c=YA,BackdropProps:d,className:u,closeAfterTransition:p=!1,children:f,container:m,component:g,components:h={},componentsProps:b={},disableAutoFocus:v=!1,disableEnforceFocus:y=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:w=!1,disableScrollLock:_=!1,hideBackdrop:E=!1,keepMounted:T=!1,onBackdropClick:I,open:C,slotProps:M,slots:O}=l,D=Go(l,zA),k=Yo({},l,{closeAfterTransition:p,disableAutoFocus:v,disableEnforceFocus:y,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:w,disableScrollLock:_,hideBackdrop:E,keepMounted:T}),{getRootProps:j,getBackdropProps:A,getTransitionProps:P,portalRef:N,isTopModal:R,exited:L,hasTransition:F}=FA(Yo({},k,{rootRef:t})),U=Yo({},k,{exited:L}),V=(e=>{const{open:t,exited:n,classes:o}=e;return _I({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},UA,o)})(U),$={};if(void 0===f.props.tabIndex&&($.tabIndex="-1"),F){const{onEnter:e,onExited:t}=P();$.onEnter=e,$.onExited=t}const B=null!=(n=null!=(o=null==O?void 0:O.root)?o:h.Root)?n:HA,K=null!=(r=null!=(i=null==O?void 0:O.backdrop)?i:h.Backdrop)?r:c,z=null!=(a=null==M?void 0:M.root)?a:b.root,H=null!=(s=null==M?void 0:M.backdrop)?s:b.backdrop,Y=xD({elementType:B,externalSlotProps:z,externalForwardedProps:D,getSlotProps:j,additionalProps:{ref:t,as:g},ownerState:U,className:cT(u,null==z?void 0:z.className,null==V?void 0:V.root,!U.open&&U.exited&&(null==V?void 0:V.hidden))}),G=xD({elementType:K,externalSlotProps:H,additionalProps:d,getSlotProps:e=>A(Yo({},e,{onClick:t=>{I&&I(t),null!=e&&e.onClick&&e.onClick(t)}})),className:cT(null==H?void 0:H.className,null==d?void 0:d.className,null==V?void 0:V.backdrop),ownerState:U});return T||C||F&&!L?(0,Eo.jsx)(XM,{ref:N,container:m,disablePortal:S,children:(0,Eo.jsxs)(B,Yo({},Y,{children:[!E&&c?(0,Eo.jsx)(K,Yo({},G)):null,(0,Eo.jsx)(zM,{disableEnforceFocus:y,disableAutoFocus:v,disableRestoreFocus:w,isEnabled:R,open:C,children:yo.cloneElement(f,$)})]}))}):null})),WA=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],qA=fI(KA,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),JA=fI(GA,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),XA=fI("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ai(n.scroll)}`]]}})((({ownerState:e})=>Yo({height:"100%","@media print":{height:"auto"},outline:0},"paper"===e.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===e.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}))),ZA=fI(ND,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ai(n.scroll)}`],t[`paperWidth${Ai(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((({theme:e,ownerState:t})=>Yo({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===t.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===t.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!t.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===t.maxWidth&&{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${MA.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}},t.maxWidth&&"xs"!==t.maxWidth&&{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`,[`&.${MA.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t.maxWidth]+64)]:{maxWidth:"calc(100% - 64px)"}}},t.fullWidth&&{width:"calc(100% - 64px)"},t.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${MA.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}))),QA=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialog"}),o=BI(),r={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":a,BackdropComponent:s,BackdropProps:l,children:c,className:d,disableEscapeKeyDown:u=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:m="sm",onBackdropClick:g,onClick:h,onClose:b,open:v,PaperComponent:y=ND,PaperProps:x={},scroll:S="paper",TransitionComponent:w=hj,transitionDuration:_=r,TransitionProps:E}=n,T=Go(n,WA),I=Yo({},n,{disableEscapeKeyDown:u,fullScreen:p,fullWidth:f,maxWidth:m,scroll:S}),C=(e=>{const{classes:t,scroll:n,maxWidth:o,fullWidth:r,fullScreen:i}=e;return _I({root:["root"],container:["container",`scroll${Ai(n)}`],paper:["paper",`paperScroll${Ai(n)}`,`paperWidth${Ai(String(o))}`,r&&"paperFullWidth",i&&"paperFullScreen"]},CA,t)})(I),M=yo.useRef(),O=Wk(a),D=yo.useMemo((()=>({titleId:O})),[O]);return(0,Eo.jsx)(JA,Yo({className:cT(C.root,d),closeAfterTransition:!0,components:{Backdrop:qA},componentsProps:{backdrop:Yo({transitionDuration:_,as:s},l)},disableEscapeKeyDown:u,onClose:b,open:v,ref:t,onClick:e=>{h&&h(e),M.current&&(M.current=null,g&&g(e),b&&b(e,"backdropClick"))},ownerState:I},T,{children:(0,Eo.jsx)(w,Yo({appear:!0,in:v,timeout:_,role:"presentation"},E,{children:(0,Eo.jsx)(XA,{className:cT(C.container),onMouseDown:e=>{M.current=e.target===e.currentTarget},ownerState:I,children:(0,Eo.jsx)(ZA,Yo({as:y,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":O},x,{className:cT(C.paper,x.className),ownerState:I,children:(0,Eo.jsx)(OA.Provider,{value:D,children:c})}))})}))}))}));function eP(e){return bI("MuiDialogContent",e)}vI("MuiDialogContent",["root","dividers"]);const tP=vI("MuiDialogTitle",["root"]),nP=["className","dividers"],oP=fI("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((({theme:e,ownerState:t})=>Yo({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},t.dividers?{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}:{[`.${tP.root} + &`]:{paddingTop:0}}))),rP=yo.forwardRef((function(e,t){const n=wI({props:e,name:"MuiDialogContent"}),{className:o,dividers:r=!1}=n,i=Go(n,nP),a=Yo({},n,{dividers:r}),s=(e=>{const{classes:t,dividers:n}=e;return _I({root:["root",n&&"dividers"]},eP,t)})(a);return(0,Eo.jsx)(oP,Yo({className:cT(s.root,o),ownerState:a,ref:t},i))})),iP=fI(QA)({[`& .${MA.container}`]:{outline:0},[`& .${MA.paper}`]:{outline:0,minWidth:320}}),aP=fI(rP)({"&:first-of-type":{padding:0}}),sP=e=>{var t;const{children:n,DialogProps:o={},onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:d,componentsProps:u}=e,p=null!=(t=null==d?void 0:d.ActionBar)?t:UM;return(0,Eo.jsxs)(iP,Yo({open:c,onClose:a},o,{children:[(0,Eo.jsx)(aP,{children:n}),(0,Eo.jsx)(p,Yo({onAccept:r,onClear:i,onCancel:s,onSetToday:l,actions:["cancel","accept"]},null==u?void 0:u.actionBar))]}))},lP=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function cP(e){const{children:t,DateInputProps:n,DialogProps:o,onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,PureDateInputComponent:d,components:u,componentsProps:p}=e,f=Go(e,lP);return(0,Eo.jsxs)(nM.Provider,{value:"mobile",children:[(0,Eo.jsx)(d,Yo({components:u},f,n)),(0,Eo.jsx)(sP,{DialogProps:o,onAccept:r,onClear:i,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:u,componentsProps:p,children:t})]})}const dP=yo.forwardRef((function(e,t){const{disabled:n,getOpenDialogAriaText:o,inputFormat:r,InputProps:i,inputRef:a,label:s,openPicker:l,rawValue:c,renderInput:d,TextFieldProps:u={},validationError:p,className:f}=e,m=ZE(),g=o??m.openDatePickerDialogue,h=JE(),b=yo.useMemo((()=>Yo({},i,{readOnly:!0})),[i]),v=HD(h,c,r),y=UC((e=>{e.stopPropagation(),l()}));return d(Yo({label:s,disabled:n,ref:t,inputRef:a,error:p,InputProps:b,className:f},!e.readOnly&&!e.disabled&&{onClick:y},{inputProps:Yo({disabled:n,readOnly:!0,"aria-readonly":!0,"aria-label":g(c,h),value:v},!e.readOnly&&{onClick:y},{onKeyDown:iM(l)})},u))})),uP=["ToolbarComponent","value","onChange","components","componentsProps"],pP=yo.forwardRef((function(e,t){const n=rT(e,"MuiMobileDatePicker"),o=null!==zD(n),{pickerProps:r,inputProps:i,wrapperProps:a}=ak(n,iT),{ToolbarComponent:s=tM,components:l,componentsProps:c}=n,d=Go(n,uP),u=Yo({},i,d,{components:l,componentsProps:c,ref:t,validationError:o});return(0,Eo.jsx)(cP,Yo({},d,a,{DateInputProps:u,PureDateInputComponent:dP,components:l,componentsProps:c,children:(0,Eo.jsx)(EA,Yo({},r,{autoFocus:!0,toolbarTitle:n.label||n.toolbarTitle,ToolbarComponent:s,DateInputProps:u,components:l,componentsProps:c},d))}))})),fP=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],mP=yo.forwardRef((function(e,t){const n=fl({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:r,PopperProps:i,TransitionComponent:a}=n,s=Go(n,fP);return WE(o,{defaultMatches:!0})?(0,Eo.jsx)(IA,Yo({ref:t,PopperProps:i,TransitionComponent:a},s)):(0,Eo.jsx)(pP,Yo({ref:t,DialogProps:r},s))})),gP=e=>{const{value:t,defaultValue:n,onChange:o,minDate:r,maxDate:i,disabled:a,readOnly:s,toolbarTitle:l,disableFuture:c,disablePast:d,shouldDisableDate:u,shouldDisableMonth:p,shouldDisableYear:f,disableHighlightToday:m,referenceDate:g,inputFormat:h="DD.MM.YYYY",views:b=["year","day"],onError:v,loading:y,onClose:x,...S}=e,[w,_]=yo.useState(n||null),[E,T]=yo.useState(!1),I=yo.useMemo((()=>o&&typeof t<"u"?t:w),[w,o,t]),C=e=>{(null==e||!e.isValid())&&null!==e||(typeof t>"u"&&_(e),null==o||o(e))};return(0,Eo.jsx)(mP,{"data-name":"datepicker",value:I,onChange:C,renderInput:e=>(0,Eo.jsx)(KE,{muiTextfieldProps:e,inputFormat:h,onChangeHandler:C,textfieldProps:{...S,onClear:()=>C(null),onIconClick:s?void 0:()=>T((e=>!e))}}),open:E,inputFormat:h,onOpen:()=>T(!0),onClose:()=>{T(!1),null==x||x()},defaultCalendarMonth:g,disabled:a,disableFuture:c,disablePast:d,shouldDisableDate:u,shouldDisableMonth:p,shouldDisableYear:f,disableHighlightToday:m,readOnly:s,minDate:r,maxDate:i,toolbarTitle:l,onError:v,loading:y,views:b})},hP=()=>{var e,t,n,o,r;const{getLabel:i}=_p(),{column:a,open:s,setOpen:l,values:c}=yo.useContext(VE),d={dateRangeField:null==c?void 0:c.dateRange},u=null==(e=null==a?void 0:a.columnDef)?void 0:e.meta,p=(null==u?void 0:u.startDatePicker)??{},f=(null==u?void 0:u.endDatePicker)??{},m=i("table.filter"),g=i("table.filter.from"),h=i("table.filter.to"),b=`filter-date-${null==a?void 0:a.id}-from`,v=`filter-date-${null==a?void 0:a.id}-to`,y=i("table.filter.validation.to-before-from"),x=FE().shape({dateRangeField:FE().shape({from:CE().defined().nullable(),to:CE().defined().nullable().test("to-before-from",y,(function(e){const{from:t}=this.parent;return!(e&&t&&Ao(e).isBefore(Ao(t),"day"))}))})}),{values:S,errors:w,setFieldValue:_,handleReset:E,handleSubmit:T}=l_({initialValues:d,validationSchema:x,onSubmit:e=>{null==a||a.setFilterValue(e.dateRangeField),null==l||l(!1)},onReset:()=>{null==a||a.setFilterValue(""),null==l||l(!1)}});return yo.useEffect((()=>{var e;if(s&&!S.dateRangeField){const t=document.getElementById(b);null==(e=null==t?void 0:t.focus)||e.call(t,{preventScroll:!0})}}),[null==a?void 0:a.id,S.dateRangeField,s,b]),(0,Eo.jsx)("form",{onSubmit:T,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(Sp,{modifiers:"h5",children:m}),(0,Eo.jsx)(gP,{id:b,label:g,...p,name:g,value:null!=(t=S.dateRangeField)&&t.from?Ao(S.dateRangeField.from):null,input:{autoComplete:"off"},onChange:e=>{var t,n;_("dateRangeField.from",(null==e?void 0:e.toISOString())??null),e&&null!=(t=S.dateRangeField)&&t.to&&Ao(e).isAfter(Ao(null==(n=S.dateRangeField)?void 0:n.to),"day")&&_("dateRangeField.to",null)}}),(0,Eo.jsx)(gP,{id:v,label:h,shouldDisableDate:e=>{var t,n;return!(null==(t=S.dateRangeField)||!t.from||!Ao(e).isBefore(Ao(null==(n=S.dateRangeField)?void 0:n.from),"day"))},...f,name:h,value:null!=(n=S.dateRangeField)&&n.to?Ao(null==(o=S.dateRangeField)?void 0:o.to):null,input:{autoComplete:"off"},onChange:e=>_("dateRangeField.to",(null==e?void 0:e.toISOString())??null),helper:null!=(r=w.dateRangeField)&&r.to?{text:w.dateRangeField.to,type:"error"}:void 0}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:E,children:i("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:i("table.filter")})})]})]})})},bP={"choice-group":"choice-group-7127bc4c","choice-group__inner--indented":"choice-group__inner--indented-095d03f8","choice-group__item--extra-padding":"choice-group__item--extra-padding-defa3089"},vP=yo.createContext({name:"",inputType:"radio",onChange:()=>null,currentValue:[]}),yP=e=>{const{id:t,label:n,value:o,className:r,direction:i="column",disabled:a,colProps:s=("column"===i?{width:12}:{width:"auto",grow:1}),onChange:l,hideLabel:c,extraContent:d,tooltip:u}=e,{currentValue:p,inputType:f,name:m,onChange:g}=yo.useContext(vP),h=!!p&&("checkbox"===f?o===p||-1!==p.indexOf(o):o===p);return(0,Eo.jsx)(Ml,{...s,children:(0,Eo.jsx)(dw,{id:t,label:n,value:o,name:m,className:r,disabled:a,checked:h,onChange:(e,t)=>{null==g||g(e,t),null==l||l(e,t)},hideLabel:c,extraContent:d,tooltip:u})})},xP="radio-4b3e1d44",SP="radio--disabled-8a5be211",wP="radio__input-c3c0efa1",_P="radio__indicator-cb82800d",EP="radio__indicator--hover-a273c5aa",TP="radio__tooltip-icon-dc07bb33",IP="radio__extra-content-465c7a50",CP=e=>{const{id:t,label:n,value:o,className:r,disabled:i,onChange:a,hideLabel:s,extraContent:l,checked:c,defaultChecked:d,hover:u,name:p,tooltip:f,...m}=e,[g,h]=yo.useState(d||!1),b=yo.useRef(null),v=yo.useMemo((()=>a&&typeof c<"u"?c:g),[a,g,c]),y=_l(xP,{[SP]:i});return(0,Eo.jsxs)("div",{"data-name":"radio",className:r,...m,children:[(0,Eo.jsxs)(Cl,{gutter:0,children:[(0,Eo.jsxs)(Ml,{width:"auto",children:[(0,Eo.jsx)("input",{id:t,value:o,name:p,type:"radio",disabled:i,checked:v,onChange:e=>{typeof c>"u"&&h(null==e?void 0:e.target.checked),null==a||a(o,null==e?void 0:e.target.checked)},className:wP}),(0,Eo.jsx)("div",{"aria-hidden":"true",onClick:()=>{var e;return null==(e=b.current)?void 0:e.click()},className:_l(_P,{[EP]:u})})]}),(0,Eo.jsx)(Ml,{children:(0,Eo.jsxs)("label",{ref:b,className:y,htmlFor:t,children:[(0,Eo.jsx)("span",{className:_l({"visually-hidden":s}),children:n}),f&&(0,Eo.jsxs)(aw,{children:[(0,Eo.jsx)(lw,{children:(0,Eo.jsx)(Rp,{name:"info",color:"brand",size:16,display:"inline",className:TP})}),(0,Eo.jsx)(cw,{children:f})]})]})})]}),l&&(0,Eo.jsx)("div",{className:IP,children:l})]})},MP=e=>{const{id:t,label:n,value:o,className:r,direction:i="column",disabled:a,colProps:s=("column"===i?{width:12}:{width:"auto",grow:1}),onChange:l,hideLabel:c,extraContent:d,tooltip:u}=e,{currentValue:p,inputType:f,name:m,onChange:g}=yo.useContext(vP),h=!!p&&("checkbox"===f?o===p||-1!==p.indexOf(o):o===p);return(0,Eo.jsx)(Ml,{...s,children:(0,Eo.jsx)(CP,{id:t,label:n,value:o,name:m,className:r,disabled:a,checked:h,onChange:(e,t)=>{null==g||g(e,t),null==l||l(e,t)},hideLabel:c,extraContent:d,tooltip:u})})},OP={"filter-item__input":"filter-item__input-7c8ed8cf","filter-item__label":"filter-item__label-057b50f5","filter-item--disabled":"filter-item--disabled-ad10dc42","filter-item--checked":"filter-item--checked-9af66168","filter-item--positive-main":"filter-item--positive-main-a40378b9","filter-item--important-main":"filter-item--important-main-f57d26aa","filter-item--warning-main":"filter-item--warning-main-5629af6e"},DP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i,background:a}=e,{currentValue:s,inputType:l,name:c,onChange:d}=yo.useContext(vP),u=!!s&&("checkbox"===l?o===s||-1!==s.indexOf(o):o===s),p=_l(OP["filter-item"],null==i?void 0:i.className,{[OP["filter-item--disabled"]]:r},{[OP["filter-item--checked"]]:u},{[OP[`filter-item--${a}`]]:!!a});return(0,Eo.jsxs)(Ml,{...i,className:p,children:[(0,Eo.jsx)("input",{id:t,value:o,name:c,type:l,disabled:r,checked:u,onChange:e=>d(o,null==e?void 0:e.target.checked),className:OP["filter-item__input"]}),(0,Eo.jsx)("label",{htmlFor:t,className:OP["filter-item__label"],children:n})]})},kP="light-item__input-db1bda86",jP="light-item__label-4502df50",AP="light-item--disabled-ea5955c3",PP="light-item--checked-19c9facc",NP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i}=e,{currentValue:a,inputType:s,name:l,onChange:c}=yo.useContext(vP),d=!!a&&("checkbox"===s?o===a||-1!==a.indexOf(o):o===a),u=_l(null==i?void 0:i.className,{[AP]:r},{[PP]:d});return(0,Eo.jsxs)(Ml,{...i,className:u,children:[(0,Eo.jsx)("input",{id:t,value:o,name:l,type:s,disabled:r,checked:d,onChange:e=>c(o,null==e?void 0:e.target.checked),className:kP}),(0,Eo.jsx)("label",{htmlFor:t,className:jP,children:n})]})},RP={"selector-item":"selector-item-afa6036a","selector-item__input":"selector-item__input-d671bb71","selector-item__label":"selector-item__label-15347301","selector-item--disabled":"selector-item--disabled-133d2c07","selector-item--checked":"selector-item--checked-3caf6414","selector-item--column":"selector-item--column-cb724fe9","selector-item--column-reverse":"selector-item--column-reverse-1d916d7a","selector-item--row":"selector-item--row-733fd28b","selector-item--row-reverse":"selector-item--row-reverse-89fd4a76"},LP=e=>{const{id:t,label:n,value:o,disabled:r,colProps:i,direction:a}=e,{currentValue:s,inputType:l,name:c,onChange:d}=yo.useContext(vP),u=!!s&&("checkbox"===l?o===s||-1!==s.indexOf(o):o===s),p=_l(RP["selector-item"],null==i?void 0:i.className,RP[`selector-item--${a}`],{[RP["selector-item--disabled"]]:r},{[RP["selector-item--checked"]]:u});return(0,Eo.jsxs)(Ml,{...i,className:p,children:[(0,Eo.jsx)("input",{id:t,value:o,name:c,type:l,disabled:r,checked:u,onChange:e=>{null==d||d(o,null==e?void 0:e.target.checked)},className:RP["selector-item__input"]}),(0,Eo.jsx)("label",{htmlFor:t,className:RP["selector-item__label"],children:n})]})},FP=e=>{const{getLabel:t}=_p(),{id:n,className:o,label:r,required:i,helper:a,items:s,type:l="default",direction:c=("default"===l?"column":"row"),rowProps:d,name:u,inputType:p="radio",value:f,defaultValue:m,onChange:g,hideLabel:h,indeterminateCheck:b,indeterminateCheckProps:v={},...y}=e,{indented:x,...S}=v,w=(null==v?void 0:v.indented)??!0,_=a?(null==a?void 0:a.id)??`${n}-helper`:void 0,E=b&&"default"===l&&"checkbox"===p,[T,I]=yo.useState((()=>m||("checkbox"===p?[]:null))),C=(t=e.value)=>!!g&&typeof t<"u",M=C(f)?f:T,O=yo.useMemo((()=>0===(null==M?void 0:M.length)),[null==M?void 0:M.length]),D=yo.useMemo((()=>{var e;return(null==M?void 0:M.length)===(null==(e=null==s?void 0:s.filter((e=>!e.disabled)))?void 0:e.length)}),[null==M?void 0:M.length,s]),k=yo.useMemo((()=>!O&&!D),[D,O]),j=yo.useMemo((()=>{const e=D?"all":O?"none":"some";return"string"==typeof b?b:"function"==typeof b?b(e):b?t("all"===e?"table.filter.remove-all":"table.filter.select-all"):""}),[t,b,D,O]),A={name:u,inputType:p,onChange:(e,t)=>{let n=M;n="checkbox"===p&&n?Array.isArray(n)?t?[...n,e]:n.filter((t=>t!==e)):t?[n,e]:[n].filter((t=>t!==e)):e,C()||I(Array.isArray(n)?[...n]:n),null==g||g(n)},currentValue:M};let P,N,R=NP;switch(l){case"default":P=2,N=1,R="checkbox"===p?yP:MP;break;case"selector":P=0,N=0,R=LP;break;case"filter":P=2,N=2,R=DP;break;case"light":P=1,N=1,R=NP}const L=_l(bP["choice-group"],o),F=_l(bP["choice-group__inner"],null==d?void 0:d.className,{[bP["choice-group__inner--indented"]]:E&&w});return(0,Eo.jsx)(vP.Provider,{value:A,children:(0,Eo.jsxs)("fieldset",{"data-name":"choice-group",...y,className:L,id:n,name:u,"aria-describedby":_,children:[(0,Eo.jsx)("legend",{children:(0,Eo.jsx)(Vh,{id:n,label:r,required:i,hideLabel:h,renderWithoutLabel:!0})}),null!=s&&s.length?(0,Eo.jsxs)(Eo.Fragment,{children:[E&&(0,Eo.jsx)(dw,{id:`${n}-indeterminate`,value:"indeterminate",name:"indeterminate",...S,label:j,indeterminate:k,checked:D,onChange:(e,t)=>{var n;const o=D?[]:null==(n=null==s?void 0:s.filter((e=>!e.disabled)))?void 0:n.map((e=>e.value));C()||I([...o]),null==g||g(o)}}),(0,Eo.jsx)(Cl,{direction:c,gutterX:P,gutterY:N,...d,className:F,children:s.map(((e,t)=>(0,yo.createElement)(R,{...e,className:_l(e.className,{[bP["choice-group__item--extra-padding"]]:e.extraContent&&t!==s.length-1}),direction:c,key:e.id})))})]}):(0,Eo.jsx)("p",{children:t("table.filter.no-options")}),a&&(0,Eo.jsx)(Pp,{...a,id:_})]})})},UP=e=>{var t,n;return null==(n=null==(t=null==e?void 0:e.filter(Boolean))?void 0:t.filter(((e,t,n)=>(null==n?void 0:n.indexOf(e))===t)))?void 0:n.sort(((e,t)=>{var n;return"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?null==(n=null==e?void 0:e.localeCompare)?void 0:n.call(e,t):0}))},VP=()=>{var e,t,n,o;const{getLabel:r}=_p(),{column:i,rows:a,setOpen:s,values:l}=yo.useContext(VE),c=r("table.filter"),d=null==(e=null==i?void 0:i.columnDef)?void 0:e.filterFn,u="select"===d?"selectFilter":"multiSelectFilter",p={inputType:d,selectFilter:null==l?void 0:l.selectField,multiSelectFilter:null==l?void 0:l.multiSelectField},f=null==(t=null==i?void 0:i.columnDef)?void 0:t.meta,m=null==f?void 0:f.filterOptions,g=e=>"object"==typeof e&&null!==e&&"id"in e&&"label"in e&&"value"in e,h=null!=a&&a.length&&"string"==typeof(null==(n=null==i?void 0:i.columnDef)?void 0:n.id)?a.map((e=>{var t,n;return null==(n=null==e?void 0:e.getValue)?void 0:n.call(e,null==(t=null==i?void 0:i.columnDef)?void 0:t.id)})):[],b=null!=m&&m.length?g(m[0])?m:UP(m):UP(h),v=null==b?void 0:b.map(((e,t)=>{var n;return g(e)?e:{id:`${null==(n=null==i?void 0:i.columnDef)?void 0:n.id}-choice-${t}`,label:String(e),value:String(e)}})),{values:y,setFieldValue:x,handleReset:S,handleSubmit:w,errors:_}=l_({initialValues:p,onSubmit:e=>{var t;null==i||i.setFilterValue(null!=(t=e[u])&&t.length?e[u]:""),null==s||s(!1)},onReset:()=>{null==i||i.setFilterValue(""),null==s||s(!1)}});return(0,Eo.jsx)("form",{onSubmit:w,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(fb,{element:"h6",children:r("table.filter")}),(0,Eo.jsx)(sb,{className:jw.filter__content,children:(0,Eo.jsx)(Tb,{children:(0,Eo.jsx)(FP,{id:`filter-${u}-${null==i?void 0:i.id}`,name:c,label:c,hideLabel:!0,inputType:"select"===d?"radio":"checkbox",size:"small",value:y[u],indeterminateCheck:!0,indeterminateCheckProps:{indented:!1,className:jw.filter__indeterminate},items:v,onChange:e=>x(u,e),helper:0!==(null==(o=_[u])?void 0:o.length)?{text:_[u],type:"error"}:{text:""}})})}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:S,children:r("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:r("table.filter")})})]})]})})},$P=()=>{const{getLabel:e}=_p(),{column:t,open:n,setOpen:o,values:r}=yo.useContext(VE),i={filter:null==r?void 0:r.filter},a=`text-filter-${null==t?void 0:t.id}`,s=e("table.filter"),l=e("search"),c=e("table.filter.validation.min-length",3),d=FE().shape({filter:CE().notRequired().matches(/^(?!\s+$).*/,e("table.filter.validation.no-spaces")).min(3,c).nullable().transform((e=>e||null))}),{values:u,setFieldValue:p,handleReset:f,handleSubmit:m,touched:g,errors:h}=l_({initialValues:i,validationSchema:d,onSubmit:e=>{null==t||t.setFilterValue(e.filter),null==o||o(!1)},onReset:()=>{null==t||t.setFilterValue(""),null==o||o(!1)}});return yo.useEffect((()=>{var e;if(n&&!u.filter){const t=document.getElementById(a);null==(e=null==t?void 0:t.focus)||e.call(t,{preventScroll:!0})}}),[null==t?void 0:t.id,u.filter,n,a]),(0,Eo.jsx)("form",{onSubmit:m,children:(0,Eo.jsxs)(pp,{children:[(0,Eo.jsx)(BE,{id:a,label:s,placeholder:l,icon:"close",onIconClick:f,value:u.filter||"",onChange:e=>p("filter",e),helper:g.filter&&h.filter?{text:h.filter,type:"error"}:{text:c},input:{autoComplete:"off"}}),(0,Eo.jsxs)(Cl,{gutter:2,justifyContent:"end",children:[(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{visualType:"secondary",onClick:f,children:e("clear")})}),(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsx)(jp,{type:"submit",children:e("table.filter")})})]})]})})},BP=e=>{const{column:t,rows:n}=e,[o,r]=yo.useState(!1),{getLabel:i}=_p(),a=t.columnDef.filterFn,s=t.getFilterValue(),l=e=>"string"==typeof e,c=e=>Array.isArray(e),d=e=>"object"==typeof e&&null!==e&&("from"in e||"to"in e),u=yo.useMemo((()=>({filter:"auto"!==a&&"text"!==a||!l(s)?"":s,selectField:"select"===a&&l(s)?s:"",multiSelectField:"multi-select"===a&&c(s)?s:[],dateRange:["date-range","date-range-period"].includes(a)&&d(s)?s:{from:null,to:null}})),[a,s]);return(0,Eo.jsx)(VE.Provider,{value:{column:t,rows:n,values:u,open:o,setOpen:r},children:(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsxs)(aw,{openWith:"click",open:o,onToggle:r,focusManager:{order:["content"],initialFocus:0,modal:!0},children:[(0,Eo.jsx)(lw,{children:(0,Eo.jsx)(jp,{visualType:"link",icon:{filled:!!t.getFilterValue()||o,name:"filter_alt",className:_l(jw.filter__icon,{[jw["filter__icon--active"]]:!!t.getFilterValue()||o})},className:_l(jw.filter__button,"show-print"),children:(0,Eo.jsx)("span",{className:"sr-only",children:i("table.filter")})})}),(0,Eo.jsx)(cw,{maxWidth:"large",cardProps:{padding:{horizontal:1,vertical:.5}},children:(()=>{switch(a){case"date-range":case"date-range-period":return(0,Eo.jsx)(hP,{});case"multi-select":case"select":return(0,Eo.jsx)(VP,{});default:return(0,Eo.jsx)($P,{})}})()})]})})})},KP=()=>{const{table:e,loadingLabel:t}=yo.useContext(bw),n=(null==e?void 0:e.getState().pagination.pageSize)||10,o=n===HP?10:n;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)("tr",{className:"sr-only",children:(0,Eo.jsx)("td",{children:t})}),Array.from(Array(o).keys()).map((t=>(0,Eo.jsx)("tr",{"aria-hidden":!0,children:Array.from(Array(null==e?void 0:e.getAllColumns().length).keys()).map((e=>(0,Eo.jsx)("td",{children:(0,Eo.jsx)(HS,{width:100,height:21})},e)))},t)))]})},zP=()=>{var e;const{getLabel:t}=_p(),{table:n,id:o,caption:r,renderSubComponent:i,isFooterVisible:a,renderGroupHeading:s,onRowClick:l,isLoading:c,isError:d,hideRowBorder:u,placeholder:p,errorPlaceholder:f,size:m}=yo.useContext(bw);if(null===n)return null;const{getHeaderGroups:g,getFooterGroups:h,getRowModel:b}=n,v=(e,n)=>{const o=t("table.sort",e),r=_l(jw.sort__icon,{[jw["sort__icon--active"]]:!!e,[jw["sort__icon--desc"]]:"desc"===e,[jw["sort__icon--asc"]]:"asc"===e});return(0,Eo.jsx)(Tp,{visibility:"show",children:(0,Eo.jsx)(jp,{visualType:"link",icon:{name:e?"expand_more":"unfold_more",className:r},className:_l(jw.sort__button),onClick:n,children:(0,Eo.jsx)("span",{className:"sr-only",children:o})})})},y=e=>{const t=null==e?void 0:e.findIndex((e=>e.column.columnDef.footer));return(-1!==t?t:null==e?void 0:e.length)+1},x=()=>{let e;return b().rows.map(((t,n)=>{const{rowGroupKey:o,...r}=t.original,i=o=>{var r;return{...t,original:{...o,rowClassName:_l(o.rowClassName,jw["table__row--group-item"],{[jw["table__row--last-group-item"]]:(null==(r=b().rows[n+1])?void 0:r.original.rowGroupKey)!==e})}}};return o&&e!==o?(e=o,i(t.original)):o?i(r):(e=o,t)}))},S=e=>{var t;return(0,Eo.jsx)(Ml,{width:"auto",children:(0,Eo.jsxs)(Cl,{justifyContent:"end",alignItems:"center",gutter:1,children:[e.column.getCanFilter()?(0,Eo.jsx)(BP,{column:e.column,rows:null==(t=null==n?void 0:n.getCoreRowModel())?void 0:t.rows}):null,e.column.getCanSort()&&(0,Eo.jsx)(Ml,{align:"center",width:"auto",children:v(e.column.getIsSorted(),e.column.getToggleSortingHandler())})]})})},w=e=>{var t;const n=e.original.CustomRowComponent;return(0,Eo.jsxs)(yo.Fragment,{children:[e.original.rowGroupKey&&(0,Eo.jsx)(Tp,{breakAfter:"avoid",children:(0,Eo.jsx)("tr",{className:_l(null==(t=e.original.rowClassName)?void 0:t.replace(jw["table__row--group-item"],"").replace(jw["table__row--last-group-item"],""),jw["table__row--group-header"],{[jw["table__row--border-hidden"]]:u}),children:s?s(e):(0,Eo.jsx)("td",{colSpan:e.getVisibleCells().length,children:e.original.rowGroupKey})})}),n?(0,Eo.jsx)(Tp,{breakInside:"avoid",children:(0,Eo.jsx)(n,{...e})}):(0,Eo.jsx)(Tp,{breakInside:"avoid",children:(0,Eo.jsx)("tr",{className:_l(e.original.rowClassName,{[jw["table__row--clickable"]]:!!e.original.onClick||!!l,[jw["table__row--border-hidden"]]:u}),onClick:()=>(e=>{var t,n;null==(n=(t=e.original).onClick)||n.call(t,e.original),null==l||l(e.original)})(e),children:e.getVisibleCells().map((e=>(0,Eo.jsx)("td",{style:{width:e.column.getSize()},className:_l({[jw["sticky-column"]]:e.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===e.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===e.column.getIsPinned()}),children:my(e.column.columnDef.cell,e.getContext())},e.id)))})}),e.getIsExpanded()&&i?(0,Eo.jsx)(Tp,{breakBefore:"avoid",children:null==i?void 0:i(e)}):null]},e.id)};return(0,Eo.jsxs)("table",{id:o,children:[r&&(0,Eo.jsx)("caption",{className:"sr-only",children:r}),(0,Eo.jsx)("thead",{children:g().map((e=>(0,Eo.jsx)("tr",{children:e.headers.map((e=>(0,Eo.jsx)("th",{scope:"col",style:{width:e.getSize()},className:_l({[jw["th--sortable"]]:e.column.getCanSort(),[jw["sticky-column"]]:e.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===e.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===e.column.getIsPinned()}),"aria-sort":"asc"===e.column.getIsSorted()?"ascending":"desc"===e.column.getIsSorted()?"descending":void 0,children:e.isPlaceholder?null:(0,Eo.jsxs)(Cl,{gutter:"small"===m?2:void 0,alignItems:"center",justifyContent:"between",wrap:"nowrap",children:[(0,Eo.jsx)(Ml,{onClick:e.column.getToggleSortingHandler(),children:my(e.column.columnDef.header,e.getContext())}),(e.column.getCanFilter()||e.column.getCanSort())&&S(e)]})},e.id)))},e.id)))}),(0,Eo.jsx)("tbody",{children:c?(0,Eo.jsx)(KP,{}):null!=(e=x())&&e.length?x().map((e=>w(e))):(()=>{const e=d?(0,Eo.jsx)(kw,{...f}):(0,Eo.jsx)(kw,{...p});return(0,Eo.jsx)("tr",{children:(0,Eo.jsx)("td",{colSpan:null==n?void 0:n.getAllColumns().length,children:e})})})()}),a&&(0,Eo.jsx)("tfoot",{children:h().map((e=>(0,Eo.jsx)("tr",{children:e.headers.map(((t,n)=>t.column.columnDef.footer?(0,Eo.jsx)("th",{scope:"col",colSpan:y(e.headers.slice(n+1)),className:_l({[jw["sticky-column"]]:t.column.getIsPinned(),[jw["sticky-column--left"]]:"left"===t.column.getIsPinned(),[jw["sticky-column--right"]]:"right"===t.column.getIsPinned()}),children:t.isPlaceholder?null:my(t.column.columnDef.footer,t.getContext())},t.id):null))},e.id)))})]})},HP=1e4,YP=[];function GP(e){const{getLabel:t}=_p(),{id:n,data:o,columns:r,caption:i,columnFilters:a,onColumnFiltersChange:s,cardProps:{padding:l=0,...c}={},hidePagination:d,defaultPagination:u={pageIndex:0,pageSize:d?HP:10},pagination:p,manualPagination:f=!!e.pagination,manualSorting:m=!!e.sorting,manualFiltering:g=!!e.columnFilters,sorting:h,defaultSorting:b=[],defaultExpanded:v={},autoResetPageIndex:y,onPaginationChange:x,onSortingChange:S,rowSelection:w,onRowSelectionChange:_,enableRowSelection:E,defaultColumnVisibility:T={},columnVisibility:I,onColumnVisibilityChange:C,columnPinning:M,onColumnPinningChange:O,getRowId:D,onRowClick:k,defaultRowSelection:j,totalRows:A,renderSubComponent:P,getRowCanExpand:N,groupRowsBy:R,renderGroupHeading:L,isLoading:F=!1,isError:U=!1,placeholder:V,errorPlaceholder:$,loadingLabel:B=t("table.loading"),verticalAlign:K="middle",enableFilters:z=!1,enableSorting:H=!0,hideRowBorder:Y=!1,size:G="medium",hideCardBorder:W,...q}=e,J=yo.useMemo((()=>(null!=o&&o.length?o:YP)??YP),[o]),X=wb(),[{pageIndex:Z,pageSize:Q},ee]=yo.useState(u),[te,ne]=yo.useState(b),[oe,re]=yo.useState(v),[ie,ae]=yo.useState(j||{}),[se,le]=yo.useState([]),[ce,de]=yo.useState(T),[ue,pe]=yo.useState({left:[],right:[]}),fe=yo.useMemo((()=>!!X||oe),[oe,X]),me=yo.useMemo((()=>p||{pageIndex:Z,pageSize:Q}),[Z,Q,p]),ge=yo.useMemo((()=>h||te),[te,h]),he=yo.useMemo((()=>a||se),[se,a]),be=yo.useMemo((()=>w||ie),[ie,w]),ve=yo.useMemo((()=>I||ce),[ce,I]),ye=yo.useMemo((()=>M||ue),[ue,M]),xe=yo.useMemo((()=>{const e=(null==J?void 0:J.map((e=>"string"==typeof R?{...e,rowGroupKey:e[R]}:R?{...e,rowGroupKey:R(e)}:e)))??[];return e.reduce(((t,n)=>(n.rowGroupKey&&t.keys.includes(n.rowGroupKey)||(n.rowGroupKey?(t.keys=[...t.keys,n.rowGroupKey],t.list=[...t.list,...e.filter((e=>e.rowGroupKey===n.rowGroupKey))]):t.list=[...t.list,n]),t)),{keys:[],list:[]}).list}),[J,R]),Se=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=yo.useState((()=>({current:cy(t)}))),[o,r]=yo.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:xe,columns:r,state:{rowSelection:be,columnFilters:he,pagination:me,sorting:ge,expanded:fe,columnVisibility:ve,columnPinning:ye},manualSorting:m,manualFiltering:g,pageCount:p&&A?Math.ceil(A/p.pageSize):void 0,autoResetPageIndex:y,onRowSelectionChange:e=>{if("function"!=typeof e)return;const t=e(be);w&&_?_(t):ae(t)},enableRowSelection:E,onExpandedChange:re,onPaginationChange:e=>{if("function"!=typeof e)return;const t=e(me);p&&x?x(t):ee(t)},onSortingChange:e=>{if("function"!=typeof e)return;const t=e(ge);h&&S?S(t):ne(t)},onColumnFiltersChange:e=>{if("function"!=typeof e)return;const t=e(he);a&&s?s(t):le(t)},onColumnVisibilityChange:e=>{if("function"!=typeof e)return;const t=e(ve);I&&C?C(t):de(t)},onColumnPinningChange:e=>{if("function"!=typeof e)return;const t=e(ye);M&&O?O(t):pe(t)},getCoreRowModel:e=>gv((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const a=[];for(let l=0;l<t.length;l++){const c=Sv(e,e._getRowId(t[l],l,i),t[l],l,r,0,null==i?void 0:i.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=o(c.originalSubRows,r+1,c)))}return a};return n.rows=o(t),n}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>gv((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),a={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],s=a[r.id],l=s.sortUndefined,c=null!=(n=null==r?void 0:r.desc)&&n;let d=0;if(l){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);if(n||o){if("first"===l)return n?-1:1;if("last"===l)return n?1:-1;d=n&&o?0:n?l:-l}}if(0===d&&(d=s.sortingFn(e,t,r.id)),0!==d)return c&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getPaginationRowModel:fy(),getFilteredRowModel:e=>gv((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&r.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const a=(n??[]).map((e=>e.id)),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,d;o&&s&&l.length&&(a.push("__global__"),l.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){c=r[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return py(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),hv(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getExpandedRowModel:dy(),getRowCanExpand:N,getSubRows:e=>e.subRows,manualPagination:f,enableFilters:z,enableSorting:H,getRowId:D,filterFns:{text:(e,t,n)=>Cw(e,t,n,ww),select:(e,t,n)=>Cw(e,t,n,_w),"multi-select":(e,t,n)=>Cw(e,t,n,Ew),"date-range":(e,t,n)=>Cw(e,t,n,Tw),"date-range-period":(e,t,n)=>Cw(e,t,n,Iw)}}),we=!!Se.getFooterGroups().find((e=>!!e.headers.find((e=>e.column.columnDef.footer)))),_e=!(W||!d||we),Ee=!Y&&we&&!d,Te=_l(jw.table,jw[`table--vertical-align-${K}`],jw[`table--${G}`],{[jw["table--hidden-bottom-border"]]:_e,[jw["table--footer-bottom-border"]]:Ee}),Ie=(e,n)=>{const{children:o=t(`table.${e}`),isNested:r=!0,icon:i=("error"===e?"error":void 0),cardProps:{padding:a=1,...s}={},...l}=n||{cardProps:{}};return{children:o,isNested:r,icon:i,cardProps:{padding:a,...s},...l}};return(0,Eo.jsx)(bw.Provider,{value:{table:Se,id:n,caption:i,onRowClick:k,renderSubComponent:P,isFooterVisible:we,renderGroupHeading:L,placeholder:Ie("empty",V),errorPlaceholder:Ie("error",$),loadingLabel:B,isLoading:F,isError:U,hideRowBorder:Y,size:G},children:(0,Eo.jsx)(sb,{"data-name":"table",...q,borderless:W,padding:l,...c,children:(0,Eo.jsxs)(Tb,{children:[(0,Eo.jsx)("div",{className:Te,children:(0,Eo.jsx)(zP,{})}),!d&&Se&&(0,Eo.jsx)(Sw,{totalRows:A||Se.getFilteredRowModel().rows.length})]})})})}const WP=()=>(0,Eo.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Eo.jsxs)("g",{"clip-path":"url(#clip0_28747_2860)",children:[(0,Eo.jsx)("path",{d:"M28.8511 26.8C28.1722 27.9772 27.0884 28.8674 25.8017 29.3048C24.515 29.7422 23.1132 29.6969 21.8574 29.1773C20.6016 28.6578 19.5776 27.6994 18.9761 26.4808C18.3745 25.2621 18.2365 23.8664 18.5878 22.5536C18.9391 21.2407 19.7557 20.1004 20.8854 19.345C22.0151 18.5896 23.3809 18.2707 24.7283 18.4477C26.0758 18.6246 27.3129 19.2854 28.2093 20.3069C29.1056 21.3284 29.6 22.641 29.6003 24H18.4003",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M24.0049 8V10.4",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M10.1465 15.9954L12.225 17.1954",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M10.1406 31.9954L12.2191 30.7954",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M23.9951 40V37.6",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M37.8539 32.0046L35.7754 30.8046",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M37.8588 16.0045L35.7803 17.2045",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),(0,Eo.jsx)("path",{d:"M28 46.8493C33.8841 45.8139 39.1414 42.5469 42.6753 37.7296C46.2092 32.9123 47.7468 26.9166 46.9675 20.9932C46.1882 15.0697 43.1521 9.67575 38.4925 5.9364C33.8329 2.19704 27.9095 0.40098 21.9578 0.922824C16.0061 1.44467 10.4857 4.24412 6.54787 8.7373C2.61007 13.2305 0.558967 19.0705 0.822366 25.0392C1.08576 31.0079 3.64332 36.6445 7.96161 40.7733C12.2799 44.9022 18.0255 47.2044 24 47.2",stroke:"#005AA3","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]}),(0,Eo.jsx)("defs",{children:(0,Eo.jsx)("clipPath",{id:"clip0_28747_2860",children:(0,Eo.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]}),qP=e=>{let{...t}=e;return(0,Eo.jsx)(GP,{columnPinning:{right:["actions"]},placeholder:{icon:(0,Eo.jsx)(WP,{})},...t})},JP=()=>{const e=(0,wo.useIntl)(),{linkGen:t}=(0,yo.useContext)(Ub),{proceedings:n,isLoading:o,isError:r}=(0,xl.useSelector)(Zn),[i,a]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{a(((e,t)=>[uv.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Proceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),uv.accessor((e=>e.planningName),{id:"planningName",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),uv.accessor((e=>e.stateCode),{id:"stateCode",cell:t=>{const n=t.row.original,o=n.stateCode?cv(n.stateCode,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_state"})}),uv.accessor((e=>e.dateStart),{id:"dateStart",cell:e=>{const t=e.row.original;return t.dateStart?rv.dateToStr(t.dateStart):"-"},header:e.formatMessage({id:"my_plannings.table.header.proceeding_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),uv.accessor((e=>e.document),{id:"document",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.document,void 0,!0),children:n.document})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),uv.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),uv.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})])(e,t))}),[n]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:n,columns:i,id:"plannings-proceedings-table"})},XP=()=>{const e=(0,wo.useIntl)();return(0,Eo.jsxs)(cb,{id:mn.PlanningsProceedings,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsProceedings}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(JP,{})})]})};function ZP(e,t){const n=(e,t,n)=>({name:e,oldType:t,newType:n});switch(Un[e]){case Un.DO_DOKUSEIS_ESITATUD:return n(t.formatMessage({id:"document.status.submitted"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_KEHTETU:return n(t.formatMessage({id:"document.status.void"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_KOOSTAMISEL:case Un.DO_DOKUSEIS_EELNOU_AKTIIVNE:return n(t.formatMessage({id:"document.status.being_created"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_ALLKIRJASTAMISEL:return n(t.formatMessage({id:"document.status.waiting_signatures"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MENETLUSES:return n(t.formatMessage({id:"document.status.being_processed"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MUUTMISEL:return n(t.formatMessage({id:"document.status.being_edited"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_TAIENDAMISEL:return n(t.formatMessage({id:"document.status.being_revised"}),nn.Warning,on.Warning);case Un.DO_DOKUSEIS_TYHISTATUD:return n(t.formatMessage({id:"document.status.canceled"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_VANA_VERSIOON:return n(t.formatMessage({id:"document.status.old_version"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_LOOBUTUD:return n(t.formatMessage({id:"document.status.withdrawn"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_ALLKIRJASTATUD:return n(t.formatMessage({id:"document.status.signed"}),nn.Info,on.Info);case Un.DO_DOKUSEIS_MENETLETUD:return n(t.formatMessage({id:"document.status.processed"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_LUBATUD:return n(t.formatMessage({id:"document.status.allowed"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_LUB_TEAV:return n(t.formatMessage({id:"document.status.allowed"}),nn.Warning,on.Warning);case Un.DO_DOKUSEIS_KEELDUTUD:return n(t.formatMessage({id:"document.status.denied"}),nn.Danger,on.Danger);case Un.DO_DOKUSEIS_TEAVITATUD:return n(t.formatMessage({id:"document.status.notified"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_REG_KANTUD:return n(t.formatMessage({id:"document.status.registered"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_ANTUD:return n(t.formatMessage({id:"document.status.given"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_EM_KINNITATUD_AKTUAL:case Un.DO_DOKUSEIS_KEHTIV:return n(t.formatMessage({id:"document.status.valid"}),nn.Success,on.Success);case Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS:return n(t.formatMessage({id:"document.status.invalidated"}),nn.Default,on.Default);case Un.DO_DOKUSEIS_KOOSK_RINGIL:return n(t.formatMessage({id:"document.status.waiting_approval"}),nn.Info,on.Info);default:return n(e,nn.Default,on.Default)}}const QP={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},eN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r}=e;const i=(0,wo.useIntl)(),{linkGen:a}=(0,yo.useContext)(Ub),[s,l]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{l(((e,t)=>{const n=[QP.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),QP.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),QP.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),QP.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),QP.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),QP.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>{const t=e.row.original.interestedPerson;return(null==t?void 0:t.length)&&t.join(", ")},header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(i,a))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:s,id:`plannings-table-${n}`})},tN=()=>{const e=(0,wo.useIntl)(),{documents:t,isLoading:n,isError:o}=(0,xl.useSelector)(to);return(0,Eo.jsxs)(cb,{id:mn.PlanningsIncoming,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsIncoming}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(eN,{documents:t,isLoading:n,isError:o,documentType:tn.Incoming})})]})},nN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},oN=e=>{var t,n;let{documents:o,documentType:r,isLoading:i,isError:a,pagination:s,sorting:l,userInfo:c}=e;const d=(0,wo.useIntl)(),u=(0,xl.useDispatch)(),{linkGen:p}=(0,yo.useContext)(Ub),[f,m]=(0,yo.useState)([]);(0,yo.useEffect)((()=>{m(((e,t)=>{const n=[nN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),nN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),nN.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.proceeding_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),nN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),nN.accessor((e=>e.areaCode),{id:"areaCode",cell:e=>e.row.original.areaCode,header:e.formatMessage({id:"my_plannings.table.header.planning_code"})}),nN.accessor((e=>e.areaName),{id:"areaName",cell:e=>e.row.original.areaName,header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),nN.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>{const t=e.row.original.interestedPerson;return(null==t?void 0:t.length)&&t.join(", ")},header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(d,p))}),[o]);return(0,Eo.jsx)(qP,{isLoading:i,isError:a,data:null!==(t=null==o?void 0:o.content)&&void 0!==t?t:[],columns:f,id:`plannings-table-${r}`,manualPagination:!0,pagination:s,onPaginationChange:e=>{u(ro(e)),u(Hn({userInfo:c,pagination:e}))},onSortingChange:e=>{u(io(e)),u(Hn({userInfo:c,sorting:e}))},manualSorting:!0,sorting:l,totalRows:null!==(n=null==o?void 0:o.totalElements)&&void 0!==n?n:0})},rN=e=>{let{userInfo:t}=e;const n=(0,wo.useIntl)(),{documents:o,isLoading:r,isError:i,pagination:a,sorting:s}=(0,xl.useSelector)(no);return(0,Eo.jsxs)(cb,{id:mn.PlanningsOngoing,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:n.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsOngoing}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(oN,{isLoading:r,isError:i,documents:o,documentType:tn.Working,pagination:a,sorting:s,userInfo:t})})]})},iN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},aN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r,showDefaultVersion:i}=e;const a=(0,wo.useIntl)(),{linkGen:s}=(0,yo.useContext)(Ub),[l,c]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{c(i?((e,t)=>{const n=[iN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),iN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),iN.accessor((e=>e.regDate),{id:"regDate",cell:e=>{const t=e.row.original;return t.regDate?rv.dateToStr(t.regDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),iN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),iN.accessor((e=>e.areaCode),{id:"areaCode",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.planning_code"})}),iN.accessor((e=>e.areaName),{id:"areaName",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),iN.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>{const t=e.row.original.interestedPerson;return(null==t?void 0:t.length)&&t.join(", ")},header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(a,s):((e,t)=>{const n=[iN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),iN.accessor((e=>e.areaName),{id:"planningName",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.planning_name"})}),iN.accessor((e=>e.regDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.regDate?rv.dateToStr(t.regDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),iN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),iN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.Document,n.docNr,void 0,!0),children:n.docNr})},header:e.formatMessage({id:"my_plannings.table.header.doc_nr"})}),iN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),iN.accessor((e=>e.interestedPerson),{id:"interestedPerson",cell:e=>{const t=e.row.original.interestedPerson;return(null==t?void 0:t.length)&&t.join(", ")},header:e.formatMessage({id:"my_plannings.table.header.interested_person"})})];return n})(a,s))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:l,id:`plannings-table-${n}`})},sN=e=>{let{showDefaultVersion:t}=e;const n=(0,wo.useIntl)(),{documents:o,isLoading:r,isError:i}=(0,xl.useSelector)(oo);return(0,Eo.jsxs)(cb,{id:mn.PlanningsCompleted,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:n.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsCompleted}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(aN,{isLoading:r,isError:i,documents:o,documentType:tn.Finished,showDefaultVersion:t})})]})},lN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},cN=()=>{const e=(0,wo.useIntl)(),{linkGen:t}=(0,yo.useContext)(Ub),{operations:n,isLoading:o,isError:r}=(0,xl.useSelector)(eo),[i,a]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{a(((e,t)=>{const n=[lN.accessor((e=>e.deadline),{id:"deadline",cell:e=>{const t=e.row.original;return t.deadline?rv.dateToStr(t.deadline):"-"},header:e.formatMessage({id:"my_plannings.table.header.deadline"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),lN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),lN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=n.state?cv(n.state,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.comment_state"})}),lN.accessor((e=>e.operationExecutor),{id:"proceeder",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.proceeder"})}),lN.accessor((e=>e.doty),{id:"documentType",cell:e=>{var t,n;const o=e.row.original;return(0,Eo.jsx)(Eo.Fragment,{children:null!==(t=null===(n=Rn.find((e=>e.code===o.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""})},header:e.formatMessage({id:"my_plannings.table.header.document_type"})})];return n})(e,t))}),[n]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:n,columns:i,id:"plannings-operations-table"})},dN=()=>{const e=(0,wo.useIntl)();return(0,Eo.jsxs)(cb,{id:mn.PlanningsToComment,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsToComment}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(cN,{})})]})},uN={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},pN=e=>{let{documents:t,documentType:n,isLoading:o,isError:r}=e;const i=(0,wo.useIntl)(),{linkGen:a}=(0,yo.useContext)(Ub),[s,l]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{l(((e,t,n)=>{const o=[uN.accessor((e=>e.docNr),{id:"docNr",cell:e=>{const t=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>n(e,iv.Document,t.docNr,void 0,!0),children:t.docNr})},header:e.formatMessage({id:"my_plannings.table.header.document_nr"})}),uN.accessor((e=>e.documentType),{id:"documentType",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.document_type"})}),uN.accessor((e=>e.docDate),{id:"docDate",cell:e=>{const t=e.row.original;return t.docDate?rv.dateToStr(t.docDate):"-"},header:e.formatMessage({id:"my_plannings.table.header.document_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),uN.accessor((e=>e.state),{id:"state",cell:t=>{const n=t.row.original,o=ZP(n.stateCode,e);return(0,Eo.jsx)(Eo.Fragment,{children:n.state&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_plannings.table.header.document_state"})}),uN.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const t=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>n(e,iv.PlanningProceeding,t.proceedingNr,void 0,!0),children:t.proceedingNr})},header:e.formatMessage({id:"my_plannings.table.header.proceeding_nr"})}),uN.accessor((e=>e.presenter),{id:"proceeder",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_plannings.table.header.proceeder"})})];return o})(i,0,a))}),[t]),(0,Eo.jsx)(qP,{isLoading:o,isError:r,data:t,columns:s,id:`plannings-table-${n}`})},fN=()=>{const e=(0,wo.useIntl)(),{documents:t,isLoading:n,isError:o}=(0,xl.useSelector)(Qn);return(0,Eo.jsxs)(cb,{id:mn.PlanningsToSign,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_plannings.page.section_title.${mn.PlanningsToSign}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(pN,{documents:t,isLoading:n,isError:o,documentType:tn.Signing})})]})},mN=(0,u.createAsyncThunk)("myPlannings/getAllPlanningsData",(async(e,t)=>{let{userInfo:n}=e,{dispatch:o}=t;o(Fn({userInfo:n})),o(Kn({userInfo:n})),o(Jn({userInfo:n})),o(zn({userInfo:n})),o(Hn({userInfo:n})),o(Yn({userInfo:n}))})),gN=e=>[cn,dn].includes(e),hN=e=>{let{userInfo:t}=e;const n=(0,wo.useIntl)(),{linkGen:o}=(0,yo.useContext)(Ub),[r,i]=(0,yo.useState)(!1),[a,s]=(0,yo.useState)([]),[l,c]=(0,yo.useState)("");(0,yo.useEffect)((()=>{u()}),[t]);const d=()=>{i((e=>!e))},u=()=>{const e=(null===(o=t.activeRole)||void 0===o?void 0:o.businessType)===ln.KOV?[Cn,Mn.code,On.code]:4406958===(null===(r=t.activeRole)||void 0===r?void 0:r.businessId)?[Dn.code,kn.code]:gN(null===(i=t.activeRole)||void 0===i?void 0:i.businessId)?[kn.code]:[];var o,r,i;c(e[0]||"");const a=e.map((e=>({id:e,key:e,title:n.formatMessage({id:`plannings.type.${e}`}),description:(0,Eo.jsx)(Cl,{children:(0,Eo.jsxs)(Sp,{children:[(0,Eo.jsx)(wo.FormattedMessage,{id:`plannings.type.${e}.description`}),(0,Eo.jsx)("br",{})]})})})));s(a)};return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(jp,{id:"modal-new-plan",visualType:"primary",iconLeft:"add",onClick:d,children:n.formatMessage({id:"my_plannings.page.button.existing_planning"})}),(0,Eo.jsx)(Fb,{toggleVisible:d,primaryText:"button.begin",secondaryText:"button.cancel",onPrimary:()=>{var e;(e=l)&&o(void 0,fn.Document,"",{doty:e},!0)},onSecondary:()=>{var e;c((null===(e=a[0])||void 0===e?void 0:e.key)||""),d()},size:6,visible:r,title:"my_plannings.modal.title.add_existing_planning",cardProps:{border:"top-positive-main"},children:(0,Eo.jsx)(Cb,{selectItems:a,value:l,onChange:c})})]})},bN=[mn.PlanningsProceedings,mn.PlanningsToSign,mn.PlanningsToComment,mn.PlanningsIncoming,mn.PlanningsOngoing,mn.PlanningsCompleted],vN=e=>{var t,n;let{userInfo:o,linkGen:r}=e;const i=(0,xl.useDispatch)(),a=(0,yo.useMemo)((()=>({linkGen:r})),[r]);(0,yo.useEffect)((()=>{o&&i(mN({userInfo:o}))}),[]);const s=[ln.MKM,ln.KOV,ln.RPLAN].includes(null===(t=o.activeRole)||void 0===t?void 0:t.businessType)||gN(null===(n=o.activeRole)||void 0===n?void 0:n.businessId);return(0,Eo.jsx)(Cl,{id:"MyPlanningsPage",gutter:0,children:(0,Eo.jsx)(Ml,{children:(0,Eo.jsx)(Ub.Provider,{value:a,children:(0,Eo.jsxs)(pp,{size:.5,children:[(0,Eo.jsx)(bp,{title:"my_plannings.page_title"}),(0,Eo.jsxs)(Cl,{justifyContent:"end",gutter:0,gap:2,children:[s&&(0,Eo.jsx)(hN,{userInfo:o}),(0,Eo.jsx)($b,{})]}),(0,Eo.jsxs)(gp,{defaultOpenItem:bN,gutter:1,children:[s&&(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(XP,{}),(0,Eo.jsx)(fN,{}),(0,Eo.jsx)(dN,{}),(0,Eo.jsx)(tN,{})]}),(0,Eo.jsx)(rN,{userInfo:o}),(0,Eo.jsx)(sN,{showDefaultVersion:!s})]})]})})})})},yN=e=>(0,Eo.jsx)(yl,{locale:"et",children:(0,Eo.jsx)(vN,{...e})});function xN(e,t,n){const o=n(e).trim(),r=n(t).trim();return o.toLowerCase()===r.toLowerCase()?0:""===o?1:""===r?-1:o.toLowerCase()>r.toLowerCase()?1:-1}function SN(e,t,n){const o=n(e),r=n(t);return o===r?0:o>r?1:-1}function wN(e){if("0"===e.done&&"0"===e.all)return 15;if(e.done===e.all)return 9;let t=parseInt(e.done)/parseInt(e.all);return 1===t&&(t+=parseInt(e.all)/1e4),t}function _N(e,t,n){const o=n(e),r=n(t),i=wN(o),a=wN(r);return a===i?0:i>a?1:-1}function EN(e,t,n){const o=n(e),r=n(t);return o===r?0:o>r?1:-1}function TN(e,t,n){if(0===e.length)return e;const o={string:xN,number:SN,object:_N,date:EN}[typeof t(e[0])],r=[...e].sort(((e,r)=>o(e,r,t)*n));return r}const IN=0,CN=1,MN=-1;function ON(e,t){return{column:e,direction:e===t.column?function(e){switch(e){case IN:return CN;case CN:return MN;case MN:return CN}}(t.direction):CN}}const DN=e=>-1===e.sortDirection?(0,Eo.jsx)("svg",{width:"10",height:"8",viewBox:"0 8 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}):1===e.sortDirection?(0,Eo.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}):(0,Eo.jsx)("svg",{width:"10",height:"16",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eo.jsx)("path",{d:"M1.55 6.05L5 2.6L8.45 6.05L9.5 5L5 0.5L0.5 5L1.55 6.05ZM1.55 9.95L5 13.4L8.45 9.95L9.5 11L5 15.5L0.5 11L1.55 9.95Z",fill:"#5D6071"})}),kN=e=>{const[t,n]=(0,yo.useState)(!1);return(0,Eo.jsx)(Eo.Fragment,{children:e.fileId&&(0,Eo.jsx)(_o.ControlledPopover,{content:(0,Eo.jsxs)("div",{style:{width:"250px"},children:[(0,Eo.jsx)("h4",{children:(0,Eo.jsx)(wo.FormattedMessage,{id:"download.file"})}),(0,Eo.jsx)("br",{}),(0,Eo.jsxs)("div",{className:"d-flex justify-content-between mt-2",children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",type:"reset",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",onClick:()=>{e.fileId&&e.fileApi.downloadFile(e.fileId,{responseType:"blob"}).then((e=>{const o=e.headers["content-disposition"];let r="download";if(o){const e=o.match(/filename\*=UTF-8''(.+?)(;|$)/);e&&e.length>=2&&(r=decodeURIComponent(e[1].replace(/\+/g," ")))}const i=new Blob([e.data],{}),a=document.createElement("a");a.download=r,a.href=URL.createObjectURL(i),a.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(a.href)),3e4)})),a.click(),n(!t)})).catch((e=>console.log(e)))},squared:!0,type:"submit",children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.download"})})]})]}),open:t,placement:"bottom-end",toggle:()=>n(!t),children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.download"}),type:"download"})})})},jN=[{code:Un.DO_DOKUSEIS_ESITATUD,value:"Esitatud"},{code:Un.DO_DOKUSEIS_KOOSTAMISEL,value:"Koostamisel"},{code:Un.DO_DOKUSEIS_MENETLUSES,value:"Menetluses"},{code:Un.DO_DOKUSEIS_MUUTMISEL,value:"Muutmisel"},{code:Un.DO_DOKUSEIS_TAIENDAMISEL,value:"Täiendamisel"}],AN=[{code:Un.DO_DOKUSEIS_KEHTETU,value:"Kehtetu"},{code:Un.DO_DOKUSEIS_REG_KANTUD,value:"Registrisse kantud"},{code:Un.DO_DOKUSEIS_TYHISTATUD,value:"Tühistatud"},{code:Un.DO_DOKUSEIS_LOOBUTUD,value:"Tagasi võetud"}];function PN(e){let t=[];e===Kt?t=jN:e===zt&&(t=AN);const n=t.sort(((e,t)=>e.value.localeCompare(t.value)));return function(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}(n)}function NN(e,t){if(t.documentTypes.length>0&&(e=e.filter((e=>void 0!==e.doty&&t.documentTypes.includes(e.doty)))),t.ehrCode.length>0&&(e=e.filter((e=>{var n;return null===(n=e.ehrCode)||void 0===n?void 0:n.some((e=>{var n;return null!==(n=e.startsWith(t.ehrCode.trim()))&&void 0!==n&&n}))}))),t.buildingName.length>0&&(e=e.filter((e=>{var n;return null===(n=e.buildingName)||void 0===n?void 0:n.some((e=>{var n,o;return null!==(n=null==e||null===(o=e.toLocaleLowerCase())||void 0===o?void 0:o.includes(t.buildingName.toLocaleLowerCase()))&&void 0!==n&&n}))}))),t.wordInAddress.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.buildingAddress)||void 0===o?void 0:o.some((e=>null==e?void 0:e.toLocaleLowerCase().includes(t.wordInAddress.trim().toLocaleLowerCase()))))&&void 0!==n&&n}))),t.documentNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.docNr)||void 0===o?void 0:o.includes(t.documentNumber.trim()))&&void 0!==n&&n}))),t.documentStates.length>0&&(e=e.filter((e=>{return(n=e.stateCode)&&[Un.DO_DOKUSEIS_MENETLETUD,Un.DO_DOKUSEIS_LUBATUD,Un.DO_DOKUSEIS_LUB_TEAV,Un.DO_DOKUSEIS_KEELDUTUD,Un.DO_DOKUSEIS_TEAVITATUD,Un.DO_DOKUSEIS_REG_KANTUD,Un.DO_DOKUSEIS_ANTUD,Un.DO_DOKUSEIS_KEHTIV].includes(n)?t.documentStates.includes(Un.DO_DOKUSEIS_REG_KANTUD):e.stateCode&&t.documentStates.includes(e.stateCode);var n}))),t.institutionUsers.length>0&&(e=e.filter((e=>(void 0!==e.presenter||null!==e.presenter)&&t.institutionUsers.find((t=>{var n;return!0===(null===(n=e.connectedPersonId)||void 0===n?void 0:n.includes(t))}))))),t.proceedingNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.proceedingNr)||void 0===o?void 0:o.includes(t.proceedingNumber.trim()))&&void 0!==n&&n}))),t.institutions.length>0&&(e=e.filter((e=>void 0!==e.institutionId&&t.institutions.includes(e.institutionId)))),!0===t.proceedingMissing&&(e=e.filter((e=>null===e.proceedingNr||void 0===e.proceedingNr))),t.documentDate.from.length>0&&0===t.documentDate.to.length){const n=new Date(t.documentDate.from).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.documentDate.to.length>0&&0===t.documentDate.from.length){const n=new Date(t.documentDate.to).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.documentDate.from.length>0&&t.documentDate.to.length>0){const n=new Date(t.documentDate.from).getTime(),o=new Date(t.documentDate.to).getTime();e=e.filter((e=>new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n&&new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=o))}return e}function RN(e){var t,n,o,r;const[i,a]=(0,yo.useState)(!1);function s(){a(!i)}const l=(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("h4",{children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kas olete kindel, et soovite selle rea kustutada?",id:null!==(t=e.titleText)&&void 0!==t?t:"common.confirmation.modal.header"})}),(0,Eo.jsx)("p",{children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kustutatud ridu ei ole võimalik hiljem taastada",id:null!==(n=e.messageText)&&void 0!==n?n:"common.confirmation.modal.description"})}),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",squared:!0,type:"reset",children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Loobun",id:"common.confirmation.modal.no"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"danger",onClick:()=>(e.onConfirm(),void s()),squared:!0,type:"submit",children:(0,Eo.jsx)(wo.FormattedMessage,{defaultMessage:"Kustutan",id:"common.confirmation.modal.yes"})})]})]});return(0,Eo.jsx)(_o.ControlledPopover,{delegateFocusOnOpen:null===(o=e.delegateFocusOnOpen)||void 0===o||o,className:"popover-confirm",content:e.content||l,open:i,placement:"top-end",theme:"danger",toggle:()=>s(),wrapperClassName:null!==(r=e.wrapperClassName)&&void 0!==r?r:"",children:e.children})}function LN(e){return(0,Eo.jsx)(RN,{titleText:e.titleText,messageText:e.messageText,onConfirm:e.onConfirm,children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.delete"}),type:"delete"})})}const FN=e=>{let{linkName:t,functionCall:n,tooltipText:o}=e;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(_o.Link,{onClick:e=>null==n?void 0:n(e),text:(0,Eo.jsx)(_o.Text,{raw:t})}),(0,Eo.jsx)(_o.Info,{tooltipText:o})]})};var UN,VN=new Uint8Array(16);function $N(){if(!UN&&!(UN="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return UN(VN)}const BN=/^(?:[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;const KN=function(e){return"string"==typeof e&&BN.test(e)};for(var zN=[],HN=0;HN<256;++HN)zN.push((HN+256).toString(16).substr(1));const YN=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(zN[e[t+0]]+zN[e[t+1]]+zN[e[t+2]]+zN[e[t+3]]+"-"+zN[e[t+4]]+zN[e[t+5]]+"-"+zN[e[t+6]]+zN[e[t+7]]+"-"+zN[e[t+8]]+zN[e[t+9]]+"-"+zN[e[t+10]]+zN[e[t+11]]+zN[e[t+12]]+zN[e[t+13]]+zN[e[t+14]]+zN[e[t+15]]).toLowerCase();if(!KN(n))throw TypeError("Stringified UUID is invalid");return n};const GN=function(e,t,n){var o=(e=e||{}).random||(e.rng||$N)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=o[r];return t}return YN(o)},WN=e=>{let{notificationStyle:t,header:n,link:o,body:r,onCloseNotification:i,isNotClosable:a,customBody:s}=e;const l=(0,wo.useIntl)(),c=null!=s?s:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("h3",{className:"alert-heading",children:n}),(0,Eo.jsx)("p",{className:"alert-body mb-0",children:r}),o&&(0,Eo.jsx)("div",{className:"mx-2",children:(0,Eo.jsx)(_o.Link,{onClick:o.onClick,text:l.formatMessage({id:o.text})})})]});return a?(0,Eo.jsx)("div",{id:"danger-toast",className:`alert ${t}`,children:c}):(0,Eo.jsxs)("div",{id:"danger-toast",className:`alert alert-toast-box ${t}`,children:[(0,Eo.jsx)("a",{className:"toast-close icon-close",role:"button","data-toggle":"tooltip","data-tooltip-placement":"bottom","data-tooltip-class":"tooltip-icon","data-tooltip-trigger":"hover focus","data-tooltip-title":"Sulgen","aria-label":"Sulgen","data-animation":"false",onClick:i}),c]})};let qN=function(e){return e.Danger="danger",e.Warning="warning",e.Info="info",e.Success="success",e}({});const JN=()=>{const e=(0,wo.useIntl)(),t=(0,xl.useDispatch)(),n=(0,xl.useSelector)(Lt),[o,r]=(0,yo.useState)();(0,yo.useEffect)((()=>{n&&r(n)}),[n]);const i=t=>{if(t)return"string"==typeof t?e.formatMessage({id:t}):t.values?e.formatMessage({id:t.id},{...t.values}):e.formatMessage({id:t.id})};return(0,Eo.jsx)(Eo.Fragment,{children:(0,Eo.jsx)("div",{className:"notification-alert-box",children:(0,Eo.jsx)("ul",{children:(null==o?void 0:o.length)>0&&o.map((e=>{var n;return(0,Eo.jsx)("li",{children:e.theme&&(0,Eo.jsx)(WN,{notificationStyle:"alert-"+e.theme+" show",header:i(null!==(n=e.messageCode)&&void 0!==n?n:e.header),body:e.messageCode?void 0:i(e.body),onCloseNotification:()=>{return n=e.id,void t(Vt(n));var n},link:e.link})},e.id)}))})})})},XN=(0,u.createAsyncThunk)("globalUI/handleNotification",(async(e,t)=>{let{dispatch:n,getState:o}=t;const r=o().myViewsPage.notifications.notices,i=GN(),a={...e,id:i};n(Ut([...r,a])),e.theme!==qN.Danger&&setTimeout((()=>{n(Vt(i))}),7e3)})),ZN=(0,u.createAsyncThunk)("document/createDocument",(async(e,t)=>{let{addEntityDto:n,successCallback:o}=e,{dispatch:r}=t;try{const e=await ft.documentApiService.createDocument(n.documentType,n);return o&&o(e.data),r(Ft()),e.data}catch(e){r(XN({header:"request.error.create_document.title",body:"request.error.create_document.message",theme:qN.Danger}))}})),QN=e=>{var t;let{doty:n,documentId:o,linkGen:r,userInfo:i}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!1),c=(null==i||null===(t=i.activeRole)||void 0===t?void 0:t.businessType)===ln.TJA,d=(e,t)=>{if(!t)return;a(ZN({addEntityDto:{documentType:t,baseDocumentId:o},successCallback:t=>((e,t)=>{const n=`${e.documentTypeWithYear}/${e.documentNumber}`;e&&r(!0,t,sn,n)})(t,e)}))};return(0,Eo.jsx)(_o.ControlledPopover,{content:(()=>{const e=n,t=An[e],o=Pn[e];return(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)("ul",{children:[(0,Eo.jsx)("li",{className:"d-flex justify-content-between",children:(0,Eo.jsx)(FN,{linkName:"my_documents.document_table.more_actions.request_document_cancellation",tooltipText:`my_documents.document_table.more_actions.request_document_cancellation.tooltip.${e}`,functionCall:e=>{d(e,o),l(!s)}})}),c&&(0,Eo.jsx)("li",{className:"d-flex justify-content-between",children:(0,Eo.jsx)(FN,{linkName:"my_documents.document_table.more_actions.cancel_document",tooltipText:`my_documents.document_table.more_actions.cancel_document.tooltip.${e}`,functionCall:e=>{d(e,t),l(!s)}})})]}),(0,Eo.jsx)(_o.Button,{onClick:()=>{l(!1)},squared:!0,colourScheme:"light",children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})})]})})(),open:s,placement:"bottom-end",toggle:()=>l(!s),children:(0,Eo.jsx)("div",{className:"pl-2",children:(0,Eo.jsx)(_o.Icon,{tooltipText:(0,Eo.jsx)(wo.FormattedMessage,{id:"tooltip.more_actions"}),type:"more"})})})},eR=e=>{var t;let{linkGen:n,userInfo:o,documentType:r,onAllUsersChecked:i,isAllUsersChecked:a,filter:s,onDocumentDelete:l,fileApi:c,hidePresenter:d}=e;const u=(0,wo.useIntl)(),[p,f]=(0,yo.useState)({offset:0,limit:10}),[m,g]=(0,yo.useState)([]),[h,b]=(0,yo.useState)({column:0,direction:IN}),[v,y]=(0,yo.useState)(!1),[x,S]=(0,yo.useState)(!1),[w,_]=(0,yo.useState)(!1),E=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.workingDocuments)),T=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.signingDocuments)),I=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.finishedDocuments)),C=(0,xl.useSelector)((e=>e.myViewsPage.myProceedings.incomingDocuments)),M=(null===(t=o.activeRole)||void 0===t?void 0:t.businessType)!==ln.A;(0,yo.useEffect)((()=>{E&&r===Kt&&(Object.keys(s).length>0?(g(NN(E,s)),f({offset:0,limit:10})):g(E))}),[E,s]),(0,yo.useEffect)((()=>{T&&r===Bt&&(Object.keys(s).length>0?(g(NN(T,s)),f({offset:0,limit:10})):g(T))}),[T,s]),(0,yo.useEffect)((()=>{I&&r===zt&&(Object.keys(s).length>0?(g(NN(I,s)),f({offset:0,limit:10})):g(I))}),[I,s]),(0,yo.useEffect)((()=>{C&&r===Ht&&(Object.keys(s).length>0?(g(NN(C,s)),f({offset:0,limit:10})):g(C))}),[C,s]);const O=["my_documents.doc_date","my_documents.reg_date","my_documents.doc_nr","my_documents.document_type","my_documents.building_name","my_documents.ehr_code","my_documents.building_address","my_documents.state","my_documents.proceeding_nr"];d||O.push("my_documents.presenter");const D=[e=>sv(e.docDate)?new Date(tv()(e.docDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>r===Ht?sv(e.deadlineDate)?new Date(tv()(e.deadlineDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER:sv(e.regDate)?new Date(tv()(e.regDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""},e=>e.buildingName&&sv(e.buildingName[0])?e.buildingName[0]:"",e=>e.ehrCode&&sv(e.ehrCode[0])?e.ehrCode[0]:"",e=>e.buildingAddress&&sv(e.buildingAddress[0])?e.buildingAddress[0]:"",e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>e.presenter?e.presenter.join(","):""];const k=e=>{var t;const i=[(0,Eo.jsx)(kN,{fileApi:c,fileId:e.generatedFileId,docNr:null!==(t=e.docNr)&&void 0!==t?t:""},e.docId+"download")];return r===Kt&&e.stateCode===Un.DO_DOKUSEIS_KOOSTAMISEL?i.push((0,Eo.jsx)(LN,{onConfirm:()=>{l(e.docNr)},titleText:"my_documents.delete_document_confirmation.modal.header",messageText:"my_documents.delete_document_confirmation.modal.message"},e.docNr)):r===zt&&e.doty&&jn.includes(e.doty)&&![Un.DO_DOKUSEIS_TYHISTATUD,Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS].includes(e.stateCode)&&i.push((0,Eo.jsx)(QN,{doty:e.doty,documentId:e.docId,linkGen:n,userInfo:o})),i};return(0,Eo.jsxs)(_o.Section,{form:!0,children:[m&&(0,Eo.jsx)(_o.CollapseTable,{content:m.slice(p.offset,p.offset+p.limit).map((e=>{var t,o,i,a,s,l,c;return(0,Eo.jsx)(_o.CollapseTableRow,{fields:[e.docDate,r===Ht?tv()(e.deadlineDate,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:null===(t=e.deadlineDate)||void 0===t?void 0:t.toString()}):e.deadlineDate:e.regDate,(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_documents.tooltip.open_document"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:t=>{n(!0,t,sn,e.docNr)},text:e.docNr,href:n(!1,void 0,sn,e.docNr)})},e.docNr),e.documentType,e.buildingName?(0,Eo.jsx)("div",{children:w?(0,Eo.jsxs)("div",{children:[e.buildingName.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),e.buildingName.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),_(!w)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_building_names"})})]}):1===e.buildingName.length?e.buildingName:(0,Eo.jsxs)("div",{children:[null===(o=e.buildingName)||void 0===o?void 0:o.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(i=e.buildingName)||void 0===i?void 0:i.slice(4,5),e.buildingName.length>5?" ...":"",e.buildingName.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),_(!w)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_building_names"})})})]})}):"",e.ehrCode?(0,Eo.jsx)("div",{children:x?(0,Eo.jsxs)("div",{children:[e.ehrCode.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}),(0,Eo.jsx)("br",{})]},t))),e.ehrCode.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),S(!x)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[null===(a=e.ehrCode)||void 0===a?void 0:a.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}),(0,Eo.jsx)("br",{})]},t))),null===(s=e.ehrCode)||void 0===s?void 0:s.slice(4,5).map((e=>(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_documents.tooltip.open_building",functionCall:t=>{n(!0,t,rn,e)},href:n(!1,void 0,rn,e)}))),e.ehrCode.length>5?" ...":"",e.ehrCode.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),S(!x)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_ehrCodes"})})})]})}):"",e.buildingAddress?(0,Eo.jsx)("div",{children:v?(0,Eo.jsxs)("div",{children:[e.buildingAddress.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),e.buildingAddress.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),y(!v)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_less_addresses"})})]}):1===e.buildingAddress.length?e.buildingAddress:(0,Eo.jsxs)("div",{children:[null===(l=e.buildingAddress)||void 0===l?void 0:l.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(c=e.buildingAddress)||void 0===c?void 0:c.slice(4,5),e.buildingAddress.length>5?" ...":"",e.buildingAddress.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),y(!v)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.link.view_all_addresses"})})})]})}):"",e.stateCode?(0,Eo.jsx)(_o.Status,{type:ZP(e.stateCode,u).oldType,children:ZP(e.stateCode,u).name}):"",r===Bt?(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_documents.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:t=>{n(!0,t,an,e.proceedingNr)},text:e.proceedingNr,href:n(!1,void 0,an,e.proceedingNr)})},e.proceedingNr):e.proceedingNr,e.presenter?e.presenter.map(((t,n)=>(0,Eo.jsxs)("div",{children:[t,n!==e.presenter.length-1?(0,Eo.jsx)("span",{children:", "}):""]}))):""],tools:k(e),editable:!0},e.docId)})),headers:function(){const e=[...O];return e[1]="my_documents.deadline",(r===Ht?e:O).map(((e,t)=>(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(t,h);b(e),e.direction!==IN&&g(TN(m,D[t],e.direction))},children:h.column===t?(0,Eo.jsx)(DN,{sortDirection:h.direction}):(0,Eo.jsx)(DN,{sortDirection:IN})}),u.formatMessage({id:e})]})))}(),paginationEnabled:!0,pager:{offset:p.offset,limit:p.limit,total:m.length},onPaginationReload:f,editable:!0}),(0,Eo.jsx)(_o.Row,{children:M&&r!==Ht?(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:e=>i(e),text:(0,Eo.jsx)(_o.Text,{raw:"my_documents.view_all_institution_documents"}),checked:a})}):(0,Eo.jsx)(_o.Col,{})})]})},tR=require("reactstrap");function nR(e,t,n,o,r){return o?(0,Eo.jsx)(_o.FieldWrapper,{labelCol:r,component:(0,Eo.jsxs)(tR.Row,{className:"w-100 px-0 mx-0",children:[(0,Eo.jsx)(tR.Col,{xs:"auto",md:1.5,className:"pl-0 px-0",children:(0,Eo.jsx)(_o.Checkbox,{"data-testid":"checkbox",info:{content:o,placement:"top-start"},name:"checkbox",text:"",checked:e})}),(0,Eo.jsx)(tR.Col,{className:"px-0",children:(0,Eo.jsx)(_o.Text,{raw:(0,Eo.jsx)(wo.FormattedMessage,{id:n})})})]}),label:" "}):(0,Eo.jsx)(_o.FieldWrapper,{labelCol:r,component:(0,Eo.jsx)(_o.Checkbox,{"data-testid":"checkbox",name:"checkbox",onChange:e=>t(e),text:(0,Eo.jsx)(_o.Text,{raw:(0,Eo.jsx)(wo.FormattedMessage,{id:n})}),checked:e}),label:" "})}const oR=["110","11002","111","11119","11129","11139","11149","11158","11159","11191","11199","112","11201","11202","11203","11204","11205","11206","11211","11212","11213","11214","11219","11229","11231","11232","11233","11234","11239","11241","11249","11251","11271","11272","11273","11274","11275","11291","11299","113","11301","11302","11303","11304","11305","11306","11311","11312","11313","11314","11318","11319","11328","11329","11331","11332","11333","11334","11338","11339","11341","11348","11349","11351","11359","11371","11381","11391","11399","114","11411","11412","11413","11430","115","11511","11512","11513","11514","11515","11516","11518","11521","11522","11523","11524","11525","11526","11527","11531","11542","11551","11561","11563","11564","11565","11566","11567","11569","11571","11573","11574","11576","11577","11578","11581","11582","11584","11601","118","11802","11811","11821","11831","120","121","12119","12129","12139","12149","12158","12159","12199","122","12211","12212","12213","12214","12219","12229","12231","12232","12233","12234","12239","12241","12249","12251","12271","12291","12299","123","12311","12312","12313","12314","12318","12319","12328","12329","12331","12332","12333","12334","12338","12339","12341","12348","12349","12351","12359","12371","12381","12391","12399","127","12711","12731","12741","12742","12743","12744","12745","12899","129","12902","12911","12912","12921","12922","12931","12932","12942","12972","12973","12971","12974","12975","12976","12977","12978","12994","12999","130","13001","13002","13003","13009","131","13101","900","91511","91561","92731","92741","92743","92744","92745","11583"];function rR(e){const t=e.filter((e=>oR.includes(e.id.toString()))).sort(((e,t)=>e.id-t.id));return function(e){let t={id:"0",label:"00000",parentId:"0",level:1,value:!1,selectable:!1,children:[]};for(let n of e){let e=n.id.toString(),o=t;for(let t=1;t<=n.id;t++)if(o.children){let n=o.children.find((n=>n.id.toString()===e.slice(0,t)));n&&(o=n)}o.children&&o.children.push({id:e+"",parentId:o.id,label:n.name+(null!==n.validTo&&tv()(n.validTo).isBefore(tv()(new Date))?" (kuni "+tv()(n.validTo).format("DD.MM.YYYY")+")":""),level:o.level+1,children:[],selectable:!0,value:!1})}return t.children?t.children:[]}(t)}function iR(e){const t=e.sort(((e,t)=>e.firstName.localeCompare(t.firstName)));return function(e){return e.map((e=>({id:e.id+"",label:e.firstName+" "+e.lastName+" ("+e.personalCode+")",level:2,children:[],selectable:!0,value:!1})))}(t)}function aR(e){const t=e.sort(((e,t)=>e.regName.localeCompare(t.regName)));return function(e){return e.map((e=>({id:e.id+"",label:e.regName,level:2,children:[],selectable:!0,value:!1})))}(t)}function sR(e){var t,n,o,r;return(0,Eo.jsxs)("div",{className:"d-flex align-items-center",children:[(0,Eo.jsx)("div",{className:"range--from",style:{flexGrow:1},children:(0,Eo.jsx)(_o.DatePicker,{disabled:null!==(t=e.disabled)&&void 0!==t&&t,maxLength:e.maxLength,onBlur:(t,n)=>e.onBlur?e.onBlur(t,n):null,onChange:(t,n)=>function(t,n){const o={...e.value};o.from=t,e.onChange(o,n)}(t,n),onFocus:(t,n)=>e.onFocus?e.onFocus(t,n):null,value:null===(n=e.value)||void 0===n?void 0:n.from})}),(0,Eo.jsx)("span",{className:"px-1",children:"—"}),(0,Eo.jsx)("div",{className:"range--to",style:{flexGrow:1},children:(0,Eo.jsx)(_o.DatePicker,{disabled:null!==(o=e.disabled)&&void 0!==o&&o,maxLength:e.maxLength,onBlur:(t,n)=>e.onBlur?e.onBlur(t,n):null,onChange:(t,n)=>function(t,n){const o={...e.value};o.to=t,e.onChange(o,n)}(t,n),onFocus:(t,n)=>e.onFocus?e.onFocus(t,n):null,value:null===(r=e.value)||void 0===r?void 0:r.to})})]})}const lR=e=>{const t=(0,wo.useIntl)(),n=/^[\\s0-9]{0,9}$/,o=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,r={documentTypes:[],ehrCode:"",buildingName:"",wordInAddress:"",documentNumber:"",cadastralNumber:"",documentStates:[],institutionUsers:[],proceedingNumber:"",institutions:[],proceedingMissing:!1,documentDate:{from:"",to:""}},[i,a]=(0,yo.useState)(r);(0,yo.useEffect)((()=>{Object.keys(e.filterState).length>0&&a(e.filterState)}),[e.documentType]);const[s,l]=(0,yo.useState)(!0),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(""),[f,m]=(0,yo.useState)([]),[g,h]=(0,yo.useState)([]),[b,v]=(0,yo.useState)([]),[y,x]=(0,yo.useState)(PN(e.documentType)),[S,w]=(0,yo.useState)([]),_=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),E=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers)),T=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function I(e){return n.test(e)}function C(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],i[t]=n,a((e=>({...e})))}function M(e,t){var n;i[t]=e,"ehrCode"===t&&I(e)?l(!0):"cadastralNumber"===t&&(0===(n=e).length||o.test(n))&&d(!0),a((e=>({...e})))}(0,yo.useEffect)((()=>{x(PN(e.documentType))}),[e.documentType]),(0,yo.useEffect)((()=>{if(_){const e=rR(_);m(e)}if(E&&e.isKov){const e=iR(E?[...E]:[]);v(e)}if(T){const e=aR([...T]);h(e)}}),[_,E,T]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(i),children:[(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>C(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>C(e,"documentTypes"),value:i.documentTypes,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.building_name"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"documentNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.documentNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_number",placement:"top-start"}}),e.documentType!==Ht&&e.documentType!==Bt&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:y,onSelect:e=>C(e,"documentStates"),allSelection:!0,onRemoveItem:e=>C(e,"documentStates"),value:i.documentStates,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_state"}),labelCol:{sm:20,md:8,lg:8}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"proceedingNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.proceeding_number",placement:"top-start"}}),nR(i.proceedingMissing,(function(e){a((t=>({...t,proceedingMissing:e})))}),"my_documents.filter.label.proceeding_missing","my_documents.filter.tooltip.proceeding_missing"),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?p(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?p(t.formatMessage({id:"filter.invalid_date_range"})):p(""),a((t=>({...t,documentDate:e})))})(e),value:i.documentDate}),errorMessage:u.length>0?u:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.document_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.document_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"ehrCode"),onBlur:e=>l(I(e.trim())),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.ehrCode}),errorMessage:!s&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.ehrCode",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>M(e,"wordInAddress"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.word_in_address",placement:"top-start"}}),e.documentType!==Ht&&e.documentType!==Bt&&e.isKov&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>C(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>C(e,"institutionUsers"),value:i.institutionUsers,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.institution_users",placement:"top-start"}}),e.documentType!==Ht&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:g,onSelect:e=>C(e,"institutions"),allSelection:!0,onRemoveItem:e=>C(e,"institutions"),value:i.institutions,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8}}),e.isKov&&e.documentType===Bt&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>C(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>C(e,"institutionUsers"),value:i.institutionUsers,selectedOptions:S}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_documents.filter.tooltip.institution_users",placement:"top-start"}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(w([]),void a(r)),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(s&&c),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},cR=["11566","11567","11569","11576","11577"],dR=[bn,vn,yn,xn],uR=e=>{const[t,n]=(0,yo.useState)(!1),[o,r]=(0,yo.useState)(""),[i,a]=(0,yo.useState)(!1),[s,l]=(0,yo.useState)([]),c=(0,xl.useSelector)((e=>e.myViewsPage.myDocuments.allowedDocumentTypesToStart)),d=e=>null==e||Number.isNaN(e)||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length;(0,yo.useEffect)((()=>{if(c){const e=c.filter((e=>!cR.includes(e.code)&&!dR.includes(e.code)));l(e.map((e=>({code:e.code,texts:e.value}))))}}),[c]);return(0,Eo.jsx)(_o.ControlledPopover,{maxWidth:900,open:t,content:(0,Eo.jsx)("div",{style:{width:"600px"},children:(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{a(!0)},children:[(0,Eo.jsx)("h2",{children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.popover.title.composing_new_document"})}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Select,{filterable:!0,placeholder:"placeholder.choose",name:"role",onChange:e=>r(e),options:s,value:o}),errorMessage:i&&d(o)&&(0,Eo.jsx)(_o.Text,{raw:"common.select.required"}),label:(0,Eo.jsx)(_o.Text,{raw:"my_documents.popover.label.new_document_type"}),name:"documentType",info:{content:"my_documents.popover.tooltip.document_type"}}),(0,Eo.jsxs)("div",{className:"d-flex justify-content-between mt-2",children:[(0,Eo.jsx)(_o.Button,{colourScheme:"light",onClick:()=>{a(!1),r("")},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.cancel"})}),(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",onClick:t=>{d(o)||(e.linkGen(!0,t,"DOCUMENT","",{doty:o}),n(!1))},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.popover.button.compose_new_document"})})]})]})}),placement:"bottom-end",toggle:()=>{n(!t)},children:(0,Eo.jsx)(_o.Button,{withPlus:!0,colourScheme:"info",onClick:()=>{n(!t)},children:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_documents.button.start_new_document"})})})},pR=["11273","11272","11274","11275","11002","11051","11201","11271","11301","11371","11412","11413","11430","11522","11525","11527","11542","11566","11567","11569","11571","11576","11577","11581","11582","11584","11831","12731","12743","12744","12745","12899","12922","12932","12942","12973","12975","12976","12977","12978","12999","11526","11601","11583"],fR=["11273","11272","11274","11275","11002","11051","11201","11271","11301","11371","11412","11413","11430","11522","11525","11527","11542","11566","11567","11569","11571","11573","11574","11576","11577","11581","11582","11584","11831","12731","12743","12744","12745","12899","12922","12932","12942","12951","12952","12953","12973","12975","12976","12977","12978","12999","11526","11601","11583"],mR=["11273","11272","11582","11525","11271","11201","11301","11371","11002","11581","12271","12371","12921","12931","12995","12996","12902","11802","12999","12922","12932","12942","12899","11526","12972","12973"],gR=e=>{var t,n,o,r,i,a,s;let{linkGen:l,userInfo:c}=e;const d=(0,xl.useDispatch)(),[u,p]=(0,yo.useState)({signingDocs:!1,workingDocs:!1,finishedDocs:!1}),[f,b]=(0,yo.useState)(!1),[v,y]=(0,yo.useState)(!0),[x,I]=(0,yo.useState)(!0),[C,M]=(0,yo.useState)([]),[O,D]=(0,yo.useState)([]),[k,j]=(0,yo.useState)([]),[A,P]=(0,yo.useState)({}),[N,R]=(0,yo.useState)({}),[L,F]=(0,yo.useState)({}),U="A"!==(null===(t=c.activeRole)||void 0===t?void 0:t.businessType);const V={userId:null===(n=c.activeRole)||void 0===n?void 0:n.userId,personId:null===(o=c.activeRole)||void 0===o?void 0:o.businessId,dotys:pR,states:[Un.DO_DOKUSEIS_ESITATUD,Un.DO_DOKUSEIS_KOOSTAMISEL,Un.DO_DOKUSEIS_EELNOU_AKTIIVNE,Un.DO_DOKUSEIS_ALLKIRJASTAMISEL,Un.DO_DOKUSEIS_MENETLUSES,Un.DO_DOKUSEIS_TAIENDAMISEL,Un.DO_DOKUSEIS_MUUTMISEL]},$={userId:null===(r=c.activeRole)||void 0===r?void 0:r.userId,personId:null===(i=c.activeRole)||void 0===i?void 0:i.businessId,dotys:fR,states:[Un.DO_DOKUSEIS_KEHTETU,Un.DO_DOKUSEIS_TUNNIST_KEHTETUKS,Un.DO_DOKUSEIS_REG_KANTUD,"DO_DOKUSEIS_TAGASTATUD",Un.DO_DOKUSEIS_KEELDUTUD,Un.DO_DOKUSEIS_TYHISTATUD,Un.DO_DOKUSEIS_LOOBUTUD,Un.DO_DOKUSEIS_ALLKIRJASTATUD,Un.DO_DOKUSEIS_MENETLETUD,Un.DO_DOKUSEIS_LUBATUD,Un.DO_DOKUSEIS_LUB_TEAV,Un.DO_DOKUSEIS_TEAVITATUD,Un.DO_DOKUSEIS_ANTUD,Un.DO_DOKUSEIS_KEHTIV]},B={userId:null===(a=c.activeRole)||void 0===a?void 0:a.userId,personId:null===(s=c.activeRole)||void 0===s?void 0:s.businessId,roles:[un],dotys:mR,states:[Un.DO_DOKUSEIS_ALLKIRJASTAMISEL]};return(0,yo.useEffect)((()=>{var e,t;ft.classifierApiService.getAllDocumentTypes().then((e=>{d(m(e.data))})).catch((e=>{console.log(e)})),ft.institutionKovEndpointApi.getJurKovPersons().then((e=>{d(h(e.data))})).catch((e=>{console.log(e)})),U&&ft.userApiService.getJurUsers(null!==(e=null===(t=c.activeRole)||void 0===t?void 0:t.businessId)&&void 0!==e?e:0).then((e=>{d(g(e.data))})).catch((e=>{console.log(e)})),ft.documentApiService.getDotysBasedOnUserRights().then((e=>{const t=e.data.filter((e=>"12922"!==e.code&&"11412"!==e.code&&"11413"!==e.code&&"12932"!==e.code&&"11430"!==e.code&&"12942"!==e.code));d(T(t))})).catch((e=>{console.log("Following error occured:",e)}))}),[c]),(0,yo.useEffect)((()=>{(()=>{const e=V;u.workingDocs&&(e.userId=void 0),y(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(S(e.data)),y(!1),D(e.data)})).catch((e=>{console.log("Following error occured:",e),y(!1)}))})()}),[u.workingDocs,c]),(0,yo.useEffect)((()=>{!function(){const e=$;u.finishedDocs&&(e.userId=void 0),I(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(_(e.data)),I(!1),j(e.data)})).catch((e=>{console.log("Following error occured:",e),I(!1)}))}()}),[u.finishedDocs,c]),(0,yo.useEffect)((()=>{!function(){const e=B;u.signingDocs&&(e.userId=void 0),b(!0),ft.myDocumentBaseApiService.findBaseWorkingDocuments(e).then((e=>{d(w(e.data)),b(!1),M(e.data)})).catch((e=>{console.log("Following error occured:",e),b(!1)}))}()}),[u.signingDocs,c]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(JN,{}),(0,Eo.jsx)("div",{className:"d-flex justify-content-end mt-2",children:(0,Eo.jsx)(uR,{linkGen:l})}),U&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.my_documents_to_sign",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Bt,filterState:A,onSubmit:e=>P(e),isKov:U}),children:f?(0,Eo.jsx)(_o.SectionLoader,{}):0===C.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.signing_documents.no_docs"})}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:Bt,onAllUsersChecked:e=>{p({signingDocs:e,workingDocs:u.workingDocs,finishedDocs:u.finishedDocs})},isAllUsersChecked:u.signingDocs,filter:A,fileApi:ft.fileApiService,hidePresenter:!0})}),(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.working_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Kt,filterState:N,onSubmit:e=>R(e),isKov:U}),children:v?(0,Eo.jsx)(_o.SectionLoader,{}):0===O.length?(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.working_documents.no_docs"})}),U&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_documents.view_all_institution_documents",onClick:()=>{p({signingDocs:u.signingDocs,workingDocs:!0,finishedDocs:u.finishedDocs})}})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(uR,{linkGen:l})})]}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:Kt,onAllUsersChecked:e=>{p({signingDocs:u.signingDocs,workingDocs:e,finishedDocs:u.finishedDocs})},isAllUsersChecked:u.workingDocs,filter:N,onDocumentDelete:e=>function(e){const t=e.slice(0,e.indexOf("/")),n=e.slice(e.indexOf("/")+1);ft.documentApiService.deleteApplicationByNumber(t,n),d(E(e))}(e),fileApi:ft.fileApiService})}),(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.finished_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:zt,filterState:L,onSubmit:e=>F(e),isKov:U}),children:x?(0,Eo.jsx)(_o.SectionLoader,{}):0===k.length?(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.finished_documents.no_docs"})}),U&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_documents.view_all_institution_documents",onClick:()=>{p({signingDocs:u.signingDocs,workingDocs:u.workingDocs,finishedDocs:!0})}})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(uR,{linkGen:l})})]}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:c,documentType:zt,onAllUsersChecked:e=>{p({signingDocs:u.signingDocs,workingDocs:u.workingDocs,finishedDocs:e}),I(!0)},isAllUsersChecked:u.finishedDocs,filter:L,fileApi:ft.fileApiService})})]})};let hR=function(e){return e.Document="DOCUMENT",e.Proceeding="PROCEEDING",e.ProceedingDecision="PROCEEDING_DECISION",e.Operation="OPERATION",e.MyDocuments="MY_DOCUMENTS",e.MyProceedings="MY_PROCEEDINGS",e.MyPlannings="MY_PLANNINGS",e.Planning="PLANNING",e.MyAdministrativeProceedings="MY_ADMIN_PROCEEDINGS",e.Building="BUILDING",e.NewEnergy="NEW_ENERGY",e.ArchiveBuildingRegistryFile="ARCHIVE_BUILDINGREGISTRYFILE",e.ArchiveBuildingDatasOf2003="ARCHIVE_BUILDINGDATAASOF2003",e.ArchiveBuildingDatasOf2014="ARCHIVE_BUILDINGDATAASOF2014",e.Restriction="RESTRICTION",e.NotFound="404",e.AdminProceeding="ADMIN_PROCEEDING",e.PlanningProceeding="PLANNING_PROCEEDING",e}({});hR.Proceeding,hR.PlanningProceeding,hR.AdminProceeding;const bR=e=>e?hR.Proceeding:hR.NotFound,vR={0:"dateStart",1:"deadline",2:"proceedingNr",3:"stateCode",4:"proceedingCircleNr",5:"operationsCount",6:"innerCommentDeadline",7:"lastEventDate",8:"document",9:"documentType",10:"buildingName",11:"ehrCode",12:"address",13:"proceedingName",14:"supervisor",15:"documentPresenter",16:"archived",17:"proceedingLength"},yR=e=>{let{buildingNames:t}=e;const[n,o]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Eo.Fragment,{children:t}):(0,Eo.jsx)("div",{children:n?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_building_names"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.slice(2,3),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_building_names"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},xR=e=>{let{ehrCodes:t,linkGen:n}=e;const[o,r]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Mo,{linkName:t[0],tooltipText:"my_proceedings.tooltip.open_building",functionCall:e=>{n(!0,e,"BUILDING",t)},href:n(!1,void 0,"BUILDING",t)}):(0,Eo.jsx)("div",{children:o?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)}),(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),r(!o)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)}),(0,Eo.jsx)("br",{})]},e))),t.slice(2,3).map((e=>(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"my_proceedings.tooltip.open_building",functionCall:t=>{n(!0,t,"BUILDING",e)},href:n(!1,void 0,"BUILDING",e)},e))),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),r(!o)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_ehrCodes"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},SR=e=>{let{addresses:t}=e;const[n,o]=(0,yo.useState)(!1);return t&&0!==t.length?1===t.length?(0,Eo.jsx)(Eo.Fragment,{children:t}):(0,Eo.jsx)("div",{style:{width:125},children:n?(0,Eo.jsxs)("div",{children:[t.map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_less_addresses"})})]}):(0,Eo.jsxs)("div",{children:[t.slice(0,2).map((e=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},e))),t.slice(2,3),t.length>3?" ...":"",t.length>3&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),o(!n)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.link.view_all_addresses"})})})]})}):(0,Eo.jsx)(Eo.Fragment,{})},wR=e=>{let{deadline:t}=e;if(!t)return(0,Eo.jsx)(Eo.Fragment,{});return tv()(t,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:t}):(0,Eo.jsx)(Eo.Fragment,{children:t})},_R=e=>{let{deadline:t}=e;if(!t)return(0,Eo.jsx)(Eo.Fragment,{});return tv()(t).valueOf()<=tv()().valueOf()?(0,Eo.jsx)("div",{style:{color:"#00b649"},children:tv()(t).format("DD.MM.YYYY")}):(0,Eo.jsx)(Eo.Fragment,{children:tv()(t).format("DD.MM.YYYY")})},ER=e=>{let{proceedingNr:t,linkGenType:n,linkGen:o}=e;return t?(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{onClick:e=>{o(!0,e,n,t)},text:t,href:o(!1,void 0,n,t)})},t):(0,Eo.jsx)(Eo.Fragment,{})},TR=e=>{let{document:t,linkGen:n}=e;return t?(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_proceedings.tooltip.open_document",functionCall:e=>{n(!0,e,"DOCUMENT",t)}}):(0,Eo.jsx)(Eo.Fragment,{})},IR=e=>{let{stateCode:t}=e;const n=(0,wo.useIntl)();if(!t)return(0,Eo.jsx)(Eo.Fragment,{});const o=cv(t,n);return(0,Eo.jsx)(_o.Status,{type:o.oldType,children:o.name})},CR=e=>{var t,n;let{linkGen:o,isKov:r,onAllUsersChecked:i,isAllUsersChecked:a,userInfo:s}=e;const l=(0,wo.useIntl)(),c=(0,xl.useDispatch)(),{proceedings:d,isLoading:u,pagination:p,sorting:f}=(0,xl.useSelector)(bt),m=null!==(t=null==d?void 0:d.content)&&void 0!==t?t:[],g=null!==(n=null==d?void 0:d.totalElements)&&void 0!==n?n:0,h=["my_proceedings.date_start","my_proceedings.deadline","my_proceedings.proceeding_nr","my_proceedings.state","my_proceedings.proceeding_circle_nr","my_proceedings.operations_count","my_proceedings.inner_comment_deadline","my_proceedings.last_event","my_proceedings.document","my_proceedings.document_type","my_proceedings.building_name","my_proceedings.ehr_code","my_proceedings.address","my_proceedings.proceeding_name","my_proceedings.supervisor","my_proceedings.document_presenter","my_proceedings.archived","my_proceedings.proceeding_length"];return u?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsxs)(_o.Section,{form:!0,children:[(0,Eo.jsx)(_o.CollapseTable,{content:(b=m,b.map((e=>{var t,n,r,i;const a=(null!==(t=null===(n=e.address)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>1?function(e,t,n){let o={addresses:[],ehrCodes:[],buildingNames:[]};if(e&&e.length>1){let r=[];for(let o=0;o<e.length;o++){let i=e[o].split(",");r.push({county:i[0],city:i[1]?i[1].trimStart():"",other:i[2]?i[2].trimStart()+","+i[3]:"",ehrCode:t?t[o]:"",buildingName:n?n[o]:""})}const i=r.reduce(((e,t)=>{var n;const{county:o}=t;return e[o]=null!==(n=e[o])&&void 0!==n?n:[],e[o].push(t),e}),{});let a=[];r.forEach((e=>{const t=e.county;a.includes(t)||a.push(t)}));let s=[];r.forEach((e=>{const t=e.city;s.includes(t)||s.push(t)})),a.forEach((e=>{const t=i[e].reduce(((e,t)=>{var n;const{city:o}=t;return e[o]=null!==(n=e[o])&&void 0!==n?n:[],e[o].push(t),e}),{});i[e]=t}));let l=[],c=[],d=[];a.forEach((e=>{s.forEach((t=>{let n="";if(i[e][t]){n+=e+", "+t;for(let o=0;o<i[e][t].length;o++){const r=i[e][t][o];n+=", "+r.other,0===o?l.push(n):l.push(r.other),c.push(r.ehrCode),d.push(r.buildingName)}}}))})),o={addresses:l,ehrCodes:c,buildingNames:d}}return o}(e.address,e.ehrCode,e.buildingName):{addresses:[],ehrCodes:[],buildingNames:[]},s=bR(e.doty);return(0,Eo.jsx)(_o.CollapseTableRow,{fields:[e.dateStart,(0,Eo.jsx)(wR,{deadline:null===(r=e.deadline)||void 0===r?void 0:r.toString()},`${e.id}-deadline`),(0,Eo.jsx)(ER,{proceedingNr:e.proceedingNr,linkGenType:s,linkGen:o},`${e.id}-proceedingLink`),(0,Eo.jsx)(IR,{stateCode:e.stateCode},`${e.id}-state`),e.proceedingCircleNr,e.operationsCount,(0,Eo.jsx)(_R,{deadline:null===(i=e.innerCommentDeadline)||void 0===i?void 0:i.toString()},`${e.id}-comment`),e.lastEventDate?tv()(e.lastEventDate).format("DD.MM.YYYY"):"",(0,Eo.jsx)(TR,{document:e.document,linkGen:o},`${e.id}-documentlink`),e.documentType,(0,Eo.jsx)(yR,{buildingNames:a.buildingNames},`${e.id}-buildingname`),(0,Eo.jsx)(xR,{ehrCodes:a.ehrCodes,linkGen:o},`${e.id}-ehrcode`),(0,Eo.jsx)(SR,{addresses:a.addresses},`${e.id}-addressCell`),e.proceedingName,e.supervisor,e.documentPresenter,e.archived,e.proceedingLength]},e.id)}))),headers:h.map(((e,t)=>{const n=(null==f?void 0:f.field)===vR[t],o=f.desc?MN:CN,r=n?o:IN;return(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(t,{column:t,direction:r}),n=vR[t];if(e.direction===IN)c(yt({field:"",desc:!1})),c(gt({userInfo:s}));else{const t={field:n,desc:e.direction===MN};c(yt(t)),c(gt({userInfo:s,sorting:t}))}},children:(0,Eo.jsx)(DN,{sortDirection:r})}),l.formatMessage({id:e})]},e)})),paginationEnabled:!0,pager:{offset:p.page*p.size,limit:p.size,total:g},onPaginationReload:e=>{const t={page:Math.floor(e.offset/e.limit),size:e.limit};c(vt(t)),c(gt({userInfo:s,pagination:t,isAllUsersChecked:a}))}}),(0,Eo.jsx)(Eo.Fragment,{children:r?(0,Eo.jsx)("div",{className:"d-flex justify-content-start",children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:e=>i(e),text:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.view_all_institution_proceedings"}),checked:a})}):null})]});var b},MR=[{code:"MENSEIS_TAIENDAMISEL",value:"Algdokument täiendamisel"},{code:"MENSEIS_ALGATATUD",value:"Algatatud"},{code:"MENSEIS_KAIMASOLEV",value:"Käimasolev"},{code:"MENSEIS_LOPETATUD",value:"Lõpetatud"},{code:"MENSEIS_MUUTMISEL",value:"Algdokument muutmisel"},{code:"MENSEIS_PEATATUD",value:"Peatatud"}];function OR(){return MR.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}function DR(){return MR.filter((e=>"MENSEIS_TAIENDAMISEL"!==e.code&&"MENSEIS_MUUTMISEL"!==e.code&&"MENSEIS_LOPETATUD"!==e.code&&"MENSEIS_PEATATUD"!==e.code)).map((e=>({id:e.code})))}const kR={documentTypes:[],ehrCode:"",buildingName:"",wordInAddress:"",proceedingNumber:"",cadastralNumber:"",proceedingStates:["MENSEIS_ALGATATUD","MENSEIS_KAIMASOLEV"],connectedPerson:"",showProceedingInArchive:!1,supervisors:[],proceedingDate:{from:"",to:""},lastEventDate:""},jR=e=>{let{onSubmit:t,isKov:n,filterState:o}=e;const r=(0,wo.useIntl)(),i=/^[\\s0-9]{0,9}$/,a=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,[s,l]=(0,yo.useState)(o),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(!0),[f,m]=(0,yo.useState)(""),[g,h]=(0,yo.useState)(""),[b,v]=(0,yo.useState)([]),[y,x]=(0,yo.useState)([]),[S]=(0,yo.useState)(OR()),[w,_]=(0,yo.useState)([]),[E,T]=(0,yo.useState)(DR()),I=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),C=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers));function M(e){return i.test(e)}function O(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],T(n.map((e=>({id:e})))),l((e=>({...e,[t]:n})))}function D(e,t){var n;"ehrCode"===t&&M(e)?d(!0):"cadastralNumber"===t&&(0===(n=e).length||a.test(n))&&p(!0),l((n=>({...n,[t]:e})))}(0,yo.useEffect)((()=>{if(I){const e=rR(I);v(e)}if(C&&n){const e=iR([...C]);x(e)}}),[I,C]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>t(s),children:[(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:b,onSelect:e=>O(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>O(e,"documentTypes"),value:s.documentTypes,selectedOptions:w}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"proceedingNumber"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:S,onSelect:e=>{O(e,"proceedingStates")},allSelection:!0,onRemoveItem:e=>O(e,"proceedingStates"),value:s.proceedingStates,selectedOptions:E}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_state"}),labelCol:{sm:20,md:8,lg:8}}),nR(s.showProceedingInArchive,(function(e){l((t=>({...t,showProceedingInArchive:e})))}),"my_proceedings.filter.label.show_archived_proceedings"),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{name:"daterange",onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?m(r.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?m(r.formatMessage({id:"filter.invalid_date_range"})):m(""),l((t=>({...t,proceedingDate:e})))})(e),value:s.proceedingDate})}),errorMessage:f.length>0?f:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.proceeding_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.proceeding_date",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.DatePicker,{name:"datepicker-field",value:s.lastEventDate,onChange:e=>function(e){""===e||tv()(e,"YYYY-MM-DD",!0).isValid()?h(""):h(r.formatMessage({id:"filter.invalid_date_format"})),l((t=>({...t,lastEventDate:e})))}(e)}),errorMessage:g.length>0?g:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.last_event_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.last_event_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"ehrCode"),onBlur:e=>d(M(e.trim())),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.ehrCode}),errorMessage:!c&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.ehrCode",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"buildingName"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.building_name"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"wordInAddress"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.word_in_address",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>D(e,"connectedPerson"),placeholder:r.formatMessage({id:"placeholder.writing"}),value:s.connectedPerson}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.connected_person"}),labelCol:{sm:20,md:8,lg:8},info:{content:"my_proceedings.filter.tooltip.connected_person",placement:"top-start"}}),n&&(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:y,onSelect:e=>O(e,"supervisors"),allSelection:!0,onRemoveItem:e=>O(e,"supervisors"),value:s.supervisors,selectedOptions:w}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_proceedings.filter.label.supervisor"}),labelCol:{sm:20,md:8,lg:8}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(_([]),l(kR),void T(DR())),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(c&&u),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})};function AR(e){return lv(Gn,e)}Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD;const PR={[Wn.MENTOIMSEIS_OOTEL]:"my_operations.operation.state.idle",[Wn.MENTOIMSEIS_TEOSTAMISEL]:"my_operations.operation.state.in_process",[Wn.MENTOIMSEIS_TYHISTATUD]:"my_operations.operation.state.cancelled",[Wn.MENTOIMSEIS_TEOSTATUD]:"my_operations.operation.state.done",[Wn.MENTOIMSEIS_LOOBUTUD]:"my_operations.operation.state.abandoned",[Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD]:"my_operations.operation.state.expired"};function NR(e,t){const n=AR(e);return n?function(e,t){switch(e){case Wn.MENTOIMSEIS_OOTEL:return{name:t.formatMessage({id:"my_operations.operation.state.idle"}),oldType:nn.Info,newType:on.Info};case Wn.MENTOIMSEIS_TEOSTAMISEL:return{name:t.formatMessage({id:"my_operations.operation.state.in_process"}),oldType:nn.Info,newType:on.Info};case Wn.MENTOIMSEIS_TYHISTATUD:return{name:t.formatMessage({id:"my_operations.operation.state.cancelled"}),oldType:nn.Default,newType:on.Default};case Wn.MENTOIMSEIS_TEOSTATUD:return{name:t.formatMessage({id:"my_operations.operation.state.done"}),oldType:nn.Success,newType:on.Success};case Wn.MENTOIMSEIS_LOOBUTUD:return{name:t.formatMessage({id:"my_operations.operation.state.abandoned"}),oldType:nn.Default,newType:on.Default};case Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD:return{name:t.formatMessage({id:"my_operations.operation.state.expired"}),oldType:nn.Default,newType:on.Default};default:return{name:e,oldType:nn.Default,newType:on.Default}}}(n,t):{name:e,oldType:nn.Default,newType:on.Default}}const RR=(e,t)=>({code:e,value:t.formatMessage({id:PR[e]})});function LR(e,t){let n;return n=e===Wt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))):e===Xt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))):e===Zt?[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD].map((e=>RR(e,t))):[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD].map((e=>RR(e,t))),function(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}(n)}function FR(){return[{code:"11271",value:"Ehitusluba"},{code:"11201",value:"Ehitusteatis"},{code:"11371",value:"Kasutusluba"},{code:"11301",value:"Kasutusteatis"},{code:"11002",value:"Projekteerimistingimused"},{code:"11051",value:"5G pääsupunkti taotlus"}].map((e=>({id:`${e.code}`,label:e.value,level:2,children:[],selectable:!0,value:!1})))}function UR(e,t){if(t.documentTypes.length>0&&(e=e.filter((e=>e.doty&&void 0!==e.doty&&t.documentTypes.includes(e.doty)))),t.ehrCode.length>0&&(e=e.filter((e=>{var n;return null===(n=e.ehrCode)||void 0===n?void 0:n.some((e=>{var n;return null!==(n=e.startsWith(t.ehrCode.trim()))&&void 0!==n&&n}))}))),t.institutions.length>0&&(e=e.filter((e=>{var n;return e.supervisorJurId&&void 0!==e.supervisorJurId&&t.institutions.includes(null===(n=e.supervisorJurId)||void 0===n?void 0:n.toString())}))),t.wordInAddress.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.address)||void 0===o?void 0:o.some((e=>null==e?void 0:e.toLocaleLowerCase().includes(t.wordInAddress.trim().toLocaleLowerCase()))))&&void 0!==n&&n}))),t.proceedingNumber.length>0&&(e=e.filter((e=>{var n,o;return null!==(n=null===(o=e.proceedingNr)||void 0===o?void 0:o.includes(t.proceedingNumber.trim()))&&void 0!==n&&n}))),t.operationStates.length>0&&(e=e.filter((e=>e.stateCode&&void 0!==e.stateCode&&t.operationStates.includes(AR(e.stateCode))))),t.institutionUsers&&t.institutionUsers.length>0&&(e=e.filter((e=>e.operationExecutorId&&void 0!==e.operationExecutorId&&t.institutionUsers.includes(e.operationExecutorId.toString())))),t.operationDate.from.length>0&&0===t.operationDate.to.length){const n=new Date(t.operationDate.from).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.operationDate.to.length>0&&0===t.operationDate.from.length){const n=new Date(t.operationDate.to).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.operationDeadline.from.length>0){const n=new Date(t.operationDeadline.from).getTime();e=e.filter((e=>!e.deadline||new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n))}if(t.operationDeadline.to.length>0){const n=new Date(t.operationDeadline.to).getTime();e=e.filter((e=>!e.deadline||new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=n))}if(t.operationDate.from.length>0&&t.operationDate.to.length>0){const n=new Date(t.operationDate.from).getTime(),o=new Date(t.operationDate.to).getTime();e=e.filter((e=>new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()>=n&&new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime()<=o))}return e}function VR(e){return[{id:Wn.MENTOIMSEIS_OOTEL},{id:Wn.MENTOIMSEIS_TEOSTAMISEL},{id:Wn.MENTOIMSEIS_TEOSTATUD},{id:Wn.MENTOIMSEIS_LOOBUTUD}].filter((t=>e.includes(t.id)))}const $R=e=>{const t=(0,wo.useIntl)(),[n,o]=(0,yo.useState)({offset:0,limit:10}),[r,i]=(0,yo.useState)([]),[a,s]=(0,yo.useState)({column:1,direction:MN}),[l,c]=(0,yo.useState)(!1),[d,u]=(0,yo.useState)(!1),[p,f]=(0,yo.useState)(!1),m=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.myOperations)),g=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.toCommentOperations)),h=(0,xl.useSelector)((e=>e.myViewsPage.myOperations.operationInvitations)),b=(0,xl.useSelector)((e=>e.myViewsPage.myProceedings.proceedingsToComment)),v=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),y=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),x=[e=>sv(e.invitationDate)?new Date(tv()(e.invitationDate,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>sv(e.deadline)?new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.operationExecutor)&&void 0!==t?t:""},e=>{var t,n;return null!==(t=null===(n=y.find((t=>t.id.toString()===e.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""},e=>void 0!==e.buildingName&&null!==e.buildingName&&sv(e.buildingName[0])?e.buildingName[0]:"",e=>void 0!==e.ehrCode&&null!==e.ehrCode&&sv(e.ehrCode[0])?e.ehrCode[0]:"",e=>void 0!==e.address&&null!==e.address&&sv(e.address[0])?e.address[0]:"",e=>{var t,n;return null!==(t=null===(n=v.find((t=>t.id===e.supervisorJurId)))||void 0===n?void 0:n.regName)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.supervisor)&&void 0!==t?t:""}];(0,yo.useEffect)((()=>{!m||e.viewType!==Gt&&e.viewType!==Yt||(i(UR(m,e.filter)),o({offset:0,limit:10}))}),[m,e.filter]),(0,yo.useEffect)((()=>{m&&e.viewType===Wt&&(i(TN(UR(m,e.filter),x[0],MN)),o({offset:0,limit:10}))}),[m,e.filter]),(0,yo.useEffect)((()=>{g&&e.viewType===Jt&&(a.direction===IN?i(UR(g,e.filter)):i(TN(UR(g,e.filter),x[a.column],a.direction)),o({offset:0,limit:10}))}),[g,e.filter]),(0,yo.useEffect)((()=>{h&&e.viewType===Xt&&(i(UR(h,e.filter)),o({offset:0,limit:10}))}),[h,e.filter]),(0,yo.useEffect)((()=>{b&&e.viewType===Zt&&(a.direction===IN?i(UR(b,e.filter)):i(TN(UR(b,e.filter),x[a.column],a.direction)))}),[b,e.filter]);const S=["my_operations.invitation_date","my_operations.deadline","my_operations.proceeding_nr","my_operations.state","my_operations.operation_executor","my_operations.connected_document_type","my_operations.building_name","my_operations.ehr_code","my_operations.building_address","my_operations.institution","my_operations.supervisor"],w=["my_operations.deadline","my_operations.proceeding_nr","my_operations.state","my_operations.supervisor","my_operations.connected_document_type","my_operations.building_address"],_=[e=>sv(e.deadline)?new Date(tv()(e.deadline,"DD.MM.YYYY").format("YYYY-MM-DD")).getTime():Number.MAX_SAFE_INTEGER,e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.state)&&void 0!==t?t:""},e=>{var t;return null!==(t=e.supervisor)&&void 0!==t?t:""},e=>{var t,n;return null!==(t=null===(n=y.find((t=>t.id.toString()===e.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:""},e=>void 0!==e.address&&null!==e.address&&sv(e.address[0])?e.address[0]:""];const E=t=>{let n=iv.Operation;return e.viewType===Zt?(n=iv.Proceeding,e.linkGen(!1,void 0,n,t.proceedingNr)):e.linkGen(!1,void 0,n,t.id)};return(0,Eo.jsxs)(_o.Section,{form:!0,children:[r&&(0,Eo.jsx)(_o.CollapseTable,{content:(o=>o.slice(n.offset,n.offset+n.limit).map((n=>{var o,r,i,a,s,m,g,h;const b=[n.invitationDate,tv()(n.deadline,"DD.MM.YYYY").valueOf()<tv()().valueOf()?(0,Eo.jsx)("div",{className:"red-text",children:n.deadline}):n.deadline,(0,Eo.jsx)(_o.Tooltip,{content:(0,Eo.jsx)(_o.Text,{raw:"my_operations.tooltip.open_proceeding"}),placement:"bottom",theme:"dark",children:(0,Eo.jsx)(_o.Link,{text:n.proceedingNr,href:E(n)})},n.proceedingNr),n.stateCode?(0,Eo.jsx)(_o.Status,{type:NR(n.stateCode,t).oldType,children:NR(n.stateCode,t).name}):"",n.operationExecutor,n.doty?null===(o=y.find((e=>e.id.toString()===n.doty)))||void 0===o?void 0:o.name:"",n.buildingName?(0,Eo.jsx)("div",{children:p?(0,Eo.jsxs)("div",{children:[n.buildingName.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),n.buildingName.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),f(!p)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_building_names"})})]}):1===n.buildingName.length?n.buildingName:(0,Eo.jsxs)("div",{children:[null===(r=n.buildingName)||void 0===r?void 0:r.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(i=n.buildingName)||void 0===i?void 0:i.slice(4,5),n.buildingName.length>5?" ...":"",n.buildingName.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),f(!p)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_building_names"})})})]})}):"",n.ehrCode?(0,Eo.jsx)("div",{children:d?(0,Eo.jsxs)("div",{children:[n.ehrCode.map(((t,n)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}),(0,Eo.jsx)("br",{})]},n))),n.ehrCode.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),u(!d)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_ehrCodes"})})]}):(0,Eo.jsxs)("div",{children:[null===(a=n.ehrCode)||void 0===a?void 0:a.slice(0,4).map(((t,n)=>(0,Eo.jsxs)(So().Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}),(0,Eo.jsx)("br",{})]},n))),null===(s=n.ehrCode)||void 0===s?void 0:s.slice(4,5).map((t=>(0,Eo.jsx)(Mo,{linkName:t,tooltipText:"my_operations.tooltip.open_building",functionCall:n=>{e.linkGen(!0,n,"BUILDING",t)},href:e.linkGen(!1,void 0,"BUILDING",t)}))),n.ehrCode.length>5?" ...":"",n.ehrCode.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),u(!d)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_ehrCodes"})})})]})}):"",n.address?(0,Eo.jsx)("div",{children:l?(0,Eo.jsxs)("div",{children:[n.address.map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),n.address.length>5&&(0,Eo.jsx)(_o.Link,{type:"hide",onClick:e=>{e.preventDefault(),c(!l)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_less_addresses"})})]}):1===n.address.length?n.address:(0,Eo.jsxs)("div",{children:[null===(m=n.address)||void 0===m?void 0:m.slice(0,4).map(((e,t)=>(0,Eo.jsxs)(So().Fragment,{children:[e,";",(0,Eo.jsx)("br",{})]},t))),null===(g=n.address)||void 0===g?void 0:g.slice(4,5),n.address.length>5?" ...":"",n.address.length>5&&(0,Eo.jsx)("div",{className:"pr-3",children:(0,Eo.jsx)(_o.Link,{type:"show",onClick:e=>{e.preventDefault(),c(!l)},text:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.link.view_all_addresses"})})})]})}):"",n.supervisorJurId?null===(h=v.find((e=>e.id===n.supervisorJurId)))||void 0===h?void 0:h.regName:"",n.supervisor],x=[...b];x.splice(4,1);const S=[...b].slice(1,4).concat(b[10]).concat(b[5]).concat(b[8]);return(0,Eo.jsx)(_o.CollapseTableRow,{fields:e.viewType===Wt?x:e.viewType===Zt?S:b},n.id)})))(r),headers:function(){const n=[...S];n.splice(4,1);const o=e.viewType===Wt?n:e.viewType===Zt?w:S,l=[...x];l.splice(4,1);const c=e.viewType===Wt?l:e.viewType===Zt?_:x;return o.map(((e,n)=>(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("a",{className:"link-gray",style:{paddingRight:"2px"},onClick:()=>{const e=ON(n,a);s(e),e.direction!==IN&&i(TN(r,c[n],e.direction))},children:a.column===n?(0,Eo.jsx)(DN,{sortDirection:a.direction}):(0,Eo.jsx)(DN,{sortDirection:IN})}),t.formatMessage({id:e})]})))}(),paginationEnabled:!0,pager:{offset:n.offset,limit:n.limit,total:r.length},onPaginationReload:o}),(e.viewType===Yt||e.viewType===Gt)&&(0,Eo.jsx)("div",{className:"d-flex justify-content-start",children:(0,Eo.jsx)(_o.Checkbox,{name:"checkbox",onChange:t=>e.onAllUsersChecked(t),text:e.viewType===Yt?(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.view_all_institution_coordinations"}):(0,Eo.jsx)(_o.Text,{raw:"my_opinions.view_all_institution_opinions"}),checked:e.isAllUsersChecked})})]})},BR=e=>{var t;const n=(0,wo.useIntl)(),o=/^[\\s0-9]{0,9}$/,r=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,i=null!==(t=e.initialFilter)&&void 0!==t?t:{documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},a={...i,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},s={...i,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},l={...i,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[c,d]=(0,yo.useState)(e.filterState),[u,p]=(0,yo.useState)(VR(c.operationStates)),[f,m]=(0,yo.useState)(!0),[g,h]=(0,yo.useState)(!0),[b,v]=(0,yo.useState)(""),[y,x]=(0,yo.useState)(""),S=(0,yo.useMemo)((()=>FR()),[]),[w,_]=(0,yo.useState)([]),[E,T]=(0,yo.useState)([]),I=(0,yo.useMemo)((()=>LR(e.viewType,n)),[e.viewType]),[C,M]=(0,yo.useState)([]),O=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutionUsers)),D=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function k(e){return o.test(e)}function j(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],c[t]=n,d((e=>({...e})))}function A(e,t){var n;c[t]=e,"ehrCode"===t&&k(e)?m(!0):"cadastralNumber"===t&&(0===(n=e).length||r.test(n))&&h(!0),d((e=>({...e})))}(0,yo.useEffect)((()=>{if(O){const e=iR(O?[...O]:[]);T(e)}if(D){const e=aR([...D]);_(e)}}),[O,D]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(c),children:[(0,Eo.jsx)(_o.Row,{className:"align-items-start",children:(0,Eo.jsx)(_o.Col,{sm:10,className:"mx-0 px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:S,onSelect:e=>j(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>j(e,"documentTypes"),value:c.documentTypes,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})}),(0,Eo.jsx)(_o.Row,{className:"align-items-start",children:(0,Eo.jsx)(_o.Col,{sm:10,className:"mx-0 px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"ehrCode"),onBlur:e=>h(k(e.trim())),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.ehrCode}),errorMessage:!f&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:w,onSelect:e=>j(e,"institutions"),allSelection:!0,onRemoveItem:e=>j(e,"institutions"),value:c.institutions,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"proceedingNumber"),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:I,onSelect:e=>j(e,"operationStates"),allSelection:!0,onRemoveItem:e=>j(e,"operationStates"),value:c.operationStates,selectedOptions:u}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_state"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?v(n.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?v(n.formatMessage({id:"filter.invalid_date_range"})):v(""),d((t=>({...t,operationDate:e})))})(e),value:c.operationDate}),errorMessage:b.length>0?b:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{sm:10,className:"mx-0 px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>A(e,"wordInAddress"),placeholder:n.formatMessage({id:"placeholder.writing"}),value:c.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:E,onSelect:e=>j(e,"institutionUsers"),allSelection:!0,onRemoveItem:e=>j(e,"institutionUsers"),value:c.institutionUsers,selectedOptions:C}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution_users"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?x(n.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?x(n.formatMessage({id:"filter.invalid_date_range"})):x(""),d((t=>({...t,operationDeadline:e})))})(e),value:c.operationDeadline}),errorMessage:y.length>0?y:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.operation_deadline"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>function(){let t;switch(M([]),e.viewType){case qt:t=a;break;case Jt:case Zt:t=s;break;case Xt:t=l;break;default:t=i}d(t),p(VR(t.operationStates))}(),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(f&&g),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},KR=e=>{var t,n,o,r,i;let{classifierApiEndpoint:a,fileUploadApiEndpoint:s,linkGen:l,myViewsApiEndpoint:c,userInfo:d,userApiEndpoint:u}=e;const p=(0,xl.useDispatch)(),[f,h]=(0,yo.useState)({proceedings:!1}),[b,v]=(0,yo.useState)(!0),[y,x]=(0,yo.useState)(!0),[S,w]=(0,yo.useState)([]),[_,E]=(0,yo.useState)([]),{proceedings:T,isLoading:I,filter:C}=(0,xl.useSelector)(bt),M=null!==(t=null==T?void 0:T.content)&&void 0!==t?t:[],O=new F(new _e({basePath:a})),D=new oe(new _e({basePath:u})),k=new he(new _e({basePath:c})),j=new xe(new _e({basePath:c})),A=new Xe(new Ze({basePath:s})),P="A"!==(null===(n=d.activeRole)||void 0===n?void 0:n.businessType);let N=new Date;N.setDate(N.getDate()-7);const R={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:["MENTOIMSEIS_OOTEL","MENTOIMSEIS_TEOSTAMISEL"],institutionUsers:[(null===(o=d.activeRole)||void 0===o?void 0:o.userId)+""],operationDate:{from:"",to:""},operationDeadline:{from:N.toISOString().split("T")[0],to:""}},[L,U]=(0,yo.useState)(R),[V,$]=(0,yo.useState)({});const B={userId:null===(r=d.activeRole)||void 0===r?void 0:r.userId,personId:null===(i=d.activeRole)||void 0===i?void 0:i.businessId,dotys:["11525","11271","11201","11301","11271","11371","11002","11582","11581","12271","12371","11413","11412","11430","11583","11274","11275"],states:[Un.DO_DOKUSEIS_ESITATUD,Un.DO_DOKUSEIS_MENETLUSES]};return(0,yo.useEffect)((()=>{!function(e){var t,n;const o={userId:e.institutionUsers?Number(e.institutionUsers[0]):null===(t=d.activeRole)||void 0===t?void 0:t.userId,personId:null===(n=d.activeRole)||void 0===n?void 0:n.businessId,states:e.operationStates,type:[pn.MENTOIMLIIK_MEN_MARKUS]};v(!0),j.findOperationsToComment(o).then((e=>{p(St(e.data)),w(e.data),v(!1)})).catch((e=>{console.log("Following error occured:",e),v(!1)}))}(L)}),[d,L]),(0,yo.useEffect)((()=>{p(gt({userInfo:d,isAllUsersChecked:f.proceedings}))}),[d,f.proceedings]),(0,yo.useEffect)((()=>{!function(){const e=B;e.userId=void 0,x(!0),k.findBaseIncomingDocuments(e).then((e=>{p(wt(e.data)),x(!1),E(e.data)})).catch((e=>{console.log("Following error occured:",e),x(!1)}))}()}),[d]),(0,yo.useEffect)((()=>{var e,t;O.getAllDocumentTypes().then((e=>{p(m(e.data))})).catch((e=>{console.log(e)})),P&&D.getJurUsers(null!==(e=null===(t=d.activeRole)||void 0===t?void 0:t.businessId)&&void 0!==e?e:0).then((e=>{p(g(e.data))})).catch((e=>{console.log(e)}))}),[d]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_proceedings.my_proceedings",showSettings:!0,filterContents:(0,Eo.jsx)(jR,{onSubmit:e=>{p(xt(e)),p(gt({userInfo:d,filter:e,isAllUsersChecked:f.proceedings}))},isKov:P,filterState:C}),children:I||0!==M.length?(0,Eo.jsx)(CR,{linkGen:l,isKov:P,onAllUsersChecked:e=>{h({proceedings:e}),p(gt({userInfo:d,isAllUsersChecked:e}))},isAllUsersChecked:f.proceedings,filter:C,userInfo:d}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.no_proceedings"})}),P&&(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_proceedings.view_all_institution_proceedings",onClick:()=>{h({proceedings:!0}),p(gt({userInfo:d,isAllUsersChecked:!0}))}})})]})}),P&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_proceedings.section_title.proceedings_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Zt,initialFilter:R,filterState:L,onSubmit:e=>U(e)}),children:b?(0,Eo.jsx)(_o.SectionLoader,{}):0===S.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_proceedings.proceedings_to_comment.no_proceedings"})}):(0,Eo.jsx)($R,{linkGen:l,viewType:Zt,filter:L})}),P&&(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_documents.incoming_documents",showSettings:!0,filterContents:(0,Eo.jsx)(lR,{documentType:Ht,filterState:V,onSubmit:e=>$(e),isKov:P}),children:y?(0,Eo.jsx)(_o.SectionLoader,{}):0===_.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_documents.incoming_documents.no_docs"})}):(0,Eo.jsx)(eR,{linkGen:l,userInfo:d,documentType:Ht,filter:V,fileApi:A})})]})},zR=e=>{let{classifierApiEndpoint:t,linkGen:n,myViewsApiEndpoint:o,userApiEndpoint:r,userInfo:{activeRole:i}}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!0),[c,d]=(0,yo.useState)(!1),[u,p]=(0,yo.useState)(!1),[f,b]=(0,yo.useState)(null),[v,y]=(0,yo.useState)(null),[x,S]=(0,yo.useState)(null),w={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},_={...w,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},E={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},T={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[I,C]=(0,yo.useState)(_),[M,O]=(0,yo.useState)(E),[D,k]=(0,yo.useState)(T),[j,A]=(0,yo.useState)(!1),P=new X(new _e({basePath:r})),N=new oe(new _e({basePath:r})),R=new xe(new _e({basePath:o})),L=new F(new _e({basePath:t}));return(0,yo.useEffect)((()=>{var e;P.getJurKovPersons().then((e=>{a(h(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),N.getJurUsers(null!==(e=null==i?void 0:i.businessId)&&void 0!==e?e:0).then((e=>{a(g(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),L.getAllDocumentTypes().then((e=>{a(m(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)}))}),[]),(0,yo.useEffect)((()=>{!function(){const e={userId:null==i?void 0:i.userId,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)};j&&(e.userId=void 0),l(!0),R.findOperations(e).then((e=>{a(It(e.data)),b(e.data),l(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),l(!1)}))}()}),[j]),(0,yo.useEffect)((()=>{d(!0),R.findOperationsToComment({userId:null==i?void 0:i.userId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Ct(e.data)),y(e.data),d(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),d(!1)})),p(!0),R.findOperationInvitations({userId:void 0,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_VALINE_KOOSK],states:Gn.MENTOIMSEIS_OOTEL.concat(Gn.MENTOIMSEIS_TEOSTAMISEL,Gn.MENTOIMSEIS_TYHISTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Mt(e.data)),S(e.data),p(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),p(!1)}))}),[]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.my_coordinations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:qt,filterState:I,onSubmit:e=>C(e)}),children:[s&&(0,Eo.jsx)(_o.SectionLoader,{}),s||f?(0,Eo.jsx)($R,{linkGen:n,viewType:Yt,filter:I,isAllUsersChecked:j,onAllUsersChecked:e=>{A(e)}}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_coordinations"})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_coordinations.view_all_institution_coordinations",onClick:()=>{A(!0)}})})]})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.coordinations_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Jt,filterState:M,onSubmit:e=>O(e)}),children:[c&&(0,Eo.jsx)(_o.SectionLoader,{}),c||v?(0,Eo.jsx)($R,{linkGen:n,viewType:Jt,filter:M}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_coordinations_to_comment"})})})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_coordinations.coordination_invitations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Xt,filterState:D,onSubmit:e=>k(e)}),children:[u&&(0,Eo.jsx)(_o.SectionLoader,{}),u||x?(0,Eo.jsx)($R,{linkGen:n,viewType:Xt,filter:D}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_coordinations.no_approval_invitations"})})})]})]})},HR=(0,u.createAsyncThunk)("myApprovals/getAllApprovalsData",(async(e,t)=>{let{userInfo:n}=e,{dispatch:o}=t;o(co({userInfo:n})),o(so({userInfo:n})),o(lo({userInfo:n}))})),YR={accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e},GR=e=>{let{operations:t,isLoading:n,isError:o}=e;const r=(0,wo.useIntl)(),{linkGen:i}=(0,yo.useContext)(Ub),[a,s]=(0,yo.useState)([]);return(0,yo.useEffect)((()=>{s(((e,t)=>[YR.accessor((e=>e.invitationDate),{id:"invitationDate",cell:e=>{const t=e.row.original;return t.invitationDate?rv.dateToStr(t.invitationDate):"-"},header:e.formatMessage({id:"my_approvals.table.header.invitation_date"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),YR.accessor((e=>e.deadline),{id:"deadline",cell:e=>{const t=e.row.original;return t.deadline?rv.dateToStr(t.deadline):"-"},header:e.formatMessage({id:"my_approvals.table.header.deadline"}),size:dv.Date,maxSize:dv.Date,minSize:dv.Date}),YR.accessor((e=>e.proceedingNr),{id:"proceedingNr",cell:e=>{const n=e.row.original;return(0,Eo.jsx)(jp,{visualType:"link",underline:!0,onClick:e=>t(e,iv.PlanningProceeding,n.proceedingNr,void 0,!0),children:n.proceedingNr})},header:e.formatMessage({id:"my_approvals.table.header.proceeding_nr"})}),YR.accessor((e=>e.stateCode),{id:"state",cell:t=>{const n=t.row.original,o=n.stateCode?NR(n.stateCode,e):void 0;return(0,Eo.jsx)(Eo.Fragment,{children:o&&(0,Eo.jsx)(Qb,{color:o.newType,children:o.name})})},header:e.formatMessage({id:"my_approvals.table.header.state"})}),YR.accessor((e=>e.doty),{id:"documentType",cell:e=>{var t,n;const o=e.row.original;return(0,Eo.jsx)(Eo.Fragment,{children:null!==(t=null===(n=Rn.find((e=>e.code===o.doty)))||void 0===n?void 0:n.name)&&void 0!==t?t:"-"})},header:e.formatMessage({id:"my_approvals.table.header.document_type"})}),YR.accessor((e=>e.institution),{id:"institution",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_approvals.table.header.institution"})}),YR.accessor((e=>e.supervisor),{id:"supervisor",cell:e=>e.renderValue(),header:e.formatMessage({id:"my_approvals.table.header.supervisor"})})])(r,i))}),[t]),(0,Eo.jsx)(qP,{isLoading:n,isError:o,data:t,columns:a,id:"approvals-operations-table"})},WR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(go);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsToComment,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsToComment}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},qR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(fo);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsOngoing,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsOngoing}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},JR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(ho);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsIncoming,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsIncoming}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},XR=()=>{const e=(0,wo.useIntl)(),{operations:t,isLoading:n,isError:o}=(0,xl.useSelector)(mo);return(0,Eo.jsxs)(cb,{id:mn.ApprovalsAllAssigned,children:[(0,Eo.jsx)(gb,{background:"primary",closeText:" ",openText:" ",children:e.formatMessage({id:`my_approvals.page.section_title.${mn.ApprovalsAllAssigned}`})}),(0,Eo.jsx)(Ib,{children:(0,Eo.jsx)(GR,{operations:t,isLoading:n,isError:o})})]})},ZR=[mn.ApprovalsOngoing,mn.ApprovalsToComment,mn.ApprovalsIncoming],QR=e=>{let{userInfo:t,linkGen:n}=e;const o=(0,xl.useDispatch)(),r=(0,yo.useMemo)((()=>({linkGen:n})),[n]);return(0,yo.useEffect)((()=>{t&&o(HR({userInfo:t}))}),[]),(0,Eo.jsx)(Cl,{id:"MyApprovalsPage",gutter:0,children:(0,Eo.jsx)(Ml,{children:(0,Eo.jsx)(Ub.Provider,{value:r,children:(0,Eo.jsxs)(pp,{size:.5,children:[(0,Eo.jsx)(bp,{title:"my_approvals.page_title"}),(0,Eo.jsxs)(gp,{defaultOpenItem:ZR,gutter:1,children:[(0,Eo.jsx)(qR,{}),(0,Eo.jsx)(XR,{}),(0,Eo.jsx)(WR,{}),(0,Eo.jsx)(JR,{})]})]})})})})},eL=e=>(0,Eo.jsx)(yl,{locale:"et",children:(0,Eo.jsx)(QR,{...e})}),tL=e=>{let{classifierApiEndpoint:t,linkGen:n,myViewsApiEndpoint:o,userApiEndpoint:r,userInfo:{activeRole:i}}=e;const a=(0,xl.useDispatch)(),[s,l]=(0,yo.useState)(!1),[c,d]=(0,yo.useState)(!1),[u,p]=(0,yo.useState)(!1),[f,b]=(0,yo.useState)(null),[v,y]=(0,yo.useState)(null),[x,S]=(0,yo.useState)(null),w={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[],institutionUsers:[],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},_={...w,operationStates:[Wn.MENTOIMSEIS_TEOSTAMISEL]},E={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_JATKAMINE]},T={...w,operationStates:[Wn.MENTOIMSEIS_OOTEL]},[I,C]=(0,yo.useState)(_),[M,O]=(0,yo.useState)(E),[D,k]=(0,yo.useState)(T),[j,A]=(0,yo.useState)(!1),P=new X(new _e({basePath:r})),N=new oe(new _e({basePath:r})),R=new xe(new _e({basePath:o})),L=new F(new _e({basePath:t}));return(0,yo.useEffect)((()=>{var e;P.getJurKovPersons().then((e=>{a(h(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),N.getJurUsers(null!==(e=null==i?void 0:i.businessId)&&void 0!==e?e:0).then((e=>{a(g(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)})),L.getAllDocumentTypes().then((e=>{a(m(e.data))})).catch((e=>{console.error(`Following error occured: ${e}`)}))}),[]),(0,yo.useEffect)((()=>{!function(){const e=j?null==i?void 0:i.businessId:null==i?void 0:i.userId;l(!0),R.findOperations({personId:j?e:void 0,userId:j?void 0:e,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(It(e.data)),b(e.data),l(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),l(!1)}))}()}),[j]),(0,yo.useEffect)((()=>{d(!0),R.findOperationsToComment({userId:null==i?void 0:i.userId,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_TEOSTAMISEL.concat(Gn.MENTOIMSEIS_TEOSTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Ct(e.data)),y(e.data),d(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),d(!1)})),p(!0),R.findOperationInvitations({userId:void 0,personId:null==i?void 0:i.businessId,type:[pn.MENTOIMLIIK_ARVAMUS],states:Gn.MENTOIMSEIS_OOTEL.concat(Gn.MENTOIMSEIS_TEOSTAMISEL,Gn.MENTOIMSEIS_TYHISTATUD,Gn.MENTOIMSEIS_LOOBUTUD,Gn.MENTOIMSEIS_TAHTAEG_MOODUNUD)}).then((e=>{a(Mt(e.data)),S(e.data),p(!1)})).catch((e=>{console.error(`Following error occured: ${e}`),p(!1)}))}),[]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.my_opinions",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:qt,filterState:I,onSubmit:e=>C(e)}),children:[s&&(0,Eo.jsx)(_o.SectionLoader,{}),s||f?(0,Eo.jsx)($R,{linkGen:n,viewType:Gt,filter:I,isAllUsersChecked:j,onAllUsersChecked:e=>{A(e)}}):(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinions"})}),(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Link,{text:"my_opinions.view_all_institution_opinions",onClick:()=>{A(!0)}})})]})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.opinions_to_comment",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Jt,filterState:M,onSubmit:e=>O(e)}),children:[c&&(0,Eo.jsx)(_o.SectionLoader,{}),c||v?(0,Eo.jsx)($R,{linkGen:n,viewType:Jt,filter:M}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinions_to_comment"})})})]}),(0,Eo.jsxs)(_o.Section,{collapsed:!1,title:"my_opinions.opinion_invitations",showSettings:!0,filterContents:(0,Eo.jsx)(BR,{viewType:Xt,filterState:D,onSubmit:e=>k(e)}),children:[u&&(0,Eo.jsx)(_o.SectionLoader,{}),u||x?(0,Eo.jsx)($R,{linkGen:n,viewType:Xt,filter:D}):(0,Eo.jsx)("div",{children:(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_opinions.no_opinion_invitations"})})})]})]})},nL=e=>{const t=(0,wo.useIntl)(),n=/^[\\s0-9]{0,9}$/,o=/^([\\s0-9]{5}:[\\s0-9]{3}:[\\s0-9]{1,4}|[\\s0-9]{5}:[\\s0-9]{1,3}|[\\s0-9]{1,5})$/,r={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},[i,a]=(0,yo.useState)(e.filterState),[s,l]=(0,yo.useState)(VR(i.operationStates)),[c,d]=(0,yo.useState)(!0),[u,p]=(0,yo.useState)(!0),[f,m]=(0,yo.useState)(""),g=(0,yo.useMemo)((()=>FR()),[]),[h,b]=(0,yo.useState)([]),v=(0,yo.useMemo)((()=>LR(Wt,t)),[]),[y,x]=(0,yo.useState)([]),S=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions));function w(e){return n.test(e)}function _(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],i[t]=n,a((e=>({...e})))}function E(e,t){var n;i[t]=e,"ehrCode"===t&&w(e)?d(!0):"cadastralNumber"===t&&(0===(n=e).length||o.test(n))&&p(!0),a((e=>({...e})))}(0,yo.useEffect)((()=>{if(S){const e=aR([...S]);b(e)}}),[S]);return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>e.onSubmit(i),children:[(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:g,onSelect:e=>_(e,"documentTypes"),allSelection:!0,onRemoveItem:e=>_(e,"documentTypes"),value:i.documentTypes,selectedOptions:y}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.document_type"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"ehrCode"),onBlur:e=>d(w(e.trim())),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.ehrCode}),errorMessage:!c&&(0,Eo.jsx)(_o.Text,{raw:"filter.invalid_building_code"}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.ehrCode"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"wordInAddress"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.wordInAddress}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.word_in_address"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:h,onSelect:e=>_(e,"institutions"),allSelection:!0,onRemoveItem:e=>_(e,"institutions"),value:i.institutions,selectedOptions:y}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.institution"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>E(e,"proceedingNumber"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:i.proceedingNumber}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_operations.filter.label.proceeding_number"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:v,onSelect:e=>_(e,"operationStates"),allSelection:!0,onRemoveItem:e=>_(e,"operationStates"),value:i.operationStates,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_involvements.filter.label.involvement_state"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.FieldWrapper,{component:(0,Eo.jsx)(sR,{onChange:e=>(e=>{""!==e.from&&!tv()(e.from,"YYYY-MM-DD",!0).isValid()||""!==e.to&&!tv()(e.to,"YYYY-MM-DD",!0).isValid()?m(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&e.from>e.to?m(t.formatMessage({id:"filter.invalid_date_range"})):m(""),a((t=>({...t,operationDate:e})))})(e),value:i.operationDate}),errorMessage:f.length>0?f:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"my_involvements.filter.label.involvement_date"}),labelCol:{sm:20,md:8,lg:8},info:{content:"...",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(x([]),a(r),void l(VR(r.operationStates))),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!(c&&u),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},oL=e=>{var t;let{classifierApiEndpoint:n,linkGen:o,myViewsApiEndpoint:r,userInfo:i,userApiEndpoint:a}=e;const s=(0,xl.useDispatch)(),[l,c]=(0,yo.useState)(!1),[d,u]=(0,yo.useState)([]),p=!(void 0===i||"A"===(null==i||null===(t=i.activeRole)||void 0===t?void 0:t.businessType)),f={documentTypes:[],ehrCode:"",institutions:[],wordInAddress:"",proceedingNumber:"",cadastralNumber:"",operationStates:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_LOOBUTUD],operationDate:{from:"",to:""},operationDeadline:{from:"",to:""}},[g,b]=(0,yo.useState)(f),v=new X(new _e({basePath:a})),y=new xe(new _e({basePath:r})),x=new F(new _e({basePath:n}));return(0,yo.useEffect)((()=>{var e;v.getJurKovPersons().then((e=>{s(h(e.data))})).catch((e=>{console.log(e)})),x.getAllDocumentTypes().then((e=>{s(m(e.data))})).catch((e=>{console.log(e)})),c(!0),y.findOperations({userId:void 0,personId:p?null===(e=i.activeRole)||void 0===e?void 0:e.businessId:i.personId,type:[pn.MENTOIMLIIK_KAASAMINE,pn.MENTOIMLIIK_KAAS_TAGASISIDE],states:[Wn.MENTOIMSEIS_OOTEL,Wn.MENTOIMSEIS_TEOSTAMISEL,Wn.MENTOIMSEIS_TEOSTATUD,Wn.MENTOIMSEIS_VALMIS,Wn.MENTOIMSEIS_JATKAMINE,Wn.MENTOIMSEIS_TYHISTATUD,Wn.MENTOIMSEIS_LOOBUTUD,Wn.MENTOIMSEIS_KEELDUTUD,Wn.MENTOIMSEIS_TAGASI_LYKATUD,Wn.MENTOIMSEIS_TAHTAEG_MOODUNUD]}).then((e=>{s(It(e.data)),u(e.data),c(!1)})).catch((e=>{console.log("Following error occured:",e),c(!1)}))}),[i]),(0,Eo.jsx)("div",{children:(0,Eo.jsx)(_o.Section,{collapsed:!1,title:"my_involvements.my_involvements",showSettings:!0,filterContents:(0,Eo.jsx)(nL,{filterState:g,onSubmit:e=>b(e)}),children:l?(0,Eo.jsx)(_o.SectionLoader,{}):0===d.length?(0,Eo.jsx)("div",{className:"d-flex justify-content-center mb-1",children:(0,Eo.jsx)(_o.Text,{raw:"my_involvements.no_involvements"})}):(0,Eo.jsx)($R,{linkGen:o,viewType:Wt,filter:g})})})};function rL(e){return e.map((e=>({id:e.code+"",label:e.value,level:2,children:[],selectable:!0,value:!1})))}function iL(e){let t=rL([{code:"EHITIS_SEISUND_KAVAN",value:"Kavandatav"},{code:"EHITIS_SEISUND_PYSTI",value:"Püstitamisel"},{code:"EHITIS_SEISUND_OLEMA",value:"Olemas"},{code:"EHITIS_SEISUND_LAMEL",value:"Lammutamisel"},{code:"EHITIS_SEISUND_LAMUT",value:"Lammutatud"},{code:"EHITIS_SEISUND_REATA",value:"Realiseerimata"},{code:"EHITIS_SEISUND_KUSTU",value:"Kustutatud"}]);return e?t:t.slice(0,-1)}function aL(e){return e.map((e=>{var t;return{id:String(e.value),label:null!==(t=e.description)&&void 0!==t?t:"",level:2,children:[],selectable:!0,value:!1}}))}const sL=[{code:"EHITIS_OMANDI_LIIK_KINNIS",value:"Kinnisasi"},{code:"EHITIS_OMANDI_LIIK_VALLAS",value:"Vallasasi"},{code:"EHITIS_OMANDI_LIIK_VALLASRO",value:"Reaalosa kui vallasasi"}];function lL(){return rL(sL)}function cL(e){let t=[];for(let n of e)t.push(n.id),t.push(...cL(n.children?n.children:[]));return t}const dL=e=>{const t=(0,wo.useIntl)(),n={buildingLocation:"",buildingName:"",buildingStates:[],firstUseDate:{from:"",to:""},firstUseMissing:!1,buildingType:[],purposeOfUse:[],ownershipType:[],heritage:[],owner:void 0,isPrivatePerson:!1,searchType:Qt},o=(0,xl.useSelector)((e=>e.myViewsPage.filter.usageClassifierTypes)),r=(0,xl.useSelector)((e=>e.myViewsPage.filter.heritageClassifierTypes)),i=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.buildings)),[a,s]=(0,yo.useState)(n),[l,c]=(0,yo.useState)([]),[d,u]=(0,yo.useState)(iL(e.isAdminRole)),[p]=(0,yo.useState)(rL([{code:"H",value:"Hoone"},{code:"R",value:"Rajatis"}])),[f]=(0,yo.useState)(lL()),[m,g]=(0,yo.useState)([]),[h,b]=(0,yo.useState)([]),[v,y]=(0,yo.useState)({}),[x,S]=(0,yo.useState)(""),[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)(""),[I,C]=(0,yo.useState)(!1),[M,O]=(0,yo.useState)({code:"",value:""}),D=(0,yo.useRef)(),[k,j]=(0,yo.useState)({});function A(e,t){let n;n=e.selectedData.length>0?void 0!==e.selectedData[0].data?e.selectedData[0].data.map((e=>e.id)):e.selectedData.map((e=>e.id)).flat():[],a[t]=n,s((e=>({...e})))}function P(e,t){let n;if(e.selectedData.length>0){n=cL(void 0===e.selectedData[0].data?e.selectedData:e.selectedData[0].data)}else n=[];a[t]=n,s((e=>({...e})))}function N(e,t){a[t]=e,s((e=>({...e})))}(0,yo.useEffect)((()=>{if(o.length>0){const e=function(e){let t=e.sort(((e,t)=>Number(e.code)-Number(t.code)));return function(e){let t={id:"00000",label:"00000",parentId:"0",level:1,value:!1,selectable:!1,children:[]};for(let n of e){const{code:e,name:o,validTo:r}=n;let i=e.replace(/0/g,""),a=i.slice(0,i.length-1),s=t;for(let e=2;e<=a.length;e++)if(s.children){let t=s.children.find((t=>t.id.replace(/0/g,"")===a.slice(0,e)));t&&(s=t)}if(s.children){const t=`${e} ${o}${null!=r&&r.trim()?` (kuni ${r})`:""}`;s.children.push({id:n.id+"",parentId:s.id,label:t,level:s.level+1,children:[],selectable:!0,value:!1})}}return t.children?t.children:[]}(t)}([...o]);g(e)}}),[o]),(0,yo.useEffect)((()=>{if(r.length>0){const e=aL(r);b(e)}}),[r]),(0,yo.useEffect)((()=>{u(iL(e.isAdminRole))}),[e.isAdminRole]);const R={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>function(){if(JSON.stringify(n)===JSON.stringify(a))_({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"});else if(a.firstUseMissing){let t={...a};t.firstUseDate={from:"",to:""},e.onSubmit(t)}else _({header:"",message:""}),e.onSubmit(a)}(),children:[w.header&&w.header.length>0&&w.message&&w.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:w.header}),onDismiss:()=>_({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:w.message})]}),i&&i.length>=500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>N(e,"buildingLocation"),placeholder:t.formatMessage({id:"detailssearch.filter.placeholder.address"}),value:a.buildingLocation}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_location"}),info:{content:"detailsearch.filter.tooltip.building_location",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>N(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:a.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_name"}),info:{content:"detailsearch.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:d,onSelect:e=>A(e,"buildingStates"),allSelection:!0,onRemoveItem:e=>A(e,"buildingStates"),value:a.buildingStates,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_state"}),info:{content:"detailsearch.filter.tooltip.building_state",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.NumberRangeExtended,{value:{from:a.firstUseDate.from,to:a.firstUseDate.to},onChange:e=>function(e){S(""),_({header:"",message:""});let t=null!==e.from?e.from:"",n=null!==e.to?e.to:"";s((e=>({...e,firstUseDate:{from:t,to:n}})))}(e),onBlur:e=>function(e){let n=Number(e.from),o=Number(e.to);n<0||n>2100||o<0||o>2100?S(t.formatMessage({id:"detailsearch.error_field.year-between"})):null!==e.from&&null!==e.to&&n>o?S(t.formatMessage({id:"detailsearch.error_field.beginning-bigger"})):(S(""),_({header:"",message:""}))}(e),onlyPositive:!0,disabled:a.firstUseMissing})}),errorMessage:x,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.first_use"}),info:{content:"detailsearch.filter.tooltip.first_use",placement:"top-start"}}),(0,Eo.jsx)(Eo.Fragment,{children:nR(a.firstUseMissing,(function(e){s((t=>({...t,firstUseMissing:e})))}),"detailsearch.filter.label.checkbox.first_use_missing","detailsearch.filter.tooltip.checkbox.first_use_missing",R)})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:p,onSelect:e=>A(e,"buildingType"),allSelection:!0,onRemoveItem:e=>A(e,"buildingType"),value:a.buildingType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_type"}),info:{content:"detailsearch.filter.tooltip.building_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:m,onSelect:e=>P(e,"purposeOfUse"),allSelection:!0,onRemoveItem:e=>P(e,"purposeOfUse"),value:a.purposeOfUse,selectedOptions:l,isSearchExactMatch:!0}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.purpose_of_use"}),info:{content:"detailsearch.filter.tooltip.purpose_of_use",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>A(e,"ownershipType"),allSelection:!0,onRemoveItem:e=>A(e,"ownershipType"),value:a.ownershipType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.ownershiptype"}),info:{content:"detailsearch.filter.tooltip.ownershiptype",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:h,onSelect:e=>A(e,"heritage"),allSelection:!0,onRemoveItem:e=>A(e,"heritage"),value:a.ownershipType,selectedOptions:l}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.heritage"}),info:{content:"detailsearch.filter.tooltip.heritage",placement:"top-start"}})]}),e.isAdminPlusRole&&(0,Eo.jsx)(Eo.Fragment,{children:(0,Eo.jsxs)(_o.Row,{className:"align-items-center w-100",children:[(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{labelCol:R,component:(0,Eo.jsx)(_o.PersonSearchPageExtended,{person:v,disabled:!1,labelKey:"code",valueKey:"value",onInputChange:e=>{!function(e){T(e)}(e)},updatedFromAR:()=>{},onPersonUpdate:e=>function(e){var t,n,o;if(y(e),e&&e.id&&e.id>0&&j(e),e&&(E===e.idCode||E===(null===(t=e.id)||void 0===t?void 0:t.toString())||E===e.regCode)||e&&M.code===e.regCode)a.owner=null===(o=e.id)||void 0===o?void 0:o.toString(),s((e=>({...e})));else if(e||E.substring(4)!==(null===(n=k.id)||void 0===n?void 0:n.toString()))e||(a.owner=void 0,s((e=>({...e}))));else{var r;a.owner=null===(r=k.id)||void 0===r?void 0:r.toString(),s((e=>({...e})))}}(e),searchPerson:e.callSearchPerson,handlePersonSelection:e=>O(e),isShowError:e=>{C(e),e||_({header:"",message:""})},searchOnBlur:!0,ref:D,isOptionalField:!0,isPrivateOwner:a.isPrivatePerson}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.owner"}),info:{content:"detailsearch.filter.tooltip.owner.extended",placement:"top-start"}})}),(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,children:nR(a.isPrivatePerson,(function(e){s((t=>({...t,isPrivatePerson:e})))}),"detailsearch.filter.label.checkbox.owner.private","",{xs:20,md:1})})]})})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(c([]),s(n),D.current.clearTypeahead(),void y({})),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(x.length>0||I),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},uL=e=>{const t=(0,wo.useIntl)(),n={buildingLocation:"",buildingName:"",institutions:[],documentDate:{from:"",to:""},documentType:[],documentNr:"",documentState:[],connectedPerson:void 0},[o,r]=(0,yo.useState)(n),[i,a]=(0,yo.useState)(""),[s,l]=(0,yo.useState)([]),[c,d]=(0,yo.useState)([]),[u,p]=(0,yo.useState)([]),[f]=(0,yo.useState)(function(){const e=[{code:Un.DO_DOKUSEIS_ESITATUD,value:"Esitatud"},{code:Un.DO_DOKUSEIS_KOOSTAMISEL,value:"Koostamisel"},{code:Un.DO_DOKUSEIS_MENETLUSES,value:"Menetluses"},{code:Un.DO_DOKUSEIS_MUUTMISEL,value:"Muutmisel"},{code:Un.DO_DOKUSEIS_TAIENDAMISEL,value:"Täiendamisel"},{code:Un.DO_DOKUSEIS_KEHTETU,value:"Kehtetu"},{code:Un.DO_DOKUSEIS_REG_KANTUD,value:"Registrisse kantud"},{code:Un.DO_DOKUSEIS_TYHISTATUD,value:"Tühistatud"},{code:Un.DO_DOKUSEIS_LOOBUTUD,value:"Tagasi võetud"},{code:Un.DO_DOKUSEIS_ALLKIRJASTAMISEL,value:"Allkirjastamisel"},{code:Un.DO_DOKUSEIS_VANA_VERSIOON,value:"Vana versioon"}].sort(((e,t)=>e.value.localeCompare(t.value)));return rL(e)}()),[m,g]=(0,yo.useState)({}),[h,b]=(0,yo.useState)(""),[v,y]=(0,yo.useState)(!1),[x,S]=(0,yo.useState)({code:"",value:""}),[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)(!1),I=(0,yo.useRef)(),C=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),M=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),O=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.documents));function D(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],o[t]=n,r((e=>({...e})))}function k(e,t){o[t]=e.trim(),r((e=>({...e})))}function j(e){return!(!tv()(e,"YYYY-MM-DD",!0).isValid()&&!tv()(e,"D.M.YYYY",!0).isValid())}(0,yo.useEffect)((()=>{if(C){const e=rR(C);d(e)}if(M){const e=aR([...M]);p(e)}}),[C,M]);const A={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{i.length>0?T(!0):JSON.stringify(n)===JSON.stringify(o)?_({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"}):(e.onSubmit(o),_({header:"",message:""}))},children:[w.header&&w.header.length>0&&w.message&&w.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:w.header}),onDismiss:()=>_({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:w.message})]}),O&&O.length>500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"buildingLocation"),placeholder:t.formatMessage({id:"detailsearch.filter.placeholder.address_catastralUnit_ehrCode"}),value:o.buildingLocation}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_location"}),info:{content:"detailsearch.filter.tooltip.address_catastralUnit_ehrCode.extended",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"buildingName"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.buildingName}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.building_name"}),info:{content:"detailsearch.filter.tooltip.building_name",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:u,onSelect:e=>D(e,"institutions"),allSelection:!0,onRemoveItem:e=>D(e,"institutions"),value:o.institutions,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.institution"})}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{onBlur:()=>{T(!0)},value:o.documentDate,onChange:e=>(e=>{""!==e.from&&!j(e.from)||""!==e.to&&!j(e.to)?a(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&tv()(e.from)>tv()(e.to)?a(t.formatMessage({id:"filter.invalid_date_range"})):""!==e.from&&(tv()(e.from)<tv()("01.01.1990")||tv()(e.from)>tv()())||""!==e.to&&(tv()(e.to)<tv()("01.01.1990")||tv()(e.to)>tv()())?a(t.formatMessage({id:"detailsearch.document.date_range_error.message"},{dateToday:tv()().format("DD.MM.YYYY")})):tv()(e.to).diff(tv()(e.from),"days")>367?a(t.formatMessage({id:"detailsearch.filter_error_message.date_range_too_long"})):(a(""),T(!1)),r((t=>({...t,documentDate:e})))})(e)})}),errorMessage:E&&i.length>0?i:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_date"}),info:{content:"detailsearch.filter.tooltip.document_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:c,onSelect:e=>D(e,"documentType"),allSelection:!0,onRemoveItem:e=>D(e,"documentType"),value:o.documentType,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_type"}),info:{content:"detailsearch.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>k(e,"documentNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.documentNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_nr"}),info:{content:"detailsearch.filter.tooltip.document_nr",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:f,onSelect:e=>D(e,"documentState"),allSelection:!0,onRemoveItem:e=>D(e,"documentState"),value:o.documentState,selectedOptions:s}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_state"})})]})]}),!e.isNonAuthenticatedUser&&(0,Eo.jsx)(_o.Row,{children:(0,Eo.jsx)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:(0,Eo.jsx)(_o.FieldWrapper,{labelCol:A,component:(0,Eo.jsx)(_o.PersonSearchPageExtended,{person:m,disabled:!1,labelKey:"code",valueKey:"value",onInputChange:e=>{!function(e){b(e),x.code.length>0&&S({code:"",value:""})}(e)},updatedFromAR:()=>{},onPersonUpdate:e=>function(e){var t;g(e),e&&(h===e.idCode||h===(null===(t=e.id)||void 0===t?void 0:t.toString())||h===e.regCode)||e&&x.code===e.regCode?(o.connectedPerson=e.id,r((e=>({...e})))):e||(o.connectedPerson=void 0,r((e=>({...e}))))}(e),searchPerson:e.callSearchPerson,handlePersonSelection:e=>S(e),isShowError:e=>{y(e),e||_({header:"",message:""})},searchOnBlur:!0,ref:I,isOptionalField:!0}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.connected_person"}),info:{content:"detailsearch.filter.tooltip.connected_person.extended",placement:"top-start"}})})}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(l([]),r(n),I.current.clearTypeahead(),void g({})),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(E&&i.length>0||v),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},pL=e=>{const t=(0,wo.useIntl)(),n={documentType:[],documentNr:"",proceedingDate:{from:"",to:""},proceedingNr:"",institutions:[]},[o,r]=(0,yo.useState)(n),[i,a]=(0,yo.useState)([]),[s,l]=(0,yo.useState)([]),[c,d]=(0,yo.useState)([]),[u,p]=(0,yo.useState)(""),[f,m]=(0,yo.useState)({}),[g,h]=(0,yo.useState)(!1),b=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),v=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),y=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.proceedings));function x(e,t){let n;e.selectedData.length>0?(n=void 0!==e.selectedData[0].data?e.selectedData[0].data:e.selectedData,n=n.map((e=>e.id.length<5?e.children.map((e=>e.id)):e.id)).flat()):n=[],o[t]=n,r((e=>({...e})))}function S(e,t){o[t]=e,r((e=>({...e})))}function w(e){return!(!tv()(e,"YYYY-MM-DD",!0).isValid()&&!tv()(e,"D.M.YYYY",!0).isValid())}(0,yo.useEffect)((()=>{if(b){const e=rR(b);l(e)}if(v){const e=aR([...v]);d(e)}}),[b,v]);const _={sm:20,md:8,lg:8};return(0,Eo.jsxs)(_o.Form,{onSubmit:()=>{u.length>0?h(!0):JSON.stringify(n)===JSON.stringify(o)?m({header:"detailsearch.empty_filter_error.header",message:"detailsearch.empty_filter_error.message"}):(e.onSubmit(o),m({header:"",message:""}))},children:[f.header&&f.header.length>0&&f.message&&f.message.length>0&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:f.header}),onDismiss:()=>m({header:"",message:""}),theme:"danger",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:f.message})]}),y&&y.length>500&&(0,Eo.jsx)(_o.MessageBlock,{dismissible:!0,header:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.empty_filter_error.header"}),theme:"warning",messages:[(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter_error_message.more_than_500_results"})]}),(0,Eo.jsxs)(_o.Row,{className:"align-items-start",children:[(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:s,onSelect:e=>x(e,"documentType"),allSelection:!0,onRemoveItem:e=>x(e,"documentType"),value:o.documentType,selectedOptions:i}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_type"}),info:{content:"detailsearch.filter.tooltip.document_type",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>S(e,"documentNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.documentNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.document_nr"}),info:{content:"detailsearch.filter.tooltip.document_nr",placement:"top-start"}}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)("div",{className:"daterange_in_form",children:(0,Eo.jsx)(_o.DateRange,{onChange:e=>(e=>{""!==e.from&&!w(e.from)||""!==e.to&&!w(e.to)?p(t.formatMessage({id:"filter.invalid_date_format"})):""!==e.from&&""!==e.to&&tv()(e.from)>tv()(e.to)?p(t.formatMessage({id:"filter.invalid_date_range"})):""!==e.from&&(tv()(e.from)<tv()("01.01.1990")||tv()(e.from)>tv()())||""!==e.to&&(tv()(e.to)<tv()("01.01.1990")||tv()(e.to)>tv()())?p(t.formatMessage({id:"detailsearch.proceeding.date_range_error.message"},{dateToday:tv()().format("DD.MM.YYYY")})):tv()(e.to).diff(tv()(e.from),"days")>367?p(t.formatMessage({id:"detailsearch.filter_error_message.date_range_too_long"})):(p(""),h(!1)),r((t=>({...t,proceedingDate:e})))})(e),value:o.proceedingDate,onBlur:()=>{h(!0)}})}),errorMessage:g&&u.length>0?u:null,label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.proceeding_date"}),info:{content:"detailsearch.filter.tooltip.proceeding_date",placement:"top-start"}})]}),(0,Eo.jsxs)(_o.Col,{xs:20,md:20,lg:10,className:"px-0",children:[(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Input,{name:"input",onChange:e=>S(e,"proceedingNr"),placeholder:t.formatMessage({id:"placeholder.writing"}),value:o.proceedingNr}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.proceeding_nr"})}),(0,Eo.jsx)(_o.FieldWrapper,{labelCol:_,component:(0,Eo.jsx)(_o.Multiselect,{name:"multiselect",options:c,onSelect:e=>x(e,"institutions"),allSelection:!0,onRemoveItem:e=>x(e,"institutions"),value:o.institutions,selectedOptions:i}),label:(0,Eo.jsx)(wo.FormattedMessage,{id:"detailsearch.filter.label.institution"})})]})]}),(0,Eo.jsxs)(_o.Row,{children:[(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{onClick:()=>(a([]),void r(n)),colourScheme:"light",squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.epmty_fields"})})}),(0,Eo.jsx)(_o.Col,{children:(0,Eo.jsx)(_o.Button,{className:"float-right",colourScheme:"success",type:"submit",disabled:!!(g&&u.length>0),squared:!0,children:(0,Eo.jsx)(wo.FormattedMessage,{id:"button.search"})})})]})]})},fL={EHITIS_SEISUND_KAVAN:["EHITIS_SEISUND_KAVAN","EHITIS_SEISUND_EHITAM_LUBA","EHITIS_SEISUND_MENETLUSES"],EHITIS_SEISUND_PYSTI:["EHITIS_SEISUND_PYSTI","EHITIS_SEISUND_EHITAMISEL"],EHITIS_SEISUND_OLEMA:["EHITIS_SEISUND_OLEMA","EHITIS_SEISUND_KASUTUSEL","EHITIS_SEISUND_KASUT_OSALINE","EHITIS_SEISUND_KASUT_LUBA_EIKEH","EHITIS_SEISUND_LAMMUT_LUBA","EHITIS_SEISUND_KASUT_MAAS","EHITIS_SEISUND_EBASEADUSLIK","EHITIS_SEISUND_MAARAMATA"],EHITIS_SEISUND_LAMEL:["EHITIS_SEISUND_LAMEL","EHITIS_SEISUND_LAMMUTAMISEL"],EHITIS_SEISUND_LAMUT:["EHITIS_SEISUND_LAMUT","EHITIS_SEISUND_LAMMUTATUD"],EHITIS_SEISUND_REATA:["EHITIS_SEISUND_REATA","EHITIS_SEISUND_EHITAM_LUBA_EIKEH"],EHITIS_SEISUND_KUSTU:["EHITIS_SEISUND_KUSTU","EHITIS_SEISUND_KUSTUTATUD","EHITIS_SEISUND_REG_OBJ_LOPP","EHITIS_SEISUND_ARHIIVIS"]};function mL(e){const t=function(e){return lv(fL,e)}(e);return t?function(e){switch(e){case"EHITIS_SEISUND_KAVAN":return{name:"Kavandatav",type:"info"};case"EHITIS_SEISUND_PYSTI":return{name:"EHITIS_SEISUND_PYSTI",type:"info"};case"EHITIS_SEISUND_OLEMA":return{name:"On",type:"success"};case"EHITIS_SEISUND_LAMEL":return{name:"Lammutamisel",type:"info"};case"EHITIS_SEISUND_LAMUT":return{name:"Lammutatud",type:"default"};case"EHITIS_SEISUND_REATA":return{name:"Realiseerimata",type:"default"};case"EHITIS_SEISUND_KUSTU":return{name:"Kustutatud",type:"default"};default:return{name:e,type:"default"}}}(t):{name:e,type:"default"}}const gL=e=>{const t=(0,wo.useIntl)(),[n,o]=(0,yo.useState)([]),r=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.buildings));(0,yo.useEffect)((()=>{if(r&&r.length>0){const t=e.isAdminRole?r:r.filter((e=>"EHITIS_SEISUND_KUSTU"!==e.buildingState.code));o(t)}}),[r]);const i=[{id:"ehr_code",property:"ehrCode",size:130,isFrozen:!0,getValue:e=>e.ehrCode?e.ehrCode:"",getFormattedValue:t=>{const{generateLink:n}=e,o=t.ehrCode?n(rn,String(t.ehrCode),null,!1,!1,null):null;return t.ehrCode&&null!==t.ehrCode?(0,Eo.jsx)(Mo,{linkName:t.ehrCode,tooltipText:"detailsearch.tooltip.open_building",href:o||void 0}):""}},{id:"building_address",property:"buildingaddress",size:160,getValue:e=>{var t;return null!==(t=e.buildingaddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingaddress&&null!==e.buildingaddress?e.buildingaddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""}},{id:"building_state",property:"buildingState",size:130,getValue:e=>{var t;return null!==(t=e.buildingState)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingState&&null!==e.buildingState?(0,Eo.jsx)(_o.Status,{type:mL(e.buildingState.code).type,children:e.buildingState.value}):""},{id:"purpose_of_use",property:"purposeOfUse",size:150,getValue:e=>{var t,n;return null!==(t=null===(n=e.purposeOfUse)||void 0===n?void 0:n.value)&&void 0!==t?t:""}},{id:"first_use_date",property:"firstUseDate",size:150,getValue:e=>{var t;return null!==(t=e.firstUseDate)&&void 0!==t?t:""}},{id:"under_area",property:"underArea",size:130,getValue:e=>e.underArea?e.underArea:""},{id:"floor_count",property:"floorCount",size:130,getValue:e=>e.floorCount?e.floorCount:""},{id:"ownership_type",property:"ownershipType",size:130,getValue:e=>{var t,n;return null!==(t=null===(n=e.ownershipType)||void 0===n?void 0:n.value)&&void 0!==t?t:""}},{id:"heritage",property:"heritage",size:130,getValue:e=>{var t;return null!==(t=e.heritage)&&void 0!==t?t:""},getFormattedValue:e=>e.heritage&&null!==e.heritage?e.heritage.map((e=>(0,Eo.jsxs)("div",{children:[e.name," ",e.value]},e.value))):""},{id:"owner",property:"owner",size:130,getValue:e=>{var t;return null!==(t=e.owner)&&void 0!==t?t:""},getFormattedValue:e=>e.owner?e.owner.map((e=>function(e){var t;const n=e.eesnimi?e.eesnimi+" "+e.perenimi:void 0,o=e.isikukood?(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)("br",{}),"IK "+e.isikukood]}):void 0,r=null!==e.regKood,i=null!==(t=e.jiNimi)&&void 0!==t?t:"";return!0===r?(0,Eo.jsx)("div",{children:i}):n?(0,Eo.jsxs)("div",{children:[n,null!=o?o:""]}):""}(e))):""}];return(0,Eo.jsx)("div",{children:(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:(e.isAdminPlusRole?i:i.slice(0,-1)).map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:t.formatMessage({id:"detailsearch.buildings.table.header."+e.id}),tooltip:{text:t.formatMessage({id:"detailsearch.buildings.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){const t=e.map((e=>({buildingaddress:e.buildingaddress,buildingId:e.buildingId,buildingName:e.buildingName,buildingType:e.buildingType,ehrCode:e.ehrCode,firstUseDate:e.firstUseDate,owner:e.owner,heritage:e.heritage,ownershipType:e.ownershipType,purposeOfUse:e.purposeOfUse,buildingState:e.buildingState,floorCount:e.floorCount,underArea:e.underArea})));return t}(n),handleEvent:()=>!0})})};const hL=e=>{var t,n,o,r,i,a;const s=(0,wo.useIntl)(),[l,c]=(0,yo.useState)([]),d=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.documents)),u=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),p=null!==(t=null===(n=e.userInfo)||void 0===n||null===(o=n.activeRole)||void 0===o?void 0:o.businessType)&&void 0!==t?t:"",f=null!==(r=null===(i=e.userInfo)||void 0===i||null===(a=i.activeRole)||void 0===a?void 0:a.businessId)&&void 0!==r?r:0;(0,yo.useEffect)((()=>{d&&d.length>0&&c(d)}),[d]);const m=e.filterStateDocumentsSearch.buildingLocation,g=e.filterStateDocumentsSearch.buildingName;const h=m?m.toString().toLowerCase().replace(/[&|=;~!$>*%_()?.+:'"\\]/g,"").replace(/\t/g," ").replace(/\s{2,}/g," ").replace(/\s?-\s?/g,"-"):"";function b(e,t){const n=(o=function(e){return e.replace(/\btn\b/g,"").replace(/\btänav\b/g,"").replace(/\btee\b/g,"").replace(/\bmaantee\b/g,"").replace(/\bmnt\b/g,"").replace(/\bküla\b/g,"").replace(/\blinnaosa\b/g,"").replace(/\blinn\b/g,"").replace(/\bpuiestee\b/g,"").replace(/\bpst\b/g,"").replace(/\bvald\b/g,"").replace(/\balevik\b/g,"").replace(/\balev\b/g,"").replace(/\bpõik\b/g,"").replace(/\blõik\b/g,"")}(e),o.replaceAll("//","").replaceAll(",","").split(/\s+/g).reduce(((e,t)=>{if(Number.isNaN(Number(t[0]))&&Number.isNaN(Number(t[1])))e.push(t);else{const n=` ${t}`;e[e.length-1]+=n}return e}),[]));var o;const r=t.replace(/\s+/g," ").split(/\/\/\s+(?=[a-z]+\b)/gi);return n.every((e=>{const t=e.trim().split(/\s+/);return r.some((e=>t.every((t=>new RegExp(`(?<![\\/\\-])\\b${t}\\b`,"i").test(e)))))}))}const v=["tn","tänav","tee","maantee","mnt","küla","linnaosa","linn","puiestee","pst","vald","alevik","alev","põik","lõik"];function y(e,t){var n;const o=null===(n=t.buildingAddress)||void 0===n?void 0:n.map((t=>function(e,t){return v.some((n=>{const o=new RegExp(`\\b(\\w+)\\s+${n}\\b`,"i"),r=e.match(o);if(r){const e=r[1];return new RegExp(`\\b${e}\\s+${n}\\b`,"i").test(t)}return!1}))}(e,t.toLowerCase())));return!!o&&o.indexOf(!0)>-1}function x(e){const t=e.filter((e=>function(e,t){var n;const o=null===(n=t.buildingAddress)||void 0===n?void 0:n.map((t=>b(e,t.toLowerCase())));return!!o&&o.indexOf(!0)>-1}(h,e)));return v.some((e=>function(e){return!new RegExp(`\\b${e}\\b`,"gi").test(e)}(e)))?t.filter((e=>y(h,e))):t}function S(){return!Number.isNaN(Number(h))}function w(){if(h&&h.indexOf(", ")>-1){return h.split(", ").reverse().join(", ")}return h}function _(e){const t=e.buildingName,n=e.buildingAddress;return t&&n&&(n.some((e=>e.toLowerCase().split(" ").some((e=>t.some((t=>t.toLowerCase().includes(e)))))))||t.some((e=>e.toLowerCase().split(" ").some((e=>n.some((t=>t.toLowerCase().includes(e))))))))}function E(e){let t=0;if(e.buildingAddress&&e.buildingAddress.length>0&&e.buildingAddress[0].length<200){const n=h.replace(",","").split(" ");let o=e.buildingAddress[0].toLowerCase().split(", ");const r=new Set;o.forEach((e=>{const t=e.split(" ")[0];return r.add(t)})),o=Array.from(r),o.forEach((e=>(n.includes(e)&&(t+=1),t)))}else t=-1;return t}const T=new RegExp(`\\b${h}\\b(?![\\/\\-])`,"i"),I=new RegExp(`\\b${w()}\\b(?![\\/\\-])`,"i"),C=h.replace(",","").split(/(?:\/|\s)+/g);function M(e){const t=e.buildingAddress;return t?t.findIndex((e=>e.toLowerCase()===h||e.toLowerCase()===w()))>-1?"exact":t.findIndex((e=>T.test(e.toLowerCase())||I.test(e.toLowerCase())))>-1?"partial":t.findIndex((e=>{const t=e.toLowerCase().replace(",","").replace(/\/\//g," ");return C.every((e=>t.includes(e)))}))>-1?"vague":"other":""}const O=["exact","partial","vague","other"];function D(e){const t=e.map((e=>{return t=e,{...t,title:t.docId,addressWithBuilding:_(t),addressMatch:M(t),addressRank:E(t)};var t}));return t.sort(((e,t)=>{const n=O.indexOf(e.addressMatch),o=O.indexOf(t.addressMatch);return n!==o?n-o:e.addressWithBuilding!==t.addressWithBuilding?""===g?e.addressWithBuilding?1:-1:e.addressWithBuilding?-1:1:t.addressRank-e.addressRank}))}const k=[{id:"doc_date",property:"docDate",size:130,getValue:e=>rv.dateToStr(e.docDate),isFrozen:!0},{id:"reg_date",property:"regDate",size:130,getValue:e=>rv.dateToStr(e.regDate)},{id:"doc_nr",property:"docNr",size:160,getValue:e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=t.docNr?n(sn,String(t.docNr),null,!1,!1,{docId:t.docId,ehrCode:t.ehrCode}):null;return t.docNr&&null!==t.docNr?(0,Eo.jsx)(Mo,{linkName:t.docNr,tooltipText:"detailsearch.tooltip.open_document",href:o||void 0}):""}},{id:"document_type",property:"documentType",size:160,getValue:e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""}},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingName&&null!==e.buildingName?e.buildingName.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"ehr_code",property:"ehrCode",size:130,getValue:e=>{var t;return null!==(t=e.ehrCode)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e;return t.ehrCode?t.ehrCode.map(((e,o)=>{const r=t.ehrCode?n(rn,String(e),null,!1,!1,null):null;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"detailsearch.tooltip.open_building",href:r||void 0}),o!==t.ehrCode.length-1?(0,Eo.jsx)("span",{children:", "}):""]})})):""}},{id:"building_address",property:"buildingAddress",size:130,getValue:e=>{var t;return null!==(t=e.buildingAddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingAddress&&null!==e.buildingAddress?e.buildingAddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"doc_state",property:"stateCode",size:180,getValue:e=>{var t;return null!==(t=e.stateCode)&&void 0!==t?t:""},getFormattedValue:e=>e.stateCode&&null!==e.stateCode?(0,Eo.jsx)(_o.Status,{type:ZP(e.stateCode,s).oldType,children:ZP(e.stateCode,s).name}):""},{id:"proceeding_nr",property:"proceedingNr",size:130,getValue:e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},getFormattedValue:t=>{var n;const{generateLink:o}=e,r=bR(null===(n=t.doty)||void 0===n?void 0:n.toString()),i=t.proceedingNr?o(r,String(t.proceedingNr),null,!1,!1,null):null;return t.proceedingNr?p===ln.MKM||t.institutionId&&f===t.institutionId?(0,Eo.jsx)(Mo,{linkName:t.proceedingNr,tooltipText:"detailsearch.tooltip.open_proceeding",href:i||void 0}):t.proceedingNr:""}},{id:"presenter",property:"presenter",size:130,getValue:e=>{var t;return null!==(t=e.presenter)&&void 0!==t?t:""},getFormattedValue:e=>e.presenter?e.presenter.map(((t,n)=>(0,Eo.jsxs)("div",{children:[t,n!==e.presenter.length-1?(0,Eo.jsx)("span",{children:", "}):""]}))):""},{id:"institution",property:"institutionName",size:130,getValue:e=>{var t;return null!==(t=e.institutionName)&&void 0!==t?t:""}}];return(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:k.map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:s.formatMessage({id:"detailsearch.documents.table.header."+e.id}),tooltip:{text:s.formatMessage({id:"detailsearch.documents.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):null==e?void 0:e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){let t;if(0===(null==m?void 0:m.indexOf('"'))&&(null==m?void 0:m.lastIndexOf('"'))===m.length-1){const n=x(e);t=S()||h.length<2?n:D(n)}else t=S()||h.length<2?e:D(e);const n=t.map((e=>{var t,n,o,r;return{docId:e.docId,docDate:null!==(t=rv.dateToMs(nv,e.docDate))&&void 0!==t?t:"",regDate:null!==(n=rv.dateToMs(nv,e.regDate))&&void 0!==n?n:"",deadlineDate:e.deadlineDate,docNr:e.docNr,documentType:e.documentType,doty:e.doty,buildingName:e.buildingName,ehrCode:e.ehrCode,buildingAddress:e.buildingAddress,state:e.state,stateCode:e.stateCode,proceedingNr:e.proceedingNr,presenter:e.presenter,institutionId:e.institutionId,institutionName:null!==(o=null===(r=u.find((t=>t.id===e.institutionId)))||void 0===r?void 0:r.regName)&&void 0!==o?o:""}}));return n}(l),handleEvent:()=>!0})},bL=e=>{var t,n,o,r;const i=(0,wo.useIntl)(),[a,s]=(0,yo.useState)([]),l=(0,xl.useSelector)((e=>e.myViewsPage.detailSearch.proceedings)),c=(0,xl.useSelector)((e=>e.myViewsPage.filter.documentTypes)),d=(0,xl.useSelector)((e=>e.myViewsPage.filter.institutions)),u=e.userInfo&&e.userInfo.activeRole&&null!==(t=e.userInfo.activeRole)&&void 0!==t&&t.businessType?null===(n=e.userInfo.activeRole)||void 0===n?void 0:n.businessType:"",p=e.userInfo&&e.userInfo.activeRole&&null!==(o=e.userInfo.activeRole)&&void 0!==o&&o.businessId?null===(r=e.userInfo.activeRole)||void 0===r?void 0:r.businessId:0;(0,yo.useEffect)((()=>{l&&l.length>0&&s(l)}),[l]);const f=[{id:"date_start",property:"dateStart",size:130,getValue:e=>rv.dateToStr(e.dateStart),isFrozen:!0},{id:"date_end",property:"dateEnd",size:130,getValue:e=>rv.dateToStr(e.dateEnd)},{id:"proceeding_nr",property:"proceedingNr",size:130,getValue:e=>{var t;return null!==(t=e.proceedingNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=bR(t.doty),r=t.proceedingNr?n(o,String(t.proceedingNr),null,!1,!1,null):null;return t.proceedingNr&&null!==t.proceedingNr?"MKM"===u||t.institutionId&&p===t.institutionId?(0,Eo.jsx)(Mo,{linkName:t.proceedingNr,tooltipText:"detailsearch.tooltip.open_proceeding",href:r||void 0}):t.proceedingNr:""}},{id:"proceeding_state",property:"proceedingState",size:200,getValue:e=>{var t;return null!==(t=e.proceedingStateCode)&&void 0!==t?t:""},getFormattedValue:e=>e.proceedingStateCode&&null!==e.proceedingStateCode?(0,Eo.jsx)(_o.Status,{type:cv(e.proceedingStateCode,i).oldType,children:cv(e.proceedingStateCode,i).name}):""},{id:"document",property:"docNr",size:160,getValue:e=>{var t;return null!==(t=e.docNr)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e,o=t.docNr?n(sn,String(t.docNr),null,!1,!1,null):null;return t.docNr&&null!==t.docNr?(0,Eo.jsx)(Mo,{linkName:t.docNr,tooltipText:"detailsearch.tooltip.open_document",href:o||void 0}):""}},{id:"document_type",property:"documentType",size:180,getValue:e=>{var t;return null!==(t=e.documentType)&&void 0!==t?t:""}},{id:"building_name",property:"buildingName",size:130,getValue:e=>{var t;return null!==(t=e.buildingName)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingName&&null!==e.buildingName?e.buildingName.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"ehr_code",property:"ehrCode",size:130,getValue:e=>{var t;return null!==(t=e.ehrCode)&&void 0!==t?t:""},getFormattedValue:t=>{const{generateLink:n}=e;return t.ehrCode&&null!==t.ehrCode?t.ehrCode.map(((e,o)=>{const r=t.ehrCode?n(rn,String(e),null,!1,!1,null):null;return(0,Eo.jsxs)(Eo.Fragment,{children:[(0,Eo.jsx)(Mo,{linkName:e,tooltipText:"detailsearch.tooltip.open_building",href:r||void 0}),o!==t.ehrCode.length-1?(0,Eo.jsx)("span",{children:", "}):""]})})):""}},{id:"building_address",property:"buildingAddress",size:160,getValue:e=>{var t;return null!==(t=e.buildingAddress)&&void 0!==t?t:""},getFormattedValue:e=>e.buildingAddress&&null!==e.buildingAddress?e.buildingAddress.map((e=>(0,Eo.jsx)("div",{children:e}))):""},{id:"proceeding_name",property:"proceedingName",size:160,getValue:e=>{var t;return null!==(t=e.proceedingName)&&void 0!==t?t:""}},{id:"supervisor",property:"supervisorName",size:130,getValue:e=>{var t;return null!==(t=e.supervisorName)&&void 0!==t?t:""}},{id:"institution",property:"institutionName",size:130,getValue:e=>{var t;return null!==(t=e.institutionName)&&void 0!==t?t:""}},{id:"archived",property:"archived",size:130,getValue:e=>e.archived&&"2"===e.archived?"Jah":"Ei"}];return(0,Eo.jsx)(_o.TableComponent,{config:{thead:{headers:f.map((e=>({id:e.id,size:e.size,className:"table-header-field text-align-left",label:i.formatMessage({id:"detailsearch.proceedings.table.header."+e.id}),tooltip:{text:i.formatMessage({id:"detailsearch.proceedings.table.tooltip."+e.id})},propertyName:e.property,sortable:!0,isShown:!0,isFrozen:e.isFrozen,type:"input",valueFormatter:t=>e.getFormattedValue?e.getFormattedValue(t):e.getValue(t)}))),icons:Co,expandableRow:!1,isFilter:!1}},data:function(e){const t=e.map((e=>{var t,n,o,r,i,a;return{proceedingId:e.proceedingId,dateStart:null!==(t=rv.dateToMs(nv,e.dateStart))&&void 0!==t?t:"",dateEnd:null!==(n=rv.dateToMs(nv,e.dateEnd))&&void 0!==n?n:"",proceedingNr:e.proceedingNr,proceedingState:e.proceedingState,proceedingStateCode:e.proceedingStateCode,docNr:e.docNr,documentType:null!==(o=null===(r=c.find((t=>t.id.toString()===e.documentType)))||void 0===r?void 0:r.name)&&void 0!==o?o:"",doty:e.documentType,proceedingName:e.proceedingName,institutionId:e.institutionId,institutionName:null!==(i=null===(a=d.find((t=>t.id===e.institutionId)))||void 0===a?void 0:a.regName)&&void 0!==i?i:"",supervisorId:e.supervisorId,supervisorName:e.supervisorName,archived:e.archived,buildingName:e.buildingName,ehrCode:e.ehrCode,buildingAddress:e.buildingAddress}}));return t}(a),handleEvent:()=>!0})},vL="https://devkluster.ehr.ee/api/building/v2".replace(/\/+$/,"");class yL{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vL,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M();this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class xL extends Error{constructor(e,t){super(t),this.name="RequiredError",this.field=e}}const SL="https://example.com",wL=function(e,t,n){if(null==n)throw new xL(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},_L=function(e){const t=new URLSearchParams(e.search);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];for(const e of o)for(const n in e)if(Array.isArray(e[n])){t.delete(n);for(const o of e[n])t.append(n,o)}else t.set(n,e[n]);e.search=t.toString()},EL=function(e,t,n){const o="string"!=typeof e;return(o&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):o)?JSON.stringify(void 0!==e?e:{}):e||""},TL=function(e){return e.pathname+e.search+e.hash},IL=function(e,t,n,o){return function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;const a={...e.options,url:((null==o?void 0:o.basePath)||i)+e.url};return r.request(a)}},CL=function(e){const t=function(e){return{buildingChangesGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("buildingChangesGet","ehrCode",t),wL("buildingChangesGet","dokNr",n);const r=new URL("/buildingChanges",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.ehr_code=t),void 0!==n&&(s.dok_nr=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingCompareGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("buildingCompareGet","doEhitisId1",t),wL("buildingCompareGet","doEhitisId2",n);const r=new URL("/buildingCompare",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.do_ehitis_id1=t),void 0!==n&&(s.do_ehitis_id2=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingDataGet:async function(t,n,o,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const a=new URL("/buildingData",SL);let s;e&&(s=e.baseOptions);const l={method:"GET",...s,...i},c={};void 0!==t&&(c.ehr_code=t),void 0!==n&&(c.ehr_id=n),void 0!==o&&(c.version=o),void 0!==r&&(c.json=r),_L(a,c,i.query);let d=s&&s.headers?s.headers:{};return l.headers={...d,...i.headers},{url:TL(a),options:l}},buildingDeepCopyPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingDeepCopyPost","deepCopyPostRequest",t);const o=new URL("/buildingDeepCopy",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingOwnerSearchPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingOwnerSearchPost","bSearchOPostRequest",t);const o=new URL("/buildingOwnerSearch",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSearchPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingSearchPost","bSearchPostRequest",t);const o=new URL("/buildingSearch",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSecureDataArrayPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingSecureDataArrayPost","requestBody",t);const o=new URL("/buildingSecureDataArray",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},buildingSecureDataGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new URL("/buildingSecureData",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.ehr_code=t),void 0!==n&&(s.ehr_id=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},buildingVersionsGet:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingVersionsGet","ehrCode",t);const o=new URL("/buildingVersions",SL);let r;e&&(r=e.baseOptions);const i={method:"GET",...r,...n},a={};void 0!==t&&(a.ehr_code=t),_L(o,a,n.query);let s=r&&r.headers?r.headers:{};return i.headers={...s,...n.headers},{url:TL(o),options:i}},buildingsDataPost:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("buildingsDataPost","ehrCodesPostRequest",t);const o=new URL("/buildingsData",SL);let r;e&&(r=e.baseOptions);const i={method:"POST",...r,...n},a={"Content-Type":"application/json"};_L(o,{},n.query);let s=r&&r.headers?r.headers:{};return i.headers={...a,...s,...n.headers},i.data=EL(t,i,e),{url:TL(o),options:i}},findEhrcodesDateafterGet:async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wL("findEhrcodesDateafterGet","timestamp",t);const r=new URL("/find/ehrcodes/dateafter",SL);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...o},s={};void 0!==t&&(s.timestamp=t instanceof Date?t.toISOString():t),void 0!==n&&(s.offset=n),_L(r,s,o.query);let l=i&&i.headers?i.headers:{};return a.headers={...l,...o.headers},{url:TL(r),options:a}},findEhrcodesDocIdGet:async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wL("findEhrcodesDocIdGet","id",t);const o=new URL("/find/ehrcodes/docId",SL);let r;e&&(r=e.baseOptions);const i={method:"GET",...r,...n},a={};void 0!==t&&(a.id=t),_L(o,a,n.query);let s=r&&r.headers?r.headers:{};return i.headers={...s,...n.headers},{url:TL(o),options:i}}}}(e);return{async buildingChangesGet(n,o,r){const i=await t.buildingChangesGet(n,o,r);return IL(i,M(),vL,e)},async buildingCompareGet(n,o,r){const i=await t.buildingCompareGet(n,o,r);return IL(i,M(),vL,e)},async buildingDataGet(n,o,r,i,a){const s=await t.buildingDataGet(n,o,r,i,a);return IL(s,M(),vL,e)},async buildingDeepCopyPost(n,o){const r=await t.buildingDeepCopyPost(n,o);return IL(r,M(),vL,e)},async buildingOwnerSearchPost(n,o){const r=await t.buildingOwnerSearchPost(n,o);return IL(r,M(),vL,e)},async buildingSearchPost(n,o){const r=await t.buildingSearchPost(n,o);return IL(r,M(),vL,e)},async buildingSecureDataArrayPost(n,o){const r=await t.buildingSecureDataArrayPost(n,o);return IL(r,M(),vL,e)},async buildingSecureDataGet(n,o,r){const i=await t.buildingSecureDataGet(n,o,r);return IL(i,M(),vL,e)},async buildingVersionsGet(n,o){const r=await t.buildingVersionsGet(n,o);return IL(r,M(),vL,e)},async buildingsDataPost(n,o){const r=await t.buildingsDataPost(n,o);return IL(r,M(),vL,e)},async findEhrcodesDateafterGet(n,o,r){const i=await t.findEhrcodesDateafterGet(n,o,r);return IL(i,M(),vL,e)},async findEhrcodesDocIdGet(n,o){const r=await t.findEhrcodesDocIdGet(n,o);return IL(r,M(),vL,e)}}};class ML extends yL{buildingChangesGet(e,t,n){return CL(this.configuration).buildingChangesGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingCompareGet(e,t,n){return CL(this.configuration).buildingCompareGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingDataGet(e,t,n,o,r){return CL(this.configuration).buildingDataGet(e,t,n,o,r).then((e=>e(this.axios,this.basePath)))}buildingDeepCopyPost(e,t){return CL(this.configuration).buildingDeepCopyPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingOwnerSearchPost(e,t){return CL(this.configuration).buildingOwnerSearchPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSearchPost(e,t){return CL(this.configuration).buildingSearchPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSecureDataArrayPost(e,t){return CL(this.configuration).buildingSecureDataArrayPost(e,t).then((e=>e(this.axios,this.basePath)))}buildingSecureDataGet(e,t,n){return CL(this.configuration).buildingSecureDataGet(e,t,n).then((e=>e(this.axios,this.basePath)))}buildingVersionsGet(e,t){return CL(this.configuration).buildingVersionsGet(e,t).then((e=>e(this.axios,this.basePath)))}buildingsDataPost(e,t){return CL(this.configuration).buildingsDataPost(e,t).then((e=>e(this.axios,this.basePath)))}findEhrcodesDateafterGet(e,t,n){return CL(this.configuration).findEhrcodesDateafterGet(e,t,n).then((e=>e(this.axios,this.basePath)))}findEhrcodesDocIdGet(e,t){return CL(this.configuration).findEhrcodesDocIdGet(e,t).then((e=>e(this.axios,this.basePath)))}}const OL=e=>{var t,n,o,r;let{buildingsActualDataApiEndpoint:i,classifierApiEndpoint:a,documentApiEndpoint:s,linkGen:l,generateLink:c,myViewsApiEndpoint:d,searchType:u,userApiEndpoint:p,userInfo:f}=e;const g=(0,xl.useDispatch)(),y=["MKM","KOV","TJA"].includes(f&&f.activeRole&&null!==(t=f.activeRole)&&void 0!==t&&t.businessType?null===(n=f.activeRole)||void 0===n?void 0:n.businessType:""),x=["MKM","KOV","TJA","N","KT"].includes(f&&f.activeRole&&null!==(o=f.activeRole)&&void 0!==o&&o.businessType?null===(r=f.activeRole)||void 0===r?void 0:r.businessType:""),S=!f,[w,_]=(0,yo.useState)({}),[E,T]=(0,yo.useState)({}),[I,C]=(0,yo.useState)({}),[M,O]=(0,yo.useState)([]),[D,k]=(0,yo.useState)([]),[j,A]=(0,yo.useState)([]),[P,N]=(0,yo.useState)(!1),[R,L]=(0,yo.useState)(!1),[U,V]=(0,yo.useState)(!1),$=new F(new _e({basePath:a})),B=new Fe(new _e({basePath:s})),K=new X(new re({basePath:p})),z=new ve(new _e({basePath:d})),H=new te(new re({basePath:p})),Y=new ML(new _e({basePath:i})),G=async(e,t,n)=>{try{const o=await H.searchPerson(e,t,n);return o.data}catch(e){console.log("= = = callSearchPerson error occured:",e)}};return(0,yo.useEffect)((()=>{$.getAllDocumentTypes().then((e=>{g(m(e.data))})).catch((e=>{console.log(e)})),K.getJurKovPersons().then((e=>{g(h(e.data))})).catch((e=>{console.log(e)})),$.getUsageClassifierTypes().then((e=>{g(b(e.data))})).catch((e=>{console.log(e)})),B.getClassifierByType("EHITIS_MALESTIS").then((e=>{g(v(e.data))})).catch((e=>{console.log(e)}))}),[]),(0,yo.useEffect)((()=>{if(Object.keys(I).length>0){V(!0);z.searchDetailProceedings(I).then((e=>{g(At(e.data)),A(e.data),V(!1)})).catch((e=>{console.log(e),V(!1)}))}}),[I]),(0,yo.useEffect)((()=>{if(Object.keys(E).length>0){L(!0);z.searchDetailDocuments(E).then((e=>{var t,n;g(jt(null!==(t=e.data.content)&&void 0!==t?t:[])),k(null!==(n=e.data.content)&&void 0!==n?n:[]),L(!1)})).catch((e=>{console.log(e),L(!1)}))}}),[E]),(0,yo.useEffect)((()=>{if(Object.keys(w).length>0){let e;N(!0),e=x?Y.buildingOwnerSearchPost(w):Y.buildingSearchPost(w),e.then((e=>{g(kt(e.data)),O(e.data),N(!1)})).catch((e=>{console.log(e),N(!1)}))}}),[w,x]),(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)(_o.Section,{collapsed:u!==Qt,title:"detailsearch.buildings_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(dL,{onSubmit:e=>{_(e)},isAdminRole:y,isAdminPlusRole:x,callSearchPerson:G})}),Object.keys(w).length>0&&0===M.length&&!P?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):P?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(gL,{linkGen:l,generateLink:c,isAdminRole:y,isAdminPlusRole:x})]})}),(0,Eo.jsx)(_o.Section,{collapsed:"DOCUMENTS_SEARCH"!==u,title:"detailsearch.documents_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(uL,{onSubmit:e=>{T(e)},callSearchPerson:G,isNonAuthenticatedUser:S})}),Object.keys(E).length>0&&0===D.length&&!R?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):R?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(hL,{linkGen:l,generateLink:c,userInfo:f,filterStateDocumentsSearch:E})]})}),y&&(0,Eo.jsx)(_o.Section,{collapsed:"PROCEEDINGS_SEARCH"!==u,title:"detailsearch.proceedings_detail_search",children:(0,Eo.jsxs)("div",{children:[(0,Eo.jsx)("div",{className:"filter-block",style:{paddingBottom:20},children:(0,Eo.jsx)(pL,{onSubmit:e=>{C(e)}})}),Object.keys(I).length>0&&0===j.length&&!U?(0,Eo.jsx)("div",{style:{height:210},className:"d-flex justify-content-center align-items-center",children:(0,Eo.jsx)(_o.Text,{raw:"detailsearch.empty_search_result"})}):U?(0,Eo.jsx)(_o.SectionLoader,{}):(0,Eo.jsx)(bL,{linkGen:l,userInfo:f,generateLink:c})]})})]})}})(),module.exports=s})();