react-luminus-components 2.0.3-beta.r19-15 → 2.0.3-beta.r19-16
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/.vite/manifest.json +42 -36
- package/dist/FormDisabledProvider-DXNc2136.js +51 -0
- package/dist/FormDisabledProvider-vg-vA0WK.cjs +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +535 -288
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +194 -125
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +277 -131
- package/dist/{localStorageUtils-B7BmbR_u.js → localStorageUtils-CZ4HDRzi.js} +17 -7
- package/dist/main.cjs.js +13 -13
- package/dist/main.es.js +10407 -5547
- package/dist/nivo-bar-BZDK_ha3.js +41897 -0
- package/dist/nivo-bar-D02kyst9.cjs +326 -0
- package/dist/useEmployeePhotoPath-TFR1dZzz.cjs +1 -0
- package/dist/useEmployeePhotoPath-_slBRHnm.js +111 -0
- package/dist/useLocalStorageState-B0hJPCtQ.cjs +1 -0
- package/dist/useLocalStorageState-DcSLbUf2.js +96 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +41 -69
- package/package.json +2 -1
- package/dist/FormDisabledProvider-B62seaHO.cjs +0 -1
- package/dist/FormDisabledProvider-qklvful2.js +0 -40
- package/dist/nivo-bar-C5h-CRYO.cjs +0 -306
- package/dist/nivo-bar-FuUHRilH.js +0 -40076
- package/dist/useEmployeePhotoPath-DdMmh1qU.js +0 -65
- package/dist/useEmployeePhotoPath-Q0EhpWOh.cjs +0 -1
- package/dist/useLocalStorageState-BWVTT0cO.js +0 -80
- package/dist/useLocalStorageState-iaJubQoG.cjs +0 -1
package/dist/main.cjs.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar-C5h-CRYO.cjs"),t=require("react/jsx-runtime"),c=require("react"),ve=require("./FormDisabledProvider-B62seaHO.cjs"),Aa=require("@azure/msal-browser"),Ra=require("@azure/msal-react");require("@tanstack/react-query");const Z=require("react-router"),St=require("react-dom"),oe=require("react-hook-form"),Pa=require("react-flexmonster"),ye=require("./localStorageUtils-CkZslzIU.cjs"),de=require("./useLocalStorageState-iaJubQoG.cjs"),Le=require("./useEmployeePhotoPath-Q0EhpWOh.cjs");function Ba(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const ue=Ba(c),$a=({fileLoader:e,fileName:n,children:a})=>{const r=c.useCallback(async()=>{var d,u;const o=await e();if(!o)return;const l=window.URL.createObjectURL(new Blob([o])),i=document.createElement("a");i.href=l,i.setAttribute("download",n),(d=document.body)==null||d.appendChild(i),i.click(),(u=document.body)==null||u.removeChild(i)},[e,n]);return t.jsx("div",{role:"button",onClick:r,children:a})},bs=({className:e,size:n,...a})=>t.jsxs("div",{className:s.classNames("luminus-loading",ve.classes.loading,ve.classes.loadingBlock,n==="line"?ve.classes.sizeLine:void 0,n==="fill"?ve.classes.sizeFill:void 0,e),...a,children:[t.jsx("div",{className:s.classNames("spinner-grow",ve.classes.spinnerGrow,"text-primary"),role:"status"}),t.jsx("div",{className:s.classNames("spinner-grow",ve.classes.spinnerGrow,"text-primary",ve.classes.second),role:"status"}),t.jsx("div",{className:s.classNames("spinner-grow",ve.classes.spinnerGrow,"text-primary",ve.classes.third),role:"status"})]});function za(e,n){const a=s.toDate(e);return isNaN(n)?s.constructFrom(e,NaN):(n&&a.setDate(a.getDate()+n),a)}function Ha(e,n){const a=s.toDate(e),r=s.toDate(n),o=a.getTime()-r.getTime();return o<0?-1:o>0?1:o}function jn(e,n){const a=s.toDate(e),r=s.toDate(n),o=a.getFullYear()-r.getFullYear(),l=a.getMonth()-r.getMonth();return o*12+l}function bn(e){const n=s.toDate(e);return Math.trunc(n.getMonth()/3)+1}function Et(e,n){const a=s.toDate(e),r=s.toDate(n),o=a.getFullYear()-r.getFullYear(),l=bn(a)-bn(r);return o*4+l}function Cn(e,n,a){const r=s.startOfWeek(e,a),o=s.startOfWeek(n,a),l=+r-s.getTimezoneOffsetInMilliseconds(r),i=+o-s.getTimezoneOffsetInMilliseconds(o);return Math.round((l-i)/s.millisecondsInWeek)}function Mt(e,n){const a=s.toDate(e),r=s.toDate(n);return a.getFullYear()-r.getFullYear()}function Va(e,n){const a=s.toDate(e),r=s.toDate(n),o=Nn(a,r),l=Math.abs(s.differenceInCalendarDays(a,r));a.setDate(a.getDate()-o*l);const i=+(Nn(a,r)===-o),d=o*(l-i);return d===0?0:d}function Nn(e,n){const a=e.getFullYear()-n.getFullYear()||e.getMonth()-n.getMonth()||e.getDate()-n.getDate()||e.getHours()-n.getHours()||e.getMinutes()-n.getMinutes()||e.getSeconds()-n.getSeconds()||e.getMilliseconds()-n.getMilliseconds();return a<0?-1:a>0?1:a}function nn(e){return n=>{const r=(e?Math[e]:Math.trunc)(n);return r===0?0:r}}function sn(e,n){return+s.toDate(e)-+s.toDate(n)}function wn(e,n,a){const r=sn(e,n)/s.millisecondsInHour;return nn(a==null?void 0:a.roundingMethod)(r)}function Sn(e,n,a){const r=sn(e,n)/s.millisecondsInMinute;return nn(a==null?void 0:a.roundingMethod)(r)}function Ft(e,n,a){const r=sn(e,n)/1e3;return nn(a==null?void 0:a.roundingMethod)(r)}function qe(e,n){const a=s.toDate(e);if(isNaN(a.getTime()))throw new RangeError("Invalid time value");const r=(n==null?void 0:n.format)??"extended",o=(n==null?void 0:n.representation)??"complete";let l="",i="";const d=r==="extended"?"-":"",u=r==="extended"?":":"";if(o!=="time"){const m=s.addLeadingZeros(a.getDate(),2),p=s.addLeadingZeros(a.getMonth()+1,2);l=`${s.addLeadingZeros(a.getFullYear(),4)}${d}${p}${d}${m}`}if(o!=="date"){const m=a.getTimezoneOffset();if(m!==0){const b=Math.abs(m),v=s.addLeadingZeros(Math.trunc(b/60),2),j=s.addLeadingZeros(b%60,2);i=`${m<0?"+":"-"}${v}:${j}`}else i="Z";const p=s.addLeadingZeros(a.getHours(),2),f=s.addLeadingZeros(a.getMinutes(),2),x=s.addLeadingZeros(a.getSeconds(),2),h=l===""?"":"T",g=[p,f,x].join(u);l=`${l}${h}${g}${i}`}return l}function Ua(e){const n=s.toDate(e),a=n.getFullYear(),r=n.getMonth(),o=s.constructFrom(e,0);return o.setFullYear(a,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Wa(e,n,a){let r=0,o;const l=s.toDate(e),i=s.toDate(n);if(a!=null&&a.unit)o=a==null?void 0:a.unit,o==="second"?r=Ft(l,i):o==="minute"?r=Sn(l,i):o==="hour"?r=wn(l,i):o==="day"?r=s.differenceInCalendarDays(l,i):o==="week"?r=Cn(l,i):o==="month"?r=jn(l,i):o==="quarter"?r=Et(l,i):o==="year"&&(r=Mt(l,i));else{const u=Ft(l,i);Math.abs(u)<s.secondsInMinute?(r=Ft(l,i),o="second"):Math.abs(u)<s.secondsInHour?(r=Sn(l,i),o="minute"):Math.abs(u)<s.secondsInDay&&Math.abs(s.differenceInCalendarDays(l,i))<1?(r=wn(l,i),o="hour"):Math.abs(u)<s.secondsInWeek&&(r=s.differenceInCalendarDays(l,i))&&Math.abs(r)<7?o="day":Math.abs(u)<s.secondsInMonth?(r=Cn(l,i),o="week"):Math.abs(u)<s.secondsInQuarter?(r=jn(l,i),o="month"):Math.abs(u)<s.secondsInYear&&Et(l,i)<4?(r=Et(l,i),o="quarter"):(r=Mt(l,i),o="year")}return new Intl.RelativeTimeFormat(a==null?void 0:a.locale,{localeMatcher:a==null?void 0:a.localeMatcher,numeric:(a==null?void 0:a.numeric)||"auto",style:a==null?void 0:a.style}).format(r,o)}function Ga(e,n){const a=s.toDate(e),r=a.getFullYear(),o=a.getDate(),l=s.constructFrom(e,0);l.setFullYear(r,n,15),l.setHours(0,0,0,0);const i=Ua(l);return a.setMonth(n,Math.min(o,i)),a}function Yt(e,n){const a=s.toDate(e);return isNaN(+a)?s.constructFrom(e,NaN):(a.setFullYear(n),a)}function at(...e){return e.filter(n=>n!=null).reduce((n,a)=>{if(typeof a!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return n===null?a:function(...o){n.apply(this,o),a.apply(this,o)}},null)}const Ya={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function qa(e,n){const a=`offset${e[0].toUpperCase()}${e.slice(1)}`,r=n[a],o=Ya[e];return r+parseInt(s.style(n,o[0]),10)+parseInt(s.style(n,o[1]),10)}const Ka={[s.EXITED]:"collapse",[s.EXITING]:"collapsing",[s.ENTERING]:"collapsing",[s.ENTERED]:"collapse show"},an=c.forwardRef(({onEnter:e,onEntering:n,onEntered:a,onExit:r,onExiting:o,className:l,children:i,dimension:d="height",in:u=!1,timeout:m=300,mountOnEnter:p=!1,unmountOnExit:f=!1,appear:x=!1,getDimensionValue:h=qa,...g},b)=>{const v=typeof d=="function"?d():d,j=c.useMemo(()=>at(k=>{k.style[v]="0"},e),[v,e]),N=c.useMemo(()=>at(k=>{const w=`scroll${v[0].toUpperCase()}${v.slice(1)}`;k.style[v]=`${k[w]}px`},n),[v,n]),S=c.useMemo(()=>at(k=>{k.style[v]=null},a),[v,a]),C=c.useMemo(()=>at(k=>{k.style[v]=`${h(v,k)}px`,s.triggerBrowserReflow(k)},r),[r,h,v]),y=c.useMemo(()=>at(k=>{k.style[v]=null},o),[v,o]);return t.jsx(s.TransitionWrapper,{ref:b,addEndListener:s.transitionEndListener,...g,"aria-expanded":g.role?u:null,onEnter:j,onEntering:N,onEntered:S,onExit:C,onExiting:y,childRef:s.getChildRef(i),in:u,timeout:m,mountOnEnter:p,unmountOnExit:f,appear:x,children:(k,w)=>c.cloneElement(i,{...w,className:s.classNames(l,i.props.className,Ka[k],v==="width"&&"collapse-horizontal")})})});an.displayName="Collapse";const rn=ue.forwardRef(({className:e,bsPrefix:n,as:a="div",...r},o)=>(n=s.useBootstrapPrefix(n,"card-body"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));rn.displayName="CardBody";const Cs=ue.forwardRef(({className:e,bsPrefix:n,as:a="div",...r},o)=>(n=s.useBootstrapPrefix(n,"card-footer"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));Cs.displayName="CardFooter";const Ns=ue.createContext(null);Ns.displayName="CardHeaderContext";const ws=ue.forwardRef(({bsPrefix:e,className:n,as:a="div",...r},o)=>{const l=s.useBootstrapPrefix(e,"card-header"),i=c.useMemo(()=>({cardHeaderBsPrefix:l}),[l]);return t.jsx(Ns.Provider,{value:i,children:t.jsx(a,{ref:o,...r,className:s.classNames(n,l)})})});ws.displayName="CardHeader";const Ss=ue.forwardRef(({bsPrefix:e,className:n,variant:a,as:r="img",...o},l)=>{const i=s.useBootstrapPrefix(e,"card-img");return t.jsx(r,{ref:l,className:s.classNames(a?`${i}-${a}`:i,n),...o})});Ss.displayName="CardImg";const Is=ue.forwardRef(({className:e,bsPrefix:n,as:a="div",...r},o)=>(n=s.useBootstrapPrefix(n,"card-img-overlay"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));Is.displayName="CardImgOverlay";const ks=ue.forwardRef(({className:e,bsPrefix:n,as:a="a",...r},o)=>(n=s.useBootstrapPrefix(n,"card-link"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));ks.displayName="CardLink";const Qa=s.divWithClassName("h6"),Ds=ue.forwardRef(({className:e,bsPrefix:n,as:a=Qa,...r},o)=>(n=s.useBootstrapPrefix(n,"card-subtitle"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));Ds.displayName="CardSubtitle";const Ts=ue.forwardRef(({className:e,bsPrefix:n,as:a="p",...r},o)=>(n=s.useBootstrapPrefix(n,"card-text"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));Ts.displayName="CardText";const Za=s.divWithClassName("h5"),_s=ue.forwardRef(({className:e,bsPrefix:n,as:a=Za,...r},o)=>(n=s.useBootstrapPrefix(n,"card-title"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));_s.displayName="CardTitle";const Ls=ue.forwardRef(({bsPrefix:e,className:n,bg:a,text:r,border:o,body:l=!1,children:i,as:d="div",...u},m)=>{const p=s.useBootstrapPrefix(e,"card");return t.jsx(d,{ref:m,...u,className:s.classNames(n,p,a&&`bg-${a}`,r&&`text-${r}`,o&&`border-${o}`),children:l?t.jsx(rn,{children:i}):i})});Ls.displayName="Card";const In=Object.assign(Ls,{Img:Ss,Title:_s,Subtitle:Ds,Body:rn,Link:ks,Text:Ts,Header:ws,Footer:Cs,ImgOverlay:Is}),kt=ue.forwardRef(({className:e,bsPrefix:n,as:a="span",...r},o)=>(n=s.useBootstrapPrefix(n,"input-group-text"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));kt.displayName="InputGroupText";const Xa=e=>t.jsx(kt,{children:t.jsx(s.FormCheckInput,{type:"checkbox",...e})}),Ja=e=>t.jsx(kt,{children:t.jsx(s.FormCheckInput,{type:"radio",...e})}),Es=ue.forwardRef(({bsPrefix:e,size:n,hasValidation:a,className:r,as:o="div",...l},i)=>{e=s.useBootstrapPrefix(e,"input-group");const d=c.useMemo(()=>({}),[]);return t.jsx(s.context.Provider,{value:d,children:t.jsx(o,{ref:i,...l,className:s.classNames(r,e,n&&`${e}-${n}`,a&&"has-validation")})})});Es.displayName="InputGroup";const Nt=Object.assign(Es,{Text:kt,Radio:Ja,Checkbox:Xa}),qt=new WeakMap,kn=(e,n)=>{if(!e||!n)return;const a=qt.get(n)||new Map;qt.set(n,a);let r=a.get(e);return r||(r=n.matchMedia(e),r.refCount=0,a.set(r.media,r)),r};function er(e,n=typeof window>"u"?void 0:window){const a=kn(e,n),[r,o]=c.useState(()=>a?a.matches:!1);return s.useIsomorphicEffect(()=>{let l=kn(e,n);if(!l)return o(!1);let i=qt.get(n);const d=()=>{o(l.matches)};return l.refCount++,l.addListener(d),d(),()=>{l.removeListener(d),l.refCount--,l.refCount<=0&&(i==null||i.delete(l.media)),l=void 0}},[e]),r}function tr(e){const n=Object.keys(e);function a(d,u){return d===u?u:d?`${d} and ${u}`:u}function r(d){return n[Math.min(n.indexOf(d)+1,n.length-1)]}function o(d){const u=r(d);let m=e[u];return typeof m=="number"?m=`${m-.2}px`:m=`calc(${m} - 0.2px)`,`(max-width: ${m})`}function l(d){let u=e[d];return typeof u=="number"&&(u=`${u}px`),`(min-width: ${u})`}function i(d,u,m){let p;typeof d=="object"?(p=d,m=u,u=!0):(u=u||!0,p={[d]:u});let f=c.useMemo(()=>Object.entries(p).reduce((x,[h,g])=>((g==="up"||g===!0)&&(x=a(x,l(h))),(g==="down"||g===!0)&&(x=a(x,o(h))),x),""),[JSON.stringify(p)]);return er(f,m)}return i}const nr=tr({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),Ms=ue.forwardRef(({className:e,bsPrefix:n,as:a="div",...r},o)=>(n=s.useBootstrapPrefix(n,"offcanvas-body"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));Ms.displayName="OffcanvasBody";const sr={[s.ENTERING]:"show",[s.ENTERED]:"show"},Fs=ue.forwardRef(({bsPrefix:e,className:n,children:a,in:r=!1,mountOnEnter:o=!1,unmountOnExit:l=!1,appear:i=!1,...d},u)=>(e=s.useBootstrapPrefix(e,"offcanvas"),t.jsx(s.TransitionWrapper,{ref:u,addEndListener:s.transitionEndListener,in:r,mountOnEnter:o,unmountOnExit:l,appear:i,...d,childRef:s.getChildRef(a),children:(m,p)=>ue.cloneElement(a,{...p,className:s.classNames(n,a.props.className,(m===s.ENTERING||m===s.EXITING)&&`${e}-toggling`,sr[m])})})));Fs.displayName="OffcanvasToggling";const Os=ue.forwardRef(({bsPrefix:e,className:n,closeLabel:a="Close",closeButton:r=!1,...o},l)=>(e=s.useBootstrapPrefix(e,"offcanvas-header"),t.jsx(s.AbstractModalHeader,{ref:l,...o,className:s.classNames(n,e),closeLabel:a,closeButton:r})));Os.displayName="OffcanvasHeader";const ar=s.divWithClassName("h5"),As=ue.forwardRef(({className:e,bsPrefix:n,as:a=ar,...r},o)=>(n=s.useBootstrapPrefix(n,"offcanvas-title"),t.jsx(a,{ref:o,className:s.classNames(e,n),...r})));As.displayName="OffcanvasTitle";function rr(e){return t.jsx(Fs,{...e})}function or(e){return t.jsx(s.Fade,{...e})}const Rs=ue.forwardRef(({bsPrefix:e,className:n,children:a,"aria-labelledby":r,placement:o="start",responsive:l,show:i=!1,backdrop:d=!0,keyboard:u=!0,scroll:m=!1,onEscapeKeyDown:p,onShow:f,onHide:x,container:h,autoFocus:g=!0,enforceFocus:b=!0,restoreFocus:v=!0,restoreFocusOptions:j,onEntered:N,onExit:S,onExiting:C,onEnter:y,onEntering:k,onExited:w,backdropClassName:I,manager:E,renderStaticNode:D=!1,...M},F)=>{const _=c.useRef();e=s.useBootstrapPrefix(e,"offcanvas");const[L,W]=c.useState(!1),A=s.useEventCallback(x),O=nr(l||"xs","up");c.useEffect(()=>{W(l?i&&!O:i)},[i,l,O]);const z=c.useMemo(()=>({onHide:A}),[A]);function B(){return E||(m?(_.current||(_.current=new s.BootstrapModalManager({handleContainerOverflow:!1})),_.current):s.getSharedManager())}const T=(K,...pe)=>{K&&(K.style.visibility="visible"),y==null||y(K,...pe)},R=(K,...pe)=>{K&&(K.style.visibility=""),w==null||w(...pe)},U=c.useCallback(K=>t.jsx("div",{...K,className:s.classNames(`${e}-backdrop`,I)}),[I,e]),q=K=>t.jsx("div",{...K,...M,className:s.classNames(n,l?`${e}-${l}`:e,`${e}-${o}`),"aria-labelledby":r,children:a});return t.jsxs(t.Fragment,{children:[!L&&(l||D)&&q({}),t.jsx(s.ModalContext.Provider,{value:z,children:t.jsx(s.BaseModal,{show:L,ref:F,backdrop:d,container:h,keyboard:u,autoFocus:g,enforceFocus:b&&!m,restoreFocus:v,restoreFocusOptions:j,onEscapeKeyDown:p,onShow:f,onHide:A,onEnter:T,onEntering:k,onEntered:N,onExit:S,onExiting:C,onExited:R,manager:B(),transition:rr,backdropTransition:or,renderBackdrop:U,renderDialog:q})})]})});Rs.displayName="Offcanvas";const Dn=Object.assign(Rs,{Body:Ms,Header:Os,Title:As});function Ps({animation:e,bg:n,bsPrefix:a,size:r,...o}){a=s.useBootstrapPrefix(a,"placeholder");const[{className:l,...i}]=s.useCol(o);return{...i,className:s.classNames(l,e?`${a}-${e}`:a,r&&`${a}-${r}`,n&&`bg-${n}`)}}const Bs=ue.forwardRef((e,n)=>{const a=Ps(e);return t.jsx(s.Button,{...a,ref:n,disabled:!0,tabIndex:-1})});Bs.displayName="PlaceholderButton";const $s=ue.forwardRef(({as:e="span",...n},a)=>{const r=Ps(n);return t.jsx(e,{...r,ref:a})});$s.displayName="Placeholder";const Fe=Object.assign($s,{Button:Bs}),on=ue.forwardRef(({bsPrefix:e,className:n,as:a="div",...r},o)=>{const l=s.useBootstrapPrefix(e,"row"),i=s.useBootstrapBreakpoints(),d=s.useBootstrapMinBreakpoint(),u=`${l}-cols`,m=[];return i.forEach(p=>{const f=r[p];delete r[p];let x;f!=null&&typeof f=="object"?{cols:x}=f:x=f;const h=p!==d?`-${p}`:"";x!=null&&m.push(`${u}${h}-${x}`)}),t.jsx(a,{ref:o,...r,className:s.classNames(n,l,...m)})});on.displayName="Row";const zs=ue.forwardRef(({bsPrefix:e,className:n,striped:a,bordered:r,borderless:o,hover:l,size:i,variant:d,responsive:u,...m},p)=>{const f=s.useBootstrapPrefix(e,"table"),x=s.classNames(n,f,d&&`${f}-${d}`,i&&`${f}-${i}`,a&&`${f}-${typeof a=="string"?`striped-${a}`:"striped"}`,r&&`${f}-bordered`,o&&`${f}-borderless`,l&&`${f}-hover`),h=t.jsx("table",{...m,className:x,ref:p});if(u){let g=`${f}-responsive`;return typeof u=="string"&&(g=`${g}-${u}`),t.jsx("div",{className:g,children:h})}return h});zs.displayName="Table";const Hs=({children:e,onStorno:n,noSpacer:a,disabled:r})=>{const{texts:{formSubmit:o}}=c.useContext(s.LuminusComponentsContext);return t.jsxs(_a,{noSpacer:a,children:[t.jsxs(s.PrimaryButton,{as:"button",color:"primary",size:"lg",type:"submit",disabled:r,children:[t.jsx(s.MdCheck,{}),e]}),n&&t.jsxs(s.PrimaryButton,{as:"button",color:"secondary",variant:"outlined",size:"lg",onClick:n,children:[t.jsx(s.MdOutlineClose,{}),o.storno]})]})},ln=({ref:e,color:n="primary",icon:a=t.jsx(s.MdOutlineFileUpload,{size:12}),inputId:r="context-file-input",accept:o="*",onUpload:l,className:i,children:d,multiple:u,...m})=>{const p=f=>{f.target.files&&(l(f.target.files),f.target.value="")};return t.jsxs(t.Fragment,{children:[t.jsxs("label",{ref:e,htmlFor:r,className:s.classNames(`luminus-context-button btn text-${n} ${i??""}`,s.classes.button),...m,children:[a,d]}),t.jsx("input",{id:r,type:"file",accept:o,onChange:p,hidden:!0,multiple:u})]})},ir=({onUpload:e,accept:n,children:a,className:r,size:o="md"})=>{const l=c.useCallback(async d=>{if(d.target.files)try{await e(d.target.files)}finally{d.target.value=""}},[e]),i=c.useId();return t.jsxs(t.Fragment,{children:[t.jsx("label",{htmlFor:i,className:s.classNames("btn luminus-context-button text-primary",`btn-${o}`,r),children:a}),t.jsx("input",{id:i,type:"file",accept:n,onChange:l,hidden:!0})]})},lr="_select_14f33_1",cr="_sm_14f33_11",dr="_lg_14f33_23",xt={select:lr,sm:cr,lg:dr},Vs=({month:e,onChangeMonth:n,locale:a,yearMin:r=2e3,yearMax:o=2050,className:l,monthClassName:i,yearClassName:d,size:u})=>{const m=c.useCallback(x=>{const h=ve.addMonths(e,x);h.getFullYear()<r||h.getFullYear()>o||n(h)},[e,n,r,o]),p=c.useMemo(()=>{const x=[];for(let h=r;h<=o;h++)x.push(h);return x},[r,o]),f=c.useMemo(()=>{const g=[];for(let b=0;b<=11;b++)g.push({id:b,name:s.format(new Date(2024,b,1),"LLLL",{locale:a})});return g},[a]);return t.jsxs("div",{className:s.classNames("card d-flex flex-row align-items-center justify-content-center m-0 p-1 gap-2",l,{[xt[u]]:u}),children:[t.jsx(s.IconButton,{onClick:()=>m(-1),disabled:e.getFullYear()<r||e.getFullYear()===r&&e.getMonth()<=0,children:t.jsx(s.MdOutlineKeyboardArrowLeft,{})}),t.jsx(s.Form.Select,{value:e.getMonth(),onChange:x=>{var h;return((h=x.target)==null?void 0:h.value)&&n(Ga(e,Number(x.target.value)))},className:s.classNames(xt.select,xt.month,i),children:f.map(x=>t.jsx("option",{value:x.id,children:x.name},x.id))}),t.jsx(s.Form.Select,{value:e.getFullYear(),onChange:x=>{var h;return((h=x.target)==null?void 0:h.value)&&n(Yt(e,Number(x.target.value)))},className:s.classNames(xt.select,d),children:p.map(x=>t.jsx("option",{value:x,children:x},x))}),t.jsx(s.IconButton,{onClick:()=>m(1),disabled:e.getFullYear()>o||e.getFullYear()===o&&e.getMonth()>=11,children:t.jsx(s.MdOutlineKeyboardArrowRight,{})})]})},ur="_select_pywmr_1",mr={select:ur},Tn=2e3,_n=2050,Us=({year:e,onChangeYear:n,className:a,variant:r="standart",...o})=>{const l=c.useMemo(()=>{var m;return o.manualOptions?((m=o.options)==null?void 0:m.at(0))??Tn:o.optionMin??Tn},[o]),i=c.useMemo(()=>{var m;return o.manualOptions?((m=o.options)==null?void 0:m.at(-1))??_n:o.optionMax??_n},[o]),d=c.useMemo(()=>{if(o.manualOptions)return o.options;const m=[];for(let p=l;p<=i;p++)m.push(p);return m},[o,i,l]),u=c.useCallback(m=>{if(o.manualOptions){const p=d.findIndex(f=>f===e.getFullYear());if(p!==-1){const f=d.at(p+m)??null;f&&n(Yt(e,f))}}else{const p=e.getFullYear()+m;p>=l&&p<=i&&n(ve.addYears(e,m))}},[e,n,i,l,o,d]);return t.jsxs("div",{className:s.classNames("d-flex flex-row align-items-center m-0",r==="standart"?"card p-1 gap-2":void 0,r==="minimalist"?"p-0 gap-0":void 0,a??""),children:[t.jsx(s.IconButton,{onClick:()=>u(-1),disabled:e.getFullYear()<=l,children:t.jsx(s.MdOutlineKeyboardArrowLeft,{})}),t.jsx(s.Form.Select,{value:e.getFullYear(),onChange:m=>{var p;return((p=m.target)==null?void 0:p.value)&&n(Yt(e,Number(m.target.value)))},className:s.classNames(mr.select,"bg-transparent"),children:d.map(m=>t.jsx("option",{value:m,children:m},m))}),t.jsx(s.IconButton,{onClick:()=>u(1),disabled:e.getFullYear()>=i,children:t.jsx(s.MdOutlineKeyboardArrowRight,{})})]})},pr="_avatar-icon_1axl6_1",fr={avatarIcon:pr},Dt=({name:e,fontSize:n,size:a})=>{const r=c.useMemo(()=>{const i=e.split(" ");return i.length<2?e:s.joinStrings(" ",i.at(i.length-2),i.at(i.length-1))},[e]),o=c.useMemo(()=>{const i=r.split(" ");return s.joinStrings("",...i.map(d=>d.at(0)??void 0))},[r]),l=i=>{let d=0,u;for(u=0;u<i.length;u+=1)d=i.charCodeAt(u)+((d<<5)-d);let m="#";for(u=0;u<3;u+=1){const p=d>>u*8&255;m+=`00${p.toString(16)}`.slice(-2)}return m};return t.jsx(s.OverlayTrigger,{placement:"bottom",overlay:t.jsx(s.Tooltip,{children:e}),children:t.jsx("div",{className:s.classNames("luminus-avatar-icon",fr.avatarIcon),style:{backgroundColor:l(r),fontSize:n??void 0,minHeight:a??void 0,height:a??void 0,maxHeight:a??void 0,minWidth:a??void 0,width:a??void 0,maxWidth:a??void 0},children:t.jsx("div",{children:o})})})},Ln={"eon-red":"#ea1b0a","eon-turquoise":"#1999aa"},hr={plain:{fgColor:"black",eyeColor:"black",logoImage:void 0,ecLevel:"M"},blackRedEyes:{fgColor:"black"},squareEyesPointingOut:{eyeRadius:[{inner:[0,2,2,2],outer:[0,10,10,10]},{inner:[2,0,2,2],outer:[10,0,10,10]},{inner:[2,2,2,0],outer:[10,10,10,0]}],qrStyle:"squares"},squareEyesRoundedIn:{eyeRadius:[{inner:[0,0,2,0],outer:[0,0,10,0]},{inner:[0,0,0,2],outer:[0,0,0,10]},{inner:[0,2,0,0],outer:[0,10,0,0]}],qrStyle:"squares"},squareTopCornersRounded:{eyeRadius:[{inner:[3,0,0,0],outer:[100,0,0,0]},{inner:[0,3,0,0],outer:[0,100,0,0]},{inner:[0,0,0,0],outer:[0,0,0,0]}],qrStyle:"squares"},fluidRoundedTopLeftEye:{eyeRadius:[{inner:[3,0,0,0],outer:[100,1,1,1]},{inner:0,outer:1},{inner:0,outer:1}],qrStyle:"fluid"},fluidRoundedEyes:{eyeRadius:{inner:1,outer:8},qrStyle:"fluid"},circleEyes:{eyeRadius:{inner:100,outer:100},qrStyle:"dots"}},gr=hr,xr=({value:e,qrRef:n,variant:a="blackRedEyes"})=>t.jsx(s.QRCode_1,{ref:n,value:e,eyeColor:Ln["eon-red"],fgColor:Ln["eon-turquoise"],logoHeight:32,logoWidth:32,removeQrCodeBehindLogo:!0,logoPadding:5,logoPaddingStyle:"circle",ecLevel:"Q",...gr[a]}),Ws=({value:e,contactType:n,className:a})=>{const{ProjectIconComponent:r}=c.useContext(s.LuminusComponentsContext),[o,l]=c.useState(!1),i=c.useCallback(()=>{l(!0)},[]),d=c.useCallback(()=>{l(!1)},[]),u=c.useMemo(()=>{switch(n){case"email":return"mailto";case"phone":return"tel";default:throw new Error("Incorrect type for ContactsLink")}},[n]);return t.jsxs(t.Fragment,{children:[t.jsx(s.IconButton,{onClick:i,disabled:e===null,className:a,children:t.jsx(r,{icon:"qr-code"})}),t.jsx(s.Modal,{show:o,onHide:d,size:"sm",children:t.jsxs(s.Modal.Body,{className:"d-flex flex-column align-items-center",children:[t.jsx(xr,{value:`${u}:${e}`}),t.jsx(s.Typography,{variant:"subtitle",children:e})]})})]})},Gs=({contactType:e,value:n,className:a,children:r,showIconWithChildren:o})=>{const{ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),i=c.useMemo(()=>{switch(e){case"email":return"mailto";case"phone":return"tel";default:throw new Error("Incorrect type for ContactsLink")}},[e]),d=c.useMemo(()=>{switch(e){case"email":return"mail";case"phone":return"phone";default:throw new Error("Incorrect type for ContactsLink")}},[e]);return t.jsx("div",{className:a,children:n===null?t.jsxs(t.Fragment,{children:[r,(!r||o)&&t.jsx(s.IconButton,{disabled:!0,children:t.jsx(l,{icon:d})})]}):t.jsxs(Z.Link,{to:`${i}:${n}`,className:"w-100",children:[r,(!r||o)&&t.jsx(s.IconButton,{children:t.jsx(l,{icon:d})})]})})},Ze=({InputContainer:e=s.FloatingLabelInput,label:n,value:a,onChange:r,hidden:o,disabled:l,className:i,type:d,withoutLabel:u,indeterminate:m,hint:p})=>{const f=c.useRef(null);return c.useEffect(()=>{f.current&&(f.current.indeterminate=m??!1)},[f,m]),t.jsx(e,{isForCheckInput:!0,hidden:o,label:n??"",withoutLabel:u,className:i,hint:p,disabled:l,children:t.jsx(s.Form.Check,{ref:f,id:`check-${n}`,type:d??"checkbox",label:n??"",checked:a,onChange:x=>{var h;r&&r(((h=x.target)==null?void 0:h.checked)??!1)},className:i??"",hidden:o??!1,disabled:l??!1})})},vr="_popoverContainer_j6114_1",yr="_textInput_j6114_5",jr="_btnsPopover_j6114_9",br="_popoverHandle_j6114_20",Cr="_btnsPopoverHideable_j6114_27",rt={popoverContainer:vr,textInput:yr,btnsPopover:jr,popoverHandle:br,btnsPopoverHideable:Cr},Ys=({children:e,className:n,withoutLabel:a,label:r,contactType:o,value:l})=>{const{ProjectIconComponent:i}=c.useContext(s.LuminusComponentsContext);return t.jsxs("div",{className:s.classNames("d-flex align-items-center",n),children:[!a&&t.jsx("div",{className:s.classNames("d-flex justify-content-between align-items-center w-50"),children:t.jsx(s.Typography,{variant:"form-label",className:"text-muted",children:r})}),t.jsxs("div",{className:s.classNames("w-50",rt.popoverContainer),children:[t.jsx("div",{className:rt.textInput,children:e}),t.jsxs("div",{className:s.classNames("d-flex gap-1",rt.btnsPopover),children:[t.jsxs("div",{className:s.classNames(rt.btnsPopoverHideable,"p-1"),children:[t.jsx(Ws,{contactType:o,value:l}),t.jsx(Gs,{contactType:o,value:l})]}),t.jsx("div",{role:"button",tabIndex:0,className:rt.popoverHandle,children:t.jsx(i,{icon:"chevron-left"})})]})]})]})},Nr=({value:e,label:n,InputContainer:a=s.FloatingLabelInput,className:r,withoutLabel:o,hidden:l,disabled:i,contactType:d,...u})=>l?null:t.jsx(Ys,{contactType:d,value:e,withoutLabel:o,label:n,className:r,children:t.jsx(s.TextInput,{type:"text",value:e,disabled:i,InputContainer:a,size:"sm",withoutLabel:!0,...u})}),wr=({InputContainer:e=s.FloatingLabelInput,items:n,selectedItemNavigateTo:a,onSearchQueryChange:r,texts:o,isLoading:l,value:i,onSelect:d,label:u,withoutLabel:m,size:p,dropdownItemsNameWidth:f,additionalColumns:x,hidden:h,disabled:g,displayIdAsName:b,CustomOnChangeComponent:v,className:j,archiveColumn:N,icon:S,hint:C,addNewOptionPath:y,refreshOptions:k,MiniDetailComponent:w,miniDetailPlacement:I,suggestedItems:E,suggestedItemsTitle:D,customEllipsisOptions:M})=>{const[F,_]=c.useState(!1),L=c.useCallback(T=>{d&&d(T)},[d]),W=c.useCallback(T=>{_(!1),L(T)},[L]),A=c.useRef(null),O=a!==void 0,z=O&&i!==null,B=c.useMemo(()=>{var T,R;return b?((T=i==null?void 0:i.id)==null?void 0:T.toString())??"":i!=null&&i.name&&i.name.length>0?i.name:((R=i==null?void 0:i.id)==null?void 0:R.toString())??""},[i,b]);return t.jsx(t.Fragment,{children:t.jsxs(e,{withoutLabel:m,label:u??"",hidden:h,inputContainerClassName:s.classNames({"luminus-dropdown-select-open":F}),className:j,hint:C,disabled:g,children:[t.jsxs(s.InputAnchorContainer,{currentSelection:i,selectedItemNavigateTo:a,children:[b&&(i==null?void 0:i.name)&&t.jsx(s.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:i.name}),t.jsx(s.MiniDetailWrapper,{value:(i==null?void 0:i.id)??null,MiniDetailComponent:w,miniDetailPlacement:I,children:t.jsxs(s.Form.Select,{ref:A,size:p,value:(i==null?void 0:i.id)??"",onMouseDown:T=>{T.currentTarget.focus(),T.preventDefault()},onClick:()=>{!O&&!g&&_(!0)},onChange:()=>{},className:s.classNames("w-100",{"luminus-dropdown-picker-disabled":g,"luminus-dropdown-picker-link":z}),hidden:h,children:[t.jsx("option",{value:""}),i&&t.jsx("option",{value:i.id??void 0,children:B})]})}),v||!g&&O?t.jsxs("div",{className:"custom-picker-button",children:[!v&&!g&&O&&t.jsx(s.IconButton,{size:"sm",color:"secondary",onClick:T=>{T.preventDefault(),T.stopPropagation(),_(!0)},children:S??t.jsx(s.MdOutlineEdit,{})}),v??null]}):null]}),A.current&&t.jsx(s.SimplePicker,{show:F,onCancel:()=>_(!1),items:n,currentSelection:i,onSelectionChange:W,onSearchQueryChange:r,texts:o,itemsNameWidth:f,additionalColumns:x,isLoading:l,disabled:g,inputRef:A,archiveColumn:N,displayIdAsName:b,addNewOptionPath:y,refreshOptions:k,suggestedItems:E,suggestedItemsTitle:D,customEllipsisOptions:M})]})})},Sr=({InputContainer:e=s.FloatingLabelInput,value:n,onChange:a,label:r,size:o,showClearIcon:l,clearValue:i,hidden:d,disabled:u,rows:m,withoutLabel:p,debounceMs:f,minLength:x,maxLength:h,className:g,hint:b})=>{const v=c.useCallback(()=>{if(!a)return;const k=i??null;a((k==null?void 0:k.toString())??"")},[i,a]),j=c.useRef(null),[N,S]=c.useState((n==null?void 0:n.toString())??""),C=c.useCallback(k=>{const w=k;a&&a(w||null)},[a]),y=c.useCallback(k=>{var I;const w=(I=k.target)==null?void 0:I.value;if(!f){C(w);return}S(w),j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{C(w)},f)},[f,C]);return c.useEffect(()=>{S(n===null?"":n.toString())},[n]),t.jsxs(e,{label:r??"",hidden:d,withoutLabel:p,className:g,isForTextAreaInput:!0,hint:b,disabled:u,children:[t.jsx(s.Form.Control,{as:"textarea",size:o,value:f?N:n??"",onChange:y,hidden:d,disabled:u,rows:m??2,className:"w-100",minLength:x,maxLength:h}),l&&n&&a&&!u&&t.jsx("div",{className:"luminus-input-remove-icon",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:v,children:t.jsx(s.MdClear,{})})})]})},Ir=({InputContainer:e=s.FloatingLabelInput,value:n,onChange:a,debounceMs:r,label:o,withoutLabel:l,placeholder:i,size:d,hidden:u,disabled:m,showClearIcon:p,clearValue:f,className:x,step:h,stepperStep:g=1,min:b,max:v,hint:j})=>{const N=c.useCallback(()=>{if(!a)return;const I=f??null;a(I?Number(I):null)},[f,a]),S=c.useRef(null),[C,y]=c.useState((n==null?void 0:n.toString())??""),k=c.useCallback(I=>{const E=I;a&&a(E==null||E===""?null:ye.limitNumber(Number(E),b,v))},[v,b,a]),w=c.useCallback(I=>{var D;const E=(D=I.target)==null?void 0:D.value;if(!r){k(E);return}y(ye.limitNumber(Number(E),b,v).toString()),S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{k(E)},r)},[r,k,v,b]);return c.useEffect(()=>{y(n===null?"":ye.limitNumber(n,b,v).toString())},[v,b,n]),t.jsx(e,{withoutLabel:l,label:o??"",hidden:u,hint:j,className:x,disabled:m,children:t.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsx(s.Form.Control,{type:"number",placeholder:i??o,size:d,value:r?C:n??"",onChange:w,className:`luminus-numeric-stepper ${x??""}`,hidden:u,disabled:m??!1,step:h}),t.jsx("div",{className:"stepper-icon left",children:!m&&t.jsx(s.IconButton,{size:"sm",onClick:I=>{I.preventDefault(),I.stopPropagation(),k(((n??0)-g).toString())},children:t.jsx(s.FaMinus,{})})}),t.jsx("div",{className:"stepper-icon right",children:!m&&t.jsx(s.IconButton,{size:"sm",onClick:I=>{I.preventDefault(),I.stopPropagation(),k(((n??0)+g).toString())},children:t.jsx(s.FaPlus,{})})}),p&&n&&a&&!m&&t.jsx("div",{className:"luminus-input-remove-icon",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:N,children:t.jsx(s.MdClear,{})})})]})})};function qs(e,n){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a}var ct;(function(e){e.event="event",e.props="prop"})(ct||(ct={}));function Ae(){}function kr(e){var n,a=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return n&&r.length===n.length&&r.every(function(l,i){return l===n[i]})||(n=r,a=e.apply(void 0,r)),a}}function dt(e){return!!(e||"").match(/\d/)}function Ke(e){return e==null}function Dr(e){return typeof e=="number"&&isNaN(e)}function Ks(e){return Ke(e)||Dr(e)||typeof e=="number"&&!isFinite(e)}function Qs(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Tr(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function _r(e,n,a){var r=Tr(a),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+n)}function Lr(e){var n=c.useRef(e);n.current=e;var a=c.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return n.current.apply(n,r)});return a.current}function cn(e,n){n===void 0&&(n=!0);var a=e[0]==="-",r=a&&n;e=e.replace("-","");var o=e.split("."),l=o[0],i=o[1]||"";return{beforeDecimal:l,afterDecimal:i,hasNegation:a,addNegation:r}}function Er(e){if(!e)return e;var n=e[0]==="-";n&&(e=e.substring(1,e.length));var a=e.split("."),r=a[0].replace(/^0+/,"")||"0",o=a[1]||"";return(n?"-":"")+r+(o?"."+o:"")}function Zs(e,n,a){for(var r="",o=a?"0":"",l=0;l<=n-1;l++)r+=e[l]||o;return r}function En(e,n){return Array(n+1).join(e)}function Xs(e){var n=e+"",a=n[0]==="-"?"-":"";a&&(n=n.substring(1));var r=n.split(/[eE]/g),o=r[0],l=r[1];if(l=Number(l),!l)return a+o;o=o.replace(".","");var i=1+l,d=o.length;return i<0?o="0."+En("0",Math.abs(i))+o:i>=d?o=o+En("0",i-d):o=(o.substring(0,i)||"0")+"."+o.substring(i),a+o}function Mn(e,n,a){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||a)&&n,o=cn(e),l=o.beforeDecimal,i=o.afterDecimal,d=o.hasNegation,u=parseFloat("0."+(i||"0")),m=i.length<=n?"0."+i:u.toFixed(n),p=m.split("."),f=l;l&&Number(p[0])&&(f=l.split("").reverse().reduce(function(b,v,j){return b.length>j?(Number(b[0])+Number(v)).toString()+b.substring(1,b.length):v+b},p[0]));var x=Zs(p[1]||"",n,a),h=d?"-":"",g=r?".":"";return""+h+f+g+x}function Ve(e,n){if(e.value=e.value,e!==null){if(e.createTextRange){var a=e.createTextRange();return a.move("character",n),a.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(n,n),!0):(e.focus(),!1)}}var Js=kr(function(e,n){for(var a=0,r=0,o=e.length,l=n.length;e[a]===n[a]&&a<o;)a++;for(;e[o-1-r]===n[l-1-r]&&l-r>a&&o-r>a;)r++;return{from:{start:a,end:o-r},to:{start:a,end:l-r}}}),Mr=function(e,n){var a=Math.min(e.selectionStart,n);return{from:{start:a,end:e.selectionEnd},to:{start:a,end:n}}};function Fr(e,n,a){return Math.min(Math.max(e,n),a)}function Ot(e){return Math.max(e.selectionStart,e.selectionEnd)}function Or(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ar(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function Rr(e){var n=e.currentValue,a=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return n[r]===a[o]}function Pr(e,n,a,r,o,l,i){i===void 0&&(i=Rr);var d=o.findIndex(function(C){return C}),u=e.slice(0,d);!n&&!a.startsWith(u)&&(n=u,a=u+a,r=r+u.length);for(var m=a.length,p=e.length,f={},x=new Array(m),h=0;h<m;h++){x[h]=-1;for(var g=0,b=p;g<b;g++){var v=i({currentValue:a,lastValue:n,formattedValue:e,currentValueIndex:h,formattedValueIndex:g});if(v&&f[g]!==!0){x[h]=g,f[g]=!0;break}}}for(var j=r;j<m&&(x[j]===-1||!l(a[j]));)j++;var N=j===m||x[j]===-1?p:x[j];for(j=r-1;j>0&&x[j]===-1;)j--;var S=j===-1||x[j]===-1?0:x[j]+1;return S>N?N:r-S<N-r?S:N}function Fn(e,n,a,r){var o=e.length;if(n=Fr(n,0,o),r==="left"){for(;n>=0&&!a[n];)n--;n===-1&&(n=a.indexOf(!0))}else{for(;n<=o&&!a[n];)n++;n>o&&(n=a.lastIndexOf(!0))}return n===-1&&(n=o),n}function Br(e){for(var n=Array.from({length:e.length+1}).map(function(){return!0}),a=0,r=n.length;a<r;a++)n[a]=!!(dt(e[a])||dt(e[a-1]));return n}function ea(e,n,a,r,o,l){l===void 0&&(l=Ae);var i=Lr(function(g,b){var v,j;return Ks(g)?(j="",v=""):typeof g=="number"||b?(j=typeof g=="number"?Xs(g):g,v=r(j)):(j=o(g,void 0),v=r(j)),{formattedValue:v,numAsString:j}}),d=c.useState(function(){return i(Ke(e)?n:e,a)}),u=d[0],m=d[1],p=function(g,b){g.formattedValue!==u.formattedValue&&m({formattedValue:g.formattedValue,numAsString:g.value}),l(g,b)},f=e,x=a;Ke(e)&&(f=u.numAsString,x=!0);var h=i(f,x);return c.useMemo(function(){m(h)},[h.formattedValue]),[u,p]}function $r(e){return e.replace(/[^0-9]/g,"")}function zr(e){return e}function Hr(e){var n=e.type;n===void 0&&(n="text");var a=e.displayType;a===void 0&&(a="input");var r=e.customInput,o=e.renderText,l=e.getInputRef,i=e.format;i===void 0&&(i=zr);var d=e.removeFormatting;d===void 0&&(d=$r);var u=e.defaultValue,m=e.valueIsNumericString,p=e.onValueChange,f=e.isAllowed,x=e.onChange;x===void 0&&(x=Ae);var h=e.onKeyDown;h===void 0&&(h=Ae);var g=e.onMouseUp;g===void 0&&(g=Ae);var b=e.onFocus;b===void 0&&(b=Ae);var v=e.onBlur;v===void 0&&(v=Ae);var j=e.value,N=e.getCaretBoundary;N===void 0&&(N=Br);var S=e.isValidInputCharacter;S===void 0&&(S=dt);var C=e.isCharacterSame,y=qs(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=ea(j,u,!!m,i,d,p),w=k[0],I=w.formattedValue,E=w.numAsString,D=k[1],M=c.useRef(),F=c.useRef({formattedValue:I,numAsString:E}),_=function(H,V){F.current={formattedValue:H.formattedValue,numAsString:H.value},D(H,V)},L=c.useState(!1),W=L[0],A=L[1],O=c.useRef(null),z=c.useRef({setCaretTimeout:null,focusTimeout:null});c.useEffect(function(){return A(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var B=i,T=function(H,V){var $=parseFloat(V);return{formattedValue:H,value:V,floatValue:isNaN($)?void 0:$}},R=function(H,V,$){H.selectionStart===0&&H.selectionEnd===H.value.length||(Ve(H,V),z.current.setCaretTimeout=setTimeout(function(){H.value===$&&H.selectionStart!==V&&Ve(H,V)},0))},U=function(H,V,$){return Fn(H,V,N(H),$)},q=function(H,V,$){var Q=N(V),ce=Pr(V,I,H,$,Q,S,C);return ce=Fn(V,ce,Q),ce},K=function(H){var V=H.formattedValue;V===void 0&&(V="");var $=H.input,Q=H.source,ce=H.event,ae=H.numAsString,J;if($){var Ce=H.inputValue||$.value,we=Ot($);$.value=V,J=q(Ce,V,we),J!==void 0&&R($,J,V)}V!==I&&_(T(V,ae),{event:ce,source:Q})};c.useEffect(function(){var H=F.current,V=H.formattedValue,$=H.numAsString;(I!==V||E!==$)&&_(T(I,E),{event:void 0,source:ct.props})},[I,E]);var pe=O.current?Ot(O.current):void 0,P=typeof window<"u"?c.useLayoutEffect:c.useEffect;P(function(){var H=O.current;if(I!==F.current.formattedValue&&H){var V=q(F.current.formattedValue,I,pe);H.value=I,R(H,V,I)}},[I]);var X=function(H,V,$){var Q=V.target,ce=M.current?Mr(M.current,Q.selectionEnd):Js(I,H),ae=Object.assign(Object.assign({},ce),{lastValue:I}),J=d(H,ae),Ce=B(J);if(J=d(Ce,void 0),f&&!f(T(Ce,J))){var we=V.target,Se=Ot(we),Ue=q(H,I,Se);return we.value=I,R(we,Ue,I),!1}return K({formattedValue:Ce,numAsString:J,inputValue:H,event:V,source:$,input:V.target}),!0},ie=function(H,V){V===void 0&&(V=0);var $=H.selectionStart,Q=H.selectionEnd;M.current={selectionStart:$,selectionEnd:Q+V}},he=function(H){var V=H.target,$=V.value,Q=X($,H,ct.event);Q&&x(H),M.current=void 0},ne=function(H){var V=H.target,$=H.key,Q=V.selectionStart,ce=V.selectionEnd,ae=V.value;ae===void 0&&(ae="");var J;$==="ArrowLeft"||$==="Backspace"?J=Math.max(Q-1,0):$==="ArrowRight"?J=Math.min(Q+1,ae.length):$==="Delete"&&(J=Q);var Ce=0;$==="Delete"&&Q===ce&&(Ce=1);var we=$==="ArrowLeft"||$==="ArrowRight";if(J===void 0||Q!==ce&&!we){h(H),ie(V,Ce);return}var Se=J;if(we){var Ue=$==="ArrowLeft"?"left":"right";Se=U(ae,J,Ue),Se!==J&&H.preventDefault()}else $==="Delete"&&!S(ae[J])?Se=U(ae,J,"right"):$==="Backspace"&&!S(ae[J])&&(Se=U(ae,J,"left"));Se!==J&&R(V,Se,ae),h(H),ie(V,Ce)},be=function(H){var V=H.target,$=function(){var Q=V.selectionStart,ce=V.selectionEnd,ae=V.value;if(ae===void 0&&(ae=""),Q===ce){var J=U(ae,Q);J!==Q&&R(V,J,ae)}};$(),requestAnimationFrame(function(){$()}),g(H),ie(V)},G=function(H){H.persist&&H.persist();var V=H.target,$=H.currentTarget;O.current=V,z.current.focusTimeout=setTimeout(function(){var Q=V.selectionStart,ce=V.selectionEnd,ae=V.value;ae===void 0&&(ae="");var J=U(ae,Q);J!==Q&&!(Q===0&&ce===ae.length)&&R(V,J,ae),b(Object.assign(Object.assign({},H),{currentTarget:$}))},0)},se=function(H){O.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),v(H)},je=W&&Or()?"numeric":void 0,Ee=Object.assign({inputMode:je},y,{type:n,value:I,onChange:he,onKeyDown:ne,onMouseUp:be,onFocus:G,onBlur:se});if(a==="text")return o?c.createElement(c.Fragment,null,o(I,y)||null):c.createElement("span",Object.assign({},y,{ref:l}),I);if(r){var Te=r;return c.createElement(Te,Object.assign({},Ee,{ref:l}))}return c.createElement("input",Object.assign({},Ee,{ref:l}))}function On(e,n){var a=n.decimalScale,r=n.fixedDecimalScale,o=n.prefix;o===void 0&&(o="");var l=n.suffix;l===void 0&&(l="");var i=n.allowNegative,d=n.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var u=Tt(n),m=u.thousandSeparator,p=u.decimalSeparator,f=a!==0&&e.indexOf(".")!==-1||a&&r,x=cn(e,i),h=x.beforeDecimal,g=x.afterDecimal,b=x.addNegation;return a!==void 0&&(g=Zs(g,a,!!r)),m&&(h=_r(h,m,d)),o&&(h=o+h),l&&(g=g+l),b&&(h="-"+h),e=h+(f&&p||"")+g,e}function Tt(e){var n=e.decimalSeparator;n===void 0&&(n=".");var a=e.thousandSeparator,r=e.allowedDecimalSeparators;return a===!0&&(a=","),r||(r=[n,"."]),{decimalSeparator:n,thousandSeparator:a,allowedDecimalSeparators:r}}function Vr(e,n){e===void 0&&(e="");var a=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=a.test(e),l=r.test(e);return e=e.replace(/-/g,""),o&&!l&&n&&(e="-"+e),e}function Ur(e,n){return new RegExp("(^-)|[0-9]|"+Qs(e),"g")}function Wr(e,n,a){return e===""?!0:!(n!=null&&n.match(/\d/))&&!(a!=null&&a.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Gr(e,n,a){var r;n===void 0&&(n=Ar(e));var o=a.allowNegative,l=a.prefix;l===void 0&&(l="");var i=a.suffix;i===void 0&&(i="");var d=a.decimalScale,u=n.from,m=n.to,p=m.start,f=m.end,x=Tt(a),h=x.allowedDecimalSeparators,g=x.decimalSeparator,b=e[f]===g;if(dt(e)&&(e===l||e===i)&&n.lastValue==="")return e;if(f-p===1&&h.indexOf(e[p])!==-1){var v=d===0?"":g;e=e.substring(0,p)+v+e.substring(p+1,e.length)}var j=function(O,z,B){var T=!1,R=!1;l.startsWith("-")?T=!1:O.startsWith("--")?(T=!1,R=!0):i.startsWith("-")&&O.length===i.length?T=!1:O[0]==="-"&&(T=!0);var U=T?1:0;return R&&(U=2),U&&(O=O.substring(U),z-=U,B-=U),{value:O,start:z,end:B,hasNegation:T}},N=j(e,p,f),S=N.hasNegation;r=N,e=r.value,p=r.start,f=r.end;var C=j(n.lastValue,u.start,u.end),y=C.start,k=C.end,w=C.value,I=e.substring(p,f);e.length&&w.length&&(y>w.length-i.length||k<l.length)&&!(I&&i.startsWith(I))&&(e=w);var E=0;e.startsWith(l)?E+=l.length:p<l.length&&(E=p),e=e.substring(E),f-=E;var D=e.length,M=e.length-i.length;e.endsWith(i)?D=M:(f>M||f>e.length-i.length)&&(D=f),e=e.substring(0,D),e=Vr(S?"-"+e:e,o),e=(e.match(Ur(g))||[]).join("");var F=e.indexOf(g);e=e.replace(new RegExp(Qs(g),"g"),function(O,z){return z===F?".":""});var _=cn(e,o),L=_.beforeDecimal,W=_.afterDecimal,A=_.addNegation;return m.end-m.start<u.end-u.start&&L===""&&b&&!parseFloat(W)&&(e=A?"-":""),e}function Yr(e,n){var a=n.prefix;a===void 0&&(a="");var r=n.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),l=e[0]==="-";o.fill(!1,0,a.length+(l?1:0));var i=e.length;return o.fill(!1,i-r.length+1,i+1),o}function qr(e){var n=Tt(e),a=n.thousandSeparator,r=n.decimalSeparator,o=e.prefix;o===void 0&&(o="");var l=e.allowNegative;if(l===void 0&&(l=!0),a===r)throw new Error(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./nivo-bar-D02kyst9.cjs"),s=require("react/jsx-runtime"),Ge=require("./FormDisabledProvider-vg-vA0WK.cjs"),N=require("react"),rl=require("@azure/msal-browser"),il=require("@azure/msal-react");require("@tanstack/react-query");const Ne=require("react-router"),Qt=require("react-dom"),Ie=require("react-hook-form"),cl=require("react-flexmonster"),Ke=require("./localStorageUtils-CkZslzIU.cjs"),Ae=require("./useLocalStorageState-B0hJPCtQ.cjs"),dt=require("./useEmployeePhotoPath-TFR1dZzz.cjs");function dl(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Me=dl(N),ul=n=>{const e=l.compilerRuntimeExports.c(6),{fileLoader:t,fileName:o,children:a}=n;let r;e[0]!==t||e[1]!==o?(r=async()=>{var f,p;const u=await t();if(!u)return;const m=window.URL.createObjectURL(new Blob([u])),d=document.createElement("a");d.href=m,d.setAttribute("download",o),(f=document.body)==null||f.appendChild(d),d.click(),(p=document.body)==null||p.removeChild(d)},e[0]=t,e[1]=o,e[2]=r):r=e[2];const i=r;let c;return e[3]!==a||e[4]!==i?(c=s.jsx("div",{role:"button",onClick:i,children:a}),e[3]=a,e[4]=i,e[5]=c):c=e[5],c},Ws=n=>{const e=l.compilerRuntimeExports.c(14);let t,o,a;e[0]!==n?({className:t,size:a,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const r=a==="line"?Ge.classes.sizeLine:void 0,i=a==="fill"?Ge.classes.sizeFill:void 0;let c;e[4]!==t||e[5]!==r||e[6]!==i?(c=l.classNames("luminus-loading",Ge.classes.loading,Ge.classes.loadingBlock,r,i,t),e[4]=t,e[5]=r,e[6]=i,e[7]=c):c=e[7];let u,m,d;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:l.classNames("spinner-grow",Ge.classes.spinnerGrow,"text-primary"),role:"status"}),m=s.jsx("div",{className:l.classNames("spinner-grow",Ge.classes.spinnerGrow,"text-primary",Ge.classes.second),role:"status"}),d=s.jsx("div",{className:l.classNames("spinner-grow",Ge.classes.spinnerGrow,"text-primary",Ge.classes.third),role:"status"}),e[8]=u,e[9]=m,e[10]=d):(u=e[8],m=e[9],d=e[10]);let f;return e[11]!==o||e[12]!==c?(f=s.jsxs("div",{className:c,...o,children:[u,m,d]}),e[11]=o,e[12]=c,e[13]=f):f=e[13],f};function ml(n,e){const t=l.toDate(n);return isNaN(e)?l.constructFrom(n,NaN):(e&&t.setDate(t.getDate()+e),t)}function fl(n,e){const t=l.toDate(n),o=l.toDate(e),a=t.getTime()-o.getTime();return a<0?-1:a>0?1:a}function Vn(n,e){const t=l.toDate(n),o=l.toDate(e),a=t.getFullYear()-o.getFullYear(),r=t.getMonth()-o.getMonth();return a*12+r}function Wn(n){const e=l.toDate(n);return Math.trunc(e.getMonth()/3)+1}function on(n,e){const t=l.toDate(n),o=l.toDate(e),a=t.getFullYear()-o.getFullYear(),r=Wn(t)-Wn(o);return a*4+r}function Un(n,e,t){const o=l.startOfWeek(n,t),a=l.startOfWeek(e,t),r=+o-l.getTimezoneOffsetInMilliseconds(o),i=+a-l.getTimezoneOffsetInMilliseconds(a);return Math.round((r-i)/l.millisecondsInWeek)}function ln(n,e){const t=l.toDate(n),o=l.toDate(e);return t.getFullYear()-o.getFullYear()}function pl(n,e){const t=l.toDate(n),o=l.toDate(e),a=Gn(t,o),r=Math.abs(l.differenceInCalendarDays(t,o));t.setDate(t.getDate()-a*r);const i=+(Gn(t,o)===-a),c=a*(r-i);return c===0?0:c}function Gn(n,e){const t=n.getFullYear()-e.getFullYear()||n.getMonth()-e.getMonth()||n.getDate()-e.getDate()||n.getHours()-e.getHours()||n.getMinutes()-e.getMinutes()||n.getSeconds()-e.getSeconds()||n.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function Dn(n){return e=>{const o=(n?Math[n]:Math.trunc)(e);return o===0?0:o}}function Tn(n,e){return+l.toDate(n)-+l.toDate(e)}function Kn(n,e,t){const o=Tn(n,e)/l.millisecondsInHour;return Dn(t==null?void 0:t.roundingMethod)(o)}function Yn(n,e,t){const o=Tn(n,e)/l.millisecondsInMinute;return Dn(t==null?void 0:t.roundingMethod)(o)}function an(n,e,t){const o=Tn(n,e)/1e3;return Dn(t==null?void 0:t.roundingMethod)(o)}function It(n,e){const t=l.toDate(n);if(isNaN(t.getTime()))throw new RangeError("Invalid time value");const o=(e==null?void 0:e.format)??"extended",a=(e==null?void 0:e.representation)??"complete";let r="",i="";const c=o==="extended"?"-":"",u=o==="extended"?":":"";if(a!=="time"){const m=l.addLeadingZeros(t.getDate(),2),d=l.addLeadingZeros(t.getMonth()+1,2);r=`${l.addLeadingZeros(t.getFullYear(),4)}${c}${d}${c}${m}`}if(a!=="date"){const m=t.getTimezoneOffset();if(m!==0){const y=Math.abs(m),h=l.addLeadingZeros(Math.trunc(y/60),2),v=l.addLeadingZeros(y%60,2);i=`${m<0?"+":"-"}${h}:${v}`}else i="Z";const d=l.addLeadingZeros(t.getHours(),2),f=l.addLeadingZeros(t.getMinutes(),2),p=l.addLeadingZeros(t.getSeconds(),2),g=r===""?"":"T",x=[d,f,p].join(u);r=`${r}${g}${x}${i}`}return r}function hl(n){const e=l.toDate(n),t=e.getFullYear(),o=e.getMonth(),a=l.constructFrom(n,0);return a.setFullYear(t,o+1,0),a.setHours(0,0,0,0),a.getDate()}function gl(n,e,t){let o=0,a;const r=l.toDate(n),i=l.toDate(e);if(t!=null&&t.unit)a=t==null?void 0:t.unit,a==="second"?o=an(r,i):a==="minute"?o=Yn(r,i):a==="hour"?o=Kn(r,i):a==="day"?o=l.differenceInCalendarDays(r,i):a==="week"?o=Un(r,i):a==="month"?o=Vn(r,i):a==="quarter"?o=on(r,i):a==="year"&&(o=ln(r,i));else{const u=an(r,i);Math.abs(u)<l.secondsInMinute?(o=an(r,i),a="second"):Math.abs(u)<l.secondsInHour?(o=Yn(r,i),a="minute"):Math.abs(u)<l.secondsInDay&&Math.abs(l.differenceInCalendarDays(r,i))<1?(o=Kn(r,i),a="hour"):Math.abs(u)<l.secondsInWeek&&(o=l.differenceInCalendarDays(r,i))&&Math.abs(o)<7?a="day":Math.abs(u)<l.secondsInMonth?(o=Un(r,i),a="week"):Math.abs(u)<l.secondsInQuarter?(o=Vn(r,i),a="month"):Math.abs(u)<l.secondsInYear&&on(r,i)<4?(o=on(r,i),a="quarter"):(o=ln(r,i),a="year")}return new Intl.RelativeTimeFormat(t==null?void 0:t.locale,{localeMatcher:t==null?void 0:t.localeMatcher,numeric:(t==null?void 0:t.numeric)||"auto",style:t==null?void 0:t.style}).format(o,a)}function xl(n,e){const t=l.toDate(n),o=t.getFullYear(),a=t.getDate(),r=l.constructFrom(n,0);r.setFullYear(o,e,15),r.setHours(0,0,0,0);const i=hl(r);return t.setMonth(e,Math.min(a,i)),t}function bn(n,e){const t=l.toDate(n);return isNaN(+t)?l.constructFrom(n,NaN):(t.setFullYear(e),t)}function Et(...n){return n.filter(e=>e!=null).reduce((e,t)=>{if(typeof t!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return e===null?t:function(...a){e.apply(this,a),t.apply(this,a)}},null)}const yl={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function vl(n,e){const t=`offset${n[0].toUpperCase()}${n.slice(1)}`,o=e[t],a=yl[n];return o+parseInt(l.style(e,a[0]),10)+parseInt(l.style(e,a[1]),10)}const bl={[l.EXITED]:"collapse",[l.EXITING]:"collapsing",[l.ENTERING]:"collapsing",[l.ENTERED]:"collapse show"},En=N.forwardRef(({onEnter:n,onEntering:e,onEntered:t,onExit:o,onExiting:a,className:r,children:i,dimension:c="height",in:u=!1,timeout:m=300,mountOnEnter:d=!1,unmountOnExit:f=!1,appear:p=!1,getDimensionValue:g=vl,...x},y)=>{const h=typeof c=="function"?c():c,v=N.useMemo(()=>Et(C=>{C.style[h]="0"},n),[h,n]),b=N.useMemo(()=>Et(C=>{const I=`scroll${h[0].toUpperCase()}${h.slice(1)}`;C.style[h]=`${C[I]}px`},e),[h,e]),w=N.useMemo(()=>Et(C=>{C.style[h]=null},t),[h,t]),S=N.useMemo(()=>Et(C=>{C.style[h]=`${g(h,C)}px`,l.triggerBrowserReflow(C)},o),[o,g,h]),j=N.useMemo(()=>Et(C=>{C.style[h]=null},a),[h,a]);return s.jsx(l.TransitionWrapper,{ref:y,addEndListener:l.transitionEndListener,...x,"aria-expanded":x.role?u:null,onEnter:v,onEntering:b,onEntered:w,onExit:S,onExiting:j,childRef:l.getChildRef(i),in:u,timeout:m,mountOnEnter:d,unmountOnExit:f,appear:p,children:(C,I)=>N.cloneElement(i,{...I,className:l.classNames(r,i.props.className,bl[C],h==="width"&&"collapse-horizontal")})})});En.displayName="Collapse";const Ln=Me.forwardRef(({className:n,bsPrefix:e,as:t="div",...o},a)=>(e=l.useBootstrapPrefix(e,"card-body"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Ln.displayName="CardBody";const Us=Me.forwardRef(({className:n,bsPrefix:e,as:t="div",...o},a)=>(e=l.useBootstrapPrefix(e,"card-footer"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Us.displayName="CardFooter";const Gs=Me.createContext(null);Gs.displayName="CardHeaderContext";const Ks=Me.forwardRef(({bsPrefix:n,className:e,as:t="div",...o},a)=>{const r=l.useBootstrapPrefix(n,"card-header"),i=N.useMemo(()=>({cardHeaderBsPrefix:r}),[r]);return s.jsx(Gs.Provider,{value:i,children:s.jsx(t,{ref:a,...o,className:l.classNames(e,r)})})});Ks.displayName="CardHeader";const Ys=Me.forwardRef(({bsPrefix:n,className:e,variant:t,as:o="img",...a},r)=>{const i=l.useBootstrapPrefix(n,"card-img");return s.jsx(o,{ref:r,className:l.classNames(t?`${i}-${t}`:i,e),...a})});Ys.displayName="CardImg";const qs=Me.forwardRef(({className:n,bsPrefix:e,as:t="div",...o},a)=>(e=l.useBootstrapPrefix(e,"card-img-overlay"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));qs.displayName="CardImgOverlay";const Qs=Me.forwardRef(({className:n,bsPrefix:e,as:t="a",...o},a)=>(e=l.useBootstrapPrefix(e,"card-link"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Qs.displayName="CardLink";const jl=l.divWithClassName("h6"),Xs=Me.forwardRef(({className:n,bsPrefix:e,as:t=jl,...o},a)=>(e=l.useBootstrapPrefix(e,"card-subtitle"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Xs.displayName="CardSubtitle";const Zs=Me.forwardRef(({className:n,bsPrefix:e,as:t="p",...o},a)=>(e=l.useBootstrapPrefix(e,"card-text"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Zs.displayName="CardText";const Sl=l.divWithClassName("h5"),Js=Me.forwardRef(({className:n,bsPrefix:e,as:t=Sl,...o},a)=>(e=l.useBootstrapPrefix(e,"card-title"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Js.displayName="CardTitle";const eo=Me.forwardRef(({bsPrefix:n,className:e,bg:t,text:o,border:a,body:r=!1,children:i,as:c="div",...u},m)=>{const d=l.useBootstrapPrefix(n,"card");return s.jsx(c,{ref:m,...u,className:l.classNames(e,d,t&&`bg-${t}`,o&&`text-${o}`,a&&`border-${a}`),children:r?s.jsx(Ln,{children:i}):i})});eo.displayName="Card";const qn=Object.assign(eo,{Img:Ys,Title:Js,Subtitle:Xs,Body:Ln,Link:Qs,Text:Zs,Header:Ks,Footer:Us,ImgOverlay:qs}),Jt=Me.forwardRef(({className:n,bsPrefix:e,as:t="span",...o},a)=>(e=l.useBootstrapPrefix(e,"input-group-text"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));Jt.displayName="InputGroupText";const Cl=n=>s.jsx(Jt,{children:s.jsx(l.FormCheckInput,{type:"checkbox",...n})}),wl=n=>s.jsx(Jt,{children:s.jsx(l.FormCheckInput,{type:"radio",...n})}),to=Me.forwardRef(({bsPrefix:n,size:e,hasValidation:t,className:o,as:a="div",...r},i)=>{n=l.useBootstrapPrefix(n,"input-group");const c=N.useMemo(()=>({}),[]);return s.jsx(l.context.Provider,{value:c,children:s.jsx(a,{ref:i,...r,className:l.classNames(o,n,e&&`${n}-${e}`,t&&"has-validation")})})});to.displayName="InputGroup";const qt=Object.assign(to,{Text:Jt,Radio:wl,Checkbox:Cl}),jn=new WeakMap,Qn=(n,e)=>{if(!n||!e)return;const t=jn.get(e)||new Map;jn.set(e,t);let o=t.get(n);return o||(o=e.matchMedia(n),o.refCount=0,t.set(o.media,o)),o};function Nl(n,e=typeof window>"u"?void 0:window){const t=Qn(n,e),[o,a]=N.useState(()=>t?t.matches:!1);return l.useIsomorphicEffect(()=>{let r=Qn(n,e);if(!r)return a(!1);let i=jn.get(e);const c=()=>{a(r.matches)};return r.refCount++,r.addListener(c),c(),()=>{r.removeListener(c),r.refCount--,r.refCount<=0&&(i==null||i.delete(r.media)),r=void 0}},[n]),o}function Il(n){const e=Object.keys(n);function t(c,u){return c===u?u:c?`${c} and ${u}`:u}function o(c){return e[Math.min(e.indexOf(c)+1,e.length-1)]}function a(c){const u=o(c);let m=n[u];return typeof m=="number"?m=`${m-.2}px`:m=`calc(${m} - 0.2px)`,`(max-width: ${m})`}function r(c){let u=n[c];return typeof u=="number"&&(u=`${u}px`),`(min-width: ${u})`}function i(c,u,m){let d;typeof c=="object"?(d=c,m=u,u=!0):(u=u||!0,d={[c]:u});let f=N.useMemo(()=>Object.entries(d).reduce((p,[g,x])=>((x==="up"||x===!0)&&(p=t(p,r(g))),(x==="down"||x===!0)&&(p=t(p,a(g))),p),""),[JSON.stringify(d)]);return Nl(f,m)}return i}const kl=Il({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),no=Me.forwardRef(({className:n,bsPrefix:e,as:t="div",...o},a)=>(e=l.useBootstrapPrefix(e,"offcanvas-body"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));no.displayName="OffcanvasBody";const _l={[l.ENTERING]:"show",[l.ENTERED]:"show"},so=Me.forwardRef(({bsPrefix:n,className:e,children:t,in:o=!1,mountOnEnter:a=!1,unmountOnExit:r=!1,appear:i=!1,...c},u)=>(n=l.useBootstrapPrefix(n,"offcanvas"),s.jsx(l.TransitionWrapper,{ref:u,addEndListener:l.transitionEndListener,in:o,mountOnEnter:a,unmountOnExit:r,appear:i,...c,childRef:l.getChildRef(t),children:(m,d)=>Me.cloneElement(t,{...d,className:l.classNames(e,t.props.className,(m===l.ENTERING||m===l.EXITING)&&`${n}-toggling`,_l[m])})})));so.displayName="OffcanvasToggling";const oo=Me.forwardRef(({bsPrefix:n,className:e,closeLabel:t="Close",closeButton:o=!1,...a},r)=>(n=l.useBootstrapPrefix(n,"offcanvas-header"),s.jsx(l.AbstractModalHeader,{ref:r,...a,className:l.classNames(e,n),closeLabel:t,closeButton:o})));oo.displayName="OffcanvasHeader";const Dl=l.divWithClassName("h5"),lo=Me.forwardRef(({className:n,bsPrefix:e,as:t=Dl,...o},a)=>(e=l.useBootstrapPrefix(e,"offcanvas-title"),s.jsx(t,{ref:a,className:l.classNames(n,e),...o})));lo.displayName="OffcanvasTitle";function Tl(n){return s.jsx(so,{...n})}function El(n){return s.jsx(l.Fade,{...n})}const ao=Me.forwardRef(({bsPrefix:n,className:e,children:t,"aria-labelledby":o,placement:a="start",responsive:r,show:i=!1,backdrop:c=!0,keyboard:u=!0,scroll:m=!1,onEscapeKeyDown:d,onShow:f,onHide:p,container:g,autoFocus:x=!0,enforceFocus:y=!0,restoreFocus:h=!0,restoreFocusOptions:v,onEntered:b,onExit:w,onExiting:S,onEnter:j,onEntering:C,onExited:I,backdropClassName:k,manager:L,renderStaticNode:E=!1,...D},_)=>{const R=N.useRef();n=l.useBootstrapPrefix(n,"offcanvas");const[$,A]=N.useState(!1),T=l.useEventCallback(p),F=kl(r||"xs","up");N.useEffect(()=>{A(r?i&&!F:i)},[i,r,F]);const P=N.useMemo(()=>({onHide:T}),[T]);function M(){return L||(m?(R.current||(R.current=new l.BootstrapModalManager({handleContainerOverflow:!1})),R.current):l.getSharedManager())}const O=(B,...U)=>{B&&(B.style.visibility="visible"),j==null||j(B,...U)},z=(B,...U)=>{B&&(B.style.visibility=""),I==null||I(...U)},H=N.useCallback(B=>s.jsx("div",{...B,className:l.classNames(`${n}-backdrop`,k)}),[k,n]),W=B=>s.jsx("div",{...B,...D,className:l.classNames(e,r?`${n}-${r}`:n,`${n}-${a}`),"aria-labelledby":o,children:t});return s.jsxs(s.Fragment,{children:[!$&&(r||E)&&W({}),s.jsx(l.ModalContext.Provider,{value:P,children:s.jsx(l.BaseModal,{show:$,ref:_,backdrop:c,container:g,keyboard:u,autoFocus:x,enforceFocus:y&&!m,restoreFocus:h,restoreFocusOptions:v,onEscapeKeyDown:d,onShow:f,onHide:T,onEnter:O,onEntering:C,onEntered:b,onExit:w,onExiting:S,onExited:z,manager:M(),transition:Tl,backdropTransition:El,renderBackdrop:H,renderDialog:W})})]})});ao.displayName="Offcanvas";const Xn=Object.assign(ao,{Body:no,Header:oo,Title:lo});function ro({animation:n,bg:e,bsPrefix:t,size:o,...a}){t=l.useBootstrapPrefix(t,"placeholder");const[{className:r,...i}]=l.useCol(a);return{...i,className:l.classNames(r,n?`${t}-${n}`:t,o&&`${t}-${o}`,e&&`bg-${e}`)}}const io=Me.forwardRef((n,e)=>{const t=ro(n);return s.jsx(l.Button,{...t,ref:e,disabled:!0,tabIndex:-1})});io.displayName="PlaceholderButton";const co=Me.forwardRef(({as:n="span",...e},t)=>{const o=ro(e);return s.jsx(n,{...o,ref:t})});co.displayName="Placeholder";const ut=Object.assign(co,{Button:io}),Rn=Me.forwardRef(({bsPrefix:n,className:e,as:t="div",...o},a)=>{const r=l.useBootstrapPrefix(n,"row"),i=l.useBootstrapBreakpoints(),c=l.useBootstrapMinBreakpoint(),u=`${r}-cols`,m=[];return i.forEach(d=>{const f=o[d];delete o[d];let p;f!=null&&typeof f=="object"?{cols:p}=f:p=f;const g=d!==c?`-${d}`:"";p!=null&&m.push(`${u}${g}-${p}`)}),s.jsx(t,{ref:a,...o,className:l.classNames(e,r,...m)})});Rn.displayName="Row";const uo=Me.forwardRef(({bsPrefix:n,className:e,striped:t,bordered:o,borderless:a,hover:r,size:i,variant:c,responsive:u,...m},d)=>{const f=l.useBootstrapPrefix(n,"table"),p=l.classNames(e,f,c&&`${f}-${c}`,i&&`${f}-${i}`,t&&`${f}-${typeof t=="string"?`striped-${t}`:"striped"}`,o&&`${f}-bordered`,a&&`${f}-borderless`,r&&`${f}-hover`),g=s.jsx("table",{...m,className:p,ref:d});if(u){let x=`${f}-responsive`;return typeof u=="string"&&(x=`${x}-${u}`),s.jsx("div",{className:x,children:g})}return g});uo.displayName="Table";const mo=n=>{const e=l.compilerRuntimeExports.c(11),{children:t,onStorno:o,noSpacer:a,disabled:r}=n,{texts:i}=N.useContext(l.LuminusComponentsContext),{formSubmit:c}=i;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(l.MdCheck,{}),e[0]=u):u=e[0];let m;e[1]!==t||e[2]!==r?(m=s.jsxs(l.PrimaryButton,{as:"button",color:"primary",size:"lg",type:"submit",disabled:r,children:[u,t]}),e[1]=t,e[2]=r,e[3]=m):m=e[3];let d;e[4]!==c||e[5]!==o?(d=o&&s.jsxs(l.PrimaryButton,{as:"button",color:"secondary",variant:"outlined",size:"lg",onClick:o,children:[s.jsx(l.MdOutlineClose,{}),c.storno]}),e[4]=c,e[5]=o,e[6]=d):d=e[6];let f;return e[7]!==a||e[8]!==m||e[9]!==d?(f=s.jsxs(el,{noSpacer:a,children:[m,d]}),e[7]=a,e[8]=m,e[9]=d,e[10]=f):f=e[10],f},$n=({ref:n,color:e="primary",icon:t=s.jsx(l.MdOutlineFileUpload,{size:12}),inputId:o="context-file-input",accept:a="*",onUpload:r,className:i,children:c,multiple:u,...m})=>{const d=f=>{f.target.files&&(r(f.target.files),f.target.value="")};return s.jsxs(s.Fragment,{children:[s.jsxs("label",{ref:n,htmlFor:o,className:l.classNames(`luminus-context-button btn text-${e} ${i??""}`,l.classes.button),...m,children:[t,c]}),s.jsx("input",{id:o,type:"file",accept:a,onChange:d,hidden:!0,multiple:u})]})},Ll=({onUpload:n,accept:e,children:t,className:o,size:a="md"})=>{const r=N.useCallback(async c=>{if(c.target.files)try{await n(c.target.files)}finally{c.target.value=""}},[n]),i=N.useId();return s.jsxs(s.Fragment,{children:[s.jsx("label",{htmlFor:i,className:l.classNames("btn luminus-context-button text-primary",`btn-${a}`,o),children:t}),s.jsx("input",{id:i,type:"file",accept:e,onChange:r,hidden:!0})]})},Rl="_select_14f33_1",$l="_sm_14f33_11",Fl="_lg_14f33_23",Vt={select:Rl,sm:$l,lg:Fl},fo=n=>{const e=l.compilerRuntimeExports.c(66),{month:t,onChangeMonth:o,locale:a,yearMin:r,yearMax:i,className:c,monthClassName:u,yearClassName:m,size:d}=n,f=r===void 0?2e3:r,p=i===void 0?2050:i;let g;e[0]!==t||e[1]!==o||e[2]!==p||e[3]!==f?(g=B=>{const U=Ge.addMonths(t,B);U.getFullYear()<f||U.getFullYear()>p||o(U)},e[0]=t,e[1]=o,e[2]=p,e[3]=f,e[4]=g):g=e[4];const x=g;let y;if(e[5]!==p||e[6]!==f){y=[];for(let B=f;B<=p;B++)y.push(B);e[5]=p,e[6]=f,e[7]=y}else y=e[7];const h=y;let v;if(e[8]!==a){v=[];for(let B=0;B<=11;B++)v.push({id:B,name:l.format(new Date(2024,B,1),"LLLL",{locale:a})});e[8]=a,e[9]=v}else v=e[9];const b=v,w=Vt[d];let S;e[10]!==c||e[11]!==d||e[12]!==w?(S=l.classNames("card d-flex flex-row align-items-center justify-content-center m-0 p-1 gap-2",c,{[w]:d}),e[10]=c,e[11]=d,e[12]=w,e[13]=S):S=e[13];let j;e[14]!==x?(j=()=>x(-1),e[14]=x,e[15]=j):j=e[15];let C;e[16]!==t||e[17]!==f?(C=t.getFullYear()<f||t.getFullYear()===f&&t.getMonth()<=0,e[16]=t,e[17]=f,e[18]=C):C=e[18];let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(l.MdOutlineKeyboardArrowLeft,{}),e[19]=I):I=e[19];let k;e[20]!==j||e[21]!==C?(k=s.jsx(l.IconButton,{onClick:j,disabled:C,children:I}),e[20]=j,e[21]=C,e[22]=k):k=e[22];let L;e[23]!==t?(L=t.getMonth(),e[23]=t,e[24]=L):L=e[24];let E;e[25]!==t||e[26]!==o?(E=B=>{var U;return((U=B.target)==null?void 0:U.value)&&o(xl(t,Number(B.target.value)))},e[25]=t,e[26]=o,e[27]=E):E=e[27];let D;e[28]!==u?(D=l.classNames(Vt.select,Vt.month,u),e[28]=u,e[29]=D):D=e[29];let _;e[30]!==b?(_=b.map(Pl),e[30]=b,e[31]=_):_=e[31];let R;e[32]!==L||e[33]!==E||e[34]!==D||e[35]!==_?(R=s.jsx(l.Form.Select,{value:L,onChange:E,className:D,children:_}),e[32]=L,e[33]=E,e[34]=D,e[35]=_,e[36]=R):R=e[36];let $;e[37]!==t?($=t.getFullYear(),e[37]=t,e[38]=$):$=e[38];let A;e[39]!==t||e[40]!==o?(A=B=>{var U;return((U=B.target)==null?void 0:U.value)&&o(bn(t,Number(B.target.value)))},e[39]=t,e[40]=o,e[41]=A):A=e[41];let T;e[42]!==m?(T=l.classNames(Vt.select,m),e[42]=m,e[43]=T):T=e[43];let F;e[44]!==h?(F=h.map(Al),e[44]=h,e[45]=F):F=e[45];let P;e[46]!==$||e[47]!==A||e[48]!==T||e[49]!==F?(P=s.jsx(l.Form.Select,{value:$,onChange:A,className:T,children:F}),e[46]=$,e[47]=A,e[48]=T,e[49]=F,e[50]=P):P=e[50];let M;e[51]!==x?(M=()=>x(1),e[51]=x,e[52]=M):M=e[52];let O;e[53]!==t||e[54]!==p?(O=t.getFullYear()>p||t.getFullYear()===p&&t.getMonth()>=11,e[53]=t,e[54]=p,e[55]=O):O=e[55];let z;e[56]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(l.MdOutlineKeyboardArrowRight,{}),e[56]=z):z=e[56];let H;e[57]!==M||e[58]!==O?(H=s.jsx(l.IconButton,{onClick:M,disabled:O,children:z}),e[57]=M,e[58]=O,e[59]=H):H=e[59];let W;return e[60]!==R||e[61]!==P||e[62]!==H||e[63]!==S||e[64]!==k?(W=s.jsxs("div",{className:S,children:[k,R,P,H]}),e[60]=R,e[61]=P,e[62]=H,e[63]=S,e[64]=k,e[65]=W):W=e[65],W};function Pl(n){return s.jsx("option",{value:n.id,children:n.name},n.id)}function Al(n){return s.jsx("option",{value:n,children:n},n)}const Ml="_select_pywmr_1",Ol={select:Ml},Zn=2e3,Jn=2050,po=n=>{var P,M;const e=l.compilerRuntimeExports.c(57);let t,o,a,r,i;e[0]!==n?({year:i,onChangeYear:o,className:t,variant:r,...a}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i):(t=e[1],o=e[2],a=e[3],r=e[4],i=e[5]);const c=r===void 0?"standart":r;let u;e[6]!==a.manualOptions||e[7]!==a.optionMin||e[8]!==a.options?(u=a.manualOptions?((P=a.options)==null?void 0:P.at(0))??Zn:a.optionMin??Zn,e[6]=a.manualOptions,e[7]=a.optionMin,e[8]=a.options,e[9]=u):u=e[9];const m=u;let d;e[10]!==a.manualOptions||e[11]!==a.optionMax||e[12]!==a.options?(d=a.manualOptions?((M=a.options)==null?void 0:M.at(-1))??Jn:a.optionMax??Jn,e[10]=a.manualOptions,e[11]=a.optionMax,e[12]=a.options,e[13]=d):d=e[13];const f=d;let p;e:{if(a.manualOptions){p=a.options;break e}let O;if(e[14]!==f||e[15]!==m){O=[];for(let z=m;z<=f;z++)O.push(z);e[14]=f,e[15]=m,e[16]=O}else O=e[16];p=O}const g=p;let x;e[17]!==o||e[18]!==f||e[19]!==m||e[20]!==a.manualOptions||e[21]!==g||e[22]!==i?(x=O=>{if(a.manualOptions){const z=g.findIndex(H=>H===i.getFullYear());if(z!==-1){const H=g.at(z+O)??null;H&&o(bn(i,H))}}else{const z=i.getFullYear()+O;z>=m&&z<=f&&o(Ge.addYears(i,O))}},e[17]=o,e[18]=f,e[19]=m,e[20]=a.manualOptions,e[21]=g,e[22]=i,e[23]=x):x=e[23];const y=x,h=c==="standart"?"card p-1 gap-2":void 0,v=c==="minimalist"?"p-0 gap-0":void 0,b=t??"";let w;e[24]!==h||e[25]!==v||e[26]!==b?(w=l.classNames("d-flex flex-row align-items-center m-0",h,v,b),e[24]=h,e[25]=v,e[26]=b,e[27]=w):w=e[27];let S;e[28]!==y?(S=()=>y(-1),e[28]=y,e[29]=S):S=e[29];const j=i.getFullYear()<=m;let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(l.MdOutlineKeyboardArrowLeft,{}),e[30]=C):C=e[30];let I;e[31]!==S||e[32]!==j?(I=s.jsx(l.IconButton,{onClick:S,disabled:j,children:C}),e[31]=S,e[32]=j,e[33]=I):I=e[33];let k;e[34]!==i?(k=i.getFullYear(),e[34]=i,e[35]=k):k=e[35];let L;e[36]!==o||e[37]!==i?(L=O=>{var z;return((z=O.target)==null?void 0:z.value)&&o(bn(i,Number(O.target.value)))},e[36]=o,e[37]=i,e[38]=L):L=e[38];let E;e[39]===Symbol.for("react.memo_cache_sentinel")?(E=l.classNames(Ol.select,"bg-transparent"),e[39]=E):E=e[39];let D;e[40]!==g?(D=g.map(Bl),e[40]=g,e[41]=D):D=e[41];let _;e[42]!==k||e[43]!==L||e[44]!==D?(_=s.jsx(l.Form.Select,{value:k,onChange:L,className:E,children:D}),e[42]=k,e[43]=L,e[44]=D,e[45]=_):_=e[45];let R;e[46]!==y?(R=()=>y(1),e[46]=y,e[47]=R):R=e[47];const $=i.getFullYear()>=f;let A;e[48]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(l.MdOutlineKeyboardArrowRight,{}),e[48]=A):A=e[48];let T;e[49]!==R||e[50]!==$?(T=s.jsx(l.IconButton,{onClick:R,disabled:$,children:A}),e[49]=R,e[50]=$,e[51]=T):T=e[51];let F;return e[52]!==I||e[53]!==_||e[54]!==T||e[55]!==w?(F=s.jsxs("div",{className:w,children:[I,_,T]}),e[52]=I,e[53]=_,e[54]=T,e[55]=w,e[56]=F):F=e[56],F};function Bl(n){return s.jsx("option",{value:n,children:n},n)}const zl="_avatar-icon_1axl6_1",Hl={avatarIcon:zl},en=({name:n,fontSize:e,size:t})=>{const o=N.useMemo(()=>{const i=n.split(" ");return i.length<2?n:l.joinStrings(" ",i.at(i.length-2),i.at(i.length-1))},[n]),a=N.useMemo(()=>{const i=o.split(" ");return l.joinStrings("",...i.map(c=>c.at(0)??void 0))},[o]),r=i=>{let c=0,u;for(u=0;u<i.length;u+=1)c=i.charCodeAt(u)+((c<<5)-c);let m="#";for(u=0;u<3;u+=1){const d=c>>u*8&255;m+=`00${d.toString(16)}`.slice(-2)}return m};return s.jsx(l.OverlayTrigger,{placement:"bottom",overlay:s.jsx(l.Tooltip,{children:n}),children:s.jsx("div",{className:l.classNames("luminus-avatar-icon",Hl.avatarIcon),style:{backgroundColor:r(o),fontSize:e??void 0,minHeight:t??void 0,height:t??void 0,maxHeight:t??void 0,minWidth:t??void 0,width:t??void 0,maxWidth:t??void 0},children:s.jsx("div",{children:a})})})},es={"eon-red":"#ea1b0a","eon-turquoise":"#1999aa"},Vl={plain:{fgColor:"black",eyeColor:"black",logoImage:void 0,ecLevel:"M"},blackRedEyes:{fgColor:"black"},squareEyesPointingOut:{eyeRadius:[{inner:[0,2,2,2],outer:[0,10,10,10]},{inner:[2,0,2,2],outer:[10,0,10,10]},{inner:[2,2,2,0],outer:[10,10,10,0]}],qrStyle:"squares"},squareEyesRoundedIn:{eyeRadius:[{inner:[0,0,2,0],outer:[0,0,10,0]},{inner:[0,0,0,2],outer:[0,0,0,10]},{inner:[0,2,0,0],outer:[0,10,0,0]}],qrStyle:"squares"},squareTopCornersRounded:{eyeRadius:[{inner:[3,0,0,0],outer:[100,0,0,0]},{inner:[0,3,0,0],outer:[0,100,0,0]},{inner:[0,0,0,0],outer:[0,0,0,0]}],qrStyle:"squares"},fluidRoundedTopLeftEye:{eyeRadius:[{inner:[3,0,0,0],outer:[100,1,1,1]},{inner:0,outer:1},{inner:0,outer:1}],qrStyle:"fluid"},fluidRoundedEyes:{eyeRadius:{inner:1,outer:8},qrStyle:"fluid"},circleEyes:{eyeRadius:{inner:100,outer:100},qrStyle:"dots"}},Wl=Vl,Ul=n=>{const e=l.compilerRuntimeExports.c(4),{value:t,qrRef:o,variant:a}=n,i=Wl[a===void 0?"blackRedEyes":a];let c;return e[0]!==o||e[1]!==i||e[2]!==t?(c=s.jsx(l.QRCode_1,{ref:o,value:t,eyeColor:es["eon-red"],fgColor:es["eon-turquoise"],logoHeight:32,logoWidth:32,removeQrCodeBehindLogo:!0,logoPadding:5,logoPaddingStyle:"circle",ecLevel:"Q",...i}),e[0]=o,e[1]=i,e[2]=t,e[3]=c):c=e[3],c},ho=n=>{const e=l.compilerRuntimeExports.c(21),{value:t,contactType:o,className:a}=n,{ProjectIconComponent:r}=N.useContext(l.LuminusComponentsContext),[i,c]=N.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{c(!0)},e[0]=u):u=e[0];const m=u;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{c(!1)},e[1]=d):d=e[1];const f=d;let p;e:switch(o){case"email":{p="mailto";break e}case"phone":{p="tel";break e}default:throw new Error("Incorrect type for ContactsLink")}const g=p,x=t===null;let y;e[2]!==r?(y=s.jsx(r,{icon:"qr-code"}),e[2]=r,e[3]=y):y=e[3];let h;e[4]!==a||e[5]!==x||e[6]!==y?(h=s.jsx(l.IconButton,{onClick:m,disabled:x,className:a,children:y}),e[4]=a,e[5]=x,e[6]=y,e[7]=h):h=e[7];const v=`${g}:${t}`;let b;e[8]!==v?(b=s.jsx(Ul,{value:v}),e[8]=v,e[9]=b):b=e[9];let w;e[10]!==t?(w=s.jsx(l.Typography,{variant:"subtitle",children:t}),e[10]=t,e[11]=w):w=e[11];let S;e[12]!==b||e[13]!==w?(S=s.jsxs(l.Modal.Body,{className:"d-flex flex-column align-items-center",children:[b,w]}),e[12]=b,e[13]=w,e[14]=S):S=e[14];let j;e[15]!==i||e[16]!==S?(j=s.jsx(l.Modal,{show:i,onHide:f,size:"sm",children:S}),e[15]=i,e[16]=S,e[17]=j):j=e[17];let C;return e[18]!==j||e[19]!==h?(C=s.jsxs(s.Fragment,{children:[h,j]}),e[18]=j,e[19]=h,e[20]=C):C=e[20],C},go=n=>{const e=l.compilerRuntimeExports.c(10),{contactType:t,value:o,className:a,children:r,showIconWithChildren:i}=n,{ProjectIconComponent:c}=N.useContext(l.LuminusComponentsContext);let u;e:switch(t){case"email":{u="mailto";break e}case"phone":{u="tel";break e}default:throw new Error("Incorrect type for ContactsLink")}const m=u;let d;e:switch(t){case"email":{d="mail";break e}case"phone":{d="phone";break e}default:throw new Error("Incorrect type for ContactsLink")}const f=d;let p;e[0]!==c||e[1]!==r||e[2]!==m||e[3]!==f||e[4]!==i||e[5]!==o?(p=o===null?s.jsxs(s.Fragment,{children:[r,(!r||i)&&s.jsx(l.IconButton,{disabled:!0,children:s.jsx(c,{icon:f})})]}):s.jsxs(Ne.Link,{to:`${m}:${o}`,className:"w-100",children:[r,(!r||i)&&s.jsx(l.IconButton,{children:s.jsx(c,{icon:f})})]}),e[0]=c,e[1]=r,e[2]=m,e[3]=f,e[4]=i,e[5]=o,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==p?(g=s.jsx("div",{className:a,children:p}),e[7]=a,e[8]=p,e[9]=g):g=e[9],g},Dt=n=>{const e=l.compilerRuntimeExports.c(23),{InputContainer:t,label:o,value:a,onChange:r,hidden:i,disabled:c,className:u,type:m,withoutLabel:d,indeterminate:f,hint:p}=n,g=t===void 0?l.FloatingLabelInput:t,x=N.useRef(null);let y,h;e[0]!==f?(y=()=>{x.current&&(x.current.indeterminate=f??!1)},h=[x,f],e[0]=f,e[1]=y,e[2]=h):(y=e[1],h=e[2]),N.useEffect(y,h);const v=o??"",b=`check-${o}`,w=m??"checkbox",S=o??"";let j;e[3]!==r?(j=D=>{var _;r&&r(((_=D.target)==null?void 0:_.checked)??!1)},e[3]=r,e[4]=j):j=e[4];const C=u??"",I=i??!1,k=c??!1;let L;e[5]!==I||e[6]!==k||e[7]!==b||e[8]!==w||e[9]!==S||e[10]!==j||e[11]!==C||e[12]!==a?(L=s.jsx(l.Form.Check,{ref:x,id:b,type:w,label:S,checked:a,onChange:j,className:C,hidden:I,disabled:k}),e[5]=I,e[6]=k,e[7]=b,e[8]=w,e[9]=S,e[10]=j,e[11]=C,e[12]=a,e[13]=L):L=e[13];let E;return e[14]!==g||e[15]!==u||e[16]!==c||e[17]!==i||e[18]!==p||e[19]!==L||e[20]!==v||e[21]!==d?(E=s.jsx(g,{isForCheckInput:!0,hidden:i,label:v,withoutLabel:d,className:u,hint:p,disabled:c,children:L}),e[14]=g,e[15]=u,e[16]=c,e[17]=i,e[18]=p,e[19]=L,e[20]=v,e[21]=d,e[22]=E):E=e[22],E},Gl="_popoverContainer_j6114_1",Kl="_textInput_j6114_5",Yl="_btnsPopover_j6114_9",ql="_popoverHandle_j6114_20",Ql="_btnsPopoverHideable_j6114_27",Lt={popoverContainer:Gl,textInput:Kl,btnsPopover:Yl,popoverHandle:ql,btnsPopoverHideable:Ql},xo=n=>{const e=l.compilerRuntimeExports.c(25),{children:t,className:o,withoutLabel:a,label:r,contactType:i,value:c}=n,{ProjectIconComponent:u}=N.useContext(l.LuminusComponentsContext);let m;e[0]!==o?(m=l.classNames("d-flex align-items-center",o),e[0]=o,e[1]=m):m=e[1];let d;e[2]!==r||e[3]!==a?(d=!a&&s.jsx("div",{className:l.classNames("d-flex justify-content-between align-items-center w-50"),children:s.jsx(l.Typography,{variant:"form-label",className:"text-muted",children:r})}),e[2]=r,e[3]=a,e[4]=d):d=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=l.classNames("w-50",Lt.popoverContainer),e[5]=f):f=e[5];let p;e[6]!==t?(p=s.jsx("div",{className:Lt.textInput,children:t}),e[6]=t,e[7]=p):p=e[7];let g,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=l.classNames("d-flex gap-1",Lt.btnsPopover),x=l.classNames(Lt.btnsPopoverHideable,"p-1"),e[8]=g,e[9]=x):(g=e[8],x=e[9]);let y;e[10]!==i||e[11]!==c?(y=s.jsxs("div",{className:x,children:[s.jsx(ho,{contactType:i,value:c}),s.jsx(go,{contactType:i,value:c})]}),e[10]=i,e[11]=c,e[12]=y):y=e[12];let h;e[13]!==u?(h=s.jsx("div",{role:"button",tabIndex:0,className:Lt.popoverHandle,children:s.jsx(u,{icon:"chevron-left"})}),e[13]=u,e[14]=h):h=e[14];let v;e[15]!==y||e[16]!==h?(v=s.jsxs("div",{className:g,children:[y,h]}),e[15]=y,e[16]=h,e[17]=v):v=e[17];let b;e[18]!==p||e[19]!==v?(b=s.jsxs("div",{className:f,children:[p,v]}),e[18]=p,e[19]=v,e[20]=b):b=e[20];let w;return e[21]!==m||e[22]!==b||e[23]!==d?(w=s.jsxs("div",{className:m,children:[d,b]}),e[21]=m,e[22]=b,e[23]=d,e[24]=w):w=e[24],w},Xl=n=>{const e=l.compilerRuntimeExports.c(22);let t,o,a,r,i,c,u,m,d;e[0]!==n?({value:m,label:i,InputContainer:u,className:t,withoutLabel:d,hidden:r,disabled:a,contactType:o,...c}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i,e[6]=c,e[7]=u,e[8]=m,e[9]=d):(t=e[1],o=e[2],a=e[3],r=e[4],i=e[5],c=e[6],u=e[7],m=e[8],d=e[9]);const f=u===void 0?l.FloatingLabelInput:u;if(r)return null;let p;e[10]!==f||e[11]!==a||e[12]!==c||e[13]!==m?(p=s.jsx(l.TextInput,{type:"text",value:m,disabled:a,InputContainer:f,size:"sm",withoutLabel:!0,...c}),e[10]=f,e[11]=a,e[12]=c,e[13]=m,e[14]=p):p=e[14];let g;return e[15]!==t||e[16]!==o||e[17]!==i||e[18]!==p||e[19]!==m||e[20]!==d?(g=s.jsx(xo,{contactType:o,value:m,withoutLabel:d,label:i,className:t,children:p}),e[15]=t,e[16]=o,e[17]=i,e[18]=p,e[19]=m,e[20]=d,e[21]=g):g=e[21],g},Zl=({InputContainer:n=l.FloatingLabelInput,items:e,selectedItemNavigateTo:t,onSearchQueryChange:o,texts:a,isLoading:r,value:i,onSelect:c,label:u,withoutLabel:m,size:d,dropdownItemsNameWidth:f,additionalColumns:p,hidden:g,disabled:x,displayIdAsName:y,CustomOnChangeComponent:h,className:v,archiveColumn:b,icon:w,hint:S,addNewOptionPath:j,refreshOptions:C,MiniDetailComponent:I,miniDetailPlacement:k,suggestedItems:L,suggestedItemsTitle:E,customEllipsisOptions:D})=>{const[_,R]=N.useState(!1),$=N.useCallback(O=>{c&&c(O)},[c]),A=N.useCallback(O=>{R(!1),$(O)},[$]),T=N.useRef(null),F=t!==void 0,P=F&&i!==null,M=N.useMemo(()=>{var O,z;return y?((O=i==null?void 0:i.id)==null?void 0:O.toString())??"":i!=null&&i.name&&i.name.length>0?i.name:((z=i==null?void 0:i.id)==null?void 0:z.toString())??""},[i,y]);return s.jsx(s.Fragment,{children:s.jsxs(n,{withoutLabel:m,label:u??"",hidden:g,inputContainerClassName:l.classNames({"luminus-dropdown-select-open":_}),className:v,hint:S,disabled:x,children:[s.jsxs(l.InputAnchorContainer,{currentSelection:i,selectedItemNavigateTo:t,children:[y&&(i==null?void 0:i.name)&&s.jsx(l.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:i.name}),s.jsx(l.MiniDetailWrapper,{value:(i==null?void 0:i.id)??null,MiniDetailComponent:I,miniDetailPlacement:k,children:s.jsxs(l.Form.Select,{ref:T,size:d,value:(i==null?void 0:i.id)??"",onMouseDown:O=>{O.currentTarget.focus(),O.preventDefault()},onClick:()=>{!F&&!x&&R(!0)},onChange:()=>{},className:l.classNames("w-100",{"luminus-dropdown-picker-disabled":x,"luminus-dropdown-picker-link":P}),hidden:g,children:[s.jsx("option",{value:""}),i&&s.jsx("option",{value:i.id??void 0,children:M})]})}),h||!x&&F?s.jsxs("div",{className:"custom-picker-button",children:[!h&&!x&&F&&s.jsx(l.IconButton,{size:"sm",color:"secondary",onClick:O=>{O.preventDefault(),O.stopPropagation(),R(!0)},children:w??s.jsx(l.MdOutlineEdit,{})}),h??null]}):null]}),T.current&&s.jsx(l.SimplePicker,{show:_,onCancel:()=>R(!1),items:e,currentSelection:i,onSelectionChange:A,onSearchQueryChange:o,texts:a,itemsNameWidth:f,additionalColumns:p,isLoading:r,disabled:x,inputRef:T,archiveColumn:b,displayIdAsName:y,addNewOptionPath:j,refreshOptions:C,suggestedItems:L,suggestedItemsTitle:E,customEllipsisOptions:D})]})})},Jl=n=>{const e=l.compilerRuntimeExports.c(38),{InputContainer:t,value:o,onChange:a,label:r,size:i,showClearIcon:c,clearValue:u,hidden:m,disabled:d,rows:f,withoutLabel:p,debounceMs:g,minLength:x,maxLength:y,className:h,hint:v}=n,b=t===void 0?l.FloatingLabelInput:t;let w;e[0]!==u||e[1]!==a?(w=()=>{if(!a)return;const z=u??null;a((z==null?void 0:z.toString())??"")},e[0]=u,e[1]=a,e[2]=w):w=e[2];const S=w,j=N.useRef(null);let C;e[3]!==o?(C=(o==null?void 0:o.toString())??"",e[3]=o,e[4]=C):C=e[4];const[I,k]=N.useState(C);let L;e[5]!==a?(L=z=>{const H=z;a&&a(H||null)},e[5]=a,e[6]=L):L=e[6];const E=L;let D;e[7]!==g||e[8]!==E?(D=z=>{var W;const H=(W=z.target)==null?void 0:W.value;if(!g){E(H);return}k(H),j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{E(H)},g)},e[7]=g,e[8]=E,e[9]=D):D=e[9];const _=D;let R,$;e[10]!==o?(R=()=>{k(o===null?"":o.toString())},$=[o],e[10]=o,e[11]=R,e[12]=$):(R=e[11],$=e[12]),N.useEffect(R,$);const A=r??"",T=g?I:o??"",F=f??2;let P;e[13]!==d||e[14]!==_||e[15]!==m||e[16]!==y||e[17]!==x||e[18]!==i||e[19]!==F||e[20]!==T?(P=s.jsx(l.Form.Control,{as:"textarea",size:i,value:T,onChange:_,hidden:m,disabled:d,rows:F,className:"w-100",minLength:x,maxLength:y}),e[13]=d,e[14]=_,e[15]=m,e[16]=y,e[17]=x,e[18]=i,e[19]=F,e[20]=T,e[21]=P):P=e[21];let M;e[22]!==S||e[23]!==d||e[24]!==a||e[25]!==c||e[26]!==o?(M=c&&o&&a&&!d&&s.jsx("div",{className:"luminus-input-remove-icon",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:S,children:s.jsx(l.MdClear,{})})}),e[22]=S,e[23]=d,e[24]=a,e[25]=c,e[26]=o,e[27]=M):M=e[27];let O;return e[28]!==b||e[29]!==h||e[30]!==d||e[31]!==m||e[32]!==v||e[33]!==P||e[34]!==M||e[35]!==A||e[36]!==p?(O=s.jsxs(b,{label:A,hidden:m,withoutLabel:p,className:h,isForTextAreaInput:!0,hint:v,disabled:d,children:[P,M]}),e[28]=b,e[29]=h,e[30]=d,e[31]=m,e[32]=v,e[33]=P,e[34]=M,e[35]=A,e[36]=p,e[37]=O):O=e[37],O},ea=n=>{const e=l.compilerRuntimeExports.c(62),{InputContainer:t,value:o,onChange:a,debounceMs:r,label:i,withoutLabel:c,placeholder:u,size:m,hidden:d,disabled:f,showClearIcon:p,clearValue:g,className:x,step:y,stepperStep:h,min:v,max:b,hint:w}=n,S=t===void 0?l.FloatingLabelInput:t,j=h===void 0?1:h;let C;e[0]!==g||e[1]!==a?(C=()=>{if(!a)return;const se=g??null;a(se?Number(se):null)},e[0]=g,e[1]=a,e[2]=C):C=e[2];const I=C,k=N.useRef(null);let L;e[3]!==o?(L=(o==null?void 0:o.toString())??"",e[3]=o,e[4]=L):L=e[4];const[E,D]=N.useState(L);let _;e[5]!==b||e[6]!==v||e[7]!==a?(_=se=>{const q=se;a&&a(q==null||q===""?null:Ke.limitNumber(Number(q),v,b))},e[5]=b,e[6]=v,e[7]=a,e[8]=_):_=e[8];const R=_;let $;e[9]!==r||e[10]!==R||e[11]!==b||e[12]!==v?($=se=>{var ae;const q=(ae=se.target)==null?void 0:ae.value;if(!r){R(q);return}D(Ke.limitNumber(Number(q),v,b).toString()),k.current!==null&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>{R(q)},r)},e[9]=r,e[10]=R,e[11]=b,e[12]=v,e[13]=$):$=e[13];const A=$;let T,F;e[14]!==b||e[15]!==v||e[16]!==o?(T=()=>{D(o===null?"":Ke.limitNumber(o,v,b).toString())},F=[b,v,o],e[14]=b,e[15]=v,e[16]=o,e[17]=T,e[18]=F):(T=e[17],F=e[18]),N.useEffect(T,F);const P=i??"",M=u??i,O=r?E:o??"",z=`luminus-numeric-stepper ${x??""}`,H=f??!1;let W;e[19]!==A||e[20]!==d||e[21]!==m||e[22]!==y||e[23]!==M||e[24]!==O||e[25]!==z||e[26]!==H?(W=s.jsx(l.Form.Control,{type:"number",placeholder:M,size:m,value:O,onChange:A,className:z,hidden:d,disabled:H,step:y}),e[19]=A,e[20]=d,e[21]=m,e[22]=y,e[23]=M,e[24]=O,e[25]=z,e[26]=H,e[27]=W):W=e[27];let B;e[28]!==f||e[29]!==R||e[30]!==j||e[31]!==o?(B=!f&&s.jsx(l.IconButton,{size:"sm",onClick:se=>{se.preventDefault(),se.stopPropagation(),R(((o??0)-j).toString())},children:s.jsx(l.FaMinus,{})}),e[28]=f,e[29]=R,e[30]=j,e[31]=o,e[32]=B):B=e[32];let U;e[33]!==B?(U=s.jsx("div",{className:"stepper-icon left",children:B}),e[33]=B,e[34]=U):U=e[34];let V;e[35]!==f||e[36]!==R||e[37]!==j||e[38]!==o?(V=!f&&s.jsx(l.IconButton,{size:"sm",onClick:se=>{se.preventDefault(),se.stopPropagation(),R(((o??0)+j).toString())},children:s.jsx(l.FaPlus,{})}),e[35]=f,e[36]=R,e[37]=j,e[38]=o,e[39]=V):V=e[39];let X;e[40]!==V?(X=s.jsx("div",{className:"stepper-icon right",children:V}),e[40]=V,e[41]=X):X=e[41];let Y;e[42]!==I||e[43]!==f||e[44]!==a||e[45]!==p||e[46]!==o?(Y=p&&o&&a&&!f&&s.jsx("div",{className:"luminus-input-remove-icon",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:I,children:s.jsx(l.MdClear,{})})}),e[42]=I,e[43]=f,e[44]=a,e[45]=p,e[46]=o,e[47]=Y):Y=e[47];let Z;e[48]!==W||e[49]!==U||e[50]!==X||e[51]!==Y?(Z=s.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[W,U,X,Y]}),e[48]=W,e[49]=U,e[50]=X,e[51]=Y,e[52]=Z):Z=e[52];let te;return e[53]!==S||e[54]!==x||e[55]!==f||e[56]!==d||e[57]!==w||e[58]!==Z||e[59]!==P||e[60]!==c?(te=s.jsx(S,{withoutLabel:c,label:P,hidden:d,hint:w,className:x,disabled:f,children:Z}),e[53]=S,e[54]=x,e[55]=f,e[56]=d,e[57]=w,e[58]=Z,e[59]=P,e[60]=c,e[61]=te):te=e[61],te};function yo(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(t[o[a]]=n[o[a]]);return t}var Ft;(function(n){n.event="event",n.props="prop"})(Ft||(Ft={}));function ft(){}function ta(n){var e,t=void 0;return function(){for(var o=[],a=arguments.length;a--;)o[a]=arguments[a];return e&&o.length===e.length&&o.every(function(r,i){return r===e[i]})||(e=o,t=n.apply(void 0,o)),t}}function Pt(n){return!!(n||"").match(/\d/)}function kt(n){return n==null}function na(n){return typeof n=="number"&&isNaN(n)}function vo(n){return kt(n)||na(n)||typeof n=="number"&&!isFinite(n)}function bo(n){return n.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function sa(n){switch(n){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function oa(n,e,t){var o=sa(t),a=n.search(/[1-9]/);return a=a===-1?n.length:a,n.substring(0,a)+n.substring(a,n.length).replace(o,"$1"+e)}function la(n){var e=N.useRef(n);e.current=n;var t=N.useRef(function(){for(var o=[],a=arguments.length;a--;)o[a]=arguments[a];return e.current.apply(e,o)});return t.current}function Fn(n,e){e===void 0&&(e=!0);var t=n[0]==="-",o=t&&e;n=n.replace("-","");var a=n.split("."),r=a[0],i=a[1]||"";return{beforeDecimal:r,afterDecimal:i,hasNegation:t,addNegation:o}}function aa(n){if(!n)return n;var e=n[0]==="-";e&&(n=n.substring(1,n.length));var t=n.split("."),o=t[0].replace(/^0+/,"")||"0",a=t[1]||"";return(e?"-":"")+o+(a?"."+a:"")}function jo(n,e,t){for(var o="",a=t?"0":"",r=0;r<=e-1;r++)o+=n[r]||a;return o}function ts(n,e){return Array(e+1).join(n)}function So(n){var e=n+"",t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var o=e.split(/[eE]/g),a=o[0],r=o[1];if(r=Number(r),!r)return t+a;a=a.replace(".","");var i=1+r,c=a.length;return i<0?a="0."+ts("0",Math.abs(i))+a:i>=c?a=a+ts("0",i-c):a=(a.substring(0,i)||"0")+"."+a.substring(i),t+a}function ns(n,e,t){if(["","-"].indexOf(n)!==-1)return n;var o=(n.indexOf(".")!==-1||t)&&e,a=Fn(n),r=a.beforeDecimal,i=a.afterDecimal,c=a.hasNegation,u=parseFloat("0."+(i||"0")),m=i.length<=e?"0."+i:u.toFixed(e),d=m.split("."),f=r;r&&Number(d[0])&&(f=r.split("").reverse().reduce(function(y,h,v){return y.length>v?(Number(y[0])+Number(h)).toString()+y.substring(1,y.length):h+y},d[0]));var p=jo(d[1]||"",e,t),g=c?"-":"",x=o?".":"";return""+g+f+x+p}function St(n,e){if(n.value=n.value,n!==null){if(n.createTextRange){var t=n.createTextRange();return t.move("character",e),t.select(),!0}return n.selectionStart||n.selectionStart===0?(n.focus(),n.setSelectionRange(e,e),!0):(n.focus(),!1)}}var Co=ta(function(n,e){for(var t=0,o=0,a=n.length,r=e.length;n[t]===e[t]&&t<a;)t++;for(;n[a-1-o]===e[r-1-o]&&r-o>t&&a-o>t;)o++;return{from:{start:t,end:a-o},to:{start:t,end:r-o}}}),ra=function(n,e){var t=Math.min(n.selectionStart,e);return{from:{start:t,end:n.selectionEnd},to:{start:t,end:e}}};function ia(n,e,t){return Math.min(Math.max(n,e),t)}function rn(n){return Math.max(n.selectionStart,n.selectionEnd)}function ca(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function da(n){return{from:{start:0,end:0},to:{start:0,end:n.length},lastValue:""}}function ua(n){var e=n.currentValue,t=n.formattedValue,o=n.currentValueIndex,a=n.formattedValueIndex;return e[o]===t[a]}function ma(n,e,t,o,a,r,i){i===void 0&&(i=ua);var c=a.findIndex(function(S){return S}),u=n.slice(0,c);!e&&!t.startsWith(u)&&(e=u,t=u+t,o=o+u.length);for(var m=t.length,d=n.length,f={},p=new Array(m),g=0;g<m;g++){p[g]=-1;for(var x=0,y=d;x<y;x++){var h=i({currentValue:t,lastValue:e,formattedValue:n,currentValueIndex:g,formattedValueIndex:x});if(h&&f[x]!==!0){p[g]=x,f[x]=!0;break}}}for(var v=o;v<m&&(p[v]===-1||!r(t[v]));)v++;var b=v===m||p[v]===-1?d:p[v];for(v=o-1;v>0&&p[v]===-1;)v--;var w=v===-1||p[v]===-1?0:p[v]+1;return w>b?b:o-w<b-o?w:b}function ss(n,e,t,o){var a=n.length;if(e=ia(e,0,a),o==="left"){for(;e>=0&&!t[e];)e--;e===-1&&(e=t.indexOf(!0))}else{for(;e<=a&&!t[e];)e++;e>a&&(e=t.lastIndexOf(!0))}return e===-1&&(e=a),e}function fa(n){for(var e=Array.from({length:n.length+1}).map(function(){return!0}),t=0,o=e.length;t<o;t++)e[t]=!!(Pt(n[t])||Pt(n[t-1]));return e}function wo(n,e,t,o,a,r){r===void 0&&(r=ft);var i=la(function(x,y){var h,v;return vo(x)?(v="",h=""):typeof x=="number"||y?(v=typeof x=="number"?So(x):x,h=o(v)):(v=a(x,void 0),h=o(v)),{formattedValue:h,numAsString:v}}),c=N.useState(function(){return i(kt(n)?e:n,t)}),u=c[0],m=c[1],d=function(x,y){x.formattedValue!==u.formattedValue&&m({formattedValue:x.formattedValue,numAsString:x.value}),r(x,y)},f=n,p=t;kt(n)&&(f=u.numAsString,p=!0);var g=i(f,p);return N.useMemo(function(){m(g)},[g.formattedValue]),[u,d]}function pa(n){return n.replace(/[^0-9]/g,"")}function ha(n){return n}function ga(n){var e=n.type;e===void 0&&(e="text");var t=n.displayType;t===void 0&&(t="input");var o=n.customInput,a=n.renderText,r=n.getInputRef,i=n.format;i===void 0&&(i=ha);var c=n.removeFormatting;c===void 0&&(c=pa);var u=n.defaultValue,m=n.valueIsNumericString,d=n.onValueChange,f=n.isAllowed,p=n.onChange;p===void 0&&(p=ft);var g=n.onKeyDown;g===void 0&&(g=ft);var x=n.onMouseUp;x===void 0&&(x=ft);var y=n.onFocus;y===void 0&&(y=ft);var h=n.onBlur;h===void 0&&(h=ft);var v=n.value,b=n.getCaretBoundary;b===void 0&&(b=fa);var w=n.isValidInputCharacter;w===void 0&&(w=Pt);var S=n.isCharacterSame,j=yo(n,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),C=wo(v,u,!!m,i,c,d),I=C[0],k=I.formattedValue,L=I.numAsString,E=C[1],D=N.useRef(),_=N.useRef({formattedValue:k,numAsString:L}),R=function(Q,K){_.current={formattedValue:Q.formattedValue,numAsString:Q.value},E(Q,K)},$=N.useState(!1),A=$[0],T=$[1],F=N.useRef(null),P=N.useRef({setCaretTimeout:null,focusTimeout:null});N.useEffect(function(){return T(!0),function(){clearTimeout(P.current.setCaretTimeout),clearTimeout(P.current.focusTimeout)}},[]);var M=i,O=function(Q,K){var G=parseFloat(K);return{formattedValue:Q,value:K,floatValue:isNaN(G)?void 0:G}},z=function(Q,K,G){Q.selectionStart===0&&Q.selectionEnd===Q.value.length||(St(Q,K),P.current.setCaretTimeout=setTimeout(function(){Q.value===G&&Q.selectionStart!==K&&St(Q,K)},0))},H=function(Q,K,G){return ss(Q,K,b(Q),G)},W=function(Q,K,G){var oe=b(K),J=ma(K,k,Q,G,oe,w,S);return J=ss(K,J,oe),J},B=function(Q){var K=Q.formattedValue;K===void 0&&(K="");var G=Q.input,oe=Q.source,J=Q.event,ee=Q.numAsString,ne;if(G){var ce=Q.inputValue||G.value,ve=rn(G);G.value=K,ne=W(ce,K,ve),ne!==void 0&&z(G,ne,K)}K!==k&&R(O(K,ee),{event:J,source:oe})};N.useEffect(function(){var Q=_.current,K=Q.formattedValue,G=Q.numAsString;(k!==K||L!==G)&&R(O(k,L),{event:void 0,source:Ft.props})},[k,L]);var U=F.current?rn(F.current):void 0,V=typeof window<"u"?N.useLayoutEffect:N.useEffect;V(function(){var Q=F.current;if(k!==_.current.formattedValue&&Q){var K=W(_.current.formattedValue,k,U);Q.value=k,z(Q,K,k)}},[k]);var X=function(Q,K,G){var oe=K.target,J=D.current?ra(D.current,oe.selectionEnd):Co(k,Q),ee=Object.assign(Object.assign({},J),{lastValue:k}),ne=c(Q,ee),ce=M(ne);if(ne=c(ce,void 0),f&&!f(O(ce,ne))){var ve=K.target,de=rn(ve),be=W(Q,k,de);return ve.value=k,z(ve,be,k),!1}return B({formattedValue:ce,numAsString:ne,inputValue:Q,event:K,source:G,input:K.target}),!0},Y=function(Q,K){K===void 0&&(K=0);var G=Q.selectionStart,oe=Q.selectionEnd;D.current={selectionStart:G,selectionEnd:oe+K}},Z=function(Q){var K=Q.target,G=K.value,oe=X(G,Q,Ft.event);oe&&p(Q),D.current=void 0},te=function(Q){var K=Q.target,G=Q.key,oe=K.selectionStart,J=K.selectionEnd,ee=K.value;ee===void 0&&(ee="");var ne;G==="ArrowLeft"||G==="Backspace"?ne=Math.max(oe-1,0):G==="ArrowRight"?ne=Math.min(oe+1,ee.length):G==="Delete"&&(ne=oe);var ce=0;G==="Delete"&&oe===J&&(ce=1);var ve=G==="ArrowLeft"||G==="ArrowRight";if(ne===void 0||oe!==J&&!ve){g(Q),Y(K,ce);return}var de=ne;if(ve){var be=G==="ArrowLeft"?"left":"right";de=H(ee,ne,be),de!==ne&&Q.preventDefault()}else G==="Delete"&&!w(ee[ne])?de=H(ee,ne,"right"):G==="Backspace"&&!w(ee[ne])&&(de=H(ee,ne,"left"));de!==ne&&z(K,de,ee),g(Q),Y(K,ce)},se=function(Q){var K=Q.target,G=function(){var oe=K.selectionStart,J=K.selectionEnd,ee=K.value;if(ee===void 0&&(ee=""),oe===J){var ne=H(ee,oe);ne!==oe&&z(K,ne,ee)}};G(),requestAnimationFrame(function(){G()}),x(Q),Y(K)},q=function(Q){Q.persist&&Q.persist();var K=Q.target,G=Q.currentTarget;F.current=K,P.current.focusTimeout=setTimeout(function(){var oe=K.selectionStart,J=K.selectionEnd,ee=K.value;ee===void 0&&(ee="");var ne=H(ee,oe);ne!==oe&&!(oe===0&&J===ee.length)&&z(K,ne,ee),y(Object.assign(Object.assign({},Q),{currentTarget:G}))},0)},ae=function(Q){F.current=null,clearTimeout(P.current.focusTimeout),clearTimeout(P.current.setCaretTimeout),h(Q)},re=A&&ca()?"numeric":void 0,me=Object.assign({inputMode:re},j,{type:e,value:k,onChange:Z,onKeyDown:te,onMouseUp:se,onFocus:q,onBlur:ae});if(t==="text")return a?N.createElement(N.Fragment,null,a(k,j)||null):N.createElement("span",Object.assign({},j,{ref:r}),k);if(o){var fe=o;return N.createElement(fe,Object.assign({},me,{ref:r}))}return N.createElement("input",Object.assign({},me,{ref:r}))}function os(n,e){var t=e.decimalScale,o=e.fixedDecimalScale,a=e.prefix;a===void 0&&(a="");var r=e.suffix;r===void 0&&(r="");var i=e.allowNegative,c=e.thousandsGroupStyle;if(c===void 0&&(c="thousand"),n===""||n==="-")return n;var u=tn(e),m=u.thousandSeparator,d=u.decimalSeparator,f=t!==0&&n.indexOf(".")!==-1||t&&o,p=Fn(n,i),g=p.beforeDecimal,x=p.afterDecimal,y=p.addNegation;return t!==void 0&&(x=jo(x,t,!!o)),m&&(g=oa(g,m,c)),a&&(g=a+g),r&&(x=x+r),y&&(g="-"+g),n=g+(f&&d||"")+x,n}function tn(n){var e=n.decimalSeparator;e===void 0&&(e=".");var t=n.thousandSeparator,o=n.allowedDecimalSeparators;return t===!0&&(t=","),o||(o=[e,"."]),{decimalSeparator:e,thousandSeparator:t,allowedDecimalSeparators:o}}function xa(n,e){n===void 0&&(n="");var t=new RegExp("(-)"),o=new RegExp("(-)(.)*(-)"),a=t.test(n),r=o.test(n);return n=n.replace(/-/g,""),a&&!r&&e&&(n="-"+n),n}function ya(n,e){return new RegExp("(^-)|[0-9]|"+bo(n),"g")}function va(n,e,t){return n===""?!0:!(e!=null&&e.match(/\d/))&&!(t!=null&&t.match(/\d/))&&typeof n=="string"&&!isNaN(Number(n))}function ba(n,e,t){var o;e===void 0&&(e=da(n));var a=t.allowNegative,r=t.prefix;r===void 0&&(r="");var i=t.suffix;i===void 0&&(i="");var c=t.decimalScale,u=e.from,m=e.to,d=m.start,f=m.end,p=tn(t),g=p.allowedDecimalSeparators,x=p.decimalSeparator,y=n[f]===x;if(Pt(n)&&(n===r||n===i)&&e.lastValue==="")return n;if(f-d===1&&g.indexOf(n[d])!==-1){var h=c===0?"":x;n=n.substring(0,d)+h+n.substring(d+1,n.length)}var v=function(F,P,M){var O=!1,z=!1;r.startsWith("-")?O=!1:F.startsWith("--")?(O=!1,z=!0):i.startsWith("-")&&F.length===i.length?O=!1:F[0]==="-"&&(O=!0);var H=O?1:0;return z&&(H=2),H&&(F=F.substring(H),P-=H,M-=H),{value:F,start:P,end:M,hasNegation:O}},b=v(n,d,f),w=b.hasNegation;o=b,n=o.value,d=o.start,f=o.end;var S=v(e.lastValue,u.start,u.end),j=S.start,C=S.end,I=S.value,k=n.substring(d,f);n.length&&I.length&&(j>I.length-i.length||C<r.length)&&!(k&&i.startsWith(k))&&(n=I);var L=0;n.startsWith(r)?L+=r.length:d<r.length&&(L=d),n=n.substring(L),f-=L;var E=n.length,D=n.length-i.length;n.endsWith(i)?E=D:(f>D||f>n.length-i.length)&&(E=f),n=n.substring(0,E),n=xa(w?"-"+n:n,a),n=(n.match(ya(x))||[]).join("");var _=n.indexOf(x);n=n.replace(new RegExp(bo(x),"g"),function(F,P){return P===_?".":""});var R=Fn(n,a),$=R.beforeDecimal,A=R.afterDecimal,T=R.addNegation;return m.end-m.start<u.end-u.start&&$===""&&y&&!parseFloat(A)&&(n=T?"-":""),n}function ja(n,e){var t=e.prefix;t===void 0&&(t="");var o=e.suffix;o===void 0&&(o="");var a=Array.from({length:n.length+1}).map(function(){return!0}),r=n[0]==="-";a.fill(!1,0,t.length+(r?1:0));var i=n.length;return a.fill(!1,i-o.length+1,i+1),a}function Sa(n){var e=tn(n),t=e.thousandSeparator,o=e.decimalSeparator,a=n.prefix;a===void 0&&(a="");var r=n.allowNegative;if(r===void 0&&(r=!0),t===o)throw new Error(`
|
|
2
2
|
Decimal separator can't be same as thousand separator.
|
|
3
|
-
thousandSeparator: `+
|
|
4
|
-
decimalSeparator: `+
|
|
5
|
-
`);return
|
|
3
|
+
thousandSeparator: `+t+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
4
|
+
decimalSeparator: `+o+` (default value for decimalSeparator is .)
|
|
5
|
+
`);return a.startsWith("-")&&r&&(console.error(`
|
|
6
6
|
Prefix can't start with '-' when allowNegative is true.
|
|
7
|
-
prefix: `+
|
|
8
|
-
allowNegative: `+
|
|
9
|
-
`),l=!1),Object.assign(Object.assign({},e),{allowNegative:l})}function Kr(e){e=qr(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var n=e.suffix,a=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Ae);var l=e.onBlur;l===void 0&&(l=Ae);var i=e.thousandSeparator,d=e.decimalScale,u=e.fixedDecimalScale,m=e.prefix;m===void 0&&(m="");var p=e.defaultValue,f=e.value,x=e.valueIsNumericString,h=e.onValueChange,g=qs(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=Tt(e),v=b.decimalSeparator,j=b.allowedDecimalSeparators,N=function(A){return On(A,e)},S=function(A,O){return Gr(A,O,e)},C=Ke(f)?p:f,y=x??Wr(C,m,n);Ke(f)?Ke(p)||(y=y||typeof p=="number"):y=y||typeof f=="number";var k=function(A){return Ks(A)?A:(typeof A=="number"&&(A=Xs(A)),y&&typeof d=="number"?Mn(A,d,!!u):A)},w=ea(k(f),k(p),!!y,N,S,h),I=w[0],E=I.numAsString,D=I.formattedValue,M=w[1],F=function(A){var O=A.target,z=A.key,B=O.selectionStart,T=O.selectionEnd,R=O.value;if(R===void 0&&(R=""),(z==="Backspace"||z==="Delete")&&T<m.length){A.preventDefault();return}if(B!==T){o(A);return}z==="Backspace"&&R[0]==="-"&&B===m.length+1&&a&&Ve(O,1),d&&u&&(z==="Backspace"&&R[B-1]===v?(Ve(O,B-1),A.preventDefault()):z==="Delete"&&R[B]===v&&A.preventDefault()),j!=null&&j.includes(z)&&R[B]===v&&Ve(O,B+1);var U=i===!0?",":i;z==="Backspace"&&R[B-1]===U&&Ve(O,B-1),z==="Delete"&&R[B]===U&&Ve(O,B+1),o(A)},_=function(A){var O=E;if(O.match(/\d/g)||(O=""),r||(O=Er(O)),u&&d&&(O=Mn(O,d,u)),O!==E){var z=On(O,e);M({formattedValue:z,value:O,floatValue:parseFloat(O)},{event:A,source:ct.event})}l(A)},L=function(A){return A===v?!0:dt(A)},W=function(A){var O=A.currentValue,z=A.lastValue,B=A.formattedValue,T=A.currentValueIndex,R=A.formattedValueIndex,U=O[T],q=B[R],K=Js(z,O),pe=K.to,P=function(X){return S(X).indexOf(".")+m.length};return f===0&&u&&d&&O[pe.start]===v&&P(O)<T&&P(B)>R?!1:T>=pe.start&&T<pe.end&&j&&j.includes(U)&&q===v?!0:U===q};return Object.assign(Object.assign({},g),{value:D,valueIsNumericString:!1,isValidInputCharacter:L,isCharacterSame:W,onValueChange:M,format:N,removeFormatting:S,getCaretBoundary:function(A){return Yr(A,e)},onKeyDown:F,onBlur:_})}function dn(e){var n=Kr(e);return c.createElement(Hr,Object.assign({},n))}const ta=({InputContainer:e=s.FloatingLabelInput,value:n,onChange:a,debounceMs:r,label:o,withoutLabel:l,placeholder:i,size:d,hidden:u,disabled:m,showClearIcon:p,clearValue:f,className:x,step:h,noSelectOnFocus:g,decimalScale:b,fixedDecimalScale:v=!1,numberPrefix:j,numberSuffix:N,min:S,max:C,hint:y})=>{const k=c.useCallback(()=>{if(!a)return;const F=f??null;a(F?Number(F):null)},[f,a]),w=c.useRef(null),[I,E]=c.useState((n==null?void 0:n.toString())??""),D=c.useCallback(F=>{const _=F;a&&a(_==null||_===""?null:Number(_))},[a]),M=c.useCallback(F=>{var L,W;let _=parseFloat(((W=(L=F.target)==null?void 0:L.value)==null?void 0:W.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(_)&&(_=0),!r){D(_.toString());return}E(_.toString()),w.current!==null&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{D(_.toString())},r)},[r,D]);return c.useEffect(()=>{E(n===null?"":n.toString())},[C,S,n]),c.useEffect(()=>{C!==void 0&&Number(I)>C&&E(C.toString()),S!==void 0&&Number(I)<S&&E(S.toString())},[I,C,S,E]),c.useEffect(()=>{!a||n===null||(C!==void 0&&n>C&&a(C),S!==void 0&&n<S&&a(S))},[n,C,S,a]),t.jsxs(e,{withoutLabel:l,label:o??"",hidden:u,className:x,hint:y,disabled:m,children:[t.jsx(dn,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:b,fixedDecimalScale:v,prefix:j,suffix:N,defaultValue:"",value:r?I:(n==null?void 0:n.toString())??"",placeholder:i??o,onFocus:F=>{!g&&F.target.select()},onChange:M,hidden:u,disabled:m,className:s.classNames("form-control text-end w-100",{[`form-control-${d}`]:d}),step:h,min:S,max:C}),p&&n!==null&&a&&!m&&t.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:k,children:t.jsx(s.MdClear,{})})})]})},na=({InputContainer:e=s.RowLabelInput,label:n,options:a,disabled:r,hidden:o,className:l,value:i,onChange:d})=>{const u=c.useCallback(m=>{d&&d(m.target.value)},[d]);return t.jsx(e,{isForRadioInput:!0,hidden:o,withoutLabel:!n,label:`${n}`,className:l,disabled:r,children:a.map(m=>t.jsx(s.Form.Check,{id:`radio-${m.id}`,label:m.name,type:"radio",value:m.id??"",checked:i===m.id,onChange:u,hidden:o,disabled:r,className:"w-100"},m.id))})},Qr=({InputContainer:e=s.RowLabelInput,formField:n,label:a,resetsFields:r,type:o,required:l,hidden:i,disabled:d,withoutLabel:u,hint:m,onChange:p,className:f})=>{const{register:x,formState:{errors:h,isSubmitted:g},setValue:b}=oe.useFormContext(),v=s.useFormDisabledContext({falseIfNotInit:!0}),[j,N]=c.useState(void 0),[S,C]=c.useState(!1);c.useEffect(()=>{const w=n.split(".");let I=h;w.forEach(E=>{I!==void 0&&(I=I[E])}),N(I)},[h,n]);const y=c.useMemo(()=>d||v,[d,v]),k=j!==void 0;return c.useEffect(()=>{g&&C(!0)},[g]),t.jsxs(e,{isForCheckInput:!0,hidden:i,label:a??"",required:l,disabled:y,isInvalid:k,withoutLabel:u,hint:m,className:f,children:[t.jsx(s.Form.Check,{id:`check-${n}`,type:o??"checkbox",label:`${a}${l?" *":""}`,...x(n,{onChange:w=>{r&&r.forEach(I=>b(I,null,{shouldDirty:!0,shouldValidate:S})),p&&p(w.target.value??null)}}),isInvalid:k,hidden:i,disabled:y,className:"w-100"}),j&&t.jsx(s.InvalidFeedback,{message:j.message})]})},Zr=({InputContainer:e=s.RowLabelInput,label:n,formField:a,options:r,resetsFields:o,required:l,disabled:i,hidden:d,onChange:u,className:m})=>{const{register:p,formState:{errors:f,isSubmitted:x},setValue:h}=oe.useFormContext(),g=s.useFormDisabledContext({falseIfNotInit:!0}),[b,v]=c.useState(void 0),[j,N]=c.useState(!1),S=c.useMemo(()=>r,[r]),C=c.useMemo(()=>i||g,[i,g]);c.useEffect(()=>{const w=a.split(".");let I=f;w.forEach(E=>{I!==void 0&&(I=I[E])}),v(I)},[f,a]),c.useEffect(()=>{x&&N(!0)},[x]);const y=b!==void 0,k=oe.useWatch({name:a});return t.jsxs(e,{isForRadioInput:!0,hidden:d,withoutLabel:!n,label:n??"",required:l,disabled:C,isInvalid:y,className:m,children:[S.map(w=>t.jsx(s.Form.Check,{id:`radio-${w.id}`,label:w.name,type:"radio",value:w.id??"",checked:k===w.id,...p(a,{onChange:I=>{var E;o&&o.forEach(D=>h(D,null,{shouldDirty:!0,shouldValidate:j})),u&&u((E=I.target)!=null&&E.value?I.target.value.toString():null)}}),isInvalid:y,hidden:d,disabled:C,className:"w-100"},w.id)),b&&t.jsx(s.InvalidFeedback,{message:b.message})]})},Xr=({label:e,InputContainer:n=s.RowLabelInput,className:a,withoutLabel:r,hidden:o,disabled:l,contactType:i,formField:d,...u})=>{const m=oe.useWatch({name:d}),p=s.useFormDisabledContext({falseIfNotInit:!0}),f=c.useMemo(()=>l||p,[l,p]);return o?null:t.jsx(Ys,{contactType:i,value:m,withoutLabel:r,label:e,className:a,children:t.jsx(s.HookFormTextInput,{type:"text",formField:d,InputContainer:n,size:"sm",withoutLabel:!0,className:"flex-grow-1",disabled:f,...u})})},Jr=({InputContainer:e=s.RowLabelInput,formField:n,label:a,size:r,defaultSelection:o,resetsFields:l,isNumber:i,required:d,hidden:u,disabled:m,items:p,onSearchQueryChange:f,selectedItemNavigateTo:x,texts:h,dropdownItemsNameWidth:g,isLoading:b,withoutLabel:v,additionalColumns:j,CustomOnChangeComponent:N,icon:S,displayIdAsName:C,onSelect:y,className:k,archiveColumn:w,hint:I,addNewOptionPath:E,refreshOptions:D,MiniDetailComponent:M,miniDetailPlacement:F,suggestedItems:_,suggestedItemsTitle:L})=>{const{formState:{errors:W,isSubmitted:A},setValue:O,control:z}=oe.useFormContext(),B=s.useFormDisabledContext({falseIfNotInit:!0}),[T,R]=c.useState(void 0),[U,q]=c.useState(!1),[K,pe]=c.useState(!1),P=oe.useWatch({name:n})??null,X=oe.useWatch({name:`${n}-DropdownName`}),ie=P===(o==null?void 0:o.id)?o==null?void 0:o.name:X,he=c.useMemo(()=>P==null?null:{id:P??null,name:ie??""},[P,ie]),ne=c.useCallback(()=>{const $=n.split(".");let Q=W;$.forEach(ce=>{Q!==void 0&&(Q=Q[ce])}),R(Q)},[W,n]),be=c.useCallback($=>{if(($==null?void 0:$.id)===P)return;if(y&&y($),l&&l.forEach(ce=>O(ce,null,{shouldDirty:!0,shouldValidate:K})),$===null){O(n,null,{shouldDirty:!0,shouldValidate:K}),O(`${n}-DropdownName`,null);return}let Q=null;i?Q=($==null?void 0:$.id)!==null&&($==null?void 0:$.id)!==""?parseInt($.id.toString(),10):null:Q=$.id===null||$.id===void 0||$.id===""?null:$.id,O(n,Q,{shouldDirty:!0,shouldValidate:K}),O(`${n}-DropdownName`,$.name??"")},[O,n,K,i,l,P,y]),G=c.useCallback($=>{q(!1),be($)},[be]),se=c.useCallback(()=>{q(!1)},[]),je=c.useRef(null),Ee=T!==void 0,Te=x!==void 0,H=Te&&he!==null,V=c.useMemo(()=>m||B,[m,B]);return c.useEffect(()=>{ne()},[ne]),c.useEffect(()=>{A&&pe(!0)},[A]),t.jsx(t.Fragment,{children:t.jsxs(e,{label:a??"",required:d,disabled:V,hidden:u,withoutLabel:v,isInvalid:Ee,inputContainerClassName:s.classNames({"luminus-dropdown-select-open":U}),hint:I,className:k,children:[t.jsxs(s.InputAnchorContainer,{currentSelection:he,selectedItemNavigateTo:x,children:[C&&(he==null?void 0:he.name)&&t.jsx(s.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:he.name}),t.jsx(oe.Controller,{control:z,name:n,render:()=>t.jsx(s.MiniDetailWrapper,{value:P,MiniDetailComponent:M,miniDetailPlacement:F,children:t.jsx(s.Form.Select,{size:r,onMouseDown:$=>{$.currentTarget.focus(),$.preventDefault()},onClick:()=>{!Te&&!V&&q(!0)},ref:je,value:P??"",onChange:()=>{},isInvalid:Ee,hidden:u,className:s.classNames("w-100",{"luminus-dropdown-picker-disabled":V,"luminus-dropdown-picker-link":H}),children:t.jsx("option",{value:P,children:C?P:(ie==null?void 0:ie.length)>0?ie:P})})})}),N||!V&&Te?t.jsxs("div",{className:"custom-picker-button",children:[!N&&!V&&Te&&t.jsx(s.IconButton,{size:"sm",color:"secondary",onClick:$=>{$.preventDefault(),$.stopPropagation(),q(!0)},children:S??t.jsx(s.MdOutlineEdit,{})}),N??null]}):null]}),T&&t.jsx(s.InvalidFeedback,{message:T.message}),je.current&&t.jsx(s.SimplePicker,{show:U,onCancel:se,items:p,currentSelection:he,onSelectionChange:G,onSearchQueryChange:f,texts:h,itemsNameWidth:g,additionalColumns:j,displayIdAsName:C,isLoading:b,disabled:V,inputRef:je,archiveColumn:w,addNewOptionPath:E,refreshOptions:D,suggestedItems:_,suggestedItemsTitle:L})]})})},eo=({InputContainer:e=s.RowLabelInput,label:n,formField:a,hidden:r,required:o,placeholder:l,disabled:i,showClearIcon:d,resetsFields:u,multiple:m,accept:p,withoutLabel:f,hint:x,className:h})=>{const{setValue:g,register:b,formState:{errors:v,isSubmitted:j}}=oe.useFormContext(),N=s.useFormDisabledContext({falseIfNotInit:!0}),[S,C]=c.useState(!1),[y,k]=c.useState(void 0),w=c.useCallback(()=>{g(a,"")},[g,a]),I=c.useCallback(()=>{const F=a.split(".");let _=v;F.forEach(L=>{_!==void 0&&(_=_[L])}),k(_)},[v,a]);c.useEffect(I,[I]),c.useEffect(()=>{j&&C(!0)},[j]);const E=c.useMemo(()=>i||N,[i,N]),D=y!==void 0,M=oe.useWatch({name:a});return t.jsxs(e,{label:n??"",required:o,disabled:E,hidden:r,withoutLabel:f,isInvalid:D,hint:x,className:h,children:[t.jsx(s.FormControl,{type:"file",multiple:m,accept:p.join(", "),placeholder:l??n,isInvalid:D,hidden:r,disabled:E,className:"w-100",...b(a,{onChange:()=>{u&&u.forEach(F=>g(F,null,{shouldDirty:!0,shouldValidate:S}))}})}),d&&M!=null&&t.jsx("div",{className:"luminus-input-remove-icon",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:w,children:t.jsx(s.MdClear,{})})}),y&&t.jsx(s.InvalidFeedback,{message:y.message})]})},sa=({children:e,onStorno:n,noSpacer:a})=>{const{isDirty:r}=oe.useFormState(),o=s.useFormDisabledContext({falseIfNotInit:!0});return r?t.jsx(Hs,{onStorno:n,noSpacer:a,disabled:o,children:e}):null},It=({InputContainer:e=s.RowLabelInput,options:n,formField:a,label:r,size:o,resetsFields:l,isNumber:i,required:d,hidden:u,disabled:m,withoutLabel:p,noSortOptions:f,suffixIdToName:x,onSelect:h,className:g,appendCurrentSelectionWithName:b,hint:v,addNewOptionPath:j,refreshOptions:N,MiniDetailComponent:S,miniDetailPlacement:C,selectedItemNavigateTo:y,noRemoveButton:k})=>{const{texts:{customSelect:w}}=c.useContext(s.LuminusComponentsContext),{formState:{errors:I,isSubmitted:E},setValue:D,control:M}=oe.useFormContext(),F=s.useFormDisabledContext({falseIfNotInit:!0}),[_,L]=c.useState(void 0),[W,A]=c.useState(!1),[O,z]=c.useState(!1),[B,T]=c.useState(""),R=oe.useWatch({name:a}),U=c.useMemo(()=>n.find(G=>G.id===R)??null,[n,R]),q=c.useCallback(()=>{const G=a.split(".");let se=I;G.forEach(je=>{se!==void 0&&(se=se[je])}),L(se)},[I,a]),K=c.useCallback(G=>{if((G==null?void 0:G.id)===R)return;if(h&&h(G),l&&l.forEach(je=>D(je,null,{shouldDirty:!0,shouldValidate:O})),G===null){D(a,null,{shouldDirty:!0,shouldValidate:O});return}let se=null;i?se=(G==null?void 0:G.id)!==null&&(G==null?void 0:G.id)!==""?parseInt(G.id.toString(),10):null:se=G.id===null||G.id===void 0||G.id===""?null:G.id,D(a,se,{shouldDirty:!0,shouldValidate:O})},[D,a,i,l,R,O,h]),pe=c.useCallback(G=>{A(!1),K(G)},[K]),P=c.useCallback(G=>{T(G)},[]),X=c.useMemo(()=>m||F,[m,F]);c.useEffect(()=>{q()},[q]),c.useEffect(()=>{E&&z(!0)},[E]);const ie=c.useCallback(G=>{var se;return G===null?"":!G.name||G.name.length===0?((se=G.id)==null?void 0:se.toString())??"":x?`${G.name} (${G.id})`:G.name},[x]),he=c.useMemo(()=>{const G=n?[...n]:[];return b!==void 0&&R&&(G.some(se=>se.id===R)||G.push({id:R,name:b})),G.map(se=>({id:se.id,name:ie(se)})).filter(se=>s.stringSearchWithin(se.name,B)).sort((se,je)=>f?0:(se.name??"").localeCompare(je.name??""))},[n,f,B,ie,b,R]),ne=c.useRef(null),be=_!==void 0;return t.jsx(t.Fragment,{children:t.jsxs(e,{label:r??"",required:d,disabled:X,hidden:u,withoutLabel:p,isInvalid:be,inputContainerClassName:s.classNames({"luminus-dropdown-select-open":W}),hint:v,className:g,children:[t.jsx(s.InputAnchorContainer,{currentSelection:U,selectedItemNavigateTo:y,children:t.jsx(oe.Controller,{control:M,name:a,render:()=>t.jsx(s.MiniDetailWrapper,{value:R,MiniDetailComponent:S,miniDetailPlacement:C,children:t.jsx(s.Form.Select,{size:o,onMouseDown:G=>{G.currentTarget.focus(),G.preventDefault()},onClick:()=>{A(!0)},ref:ne,value:R??"",onChange:()=>{},isInvalid:be,hidden:u,disabled:X,className:"w-100",children:t.jsx("option",{value:(U==null?void 0:U.id)??"",children:ie(U)})})})})}),_&&t.jsx(s.InvalidFeedback,{message:_.message}),ne.current&&t.jsx(s.SimplePicker,{show:W,onCancel:()=>A(!1),items:he,currentSelection:U??null,onSelectionChange:pe,onSearchQueryChange:P,texts:w,disabled:X,inputRef:ne,autoHideSearch:!0,allItemsLength:n.length,addNewOptionPath:j,refreshOptions:N,noRemoveButton:k})]})})},to=({InputContainer:e=s.RowLabelInput,formField:n,label:a,placeholder:r,size:o,resetsFields:l,showClearIcon:i,clearValue:d,required:u,hidden:m,disabled:p,withoutLabel:f,step:x,stepperStep:h=1,className:g,min:b,max:v,onChange:j,hint:N})=>{const{register:S,formState:{errors:C,isSubmitted:y},setValue:k}=oe.useFormContext(),w=s.useFormDisabledContext({falseIfNotInit:!0}),[I,E]=c.useState(void 0),[D,M]=c.useState(!1),F=c.useCallback((z,B,T)=>{k(z,ye.limitNumber(B,b,v),T)},[v,b,k]),_=c.useCallback(()=>{const z=d??null;F(n,z!==null?Number(z):null,{shouldDirty:!0,shouldValidate:D})},[d,F,n,D]),L=c.useCallback(()=>{const z=n.split(".");let B=C;z.forEach(T=>{B!==void 0&&(B=B[T])}),E(B)},[C,n]),W=c.useMemo(()=>p||w,[p,w]);c.useEffect(()=>{L()},[L]),c.useEffect(()=>{y&&M(!0)},[y]);const A=I!==void 0,O=oe.useWatch({name:n});return t.jsxs(e,{label:a??"",required:u,disabled:W,hidden:m,withoutLabel:f,isInvalid:A,hint:N,className:g,children:[t.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsx(s.Form.Control,{type:"number",placeholder:r??a,size:o,...S(n,{setValueAs:z=>z==null||z===""?null:ye.limitNumber(Number(z),b,v),min:b,max:v,onChange:z=>{var B;l&&l.forEach(T=>k(T,null,{shouldDirty:!0,shouldValidate:D})),j&&j((B=z.target)!=null&&B.value?Number(z.target.value)??null:null)}}),isInvalid:A,hidden:m,disabled:W,className:"w-100 luminus-numeric-stepper",step:x,min:b,max:v}),t.jsx("div",{className:"stepper-icon left",children:!p&&t.jsx(s.IconButton,{size:"sm",onClick:z=>{z.preventDefault(),z.stopPropagation(),F(n,((O?Number(O):0)-h).toString(),{shouldDirty:!0,shouldValidate:D})},children:t.jsx(s.FaMinus,{})})}),t.jsx("div",{className:"stepper-icon right",children:!p&&t.jsx(s.IconButton,{size:"sm",onClick:z=>{z.preventDefault(),z.stopPropagation(),F(n,((O?Number(O):0)+h).toString(),{shouldDirty:!0,shouldValidate:D})},children:t.jsx(s.FaPlus,{})})})]}),i&&O!=null&&t.jsx("div",{className:"luminus-input-remove-icon",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:_,children:t.jsx(s.MdClear,{})})}),I&&t.jsx(s.InvalidFeedback,{message:I.message})]})},no=({InputContainer:e=s.RowLabelInput,formField:n,label:a,placeholder:r,resetsFields:o,showClearIcon:l,clearValue:i,required:d,hidden:u,disabled:m,withoutLabel:p,step:f,size:x,CustomOnChangeComponent:h,noSelectOnFocus:g,className:b,decimalScale:v=2,fixedDecimalScale:j=!1,numberPrefix:N,numberSuffix:S,min:C,max:y,onChange:k,hint:w})=>{const{formState:{errors:I,isSubmitted:E},setValue:D,control:M}=oe.useFormContext(),F=s.useFormDisabledContext({falseIfNotInit:!0}),[_,L]=c.useState(void 0),[W,A]=c.useState(!1),O=c.useCallback(()=>{const U=i??null;D(n,U!==null?Number(U):null,{shouldDirty:!0,shouldValidate:W})},[i,D,n,W]),z=c.useCallback(()=>{const U=n.split(".");let q=I;U.forEach(K=>{q!==void 0&&(q=q[K])}),L(q)},[I,n]),B=c.useMemo(()=>m||F,[m,F]);c.useEffect(()=>{z()},[z]),c.useEffect(()=>{E&&A(!0)},[E]);const T=oe.useWatch({name:n});c.useEffect(()=>{y!==void 0&&T>y&&D(n,y),C!==void 0&&T<C&&D(n,C)},[n,T,y,C,D]);const R=_!==void 0;return t.jsxs(e,{label:a??"",required:d,disabled:B,hidden:u,withoutLabel:p,isInvalid:R,hint:w,className:b,children:[t.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[t.jsx(oe.Controller,{control:M,name:n,render:({field:{ref:U,onChange:q,name:K,value:pe}})=>t.jsx(dn,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:v,fixedDecimalScale:j,prefix:N,suffix:S,defaultValue:"",name:K,value:pe??"",placeholder:r??a,onFocus:P=>{!g&&P.target.select()},onChange:P=>{var he,ne;const X=parseFloat(((ne=(he=P.target)==null?void 0:he.value)==null?void 0:ne.replaceAll(" ","").replaceAll(",","."))??0);o&&o.forEach(be=>D(be,null,{shouldDirty:!0,shouldValidate:W}));const ie=X==null||Number.isNaN(X)?null:Number(X);q(ie),k&&k(ie)},hidden:u,disabled:B,className:s.classNames("form-control text-end w-100",{"is-invalid":R},{[`form-control-${x}`]:x}),step:f,getInputRef:U,min:C,max:y})}),h&&t.jsx("div",{className:"custom-picker-button",children:h})]}),l&&T!=null&&t.jsx("div",{className:"luminus-input-remove-icon inset",children:t.jsx(s.IconButton,{color:"secondary",size:"sm",onClick:O,children:t.jsx(s.MdClear,{})})}),_&&t.jsx(s.InvalidFeedback,{message:_.message})]})},so=({ref:e,userName:n,onClick:a,children:r})=>t.jsxs("button",{type:"button",ref:e,onClick:o=>{o.preventDefault(),a(o)},"aria-label":"User avatar toggle",className:"m-0 p-0",style:{backgroundColor:"transparent",border:"none",cursor:"pointer"},children:[t.jsx(Dt,{name:n}),r]}),ao=({color:e="primary",icon:n=t.jsx(s.MdOutlineFileUpload,{size:12}),inputId:a="context-file-input",accept:r="*",onUpload:o,multiple:l,className:i,children:d,...u})=>{const m=p=>{p.target.files&&(o(p.target.files),p.target.value="")};return t.jsxs(t.Fragment,{children:[t.jsxs("label",{htmlFor:a,className:s.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${i??""}`,s.classes$1.item),...u,children:[n,d]}),t.jsx("input",{id:a,type:"file",accept:r,onChange:m,hidden:!0,multiple:l})]})},un=["slice","options","formats","conditions"],An=e=>{const n=e.current.flexmonster.getReport({withDefaults:!0});if(typeof n=="string")throw alert("report is string"),new Error("report is string");const a={};return un.forEach(r=>{a[r]=n[r]}),JSON.stringify(a)},ro=e=>{if(e.settings){const n=JSON.parse(e.settings);return un.forEach(a=>{n[a]===void 0&&(n[a]=null)}),n}return{}},oo=e=>{const n={};return un.forEach(a=>{n[a]=(e==null?void 0:e[a])??void 0}),n},io=e=>e&&e.type==="header"&&e.member&&e.member.caption!=="All"&&e.label==="",Rn=(e,n)=>e.hierarchy&&e.hierarchy.uniqueName===n,Pn=e=>!e.member&&!e.isDrillThrough,Bn=(e,n)=>typeof e=="function"?e(n):e.replace(":id",n),aa=({dataSource:e,settings:n,pivotRef:a,localization:r,licenseKey:o,hyperlinkColumn:l,roomPasportization:i,enabled:d=!0})=>{const{texts:{reports:u}}=c.useContext(s.LuminusComponentsContext),[m,p]=c.useState(!1),f=c.useRef(null),x=a??f,h=c.useMemo(()=>({localization:r}),[r]),g=c.useCallback(C=>{delete C[0],delete C[1],delete C[2];const y=[{id:"fm-tab-expand",title:u.expandAll,handler:x.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:u.collapseAll,handler:x.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return C.unshift({id:"fm-tab-expand",title:u.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:y,rightGroup:!0}),C},[x,u.collapseAll,u.expand,u.expandAll]),b=C=>{const y=C.getTabs();C.getTabs=()=>g(y)},v=c.useMemo(()=>e&&e.mapping?Object.values(e.mapping).filter(C=>C.caption.includes("P:")).map(C=>({uniqueName:C.caption.replace("P:",""),caption:C.caption})):[],[e]),j=c.useMemo(()=>{var y,k,w,I;const C=(y=x.current)==null?void 0:y.flexmonster.getReport();return C&&C.slice?{...C.slice,rows:[...((k=C.slice.rows)==null?void 0:k.filter(E=>{var D;return!((D=E.caption)!=null&&D.includes("P:"))}))??[],...v],columns:[...((w=C.slice.columns)==null?void 0:w.filter(E=>{var D;return!((D=E.caption)!=null&&D.includes("P:"))}))??[],...v],measures:[...((I=C.slice.measures)==null?void 0:I.filter(E=>{var D;return!((D=E.caption)!=null&&D.includes("P:"))}))??[],...v]}:null},[v,x]);c.useEffect(()=>{var C,y,k,w;if(m&&d){if(i&&j){const I=(C=x.current)==null?void 0:C.flexmonster.getReport(),E=I&&I.options?{...I.options,grid:{...(y=I.options)==null?void 0:y.grid,autoSwitchToCompact:!1}}:{};(k=x.current)==null||k.flexmonster.setReport({...I,dataSource:e,slice:j,options:E})}else(w=x.current)==null||w.flexmonster.updateData(e);console.log("Updating flexmonster dataSource to: ",e)}},[e,d,m,v,x,i,j]),c.useEffect(()=>{var C,y,k,w,I;if(m&&d){const E=(C=x.current)==null?void 0:C.flexmonster.getReport();if(E===void 0||typeof E=="string")return;const D=oo(n);D.options={...n==null?void 0:n.options,grid:{...(y=n==null?void 0:n.options)==null?void 0:y.grid,autoSwitchToCompact:!1},showFieldListSearch:!0,datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm:ss"},i&&(D.slice={...n==null?void 0:n.slice,rows:[...((w=(k=n==null?void 0:n.slice)==null?void 0:k.rows)==null?void 0:w.filter(F=>{var _;return!((_=F.caption)!=null&&_.includes("P:"))}))??[],...v]});const M={...E,...D};(I=x.current)==null||I.flexmonster.setReport(M),console.log("Refreshing flexmonster settings. New report: ",M)}},[d,m,v,x,i,n]);const N=c.useCallback((C,y)=>{var F,_;if(io(y)){C.text=((F=y.member)==null?void 0:F.caption)??"";const L=C.style["padding-left"]??"4px",W=parseInt(L,10);C.style["padding-left"]=W+11+"px"}if(!l||!Rn(y,l.idColumn)||Pn(y))return;const k=(_=y.escapedLabel)==null?void 0:_.toString();if(k===void 0)return;const w=Bn(l.url,k),I="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",E=y.type==="header"?"onclick='event.stopImmediatePropagation()'":"",D=y.isDrillThrough||y.type==="header"?`href='${w}' target='_blank'`:"";C.style&&(C.style["z-index"]=1);const M=`<a ${D} ${I} ${E}>${y.escapedLabel}</a>`;C.text=M},[l]),S=c.useCallback(C=>{if(!l||!Rn(C,l.idColumn)||Pn(C))return;const y=Bn(l.url,C.escapedLabel??"");window.open(y??"","_blank","noreferrer")},[l]);return t.jsx(t.Fragment,{children:t.jsx(Pa.Pivot,{ref:x,global:h,licenseKey:o,toolbar:!0,height:"100%",beforetoolbarcreated:b,ready:()=>{p(!0)},width:"100%",customizeCell:N,cellclick:S})})},lo=(e,n,a,r)=>{const{texts:{reports:o}}=c.useContext(s.LuminusComponentsContext),{prompt:l}=s.usePrompt(),{confirm:i}=s.useConfirm(),d=s.useAxios(),{user:u}=c.useContext(s.UserContext),{startLoading:m,stopLoading:p}=c.useContext(s.LoadingContext),{addNotification:f}=s.useNotifications(),x=c.useCallback(async j=>{m("report-versionSavingAs");try{const N=await d.post("/reports/version",j);f(o.saveSuccessful,"success"),await r(N.data)}finally{p("report-versionSavingAs")}},[f,r,d,o.saveSuccessful,m,p]),h=c.useCallback(async()=>{if(a===null){f("none open","warning");return}if(!await i(o.confirmOverwriteSave))return;const N=An(n);x({reportSourceName:e,reportVersionId:a,settings:N})},[f,i,n,e,o.confirmOverwriteSave,x,a]),g=c.useCallback(async()=>{const j=await l(o.enterName,{input:"input",required:!0});if(j===null)return;const N=An(n);x({reportSourceName:e,name:j,settings:N})},[n,l,e,o.enterName,x]),b=c.useCallback(async()=>{m("report-versionSavingAs");try{await d.post("/reports/version",{reportVersionId:a??void 0,reportSourceName:e,isArchived:!0}),f(o.deleteSuccessful,"success")}finally{p("report-versionSavingAs")}},[f,d,e,o.deleteSuccessful,a,m,p]),v=c.useCallback(async()=>{m("report-versionSavingAs");try{await d.post("/reports/version-restrictions",{reportVersionId:a??void 0,userRestricts:[{employeeId:u.personalNumber,addRights:!1}]}),f(o.detachSuccessful,"success")}finally{p("report-versionSavingAs")}},[f,d,o.detachSuccessful,a,m,p,u.personalNumber]);return{saveAs:g,save:h,archive:b,detach:v}},co=e=>{const n=s.useAxios(),{startLoading:a,stopLoading:r}=c.useContext(s.LoadingContext);return{changeEmployeeRights:c.useCallback(async(l,i)=>{let d=null;a("reportSharing-addPerson");try{d=(await n.post("/reports/version-restrictions",{reportVersionId:e,userRestricts:[{employeeId:l,addRights:i}]})).data}finally{r("reportSharing-addPerson")}return d},[n,e,a,r])}},uo=({isOpen:e,onHide:n,usersData:a,reportVersionId:r,EmployeePicker:o,setReportVersion:l})=>{const{ProjectIconComponent:i,texts:{reports:d}}=c.useContext(s.LuminusComponentsContext),{confirm:u}=s.useConfirm(),[m,p]=c.useState(null),{changeEmployeeRights:f}=co(r),x=c.useCallback(b=>{l(v=>v===null?null:{...v,users:b.filter(j=>j.isReportOwner===!1)})},[l]),h=c.useCallback(async()=>{if(m===null)return;const b=await f(m.id,!0);x(b),p(null)},[m,f,x]),g=c.useCallback(async b=>{if(!await u(d.removeSharingWith(b)))return;const j=await f(b,!1);x(j)},[f,u,d,x]);return t.jsxs(s.Modal,{show:e,onHide:n,children:[t.jsx(s.Modal.Header,{closeButton:!0,children:t.jsx(s.Modal.Title,{children:d.reportSharing})}),t.jsxs(s.Modal.Body,{children:[t.jsx(s.Typography,{variant:"h6",children:d.sharedWith}),t.jsxs(s.ListGroup,{variant:"flush",children:[a&&a.length===0?t.jsx("div",{className:"px-2 text-muted",children:d.noone.toLowerCase()}):null,a==null?void 0:a.map(b=>t.jsxs(s.ListGroupItem,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[b.lastName," ",b.firstName," [",b.id,"]",t.jsx(s.IconButton,{color:"danger",onClick:()=>g(b.id),children:t.jsx(i,{icon:"delete"})})]},b.id))]}),t.jsx(s.Typography,{variant:"h6",className:"mt-2 mb-2",children:d.addSharing}),t.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[t.jsx("div",{className:"flex-grow-1",children:t.jsx(o,{label:d.shareWith,onSelect:b=>{if(b===null||typeof b.id!="number"){p(null);return}p(b)},value:m})}),t.jsx(s.PrimaryButton,{onClick:h,disabled:m===null,children:d.add})]})]})]})},mo=(e,n)=>{const[a,r]=c.useState(null);return c.useEffect(()=>{e.then(({default:o})=>{const l=n!==void 0?n(o):o;r(l)})},[n,e]),{mappings:a}},po=({reportType:e,title:n,data:a,filterElements:r,getReportRoute:o,localization:l,licenseKey:i,EmployeePicker:d,localizationJsonFile:u,localizationTransformer:m,hyperlinkColumn:p,roomPasportization:f=!1})=>{const{texts:{reports:x}}=c.useContext(s.LuminusComponentsContext),{confirm:h}=s.useConfirm(),g=Z.useNavigate(),[b]=Z.useSearchParams(),{id:v}=Z.useParams(),j=c.useMemo(()=>v===void 0?null:Number(v),[v]),N=c.useCallback(P=>{const X=P===null?"":P.toString();g(Z.generatePath(o(e),{id:X})+"?"+b.toString(),{replace:!0,flushSync:!0})},[o,g,e,b]),[S,C]=c.useState(!1),y=c.useRef(null),{user:k}=c.useContext(s.UserContext),{data:w,reloadData:I}=de.useGetApiData(`/reports/${e}`),{mappings:E}=mo(u,m),[D,M]=c.useState({}),F=c.useCallback(P=>{const X=P.target.value,ie=X===""?null:Number(X);N(ie)},[N]),_=c.useCallback(async P=>{await I(),N(P)},[I,N]),{data:L,setData:W}=de.useGetApiData(`/reports/version/${j}`,{enabled:j!==null,nullStateBeforeLoad:!1,nullStateOnFail:!0});c.useEffect(()=>{var X;if(L===null){M({});return}const P=ro(L)??{};M(P),(X=y.current)==null||X.flexmonster.refresh()},[L]);const{save:A,saveAs:O,archive:z,detach:B}=lo(e,y,j,_),T=c.useMemo(()=>({data:a??[],mapping:E??void 0}),[a,E]),R=c.useCallback(async()=>{var X;await h(x.confirmRevertChanges)&&((X=y.current)==null||X.flexmonster.setReport({dataSource:T,...D}))},[h,T,x.confirmRevertChanges,D]),U=c.useMemo(()=>(L==null?void 0:L.ownerId)===k.personalNumber,[L==null?void 0:L.ownerId,k.personalNumber]),q=c.useMemo(()=>{var P;return(P=L==null?void 0:L.users)==null?void 0:P.some(X=>X.id===k.personalNumber&&!X.isReportOwner)},[L==null?void 0:L.users,k.personalNumber]),K=c.useCallback(async()=>{await h(x.confirmDelete(L==null?void 0:L.name))&&(await z(),N(null),await I())},[z,h,I,L==null?void 0:L.name,x,N]),pe=c.useCallback(async()=>{await h(x.confirmDetach(L==null?void 0:L.name))&&(await B(),N(null),await I())},[h,B,I,L==null?void 0:L.name,x,N]);return c.useEffect(()=>{var P,X;j===null&&N(((P=w==null?void 0:w.reportVersions.find(ie=>ie.isSystem===!0))==null?void 0:P.reportVersionId)??((X=w==null?void 0:w.reportVersions[0])==null?void 0:X.reportVersionId)??null)},[w==null?void 0:w.reportVersions,j,N]),t.jsxs(t.Fragment,{children:[t.jsx(s.PageContainer,{variant:"fullScreen",title:t.jsxs("div",{className:"d-flex justify-content-start gap-3",children:[t.jsx(s.Typography,{variant:"h3",children:n}),r,t.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxs(s.FormSelect,{size:"sm",value:j??void 0,onChange:F,children:[t.jsx("optgroup",{label:x.versionSelectSystem,children:w==null?void 0:w.reportVersions.filter(P=>P.isSystem===!0).map(P=>t.jsx("option",{value:P.reportVersionId,children:P.name},P.reportVersionId))}),t.jsx("optgroup",{label:x.versionSelectYour,children:w==null?void 0:w.reportVersions.filter(P=>P.ownerId===k.personalNumber).map(P=>t.jsx("option",{value:P.reportVersionId,children:P.name},P.reportVersionId))}),t.jsx("optgroup",{label:x.versionSelectSharedWithYou,children:w==null?void 0:w.reportVersions.filter(P=>P.isSystem===!1&&P.ownerId!==k.personalNumber).map(P=>t.jsx("option",{value:P.reportVersionId,children:`${P.name} [${P.ownerId}]`},P.reportVersionId))})]}),t.jsx(s.ContextButton,{icon:t.jsx(s.MdSave,{}),onClick:A,disabled:j===null||(L==null?void 0:L.isSystem)||!U,children:x.save}),t.jsx(s.ContextButton,{icon:t.jsx(s.MdSaveAs,{}),onClick:O,className:"flex-shrink-0",children:x.saveAs}),t.jsxs(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle}),children:[t.jsx(s.DropdownItem,{onClick:R,children:x.revertChanges}),t.jsx(s.DropdownItem,{onClick:()=>C(!0),disabled:!U||(L==null?void 0:L.isSystem),children:x.share}),U&&!(L!=null&&L.isSystem)?t.jsx(s.DropdownItem,{color:"danger",onClick:K,children:x.delete}):null,q&&!(L!=null&&L.isSystem)?t.jsx(s.DropdownItem,{color:"danger",onClick:pe,children:x.detach}):null]})]})]}),children:t.jsx("div",{className:s.classNames("h-100 w-100",T.data&&T.data.length>0?"":"d-none"),children:t.jsx(aa,{dataSource:T,settings:D,pivotRef:y,enabled:T.data&&T.data.length>0,roomPasportization:f,localization:l,licenseKey:i,hyperlinkColumn:p})})}),L!==null?t.jsx(uo,{isOpen:S,onHide:()=>C(!1),usersData:L.users??null,setReportVersion:W,reportVersionId:L==null?void 0:L.reportVersionId,EmployeePicker:d}):null]})},fo=({cell:{value:e}})=>t.jsx(t.Fragment,{children:e?t.jsx(Dt,{name:e,size:21,fontSize:12}):t.jsx(t.Fragment,{})}),ho=({knownTypes:e,typeFilters:n,onChangeTypeFilters:a})=>t.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:e.map(r=>t.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:s.classNames(`border-${r}`,n.includes(r)&&`bg-${r}`),onClick:()=>{n.includes(r)?a(n.filter(o=>o!==r)):a([...n,r])}},r))}),go=({linksTo:e,onClick:n,children:a})=>e?t.jsx(Z.Link,{to:e,className:"text-decoration-none",onClick:n,children:a}):t.jsx(t.Fragment,{children:a}),xo=({message:e,onDeleteMessage:n,onClickMessage:a,getIcon:r,getLinksTo:o})=>{const{ProjectIconComponent:l,localizationContext:i}=c.useContext(s.LuminusComponentsContext),{dateFnsLocale:d}=c.useContext(i),u=e.dateTime?s.parseISO(e.dateTime):null,m=u?Va(new Date(Date.now()),u):0;return t.jsxs("div",{children:[u&&t.jsx("div",{className:"d-flex justify-content-end",children:t.jsx(s.SimpleTooltip,{text:s.format(u,"dd.MM.yyyy HH:mm"),placement:"left",children:t.jsx("div",{children:t.jsx(s.Typography,{variant:"caption",children:m>2?s.format(u,"dd.MM.yyyy"):Wa(u,new Date(Date.now()),{locale:d.code})})})})}),t.jsx(go,{linksTo:o(e)??void 0,onClick:a,children:t.jsx(Da,{level:e.type,noIcon:!0,children:t.jsxs("div",{className:"d-flex align-items-start gap-2",children:[r(e),t.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[t.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[t.jsx(s.Typography,{variant:"body2",className:"fw-bold",children:e.subject}),t.jsx(s.IconButton,{size:"sm",onClick:p=>{p.preventDefault(),p.stopPropagation(),n(e.id)},children:t.jsx(l,{icon:"delete"})})]}),t.jsx(s.Typography,{variant:"body2",children:e.text})]})]})})})]})},$n=["info","warning","danger"],zn=({messages:e,isLoading:n,onDeleteMessage:a,onClickMessage:r,getIcon:o,getLinksTo:l})=>{const{texts:{messageBoard:i}}=c.useContext(s.LuminusComponentsContext),[d,u]=c.useState($n),m=c.useMemo(()=>e.filter(p=>d.includes(p.type??"")),[d,e]);return t.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[t.jsx(ho,{knownTypes:$n,typeFilters:d,onChangeTypeFilters:p=>u(p)}),n&&t.jsxs("div",{className:"p-3 w-100",children:[t.jsx(Fe,{as:In.Title,animation:"glow",children:t.jsx(Fe,{xs:6})}),t.jsxs(Fe,{as:In.Text,animation:"glow",children:[t.jsx(Fe,{xs:7})," ",t.jsx(Fe,{xs:4})," ",t.jsx(Fe,{xs:4})," ",t.jsx(Fe,{xs:6})," ",t.jsx(Fe,{xs:8})]})]}),!n&&t.jsxs(t.Fragment,{children:[e.length===0&&t.jsx(s.Alert,{variant:"info",size:"sm",className:"mt-2",children:i.noMessages}),t.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:m.map(p=>t.jsx(xo,{message:p,onDeleteMessage:a,onClickMessage:r,getIcon:o,getLinksTo:l},p.id))})]})]})},At={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},vo=({renderAsNotifPanel:e,notifIcon:n,apiUrls:{apiGet:a=At.apiGet,apiDelete:r=At.apiDelete}=At,getIcon:o,getLinksTo:l})=>{const d=s.useAxios(),[u,m]=c.useState([]),[p,f]=c.useState(!1),[x,h]=c.useState(!1),[g,b]=c.useState(!1),v=c.useCallback(async()=>{h(!0),await d.get(a).then(({data:y})=>{m(y),f(!0),h(!1)}).catch(()=>{m([]),h(!1)})},[a,d]),j=c.useCallback(async y=>d.delete(`${r}${y}`).then(()=>!0).catch(()=>!1),[r,d]),N=c.useCallback(y=>{j(y).then(k=>{k&&m(u.filter(w=>w.id!==y))})},[j,u]);c.useEffect(()=>{v();const y=setInterval(()=>v(),60*1e3);return()=>{clearInterval(y)}},[v]);const S=u.filter(y=>y.type==="danger").length,C=p?!1:x;return e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"position-relative",children:[t.jsx(s.IconButton,{size:"md",onClick:()=>b(!g),children:n}),S>0&&t.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:S})]}),t.jsx(Dn,{show:g,onHide:()=>b(!1),placement:"end",children:t.jsx(Dn.Body,{children:t.jsx(zn,{messages:u,isLoading:C,onDeleteMessage:N,onClickMessage:()=>b(!1),getIcon:o,getLinksTo:l})})})]}):t.jsx(zn,{messages:u,isLoading:C,onDeleteMessage:N,getIcon:o,getLinksTo:l})},yo="_tab-panel_d8l8q_1",jo="_full-height-no-overflow_d8l8q_5",bo="_disabled_d8l8q_12",Rt={tabPanel:yo,fullHeightNoOverflow:jo,disabled:bo},ra=({eventKey:e,activeTab:n,fullHeightNoOverflow:a,disabled:r,className:o,children:l})=>e!==n?null:t.jsx("div",{className:s.classNames("luminus-tab-panel",Rt.tabPanel,{[Rt.fullHeightNoOverflow]:a},{disabled:r},{[Rt.disabled]:r},o),children:l}),Co="_join-line_1q9e8_1",No={joinLine:Co},mn=({activeTab:e,onSelect:n,children:a,vertical:r,verticalStepper:o})=>t.jsx("div",{className:s.classNames("luminus-tabs d-flex mb-2",{"gap-1":!o},{"gap-0":o},{"flex-column":r||o}),children:a.map((l,i)=>{const d=l.type,u=l.props;if(!u)return null;const m=u.eventKey,p=u.children,f=u.className,x=u.onClick;return t.jsxs(c.Fragment,{children:[t.jsx(d,{...u,className:s.classNames({active:e===m},f),onClick:()=>{n(m),x&&x(m)},vertical:r||o,children:p}),o&&i<a.length-1&&t.jsx("div",{className:s.classNames("join-line",No.joinLine)})]},u.eventKey)})}),wo="_tab_1tbi7_1",So="_disabled_1tbi7_7",Io="_vertical_1tbi7_13",Pt={tab:wo,disabled:So,vertical:Io},pn=({eventKey:e,className:n,onClick:a,disabled:r,vertical:o,children:l})=>t.jsx("div",{role:"button",className:s.classNames("luminus-tab text-primary rounded",Pt.tab,n,{disabled:r},{[Pt.disabled]:r},{vertical:o},{[Pt.vertical]:o}),onClick:()=>a&&!r&&a(e),children:typeof l=="string"?t.jsx(s.Typography,{variant:o?"body":"h6",className:o?"":"text-primary",children:l}):l}),ko=({tabs:e,activeTab:n,onSelect:a,...r})=>{var i;const{ProjectIconComponent:o}=c.useContext(s.LuminusComponentsContext),{isMobile:l}=s.useWindowSize();return l?t.jsx(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle,text:((i=e.find(d=>d.id===n))==null?void 0:i.name)??"",icon:t.jsx(o,{icon:"chevron-down"})}),...r,children:e.map(d=>t.jsx(s.DropdownItem,{onClick:()=>a(d.id),children:d.name},d.id))}):t.jsx(mn,{activeTab:n,onSelect:d=>a(d),...r,children:e.map(d=>t.jsx(pn,{eventKey:d.id,children:d.name},d.id))})},Do="_selection_1dtmm_1",To="_selectionBg_1dtmm_10",_o="_selectionItemsContainer_1dtmm_18",Lo="_selectionItems_1dtmm_18",vt={selection:Do,selectionBg:To,selectionItemsContainer:_o,selectionItems:Lo},fn=({icon:e,setIcon:n,IconComponent:a,IconTypeArray:r})=>{const[o,l]=c.useState(!1),i=d=>{n(d),l(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(s.IconButton,{className:"rounded m-1",onClick:()=>l(!0),children:t.jsx(a,{icon:e})}),o&&t.jsxs("div",{className:vt.selection,children:[t.jsx("div",{className:vt.selectionBg,onClick:()=>l(!1)}),t.jsx("div",{className:vt.selectionItemsContainer,children:t.jsx("div",{className:vt.selectionItems,children:r.filter((d,u,m)=>m.indexOf(d)===u).map(d=>t.jsx(s.IconButton,{className:"rounded",onClick:()=>i(d),children:t.jsx(a,{icon:d})},d))})})]})]})},hn=()=>{const e=c.useContext(s.ShortcutLinksContext);if(e===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return e},Eo=({shortcutLink:e,IconComponent:n,IconTypeArray:a,editShortcutLink:r,deleteLocation:o})=>{const{ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),[i,d]=c.useState(e.icon),[u,m]=c.useState(e.name),p=c.useMemo(()=>!(i===e.icon&&u===e.name),[i,u,e.icon,e.name]),f=c.useCallback(()=>{d(e.icon),m(e.name)},[e]),x=c.useCallback(()=>{r({...e,icon:i,name:u})},[r,i,u,e]);return t.jsxs(t.Fragment,{children:[t.jsx("td",{className:"align-middle",children:t.jsx(s.TextInput,{type:"text",maxLength:20,value:u,onChange:m,className:"d-flex-grow-1",InputContainer:s.NoInputContainer,size:"sm"})}),t.jsx("td",{className:"align-middle",children:t.jsx("div",{className:"d-flex justify-content-center align-items-center",children:t.jsx(fn,{icon:i,setIcon:d,IconComponent:n,IconTypeArray:a})})}),t.jsx("td",{className:"align-middle",style:{width:"7em"},children:t.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-end",children:[p&&t.jsxs(t.Fragment,{children:[t.jsx(s.IconButton,{onClick:f,color:"secondary",className:"d-inline",children:t.jsx(l,{icon:"cancel"})}),t.jsx(s.IconButton,{onClick:x,color:"success",className:"d-inline",children:t.jsx(l,{icon:"check"})})]}),t.jsx(s.IconButton,{onClick:o,color:"danger",children:t.jsx(l,{icon:"delete"})})]})})]})},Mo=({shortcutLink:e,IconComponent:n,IconTypeArray:a,editShortcutLink:r,deleteShortcutLink:o})=>{const l=c.useCallback(()=>{o(e.id)},[o,e.id]);return t.jsx("tr",{className:"mb-3",children:t.jsxs(t.Fragment,{children:[t.jsx("td",{className:"align-middle",children:e.url.length<=23?t.jsx(s.Typography,{variant:"body2",children:e.url}):t.jsx(s.SimpleTooltip,{placement:"bottom",text:e.url,children:t.jsxs(s.Typography,{variant:"body2",children:[e.url.slice(0,21),"..."]})})}),t.jsx(Eo,{shortcutLink:e,IconComponent:n,IconTypeArray:a,editShortcutLink:r,deleteLocation:l})]})})},Fo=({IconComponent:e,IconTypeArray:n})=>{const{texts:a}=c.useContext(s.LuminusComponentsContext),{shortcutLinks:r,editShortcutLink:o,deleteShortcutLink:l}=hn();return t.jsx(t.Fragment,{children:r!==null&&r.length>0?t.jsxs(zs,{size:"sm",title:a.shortcutLinks.shortcutLinksSetting,children:[t.jsx("thead",{className:"fw-bold",children:t.jsxs("tr",{children:[t.jsx("th",{children:t.jsx(s.Typography,{variant:"body2",children:a.shortcutLinks.target})}),t.jsx("th",{children:t.jsx(s.Typography,{variant:"body2",children:a.shortcutLinks.name})}),t.jsx("th",{className:"text-center",children:t.jsx(s.Typography,{variant:"body2",children:a.shortcutLinks.icon})}),t.jsx("th",{})]})}),t.jsx("tbody",{children:r==null?void 0:r.map(i=>t.jsx(Mo,{shortcutLink:i,IconComponent:e,IconTypeArray:n,editShortcutLink:o,deleteShortcutLink:l},i.id))})]}):t.jsx(s.Alert,{variant:"info",size:"sm",children:a.shortcutLinks.addLinksToEditThemHereInfo})})},Kt=5,Oo="_linkButton_pnlvi_1",Ao="_linkAddButton_pnlvi_31",Ro="_createLinkRow_pnlvi_39",Qe={linkButton:Oo,linkAddButton:Ao,createLinkRow:Ro},Po=({shortcutLink:e,IconComponent:n})=>t.jsx(s.SimpleTooltip,{text:e.name,placement:"bottom",children:t.jsx(Z.Link,{to:e.url,className:Qe.linkButton,children:t.jsx(n,{icon:e.icon})})}),Bo=({closeModal:e,isOpen:n,createLink:a,pageTitlePrefix:r,IconComponent:o,IconTypeArray:l})=>{const i=Z.useLocation(),{texts:d}=c.useContext(s.LuminusComponentsContext),[u,m]=c.useState("star-outline"),[p,f]=c.useState(r?document.title.replace(r,""):document.title),x=c.useCallback(async()=>{await a({icon:u,name:p,url:i.pathname+i.search}),e()},[e,a,u,i.pathname,i.search,p]),h=c.useMemo(()=>i.pathname+i.search,[i.pathname,i.search]);return t.jsx(s.Modal,{show:n,onHide:e,size:"sm",children:t.jsxs("div",{onKeyDown:g=>{g.code!=="Escape"&&g.stopPropagation()},children:[t.jsx(s.Modal.Header,{closeButton:!0,children:t.jsx(s.Modal.Title,{children:d.shortcutLinks.newShortcut})}),t.jsxs(s.Modal.Body,{children:[t.jsxs("div",{className:Qe.createLinkRow,children:[t.jsx(s.Typography,{variant:"form-label",className:"pe-3 text-end",children:d.shortcutLinks.target}),t.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:h.length<=23?h:t.jsx(s.SimpleTooltip,{placement:"bottom",text:h,children:t.jsxs("span",{children:[h.slice(0,21),"..."]})})})]}),t.jsxs("div",{className:Qe.createLinkRow,children:[t.jsx(s.Typography,{variant:"form-label",className:"pe-3 text-end",children:d.shortcutLinks.name}),t.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsx(s.TextInput,{type:"text",maxLength:25,value:p,onChange:f,className:"w-100",InputContainer:s.RowLabelInput,withoutLabel:!0})})]}),t.jsxs("div",{className:Qe.createLinkRow,children:[t.jsx(s.Typography,{variant:"form-label",className:"pe-3 text-end",children:d.shortcutLinks.icon}),t.jsx("div",{className:"d-flex align-items-middle fw-bold",children:t.jsx(fn,{icon:u,setIcon:m,IconComponent:o,IconTypeArray:l})})]})]}),t.jsx(s.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsx(s.PrimaryButton,{onClick:x,children:d.shortcutLinks.addShortcut})})]})})},$o=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:a,createLink:r})=>{const{ProjectIconComponent:o,texts:l}=c.useContext(s.LuminusComponentsContext),[i,d]=c.useState(!1),[u]=s.a(i,100);return t.jsxs(t.Fragment,{children:[t.jsx(s.SimpleTooltip,{text:l.shortcutLinks.addShortcut,placement:"bottom",children:t.jsx("button",{type:"button",className:s.classNames(Qe.linkButton,Qe.linkAddButton),onClick:()=>d(!0),children:t.jsx(o,{icon:"add"})})}),(i||u)&&t.jsx(Bo,{IconComponent:e,IconTypeArray:n,closeModal:()=>d(!1),createLink:r,isOpen:i,pageTitlePrefix:a})]})},zo=({IconComponent:e,IconTypeArray:n,pageTitlePrefix:a})=>{const{shortcutLinks:r,createShortcutLink:o}=hn(),l=c.useMemo(()=>r!==null&&r.length<Kt,[r]);return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"d-flex gap-2",children:[r==null?void 0:r.slice(0,Kt).map((i,d)=>i!==null?t.jsx(Po,{shortcutLink:i,IconComponent:e},d):null),l&&t.jsx($o,{IconComponent:e,IconTypeArray:n,pageTitlePrefix:a,createLink:o})]})})},Ho=e=>{const n=s.useAxios(),{startLoading:a,stopLoading:r}=c.useContext(s.LoadingContext),o=c.useCallback(async d=>{a("submit-createShortcutLink");try{await n.post(`/dynamicForms/insert?referenceId=${e}`,d)}finally{r("submit-createShortcutLink")}},[n,e,a,r]),l=c.useCallback(async d=>{a("submit-updateShortcutLink");try{await n.post(`/dynamicForms/update?referenceId=${e}`,d)}finally{r("submit-updateShortcutLink")}},[n,e,a,r]),i=c.useCallback(async d=>{a("delete-deleteShortcutLink");try{await n.delete(`/dynamicForms/delete?referenceId=${e}&pk=${d.toString()}`)}finally{r("delete-deleteShortcutLink")}},[n,e,a,r]);return{create:o,update:l,remove:i}},Vo=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},Hn=e=>{if(e==null)throw new Error("Tried to make operation on null shortcutLinks.");return e},Uo=({children:e,referenceId:n})=>{const{user:a}=c.useContext(s.UserContext),r=c.useCallback(h=>h.map(g=>({id:g.id,icon:g.icon,name:g.name,url:g.url})),[]),{data:o,reloadData:l}=de.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${n}&employee=${a==null?void 0:a.personalNumber}`,{silent:!0,dataTransformer:r,enabled:a!==null}),{create:i,update:d,remove:u}=Ho(n),m=c.useCallback(async h=>{const g=Hn(a);if(Vo(o).length>=Kt)throw new Error("Cannot add more shortcut links.");await i({...h,employee:g.personalNumber}),await l()},[i,l,o,a]),p=c.useCallback(async h=>{const g=Hn(a);await d({...h,employee:g.personalNumber}),await l()},[l,d,a]),f=c.useCallback(async h=>{await u(h),await l()},[l,u]),x=c.useMemo(()=>({shortcutLinks:o,createShortcutLink:m,editShortcutLink:p,deleteShortcutLink:f}),[m,f,p,o]);return t.jsx(s.ShortcutLinksContext.Provider,{value:x,children:e})},Wo=({targets:e,removeNotifTarget:n})=>{const{ProjectIconComponent:a}=c.useContext(s.LuminusComponentsContext);return t.jsx(t.Fragment,{children:e&&e.sort((r,o)=>(r.employeeId??0)-(o.employeeId??0)).map(r=>t.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-between mb-1",children:[t.jsx("div",{className:"text-secondary",children:t.jsx("span",{className:"d-flex gap-2 ",children:r.employeeId&&r.roleName===null?t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:"user"}),t.jsx(s.Typography,{variant:"subtitle",children:r.employeeName})]}):t.jsxs(t.Fragment,{children:[t.jsx(a,{icon:"role"}),t.jsx(s.Typography,{variant:"subtitle",children:r.roleName})]})})}),t.jsx(s.IconButton,{size:"sm",color:"danger",onClick:()=>n(r.id),children:t.jsx(a,{icon:"delete"})})]},r.id))})},Go=({show:e,onHide:n,roles:a,onAddTarget:r,EmployeePicker:o,templateId:l})=>{const{texts:{notifCentrum:i}}=c.useContext(s.LuminusComponentsContext),[d,u]=c.useState(null),[m,p]=c.useState(null),[f,x]=c.useState("R"),h=c.useCallback(()=>{u(null),p(null),n()},[n]);return t.jsxs(s.Modal,{show:e,onHide:()=>h(),children:[t.jsx(s.Modal.Header,{closeButton:!0,children:t.jsx(s.Modal.Title,{children:i.addNewTarget})}),t.jsxs(s.Modal.Body,{children:[t.jsx(na,{options:[{id:"E",name:i.employee},{id:"R",name:i.role}],value:f,onChange:g=>x(g),InputContainer:s.RowLabelInput}),f==="E"?t.jsx(o,{InputContainer:s.RowLabelInput,label:i.employee,value:{id:(d==null?void 0:d.id)??null,name:(d==null?void 0:d.name)??""},onSelect:g=>u({id:Number(g==null?void 0:g.id)??null,name:(g==null?void 0:g.name)??""})}):t.jsx(s.CustomSelectInput,{InputContainer:s.RowLabelInput,label:i.role,options:a.map(g=>({id:g,name:g})),value:m,onChange:g=>p((g==null?void 0:g.toString())??"")})]}),t.jsx(s.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsx(s.PrimaryButton,{onClick:()=>{r({templateId:l??0,targetId:null,employeeId:(d==null?void 0:d.id)??null,roleName:m},(d==null?void 0:d.name)??null),h()},children:i.add})})]})},Yo=({templates:e,selectedTemplateId:n,setSelectedTemplateId:a,roles:r,onAddNotifTarget:o,onRemoveNotifTarget:l,EmployeePicker:i})=>{const{texts:{notifCentrum:d},ProjectIconComponent:u}=c.useContext(s.LuminusComponentsContext),[m,p]=c.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(s.ListGroup,{className:"overflow-auto h-max-100 p-2",children:e.map(f=>t.jsxs(s.ListGroup.Item,{action:n!==f.id,className:`p-0 mb-2 border rounded shadow-sm ${n===f.id?"border-1 border-primary":""}`,onClick:()=>a(f.id),children:[t.jsxs("div",{className:"d-flex gap-2 justify-content-between align-items-center border-1 border-bottom border-primary p-2",children:[t.jsx("div",{className:"text-primary",children:f.destinationId===1?t.jsx(u,{icon:"mail-envelope"}):t.jsx(u,{icon:"dashboard"})}),t.jsx(s.Typography,{className:"text-truncate text-primary",variant:"subtitle",children:f.subjectTemplate}),t.jsx(s.IconButton,{size:"sm",onClick:()=>p(!0),children:t.jsx(u,{icon:"add"})})]}),t.jsx("div",{className:"my-2 ps-3 pe-2",children:f.targets.length>0?t.jsx(Wo,{targets:f.targets,removeNotifTarget:l}):t.jsx(s.Alert,{size:"sm",variant:"warning",children:d.noTargets})})]},f.id))}),t.jsx(Go,{show:m,onHide:()=>p(!1),roles:r??[],onAddTarget:o,EmployeePicker:i,templateId:n})]})},qo=({data:e,onClick:n,BnfTableComponent:a})=>{const{texts:{notifCentrum:r}}=c.useContext(s.LuminusComponentsContext),o=c.useMemo(()=>e==null?void 0:e.map(u=>{var m;return{...u,recipientsString:((m=u.recipients)==null?void 0:m.map(p=>p.name).join(", "))??""}}),[e]),l=s.u(),i=c.useMemo(()=>[l.accessor("date",{header:r.date,type:"date"}),l.accessor("recipientsString",{header:r.recipients,type:"string"}),l.accessor("subject",{header:r.subject,type:"string",meta:{hidden:!0}}),l.accessor("id",{header:"Id",type:"number",meta:{hidden:!0}})],[r,l]),d=c.useCallback(u=>{n(u.id)},[n]);return t.jsx(a,{columns:i,data:o,onRowClick:d})},Ko=({show:e,onHide:n,template:a,onEdit:r})=>{const{texts:{notifCentrum:o}}=c.useContext(s.LuminusComponentsContext),[l,i]=c.useState(null),[d,u]=c.useState(null);c.useEffect(()=>{a&&(i(a.subjectTemplate),u(a.textTemplate))},[a]);const m=c.useCallback(()=>{!l||!d||(r(l,d),n())},[d,r,n,l]);return t.jsx(t.Fragment,{children:a&&t.jsxs(s.Modal,{show:e,onHide:n,size:"lg",scrollable:!0,children:[t.jsx(s.Modal.Header,{children:t.jsx(s.Modal.Title,{children:o.editTemplate})}),t.jsxs(s.Modal.Body,{style:{minHeight:"50vh"},children:[t.jsxs(s.Form.Group,{controlId:"subject",children:[t.jsx(s.Form.Label,{children:t.jsx(s.Typography,{variant:"form-label",className:"text-primary",children:o.subject})}),t.jsx(s.Form.Control,{value:l??"",onChange:p=>i(p.target.value)})]}),t.jsxs(s.Form.Group,{controlId:"text",children:[t.jsx(s.Form.Label,{children:t.jsx(s.Typography,{variant:"form-label",className:"text-primary",children:o.text})}),t.jsx(s.Form.Control,{as:"textarea",rows:10,value:d??"",onChange:p=>u(p.target.value),style:{resize:"vertical",minHeight:"400px"}})]})]}),t.jsx(s.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsx(s.PrimaryButton,{onClick:()=>{console.log(l),console.log(d),m()},children:o.save})})]})})},Qo=({kinds:e,targetSystem:n,reloadActions:a,reloadHistory:r,reloadRoles:o,onRemoveTarget:l,onPostTarget:i,onTemplateEdit:d,EmployeePicker:u,BnfTableComponent:m})=>{var O,z,B;const{texts:{notifCentrum:p},ProjectIconComponent:f}=c.useContext(s.LuminusComponentsContext),{confirm:x}=s.useConfirm(),[h,g]=c.useState(null),[b,v]=c.useState(null),[j,N]=c.useState(!1),[S,C]=de.useLocalStorageState("notif-kind-id",null);c.useEffect(()=>{var T;e.length>0?C(((T=e.at(0))==null?void 0:T.id)??null):C(null)},[e,C]);const[y,k]=c.useState([]);c.useEffect(()=>{S&&a(S).then(T=>{k(T)}).catch(T=>{console.log(T),k([])})},[a,S]);const[w,I]=de.useLocalStorageState("notif-action-id",((O=y==null?void 0:y.at(0))==null?void 0:O.id)??null),[E,D]=c.useState([]);c.useEffect(()=>{w===null||h===null||r(w,h).then(T=>{D(T)}).catch(T=>{console.log(T),D([])})},[a,r,w,S,h]);const[M,F]=c.useState([]);c.useEffect(()=>{w!==null&&o(w).then(T=>{F(T)}).catch(T=>{console.log(T),F([])})},[o,w]);const _=c.useMemo(()=>{var T;return!y||!w?[]:((T=y.find(R=>R.id===w))==null?void 0:T.templates)??[]},[y,w]),L=c.useCallback((T,R)=>{i(T,R).then(U=>{k(y?[...y.map(q=>q.id!==w?q:{...q,templates:[...q.templates.map(K=>K.id!==h?K:{...K,targets:[...K.targets,U]})]})]:[])}).catch(U=>console.log(U))},[y,i,w,h,k]),W=c.useCallback((T,R)=>{h&&d(h,T,R).then(()=>{k(y?[...y.map(U=>U.id!==w?U:{...U,templates:[...U.templates.map(q=>q.id!==h?q:{...q,subjectTemplate:T,textTemplate:R})]})]:[])}).catch(U=>console.log(U))},[y,d,w,h]),A=c.useCallback(async T=>{await x(p.confirmTargetDelete)&&l(T).then(()=>k(y?[...y.map(R=>R.id!==w?R:{...R,templates:[...R.templates.map(U=>U.id!==h?U:{...U,targets:U.targets.filter(q=>q.id!==T)})]})]:[]))},[y,x,p,l,w,h]);return t.jsxs("div",{className:"h-100 overflow-hidden",children:[t.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.jsxs("div",{className:"row w-100",children:[t.jsx("div",{className:"col-2",children:t.jsx(s.CustomSelectInput,{label:p.kind,size:"sm",noEmptyOption:!0,options:((z=e.filter(T=>(T.targetSystem&n)>0))==null?void 0:z.map(T=>({id:T.id,name:T.name})))??[],value:S??null,onChange:T=>C(Number(T)),dropdownWidth:200})}),t.jsx("div",{className:"col-3",children:t.jsx(s.CustomSelectInput,{label:p.subkind,size:"sm",noEmptyOption:!0,options:(y==null?void 0:y.map(T=>({id:T.id,name:T.name})))??[],value:w??null,onChange:T=>I(Number(T)),dropdownWidth:250})})]}),t.jsx(s.ResponsiveContextDropdown,{children:t.jsx(s.ResponsiveContextDropdownItem,{hideOn:"always",cKey:"template-edit",onClick:()=>N(!0),disabled:h===null,icon:t.jsx(f,{icon:"edit"}),children:p.editTemplate})})]}),t.jsxs("div",{className:"vh-100 overflow-hidden d-flex gap-1",children:[t.jsx("div",{className:"h-75 w-25 overflow-hidden",children:t.jsx(Yo,{templates:_,roles:M??[],onAddNotifTarget:L,onRemoveNotifTarget:A,selectedTemplateId:h,setSelectedTemplateId:T=>{g(T),v(null)},EmployeePicker:u})}),t.jsx("div",{className:"w-25 h-75 overflow-hidden",children:h&&t.jsx(qo,{data:E??[],onClick:T=>v((E==null?void 0:E.find(R=>R.id===T))??null),BnfTableComponent:m})}),h&&t.jsx("div",{className:"h-75 w-75 overflow-hidden border rounded bg-white",children:t.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:(b==null?void 0:b.message)??((B=_.find(T=>T.id===h))==null?void 0:B.textTemplate)})})]}),t.jsx(Ko,{show:j,onHide:()=>N(!1),template:_.find(T=>T.id===h)??null,onEdit:W})]})},Zo=({history:e,onClick:n,BnfTableComponent:a})=>{const{texts:{notifCentrum:r}}=c.useContext(s.LuminusComponentsContext),o=s.u(),l=c.useMemo(()=>[o.accessor("id",{header:"notificationHistory.id",type:"number",meta:{hidden:!0}}),o.accessor("recipientId",{header:"notificationHistory.recipientId",type:"number",meta:{hidden:!0}}),o.accessor("recipientFullName",{header:"notificationHistory.recipientFullName",type:"string",meta:{hidden:!0}}),o.accessor("actionKindId",{header:"notificationHistory.actionKindId",type:"number",meta:{hidden:!0}}),o.accessor("actionKindName",{header:r.subkind,type:"string",meta:{filterVariant:"select"}}),o.accessor("actionId",{header:"notificationHistory.actionId",type:"number",meta:{hidden:!0}}),o.accessor("actionName",{header:r.subkind,type:"string",meta:{filterVariant:"select"}}),o.accessor("date",{header:r.date,type:"string"}),o.accessor("subject",{header:r.subject,type:"string"}),o.accessor("message",{header:"notificationHistory.message",type:"string",meta:{hidden:!0}})],[r,o]),i=c.useCallback(d=>{n(d.id)},[n]);return t.jsx(a,{columns:l,data:e,pagination:{mode:"enabled"},fullScreen:{enabled:!1},onRowClick:i})},Xo=({reloadUserHistory:e,EmployeePicker:n,BnfTableComponent:a})=>{const{texts:{notifCentrum:r}}=c.useContext(s.LuminusComponentsContext),[o,l]=c.useState(null),[i,d]=de.useLocalStorageState("notif-user",null),[u,m]=c.useState([]);return c.useEffect(()=>{i!==null&&e(i.id).then(p=>{m(p)}).catch(p=>{console.log(p),m([])})},[i,e]),t.jsxs("div",{className:"h-100 overflow-hidden d-flex flex-column gap-1",children:[t.jsx("div",{className:"row",children:t.jsx("div",{className:"col-3",children:t.jsx(n,{label:r.employee,value:i,size:"sm",onSelect:p=>d(p?{id:Number(p.id),name:p.name}:null)})})}),t.jsxs("div",{className:"vh-100 overflow hidden row",children:[t.jsx("div",{className:"col-5 h-75 overflow-hidden",children:t.jsx(Zo,{history:u??[],onClick:p=>l((u==null?void 0:u.find(f=>f.id===p))??null),BnfTableComponent:a})}),o&&t.jsx("div",{className:"col bg-darker h-75",children:t.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:o==null?void 0:o.message})})]})]})},oa=({result:e,onClose:n,tableIdentifier:a,BnfTableComponent:r})=>{var u,m,p,f,x;const{texts:{imports:o},ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),i=s.u(),d=c.useMemo(()=>[i.accessor("row",{header:o.row,type:"number",size:100}),i.accessor("column",{header:o.column,type:"number",size:100}),i.accessor("error",{header:o.error,type:"string",size:500})],[i,o]);return e?t.jsx(t.Fragment,{children:t.jsx(s.Alert,{variant:e.success?"success":"danger",size:"sm",className:"mb-2 p-2",children:t.jsxs("div",{className:"d-flex gap-3 align-items-start",children:[t.jsxs("div",{className:"w-100",children:[t.jsx("div",{className:"w-100 text-center",children:e.success?o.importSuccess:o.importFailed}),e.success&&((u=e.data)!=null&&u.added||(m=e.data)!=null&&m.updated||(p=e.data)!=null&&p.deleted)?t.jsx("div",{className:"d-flex justify-content-center mt-2",children:t.jsxs("div",{className:"list-group",children:[e.data.added?t.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxs(s.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importAdded(e.data.added)," "]})}):null,e.data.updated?t.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxs(s.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importUpdated(e.data.updated)," "]})}):null,e.data.deleted?t.jsx("div",{className:"list-group-item p-1 px-3",children:t.jsxs(s.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[o.importDeleted(e.data.deleted)," "]})}):null]})}):null,!e.success&&((x=(f=e.data)==null?void 0:f.errors)==null?void 0:x.length)>0?t.jsx("div",{className:"mt-3",children:t.jsx(r,{columns:d,data:e.data.errors,tableId:a})}):null]}),n!==void 0?t.jsx(s.IconButton,{color:e.success?"success":"danger",className:s.classNames("hover-darken",e.success?"bg-success-subtle":"bg-danger-subtle"),onClick:n,children:t.jsx(l,{icon:"close"})}):null]})})}):null},Jo="_upload-box_9ka79_1",ei="_browse-btn_9ka79_15",Bt={uploadBox:Jo,browseBtn:ei},ia=({file:e,onFileChange:n,onImport:a,children:r,multiple:o,accept:l})=>{const{ProjectIconComponent:i,texts:{imports:d}}=c.useContext(s.LuminusComponentsContext),u=c.useCallback(async p=>{p.length>0&&n(o===!0?[...p]:p[0])},[e,o,n]),m=c.useCallback(p=>{var x;p.preventDefault();const f=(x=p.dataTransfer)==null?void 0:x.files;f&&(f==null?void 0:f.length)>0&&u(f)},[u]);return t.jsxs(t.Fragment,{children:[e!==null?t.jsxs("div",{className:"d-flex border rounded p-1 ps-2 bg-white justify-content-between align-items-center mb-2",children:[t.jsx(s.Typography,{variant:"body",children:o?e.map(p=>p.name).join(", "):e.name}),t.jsxs("div",{className:"d-flex align-items-center gap-3",children:[r??null,t.jsx(s.PrimaryButton,{className:"text-nowrap",size:"sm",disabled:e===null,onClick:a,children:d.start})]})]}):null,t.jsxs("div",{className:s.classNames(Bt.uploadBox,{[Bt.active]:e!==null}),onDrop:m,onDragOver:p=>p.preventDefault(),children:[t.jsx(s.Typography,{variant:"body",children:d.dropHint}),t.jsx("input",{type:"file",hidden:!0,id:"browse",onChange:p=>{var f;return((f=p.target)==null?void 0:f.files)&&u(p.target.files)},multiple:o,accept:l}),t.jsx("label",{htmlFor:"browse",className:Bt.browseBtn,children:t.jsxs(s.Typography,{variant:"body",className:"d-flex gap-2 align-items-center",children:[t.jsx(i,{icon:"file-upload"}),d.pickFileHint]})})]})]})},ti=({otherSettingId:e,languageOptions:n,tableIdentifier:a,SettingsOutlet:r,BnfTableComponent:o,importLocalization:l})=>{const{texts:{localizations:i}}=c.useContext(s.LuminusComponentsContext),[d,u]=c.useState(n[0].id),[m,p]=c.useState(null),[f,x]=c.useState(null),h=c.useCallback(async()=>{if(m===null)return;const g=await l({file:m,lang:d});g.status==="success"&&x(g.data)},[l,d,m]);return t.jsx(r,{itemId:e,title:i.localizationImport,children:f?t.jsx(oa,{result:f,onClose:()=>x(null),BnfTableComponent:o,tableIdentifier:a}):t.jsx(ia,{file:m,onFileChange:p,onImport:h,children:t.jsx("div",{style:{minWidth:140},children:t.jsx(s.CustomSelectInput,{value:d,onChange:g=>typeof g=="string"?u(g):null,options:n,label:i.importedLanguage})})})})},ni=(e,n)=>{const a=n.split(".");let r=e;for(let o=0;o<a.length;o++){const l=a[o],i=r[l];if(typeof i=="string")return i;if(i===void 0)return;r=i}},si=({selLng:e,lngsData:n,localizationKey:a,reloadData:r,saveChanges:o})=>{const{ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),i=c.useMemo(()=>{const f=n.get(e);if(f===void 0)return"";const x=ni(f,a);return f!==void 0&&x!==void 0?x:""},[n,a,e]),[d,u]=c.useState(i),m=c.useCallback(async()=>{await o([{fileName:e+".json",items:[{key:a,value:d}]}]),await r()},[a,r,o,e,d]),p=c.useMemo(()=>d!==i,[i,d]);return t.jsxs("div",{className:"d-flex",children:[t.jsx(s.TextInput,{label:e+a,type:"text",value:d,onChange:f=>{u(typeof f!="string"?"":f)},InputContainer:s.RowLabelInput,withoutLabel:!0,className:"flex-grow-1"}),p?t.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsx(s.IconButton,{color:"danger",onClick:()=>u(i),children:t.jsx(l,{icon:"cancel"})}),t.jsx(s.IconButton,{onClick:m,children:t.jsx(l,{icon:"check"})})]}):null]})},ai="_keysTable_1j6ns_1",ri="_subgrid_1j6ns_14",oi="_lngSelectRow_1j6ns_19",ii="_tableItem_1j6ns_26",li="_tableFooter_1j6ns_29",ci="_tableFullWidth_1j6ns_35",di="_tableBody_1j6ns_39",ui="_lngSelect_1j6ns_19",mi="_addLng_1j6ns_52",pi="_fileSelect_1j6ns_57",fi="_searchBox_1j6ns_61",ge={keysTable:ai,subgrid:ri,lngSelectRow:oi,tableItem:ii,tableFooter:li,tableFullWidth:ci,tableBody:di,lngSelect:ui,addLng:mi,fileSelect:pi,searchBox:fi},yt=50,hi=(e,n)=>{const a=n.split(".");let r=e;for(let o=0;o<a.length;o++){const l=a[o],i=r[l];if(typeof i=="string")return i;if(i===void 0)return;r=i}},gi=({languageOptions:e,envMode:n,getOtherSettingsUrl:a,downloadXls:r,saveChanges:o,localizationFilesOptions:l,remoteLocalesRoot:i})=>{const{texts:{localizations:d},ProjectIconComponent:u}=c.useContext(s.LuminusComponentsContext),[m,p]=c.useState(1),[f,x]=c.useState(new Map),[h,g]=c.useState(null),[b,v]=c.useState(""),[j,N]=c.useState(new Set),S=c.useCallback(_=>{x(new Map),N(_)},[]),C=c.useMemo(()=>e.filter(_=>!j.has(_.id)),[j,e]),y=c.useMemo(()=>{if(f.size===0)return[];const _=new Set,L=(B,T="")=>{if(typeof B[1]=="object"){Object.entries(B[1]).forEach(R=>L(R,T+B[0]+"."));return}_.add(T+B[0])};Array.from(f).forEach(B=>{Object.entries(B[1]).forEach(T=>L(T))});const W=Array.from(_),A=l.find(B=>B.path===h);return((A==null?void 0:A.type)==="report"?W.filter(B=>{const T=B.split(".");return T[T.length-1]==="caption"}):W).map(B=>({key:B,lngData:new Map(Array.from(j).map(T=>{const R=f.get(T);return[T,(R===void 0?void 0:hi(R,B))??""]}))}))},[f,l,h,j]),k=c.useMemo(()=>y.filter(_=>s.stringSearchWithin(_.key,b)||Array.from(_.lngData).some(L=>typeof(L==null?void 0:L[1])!="string"?!1:s.stringSearchWithin((L==null?void 0:L[1])??"",b))),[b,y]),w=c.useMemo(()=>Math.ceil(k.length/yt),[k.length]),I=c.useCallback(_=>{_!==null&&p(()=>Math.max(1,Math.min(_,w)))},[w]),E=c.useCallback(async()=>{if(h===null)return;const _=Array.from(j).map(W=>(async()=>{const A=await s.axios.get(`${i}${h==null?void 0:h.replace("{{lng}}",W)}&v=${new Date().getTime()}`,{responseType:"json"});return[W,A.data]})()),L=await Promise.allSettled(_);x(new Map(L.map(W=>W.status==="fulfilled"?W.value:["",{}])))},[i,h,j]),D=c.useCallback(async()=>{E()},[E]),M=c.useMemo(()=>C.length>0,[C.length]),F=c.useMemo(()=>j.size+1+(M?1:0),[M,j.size]);return c.useEffect(()=>{I(m)},[I,m,k]),c.useEffect(()=>{E()},[E]),i===void 0?t.jsx(s.PageContainer,{children:t.jsxs(s.Alert,{variant:"danger",className:"fw-bold",children:[d.cantRunLocalizationSettings,t.jsx("br",{}),t.jsx("br",{}),d.envNotConnectedToRemote(n.toUpperCase())]})}):t.jsx(s.PageContainer,{title:t.jsx("div",{className:"d-flex gap-4",children:t.jsx(s.Typography,{variant:"h3",children:d.localizationSettings})}),helmet:d.localizationSettings,variant:"fullScreen",children:t.jsxs("div",{className:ge.keysTable,style:{"--keys-table-columns":F,"--adding-column":M?1:0},children:[t.jsxs("div",{className:s.classNames(ge.tableFullWidth,"d-flex align-items-center justify-content-between gap-2 px-2 mt-1"),children:[t.jsx(s.CustomSelectInput,{options:l.map(_=>({id:_.path,name:_.nameTranslationKey})),value:h,onChange:_=>typeof _!="number"?g(_):null,size:"sm",label:d.localizationFile,className:ge.fileSelect,noSortOptions:!0}),t.jsxs("div",{className:s.classNames(ge.searchBox,"d-flex align-items-center gap-2 border rounded"),children:[t.jsx(u,{icon:"search",className:"text-muted",size:18,iconProps:{className:"mt- me-n4"}}),t.jsx(s.TextInput,{type:"text",value:b,onChange:_=>v(typeof _=="string"?_:""),size:"sm",showClearIcon:b!=="",withoutLabel:!0,placeholder:"vyhledávat...",className:"placeholder-muted bg-transparent border-0 my-0 py-0 w-100"})]}),t.jsxs(s.ResponsiveContextDropdown,{children:[t.jsx(s.ResponsiveContextDropdownItem,{cKey:"export",hideOn:"always",onClick:r,icon:t.jsx(s.FileExtensionIcon,{fileExtension:"xls"}),children:d.xlsExport}),t.jsx(s.ResponsiveContextDropdownItem,{cKey:"import",hideOn:"always",to:a("localizationImport"),icon:t.jsx(u,{icon:"link"}),children:d.import})]})]}),t.jsxs("div",{className:s.classNames(ge.subgrid,ge.lngSelectRow),children:[t.jsx(s.Typography,{variant:"body",children:d.key}),Array.from(j).map((_,L)=>t.jsx(s.CustomSelectInput,{options:e.filter(W=>W.id===_||!j.has(W.id)),value:_,onChange:W=>S(A=>W===null?(A.delete(_),new Set(A)):(typeof W=="string"&&(A.delete(_),A.add(W)),new Set(A))),size:"sm",label:`${d.language} ${L+1}`,withoutLabel:!0,InputContainer:s.RowLabelInput,className:s.classNames(ge.lngSelect)},_)),M?t.jsx(s.CustomSelectInput,{options:C,value:null,onChange:_=>S(L=>(typeof _=="string"&&L.add(_),new Set(L))),size:"sm",label:d.addLanguage,InputContainer:s.RowLabelInput,className:s.classNames(ge.lngSelect,ge.addLng)}):null]}),t.jsxs("div",{className:s.classNames(ge.subgrid,ge.tableBody),children:[y.length===0||k.length===0?t.jsx(s.Alert,{variant:"warning",className:s.classNames(ge.tableFullWidth,ge.emptyTableAlert,"my-n1"),children:y.length===0?d.noDataLoaded:k.length===0?d.noDataFiltered:null}):null,k.slice(yt*(m-1),yt*m).map(_=>t.jsxs("div",{className:s.classNames(ge.subgrid,ge.tableItem),children:[t.jsx(s.Typography,{variant:"form-label",children:_.key}),Array.from(j).map(L=>t.jsx(si,{localizationKey:_.key,lngsData:f,selLng:L,reloadData:D,saveChanges:o},L))]},_.key))]}),t.jsxs("div",{className:s.classNames("d-flex align-items-center justify-content-around gap-3 px-2 py-0",ge.tableFooter),children:[t.jsx("div",{children:t.jsxs(s.Typography,{variant:"body",children:[d.keyCount,":"," ",t.jsx("span",{className:"fw-bold",children:k.length})]})}),t.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[t.jsxs(s.Typography,{variant:"body",children:[d.page,": "]}),t.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsx(s.IconButton,{size:"sm",onClick:()=>I(m-1),children:t.jsx(u,{icon:"minus"})}),t.jsx("div",{style:{width:30},children:t.jsx(ta,{value:m,onChange:I,InputContainer:s.RowLabelInput,withoutLabel:!0,size:"sm"})}),t.jsxs(s.Typography,{variant:"body",children:["/",Math.ceil(k.length/yt)]}),t.jsx(s.IconButton,{size:"sm",onClick:()=>I(m+1),children:t.jsx(u,{icon:"plus"})})]})]})]})]})})},Vn=3,la=(e,n,a)=>{var o;if((n==null?void 0:n.customPathBuilder)!==void 0)return n.customPathBuilder(e,n);const r=(o=a.find(l=>l.key===e.type))==null?void 0:o.toPath;return r?`${r}/${e.searchKey}`:"/not-found"},ca=(e,n)=>{var a;return((a=n==null?void 0:n.customNameBuilder)==null?void 0:a.call(n,e))??e.name},da=(e,n,a,r,o)=>{const l=s.useAxios(),[i,d]=c.useState(!1),[u,m]=c.useState([]),p=e==="",f=c.useCallback(()=>{m([]),!(n.length<Vn)&&(d(!0),l.get(ye.generateApiPath(a,{path:{query:n},query:{type:p?void 0:e,count:r?void 0:p?5:20}})).then(({data:g})=>{m(g),d(!1)}).catch(()=>{d(!1)}))},[l,r,p,n,a,e]),x=c.useMemo(()=>{if(o===void 0)return[];if(n.length<Vn||!["XAP","",null].includes(e))return[];const g=[];return o.forEach(b=>{const v=b.items.filter(j=>s.stringSearchWithin(j.name,decodeURIComponent(n)));v.length>0&&g.push({key:{...b.key,totalCount:v.length},items:v})}),g},[n,o,e]),h=c.useMemo(()=>x.concat(u),[u,x]);return c.useEffect(()=>{f()},[f]),{isLoading:i,searchItems:h}},xi="_input-group_1hcpm_1",vi="_input-group-text_1hcpm_5",yi="_left_1hcpm_9",ji="_right_1hcpm_13",bi="_input_1hcpm_1",Ci="_submit-button_1hcpm_20",Pe={inputGroup:xi,inputGroupText:vi,left:yi,right:ji,input:bi,submitButton:Ci},Ni=({searchTypes:e,selectedType:n,setSelectedType:a})=>t.jsx(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle,icon:null,text:n==null?void 0:n.text}),children:e.map(r=>t.jsx(s.DropdownItem,{icon:null,onClick:()=>a(r.key),children:r.text},r.key))}),wi="_dropdown_1ddrg_1",Si="_open_1ddrg_12",Ii="_loading-container_1ddrg_15",ki="_groups-container_1ddrg_22",Di="_group_1ddrg_22",Ti="_header_1ddrg_26",_i="_item_1ddrg_33",He={dropdown:wi,open:Si,loadingContainer:Ii,groupsContainer:ki,group:Di,header:Ti,item:_i},Li=({item:e,searchTypes:n,onCancel:a})=>{const r=c.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=c.useMemo(()=>la(e,r,n),[e,r,n]),l=c.useMemo(()=>ca(e,r),[e,r]);return t.jsxs(Z.Link,{to:o,className:s.classNames("search-item d-flex gap-3 align-items-center justify-content-between",He.item),onClick:a,children:[t.jsx(s.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:l}),t.jsx(s.Typography,{variant:"caption",className:"text-primary",children:t.jsx(s.MdOutlineArrowOutward,{})})]})},Ei=({show:e,query:n,onCancel:a,groups:r,isLoading:o,searchTypes:l})=>{const{texts:{appSearch:i}}=c.useContext(s.LuminusComponentsContext),d=c.useRef(null);return s.useClickOutside([d],a),t.jsx("div",{ref:d,className:s.classNames("luminus-app-search-dropdown shadow rounded",He.dropdown,{[He.open]:e}),children:o?t.jsx("div",{className:He.loadingContainer,children:t.jsx(s.Spinner,{animation:"border",variant:"primary"})}):t.jsx("div",{className:He.groupsContainer,children:r==null?void 0:r.map(u=>{var m;return t.jsxs("div",{className:s.classNames(He.group),children:[t.jsxs(Z.Link,{to:`/search?query=${n}&type=${u.key.category}`,className:s.classNames("group-header",He.header),onClick:a,children:[t.jsx(s.Typography,{variant:"body",className:"text-primary",children:u.key.categoryName}),t.jsxs(s.Typography,{variant:"caption",children:[u.items.length," ",i.amountFrom," ",u.key.totalCount]})]}),(m=u.items)==null?void 0:m.map((p,f)=>t.jsx(Li,{item:p,onCancel:a,searchTypes:l},f))]},u.key.category)})})})},Mi=({searchTypes:e,navigateFunction:n,currentPath:a,homePath:r="/",className:o,staticAppItems:l,searchEndpointUri:i})=>{var C;const{texts:{appSearch:d}}=c.useContext(s.LuminusComponentsContext),[u,m]=c.useState(e.length>0?((C=e.at(0))==null?void 0:C.key)??null:null),p=c.useMemo(()=>e.find(y=>y.key===u)??null,[e,u]),[f,x]=c.useState(""),[h,g]=s.a(encodeURIComponent(f),500),{isLoading:b,searchItems:v}=da(u,h,i,!1,l),[j,N]=c.useState(!1);c.useEffect(()=>{(v.length>0||b)&&N(!0)},[v,b]);const S=c.useRef(null);return c.useEffect(()=>{var y;x(""),a===r&&((y=S.current)==null||y.focus())},[a,r]),t.jsx(s.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:y=>{y.preventDefault(),y.stopPropagation(),g.flush(),N(!1),h.length>2&&n(`/search?query=${h}${p&&p.key&&`&type=${p==null?void 0:p.key}`}`)},children:t.jsxs(Nt,{className:s.classNames(Pe.inputGroup,o),children:[t.jsx(Nt.Text,{className:s.classNames("p-1 rounded",Pe.inputGroupText,Pe.left),children:t.jsx(Ni,{searchTypes:e,selectedType:p,setSelectedType:m})}),t.jsx(s.Form.Control,{ref:S,placeholder:d.searchPlaceholder,type:"text",size:"sm",className:s.classNames("luminus-app-search-input",Pe.input),value:f,onChange:y=>{var k;return x(((k=y.target)==null?void 0:k.value)??"")},onFocus:()=>v.length>0&&N(!0)}),t.jsx(Nt.Text,{className:s.classNames("p-0 rounded",Pe.inputGroupText,Pe.right),children:t.jsx("button",{type:"submit",className:s.classNames("text-primary",Pe.submitButton),children:t.jsx(s.FaSearch,{})})}),t.jsx(Ei,{query:h,searchTypes:e,show:j,onCancel:()=>N(!1),groups:v,isLoading:b})]})})},Fi=({item:e,searchTypes:n})=>{const{ProjectIconComponent:a}=c.useContext(s.LuminusComponentsContext),r=c.useMemo(()=>n.find(i=>i.key===e.type),[e.type,n]),o=c.useMemo(()=>la(e,r,n),[e,r,n]),l=c.useMemo(()=>ca(e,r),[e,r]);return t.jsxs(Z.Link,{to:o,className:"text-nowrap list-group-item list-group-item-action d-flex justify-content-between align-items-center",children:[t.jsx(s.Typography,{variant:"body",children:l}),t.jsx(a,{icon:"chevron-right",className:"text-primary"})]})},Oi=({query:e,type:n,appSearchTypes:a,searchEndpointUri:r,staticAppItems:o})=>{var p,f;const{texts:{appSearch:l}}=c.useContext(s.LuminusComponentsContext),[i,d]=c.useState(""),{searchItems:u,isLoading:m}=da(n,e,r,!0,o);return c.useEffect(()=>{var x;i||u===null||u.length===0||d(((x=u[0].key)==null?void 0:x.category)??"")},[u,i]),u===null?null:t.jsx(s.PageContainer,{variant:"fullScreen",children:m?t.jsx(ve.Loading,{}):u.length===0?t.jsx("div",{className:"alert alert-warning",children:t.jsx(s.Typography,{variant:"body",children:l.noResultsFor(e)})}):t.jsxs(t.Fragment,{children:[t.jsx(mn,{activeTab:i,onSelect:x=>d((x==null?void 0:x.toString())??""),children:u.map(x=>{var h,g;return t.jsx(pn,{eventKey:((h=x.key)==null?void 0:h.category)??"",children:((g=x.key)==null?void 0:g.categoryName)??""},x.key.category)})}),t.jsx(ra,{eventKey:i,activeTab:i,fullHeightNoOverflow:!0,children:t.jsx("div",{className:"list-group h-100 overflow-auto",children:(f=(p=u.find(x=>x.key.category===i))==null?void 0:p.items)==null?void 0:f.map((x,h)=>t.jsx(Fi,{item:x,searchTypes:a},h))})})]})})},Ai=()=>{const{texts:{userSettings:e}}=c.useContext(s.LuminusComponentsContext),[n,a]=de.useLocalStorageState("file-download-try-opening",!0);return t.jsx(Re,{collapsible:!0,title:e.downloads,defaultOpen:!0,children:t.jsx(Ze,{type:"switch",value:n===void 0?!0:n,onChange:a,label:e.tryOpenFileLabel})})},Ri=({show:e,handleClose:n,onConfirm:a,apiCreateBackup:r})=>{const{texts:{userSettings:o}}=c.useContext(s.LuminusComponentsContext),{zStringRequired:l}=s.useZodSchemaTypes(),{addNotification:i}=s.useNotifications(),d=s.useAxios(),{startLoading:u,stopLoading:m}=c.useContext(s.LoadingContext),[p,f]=c.useState(null),x=s.z.object({name:l()}),h=oe.useForm({resolver:s.t(x)}),g=c.useCallback(async(v,j)=>(u("localStorageSettingPost"),d.post(r,{name:v,setting:j}).then(()=>!0).catch(()=>!1).finally(()=>m("localStorageSettingPost"))),[d,r,u,m]),b=async v=>{await g(v.name,JSON.stringify(p))&&(i(o.localStorageCreateBackupSuccess,"success"),a())};return c.useEffect(()=>{e&&f(ye.dumpLocalStorage())},[e]),t.jsxs(s.Modal,{show:e,onHide:()=>n(),children:[t.jsx(s.Modal.Header,{closeButton:!0,children:t.jsx(s.Modal.Title,{children:o.localStorageCreateBackup})}),t.jsx(oe.FormProvider,{...h,children:t.jsxs(s.Form,{onSubmit:h.handleSubmit(b),noValidate:!0,children:[t.jsxs(s.Modal.Body,{children:[t.jsx(s.Alert,{variant:"info",size:"sm",children:o.localStorageCreateBackupInfo(Object.keys(p||{}).length)}),t.jsx(s.HookFormTextInput,{required:!0,label:o.localStorageCreateBackupName,formField:"name",type:"text"})]}),t.jsx(s.Modal.Footer,{className:"justify-content-end",children:t.jsx(s.PrimaryButton,{type:"submit",children:o.localStorageCreateBackupSave})})]})})]})},jt={apiGetBackups:"/localStorageSettings",apiCreateBackup:"/localStorageSettings",apiDeleteBackup:"/localStorageSettings"},Pi=({apiUrls:{apiGetBackups:e=jt.apiGetBackups,apiCreateBackup:n=jt.apiCreateBackup,apiDeleteBackup:a=jt.apiDeleteBackup}=jt})=>{const{ProjectIconComponent:r,texts:{userSettings:o}}=c.useContext(s.LuminusComponentsContext),{confirm:l}=s.useConfirm(),i=s.useAxios(),{startLoading:d,stopLoading:u}=c.useContext(s.LoadingContext),{addNotification:m}=s.useNotifications(),[p,f]=c.useState(!1),{data:x,setData:h,reloadData:g}=de.useGetApiData(e),b=c.useCallback(async N=>(d("localStorageSettingDelete"),i.delete(`${a}/${N}`).then(()=>!0).catch(()=>!1).finally(()=>u("localStorageSettingDelete"))),[i,a,d,u]),v=c.useCallback(async N=>{await l(o.localStorageDeleteBackupConfirm)&&await b(N)&&(m(o.localStorageDeleteBackupSuccess,"success"),h(S=>(S==null?void 0:S.filter(C=>C.id!==N))??null))},[l,o,b,m,h]),j=c.useCallback(async N=>{N.setting&&await l(o.localStorageLoadBackup)&&(ye.restoreLocalStorage(N.setting)?m(o.localStorageLoadBackupSuccess,"success"):m(o.localStorageLoadBackupError,"danger"))},[l,o,m]);return t.jsxs(Re,{collapsible:!0,title:o.localStorage,defaultOpen:!0,children:[t.jsx(s.ContextButton,{className:"mb-2",onClick:()=>f(!0),children:o.localStorageCreateBackup}),x&&x.length>0?t.jsx("div",{className:"list-group",children:x.map((N,S)=>t.jsxs("div",{role:"button",className:"list-group-item list-group-item-action d-flex justify-content-between align-items-center",onClick:()=>j(N),children:[t.jsx(s.Typography,{variant:"body2",children:N.name}),t.jsxs("div",{className:"d-flex align-items-center gap-3",children:[t.jsx(s.Typography,{variant:"body2",className:"text-muted",children:N.date?s.formatDate(N.date):""}),t.jsx(s.IconButton,{size:"sm",color:"danger",onClick:C=>{C.stopPropagation(),v(N.id)},children:t.jsx(r,{icon:"delete"})})]})]},S))}):x?t.jsx(s.Alert,{variant:"secondary",size:"sm",children:o.localStorageNoBackups}):null,t.jsx(Ri,{show:p,handleClose:()=>f(!1),onConfirm:()=>{f(!1),g()},apiCreateBackup:n})]})},Bi=()=>{const{texts:{userSettings:e}}=c.useContext(s.LuminusComponentsContext),[n,a]=de.useLocalStorageState("search-use-asterisk",!0);return t.jsx(Re,{collapsible:!0,title:e.searchSettings,defaultOpen:!0,children:t.jsx(Ze,{type:"switch",value:n===void 0?!0:n,onChange:a,label:e.searchSettingsUseAsterisk})})},$i="_widgets-row_13gg1_1",zi="_widget_13gg1_1",Hi="_widget-img_13gg1_5",Vi="_widget-title-spacer_13gg1_14",Ui="_widget-title_13gg1_14",Wi="_title_13gg1_28",Ne={widgetsRow:$i,widget:zi,widgetImg:Hi,widgetTitleSpacer:Vi,widgetTitle:Ui,title:Wi},Gi=({show:e,widgetGroups:n,widgets:a,handleClose:r,onWidgetPicked:o,texts:l})=>{const[i,d]=c.useState(""),u=c.useMemo(()=>a.filter(p=>p.id!==-1&&s.stringSearchWithin(p.name,i)),[a,i]),m=c.useMemo(()=>n.filter(p=>u.some(f=>f.group===p.id)),[n,u]);return t.jsxs(s.Modal,{show:e,onHide:()=>r(),size:"lg",children:[t.jsxs(s.Modal.Header,{closeButton:!0,children:[t.jsx(s.Modal.Title,{className:"w-100",children:l.pickWidgetToAdd}),t.jsx(s.Form.Control,{type:"search",size:"sm",value:i,placeholder:l.searchPlaceholder,onChange:p=>{var f;return d(((f=p.target)==null?void 0:f.value)??"")},className:"me-3",style:{maxWidth:"200px"}})]}),t.jsx(s.Modal.Body,{className:"flex-column gap-3",children:u.length===0?t.jsx(s.Alert,{variant:"warning",children:l.noWidgets}):t.jsxs(t.Fragment,{children:[m.map(p=>t.jsx(ut,{defaultOpen:!0,title:p.name??"",children:t.jsx("div",{className:"p-1",children:t.jsx("div",{className:s.classNames("row gx-3 gy-3",Ne.widgetsRow),children:u.filter(f=>f.group===p.id).map(f=>t.jsx("div",{className:"col col-4",children:t.jsxs("div",{role:"button",className:s.classNames("p-0 pt-2 bg-white rounded shadow-sm",Ne.widget),onClick:()=>o(f.id),children:[t.jsx("div",{className:Ne.widgetImg,style:{backgroundImage:f.img?`url(${f.img})`:void 0}}),t.jsx("div",{className:Ne.widgetTitleSpacer}),t.jsx("div",{className:s.classNames(Ne.widgetTitle,"rounded"),children:t.jsx(s.Typography,{variant:"body",className:s.classNames(Ne.title,"text-white text-truncate"),children:f.name})})]},f.id)}))})})},p.id)),u.some(p=>p.group===void 0)&&t.jsx(ut,{defaultOpen:!0,title:l.otherWidgets,children:t.jsx("div",{className:"p-1",children:t.jsx("div",{className:s.classNames("row gx-3 gy-3",Ne.widgetsRow),children:u.filter(p=>p.group===void 0).map(p=>t.jsx("div",{className:"col col-4",children:t.jsxs("div",{role:"button",className:s.classNames("p-0 pt-2 bg-white rounded shadow-sm",Ne.widget),onClick:()=>o(p.id),children:[t.jsx("div",{className:Ne.widgetImg,style:{backgroundImage:p.img?`url(${p.img})`:void 0}}),t.jsx("div",{className:Ne.widgetTitleSpacer}),t.jsx("div",{className:s.classNames(Ne.widgetTitle,"rounded"),children:t.jsx(s.Typography,{variant:"body",className:s.classNames(Ne.title,"text-white text-truncate"),children:p.name})})]},p.id)}))})})})]})})]})},Yi="_widget_19xgl_1",qi="_mobile_19xgl_7",Un={widget:Yi,mobile:qi},ua=({widgetGroups:e,availableWidgets:n,onAdd:a,texts:r})=>{const[o,l]=c.useState(!1),{isMobile:i}=s.useWindowSize();return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:s.classNames("luminus-empty-widget",Un.widget,{[Un.mobile]:i}),children:t.jsx(s.IconButton,{onClick:()=>l(!0),children:t.jsx(s.MdOutlineAddCircleOutline,{})})}),t.jsx(Gi,{show:o,widgetGroups:e,widgets:n,handleClose:()=>l(!1),onWidgetPicked:d=>{l(!1),a(d)},texts:r})]})},Ki="_dashboard_1gf59_1",Qi="_widgets-grid_1gf59_1",Zi="_widget-wrapper_1gf59_8",Xi="_full-width_1gf59_13",Ji="_widget-edit_1gf59_16",el="_remove-icon_1gf59_19",tl="_full-width-icon_1gf59_26",nl="_widget-edit-overlay_1gf59_36",sl="_mobile_1gf59_45",De={dashboard:Ki,widgetsGrid:Qi,widgetWrapper:Zi,fullWidth:Xi,widgetEdit:Ji,removeIcon:el,fullWidthIcon:tl,widgetEditOverlay:nl,mobile:sl},al=({widget:e,onIndex:n,fullWidth:a,editMode:r,widgetGroups:o,availableWidgets:l,onRemove:i,onToggleFullWidth:d,onAdd:u})=>{const{texts:{homeDashboard:m}}=c.useContext(s.LuminusComponentsContext);return e?t.jsxs("div",{className:s.classNames(De.widgetWrapper,{[De.widgetEdit]:r&&e.id!==-1},{[De.fullWidth]:a}),children:[r&&t.jsxs(t.Fragment,{children:[t.jsx(s.IconButton,{color:"danger",onClick:()=>i(n),className:s.classNames(De.removeIcon),children:t.jsx(s.MdOutlineDelete,{})}),t.jsx(s.IconButton,{color:a?"danger":"primary",onClick:()=>d(n),className:s.classNames(De.fullWidthIcon),children:t.jsx(s.MdOutlineExpand,{})})]}),e.id===-1?r&&t.jsx("div",{className:De.widgetWrapper,children:t.jsx(ua,{widgetGroups:o,availableWidgets:l,onAdd:p=>u(n,p),texts:m})}):t.jsx(qc,{title:e.title,children:t.jsx(e.WidgetElement,{title:e.title})}),e.id>-1&&r&&t.jsx("div",{className:De.widgetEditOverlay})]},n):null},rl=(e,n="dashboardConfig")=>{const[a,r]=c.useState({widgets:[]});c.useEffect(()=>{const l=localStorage.getItem(n);l?r(JSON.parse(l)):e&&r(e)},[e,n]);const o=c.useCallback(l=>{r(l),localStorage.setItem(n,JSON.stringify(l))},[n]);return{dashboardConfig:a,onChangeDashboardConfig:o}},ol=({widgetGroups:e,availableWidgets:n,editMode:a,defaultDashboardConfig:r,dashboardConfigKey:o})=>{var x;const{texts:{homeDashboard:l}}=c.useContext(s.LuminusComponentsContext),{dashboardConfig:i,onChangeDashboardConfig:d}=rl(r,o),u=c.useCallback((h,g)=>{var b,v;h===((b=i.widgets)==null?void 0:b.length)?d({...i,widgets:[...i.widgets,{widgetId:g,fullWidth:!1}]}):d({...i,widgets:((v=i.widgets)==null?void 0:v.map((j,N)=>N===h?{widgetId:g,fullWidth:!1}:j))??[]})},[i,d]),m=c.useCallback(h=>{var g,b;((g=i.widgets[h])==null?void 0:g.widgetId)===-1?d({...i,widgets:((b=i.widgets)==null?void 0:b.filter((v,j)=>j!==h))??[]}):u(h,-1)},[i,d,u]),p=c.useCallback(h=>{var g;d({...i,widgets:((g=i.widgets)==null?void 0:g.map((b,v)=>v===h?{...b,fullWidth:!b.fullWidth}:b))??[]})},[i,d]),{isMobile:f}=s.useWindowSize();return t.jsx("div",{className:s.classNames(De.dashboard,{[De.mobile]:f}),children:t.jsxs("div",{className:s.classNames(De.widgetsGrid),children:[(x=i.widgets)==null?void 0:x.map((h,g)=>t.jsx(al,{widget:n.find(b=>b.id===h.widgetId),onIndex:g,fullWidth:h.fullWidth,editMode:a,widgetGroups:e,availableWidgets:n,onRemove:m,onToggleFullWidth:p,onAdd:u},`${h.widgetId}-${g}`)),a&&t.jsx(ua,{widgetGroups:e,availableWidgets:n,onAdd:h=>{var g;return u((g=i.widgets)==null?void 0:g.length,h)},texts:l})]})})},il="_badge_193ci_1",ll="_sm_193ci_6",cl="_md_193ci_10",dl="_lg_193ci_14",ul="_light_193ci_18",$t={badge:il,sm:ll,md:cl,lg:dl,light:ul},ml=({children:e,color:n="primary",size:a="md",rounded:r,className:o,variant:l="filled",...i})=>{const d=c.useMemo(()=>l==="filled"?s.classNames(`bg-${n}`):l==="outline"?s.classNames(`text-${n} border-${n} border bg-white`):"",[n,l]);return t.jsx("span",{className:s.classNames("luminus-badge badge",d,o,{"rounded-pill":r},{"text-dark":n==="light"},{[$t.light]:n==="light"},$t.badge,$t[a]),...i,children:e})},pl="_collapse-icon_1ahhn_1",fl="_collapsed_1ahhn_6",Wn={collapseIcon:pl,collapsed:fl},ut=({title:e,children:n,className:a,...r})=>{const o=r.controlled?!1:r.defaultOpen??!1,[l,i]=c.useState(o),d=r.controlled?r.isOpen:l;return c.useEffect(()=>{i(o)},[o]),t.jsxs("div",{className:a??"",children:[t.jsxs("div",{role:"button",className:"d-flex align-items-center justify-content-between pb-3 pt-2",onClick:()=>r.controlled?r.onToggle(!r.isOpen):i(!l),children:[t.jsx(s.Typography,{variant:"h6",children:e}),t.jsx(s.MdOutlineChevronRight,{className:s.classNames(Wn.collapseIcon,{[Wn.collapsed]:d})})]}),t.jsx(an,{in:d,children:t.jsx("div",{children:n})}),t.jsx("hr",{className:`my-0 ${d?"mt-3":""}`})]})},hl="_card_19733_1",gl="_header_19733_6",xl="_header-content_19733_13",vl="_title_19733_19",yl="_collapse-icon_19733_22",jl="_collapsed_19733_27",bl="_content_19733_30",Be={card:hl,header:gl,headerContent:xl,title:vl,collapseIcon:yl,collapsed:jl,content:bl},Re=({title:e,headerContent:n,children:a,className:r,headerClassName:o,contentClassName:l,dontRenderIfNoChildren:i,...d})=>{const u=d.collapsible?d.controlled?!1:d.defaultOpen??!1:!0,[m,p]=c.useState(u),f=d.collapsible?d.controlled?d.isOpen:m:!0;c.useEffect(()=>{p(u)},[u]);const x=c.useMemo(()=>!a||!a.toString()||a.toString().split(",").filter(h=>h&&h!=="false").length===0,[a]);return i&&x?null:t.jsxs("div",{className:s.classNames("luminus-card rounded shadow-sm",Be.card,{[r??""]:r}),children:[t.jsxs("div",{role:d.collapsible?"button":void 0,className:s.classNames("header",Be.header,{[o??""]:o}),onClick:()=>{d.collapsible&&(d.controlled?d.onToggle(!d.isOpen):p(!m))},children:[t.jsxs("div",{className:s.classNames("header-content",Be.headerContent),children:[t.jsx(s.Typography,{variant:"h6",className:s.classNames("text-primary",Be.title),children:e}),n??null]}),d.collapsible&&t.jsx(s.MdOutlineChevronRight,{className:s.classNames(Be.collapseIcon,{[Be.collapsed]:f})})]}),t.jsx(an,{in:f,children:t.jsx("div",{className:s.classNames("card-content border-top border-primary",Be.content,{[l??""]:l}),children:a})})]})};var Cl=!!(typeof window<"u"&&window.document&&window.document.createElement),Nl=function(){function e(n,a){for(var r=0;r<a.length;r++){var o=a[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}return function(n,a,r){return a&&e(n.prototype,a),r&&e(n,r),n}}();function wl(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Sl(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:e}function Il(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}var ma=function(e){Il(n,e);function n(){return wl(this,n),Sl(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return Nl(n,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return Cl?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),St.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),n}(c.Component);ma.propTypes={children:s.PropTypes.node.isRequired,node:s.PropTypes.any};var kl=function(){function e(n,a){for(var r=0;r<a.length;r++){var o=a[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}return function(n,a,r){return a&&e(n.prototype,a),r&&e(n,r),n}}();function Dl(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Tl(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:e}function _l(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}var pa=function(e){_l(n,e);function n(){return Dl(this,n),Tl(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return kl(n,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(r){this.renderPortal()}},{key:"componentWillUnmount",value:function(){St.unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(r){!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var o=this.props.children;typeof this.props.children.type=="function"&&(o=c.cloneElement(this.props.children)),this.portal=St.unstable_renderSubtreeIntoContainer(this,o,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),n}(c.Component);pa.propTypes={children:s.PropTypes.node.isRequired,node:s.PropTypes.any};var Qt=void 0;St.createPortal?Qt=ma:Qt=pa;const gn=({src:e,alt:n,baseUrl:a,customToken:r,placeholder:o,renderAsDivBg:l,...i})=>l?t.jsx("div",{...i,style:{backgroundImage:e?`url(${e})`:void 0,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"}}):t.jsx("img",{...i,alt:n??"",src:e??o}),Ll="_lightbox_1kenb_1",El="_show_1kenb_16",Ml="_header_1kenb_20",Fl="_photo-actions_1kenb_26",Ol="_photo-container_1kenb_31",Al="_photo_1kenb_26",Rl="_nav-button_1kenb_46",Pl="_photos-preview-container_1kenb_53",Bl="_lightbox-draggable-photo_1kenb_67",$l="_selected_1kenb_75",zl="_indicators_1kenb_79",Hl="_left_1kenb_111",Vl="_right_1kenb_114",Ul="_dragging_1kenb_125",xe={lightbox:Ll,show:El,header:Ml,photoActions:Fl,photoContainer:Ol,photo:Al,navButton:Rl,photosPreviewContainer:Pl,lightboxDraggablePhoto:Bl,selected:$l,indicators:zl,left:Hl,right:Vl,dragging:Ul};function mt(e){"@babel/helpers - typeof";return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},mt(e)}function Wl(e,n){if(mt(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,n);if(mt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Gl(e){var n=Wl(e,"string");return mt(n)=="symbol"?n:n+""}function ht(e,n,a){return(n=Gl(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Gn(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function Yn(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Gn(Object(a),!0).forEach(function(r){ht(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Gn(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}var Yl={top:function(n,a){return Math.abs(a.y-n.top)},right:function(n,a){return Math.abs(n.right-a.x)},bottom:function(n,a){return Math.abs(n.bottom-a.y)},left:function(n,a){return Math.abs(a.x-n.left)}},fa=Symbol("closestEdge");function ql(e,n){var a,r,o=n.element,l=n.input,i=n.allowedEdges,d={x:l.clientX,y:l.clientY},u=o.getBoundingClientRect(),m=i.map(function(f){return{edge:f,value:Yl[f](u,d)}}),p=(a=(r=m.sort(function(f,x){return f.value-x.value})[0])===null||r===void 0?void 0:r.edge)!==null&&a!==void 0?a:null;return Yn(Yn({},e),{},ht({},fa,p))}function ha(e){var n;return(n=e[fa])!==null&&n!==void 0?n:null}function Kl(e){var n=e.startIndex,a=e.closestEdgeOfTarget,r=e.indexOfTarget;if(n===-1||r===-1||n===r)return n;if(a==null)return r;var o=a==="right",l=n<r;return l?o?r:r-1:o?r+1:r}function Ql(e){if(Array.isArray(e))return e}function Zl(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r,o,l,i,d=[],u=!0,m=!1;try{if(l=(a=a.call(e)).next,n!==0)for(;!(u=(r=l.call(a)).done)&&(d.push(r.value),d.length!==n);u=!0);}catch(p){m=!0,o=p}finally{try{if(!u&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(m)throw o}}return d}}function Zt(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=Array(n);a<n;a++)r[a]=e[a];return r}function ga(e,n){if(e){if(typeof e=="string")return Zt(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Zt(e,n):void 0}}function Xl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
7
|
+
prefix: `+a+`
|
|
8
|
+
allowNegative: `+r+`
|
|
9
|
+
`),r=!1),Object.assign(Object.assign({},n),{allowNegative:r})}function Ca(n){n=Sa(n),n.decimalSeparator,n.allowedDecimalSeparators,n.thousandsGroupStyle;var e=n.suffix,t=n.allowNegative,o=n.allowLeadingZeros,a=n.onKeyDown;a===void 0&&(a=ft);var r=n.onBlur;r===void 0&&(r=ft);var i=n.thousandSeparator,c=n.decimalScale,u=n.fixedDecimalScale,m=n.prefix;m===void 0&&(m="");var d=n.defaultValue,f=n.value,p=n.valueIsNumericString,g=n.onValueChange,x=yo(n,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),y=tn(n),h=y.decimalSeparator,v=y.allowedDecimalSeparators,b=function(T){return os(T,n)},w=function(T,F){return ba(T,F,n)},S=kt(f)?d:f,j=p??va(S,m,e);kt(f)?kt(d)||(j=j||typeof d=="number"):j=j||typeof f=="number";var C=function(T){return vo(T)?T:(typeof T=="number"&&(T=So(T)),j&&typeof c=="number"?ns(T,c,!!u):T)},I=wo(C(f),C(d),!!j,b,w,g),k=I[0],L=k.numAsString,E=k.formattedValue,D=I[1],_=function(T){var F=T.target,P=T.key,M=F.selectionStart,O=F.selectionEnd,z=F.value;if(z===void 0&&(z=""),(P==="Backspace"||P==="Delete")&&O<m.length){T.preventDefault();return}if(M!==O){a(T);return}P==="Backspace"&&z[0]==="-"&&M===m.length+1&&t&&St(F,1),c&&u&&(P==="Backspace"&&z[M-1]===h?(St(F,M-1),T.preventDefault()):P==="Delete"&&z[M]===h&&T.preventDefault()),v!=null&&v.includes(P)&&z[M]===h&&St(F,M+1);var H=i===!0?",":i;P==="Backspace"&&z[M-1]===H&&St(F,M-1),P==="Delete"&&z[M]===H&&St(F,M+1),a(T)},R=function(T){var F=L;if(F.match(/\d/g)||(F=""),o||(F=aa(F)),u&&c&&(F=ns(F,c,u)),F!==L){var P=os(F,n);D({formattedValue:P,value:F,floatValue:parseFloat(F)},{event:T,source:Ft.event})}r(T)},$=function(T){return T===h?!0:Pt(T)},A=function(T){var F=T.currentValue,P=T.lastValue,M=T.formattedValue,O=T.currentValueIndex,z=T.formattedValueIndex,H=F[O],W=M[z],B=Co(P,F),U=B.to,V=function(X){return w(X).indexOf(".")+m.length};return f===0&&u&&c&&F[U.start]===h&&V(F)<O&&V(M)>z?!1:O>=U.start&&O<U.end&&v&&v.includes(H)&&W===h?!0:H===W};return Object.assign(Object.assign({},x),{value:E,valueIsNumericString:!1,isValidInputCharacter:$,isCharacterSame:A,onValueChange:D,format:b,removeFormatting:w,getCaretBoundary:function(T){return ja(T,n)},onKeyDown:_,onBlur:R})}function Pn(n){var e=Ca(n);return N.createElement(ga,Object.assign({},e))}const No=({InputContainer:n=l.FloatingLabelInput,value:e,onChange:t,debounceMs:o,label:a,withoutLabel:r,placeholder:i,size:c,hidden:u,disabled:m,showClearIcon:d,clearValue:f,className:p,step:g,noSelectOnFocus:x,decimalScale:y,fixedDecimalScale:h=!1,numberPrefix:v,numberSuffix:b,min:w,max:S,hint:j})=>{const C=N.useCallback(()=>{if(!t)return;const _=f??null;t(_?Number(_):null)},[f,t]),I=N.useRef(null),[k,L]=N.useState((e==null?void 0:e.toString())??""),E=N.useCallback(_=>{const R=_;t&&t(R==null||R===""?null:Number(R))},[t]),D=N.useCallback(_=>{var $,A;let R=parseFloat(((A=($=_.target)==null?void 0:$.value)==null?void 0:A.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(R)&&(R=0),!o){E(R.toString());return}L(R.toString()),I.current!==null&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>{E(R.toString())},o)},[o,E]);return N.useEffect(()=>{L(e===null?"":e.toString())},[S,w,e]),N.useEffect(()=>{S!==void 0&&Number(k)>S&&L(S.toString()),w!==void 0&&Number(k)<w&&L(w.toString())},[k,S,w,L]),N.useEffect(()=>{!t||e===null||(S!==void 0&&e>S&&t(S),w!==void 0&&e<w&&t(w))},[e,S,w,t]),s.jsxs(n,{withoutLabel:r,label:a??"",hidden:u,className:p,hint:j,disabled:m,children:[s.jsx(Pn,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:y,fixedDecimalScale:h,prefix:v,suffix:b,defaultValue:"",value:o?k:(e==null?void 0:e.toString())??"",placeholder:i??a,onFocus:_=>{!x&&_.target.select()},onChange:D,hidden:u,disabled:m,className:l.classNames("form-control text-end w-100",{[`form-control-${c}`]:c}),step:g,min:w,max:S}),d&&e!==null&&t&&!m&&s.jsx("div",{className:"luminus-input-remove-icon inset",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:C,children:s.jsx(l.MdClear,{})})})]})},Io=n=>{const e=l.compilerRuntimeExports.c(21),{InputContainer:t,label:o,options:a,disabled:r,hidden:i,className:c,value:u,onChange:m}=n,d=t===void 0?l.RowLabelInput:t;let f;e[0]!==m?(f=v=>{m&&m(v.target.value)},e[0]=m,e[1]=f):f=e[1];const p=f,g=!o,x=`${o}`;let y;if(e[2]!==r||e[3]!==p||e[4]!==i||e[5]!==a||e[6]!==u){let v;e[8]!==r||e[9]!==p||e[10]!==i||e[11]!==u?(v=b=>s.jsx(l.Form.Check,{id:`radio-${b.id}`,label:b.name,type:"radio",value:b.id??"",checked:u===b.id,onChange:p,hidden:i,disabled:r,className:"w-100"},b.id),e[8]=r,e[9]=p,e[10]=i,e[11]=u,e[12]=v):v=e[12],y=a.map(v),e[2]=r,e[3]=p,e[4]=i,e[5]=a,e[6]=u,e[7]=y}else y=e[7];let h;return e[13]!==d||e[14]!==c||e[15]!==r||e[16]!==i||e[17]!==g||e[18]!==x||e[19]!==y?(h=s.jsx(d,{isForRadioInput:!0,hidden:i,withoutLabel:g,label:x,className:c,disabled:r,children:y}),e[13]=d,e[14]=c,e[15]=r,e[16]=i,e[17]=g,e[18]=x,e[19]=y,e[20]=h):h=e[20],h},wa=n=>{const e=l.compilerRuntimeExports.c(39),{InputContainer:t,formField:o,label:a,resetsFields:r,type:i,required:c,hidden:u,disabled:m,withoutLabel:d,hint:f,onChange:p,className:g}=n,x=t===void 0?l.RowLabelInput:t,{register:y,formState:h,setValue:v}=Ie.useFormContext(),{errors:b,isSubmitted:w}=h;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S={falseIfNotInit:!0},e[0]=S):S=e[0];const j=l.useFormDisabledContext(S),[C,I]=N.useState(void 0),[k,L]=N.useState(!1);let E,D;e[1]!==o||e[2]!==b?(E=()=>{const U=o.split(".");let V=b;U.forEach(X=>{V!==void 0&&(V=V[X])}),I(V)},D=[b,o],e[1]=o,e[2]=b,e[3]=E,e[4]=D):(E=e[3],D=e[4]),N.useEffect(E,D);const _=m||j,R=C!==void 0;let $,A;e[5]!==w?($=()=>{w&&L(!0)},A=[w],e[5]=w,e[6]=$,e[7]=A):($=e[6],A=e[7]),N.useEffect($,A);const T=a??"",F=`check-${o}`,P=i??"checkbox",M=`${a}${c?" *":""}`;let O;e[8]!==p||e[9]!==r||e[10]!==v||e[11]!==k?(O=U=>{r&&r.forEach(V=>v(V,null,{shouldDirty:!0,shouldValidate:k})),p&&p(U.target.value??null)},e[8]=p,e[9]=r,e[10]=v,e[11]=k,e[12]=O):O=e[12];let z;e[13]!==o||e[14]!==y||e[15]!==O?(z=y(o,{onChange:O}),e[13]=o,e[14]=y,e[15]=O,e[16]=z):z=e[16];let H;e[17]!==_||e[18]!==u||e[19]!==R||e[20]!==P||e[21]!==M||e[22]!==z||e[23]!==F?(H=s.jsx(l.Form.Check,{id:F,type:P,label:M,...z,isInvalid:R,hidden:u,disabled:_,className:"w-100"}),e[17]=_,e[18]=u,e[19]=R,e[20]=P,e[21]=M,e[22]=z,e[23]=F,e[24]=H):H=e[24];let W;e[25]!==C?(W=C&&s.jsx(l.InvalidFeedback,{message:C.message}),e[25]=C,e[26]=W):W=e[26];let B;return e[27]!==x||e[28]!==_||e[29]!==g||e[30]!==u||e[31]!==f||e[32]!==R||e[33]!==c||e[34]!==H||e[35]!==W||e[36]!==T||e[37]!==d?(B=s.jsxs(x,{isForCheckInput:!0,hidden:u,label:T,required:c,disabled:_,isInvalid:R,withoutLabel:d,hint:f,className:g,children:[H,W]}),e[27]=x,e[28]=_,e[29]=g,e[30]=u,e[31]=f,e[32]=R,e[33]=c,e[34]=H,e[35]=W,e[36]=T,e[37]=d,e[38]=B):B=e[38],B},Na=n=>{const e=l.compilerRuntimeExports.c(46),{InputContainer:t,label:o,formField:a,options:r,resetsFields:i,required:c,disabled:u,hidden:m,onChange:d,className:f}=n,p=t===void 0?l.RowLabelInput:t,{register:g,formState:x,setValue:y}=Ie.useFormContext(),{errors:h,isSubmitted:v}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={falseIfNotInit:!0},e[0]=b):b=e[0];const w=l.useFormDisabledContext(b),[S,j]=N.useState(void 0),[C,I]=N.useState(!1),k=r,L=u||w;let E,D;e[1]!==a||e[2]!==h?(E=()=>{const H=a.split(".");let W=h;H.forEach(B=>{W!==void 0&&(W=W[B])}),j(W)},D=[h,a],e[1]=a,e[2]=h,e[3]=E,e[4]=D):(E=e[3],D=e[4]),N.useEffect(E,D);let _,R;e[5]!==v?(_=()=>{v&&I(!0)},R=[v],e[5]=v,e[6]=_,e[7]=R):(_=e[6],R=e[7]),N.useEffect(_,R);const $=S!==void 0;let A;e[8]!==a?(A={name:a},e[8]=a,e[9]=A):A=e[9];const T=Ie.useWatch(A),F=!o,P=o??"";let M;if(e[10]!==L||e[11]!==a||e[12]!==T||e[13]!==m||e[14]!==$||e[15]!==d||e[16]!==k||e[17]!==g||e[18]!==i||e[19]!==y||e[20]!==C){let H;e[22]!==L||e[23]!==a||e[24]!==T||e[25]!==m||e[26]!==$||e[27]!==d||e[28]!==g||e[29]!==i||e[30]!==y||e[31]!==C?(H=W=>s.jsx(l.Form.Check,{id:`radio-${W.id}`,label:W.name,type:"radio",value:W.id??"",checked:T===W.id,...g(a,{onChange:B=>{var U;i&&i.forEach(V=>y(V,null,{shouldDirty:!0,shouldValidate:C})),d&&d((U=B.target)!=null&&U.value?B.target.value.toString():null)}}),isInvalid:$,hidden:m,disabled:L,className:"w-100"},W.id),e[22]=L,e[23]=a,e[24]=T,e[25]=m,e[26]=$,e[27]=d,e[28]=g,e[29]=i,e[30]=y,e[31]=C,e[32]=H):H=e[32],M=k.map(H),e[10]=L,e[11]=a,e[12]=T,e[13]=m,e[14]=$,e[15]=d,e[16]=k,e[17]=g,e[18]=i,e[19]=y,e[20]=C,e[21]=M}else M=e[21];let O;e[33]!==S?(O=S&&s.jsx(l.InvalidFeedback,{message:S.message}),e[33]=S,e[34]=O):O=e[34];let z;return e[35]!==p||e[36]!==L||e[37]!==f||e[38]!==m||e[39]!==$||e[40]!==c||e[41]!==P||e[42]!==M||e[43]!==O||e[44]!==F?(z=s.jsxs(p,{isForRadioInput:!0,hidden:m,withoutLabel:F,label:P,required:c,disabled:L,isInvalid:$,className:f,children:[M,O]}),e[35]=p,e[36]=L,e[37]=f,e[38]=m,e[39]=$,e[40]=c,e[41]=P,e[42]=M,e[43]=O,e[44]=F,e[45]=z):z=e[45],z},Ia=n=>{const e=l.compilerRuntimeExports.c(25);let t,o,a,r,i,c,u,m,d;e[0]!==n?({label:c,InputContainer:m,className:t,withoutLabel:d,hidden:i,disabled:a,contactType:o,formField:r,...u}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i,e[6]=c,e[7]=u,e[8]=m,e[9]=d):(t=e[1],o=e[2],a=e[3],r=e[4],i=e[5],c=e[6],u=e[7],m=e[8],d=e[9]);const f=m===void 0?l.RowLabelInput:m;let p;e[10]!==r?(p={name:r},e[10]=r,e[11]=p):p=e[11];const g=Ie.useWatch(p);let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x={falseIfNotInit:!0},e[12]=x):x=e[12];const y=l.useFormDisabledContext(x),h=a||y;if(i)return null;let v;e[13]!==f||e[14]!==h||e[15]!==r||e[16]!==u?(v=s.jsx(l.HookFormTextInput,{type:"text",formField:r,InputContainer:f,size:"sm",withoutLabel:!0,className:"flex-grow-1",disabled:h,...u}),e[13]=f,e[14]=h,e[15]=r,e[16]=u,e[17]=v):v=e[17];let b;return e[18]!==t||e[19]!==o||e[20]!==c||e[21]!==v||e[22]!==g||e[23]!==d?(b=s.jsx(xo,{contactType:o,value:g,withoutLabel:d,label:c,className:t,children:v}),e[18]=t,e[19]=o,e[20]=c,e[21]=v,e[22]=g,e[23]=d,e[24]=b):b=e[24],b},ka=({InputContainer:n=l.RowLabelInput,formField:e,label:t,size:o,defaultSelection:a,resetsFields:r,isNumber:i,required:c,hidden:u,disabled:m,items:d,onSearchQueryChange:f,selectedItemNavigateTo:p,texts:g,dropdownItemsNameWidth:x,isLoading:y,withoutLabel:h,additionalColumns:v,CustomOnChangeComponent:b,icon:w,displayIdAsName:S,onSelect:j,className:C,archiveColumn:I,hint:k,addNewOptionPath:L,refreshOptions:E,MiniDetailComponent:D,miniDetailPlacement:_,suggestedItems:R,suggestedItemsTitle:$})=>{const{formState:{errors:A,isSubmitted:T},setValue:F,control:P}=Ie.useFormContext(),M=l.useFormDisabledContext({falseIfNotInit:!0}),[O,z]=N.useState(void 0),[H,W]=N.useState(!1),[B,U]=N.useState(!1),V=Ie.useWatch({name:e})??null,X=Ie.useWatch({name:`${e}-DropdownName`}),Y=V===(a==null?void 0:a.id)?a==null?void 0:a.name:X,Z=N.useMemo(()=>V==null?null:{id:V??null,name:Y??""},[V,Y]),te=N.useCallback(()=>{const G=e.split(".");let oe=A;G.forEach(J=>{oe!==void 0&&(oe=oe[J])}),z(oe)},[A,e]),se=N.useCallback(G=>{if((G==null?void 0:G.id)===V)return;if(j&&j(G),r&&r.forEach(J=>F(J,null,{shouldDirty:!0,shouldValidate:B})),G===null){F(e,null,{shouldDirty:!0,shouldValidate:B}),F(`${e}-DropdownName`,null);return}let oe=null;i?oe=(G==null?void 0:G.id)!==null&&(G==null?void 0:G.id)!==""?parseInt(G.id.toString(),10):null:oe=G.id===null||G.id===void 0||G.id===""?null:G.id,F(e,oe,{shouldDirty:!0,shouldValidate:B}),F(`${e}-DropdownName`,G.name??"")},[F,e,B,i,r,V,j]),q=N.useCallback(G=>{W(!1),se(G)},[se]),ae=N.useCallback(()=>{W(!1)},[]),re=N.useRef(null),me=O!==void 0,fe=p!==void 0,Q=fe&&Z!==null,K=N.useMemo(()=>m||M,[m,M]);return N.useEffect(()=>{te()},[te]),N.useEffect(()=>{T&&U(!0)},[T]),s.jsx(s.Fragment,{children:s.jsxs(n,{label:t??"",required:c,disabled:K,hidden:u,withoutLabel:h,isInvalid:me,inputContainerClassName:l.classNames({"luminus-dropdown-select-open":H}),hint:k,className:C,children:[s.jsxs(l.InputAnchorContainer,{currentSelection:Z,selectedItemNavigateTo:p,children:[S&&(Z==null?void 0:Z.name)&&s.jsx(l.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:Z.name}),s.jsx(Ie.Controller,{control:P,name:e,render:()=>s.jsx(l.MiniDetailWrapper,{value:V,MiniDetailComponent:D,miniDetailPlacement:_,children:s.jsx(l.Form.Select,{size:o,onMouseDown:G=>{G.currentTarget.focus(),G.preventDefault()},onClick:()=>{!fe&&!K&&W(!0)},ref:re,value:V??"",onChange:()=>{},isInvalid:me,hidden:u,className:l.classNames("w-100",{"luminus-dropdown-picker-disabled":K,"luminus-dropdown-picker-link":Q}),children:s.jsx("option",{value:V,children:S?V:(Y==null?void 0:Y.length)>0?Y:V})})})}),b||!K&&fe?s.jsxs("div",{className:"custom-picker-button",children:[!b&&!K&&fe&&s.jsx(l.IconButton,{size:"sm",color:"secondary",onClick:G=>{G.preventDefault(),G.stopPropagation(),W(!0)},children:w??s.jsx(l.MdOutlineEdit,{})}),b??null]}):null]}),O&&s.jsx(l.InvalidFeedback,{message:O.message}),re.current&&s.jsx(l.SimplePicker,{show:H,onCancel:ae,items:d,currentSelection:Z,onSelectionChange:q,onSearchQueryChange:f,texts:g,itemsNameWidth:x,additionalColumns:v,displayIdAsName:S,isLoading:y,disabled:K,inputRef:re,archiveColumn:I,addNewOptionPath:L,refreshOptions:E,suggestedItems:R,suggestedItemsTitle:$})]})})},_a=n=>{const e=l.compilerRuntimeExports.c(51),{InputContainer:t,label:o,formField:a,hidden:r,required:i,placeholder:c,disabled:u,showClearIcon:m,resetsFields:d,multiple:f,accept:p,withoutLabel:g,hint:x,className:y}=n,h=t===void 0?l.RowLabelInput:t,{setValue:v,register:b,formState:w}=Ie.useFormContext(),{errors:S,isSubmitted:j}=w;let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C={falseIfNotInit:!0},e[0]=C):C=e[0];const I=l.useFormDisabledContext(C),[k,L]=N.useState(!1),[E,D]=N.useState(void 0);let _;e[1]!==a||e[2]!==v?(_=()=>{v(a,"")},e[1]=a,e[2]=v,e[3]=_):_=e[3];const R=_;let $;e[4]!==a||e[5]!==S?($=()=>{const q=a.split(".");let ae=S;q.forEach(re=>{ae!==void 0&&(ae=ae[re])}),D(ae)},e[4]=a,e[5]=S,e[6]=$):$=e[6];const A=$;let T;e[7]!==A?(T=[A],e[7]=A,e[8]=T):T=e[8],N.useEffect(A,T);let F,P;e[9]!==j?(F=()=>{j&&L(!0)},P=[j],e[9]=j,e[10]=F,e[11]=P):(F=e[10],P=e[11]),N.useEffect(F,P);const M=u||I,O=E!==void 0;let z;e[12]!==a?(z={name:a},e[12]=a,e[13]=z):z=e[13];const H=Ie.useWatch(z),W=o??"";let B;e[14]!==p?(B=p.join(", "),e[14]=p,e[15]=B):B=e[15];const U=c??o;let V;e[16]!==d||e[17]!==v||e[18]!==k?(V=()=>{d&&d.forEach(q=>v(q,null,{shouldDirty:!0,shouldValidate:k}))},e[16]=d,e[17]=v,e[18]=k,e[19]=V):V=e[19];let X;e[20]!==a||e[21]!==b||e[22]!==V?(X=b(a,{onChange:V}),e[20]=a,e[21]=b,e[22]=V,e[23]=X):X=e[23];let Y;e[24]!==M||e[25]!==r||e[26]!==O||e[27]!==f||e[28]!==B||e[29]!==U||e[30]!==X?(Y=s.jsx(l.FormControl,{type:"file",multiple:f,accept:B,placeholder:U,isInvalid:O,hidden:r,disabled:M,className:"w-100",...X}),e[24]=M,e[25]=r,e[26]=O,e[27]=f,e[28]=B,e[29]=U,e[30]=X,e[31]=Y):Y=e[31];let Z;e[32]!==R||e[33]!==H||e[34]!==m?(Z=m&&H!=null&&s.jsx("div",{className:"luminus-input-remove-icon",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:R,children:s.jsx(l.MdClear,{})})}),e[32]=R,e[33]=H,e[34]=m,e[35]=Z):Z=e[35];let te;e[36]!==E?(te=E&&s.jsx(l.InvalidFeedback,{message:E.message}),e[36]=E,e[37]=te):te=e[37];let se;return e[38]!==h||e[39]!==M||e[40]!==y||e[41]!==r||e[42]!==x||e[43]!==O||e[44]!==i||e[45]!==W||e[46]!==Y||e[47]!==Z||e[48]!==te||e[49]!==g?(se=s.jsxs(h,{label:W,required:i,disabled:M,hidden:r,withoutLabel:g,isInvalid:O,hint:x,className:y,children:[Y,Z,te]}),e[38]=h,e[39]=M,e[40]=y,e[41]=r,e[42]=x,e[43]=O,e[44]=i,e[45]=W,e[46]=Y,e[47]=Z,e[48]=te,e[49]=g,e[50]=se):se=e[50],se},ko=n=>{const e=l.compilerRuntimeExports.c(7),{children:t,onStorno:o,noSpacer:a}=n,{isDirty:r}=Ie.useFormState();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={falseIfNotInit:!0},e[0]=i):i=e[0];const c=l.useFormDisabledContext(i);let u;return e[1]!==t||e[2]!==c||e[3]!==r||e[4]!==a||e[5]!==o?(u=r?s.jsx(mo,{onStorno:o,noSpacer:a,disabled:c,children:t}):null,e[1]=t,e[2]=c,e[3]=r,e[4]=a,e[5]=o,e[6]=u):u=e[6],u},Xt=({InputContainer:n=l.RowLabelInput,options:e,formField:t,label:o,size:a,resetsFields:r,isNumber:i,required:c,hidden:u,disabled:m,withoutLabel:d,noSortOptions:f,suffixIdToName:p,onSelect:g,className:x,appendCurrentSelectionWithName:y,hint:h,addNewOptionPath:v,refreshOptions:b,MiniDetailComponent:w,miniDetailPlacement:S,selectedItemNavigateTo:j,noRemoveButton:C})=>{const{texts:{customSelect:I}}=N.useContext(l.LuminusComponentsContext),{formState:{errors:k,isSubmitted:L},setValue:E,control:D}=Ie.useFormContext(),_=l.useFormDisabledContext({falseIfNotInit:!0}),[R,$]=N.useState(void 0),[A,T]=N.useState(!1),[F,P]=N.useState(!1),[M,O]=N.useState(""),z=Ie.useWatch({name:t}),H=N.useMemo(()=>e.find(q=>q.id===z)??null,[e,z]),W=N.useCallback(()=>{const q=t.split(".");let ae=k;q.forEach(re=>{ae!==void 0&&(ae=ae[re])}),$(ae)},[k,t]),B=N.useCallback(q=>{if((q==null?void 0:q.id)===z)return;if(g&&g(q),r&&r.forEach(re=>E(re,null,{shouldDirty:!0,shouldValidate:F})),q===null){E(t,null,{shouldDirty:!0,shouldValidate:F});return}let ae=null;i?ae=(q==null?void 0:q.id)!==null&&(q==null?void 0:q.id)!==""?parseInt(q.id.toString(),10):null:ae=q.id===null||q.id===void 0||q.id===""?null:q.id,E(t,ae,{shouldDirty:!0,shouldValidate:F})},[E,t,i,r,z,F,g]),U=N.useCallback(q=>{T(!1),B(q)},[B]),V=N.useCallback(q=>{O(q)},[]),X=N.useMemo(()=>m||_,[m,_]);N.useEffect(()=>{W()},[W]),N.useEffect(()=>{L&&P(!0)},[L]);const Y=N.useCallback(q=>{var ae;return q===null?"":!q.name||q.name.length===0?((ae=q.id)==null?void 0:ae.toString())??"":p?`${q.name} (${q.id})`:q.name},[p]),Z=N.useMemo(()=>{const q=e?[...e]:[];return y!==void 0&&z&&(q.some(ae=>ae.id===z)||q.push({id:z,name:y})),q.map(ae=>({id:ae.id,name:Y(ae)})).filter(ae=>l.stringSearchWithin(ae.name,M)).sort((ae,re)=>f?0:(ae.name??"").localeCompare(re.name??""))},[e,f,M,Y,y,z]),te=N.useRef(null),se=R!==void 0;return s.jsx(s.Fragment,{children:s.jsxs(n,{label:o??"",required:c,disabled:X,hidden:u,withoutLabel:d,isInvalid:se,inputContainerClassName:l.classNames({"luminus-dropdown-select-open":A}),hint:h,className:x,children:[s.jsx(l.InputAnchorContainer,{currentSelection:H,selectedItemNavigateTo:j,children:s.jsx(Ie.Controller,{control:D,name:t,render:()=>s.jsx(l.MiniDetailWrapper,{value:z,MiniDetailComponent:w,miniDetailPlacement:S,children:s.jsx(l.Form.Select,{size:a,onMouseDown:q=>{q.currentTarget.focus(),q.preventDefault()},onClick:()=>{T(!0)},ref:te,value:z??"",onChange:()=>{},isInvalid:se,hidden:u,disabled:X,className:"w-100",children:s.jsx("option",{value:(H==null?void 0:H.id)??"",children:Y(H)})})})})}),R&&s.jsx(l.InvalidFeedback,{message:R.message}),te.current&&s.jsx(l.SimplePicker,{show:A,onCancel:()=>T(!1),items:Z,currentSelection:H??null,onSelectionChange:U,onSearchQueryChange:V,texts:I,disabled:X,inputRef:te,autoHideSearch:!0,allItemsLength:e.length,addNewOptionPath:v,refreshOptions:b,noRemoveButton:C})]})})},Da=n=>{const e=l.compilerRuntimeExports.c(87),{InputContainer:t,formField:o,label:a,placeholder:r,size:i,resetsFields:c,showClearIcon:u,clearValue:m,required:d,hidden:f,disabled:p,withoutLabel:g,step:x,stepperStep:y,className:h,min:v,max:b,onChange:w,hint:S}=n,j=t===void 0?l.RowLabelInput:t,C=y===void 0?1:y,{register:I,formState:k,setValue:L}=Ie.useFormContext(),{errors:E,isSubmitted:D}=k;let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={falseIfNotInit:!0},e[0]=_):_=e[0];const R=l.useFormDisabledContext(_),[$,A]=N.useState(void 0),[T,F]=N.useState(!1);let P;e[1]!==b||e[2]!==v||e[3]!==L?(P=(de,be,we)=>{L(de,Ke.limitNumber(be,v,b),we)},e[1]=b,e[2]=v,e[3]=L,e[4]=P):P=e[4];const M=P;let O;e[5]!==m||e[6]!==o||e[7]!==M||e[8]!==T?(O=()=>{const de=m??null;M(o,de!==null?Number(de):null,{shouldDirty:!0,shouldValidate:T})},e[5]=m,e[6]=o,e[7]=M,e[8]=T,e[9]=O):O=e[9];const z=O;let H;e[10]!==o||e[11]!==E?(H=()=>{const de=o.split(".");let be=E;de.forEach(we=>{be!==void 0&&(be=be[we])}),A(be)},e[10]=o,e[11]=E,e[12]=H):H=e[12];const W=H,B=p||R;let U,V;e[13]!==W?(U=()=>{W()},V=[W],e[13]=W,e[14]=U,e[15]=V):(U=e[14],V=e[15]),N.useEffect(U,V);let X,Y;e[16]!==D?(X=()=>{D&&F(!0)},Y=[D],e[16]=D,e[17]=X,e[18]=Y):(X=e[17],Y=e[18]),N.useEffect(X,Y);const Z=$!==void 0;let te;e[19]!==o?(te={name:o},e[19]=o,e[20]=te):te=e[20];const se=Ie.useWatch(te),q=a??"",ae=r??a;let re;e[21]!==b||e[22]!==v?(re=de=>de==null||de===""?null:Ke.limitNumber(Number(de),v,b),e[21]=b,e[22]=v,e[23]=re):re=e[23];let me;e[24]!==w||e[25]!==c||e[26]!==L||e[27]!==T?(me=de=>{var be;c&&c.forEach(we=>L(we,null,{shouldDirty:!0,shouldValidate:T})),w&&w((be=de.target)!=null&&be.value?Number(de.target.value)??null:null)},e[24]=w,e[25]=c,e[26]=L,e[27]=T,e[28]=me):me=e[28];let fe;e[29]!==o||e[30]!==b||e[31]!==v||e[32]!==I||e[33]!==re||e[34]!==me?(fe=I(o,{setValueAs:re,min:v,max:b,onChange:me}),e[29]=o,e[30]=b,e[31]=v,e[32]=I,e[33]=re,e[34]=me,e[35]=fe):fe=e[35];let Q;e[36]!==B||e[37]!==f||e[38]!==Z||e[39]!==b||e[40]!==v||e[41]!==i||e[42]!==x||e[43]!==ae||e[44]!==fe?(Q=s.jsx(l.Form.Control,{type:"number",placeholder:ae,size:i,...fe,isInvalid:Z,hidden:f,disabled:B,className:"w-100 luminus-numeric-stepper",step:x,min:v,max:b}),e[36]=B,e[37]=f,e[38]=Z,e[39]=b,e[40]=v,e[41]=i,e[42]=x,e[43]=ae,e[44]=fe,e[45]=Q):Q=e[45];let K;e[46]!==se||e[47]!==p||e[48]!==o||e[49]!==M||e[50]!==T||e[51]!==C?(K=!p&&s.jsx(l.IconButton,{size:"sm",onClick:de=>{de.preventDefault(),de.stopPropagation(),M(o,((se?Number(se):0)-C).toString(),{shouldDirty:!0,shouldValidate:T})},children:s.jsx(l.FaMinus,{})}),e[46]=se,e[47]=p,e[48]=o,e[49]=M,e[50]=T,e[51]=C,e[52]=K):K=e[52];let G;e[53]!==K?(G=s.jsx("div",{className:"stepper-icon left",children:K}),e[53]=K,e[54]=G):G=e[54];let oe;e[55]!==se||e[56]!==p||e[57]!==o||e[58]!==M||e[59]!==T||e[60]!==C?(oe=!p&&s.jsx(l.IconButton,{size:"sm",onClick:de=>{de.preventDefault(),de.stopPropagation(),M(o,((se?Number(se):0)+C).toString(),{shouldDirty:!0,shouldValidate:T})},children:s.jsx(l.FaPlus,{})}),e[55]=se,e[56]=p,e[57]=o,e[58]=M,e[59]=T,e[60]=C,e[61]=oe):oe=e[61];let J;e[62]!==oe?(J=s.jsx("div",{className:"stepper-icon right",children:oe}),e[62]=oe,e[63]=J):J=e[63];let ee;e[64]!==Q||e[65]!==G||e[66]!==J?(ee=s.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[Q,G,J]}),e[64]=Q,e[65]=G,e[66]=J,e[67]=ee):ee=e[67];let ne;e[68]!==z||e[69]!==se||e[70]!==u?(ne=u&&se!=null&&s.jsx("div",{className:"luminus-input-remove-icon",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:z,children:s.jsx(l.MdClear,{})})}),e[68]=z,e[69]=se,e[70]=u,e[71]=ne):ne=e[71];let ce;e[72]!==$?(ce=$&&s.jsx(l.InvalidFeedback,{message:$.message}),e[72]=$,e[73]=ce):ce=e[73];let ve;return e[74]!==j||e[75]!==B||e[76]!==h||e[77]!==f||e[78]!==S||e[79]!==Z||e[80]!==d||e[81]!==q||e[82]!==ee||e[83]!==ne||e[84]!==ce||e[85]!==g?(ve=s.jsxs(j,{label:q,required:d,disabled:B,hidden:f,withoutLabel:g,isInvalid:Z,hint:S,className:h,children:[ee,ne,ce]}),e[74]=j,e[75]=B,e[76]=h,e[77]=f,e[78]=S,e[79]=Z,e[80]=d,e[81]=q,e[82]=ee,e[83]=ne,e[84]=ce,e[85]=g,e[86]=ve):ve=e[86],ve},Ta=({InputContainer:n=l.RowLabelInput,formField:e,label:t,placeholder:o,resetsFields:a,showClearIcon:r,clearValue:i,required:c,hidden:u,disabled:m,withoutLabel:d,step:f,size:p,CustomOnChangeComponent:g,noSelectOnFocus:x,className:y,decimalScale:h=2,fixedDecimalScale:v=!1,numberPrefix:b,numberSuffix:w,min:S,max:j,onChange:C,hint:I})=>{const{formState:{errors:k,isSubmitted:L},setValue:E,control:D}=Ie.useFormContext(),_=l.useFormDisabledContext({falseIfNotInit:!0}),[R,$]=N.useState(void 0),[A,T]=N.useState(!1),F=N.useCallback(()=>{const H=i??null;E(e,H!==null?Number(H):null,{shouldDirty:!0,shouldValidate:A})},[i,E,e,A]),P=N.useCallback(()=>{const H=e.split(".");let W=k;H.forEach(B=>{W!==void 0&&(W=W[B])}),$(W)},[k,e]),M=N.useMemo(()=>m||_,[m,_]);N.useEffect(()=>{P()},[P]),N.useEffect(()=>{L&&T(!0)},[L]);const O=Ie.useWatch({name:e});N.useEffect(()=>{j!==void 0&&O>j&&E(e,j),S!==void 0&&O<S&&E(e,S)},[e,O,j,S,E]);const z=R!==void 0;return s.jsxs(n,{label:t??"",required:c,disabled:M,hidden:u,withoutLabel:d,isInvalid:z,hint:I,className:y,children:[s.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[s.jsx(Ie.Controller,{control:D,name:e,render:({field:{ref:H,onChange:W,name:B,value:U}})=>s.jsx(Pn,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:h,fixedDecimalScale:v,prefix:b,suffix:w,defaultValue:"",name:B,value:U??"",placeholder:o??t,onFocus:V=>{!x&&V.target.select()},onChange:V=>{var Z,te;const X=parseFloat(((te=(Z=V.target)==null?void 0:Z.value)==null?void 0:te.replaceAll(" ","").replaceAll(",","."))??0);a&&a.forEach(se=>E(se,null,{shouldDirty:!0,shouldValidate:A}));const Y=X==null||Number.isNaN(X)?null:Number(X);W(Y),C&&C(Y)},hidden:u,disabled:M,className:l.classNames("form-control text-end w-100",{"is-invalid":z},{[`form-control-${p}`]:p}),step:f,getInputRef:H,min:S,max:j})}),g&&s.jsx("div",{className:"custom-picker-button",children:g})]}),r&&O!=null&&s.jsx("div",{className:"luminus-input-remove-icon inset",children:s.jsx(l.IconButton,{color:"secondary",size:"sm",onClick:F,children:s.jsx(l.MdClear,{})})}),R&&s.jsx(l.InvalidFeedback,{message:R.message})]})},Ea=n=>{const e=l.compilerRuntimeExports.c(10),{ref:t,userName:o,onClick:a,children:r}=n;let i;e[0]!==a?(i=d=>{d.preventDefault(),a(d)},e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={backgroundColor:"transparent",border:"none",cursor:"pointer"},e[2]=c):c=e[2];let u;e[3]!==o?(u=s.jsx(en,{name:o}),e[3]=o,e[4]=u):u=e[4];let m;return e[5]!==r||e[6]!==t||e[7]!==i||e[8]!==u?(m=s.jsxs("button",{type:"button",ref:t,onClick:i,"aria-label":"User avatar toggle",className:"m-0 p-0",style:c,children:[u,r]}),e[5]=r,e[6]=t,e[7]=i,e[8]=u,e[9]=m):m=e[9],m},La=({color:n="primary",icon:e=s.jsx(l.MdOutlineFileUpload,{size:12}),inputId:t="context-file-input",accept:o="*",onUpload:a,multiple:r,className:i,children:c,...u})=>{const m=d=>{d.target.files&&(a(d.target.files),d.target.value="")};return s.jsxs(s.Fragment,{children:[s.jsxs("label",{htmlFor:t,className:l.classNames(`btn luminus-dropdown-item text-nowrap rounded text-${n} ${i??""}`,l.classes$1.item),...u,children:[e,c]}),s.jsx("input",{id:t,type:"file",accept:o,onChange:m,hidden:!0,multiple:r})]})},An=["slice","options","formats","conditions"],ls=n=>{const e=n.current.flexmonster.getReport({withDefaults:!0});if(typeof e=="string")throw alert("report is string"),new Error("report is string");const t={};return An.forEach(o=>{t[o]=e[o]}),JSON.stringify(t)},Ra=n=>{if(n.settings){const e=JSON.parse(n.settings);return An.forEach(t=>{e[t]===void 0&&(e[t]=null)}),e}return{}},$a=n=>{const e={};return An.forEach(t=>{e[t]=(n==null?void 0:n[t])??void 0}),e},Fa=n=>n&&n.type==="header"&&n.member&&n.member.caption!=="All"&&n.label==="",as=(n,e)=>n.hierarchy&&n.hierarchy.uniqueName===e,rs=n=>!n.member&&!n.isDrillThrough,is=(n,e)=>typeof n=="function"?n(e):n.replace(":id",e),_o=({dataSource:n,settings:e,pivotRef:t,localization:o,licenseKey:a,hyperlinkColumn:r,roomPasportization:i,enabled:c=!0})=>{const{texts:{reports:u}}=N.useContext(l.LuminusComponentsContext),[m,d]=N.useState(!1),f=N.useRef(null),p=t??f,g=N.useMemo(()=>({localization:o}),[o]),x=N.useCallback(S=>{delete S[0],delete S[1],delete S[2];const j=[{id:"fm-tab-expand",title:u.expandAll,handler:p.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:u.collapseAll,handler:p.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return S.unshift({id:"fm-tab-expand",title:u.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:j,rightGroup:!0}),S},[p,u.collapseAll,u.expand,u.expandAll]),y=S=>{const j=S.getTabs();S.getTabs=()=>x(j)},h=N.useMemo(()=>n&&n.mapping?Object.values(n.mapping).filter(S=>S.caption.includes("P:")).map(S=>({uniqueName:S.caption.replace("P:",""),caption:S.caption})):[],[n]),v=N.useMemo(()=>{var j,C,I,k;const S=(j=p.current)==null?void 0:j.flexmonster.getReport();return S&&S.slice?{...S.slice,rows:[...((C=S.slice.rows)==null?void 0:C.filter(L=>{var E;return!((E=L.caption)!=null&&E.includes("P:"))}))??[],...h],columns:[...((I=S.slice.columns)==null?void 0:I.filter(L=>{var E;return!((E=L.caption)!=null&&E.includes("P:"))}))??[],...h],measures:[...((k=S.slice.measures)==null?void 0:k.filter(L=>{var E;return!((E=L.caption)!=null&&E.includes("P:"))}))??[],...h]}:null},[h,p]);N.useEffect(()=>{var S,j,C,I;if(m&&c){if(i&&v){const k=(S=p.current)==null?void 0:S.flexmonster.getReport(),L=k&&k.options?{...k.options,grid:{...(j=k.options)==null?void 0:j.grid,autoSwitchToCompact:!1}}:{};(C=p.current)==null||C.flexmonster.setReport({...k,dataSource:n,slice:v,options:L})}else(I=p.current)==null||I.flexmonster.updateData(n);console.log("Updating flexmonster dataSource to: ",n)}},[n,c,m,h,p,i,v]),N.useEffect(()=>{var S,j,C,I,k;if(m&&c){const L=(S=p.current)==null?void 0:S.flexmonster.getReport();if(L===void 0||typeof L=="string")return;const E=$a(e);E.options={...e==null?void 0:e.options,grid:{...(j=e==null?void 0:e.options)==null?void 0:j.grid,autoSwitchToCompact:!1},showFieldListSearch:!0,datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm:ss"},i&&(E.slice={...e==null?void 0:e.slice,rows:[...((I=(C=e==null?void 0:e.slice)==null?void 0:C.rows)==null?void 0:I.filter(_=>{var R;return!((R=_.caption)!=null&&R.includes("P:"))}))??[],...h]});const D={...L,...E};(k=p.current)==null||k.flexmonster.setReport(D),console.log("Refreshing flexmonster settings. New report: ",D)}},[c,m,h,p,i,e]);const b=N.useCallback((S,j)=>{var _,R;if(Fa(j)){S.text=((_=j.member)==null?void 0:_.caption)??"";const $=S.style["padding-left"]??"4px",A=parseInt($,10);S.style["padding-left"]=A+11+"px"}if(!r||!as(j,r.idColumn)||rs(j))return;const C=(R=j.escapedLabel)==null?void 0:R.toString();if(C===void 0)return;const I=is(r.url,C),k="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",L=j.type==="header"?"onclick='event.stopImmediatePropagation()'":"",E=j.isDrillThrough||j.type==="header"?`href='${I}' target='_blank'`:"";S.style&&(S.style["z-index"]=1);const D=`<a ${E} ${k} ${L}>${j.escapedLabel}</a>`;S.text=D},[r]),w=N.useCallback(S=>{if(!r||!as(S,r.idColumn)||rs(S))return;const j=is(r.url,S.escapedLabel??"");window.open(j??"","_blank","noreferrer")},[r]);return s.jsx(s.Fragment,{children:s.jsx(cl.Pivot,{ref:p,global:g,licenseKey:a,toolbar:!0,height:"100%",beforetoolbarcreated:y,ready:()=>{d(!0)},width:"100%",customizeCell:b,cellclick:w})})},Pa=(n,e,t,o)=>{const{texts:{reports:a}}=N.useContext(l.LuminusComponentsContext),{prompt:r}=l.usePrompt(),{confirm:i}=l.useConfirm(),c=l.useAxios(),{user:u}=N.useContext(l.UserContext),{startLoading:m,stopLoading:d}=N.useContext(l.LoadingContext),{addNotification:f}=l.useNotifications(),p=N.useCallback(async v=>{m("report-versionSavingAs");try{const b=await c.post("/reports/version",v);f(a.saveSuccessful,"success"),await o(b.data)}finally{d("report-versionSavingAs")}},[f,o,c,a.saveSuccessful,m,d]),g=N.useCallback(async()=>{if(t===null){f("none open","warning");return}if(!await i(a.confirmOverwriteSave))return;const b=ls(e);p({reportSourceName:n,reportVersionId:t,settings:b})},[f,i,e,n,a.confirmOverwriteSave,p,t]),x=N.useCallback(async()=>{const v=await r(a.enterName,{input:"input",required:!0});if(v===null)return;const b=ls(e);p({reportSourceName:n,name:v,settings:b})},[e,r,n,a.enterName,p]),y=N.useCallback(async()=>{m("report-versionSavingAs");try{await c.post("/reports/version",{reportVersionId:t??void 0,reportSourceName:n,isArchived:!0}),f(a.deleteSuccessful,"success")}finally{d("report-versionSavingAs")}},[f,c,n,a.deleteSuccessful,t,m,d]),h=N.useCallback(async()=>{m("report-versionSavingAs");try{await c.post("/reports/version-restrictions",{reportVersionId:t??void 0,userRestricts:[{employeeId:u.personalNumber,addRights:!1}]}),f(a.detachSuccessful,"success")}finally{d("report-versionSavingAs")}},[f,c,a.detachSuccessful,t,m,d,u.personalNumber]);return{saveAs:x,save:g,archive:y,detach:h}},Aa=n=>{const e=l.useAxios(),{startLoading:t,stopLoading:o}=N.useContext(l.LoadingContext);return{changeEmployeeRights:N.useCallback(async(r,i)=>{let c=null;t("reportSharing-addPerson");try{c=(await e.post("/reports/version-restrictions",{reportVersionId:n,userRestricts:[{employeeId:r,addRights:i}]})).data}finally{o("reportSharing-addPerson")}return c},[e,n,t,o])}},Ma=n=>{const e=l.compilerRuntimeExports.c(49),{isOpen:t,onHide:o,usersData:a,reportVersionId:r,EmployeePicker:i,setReportVersion:c}=n,{ProjectIconComponent:u,texts:m}=N.useContext(l.LuminusComponentsContext),{reports:d}=m,{confirm:f}=l.useConfirm(),[p,g]=N.useState(null),{changeEmployeeRights:x}=Aa(r);let y;e[0]!==c?(y=P=>{c(M=>M===null?null:{...M,users:P.filter(Oa)})},e[0]=c,e[1]=y):y=e[1];const h=y;let v;e[2]!==p||e[3]!==x||e[4]!==h?(v=async()=>{if(p===null)return;const P=await x(p.id,!0);h(P),g(null)},e[2]=p,e[3]=x,e[4]=h,e[5]=v):v=e[5];const b=v;let w;e[6]!==x||e[7]!==f||e[8]!==d||e[9]!==h?(w=async P=>{if(!await f(d.removeSharingWith(P)))return;const O=await x(P,!1);h(O)},e[6]=x,e[7]=f,e[8]=d,e[9]=h,e[10]=w):w=e[10];const S=w;let j;e[11]!==d.reportSharing?(j=s.jsx(l.Modal.Header,{closeButton:!0,children:s.jsx(l.Modal.Title,{children:d.reportSharing})}),e[11]=d.reportSharing,e[12]=j):j=e[12];let C;e[13]!==d.sharedWith?(C=s.jsx(l.Typography,{variant:"h6",children:d.sharedWith}),e[13]=d.sharedWith,e[14]=C):C=e[14];let I;e[15]!==d.noone||e[16]!==a?(I=a&&a.length===0?s.jsx("div",{className:"px-2 text-muted",children:d.noone.toLowerCase()}):null,e[15]=d.noone,e[16]=a,e[17]=I):I=e[17];let k;e[18]!==u||e[19]!==S||e[20]!==a?(k=a==null?void 0:a.map(P=>s.jsxs(l.ListGroupItem,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[P.lastName," ",P.firstName," [",P.id,"]",s.jsx(l.IconButton,{color:"danger",onClick:()=>S(P.id),children:s.jsx(u,{icon:"delete"})})]},P.id)),e[18]=u,e[19]=S,e[20]=a,e[21]=k):k=e[21];let L;e[22]!==I||e[23]!==k?(L=s.jsxs(l.ListGroup,{variant:"flush",children:[I,k]}),e[22]=I,e[23]=k,e[24]=L):L=e[24];let E;e[25]!==d.addSharing?(E=s.jsx(l.Typography,{variant:"h6",className:"mt-2 mb-2",children:d.addSharing}),e[25]=d.addSharing,e[26]=E):E=e[26];let D;e[27]===Symbol.for("react.memo_cache_sentinel")?(D=P=>{if(P===null||typeof P.id!="number"){g(null);return}g(P)},e[27]=D):D=e[27];let _;e[28]!==i||e[29]!==p||e[30]!==d.shareWith?(_=s.jsx("div",{className:"flex-grow-1",children:s.jsx(i,{label:d.shareWith,onSelect:D,value:p})}),e[28]=i,e[29]=p,e[30]=d.shareWith,e[31]=_):_=e[31];const R=p===null;let $;e[32]!==b||e[33]!==d.add||e[34]!==R?($=s.jsx(l.PrimaryButton,{onClick:b,disabled:R,children:d.add}),e[32]=b,e[33]=d.add,e[34]=R,e[35]=$):$=e[35];let A;e[36]!==_||e[37]!==$?(A=s.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[_,$]}),e[36]=_,e[37]=$,e[38]=A):A=e[38];let T;e[39]!==E||e[40]!==A||e[41]!==C||e[42]!==L?(T=s.jsxs(l.Modal.Body,{children:[C,L,E,A]}),e[39]=E,e[40]=A,e[41]=C,e[42]=L,e[43]=T):T=e[43];let F;return e[44]!==t||e[45]!==o||e[46]!==T||e[47]!==j?(F=s.jsxs(l.Modal,{show:t,onHide:o,children:[j,T]}),e[44]=t,e[45]=o,e[46]=T,e[47]=j,e[48]=F):F=e[48],F};function Oa(n){return n.isReportOwner===!1}const Ba=(n,e)=>{const t=l.compilerRuntimeExports.c(6),[o,a]=N.useState(null);let r,i;t[0]!==e||t[1]!==n?(r=()=>{n.then(u=>{const{default:m}=u,d=e!==void 0?e(m):m;a(d)})},i=[e,n],t[0]=e,t[1]=n,t[2]=r,t[3]=i):(r=t[2],i=t[3]),N.useEffect(r,i);let c;return t[4]!==o?(c={mappings:o},t[4]=o,t[5]=c):c=t[5],c},za=n=>{var xe;const e=l.compilerRuntimeExports.c(144),{reportType:t,title:o,data:a,filterElements:r,getReportRoute:i,localization:c,licenseKey:u,EmployeePicker:m,localizationJsonFile:d,localizationTransformer:f,hyperlinkColumn:p,roomPasportization:g}=n,x=g===void 0?!1:g,{texts:y}=N.useContext(l.LuminusComponentsContext),{reports:h}=y,{confirm:v}=l.useConfirm(),b=Ne.useNavigate(),[w]=Ne.useSearchParams(),{id:S}=Ne.useParams(),j=S===void 0?null:Number(S);let C;e[0]!==i||e[1]!==b||e[2]!==t||e[3]!==w?(C=ge=>{const Se=ge===null?"":ge.toString();b(Ne.generatePath(i(t),{id:Se})+"?"+w.toString(),{replace:!0,flushSync:!0})},e[0]=i,e[1]=b,e[2]=t,e[3]=w,e[4]=C):C=e[4];const I=C,[k,L]=N.useState(!1),E=N.useRef(null),{user:D}=N.useContext(l.UserContext),{data:_,reloadData:R}=Ae.useGetApiData(`/reports/${t}`),{mappings:$}=Ba(d,f);let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={},e[5]=A):A=e[5];const[T,F]=N.useState(A);let P;e[6]!==I?(P=ge=>{const Se=ge.target.value,He=Se===""?null:Number(Se);I(He)},e[6]=I,e[7]=P):P=e[7];const M=P;let O;e[8]!==R||e[9]!==I?(O=async ge=>{await R(),I(ge)},e[8]=R,e[9]=I,e[10]=O):O=e[10];const z=O,H=j!==null;let W;e[11]!==H?(W={enabled:H,nullStateBeforeLoad:!1,nullStateOnFail:!0},e[11]=H,e[12]=W):W=e[12];const{data:B,setData:U}=Ae.useGetApiData(`/reports/version/${j}`,W);let V,X;e[13]!==B?(X=()=>{var Se;if(B===null){F({});return}const ge=Ra(B)??{};F(ge),(Se=E.current)==null||Se.flexmonster.refresh()},V=[B],e[13]=B,e[14]=V,e[15]=X):(V=e[14],X=e[15]),N.useEffect(X,V);const{save:Y,saveAs:Z,archive:te,detach:se}=Pa(t,E,j,z);let q;e[16]!==a?(q=a??[],e[16]=a,e[17]=q):q=e[17];const ae=$??void 0;let re;e[18]!==q||e[19]!==ae?(re={data:q,mapping:ae},e[18]=q,e[19]=ae,e[20]=re):re=e[20];const me=re;let fe;e[21]!==v||e[22]!==me||e[23]!==h.confirmRevertChanges||e[24]!==T?(fe=async()=>{var Se;await v(h.confirmRevertChanges)&&((Se=E.current)==null||Se.flexmonster.setReport({dataSource:me,...T}))},e[21]=v,e[22]=me,e[23]=h.confirmRevertChanges,e[24]=T,e[25]=fe):fe=e[25];const Q=fe;let K;e[26]!==(B==null?void 0:B.ownerId)||e[27]!==D.personalNumber?(K=()=>(B==null?void 0:B.ownerId)===D.personalNumber,e[26]=B==null?void 0:B.ownerId,e[27]=D.personalNumber,e[28]=K):K=e[28],B==null||B.ownerId;const G=K();B==null||B.users;let oe;e[29]!==(B==null?void 0:B.users)||e[30]!==D.personalNumber?(oe=(xe=B==null?void 0:B.users)==null?void 0:xe.some(ge=>ge.id===D.personalNumber&&!ge.isReportOwner),e[29]=B==null?void 0:B.users,e[30]=D.personalNumber,e[31]=oe):oe=e[31];const J=oe;let ee;e[32]!==te||e[33]!==v||e[34]!==R||e[35]!==(B==null?void 0:B.name)||e[36]!==h||e[37]!==I?(ee=async()=>{await v(h.confirmDelete(B==null?void 0:B.name))&&(await te(),I(null),await R())},e[32]=te,e[33]=v,e[34]=R,e[35]=B==null?void 0:B.name,e[36]=h,e[37]=I,e[38]=ee):ee=e[38],B==null||B.name;const ne=ee;let ce;e[39]!==v||e[40]!==se||e[41]!==R||e[42]!==(B==null?void 0:B.name)||e[43]!==h||e[44]!==I?(ce=async()=>{await v(h.confirmDetach(B==null?void 0:B.name))&&(await se(),I(null),await R())},e[39]=v,e[40]=se,e[41]=R,e[42]=B==null?void 0:B.name,e[43]=h,e[44]=I,e[45]=ce):ce=e[45],B==null||B.name;const ve=ce;let de;e[46]!==(_==null?void 0:_.reportVersions)||e[47]!==j||e[48]!==I?(de=()=>{var ge,Se;j===null&&I(((ge=_==null?void 0:_.reportVersions.find(Ha))==null?void 0:ge.reportVersionId)??((Se=_==null?void 0:_.reportVersions[0])==null?void 0:Se.reportVersionId)??null)},e[46]=_==null?void 0:_.reportVersions,e[47]=j,e[48]=I,e[49]=de):de=e[49];const be=_==null?void 0:_.reportVersions;let we;e[50]!==j||e[51]!==I||e[52]!==be?(we=[be,j,I],e[50]=j,e[51]=I,e[52]=be,e[53]=we):we=e[53],N.useEffect(de,we);let ke;e[54]!==o?(ke=s.jsx(l.Typography,{variant:"h3",children:o}),e[54]=o,e[55]=ke):ke=e[55];const Fe=j??void 0;let le;e[56]!==(_==null?void 0:_.reportVersions)?(le=_==null?void 0:_.reportVersions.filter(Va).map(Wa),e[56]=_==null?void 0:_.reportVersions,e[57]=le):le=e[57];let ue;e[58]!==h.versionSelectSystem||e[59]!==le?(ue=s.jsx("optgroup",{label:h.versionSelectSystem,children:le}),e[58]=h.versionSelectSystem,e[59]=le,e[60]=ue):ue=e[60];let he;e[61]!==(_==null?void 0:_.reportVersions)||e[62]!==D.personalNumber?(he=_==null?void 0:_.reportVersions.filter(ge=>ge.ownerId===D.personalNumber).map(Ua),e[61]=_==null?void 0:_.reportVersions,e[62]=D.personalNumber,e[63]=he):he=e[63];let pe;e[64]!==h.versionSelectYour||e[65]!==he?(pe=s.jsx("optgroup",{label:h.versionSelectYour,children:he}),e[64]=h.versionSelectYour,e[65]=he,e[66]=pe):pe=e[66];let ye;e[67]!==(_==null?void 0:_.reportVersions)||e[68]!==D.personalNumber?(ye=_==null?void 0:_.reportVersions.filter(ge=>ge.isSystem===!1&&ge.ownerId!==D.personalNumber).map(Ga),e[67]=_==null?void 0:_.reportVersions,e[68]=D.personalNumber,e[69]=ye):ye=e[69];let je;e[70]!==h.versionSelectSharedWithYou||e[71]!==ye?(je=s.jsx("optgroup",{label:h.versionSelectSharedWithYou,children:ye}),e[70]=h.versionSelectSharedWithYou,e[71]=ye,e[72]=je):je=e[72];let Oe;e[73]!==M||e[74]!==Fe||e[75]!==ue||e[76]!==pe||e[77]!==je?(Oe=s.jsxs(l.FormSelect,{size:"sm",value:Fe,onChange:M,children:[ue,pe,je]}),e[73]=M,e[74]=Fe,e[75]=ue,e[76]=pe,e[77]=je,e[78]=Oe):Oe=e[78];let Le;e[79]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(l.MdSave,{}),e[79]=Le):Le=e[79];const Pe=j===null||(B==null?void 0:B.isSystem)||!G;let Re;e[80]!==h.save||e[81]!==Y||e[82]!==Pe?(Re=s.jsx(l.ContextButton,{icon:Le,onClick:Y,disabled:Pe,children:h.save}),e[80]=h.save,e[81]=Y,e[82]=Pe,e[83]=Re):Re=e[83];let Be;e[84]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx(l.MdSaveAs,{}),e[84]=Be):Be=e[84];let ze;e[85]!==h.saveAs||e[86]!==Z?(ze=s.jsx(l.ContextButton,{icon:Be,onClick:Z,className:"flex-shrink-0",children:h.saveAs}),e[85]=h.saveAs,e[86]=Z,e[87]=ze):ze=e[87];let De;e[88]===Symbol.for("react.memo_cache_sentinel")?(De=s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle}),e[88]=De):De=e[88];let Te;e[89]!==Q||e[90]!==h.revertChanges?(Te=s.jsx(l.DropdownItem,{onClick:Q,children:h.revertChanges}),e[89]=Q,e[90]=h.revertChanges,e[91]=Te):Te=e[91];let ie;e[92]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>L(!0),e[92]=ie):ie=e[92];const Ce=!G||(B==null?void 0:B.isSystem);let Ee;e[93]!==h.share||e[94]!==Ce?(Ee=s.jsx(l.DropdownItem,{onClick:ie,disabled:Ce,children:h.share}),e[93]=h.share,e[94]=Ce,e[95]=Ee):Ee=e[95];let $e;e[96]!==ne||e[97]!==G||e[98]!==(B==null?void 0:B.isSystem)||e[99]!==h.delete?($e=G&&!(B!=null&&B.isSystem)?s.jsx(l.DropdownItem,{color:"danger",onClick:ne,children:h.delete}):null,e[96]=ne,e[97]=G,e[98]=B==null?void 0:B.isSystem,e[99]=h.delete,e[100]=$e):$e=e[100];let Ve;e[101]!==ve||e[102]!==J||e[103]!==(B==null?void 0:B.isSystem)||e[104]!==h.detach?(Ve=J&&!(B!=null&&B.isSystem)?s.jsx(l.DropdownItem,{color:"danger",onClick:ve,children:h.detach}):null,e[101]=ve,e[102]=J,e[103]=B==null?void 0:B.isSystem,e[104]=h.detach,e[105]=Ve):Ve=e[105];let Ye;e[106]!==Te||e[107]!==Ee||e[108]!==$e||e[109]!==Ve?(Ye=s.jsxs(l.Dropdown,{toggle:De,children:[Te,Ee,$e,Ve]}),e[106]=Te,e[107]=Ee,e[108]=$e,e[109]=Ve,e[110]=Ye):Ye=e[110];let ot;e[111]!==Oe||e[112]!==Re||e[113]!==ze||e[114]!==Ye?(ot=s.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[Oe,Re,ze,Ye]}),e[111]=Oe,e[112]=Re,e[113]=ze,e[114]=Ye,e[115]=ot):ot=e[115];let qe;e[116]!==r||e[117]!==ke||e[118]!==ot?(qe=s.jsxs("div",{className:"d-flex justify-content-start gap-3",children:[ke,r,ot]}),e[116]=r,e[117]=ke,e[118]=ot,e[119]=qe):qe=e[119];const lt=me.data&&me.data.length>0?"":"d-none";let Qe;e[120]!==lt?(Qe=l.classNames("h-100 w-100",lt),e[120]=lt,e[121]=Qe):Qe=e[121];const at=me.data&&me.data.length>0;let Xe;e[122]!==me||e[123]!==p||e[124]!==u||e[125]!==c||e[126]!==x||e[127]!==T||e[128]!==at?(Xe=s.jsx(_o,{dataSource:me,settings:T,pivotRef:E,enabled:at,roomPasportization:x,localization:c,licenseKey:u,hyperlinkColumn:p}),e[122]=me,e[123]=p,e[124]=u,e[125]=c,e[126]=x,e[127]=T,e[128]=at,e[129]=Xe):Xe=e[129];let Ze;e[130]!==Qe||e[131]!==Xe?(Ze=s.jsx("div",{className:Qe,children:Xe}),e[130]=Qe,e[131]=Xe,e[132]=Ze):Ze=e[132];let Je;e[133]!==qe||e[134]!==Ze?(Je=s.jsx(l.PageContainer,{variant:"fullScreen",title:qe,children:Ze}),e[133]=qe,e[134]=Ze,e[135]=Je):Je=e[135];let et;e[136]!==m||e[137]!==k||e[138]!==B||e[139]!==U?(et=B!==null?s.jsx(Ma,{isOpen:k,onHide:()=>L(!1),usersData:B.users??null,setReportVersion:U,reportVersionId:B==null?void 0:B.reportVersionId,EmployeePicker:m}):null,e[136]=m,e[137]=k,e[138]=B,e[139]=U,e[140]=et):et=e[140];let it;return e[141]!==Je||e[142]!==et?(it=s.jsxs(s.Fragment,{children:[Je,et]}),e[141]=Je,e[142]=et,e[143]=it):it=e[143],it};function Ha(n){return n.isSystem===!0}function Va(n){return n.isSystem===!0}function Wa(n){return s.jsx("option",{value:n.reportVersionId,children:n.name},n.reportVersionId)}function Ua(n){return s.jsx("option",{value:n.reportVersionId,children:n.name},n.reportVersionId)}function Ga(n){return s.jsx("option",{value:n.reportVersionId,children:`${n.name} [${n.ownerId}]`},n.reportVersionId)}const Ka=n=>{const e=l.compilerRuntimeExports.c(2),{cell:t}=n,{value:o}=t;let a;return e[0]!==o?(a=s.jsx(s.Fragment,{children:o?s.jsx(en,{name:o,size:21,fontSize:12}):s.jsx(s.Fragment,{})}),e[0]=o,e[1]=a):a=e[1],a},Ya=n=>{const e=l.compilerRuntimeExports.c(9),{knownTypes:t,typeFilters:o,onChangeTypeFilters:a}=n;let r;if(e[0]!==t||e[1]!==a||e[2]!==o){let c;e[4]!==a||e[5]!==o?(c=u=>s.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:l.classNames(`border-${u}`,o.includes(u)&&`bg-${u}`),onClick:()=>{o.includes(u)?a(o.filter(m=>m!==u)):a([...o,u])}},u),e[4]=a,e[5]=o,e[6]=c):c=e[6],r=t.map(c),e[0]=t,e[1]=a,e[2]=o,e[3]=r}else r=e[3];let i;return e[7]!==r?(i=s.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:r}),e[7]=r,e[8]=i):i=e[8],i},qa=n=>{const e=l.compilerRuntimeExports.c(4),{linksTo:t,onClick:o,children:a}=n;let r;return e[0]!==a||e[1]!==t||e[2]!==o?(r=t?s.jsx(Ne.Link,{to:t,className:"text-decoration-none",onClick:o,children:a}):s.jsx(s.Fragment,{children:a}),e[0]=a,e[1]=t,e[2]=o,e[3]=r):r=e[3],r},Qa=n=>{const e=l.compilerRuntimeExports.c(40),{message:t,onDeleteMessage:o,onClickMessage:a,getIcon:r,getLinksTo:i}=n,{ProjectIconComponent:c,localizationContext:u}=N.useContext(l.LuminusComponentsContext),{dateFnsLocale:m}=N.useContext(u);let d;if(e[0]!==m||e[1]!==t.dateTime){const L=t.dateTime?l.parseISO(t.dateTime):null,E=L?pl(new Date(Date.now()),L):0;d=L&&s.jsx("div",{className:"d-flex justify-content-end",children:s.jsx(l.SimpleTooltip,{text:l.format(L,"dd.MM.yyyy HH:mm"),placement:"left",children:s.jsx("div",{children:s.jsx(l.Typography,{variant:"caption",children:E>2?l.format(L,"dd.MM.yyyy"):gl(L,new Date(Date.now()),{locale:m.code})})})})}),e[0]=m,e[1]=t.dateTime,e[2]=d}else d=e[2];let f;e[3]!==i||e[4]!==t?(f=i(t)??void 0,e[3]=i,e[4]=t,e[5]=f):f=e[5];const p=t.type;let g;e[6]!==r||e[7]!==t?(g=r(t),e[6]=r,e[7]=t,e[8]=g):g=e[8];let x;e[9]!==t.subject?(x=s.jsx(l.Typography,{variant:"body2",className:"fw-bold",children:t.subject}),e[9]=t.subject,e[10]=x):x=e[10];let y;e[11]!==t.id||e[12]!==o?(y=L=>{L.preventDefault(),L.stopPropagation(),o(t.id)},e[11]=t.id,e[12]=o,e[13]=y):y=e[13];let h;e[14]!==c?(h=s.jsx(c,{icon:"delete"}),e[14]=c,e[15]=h):h=e[15];let v;e[16]!==y||e[17]!==h?(v=s.jsx(l.IconButton,{size:"sm",onClick:y,children:h}),e[16]=y,e[17]=h,e[18]=v):v=e[18];let b;e[19]!==x||e[20]!==v?(b=s.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[x,v]}),e[19]=x,e[20]=v,e[21]=b):b=e[21];let w;e[22]!==t.text?(w=s.jsx(l.Typography,{variant:"body2",children:t.text}),e[22]=t.text,e[23]=w):w=e[23];let S;e[24]!==w||e[25]!==b?(S=s.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[b,w]}),e[24]=w,e[25]=b,e[26]=S):S=e[26];let j;e[27]!==S||e[28]!==g?(j=s.jsxs("div",{className:"d-flex align-items-start gap-2",children:[g,S]}),e[27]=S,e[28]=g,e[29]=j):j=e[29];let C;e[30]!==t.type||e[31]!==j?(C=s.jsx(Zo,{level:p,noIcon:!0,children:j}),e[30]=t.type,e[31]=j,e[32]=C):C=e[32];let I;e[33]!==a||e[34]!==C||e[35]!==f?(I=s.jsx(qa,{linksTo:f,onClick:a,children:C}),e[33]=a,e[34]=C,e[35]=f,e[36]=I):I=e[36];let k;return e[37]!==d||e[38]!==I?(k=s.jsxs("div",{children:[d,I]}),e[37]=d,e[38]=I,e[39]=k):k=e[39],k},cs=["info","warning","danger"],ds=n=>{const e=l.compilerRuntimeExports.c(23),{messages:t,isLoading:o,onDeleteMessage:a,onClickMessage:r,getIcon:i,getLinksTo:c}=n,{texts:u}=N.useContext(l.LuminusComponentsContext),{messageBoard:m}=u,[d,f]=N.useState(cs);let p;if(e[0]!==t||e[1]!==d){let w;e[3]!==d?(w=S=>d.includes(S.type??""),e[3]=d,e[4]=w):w=e[4],p=t.filter(w),e[0]=t,e[1]=d,e[2]=p}else p=e[2];const g=p;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=w=>f(w),e[5]=x):x=e[5];let y;e[6]!==d?(y=s.jsx(Ya,{knownTypes:cs,typeFilters:d,onChangeTypeFilters:x}),e[6]=d,e[7]=y):y=e[7];let h;e[8]!==o?(h=o&&s.jsxs("div",{className:"p-3 w-100",children:[s.jsx(ut,{as:qn.Title,animation:"glow",children:s.jsx(ut,{xs:6})}),s.jsxs(ut,{as:qn.Text,animation:"glow",children:[s.jsx(ut,{xs:7})," ",s.jsx(ut,{xs:4})," ",s.jsx(ut,{xs:4})," ",s.jsx(ut,{xs:6})," ",s.jsx(ut,{xs:8})]})]}),e[8]=o,e[9]=h):h=e[9];let v;e[10]!==g||e[11]!==i||e[12]!==c||e[13]!==o||e[14]!==m||e[15]!==t.length||e[16]!==r||e[17]!==a?(v=!o&&s.jsxs(s.Fragment,{children:[t.length===0&&s.jsx(l.Alert,{variant:"info",size:"sm",className:"mt-2",children:m.noMessages}),s.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:g.map(w=>s.jsx(Qa,{message:w,onDeleteMessage:a,onClickMessage:r,getIcon:i,getLinksTo:c},w.id))})]}),e[10]=g,e[11]=i,e[12]=c,e[13]=o,e[14]=m,e[15]=t.length,e[16]=r,e[17]=a,e[18]=v):v=e[18];let b;return e[19]!==y||e[20]!==h||e[21]!==v?(b=s.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[y,h,v]}),e[19]=y,e[20]=h,e[21]=v,e[22]=b):b=e[22],b},cn={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},Xa=n=>{const e=l.compilerRuntimeExports.c(25),{renderAsNotifPanel:t,notifIcon:o,apiUrls:a,getIcon:r,getLinksTo:i}=n,{apiGet:c,apiDelete:u}=a===void 0?cn:a,m=c===void 0?cn.apiGet:c,d=u===void 0?cn.apiDelete:u,f=l.useAxios();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[g,x]=N.useState(p),[y,h]=N.useState(!1),[v,b]=N.useState(!1),[w,S]=N.useState(!1);let j;e[1]!==m||e[2]!==f?(j=async()=>{b(!0),await f.get(m).then(F=>{const{data:P}=F;x(P),h(!0),b(!1)}).catch(()=>{x([]),b(!1)})},e[1]=m,e[2]=f,e[3]=j):j=e[3];const C=j;let I;e[4]!==d||e[5]!==f?(I=async F=>f.delete(`${d}${F}`).then(Za).catch(Ja),e[4]=d,e[5]=f,e[6]=I):I=e[6];const k=I;let L;e[7]!==k||e[8]!==g?(L=F=>{k(F).then(P=>{P&&x(g.filter(M=>M.id!==F))})},e[7]=k,e[8]=g,e[9]=L):L=e[9];const E=L;let D,_;e[10]!==C?(D=()=>{C();const F=setInterval(()=>C(),6e4);return()=>{clearInterval(F)}},_=[C],e[10]=C,e[11]=D,e[12]=_):(D=e[11],_=e[12]),N.useEffect(D,_);let R;e[13]!==g?(R=g.filter(er),e[13]=g,e[14]=R):R=e[14];const $=R.length,A=y?!1:v;let T;return e[15]!==$||e[16]!==A||e[17]!==r||e[18]!==i||e[19]!==g||e[20]!==o||e[21]!==E||e[22]!==t||e[23]!==w?(T=t?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"position-relative",children:[s.jsx(l.IconButton,{size:"md",onClick:()=>S(!w),children:o}),$>0&&s.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:$})]}),s.jsx(Xn,{show:w,onHide:()=>S(!1),placement:"end",children:s.jsx(Xn.Body,{children:s.jsx(ds,{messages:g,isLoading:A,onDeleteMessage:E,onClickMessage:()=>S(!1),getIcon:r,getLinksTo:i})})})]}):s.jsx(ds,{messages:g,isLoading:A,onDeleteMessage:E,getIcon:r,getLinksTo:i}),e[15]=$,e[16]=A,e[17]=r,e[18]=i,e[19]=g,e[20]=o,e[21]=E,e[22]=t,e[23]=w,e[24]=T):T=e[24],T};function Za(){return!0}function Ja(){return!1}function er(n){return n.type==="danger"}const tr="_tab-panel_d8l8q_1",nr="_full-height-no-overflow_d8l8q_5",sr="_disabled_d8l8q_12",dn={tabPanel:tr,fullHeightNoOverflow:nr,disabled:sr},Do=n=>{const e=l.compilerRuntimeExports.c(7),{eventKey:t,activeTab:o,fullHeightNoOverflow:a,disabled:r,className:i,children:c}=n;if(t!==o)return null;let u;e[0]!==i||e[1]!==r||e[2]!==a?(u=l.classNames("luminus-tab-panel",dn.tabPanel,{[dn.fullHeightNoOverflow]:a},{disabled:r},{[dn.disabled]:r},i),e[0]=i,e[1]=r,e[2]=a,e[3]=u):u=e[3];let m;return e[4]!==c||e[5]!==u?(m=s.jsx("div",{className:u,children:c}),e[4]=c,e[5]=u,e[6]=m):m=e[6],m},or="_join-line_1q9e8_1",lr={joinLine:or},Mn=n=>{const e=l.compilerRuntimeExports.c(18),{activeTab:t,onSelect:o,children:a,vertical:r,verticalStepper:i}=n;let c;e[0]!==r||e[1]!==i?(c=l.classNames("luminus-tabs d-flex mb-2",{"gap-1":!i},{"gap-0":i},{"flex-column":r||i}),e[0]=r,e[1]=i,e[2]=c):c=e[2];let u;if(e[3]!==t||e[4]!==a||e[5]!==o||e[6]!==r||e[7]!==i){let d;e[9]!==t||e[10]!==a.length||e[11]!==o||e[12]!==r||e[13]!==i?(d=(f,p)=>{const g=f.type,x=f.props;if(!x)return null;const y=x.eventKey,h=x.children,v=x.className,b=x.onClick;return s.jsxs(N.Fragment,{children:[s.jsx(g,{...x,className:l.classNames({active:t===y},v),onClick:()=>{o(y),b&&b(y)},vertical:r||i,children:h}),i&&p<a.length-1&&s.jsx("div",{className:l.classNames("join-line",lr.joinLine)})]},x.eventKey)},e[9]=t,e[10]=a.length,e[11]=o,e[12]=r,e[13]=i,e[14]=d):d=e[14],u=a.map(d),e[3]=t,e[4]=a,e[5]=o,e[6]=r,e[7]=i,e[8]=u}else u=e[8];let m;return e[15]!==c||e[16]!==u?(m=s.jsx("div",{className:c,children:u}),e[15]=c,e[16]=u,e[17]=m):m=e[17],m},ar="_tab_1tbi7_1",rr="_disabled_1tbi7_7",ir="_vertical_1tbi7_13",un={tab:ar,disabled:rr,vertical:ir},On=n=>{const e=l.compilerRuntimeExports.c(15),{eventKey:t,className:o,onClick:a,disabled:r,vertical:i,children:c}=n;let u;e[0]!==o||e[1]!==r||e[2]!==i?(u=l.classNames("luminus-tab text-primary rounded",un.tab,o,{disabled:r},{[un.disabled]:r},{vertical:i},{[un.vertical]:i}),e[0]=o,e[1]=r,e[2]=i,e[3]=u):u=e[3];let m;e[4]!==r||e[5]!==t||e[6]!==a?(m=()=>a&&!r&&a(t),e[4]=r,e[5]=t,e[6]=a,e[7]=m):m=e[7];let d;e[8]!==c||e[9]!==i?(d=typeof c=="string"?s.jsx(l.Typography,{variant:i?"body":"h6",className:i?"":"text-primary",children:c}):c,e[8]=c,e[9]=i,e[10]=d):d=e[10];let f;return e[11]!==u||e[12]!==m||e[13]!==d?(f=s.jsx("div",{role:"button",className:u,onClick:m,children:d}),e[11]=u,e[12]=m,e[13]=d,e[14]=f):f=e[14],f},cr=n=>{var f;const e=l.compilerRuntimeExports.c(31);let t,o,a,r;e[0]!==n?({tabs:r,activeTab:t,onSelect:o,...a}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r):(t=e[1],o=e[2],a=e[3],r=e[4]);const{ProjectIconComponent:i}=N.useContext(l.LuminusComponentsContext),{isMobile:c}=l.useWindowSize();if(c){let p;e[5]!==t||e[6]!==r?(p=((f=r.find(v=>v.id===t))==null?void 0:f.name)??"",e[5]=t,e[6]=r,e[7]=p):p=e[7];let g;e[8]!==i?(g=s.jsx(i,{icon:"chevron-down"}),e[8]=i,e[9]=g):g=e[9];let x;e[10]!==p||e[11]!==g?(x=s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle,text:p,icon:g}),e[10]=p,e[11]=g,e[12]=x):x=e[12];let y;if(e[13]!==o||e[14]!==r){let v;e[16]!==o?(v=b=>s.jsx(l.DropdownItem,{onClick:()=>o(b.id),children:b.name},b.id),e[16]=o,e[17]=v):v=e[17],y=r.map(v),e[13]=o,e[14]=r,e[15]=y}else y=e[15];let h;return e[18]!==a||e[19]!==x||e[20]!==y?(h=s.jsx(l.Dropdown,{toggle:x,...a,children:y}),e[18]=a,e[19]=x,e[20]=y,e[21]=h):h=e[21],h}let u;e[22]!==o?(u=p=>o(p),e[22]=o,e[23]=u):u=e[23];let m;e[24]!==r?(m=r.map(dr),e[24]=r,e[25]=m):m=e[25];let d;return e[26]!==t||e[27]!==a||e[28]!==u||e[29]!==m?(d=s.jsx(Mn,{activeTab:t,onSelect:u,...a,children:m}),e[26]=t,e[27]=a,e[28]=u,e[29]=m,e[30]=d):d=e[30],d};function dr(n){return s.jsx(On,{eventKey:n.id,children:n.name},n.id)}const ur="_selection_1dtmm_1",mr="_selectionBg_1dtmm_10",fr="_selectionItemsContainer_1dtmm_18",pr="_selectionItems_1dtmm_18",Wt={selection:ur,selectionBg:mr,selectionItemsContainer:fr,selectionItems:pr},Bn=n=>{const e=l.compilerRuntimeExports.c(14),{icon:t,setIcon:o,IconComponent:a,IconTypeArray:r}=n,[i,c]=N.useState(!1);let u;e[0]!==o?(u=x=>{o(x),c(!1)},e[0]=o,e[1]=u):u=e[1];const m=u;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>c(!0),e[2]=d):d=e[2];let f;e[3]!==a||e[4]!==t?(f=s.jsx(l.IconButton,{className:"rounded m-1",onClick:d,children:s.jsx(a,{icon:t})}),e[3]=a,e[4]=t,e[5]=f):f=e[5];let p;e[6]!==a||e[7]!==r||e[8]!==m||e[9]!==i?(p=i&&s.jsxs("div",{className:Wt.selection,children:[s.jsx("div",{className:Wt.selectionBg,onClick:()=>c(!1)}),s.jsx("div",{className:Wt.selectionItemsContainer,children:s.jsx("div",{className:Wt.selectionItems,children:r.filter(hr).map(x=>s.jsx(l.IconButton,{className:"rounded",onClick:()=>m(x),children:s.jsx(a,{icon:x})},x))})})]}),e[6]=a,e[7]=r,e[8]=m,e[9]=i,e[10]=p):p=e[10];let g;return e[11]!==f||e[12]!==p?(g=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=g):g=e[13],g};function hr(n,e,t){return t.indexOf(n)===e}const zn=()=>{const n=N.useContext(l.ShortcutLinksContext);if(n===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return n},gr=n=>{const e=l.compilerRuntimeExports.c(32),{shortcutLink:t,IconComponent:o,IconTypeArray:a,editShortcutLink:r,deleteLocation:i}=n,{ProjectIconComponent:c}=N.useContext(l.LuminusComponentsContext),[u,m]=N.useState(t.icon),[d,f]=N.useState(t.name),p=!(u===t.icon&&d===t.name);let g;e[0]!==t.icon||e[1]!==t.name?(g=()=>{m(t.icon),f(t.name)},e[0]=t.icon,e[1]=t.name,e[2]=g):g=e[2];const x=g;let y;e[3]!==r||e[4]!==u||e[5]!==d||e[6]!==t?(y=()=>{r({...t,icon:u,name:d})},e[3]=r,e[4]=u,e[5]=d,e[6]=t,e[7]=y):y=e[7];const h=y;let v;e[8]!==d?(v=s.jsx("td",{className:"align-middle",children:s.jsx(l.TextInput,{type:"text",maxLength:20,value:d,onChange:f,className:"d-flex-grow-1",InputContainer:l.NoInputContainer,size:"sm"})}),e[8]=d,e[9]=v):v=e[9];let b;e[10]!==o||e[11]!==a||e[12]!==u?(b=s.jsx("td",{className:"align-middle",children:s.jsx("div",{className:"d-flex justify-content-center align-items-center",children:s.jsx(Bn,{icon:u,setIcon:m,IconComponent:o,IconTypeArray:a})})}),e[10]=o,e[11]=a,e[12]=u,e[13]=b):b=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w={width:"7em"},e[14]=w):w=e[14];let S;e[15]!==c||e[16]!==x||e[17]!==h||e[18]!==p?(S=p&&s.jsxs(s.Fragment,{children:[s.jsx(l.IconButton,{onClick:x,color:"secondary",className:"d-inline",children:s.jsx(c,{icon:"cancel"})}),s.jsx(l.IconButton,{onClick:h,color:"success",className:"d-inline",children:s.jsx(c,{icon:"check"})})]}),e[15]=c,e[16]=x,e[17]=h,e[18]=p,e[19]=S):S=e[19];let j;e[20]!==c?(j=s.jsx(c,{icon:"delete"}),e[20]=c,e[21]=j):j=e[21];let C;e[22]!==i||e[23]!==j?(C=s.jsx(l.IconButton,{onClick:i,color:"danger",children:j}),e[22]=i,e[23]=j,e[24]=C):C=e[24];let I;e[25]!==S||e[26]!==C?(I=s.jsx("td",{className:"align-middle",style:w,children:s.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-end",children:[S,C]})}),e[25]=S,e[26]=C,e[27]=I):I=e[27];let k;return e[28]!==v||e[29]!==b||e[30]!==I?(k=s.jsxs(s.Fragment,{children:[v,b,I]}),e[28]=v,e[29]=b,e[30]=I,e[31]=k):k=e[31],k},xr=n=>{const e=l.compilerRuntimeExports.c(14),{shortcutLink:t,IconComponent:o,IconTypeArray:a,editShortcutLink:r,deleteShortcutLink:i}=n;let c;e[0]!==i||e[1]!==t.id?(c=()=>{i(t.id)},e[0]=i,e[1]=t.id,e[2]=c):c=e[2];const u=c;let m;e[3]!==t.url?(m=s.jsx("td",{className:"align-middle",children:t.url.length<=23?s.jsx(l.Typography,{variant:"body2",children:t.url}):s.jsx(l.SimpleTooltip,{placement:"bottom",text:t.url,children:s.jsxs(l.Typography,{variant:"body2",children:[t.url.slice(0,21),"..."]})})}),e[3]=t.url,e[4]=m):m=e[4];let d;e[5]!==o||e[6]!==a||e[7]!==u||e[8]!==r||e[9]!==t?(d=s.jsx(gr,{shortcutLink:t,IconComponent:o,IconTypeArray:a,editShortcutLink:r,deleteLocation:u}),e[5]=o,e[6]=a,e[7]=u,e[8]=r,e[9]=t,e[10]=d):d=e[10];let f;return e[11]!==m||e[12]!==d?(f=s.jsx("tr",{className:"mb-3",children:s.jsxs(s.Fragment,{children:[m,d]})}),e[11]=m,e[12]=d,e[13]=f):f=e[13],f},yr=n=>{const e=l.compilerRuntimeExports.c(11),{IconComponent:t,IconTypeArray:o}=n,{texts:a}=N.useContext(l.LuminusComponentsContext),{shortcutLinks:r,editShortcutLink:i,deleteShortcutLink:c}=zn();let u;return e[0]!==t||e[1]!==o||e[2]!==c||e[3]!==i||e[4]!==r||e[5]!==a.shortcutLinks.addLinksToEditThemHereInfo||e[6]!==a.shortcutLinks.icon||e[7]!==a.shortcutLinks.name||e[8]!==a.shortcutLinks.shortcutLinksSetting||e[9]!==a.shortcutLinks.target?(u=s.jsx(s.Fragment,{children:r!==null&&r.length>0?s.jsxs(uo,{size:"sm",title:a.shortcutLinks.shortcutLinksSetting,children:[s.jsx("thead",{className:"fw-bold",children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsx(l.Typography,{variant:"body2",children:a.shortcutLinks.target})}),s.jsx("th",{children:s.jsx(l.Typography,{variant:"body2",children:a.shortcutLinks.name})}),s.jsx("th",{className:"text-center",children:s.jsx(l.Typography,{variant:"body2",children:a.shortcutLinks.icon})}),s.jsx("th",{})]})}),s.jsx("tbody",{children:r==null?void 0:r.map(m=>s.jsx(xr,{shortcutLink:m,IconComponent:t,IconTypeArray:o,editShortcutLink:i,deleteShortcutLink:c},m.id))})]}):s.jsx(l.Alert,{variant:"info",size:"sm",children:a.shortcutLinks.addLinksToEditThemHereInfo})}),e[0]=t,e[1]=o,e[2]=c,e[3]=i,e[4]=r,e[5]=a.shortcutLinks.addLinksToEditThemHereInfo,e[6]=a.shortcutLinks.icon,e[7]=a.shortcutLinks.name,e[8]=a.shortcutLinks.shortcutLinksSetting,e[9]=a.shortcutLinks.target,e[10]=u):u=e[10],u},Sn=5,vr="_linkButton_pnlvi_1",br="_linkAddButton_pnlvi_31",jr="_createLinkRow_pnlvi_39",_t={linkButton:vr,linkAddButton:br,createLinkRow:jr},Sr=n=>{const e=l.compilerRuntimeExports.c(9),{shortcutLink:t,IconComponent:o}=n;let a;e[0]!==o||e[1]!==t.icon?(a=s.jsx(o,{icon:t.icon}),e[0]=o,e[1]=t.icon,e[2]=a):a=e[2];let r;e[3]!==t.url||e[4]!==a?(r=s.jsx(Ne.Link,{to:t.url,className:_t.linkButton,children:a}),e[3]=t.url,e[4]=a,e[5]=r):r=e[5];let i;return e[6]!==t.name||e[7]!==r?(i=s.jsx(l.SimpleTooltip,{text:t.name,placement:"bottom",children:r}),e[6]=t.name,e[7]=r,e[8]=i):i=e[8],i},Cr=n=>{const e=l.compilerRuntimeExports.c(51),{closeModal:t,isOpen:o,createLink:a,pageTitlePrefix:r,IconComponent:i,IconTypeArray:c}=n,u=Ne.useLocation(),{texts:m}=N.useContext(l.LuminusComponentsContext),[d,f]=N.useState("star-outline");let p;e[0]!==r?(p=r?document.title.replace(r,""):document.title,e[0]=r,e[1]=p):p=e[1];const[g,x]=N.useState(p);let y;e[2]!==t||e[3]!==a||e[4]!==d||e[5]!==u.pathname||e[6]!==u.search||e[7]!==g?(y=async()=>{await a({icon:d,name:g,url:u.pathname+u.search}),t()},e[2]=t,e[3]=a,e[4]=d,e[5]=u.pathname,e[6]=u.search,e[7]=g,e[8]=y):y=e[8];const h=y,v=u.pathname+u.search;let b;e[9]!==m.shortcutLinks.newShortcut?(b=s.jsx(l.Modal.Header,{closeButton:!0,children:s.jsx(l.Modal.Title,{children:m.shortcutLinks.newShortcut})}),e[9]=m.shortcutLinks.newShortcut,e[10]=b):b=e[10];let w;e[11]!==m.shortcutLinks.target?(w=s.jsx(l.Typography,{variant:"form-label",className:"pe-3 text-end",children:m.shortcutLinks.target}),e[11]=m.shortcutLinks.target,e[12]=w):w=e[12];let S;e[13]!==v?(S=v.length<=23?v:s.jsx(l.SimpleTooltip,{placement:"bottom",text:v,children:s.jsxs("span",{children:[v.slice(0,21),"..."]})}),e[13]=v,e[14]=S):S=e[14];let j;e[15]!==S?(j=s.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:S}),e[15]=S,e[16]=j):j=e[16];let C;e[17]!==w||e[18]!==j?(C=s.jsxs("div",{className:_t.createLinkRow,children:[w,j]}),e[17]=w,e[18]=j,e[19]=C):C=e[19];let I;e[20]!==m.shortcutLinks.name?(I=s.jsx(l.Typography,{variant:"form-label",className:"pe-3 text-end",children:m.shortcutLinks.name}),e[20]=m.shortcutLinks.name,e[21]=I):I=e[21];let k;e[22]!==g?(k=s.jsx("div",{className:"d-flex align-items-middle fw-bold",children:s.jsx(l.TextInput,{type:"text",maxLength:25,value:g,onChange:x,className:"w-100",InputContainer:l.RowLabelInput,withoutLabel:!0})}),e[22]=g,e[23]=k):k=e[23];let L;e[24]!==I||e[25]!==k?(L=s.jsxs("div",{className:_t.createLinkRow,children:[I,k]}),e[24]=I,e[25]=k,e[26]=L):L=e[26];let E;e[27]!==m.shortcutLinks.icon?(E=s.jsx(l.Typography,{variant:"form-label",className:"pe-3 text-end",children:m.shortcutLinks.icon}),e[27]=m.shortcutLinks.icon,e[28]=E):E=e[28];let D;e[29]!==i||e[30]!==c||e[31]!==d?(D=s.jsx("div",{className:"d-flex align-items-middle fw-bold",children:s.jsx(Bn,{icon:d,setIcon:f,IconComponent:i,IconTypeArray:c})}),e[29]=i,e[30]=c,e[31]=d,e[32]=D):D=e[32];let _;e[33]!==E||e[34]!==D?(_=s.jsxs("div",{className:_t.createLinkRow,children:[E,D]}),e[33]=E,e[34]=D,e[35]=_):_=e[35];let R;e[36]!==L||e[37]!==_||e[38]!==C?(R=s.jsxs(l.Modal.Body,{children:[C,L,_]}),e[36]=L,e[37]=_,e[38]=C,e[39]=R):R=e[39];let $;e[40]!==h||e[41]!==m.shortcutLinks.addShortcut?($=s.jsx(l.Modal.Footer,{className:"d-flex justify-content-end",children:s.jsx(l.PrimaryButton,{onClick:h,children:m.shortcutLinks.addShortcut})}),e[40]=h,e[41]=m.shortcutLinks.addShortcut,e[42]=$):$=e[42];let A;e[43]!==R||e[44]!==$||e[45]!==b?(A=s.jsxs("div",{onKeyDown:wr,children:[b,R,$]}),e[43]=R,e[44]=$,e[45]=b,e[46]=A):A=e[46];let T;return e[47]!==t||e[48]!==o||e[49]!==A?(T=s.jsx(l.Modal,{show:o,onHide:t,size:"sm",children:A}),e[47]=t,e[48]=o,e[49]=A,e[50]=T):T=e[50],T};function wr(n){n.code!=="Escape"&&n.stopPropagation()}const Nr=n=>{const e=l.compilerRuntimeExports.c(17),{IconComponent:t,IconTypeArray:o,pageTitlePrefix:a,createLink:r}=n,{ProjectIconComponent:i,texts:c}=N.useContext(l.LuminusComponentsContext),[u,m]=N.useState(!1),[d]=l.a(u,100),f=c.shortcutLinks.addShortcut;let p,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=l.classNames(_t.linkButton,_t.linkAddButton),g=()=>m(!0),e[0]=p,e[1]=g):(p=e[0],g=e[1]);let x;e[2]!==i?(x=s.jsx("button",{type:"button",className:p,onClick:g,children:s.jsx(i,{icon:"add"})}),e[2]=i,e[3]=x):x=e[3];let y;e[4]!==x||e[5]!==c.shortcutLinks.addShortcut?(y=s.jsx(l.SimpleTooltip,{text:f,placement:"bottom",children:x}),e[4]=x,e[5]=c.shortcutLinks.addShortcut,e[6]=y):y=e[6];let h;e[7]!==t||e[8]!==o||e[9]!==r||e[10]!==d||e[11]!==u||e[12]!==a?(h=(u||d)&&s.jsx(Cr,{IconComponent:t,IconTypeArray:o,closeModal:()=>m(!1),createLink:r,isOpen:u,pageTitlePrefix:a}),e[7]=t,e[8]=o,e[9]=r,e[10]=d,e[11]=u,e[12]=a,e[13]=h):h=e[13];let v;return e[14]!==y||e[15]!==h?(v=s.jsxs(s.Fragment,{children:[y,h]}),e[14]=y,e[15]=h,e[16]=v):v=e[16],v},Ir=n=>{const e=l.compilerRuntimeExports.c(12),{IconComponent:t,IconTypeArray:o,pageTitlePrefix:a}=n,{shortcutLinks:r,createShortcutLink:i}=zn(),c=r!==null&&r.length<Sn;let u;e[0]!==t||e[1]!==r?(u=r==null?void 0:r.slice(0,Sn).map((f,p)=>f!==null?s.jsx(Sr,{shortcutLink:f,IconComponent:t},p):null),e[0]=t,e[1]=r,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==o||e[5]!==i||e[6]!==c||e[7]!==a?(m=c&&s.jsx(Nr,{IconComponent:t,IconTypeArray:o,pageTitlePrefix:a,createLink:i}),e[3]=t,e[4]=o,e[5]=i,e[6]=c,e[7]=a,e[8]=m):m=e[8];let d;return e[9]!==u||e[10]!==m?(d=s.jsx(s.Fragment,{children:s.jsxs("div",{className:"d-flex gap-2",children:[u,m]})}),e[9]=u,e[10]=m,e[11]=d):d=e[11],d},kr=n=>{const e=l.useAxios(),{startLoading:t,stopLoading:o}=N.useContext(l.LoadingContext),a=N.useCallback(async c=>{t("submit-createShortcutLink");try{await e.post(`/dynamicForms/insert?referenceId=${n}`,c)}finally{o("submit-createShortcutLink")}},[e,n,t,o]),r=N.useCallback(async c=>{t("submit-updateShortcutLink");try{await e.post(`/dynamicForms/update?referenceId=${n}`,c)}finally{o("submit-updateShortcutLink")}},[e,n,t,o]),i=N.useCallback(async c=>{t("delete-deleteShortcutLink");try{await e.delete(`/dynamicForms/delete?referenceId=${n}&pk=${c.toString()}`)}finally{o("delete-deleteShortcutLink")}},[e,n,t,o]);return{create:a,update:r,remove:i}},_r=n=>{if(n==null)throw new Error("Tried to make operation on null shortcutLinks.");return n},us=n=>{if(n==null)throw new Error("Tried to make operation on null shortcutLinks.");return n},Dr=n=>{const e=l.compilerRuntimeExports.c(22),{children:t,referenceId:o}=n,{user:a}=N.useContext(l.UserContext),r=Er,i=a!==null;let c;e[0]!==i?(c={silent:!0,dataTransformer:r,enabled:i},e[0]=i,e[1]=c):c=e[1];const{data:u,reloadData:m}=Ae.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${o}&employee=${a==null?void 0:a.personalNumber}`,c),{create:d,update:f,remove:p}=kr(o);let g;e[2]!==d||e[3]!==m||e[4]!==u||e[5]!==a?(g=async C=>{const I=us(a);if(_r(u).length>=Sn)throw new Error("Cannot add more shortcut links.");await d({...C,employee:I.personalNumber}),await m()},e[2]=d,e[3]=m,e[4]=u,e[5]=a,e[6]=g):g=e[6];const x=g;let y;e[7]!==m||e[8]!==f||e[9]!==a?(y=async C=>{const I=us(a);await f({...C,employee:I.personalNumber}),await m()},e[7]=m,e[8]=f,e[9]=a,e[10]=y):y=e[10];const h=y;let v;e[11]!==m||e[12]!==p?(v=async C=>{await p(C),await m()},e[11]=m,e[12]=p,e[13]=v):v=e[13];const b=v;let w;e[14]!==x||e[15]!==b||e[16]!==h||e[17]!==u?(w={shortcutLinks:u,createShortcutLink:x,editShortcutLink:h,deleteShortcutLink:b},e[14]=x,e[15]=b,e[16]=h,e[17]=u,e[18]=w):w=e[18];const S=w;let j;return e[19]!==t||e[20]!==S?(j=s.jsx(l.ShortcutLinksContext.Provider,{value:S,children:t}),e[19]=t,e[20]=S,e[21]=j):j=e[21],j};function Tr(n){return{id:n.id,icon:n.icon,name:n.name,url:n.url}}function Er(n){return n.map(Tr)}const Lr=n=>{const e=l.compilerRuntimeExports.c(6),{targets:t,removeNotifTarget:o}=n,{ProjectIconComponent:a}=N.useContext(l.LuminusComponentsContext);let r;e[0]!==a||e[1]!==o||e[2]!==t?(r=t&&t.sort(Rr).map(c=>s.jsxs("div",{className:"d-flex gap-2 align-items-center justify-content-between mb-1",children:[s.jsx("div",{className:"text-secondary",children:s.jsx("span",{className:"d-flex gap-2 ",children:c.employeeId&&c.roleName===null?s.jsxs(s.Fragment,{children:[s.jsx(a,{icon:"user"}),s.jsx(l.Typography,{variant:"subtitle",children:c.employeeName})]}):s.jsxs(s.Fragment,{children:[s.jsx(a,{icon:"role"}),s.jsx(l.Typography,{variant:"subtitle",children:c.roleName})]})})}),s.jsx(l.IconButton,{size:"sm",color:"danger",onClick:()=>o(c.id),children:s.jsx(a,{icon:"delete"})})]},c.id)),e[0]=a,e[1]=o,e[2]=t,e[3]=r):r=e[3];let i;return e[4]!==r?(i=s.jsx(s.Fragment,{children:r}),e[4]=r,e[5]=i):i=e[5],i};function Rr(n,e){return(n.employeeId??0)-(e.employeeId??0)}const $r=n=>{const e=l.compilerRuntimeExports.c(45),{show:t,onHide:o,roles:a,onAddTarget:r,EmployeePicker:i,templateId:c}=n,{texts:u}=N.useContext(l.LuminusComponentsContext),{notifCentrum:m}=u,[d,f]=N.useState(null),[p,g]=N.useState(null),[x,y]=N.useState("R");let h;e[0]!==o?(h=()=>{f(null),g(null),o()},e[0]=o,e[1]=h):h=e[1];const v=h;let b;e[2]!==v?(b=()=>v(),e[2]=v,e[3]=b):b=e[3];let w;e[4]!==m.addNewTarget?(w=s.jsx(l.Modal.Header,{closeButton:!0,children:s.jsx(l.Modal.Title,{children:m.addNewTarget})}),e[4]=m.addNewTarget,e[5]=w):w=e[5];let S;e[6]!==m.employee?(S={id:"E",name:m.employee},e[6]=m.employee,e[7]=S):S=e[7];let j;e[8]!==m.role?(j={id:"R",name:m.role},e[8]=m.role,e[9]=j):j=e[9];let C;e[10]!==S||e[11]!==j?(C=[S,j],e[10]=S,e[11]=j,e[12]=C):C=e[12];let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=$=>y($),e[13]=I):I=e[13];let k;e[14]!==C||e[15]!==x?(k=s.jsx(Io,{options:C,value:x,onChange:I,InputContainer:l.RowLabelInput}),e[14]=C,e[15]=x,e[16]=k):k=e[16];let L;e[17]!==i||e[18]!==(d==null?void 0:d.id)||e[19]!==(d==null?void 0:d.name)||e[20]!==m.employee||e[21]!==m.role||e[22]!==p||e[23]!==a||e[24]!==x?(L=x==="E"?s.jsx(i,{InputContainer:l.RowLabelInput,label:m.employee,value:{id:(d==null?void 0:d.id)??null,name:(d==null?void 0:d.name)??""},onSelect:$=>f({id:Number($==null?void 0:$.id)??null,name:($==null?void 0:$.name)??""})}):s.jsx(l.CustomSelectInput,{InputContainer:l.RowLabelInput,label:m.role,options:a.map(Fr),value:p,onChange:$=>g(($==null?void 0:$.toString())??"")}),e[17]=i,e[18]=d==null?void 0:d.id,e[19]=d==null?void 0:d.name,e[20]=m.employee,e[21]=m.role,e[22]=p,e[23]=a,e[24]=x,e[25]=L):L=e[25];let E;e[26]!==L||e[27]!==k?(E=s.jsxs(l.Modal.Body,{children:[k,L]}),e[26]=L,e[27]=k,e[28]=E):E=e[28];let D;e[29]!==(d==null?void 0:d.id)||e[30]!==(d==null?void 0:d.name)||e[31]!==v||e[32]!==r||e[33]!==p||e[34]!==c?(D=()=>{r({templateId:c??0,targetId:null,employeeId:(d==null?void 0:d.id)??null,roleName:p},(d==null?void 0:d.name)??null),v()},e[29]=d==null?void 0:d.id,e[30]=d==null?void 0:d.name,e[31]=v,e[32]=r,e[33]=p,e[34]=c,e[35]=D):D=e[35];let _;e[36]!==m.add||e[37]!==D?(_=s.jsx(l.Modal.Footer,{className:"d-flex justify-content-end",children:s.jsx(l.PrimaryButton,{onClick:D,children:m.add})}),e[36]=m.add,e[37]=D,e[38]=_):_=e[38];let R;return e[39]!==t||e[40]!==E||e[41]!==_||e[42]!==b||e[43]!==w?(R=s.jsxs(l.Modal,{show:t,onHide:b,children:[w,E,_]}),e[39]=t,e[40]=E,e[41]=_,e[42]=b,e[43]=w,e[44]=R):R=e[44],R};function Fr(n){return{id:n,name:n}}const Pr=n=>{const e=l.compilerRuntimeExports.c(27),{templates:t,selectedTemplateId:o,setSelectedTemplateId:a,roles:r,onAddNotifTarget:i,onRemoveNotifTarget:c,EmployeePicker:u}=n,{texts:m,ProjectIconComponent:d}=N.useContext(l.LuminusComponentsContext),{notifCentrum:f}=m,[p,g]=N.useState(!1);let x;if(e[0]!==d||e[1]!==f||e[2]!==c||e[3]!==o||e[4]!==a||e[5]!==t){let S;e[7]!==d||e[8]!==f||e[9]!==c||e[10]!==o||e[11]!==a?(S=j=>s.jsxs(l.ListGroup.Item,{action:o!==j.id,className:`p-0 mb-2 border rounded shadow-sm ${o===j.id?"border-1 border-primary":""}`,onClick:()=>a(j.id),children:[s.jsxs("div",{className:"d-flex gap-2 justify-content-between align-items-center border-1 border-bottom border-primary p-2",children:[s.jsx("div",{className:"text-primary",children:j.destinationId===1?s.jsx(d,{icon:"mail-envelope"}):s.jsx(d,{icon:"dashboard"})}),s.jsx(l.Typography,{className:"text-truncate text-primary",variant:"subtitle",children:j.subjectTemplate}),s.jsx(l.IconButton,{size:"sm",onClick:()=>g(!0),children:s.jsx(d,{icon:"add"})})]}),s.jsx("div",{className:"my-2 ps-3 pe-2",children:j.targets.length>0?s.jsx(Lr,{targets:j.targets,removeNotifTarget:c}):s.jsx(l.Alert,{size:"sm",variant:"warning",children:f.noTargets})})]},j.id),e[7]=d,e[8]=f,e[9]=c,e[10]=o,e[11]=a,e[12]=S):S=e[12],x=t.map(S),e[0]=d,e[1]=f,e[2]=c,e[3]=o,e[4]=a,e[5]=t,e[6]=x}else x=e[6];let y;e[13]!==x?(y=s.jsx(l.ListGroup,{className:"overflow-auto h-max-100 p-2",children:x}),e[13]=x,e[14]=y):y=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=()=>g(!1),e[15]=h):h=e[15];let v;e[16]!==r?(v=r??[],e[16]=r,e[17]=v):v=e[17];let b;e[18]!==u||e[19]!==i||e[20]!==o||e[21]!==p||e[22]!==v?(b=s.jsx($r,{show:p,onHide:h,roles:v,onAddTarget:i,EmployeePicker:u,templateId:o}),e[18]=u,e[19]=i,e[20]=o,e[21]=p,e[22]=v,e[23]=b):b=e[23];let w;return e[24]!==y||e[25]!==b?(w=s.jsxs(s.Fragment,{children:[y,b]}),e[24]=y,e[25]=b,e[26]=w):w=e[26],w},Ar=n=>{const e=l.compilerRuntimeExports.c(21),{data:t,onClick:o,BnfTableComponent:a}=n,{texts:r}=N.useContext(l.LuminusComponentsContext),{notifCentrum:i}=r;let c;e[0]!==t?(c=t==null?void 0:t.map(Or),e[0]=t,e[1]=c):c=e[1];const u=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=l.u(),e[2]=m):m=e[2];const d=m;let f;e[3]!==i.date?(f=d.accessor("date",{header:i.date,type:"date"}),e[3]=i.date,e[4]=f):f=e[4];let p;e[5]!==i.recipients?(p=d.accessor("recipientsString",{header:i.recipients,type:"string"}),e[5]=i.recipients,e[6]=p):p=e[6];let g;e[7]!==i.subject?(g=d.accessor("subject",{header:i.subject,type:"string",meta:{hidden:!0}}),e[7]=i.subject,e[8]=g):g=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=d.accessor("id",{header:"Id",type:"number",meta:{hidden:!0}}),e[9]=x):x=e[9];let y;e[10]!==f||e[11]!==p||e[12]!==g?(y=[f,p,g,x],e[10]=f,e[11]=p,e[12]=g,e[13]=y):y=e[13];const h=y;let v;e[14]!==o?(v=S=>{o(S.id)},e[14]=o,e[15]=v):v=e[15];const b=v;let w;return e[16]!==a||e[17]!==h||e[18]!==b||e[19]!==u?(w=s.jsx(a,{columns:h,data:u,onRowClick:b}),e[16]=a,e[17]=h,e[18]=b,e[19]=u,e[20]=w):w=e[20],w};function Mr(n){return n.name}function Or(n){var e;return{...n,recipientsString:((e=n.recipients)==null?void 0:e.map(Mr).join(", "))??""}}const Br=n=>{const e=l.compilerRuntimeExports.c(18),{show:t,onHide:o,template:a,onEdit:r}=n,{texts:i}=N.useContext(l.LuminusComponentsContext),{notifCentrum:c}=i,[u,m]=N.useState(null),[d,f]=N.useState(null);let p,g;e[0]!==a?(p=()=>{a&&(m(a.subjectTemplate),f(a.textTemplate))},g=[a],e[0]=a,e[1]=p,e[2]=g):(p=e[1],g=e[2]),N.useEffect(p,g);let x;e[3]!==d||e[4]!==r||e[5]!==o||e[6]!==u?(x=()=>{!u||!d||(r(u,d),o())},e[3]=d,e[4]=r,e[5]=o,e[6]=u,e[7]=x):x=e[7];const y=x;let h;e[8]!==d||e[9]!==y||e[10]!==c||e[11]!==o||e[12]!==t||e[13]!==u||e[14]!==a?(h=a&&s.jsxs(l.Modal,{show:t,onHide:o,size:"lg",scrollable:!0,children:[s.jsx(l.Modal.Header,{children:s.jsx(l.Modal.Title,{children:c.editTemplate})}),s.jsxs(l.Modal.Body,{style:{minHeight:"50vh"},children:[s.jsxs(l.Form.Group,{controlId:"subject",children:[s.jsx(l.Form.Label,{children:s.jsx(l.Typography,{variant:"form-label",className:"text-primary",children:c.subject})}),s.jsx(l.Form.Control,{value:u??"",onChange:b=>m(b.target.value)})]}),s.jsxs(l.Form.Group,{controlId:"text",children:[s.jsx(l.Form.Label,{children:s.jsx(l.Typography,{variant:"form-label",className:"text-primary",children:c.text})}),s.jsx(l.Form.Control,{as:"textarea",rows:10,value:d??"",onChange:b=>f(b.target.value),style:{resize:"vertical",minHeight:"400px"}})]})]}),s.jsx(l.Modal.Footer,{className:"d-flex justify-content-end",children:s.jsx(l.PrimaryButton,{onClick:()=>{console.log(u),console.log(d),y()},children:c.save})})]}),e[8]=d,e[9]=y,e[10]=c,e[11]=o,e[12]=t,e[13]=u,e[14]=a,e[15]=h):h=e[15];let v;return e[16]!==h?(v=s.jsx(s.Fragment,{children:h}),e[16]=h,e[17]=v):v=e[17],v},zr=n=>{var Be,ze,De,Te;const e=l.compilerRuntimeExports.c(116),{kinds:t,targetSystem:o,reloadActions:a,reloadHistory:r,reloadRoles:i,onRemoveTarget:c,onPostTarget:u,onTemplateEdit:m,EmployeePicker:d,BnfTableComponent:f}=n,{texts:p,ProjectIconComponent:g}=N.useContext(l.LuminusComponentsContext),{notifCentrum:x}=p,{confirm:y}=l.useConfirm(),[h,v]=N.useState(null),[b,w]=N.useState(null),[S,j]=N.useState(!1),[C,I]=Ae.useLocalStorageState("notif-kind-id",null);let k,L;e[0]!==t||e[1]!==I?(k=()=>{var ie;t.length>0?I(((ie=t.at(0))==null?void 0:ie.id)??null):I(null)},L=[t,I],e[0]=t,e[1]=I,e[2]=k,e[3]=L):(k=e[2],L=e[3]),N.useEffect(k,L);let E;e[4]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[4]=E):E=e[4];const[D,_]=N.useState(E);let R,$;e[5]!==a||e[6]!==C?(R=()=>{C&&a(C).then(ie=>{_(ie)}).catch(ie=>{console.log(ie),_([])})},$=[a,C],e[5]=a,e[6]=C,e[7]=R,e[8]=$):(R=e[7],$=e[8]),N.useEffect(R,$);let A;e[9]!==D?(A=((Be=D==null?void 0:D.at(0))==null?void 0:Be.id)??null,e[9]=D,e[10]=A):A=e[10];const[T,F]=Ae.useLocalStorageState("notif-action-id",A);let P;e[11]===Symbol.for("react.memo_cache_sentinel")?(P=[],e[11]=P):P=e[11];const[M,O]=N.useState(P);let z;e[12]!==r||e[13]!==T||e[14]!==h?(z=()=>{T===null||h===null||r(T,h).then(ie=>{O(ie)}).catch(ie=>{console.log(ie),O([])})},e[12]=r,e[13]=T,e[14]=h,e[15]=z):z=e[15];let H;e[16]!==a||e[17]!==r||e[18]!==T||e[19]!==C||e[20]!==h?(H=[a,r,T,C,h],e[16]=a,e[17]=r,e[18]=T,e[19]=C,e[20]=h,e[21]=H):H=e[21],N.useEffect(z,H);let W;e[22]===Symbol.for("react.memo_cache_sentinel")?(W=[],e[22]=W):W=e[22];const[B,U]=N.useState(W);let V,X;e[23]!==i||e[24]!==T?(V=()=>{T!==null&&i(T).then(ie=>{U(ie)}).catch(ie=>{console.log(ie),U([])})},X=[i,T],e[23]=i,e[24]=T,e[25]=V,e[26]=X):(V=e[25],X=e[26]),N.useEffect(V,X);let Y;e:{if(!D||!T){let Ce;e[27]===Symbol.for("react.memo_cache_sentinel")?(Ce=[],e[27]=Ce):Ce=e[27],Y=Ce;break e}let ie;e[28]!==D||e[29]!==T?(ie=((ze=D.find(Ce=>Ce.id===T))==null?void 0:ze.templates)??[],e[28]=D,e[29]=T,e[30]=ie):ie=e[30],Y=ie}const Z=Y;let te;e[31]!==D||e[32]!==u||e[33]!==T||e[34]!==h?(te=(ie,Ce)=>{u(ie,Ce).then(Ee=>{_(D?[...D.map($e=>$e.id!==T?$e:{...$e,templates:[...$e.templates.map(Ve=>Ve.id!==h?Ve:{...Ve,targets:[...Ve.targets,Ee]})]})]:[])}).catch(Hr)},e[31]=D,e[32]=u,e[33]=T,e[34]=h,e[35]=te):te=e[35];const se=te;let q;e[36]!==D||e[37]!==m||e[38]!==T||e[39]!==h?(q=(ie,Ce)=>{h&&m(h,ie,Ce).then(()=>{_(D?[...D.map(Ee=>Ee.id!==T?Ee:{...Ee,templates:[...Ee.templates.map($e=>$e.id!==h?$e:{...$e,subjectTemplate:ie,textTemplate:Ce})]})]:[])}).catch(Vr)},e[36]=D,e[37]=m,e[38]=T,e[39]=h,e[40]=q):q=e[40];const ae=q;let re;e[41]!==D||e[42]!==y||e[43]!==x.confirmTargetDelete||e[44]!==c||e[45]!==T||e[46]!==h?(re=async ie=>{await y(x.confirmTargetDelete)&&c(ie).then(()=>_(D?[...D.map(Ce=>Ce.id!==T?Ce:{...Ce,templates:[...Ce.templates.map(Ee=>Ee.id!==h?Ee:{...Ee,targets:Ee.targets.filter($e=>$e.id!==ie)})]})]:[]))},e[41]=D,e[42]=y,e[43]=x.confirmTargetDelete,e[44]=c,e[45]=T,e[46]=h,e[47]=re):re=e[47];const me=re;let fe;e[48]!==t||e[49]!==o?(fe=((De=t.filter(ie=>(ie.targetSystem&o)>0))==null?void 0:De.map(Wr))??[],e[48]=t,e[49]=o,e[50]=fe):fe=e[50];const Q=C??null;let K;e[51]!==I?(K=ie=>I(Number(ie)),e[51]=I,e[52]=K):K=e[52];let G;e[53]!==x.kind||e[54]!==fe||e[55]!==Q||e[56]!==K?(G=s.jsx("div",{className:"col-2",children:s.jsx(l.CustomSelectInput,{label:x.kind,size:"sm",noEmptyOption:!0,options:fe,value:Q,onChange:K,dropdownWidth:200})}),e[53]=x.kind,e[54]=fe,e[55]=Q,e[56]=K,e[57]=G):G=e[57];let oe;e[58]!==D?(oe=(D==null?void 0:D.map(Ur))??[],e[58]=D,e[59]=oe):oe=e[59];const J=T??null;let ee;e[60]!==F?(ee=ie=>F(Number(ie)),e[60]=F,e[61]=ee):ee=e[61];let ne;e[62]!==x.subkind||e[63]!==oe||e[64]!==J||e[65]!==ee?(ne=s.jsx("div",{className:"col-3",children:s.jsx(l.CustomSelectInput,{label:x.subkind,size:"sm",noEmptyOption:!0,options:oe,value:J,onChange:ee,dropdownWidth:250})}),e[62]=x.subkind,e[63]=oe,e[64]=J,e[65]=ee,e[66]=ne):ne=e[66];let ce;e[67]!==G||e[68]!==ne?(ce=s.jsxs("div",{className:"row w-100",children:[G,ne]}),e[67]=G,e[68]=ne,e[69]=ce):ce=e[69];let ve;e[70]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>j(!0),e[70]=ve):ve=e[70];const de=h===null;let be;e[71]!==g?(be=s.jsx(g,{icon:"edit"}),e[71]=g,e[72]=be):be=e[72];let we;e[73]!==x.editTemplate||e[74]!==de||e[75]!==be?(we=s.jsx(l.ResponsiveContextDropdown,{children:s.jsx(l.ResponsiveContextDropdownItem,{hideOn:"always",cKey:"template-edit",onClick:ve,disabled:de,icon:be,children:x.editTemplate})}),e[73]=x.editTemplate,e[74]=de,e[75]=be,e[76]=we):we=e[76];let ke;e[77]!==ce||e[78]!==we?(ke=s.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[ce,we]}),e[77]=ce,e[78]=we,e[79]=ke):ke=e[79];let Fe;e[80]!==B?(Fe=B??[],e[80]=B,e[81]=Fe):Fe=e[81];let le;e[82]===Symbol.for("react.memo_cache_sentinel")?(le=ie=>{v(ie),w(null)},e[82]=le):le=e[82];let ue;e[83]!==d||e[84]!==Z||e[85]!==se||e[86]!==me||e[87]!==h||e[88]!==Fe?(ue=s.jsx("div",{className:"h-75 w-25 overflow-hidden",children:s.jsx(Pr,{templates:Z,roles:Fe,onAddNotifTarget:se,onRemoveNotifTarget:me,selectedTemplateId:h,setSelectedTemplateId:le,EmployeePicker:d})}),e[83]=d,e[84]=Z,e[85]=se,e[86]=me,e[87]=h,e[88]=Fe,e[89]=ue):ue=e[89];let he;e[90]!==f||e[91]!==M||e[92]!==h?(he=h&&s.jsx(Ar,{data:M??[],onClick:ie=>w((M==null?void 0:M.find(Ce=>Ce.id===ie))??null),BnfTableComponent:f}),e[90]=f,e[91]=M,e[92]=h,e[93]=he):he=e[93];let pe;e[94]!==he?(pe=s.jsx("div",{className:"w-25 h-75 overflow-hidden",children:he}),e[94]=he,e[95]=pe):pe=e[95];let ye;e[96]!==Z||e[97]!==(b==null?void 0:b.message)||e[98]!==h?(ye=h&&s.jsx("div",{className:"h-75 w-75 overflow-hidden border rounded bg-white",children:s.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:(b==null?void 0:b.message)??((Te=Z.find(ie=>ie.id===h))==null?void 0:Te.textTemplate)})}),e[96]=Z,e[97]=b==null?void 0:b.message,e[98]=h,e[99]=ye):ye=e[99];let je;e[100]!==ue||e[101]!==pe||e[102]!==ye?(je=s.jsxs("div",{className:"vh-100 overflow-hidden d-flex gap-1",children:[ue,pe,ye]}),e[100]=ue,e[101]=pe,e[102]=ye,e[103]=je):je=e[103];let Oe;e[104]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>j(!1),e[104]=Oe):Oe=e[104];let Le;e[105]!==Z||e[106]!==h?(Le=Z.find(ie=>ie.id===h)??null,e[105]=Z,e[106]=h,e[107]=Le):Le=e[107];let Pe;e[108]!==ae||e[109]!==S||e[110]!==Le?(Pe=s.jsx(Br,{show:S,onHide:Oe,template:Le,onEdit:ae}),e[108]=ae,e[109]=S,e[110]=Le,e[111]=Pe):Pe=e[111];let Re;return e[112]!==ke||e[113]!==je||e[114]!==Pe?(Re=s.jsxs("div",{className:"h-100 overflow-hidden",children:[ke,je,Pe]}),e[112]=ke,e[113]=je,e[114]=Pe,e[115]=Re):Re=e[115],Re};function Hr(n){return console.log(n)}function Vr(n){return console.log(n)}function Wr(n){return{id:n.id,name:n.name}}function Ur(n){return{id:n.id,name:n.name}}const Gr=n=>{const e=l.compilerRuntimeExports.c(29),{history:t,onClick:o,BnfTableComponent:a}=n,{texts:r}=N.useContext(l.LuminusComponentsContext),{notifCentrum:i}=r;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.u(),e[0]=c):c=e[0];const u=c;let m,d,f,p;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=u.accessor("id",{header:"notificationHistory.id",type:"number",meta:{hidden:!0}}),d=u.accessor("recipientId",{header:"notificationHistory.recipientId",type:"number",meta:{hidden:!0}}),f=u.accessor("recipientFullName",{header:"notificationHistory.recipientFullName",type:"string",meta:{hidden:!0}}),p=u.accessor("actionKindId",{header:"notificationHistory.actionKindId",type:"number",meta:{hidden:!0}}),e[1]=m,e[2]=d,e[3]=f,e[4]=p):(m=e[1],d=e[2],f=e[3],p=e[4]);let g;e[5]!==i.subkind?(g=u.accessor("actionKindName",{header:i.subkind,type:"string",meta:{filterVariant:"select"}}),e[5]=i.subkind,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=u.accessor("actionId",{header:"notificationHistory.actionId",type:"number",meta:{hidden:!0}}),e[7]=x):x=e[7];let y;e[8]!==i.subkind?(y=u.accessor("actionName",{header:i.subkind,type:"string",meta:{filterVariant:"select"}}),e[8]=i.subkind,e[9]=y):y=e[9];let h;e[10]!==i.date?(h=u.accessor("date",{header:i.date,type:"string"}),e[10]=i.date,e[11]=h):h=e[11];let v;e[12]!==i.subject?(v=u.accessor("subject",{header:i.subject,type:"string"}),e[12]=i.subject,e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=u.accessor("message",{header:"notificationHistory.message",type:"string",meta:{hidden:!0}}),e[14]=b):b=e[14];let w;e[15]!==h||e[16]!==v||e[17]!==g||e[18]!==y?(w=[m,d,f,p,g,x,y,h,v,b],e[15]=h,e[16]=v,e[17]=g,e[18]=y,e[19]=w):w=e[19];const S=w;let j;e[20]!==o?(j=E=>{o(E.id)},e[20]=o,e[21]=j):j=e[21];const C=j;let I,k;e[22]===Symbol.for("react.memo_cache_sentinel")?(I={mode:"enabled"},k={enabled:!1},e[22]=I,e[23]=k):(I=e[22],k=e[23]);let L;return e[24]!==a||e[25]!==S||e[26]!==t||e[27]!==C?(L=s.jsx(a,{columns:S,data:t,pagination:I,fullScreen:k,onRowClick:C}),e[24]=a,e[25]=S,e[26]=t,e[27]=C,e[28]=L):L=e[28],L},Kr=n=>{const e=l.compilerRuntimeExports.c(28),{reloadUserHistory:t,EmployeePicker:o,BnfTableComponent:a}=n,{texts:r}=N.useContext(l.LuminusComponentsContext),{notifCentrum:i}=r,[c,u]=N.useState(null),[m,d]=Ae.useLocalStorageState("notif-user",null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[p,g]=N.useState(f);let x,y;e[1]!==m||e[2]!==t?(x=()=>{m!==null&&t(m.id).then(k=>{g(k)}).catch(k=>{console.log(k),g([])})},y=[m,t],e[1]=m,e[2]=t,e[3]=x,e[4]=y):(x=e[3],y=e[4]),N.useEffect(x,y);let h;e[5]!==d?(h=k=>d(k?{id:Number(k.id),name:k.name}:null),e[5]=d,e[6]=h):h=e[6];let v;e[7]!==o||e[8]!==m||e[9]!==i.employee||e[10]!==h?(v=s.jsx("div",{className:"row",children:s.jsx("div",{className:"col-3",children:s.jsx(o,{label:i.employee,value:m,size:"sm",onSelect:h})})}),e[7]=o,e[8]=m,e[9]=i.employee,e[10]=h,e[11]=v):v=e[11];let b;e[12]!==p?(b=p??[],e[12]=p,e[13]=b):b=e[13];let w;e[14]!==p?(w=k=>u((p==null?void 0:p.find(L=>L.id===k))??null),e[14]=p,e[15]=w):w=e[15];let S;e[16]!==a||e[17]!==b||e[18]!==w?(S=s.jsx("div",{className:"col-5 h-75 overflow-hidden",children:s.jsx(Gr,{history:b,onClick:w,BnfTableComponent:a})}),e[16]=a,e[17]=b,e[18]=w,e[19]=S):S=e[19];let j;e[20]!==c?(j=c&&s.jsx("div",{className:"col bg-darker h-75",children:s.jsx("iframe",{title:"notification",className:"w-100 h-100",srcDoc:c==null?void 0:c.message})}),e[20]=c,e[21]=j):j=e[21];let C;e[22]!==j||e[23]!==S?(C=s.jsxs("div",{className:"vh-100 overflow hidden row",children:[S,j]}),e[22]=j,e[23]=S,e[24]=C):C=e[24];let I;return e[25]!==C||e[26]!==v?(I=s.jsxs("div",{className:"h-100 overflow-hidden d-flex flex-column gap-1",children:[v,C]}),e[25]=C,e[26]=v,e[27]=I):I=e[27],I},To=n=>{var L,E,D,_,R;const e=l.compilerRuntimeExports.c(37),{result:t,onClose:o,tableIdentifier:a,BnfTableComponent:r}=n,{texts:i,ProjectIconComponent:c}=N.useContext(l.LuminusComponentsContext),{imports:u}=i;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=l.u(),e[0]=m):m=e[0];const d=m;let f;e[1]!==u.row?(f=d.accessor("row",{header:u.row,type:"number",size:100}),e[1]=u.row,e[2]=f):f=e[2];let p;e[3]!==u.column?(p=d.accessor("column",{header:u.column,type:"number",size:100}),e[3]=u.column,e[4]=p):p=e[4];let g;e[5]!==u.error?(g=d.accessor("error",{header:u.error,type:"string",size:500}),e[5]=u.error,e[6]=g):g=e[6];let x;e[7]!==f||e[8]!==p||e[9]!==g?(x=[f,p,g],e[7]=f,e[8]=p,e[9]=g,e[10]=x):x=e[10];const y=x;if(!t)return null;const h=t.success?"success":"danger",v=t.success?u.importSuccess:u.importFailed;let b;e[11]!==v?(b=s.jsx("div",{className:"w-100 text-center",children:v}),e[11]=v,e[12]=b):b=e[12];let w;e[13]!==u||e[14]!==t.data||e[15]!==t.success?(w=t.success&&((L=t.data)!=null&&L.added||(E=t.data)!=null&&E.updated||(D=t.data)!=null&&D.deleted)?s.jsx("div",{className:"d-flex justify-content-center mt-2",children:s.jsxs("div",{className:"list-group",children:[t.data.added?s.jsx("div",{className:"list-group-item p-1 px-3",children:s.jsxs(l.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[u.importAdded(t.data.added)," "]})}):null,t.data.updated?s.jsx("div",{className:"list-group-item p-1 px-3",children:s.jsxs(l.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[u.importUpdated(t.data.updated)," "]})}):null,t.data.deleted?s.jsx("div",{className:"list-group-item p-1 px-3",children:s.jsxs(l.Typography,{variant:"body2",className:"d-flex gap-2 align-items-center",children:[u.importDeleted(t.data.deleted)," "]})}):null]})}):null,e[13]=u,e[14]=t.data,e[15]=t.success,e[16]=w):w=e[16];let S;e[17]!==r||e[18]!==y||e[19]!==t.data||e[20]!==t.success||e[21]!==a?(S=!t.success&&((R=(_=t.data)==null?void 0:_.errors)==null?void 0:R.length)>0?s.jsx("div",{className:"mt-3",children:s.jsx(r,{columns:y,data:t.data.errors,tableId:a})}):null,e[17]=r,e[18]=y,e[19]=t.data,e[20]=t.success,e[21]=a,e[22]=S):S=e[22];let j;e[23]!==w||e[24]!==S||e[25]!==b?(j=s.jsxs("div",{className:"w-100",children:[b,w,S]}),e[23]=w,e[24]=S,e[25]=b,e[26]=j):j=e[26];let C;e[27]!==c||e[28]!==o||e[29]!==t.success?(C=o!==void 0?s.jsx(l.IconButton,{color:t.success?"success":"danger",className:l.classNames("hover-darken",t.success?"bg-success-subtle":"bg-danger-subtle"),onClick:o,children:s.jsx(c,{icon:"close"})}):null,e[27]=c,e[28]=o,e[29]=t.success,e[30]=C):C=e[30];let I;e[31]!==j||e[32]!==C?(I=s.jsxs("div",{className:"d-flex gap-3 align-items-start",children:[j,C]}),e[31]=j,e[32]=C,e[33]=I):I=e[33];let k;return e[34]!==I||e[35]!==h?(k=s.jsx(s.Fragment,{children:s.jsx(l.Alert,{variant:h,size:"sm",className:"mb-2 p-2",children:I})}),e[34]=I,e[35]=h,e[36]=k):k=e[36],k},Yr="_upload-box_9ka79_1",qr="_browse-btn_9ka79_15",mn={uploadBox:Yr,browseBtn:qr},Eo=n=>{const e=l.compilerRuntimeExports.c(35),{file:t,onFileChange:o,onImport:a,children:r,multiple:i,accept:c}=n,{ProjectIconComponent:u,texts:m}=N.useContext(l.LuminusComponentsContext),{imports:d}=m;let f;e[0]!==i||e[1]!==o?(f=async L=>{L.length>0&&o(i===!0?[...L]:L[0])},e[0]=i,e[1]=o,e[2]=f):f=e[2];const p=f;let g;e[3]!==p?(g=L=>{var D;L.preventDefault();const E=(D=L.dataTransfer)==null?void 0:D.files;E&&(E==null?void 0:E.length)>0&&p(E)},e[3]=p,e[4]=g):g=e[4];const x=g;let y;e[5]!==r||e[6]!==t||e[7]!==d.start||e[8]!==i||e[9]!==a?(y=t!==null?s.jsxs("div",{className:"d-flex border rounded p-1 ps-2 bg-white justify-content-between align-items-center mb-2",children:[s.jsx(l.Typography,{variant:"body",children:i?t.map(Qr).join(", "):t.name}),s.jsxs("div",{className:"d-flex align-items-center gap-3",children:[r??null,s.jsx(l.PrimaryButton,{className:"text-nowrap",size:"sm",disabled:t===null,onClick:a,children:d.start})]})]}):null,e[5]=r,e[6]=t,e[7]=d.start,e[8]=i,e[9]=a,e[10]=y):y=e[10];const h=t!==null;let v;e[11]!==h?(v=l.classNames(mn.uploadBox,{[mn.active]:h}),e[11]=h,e[12]=v):v=e[12];let b;e[13]!==d.dropHint?(b=s.jsx(l.Typography,{variant:"body",children:d.dropHint}),e[13]=d.dropHint,e[14]=b):b=e[14];let w;e[15]!==p?(w=L=>{var E;return((E=L.target)==null?void 0:E.files)&&p(L.target.files)},e[15]=p,e[16]=w):w=e[16];let S;e[17]!==c||e[18]!==i||e[19]!==w?(S=s.jsx("input",{type:"file",hidden:!0,id:"browse",onChange:w,multiple:i,accept:c}),e[17]=c,e[18]=i,e[19]=w,e[20]=S):S=e[20];let j;e[21]!==u?(j=s.jsx(u,{icon:"file-upload"}),e[21]=u,e[22]=j):j=e[22];let C;e[23]!==d.pickFileHint||e[24]!==j?(C=s.jsx("label",{htmlFor:"browse",className:mn.browseBtn,children:s.jsxs(l.Typography,{variant:"body",className:"d-flex gap-2 align-items-center",children:[j,d.pickFileHint]})}),e[23]=d.pickFileHint,e[24]=j,e[25]=C):C=e[25];let I;e[26]!==x||e[27]!==C||e[28]!==v||e[29]!==b||e[30]!==S?(I=s.jsxs("div",{className:v,onDrop:x,onDragOver:Xr,children:[b,S,C]}),e[26]=x,e[27]=C,e[28]=v,e[29]=b,e[30]=S,e[31]=I):I=e[31];let k;return e[32]!==I||e[33]!==y?(k=s.jsxs(s.Fragment,{children:[y,I]}),e[32]=I,e[33]=y,e[34]=k):k=e[34],k};function Qr(n){return n.name}function Xr(n){return n.preventDefault()}const Zr=n=>{const e=l.compilerRuntimeExports.c(18),{otherSettingId:t,languageOptions:o,tableIdentifier:a,SettingsOutlet:r,BnfTableComponent:i,importLocalization:c}=n,{texts:u}=N.useContext(l.LuminusComponentsContext),{localizations:m}=u,[d,f]=N.useState(o[0].id),[p,g]=N.useState(null),[x,y]=N.useState(null);let h;e[0]!==c||e[1]!==d||e[2]!==p?(h=async()=>{if(p===null)return;const S=await c({file:p,lang:d});S.status==="success"&&y(S.data)},e[0]=c,e[1]=d,e[2]=p,e[3]=h):h=e[3];const v=h;let b;e[4]!==i||e[5]!==v||e[6]!==d||e[7]!==o||e[8]!==m.importedLanguage||e[9]!==x||e[10]!==p||e[11]!==a?(b=x?s.jsx(To,{result:x,onClose:()=>y(null),BnfTableComponent:i,tableIdentifier:a}):s.jsx(Eo,{file:p,onFileChange:g,onImport:v,children:s.jsx("div",{style:{minWidth:140},children:s.jsx(l.CustomSelectInput,{value:d,onChange:S=>typeof S=="string"?f(S):null,options:o,label:m.importedLanguage})})}),e[4]=i,e[5]=v,e[6]=d,e[7]=o,e[8]=m.importedLanguage,e[9]=x,e[10]=p,e[11]=a,e[12]=b):b=e[12];let w;return e[13]!==r||e[14]!==m.localizationImport||e[15]!==t||e[16]!==b?(w=s.jsx(r,{itemId:t,title:m.localizationImport,children:b}),e[13]=r,e[14]=m.localizationImport,e[15]=t,e[16]=b,e[17]=w):w=e[17],w},Jr=(n,e)=>{const t=e.split(".");let o=n;for(let a=0;a<t.length;a++){const r=t[a],i=o[r];if(typeof i=="string")return i;if(i===void 0)return;o=i}},ei=n=>{const e=l.compilerRuntimeExports.c(22),{selLng:t,lngsData:o,localizationKey:a,reloadData:r,saveChanges:i}=n,{ProjectIconComponent:c}=N.useContext(l.LuminusComponentsContext);let u;if(e[0]!==o||e[1]!==a||e[2]!==t){e:{const S=o.get(t);if(S===void 0){u="";break e}const j=Jr(S,a);u=S!==void 0&&j!==void 0?j:""}e[0]=o,e[1]=a,e[2]=t,e[3]=u}else u=e[3];const m=u,[d,f]=N.useState(m);let p;e[4]!==a||e[5]!==r||e[6]!==i||e[7]!==t||e[8]!==d?(p=async()=>{await i([{fileName:t+".json",items:[{key:a,value:d}]}]),await r()},e[4]=a,e[5]=r,e[6]=i,e[7]=t,e[8]=d,e[9]=p):p=e[9];const g=p,x=d!==m,y=t+a;let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=S=>{f(typeof S!="string"?"":S)},e[10]=h):h=e[10];let v;e[11]!==y||e[12]!==d?(v=s.jsx(l.TextInput,{label:y,type:"text",value:d,onChange:h,InputContainer:l.RowLabelInput,withoutLabel:!0,className:"flex-grow-1"}),e[11]=y,e[12]=d,e[13]=v):v=e[13];let b;e[14]!==c||e[15]!==m||e[16]!==g||e[17]!==x?(b=x?s.jsxs("div",{className:"d-flex align-items-center gap-1",children:[s.jsx(l.IconButton,{color:"danger",onClick:()=>f(m),children:s.jsx(c,{icon:"cancel"})}),s.jsx(l.IconButton,{onClick:g,children:s.jsx(c,{icon:"check"})})]}):null,e[14]=c,e[15]=m,e[16]=g,e[17]=x,e[18]=b):b=e[18];let w;return e[19]!==v||e[20]!==b?(w=s.jsxs("div",{className:"d-flex",children:[v,b]}),e[19]=v,e[20]=b,e[21]=w):w=e[21],w},ti="_keysTable_1j6ns_1",ni="_subgrid_1j6ns_14",si="_lngSelectRow_1j6ns_19",oi="_tableItem_1j6ns_26",li="_tableFooter_1j6ns_29",ai="_tableFullWidth_1j6ns_35",ri="_tableBody_1j6ns_39",ii="_lngSelect_1j6ns_19",ci="_addLng_1j6ns_52",di="_fileSelect_1j6ns_57",ui="_searchBox_1j6ns_61",We={keysTable:ti,subgrid:ni,lngSelectRow:si,tableItem:oi,tableFooter:li,tableFullWidth:ai,tableBody:ri,lngSelect:ii,addLng:ci,fileSelect:di,searchBox:ui},Ut=50,mi=(n,e)=>{const t=e.split(".");let o=n;for(let a=0;a<t.length;a++){const r=t[a],i=o[r];if(typeof i=="string")return i;if(i===void 0)return;o=i}},fi=n=>{const e=l.compilerRuntimeExports.c(173),{languageOptions:t,envMode:o,getOtherSettingsUrl:a,downloadXls:r,saveChanges:i,localizationFilesOptions:c,remoteLocalesRoot:u}=n,{texts:m,ProjectIconComponent:d}=N.useContext(l.LuminusComponentsContext),{localizations:f}=m,[p,g]=N.useState(1);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=new Map,e[0]=x):x=e[0];const[y,h]=N.useState(x),[v,b]=N.useState(null),[w,S]=N.useState("");let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=new Set,e[1]=j):j=e[1];const[C,I]=N.useState(j);let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=xe=>{h(new Map),I(xe)},e[2]=k):k=e[2];const L=k;let E;if(e[3]!==t||e[4]!==C){let xe;e[6]!==C?(xe=ge=>!C.has(ge.id),e[6]=C,e[7]=xe):xe=e[7],E=t.filter(xe),e[3]=t,e[4]=C,e[5]=E}else E=e[5];const D=E;let _;e:{if(y.size===0){let Se;e[8]===Symbol.for("react.memo_cache_sentinel")?(Se=[],e[8]=Se):Se=e[8],_=Se;break e}let xe;if(e[9]!==y||e[10]!==c||e[11]!==v||e[12]!==C){const Se=new Set,He=(nt,gt)=>{const Tt=gt===void 0?"":gt;if(typeof nt[1]=="object"){Object.entries(nt[1]).forEach(al=>He(al,Tt+nt[0]+"."));return}Se.add(Tt+nt[0])};Array.from(y).forEach(nt=>{Object.entries(nt[1]).forEach(gt=>He(gt))});const ht=Array.from(Se),sn=c.find(nt=>nt.path===v);xe=((sn==null?void 0:sn.type)==="report"?ht.filter(pi):ht).map(nt=>({key:nt,lngData:new Map(Array.from(C).map(gt=>{const Tt=y.get(gt);return[gt,(Tt===void 0?void 0:mi(Tt,nt))??""]}))})),e[9]=y,e[10]=c,e[11]=v,e[12]=C,e[13]=xe}else xe=e[13];_=xe}const R=_;let $;e[14]!==w||e[15]!==R?($=R.filter(xe=>l.stringSearchWithin(xe.key,w)||Array.from(xe.lngData).some(ge=>typeof(ge==null?void 0:ge[1])!="string"?!1:l.stringSearchWithin((ge==null?void 0:ge[1])??"",w))),e[14]=w,e[15]=R,e[16]=$):$=e[16];const A=$,T=Math.ceil(A.length/Ut);let F;e[17]!==T?(F=xe=>{xe!==null&&g(()=>Math.max(1,Math.min(xe,T)))},e[17]=T,e[18]=F):F=e[18];const P=F;let M;e[19]!==u||e[20]!==v||e[21]!==C?(M=async()=>{if(v===null)return;const xe=Array.from(C).map(Se=>(async()=>{const He=await l.axios.get(`${u}${v==null?void 0:v.replace("{{lng}}",Se)}&v=${new Date().getTime()}`,{responseType:"json"});return[Se,He.data]})()),ge=await Promise.allSettled(xe);h(new Map(ge.map(hi)))},e[19]=u,e[20]=v,e[21]=C,e[22]=M):M=e[22];const O=M;let z;e[23]!==O?(z=async()=>{O()},e[23]=O,e[24]=z):z=e[24];const H=z,W=D.length>0,B=C.size+1+(W?1:0);let U;e[25]!==P||e[26]!==p?(U=()=>{P(p)},e[25]=P,e[26]=p,e[27]=U):U=e[27];let V;e[28]!==P||e[29]!==p||e[30]!==A?(V=[P,p,A],e[28]=P,e[29]=p,e[30]=A,e[31]=V):V=e[31],N.useEffect(U,V);let X,Y;if(e[32]!==O?(X=()=>{O()},Y=[O],e[32]=O,e[33]=X,e[34]=Y):(X=e[33],Y=e[34]),N.useEffect(X,Y),u===void 0){const xe=f.cantRunLocalizationSettings;let ge,Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx("br",{}),Se=s.jsx("br",{}),e[35]=ge,e[36]=Se):(ge=e[35],Se=e[36]);let He;e[37]!==o||e[38]!==f?(He=f.envNotConnectedToRemote(o.toUpperCase()),e[37]=o,e[38]=f,e[39]=He):He=e[39];let ht;return e[40]!==f.cantRunLocalizationSettings||e[41]!==He?(ht=s.jsx(l.PageContainer,{children:s.jsxs(l.Alert,{variant:"danger",className:"fw-bold",children:[xe,ge,Se,He]})}),e[40]=f.cantRunLocalizationSettings,e[41]=He,e[42]=ht):ht=e[42],ht}let Z;e[43]!==f.localizationSettings?(Z=s.jsx("div",{className:"d-flex gap-4",children:s.jsx(l.Typography,{variant:"h3",children:f.localizationSettings})}),e[43]=f.localizationSettings,e[44]=Z):Z=e[44];const te=f.localizationSettings,se=W?1:0;let q;e[45]!==se||e[46]!==B?(q={"--keys-table-columns":B,"--adding-column":se},e[45]=se,e[46]=B,e[47]=q):q=e[47];let ae;e[48]===Symbol.for("react.memo_cache_sentinel")?(ae=l.classNames(We.tableFullWidth,"d-flex align-items-center justify-content-between gap-2 px-2 mt-1"),e[48]=ae):ae=e[48];let re;e[49]!==c?(re=c.map(gi),e[49]=c,e[50]=re):re=e[50];let me;e[51]===Symbol.for("react.memo_cache_sentinel")?(me=xe=>typeof xe!="number"?b(xe):null,e[51]=me):me=e[51];let fe;e[52]!==f.localizationFile||e[53]!==v||e[54]!==re?(fe=s.jsx(l.CustomSelectInput,{options:re,value:v,onChange:me,size:"sm",label:f.localizationFile,className:We.fileSelect,noSortOptions:!0}),e[52]=f.localizationFile,e[53]=v,e[54]=re,e[55]=fe):fe=e[55];let Q;e[56]===Symbol.for("react.memo_cache_sentinel")?(Q=l.classNames(We.searchBox,"d-flex align-items-center gap-2 border rounded"),e[56]=Q):Q=e[56];let K;e[57]===Symbol.for("react.memo_cache_sentinel")?(K={className:"mt- me-n4"},e[57]=K):K=e[57];let G;e[58]!==d?(G=s.jsx(d,{icon:"search",className:"text-muted",size:18,iconProps:K}),e[58]=d,e[59]=G):G=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=xe=>S(typeof xe=="string"?xe:""),e[60]=oe):oe=e[60];const J=w!=="";let ee;e[61]!==w||e[62]!==J?(ee=s.jsx(l.TextInput,{type:"text",value:w,onChange:oe,size:"sm",showClearIcon:J,withoutLabel:!0,placeholder:"vyhledávat...",className:"placeholder-muted bg-transparent border-0 my-0 py-0 w-100"}),e[61]=w,e[62]=J,e[63]=ee):ee=e[63];let ne;e[64]!==G||e[65]!==ee?(ne=s.jsxs("div",{className:Q,children:[G,ee]}),e[64]=G,e[65]=ee,e[66]=ne):ne=e[66];let ce;e[67]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(l.FileExtensionIcon,{fileExtension:"xls"}),e[67]=ce):ce=e[67];let ve;e[68]!==r||e[69]!==f.xlsExport?(ve=s.jsx(l.ResponsiveContextDropdownItem,{cKey:"export",hideOn:"always",onClick:r,icon:ce,children:f.xlsExport}),e[68]=r,e[69]=f.xlsExport,e[70]=ve):ve=e[70];let de;e[71]!==a?(de=a("localizationImport"),e[71]=a,e[72]=de):de=e[72];let be;e[73]!==d?(be=s.jsx(d,{icon:"link"}),e[73]=d,e[74]=be):be=e[74];let we;e[75]!==f.import||e[76]!==de||e[77]!==be?(we=s.jsx(l.ResponsiveContextDropdownItem,{cKey:"import",hideOn:"always",to:de,icon:be,children:f.import}),e[75]=f.import,e[76]=de,e[77]=be,e[78]=we):we=e[78];let ke;e[79]!==ve||e[80]!==we?(ke=s.jsxs(l.ResponsiveContextDropdown,{children:[ve,we]}),e[79]=ve,e[80]=we,e[81]=ke):ke=e[81];let Fe;e[82]!==fe||e[83]!==ne||e[84]!==ke?(Fe=s.jsxs("div",{className:ae,children:[fe,ne,ke]}),e[82]=fe,e[83]=ne,e[84]=ke,e[85]=Fe):Fe=e[85];let le;e[86]===Symbol.for("react.memo_cache_sentinel")?(le=l.classNames(We.subgrid,We.lngSelectRow),e[86]=le):le=e[86];let ue;e[87]!==f.key?(ue=s.jsx(l.Typography,{variant:"body",children:f.key}),e[87]=f.key,e[88]=ue):ue=e[88];let he;e[89]!==C?(he=Array.from(C),e[89]=C,e[90]=he):he=e[90];let pe;e[91]!==t||e[92]!==f.language||e[93]!==C||e[94]!==he?(pe=he.map((xe,ge)=>s.jsx(l.CustomSelectInput,{options:t.filter(Se=>Se.id===xe||!C.has(Se.id)),value:xe,onChange:Se=>L(He=>Se===null?(He.delete(xe),new Set(He)):(typeof Se=="string"&&(He.delete(xe),He.add(Se)),new Set(He))),size:"sm",label:`${f.language} ${ge+1}`,withoutLabel:!0,InputContainer:l.RowLabelInput,className:l.classNames(We.lngSelect)},xe)),e[91]=t,e[92]=f.language,e[93]=C,e[94]=he,e[95]=pe):pe=e[95];let ye;e[96]!==D||e[97]!==W||e[98]!==f.addLanguage?(ye=W?s.jsx(l.CustomSelectInput,{options:D,value:null,onChange:xe=>L(ge=>(typeof xe=="string"&&ge.add(xe),new Set(ge))),size:"sm",label:f.addLanguage,InputContainer:l.RowLabelInput,className:l.classNames(We.lngSelect,We.addLng)}):null,e[96]=D,e[97]=W,e[98]=f.addLanguage,e[99]=ye):ye=e[99];let je;e[100]!==ue||e[101]!==pe||e[102]!==ye?(je=s.jsxs("div",{className:le,children:[ue,pe,ye]}),e[100]=ue,e[101]=pe,e[102]=ye,e[103]=je):je=e[103];let Oe;e[104]===Symbol.for("react.memo_cache_sentinel")?(Oe=l.classNames(We.subgrid,We.tableBody),e[104]=Oe):Oe=e[104];let Le;e[105]!==f.noDataFiltered||e[106]!==f.noDataLoaded||e[107]!==R.length||e[108]!==A.length?(Le=R.length===0||A.length===0?s.jsx(l.Alert,{variant:"warning",className:l.classNames(We.tableFullWidth,We.emptyTableAlert,"my-n1"),children:R.length===0?f.noDataLoaded:A.length===0?f.noDataFiltered:null}):null,e[105]=f.noDataFiltered,e[106]=f.noDataLoaded,e[107]=R.length,e[108]=A.length,e[109]=Le):Le=e[109];let Pe;e[110]!==p||e[111]!==A?(Pe=A.slice(Ut*(p-1),Ut*p),e[110]=p,e[111]=A,e[112]=Pe):Pe=e[112];let Re;e[113]!==y||e[114]!==H||e[115]!==i||e[116]!==C||e[117]!==Pe?(Re=Pe.map(xe=>s.jsxs("div",{className:l.classNames(We.subgrid,We.tableItem),children:[s.jsx(l.Typography,{variant:"form-label",children:xe.key}),Array.from(C).map(ge=>s.jsx(ei,{localizationKey:xe.key,lngsData:y,selLng:ge,reloadData:H,saveChanges:i},ge))]},xe.key)),e[113]=y,e[114]=H,e[115]=i,e[116]=C,e[117]=Pe,e[118]=Re):Re=e[118];let Be;e[119]!==Le||e[120]!==Re?(Be=s.jsxs("div",{className:Oe,children:[Le,Re]}),e[119]=Le,e[120]=Re,e[121]=Be):Be=e[121];let ze;e[122]===Symbol.for("react.memo_cache_sentinel")?(ze=l.classNames("d-flex align-items-center justify-content-around gap-3 px-2 py-0",We.tableFooter),e[122]=ze):ze=e[122];let De;e[123]!==A.length?(De=s.jsx("span",{className:"fw-bold",children:A.length}),e[123]=A.length,e[124]=De):De=e[124];let Te;e[125]!==f.keyCount||e[126]!==De?(Te=s.jsx("div",{children:s.jsxs(l.Typography,{variant:"body",children:[f.keyCount,":"," ",De]})}),e[125]=f.keyCount,e[126]=De,e[127]=Te):Te=e[127];let ie;e[128]!==f.page?(ie=s.jsxs(l.Typography,{variant:"body",children:[f.page,": "]}),e[128]=f.page,e[129]=ie):ie=e[129];let Ce;e[130]!==P||e[131]!==p?(Ce=()=>P(p-1),e[130]=P,e[131]=p,e[132]=Ce):Ce=e[132];let Ee;e[133]!==d?(Ee=s.jsx(d,{icon:"minus"}),e[133]=d,e[134]=Ee):Ee=e[134];let $e;e[135]!==Ce||e[136]!==Ee?($e=s.jsx(l.IconButton,{size:"sm",onClick:Ce,children:Ee}),e[135]=Ce,e[136]=Ee,e[137]=$e):$e=e[137];let Ve;e[138]===Symbol.for("react.memo_cache_sentinel")?(Ve={width:30},e[138]=Ve):Ve=e[138];let Ye;e[139]!==P||e[140]!==p?(Ye=s.jsx("div",{style:Ve,children:s.jsx(No,{value:p,onChange:P,InputContainer:l.RowLabelInput,withoutLabel:!0,size:"sm"})}),e[139]=P,e[140]=p,e[141]=Ye):Ye=e[141];const ot=Math.ceil(A.length/Ut);let qe;e[142]!==ot?(qe=s.jsxs(l.Typography,{variant:"body",children:["/",ot]}),e[142]=ot,e[143]=qe):qe=e[143];let lt;e[144]!==P||e[145]!==p?(lt=()=>P(p+1),e[144]=P,e[145]=p,e[146]=lt):lt=e[146];let Qe;e[147]!==d?(Qe=s.jsx(d,{icon:"plus"}),e[147]=d,e[148]=Qe):Qe=e[148];let at;e[149]!==lt||e[150]!==Qe?(at=s.jsx(l.IconButton,{size:"sm",onClick:lt,children:Qe}),e[149]=lt,e[150]=Qe,e[151]=at):at=e[151];let Xe;e[152]!==$e||e[153]!==Ye||e[154]!==qe||e[155]!==at?(Xe=s.jsxs("div",{className:"d-flex align-items-center gap-1",children:[$e,Ye,qe,at]}),e[152]=$e,e[153]=Ye,e[154]=qe,e[155]=at,e[156]=Xe):Xe=e[156];let Ze;e[157]!==ie||e[158]!==Xe?(Ze=s.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[ie,Xe]}),e[157]=ie,e[158]=Xe,e[159]=Ze):Ze=e[159];let Je;e[160]!==Te||e[161]!==Ze?(Je=s.jsxs("div",{className:ze,children:[Te,Ze]}),e[160]=Te,e[161]=Ze,e[162]=Je):Je=e[162];let et;e[163]!==q||e[164]!==Fe||e[165]!==je||e[166]!==Be||e[167]!==Je?(et=s.jsxs("div",{className:We.keysTable,style:q,children:[Fe,je,Be,Je]}),e[163]=q,e[164]=Fe,e[165]=je,e[166]=Be,e[167]=Je,e[168]=et):et=e[168];let it;return e[169]!==f.localizationSettings||e[170]!==Z||e[171]!==et?(it=s.jsx(l.PageContainer,{title:Z,helmet:te,variant:"fullScreen",children:et}),e[169]=f.localizationSettings,e[170]=Z,e[171]=et,e[172]=it):it=e[172],it};function pi(n){const e=n.split(".");return e[e.length-1]==="caption"}function hi(n){return n.status==="fulfilled"?n.value:["",{}]}function gi(n){return{id:n.path,name:n.nameTranslationKey}}const ms=3,Lo=(n,e,t)=>{var a;if((e==null?void 0:e.customPathBuilder)!==void 0)return e.customPathBuilder(n,e);const o=(a=t.find(r=>r.key===n.type))==null?void 0:a.toPath;return o?`${o}/${n.searchKey}`:"/not-found"},Ro=(n,e)=>{var t;return((t=e==null?void 0:e.customNameBuilder)==null?void 0:t.call(e,n))??n.name},$o=(n,e,t,o,a)=>{const r=l.compilerRuntimeExports.c(22),i=l.useAxios(),[c,u]=N.useState(!1);let m;r[0]===Symbol.for("react.memo_cache_sentinel")?(m=[],r[0]=m):m=r[0];const[d,f]=N.useState(m),p=n==="";let g;r[1]!==i||r[2]!==o||r[3]!==p||r[4]!==e||r[5]!==t||r[6]!==n?(g=()=>{f([]),!(e.length<ms)&&(u(!0),i.get(Ke.generateApiPath(t,{path:{query:e},query:{type:p?void 0:n,count:o?void 0:p?5:20}})).then(C=>{const{data:I}=C;f(I),u(!1)}).catch(()=>{u(!1)}))},r[1]=i,r[2]=o,r[3]=p,r[4]=e,r[5]=t,r[6]=n,r[7]=g):g=r[7];const x=g;let y;e:{if(a===void 0){let I;r[8]===Symbol.for("react.memo_cache_sentinel")?(I=[],r[8]=I):I=r[8],y=I;break e}if(e.length<ms||!["XAP","",null].includes(n)){let I;r[9]===Symbol.for("react.memo_cache_sentinel")?(I=[],r[9]=I):I=r[9],y=I;break e}let C;r[10]!==e||r[11]!==a?(C=[],a.forEach(I=>{const k=I.items.filter(L=>l.stringSearchWithin(L.name,decodeURIComponent(e)));k.length>0&&C.push({key:{...I.key,totalCount:k.length},items:k})}),r[10]=e,r[11]=a,r[12]=C):C=r[12],y=C}const h=y;let v;r[13]!==d||r[14]!==h?(v=h.concat(d),r[13]=d,r[14]=h,r[15]=v):v=r[15];const b=v;let w,S;r[16]!==x?(w=()=>{x()},S=[x],r[16]=x,r[17]=w,r[18]=S):(w=r[17],S=r[18]),N.useEffect(w,S);let j;return r[19]!==c||r[20]!==b?(j={isLoading:c,searchItems:b},r[19]=c,r[20]=b,r[21]=j):j=r[21],j},xi="_input-group_1hcpm_1",yi="_input-group-text_1hcpm_5",vi="_left_1hcpm_9",bi="_right_1hcpm_13",ji="_input_1hcpm_1",Si="_submit-button_1hcpm_20",xt={inputGroup:xi,inputGroupText:yi,left:vi,right:bi,input:ji,submitButton:Si},Ci=n=>{const e=l.compilerRuntimeExports.c(10),{searchTypes:t,selectedType:o,setSelectedType:a}=n,r=o==null?void 0:o.text;let i;e[0]!==r?(i=s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle,icon:null,text:r}),e[0]=r,e[1]=i):i=e[1];let c;if(e[2]!==t||e[3]!==a){let m;e[5]!==a?(m=d=>s.jsx(l.DropdownItem,{icon:null,onClick:()=>a(d.key),children:d.text},d.key),e[5]=a,e[6]=m):m=e[6],c=t.map(m),e[2]=t,e[3]=a,e[4]=c}else c=e[4];let u;return e[7]!==i||e[8]!==c?(u=s.jsx(l.Dropdown,{toggle:i,children:c}),e[7]=i,e[8]=c,e[9]=u):u=e[9],u},wi="_dropdown_1ddrg_1",Ni="_open_1ddrg_12",Ii="_loading-container_1ddrg_15",ki="_groups-container_1ddrg_22",_i="_group_1ddrg_22",Di="_header_1ddrg_26",Ti="_item_1ddrg_33",bt={dropdown:wi,open:Ni,loadingContainer:Ii,groupsContainer:ki,group:_i,header:Di,item:Ti},Ei=n=>{const e=l.compilerRuntimeExports.c(20),{item:t,searchTypes:o,onCancel:a}=n;let r;if(e[0]!==t.type||e[1]!==o){let y;e[3]!==t.type?(y=h=>h.key===t.type,e[3]=t.type,e[4]=y):y=e[4],r=o.find(y),e[0]=t.type,e[1]=o,e[2]=r}else r=e[2];const i=r;let c;e[5]!==t||e[6]!==i||e[7]!==o?(c=Lo(t,i,o),e[5]=t,e[6]=i,e[7]=o,e[8]=c):c=e[8];const u=c;let m;e[9]!==t||e[10]!==i?(m=Ro(t,i),e[9]=t,e[10]=i,e[11]=m):m=e[11];const d=m;let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=l.classNames("search-item d-flex gap-3 align-items-center justify-content-between",bt.item),e[12]=f):f=e[12];let p;e[13]!==d?(p=s.jsx(l.Typography,{variant:"body2",className:"text-nowrap text-truncate",children:d}),e[13]=d,e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(l.Typography,{variant:"caption",className:"text-primary",children:s.jsx(l.MdOutlineArrowOutward,{})}),e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==a||e[18]!==p?(x=s.jsxs(Ne.Link,{to:u,className:f,onClick:a,children:[p,g]}),e[16]=u,e[17]=a,e[18]=p,e[19]=x):x=e[19],x},Li=n=>{const e=l.compilerRuntimeExports.c(13),{show:t,query:o,onCancel:a,groups:r,isLoading:i,searchTypes:c}=n,{texts:u}=N.useContext(l.LuminusComponentsContext),{appSearch:m}=u,d=N.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[d],e[0]=f):f=e[0],l.useClickOutside(f,a);let p;e[1]!==t?(p=l.classNames("luminus-app-search-dropdown shadow rounded",bt.dropdown,{[bt.open]:t}),e[1]=t,e[2]=p):p=e[2];let g;e[3]!==m||e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==o||e[8]!==c?(g=i?s.jsx("div",{className:bt.loadingContainer,children:s.jsx(l.Spinner,{animation:"border",variant:"primary"})}):s.jsx("div",{className:bt.groupsContainer,children:r==null?void 0:r.map(y=>{var h;return s.jsxs("div",{className:l.classNames(bt.group),children:[s.jsxs(Ne.Link,{to:`/search?query=${o}&type=${y.key.category}`,className:l.classNames("group-header",bt.header),onClick:a,children:[s.jsx(l.Typography,{variant:"body",className:"text-primary",children:y.key.categoryName}),s.jsxs(l.Typography,{variant:"caption",children:[y.items.length," ",m.amountFrom," ",y.key.totalCount]})]}),(h=y.items)==null?void 0:h.map((v,b)=>s.jsx(Ei,{item:v,onCancel:a,searchTypes:c},b))]},y.key.category)})}),e[3]=m,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=c,e[9]=g):g=e[9];let x;return e[10]!==p||e[11]!==g?(x=s.jsx("div",{ref:d,className:p,children:g}),e[10]=p,e[11]=g,e[12]=x):x=e[12],x},Ri=n=>{var Y;const e=l.compilerRuntimeExports.c(49),{searchTypes:t,navigateFunction:o,currentPath:a,homePath:r,className:i,staticAppItems:c,searchEndpointUri:u}=n,m=r===void 0?"/":r,{texts:d}=N.useContext(l.LuminusComponentsContext),{appSearch:f}=d,[p,g]=N.useState(t.length>0?((Y=t.at(0))==null?void 0:Y.key)??null:null);let x;e[0]!==t||e[1]!==p?(x=t.find(Z=>Z.key===p)??null,e[0]=t,e[1]=p,e[2]=x):x=e[2];const y=x,[h,v]=N.useState(""),[b,w]=l.a(encodeURIComponent(h),500),{isLoading:S,searchItems:j}=$o(p,b,u,!1,c),[C,I]=N.useState(!1);let k;e[3]!==S||e[4]!==j.length?(k=()=>{(j.length>0||S)&&I(!0)},e[3]=S,e[4]=j.length,e[5]=k):k=e[5];let L;e[6]!==S||e[7]!==j?(L=[j,S],e[6]=S,e[7]=j,e[8]=L):L=e[8],N.useEffect(k,L);const E=N.useRef(null);let D,_;e[9]!==a||e[10]!==m?(D=()=>{var Z;v(""),a===m&&((Z=E.current)==null||Z.focus())},_=[a,m],e[9]=a,e[10]=m,e[11]=D,e[12]=_):(D=e[11],_=e[12]),N.useEffect(D,_);let R;e[13]!==b||e[14]!==w||e[15]!==o||e[16]!==y?(R=Z=>{Z.preventDefault(),Z.stopPropagation(),w.flush(),I(!1),b.length>2&&o(`/search?query=${b}${y&&y.key&&`&type=${y==null?void 0:y.key}`}`)},e[13]=b,e[14]=w,e[15]=o,e[16]=y,e[17]=R):R=e[17];let $;e[18]!==i?($=l.classNames(xt.inputGroup,i),e[18]=i,e[19]=$):$=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=l.classNames("p-1 rounded",xt.inputGroupText,xt.left),e[20]=A):A=e[20];let T;e[21]!==t||e[22]!==y?(T=s.jsx(qt.Text,{className:A,children:s.jsx(Ci,{searchTypes:t,selectedType:y,setSelectedType:g})}),e[21]=t,e[22]=y,e[23]=T):T=e[23];const F=f.searchPlaceholder;let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=l.classNames("luminus-app-search-input",xt.input),e[24]=P):P=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=Z=>{var te;return v(((te=Z.target)==null?void 0:te.value)??"")},e[25]=M):M=e[25];let O;e[26]!==j.length?(O=()=>j.length>0&&I(!0),e[26]=j.length,e[27]=O):O=e[27];let z;e[28]!==f.searchPlaceholder||e[29]!==h||e[30]!==O?(z=s.jsx(l.Form.Control,{ref:E,placeholder:F,type:"text",size:"sm",className:P,value:h,onChange:M,onFocus:O}),e[28]=f.searchPlaceholder,e[29]=h,e[30]=O,e[31]=z):z=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=l.classNames("p-0 rounded",xt.inputGroupText,xt.right),e[32]=H):H=e[32];let W;e[33]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(qt.Text,{className:H,children:s.jsx("button",{type:"submit",className:l.classNames("text-primary",xt.submitButton),children:s.jsx(l.FaSearch,{})})}),e[33]=W):W=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=()=>I(!1),e[34]=B):B=e[34];let U;e[35]!==b||e[36]!==S||e[37]!==j||e[38]!==t||e[39]!==C?(U=s.jsx(Li,{query:b,searchTypes:t,show:C,onCancel:B,groups:j,isLoading:S}),e[35]=b,e[36]=S,e[37]=j,e[38]=t,e[39]=C,e[40]=U):U=e[40];let V;e[41]!==T||e[42]!==z||e[43]!==U||e[44]!==$?(V=s.jsxs(qt,{className:$,children:[T,z,W,U]}),e[41]=T,e[42]=z,e[43]=U,e[44]=$,e[45]=V):V=e[45];let X;return e[46]!==V||e[47]!==R?(X=s.jsx(l.Form,{className:"w-100 d-flex align-items-center justify-content-center",onSubmit:R,children:V}),e[46]=V,e[47]=R,e[48]=X):X=e[48],X},$i=n=>{const e=l.compilerRuntimeExports.c(20),{item:t,searchTypes:o}=n,{ProjectIconComponent:a}=N.useContext(l.LuminusComponentsContext);let r;if(e[0]!==t.type||e[1]!==o){let x;e[3]!==t.type?(x=y=>y.key===t.type,e[3]=t.type,e[4]=x):x=e[4],r=o.find(x),e[0]=t.type,e[1]=o,e[2]=r}else r=e[2];const i=r;let c;e[5]!==t||e[6]!==i||e[7]!==o?(c=Lo(t,i,o),e[5]=t,e[6]=i,e[7]=o,e[8]=c):c=e[8];const u=c;let m;e[9]!==t||e[10]!==i?(m=Ro(t,i),e[9]=t,e[10]=i,e[11]=m):m=e[11];const d=m;let f;e[12]!==d?(f=s.jsx(l.Typography,{variant:"body",children:d}),e[12]=d,e[13]=f):f=e[13];let p;e[14]!==a?(p=s.jsx(a,{icon:"chevron-right",className:"text-primary"}),e[14]=a,e[15]=p):p=e[15];let g;return e[16]!==u||e[17]!==f||e[18]!==p?(g=s.jsxs(Ne.Link,{to:u,className:"text-nowrap list-group-item list-group-item-action d-flex justify-content-between align-items-center",children:[f,p]}),e[16]=u,e[17]=f,e[18]=p,e[19]=g):g=e[19],g},Fi=n=>{var h,v;const e=l.compilerRuntimeExports.c(11),{query:t,type:o,appSearchTypes:a,searchEndpointUri:r,staticAppItems:i}=n,{texts:c}=N.useContext(l.LuminusComponentsContext),{appSearch:u}=c,[m,d]=N.useState(""),{searchItems:f,isLoading:p}=$o(o,t,r,!0,i);let g,x;if(e[0]!==m||e[1]!==f?(g=()=>{var b;m||f===null||f.length===0||d(((b=f[0].key)==null?void 0:b.category)??"")},x=[f,m],e[0]=m,e[1]=f,e[2]=g,e[3]=x):(g=e[2],x=e[3]),N.useEffect(g,x),f===null)return null;let y;return e[4]!==m||e[5]!==u||e[6]!==a||e[7]!==p||e[8]!==t||e[9]!==f?(y=s.jsx(l.PageContainer,{variant:"fullScreen",children:p?s.jsx(Ge.Loading,{}):f.length===0?s.jsx("div",{className:"alert alert-warning",children:s.jsx(l.Typography,{variant:"body",children:u.noResultsFor(t)})}):s.jsxs(s.Fragment,{children:[s.jsx(Mn,{activeTab:m,onSelect:b=>d((b==null?void 0:b.toString())??""),children:f.map(Pi)}),s.jsx(Do,{eventKey:m,activeTab:m,fullHeightNoOverflow:!0,children:s.jsx("div",{className:"list-group h-100 overflow-auto",children:(v=(h=f.find(b=>b.key.category===m))==null?void 0:h.items)==null?void 0:v.map((b,w)=>s.jsx($i,{item:b,searchTypes:a},w))})})]})}),e[4]=m,e[5]=u,e[6]=a,e[7]=p,e[8]=t,e[9]=f,e[10]=y):y=e[10],y};function Pi(n){var e,t;return s.jsx(On,{eventKey:((e=n.key)==null?void 0:e.category)??"",children:((t=n.key)==null?void 0:t.categoryName)??""},n.key.category)}const Ai=()=>{const n=l.compilerRuntimeExports.c(7),{texts:e}=N.useContext(l.LuminusComponentsContext),{userSettings:t}=e,[o,a]=Ae.useLocalStorageState("file-download-try-opening",!0),r=o===void 0?!0:o;let i;n[0]!==a||n[1]!==r||n[2]!==t.tryOpenFileLabel?(i=s.jsx(Dt,{type:"switch",value:r,onChange:a,label:t.tryOpenFileLabel}),n[0]=a,n[1]=r,n[2]=t.tryOpenFileLabel,n[3]=i):i=n[3];let c;return n[4]!==i||n[5]!==t.downloads?(c=s.jsx(pt,{collapsible:!0,title:t.downloads,defaultOpen:!0,children:i}),n[4]=i,n[5]=t.downloads,n[6]=c):c=n[6],c},Mi=n=>{const e=l.compilerRuntimeExports.c(52),{show:t,handleClose:o,onConfirm:a,apiCreateBackup:r}=n,{texts:i}=N.useContext(l.LuminusComponentsContext),{userSettings:c}=i,{zStringRequired:u}=l.useZodSchemaTypes(),{addNotification:m}=l.useNotifications(),d=l.useAxios(),{startLoading:f,stopLoading:p}=N.useContext(l.LoadingContext),[g,x]=N.useState(null);let y,h;if(e[0]!==u){const O=l.z.object({name:u()});h=Ie.useForm,y=l.t(O),e[0]=u,e[1]=y,e[2]=h}else y=e[1],h=e[2];let v;e[3]!==y?(v={resolver:y},e[3]=y,e[4]=v):v=e[4];const b=h(v);let w;e[5]!==r||e[6]!==d||e[7]!==f||e[8]!==p?(w=async(O,z)=>(f("localStorageSettingPost"),d.post(r,{name:O,setting:z}).then(Oi).catch(Bi).finally(()=>p("localStorageSettingPost"))),e[5]=r,e[6]=d,e[7]=f,e[8]=p,e[9]=w):w=e[9];const S=w;let j;e[10]!==m||e[11]!==g||e[12]!==a||e[13]!==S||e[14]!==c.localStorageCreateBackupSuccess?(j=async O=>{await S(O.name,JSON.stringify(g))&&(m(c.localStorageCreateBackupSuccess,"success"),a())},e[10]=m,e[11]=g,e[12]=a,e[13]=S,e[14]=c.localStorageCreateBackupSuccess,e[15]=j):j=e[15];const C=j;let I,k;e[16]!==t?(I=()=>{t&&x(Ke.dumpLocalStorage())},k=[t],e[16]=t,e[17]=I,e[18]=k):(I=e[17],k=e[18]),N.useEffect(I,k);let L;e[19]!==o?(L=()=>o(),e[19]=o,e[20]=L):L=e[20];let E;e[21]!==c.localStorageCreateBackup?(E=s.jsx(l.Modal.Header,{closeButton:!0,children:s.jsx(l.Modal.Title,{children:c.localStorageCreateBackup})}),e[21]=c.localStorageCreateBackup,e[22]=E):E=e[22];let D;e[23]!==b||e[24]!==C?(D=b.handleSubmit(C),e[23]=b,e[24]=C,e[25]=D):D=e[25];let _;if(e[26]!==g||e[27]!==c){let O;e[29]!==g?(O=Object.keys(g||{}),e[29]=g,e[30]=O):O=e[30],_=c.localStorageCreateBackupInfo(O.length),e[26]=g,e[27]=c,e[28]=_}else _=e[28];let R;e[31]!==_?(R=s.jsx(l.Alert,{variant:"info",size:"sm",children:_}),e[31]=_,e[32]=R):R=e[32];let $;e[33]!==c.localStorageCreateBackupName?($=s.jsx(l.HookFormTextInput,{required:!0,label:c.localStorageCreateBackupName,formField:"name",type:"text"}),e[33]=c.localStorageCreateBackupName,e[34]=$):$=e[34];let A;e[35]!==R||e[36]!==$?(A=s.jsxs(l.Modal.Body,{children:[R,$]}),e[35]=R,e[36]=$,e[37]=A):A=e[37];let T;e[38]!==c.localStorageCreateBackupSave?(T=s.jsx(l.Modal.Footer,{className:"justify-content-end",children:s.jsx(l.PrimaryButton,{type:"submit",children:c.localStorageCreateBackupSave})}),e[38]=c.localStorageCreateBackupSave,e[39]=T):T=e[39];let F;e[40]!==D||e[41]!==A||e[42]!==T?(F=s.jsxs(l.Form,{onSubmit:D,noValidate:!0,children:[A,T]}),e[40]=D,e[41]=A,e[42]=T,e[43]=F):F=e[43];let P;e[44]!==b||e[45]!==F?(P=s.jsx(Ie.FormProvider,{...b,children:F}),e[44]=b,e[45]=F,e[46]=P):P=e[46];let M;return e[47]!==t||e[48]!==E||e[49]!==P||e[50]!==L?(M=s.jsxs(l.Modal,{show:t,onHide:L,children:[E,P]}),e[47]=t,e[48]=E,e[49]=P,e[50]=L,e[51]=M):M=e[51],M};function Oi(){return!0}function Bi(){return!1}const Gt={apiGetBackups:"/localStorageSettings",apiCreateBackup:"/localStorageSettings",apiDeleteBackup:"/localStorageSettings"},zi=n=>{const e=l.compilerRuntimeExports.c(39),{apiUrls:t}=n,{apiGetBackups:o,apiCreateBackup:a,apiDeleteBackup:r}=t===void 0?Gt:t,i=o===void 0?Gt.apiGetBackups:o,c=a===void 0?Gt.apiCreateBackup:a,u=r===void 0?Gt.apiDeleteBackup:r,{ProjectIconComponent:m,texts:d}=N.useContext(l.LuminusComponentsContext),{userSettings:f}=d,{confirm:p}=l.useConfirm(),g=l.useAxios(),{startLoading:x,stopLoading:y}=N.useContext(l.LoadingContext),{addNotification:h}=l.useNotifications(),[v,b]=N.useState(!1),{data:w,setData:S,reloadData:j}=Ae.useGetApiData(i);let C;e[0]!==u||e[1]!==g||e[2]!==x||e[3]!==y?(C=async M=>(x("localStorageSettingDelete"),g.delete(`${u}/${M}`).then(Hi).catch(Vi).finally(()=>y("localStorageSettingDelete"))),e[0]=u,e[1]=g,e[2]=x,e[3]=y,e[4]=C):C=e[4];const I=C;let k;e[5]!==h||e[6]!==p||e[7]!==I||e[8]!==S||e[9]!==f.localStorageDeleteBackupConfirm||e[10]!==f.localStorageDeleteBackupSuccess?(k=async M=>{await p(f.localStorageDeleteBackupConfirm)&&await I(M)&&(h(f.localStorageDeleteBackupSuccess,"success"),S(O=>(O==null?void 0:O.filter(z=>z.id!==M))??null))},e[5]=h,e[6]=p,e[7]=I,e[8]=S,e[9]=f.localStorageDeleteBackupConfirm,e[10]=f.localStorageDeleteBackupSuccess,e[11]=k):k=e[11];const L=k;let E;e[12]!==h||e[13]!==p||e[14]!==f.localStorageLoadBackup||e[15]!==f.localStorageLoadBackupError||e[16]!==f.localStorageLoadBackupSuccess?(E=async M=>{M.setting&&await p(f.localStorageLoadBackup)&&(Ke.restoreLocalStorage(M.setting)?h(f.localStorageLoadBackupSuccess,"success"):h(f.localStorageLoadBackupError,"danger"))},e[12]=h,e[13]=p,e[14]=f.localStorageLoadBackup,e[15]=f.localStorageLoadBackupError,e[16]=f.localStorageLoadBackupSuccess,e[17]=E):E=e[17];const D=E;let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=()=>b(!0),e[18]=_):_=e[18];let R;e[19]!==f.localStorageCreateBackup?(R=s.jsx(l.ContextButton,{className:"mb-2",onClick:_,children:f.localStorageCreateBackup}),e[19]=f.localStorageCreateBackup,e[20]=R):R=e[20];let $;e[21]!==m||e[22]!==w||e[23]!==L||e[24]!==D||e[25]!==f.localStorageNoBackups?($=w&&w.length>0?s.jsx("div",{className:"list-group",children:w.map((M,O)=>s.jsxs("div",{role:"button",className:"list-group-item list-group-item-action d-flex justify-content-between align-items-center",onClick:()=>D(M),children:[s.jsx(l.Typography,{variant:"body2",children:M.name}),s.jsxs("div",{className:"d-flex align-items-center gap-3",children:[s.jsx(l.Typography,{variant:"body2",className:"text-muted",children:M.date?l.formatDate(M.date):""}),s.jsx(l.IconButton,{size:"sm",color:"danger",onClick:z=>{z.stopPropagation(),L(M.id)},children:s.jsx(m,{icon:"delete"})})]})]},O))}):w?s.jsx(l.Alert,{variant:"secondary",size:"sm",children:f.localStorageNoBackups}):null,e[21]=m,e[22]=w,e[23]=L,e[24]=D,e[25]=f.localStorageNoBackups,e[26]=$):$=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=()=>b(!1),e[27]=A):A=e[27];let T;e[28]!==j?(T=()=>{b(!1),j()},e[28]=j,e[29]=T):T=e[29];let F;e[30]!==c||e[31]!==v||e[32]!==T?(F=s.jsx(Mi,{show:v,handleClose:A,onConfirm:T,apiCreateBackup:c}),e[30]=c,e[31]=v,e[32]=T,e[33]=F):F=e[33];let P;return e[34]!==R||e[35]!==$||e[36]!==F||e[37]!==f.localStorage?(P=s.jsxs(pt,{collapsible:!0,title:f.localStorage,defaultOpen:!0,children:[R,$,F]}),e[34]=R,e[35]=$,e[36]=F,e[37]=f.localStorage,e[38]=P):P=e[38],P};function Hi(){return!0}function Vi(){return!1}const Wi=()=>{const n=l.compilerRuntimeExports.c(7),{texts:e}=N.useContext(l.LuminusComponentsContext),{userSettings:t}=e,[o,a]=Ae.useLocalStorageState("search-use-asterisk",!0),r=o===void 0?!0:o;let i;n[0]!==a||n[1]!==r||n[2]!==t.searchSettingsUseAsterisk?(i=s.jsx(Dt,{type:"switch",value:r,onChange:a,label:t.searchSettingsUseAsterisk}),n[0]=a,n[1]=r,n[2]=t.searchSettingsUseAsterisk,n[3]=i):i=n[3];let c;return n[4]!==i||n[5]!==t.searchSettings?(c=s.jsx(pt,{collapsible:!0,title:t.searchSettings,defaultOpen:!0,children:i}),n[4]=i,n[5]=t.searchSettings,n[6]=c):c=n[6],c},Ui="_widgets-row_13gg1_1",Gi="_widget_13gg1_1",Ki="_widget-img_13gg1_5",Yi="_widget-title-spacer_13gg1_14",qi="_widget-title_13gg1_14",Qi="_title_13gg1_28",tt={widgetsRow:Ui,widget:Gi,widgetImg:Ki,widgetTitleSpacer:Yi,widgetTitle:qi,title:Qi},Xi=n=>{const e=l.compilerRuntimeExports.c(33),{show:t,widgetGroups:o,widgets:a,handleClose:r,onWidgetPicked:i,texts:c}=n,[u,m]=N.useState("");let d;if(e[0]!==u||e[1]!==a){let C;e[3]!==u?(C=I=>I.id!==-1&&l.stringSearchWithin(I.name,u),e[3]=u,e[4]=C):C=e[4],d=a.filter(C),e[0]=u,e[1]=a,e[2]=d}else d=e[2];const f=d;let p;if(e[5]!==f||e[6]!==o){let C;e[8]!==f?(C=I=>f.some(k=>k.group===I.id),e[8]=f,e[9]=C):C=e[9],p=o.filter(C),e[5]=f,e[6]=o,e[7]=p}else p=e[7];const g=p;let x;e[10]!==r?(x=()=>r(),e[10]=r,e[11]=x):x=e[11];let y;e[12]!==c.pickWidgetToAdd?(y=s.jsx(l.Modal.Title,{className:"w-100",children:c.pickWidgetToAdd}),e[12]=c.pickWidgetToAdd,e[13]=y):y=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=C=>{var I;return m(((I=C.target)==null?void 0:I.value)??"")},e[14]=h):h=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v={maxWidth:"200px"},e[15]=v):v=e[15];let b;e[16]!==u||e[17]!==c.searchPlaceholder?(b=s.jsx(l.Form.Control,{type:"search",size:"sm",value:u,placeholder:c.searchPlaceholder,onChange:h,className:"me-3",style:v}),e[16]=u,e[17]=c.searchPlaceholder,e[18]=b):b=e[18];let w;e[19]!==y||e[20]!==b?(w=s.jsxs(l.Modal.Header,{closeButton:!0,children:[y,b]}),e[19]=y,e[20]=b,e[21]=w):w=e[21];let S;e[22]!==f||e[23]!==g||e[24]!==i||e[25]!==c.noWidgets||e[26]!==c.otherWidgets?(S=s.jsx(l.Modal.Body,{className:"flex-column gap-3",children:f.length===0?s.jsx(l.Alert,{variant:"warning",children:c.noWidgets}):s.jsxs(s.Fragment,{children:[g.map(C=>s.jsx(At,{defaultOpen:!0,title:C.name??"",children:s.jsx("div",{className:"p-1",children:s.jsx("div",{className:l.classNames("row gx-3 gy-3",tt.widgetsRow),children:f.filter(I=>I.group===C.id).map(I=>s.jsx("div",{className:"col col-4",children:s.jsxs("div",{role:"button",className:l.classNames("p-0 pt-2 bg-white rounded shadow-sm",tt.widget),onClick:()=>i(I.id),children:[s.jsx("div",{className:tt.widgetImg,style:{backgroundImage:I.img?`url(${I.img})`:void 0}}),s.jsx("div",{className:tt.widgetTitleSpacer}),s.jsx("div",{className:l.classNames(tt.widgetTitle,"rounded"),children:s.jsx(l.Typography,{variant:"body",className:l.classNames(tt.title,"text-white text-truncate"),children:I.name})})]},I.id)}))})})},C.id)),f.some(Zi)&&s.jsx(At,{defaultOpen:!0,title:c.otherWidgets,children:s.jsx("div",{className:"p-1",children:s.jsx("div",{className:l.classNames("row gx-3 gy-3",tt.widgetsRow),children:f.filter(Ji).map(C=>s.jsx("div",{className:"col col-4",children:s.jsxs("div",{role:"button",className:l.classNames("p-0 pt-2 bg-white rounded shadow-sm",tt.widget),onClick:()=>i(C.id),children:[s.jsx("div",{className:tt.widgetImg,style:{backgroundImage:C.img?`url(${C.img})`:void 0}}),s.jsx("div",{className:tt.widgetTitleSpacer}),s.jsx("div",{className:l.classNames(tt.widgetTitle,"rounded"),children:s.jsx(l.Typography,{variant:"body",className:l.classNames(tt.title,"text-white text-truncate"),children:C.name})})]},C.id)}))})})})]})}),e[22]=f,e[23]=g,e[24]=i,e[25]=c.noWidgets,e[26]=c.otherWidgets,e[27]=S):S=e[27];let j;return e[28]!==t||e[29]!==x||e[30]!==w||e[31]!==S?(j=s.jsxs(l.Modal,{show:t,onHide:x,size:"lg",children:[w,S]}),e[28]=t,e[29]=x,e[30]=w,e[31]=S,e[32]=j):j=e[32],j};function Zi(n){return n.group===void 0}function Ji(n){return n.group===void 0}const ec="_widget_19xgl_1",tc="_mobile_19xgl_7",fs={widget:ec,mobile:tc},Fo=n=>{const e=l.compilerRuntimeExports.c(17),{widgetGroups:t,availableWidgets:o,onAdd:a,texts:r}=n,[i,c]=N.useState(!1),{isMobile:u}=l.useWindowSize();let m;e[0]!==u?(m=l.classNames("luminus-empty-widget",fs.widget,{[fs.mobile]:u}),e[0]=u,e[1]=m):m=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(l.IconButton,{onClick:()=>c(!0),children:s.jsx(l.MdOutlineAddCircleOutline,{})}),e[2]=d):d=e[2];let f;e[3]!==m?(f=s.jsx("div",{className:m,children:d}),e[3]=m,e[4]=f):f=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!1),e[5]=p):p=e[5];let g;e[6]!==a?(g=h=>{c(!1),a(h)},e[6]=a,e[7]=g):g=e[7];let x;e[8]!==o||e[9]!==i||e[10]!==g||e[11]!==r||e[12]!==t?(x=s.jsx(Xi,{show:i,widgetGroups:t,widgets:o,handleClose:p,onWidgetPicked:g,texts:r}),e[8]=o,e[9]=i,e[10]=g,e[11]=r,e[12]=t,e[13]=x):x=e[13];let y;return e[14]!==f||e[15]!==x?(y=s.jsxs(s.Fragment,{children:[f,x]}),e[14]=f,e[15]=x,e[16]=y):y=e[16],y},nc="_dashboard_1gf59_1",sc="_widgets-grid_1gf59_1",oc="_widget-wrapper_1gf59_8",lc="_full-width_1gf59_13",ac="_widget-edit_1gf59_16",rc="_remove-icon_1gf59_19",ic="_full-width-icon_1gf59_26",cc="_widget-edit-overlay_1gf59_36",dc="_mobile_1gf59_45",rt={dashboard:nc,widgetsGrid:sc,widgetWrapper:oc,fullWidth:lc,widgetEdit:ac,removeIcon:rc,fullWidthIcon:ic,widgetEditOverlay:cc,mobile:dc},uc=n=>{const e=l.compilerRuntimeExports.c(29),{widget:t,onIndex:o,fullWidth:a,editMode:r,widgetGroups:i,availableWidgets:c,onRemove:u,onToggleFullWidth:m,onAdd:d}=n,{texts:f}=N.useContext(l.LuminusComponentsContext),{homeDashboard:p}=f;if(!t)return null;let g;e[0]!==r||e[1]!==a||e[2]!==t.id?(g=l.classNames(rt.widgetWrapper,{[rt.widgetEdit]:r&&t.id!==-1},{[rt.fullWidth]:a}),e[0]=r,e[1]=a,e[2]=t.id,e[3]=g):g=e[3];let x;e[4]!==r||e[5]!==a||e[6]!==o||e[7]!==u||e[8]!==m?(x=r&&s.jsxs(s.Fragment,{children:[s.jsx(l.IconButton,{color:"danger",onClick:()=>u(o),className:l.classNames(rt.removeIcon),children:s.jsx(l.MdOutlineDelete,{})}),s.jsx(l.IconButton,{color:a?"danger":"primary",onClick:()=>m(o),className:l.classNames(rt.fullWidthIcon),children:s.jsx(l.MdOutlineExpand,{})})]}),e[4]=r,e[5]=a,e[6]=o,e[7]=u,e[8]=m,e[9]=x):x=e[9];let y;e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==d||e[14]!==o||e[15]!==t.WidgetElement||e[16]!==t.id||e[17]!==t.title||e[18]!==i?(y=t.id===-1?r&&s.jsx("div",{className:rt.widgetWrapper,children:s.jsx(Fo,{widgetGroups:i,availableWidgets:c,onAdd:b=>d(o,b),texts:p})}):s.jsx(uu,{title:t.title,children:s.jsx(t.WidgetElement,{title:t.title})}),e[10]=c,e[11]=r,e[12]=p,e[13]=d,e[14]=o,e[15]=t.WidgetElement,e[16]=t.id,e[17]=t.title,e[18]=i,e[19]=y):y=e[19];let h;e[20]!==r||e[21]!==t.id?(h=t.id>-1&&r&&s.jsx("div",{className:rt.widgetEditOverlay}),e[20]=r,e[21]=t.id,e[22]=h):h=e[22];let v;return e[23]!==o||e[24]!==g||e[25]!==x||e[26]!==y||e[27]!==h?(v=s.jsxs("div",{className:g,children:[x,y,h]},o),e[23]=o,e[24]=g,e[25]=x,e[26]=y,e[27]=h,e[28]=v):v=e[28],v},mc=(n,e)=>{const t=l.compilerRuntimeExports.c(10),o=e===void 0?"dashboardConfig":e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={widgets:[]},t[0]=a):a=t[0];const[r,i]=N.useState(a);let c,u;t[1]!==n||t[2]!==o?(c=()=>{const p=localStorage.getItem(o);p?i(JSON.parse(p)):n&&i(n)},u=[n,o],t[1]=n,t[2]=o,t[3]=c,t[4]=u):(c=t[3],u=t[4]),N.useEffect(c,u);let m;t[5]!==o?(m=p=>{i(p),localStorage.setItem(o,JSON.stringify(p))},t[5]=o,t[6]=m):m=t[6];const d=m;let f;return t[7]!==r||t[8]!==d?(f={dashboardConfig:r,onChangeDashboardConfig:d},t[7]=r,t[8]=d,t[9]=f):f=t[9],f},fc=n=>{var k,L,E;const e=l.compilerRuntimeExports.c(34),{widgetGroups:t,availableWidgets:o,editMode:a,defaultDashboardConfig:r,dashboardConfigKey:i}=n,{texts:c}=N.useContext(l.LuminusComponentsContext),{homeDashboard:u}=c,{dashboardConfig:m,onChangeDashboardConfig:d}=mc(r,i);let f;e[0]!==m||e[1]!==d?(f=(D,_)=>{var R,$;D===((R=m.widgets)==null?void 0:R.length)?d({...m,widgets:[...m.widgets,{widgetId:_,fullWidth:!1}]}):d({...m,widgets:(($=m.widgets)==null?void 0:$.map((A,T)=>T===D?{widgetId:_,fullWidth:!1}:A))??[]})},e[0]=m,e[1]=d,e[2]=f):f=e[2];const p=f;let g;e[3]!==p||e[4]!==m||e[5]!==d?(g=D=>{var _,R;((_=m.widgets[D])==null?void 0:_.widgetId)===-1?d({...m,widgets:((R=m.widgets)==null?void 0:R.filter(($,A)=>A!==D))??[]}):p(D,-1)},e[3]=p,e[4]=m,e[5]=d,e[6]=g):g=e[6];const x=g;let y;e[7]!==m||e[8]!==d?(y=D=>{var _;d({...m,widgets:((_=m.widgets)==null?void 0:_.map((R,$)=>$===D?{...R,fullWidth:!R.fullWidth}:R))??[]})},e[7]=m,e[8]=d,e[9]=y):y=e[9];const h=y,{isMobile:v}=l.useWindowSize();let b;e[10]!==v?(b=l.classNames(rt.dashboard,{[rt.mobile]:v}),e[10]=v,e[11]=b):b=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=l.classNames(rt.widgetsGrid),e[12]=w):w=e[12];let S;e[13]!==p||e[14]!==o||e[15]!==m.widgets||e[16]!==a||e[17]!==x||e[18]!==h||e[19]!==t?(S=(k=m.widgets)==null?void 0:k.map((D,_)=>s.jsx(uc,{widget:o.find(R=>R.id===D.widgetId),onIndex:_,fullWidth:D.fullWidth,editMode:a,widgetGroups:t,availableWidgets:o,onRemove:x,onToggleFullWidth:h,onAdd:p},`${D.widgetId}-${_}`)),e[13]=p,e[14]=o,e[15]=m.widgets,e[16]=a,e[17]=x,e[18]=h,e[19]=t,e[20]=S):S=e[20];let j;e[21]!==p||e[22]!==o||e[23]!==((L=m.widgets)==null?void 0:L.length)||e[24]!==a||e[25]!==u||e[26]!==t?(j=a&&s.jsx(Fo,{widgetGroups:t,availableWidgets:o,onAdd:D=>{var _;return p((_=m.widgets)==null?void 0:_.length,D)},texts:u}),e[21]=p,e[22]=o,e[23]=(E=m.widgets)==null?void 0:E.length,e[24]=a,e[25]=u,e[26]=t,e[27]=j):j=e[27];let C;e[28]!==S||e[29]!==j?(C=s.jsxs("div",{className:w,children:[S,j]}),e[28]=S,e[29]=j,e[30]=C):C=e[30];let I;return e[31]!==b||e[32]!==C?(I=s.jsx("div",{className:b,children:C}),e[31]=b,e[32]=C,e[33]=I):I=e[33],I},pc="_badge_193ci_1",hc="_sm_193ci_6",gc="_md_193ci_10",xc="_lg_193ci_14",yc="_light_193ci_18",fn={badge:pc,sm:hc,md:gc,lg:xc,light:yc},vc=n=>{const e=l.compilerRuntimeExports.c(22);let t,o,a,r,i,c,u;e[0]!==n?({children:t,color:i,size:c,rounded:r,className:o,variant:u,...a}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i,e[6]=c,e[7]=u):(t=e[1],o=e[2],a=e[3],r=e[4],i=e[5],c=e[6],u=e[7]);const m=i===void 0?"primary":i,d=c===void 0?"md":c,f=u===void 0?"filled":u;let p;e:{if(f==="filled"){const h=`bg-${m}`;let v;e[8]!==h?(v=l.classNames(h),e[8]=h,e[9]=v):v=e[9],p=v;break e}if(f==="outline"){const h=`text-${m} border-${m} border bg-white`;let v;e[10]!==h?(v=l.classNames(h),e[10]=h,e[11]=v):v=e[11],p=v;break e}p=""}const g=p;let x;e[12]!==o||e[13]!==m||e[14]!==r||e[15]!==d||e[16]!==g?(x=l.classNames("luminus-badge badge",g,o,{"rounded-pill":r},{"text-dark":m==="light"},{[fn.light]:m==="light"},fn.badge,fn[d]),e[12]=o,e[13]=m,e[14]=r,e[15]=d,e[16]=g,e[17]=x):x=e[17];let y;return e[18]!==t||e[19]!==a||e[20]!==x?(y=s.jsx("span",{className:x,...a,children:t}),e[18]=t,e[19]=a,e[20]=x,e[21]=y):y=e[21],y},bc="_collapse-icon_1ahhn_1",jc="_collapsed_1ahhn_6",ps={collapseIcon:bc,collapsed:jc},At=n=>{const e=l.compilerRuntimeExports.c(23),{title:t,children:o,className:a,...r}=n,i=r.controlled?!1:r.defaultOpen??!1,[c,u]=N.useState(i),m=r.controlled?r.isOpen:c;let d;e[0]!==i?(d=[i],e[0]=i,e[1]=d):d=e[1],N.useEffect(()=>{u(i)},d);const f=a??"",p="button",g="d-flex align-items-center justify-content-between pb-3 pt-2",x=()=>r.controlled?r.onToggle(!r.isOpen):u(!c);let y;e[2]!==t?(y=s.jsx(l.Typography,{variant:"h6",children:t}),e[2]=t,e[3]=y):y=e[3];const h=l.MdOutlineChevronRight,v=l.classNames(ps.collapseIcon,{[ps.collapsed]:m});let b;e[4]!==h||e[5]!==v?(b=s.jsx(h,{className:v}),e[4]=h,e[5]=v,e[6]=b):b=e[6];let w;e[7]!==x||e[8]!==y||e[9]!==b?(w=s.jsxs("div",{role:p,className:g,onClick:x,children:[y,b]}),e[7]=x,e[8]=y,e[9]=b,e[10]=w):w=e[10];let S;e[11]!==o?(S=s.jsx("div",{children:o}),e[11]=o,e[12]=S):S=e[12];let j;e[13]!==m||e[14]!==S?(j=s.jsx(En,{in:m,children:S}),e[13]=m,e[14]=S,e[15]=j):j=e[15];const C=`my-0 ${m?"mt-3":""}`;let I;e[16]!==C?(I=s.jsx("hr",{className:C}),e[16]=C,e[17]=I):I=e[17];let k;return e[18]!==j||e[19]!==I||e[20]!==f||e[21]!==w?(k=s.jsxs("div",{className:f,children:[w,j,I]}),e[18]=j,e[19]=I,e[20]=f,e[21]=w,e[22]=k):k=e[22],k},Sc="_card_19733_1",Cc="_header_19733_6",wc="_header-content_19733_13",Nc="_title_19733_19",Ic="_collapse-icon_19733_22",kc="_collapsed_19733_27",_c="_content_19733_30",yt={card:Sc,header:Cc,headerContent:wc,title:Nc,collapseIcon:Ic,collapsed:kc,content:_c},pt=({title:n,headerContent:e,children:t,className:o,headerClassName:a,contentClassName:r,dontRenderIfNoChildren:i,...c})=>{const u=c.collapsible?c.controlled?!1:c.defaultOpen??!1:!0,[m,d]=N.useState(u),f=c.collapsible?c.controlled?c.isOpen:m:!0;N.useEffect(()=>{d(u)},[u]);const p=N.useMemo(()=>!t||!t.toString()||t.toString().split(",").filter(g=>g&&g!=="false").length===0,[t]);return i&&p?null:s.jsxs("div",{className:l.classNames("luminus-card rounded shadow-sm",yt.card,{[o??""]:o}),children:[s.jsxs("div",{role:c.collapsible?"button":void 0,className:l.classNames("header",yt.header,{[a??""]:a}),onClick:()=>{c.collapsible&&(c.controlled?c.onToggle(!c.isOpen):d(!m))},children:[s.jsxs("div",{className:l.classNames("header-content",yt.headerContent),children:[s.jsx(l.Typography,{variant:"h6",className:l.classNames("text-primary",yt.title),children:n}),e??null]}),c.collapsible&&s.jsx(l.MdOutlineChevronRight,{className:l.classNames(yt.collapseIcon,{[yt.collapsed]:f})})]}),s.jsx(En,{in:f,children:s.jsx("div",{className:l.classNames("card-content border-top border-primary",yt.content,{[r??""]:r}),children:t})})]})};var Dc=!!(typeof window<"u"&&window.document&&window.document.createElement),Tc=function(){function n(e,t){for(var o=0;o<t.length;o++){var a=t[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}}();function Ec(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Lc(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Rc(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Po=function(n){Rc(e,n);function e(){return Ec(this,e),Lc(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Tc(e,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return Dc?(!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),Qt.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),e}(N.Component);Po.propTypes={children:l.PropTypes.node.isRequired,node:l.PropTypes.any};var $c=function(){function n(e,t){for(var o=0;o<t.length;o++){var a=t[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}}();function Fc(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Pc(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Ac(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Ao=function(n){Ac(e,n);function e(){return Fc(this,e),Pc(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return $c(e,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(o){this.renderPortal()}},{key:"componentWillUnmount",value:function(){Qt.unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(o){!this.props.node&&!this.defaultNode&&(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var a=this.props.children;typeof this.props.children.type=="function"&&(a=N.cloneElement(this.props.children)),this.portal=Qt.unstable_renderSubtreeIntoContainer(this,a,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),e}(N.Component);Ao.propTypes={children:l.PropTypes.node.isRequired,node:l.PropTypes.any};var Cn=void 0;Qt.createPortal?Cn=Po:Cn=Ao;const Hn=n=>{const e=l.compilerRuntimeExports.c(15);let t,o,a,r,i;if(e[0]!==n){const{src:d,alt:f,baseUrl:p,customToken:g,placeholder:x,renderAsDivBg:y,...h}=n;i=d,t=f,a=x,r=y,o=h,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i}else t=e[1],o=e[2],a=e[3],r=e[4],i=e[5];if(!r){const d=t??"",f=i??a;let p;return e[6]!==o||e[7]!==d||e[8]!==f?(p=s.jsx("img",{...o,alt:d,src:f}),e[6]=o,e[7]=d,e[8]=f,e[9]=p):p=e[9],p}const c=i?`url(${i})`:void 0;let u;e[10]!==c?(u={backgroundImage:c,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},e[10]=c,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=s.jsx("div",{...o,style:u}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m},Mc="_lightbox_1kenb_1",Oc="_show_1kenb_16",Bc="_header_1kenb_20",zc="_photo-actions_1kenb_26",Hc="_photo-container_1kenb_31",Vc="_photo_1kenb_26",Wc="_nav-button_1kenb_46",Uc="_photos-preview-container_1kenb_53",Gc="_lightbox-draggable-photo_1kenb_67",Kc="_selected_1kenb_75",Yc="_indicators_1kenb_79",qc="_left_1kenb_111",Qc="_right_1kenb_114",Xc="_dragging_1kenb_125",Ue={lightbox:Mc,show:Oc,header:Bc,photoActions:zc,photoContainer:Hc,photo:Vc,navButton:Wc,photosPreviewContainer:Uc,lightboxDraggablePhoto:Gc,selected:Kc,indicators:Yc,left:qc,right:Qc,dragging:Xc};function Mt(n){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(n)}function Zc(n,e){if(Mt(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(Mt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Jc(n){var e=Zc(n,"string");return Mt(e)=="symbol"?e:e+""}function Ht(n,e,t){return(e=Jc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),t.push.apply(t,o)}return t}function gs(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(t),!0).forEach(function(o){Ht(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}var ed={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},Mo=Symbol("closestEdge");function td(n,e){var t,o,a=e.element,r=e.input,i=e.allowedEdges,c={x:r.clientX,y:r.clientY},u=a.getBoundingClientRect(),m=i.map(function(f){return{edge:f,value:ed[f](u,c)}}),d=(t=(o=m.sort(function(f,p){return f.value-p.value})[0])===null||o===void 0?void 0:o.edge)!==null&&t!==void 0?t:null;return gs(gs({},n),{},Ht({},Mo,d))}function Oo(n){var e;return(e=n[Mo])!==null&&e!==void 0?e:null}function nd(n){var e=n.startIndex,t=n.closestEdgeOfTarget,o=n.indexOfTarget;if(e===-1||o===-1||e===o)return e;if(t==null)return o;var a=t==="right",r=e<o;return r?a?o:o-1:a?o+1:o}function sd(n){if(Array.isArray(n))return n}function od(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var o,a,r,i,c=[],u=!0,m=!1;try{if(r=(t=t.call(n)).next,e!==0)for(;!(u=(o=r.call(t)).done)&&(c.push(o.value),c.length!==e);u=!0);}catch(d){m=!0,a=d}finally{try{if(!u&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(m)throw a}}return c}}function wn(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}function Bo(n,e){if(n){if(typeof n=="string")return wn(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wn(n,e):void 0}}function ld(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zo(n,e){return sd(n)||od(n,e)||Bo(n,e)||ld()}var Ho="data-pdnd-honey-pot";function Vo(n){return n instanceof Element&&n.hasAttribute(Ho)}function Wo(n){var e=document.elementsFromPoint(n.x,n.y),t=zo(e,2),o=t[0],a=t[1];return o?Vo(o)?a??null:o:null}var ad=2147483647;function xs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),t.push.apply(t,o)}return t}function ys(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xs(Object(t),!0).forEach(function(o){Ht(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}var Ot=2,vs=Ot/2;function rd(n){return{x:Math.floor(n.x),y:Math.floor(n.y)}}function id(n){return{x:n.x-vs,y:n.y-vs}}function cd(n){return{x:Math.max(n.x,0),y:Math.max(n.y,0)}}function dd(n){return{x:Math.min(n.x,window.innerWidth-Ot),y:Math.min(n.y,window.innerHeight-Ot)}}function bs(n){var e=n.client,t=dd(cd(id(rd(e))));return DOMRect.fromRect({x:t.x,y:t.y,width:Ot,height:Ot})}function js(n){var e=n.clientRect;return{left:"".concat(e.left,"px"),top:"".concat(e.top,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}}function ud(n){var e=n.client,t=n.clientRect;return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function md(n){var e=n.initial,t=document.createElement("div");t.setAttribute(Ho,"true");var o=bs({client:e});Object.assign(t.style,ys(ys({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},js({clientRect:o})),{},{pointerEvents:"auto",zIndex:ad})),document.body.appendChild(t);var a=l.dist.bind(window,{type:"pointermove",listener:function(i){var c={x:i.clientX,y:i.clientY};o=bs({client:c}),Object.assign(t.style,js({clientRect:o}))},options:{capture:!0}});return function(i){var c=i.current;if(a(),ud({client:c,clientRect:o})){t.remove();return}function u(){m(),t.remove()}var m=l.dist.bindAll(window,[{type:"pointerdown",listener:u},{type:"pointermove",listener:u},{type:"focusin",listener:u},{type:"focusout",listener:u},{type:"dragstart",listener:u},{type:"dragenter",listener:u},{type:"dragover",listener:u}],{capture:!0})}}function fd(){var n=null;function e(){return n=null,l.dist.bind(window,{type:"pointermove",listener:function(a){n={x:a.clientX,y:a.clientY}},options:{capture:!0}})}function t(){var o=null;return function(r){var i=r.eventName,c=r.payload;if(i==="onDragStart"){var u=c.location.initial.input,m=n??{x:u.clientX,y:u.clientY};o=md({initial:m})}if(i==="onDrop"){var d,f=c.location.current.input;(d=o)===null||d===void 0||d({current:{x:f.clientX,y:f.clientY}}),o=null,n=null}}}return{bindEvents:e,getOnPostDispatch:t}}function pd(n){if(Array.isArray(n))return wn(n)}function hd(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function gd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uo(n){return pd(n)||hd(n)||Bo(n)||gd()}var xd=l.once(function(){return process.env.NODE_ENV==="test"?!1:navigator.userAgent.includes("Firefox")});function yd(n){return"nodeName"in n}function vd(n){return yd(n)&&n.ownerDocument!==document}function bd(n){var e=n.dragLeave,t=e.type,o=e.relatedTarget;return t!=="dragleave"?!1:l.isSafari()?l.isLeavingWindowInSafari({dragLeave:e}):o==null?!0:xd()?vd(o):o instanceof HTMLIFrameElement}function jd(n){var e=n.onDragEnd;return[{type:"pointermove",listener:function(){var t=0;return function(){if(t<20){t++;return}e()}}()},{type:"pointerdown",listener:e}]}function $t(n){return{altKey:n.altKey,button:n.button,buttons:n.buttons,ctrlKey:n.ctrlKey,metaKey:n.metaKey,shiftKey:n.shiftKey,clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY}}var Nn={isActive:!1};function Go(){return!Nn.isActive}function Sd(n){return n.dataTransfer?n.dataTransfer.setDragImage.bind(n.dataTransfer):null}function Cd(n){var e=n.current,t=n.next;if(e.length!==t.length)return!0;for(var o=0;o<e.length;o++)if(e[o].element!==t[o].element)return!0;return!1}function wd(n){var e=n.event,t=n.dragType,o=n.getDropTargetsOver,a=n.dispatchEvent;if(!Go())return;var r=Nd({event:e,dragType:t,getDropTargetsOver:o});Nn.isActive=!0;var i={current:r};pn({event:e,current:r.dropTargets});var c=l.makeDispatch({source:t.payload,dispatchEvent:a,initial:r});function u(g){var x=Cd({current:i.current.dropTargets,next:g.dropTargets});i.current=g,x&&c.dragUpdate({current:i.current})}function m(g){var x=$t(g),y=Vo(g.target)?Wo({x:x.clientX,y:x.clientY}):g.target,h=o({target:y,input:x,source:t.payload,current:i.current.dropTargets});h.length&&(g.preventDefault(),pn({event:g,current:h})),u({dropTargets:h,input:x})}function d(){i.current.dropTargets.length&&u({dropTargets:[],input:i.current.input}),c.drop({current:i.current,updatedSourcePayload:null}),f()}function f(){Nn.isActive=!1,p()}var p=l.dist.bindAll(window,[{type:"dragover",listener:function(x){m(x),c.drag({current:i.current})}},{type:"dragenter",listener:m},{type:"dragleave",listener:function(x){bd({dragLeave:x})&&(u({input:i.current.input,dropTargets:[]}),t.startedFrom==="external"&&d())}},{type:"drop",listener:function(x){if(i.current={dropTargets:i.current.dropTargets,input:$t(x)},!i.current.dropTargets.length){d();return}x.preventDefault(),pn({event:x,current:i.current.dropTargets}),c.drop({current:i.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(x):null}),f()}},{type:"dragend",listener:function(x){i.current={dropTargets:i.current.dropTargets,input:$t(x)},d()}}].concat(Uo(jd({onDragEnd:d}))),{capture:!0});c.start({nativeSetDragImage:Sd(e)})}function pn(n){var e,t=n.event,o=n.current,a=(e=o[0])===null||e===void 0?void 0:e.dropEffect;a!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=a)}function Nd(n){var e=n.event,t=n.dragType,o=n.getDropTargetsOver,a=$t(e);if(t.startedFrom==="external")return{input:a,dropTargets:[]};var r=o({input:a,source:t.payload,target:e.target,current:[]});return{input:a,dropTargets:r}}var Ss={canStart:Go,start:wd},In=new Map;function Id(n){var e=n.typeKey,t=n.mount,o=In.get(e);if(o)return o.usageCount++,o;var a={typeKey:e,unmount:t(),usageCount:1};return In.set(e,a),a}function kd(n){var e=Id(n);return function(){e.usageCount--,!(e.usageCount>0)&&(e.unmount(),In.delete(n.typeKey))}}function nn(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(){e.forEach(function(a){return a()})}}function Ko(n,e){var t=e.attribute,o=e.value;return n.setAttribute(t,o),function(){return n.removeAttribute(t)}}function Cs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),t.push.apply(t,o)}return t}function mt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cs(Object(t),!0).forEach(function(o){Ht(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cs(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function hn(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=_d(n))||e){t&&(n=t);var o=0,a=function(){};return{s:a,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(m){throw m},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var m=t.next();return i=m.done,m},e:function(m){c=!0,r=m},f:function(){try{i||t.return==null||t.return()}finally{if(c)throw r}}}}function _d(n,e){if(n){if(typeof n=="string")return ws(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ws(n,e):void 0}}function ws(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}function gn(n){return n.slice(0).reverse()}function Dd(n){var e=n.typeKey,t=n.defaultDropEffect,o=new WeakMap,a="data-drop-target-for-".concat(e),r="[".concat(a,"]");function i(g){return o.set(g.element,g),function(){return o.delete(g.element)}}function c(g){if(process.env.NODE_ENV!=="production"){var x=o.get(g.element);x&&console.warn("You have already registered a [".concat(e,"] dropTarget on the same element"),{existing:x,proposed:g}),g.element instanceof HTMLIFrameElement&&console.warn(`
|
|
13
13
|
We recommend not registering <iframe> elements as drop targets
|
|
14
14
|
as it can result in some strange browser event ordering.
|
|
15
|
-
`.replace(/\s{2,}/g," ").trim())}var
|
|
16
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
15
|
+
`.replace(/\s{2,}/g," ").trim())}var y=nn(Ko(g.element,{attribute:a,value:"true"}),i(g));return l.once(y)}function u(g){var x,y,h,v,b=g.source,w=g.target,S=g.input,j=g.result,C=j===void 0?[]:j;if(w==null)return C;if(!(w instanceof Element))return w instanceof Node?u({source:b,target:w.parentElement,input:S,result:C}):C;var I=w.closest(r);if(I==null)return C;var k=o.get(I);if(k==null)return C;var L={input:S,source:b,element:k.element};if(k.canDrop&&!k.canDrop(L))return u({source:b,target:k.element.parentElement,input:S,result:C});var E=(x=(y=k.getData)===null||y===void 0?void 0:y.call(k,L))!==null&&x!==void 0?x:{},D=(h=(v=k.getDropEffect)===null||v===void 0?void 0:v.call(k,L))!==null&&h!==void 0?h:t,_={data:E,element:k.element,dropEffect:D,isActiveDueToStickiness:!1};return u({source:b,target:k.element.parentElement,input:S,result:[].concat(Uo(C),[_])})}function m(g){var x=g.eventName,y=g.payload,h=hn(y.location.current.dropTargets),v;try{for(h.s();!(v=h.n()).done;){var b,w=v.value,S=o.get(w.element),j=mt(mt({},y),{},{self:w});S==null||(b=S[x])===null||b===void 0||b.call(S,j)}}catch(C){h.e(C)}finally{h.f()}}var d={onGenerateDragPreview:m,onDrag:m,onDragStart:m,onDrop:m,onDropTargetChange:function(x){var y=x.payload,h=new Set(y.location.current.dropTargets.map(function(F){return F.element})),v=new Set,b=hn(y.location.previous.dropTargets),w;try{for(b.s();!(w=b.n()).done;){var S,j=w.value;v.add(j.element);var C=o.get(j.element),I=h.has(j.element),k=mt(mt({},y),{},{self:j});if(C==null||(S=C.onDropTargetChange)===null||S===void 0||S.call(C,k),!I){var L;C==null||(L=C.onDragLeave)===null||L===void 0||L.call(C,k)}}}catch(F){b.e(F)}finally{b.f()}var E=hn(y.location.current.dropTargets),D;try{for(E.s();!(D=E.n()).done;){var _,R,$=D.value;if(!v.has($.element)){var A=mt(mt({},y),{},{self:$}),T=o.get($.element);T==null||(_=T.onDropTargetChange)===null||_===void 0||_.call(T,A),T==null||(R=T.onDragEnter)===null||R===void 0||R.call(T,A)}}}catch(F){E.e(F)}finally{E.f()}}};function f(g){d[g.eventName](g)}function p(g){var x=g.source,y=g.target,h=g.input,v=g.current,b=u({source:x,target:y,input:h});if(b.length>=v.length)return b;for(var w=gn(v),S=gn(b),j=[],C=0;C<w.length;C++){var I,k=w[C],L=S[C];if(L!=null){j.push(L);continue}var E=j[C-1],D=w[C-1];if((E==null?void 0:E.element)!==(D==null?void 0:D.element))break;var _=o.get(k.element);if(!_)break;var R={input:h,source:x,element:_.element};if(_.canDrop&&!_.canDrop(R)||!((I=_.getIsSticky)!==null&&I!==void 0&&I.call(_,R)))break;j.push(mt(mt({},k),{},{isActiveDueToStickiness:!0}))}return gn(j)}return{dropTargetForConsumers:c,getIsOver:p,dispatchEvent:f}}function Td(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Ed(n))||e){t&&(n=t);var o=0,a=function(){};return{s:a,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(m){throw m},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,c=!1;return{s:function(){t=t.call(n)},n:function(){var m=t.next();return i=m.done,m},e:function(m){c=!0,r=m},f:function(){try{i||t.return==null||t.return()}finally{if(c)throw r}}}}function Ed(n,e){if(n){if(typeof n=="string")return Ns(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ns(n,e):void 0}}function Ns(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}function Is(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),t.push.apply(t,o)}return t}function Ld(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Is(Object(t),!0).forEach(function(o){Ht(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Is(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Rd(){var n=new Set,e=null;function t(r){e&&(!r.canMonitor||r.canMonitor(e.canMonitorArgs))&&e.active.add(r)}function o(r){var i=Ld({},r);n.add(i),t(i);function c(){n.delete(i),e&&e.active.delete(i)}return l.once(c)}function a(r){var i=r.eventName,c=r.payload;if(i==="onGenerateDragPreview"){e={canMonitorArgs:{initial:c.location.initial,source:c.source},active:new Set};var u=Td(n),m;try{for(u.s();!(m=u.n()).done;){var d=m.value;t(d)}}catch(h){u.e(h)}finally{u.f()}}if(e){for(var f=Array.from(e.active),p=0,g=f;p<g.length;p++){var x=g[p];if(e.active.has(x)){var y;(y=x[i])===null||y===void 0||y.call(x,c)}}i==="onDrop"&&(e.active.clear(),e=null)}}return{dispatchEvent:a,monitorForConsumers:o}}function $d(n){var e=n.typeKey,t=n.mount,o=n.dispatchEventToSource,a=n.onPostDispatch,r=n.defaultDropEffect,i=Rd(),c=Dd({typeKey:e,defaultDropEffect:r});function u(f){o==null||o(f),c.dispatchEvent(f),i.dispatchEvent(f),a==null||a(f)}function m(f){var p=f.event,g=f.dragType;Ss.start({event:p,dragType:g,getDropTargetsOver:c.getIsOver,dispatchEvent:u})}function d(){function f(){var p={canStart:Ss.canStart,start:m};return t(p)}return kd({typeKey:e,mount:f})}return{registerUsage:d,dropTarget:c.dropTargetForConsumers,monitor:i.monitorForConsumers}}var Fd=l.once(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),Pd="pdnd:android-fallback",ks="text/plain",Ad="text/uri-list",Md="application/vnd.pdnd",Bt=new WeakMap;function Od(n){return Bt.set(n.element,n),function(){Bt.delete(n.element)}}var _s=fd(),Yo=$d({typeKey:"element",defaultDropEffect:"move",mount:function(e){return nn(_s.bindEvents(),l.dist.bind(document,{type:"dragstart",listener:function(o){var a,r,i,c,u,m;if(e.canStart(o)&&!o.defaultPrevented){if(!o.dataTransfer){process.env.NODE_ENV!=="production"&&console.warn(`
|
|
17
17
|
It appears as though you have are not testing DragEvents correctly.
|
|
18
18
|
|
|
19
19
|
- If you are unit testing, ensure you have polyfilled DragEvent.
|
|
@@ -21,4 +21,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
21
21
|
|
|
22
22
|
Please see our testing guides for more information:
|
|
23
23
|
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
24
|
-
`.replace(/ {2}/g,""));return}var p=r.target;if(p instanceof HTMLElement){var f=ft.get(p);if(f){var x=it(r),h={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:x};if(f.canDrag&&!f.canDrag(h)){r.preventDefault();return}if(f.dragHandle){var g=ja({x:x.clientX,y:x.clientY});if(!f.dragHandle.contains(g)){r.preventDefault();return}}var b=(l=(i=f.getInitialDataForExternal)===null||i===void 0?void 0:i.call(f,h))!==null&&l!==void 0?l:null;if(b)for(var v=0,j=Object.entries(b);v<j.length;v++){var N=xa(j[v],2),S=N[0],C=N[1];r.dataTransfer.setData(S,C??"")}Dc()&&!r.dataTransfer.types.includes(as)&&!r.dataTransfer.types.includes(_c)&&r.dataTransfer.setData(as,Tc),r.dataTransfer.setData(Lc,"");var y={element:f.element,dragHandle:(d=f.dragHandle)!==null&&d!==void 0?d:null,data:(u=(m=f.getInitialData)===null||m===void 0?void 0:m.call(f,h))!==null&&u!==void 0?u:{}},k={type:"element",payload:y,startedFrom:"internal"};n.start({event:r,dragType:k})}}}}}))},dispatchEventToSource:function(n){var a,r,o=n.eventName,l=n.payload;(a=ft.get(l.source.element))===null||a===void 0||(r=a[o])===null||r===void 0||r.call(a,l)},onPostDispatch:rs.getOnPostDispatch()}),Sa=wa.dropTarget;function Mc(e){if(process.env.NODE_ENV!=="production"&&e.dragHandle&&!e.element.contains(e.dragHandle)&&console.warn("Drag handle element must be contained in draggable element",{element:e.element,dragHandle:e.dragHandle}),process.env.NODE_ENV!=="production"){var n=ft.get(e.element);n&&console.warn("You have already registered a `draggable` on the same element",{existing:n,proposed:e})}var a=_t(wa.registerUsage(),Ec(e),Na(e.element,{attribute:"draggable",value:"true"}));return s.once(a)}const os=({width:e})=>t.jsx("div",{style:{width:e,height:"100%",backgroundColor:"#c9c9c9",border:"1px solid #bdbdbd",borderRadius:"4px"}}),Fc=({photo:e,setSelectedIndex:n,selectedIndex:a,index:r,ImgComponent:o,baseUrl:l,customToken:i,placeholder:d})=>{var h;const u=c.useRef(null),[m,p]=c.useState({type:"idle"}),[f,x]=c.useState(!1);return c.useEffect(()=>u.current?_t(Sa({element:u.current,getData:({input:g,element:b})=>ql({photoId:e.id},{input:g,element:b,allowedEdges:["left","right"]}),onDrop:()=>{p({type:"idle"})},onDrag:({self:g,source:b})=>{const v=ha(g.data);v&&p({type:"is-over",closestEdge:v,draggedWidth:b.data.width})},onDragLeave:()=>{p({type:"idle"})},getIsSticky:()=>!0}),Mc({element:u.current,onDragStart:()=>{x(!0)},onDrop:()=>{x(!1)},getInitialData:()=>{var g;return{photoId:e.id,width:(g=u.current)==null?void 0:g.clientWidth}}})):()=>{},[e.id]),t.jsxs(t.Fragment,{children:[m.type==="is-over"&&m.closestEdge==="left"&&t.jsx(os,{width:m.draggedWidth}),t.jsxs("div",{ref:u,role:"button",onClick:()=>n(r),className:s.classNames(xe.lightboxDraggablePhoto,{[xe.dragging]:f}),children:[t.jsx(o,{role:r!==a?"button":void 0,src:e.smSrc,alt:e.alt,className:s.classNames("rounded drag-handle",xe.photo,{[xe.selected]:r===a}),baseUrl:l,customToken:i,placeholder:d,draggable:!1},e.id),e.isDefault||e.customIndicators&&e.customIndicators.length>0?t.jsxs("div",{className:s.classNames(xe.indicators,"gap-1"),children:[e.isDefault&&t.jsx("div",{className:"text-primary",children:t.jsx(s.MdOutlineStar,{})}),(h=e.customIndicators)==null?void 0:h.map((g,b)=>t.jsx("div",{className:g.className,children:g.content},b))]}):null]}),m.type==="is-over"&&m.closestEdge==="right"&&t.jsx(os,{width:m.draggedWidth})]})},Oc=({photos:e,setSelectedIndex:n,selectedIndex:a,ImgComponent:r,baseUrl:o,customToken:l,placeholder:i,reorderPhotos:d,onChangeOrder:u})=>{const m=c.useRef(null);return c.useEffect(()=>{if(!m.current)throw new Error("dropTargetRef is not defined");return Sa({element:m.current,onDrop:p=>{const f=p.source.data.photoId,x=p.location.current.dropTargets[0],h=e.findIndex(j=>j.id===x.data.photoId),g=e.findIndex(j=>j.id===f),b=ha(x.data);console.log({indexOfTarget:h,startIndex:g,closestEdgeOfTarget:b});const v=Kl({startIndex:g,indexOfTarget:h,closestEdgeOfTarget:b});console.log("drop",p),d(g,v),u&&u(f,v)}})},[u,e,d]),t.jsx("div",{ref:m,className:"d-flex justify-content-center gap-1",children:e.map((p,f)=>t.jsx(Fc,{photo:p,setSelectedIndex:n,selectedIndex:a,index:f,ImgComponent:r,baseUrl:o,customToken:l,placeholder:i},p.id))})},Ia=({show:e,onClose:n,photos:a,defaultIndex:r,uploadPhotosText:o,noPhotosText:l,onUploadPhotos:i,photoActions:d,baseUrl:u,customToken:m,placeholder:p,ImgComponent:f=gn,onChangeOrder:x})=>{const[h,g]=c.useState(a);c.useEffect(()=>{g(a)},[a]);const[b,v]=c.useState(r),j=h.at(b),N=b>0,S=b<h.length-1;c.useEffect(()=>{e&&v(r)},[r,e]),c.useEffect(()=>{b>=h.length&&v(h.length-1)},[h,b]);const C=c.useCallback(w=>{switch(w.key){case"ArrowLeft":w.stopPropagation(),N&&v(I=>I-1);break;case"ArrowRight":w.stopPropagation(),S&&v(I=>I+1);break;case"Escape":w.stopPropagation(),n();break}},[S,N,n]),y=c.useCallback((w,I)=>{const E=Array.from(h),[D]=E.splice(w,1);return E.splice(I,0,D),E},[h]);s.useKeyPress(C);const k=s.useSwipeable({onSwipedLeft:w=>{w.velocity>.8&&S&&v(I=>I+1)},onSwipedRight:w=>{w.velocity>.8&&N&&v(I=>I-1)},delta:100});return t.jsxs(Qt,{children:[t.jsx(s.Backdrop,{show:e,onClick:n}),t.jsx("div",{className:s.classNames("luminus-lightbox rounded shadow",xe.lightbox,{[xe.show]:e}),...k,children:e&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:xe.header,children:[t.jsxs("div",{className:s.classNames("rounded",xe.photoActions),children:[i&&t.jsx(ln,{accept:".jpg,.jpeg,.png",onUpload:w=>{w.length>0&&i(Array.from(w))},icon:t.jsx(s.MdOutlineCameraAlt,{style:{fontSize:18}}),multiple:!0,className:"me-1 me-lg-3",children:o??null}),t.jsx(s.ResponsiveContextDropdown,{children:j&&(d==null?void 0:d.map(({label:w,onClick:I,...E},D)=>t.jsx(s.ResponsiveContextDropdownItem,{hideOn:"sm",cKey:`action-${D}`,onClick:()=>I(j.id),...E,children:typeof w=="string"?w:w(j.id)},`action-${D}`)))})]}),t.jsx("div",{role:"button",onClick:n,children:t.jsx(s.MdClear,{style:{fontSize:"32px"}})})]}),h.length===0&&t.jsx("div",{className:"w-100 h-100 d-flex align-items-center justify-content-center",children:t.jsx(s.Typography,{variant:"body",children:l??"No photos available"})}),j&&t.jsxs("div",{className:xe.photoContainer,children:[t.jsx("div",{role:N?"button":void 0,className:s.classNames("align-items-start",xe.navButton,xe.left),onClick:()=>N&&v(w=>w-1),children:N&&t.jsx(s.MdOutlineKeyboardArrowLeft,{style:{fontSize:"40px"}})}),t.jsx(f,{src:j.lgSrc,alt:j.alt,className:s.classNames("rounded",xe.photo),baseUrl:u,customToken:m,placeholder:p,renderAsDivBg:!0}),t.jsx("div",{role:S?"button":void 0,className:s.classNames("align-items-end",xe.navButton,xe.right),onClick:()=>S&&v(w=>w+1),children:S&&t.jsx(s.MdOutlineKeyboardArrowRight,{style:{fontSize:"40px"}})})]}),t.jsx("div",{className:s.classNames("d-flex justify-content-center",xe.photosPreviewContainer),children:t.jsx(Oc,{photos:h,setSelectedIndex:v,selectedIndex:b,ImgComponent:f,baseUrl:u,customToken:m,placeholder:p,reorderPhotos:y,onChangeOrder:x})})]})})]})},ka=({photos:e,onUploadPhotos:n,uploadPhotosText:a,noPhotosText:r,photoActions:o,baseUrl:l,customToken:i,placeholder:d,ImgComponent:u=gn,noLightboxOnlyButtonOnEmpty:m=!1,hideLightbox:p=!1,onChangeOrder:f})=>{const[x,h]=c.useState(null),g=x!==null?e[x]:null,[b,v]=c.useState(!1);return c.useEffect(()=>{if(e.length===0){h(null);return}const j=e.findIndex(N=>N.isDefault);h(j>-1?j:0)},[e]),!g&&n&&m?t.jsx(ln,{accept:".jpg,.jpeg,.png",onUpload:j=>{j.length>0&&n(Array.from(j))},icon:t.jsx(s.MdOutlineCameraAlt,{style:{fontSize:18}}),multiple:!0,children:a??null}):t.jsxs(t.Fragment,{children:[g?t.jsxs("div",{role:"button",className:"w-100 position-relative",onClick:()=>v(!0),children:[t.jsx(u,{src:g.smSrc,alt:g.alt,className:"rounded w-100",baseUrl:l,customToken:i,placeholder:d}),e.length>1&&t.jsx("div",{className:"position-absolute rounded p-1",style:{top:0,right:0,color:"white",textShadow:"-2px 2px 4px #696969",background:"rgba(105,105,105,0.5)"},children:t.jsx(s.MdOutlinePhotoLibrary,{fontSize:24})})]}):t.jsx(s.SimpleTooltip,{text:a??"",placement:"left",children:t.jsx("div",{role:"button",className:s.classNames("rounded p-3 d-flex justify-content-center"),onClick:()=>v(!0),children:t.jsx("img",{src:d,alt:"placeholder",className:"rounded w-25"})})}),t.jsx(Ia,{show:b&&!p,onClose:()=>v(!1),photos:e,defaultIndex:x??0,uploadPhotosText:a,noPhotosText:r,onUploadPhotos:n,photoActions:o,baseUrl:l,customToken:i,placeholder:d,ImgComponent:u,onChangeOrder:f})]})},Ac=({children:e})=>{var u,m,p;const{useMsal:n,msalScopes:a,msalExtraScopes:r}=c.useContext(s.AuthContext),{isAuthenticated:o}=s.useAuth(),{userLoginState:l}=c.useContext(s.UserContext),i=l.state===s.LoginState.LOGGING_IN,d=l.user&&((u=l.user)==null?void 0:u.permissions)&&((p=(m=l.user)==null?void 0:m.permissions)==null?void 0:p.length)>0;return n?t.jsx(Ra.MsalAuthenticationTemplate,{interactionType:Aa.InteractionType.Redirect,authenticationRequest:{scopes:a,extraScopesToConsent:r},children:i||!o()?t.jsx(ve.Loading,{}):l.user?d?t.jsx(t.Fragment,{children:e}):t.jsx(Z.Navigate,{to:"/user-not-permitted",replace:!0}):t.jsx(Z.Navigate,{to:"/no-user-login",replace:!0})}):i?t.jsx(ve.Loading,{}):!o()||!l.user?t.jsx(Z.Navigate,{to:"/login",replace:!0}):d?e:t.jsx(Z.Navigate,{to:"/user-not-permitted",replace:!0})},Rc="_item_z9z4m_1",Pc="_level-success_z9z4m_4",Bc="_level-info_z9z4m_10",$c="_level-warning_z9z4m_16",zc="_level-danger_z9z4m_22",Hc="_type-icon_z9z4m_28",Ut={item:Rc,"level-success":"_level-success_z9z4m_4",levelSuccess:Pc,"level-info":"_level-info_z9z4m_10",levelInfo:Bc,"level-warning":"_level-warning_z9z4m_16",levelWarning:$c,"level-danger":"_level-danger_z9z4m_22",levelDanger:zc,"type-icon":"_type-icon_z9z4m_28",typeIcon:Hc},Da=({level:e,children:n,customIcon:a,noIcon:r})=>{const{ProjectIconComponent:o}=c.useContext(s.LuminusComponentsContext),l=c.useCallback(()=>{switch(e){case"info":return t.jsx(o,{icon:"info"});case"warning":return t.jsx(o,{icon:"warning"});case"danger":return t.jsx(o,{icon:"danger"});default:return t.jsx(o,{icon:"check"})}},[o,e]);return t.jsxs("div",{className:s.classNames("p-2 rounded d-flex gap-1 align-items-center justify-content-between",{"ps-1":!r},Ut.item,Ut[`level-${e}`]),children:[!r&&t.jsx("div",{className:s.classNames(Ut.typeIcon),children:a??l()}),t.jsx(s.Typography,{variant:"body2",className:"w-100",children:n})]})},Vc=({version:e})=>t.jsx("div",{className:"rounded",style:{position:"fixed",right:"0px",bottom:"0px",zIndex:"10000",backgroundColor:"rgba(255, 255, 255, 0.5)",padding:"4px",pointerEvents:"all"},children:t.jsxs(s.Typography,{variant:"caption",className:"w-100 text-end",children:["verze ",e]})}),Uc="_widget-card_e9tsb_1",Wc={widgetCard:Uc},en=({children:e,title:n,headerContent:a})=>t.jsx(Re,{className:s.classNames(Wc.widgetCard,"luminus-widget"),title:n,headerContent:a,contentClassName:"h-100 overflow-auto",children:e});class Gc extends c.Component{constructor(n){super(n),this.state={hasError:!1,is404Error:!1},this.reload=this.reload.bind(this)}static getDerivedStateFromError(n){return{hasError:!0,is404Error:n.message==="404"}}componentDidUpdate(n){this.state.hasError&&n.keyForErrorState!==this.props.keyForErrorState&&this.setState({hasError:!1,is404Error:!1})}componentDidCatch(n,a){console.error("ErrorBoundary caught an error:",n,a),console.error("Error stack:",n.stack),console.error("Component stack:",a.componentStack)}reload(){this.setState({hasError:!1,is404Error:!1})}render(){const{fallback:n,fallbackOn404:a,children:r,texts:o,reloadButtonDisplay:l="append-after-child"}=this.props;return this.state.hasError?l==="inject-to-child"&&!this.state.is404Error&&c.isValidElement(n)?c.cloneElement(n,{...n.props},t.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...n.props.children,t.jsx("div",{className:"d-flex gap-2 justify-content-center",children:t.jsx(s.ContextButton,{type:"button",onClick:this.reload,children:o.reloadButtonContent})})]})):l==="inject-to-child"&&this.state.is404Error&&c.isValidElement(a)?c.cloneElement(a,{...a.props},t.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...a.props.children,t.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[t.jsx(s.ContextButton,{type:"button",onClick:this.reload,children:o.reloadButtonContent}),t.jsx(s.ContextButton,{type:"button",onClick:this.props.navigateBack,children:o.navigateBackButtonContent})]})]})):t.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[this.state.is404Error?a:n,t.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[l==="none"?null:t.jsx(s.ContextButton,{type:"button",onClick:this.reload,children:o.reloadButtonContent}),this.state.is404Error&&t.jsx(s.ContextButton,{type:"button",onClick:this.props.navigateBack,children:o.navigateBackButtonContent})]})]}):r}}const Yc=e=>a=>{const{texts:{errorBoundary:r}}=c.useContext(s.LuminusComponentsContext);return t.jsx(e,{texts:r,...a})},Ta=Yc(Gc),qc=({children:e,title:n})=>{const{texts:{widget:a}}=c.useContext(s.LuminusComponentsContext),r=Z.useNavigate();return c.useEffect(()=>{console.log("widget wrapper mounted")},[]),t.jsx(Ta,{fallback:t.jsx(en,{title:n,children:a.fallbackError}),reloadButtonDisplay:"inject-to-child",navigateBack:()=>r(-1),children:t.jsx(c.Suspense,{fallback:t.jsx(en,{title:n,children:t.jsx(bs,{})}),children:e})})},Kc="_submit-container_j8pmc_1",Qc="_spacer_j8pmc_14",is={submitContainer:Kc,spacer:Qc},_a=({children:e,noSpacer:n=!1})=>t.jsxs(t.Fragment,{children:[!n&&t.jsx("div",{className:is.spacer}),t.jsx("div",{className:s.classNames("luminus-floating-action-container shadow",is.submitContainer),children:e})]}),Zc="_timeline_g1754_1",Xc="_step-container_g1754_1",Jc="_step-date_g1754_1",ed="_step-content_g1754_4",td="_content-header_g1754_8",nd="_content-text_g1754_11",sd="_step-icon_g1754_14",$e={timeline:Zc,stepContainer:Xc,stepDate:Jc,stepContent:ed,contentHeader:td,contentText:nd,stepIcon:sd},La=({steps:e,dontSort:n})=>t.jsx("div",{className:$e.timeline,children:e.sort((a,r)=>n?0:Ha(a.date??new Date,r.date??new Date)).map((a,r)=>t.jsxs("div",{className:s.classNames("row g-0 gx-3",$e.stepContainer),children:[t.jsx("div",{className:"col-3",children:a.date&&t.jsxs(s.Typography,{variant:"caption",className:s.classNames("h-100 d-flex flex-column align-items-end justify-content-center gap-0",$e.stepDate),children:[t.jsx("div",{children:s.format(a.date,"dd.MM.yyyy")}),a.dateFormat==="date"?null:t.jsx("div",{children:s.format(a.date,"HH:mm")})]})}),t.jsx("div",{className:"col-9",children:t.jsxs("div",{className:s.classNames("h-100 d-flex flex-column gap-1 border-start border-2 p-3",$e.stepContent),children:[t.jsxs("div",{className:s.classNames("d-flex gap-2 align-items-center",$e.contentHeader),children:[a.person&&t.jsx(Dt,{name:a.person.name??"",size:22,fontSize:12}),typeof a.title=="string"?t.jsx(s.Typography,{variant:"body",className:"fw-bold",children:a.title}):a.title]}),a.text&&t.jsx(s.Typography,{variant:"body2",className:$e.contentText,children:a.text}),t.jsx("div",{className:s.classNames("text-primary",$e.stepIcon),children:a.icon??t.jsx(s.MdCircle,{})})]})})]},r))}),ad=(e,n,a,r=!0)=>{const o=s.useAxios({silent:r,differentBaseUrl:n,customToken:a}),[l,i]=c.useState(!1),[d,u]=c.useState(null),m=c.useCallback(async p=>{i(!0),u(null),o.get(e,{signal:p,responseType:"blob"}).then(f=>{i(!1),u(f.data)}).catch(()=>{i(!1),u(null)})},[o,e]);return c.useEffect(()=>{const p=new AbortController;return m(p.signal),()=>{p.abort()}},[m]),{data:d,setData:u,reloadData:m,isLoading:l}},tn=({src:e,alt:n,baseUrl:a,customToken:r,placeholder:o,renderAsDivBg:l,...i})=>{const{data:d}=ad(e,a,r),[u,m]=c.useState(null);return c.useEffect(()=>{let p=null;return d!==null?(p=URL.createObjectURL(d),m(p)):m(null),()=>{p!==null&&URL.revokeObjectURL(p)}},[d]),u===null&&!o?null:l?t.jsx("div",{...i,style:{backgroundImage:u?`url(${u})`:void 0,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"}}):t.jsx("img",{...i,alt:n??"",src:u??o})},rd=({src:e,alt:n,baseUrl:a,customToken:r,placeholder:o,renderAsDivBg:l,...i})=>{const{data:d}=de.useGetApiData("/photos/SAS",{silent:!0}),u=c.useMemo(()=>`${e}?${d}`,[e,d]);return!d||!e?null:l?t.jsx("div",{...i,style:{backgroundImage:u?`url(${u})`:void 0,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"}}):t.jsx("img",{...i,alt:n??"",src:u??o})},od=({ref:e,onClick:n,text:a})=>t.jsx("div",{ref:e,onClick:r=>{r.preventDefault(),n(r)},role:"button",className:"middle-div",children:t.jsxs("div",{className:"d-flex flex-column align-items-center",children:[t.jsx("div",{className:"mt-",children:"…"}),t.jsx("div",{className:"mt-1 middle-letter",children:a})]})}),ls=[["D","day"],["M","month"],["Y","year"],["C","custom"]],id="_wrapper_qfqux_1",ld="_lg_qfqux_7",cd="_sm_qfqux_11",dd="_md_qfqux_14",cs={wrapper:id,lg:ld,sm:cd,md:dd},wt=e=>{const n=new Date(e),a=s.trimIsoDate(n.toISOString());n.setUTCMonth(n.getUTCMonth()+1),n.setUTCDate(n.getUTCDate()-1);const r=s.trimIsoDate(n.toISOString());return{from:a,to:r}},lt=e=>{const n=new Date(e),a=s.trimIsoDate(n.toISOString());n.setUTCFullYear(n.getUTCFullYear()+1),n.setUTCDate(n.getUTCDate()-1);const r=s.trimIsoDate(n.toISOString());return{from:a,to:r}},ud=(e,n)=>{if(e===null||n===null)return"C";if(e===n)return"D";const a=new Date(e);return wt(a).to===n?"M":lt(a).to===n?"Y":(console.log(lt(a),n),"C")},md=(e,n,a)=>{const r=c.useCallback((i,d)=>{if(e==="C"){a(u=>({...u,[i]:d}));return}switch(i){case"from":a(u=>{if(d===null)return u;const m=new Date(d);if(e==="D"){const p=s.trimIsoDate(m.toISOString());return{from:p,to:p}}return e==="M"?wt(m):e==="Y"?lt(m):u});break;case"to":n("C"),a(u=>({...u,[i]:d}));break}},[e,a,n]),o=c.useCallback(i=>{a(d=>{if(d.from===null||d.to===null)return d;const u=new Date(d.from);u.setHours(u.getHours()-u.getTimezoneOffset()/60);const m=new Date(d.to);if(e==="D"){u.setDate(u.getDate()+i);const p=s.trimIsoDate(u.toISOString());return{from:p,to:p}}return e==="M"?(u.setMonth(u.getMonth()+i),wt(u)):e==="Y"?(u.setFullYear(u.getFullYear()+i),lt(u)):{from:s.trimIsoDate(u.toISOString()),to:s.trimIsoDate(m.toISOString())}})},[e,a]),l=c.useCallback(i=>{i==="D"?a(d=>({from:d.from,to:d.from})):i==="M"?a(d=>{if(d.from===null)return d;const u=s.getFirstDayOfMonth(d.from);return wt(u)}):i==="Y"&&a(d=>{if(d.from===null)return d;const u=s.getFirstDayOfYear(new Date(d.from).getFullYear());return lt(u)}),n(i)},[a,n]);return{setFromToProp:r,handleArrowClick:o,handleRangeChange:l}},pd=({fromtoState:[e,n],className:a,size:r})=>{const{texts:{date:o},ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),[i,d]=c.useState("C"),{handleArrowClick:u,handleRangeChange:m,setFromToProp:p}=md(i,d,n),f=c.useMemo(()=>i==="C",[i]),x=c.useRef(!0);return c.useEffect(()=>{if(x.current){const h=ud(e.from,e.to);d(h),x.current=!1}},[e.from,e.to]),t.jsxs("div",{className:s.classNames("d-inline-flex align-items-center gap-1",cs.wrapper,cs[r??"md"],a),children:[t.jsx(s.IconButton,{disabled:f,onClick:()=>{u(-1)},children:t.jsx(l,{icon:"chevron-left"})}),t.jsx("div",{children:t.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsx(s.TextInput,{type:"date",value:e.from,onChange:h=>p("from",h===null?null:h.toString()),InputContainer:s.NoInputContainer,size:r}),t.jsx(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{text:o[ls.find(h=>h[0]===i)[1]].substring(0,1),as:od}),children:ls.map(h=>t.jsx(s.DropdownItem,{disabled:h[0]===i,className:s.classNames(h[0]===i?"text-black-50":""),onClick:()=>m(h[0]),role:"button",children:o[h[1]]},h[0]))}),t.jsx(s.TextInput,{type:"date",value:e.to,onChange:h=>p("to",h===null?null:h.toString()),InputContainer:s.NoInputContainer,size:r})]})}),t.jsx(s.IconButton,{disabled:f,onClick:()=>{u(1)},children:t.jsx(l,{icon:"chevron-right"})})]})},fd=({defaultMonth:e,searchKey:n="monthFrom",yearMin:a,yearMax:r})=>{const{localizationContext:o}=c.useContext(s.LuminusComponentsContext),{dateFnsLocale:l}=c.useContext(o),{searchParams:i,setSearch:d}=Le.useSearchQuery(),u=i.get(n),m=u?s.parseISO(u):e,p=c.useCallback(f=>{d(n,qe(f,{representation:"date"}))},[n,d]);return t.jsx(Vs,{month:m,onChangeMonth:p,locale:l,yearMin:a,yearMax:r})},hd=({defaultYear:e,searchKey:n="yearFrom",...a})=>{const[r,o]=Le.useSearchQueryState(n,qe(e,{representation:"date"})),l=r?s.parseISO(r):e,i=c.useCallback(d=>{o(qe(d,{representation:"date"}))},[o]);return t.jsx(Us,{year:l,onChangeYear:i,...a})},gd=({data:e,showLegend:n=!1,legendPosition:a="left",onClick:r})=>{const{chartColorPalette:o}=c.useContext(s.LuminusComponentsContext);return t.jsx(s.te,{data:e,margin:{top:50,right:n&&a==="right"?200:100,bottom:50,left:n&&a==="left"?200:100},innerRadius:.4,padAngle:4,cornerRadius:2,activeOuterRadiusOffset:10,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},colors:o,arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:{from:"color",modifiers:[["darker",.5]]},arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},enableArcLabels:!1,legends:n?[{anchor:a,direction:a==="left"||a==="right"?"column":"row",justify:!1,translateX:a==="left"?-200:a==="right"?200:0,translateY:a==="top"?-50:a==="bottom"?50:0,itemsSpacing:4,itemWidth:120,itemHeight:18,itemTextColor:"#1e2832",itemDirection:"left-to-right",itemOpacity:1,symbolSize:18,symbolShape:"circle",padding:10}]:[],onClick:l=>r&&r(l.data)})},xd=({val:e,translateKey:n,data:a,unit:r})=>{var u,m;const o=e.point.id.split("."),l=o[0],i=Number(o[1]),d=c.useMemo(()=>{const p=e.point.x<100?"56%":"-56%",f=e.point.y<60?"70px":"8px";return{transform:`translate(${p}, ${f})`}},[e.point.x,e.point.y]);return t.jsxs("div",{className:"bg-white shadow-sm px-2 py-1 rounded",style:d,children:[t.jsx(s.Typography,{variant:"body",children:n(e.point.seriesId)}),t.jsxs("div",{className:"d-flex",children:[t.jsxs(s.Typography,{variant:"body",className:"pe-1",children:[(u=e.point.data.x)==null?void 0:u.toString(),":"]}),t.jsxs(s.Typography,{variant:"body",className:"fw-bold",children:[(m=a==null?void 0:a[i])==null?void 0:m[l],r&&t.jsx("span",{className:"ms-1",children:r})]})]})]})},vd=({data:e,xKey:n,yKeys:a,translateKey:r,usePercentageValue:o=!1,variant:l="default",legendPosition:i,noSort:d=!1,unit:u})=>{const{confirm:m}=s.useConfirm(),{chartColorPalette:p,texts:{chart:f}}=c.useContext(s.LuminusComponentsContext),[x,h]=c.useState(new Set),g=c.useRef(null),b=async()=>{var M;const D=(M=g.current)==null?void 0:M.querySelector("svg");if(D&&await m(f.confirmExport)){const F=D.cloneNode(!0);F.setAttribute("fill","none");const L=new XMLSerializer().serializeToString(F);s.saveFile(new Blob([L],{type:"image/svg+xml"}),"graf.svg")}},v=D=>{h(M=>{const F=new Set(M);return F.has(D.id)?F.delete(D.id):F.add(D.id),F})},j=c.useMemo(()=>d?e:e.toSorted((D,M)=>{var F;return typeof M[n]=="number"&&typeof D[n]=="number"?D[n]-M[n]:(D[n]??"").toString().localeCompare(((F=M[n])==null?void 0:F.toString())??"")}),[e,d,n]),N=c.useMemo(()=>{const D=[];return a.forEach(M=>{if(o){const F=Math.max(...j.map(L=>L[M.key]??-1/0));if(F===-1/0)return;const _=[];j.forEach(L=>{L[M.key]!=null&&_.push({x:L[n],y:F===0?0:L[M.key]/F})}),D.push({id:M.key,data:_})}else D.push({id:M.key,data:j.map(F=>({x:F[n],y:F[M.key]}))})}),D},[j,o,n,a]),S=c.useCallback(D=>{var M;return t.jsx(xd,{data:j,translateKey:r,val:D,unit:((M=a.find(F=>{var _;return F.key===((_=D.point)==null?void 0:_.seriesId)}))==null?void 0:M.unit)??u??void 0})},[j,r,u,a]),C=c.useMemo(()=>Math.min(...e.map(D=>D[n]??1/0)),[e,n]),y=c.useMemo(()=>Math.max(...e.map(D=>D[n]??-1/0)),[e,n]),k=c.useMemo(()=>{var D;return typeof((D=e==null?void 0:e[0])==null?void 0:D[n])},[e,n]),w=i??(l==="sideContent"?"bottom":"right"),I=c.useMemo(()=>!o&&l!=="sideContent",[o,l]),E=c.useMemo(()=>[C,y],[y,C]);return t.jsx("div",{ref:g,className:"d-flex h-100 w-100",children:t.jsx(s.Me,{onClick:()=>b(),data:N,xScale:k==="string"?{type:"point"}:{type:"linear",min:C},yScale:{type:"linear",nice:!0},axisLeft:I?{tickSize:5,tickPadding:5,tickRotation:0,legend:o?"%":"count",legendOffset:-40,legendPosition:"middle",truncateTickAt:0}:null,axisBottom:{tickValues:l==="sideContent"?E:void 0},gridYValues:l==="sideContent"?[0]:void 0,legends:w!=="none"?[{data:a.map((D,M)=>({id:D.key,label:r(D.key),color:p==null?void 0:p[M],hidden:x.has(D.key)})),onClick:v,anchor:w,direction:w==="right"?"column":"row",toggleSerie:!0,justify:!1,translateX:w==="right"?120:void 0,translateY:w==="right"?0:w==="bottom"?44:void 0,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:100,itemHeight:20,itemOpacity:.75,symbolSize:12,symbolShape:"circle",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .04)",itemOpacity:1,symbolSize:14}}]}]:void 0,pointSize:6,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},margin:{top:10,right:w==="right"?130:20,bottom:w==="bottom"?44:20,left:I?50:20},colors:p,isInteractive:!0,enableCrosshair:!0,enableTouchCrosshair:!0,useMesh:!0,animate:!1,tooltip:S})})},yd=({errors:e,schema:n})=>{const a=r=>{var o,l;return r.toLowerCase()==="others"?"Obecné":((l=(o=n.columns)==null?void 0:o.find(i=>i.field===r))==null?void 0:l.caption)??r};return t.jsx("div",{className:"alert alert-danger w-100 m-0 p-2",children:t.jsx("table",{children:t.jsx("tbody",{children:e.map(r=>t.jsxs("tr",{children:[t.jsx("td",{className:"fw-bold pe-2",children:t.jsxs(s.Typography,{variant:"body",children:[a(r.name),":"]})}),t.jsx("td",{className:"",children:t.jsx(s.Typography,{variant:"body",children:r.errors})})]},r.name))})})})},Ea=e=>{const n={};return Object.keys(e).forEach(a=>{if(e[a].value===!0){n[a]=1;return}if(e[a].value===!1){n[a]=0;return}n[a]=e[a].value}),n},ds=(e,n)=>{const a={};return Object.keys(e).forEach(r=>{var i;const o=e[r],l=(i=n.columns)==null?void 0:i.find(d=>d.field===r);if((l==null?void 0:l.type)==="BIT"&&(o===1||o===0)){a[r]={value:o===1,defaultValue:o===1};return}a[r]={value:o,defaultValue:o}}),a},jd="_table_1klfy_1",bd="_table-header_1klfy_10",Cd="_table-row_1klfy_10",Nd="_table-head_1klfy_10",wd="_filters-row_1klfy_19",Sd="_table-body_1klfy_30",Id="_table-cell_1klfy_30",kd="_action-column_1klfy_43",Dd="_sticky-top_1klfy_47",Td="_sticky-first_1klfy_54",_d="_sticky-last_1klfy_61",re={table:jd,tableHeader:bd,tableRow:Cd,tableHead:Nd,filtersRow:wd,tableBody:Sd,tableCell:Id,actionColumn:kd,stickyTop:Dd,stickyFirst:Td,stickyLast:_d},Ld="_input_pxkkh_1",_e={input:Ld},Ed="_multiselect_134m5_1",Md="_multiselect-menu_134m5_10",Fd="_dropdown-item_134m5_18",Od="_special-option_134m5_24",We={multiselect:Ed,multiselectMenu:Md,dropdownItem:Fd,specialOption:Od},us=10,ms=({value:e,field:n,disabled:a,valuesForSelect:r,onChangeHandler:o,separator:l})=>{var v,j,N,S;const{texts:{dynamicForms:i}}=c.useContext(s.LuminusComponentsContext),[d,u]=c.useState("");r==null||r.sort((C,y)=>(C.name??"").localeCompare(y.name??""));const m=c.useMemo(()=>{var C;return e?(C=e==null?void 0:e.toString())==null?void 0:C.split(l):[]},[e,l]),p=c.useCallback((C,y)=>{const k=C.split(l),w=y?k.every(I=>m.includes(I))&&m.length===k.length?null:k:C===""?void 0:m.includes(C)?m.filter(I=>I!==C):[...m,C];o(w!=null&&w.length?w.join(l):null)},[o,m,l]),f=c.useMemo(()=>{const C=[{value:r.map(y=>{var k;return((k=y.id)==null?void 0:k.toString())??""}).join(l),label:i.allOptionsMultiselect,specialOption:!0}];return r.forEach(y=>{var k,w;C.push({value:((k=y.id)==null?void 0:k.toString())??"",label:((w=y.name)==null?void 0:w.toString())??"",specialOption:!1})}),C},[r,i,l]),x=c.useRef(null),h=c.useRef(null),[g,b]=c.useState(!1);return c.useEffect(()=>{g&&h.current&&h.current.focus()},[g]),c.useEffect(()=>{f.length<us&&u("")},[f]),t.jsxs(s.Dropdown$1,{autoClose:"outside",onToggle:C=>b(C),children:[t.jsx(s.Dropdown$1.Toggle,{variant:"light",ref:x,id:`multiselect-${n}`,size:"sm",className:s.classNames("bg-white border",We.multiselect),onKeyDown:C=>{a||C.key==="Escape"&&o(null)},children:m.length>1||m.length===0?i.xValuesMultiselect(m.length):m.length===1?(v=f.find(C=>C.value===m.at(0)))==null?void 0:v.label:i.allOptionsMultiselect}),t.jsxs(s.Dropdown$1.Menu,{className:s.classNames(We.multiselectMenu),style:{left:(j=x.current)==null?void 0:j.getBoundingClientRect().left,top:(N=x.current)==null?void 0:N.getBoundingClientRect().bottom,maxWidth:`max(300px, ${(S=x.current)==null?void 0:S.getBoundingClientRect().width}px)`},children:[f.length>=us?t.jsx(s.Dropdown$1.Item,{className:s.classNames("rounded",We.dropdownItem,We.searchItem),children:t.jsx(s.Form.Control,{ref:h,type:"search",size:"sm",value:d,onChange:C=>u(C.target.value??""),className:"w-100"})}):null,f.filter(C=>C.specialOption?!0:d?s.stringSearchWithin(C.value,d):!0).map(C=>t.jsx(s.Dropdown$1.Item,{onClick:()=>!a&&p(C.value,C.specialOption),disabled:a,className:s.classNames("rounded",We.dropdownItem,{[We.specialOption]:C.specialOption},{"text-muted":a}),children:t.jsx(s.Form.Check,{disabled:a,label:C.label,checked:C.specialOption?m.length===C.value.split(l).length&&m.every(y=>C.value.split(l).includes(y)):m.includes(C.value),onChange:()=>{}})},C.value))]})]})},Ma=({type:e,value:n,field:a,isPrimary:r,isReadonly:o,primaryEditable:l=!1,valuesForSelect:i,addValueToValuesForSelect:d,onChangeHandler:u,hideClearIcon:m,clearValue:p,customPickers:f,isMultiChoice:x,multiChoiceSeparator:h})=>{var g;switch(e){case"NUM":return i&&i.length>0?x?t.jsx(ms,{field:a,value:(n==null?void 0:n.toString())??"",separator:h??",",onChangeHandler:b=>u(a,b),valuesForSelect:i,disabled:o?!0:r?!l:!1}):t.jsx(s.CustomSelectInput,{withoutLabel:!0,InputContainer:s.NoInputContainer,className:_e.input,size:"sm",value:(n==null?void 0:n.toString())??"",onChange:b=>u(a,b===null?null:Number(b)),options:i,disabled:o?!0:r?!l:!1,showClearIcon:!m,clearValue:p,dropdownWidth:200}):t.jsx(s.TextInput,{withoutLabel:!0,InputContainer:s.NoInputContainer,className:_e.input,size:"sm",type:"number",value:n===null?null:Number(n),onChange:b=>u(a,b===null?null:Number(b)),disabled:o?!0:r?!l:!1,showClearIcon:!m,clearValue:p});case"STR":return i&&i.length>0?x?t.jsx(ms,{field:a,value:(n==null?void 0:n.toString())??"",separator:h??",",onChangeHandler:b=>{u(a,b)},valuesForSelect:i,disabled:o?!0:r?!l:!1}):t.jsx(s.CustomSelectInput,{withoutLabel:!0,InputContainer:s.NoInputContainer,className:_e.input,size:"sm",value:(n==null?void 0:n.toString())??"",onChange:b=>u(a,(b==null?void 0:b.toString())??null),options:i,disabled:o?!0:r?!l:!1,showClearIcon:!m,clearValue:p,dropdownWidth:200}):t.jsx(s.TextInput,{withoutLabel:!0,InputContainer:s.NoInputContainer,className:s.classNames(_e.input,_e.longer),size:"sm",type:"text",value:(n==null?void 0:n.toString())??"",onChange:b=>u(a,(b==null?void 0:b.toString())??null),disabled:o?!0:r?!l:!1,showClearIcon:!m,clearValue:p});case"BIT":return t.jsx(Ze,{InputContainer:s.NoInputContainer,className:_e.input,value:n===!0,onChange:b=>u(a,b),disabled:o?!0:r?!l:!1});case"DT":return t.jsx(s.TextInput,{withoutLabel:!0,InputContainer:s.NoInputContainer,className:_e.input,size:"sm",type:"date",value:n?n.toString().split("T")[0]??"":"",onChange:b=>u(a,(b==null?void 0:b.toString())??null),disabled:o?!0:r?!l:!1,showClearIcon:!m,clearValue:p});default:{const b=f==null?void 0:f.find(v=>v.type===e);return b?t.jsx(b.picker,{className:s.classNames(_e.input,_e.longer),value:n?{id:(n==null?void 0:n.toString())??null,name:((g=i==null?void 0:i.find(v=>{var j;return((j=v.id)==null?void 0:j.toString())===(n==null?void 0:n.toString())}))==null?void 0:g.name)??""}:null,onChange:v=>{var j;u(a,(v==null?void 0:v.id)??null),console.log(v,i==null?void 0:i.some(N=>{var S,C;return((S=N.id)==null?void 0:S.toString())===((C=v==null?void 0:v.id)==null?void 0:C.toString())}),d),v&&!(i!=null&&i.some(N=>{var S,C;return((S=N.id)==null?void 0:S.toString())===((C=v==null?void 0:v.id)==null?void 0:C.toString())}))&&d&&(console.log("adding to values for select"),d({id:((j=v.id)==null?void 0:j.toString())??"",name:v.name}))},disabled:o?!0:r?!l:!1}):t.jsx("div",{className:"alert alert-warning p-1 m-0",children:t.jsxs(s.Typography,{variant:"body",children:["Neznámý typ ",e]})})}}},Ad=({schema:e,columns:n,setColumns:a,initialItem:r,onEdit:o,onDelete:l,customPickers:i,appDetail:d})=>{const{ProjectIconComponent:u}=c.useContext(s.LuminusComponentsContext),[m,p]=c.useState(r),f=c.useCallback((g,b)=>{console.log("changeValue",g,b),p(v=>({...v,[g]:{...v[g],value:b}}))},[]),x=g=>(g==null?void 0:g.value)!==(g==null?void 0:g.defaultValue),h=c.useCallback(()=>Object.keys(m).some(g=>x(m[g])),[m]);return c.useEffect(()=>{p(r)},[r]),t.jsxs("tr",{className:s.classNames("table-row",re.tableRow),children:[t.jsx("td",{className:s.classNames("table-cell",re.tableCell,re.stickyFirst),children:h()&&t.jsx(s.IconButton,{color:"success",onClick:()=>o(Ea(m)),children:t.jsx(u,{icon:"check"})})}),n.map(g=>{var b,v;return t.jsx("td",{className:s.classNames("table-cell",re.tableCell),children:t.jsx(Ma,{type:g.type,value:(b=m[g.field??""])==null?void 0:b.value,field:g.field,isReadonly:g.readOnly,isPrimary:e.primaryKey===g.field,valuesForSelect:g.valuesForSelect,addValueToValuesForSelect:j=>{a(n.map(N=>N.field===g.field?{...N,valuesForSelect:[...N.valuesForSelect??[],j]}:N))},onChangeHandler:f,hideClearIcon:!x(m[g.field??""]),clearValue:(v=m[g.field??""].defaultValue)==null?void 0:v.toString(),customPickers:i,isMultiChoice:g.multiChoice??!1,multiChoiceSeparator:g.multiChoiceSeparator??null})},`${e.id}-${g.field}`)}),t.jsxs("td",{className:s.classNames("table-cell d-flex gap-1",re.tableCell,re.stickyLast),children:[e!=null&&e.slaves&&e.slaves.length>0?e.slaves.map((g,b)=>{var v,j;return t.jsx(s.IconButton,{as:"link",href:`${Z.generatePath(d,{id:(v=g.id)==null?void 0:v.toString()})}?type=dynamic-form&masterId=${(j=m.id)==null?void 0:j.value}`,children:t.jsx(s.SimpleTooltip,{text:g.name??"",placement:"left",children:t.jsx("div",{children:t.jsxs(s.Typography,{variant:"body",className:"d-flex align-items-center text-primary",children:[e.slaves.length>1?t.jsx(s.Typography,{variant:"caption",className:"text-primary",children:b+1}):null,t.jsx(s.MdOutlineSubdirectoryArrowRight,{})]})})})},g.id)}):null,t.jsx(s.IconButton,{color:"danger",onClick:()=>l(m[e.primaryKey??""].value),children:t.jsx(u,{icon:"delete"})})]})]})},Rd=({schema:e,columns:n,setColumns:a,onCreate:r,customPickers:o})=>{const{ProjectIconComponent:l}=c.useContext(s.LuminusComponentsContext),[i,d]=c.useState(null),u=c.useCallback(()=>{var f;const p={};(f=e.columns)==null||f.forEach(x=>{const h=x.type==="BIT"?!1:x.type==="NUM"?null:x.type==="STR"?"":null;p[x.field??""]={value:h,defaultValue:h}}),d(p)},[e]),m=c.useCallback((p,f)=>{d(x=>x&&{...x,[p]:{...x[p],value:f}})},[]);return i?t.jsxs("tr",{className:"sticky-bottom shadow",children:[t.jsx("td",{className:"sticky-first",children:t.jsx(s.IconButton,{color:"success",onClick:async()=>{const p=Ea(i);p&&await r(p)&&d(null)},children:t.jsx(l,{icon:"check"})})}),n.map(p=>t.jsx("td",{children:t.jsx(Ma,{type:p.type,value:i[p.field??""].value,field:p.field,isReadonly:p.readOnly,isPrimary:e.primaryKey===p.field,valuesForSelect:p.valuesForSelect,addValueToValuesForSelect:f=>{a(n.map(x=>x.field===p.field?{...x,valuesForSelect:[...x.valuesForSelect??[],f]}:x))},onChangeHandler:m,primaryEditable:!0,customPickers:o,isMultiChoice:p.multiChoice??!1,multiChoiceSeparator:p.multiChoiceSeparator??null})},`${e.id}-${p.field}`)),t.jsx("td",{className:"sticky-last",children:t.jsx(s.IconButton,{color:"danger",onClick:()=>d(null),children:t.jsx(l,{icon:"cancel"})})})]}):t.jsxs("tr",{className:"sticky-bottom shadow",children:[t.jsx("td",{className:"sticky-first",children:t.jsx(s.IconButton,{onClick:u,children:t.jsx(l,{icon:"add"})})}),t.jsx("td",{colSpan:n.length+1})]})},Pd="_resizer_ref0b_1",Bd="_content_ref0b_11",$d="_dragging_ref0b_16",bt={resizer:Pd,content:Bd,dragging:$d},Fa=({cellRef:e,defaultWidth:n})=>{const[a,r]=c.useState(n),[,o]=c.useState(null);return c.useEffect(()=>{r(n)},[n]),c.useEffect(()=>{e.current&&(e.current.style.minWidth=`${a}px`)},[a,e]),t.jsx("div",{className:s.classNames("luminus-column-resizer",bt.resizer),draggable:!0,onDragStart:l=>{o(l.currentTarget.getBoundingClientRect().x),l.currentTarget.classList.add(bt.dragging)},onDrag:l=>{o(i=>(e.current&&r(d=>d+l.clientX-(i??0)),l.clientX))},onDragEnd:l=>{o(null),l.currentTarget.classList.remove(bt.dragging)},children:t.jsx("div",{className:s.classNames("content",bt.content)})})},zd=({column:e,children:n})=>{const{ProjectIconComponent:a}=c.useContext(s.LuminusComponentsContext);return e.description?t.jsx(s.SimpleTooltip,{placement:"bottom",text:e.description??"",children:t.jsxs("div",{className:"d-flex justify-content-between",children:[n,t.jsx(a,{icon:"info"})]})}):t.jsx(t.Fragment,{children:n})},Hd=({column:e,sortByField:n,sortByType:a,setSortBy:r})=>{const{ProjectIconComponent:o}=c.useContext(s.LuminusComponentsContext),l=c.useRef(null),i=c.useMemo(()=>{if(e.valuesForSelect&&e.valuesForSelect.length>0)return 200;switch(e.type){case"NUM":return 80;case"STR":return 200;case"BIT":return 50;case"DT":return 100;default:return 100}},[e.type,e.valuesForSelect]);return t.jsxs("th",{ref:l,className:s.classNames("table-head",re.tableHead),onClick:()=>{const d=n===e.field?a:null;if(d==="asc"){r(e.field,"desc");return}if(d==="desc"){r(e.field,null);return}r(e.field,"asc")},children:[t.jsx(zd,{column:e,children:t.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[e.label,n===e.field&&t.jsx(o,{icon:a==="asc"?"chevron-up":"chevron-down"})]})}),t.jsx(Fa,{cellRef:l,defaultWidth:i})]})},Vd=({schema:e,items:n,onEditItem:a,onDeleteItem:r,onCreateItem:o,filters:l,setFilter:i,sortByField:d,sortByType:u,setSortBy:m,selectedMaster:p,customPickers:f,appDetail:x})=>{const{texts:{dynamicForms:h}}=c.useContext(s.LuminusComponentsContext),[g,b]=c.useState([]);return c.useEffect(()=>{var v,j,N;b([...((N=(j=(v=e.columns)==null?void 0:v.filter(S=>!S.hidden))==null?void 0:j.filter(S=>e.masterReference?S.field!==e.masterReferenceColumn:!0))==null?void 0:N.map(S=>{var C;return{label:S.caption??"",width:100,description:S.description??null,field:S.field??"",type:S.type,readOnly:S.readOnly,valuesForSelect:((C=S.values)==null?void 0:C.filter(y=>S.valuesFilteredByMaster?y.masterValue===p:!0).map(y=>({id:y.id??"",name:y.name})))??void 0,multiChoice:S.multiChoice??!1,multiChoiceSeparator:S.multiChoiceSeparator??null}}))??[]])},[e,p]),t.jsxs("table",{id:`dynamic-table-${e.id}`,className:s.classNames("table table-borderless luminus-df-table",re.table),children:[t.jsxs("thead",{className:s.classNames("text-nowrap table-header",re.stickyTop,re.tableHeader),children:[t.jsxs("tr",{className:s.classNames("table-row",re.tableRow),children:[t.jsx("th",{className:s.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),g.map(v=>t.jsx(Hd,{column:v,sortByField:d,sortByType:u,setSortBy:m},`${e.id}-${v.field}`)),t.jsx("th",{className:s.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]}),t.jsxs("tr",{className:s.classNames("table-row filters-row",re.tableRow,re.filtersRow),children:[t.jsx("th",{className:s.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),g.map(v=>t.jsx("th",{className:s.classNames("table-head",re.tableHead),children:v.valuesForSelect&&v.valuesForSelect.length>0||v.type==="BIT"?t.jsx(t.Fragment,{children:t.jsx(s.CustomSelectInput,{InputContainer:s.NoInputContainer,withoutLabel:!0,size:"sm",value:l[v.field]??"",onChange:j=>i(v.field,(j==null?void 0:j.toString())??null),options:v.type==="BIT"?[{id:1,name:h.yes},{id:0,name:h.no}]:v.valuesForSelect??[],isNumber:v.type==="BIT",showClearIcon:!0,dropdownWidth:200})}):t.jsx(t.Fragment,{children:t.jsx(s.TextInput,{InputContainer:s.NoInputContainer,withoutLabel:!0,size:"sm",type:v.type==="NUM"?"number":v.type==="DT"?"date":"text",value:l[v.field]??"",onChange:j=>i(v.field,(j==null?void 0:j.toString())??null)})})},`${e.id}-${v.field}`)),t.jsx("th",{className:s.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]})]}),t.jsxs("tbody",{className:s.classNames("table-body",re.tableBody),children:[n.filter(v=>v[e.primaryKey??""]).map(v=>t.jsx(Ad,{schema:e,columns:g,setColumns:b,initialItem:v,onEdit:a,onDelete:r,customPickers:f,appDetail:x},`${e.id}-${v[e.primaryKey??""].value}`)),t.jsx(Rd,{schema:e,columns:g,setColumns:b,onCreate:o,customPickers:f})]})]})},Ud=({master:e,onChange:n,options:a,label:r})=>t.jsx("div",{style:{minWidth:"200px"},children:t.jsx(s.CustomSelectInput,{label:r,value:e,onChange:o=>n(o?o.toString():null),options:a,size:"sm"})}),Wd="_pagination_gujwe_1",ps={pagination:Wd},fs={appDetail:"/settings/:id"},ze={apiSchemaGet:"/dynamicForms/schema",apiDataGet:"/dynamicForms/data",apiItemPost:"/dynamicForms/update",apiItemDelete:"/dynamicForms/delete",apiItemCreate:"/dynamicForms/insert",apiExportGet:"/dynamicForms/export"},Gd=({id:e,page:n,setPage:a,filters:r,setFilter:o,sortByField:l,sortByType:i,setSortBy:d,appUrls:{appDetail:u=fs.appDetail}=fs,apiUrls:{apiSchemaGet:m=ze.apiSchemaGet,apiDataGet:p=ze.apiDataGet,apiItemPost:f=ze.apiItemPost,apiItemDelete:x=ze.apiItemDelete,apiItemCreate:h=ze.apiItemCreate,apiExportGet:g=ze.apiExportGet}=ze,customPickers:b})=>{var Ce,we,Se,Ue,xn,vn,yn;const{texts:{dynamicForms:v},ProjectIconComponent:j}=c.useContext(s.LuminusComponentsContext),N=s.useAxios(),{startLoading:S,stopLoading:C}=c.useContext(s.LoadingContext),[y,k]=c.useState(null),[w,I]=c.useState(null),[E,D]=c.useState(null),[M,F]=c.useState(null),[_,L]=c.useState(!1),{addNotification:W}=s.useNotifications(),[A,O]=c.useState([]),{confirm:z}=s.useConfirm(),B=20,T=B+1,R=M?Math.ceil(M.length/B):1,U=n?n>1:!1,q=n?n<R:!1,K=n?(n-1)*B:0,pe=n?n*B:B,P=c.useMemo(()=>M?M.length>T:!1,[M,T]),X=c.useMemo(()=>P?(M==null?void 0:M.slice(K,pe))??null:M??null,[P,M,K,pe]),[ie,he]=Le.useSearchQueryState("masterId",null,"string"),[ne,be]=c.useState(ie);c.useEffect(()=>{k(null),I(null),L(!1),O([])},[e]),c.useEffect(()=>{ie!==null&&(be(ie),he(null))},[ie,e,he]);const G=c.useCallback(async()=>{S("dynamicFormSchema"),await N.get(`${m}?id=${e}`).then(({data:Y})=>{k(Y),C("dynamicFormSchema")}).catch(()=>C("dynamicFormSchema"))},[N,e,S,C,m]),se=c.useCallback(async()=>{var Y;if(!(y===null||((Y=y.id)==null?void 0:Y.toString())!==e)){if(y.masterReference&&!ne){I([]);return}S("dynamicFormData"),await N.get(`${p}?id=${e}&showArchive=${_}${y.masterReference?`&master=${ne}`:""}`).then(({data:ee})=>{const le=ee.map(te=>{var me;return Object.fromEntries(((me=y.columns)==null?void 0:me.filter(fe=>fe.field).map(fe=>[fe.field,{value:te[fe.field??""],defaultValue:te[fe.field??""]}]))??[])});I(le),C("dynamicFormData")}).catch(()=>C("dynamicFormData"))}},[N,e,y,S,C,_,ne,p]),je=c.useCallback(async()=>{var Y;y===null||((Y=y.id)==null?void 0:Y.toString())!==e||y.masterReference&&!ne||(S("dynamicFormExport"),await N.get(`${g}?id=${e}&showArchive=${_}${y.masterReference?`&master=${ne}`:""}`,{responseType:"blob"}).then(ee=>s.saveFileFromResponse(ee,{fallbackName:`export-${e}`})).finally(()=>C("dynamicFormExport")))},[N,e,y,S,C,_,ne,g]),Ee=c.useCallback(async Y=>(S("dynamicFormEdit"),N.post(`${f}?id=${e}`,Y).then(()=>(C("dynamicFormEdit"),O([]),!0)).catch(ee=>(C("dynamicFormEdit"),O(s.extractErrorsFromResponse(ee)),!1))),[N,e,S,C,f]),Te=c.useCallback(async Y=>(S("dynamicFormDelete"),N.delete(`${x}?id=${e}&pk=${Y}`).then(()=>(C("dynamicFormDelete"),O([]),!0)).catch(ee=>(C("dynamicFormDelete"),O(s.extractErrorsFromResponse(ee)),!1))),[N,e,S,C,x]),H=c.useCallback(async Y=>(S("dynamicFormCreate"),N.post(`${h}?id=${e}`,Y).then(({data:ee})=>(C("dynamicFormCreate"),O([]),ee)).catch(ee=>(C("dynamicFormCreate"),O(s.extractErrorsFromResponse(ee)),null))),[N,e,S,C,h]),V=c.useCallback(async Y=>{y&&await Ee(y.masterReference?{...Y,[y.masterReferenceColumn??""]:ne}:Y)&&(W(v.editSuccess,"success"),I(ee=>ee&&ee.map(le=>{var te;return((te=le[(y==null?void 0:y.primaryKey)??""])==null?void 0:te.value)===Y[(y==null?void 0:y.primaryKey)??""]?ds(Y,y):le})))},[W,Ee,y,ne,v]),$=c.useCallback(async Y=>{await z(v.deleteConfirm)&&await Te(Y)&&(W(v.deleteSuccess,"success"),I(ee=>ee&&ee.filter(le=>{var te;return((te=le[(y==null?void 0:y.primaryKey)??""])==null?void 0:te.value)!==Y})))},[W,Te,v,z,y]),Q=c.useCallback(async Y=>{if(!y)return!1;const ee=await H(y.masterReference?{...Y,[y.masterReferenceColumn??""]:ne}:Y);if(ee!==null){W(v.createSuccess,"success");const le=ds(Y,y);return le[(y==null?void 0:y.primaryKey)??""]={value:ee,defaultValue:ee},I(te=>[...te??[],le]),!0}return!1},[W,H,v,y,ne]),ce=Y=>{Y>R?a(R):Y<1&&a(1),a(Y)},ae=c.useCallback(()=>{if(!w||!y){D(null);return}const Y=w.filter(ee=>Object.entries(r).every(([le,te])=>{var et,tt,nt;if(te===null)return!0;const me=(et=ee[le])==null?void 0:et.value;if(me==null)return!1;const fe=(tt=y.columns)==null?void 0:tt.find(gt=>gt.field===le),Xe=fe==null?void 0:fe.type,Je=(fe==null?void 0:fe.values)&&((nt=fe==null?void 0:fe.values)==null?void 0:nt.length)>0;if(!Xe)return!1;switch(Xe){case"STR":return Je?me===te:me.toString().toLowerCase().includes(te.toLowerCase());case"NUM":return Je?Number(me)===Number(te):me.toString().toLowerCase().includes(te.toLowerCase());case"DT":return me.toString().toLowerCase().includes(te.toLowerCase());case"BIT":return Number(me)===Number(te);default:return me.toString().toLowerCase().includes(te.toLowerCase())}}));D(Y)},[w,r,y]),J=c.useCallback(()=>{if(!E||!y){F([]);return}if(!l){F(E);return}F([...E].sort((Y,ee)=>{var Xe,Je,et,tt,nt,gt;const le=((Je=(Xe=Y[l])==null?void 0:Xe.value)==null?void 0:Je.toString())??"",te=((tt=(et=ee[l])==null?void 0:et.value)==null?void 0:tt.toString())??"",me=y.columns.find(ke=>ke.field===l),fe=me==null?void 0:me.type;if(!me||!fe||!le&&!te)return 0;if(!le)return 1;if(!te)return-1;if(me.values&&me.values.length>0){const ke=((nt=me.values.find(Lt=>{var st;return((st=Lt.id)==null?void 0:st.toString())===le}))==null?void 0:nt.name)??"",Me=((gt=me.values.find(Lt=>{var st;return((st=Lt.id)==null?void 0:st.toString())===te}))==null?void 0:gt.name)??"";return i==="asc"?ke.localeCompare(Me):Me.localeCompare(ke)}if(fe==="NUM"){const ke=Number(le),Me=Number(te);return i==="asc"?ke-Me:Me-ke}if(fe==="DT"){const ke=s.parseISO(le==null?void 0:le.toString()).getTime(),Me=s.parseISO(te==null?void 0:te.toString()).getTime();return i==="asc"?ke-Me:Me-ke}return i==="asc"?le.toString().localeCompare(te.toString()):te.toString().localeCompare(le.toString())}))},[E,y,l,i]);return c.useEffect(()=>{G()},[G]),c.useEffect(()=>{se()},[se]),c.useEffect(()=>{ae()},[ae]),c.useEffect(()=>{J()},[J]),c.useEffect(()=>{P?n||a(1):M&&a(null)},[M,P,n,a]),c.useEffect(()=>{!P||!n||(n>R&&a(R),n<1&&a(1))},[n,P,R,a]),t.jsxs("div",{className:"h-100 w-100 d-flex flex-column",children:[t.jsxs("div",{className:"mb-3 d-flex justify-content-between align-items-start",children:[t.jsxs("div",{className:"d-flex align-items-center gap-3",children:[t.jsx(s.Typography,{variant:"h3",children:(y==null?void 0:y.name)??""}),(y==null?void 0:y.masterReference)&&t.jsx(Ud,{label:((we=(Ce=y.columns)==null?void 0:Ce.find(Y=>Y.field===y.masterReferenceColumn))==null?void 0:we.caption)??"",options:((Ue=(Se=y.columns)==null?void 0:Se.find(Y=>Y.field===y.masterReferenceColumn))==null?void 0:Ue.values)??[],master:ne,onChange:Y=>be(Y)})]}),t.jsxs("div",{className:"d-flex align-items-center gap-1",children:[(xn=y==null?void 0:y.slaves)==null?void 0:xn.map((Y,ee)=>{var le;return t.jsxs(s.ContextButton,{as:"link",href:`${Z.generatePath(u,{id:(le=Y.id)==null?void 0:le.toString()})}?type=dynamic-form`,children:[t.jsxs("div",{className:"d-flex align-items-center",children:[y.slaves.length>1?t.jsx(s.Typography,{variant:"caption",className:"text-primary",children:ee+1}):null,t.jsx(s.MdOutlineSubdirectoryArrowRight,{})]}),Y.name]},Y.id)}),t.jsxs(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle}),children:[t.jsx(s.DropdownItem,{onClick:()=>L(!_),children:_?v.hideArchived:v.showArchived}),t.jsx(s.DropdownDivider,{}),t.jsx(s.DropdownItem,{onClick:je,icon:t.jsx(j,{icon:"file-download"}),children:v.downloadExport})]})]})]}),(y==null?void 0:y.description)&&t.jsx(s.Typography,{variant:"body2",className:"mb-3",children:y==null?void 0:y.description}),y!=null&&y.masterReference&&!ne?t.jsx(s.Alert,{variant:"warning",children:v.selectMaster(((yn=(vn=y.columns)==null?void 0:vn.find(Y=>Y.field===y.masterReferenceColumn))==null?void 0:yn.caption)??"").toLowerCase()}):t.jsxs(t.Fragment,{children:[y&&A.length>0&&t.jsx("div",{className:"mb-2",children:t.jsx(yd,{errors:A,schema:y})}),y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:s.classNames("rounded border overflow-auto",ps.tableContainer),children:t.jsx(Vd,{schema:y,items:!P&&M&&(M==null?void 0:M.length)>T?[]:(P?X:M)??[],onEditItem:V,onDeleteItem:$,onCreateItem:Q,filters:r,setFilter:o,sortByField:l,sortByType:i,setSortBy:d,selectedMaster:(ne==null?void 0:ne.toString())??null,customPickers:b,appDetail:u})}),P&&n&&t.jsxs("div",{className:s.classNames(ps.pagination,"d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"),children:[t.jsxs("div",{className:"d-flex align-items-center gap-1",children:[t.jsx(s.IconButton,{color:"primary",onClick:()=>ce(1),disabled:!U,children:t.jsx(j,{icon:"chevron-double-left"})}),t.jsx(s.IconButton,{color:"primary",onClick:()=>ce(n-1),disabled:!U,children:t.jsx(j,{icon:"chevron-left"})}),t.jsx(s.IconButton,{color:"primary",onClick:()=>ce(n+1),disabled:!q,children:t.jsx(j,{icon:"chevron-right"})}),t.jsx(s.IconButton,{color:"primary",onClick:()=>ce(R),disabled:!q,children:t.jsx(j,{icon:"chevron-double-right"})})]}),t.jsxs(s.Typography,{variant:"body",children:[v.tablePage," ",n," ",v.tablePageFrom," ",R]})]})]})]})]})},hs={appDetail:"/settings/:id"},gs={apiDynamicFormsGet:"/dynamicForms"},Yd=({item:e,children:n})=>e.description?t.jsx(s.SimpleTooltip,{placement:"left",text:e.description??"",children:t.jsx("div",{children:n})}):t.jsx(t.Fragment,{children:n}),xs=({item:e,fullSize:n,appDetail:a,search:r,activeId:o})=>{var l,i,d,u;return n?t.jsxs(Z.Link,{to:`${Z.generatePath(a,{id:(l=e.id)==null?void 0:l.toString()})}?type=${e.type}&search=${r??""}`,className:`text-nowrap list-group-item list-group-item-action ${(o==null?void 0:o.toString())===((i=e.id)==null?void 0:i.toString())?"active":""}`,children:[t.jsx(s.Typography,{variant:"body",children:e.name}),e.description&&t.jsx(s.Typography,{variant:"body2",className:"text-muted mt-2",children:e.description})]}):t.jsx(Yd,{item:e,children:t.jsx(Z.Link,{to:`${Z.generatePath(a,{id:(d=e.id)==null?void 0:d.toString()})}?type=${e.type}&search=${r??""}`,className:`text-nowrap list-group-item list-group-item-action ${(o==null?void 0:o.toString())===((u=e.id)==null?void 0:u.toString())?"active":""}`,children:t.jsx(s.Typography,{variant:"body2",children:e.name})})},e.id)},qd=({activeId:e,anchoredForms:n,otherForms:a=[],groupsDefs:r=[],searchQuery:o,fullSize:l,appUrls:{appDetail:i=hs.appDetail}=hs,apiUrls:{apiDynamicFormsGet:d=gs.apiDynamicFormsGet}=gs})=>{const u=s.useAxios(),{startLoading:m,stopLoading:p}=c.useContext(s.LoadingContext),[f,x]=c.useState(null),[h]=Le.useSearchQueryState("search",""),g=c.useMemo(()=>(n==null?void 0:n.filter(N=>s.stringSearchWithin(N.name,o)||s.stringSearchWithin(N.description,o)).sort((N,S)=>(N.name??"").localeCompare(S.name??"")))??[],[n,o]),b=c.useMemo(()=>[...(f==null?void 0:f.map(N=>({...N,type:"dynamic-form"})))??[],...a].filter(N=>s.stringSearchWithin(N.name,o)||s.stringSearchWithin(N.description,o)).sort((N,S)=>(N.name??"").localeCompare(S.name??""))??[],[f,a,o]),v=c.useMemo(()=>r.map(N=>({id:N.id,name:N.name??"",items:b.filter(S=>S.group===N.id)})).filter(N=>N.items.length>0),[r,b]),j=c.useCallback(async()=>{m("dynamicForms"),await u.get(d).then(({data:N})=>{x(N),p("dynamicForms")}).catch(()=>p("dynamicForms"))},[u,m,p,d]);return c.useEffect(()=>{!f&&j()},[j,f]),[...g,...b].length>0?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-auto list-group forms-items overflow-x-hidden",children:[g.length>0?t.jsxs(t.Fragment,{children:[g.map(N=>t.jsx(xs,{item:N,fullSize:l??!1,appDetail:i,search:h,activeId:e},N.id)),t.jsx("hr",{className:"mb-0"})]}):null,v.map(N=>t.jsx(ut,{title:N.name,defaultOpen:!0,children:N.items.map(S=>t.jsx(xs,{item:S,fullSize:l??!1,appDetail:i,search:h,activeId:e},S.id))},N.id))]})}):null},Kd=({label:e,to:n,value:a})=>t.jsxs(s.RowLabelInput,{label:e,children:[t.jsx("input",{disabled:!0,className:"form-control d-none"}),n?t.jsx(Z.Link,{to:n,className:"border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:a}):t.jsx("div",{className:"luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:a})]}),Qd=()=>{const{localizationContext:e}=c.useContext(s.LuminusComponentsContext),{language:n,setLanguage:a}=c.useContext(e),r=o=>{a(o)};return t.jsx(s.DropdownItem,{onClick:o=>{r(n==="cz"?"en":n==="en"?"de":"cz"),o.stopPropagation()},children:n==="cz"?t.jsxs(t.Fragment,{children:[t.jsx("strong",{className:"fw-bold",children:"CZ"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"EN"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"DE"})]}):n==="en"?t.jsxs(t.Fragment,{children:[t.jsx("strong",{className:"fw-bold",children:"EN"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"DE"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"CZ"})]}):t.jsxs(t.Fragment,{children:[t.jsx("strong",{className:"fw-bold",children:"DE"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"CZ"}),t.jsx(s.MdArrowRight,{}),t.jsx("span",{children:"EN"})]})})},Zd=({controlId:e,...n})=>t.jsx(s.Form.Group,{controlId:e,...n}),Xd=({employeeId:e,alt:n,noPhotoImage:a,cafmApiUrl:r,showLargeInLightBox:o=!1})=>{const{user:l}=c.useContext(s.UserContext),{photoPath:i,photoPathSm:d}=Le.useEmployeePhotoPath(e);return t.jsx(t.Fragment,{children:e&&t.jsx(t.Fragment,{children:o?t.jsx(ka,{baseUrl:r,customToken:l.cafmToken??void 0,photos:[{id:e.toString(),alt:n??"",isDefault:!0,smSrc:d,lgSrc:i}],placeholder:a,ImgComponent:tn}):t.jsx(tn,{baseUrl:r,customToken:l.cafmToken??void 0,src:d,alt:n,placeholder:a,className:"rounded w-100"})})})},Jd=({text:e,setText:n,onSearchButtonClick:a,className:r})=>{const o=l=>{n(l)};return t.jsxs(Nt,{className:`${r}`,children:[t.jsx(s.Form.Control,{value:e,onChange:l=>n(l.target.value)}),e&&t.jsx(s.Button,{onClick:()=>o(""),variant:"link",className:"border text-muted",children:t.jsx(s.MdClear,{})}),t.jsx(s.Button,{onClick:()=>a&&a(e),variant:"link",className:"border",children:t.jsx(s.MdSearch,{})})]})},eu=({value:e,numberPrefix:n,numberSuffix:a,decimalScale:r=2,fixedDecimalScale:o=!1,className:l})=>t.jsx(dn,{value:e,displayType:"text",thousandSeparator:" ",decimalScale:r,fixedDecimalScale:o,defaultValue:"",prefix:n,suffix:a,className:l,decimalSeparator:","}),tu=({data:e,keys:n,colors:a,tooltipLabel:r})=>t.jsx(s.Xe,{data:e.map(o=>({name:o.name,...o.values})),indexBy:"name",keys:n,margin:{top:20,right:50,bottom:30,left:150},layout:"horizontal",colors:a,padding:.2,borderRadius:2,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0},labelSkipWidth:12,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltipLabel:r}),nu="_hrText_xxish_1",su={hrText:nu},Oa=({text:e})=>t.jsx("hr",{className:s.classNames(su.hrText),"data-content":e}),au="_cards-group_1gvpy_1",ru="_group-title_1gvpy_1",ou="_group-content_1gvpy_8",iu="_report-card_1gvpy_12",lu="_card-title-link_1gvpy_22",Ye={cardsGroup:au,groupTitle:ru,groupContent:ou,reportCard:iu,cardTitleLink:lu},cu=({reportsLastUsedGet:e,getReportRoute:n,getReportName:a})=>{const{texts:{reports:r}}=c.useContext(s.LuminusComponentsContext),{data:o}=de.useGetApiData(e);return t.jsx(t.Fragment,{children:t.jsx(ut,{defaultOpen:!0,title:r.index.lastUsedReports,children:t.jsx(s.ListGroup,{children:o&&o.map(l=>l.versions.map(i=>t.jsxs(s.ListGroupItem,{as:Z.Link,to:n(l,i.id),className:"p-1 px-2",action:!0,children:[t.jsx(s.Typography,{variant:"body2",className:"text-uppercase",children:a(l)}),t.jsxs(s.Typography,{variant:"caption",className:"d-flex justify-content-between align-items-center gap-3 text-dark",children:[i.name,t.jsx(s.Typography,{variant:"caption",className:"text-end opacity-50",children:s.formatDate(i.lastUsedDate)})]})]})))})})})},vs=({reportVersion:e,getReportRoute:n,report:a})=>t.jsx(s.ListGroupItem,{as:Z.Link,to:n(a,e.id),className:"p-1 px-2",action:!0,children:t.jsx(s.Typography,{variant:"body2",className:"d-flex justify-content-between align-items-center gap-3",children:t.jsx("div",{className:"link",children:e.name})})}),Ct=5,ys=({versionsList:e,getReportRoute:n,report:a})=>{const{ProjectIconComponent:r}=c.useContext(s.LuminusComponentsContext),[o,l]=c.useState(!0),i=c.useMemo(()=>e.length<=Ct?e:e.slice(0,Ct-1),[e]),d=c.useMemo(()=>e.length<=Ct?[]:e.slice(Ct-1),[e]);return t.jsx(t.Fragment,{children:t.jsxs(s.ListGroup,{children:[i.map(u=>t.jsx(vs,{reportVersion:u,getReportRoute:n,report:a})),o?null:d.map(u=>t.jsx(vs,{reportVersion:u,getReportRoute:n,report:a})),d.length>0&&t.jsx(s.ListGroupItem,{onClick:()=>l(u=>!u),className:"py-0 d-flex justify-content-center",children:o?t.jsx(r,{icon:"chevron-down"}):t.jsx(r,{icon:"chevron-up"})})]})})},du=({report:e,getReportRoute:n,getReportName:a,getReportDescription:r})=>{const o=c.useMemo(()=>e.versionsCustom.length===0?{xs:12}:{xs:12,sm:6,md:12,lg:12,xl:12,xxl:6},[e.versionsCustom.length]);return t.jsx("div",{className:"col-12 col-lg-4",children:t.jsxs(Re,{title:t.jsx(Z.Link,{to:n(e),className:s.classNames(Ye.cardTitleLink,"w-100 text-uppercase fw-normal"),children:a(e)}),headerClassName:"bg-darker",className:s.classNames(Ye.reportCard,"shadow h-100 d-flex flex-column"),contentClassName:"d-flex flex-column gap-2 h-100",children:[t.jsx(s.Typography,{variant:"body2",className:"px-2",children:r(e)}),t.jsxs(on,{className:"h-100 g-2",children:[e.versions&&e.versions.length>0?t.jsx(s.Col,{...o,children:t.jsx(ys,{versionsList:e.versions,getReportRoute:n,report:e})}):null,e.versionsCustom&&e.versionsCustom.length>0?t.jsx(s.Col,{...o,children:t.jsx(ys,{versionsList:e.versionsCustom,getReportRoute:n,report:e})}):null]})]})},e.id)},Wt={reportsGet:"/reports",reportsLastUsedGet:"/reports/last-used"},uu=({groups:e,apiUrls:{reportsGet:n=Wt.reportsGet,reportsLastUsedGet:a=Wt.reportsLastUsedGet}=Wt,getReportName:r,getReportDescription:o,getGroupTitle:l,getReportRoute:i})=>{const{texts:{reports:d}}=c.useContext(s.LuminusComponentsContext),[u,m]=c.useState(""),[p]=s.a(u,500),f=c.useCallback(v=>v.map(j=>({...j,groupId:!j.groupId||j.groupId===0||!e.some(N=>N===j.groupId)?999:j.groupId})),[e]),{data:x}=de.useGetApiData(n,{dataTransformer:f}),h=c.useMemo(()=>{if(x===null)return{};const v={};return e.forEach(j=>{v[j]=x.filter(N=>N.groupId===j&&(s.stringSearchWithin(r(N),p)||s.stringSearchWithin(o(N),p)||N.versions.some(S=>s.stringSearchWithin(S.name,p))||N.versionsCustom.some(S=>s.stringSearchWithin(S.name,p))))}),v},[p,e,x,o,r]),g=c.useMemo(()=>e.filter(v=>{var j;return((j=h[v])==null?void 0:j.length)>0}),[h,e]),{isMobile:b}=s.useWindowSize();return t.jsxs(s.PageContainer,{unavailableOnMobile:!0,variant:"fullScreen",sideContent:t.jsx(t.Fragment,{children:t.jsx(cu,{reportsLastUsedGet:a,getReportName:r,getReportRoute:i})}),children:[t.jsx("div",{children:t.jsx(s.Form.Control,{className:"mb-3",type:"search",value:u,onChange:v=>{var j;return m(((j=v.target)==null?void 0:j.value)??"")},placeholder:d.index.search})}),t.jsx("div",{className:"overflow-x-hidden luminus-thin-scrollbar luminus-reports-index",children:g.map(v=>t.jsxs("div",{className:s.classNames(Ye.cardsGroup,{[Ye.mobile]:b}),children:[t.jsx("div",{className:s.classNames("group-title z-1",Ye.groupTitle),children:t.jsx(Oa,{text:l(v)})}),t.jsx("div",{className:s.classNames(Ye.groupContent),children:t.jsx("div",{className:s.classNames("row gx-3 gy-3"),children:h[v].map(j=>t.jsx(du,{report:j,getReportRoute:i,getReportName:r,getReportDescription:o}))})})]},v))})]})},mu="_mini-detail-popover_obryf_1",pu="_sm_obryf_5",fu="_lg_obryf_9",js={"mini-detail-popover":"_mini-detail-popover_obryf_1",miniDetailPopover:mu,sm:pu,lg:fu},hu=({children:e,useMiniDetail:n,miniDetailProps:a,placement:r="bottom",trigger:o=["hover"],delayMs:l=500})=>{const{user:i}=c.useContext(s.UserContext),[d,u]=c.useState(!1),{isLoading:m,detail:p,heading:f,tooltipWidth:x}=n({...a,enabled:d&&!(i!=null&&i.external)}),h=c.useRef(null);return t.jsx("div",{onMouseEnter:()=>{h.current=window.setTimeout(()=>u(!0),l)},onMouseLeave:()=>{h.current&&clearTimeout(h.current),u(!1)},children:d&&!(i!=null&&i.external)?t.jsx(s.HtmlTooltip,{heading:m?t.jsx(s.Typography,{variant:"body2",className:"placeholder-glow",children:t.jsx("span",{className:"placeholder bg-primary col-6"})}):f,content:t.jsx(t.Fragment,{children:m?t.jsxs(s.Typography,{variant:"body2",className:"placeholder-glow",children:[t.jsxs("div",{className:"d-flex justify-content-between py-1",children:[t.jsx("span",{className:"placeholder col-5"}),t.jsx("span",{className:"placeholder col-4"})]}),t.jsxs("div",{className:"d-flex justify-content-between py-1",children:[t.jsx("span",{className:"placeholder col-3"}),t.jsx("span",{className:"placeholder col-2"})]}),t.jsxs("div",{className:"d-flex justify-content-between py-1",children:[t.jsx("span",{className:"placeholder col-4"}),t.jsx("span",{className:"placeholder col-6"})]}),t.jsxs("div",{className:"d-flex justify-content-between py-1",children:[t.jsx("span",{className:"placeholder col-4"}),t.jsx("span",{className:"placeholder col-3"})]}),t.jsxs("div",{className:"d-flex justify-content-between py-1",children:[t.jsx("span",{className:"placeholder col-5"}),t.jsx("span",{className:"placeholder col-4"})]})]}):p}),placement:r,trigger:o,popoverClassName:s.classNames(js.miniDetailPopover,js[x]),children:t.jsx("div",{children:e})}):t.jsx(t.Fragment,{children:e})})},gu=({label:e,value:n})=>t.jsxs("div",{className:"py-1 border-bottom d-flex gap-3 align-items-center justify-content-between",children:[t.jsx(s.Typography,{variant:"caption",children:e}),t.jsx(s.Typography,{variant:"body2",className:"text-end",children:n??"-"})]}),xu=({route:e,variant:n="link",children:a,className:r,disabled:o=!1,routeParams:l})=>{const{checkUserHasPermissions:i}=s.usePermissions(),d=c.useMemo(()=>o||!(e.permissions===void 0||i(e.permissions)),[i,o,e.permissions]),u=a??e.name,m=c.useMemo(()=>{switch(n){case"primaryButton":return s.PrimaryButton;case"contextButton":return s.ContextButton;case"iconButton":return s.IconButton;default:return c.Fragment}},[n]);return n==="link"?t.jsx(Z.Link,{to:ye.generateApiPath(e.route,l),className:s.classNames("link font-size-14",d?"disabled":void 0,r),children:u}):t.jsx(m,{as:"link",href:ye.generateApiPath(e.route,l),className:s.classNames(d?"disabled":void 0,r),children:u})},vu=({id:e,getTimelineApiPath:n})=>{var i;const{texts:{approval:a},ProjectIconComponent:r}=c.useContext(s.LuminusComponentsContext),{data:o}=de.useGetApiData(n(e)),l=c.useCallback((d,u=!1)=>{switch(d){case s.ApprovalState.Zamitnuto:return t.jsx(s.SimpleTooltip,{placement:"left",text:a.stateRejected,children:t.jsx("div",{children:t.jsx(r,{icon:"cancel-simple",className:u?"text-danger":"bg-danger rounded-circle p-1",iconProps:{fontSize:"14px",color:u?void 0:"white"}})})});case s.ApprovalState.Nevyrizeno:return t.jsx(s.SimpleTooltip,{placement:"left",text:a.stateUnrealized,children:t.jsx("div",{children:t.jsx(r,{icon:"pending",className:u?"text-secondary":"bg-secondary rounded-circle p-1",iconProps:{fontSize:"14px",color:u?void 0:"white"}})})});case s.ApprovalState.Odebrano:return t.jsx(s.SimpleTooltip,{placement:"left",text:a.stateRemoved,children:t.jsx("div",{children:t.jsx(r,{icon:"cancel-simple",className:u?"text-warning":"bg-warning rounded-circle p-1",iconProps:{fontSize:"14px",color:u?void 0:"white"}})})});case s.ApprovalState.Schvaleno:return t.jsx(s.SimpleTooltip,{placement:"left",text:a.stateApproved,children:t.jsx("div",{children:t.jsx(r,{icon:"check-simple",className:u?"text-success":"bg-success rounded-circle p-1",iconProps:{fontSize:"14px",color:u?void 0:"white"}})})});default:return null}},[a,r]);return t.jsx("div",{children:t.jsx(La,{dontSort:!0,steps:[o!=null&&o.startDate?{date:s.parseISO(o.startDate),title:t.jsx(s.Typography,{variant:"body2",children:a.startDate}),dateFormat:"date"}:null,...((i=o==null?void 0:o.approvalLevels)==null?void 0:i.map(d=>{var u;return{date:void 0,title:t.jsxs("div",{className:"d-flex align-items-center justify-content-between w-100",children:[t.jsx(s.Typography,{variant:"body",className:"fw-bold",children:a.getLevelText(d.index)}),t.jsx(s.Typography,{variant:"caption",className:"text-end",children:a.getThresholdText(d.threshold)})]}),icon:l(d.state),text:d.approvers&&((u=d.approvers)==null?void 0:u.length)>0?t.jsx("div",{className:"list-group",children:d.approvers.map(m=>t.jsx("div",{className:"list-group-item p-1",children:t.jsxs("div",{className:"d-flex justify-content-between align-items-center gap-2",children:[m.automaticApproval?t.jsx(s.SimpleTooltip,{placement:"left",text:a.autoApproved,children:t.jsx("div",{children:t.jsx("div",{className:"text-success",style:{fontSize:"14px"},children:"A"})})}):l(m.state,!0),t.jsxs("div",{className:"text-end",children:[t.jsx(s.Typography,{variant:"body2",children:m.delegatedApprover?m.delegatedApprover.name:m.approver.name}),m.responseDate?t.jsx(s.Typography,{variant:"caption",children:s.formatDate(m.responseDate)}):null]})]})},m.id))}):null}}))??[],o!=null&&o.finishedDate?{date:s.parseISO(o.finishedDate),title:t.jsx(s.Typography,{variant:"body2",children:a.finishedDate}),dateFormat:"date"}:null].filter(d=>d!==null).map(d=>d)})})},yu="_state-switch_uc6su_1",ju="_switch-button_uc6su_7",bu="_bg-layer_uc6su_17",Cu="_text-layer_uc6su_26",Nu="_left_uc6su_38",wu="_right_uc6su_41",Su="_active_uc6su_44",Ie={stateSwitch:yu,switchButton:ju,bgLayer:bu,textLayer:Cu,left:Nu,right:wu,active:Su},Iu=({isLeftStateActive:e,toggleState:n,leftStateLabel:a,rightStateLabel:r})=>t.jsxs("div",{role:"button",className:s.classNames("gap-1",Ie.stateSwitch),onClick:n,children:[t.jsxs(s.Typography,{variant:"body2",className:s.classNames(Ie.switchButton,Ie.left,{[Ie.active]:e}),children:[t.jsx("div",{className:Ie.bgLayer}),t.jsx("div",{className:Ie.textLayer,children:a})]}),t.jsxs(s.Typography,{variant:"body2",className:s.classNames(Ie.switchButton,Ie.right,{[Ie.active]:!e}),children:[t.jsx("div",{className:Ie.bgLayer}),t.jsx("div",{className:Ie.textLayer,children:r})]})]}),ku=({showArchived:e,BnfTableComponent:n,tableIdentifier:a,detailRoute:r})=>{const{texts:{substitutions:o}}=c.useContext(s.LuminusComponentsContext),{data:l}=de.useGetApiData(`/permissions/substitutions?archived=${e}`),i=c.useMemo(()=>({enable:!0,column:"archived"}),[]),d=s.u(),u=c.useMemo(()=>[d.accessor("employeeName",{header:o.index.employeeName,type:"string",mobileMeta:{isIdentifier:!0}}),d.accessor("substituteName",{header:o.index.substitute,type:"string",mobileMeta:{isIdentifier:!0}}),d.accessor("from",{header:o.index.from,type:"date",mobileMeta:{displayGroup:o.index.generalInfo}}),d.accessor("to",{header:o.index.to,type:"date",mobileMeta:{displayGroup:o.index.generalInfo}}),d.accessor("archived",{header:"Archived",type:"boolean",meta:{hidden:!0}}),d.accessor("id",{header:"",type:"number",meta:{hidden:!0},size:50})],[o,d]),m=c.useCallback(p=>Z.generatePath(r,{id:p.id.toString()}),[r]);return t.jsx(n,{data:l??[],columns:u,tableId:a,pagination:{mode:"enabled"},archiveHighlighting:i,rowNavigation:m})},Du=(e,n)=>{const a=s.useAxios(),r=Z.useNavigate(),{startLoading:o,stopLoading:l}=c.useContext(s.LoadingContext),{zDateRequired:i,zNumberRequired:d}=s.useZodSchemaTypes(),{addNotification:u}=s.useNotifications(),{refreshAvailableDelegations:m}=c.useContext(s.DelegationContext),{user:p}=c.useContext(s.UserContext),{texts:{substitutions:{detail:f}}}=c.useContext(s.LuminusComponentsContext),x=s.objectType({id:d(),employeeId:d(),substituteId:d(),from:i(),to:i(),roles:s.arrayType(s.stringType())}),h=c.useMemo(()=>({id:(e==null?void 0:e.id)??0,employeeId:(e==null?void 0:e.employeeId)??(p==null?void 0:p.personalNumber)??void 0,substituteId:(e==null?void 0:e.substituteId)??void 0,from:(e==null?void 0:e.from)??s.format(new Date,"yyyy-MM-dd"),to:(e==null?void 0:e.to)??s.format(new Date,"yyyy-MM-dd"),roles:(e==null?void 0:e.roles)??[]}),[e==null?void 0:e.employeeId,e==null?void 0:e.from,e==null?void 0:e.id,e==null?void 0:e.roles,e==null?void 0:e.substituteId,e==null?void 0:e.to,p==null?void 0:p.personalNumber]),g=oe.useForm({resolver:s.t(x),defaultValues:h}),b=c.useCallback(async v=>{o("premissions-substitute-submit");try{await a.post("permissions/substitutions",v),u(f.updateSuccess,"success"),m(),r(n)}catch(j){s.hookFormSetServerErrors(g,j)}finally{l("premissions-substitute-submit")}},[u,a,g,r,m,o,l,n,f]);return c.useEffect(()=>{g.reset(h)},[h,g]),{formSchema:x,onSubmit:b,formMethods:g}},Tu=({indexRoute:e})=>{var C;const{id:n}=Z.useParams(),{user:a}=c.useContext(s.UserContext),r=s.useAxios(),o=Z.useNavigate(),{confirm:l}=s.useConfirm(),{texts:{substitutions:{detail:i}}}=c.useContext(s.LuminusComponentsContext),{data:d}=de.useGetApiData(`/permissions/substitutions/${n}`,{enabled:n!==void 0}),{data:u}=de.useGetApiData("/permissions/users"),{onSubmit:m,formMethods:p}=Du(d,e),f=p.watch("employeeId"),{data:x}=de.useGetApiData(`/permissions/roles?userName=${(C=u==null?void 0:u.find(y=>y.employeeId===f))==null?void 0:C.name}`,{enabled:f>0&&!!u}),{refreshAvailableDelegations:h}=c.useContext(s.DelegationContext),{checkUserHasPermissions:g}=s.usePermissions(),b=c.useCallback(async()=>{await l(i.deleteConfirm)&&(await r.delete(`/permissions/substitutions/${n}`),h(),o(e))},[r,l,n,o,h,i,e]),v=c.useMemo(()=>f!==(a==null?void 0:a.personalNumber)&&!g(["ZASTUP_MODIFY"]),[g,f,a==null?void 0:a.personalNumber]),j=p.watch("roles"),N=c.useMemo(()=>x==null?void 0:x.filter(y=>y.canBeRepresented),[x]),S=c.useMemo(()=>(N==null?void 0:N.every(y=>j==null?void 0:j.includes(y.name)))??!1,[N,j]);return t.jsx(s.PageContainer,{title:t.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.jsx(s.Typography,{variant:"h3",children:i.title}),t.jsx(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle}),children:t.jsx(s.DropdownItem,{onClick:()=>b(),children:i.delete})})]}),children:t.jsx(oe.FormProvider,{...p,children:t.jsx(ve.FormDisabledProvider,{disabled:v,children:t.jsxs(s.Form,{onSubmit:p.handleSubmit(m),className:"h-100",children:[t.jsxs(on,{className:"h-100 gx-3 gy-3",children:[t.jsx(s.Col,{sm:12,md:4,children:t.jsxs(Re,{title:i.title,children:[t.jsx(It,{formField:"employeeId",options:(u==null?void 0:u.map(y=>({id:y.employeeId,name:`${y.employeeName} (${y.name})`})))??[],label:i.employee,isNumber:!0,required:!0,disabled:!g(["ZASTUP_MODIFY"]),resetsFields:["roles"]}),t.jsx(It,{formField:"substituteId",options:(u==null?void 0:u.map(y=>({id:y.employeeId,name:`${y.employeeName} (${y.name})`})))??[],label:i.substitute,isNumber:!0,required:!0}),t.jsx(s.HookFormTextInput,{formField:"from",label:i.from,type:"date",required:!0}),t.jsx(s.HookFormTextInput,{formField:"to",label:i.to,type:"date",required:!0})]})}),t.jsx(s.Col,{sm:12,md:4,children:t.jsxs(Re,{title:i.roles(`${(j==null?void 0:j.length)??0}/${(N==null?void 0:N.length)??0}`),className:"h-max-100",contentClassName:"d-flex flex-column overflow-hidden",children:[v?null:t.jsx("div",{className:"bg-darker",style:{marginLeft:"-12px",marginRight:"-12px",marginTop:"-12px",padding:"0px 12px"},children:t.jsx(Ze,{label:S?i.uncheckAllRoles:i.checkAllRoles,indeterminate:!S&&(j==null?void 0:j.length)>0,value:S,disabled:v,onChange:()=>{p.setValue("roles",S?[]:(N==null?void 0:N.map(y=>y.name))??[],{shouldDirty:!0})},InputContainer:s.RowLabelInput})}),t.jsx("div",{className:"overflow-auto",style:{maxHeight:"60vh",marginLeft:"-12px",marginRight:"-12px",padding:"0px 12px"},children:x==null?void 0:x.map(y=>t.jsx(Ze,{label:y.name,value:(j==null?void 0:j.find(k=>k===y.name))!==void 0,disabled:v||!y.canBeRepresented,onChange:k=>{p.setValue("roles",k?[...j??[],y.name]:(j==null?void 0:j.filter(w=>w!==y.name))??[],{shouldDirty:!0})},InputContainer:s.RowLabelInput},y.name))})]})})]}),t.jsx(sa,{onStorno:()=>p.reset(),children:i.save})]})})})})},_u=({BnfTableComponent:e,items:n,onEditItem:a,tableIdentifier:r})=>{const{texts:{approval:o}}=c.useContext(s.LuminusComponentsContext),l=c.useMemo(()=>n.map(m=>({...m,archive:!!(m.dateTo&&s.isPast(s.parseISO(m.dateTo)))})),[n]),i=s.u(),d=c.useMemo(()=>[i.accessor("id",{header:"Id",type:"number",meta:{filterVariant:"none",hidden:!0}}),i.accessor("approval.name",{header:o.delegations.table.approval,type:"string",meta:{filterVariant:"select"},mobileMeta:{isIdentifier:!0}}),i.accessor("employee.name",{header:o.delegations.table.employee,type:"string",mobileMeta:{isIdentifier:!0}}),i.accessor("delegate.name",{header:o.delegations.table.delegate,type:"string",mobileMeta:{isIdentifier:!0}}),i.accessor("dateFrom",{header:o.delegations.table.dateFrom,type:"date",mobileMeta:{displayGroup:o.delegations.table.dateGroup}}),i.accessor("dateTo",{header:o.delegations.table.dateTo,type:"date",mobileMeta:{displayGroup:o.delegations.table.dateGroup}}),i.accessor("archive",{header:"",type:"boolean",meta:{hidden:!0}})],[o,i]),u=c.useCallback(m=>{a(n.find(p=>p.id===m.id))},[n,a]);return t.jsx(e,{tableId:r,columns:d,data:l,onRowClick:u})},Lu=(e,n="/approval/delegation/runningProcess",a="/approval/delegation",r=o=>`/approval/delegation/${o}`)=>{const o=s.useAxios(),{startLoading:l,stopLoading:i}=c.useContext(s.LoadingContext),d=c.useCallback(async(p,f)=>{let x=null;l("getHasRunningProcesses");try{x=(await o.get(`${n}?employeeId=${p}&approvalId=${f}`)).data}finally{i("getHasRunningProcesses")}return x},[o,l,i,n]),u=c.useCallback(async(p,f)=>(l("approvalDelegationPost"),o.post(a,p).then(()=>!0).catch(x=>(s.hookFormSetServerErrors(f,x),!1)).finally(()=>i("approvalDelegationPost"))),[o,l,i,a]),m=c.useCallback(async()=>e!=null&&e.id?(l("approvalDelegationDelete"),o.delete(r(e.id)).then(()=>!0).catch(()=>!1).finally(()=>i("approvalDelegationDelete"))):!1,[o,e,l,i,r]);return{getHasRunningProcesses:d,postEditDelegation:u,postDeleteDelegation:m}},Eu=({model:e,handleClose:n,onConfirm:a,apiApprovalDefinitions:r,apiHasRunningProcess:o,apiPostEditDelegation:l,apiDeleteDelegation:i,EmployeePickerComponent:d})=>{var w,I;const{ProjectIconComponent:u,texts:{approval:m}}=c.useContext(s.LuminusComponentsContext),{zDate:p,zObjectIdIntRequired:f,zDateRequired:x}=s.useZodSchemaTypes(),{addNotification:h}=s.useNotifications(),{confirm:g}=s.useConfirm(),{data:b}=de.useGetApiData(r),v=s.objectType({employee:f(),delegate:f(),dateFrom:x(),dateTo:p(),approval:f()}),j=oe.useForm({resolver:s.t(v)}),{getHasRunningProcesses:N,postEditDelegation:S,postDeleteDelegation:C}=Lu(e,o,l,i);c.useEffect(()=>{var E,D,M,F,_,L;e&&(j.reset({...e,employee:{id:((E=e.employee)==null?void 0:E.id)??0},delegate:{id:((D=e.delegate)==null?void 0:D.id)??0},dateFrom:e.dateFrom??"",approval:{id:((M=e.approval)==null?void 0:M.id)??0}},{keepDirty:!1}),(F=e.employee)!=null&&F.id||ye.hookFormSetNull(j,"employee.id"),(_=e.delegate)!=null&&_.id||ye.hookFormSetNull(j,"delegate.id"),(L=e.approval)!=null&&L.id||ye.hookFormSetNull(j,"approval.id"))},[e,j]);const y=async E=>{if(!e)return;const D={...e};Object.assign(D,E),s.fixNameIdNulls(D);const M=await N(D.employee.id,D.approval.id);D.includeExisting=M&&!!await g(m.delegations.delegateExistingsConfirmMessage),await S(D,j)&&(h(e.id?m.delegations.editSuccess:m.delegations.createSuccess,"success"),a())},k=c.useCallback(async()=>{await g(m.delegations.deleteConfirm)&&await C()&&(h(m.delegations.deleteSuccess,"success"),a())},[g,m,C,h,a]);return t.jsxs(s.Modal,{show:e!==null,onHide:()=>n(),children:[t.jsxs(s.Modal.Header,{closeButton:!0,children:[t.jsx(s.Modal.Title,{className:"w-100",children:e!=null&&e.id?m.delegations.detailTitle:m.delegations.newTitle}),e!=null&&e.id?t.jsx(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle}),className:"modalHeaderDropdown",children:t.jsx(s.DropdownItem,{color:"danger",icon:t.jsx(u,{icon:"delete"}),onClick:k,children:m.delegations.delete})}):null]}),t.jsx(oe.FormProvider,{...j,children:t.jsxs(s.Form,{onSubmit:j.handleSubmit(y),noValidate:!0,children:[t.jsxs(s.Modal.Body,{children:[t.jsx(It,{label:m.delegations.detail.approval,isNumber:!0,formField:"approval.id",options:b??[],required:!0}),t.jsx(d,{label:m.delegations.detail.employee,formField:"employee.id",defaultSelection:(w=e==null?void 0:e.employee)!=null&&w.id?{id:e.employee.id,name:e.employee.name}:null,required:!0}),t.jsx(d,{label:m.delegations.detail.delegate,formField:"delegate.id",defaultSelection:(I=e==null?void 0:e.delegate)!=null&&I.id?{id:e.delegate.id,name:e.delegate.name}:null,required:!0}),t.jsx(s.HookFormTextInput,{label:m.delegations.detail.dateFrom,formField:"dateFrom",type:"date",required:!0}),t.jsx(s.HookFormTextInput,{label:m.delegations.detail.dateTo,formField:"dateTo",type:"date"})]}),t.jsx(s.Modal.Footer,{className:"justify-content-end",children:t.jsx(s.PrimaryButton,{type:"submit",children:e!=null&&e.id?m.delegations.save:m.delegations.create})})]})})]})},Ge={apiApprovalDelegations:"/approval/delegation",apiHasRunningProcess:"/approval/delegation/runningProcess",apiPostEditDelegation:"/approval/delegation",apiDeleteDelegation:e=>`/approval/delegation/${e}`,apiApprovalDefinitions:"/approval/definition"},Mu=({apiUrls:{apiApprovalDelegations:e=Ge.apiApprovalDelegations,apiHasRunningProcess:n=Ge.apiHasRunningProcess,apiPostEditDelegation:a=Ge.apiPostEditDelegation,apiDeleteDelegation:r=Ge.apiDeleteDelegation,apiApprovalDefinitions:o=Ge.apiApprovalDefinitions}=Ge,BnfTableComponent:l,tableIdentifier:i,EmployeePickerComponent:d})=>{const{texts:{approval:u}}=c.useContext(s.LuminusComponentsContext),[m,p]=Le.useSearchQueryState("archive",!1),[f,x]=c.useState(null),{data:h,reloadData:g}=de.useGetApiData(`${e}?archive=${m}`);return t.jsxs(s.PageContainer,{variant:"fullScreen",title:t.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.jsx(s.Typography,{variant:"h3",children:u.delegations.title}),t.jsxs(s.Dropdown,{toggle:t.jsx(s.DropdownToggle,{as:s.SimpleDropdownToggle}),children:[t.jsx(s.DropdownItem,{onClick:()=>x({id:null,employee:null,delegate:null,dateFrom:null,dateTo:null,approval:null,includeExisting:null}),children:u.delegations.createDelegation}),t.jsx(s.DropdownDivider,{}),t.jsx(s.DropdownItem,{onClick:()=>p(!m),children:m?u.delegations.hideArchived:u.delegations.showArchived})]})]}),children:[h?t.jsx(_u,{items:h,onEditItem:x,BnfTableComponent:l,tableIdentifier:i}):null,t.jsx(Eu,{model:f,handleClose:()=>x(null),onConfirm:()=>{x(null),g()},EmployeePickerComponent:d,apiApprovalDefinitions:o,apiHasRunningProcess:n,apiPostEditDelegation:a,apiDeleteDelegation:r})]})},Fu=({show:e,handleClose:n,onConfirm:a,currentEmployee:r,approvalApproverId:o,apiPostChangeEmployee:l,EmployeePickerComponent:i})=>{const{texts:{approval:d}}=c.useContext(s.LuminusComponentsContext),{zNumberRequired:u}=s.useZodSchemaTypes(),m=s.useAxios(),{startLoading:p,stopLoading:f}=c.useContext(s.LoadingContext),{addNotification:x}=s.useNotifications(),h=s.z.object({employeeId:u()}),g=oe.useForm({resolver:s.t(h)});c.useEffect(()=>{e&&(g.reset({employeeId:r==null?void 0:r.id}),!(r!=null&&r.id)&&ye.hookFormSetNull(g,"employeeId"))},[e,r,g]);const b=c.useCallback(async j=>(p("approvalChangeEmployee"),m.post(l,{id:o,employeeId:j}).then(()=>!0).catch(N=>(s.hookFormSetServerErrors(g,N),!1)).finally(()=>f("approvalChangeEmployee"))),[m,o,g,p,f,l]),v=async j=>{await b(j.employeeId)&&(x(d.definitions.changeEmployeeSuccess,"success"),a())};return t.jsxs(s.Modal,{show:e,onHide:()=>n(),children:[t.jsx(s.Modal.Header,{closeButton:!0,children:t.jsx(s.Modal.Title,{children:d.definitions.changeEmployeeTitle})}),t.jsx(oe.FormProvider,{...g,children:t.jsxs(s.Form,{onSubmit:g.handleSubmit(v),noValidate:!0,children:[t.jsx(s.Modal.Body,{children:t.jsx(i,{formField:"employeeId",defaultSelection:r,label:d.definitions.changeEmployeeNewEmployee,required:!0})}),t.jsx(s.Modal.Footer,{className:"d-flex justify-content-end",children:t.jsx(s.PrimaryButton,{type:"submit",children:d.definitions.changeEmployeeConfirm})})]})})]})},Ou=({level:e,reloadApproval:n,appEmployeeDetail:a,apiPostChangeEmployee:r,EmployeePickerComponent:o})=>{var m;const{ProjectIconComponent:l,texts:{approval:i}}=c.useContext(s.LuminusComponentsContext),[d,u]=c.useState(null);return t.jsxs("div",{className:"bg-white rounded p-2 px-3 d-flex flex-column gap-2 shadow-sm",children:[t.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[t.jsx(s.Typography,{variant:"body",children:i.definitions.nthLevel(e.index+1)}),t.jsx(s.Typography,{variant:"body2",children:i.definitions.levelThresholdInfo(e.threshold)})]}),e.approvers&&e.approvers.length>0?t.jsx("div",{className:"list-group",children:(m=e.approvers)==null?void 0:m.map(p=>t.jsxs("div",{className:"list-group-item ms-3 p-1 px-2 d-flex align-items-center justify-content-between gap-5",children:[t.jsxs(s.Typography,{variant:"body2",className:"d-flex align-items-center justify-content-between gap-2",children:[p.employeeId?t.jsxs(t.Fragment,{children:[t.jsx(l,{icon:"user"}),t.jsx(s.IconButton,{size:"sm",onClick:()=>u({id:p.id,employee:{id:p.employeeId??0,name:p.employeeName}}),children:t.jsx(l,{icon:"edit"})}),t.jsx(Z.Link,{to:a(p.employeeId),className:"link",children:p.employeeName})]}):null,p.role?t.jsxs(t.Fragment,{children:[t.jsx(l,{icon:"role"})," ",t.jsx("span",{className:"fw-bold text-uppercase",children:p.role})]}):null]}),t.jsx(s.Typography,{variant:"body2",children:i.definitions.approverThresholdInfo(e.threshold,p.scale)})]}))}):null,t.jsx(Fu,{approvalApproverId:(d==null?void 0:d.id)??0,currentEmployee:(d==null?void 0:d.employee)??null,show:d!==null,handleClose:()=>u(null),onConfirm:()=>{u(null),n()},apiPostChangeEmployee:r,EmployeePickerComponent:o})]})},Au=({approval:e,apiApprovalDelegations:n,appEmployeeDetail:a})=>{const{ProjectIconComponent:r,texts:{approval:o}}=c.useContext(s.LuminusComponentsContext),{data:l}=de.useGetApiData(n),i=c.useMemo(()=>l?l.filter(d=>{var u;return((u=d.approval)==null?void 0:u.id)===e.id}):null,[l,e]);return t.jsxs("div",{className:"bg-white rounded border p-2 px-3 d-flex flex-column gap-2 overflow-hidden h-max-100",children:[t.jsx(s.Typography,{variant:"body",children:o.delegations.title}),t.jsx("div",{className:"overflow-auto h-100",children:i&&i.length>0?t.jsx("div",{className:"list-group",children:i.map(d=>{var u,m,p,f;return t.jsxs("div",{className:"list-group-item p-2 px-3",children:[t.jsxs(s.Typography,{variant:"body2",className:"row g-0",children:[t.jsx("div",{className:"col-5 d-flex align-items-center",children:t.jsx(Z.Link,{to:a(((u=d.employee)==null?void 0:u.id)??0),className:"link text-decoration-line-through link-secondary",children:((m=d.employee)==null?void 0:m.name)??"-"})}),t.jsx("div",{className:"col-2 text-center d-flex align-items-center justify-content-center",children:t.jsx(r,{icon:"arrow-right"})}),t.jsx("div",{className:"col-5 text-end d-flex-align-items-center",children:t.jsx(Z.Link,{to:a(((p=d.delegate)==null?void 0:p.id)??0),className:"link",children:((f=d.delegate)==null?void 0:f.name)??"-"})})]}),t.jsxs(s.Typography,{variant:"caption",children:[d.dateFrom?s.formatDate(d.dateFrom):"N/A"," -"," ",d.dateTo?s.formatDate(d.dateTo):"N/A"]})]},d.id)})}):null}),i&&i.length===0?t.jsx(s.Alert,{variant:"secondary",size:"sm",children:o.delegations.noDelegations}):null]})},Ru=({approval:e,reloadApproval:n,appEmployeeDetail:a,apiPostChangeEmployee:r,apiApprovalDelegations:o,EmployeePickerComponent:l})=>{var d,u;const{texts:{approval:i}}=c.useContext(s.LuminusComponentsContext);return t.jsxs("div",{className:"row g-0 overflow-hidden h-100",children:[t.jsx("div",{className:"col-7 overflow-hidden h-100",children:t.jsxs("div",{className:"d-flex flex-column gap-0 overflow-hidden h-100",children:[t.jsxs("div",{className:"px-4 pt-1 d-flex align-items-center justify-content-between",children:[t.jsx(s.Typography,{variant:"h6",children:e.name??""}),e.lastExecutionDate?t.jsxs(s.Typography,{variant:"caption",children:[i.definitions.lastExecuted," ",s.formatDate(e.lastExecutionDate)]}):null]}),t.jsx("div",{className:"d-flex flex-column gap-2 overflow-auto h-100 p-3 px-4",children:(u=(d=e.levels)==null?void 0:d.sort((m,p)=>m.index-p.index))==null?void 0:u.map(m=>t.jsx(Ou,{level:m,reloadApproval:n,appEmployeeDetail:a,apiPostChangeEmployee:r,EmployeePickerComponent:l},m.id))})]})}),t.jsx("div",{className:"col-5 overflow-hidden h-100",children:t.jsx(Au,{approval:e,apiApprovalDelegations:o,appEmployeeDetail:a})})]})},ot={apiApprovalDefinitions:"/approval/definition",apiApprovalDefinitionDetail:e=>`/approval/definition/${e}`,apiPostChangeEmployee:"/approval/definition/approver/edit",apiApprovalDelegations:"/approval/delegation"},Gt={appApprovalsDelegations:"/approvals/delegations",appEmployeeDetail:e=>`/employees/${e}`},Pu=({appUrls:{appApprovalsDelegations:e=Gt.appApprovalsDelegations,appEmployeeDetail:n=Gt.appEmployeeDetail}=Gt,apiUrls:{apiApprovalDefinitions:a=ot.apiApprovalDefinitions,apiApprovalDefinitionDetail:r=ot.apiApprovalDefinitionDetail,apiPostChangeEmployee:o=ot.apiPostChangeEmployee,apiApprovalDelegations:l=ot.apiApprovalDelegations}=ot,EmployeePickerComponent:i})=>{const{ProjectIconComponent:d,texts:{approval:u}}=c.useContext(s.LuminusComponentsContext),{data:m}=de.useGetApiData(a),[p,f]=Le.useSearchQueryState("approval",null),{data:x,reloadData:h}=de.useGetApiData(r(p??0),{enabled:p!==null});return c.useEffect(()=>{var g;p||f(((g=m==null?void 0:m.at(0))==null?void 0:g.id)??null)},[m,p,f]),t.jsx(s.PageContainer,{variant:"fullScreen",title:t.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.jsx(s.Typography,{variant:"h3",children:u.definitions.title}),t.jsx(s.ContextButton,{as:"link",href:e,icon:t.jsx(d,{icon:"link"}),children:u.definitions.delegationsDefinitions})]}),children:t.jsxs("div",{className:"row g-0 h-max-100 overflow-hidden",children:[t.jsx("div",{className:"col-2 overflow-hidden h-100",children:t.jsx(s.Typography,{variant:"body2",className:"overflow-x-hidden overflow-y-auto h-100",children:t.jsx("div",{className:"list-group",children:m==null?void 0:m.sort((g,b)=>(g.name??"").localeCompare(b.name??"")).map(g=>t.jsxs("div",{role:"button",className:s.classNames("list-group-item list-group-item-action p-2 d-flex gap-3 align-items-center justify-content-between",{"bg-primary text-white":p===g.id}),onClick:()=>f(g.id),children:[t.jsx("span",{children:g.name}),t.jsxs(s.Typography,{variant:"caption",className:"d-flex align-items-center gap-1",children:[t.jsx(d,{icon:"menu"}),g.levelCount]})]},g.id))})})}),t.jsx("div",{className:"col-10 overflow-hidden h-100",children:x?t.jsx(Ru,{approval:x,reloadApproval:h,appEmployeeDetail:n,apiPostChangeEmployee:o,EmployeePickerComponent:i,apiApprovalDelegations:l}):null})]})})},Bu=({overviewApiPath:e=n=>`/notification/email/overview?date=${n}`})=>{const{ProjectIconComponent:n,texts:{emailOverview:a}}=c.useContext(s.LuminusComponentsContext),[r,o]=Le.useSearchQueryState("date",qe(new Date,{representation:"date"})),l=c.useMemo(()=>r?s.parseISO(r):new Date,[r]),{data:i}=de.useGetApiData(e(qe(l,{representation:"date"}))),d=c.useCallback(f=>{o(qe(za(l,f),{representation:"date"}))},[l,o]),[u,m]=Le.useSearchQueryState("email",null),p=c.useMemo(()=>u?i==null?void 0:i.find(f=>f.id===u):null,[u,i]);return t.jsx(s.PageContainer,{variant:"fullScreen",title:t.jsxs("div",{className:"d-flex align-items-center gap-3",children:[t.jsx(s.Typography,{variant:"h3",children:a.title}),t.jsxs("div",{className:"d-flex gap-1 align-items-center justify-content-start",children:[t.jsx(s.IconButton,{onClick:()=>d(-1),children:t.jsx(n,{icon:"chevron-left"})}),t.jsx(s.TextInput,{type:"date",withoutLabel:!0,value:r,onChange:f=>o((f==null?void 0:f.toString())??""),size:"sm",className:"mb-1"}),t.jsx(s.IconButton,{onClick:()=>d(1),children:t.jsx(n,{icon:"chevron-right"})})]})]}),children:i!==null&&i.length<1?t.jsx(s.Alert,{variant:"warning",children:a.noMails}):t.jsxs("div",{className:"d-flex overflow-hidden gap-3 h-100",children:[t.jsx("div",{className:"h-100 overflow-y-auto overflow-x-hidden",style:{minWidth:"260px"},children:t.jsx("div",{className:"list-group",children:i==null?void 0:i.map(f=>t.jsxs("div",{role:"button",onClick:()=>m(f.id),className:s.classNames("list-group-item list-group-item-action d-flex gap-3 justify-content-between p-2",{active:u===f.id}),children:[t.jsx(s.Typography,{variant:"body2",children:f.subject}),t.jsx(s.Typography,{variant:"caption",children:s.format(s.parseISO(f.date??""),"HH:mm")})]},f.id))})}),p?t.jsxs("div",{className:"w-100 h-100 overflow-hidden bg-white rounded shadow-sm p-0",children:[t.jsx("div",{className:"mb-3 p-3 bg-darker",children:t.jsxs("div",{className:"row gx-3",children:[t.jsxs("div",{className:"col-8",children:[t.jsx(s.Typography,{variant:"caption",children:s.format(s.parseISO((p==null?void 0:p.date)??""),"dd.MM.yyyy HH:mm")}),t.jsx(s.Typography,{variant:"h6",children:(p==null?void 0:p.subject)??""})]}),t.jsxs("div",{className:"col-4",children:[t.jsxs("div",{className:"row",children:[t.jsx("div",{className:"col-6",children:t.jsx(s.Typography,{variant:"body2",children:a.from})}),t.jsx("div",{className:"col-6",children:t.jsx(s.Typography,{variant:"body2",className:"text-end fw-bold",children:(p==null?void 0:p.sender)??"-"})})]}),t.jsxs("div",{className:"row",children:[t.jsx("div",{className:"col-6",children:t.jsx(s.Typography,{variant:"body2",children:a.to})}),t.jsx("div",{className:"col-6",children:t.jsx(s.Typography,{variant:"body2",className:"text-end fw-bold",children:(p==null?void 0:p.recipient)??"-"})})]})]})]})}),t.jsx("iframe",{title:"email-body",srcDoc:(p==null?void 0:p.body)??"",width:"100%",height:"100%"})]}):null]})})};exports.Alert=s.Alert;exports.Backdrop=s.Backdrop;exports.ContextButton=s.ContextButton;exports.Documents=s.Documents;exports.Dropdown=s.Dropdown;exports.DropdownDivider=s.DropdownDivider;exports.DropdownItem=s.DropdownItem;exports.DropdownToggle=s.DropdownToggle;exports.FileExtensionIcon=s.FileExtensionIcon;exports.FloatingLabelInput=s.FloatingLabelInput;exports.HookFormTextAreaInput=s.HookFormTextAreaInput;exports.HookFormTextInput=s.HookFormTextInput;exports.HtmlTooltip=s.HtmlTooltip;exports.IconButton=s.IconButton;exports.InvalidFeedback=s.InvalidFeedback;exports.NoInputContainer=s.NoInputContainer;exports.PrimaryButton=s.PrimaryButton;exports.ResponsiveContextDropdown=s.ResponsiveContextDropdown;exports.ResponsiveContextDropdownItem=s.ResponsiveContextDropdownItem;exports.RowLabelInput=s.RowLabelInput;exports.SelectInput=s.CustomSelectInput;exports.SimplePicker=s.SimplePicker;exports.SimpleToggle=s.SimpleDropdownToggle;exports.SimpleTooltip=s.SimpleTooltip;exports.TextInput=s.TextInput;exports.Typography=s.Typography;exports.Loading=ve.Loading;exports.AlertItem=Da;exports.ApiFileDownloadButton=$a;exports.AppSearch=Mi;exports.Approval=vu;exports.Approvals=Pu;exports.ApprovalsDelegations=Mu;exports.AuthTemplate=Ac;exports.AvatarIcon=Dt;exports.Badge=ml;exports.BarChart=tu;exports.Card=Re;exports.CheckInput=Ze;exports.Collapse=ut;exports.ColumnResizer=Fa;exports.ContactButtonQrModal=Ws;exports.ContactInput=Nr;exports.ContactsLink=Gs;exports.DisabledRowLabelLink=Kd;exports.DropdownPicker=wr;exports.DynamicForm=Gd;exports.EmailOverview=Bu;exports.EmployeeSmallPhoto=Xd;exports.ErrorBoundary=Ta;exports.FileDownloadUS=Ai;exports.FileUploadButton=ir;exports.FileUploadContextButton=ln;exports.FileUploadDropdownItem=ao;exports.Flexmonster=aa;exports.FloatingActionContainer=_a;exports.FloatingFormSubmit=Hs;exports.FromToDatePicker=pd;exports.HomeDashboard=ol;exports.HookFormCheckInput=Qr;exports.HookFormContactInput=Xr;exports.HookFormDropdownPicker=Jr;exports.HookFormFileInput=eo;exports.HookFormFloatingSubmit=sa;exports.HookFormNumericStepperInput=to;exports.HookFormNumericTextInput=no;exports.HookFormRadioInput=Zr;exports.HookFormSelectInput=It;exports.HrWithText=Oa;exports.IconPicker=fn;exports.ImgApi=tn;exports.ImgBlob=rd;exports.ImgDirect=gn;exports.ImportFilePicker=ia;exports.ImportResult=oa;exports.LanguageSwitch=Qd;exports.LineChart=vd;exports.LoadingBlock=bs;exports.LocalStorageBackupUS=Pi;exports.LocalizationImport=ti;exports.LocalizationSettings=gi;exports.MessageBoard=vo;exports.MiniDetailTooltip=hu;exports.MiniDetailValueItem=gu;exports.MonthPicker=Vs;exports.MonthPickerSearchParams=fd;exports.NotificationActions=Qo;exports.NotificationUsers=Xo;exports.NumericFormat=eu;exports.NumericStepperInput=Ir;exports.NumericTextInput=ta;exports.PermissionSubstituteDetail=Tu;exports.PermissionSubstituteTable=ku;exports.PhotoLibrary=ka;exports.PhotoLightbox=Ia;exports.PieChart=gd;exports.RadioInput=na;exports.ReportPage=po;exports.ReportsIndexPage=uu;exports.ResponsiveTabs=ko;exports.RouteLink=xu;exports.SearchBox=Jd;exports.SearchPage=Oi;exports.SearchSettingsUS=Bi;exports.SettingsFormPicker=qd;exports.ShortcutLinks=zo;exports.ShortcutLinksProvider=Uo;exports.ShortcutLinksSetup=Fo;exports.StateToggle=Iu;exports.Tab=pn;exports.TabPanel=ra;exports.Tabs=mn;exports.TextAreaInput=Sr;exports.Timeline=La;exports.TypedFormGroup=Zd;exports.UserAvatarToggle=so;exports.UserAvatarValueFormat=fo;exports.VersionInfo=Vc;exports.WidgetCard=en;exports.YearPicker=Us;exports.YearPickerSearchParams=hd;exports.useShortcutLinksContext=hn;
|
|
24
|
+
`.replace(/ {2}/g,""));return}var d=o.target;if(d instanceof HTMLElement){var f=Bt.get(d);if(f){var p=$t(o),g={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,input:p};if(f.canDrag&&!f.canDrag(g)){o.preventDefault();return}if(f.dragHandle){var x=Wo({x:p.clientX,y:p.clientY});if(!f.dragHandle.contains(x)){o.preventDefault();return}}var y=(r=(i=f.getInitialDataForExternal)===null||i===void 0?void 0:i.call(f,g))!==null&&r!==void 0?r:null;if(y)for(var h=0,v=Object.entries(y);h<v.length;h++){var b=zo(v[h],2),w=b[0],S=b[1];o.dataTransfer.setData(w,S??"")}Fd()&&!o.dataTransfer.types.includes(ks)&&!o.dataTransfer.types.includes(Ad)&&o.dataTransfer.setData(ks,Pd),o.dataTransfer.setData(Md,"");var j={element:f.element,dragHandle:(c=f.dragHandle)!==null&&c!==void 0?c:null,data:(u=(m=f.getInitialData)===null||m===void 0?void 0:m.call(f,g))!==null&&u!==void 0?u:{}},C={type:"element",payload:j,startedFrom:"internal"};e.start({event:o,dragType:C})}}}}}))},dispatchEventToSource:function(e){var t,o,a=e.eventName,r=e.payload;(t=Bt.get(r.source.element))===null||t===void 0||(o=t[a])===null||o===void 0||o.call(t,r)},onPostDispatch:_s.getOnPostDispatch()}),qo=Yo.dropTarget;function Bd(n){if(process.env.NODE_ENV!=="production"&&n.dragHandle&&!n.element.contains(n.dragHandle)&&console.warn("Drag handle element must be contained in draggable element",{element:n.element,dragHandle:n.dragHandle}),process.env.NODE_ENV!=="production"){var e=Bt.get(n.element);e&&console.warn("You have already registered a `draggable` on the same element",{existing:e,proposed:n})}var t=nn(Yo.registerUsage(),Od(n),Ko(n.element,{attribute:"draggable",value:"true"}));return l.once(t)}const Ds=n=>{const e=l.compilerRuntimeExports.c(2),{width:t}=n;let o;return e[0]!==t?(o=s.jsx("div",{style:{width:t,height:"100%",backgroundColor:"#c9c9c9",border:"1px solid #bdbdbd",borderRadius:"4px"}}),e[0]=t,e[1]=o):o=e[1],o},zd=n=>{var T;const e=l.compilerRuntimeExports.c(41),{photo:t,setSelectedIndex:o,selectedIndex:a,index:r,ImgComponent:i,baseUrl:c,customToken:u,placeholder:m}=n,d=N.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={type:"idle"},e[0]=f):f=e[0];const[p,g]=N.useState(f),[x,y]=N.useState(!1);let h,v;e[1]!==t.id?(h=()=>d.current?nn(qo({element:d.current,getData:F=>{const{input:P,element:M}=F;return td({photoId:t.id},{input:P,element:M,allowedEdges:["left","right"]})},onDrop:()=>{g({type:"idle"})},onDrag:F=>{const{self:P,source:M}=F,O=Oo(P.data);O&&g({type:"is-over",closestEdge:O,draggedWidth:M.data.width})},onDragLeave:()=>{g({type:"idle"})},getIsSticky:Vd}),Bd({element:d.current,onDragStart:()=>{y(!0)},onDrop:()=>{y(!1)},getInitialData:()=>{var F;return{photoId:t.id,width:(F=d.current)==null?void 0:F.clientWidth}}})):Hd,v=[t.id],e[1]=t.id,e[2]=h,e[3]=v):(h=e[2],v=e[3]),N.useEffect(h,v);let b;e[4]!==p.closestEdge||e[5]!==p.draggedWidth||e[6]!==p.type?(b=p.type==="is-over"&&p.closestEdge==="left"&&s.jsx(Ds,{width:p.draggedWidth}),e[4]=p.closestEdge,e[5]=p.draggedWidth,e[6]=p.type,e[7]=b):b=e[7];let w;e[8]!==r||e[9]!==o?(w=()=>o(r),e[8]=r,e[9]=o,e[10]=w):w=e[10];let S;e[11]!==x?(S=l.classNames(Ue.lightboxDraggablePhoto,{[Ue.dragging]:x}),e[11]=x,e[12]=S):S=e[12];const j=t.id,C=r!==a?"button":void 0,I=t.smSrc,k=t.alt,L=r===a;let E;e[13]!==L?(E=l.classNames("rounded drag-handle",Ue.photo,{[Ue.selected]:L}),e[13]=L,e[14]=E):E=e[14];let D;e[15]!==i||e[16]!==c||e[17]!==u||e[18]!==t.alt||e[19]!==t.id||e[20]!==t.smSrc||e[21]!==m||e[22]!==E||e[23]!==C?(D=s.jsx(i,{role:C,src:I,alt:k,className:E,baseUrl:c,customToken:u,placeholder:m,draggable:!1},j),e[15]=i,e[16]=c,e[17]=u,e[18]=t.alt,e[19]=t.id,e[20]=t.smSrc,e[21]=m,e[22]=E,e[23]=C,e[24]=D):D=e[24];let _;e[25]!==t.customIndicators||e[26]!==t.isDefault?(_=t.isDefault||t.customIndicators&&t.customIndicators.length>0?s.jsxs("div",{className:l.classNames(Ue.indicators,"gap-1"),children:[t.isDefault&&s.jsx("div",{className:"text-primary",children:s.jsx(l.MdOutlineStar,{})}),(T=t.customIndicators)==null?void 0:T.map(Wd)]}):null,e[25]=t.customIndicators,e[26]=t.isDefault,e[27]=_):_=e[27];let R;e[28]!==D||e[29]!==_||e[30]!==w||e[31]!==S?(R=s.jsxs("div",{ref:d,role:"button",onClick:w,className:S,children:[D,_]}),e[28]=D,e[29]=_,e[30]=w,e[31]=S,e[32]=R):R=e[32];let $;e[33]!==p.closestEdge||e[34]!==p.draggedWidth||e[35]!==p.type?($=p.type==="is-over"&&p.closestEdge==="right"&&s.jsx(Ds,{width:p.draggedWidth}),e[33]=p.closestEdge,e[34]=p.draggedWidth,e[35]=p.type,e[36]=$):$=e[36];let A;return e[37]!==R||e[38]!==$||e[39]!==b?(A=s.jsxs(s.Fragment,{children:[b,R,$]}),e[37]=R,e[38]=$,e[39]=b,e[40]=A):A=e[40],A};function Hd(){}function Vd(){return!0}function Wd(n,e){return s.jsx("div",{className:n.className,children:n.content},e)}const Ud=n=>{const e=l.compilerRuntimeExports.c(22),{photos:t,setSelectedIndex:o,selectedIndex:a,ImgComponent:r,baseUrl:i,customToken:c,placeholder:u,reorderPhotos:m,onChangeOrder:d}=n,f=N.useRef(null);let p,g;e[0]!==d||e[1]!==t||e[2]!==m?(p=()=>{if(!f.current)throw new Error("dropTargetRef is not defined");return qo({element:f.current,onDrop:h=>{const v=h.source.data.photoId,b=h.location.current.dropTargets[0],w=t.findIndex(I=>I.id===b.data.photoId),S=t.findIndex(I=>I.id===v),j=Oo(b.data);console.log({indexOfTarget:w,startIndex:S,closestEdgeOfTarget:j});const C=nd({startIndex:S,indexOfTarget:w,closestEdgeOfTarget:j});console.log("drop",h),m(S,C),d&&d(v,C)}})},g=[d,t,m],e[0]=d,e[1]=t,e[2]=m,e[3]=p,e[4]=g):(p=e[3],g=e[4]),N.useEffect(p,g);let x;if(e[5]!==r||e[6]!==i||e[7]!==c||e[8]!==t||e[9]!==u||e[10]!==a||e[11]!==o){let h;e[13]!==r||e[14]!==i||e[15]!==c||e[16]!==u||e[17]!==a||e[18]!==o?(h=(v,b)=>s.jsx(zd,{photo:v,setSelectedIndex:o,selectedIndex:a,index:b,ImgComponent:r,baseUrl:i,customToken:c,placeholder:u},v.id),e[13]=r,e[14]=i,e[15]=c,e[16]=u,e[17]=a,e[18]=o,e[19]=h):h=e[19],x=t.map(h),e[5]=r,e[6]=i,e[7]=c,e[8]=t,e[9]=u,e[10]=a,e[11]=o,e[12]=x}else x=e[12];let y;return e[20]!==x?(y=s.jsx("div",{ref:f,className:"d-flex justify-content-center gap-1",children:x}),e[20]=x,e[21]=y):y=e[21],y},Qo=n=>{const e=l.compilerRuntimeExports.c(40),{show:t,onClose:o,photos:a,defaultIndex:r,uploadPhotosText:i,noPhotosText:c,onUploadPhotos:u,photoActions:m,baseUrl:d,customToken:f,placeholder:p,ImgComponent:g,onChangeOrder:x}=n,y=g===void 0?Hn:g,[h,v]=N.useState(a);let b,w;e[0]!==a?(b=()=>{v(a)},w=[a],e[0]=a,e[1]=b,e[2]=w):(b=e[1],w=e[2]),N.useEffect(b,w);const[S,j]=N.useState(r),C=h.at(S),I=S>0,k=S<h.length-1;let L,E;e[3]!==r||e[4]!==t?(L=()=>{t&&j(r)},E=[r,t],e[3]=r,e[4]=t,e[5]=L,e[6]=E):(L=e[5],E=e[6]),N.useEffect(L,E);let D;e[7]!==h.length||e[8]!==S?(D=()=>{S>=h.length&&j(h.length-1)},e[7]=h.length,e[8]=S,e[9]=D):D=e[9];let _;e[10]!==h||e[11]!==S?(_=[h,S],e[10]=h,e[11]=S,e[12]=_):_=e[12],N.useEffect(D,_);let R;e[13]!==k||e[14]!==I||e[15]!==o?(R=Y=>{e:switch(Y.key){case"ArrowLeft":{Y.stopPropagation(),I&&j(Gd);break e}case"ArrowRight":{Y.stopPropagation(),k&&j(Kd);break e}case"Escape":{Y.stopPropagation(),o();break e}}},e[13]=k,e[14]=I,e[15]=o,e[16]=R):R=e[16];const $=R;let A;e[17]!==h?(A=(Y,Z)=>{const te=Array.from(h),[se]=te.splice(Y,1);return te.splice(Z,0,se),te},e[17]=h,e[18]=A):A=e[18];const T=A;l.useKeyPress($);let F;e[19]!==k?(F=Y=>{Y.velocity>.8&&k&&j(Yd)},e[19]=k,e[20]=F):F=e[20];let P;e[21]!==I?(P=Y=>{Y.velocity>.8&&I&&j(qd)},e[21]=I,e[22]=P):P=e[22];let M;e[23]===Symbol.for("react.memo_cache_sentinel")?(M={delta:100},e[23]=M):M=e[23];let O;e[24]!==F||e[25]!==P?(O={onSwipedLeft:F,onSwipedRight:P,...M},e[24]=F,e[25]=P,e[26]=O):O=e[26];const z=l.useSwipeable(O),H=Cn;let W;e[27]!==o||e[28]!==t?(W=s.jsx(l.Backdrop,{show:t,onClick:o}),e[27]=o,e[28]=t,e[29]=W):W=e[29];let B;e[30]!==t?(B=l.classNames("luminus-lightbox rounded shadow",Ue.lightbox,{[Ue.show]:t}),e[30]=t,e[31]=B):B=e[31];const U=t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Ue.header,children:[s.jsxs("div",{className:l.classNames("rounded",Ue.photoActions),children:[u&&s.jsx($n,{accept:".jpg,.jpeg,.png",onUpload:Y=>{Y.length>0&&u(Array.from(Y))},icon:s.jsx(l.MdOutlineCameraAlt,{style:{fontSize:18}}),multiple:!0,className:"me-1 me-lg-3",children:i??null}),s.jsx(l.ResponsiveContextDropdown,{children:C&&(m==null?void 0:m.map((Y,Z)=>{const{label:te,onClick:se,...q}=Y;return s.jsx(l.ResponsiveContextDropdownItem,{hideOn:"sm",cKey:`action-${Z}`,onClick:()=>se(C.id),...q,children:typeof te=="string"?te:te(C.id)},`action-${Z}`)}))})]}),s.jsx("div",{role:"button",onClick:o,children:s.jsx(l.MdClear,{style:{fontSize:"32px"}})})]}),h.length===0&&s.jsx("div",{className:"w-100 h-100 d-flex align-items-center justify-content-center",children:s.jsx(l.Typography,{variant:"body",children:c??"No photos available"})}),C&&s.jsxs("div",{className:Ue.photoContainer,children:[s.jsx("div",{role:I?"button":void 0,className:l.classNames("align-items-start",Ue.navButton,Ue.left),onClick:()=>I&&j(Qd),children:I&&s.jsx(l.MdOutlineKeyboardArrowLeft,{style:{fontSize:"40px"}})}),s.jsx(y,{src:C.lgSrc,alt:C.alt,className:l.classNames("rounded",Ue.photo),baseUrl:d,customToken:f,placeholder:p,renderAsDivBg:!0}),s.jsx("div",{role:k?"button":void 0,className:l.classNames("align-items-end",Ue.navButton,Ue.right),onClick:()=>k&&j(Xd),children:k&&s.jsx(l.MdOutlineKeyboardArrowRight,{style:{fontSize:"40px"}})})]}),s.jsx("div",{className:l.classNames("d-flex justify-content-center",Ue.photosPreviewContainer),children:s.jsx(Ud,{photos:h,setSelectedIndex:j,selectedIndex:S,ImgComponent:y,baseUrl:d,customToken:f,placeholder:p,reorderPhotos:T,onChangeOrder:x})})]});let V;e[32]!==z||e[33]!==B||e[34]!==U?(V=s.jsx("div",{className:B,...z,children:U}),e[32]=z,e[33]=B,e[34]=U,e[35]=V):V=e[35];let X;return e[36]!==H||e[37]!==W||e[38]!==V?(X=s.jsxs(H,{children:[W,V]}),e[36]=H,e[37]=W,e[38]=V,e[39]=X):X=e[39],X};function Gd(n){return n-1}function Kd(n){return n+1}function Yd(n){return n+1}function qd(n){return n-1}function Qd(n){return n-1}function Xd(n){return n+1}const Xo=n=>{const e=l.compilerRuntimeExports.c(34),{photos:t,onUploadPhotos:o,uploadPhotosText:a,noPhotosText:r,photoActions:i,baseUrl:c,customToken:u,placeholder:m,ImgComponent:d,noLightboxOnlyButtonOnEmpty:f,hideLightbox:p,onChangeOrder:g}=n,x=d===void 0?Hn:d,y=f===void 0?!1:f,h=p===void 0?!1:p,[v,b]=N.useState(null),w=v!==null?t[v]:null,[S,j]=N.useState(!1);let C,I;if(e[0]!==t?(C=()=>{if(t.length===0){b(null);return}const $=t.findIndex(Zd);b($>-1?$:0)},I=[t],e[0]=t,e[1]=C,e[2]=I):(C=e[1],I=e[2]),N.useEffect(C,I),!w&&o&&y){let $;e[3]!==o?($=P=>{P.length>0&&o(Array.from(P))},e[3]=o,e[4]=$):$=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(l.MdOutlineCameraAlt,{style:{fontSize:18}}),e[5]=A):A=e[5];const T=a??null;let F;return e[6]!==$||e[7]!==T?(F=s.jsx($n,{accept:".jpg,.jpeg,.png",onUpload:$,icon:A,multiple:!0,children:T}),e[6]=$,e[7]=T,e[8]=F):F=e[8],F}let k;e[9]!==x||e[10]!==c||e[11]!==u||e[12]!==w||e[13]!==t.length||e[14]!==m||e[15]!==a?(k=w?s.jsxs("div",{role:"button",className:"w-100 position-relative",onClick:()=>j(!0),children:[s.jsx(x,{src:w.smSrc,alt:w.alt,className:"rounded w-100",baseUrl:c,customToken:u,placeholder:m}),t.length>1&&s.jsx("div",{className:"position-absolute rounded p-1",style:{top:0,right:0,color:"white",textShadow:"-2px 2px 4px #696969",background:"rgba(105,105,105,0.5)"},children:s.jsx(l.MdOutlinePhotoLibrary,{fontSize:24})})]}):s.jsx(l.SimpleTooltip,{text:a??"",placement:"left",children:s.jsx("div",{role:"button",className:l.classNames("rounded p-3 d-flex justify-content-center"),onClick:()=>j(!0),children:s.jsx("img",{src:m,alt:"placeholder",className:"rounded w-25"})})}),e[9]=x,e[10]=c,e[11]=u,e[12]=w,e[13]=t.length,e[14]=m,e[15]=a,e[16]=k):k=e[16];const L=S&&!h;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=()=>j(!1),e[17]=E):E=e[17];const D=v??0;let _;e[18]!==x||e[19]!==c||e[20]!==u||e[21]!==r||e[22]!==g||e[23]!==o||e[24]!==i||e[25]!==t||e[26]!==m||e[27]!==L||e[28]!==D||e[29]!==a?(_=s.jsx(Qo,{show:L,onClose:E,photos:t,defaultIndex:D,uploadPhotosText:a,noPhotosText:r,onUploadPhotos:o,photoActions:i,baseUrl:c,customToken:u,placeholder:m,ImgComponent:x,onChangeOrder:g}),e[18]=x,e[19]=c,e[20]=u,e[21]=r,e[22]=g,e[23]=o,e[24]=i,e[25]=t,e[26]=m,e[27]=L,e[28]=D,e[29]=a,e[30]=_):_=e[30];let R;return e[31]!==_||e[32]!==k?(R=s.jsxs(s.Fragment,{children:[k,_]}),e[31]=_,e[32]=k,e[33]=R):R=e[33],R};function Zd(n){return n.isDefault}const Jd=n=>{var d,f,p;const e=l.compilerRuntimeExports.c(15),{children:t}=n,{useMsal:o,msalScopes:a,msalExtraScopes:r}=N.useContext(l.AuthContext),{isAuthenticated:i}=l.useAuth(),{userLoginState:c}=N.useContext(l.UserContext),u=c.state===l.LoginState.LOGGING_IN,m=c.user&&((d=c.user)==null?void 0:d.permissions)&&((p=(f=c.user)==null?void 0:f.permissions)==null?void 0:p.length)>0;if(o){let g;e[0]!==r||e[1]!==a?(g={scopes:a,extraScopesToConsent:r},e[0]=r,e[1]=a,e[2]=g):g=e[2];let x;e[3]!==t||e[4]!==i||e[5]!==u||e[6]!==c.user||e[7]!==m?(x=u||!i()?s.jsx(Ge.Loading,{}):c.user?m?s.jsx(s.Fragment,{children:t}):s.jsx(Ne.Navigate,{to:"/user-not-permitted",replace:!0}):s.jsx(Ne.Navigate,{to:"/no-user-login",replace:!0}),e[3]=t,e[4]=i,e[5]=u,e[6]=c.user,e[7]=m,e[8]=x):x=e[8];let y;return e[9]!==g||e[10]!==x?(y=s.jsx(il.MsalAuthenticationTemplate,{interactionType:rl.InteractionType.Redirect,authenticationRequest:g,children:x}),e[9]=g,e[10]=x,e[11]=y):y=e[11],y}if(u){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ge.Loading,{}),e[12]=g):g=e[12],g}if(!i()||!c.user){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ne.Navigate,{to:"/login",replace:!0}),e[13]=g):g=e[13],g}if(!m){let g;return e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ne.Navigate,{to:"/user-not-permitted",replace:!0}),e[14]=g):g=e[14],g}return t},eu="_item_z9z4m_1",tu="_level-success_z9z4m_4",nu="_level-info_z9z4m_10",su="_level-warning_z9z4m_16",ou="_level-danger_z9z4m_22",lu="_type-icon_z9z4m_28",xn={item:eu,"level-success":"_level-success_z9z4m_4",levelSuccess:tu,"level-info":"_level-info_z9z4m_10",levelInfo:nu,"level-warning":"_level-warning_z9z4m_16",levelWarning:su,"level-danger":"_level-danger_z9z4m_22",levelDanger:ou,"type-icon":"_type-icon_z9z4m_28",typeIcon:lu},Zo=n=>{const e=l.compilerRuntimeExports.c(16),{level:t,children:o,customIcon:a,noIcon:r}=n,{ProjectIconComponent:i}=N.useContext(l.LuminusComponentsContext);let c;e[0]!==i||e[1]!==t?(c=()=>{switch(t){case"info":return s.jsx(i,{icon:"info"});case"warning":return s.jsx(i,{icon:"warning"});case"danger":return s.jsx(i,{icon:"danger"});default:return s.jsx(i,{icon:"check"})}},e[0]=i,e[1]=t,e[2]=c):c=e[2];const u=c,m=!r;let d;e[3]!==t||e[4]!==m?(d=l.classNames("p-2 rounded d-flex gap-1 align-items-center justify-content-between",{"ps-1":m},xn.item,xn[`level-${t}`]),e[3]=t,e[4]=m,e[5]=d):d=e[5];let f;e[6]!==a||e[7]!==u||e[8]!==r?(f=!r&&s.jsx("div",{className:l.classNames(xn.typeIcon),children:a??u()}),e[6]=a,e[7]=u,e[8]=r,e[9]=f):f=e[9];let p;e[10]!==o?(p=s.jsx(l.Typography,{variant:"body2",className:"w-100",children:o}),e[10]=o,e[11]=p):p=e[11];let g;return e[12]!==d||e[13]!==f||e[14]!==p?(g=s.jsxs("div",{className:d,children:[f,p]}),e[12]=d,e[13]=f,e[14]=p,e[15]=g):g=e[15],g},au=n=>{const e=l.compilerRuntimeExports.c(3),{version:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={position:"fixed",right:"0px",bottom:"0px",zIndex:"10000",backgroundColor:"rgba(255, 255, 255, 0.5)",padding:"4px",pointerEvents:"all"},e[0]=o):o=e[0];let a;return e[1]!==t?(a=s.jsx("div",{className:"rounded",style:o,children:s.jsxs(l.Typography,{variant:"caption",className:"w-100 text-end",children:["verze ",t]})}),e[1]=t,e[2]=a):a=e[2],a},ru="_widget-card_e9tsb_1",iu={widgetCard:ru},kn=n=>{const e=l.compilerRuntimeExports.c(5),{children:t,title:o,headerContent:a}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=l.classNames(iu.widgetCard,"luminus-widget"),e[0]=r):r=e[0];let i;return e[1]!==t||e[2]!==a||e[3]!==o?(i=s.jsx(pt,{className:r,title:o,headerContent:a,contentClassName:"h-100 overflow-auto",children:t}),e[1]=t,e[2]=a,e[3]=o,e[4]=i):i=e[4],i};class cu extends N.Component{constructor(e){super(e),this.state={hasError:!1,is404Error:!1},this.reload=this.reload.bind(this)}static getDerivedStateFromError(e){return{hasError:!0,is404Error:e.message==="404"}}componentDidUpdate(e){this.state.hasError&&e.keyForErrorState!==this.props.keyForErrorState&&this.setState({hasError:!1,is404Error:!1})}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),console.error("Error stack:",e.stack),console.error("Component stack:",t.componentStack)}reload(){this.setState({hasError:!1,is404Error:!1})}render(){const{fallback:e,fallbackOn404:t,children:o,texts:a,reloadButtonDisplay:r="append-after-child"}=this.props;return this.state.hasError?r==="inject-to-child"&&!this.state.is404Error&&N.isValidElement(e)?N.cloneElement(e,{...e.props},s.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...e.props.children,s.jsx("div",{className:"d-flex gap-2 justify-content-center",children:s.jsx(l.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent})})]})):r==="inject-to-child"&&this.state.is404Error&&N.isValidElement(t)?N.cloneElement(t,{...t.props},s.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[...t.props.children,s.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[s.jsx(l.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),s.jsx(l.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]})):s.jsxs("div",{className:"translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2",children:[this.state.is404Error?t:e,s.jsxs("div",{className:"d-flex gap-2 justify-content-center",children:[r==="none"?null:s.jsx(l.ContextButton,{type:"button",onClick:this.reload,children:a.reloadButtonContent}),this.state.is404Error&&s.jsx(l.ContextButton,{type:"button",onClick:this.props.navigateBack,children:a.navigateBackButtonContent})]})]}):o}}const du=n=>t=>{const o=l.compilerRuntimeExports.c(3),{texts:a}=N.useContext(l.LuminusComponentsContext),{errorBoundary:r}=a;let i;return o[0]!==r||o[1]!==t?(i=s.jsx(n,{texts:r,...t}),o[0]=r,o[1]=t,o[2]=i):i=o[2],i},Jo=du(cu),uu=n=>{const e=l.compilerRuntimeExports.c(16),{children:t,title:o}=n,{texts:a}=N.useContext(l.LuminusComponentsContext),{widget:r}=a,i=Ne.useNavigate();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0],N.useEffect(mu,c);let u;e[1]!==o||e[2]!==r.fallbackError?(u=s.jsx(kn,{title:o,children:r.fallbackError}),e[1]=o,e[2]=r.fallbackError,e[3]=u):u=e[3];let m;e[4]!==i?(m=()=>i(-1),e[4]=i,e[5]=m):m=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ws,{}),e[6]=d):d=e[6];let f;e[7]!==o?(f=s.jsx(kn,{title:o,children:d}),e[7]=o,e[8]=f):f=e[8];let p;e[9]!==t||e[10]!==f?(p=s.jsx(N.Suspense,{fallback:f,children:t}),e[9]=t,e[10]=f,e[11]=p):p=e[11];let g;return e[12]!==u||e[13]!==m||e[14]!==p?(g=s.jsx(Jo,{fallback:u,reloadButtonDisplay:"inject-to-child",navigateBack:m,children:p}),e[12]=u,e[13]=m,e[14]=p,e[15]=g):g=e[15],g};function mu(){console.log("widget wrapper mounted")}const fu="_submit-container_j8pmc_1",pu="_spacer_j8pmc_14",Ts={submitContainer:fu,spacer:pu},el=n=>{const e=l.compilerRuntimeExports.c(8),{children:t,noSpacer:o}=n,a=o===void 0?!1:o;let r;e[0]!==a?(r=!a&&s.jsx("div",{className:Ts.spacer}),e[0]=a,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=l.classNames("luminus-floating-action-container shadow",Ts.submitContainer),e[2]=i):i=e[2];let c;e[3]!==t?(c=s.jsx("div",{className:i,children:t}),e[3]=t,e[4]=c):c=e[4];let u;return e[5]!==r||e[6]!==c?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[5]=r,e[6]=c,e[7]=u):u=e[7],u},hu="_timeline_g1754_1",gu="_step-container_g1754_1",xu="_step-date_g1754_1",yu="_step-content_g1754_4",vu="_content-header_g1754_8",bu="_content-text_g1754_11",ju="_step-icon_g1754_14",jt={timeline:hu,stepContainer:gu,stepDate:xu,stepContent:yu,contentHeader:vu,contentText:bu,stepIcon:ju},tl=n=>{const e=l.compilerRuntimeExports.c(7),{steps:t,dontSort:o}=n;let a;if(e[0]!==o||e[1]!==t){let i;e[3]!==o?(i=(c,u)=>o?0:fl(c.date??new Date,u.date??new Date),e[3]=o,e[4]=i):i=e[4],a=t.sort(i).map(Su),e[0]=o,e[1]=t,e[2]=a}else a=e[2];let r;return e[5]!==a?(r=s.jsx("div",{className:jt.timeline,children:a}),e[5]=a,e[6]=r):r=e[6],r};function Su(n,e){return s.jsxs("div",{className:l.classNames("row g-0 gx-3",jt.stepContainer),children:[s.jsx("div",{className:"col-3",children:n.date&&s.jsxs(l.Typography,{variant:"caption",className:l.classNames("h-100 d-flex flex-column align-items-end justify-content-center gap-0",jt.stepDate),children:[s.jsx("div",{children:l.format(n.date,"dd.MM.yyyy")}),n.dateFormat==="date"?null:s.jsx("div",{children:l.format(n.date,"HH:mm")})]})}),s.jsx("div",{className:"col-9",children:s.jsxs("div",{className:l.classNames("h-100 d-flex flex-column gap-1 border-start border-2 p-3",jt.stepContent),children:[s.jsxs("div",{className:l.classNames("d-flex gap-2 align-items-center",jt.contentHeader),children:[n.person&&s.jsx(en,{name:n.person.name??"",size:22,fontSize:12}),typeof n.title=="string"?s.jsx(l.Typography,{variant:"body",className:"fw-bold",children:n.title}):n.title]}),n.text&&s.jsx(l.Typography,{variant:"body2",className:jt.contentText,children:n.text}),s.jsx("div",{className:l.classNames("text-primary",jt.stepIcon),children:n.icon??s.jsx(l.MdCircle,{})})]})})]},e)}const Cu=(n,e,t,o)=>{const a=l.compilerRuntimeExports.c(14),r=!0;let i;a[0]!==e||a[1]!==t||a[2]!==r?(i={silent:r,differentBaseUrl:e,customToken:t},a[0]=e,a[1]=t,a[2]=r,a[3]=i):i=a[3];const c=l.useAxios(i),[u,m]=N.useState(!1),[d,f]=N.useState(null);let p;a[4]!==c||a[5]!==n?(p=async v=>{m(!0),f(null),c.get(n,{signal:v,responseType:"blob"}).then(b=>{m(!1),f(b.data)}).catch(()=>{m(!1),f(null)})},a[4]=c,a[5]=n,a[6]=p):p=a[6];const g=p;let x,y;a[7]!==g?(x=()=>{const v=new AbortController;return g(v.signal),()=>{v.abort()}},y=[g],a[7]=g,a[8]=x,a[9]=y):(x=a[8],y=a[9]),N.useEffect(x,y);let h;return a[10]!==d||a[11]!==u||a[12]!==g?(h={data:d,setData:f,reloadData:g,isLoading:u},a[10]=d,a[11]=u,a[12]=g,a[13]=h):h=a[13],h},_n=n=>{const e=l.compilerRuntimeExports.c(20);let t,o,a,r,i,c,u;e[0]!==n?({src:u,alt:t,baseUrl:o,customToken:a,placeholder:i,renderAsDivBg:c,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i,e[6]=c,e[7]=u):(t=e[1],o=e[2],a=e[3],r=e[4],i=e[5],c=e[6],u=e[7]);const{data:m}=Cu(u,o,a),[d,f]=N.useState(null);let p,g;if(e[8]!==m?(p=()=>{let v=null;return m!==null?(v=URL.createObjectURL(m),f(v)):f(null),()=>{v!==null&&URL.revokeObjectURL(v)}},g=[m],e[8]=m,e[9]=p,e[10]=g):(p=e[9],g=e[10]),N.useEffect(p,g),d===null&&!i)return null;if(!c){const v=t??"",b=d??i;let w;return e[11]!==r||e[12]!==v||e[13]!==b?(w=s.jsx("img",{...r,alt:v,src:b}),e[11]=r,e[12]=v,e[13]=b,e[14]=w):w=e[14],w}const x=d?`url(${d})`:void 0;let y;e[15]!==x?(y={backgroundImage:x,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},e[15]=x,e[16]=y):y=e[16];let h;return e[17]!==r||e[18]!==y?(h=s.jsx("div",{...r,style:y}),e[17]=r,e[18]=y,e[19]=h):h=e[19],h},wu=n=>{const e=l.compilerRuntimeExports.c(16);let t,o,a,r,i;if(e[0]!==n){const{src:g,alt:x,baseUrl:y,customToken:h,placeholder:v,renderAsDivBg:b,...w}=n;i=g,t=x,a=v,r=b,o=w,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=i}else t=e[1],o=e[2],a=e[3],r=e[4],i=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c={silent:!0},e[6]=c):c=e[6];const{data:u}=Ae.useGetApiData("/photos/SAS",c),m=`${i}?${u}`;if(!u||!i)return null;if(!r){const g=t??"",x=m??a;let y;return e[7]!==o||e[8]!==g||e[9]!==x?(y=s.jsx("img",{...o,alt:g,src:x}),e[7]=o,e[8]=g,e[9]=x,e[10]=y):y=e[10],y}const d=m?`url(${m})`:void 0;let f;e[11]!==d?(f={backgroundImage:d,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},e[11]=d,e[12]=f):f=e[12];let p;return e[13]!==o||e[14]!==f?(p=s.jsx("div",{...o,style:f}),e[13]=o,e[14]=f,e[15]=p):p=e[15],p},Nu=n=>{const e=l.compilerRuntimeExports.c(9),{ref:t,onClick:o,text:a}=n;let r;e[0]!==o?(r=m=>{m.preventDefault(),o(m)},e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"mt-",children:"…"}),e[2]=i):i=e[2];let c;e[3]!==a?(c=s.jsxs("div",{className:"d-flex flex-column align-items-center",children:[i,s.jsx("div",{className:"mt-1 middle-letter",children:a})]}),e[3]=a,e[4]=c):c=e[4];let u;return e[5]!==t||e[6]!==r||e[7]!==c?(u=s.jsx("div",{ref:t,onClick:r,role:"button",className:"middle-div",children:c}),e[5]=t,e[6]=r,e[7]=c,e[8]=u):u=e[8],u},Es=[["D","day"],["M","month"],["Y","year"],["C","custom"]],Iu="_wrapper_qfqux_1",ku="_lg_qfqux_7",_u="_sm_qfqux_11",Du="_md_qfqux_14",Ls={wrapper:Iu,lg:ku,sm:_u,md:Du},Zt=n=>{const e=new Date(n),t=l.trimIsoDate(e.toISOString());e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(e.getUTCDate()-1);const o=l.trimIsoDate(e.toISOString());return{from:t,to:o}},zt=n=>{const e=new Date(n),t=l.trimIsoDate(e.toISOString());e.setUTCFullYear(e.getUTCFullYear()+1),e.setUTCDate(e.getUTCDate()-1);const o=l.trimIsoDate(e.toISOString());return{from:t,to:o}},Tu=(n,e)=>{if(n===null||e===null)return"C";if(n===e)return"D";const t=new Date(n);return Zt(t).to===e?"M":zt(t).to===e?"Y":(console.log(zt(t),e),"C")},Eu=(n,e,t)=>{const o=l.compilerRuntimeExports.c(14);let a;o[0]!==n||o[1]!==t||o[2]!==e?(a=(f,p)=>{if(n==="C"){t(g=>({...g,[f]:p}));return}e:switch(f){case"from":{t(g=>{if(p===null)return g;const x=new Date(p);if(n==="D"){const y=l.trimIsoDate(x.toISOString());return{from:y,to:y}}return n==="M"?Zt(x):n==="Y"?zt(x):g});break e}case"to":{e("C"),t(g=>({...g,[f]:p}));break e}}},o[0]=n,o[1]=t,o[2]=e,o[3]=a):a=o[3];const r=a;let i;o[4]!==n||o[5]!==t?(i=f=>{t(p=>{if(p.from===null||p.to===null)return p;const g=new Date(p.from);g.setHours(g.getHours()-g.getTimezoneOffset()/60);const x=new Date(p.to);if(n==="D"){g.setDate(g.getDate()+f);const y=l.trimIsoDate(g.toISOString());return{from:y,to:y}}return n==="M"?(g.setMonth(g.getMonth()+f),Zt(g)):n==="Y"?(g.setFullYear(g.getFullYear()+f),zt(g)):{from:l.trimIsoDate(g.toISOString()),to:l.trimIsoDate(x.toISOString())}})},o[4]=n,o[5]=t,o[6]=i):i=o[6];const c=i;let u;o[7]!==t||o[8]!==e?(u=f=>{f==="D"?t(Lu):f==="M"?t(Ru):f==="Y"&&t($u),e(f)},o[7]=t,o[8]=e,o[9]=u):u=o[9];const m=u;let d;return o[10]!==c||o[11]!==m||o[12]!==r?(d={setFromToProp:r,handleArrowClick:c,handleRangeChange:m},o[10]=c,o[11]=m,o[12]=r,o[13]=d):d=o[13],d};function Lu(n){return{from:n.from,to:n.from}}function Ru(n){if(n.from===null)return n;const e=l.getFirstDayOfMonth(n.from);return Zt(e)}function $u(n){if(n.from===null)return n;const e=l.getFirstDayOfYear(new Date(n.from).getFullYear());return zt(e)}const Fu=n=>{const e=l.compilerRuntimeExports.c(55),{fromtoState:t,className:o,size:a}=n,[r,i]=t,{texts:c,ProjectIconComponent:u}=N.useContext(l.LuminusComponentsContext),{date:m}=c,[d,f]=N.useState("C"),{handleArrowClick:p,handleRangeChange:g,setFromToProp:x}=Eu(d,f,i),y=d==="C",h=N.useRef(!0);let v,b;e[0]!==r.from||e[1]!==r.to?(v=()=>{if(h.current){const H=Tu(r.from,r.to);f(H),h.current=!1}},b=[r.from,r.to],e[0]=r.from,e[1]=r.to,e[2]=v,e[3]=b):(v=e[2],b=e[3]),N.useEffect(v,b);const w=Ls[a??"md"];let S;e[4]!==o||e[5]!==w?(S=l.classNames("d-inline-flex align-items-center gap-1",Ls.wrapper,w,o),e[4]=o,e[5]=w,e[6]=S):S=e[6];let j;e[7]!==p?(j=()=>{p(-1)},e[7]=p,e[8]=j):j=e[8];let C;e[9]!==u?(C=s.jsx(u,{icon:"chevron-left"}),e[9]=u,e[10]=C):C=e[10];let I;e[11]!==y||e[12]!==j||e[13]!==C?(I=s.jsx(l.IconButton,{disabled:y,onClick:j,children:C}),e[11]=y,e[12]=j,e[13]=C,e[14]=I):I=e[14];let k;e[15]!==x?(k=H=>x("from",H===null?null:H.toString()),e[15]=x,e[16]=k):k=e[16];let L;e[17]!==r.from||e[18]!==a||e[19]!==k?(L=s.jsx(l.TextInput,{type:"date",value:r.from,onChange:k,InputContainer:l.NoInputContainer,size:a}),e[17]=r.from,e[18]=a,e[19]=k,e[20]=L):L=e[20];const E=m[Es.find(H=>H[0]===d)[1]];let D;e[21]!==E?(D=E.substring(0,1),e[21]=E,e[22]=D):D=e[22];let _;e[23]!==D?(_=s.jsx(l.DropdownToggle,{text:D,as:Nu}),e[23]=D,e[24]=_):_=e[24];let R;e[25]!==m||e[26]!==g||e[27]!==d?(R=Es.map(H=>s.jsx(l.DropdownItem,{disabled:H[0]===d,className:l.classNames(H[0]===d?"text-black-50":""),onClick:()=>g(H[0]),role:"button",children:m[H[1]]},H[0])),e[25]=m,e[26]=g,e[27]=d,e[28]=R):R=e[28];let $;e[29]!==_||e[30]!==R?($=s.jsx(l.Dropdown,{toggle:_,children:R}),e[29]=_,e[30]=R,e[31]=$):$=e[31];let A;e[32]!==x?(A=H=>x("to",H===null?null:H.toString()),e[32]=x,e[33]=A):A=e[33];let T;e[34]!==r.to||e[35]!==a||e[36]!==A?(T=s.jsx(l.TextInput,{type:"date",value:r.to,onChange:A,InputContainer:l.NoInputContainer,size:a}),e[34]=r.to,e[35]=a,e[36]=A,e[37]=T):T=e[37];let F;e[38]!==L||e[39]!==$||e[40]!==T?(F=s.jsx("div",{children:s.jsxs("div",{className:"d-flex align-items-center gap-1",children:[L,$,T]})}),e[38]=L,e[39]=$,e[40]=T,e[41]=F):F=e[41];let P;e[42]!==p?(P=()=>{p(1)},e[42]=p,e[43]=P):P=e[43];let M;e[44]!==u?(M=s.jsx(u,{icon:"chevron-right"}),e[44]=u,e[45]=M):M=e[45];let O;e[46]!==y||e[47]!==P||e[48]!==M?(O=s.jsx(l.IconButton,{disabled:y,onClick:P,children:M}),e[46]=y,e[47]=P,e[48]=M,e[49]=O):O=e[49];let z;return e[50]!==F||e[51]!==O||e[52]!==S||e[53]!==I?(z=s.jsxs("div",{className:S,children:[I,F,O]}),e[50]=F,e[51]=O,e[52]=S,e[53]=I,e[54]=z):z=e[54],z},Pu=n=>{const e=l.compilerRuntimeExports.c(13),{defaultMonth:t,searchKey:o,yearMin:a,yearMax:r}=n,i=o===void 0?"monthFrom":o,{localizationContext:c}=N.useContext(l.LuminusComponentsContext),{dateFnsLocale:u}=N.useContext(c),{searchParams:m,setSearch:d}=dt.useSearchQuery();let f;if(e[0]!==t||e[1]!==i||e[2]!==m){const h=m.get(i);f=h?l.parseISO(h):t,e[0]=t,e[1]=i,e[2]=m,e[3]=f}else f=e[3];const p=f;let g;e[4]!==i||e[5]!==d?(g=h=>{d(i,It(h,{representation:"date"}))},e[4]=i,e[5]=d,e[6]=g):g=e[6];const x=g;let y;return e[7]!==u||e[8]!==p||e[9]!==x||e[10]!==r||e[11]!==a?(y=s.jsx(fo,{month:p,onChangeMonth:x,locale:u,yearMin:a,yearMax:r}),e[7]=u,e[8]=p,e[9]=x,e[10]=r,e[11]=a,e[12]=y):y=e[12],y},Au=n=>{const e=l.compilerRuntimeExports.c(15);let t,o,a;e[0]!==n?({defaultYear:t,searchKey:a,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const r=a===void 0?"yearFrom":a;let i;e[4]!==t?(i=It(t,{representation:"date"}),e[4]=t,e[5]=i):i=e[5];const[c,u]=dt.useSearchQueryState(r,i);let m;e[6]!==t||e[7]!==c?(m=c?l.parseISO(c):t,e[6]=t,e[7]=c,e[8]=m):m=e[8];const d=m;let f;e[9]!==u?(f=x=>{u(It(x,{representation:"date"}))},e[9]=u,e[10]=f):f=e[10];const p=f;let g;return e[11]!==p||e[12]!==o||e[13]!==d?(g=s.jsx(po,{year:d,onChangeYear:p,...o}),e[11]=p,e[12]=o,e[13]=d,e[14]=g):g=e[14],g},Mu=n=>{const e=l.compilerRuntimeExports.c(17),{data:t,showLegend:o,legendPosition:a,onClick:r}=n,i=o===void 0?!1:o,c=a===void 0?"left":a,{chartColorPalette:u}=N.useContext(l.LuminusComponentsContext),m=i&&c==="right"?200:100,d=i&&c==="left"?200:100;let f;e[0]!==m||e[1]!==d?(f={top:50,right:m,bottom:50,left:d},e[0]=m,e[1]=d,e[2]=f):f=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={from:"color",modifiers:[["darker",.5]]},e[3]=p):p=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g={from:"color",modifiers:[["darker",.5]]},e[4]=g):g=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x={from:"color"},e[5]=x):x=e[5];let y;e[6]!==c||e[7]!==i?(y=i?[{anchor:c,direction:c==="left"||c==="right"?"column":"row",justify:!1,translateX:c==="left"?-200:c==="right"?200:0,translateY:c==="top"?-50:c==="bottom"?50:0,itemsSpacing:4,itemWidth:120,itemHeight:18,itemTextColor:"#1e2832",itemDirection:"left-to-right",itemOpacity:1,symbolSize:18,symbolShape:"circle",padding:10}]:[],e[6]=c,e[7]=i,e[8]=y):y=e[8];let h;e[9]!==r?(h=b=>r&&r(b.data),e[9]=r,e[10]=h):h=e[10];let v;return e[11]!==u||e[12]!==t||e[13]!==h||e[14]!==f||e[15]!==y?(v=s.jsx(l.te,{data:t,margin:f,innerRadius:.4,padAngle:4,cornerRadius:2,activeOuterRadiusOffset:10,borderWidth:2,borderColor:p,colors:u,arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:g,arcLinkLabelsThickness:2,arcLinkLabelsColor:x,enableArcLabels:!1,legends:y,onClick:h}),e[11]=u,e[12]=t,e[13]=h,e[14]=f,e[15]=y,e[16]=v):v=e[16],v},Ou=n=>{var I,k;const e=l.compilerRuntimeExports.c(23),{val:t,translateKey:o,data:a,unit:r}=n,i=t.point.id.split("."),c=i[0],u=Number(i[1]),m=t.point.x<100?"56%":"-56%",d=t.point.y<60?"70px":"8px",f=`translate(${m}, ${d})`;let p;e[0]!==f?(p={transform:f},e[0]=f,e[1]=p):p=e[1];const g=p;let x;e[2]!==o||e[3]!==t.point.seriesId?(x=o(t.point.seriesId),e[2]=o,e[3]=t.point.seriesId,e[4]=x):x=e[4];let y;e[5]!==x?(y=s.jsx(l.Typography,{variant:"body",children:x}),e[5]=x,e[6]=y):y=e[6];let h;e[7]!==t.point.data.x?(h=(I=t.point.data.x)==null?void 0:I.toString(),e[7]=t.point.data.x,e[8]=h):h=e[8];let v;e[9]!==h?(v=s.jsxs(l.Typography,{variant:"body",className:"pe-1",children:[h,":"]}),e[9]=h,e[10]=v):v=e[10];const b=(k=a==null?void 0:a[u])==null?void 0:k[c];let w;e[11]!==r?(w=r&&s.jsx("span",{className:"ms-1",children:r}),e[11]=r,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=s.jsxs(l.Typography,{variant:"body",className:"fw-bold",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let j;e[16]!==v||e[17]!==S?(j=s.jsxs("div",{className:"d-flex",children:[v,S]}),e[16]=v,e[17]=S,e[18]=j):j=e[18];let C;return e[19]!==g||e[20]!==j||e[21]!==y?(C=s.jsxs("div",{className:"bg-white shadow-sm px-2 py-1 rounded",style:g,children:[y,j]}),e[19]=g,e[20]=j,e[21]=y,e[22]=C):C=e[22],C},Bu=n=>{var oe;const e=l.compilerRuntimeExports.c(68),{data:t,xKey:o,yKeys:a,translateKey:r,usePercentageValue:i,variant:c,legendPosition:u,noSort:m,unit:d}=n,f=i===void 0?!1:i,p=c===void 0?"default":c,g=m===void 0?!1:m,{confirm:x}=l.useConfirm(),{chartColorPalette:y,texts:h}=N.useContext(l.LuminusComponentsContext),{chart:v}=h;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[w,S]=N.useState(b),j=N.useRef(null);let C;e[1]!==v||e[2]!==x?(C=async()=>{var ee;const J=(ee=j.current)==null?void 0:ee.querySelector("svg");if(J&&await x(v.confirmExport)){const ne=J.cloneNode(!0);ne.setAttribute("fill","none");const ve=new XMLSerializer().serializeToString(ne);l.saveFile(new Blob([ve],{type:"image/svg+xml"}),"graf.svg")}},e[1]=v,e[2]=x,e[3]=C):C=e[3];const I=C;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=J=>{S(ee=>{const ne=new Set(ee);return ne.has(J.id)?ne.delete(J.id):ne.add(J.id),ne})},e[4]=k):k=e[4];const L=k;let E;e[5]!==t||e[6]!==g||e[7]!==o?(E=g?t:t.toSorted((J,ee)=>{var ne;return typeof ee[o]=="number"&&typeof J[o]=="number"?J[o]-ee[o]:(J[o]??"").toString().localeCompare(((ne=ee[o])==null?void 0:ne.toString())??"")}),e[5]=t,e[6]=g,e[7]=o,e[8]=E):E=e[8];const D=E;let _;e[9]!==D||e[10]!==f||e[11]!==o||e[12]!==a?(_=[],a.forEach(J=>{if(f){const ee=Math.max(...D.map(ce=>ce[J.key]??-1/0));if(ee===-1/0)return;const ne=[];D.forEach(ce=>{ce[J.key]!=null&&ne.push({x:ce[o],y:ee===0?0:ce[J.key]/ee})}),_.push({id:J.key,data:ne})}else _.push({id:J.key,data:D.map(ee=>({x:ee[o],y:ee[J.key]}))})}),e[9]=D,e[10]=f,e[11]=o,e[12]=a,e[13]=_):_=e[13];const R=_;let $;e[14]!==D||e[15]!==r||e[16]!==d||e[17]!==a?($=J=>{var ee;return s.jsx(Ou,{data:D,translateKey:r,val:J,unit:((ee=a.find(ne=>{var ce;return ne.key===((ce=J.point)==null?void 0:ce.seriesId)}))==null?void 0:ee.unit)??d??void 0})},e[14]=D,e[15]=r,e[16]=d,e[17]=a,e[18]=$):$=e[18];const A=$;let T;if(e[19]!==t||e[20]!==o){let J;e[22]!==o?(J=ee=>ee[o]??1/0,e[22]=o,e[23]=J):J=e[23],T=Math.min(...t.map(J)),e[19]=t,e[20]=o,e[21]=T}else T=e[21];const F=T;let P;if(e[24]!==t||e[25]!==o){let J;e[27]!==o?(J=ee=>ee[o]??-1/0,e[27]=o,e[28]=J):J=e[28],P=Math.max(...t.map(J)),e[24]=t,e[25]=o,e[26]=P}else P=e[26];const M=P,O=typeof((oe=t==null?void 0:t[0])==null?void 0:oe[o]),z=u??(p==="sideContent"?"bottom":"right"),H=!f&&p!=="sideContent";let W;e[29]!==M||e[30]!==F?(W=[F,M],e[29]=M,e[30]=F,e[31]=W):W=e[31];const B=W;let U;e[32]!==I?(U=()=>I(),e[32]=I,e[33]=U):U=e[33];let V;e[34]!==F||e[35]!==O?(V=O==="string"?{type:"point"}:{type:"linear",min:F},e[34]=F,e[35]=O,e[36]=V):V=e[36];let X;e[37]===Symbol.for("react.memo_cache_sentinel")?(X={type:"linear",nice:!0},e[37]=X):X=e[37];let Y;e[38]!==H||e[39]!==f?(Y=H?{tickSize:5,tickPadding:5,tickRotation:0,legend:f?"%":"count",legendOffset:-40,legendPosition:"middle",truncateTickAt:0}:null,e[38]=H,e[39]=f,e[40]=Y):Y=e[40];const Z=p==="sideContent"?B:void 0;let te;e[41]!==Z?(te={tickValues:Z},e[41]=Z,e[42]=te):te=e[42];let se;e[43]!==p?(se=p==="sideContent"?[0]:void 0,e[43]=p,e[44]=se):se=e[44];let q;e[45]!==y||e[46]!==w||e[47]!==z||e[48]!==r||e[49]!==a?(q=z!=="none"?[{data:a.map((J,ee)=>({id:J.key,label:r(J.key),color:y==null?void 0:y[ee],hidden:w.has(J.key)})),onClick:L,anchor:z,direction:z==="right"?"column":"row",toggleSerie:!0,justify:!1,translateX:z==="right"?120:void 0,translateY:z==="right"?0:z==="bottom"?44:void 0,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:100,itemHeight:20,itemOpacity:.75,symbolSize:12,symbolShape:"circle",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .04)",itemOpacity:1,symbolSize:14}}]}]:void 0,e[45]=y,e[46]=w,e[47]=z,e[48]=r,e[49]=a,e[50]=q):q=e[50];let ae;e[51]===Symbol.for("react.memo_cache_sentinel")?(ae={theme:"background"},e[51]=ae):ae=e[51];let re;e[52]===Symbol.for("react.memo_cache_sentinel")?(re={from:"serieColor"},e[52]=re):re=e[52];const me=z==="right"?130:20,fe=z==="bottom"?44:20,Q=H?50:20;let K;e[53]!==me||e[54]!==fe||e[55]!==Q?(K={top:10,right:me,bottom:fe,left:Q},e[53]=me,e[54]=fe,e[55]=Q,e[56]=K):K=e[56];let G;return e[57]!==y||e[58]!==R||e[59]!==U||e[60]!==V||e[61]!==Y||e[62]!==te||e[63]!==se||e[64]!==q||e[65]!==K||e[66]!==A?(G=s.jsx("div",{ref:j,className:"d-flex h-100 w-100",children:s.jsx(l.Me,{onClick:U,data:R,xScale:V,yScale:X,axisLeft:Y,axisBottom:te,gridYValues:se,legends:q,pointSize:6,pointColor:ae,pointBorderWidth:2,pointBorderColor:re,margin:K,colors:y,isInteractive:!0,enableCrosshair:!0,enableTouchCrosshair:!0,useMesh:!0,animate:!1,tooltip:A})}),e[57]=y,e[58]=R,e[59]=U,e[60]=V,e[61]=Y,e[62]=te,e[63]=se,e[64]=q,e[65]=K,e[66]=A,e[67]=G):G=e[67],G},zu=n=>{const e=l.compilerRuntimeExports.c(9),{errors:t,schema:o}=n;let a;e[0]!==o?(a=u=>{var m,d;return u.toLowerCase()==="others"?"Obecné":((d=(m=o.columns)==null?void 0:m.find(f=>f.field===u))==null?void 0:d.caption)??u},e[0]=o,e[1]=a):a=e[1];const r=a;let i;if(e[2]!==t||e[3]!==r){let u;e[5]!==r?(u=m=>s.jsxs("tr",{children:[s.jsx("td",{className:"fw-bold pe-2",children:s.jsxs(l.Typography,{variant:"body",children:[r(m.name),":"]})}),s.jsx("td",{className:"",children:s.jsx(l.Typography,{variant:"body",children:m.errors})})]},m.name),e[5]=r,e[6]=u):u=e[6],i=t.map(u),e[2]=t,e[3]=r,e[4]=i}else i=e[4];let c;return e[7]!==i?(c=s.jsx("div",{className:"alert alert-danger w-100 m-0 p-2",children:s.jsx("table",{children:s.jsx("tbody",{children:i})})}),e[7]=i,e[8]=c):c=e[8],c},nl=n=>{const e={};return Object.keys(n).forEach(t=>{if(n[t].value===!0){e[t]=1;return}if(n[t].value===!1){e[t]=0;return}e[t]=n[t].value}),e},Rs=(n,e)=>{const t={};return Object.keys(n).forEach(o=>{var i;const a=n[o],r=(i=e.columns)==null?void 0:i.find(c=>c.field===o);if((r==null?void 0:r.type)==="BIT"&&(a===1||a===0)){t[o]={value:a===1,defaultValue:a===1};return}t[o]={value:a,defaultValue:a}}),t},Hu="_table_1klfy_1",Vu="_table-header_1klfy_10",Wu="_table-row_1klfy_10",Uu="_table-head_1klfy_10",Gu="_filters-row_1klfy_19",Ku="_table-body_1klfy_30",Yu="_table-cell_1klfy_30",qu="_action-column_1klfy_43",Qu="_sticky-top_1klfy_47",Xu="_sticky-first_1klfy_54",Zu="_sticky-last_1klfy_61",_e={table:Hu,tableHeader:Vu,tableRow:Wu,tableHead:Uu,filtersRow:Gu,tableBody:Ku,tableCell:Yu,actionColumn:qu,stickyTop:Qu,stickyFirst:Xu,stickyLast:Zu},Ju="_input_pxkkh_1",ct={input:Ju},em="_multiselect_134m5_1",tm="_multiselect-menu_134m5_10",nm="_dropdown-item_134m5_18",sm="_special-option_134m5_24",Ct={multiselect:em,multiselectMenu:tm,dropdownItem:nm,specialOption:sm},$s=10,Fs=({value:n,field:e,disabled:t,valuesForSelect:o,onChangeHandler:a,separator:r})=>{var h,v,b,w;const{texts:{dynamicForms:i}}=N.useContext(l.LuminusComponentsContext),[c,u]=N.useState("");o==null||o.sort((S,j)=>(S.name??"").localeCompare(j.name??""));const m=N.useMemo(()=>{var S;return n?(S=n==null?void 0:n.toString())==null?void 0:S.split(r):[]},[n,r]),d=N.useCallback((S,j)=>{const C=S.split(r),I=j?C.every(k=>m.includes(k))&&m.length===C.length?null:C:S===""?void 0:m.includes(S)?m.filter(k=>k!==S):[...m,S];a(I!=null&&I.length?I.join(r):null)},[a,m,r]),f=N.useMemo(()=>{const S=[{value:o.map(j=>{var C;return((C=j.id)==null?void 0:C.toString())??""}).join(r),label:i.allOptionsMultiselect,specialOption:!0}];return o.forEach(j=>{var C,I;S.push({value:((C=j.id)==null?void 0:C.toString())??"",label:((I=j.name)==null?void 0:I.toString())??"",specialOption:!1})}),S},[o,i,r]),p=N.useRef(null),g=N.useRef(null),[x,y]=N.useState(!1);return N.useEffect(()=>{x&&g.current&&g.current.focus()},[x]),N.useEffect(()=>{f.length<$s&&u("")},[f]),s.jsxs(l.Dropdown$1,{autoClose:"outside",onToggle:S=>y(S),children:[s.jsx(l.Dropdown$1.Toggle,{variant:"light",ref:p,id:`multiselect-${e}`,size:"sm",className:l.classNames("bg-white border",Ct.multiselect),onKeyDown:S=>{t||S.key==="Escape"&&a(null)},children:m.length>1||m.length===0?i.xValuesMultiselect(m.length):m.length===1?(h=f.find(S=>S.value===m.at(0)))==null?void 0:h.label:i.allOptionsMultiselect}),s.jsxs(l.Dropdown$1.Menu,{className:l.classNames(Ct.multiselectMenu),style:{left:(v=p.current)==null?void 0:v.getBoundingClientRect().left,top:(b=p.current)==null?void 0:b.getBoundingClientRect().bottom,maxWidth:`max(300px, ${(w=p.current)==null?void 0:w.getBoundingClientRect().width}px)`},children:[f.length>=$s?s.jsx(l.Dropdown$1.Item,{className:l.classNames("rounded",Ct.dropdownItem,Ct.searchItem),children:s.jsx(l.Form.Control,{ref:g,type:"search",size:"sm",value:c,onChange:S=>u(S.target.value??""),className:"w-100"})}):null,f.filter(S=>S.specialOption?!0:c?l.stringSearchWithin(S.value,c):!0).map(S=>s.jsx(l.Dropdown$1.Item,{onClick:()=>!t&&d(S.value,S.specialOption),disabled:t,className:l.classNames("rounded",Ct.dropdownItem,{[Ct.specialOption]:S.specialOption},{"text-muted":t}),children:s.jsx(l.Form.Check,{disabled:t,label:S.label,checked:S.specialOption?m.length===S.value.split(r).length&&m.every(j=>S.value.split(r).includes(j)):m.includes(S.value),onChange:()=>{}})},S.value))]})]})},sl=n=>{var v;const e=l.compilerRuntimeExports.c(106),{type:t,value:o,field:a,isPrimary:r,isReadonly:i,primaryEditable:c,valuesForSelect:u,addValueToValuesForSelect:m,onChangeHandler:d,hideClearIcon:f,clearValue:p,customPickers:g,isMultiChoice:x,multiChoiceSeparator:y}=n,h=c===void 0?!1:c;switch(t){case"NUM":{if(u&&u.length>0){if(!x){let _;e[0]!==o?(_=(o==null?void 0:o.toString())??"",e[0]=o,e[1]=_):_=e[1];let R;e[2]!==a||e[3]!==d?(R=F=>d(a,F===null?null:Number(F)),e[2]=a,e[3]=d,e[4]=R):R=e[4];const $=i?!0:r?!h:!1,A=!f;let T;return e[5]!==p||e[6]!==_||e[7]!==R||e[8]!==$||e[9]!==A||e[10]!==u?(T=s.jsx(l.CustomSelectInput,{withoutLabel:!0,InputContainer:l.NoInputContainer,className:ct.input,size:"sm",value:_,onChange:R,options:u,disabled:$,showClearIcon:A,clearValue:p,dropdownWidth:200}),e[5]=p,e[6]=_,e[7]=R,e[8]=$,e[9]=A,e[10]=u,e[11]=T):T=e[11],T}let I;e[12]!==o?(I=(o==null?void 0:o.toString())??"",e[12]=o,e[13]=I):I=e[13];const k=y??",";let L;e[14]!==a||e[15]!==d?(L=_=>d(a,_),e[14]=a,e[15]=d,e[16]=L):L=e[16];const E=i?!0:r?!h:!1;let D;return e[17]!==a||e[18]!==I||e[19]!==k||e[20]!==L||e[21]!==E||e[22]!==u?(D=s.jsx(Fs,{field:a,value:I,separator:k,onChangeHandler:L,valuesForSelect:u,disabled:E}),e[17]=a,e[18]=I,e[19]=k,e[20]=L,e[21]=E,e[22]=u,e[23]=D):D=e[23],D}const b=o===null?null:Number(o);let w;e[24]!==a||e[25]!==d?(w=I=>d(a,I===null?null:Number(I)),e[24]=a,e[25]=d,e[26]=w):w=e[26];const S=i?!0:r?!h:!1,j=!f;let C;return e[27]!==p||e[28]!==b||e[29]!==w||e[30]!==S||e[31]!==j?(C=s.jsx(l.TextInput,{withoutLabel:!0,InputContainer:l.NoInputContainer,className:ct.input,size:"sm",type:"number",value:b,onChange:w,disabled:S,showClearIcon:j,clearValue:p}),e[27]=p,e[28]=b,e[29]=w,e[30]=S,e[31]=j,e[32]=C):C=e[32],C}case"STR":{if(u&&u.length>0){if(!x){let R;e[33]!==o?(R=(o==null?void 0:o.toString())??"",e[33]=o,e[34]=R):R=e[34];let $;e[35]!==a||e[36]!==d?($=P=>d(a,(P==null?void 0:P.toString())??null),e[35]=a,e[36]=d,e[37]=$):$=e[37];const A=i?!0:r?!h:!1,T=!f;let F;return e[38]!==p||e[39]!==R||e[40]!==$||e[41]!==A||e[42]!==T||e[43]!==u?(F=s.jsx(l.CustomSelectInput,{withoutLabel:!0,InputContainer:l.NoInputContainer,className:ct.input,size:"sm",value:R,onChange:$,options:u,disabled:A,showClearIcon:T,clearValue:p,dropdownWidth:200}),e[38]=p,e[39]=R,e[40]=$,e[41]=A,e[42]=T,e[43]=u,e[44]=F):F=e[44],F}let k;e[45]!==o?(k=(o==null?void 0:o.toString())??"",e[45]=o,e[46]=k):k=e[46];const L=y??",";let E;e[47]!==a||e[48]!==d?(E=R=>{d(a,R)},e[47]=a,e[48]=d,e[49]=E):E=e[49];const D=i?!0:r?!h:!1;let _;return e[50]!==a||e[51]!==k||e[52]!==L||e[53]!==E||e[54]!==D||e[55]!==u?(_=s.jsx(Fs,{field:a,value:k,separator:L,onChangeHandler:E,valuesForSelect:u,disabled:D}),e[50]=a,e[51]=k,e[52]=L,e[53]=E,e[54]=D,e[55]=u,e[56]=_):_=e[56],_}let b;e[57]===Symbol.for("react.memo_cache_sentinel")?(b=l.classNames(ct.input,ct.longer),e[57]=b):b=e[57];let w;e[58]!==o?(w=(o==null?void 0:o.toString())??"",e[58]=o,e[59]=w):w=e[59];let S;e[60]!==a||e[61]!==d?(S=k=>d(a,(k==null?void 0:k.toString())??null),e[60]=a,e[61]=d,e[62]=S):S=e[62];const j=i?!0:r?!h:!1,C=!f;let I;return e[63]!==p||e[64]!==w||e[65]!==S||e[66]!==j||e[67]!==C?(I=s.jsx(l.TextInput,{withoutLabel:!0,InputContainer:l.NoInputContainer,className:b,size:"sm",type:"text",value:w,onChange:S,disabled:j,showClearIcon:C,clearValue:p}),e[63]=p,e[64]=w,e[65]=S,e[66]=j,e[67]=C,e[68]=I):I=e[68],I}case"BIT":{const b=o===!0;let w;e[69]!==a||e[70]!==d?(w=C=>d(a,C),e[69]=a,e[70]=d,e[71]=w):w=e[71];const S=i?!0:r?!h:!1;let j;return e[72]!==b||e[73]!==w||e[74]!==S?(j=s.jsx(Dt,{InputContainer:l.NoInputContainer,className:ct.input,value:b,onChange:w,disabled:S}),e[72]=b,e[73]=w,e[74]=S,e[75]=j):j=e[75],j}case"DT":{let b;e[76]!==o?(b=o?o.toString().split("T")[0]??"":"",e[76]=o,e[77]=b):b=e[77];let w;e[78]!==a||e[79]!==d?(w=I=>d(a,(I==null?void 0:I.toString())??null),e[78]=a,e[79]=d,e[80]=w):w=e[80];const S=i?!0:r?!h:!1,j=!f;let C;return e[81]!==p||e[82]!==b||e[83]!==w||e[84]!==S||e[85]!==j?(C=s.jsx(l.TextInput,{withoutLabel:!0,InputContainer:l.NoInputContainer,className:ct.input,size:"sm",type:"date",value:b,onChange:w,disabled:S,showClearIcon:j,clearValue:p}),e[81]=p,e[82]=b,e[83]=w,e[84]=S,e[85]=j,e[86]=C):C=e[86],C}default:{let b;e[87]!==g||e[88]!==t?(b=g==null?void 0:g.find(E=>E.type===t),e[87]=g,e[88]=t,e[89]=b):b=e[89];const w=b;if(!w){let E;return e[90]!==t?(E=s.jsx("div",{className:"alert alert-warning p-1 m-0",children:s.jsxs(l.Typography,{variant:"body",children:["Neznámý typ ",t]})}),e[90]=t,e[91]=E):E=e[91],E}const S=w.picker;let j;e[92]===Symbol.for("react.memo_cache_sentinel")?(j=l.classNames(ct.input,ct.longer),e[92]=j):j=e[92];let C;e[93]!==o||e[94]!==u?(C=o?{id:(o==null?void 0:o.toString())??null,name:((v=u==null?void 0:u.find(E=>{var D;return((D=E.id)==null?void 0:D.toString())===(o==null?void 0:o.toString())}))==null?void 0:v.name)??""}:null,e[93]=o,e[94]=u,e[95]=C):C=e[95];let I;e[96]!==m||e[97]!==a||e[98]!==d||e[99]!==u?(I=E=>{var D;d(a,(E==null?void 0:E.id)??null),console.log(E,u==null?void 0:u.some(_=>{var R,$;return((R=_.id)==null?void 0:R.toString())===(($=E==null?void 0:E.id)==null?void 0:$.toString())}),m),E&&!(u!=null&&u.some(_=>{var R,$;return((R=_.id)==null?void 0:R.toString())===(($=E==null?void 0:E.id)==null?void 0:$.toString())}))&&m&&(console.log("adding to values for select"),m({id:((D=E.id)==null?void 0:D.toString())??"",name:E.name}))},e[96]=m,e[97]=a,e[98]=d,e[99]=u,e[100]=I):I=e[100];const k=i?!0:r?!h:!1;let L;return e[101]!==w.picker||e[102]!==C||e[103]!==I||e[104]!==k?(L=s.jsx(S,{className:j,value:C,onChange:I,disabled:k}),e[101]=w.picker,e[102]=C,e[103]=I,e[104]=k,e[105]=L):L=e[105],L}}},om=n=>{var T,F;const e=l.compilerRuntimeExports.c(43),{schema:t,columns:o,setColumns:a,initialItem:r,onEdit:i,onDelete:c,customPickers:u,appDetail:m}=n,{ProjectIconComponent:d}=N.useContext(l.LuminusComponentsContext),[f,p]=N.useState(r);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=(P,M)=>{console.log("changeValue",P,M),p(O=>({...O,[P]:{...O[P],value:M}}))},e[0]=g):g=e[0];const x=g,y=lm;let h;e[1]!==f?(h=()=>Object.keys(f).some(P=>y(f[P])),e[1]=f,e[2]=h):h=e[2];const v=h;let b,w;e[3]!==r?(b=()=>{p(r)},w=[r],e[3]=r,e[4]=b,e[5]=w):(b=e[4],w=e[5]),N.useEffect(b,w);let S,j;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=l.classNames("table-row",_e.tableRow),j=l.classNames("table-cell",_e.tableCell,_e.stickyFirst),e[6]=S,e[7]=j):(S=e[6],j=e[7]);let C;e[8]!==d||e[9]!==v||e[10]!==f||e[11]!==i?(C=v()&&s.jsx(l.IconButton,{color:"success",onClick:()=>i(nl(f)),children:s.jsx(d,{icon:"check"})}),e[8]=d,e[9]=v,e[10]=f,e[11]=i,e[12]=C):C=e[12];let I;e[13]!==C?(I=s.jsx("td",{className:j,children:C}),e[13]=C,e[14]=I):I=e[14];let k;e[15]!==o||e[16]!==u||e[17]!==f||e[18]!==t.id||e[19]!==t.primaryKey||e[20]!==a?(k=o.map(P=>{var M,O;return s.jsx("td",{className:l.classNames("table-cell",_e.tableCell),children:s.jsx(sl,{type:P.type,value:(M=f[P.field??""])==null?void 0:M.value,field:P.field,isReadonly:P.readOnly,isPrimary:t.primaryKey===P.field,valuesForSelect:P.valuesForSelect,addValueToValuesForSelect:z=>{a(o.map(H=>H.field===P.field?{...H,valuesForSelect:[...H.valuesForSelect??[],z]}:H))},onChangeHandler:x,hideClearIcon:!y(f[P.field??""]),clearValue:(O=f[P.field??""].defaultValue)==null?void 0:O.toString(),customPickers:u,isMultiChoice:P.multiChoice??!1,multiChoiceSeparator:P.multiChoiceSeparator??null})},`${t.id}-${P.field}`)}),e[15]=o,e[16]=u,e[17]=f,e[18]=t.id,e[19]=t.primaryKey,e[20]=a,e[21]=k):k=e[21];let L;e[22]===Symbol.for("react.memo_cache_sentinel")?(L=l.classNames("table-cell d-flex gap-1",_e.tableCell,_e.stickyLast),e[22]=L):L=e[22];let E;e[23]!==m||e[24]!==((T=f.id)==null?void 0:T.value)||e[25]!==t.slaves?(E=t!=null&&t.slaves&&t.slaves.length>0?t.slaves.map((P,M)=>{var O,z;return s.jsx(l.IconButton,{as:"link",href:`${Ne.generatePath(m,{id:(O=P.id)==null?void 0:O.toString()})}?type=dynamic-form&masterId=${(z=f.id)==null?void 0:z.value}`,children:s.jsx(l.SimpleTooltip,{text:P.name??"",placement:"left",children:s.jsx("div",{children:s.jsxs(l.Typography,{variant:"body",className:"d-flex align-items-center text-primary",children:[t.slaves.length>1?s.jsx(l.Typography,{variant:"caption",className:"text-primary",children:M+1}):null,s.jsx(l.MdOutlineSubdirectoryArrowRight,{})]})})})},P.id)}):null,e[23]=m,e[24]=(F=f.id)==null?void 0:F.value,e[25]=t.slaves,e[26]=E):E=e[26];let D;e[27]!==f||e[28]!==c||e[29]!==t.primaryKey?(D=()=>c(f[t.primaryKey??""].value),e[27]=f,e[28]=c,e[29]=t.primaryKey,e[30]=D):D=e[30];let _;e[31]!==d?(_=s.jsx(d,{icon:"delete"}),e[31]=d,e[32]=_):_=e[32];let R;e[33]!==D||e[34]!==_?(R=s.jsx(l.IconButton,{color:"danger",onClick:D,children:_}),e[33]=D,e[34]=_,e[35]=R):R=e[35];let $;e[36]!==E||e[37]!==R?($=s.jsxs("td",{className:L,children:[E,R]}),e[36]=E,e[37]=R,e[38]=$):$=e[38];let A;return e[39]!==$||e[40]!==I||e[41]!==k?(A=s.jsxs("tr",{className:S,children:[I,k,$]}),e[39]=$,e[40]=I,e[41]=k,e[42]=A):A=e[42],A};function lm(n){return(n==null?void 0:n.value)!==(n==null?void 0:n.defaultValue)}const am=n=>{const e=l.compilerRuntimeExports.c(13),{schema:t,columns:o,setColumns:a,onCreate:r,customPickers:i}=n,{ProjectIconComponent:c}=N.useContext(l.LuminusComponentsContext),[u,m]=N.useState(null);let d;e[0]!==t.columns?(d=()=>{var h;const y={};(h=t.columns)==null||h.forEach(v=>{const b=v.type==="BIT"?!1:v.type==="NUM"?null:v.type==="STR"?"":null;y[v.field??""]={value:b,defaultValue:b}}),m(y)},e[0]=t.columns,e[1]=d):d=e[1];const f=d;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=(y,h)=>{m(v=>v&&{...v,[y]:{...v[y],value:h}})},e[2]=p):p=e[2];const g=p;let x;return e[3]!==c||e[4]!==o||e[5]!==i||e[6]!==f||e[7]!==u||e[8]!==r||e[9]!==t.id||e[10]!==t.primaryKey||e[11]!==a?(x=u?s.jsxs("tr",{className:"sticky-bottom shadow",children:[s.jsx("td",{className:"sticky-first",children:s.jsx(l.IconButton,{color:"success",onClick:async()=>{const y=nl(u);y&&await r(y)&&m(null)},children:s.jsx(c,{icon:"check"})})}),o.map(y=>s.jsx("td",{children:s.jsx(sl,{type:y.type,value:u[y.field??""].value,field:y.field,isReadonly:y.readOnly,isPrimary:t.primaryKey===y.field,valuesForSelect:y.valuesForSelect,addValueToValuesForSelect:h=>{a(o.map(v=>v.field===y.field?{...v,valuesForSelect:[...v.valuesForSelect??[],h]}:v))},onChangeHandler:g,primaryEditable:!0,customPickers:i,isMultiChoice:y.multiChoice??!1,multiChoiceSeparator:y.multiChoiceSeparator??null})},`${t.id}-${y.field}`)),s.jsx("td",{className:"sticky-last",children:s.jsx(l.IconButton,{color:"danger",onClick:()=>m(null),children:s.jsx(c,{icon:"cancel"})})})]}):s.jsxs("tr",{className:"sticky-bottom shadow",children:[s.jsx("td",{className:"sticky-first",children:s.jsx(l.IconButton,{onClick:f,children:s.jsx(c,{icon:"add"})})}),s.jsx("td",{colSpan:o.length+1})]}),e[3]=c,e[4]=o,e[5]=i,e[6]=f,e[7]=u,e[8]=r,e[9]=t.id,e[10]=t.primaryKey,e[11]=a,e[12]=x):x=e[12],x},rm="_resizer_ref0b_1",im="_content_ref0b_11",cm="_dragging_ref0b_16",Kt={resizer:rm,content:im,dragging:cm},ol=n=>{const e=l.compilerRuntimeExports.c(20),{cellRef:t,defaultWidth:o}=n,[a,r]=N.useState(o),[,i]=N.useState(null);let c,u;e[0]!==o?(c=()=>{r(o)},u=[o],e[0]=o,e[1]=c,e[2]=u):(c=e[1],u=e[2]),N.useEffect(c,u);let m,d;e[3]!==t||e[4]!==a?(m=()=>{t.current&&(t.current.style.minWidth=`${a}px`)},d=[a,t],e[3]=t,e[4]=a,e[5]=m,e[6]=d):(m=e[5],d=e[6]),N.useEffect(m,d);let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.classNames("luminus-column-resizer",Kt.resizer),e[7]=f):f=e[7];let p;e[8]!==i?(p=v=>{i(v.currentTarget.getBoundingClientRect().x),v.currentTarget.classList.add(Kt.dragging)},e[8]=i,e[9]=p):p=e[9];let g;e[10]!==t||e[11]!==i?(g=v=>{i(b=>(t.current&&r(w=>w+v.clientX-(b??0)),v.clientX))},e[10]=t,e[11]=i,e[12]=g):g=e[12];let x;e[13]!==i?(x=v=>{i(null),v.currentTarget.classList.remove(Kt.dragging)},e[13]=i,e[14]=x):x=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:l.classNames("content",Kt.content)}),e[15]=y):y=e[15];let h;return e[16]!==p||e[17]!==g||e[18]!==x?(h=s.jsx("div",{className:f,draggable:!0,onDragStart:p,onDrag:g,onDragEnd:x,children:y}),e[16]=p,e[17]=g,e[18]=x,e[19]=h):h=e[19],h},dm=n=>{const e=l.compilerRuntimeExports.c(10),{column:t,children:o}=n,{ProjectIconComponent:a}=N.useContext(l.LuminusComponentsContext);if(t.description){const i=t.description??"";let c;e[0]!==a?(c=s.jsx(a,{icon:"info"}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==o||e[3]!==c?(u=s.jsxs("div",{className:"d-flex justify-content-between",children:[o,c]}),e[2]=o,e[3]=c,e[4]=u):u=e[4];let m;return e[5]!==i||e[6]!==u?(m=s.jsx(l.SimpleTooltip,{placement:"bottom",text:i,children:u}),e[5]=i,e[6]=u,e[7]=m):m=e[7],m}let r;return e[8]!==o?(r=s.jsx(s.Fragment,{children:o}),e[8]=o,e[9]=r):r=e[9],r},um=n=>{const e=l.compilerRuntimeExports.c(23),{column:t,sortByField:o,sortByType:a,setSortBy:r}=n,{ProjectIconComponent:i}=N.useContext(l.LuminusComponentsContext),c=N.useRef(null);let u;e:{if(t.valuesForSelect&&t.valuesForSelect.length>0){u=200;break e}switch(t.type){case"NUM":{u=80;break e}case"STR":{u=200;break e}case"BIT":{u=50;break e}case"DT":{u=100;break e}default:u=100}}const m=u;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.classNames("table-head",_e.tableHead),e[0]=d):d=e[0];let f;e[1]!==t.field||e[2]!==r||e[3]!==o||e[4]!==a?(f=()=>{const v=o===t.field?a:null;if(v==="asc"){r(t.field,"desc");return}if(v==="desc"){r(t.field,null);return}r(t.field,"asc")},e[1]=t.field,e[2]=r,e[3]=o,e[4]=a,e[5]=f):f=e[5];let p;e[6]!==i||e[7]!==t.field||e[8]!==o||e[9]!==a?(p=o===t.field&&s.jsx(i,{icon:a==="asc"?"chevron-up":"chevron-down"}),e[6]=i,e[7]=t.field,e[8]=o,e[9]=a,e[10]=p):p=e[10];let g;e[11]!==t.label||e[12]!==p?(g=s.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.label,p]}),e[11]=t.label,e[12]=p,e[13]=g):g=e[13];let x;e[14]!==t||e[15]!==g?(x=s.jsx(dm,{column:t,children:g}),e[14]=t,e[15]=g,e[16]=x):x=e[16];let y;e[17]!==m?(y=s.jsx(ol,{cellRef:c,defaultWidth:m}),e[17]=m,e[18]=y):y=e[18];let h;return e[19]!==f||e[20]!==x||e[21]!==y?(h=s.jsxs("th",{ref:c,className:d,onClick:f,children:[x,y]}),e[19]=f,e[20]=x,e[21]=y,e[22]=h):h=e[22],h},mm=n=>{const e=l.compilerRuntimeExports.c(76),{schema:t,items:o,onEditItem:a,onDeleteItem:r,onCreateItem:i,filters:c,setFilter:u,sortByField:m,sortByType:d,setSortBy:f,selectedMaster:p,customPickers:g,appDetail:x}=n,{texts:y}=N.useContext(l.LuminusComponentsContext),{dynamicForms:h}=y;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=[],e[0]=v):v=e[0];const[b,w]=N.useState(v);let S;e[1]!==t.columns||e[2]!==t.masterReference||e[3]!==t.masterReferenceColumn||e[4]!==p?(S=()=>{var U,V,X;w([...((X=(V=(U=t.columns)==null?void 0:U.filter(fm))==null?void 0:V.filter(Y=>t.masterReference?Y.field!==t.masterReferenceColumn:!0))==null?void 0:X.map(Y=>{var Z;return{label:Y.caption??"",width:100,description:Y.description??null,field:Y.field??"",type:Y.type,readOnly:Y.readOnly,valuesForSelect:((Z=Y.values)==null?void 0:Z.filter(te=>Y.valuesFilteredByMaster?te.masterValue===p:!0).map(pm))??void 0,multiChoice:Y.multiChoice??!1,multiChoiceSeparator:Y.multiChoiceSeparator??null}}))??[]])},e[1]=t.columns,e[2]=t.masterReference,e[3]=t.masterReferenceColumn,e[4]=p,e[5]=S):S=e[5];let j;e[6]!==t||e[7]!==p?(j=[t,p],e[6]=t,e[7]=p,e[8]=j):j=e[8],N.useEffect(S,j);const C=`dynamic-table-${t.id}`;let I,k,L,E;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=l.classNames("table table-borderless luminus-df-table",_e.table),k=l.classNames("text-nowrap table-header",_e.stickyTop,_e.tableHeader),L=l.classNames("table-row",_e.tableRow),E=s.jsx("th",{className:l.classNames("table-head",_e.tableHead,_e.actionColumn,_e.stickyFirst)}),e[9]=I,e[10]=k,e[11]=L,e[12]=E):(I=e[9],k=e[10],L=e[11],E=e[12]);let D;if(e[13]!==b||e[14]!==t.id||e[15]!==f||e[16]!==m||e[17]!==d){let U;e[19]!==t.id||e[20]!==f||e[21]!==m||e[22]!==d?(U=V=>s.jsx(um,{column:V,sortByField:m,sortByType:d,setSortBy:f},`${t.id}-${V.field}`),e[19]=t.id,e[20]=f,e[21]=m,e[22]=d,e[23]=U):U=e[23],D=b.map(U),e[13]=b,e[14]=t.id,e[15]=f,e[16]=m,e[17]=d,e[18]=D}else D=e[18];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("th",{className:l.classNames("table-head",_e.tableHead,_e.actionColumn,_e.stickyLast)}),e[24]=_):_=e[24];let R;e[25]!==D?(R=s.jsxs("tr",{className:L,children:[E,D,_]}),e[25]=D,e[26]=R):R=e[26];let $,A;e[27]===Symbol.for("react.memo_cache_sentinel")?($=l.classNames("table-row filters-row",_e.tableRow,_e.filtersRow),A=s.jsx("th",{className:l.classNames("table-head",_e.tableHead,_e.actionColumn,_e.stickyFirst)}),e[27]=$,e[28]=A):($=e[27],A=e[28]);let T;if(e[29]!==b||e[30]!==h||e[31]!==c||e[32]!==t.id||e[33]!==u){let U;e[35]!==h||e[36]!==c||e[37]!==t.id||e[38]!==u?(U=V=>s.jsx("th",{className:l.classNames("table-head",_e.tableHead),children:V.valuesForSelect&&V.valuesForSelect.length>0||V.type==="BIT"?s.jsx(s.Fragment,{children:s.jsx(l.CustomSelectInput,{InputContainer:l.NoInputContainer,withoutLabel:!0,size:"sm",value:c[V.field]??"",onChange:X=>u(V.field,(X==null?void 0:X.toString())??null),options:V.type==="BIT"?[{id:1,name:h.yes},{id:0,name:h.no}]:V.valuesForSelect??[],isNumber:V.type==="BIT",showClearIcon:!0,dropdownWidth:200})}):s.jsx(s.Fragment,{children:s.jsx(l.TextInput,{InputContainer:l.NoInputContainer,withoutLabel:!0,size:"sm",type:V.type==="NUM"?"number":V.type==="DT"?"date":"text",value:c[V.field]??"",onChange:X=>u(V.field,(X==null?void 0:X.toString())??null)})})},`${t.id}-${V.field}`),e[35]=h,e[36]=c,e[37]=t.id,e[38]=u,e[39]=U):U=e[39],T=b.map(U),e[29]=b,e[30]=h,e[31]=c,e[32]=t.id,e[33]=u,e[34]=T}else T=e[34];let F;e[40]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("th",{className:l.classNames("table-head",_e.tableHead,_e.actionColumn,_e.stickyLast)}),e[40]=F):F=e[40];let P;e[41]!==T?(P=s.jsxs("tr",{className:$,children:[A,T,F]}),e[41]=T,e[42]=P):P=e[42];let M;e[43]!==R||e[44]!==P?(M=s.jsxs("thead",{className:k,children:[R,P]}),e[43]=R,e[44]=P,e[45]=M):M=e[45];let O;e[46]===Symbol.for("react.memo_cache_sentinel")?(O=l.classNames("table-body",_e.tableBody),e[46]=O):O=e[46];let z;if(e[47]!==x||e[48]!==b||e[49]!==g||e[50]!==o||e[51]!==r||e[52]!==a||e[53]!==t){let U;e[55]!==t.primaryKey?(U=X=>X[t.primaryKey??""],e[55]=t.primaryKey,e[56]=U):U=e[56];let V;e[57]!==x||e[58]!==b||e[59]!==g||e[60]!==r||e[61]!==a||e[62]!==t?(V=X=>s.jsx(om,{schema:t,columns:b,setColumns:w,initialItem:X,onEdit:a,onDelete:r,customPickers:g,appDetail:x},`${t.id}-${X[t.primaryKey??""].value}`),e[57]=x,e[58]=b,e[59]=g,e[60]=r,e[61]=a,e[62]=t,e[63]=V):V=e[63],z=o.filter(U).map(V),e[47]=x,e[48]=b,e[49]=g,e[50]=o,e[51]=r,e[52]=a,e[53]=t,e[54]=z}else z=e[54];let H;e[64]!==b||e[65]!==g||e[66]!==i||e[67]!==t?(H=s.jsx(am,{schema:t,columns:b,setColumns:w,onCreate:i,customPickers:g}),e[64]=b,e[65]=g,e[66]=i,e[67]=t,e[68]=H):H=e[68];let W;e[69]!==z||e[70]!==H?(W=s.jsxs("tbody",{className:O,children:[z,H]}),e[69]=z,e[70]=H,e[71]=W):W=e[71];let B;return e[72]!==M||e[73]!==W||e[74]!==C?(B=s.jsxs("table",{id:C,className:I,children:[M,W]}),e[72]=M,e[73]=W,e[74]=C,e[75]=B):B=e[75],B};function fm(n){return!n.hidden}function pm(n){return{id:n.id??"",name:n.name}}const hm=n=>{const e=l.compilerRuntimeExports.c(8),{master:t,onChange:o,options:a,label:r}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={minWidth:"200px"},e[0]=i):i=e[0];let c;e[1]!==o?(c=m=>o(m?m.toString():null),e[1]=o,e[2]=c):c=e[2];let u;return e[3]!==r||e[4]!==t||e[5]!==a||e[6]!==c?(u=s.jsx("div",{style:i,children:s.jsx(l.CustomSelectInput,{label:r,value:t,onChange:c,options:a,size:"sm"})}),e[3]=r,e[4]=t,e[5]=a,e[6]=c,e[7]=u):u=e[7],u},gm="_pagination_gujwe_1",Ps={pagination:gm},As={appDetail:"/settings/:id"},vt={apiSchemaGet:"/dynamicForms/schema",apiDataGet:"/dynamicForms/data",apiItemPost:"/dynamicForms/update",apiItemDelete:"/dynamicForms/delete",apiItemCreate:"/dynamicForms/insert",apiExportGet:"/dynamicForms/export"},xm=({id:n,page:e,setPage:t,filters:o,setFilter:a,sortByField:r,sortByType:i,setSortBy:c,appUrls:{appDetail:u=As.appDetail}=As,apiUrls:{apiSchemaGet:m=vt.apiSchemaGet,apiDataGet:d=vt.apiDataGet,apiItemPost:f=vt.apiItemPost,apiItemDelete:p=vt.apiItemDelete,apiItemCreate:g=vt.apiItemCreate,apiExportGet:x=vt.apiExportGet}=vt,customPickers:y})=>{var ce,ve,de,be,we,ke,Fe;const{texts:{dynamicForms:h},ProjectIconComponent:v}=N.useContext(l.LuminusComponentsContext),b=l.useAxios(),{startLoading:w,stopLoading:S}=N.useContext(l.LoadingContext),[j,C]=N.useState(null),[I,k]=N.useState(null),[L,E]=N.useState(null),[D,_]=N.useState(null),[R,$]=N.useState(!1),{addNotification:A}=l.useNotifications(),[T,F]=N.useState([]),{confirm:P}=l.useConfirm(),M=20,O=M+1,z=D?Math.ceil(D.length/M):1,H=e?e>1:!1,W=e?e<z:!1,B=e?(e-1)*M:0,U=e?e*M:M,V=N.useMemo(()=>D?D.length>O:!1,[D,O]),X=N.useMemo(()=>V?(D==null?void 0:D.slice(B,U))??null:D??null,[V,D,B,U]),[Y,Z]=dt.useSearchQueryState("masterId",null,"string"),[te,se]=N.useState(Y);N.useEffect(()=>{C(null),k(null),$(!1),F([])},[n]),N.useEffect(()=>{Y!==null&&(se(Y),Z(null))},[Y,n,Z]);const q=N.useCallback(async()=>{w("dynamicFormSchema"),await b.get(`${m}?id=${n}`).then(({data:le})=>{C(le),S("dynamicFormSchema")}).catch(()=>S("dynamicFormSchema"))},[b,n,w,S,m]),ae=N.useCallback(async()=>{var le;if(!(j===null||((le=j.id)==null?void 0:le.toString())!==n)){if(j.masterReference&&!te){k([]);return}w("dynamicFormData"),await b.get(`${d}?id=${n}&showArchive=${R}${j.masterReference?`&master=${te}`:""}`).then(({data:ue})=>{const he=ue.map(pe=>{var ye;return Object.fromEntries(((ye=j.columns)==null?void 0:ye.filter(je=>je.field).map(je=>[je.field,{value:pe[je.field??""],defaultValue:pe[je.field??""]}]))??[])});k(he),S("dynamicFormData")}).catch(()=>S("dynamicFormData"))}},[b,n,j,w,S,R,te,d]),re=N.useCallback(async()=>{var le;j===null||((le=j.id)==null?void 0:le.toString())!==n||j.masterReference&&!te||(w("dynamicFormExport"),await b.get(`${x}?id=${n}&showArchive=${R}${j.masterReference?`&master=${te}`:""}`,{responseType:"blob"}).then(ue=>l.saveFileFromResponse(ue,{fallbackName:`export-${n}`})).finally(()=>S("dynamicFormExport")))},[b,n,j,w,S,R,te,x]),me=N.useCallback(async le=>(w("dynamicFormEdit"),b.post(`${f}?id=${n}`,le).then(()=>(S("dynamicFormEdit"),F([]),!0)).catch(ue=>(S("dynamicFormEdit"),F(l.extractErrorsFromResponse(ue)),!1))),[b,n,w,S,f]),fe=N.useCallback(async le=>(w("dynamicFormDelete"),b.delete(`${p}?id=${n}&pk=${le}`).then(()=>(S("dynamicFormDelete"),F([]),!0)).catch(ue=>(S("dynamicFormDelete"),F(l.extractErrorsFromResponse(ue)),!1))),[b,n,w,S,p]),Q=N.useCallback(async le=>(w("dynamicFormCreate"),b.post(`${g}?id=${n}`,le).then(({data:ue})=>(S("dynamicFormCreate"),F([]),ue)).catch(ue=>(S("dynamicFormCreate"),F(l.extractErrorsFromResponse(ue)),null))),[b,n,w,S,g]),K=N.useCallback(async le=>{j&&await me(j.masterReference?{...le,[j.masterReferenceColumn??""]:te}:le)&&(A(h.editSuccess,"success"),k(ue=>ue&&ue.map(he=>{var pe;return((pe=he[(j==null?void 0:j.primaryKey)??""])==null?void 0:pe.value)===le[(j==null?void 0:j.primaryKey)??""]?Rs(le,j):he})))},[A,me,j,te,h]),G=N.useCallback(async le=>{await P(h.deleteConfirm)&&await fe(le)&&(A(h.deleteSuccess,"success"),k(ue=>ue&&ue.filter(he=>{var pe;return((pe=he[(j==null?void 0:j.primaryKey)??""])==null?void 0:pe.value)!==le})))},[A,fe,h,P,j]),oe=N.useCallback(async le=>{if(!j)return!1;const ue=await Q(j.masterReference?{...le,[j.masterReferenceColumn??""]:te}:le);if(ue!==null){A(h.createSuccess,"success");const he=Rs(le,j);return he[(j==null?void 0:j.primaryKey)??""]={value:ue,defaultValue:ue},k(pe=>[...pe??[],he]),!0}return!1},[A,Q,h,j,te]),J=le=>{le>z?t(z):le<1&&t(1),t(le)},ee=N.useCallback(()=>{if(!I||!j){E(null);return}const le=I.filter(ue=>Object.entries(o).every(([he,pe])=>{var Pe,Re,Be;if(pe===null)return!0;const ye=(Pe=ue[he])==null?void 0:Pe.value;if(ye==null)return!1;const je=(Re=j.columns)==null?void 0:Re.find(ze=>ze.field===he),Oe=je==null?void 0:je.type,Le=(je==null?void 0:je.values)&&((Be=je==null?void 0:je.values)==null?void 0:Be.length)>0;if(!Oe)return!1;switch(Oe){case"STR":return Le?ye===pe:ye.toString().toLowerCase().includes(pe.toLowerCase());case"NUM":return Le?Number(ye)===Number(pe):ye.toString().toLowerCase().includes(pe.toLowerCase());case"DT":return ye.toString().toLowerCase().includes(pe.toLowerCase());case"BIT":return Number(ye)===Number(pe);default:return ye.toString().toLowerCase().includes(pe.toLowerCase())}}));E(le)},[I,o,j]),ne=N.useCallback(()=>{if(!L||!j){_([]);return}if(!r){_(L);return}_([...L].sort((le,ue)=>{var Oe,Le,Pe,Re,Be,ze;const he=((Le=(Oe=le[r])==null?void 0:Oe.value)==null?void 0:Le.toString())??"",pe=((Re=(Pe=ue[r])==null?void 0:Pe.value)==null?void 0:Re.toString())??"",ye=j.columns.find(De=>De.field===r),je=ye==null?void 0:ye.type;if(!ye||!je||!he&&!pe)return 0;if(!he)return 1;if(!pe)return-1;if(ye.values&&ye.values.length>0){const De=((Be=ye.values.find(ie=>{var Ce;return((Ce=ie.id)==null?void 0:Ce.toString())===he}))==null?void 0:Be.name)??"",Te=((ze=ye.values.find(ie=>{var Ce;return((Ce=ie.id)==null?void 0:Ce.toString())===pe}))==null?void 0:ze.name)??"";return i==="asc"?De.localeCompare(Te):Te.localeCompare(De)}if(je==="NUM"){const De=Number(he),Te=Number(pe);return i==="asc"?De-Te:Te-De}if(je==="DT"){const De=l.parseISO(he==null?void 0:he.toString()).getTime(),Te=l.parseISO(pe==null?void 0:pe.toString()).getTime();return i==="asc"?De-Te:Te-De}return i==="asc"?he.toString().localeCompare(pe.toString()):pe.toString().localeCompare(he.toString())}))},[L,j,r,i]);return N.useEffect(()=>{q()},[q]),N.useEffect(()=>{ae()},[ae]),N.useEffect(()=>{ee()},[ee]),N.useEffect(()=>{ne()},[ne]),N.useEffect(()=>{V?e||t(1):D&&t(null)},[D,V,e,t]),N.useEffect(()=>{!V||!e||(e>z&&t(z),e<1&&t(1))},[e,V,z,t]),s.jsxs("div",{className:"h-100 w-100 d-flex flex-column",children:[s.jsxs("div",{className:"mb-3 d-flex justify-content-between align-items-start",children:[s.jsxs("div",{className:"d-flex align-items-center gap-3",children:[s.jsx(l.Typography,{variant:"h3",children:(j==null?void 0:j.name)??""}),(j==null?void 0:j.masterReference)&&s.jsx(hm,{label:((ve=(ce=j.columns)==null?void 0:ce.find(le=>le.field===j.masterReferenceColumn))==null?void 0:ve.caption)??"",options:((be=(de=j.columns)==null?void 0:de.find(le=>le.field===j.masterReferenceColumn))==null?void 0:be.values)??[],master:te,onChange:le=>se(le)})]}),s.jsxs("div",{className:"d-flex align-items-center gap-1",children:[(we=j==null?void 0:j.slaves)==null?void 0:we.map((le,ue)=>{var he;return s.jsxs(l.ContextButton,{as:"link",href:`${Ne.generatePath(u,{id:(he=le.id)==null?void 0:he.toString()})}?type=dynamic-form`,children:[s.jsxs("div",{className:"d-flex align-items-center",children:[j.slaves.length>1?s.jsx(l.Typography,{variant:"caption",className:"text-primary",children:ue+1}):null,s.jsx(l.MdOutlineSubdirectoryArrowRight,{})]}),le.name]},le.id)}),s.jsxs(l.Dropdown,{toggle:s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle}),children:[s.jsx(l.DropdownItem,{onClick:()=>$(!R),children:R?h.hideArchived:h.showArchived}),s.jsx(l.DropdownDivider,{}),s.jsx(l.DropdownItem,{onClick:re,icon:s.jsx(v,{icon:"file-download"}),children:h.downloadExport})]})]})]}),(j==null?void 0:j.description)&&s.jsx(l.Typography,{variant:"body2",className:"mb-3",children:j==null?void 0:j.description}),j!=null&&j.masterReference&&!te?s.jsx(l.Alert,{variant:"warning",children:h.selectMaster(((Fe=(ke=j.columns)==null?void 0:ke.find(le=>le.field===j.masterReferenceColumn))==null?void 0:Fe.caption)??"").toLowerCase()}):s.jsxs(s.Fragment,{children:[j&&T.length>0&&s.jsx("div",{className:"mb-2",children:s.jsx(zu,{errors:T,schema:j})}),j&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:l.classNames("rounded border overflow-auto",Ps.tableContainer),children:s.jsx(mm,{schema:j,items:!V&&D&&(D==null?void 0:D.length)>O?[]:(V?X:D)??[],onEditItem:K,onDeleteItem:G,onCreateItem:oe,filters:o,setFilter:a,sortByField:r,sortByType:i,setSortBy:c,selectedMaster:(te==null?void 0:te.toString())??null,customPickers:y,appDetail:u})}),V&&e&&s.jsxs("div",{className:l.classNames(Ps.pagination,"d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"),children:[s.jsxs("div",{className:"d-flex align-items-center gap-1",children:[s.jsx(l.IconButton,{color:"primary",onClick:()=>J(1),disabled:!H,children:s.jsx(v,{icon:"chevron-double-left"})}),s.jsx(l.IconButton,{color:"primary",onClick:()=>J(e-1),disabled:!H,children:s.jsx(v,{icon:"chevron-left"})}),s.jsx(l.IconButton,{color:"primary",onClick:()=>J(e+1),disabled:!W,children:s.jsx(v,{icon:"chevron-right"})}),s.jsx(l.IconButton,{color:"primary",onClick:()=>J(z),disabled:!W,children:s.jsx(v,{icon:"chevron-double-right"})})]}),s.jsxs(l.Typography,{variant:"body",children:[h.tablePage," ",e," ",h.tablePageFrom," ",z]})]})]})]})]})},Ms={appDetail:"/settings/:id"},Os={apiDynamicFormsGet:"/dynamicForms"},ym=n=>{const e=l.compilerRuntimeExports.c(7),{item:t,children:o}=n;if(t.description){const r=t.description??"";let i;e[0]!==o?(i=s.jsx("div",{children:o}),e[0]=o,e[1]=i):i=e[1];let c;return e[2]!==r||e[3]!==i?(c=s.jsx(l.SimpleTooltip,{placement:"left",text:r,children:i}),e[2]=r,e[3]=i,e[4]=c):c=e[4],c}let a;return e[5]!==o?(a=s.jsx(s.Fragment,{children:o}),e[5]=o,e[6]=a):a=e[6],a},Bs=({item:n,fullSize:e,appDetail:t,search:o,activeId:a})=>{var r,i,c,u;return e?s.jsxs(Ne.Link,{to:`${Ne.generatePath(t,{id:(r=n.id)==null?void 0:r.toString()})}?type=${n.type}&search=${o??""}`,className:`text-nowrap list-group-item list-group-item-action ${(a==null?void 0:a.toString())===((i=n.id)==null?void 0:i.toString())?"active":""}`,children:[s.jsx(l.Typography,{variant:"body",children:n.name}),n.description&&s.jsx(l.Typography,{variant:"body2",className:"text-muted mt-2",children:n.description})]}):s.jsx(ym,{item:n,children:s.jsx(Ne.Link,{to:`${Ne.generatePath(t,{id:(c=n.id)==null?void 0:c.toString()})}?type=${n.type}&search=${o??""}`,className:`text-nowrap list-group-item list-group-item-action ${(a==null?void 0:a.toString())===((u=n.id)==null?void 0:u.toString())?"active":""}`,children:s.jsx(l.Typography,{variant:"body2",children:n.name})})},n.id)},vm=n=>{const e=l.compilerRuntimeExports.c(33),{activeId:t,anchoredForms:o,otherForms:a,groupsDefs:r,searchQuery:i,fullSize:c,appUrls:u,apiUrls:m}=n;let d;e[0]!==a?(d=a===void 0?[]:a,e[0]=a,e[1]=d):d=e[1];const f=d;let p;e[2]!==r?(p=r===void 0?[]:r,e[2]=r,e[3]=p):p=e[3];const g=p,{appDetail:x}=u===void 0?Ms:u,y=x===void 0?Ms.appDetail:x,{apiDynamicFormsGet:h}=m===void 0?Os:m,v=h===void 0?Os.apiDynamicFormsGet:h,b=l.useAxios(),{startLoading:w,stopLoading:S}=N.useContext(l.LoadingContext),[j,C]=N.useState(null),[I]=dt.useSearchQueryState("search","");let k;e[4]!==o||e[5]!==i?(k=(o==null?void 0:o.filter(M=>l.stringSearchWithin(M.name,i)||l.stringSearchWithin(M.description,i)).sort(bm))??[],e[4]=o,e[5]=i,e[6]=k):k=e[6];const L=k;let E;e[7]!==j||e[8]!==f||e[9]!==i?(E=[...(j==null?void 0:j.map(jm))??[],...f].filter(M=>l.stringSearchWithin(M.name,i)||l.stringSearchWithin(M.description,i)).sort(Sm)??[],e[7]=j,e[8]=f,e[9]=i,e[10]=E):E=e[10];const D=E;let _;if(e[11]!==D||e[12]!==g){let M;e[14]!==D?(M=O=>({id:O.id,name:O.name??"",items:D.filter(z=>z.group===O.id)}),e[14]=D,e[15]=M):M=e[15],_=g.map(M).filter(Cm),e[11]=D,e[12]=g,e[13]=_}else _=e[13];const R=_;let $;e[16]!==v||e[17]!==b||e[18]!==w||e[19]!==S?($=async()=>{w("dynamicForms"),await b.get(v).then(M=>{const{data:O}=M;C(O),S("dynamicForms")}).catch(()=>S("dynamicForms"))},e[16]=v,e[17]=b,e[18]=w,e[19]=S,e[20]=$):$=e[20];const A=$;let T,F;e[21]!==j||e[22]!==A?(T=()=>{!j&&A()},F=[A,j],e[21]=j,e[22]=A,e[23]=T,e[24]=F):(T=e[23],F=e[24]),N.useEffect(T,F);let P;return e[25]!==t||e[26]!==y||e[27]!==L||e[28]!==R||e[29]!==D||e[30]!==c||e[31]!==I?(P=[...L,...D].length>0?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"w-auto list-group forms-items overflow-x-hidden",children:[L.length>0?s.jsxs(s.Fragment,{children:[L.map(M=>s.jsx(Bs,{item:M,fullSize:c??!1,appDetail:y,search:I,activeId:t},M.id)),s.jsx("hr",{className:"mb-0"})]}):null,R.map(M=>s.jsx(At,{title:M.name,defaultOpen:!0,children:M.items.map(O=>s.jsx(Bs,{item:O,fullSize:c??!1,appDetail:y,search:I,activeId:t},O.id))},M.id))]})}):null,e[25]=t,e[26]=y,e[27]=L,e[28]=R,e[29]=D,e[30]=c,e[31]=I,e[32]=P):P=e[32],P};function bm(n,e){return(n.name??"").localeCompare(e.name??"")}function jm(n){return{...n,type:"dynamic-form"}}function Sm(n,e){return(n.name??"").localeCompare(e.name??"")}function Cm(n){return n.items.length>0}const wm=n=>{const e=l.compilerRuntimeExports.c(7),{label:t,to:o,value:a}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("input",{disabled:!0,className:"form-control d-none"}),e[0]=r):r=e[0];let i;e[1]!==o||e[2]!==a?(i=o?s.jsx(Ne.Link,{to:o,className:"border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:a}):s.jsx("div",{className:"luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:a}),e[1]=o,e[2]=a,e[3]=i):i=e[3];let c;return e[4]!==t||e[5]!==i?(c=s.jsxs(l.RowLabelInput,{label:t,children:[r,i]}),e[4]=t,e[5]=i,e[6]=c):c=e[6],c},Nm=()=>{const n=l.compilerRuntimeExports.c(10),{localizationContext:e}=N.useContext(l.LuminusComponentsContext),{language:t,setLanguage:o}=N.useContext(e);let a;n[0]!==o?(a=m=>{o(m)},n[0]=o,n[1]=a):a=n[1];const r=a;let i;n[2]!==t||n[3]!==r?(i=m=>{r(t==="cz"?"en":t==="en"?"de":"cz"),m.stopPropagation()},n[2]=t,n[3]=r,n[4]=i):i=n[4];let c;n[5]!==t?(c=t==="cz"?s.jsxs(s.Fragment,{children:[s.jsx("strong",{className:"fw-bold",children:"CZ"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"EN"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"DE"})]}):t==="en"?s.jsxs(s.Fragment,{children:[s.jsx("strong",{className:"fw-bold",children:"EN"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"DE"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"CZ"})]}):s.jsxs(s.Fragment,{children:[s.jsx("strong",{className:"fw-bold",children:"DE"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"CZ"}),s.jsx(l.MdArrowRight,{}),s.jsx("span",{children:"EN"})]}),n[5]=t,n[6]=c):c=n[6];let u;return n[7]!==i||n[8]!==c?(u=s.jsx(l.DropdownItem,{onClick:i,children:c}),n[7]=i,n[8]=c,n[9]=u):u=n[9],u},Im=n=>{const e=l.compilerRuntimeExports.c(6);let t,o;e[0]!==n?({controlId:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;return e[3]!==t||e[4]!==o?(a=s.jsx(l.Form.Group,{controlId:t,...o}),e[3]=t,e[4]=o,e[5]=a):a=e[5],a},km=n=>{const e=l.compilerRuntimeExports.c(11),{employeeId:t,alt:o,noPhotoImage:a,cafmApiUrl:r,showLargeInLightBox:i}=n,c=i===void 0?!1:i,{user:u}=N.useContext(l.UserContext),{photoPath:m,photoPathSm:d}=dt.useEmployeePhotoPath(t);let f;e[0]!==o||e[1]!==r||e[2]!==t||e[3]!==a||e[4]!==m||e[5]!==d||e[6]!==c||e[7]!==u?(f=t&&s.jsx(s.Fragment,{children:c?s.jsx(Xo,{baseUrl:r,customToken:u.cafmToken??void 0,photos:[{id:t.toString(),alt:o??"",isDefault:!0,smSrc:d,lgSrc:m}],placeholder:a,ImgComponent:_n}):s.jsx(_n,{baseUrl:r,customToken:u.cafmToken??void 0,src:d,alt:o,placeholder:a,className:"rounded w-100"})}),e[0]=o,e[1]=r,e[2]=t,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=u,e[8]=f):f=e[8];let p;return e[9]!==f?(p=s.jsx(s.Fragment,{children:f}),e[9]=f,e[10]=p):p=e[10],p},_m=n=>{const e=l.compilerRuntimeExports.c(21),{text:t,setText:o,onSearchButtonClick:a,className:r}=n;let i;e[0]!==o?(i=h=>{o(h)},e[0]=o,e[1]=i):i=e[1];const c=i,u=`${r}`;let m;e[2]!==o?(m=h=>o(h.target.value),e[2]=o,e[3]=m):m=e[3];let d;e[4]!==m||e[5]!==t?(d=s.jsx(l.Form.Control,{value:t,onChange:m}),e[4]=m,e[5]=t,e[6]=d):d=e[6];let f;e[7]!==c||e[8]!==t?(f=t&&s.jsx(l.Button,{onClick:()=>c(""),variant:"link",className:"border text-muted",children:s.jsx(l.MdClear,{})}),e[7]=c,e[8]=t,e[9]=f):f=e[9];let p;e[10]!==a||e[11]!==t?(p=()=>a&&a(t),e[10]=a,e[11]=t,e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(l.MdSearch,{}),e[13]=g):g=e[13];let x;e[14]!==p?(x=s.jsx(l.Button,{onClick:p,variant:"link",className:"border",children:g}),e[14]=p,e[15]=x):x=e[15];let y;return e[16]!==u||e[17]!==d||e[18]!==f||e[19]!==x?(y=s.jsxs(qt,{className:u,children:[d,f,x]}),e[16]=u,e[17]=d,e[18]=f,e[19]=x,e[20]=y):y=e[20],y},Dm=n=>{const e=l.compilerRuntimeExports.c(7),{value:t,numberPrefix:o,numberSuffix:a,decimalScale:r,fixedDecimalScale:i,className:c}=n,u=r===void 0?2:r,m=i===void 0?!1:i;let d;return e[0]!==c||e[1]!==u||e[2]!==m||e[3]!==o||e[4]!==a||e[5]!==t?(d=s.jsx(Pn,{value:t,displayType:"text",thousandSeparator:" ",decimalScale:u,fixedDecimalScale:m,defaultValue:"",prefix:o,suffix:a,className:c,decimalSeparator:","}),e[0]=c,e[1]=u,e[2]=m,e[3]=o,e[4]=a,e[5]=t,e[6]=d):d=e[6],d},Tm=n=>{const e=l.compilerRuntimeExports.c(12),{data:t,keys:o,colors:a,tooltipLabel:r}=n;let i;e[0]!==t?(i=t.map(Em),e[0]=t,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={top:20,right:50,bottom:30,left:150},e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={from:"color",modifiers:[["darker",.5]]},e[3]=u):u=e[3];let m,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={tickSize:5,tickPadding:5,tickRotation:0},d={tickSize:5,tickPadding:5,tickRotation:0},e[4]=m,e[5]=d):(m=e[4],d=e[5]);let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={from:"color",modifiers:[["darker",1.6]]},e[6]=f):f=e[6];let p;return e[7]!==a||e[8]!==o||e[9]!==i||e[10]!==r?(p=s.jsx(l.Xe,{data:i,indexBy:"name",keys:o,margin:c,layout:"horizontal",colors:a,padding:.2,borderRadius:2,borderWidth:2,borderColor:u,axisTop:null,axisRight:null,axisBottom:m,axisLeft:d,labelSkipWidth:12,labelSkipHeight:12,labelTextColor:f,tooltipLabel:r}),e[7]=a,e[8]=o,e[9]=i,e[10]=r,e[11]=p):p=e[11],p};function Em(n){return{name:n.name,...n.values}}const Lm="_hrText_xxish_1",Rm={hrText:Lm},ll=n=>{const e=l.compilerRuntimeExports.c(3),{text:t}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.classNames(Rm.hrText),e[0]=o):o=e[0];let a;return e[1]!==t?(a=s.jsx("hr",{className:o,"data-content":t}),e[1]=t,e[2]=a):a=e[2],a},$m="_cards-group_1gvpy_1",Fm="_group-title_1gvpy_1",Pm="_group-content_1gvpy_8",Am="_report-card_1gvpy_12",Mm="_card-title-link_1gvpy_22",Nt={cardsGroup:$m,groupTitle:Fm,groupContent:Pm,reportCard:Am,cardTitleLink:Mm},Om=n=>{const e=l.compilerRuntimeExports.c(9),{reportsLastUsedGet:t,getReportRoute:o,getReportName:a}=n,{texts:r}=N.useContext(l.LuminusComponentsContext),{reports:i}=r,{data:c}=Ae.useGetApiData(t);let u;e[0]!==a||e[1]!==o||e[2]!==c?(u=c&&c.map(f=>f.versions.map(p=>s.jsxs(l.ListGroupItem,{as:Ne.Link,to:o(f,p.id),className:"p-1 px-2",action:!0,children:[s.jsx(l.Typography,{variant:"body2",className:"text-uppercase",children:a(f)}),s.jsxs(l.Typography,{variant:"caption",className:"d-flex justify-content-between align-items-center gap-3 text-dark",children:[p.name,s.jsx(l.Typography,{variant:"caption",className:"text-end opacity-50",children:l.formatDate(p.lastUsedDate)})]})]}))),e[0]=a,e[1]=o,e[2]=c,e[3]=u):u=e[3];let m;e[4]!==u?(m=s.jsx(l.ListGroup,{children:u}),e[4]=u,e[5]=m):m=e[5];let d;return e[6]!==i.index.lastUsedReports||e[7]!==m?(d=s.jsx(s.Fragment,{children:s.jsx(At,{defaultOpen:!0,title:i.index.lastUsedReports,children:m})}),e[6]=i.index.lastUsedReports,e[7]=m,e[8]=d):d=e[8],d},zs=n=>{const e=l.compilerRuntimeExports.c(9),{reportVersion:t,getReportRoute:o,report:a}=n;let r;e[0]!==o||e[1]!==a||e[2]!==t.id?(r=o(a,t.id),e[0]=o,e[1]=a,e[2]=t.id,e[3]=r):r=e[3];let i;e[4]!==t.name?(i=s.jsx(l.Typography,{variant:"body2",className:"d-flex justify-content-between align-items-center gap-3",children:s.jsx("div",{className:"link",children:t.name})}),e[4]=t.name,e[5]=i):i=e[5];let c;return e[6]!==r||e[7]!==i?(c=s.jsx(l.ListGroupItem,{as:Ne.Link,to:r,className:"p-1 px-2",action:!0,children:i}),e[6]=r,e[7]=i,e[8]=c):c=e[8],c},Yt=5,Hs=n=>{const e=l.compilerRuntimeExports.c(25),{versionsList:t,getReportRoute:o,report:a}=n,{ProjectIconComponent:r}=N.useContext(l.LuminusComponentsContext),[i,c]=N.useState(!0);let u;e:{if(t.length<=Yt){u=t;break e}let h;e[0]!==t?(h=t.slice(0,Yt-1),e[0]=t,e[1]=h):h=e[1],u=h}const m=u;let d;e:{if(t.length<=Yt){let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=[],e[2]=v):v=e[2],d=v;break e}let h;e[3]!==t?(h=t.slice(Yt-1),e[3]=t,e[4]=h):h=e[4],d=h}const f=d;let p;if(e[5]!==m||e[6]!==o||e[7]!==a){let h;e[9]!==o||e[10]!==a?(h=v=>s.jsx(zs,{reportVersion:v,getReportRoute:o,report:a}),e[9]=o,e[10]=a,e[11]=h):h=e[11],p=m.map(h),e[5]=m,e[6]=o,e[7]=a,e[8]=p}else p=e[8];let g;e[12]!==i||e[13]!==o||e[14]!==f||e[15]!==a?(g=i?null:f.map(h=>s.jsx(zs,{reportVersion:h,getReportRoute:o,report:a})),e[12]=i,e[13]=o,e[14]=f,e[15]=a,e[16]=g):g=e[16];let x;e[17]!==r||e[18]!==i||e[19]!==f.length?(x=f.length>0&&s.jsx(l.ListGroupItem,{onClick:()=>c(Bm),className:"py-0 d-flex justify-content-center",children:i?s.jsx(r,{icon:"chevron-down"}):s.jsx(r,{icon:"chevron-up"})}),e[17]=r,e[18]=i,e[19]=f.length,e[20]=x):x=e[20];let y;return e[21]!==p||e[22]!==g||e[23]!==x?(y=s.jsx(s.Fragment,{children:s.jsxs(l.ListGroup,{children:[p,g,x]})}),e[21]=p,e[22]=g,e[23]=x,e[24]=y):y=e[24],y};function Bm(n){return!n}const zm=n=>{const e=l.compilerRuntimeExports.c(36),{report:t,getReportRoute:o,getReportName:a,getReportDescription:r}=n;let i;e:{if(t.versionsCustom.length===0){let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C={xs:12},e[0]=C):C=e[0],i=C;break e}let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={xs:12,sm:6,md:12,lg:12,xl:12,xxl:6},e[1]=j):j=e[1],i=j}const c=i,u=t.id;let m;e[2]!==o||e[3]!==t?(m=o(t),e[2]=o,e[3]=t,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=l.classNames(Nt.cardTitleLink,"w-100 text-uppercase fw-normal"),e[5]=d):d=e[5];let f;e[6]!==a||e[7]!==t?(f=a(t),e[6]=a,e[7]=t,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=s.jsx(Ne.Link,{to:m,className:d,children:f}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=l.classNames(Nt.reportCard,"shadow h-100 d-flex flex-column"),e[12]=g):g=e[12];let x;e[13]!==r||e[14]!==t?(x=r(t),e[13]=r,e[14]=t,e[15]=x):x=e[15];let y;e[16]!==x?(y=s.jsx(l.Typography,{variant:"body2",className:"px-2",children:x}),e[16]=x,e[17]=y):y=e[17];let h;e[18]!==o||e[19]!==t||e[20]!==c?(h=t.versions&&t.versions.length>0?s.jsx(l.Col,{...c,children:s.jsx(Hs,{versionsList:t.versions,getReportRoute:o,report:t})}):null,e[18]=o,e[19]=t,e[20]=c,e[21]=h):h=e[21];let v;e[22]!==o||e[23]!==t||e[24]!==c?(v=t.versionsCustom&&t.versionsCustom.length>0?s.jsx(l.Col,{...c,children:s.jsx(Hs,{versionsList:t.versionsCustom,getReportRoute:o,report:t})}):null,e[22]=o,e[23]=t,e[24]=c,e[25]=v):v=e[25];let b;e[26]!==h||e[27]!==v?(b=s.jsxs(Rn,{className:"h-100 g-2",children:[h,v]}),e[26]=h,e[27]=v,e[28]=b):b=e[28];let w;e[29]!==b||e[30]!==p||e[31]!==y?(w=s.jsxs(pt,{title:p,headerClassName:"bg-darker",className:g,contentClassName:"d-flex flex-column gap-2 h-100",children:[y,b]}),e[29]=b,e[30]=p,e[31]=y,e[32]=w):w=e[32];let S;return e[33]!==t.id||e[34]!==w?(S=s.jsx("div",{className:"col-12 col-lg-4",children:w},u),e[33]=t.id,e[34]=w,e[35]=S):S=e[35],S},yn={reportsGet:"/reports",reportsLastUsedGet:"/reports/last-used"},Hm=n=>{const e=l.compilerRuntimeExports.c(45),{groups:t,apiUrls:o,getReportName:a,getReportDescription:r,getGroupTitle:i,getReportRoute:c}=n,{reportsGet:u,reportsLastUsedGet:m}=o===void 0?yn:o,d=u===void 0?yn.reportsGet:u,f=m===void 0?yn.reportsLastUsedGet:m,{texts:p}=N.useContext(l.LuminusComponentsContext),{reports:g}=p,[x,y]=N.useState(""),[h]=l.a(x,500);let v;e[0]!==t?(v=T=>T.map(F=>({...F,groupId:!F.groupId||F.groupId===0||!t.some(P=>P===F.groupId)?999:F.groupId})),e[0]=t,e[1]=v):v=e[1];const b=v;let w;e[2]!==b?(w={dataTransformer:b},e[2]=b,e[3]=w):w=e[3];const{data:S}=Ae.useGetApiData(d,w);let j;e:{if(S===null){let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={},e[4]=F):F=e[4],j=F;break e}let T;e[5]!==h||e[6]!==r||e[7]!==a||e[8]!==t||e[9]!==S?(T={},t.forEach(F=>{T[F]=S.filter(P=>P.groupId===F&&(l.stringSearchWithin(a(P),h)||l.stringSearchWithin(r(P),h)||P.versions.some(M=>l.stringSearchWithin(M.name,h))||P.versionsCustom.some(M=>l.stringSearchWithin(M.name,h))))}),e[5]=h,e[6]=r,e[7]=a,e[8]=t,e[9]=S,e[10]=T):T=e[10],j=T}const C=j;let I;if(e[11]!==C||e[12]!==t){let T;e[14]!==C?(T=F=>{var P;return((P=C[F])==null?void 0:P.length)>0},e[14]=C,e[15]=T):T=e[15],I=t.filter(T),e[11]=C,e[12]=t,e[13]=I}else I=e[13];const k=I,{isMobile:L}=l.useWindowSize();let E;e[16]!==a||e[17]!==c||e[18]!==f?(E=s.jsx(s.Fragment,{children:s.jsx(Om,{reportsLastUsedGet:f,getReportName:a,getReportRoute:c})}),e[16]=a,e[17]=c,e[18]=f,e[19]=E):E=e[19];let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=T=>{var F;return y(((F=T.target)==null?void 0:F.value)??"")},e[20]=D):D=e[20];let _;e[21]!==g.index.search||e[22]!==x?(_=s.jsx("div",{children:s.jsx(l.Form.Control,{className:"mb-3",type:"search",value:x,onChange:D,placeholder:g.index.search})}),e[21]=g.index.search,e[22]=x,e[23]=_):_=e[23];let R;if(e[24]!==k||e[25]!==C||e[26]!==i||e[27]!==r||e[28]!==a||e[29]!==c||e[30]!==L){let T;e[32]!==C||e[33]!==i||e[34]!==r||e[35]!==a||e[36]!==c||e[37]!==L?(T=F=>s.jsxs("div",{className:l.classNames(Nt.cardsGroup,{[Nt.mobile]:L}),children:[s.jsx("div",{className:l.classNames("group-title z-1",Nt.groupTitle),children:s.jsx(ll,{text:i(F)})}),s.jsx("div",{className:l.classNames(Nt.groupContent),children:s.jsx("div",{className:l.classNames("row gx-3 gy-3"),children:C[F].map(P=>s.jsx(zm,{report:P,getReportRoute:c,getReportName:a,getReportDescription:r}))})})]},F),e[32]=C,e[33]=i,e[34]=r,e[35]=a,e[36]=c,e[37]=L,e[38]=T):T=e[38],R=k.map(T),e[24]=k,e[25]=C,e[26]=i,e[27]=r,e[28]=a,e[29]=c,e[30]=L,e[31]=R}else R=e[31];let $;e[39]!==R?($=s.jsx("div",{className:"overflow-x-hidden luminus-thin-scrollbar luminus-reports-index",children:R}),e[39]=R,e[40]=$):$=e[40];let A;return e[41]!==_||e[42]!==$||e[43]!==E?(A=s.jsxs(l.PageContainer,{unavailableOnMobile:!0,variant:"fullScreen",sideContent:E,children:[_,$]}),e[41]=_,e[42]=$,e[43]=E,e[44]=A):A=e[44],A},Vm="_mini-detail-popover_obryf_1",Wm="_sm_obryf_5",Um="_lg_obryf_9",Vs={"mini-detail-popover":"_mini-detail-popover_obryf_1",miniDetailPopover:Vm,sm:Wm,lg:Um},Gm=({children:n,useMiniDetail:e,miniDetailProps:t,placement:o="bottom",trigger:a=["hover"],delayMs:r=500})=>{const{user:i}=N.useContext(l.UserContext),[c,u]=N.useState(!1),{isLoading:m,detail:d,heading:f,tooltipWidth:p}=e({...t,enabled:c&&!(i!=null&&i.external)}),g=N.useRef(null);return s.jsx("div",{onMouseEnter:()=>{g.current=window.setTimeout(()=>u(!0),r)},onMouseLeave:()=>{g.current&&clearTimeout(g.current),u(!1)},children:c&&!(i!=null&&i.external)?s.jsx(l.HtmlTooltip,{heading:m?s.jsx(l.Typography,{variant:"body2",className:"placeholder-glow",children:s.jsx("span",{className:"placeholder bg-primary col-6"})}):f,content:s.jsx(s.Fragment,{children:m?s.jsxs(l.Typography,{variant:"body2",className:"placeholder-glow",children:[s.jsxs("div",{className:"d-flex justify-content-between py-1",children:[s.jsx("span",{className:"placeholder col-5"}),s.jsx("span",{className:"placeholder col-4"})]}),s.jsxs("div",{className:"d-flex justify-content-between py-1",children:[s.jsx("span",{className:"placeholder col-3"}),s.jsx("span",{className:"placeholder col-2"})]}),s.jsxs("div",{className:"d-flex justify-content-between py-1",children:[s.jsx("span",{className:"placeholder col-4"}),s.jsx("span",{className:"placeholder col-6"})]}),s.jsxs("div",{className:"d-flex justify-content-between py-1",children:[s.jsx("span",{className:"placeholder col-4"}),s.jsx("span",{className:"placeholder col-3"})]}),s.jsxs("div",{className:"d-flex justify-content-between py-1",children:[s.jsx("span",{className:"placeholder col-5"}),s.jsx("span",{className:"placeholder col-4"})]})]}):d}),placement:o,trigger:a,popoverClassName:l.classNames(Vs.miniDetailPopover,Vs[p]),children:s.jsx("div",{children:n})}):s.jsx(s.Fragment,{children:n})})},Km=n=>{const e=l.compilerRuntimeExports.c(7),{label:t,value:o}=n;let a;e[0]!==t?(a=s.jsx(l.Typography,{variant:"caption",children:t}),e[0]=t,e[1]=a):a=e[1];const r=o??"-";let i;e[2]!==r?(i=s.jsx(l.Typography,{variant:"body2",className:"text-end",children:r}),e[2]=r,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=s.jsxs("div",{className:"py-1 border-bottom d-flex gap-3 align-items-center justify-content-between",children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c},Ym=n=>{const e=l.compilerRuntimeExports.c(21),{route:t,variant:o,children:a,className:r,disabled:i,routeParams:c}=n,u=o===void 0?"link":o,m=i===void 0?!1:i,{checkUserHasPermissions:d}=l.usePermissions(),f=m||!(t.permissions===void 0||d(t.permissions)),p=a??t.name;let g;e:switch(u){case"primaryButton":{g=l.PrimaryButton;break e}case"contextButton":{g=l.ContextButton;break e}case"iconButton":{g=l.IconButton;break e}default:g=N.Fragment}const x=g;if(u==="link"){let w;e[0]!==t.route||e[1]!==c?(w=Ke.generateApiPath(t.route,c),e[0]=t.route,e[1]=c,e[2]=w):w=e[2];const S=f?"disabled":void 0;let j;e[3]!==r||e[4]!==S?(j=l.classNames("link font-size-14",S,r),e[3]=r,e[4]=S,e[5]=j):j=e[5];let C;return e[6]!==p||e[7]!==w||e[8]!==j?(C=s.jsx(Ne.Link,{to:w,className:j,children:p}),e[6]=p,e[7]=w,e[8]=j,e[9]=C):C=e[9],C}let y;e[10]!==t.route||e[11]!==c?(y=Ke.generateApiPath(t.route,c),e[10]=t.route,e[11]=c,e[12]=y):y=e[12];const h=f?"disabled":void 0;let v;e[13]!==r||e[14]!==h?(v=l.classNames(h,r),e[13]=r,e[14]=h,e[15]=v):v=e[15];let b;return e[16]!==x||e[17]!==p||e[18]!==y||e[19]!==v?(b=s.jsx(x,{as:"link",href:y,className:v,children:p}),e[16]=x,e[17]=p,e[18]=y,e[19]=v,e[20]=b):b=e[20],b},qm=n=>{var g;const e=l.compilerRuntimeExports.c(17),{id:t,getTimelineApiPath:o}=n,{texts:a,ProjectIconComponent:r}=N.useContext(l.LuminusComponentsContext),{approval:i}=a;let c;e[0]!==o||e[1]!==t?(c=o(t),e[0]=o,e[1]=t,e[2]=c):c=e[2];const{data:u}=Ae.useGetApiData(c);let m;e[3]!==r||e[4]!==i?(m=(x,y)=>{const h=y===void 0?!1:y;switch(x){case l.ApprovalState.Zamitnuto:return s.jsx(l.SimpleTooltip,{placement:"left",text:i.stateRejected,children:s.jsx("div",{children:s.jsx(r,{icon:"cancel-simple",className:h?"text-danger":"bg-danger rounded-circle p-1",iconProps:{fontSize:"14px",color:h?void 0:"white"}})})});case l.ApprovalState.Nevyrizeno:return s.jsx(l.SimpleTooltip,{placement:"left",text:i.stateUnrealized,children:s.jsx("div",{children:s.jsx(r,{icon:"pending",className:h?"text-secondary":"bg-secondary rounded-circle p-1",iconProps:{fontSize:"14px",color:h?void 0:"white"}})})});case l.ApprovalState.Odebrano:return s.jsx(l.SimpleTooltip,{placement:"left",text:i.stateRemoved,children:s.jsx("div",{children:s.jsx(r,{icon:"cancel-simple",className:h?"text-warning":"bg-warning rounded-circle p-1",iconProps:{fontSize:"14px",color:h?void 0:"white"}})})});case l.ApprovalState.Schvaleno:return s.jsx(l.SimpleTooltip,{placement:"left",text:i.stateApproved,children:s.jsx("div",{children:s.jsx(r,{icon:"check-simple",className:h?"text-success":"bg-success rounded-circle p-1",iconProps:{fontSize:"14px",color:h?void 0:"white"}})})});default:return null}},e[3]=r,e[4]=i,e[5]=m):m=e[5];const d=m;let f;e[6]!==i||e[7]!==u?(f=u!=null&&u.startDate?{date:l.parseISO(u.startDate),title:s.jsx(l.Typography,{variant:"body2",children:i.startDate}),dateFormat:"date"}:null,e[6]=i,e[7]=u,e[8]=f):f=e[8];let p;if(e[9]!==i||e[10]!==d||e[11]!==f||e[12]!==u){let x;e[14]!==i||e[15]!==u?(x=u!=null&&u.finishedDate?{date:l.parseISO(u.finishedDate),title:s.jsx(l.Typography,{variant:"body2",children:i.finishedDate}),dateFormat:"date"}:null,e[14]=i,e[15]=u,e[16]=x):x=e[16],p=s.jsx("div",{children:s.jsx(tl,{dontSort:!0,steps:[f,...((g=u==null?void 0:u.approvalLevels)==null?void 0:g.map(y=>{var h;return{date:void 0,title:s.jsxs("div",{className:"d-flex align-items-center justify-content-between w-100",children:[s.jsx(l.Typography,{variant:"body",className:"fw-bold",children:i.getLevelText(y.index)}),s.jsx(l.Typography,{variant:"caption",className:"text-end",children:i.getThresholdText(y.threshold)})]}),icon:d(y.state),text:y.approvers&&((h=y.approvers)==null?void 0:h.length)>0?s.jsx("div",{className:"list-group",children:y.approvers.map(v=>s.jsx("div",{className:"list-group-item p-1",children:s.jsxs("div",{className:"d-flex justify-content-between align-items-center gap-2",children:[v.automaticApproval?s.jsx(l.SimpleTooltip,{placement:"left",text:i.autoApproved,children:s.jsx("div",{children:s.jsx("div",{className:"text-success",style:{fontSize:"14px"},children:"A"})})}):d(v.state,!0),s.jsxs("div",{className:"text-end",children:[s.jsx(l.Typography,{variant:"body2",children:v.delegatedApprover?v.delegatedApprover.name:v.approver.name}),v.responseDate?s.jsx(l.Typography,{variant:"caption",children:l.formatDate(v.responseDate)}):null]})]})},v.id))}):null}}))??[],x].filter(Qm).map(Xm)})}),e[9]=i,e[10]=d,e[11]=f,e[12]=u,e[13]=p}else p=e[13];return p};function Qm(n){return n!==null}function Xm(n){return n}const Zm="_state-switch_uc6su_1",Jm="_switch-button_uc6su_7",ef="_bg-layer_uc6su_17",tf="_text-layer_uc6su_26",nf="_left_uc6su_38",sf="_right_uc6su_41",of="_active_uc6su_44",st={stateSwitch:Zm,switchButton:Jm,bgLayer:ef,textLayer:tf,left:nf,right:sf,active:of},lf=n=>{const e=l.compilerRuntimeExports.c(21),{isLeftStateActive:t,toggleState:o,leftStateLabel:a,rightStateLabel:r}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.classNames("gap-1",st.stateSwitch),e[0]=i):i=e[0];let c;e[1]!==t?(c=l.classNames(st.switchButton,st.left,{[st.active]:t}),e[1]=t,e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:st.bgLayer}),e[3]=u):u=e[3];let m;e[4]!==a?(m=s.jsx("div",{className:st.textLayer,children:a}),e[4]=a,e[5]=m):m=e[5];let d;e[6]!==c||e[7]!==m?(d=s.jsxs(l.Typography,{variant:"body2",className:c,children:[u,m]}),e[6]=c,e[7]=m,e[8]=d):d=e[8];const f=!t;let p;e[9]!==f?(p=l.classNames(st.switchButton,st.right,{[st.active]:f}),e[9]=f,e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:st.bgLayer}),e[11]=g):g=e[11];let x;e[12]!==r?(x=s.jsx("div",{className:st.textLayer,children:r}),e[12]=r,e[13]=x):x=e[13];let y;e[14]!==p||e[15]!==x?(y=s.jsxs(l.Typography,{variant:"body2",className:p,children:[g,x]}),e[14]=p,e[15]=x,e[16]=y):y=e[16];let h;return e[17]!==y||e[18]!==d||e[19]!==o?(h=s.jsxs("div",{role:"button",className:i,onClick:o,children:[d,y]}),e[17]=y,e[18]=d,e[19]=o,e[20]=h):h=e[20],h},af=n=>{const e=l.compilerRuntimeExports.c(30),{showArchived:t,BnfTableComponent:o,tableIdentifier:a,detailRoute:r}=n,{texts:i}=N.useContext(l.LuminusComponentsContext),{substitutions:c}=i,{data:u}=Ae.useGetApiData(`/permissions/substitutions?archived=${t}`);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={enable:!0,column:"archived"},e[0]=m):m=e[0];const d=m;let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=l.u(),e[1]=f):f=e[1];const p=f;let g;e[2]!==c.index.employeeName?(g=p.accessor("employeeName",{header:c.index.employeeName,type:"string",mobileMeta:{isIdentifier:!0}}),e[2]=c.index.employeeName,e[3]=g):g=e[3];let x;e[4]!==c.index.substitute?(x=p.accessor("substituteName",{header:c.index.substitute,type:"string",mobileMeta:{isIdentifier:!0}}),e[4]=c.index.substitute,e[5]=x):x=e[5];let y;e[6]!==c.index.from||e[7]!==c.index.generalInfo?(y=p.accessor("from",{header:c.index.from,type:"date",mobileMeta:{displayGroup:c.index.generalInfo}}),e[6]=c.index.from,e[7]=c.index.generalInfo,e[8]=y):y=e[8];let h;e[9]!==c.index.generalInfo||e[10]!==c.index.to?(h=p.accessor("to",{header:c.index.to,type:"date",mobileMeta:{displayGroup:c.index.generalInfo}}),e[9]=c.index.generalInfo,e[10]=c.index.to,e[11]=h):h=e[11];let v,b;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=p.accessor("archived",{header:"Archived",type:"boolean",meta:{hidden:!0}}),b=p.accessor("id",{header:"",type:"number",meta:{hidden:!0},size:50}),e[12]=v,e[13]=b):(v=e[12],b=e[13]);let w;e[14]!==g||e[15]!==x||e[16]!==y||e[17]!==h?(w=[g,x,y,h,v,b],e[14]=g,e[15]=x,e[16]=y,e[17]=h,e[18]=w):w=e[18];const S=w;let j;e[19]!==r?(j=E=>Ne.generatePath(r,{id:E.id.toString()}),e[19]=r,e[20]=j):j=e[20];const C=j;let I;e[21]!==u?(I=u??[],e[21]=u,e[22]=I):I=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k={mode:"enabled"},e[23]=k):k=e[23];let L;return e[24]!==o||e[25]!==S||e[26]!==C||e[27]!==I||e[28]!==a?(L=s.jsx(o,{data:I,columns:S,tableId:a,pagination:k,archiveHighlighting:d,rowNavigation:C}),e[24]=o,e[25]=S,e[26]=C,e[27]=I,e[28]=a,e[29]=L):L=e[29],L},rf=(n,e)=>{const t=l.useAxios(),o=Ne.useNavigate(),{startLoading:a,stopLoading:r}=N.useContext(l.LoadingContext),{zDateRequired:i,zNumberRequired:c}=l.useZodSchemaTypes(),{addNotification:u}=l.useNotifications(),{refreshAvailableDelegations:m}=N.useContext(l.DelegationContext),{user:d}=N.useContext(l.UserContext),{texts:{substitutions:{detail:f}}}=N.useContext(l.LuminusComponentsContext),p=l.objectType({id:c(),employeeId:c(),substituteId:c(),from:i(),to:i(),roles:l.arrayType(l.stringType())}),g=N.useMemo(()=>({id:(n==null?void 0:n.id)??0,employeeId:(n==null?void 0:n.employeeId)??(d==null?void 0:d.personalNumber)??void 0,substituteId:(n==null?void 0:n.substituteId)??void 0,from:(n==null?void 0:n.from)??l.format(new Date,"yyyy-MM-dd"),to:(n==null?void 0:n.to)??l.format(new Date,"yyyy-MM-dd"),roles:(n==null?void 0:n.roles)??[]}),[n==null?void 0:n.employeeId,n==null?void 0:n.from,n==null?void 0:n.id,n==null?void 0:n.roles,n==null?void 0:n.substituteId,n==null?void 0:n.to,d==null?void 0:d.personalNumber]),x=Ie.useForm({resolver:l.t(p),defaultValues:g}),y=N.useCallback(async h=>{a("premissions-substitute-submit");try{await t.post("permissions/substitutions",h),u(f.updateSuccess,"success"),m(),o(e)}catch(v){l.hookFormSetServerErrors(x,v)}finally{r("premissions-substitute-submit")}},[u,t,x,o,m,a,r,e,f]);return N.useEffect(()=>{x.reset(g)},[g,x]),{formSchema:p,onSubmit:y,formMethods:x}},cf=n=>{var Fe;const e=l.compilerRuntimeExports.c(111),{indexRoute:t}=n,{id:o}=Ne.useParams(),{user:a}=N.useContext(l.UserContext),r=l.useAxios(),i=Ne.useNavigate(),{confirm:c}=l.useConfirm(),{texts:u}=N.useContext(l.LuminusComponentsContext),{substitutions:m}=u,{detail:d}=m,f=o!==void 0;let p;e[0]!==f?(p={enabled:f},e[0]=f,e[1]=p):p=e[1];const{data:g}=Ae.useGetApiData(`/permissions/substitutions/${o}`,p),{data:x}=Ae.useGetApiData("/permissions/users"),{onSubmit:y,formMethods:h}=rf(g,t);let v;e[2]!==h.control?(v={control:h.control,name:"employeeId"},e[2]=h.control,e[3]=v):v=e[3];const b=Ie.useWatch(v);let w;e[4]!==b||e[5]!==x?(w=(Fe=x==null?void 0:x.find(le=>le.employeeId===b))==null?void 0:Fe.name,e[4]=b,e[5]=x,e[6]=w):w=e[6];const S=b>0&&!!x;let j;e[7]!==S?(j={enabled:S},e[7]=S,e[8]=j):j=e[8];const{data:C}=Ae.useGetApiData(`/permissions/roles?userName=${w}`,j),{refreshAvailableDelegations:I}=N.useContext(l.DelegationContext),{checkUserHasPermissions:k}=l.usePermissions();let L;e[9]!==r||e[10]!==c||e[11]!==o||e[12]!==t||e[13]!==i||e[14]!==I||e[15]!==d.deleteConfirm?(L=async()=>{await c(d.deleteConfirm)&&(await r.delete(`/permissions/substitutions/${o}`),I(),i(t))},e[9]=r,e[10]=c,e[11]=o,e[12]=t,e[13]=i,e[14]=I,e[15]=d.deleteConfirm,e[16]=L):L=e[16];const E=L;a==null||a.personalNumber;let D;e[17]!==k||e[18]!==b||e[19]!==(a==null?void 0:a.personalNumber)?(D=b!==(a==null?void 0:a.personalNumber)&&!k(["ZASTUP_MODIFY"]),e[17]=k,e[18]=b,e[19]=a==null?void 0:a.personalNumber,e[20]=D):D=e[20];const _=D;let R;e[21]!==h.control?(R={control:h.control,name:"roles"},e[21]=h.control,e[22]=R):R=e[22];const $=Ie.useWatch(R);let A;e[23]!==C?(A=C==null?void 0:C.filter(df),e[23]=C,e[24]=A):A=e[24];const T=A;let F;e[25]!==T||e[26]!==$?(F=(T==null?void 0:T.every(le=>$==null?void 0:$.includes(le.name)))??!1,e[25]=T,e[26]=$,e[27]=F):F=e[27];const P=F;let M;e[28]!==d.title?(M=s.jsx(l.Typography,{variant:"h3",children:d.title}),e[28]=d.title,e[29]=M):M=e[29];let O;e[30]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle}),e[30]=O):O=e[30];let z;e[31]!==E?(z=()=>E(),e[31]=E,e[32]=z):z=e[32];let H;e[33]!==z||e[34]!==d.delete?(H=s.jsx(l.Dropdown,{toggle:O,children:s.jsx(l.DropdownItem,{onClick:z,children:d.delete})}),e[33]=z,e[34]=d.delete,e[35]=H):H=e[35];let W;e[36]!==M||e[37]!==H?(W=s.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[M,H]}),e[36]=M,e[37]=H,e[38]=W):W=e[38];let B;e[39]!==h||e[40]!==y?(B=h.handleSubmit(y),e[39]=h,e[40]=y,e[41]=B):B=e[41];const U=d.title;let V;e[42]!==x?(V=(x==null?void 0:x.map(uf))??[],e[42]=x,e[43]=V):V=e[43];const X=d.employee;let Y;e[44]!==k?(Y=k(["ZASTUP_MODIFY"]),e[44]=k,e[45]=Y):Y=e[45];const Z=!Y;let te;e[46]===Symbol.for("react.memo_cache_sentinel")?(te=["roles"],e[46]=te):te=e[46];let se;e[47]!==V||e[48]!==Z||e[49]!==d.employee?(se=s.jsx(Xt,{formField:"employeeId",options:V,label:X,isNumber:!0,required:!0,disabled:Z,resetsFields:te}),e[47]=V,e[48]=Z,e[49]=d.employee,e[50]=se):se=e[50];let q;e[51]!==x?(q=(x==null?void 0:x.map(mf))??[],e[51]=x,e[52]=q):q=e[52];let ae;e[53]!==q||e[54]!==d.substitute?(ae=s.jsx(Xt,{formField:"substituteId",options:q,label:d.substitute,isNumber:!0,required:!0}),e[53]=q,e[54]=d.substitute,e[55]=ae):ae=e[55];let re;e[56]!==d.from?(re=s.jsx(l.HookFormTextInput,{formField:"from",label:d.from,type:"date",required:!0}),e[56]=d.from,e[57]=re):re=e[57];let me;e[58]!==d.to?(me=s.jsx(l.HookFormTextInput,{formField:"to",label:d.to,type:"date",required:!0}),e[58]=d.to,e[59]=me):me=e[59];let fe;e[60]!==se||e[61]!==ae||e[62]!==re||e[63]!==me||e[64]!==d.title?(fe=s.jsx(l.Col,{sm:12,md:4,children:s.jsxs(pt,{title:U,children:[se,ae,re,me]})}),e[60]=se,e[61]=ae,e[62]=re,e[63]=me,e[64]=d.title,e[65]=fe):fe=e[65];let Q;e[66]!==(T==null?void 0:T.length)||e[67]!==($==null?void 0:$.length)||e[68]!==d?(Q=d.roles(`${($==null?void 0:$.length)??0}/${(T==null?void 0:T.length)??0}`),e[66]=T==null?void 0:T.length,e[67]=$==null?void 0:$.length,e[68]=d,e[69]=Q):Q=e[69];let K;e[70]!==P||e[71]!==T||e[72]!==_||e[73]!==h||e[74]!==($==null?void 0:$.length)||e[75]!==d.checkAllRoles||e[76]!==d.uncheckAllRoles?(K=_?null:s.jsx("div",{className:"bg-darker",style:{marginLeft:"-12px",marginRight:"-12px",marginTop:"-12px",padding:"0px 12px"},children:s.jsx(Dt,{label:P?d.uncheckAllRoles:d.checkAllRoles,indeterminate:!P&&($==null?void 0:$.length)>0,value:P,disabled:_,onChange:()=>{h.setValue("roles",P?[]:(T==null?void 0:T.map(ff))??[],{shouldDirty:!0})},InputContainer:l.RowLabelInput})}),e[70]=P,e[71]=T,e[72]=_,e[73]=h,e[74]=$==null?void 0:$.length,e[75]=d.checkAllRoles,e[76]=d.uncheckAllRoles,e[77]=K):K=e[77];let G;e[78]===Symbol.for("react.memo_cache_sentinel")?(G={maxHeight:"60vh",marginLeft:"-12px",marginRight:"-12px",padding:"0px 12px"},e[78]=G):G=e[78];let oe;e[79]!==_||e[80]!==h||e[81]!==$||e[82]!==C?(oe=C==null?void 0:C.map(le=>s.jsx(Dt,{label:le.name,value:($==null?void 0:$.find(ue=>ue===le.name))!==void 0,disabled:_||!le.canBeRepresented,onChange:ue=>{h.setValue("roles",ue?[...$??[],le.name]:($==null?void 0:$.filter(he=>he!==le.name))??[],{shouldDirty:!0})},InputContainer:l.RowLabelInput},le.name)),e[79]=_,e[80]=h,e[81]=$,e[82]=C,e[83]=oe):oe=e[83];let J;e[84]!==oe?(J=s.jsx("div",{className:"overflow-auto",style:G,children:oe}),e[84]=oe,e[85]=J):J=e[85];let ee;e[86]!==Q||e[87]!==K||e[88]!==J?(ee=s.jsx(l.Col,{sm:12,md:4,children:s.jsxs(pt,{title:Q,className:"h-max-100",contentClassName:"d-flex flex-column overflow-hidden",children:[K,J]})}),e[86]=Q,e[87]=K,e[88]=J,e[89]=ee):ee=e[89];let ne;e[90]!==fe||e[91]!==ee?(ne=s.jsxs(Rn,{className:"h-100 gx-3 gy-3",children:[fe,ee]}),e[90]=fe,e[91]=ee,e[92]=ne):ne=e[92];let ce;e[93]!==h?(ce=()=>h.reset(),e[93]=h,e[94]=ce):ce=e[94];let ve;e[95]!==ce||e[96]!==d.save?(ve=s.jsx(ko,{onStorno:ce,children:d.save}),e[95]=ce,e[96]=d.save,e[97]=ve):ve=e[97];let de;e[98]!==B||e[99]!==ne||e[100]!==ve?(de=s.jsxs(l.Form,{onSubmit:B,className:"h-100",children:[ne,ve]}),e[98]=B,e[99]=ne,e[100]=ve,e[101]=de):de=e[101];let be;e[102]!==_||e[103]!==de?(be=s.jsx(Ge.FormDisabledProvider,{disabled:_,children:de}),e[102]=_,e[103]=de,e[104]=be):be=e[104];let we;e[105]!==h||e[106]!==be?(we=s.jsx(Ie.FormProvider,{...h,children:be}),e[105]=h,e[106]=be,e[107]=we):we=e[107];let ke;return e[108]!==W||e[109]!==we?(ke=s.jsx(l.PageContainer,{title:W,children:we}),e[108]=W,e[109]=we,e[110]=ke):ke=e[110],ke};function df(n){return n.canBeRepresented}function uf(n){return{id:n.employeeId,name:`${n.employeeName} (${n.name})`}}function mf(n){return{id:n.employeeId,name:`${n.employeeName} (${n.name})`}}function ff(n){return n.name}const pf=n=>{const e=l.compilerRuntimeExports.c(32),{BnfTableComponent:t,items:o,onEditItem:a,tableIdentifier:r}=n,{texts:i}=N.useContext(l.LuminusComponentsContext),{approval:c}=i;let u;e[0]!==o?(u=o.map(hf),e[0]=o,e[1]=u):u=e[1];const m=u;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=l.u(),e[2]=d):d=e[2];const f=d;let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f.accessor("id",{header:"Id",type:"number",meta:{filterVariant:"none",hidden:!0}}),e[3]=p):p=e[3];let g;e[4]!==c.delegations.table.approval?(g=f.accessor("approval.name",{header:c.delegations.table.approval,type:"string",meta:{filterVariant:"select"},mobileMeta:{isIdentifier:!0}}),e[4]=c.delegations.table.approval,e[5]=g):g=e[5];let x;e[6]!==c.delegations.table.employee?(x=f.accessor("employee.name",{header:c.delegations.table.employee,type:"string",mobileMeta:{isIdentifier:!0}}),e[6]=c.delegations.table.employee,e[7]=x):x=e[7];let y;e[8]!==c.delegations.table.delegate?(y=f.accessor("delegate.name",{header:c.delegations.table.delegate,type:"string",mobileMeta:{isIdentifier:!0}}),e[8]=c.delegations.table.delegate,e[9]=y):y=e[9];let h;e[10]!==c.delegations.table.dateFrom||e[11]!==c.delegations.table.dateGroup?(h=f.accessor("dateFrom",{header:c.delegations.table.dateFrom,type:"date",mobileMeta:{displayGroup:c.delegations.table.dateGroup}}),e[10]=c.delegations.table.dateFrom,e[11]=c.delegations.table.dateGroup,e[12]=h):h=e[12];let v;e[13]!==c.delegations.table.dateGroup||e[14]!==c.delegations.table.dateTo?(v=f.accessor("dateTo",{header:c.delegations.table.dateTo,type:"date",mobileMeta:{displayGroup:c.delegations.table.dateGroup}}),e[13]=c.delegations.table.dateGroup,e[14]=c.delegations.table.dateTo,e[15]=v):v=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=f.accessor("archive",{header:"",type:"boolean",meta:{hidden:!0}}),e[16]=b):b=e[16];let w;e[17]!==g||e[18]!==x||e[19]!==y||e[20]!==h||e[21]!==v?(w=[p,g,x,y,h,v,b],e[17]=g,e[18]=x,e[19]=y,e[20]=h,e[21]=v,e[22]=w):w=e[22];const S=w;let j;e[23]!==o||e[24]!==a?(j=k=>{a(o.find(L=>L.id===k.id))},e[23]=o,e[24]=a,e[25]=j):j=e[25];const C=j;let I;return e[26]!==t||e[27]!==S||e[28]!==C||e[29]!==r||e[30]!==m?(I=s.jsx(t,{tableId:r,columns:S,data:m,onRowClick:C}),e[26]=t,e[27]=S,e[28]=C,e[29]=r,e[30]=m,e[31]=I):I=e[31],I};function hf(n){return{...n,archive:!!(n.dateTo&&l.isPast(l.parseISO(n.dateTo)))}}const gf=(n,e="/approval/delegation/runningProcess",t="/approval/delegation",o=a=>`/approval/delegation/${a}`)=>{const a=l.useAxios(),{startLoading:r,stopLoading:i}=N.useContext(l.LoadingContext),c=N.useCallback(async(d,f)=>{let p=null;r("getHasRunningProcesses");try{p=(await a.get(`${e}?employeeId=${d}&approvalId=${f}`)).data}finally{i("getHasRunningProcesses")}return p},[a,r,i,e]),u=N.useCallback(async(d,f)=>(r("approvalDelegationPost"),a.post(t,d).then(()=>!0).catch(p=>(l.hookFormSetServerErrors(f,p),!1)).finally(()=>i("approvalDelegationPost"))),[a,r,i,t]),m=N.useCallback(async()=>n!=null&&n.id?(r("approvalDelegationDelete"),a.delete(o(n.id)).then(()=>!0).catch(()=>!1).finally(()=>i("approvalDelegationDelete"))):!1,[a,n,r,i,o]);return{getHasRunningProcesses:c,postEditDelegation:u,postDeleteDelegation:m}},xf=n=>{var Q,K;const e=l.compilerRuntimeExports.c(85),{model:t,handleClose:o,onConfirm:a,apiApprovalDefinitions:r,apiHasRunningProcess:i,apiPostEditDelegation:c,apiDeleteDelegation:u,EmployeePickerComponent:m}=n,{ProjectIconComponent:d,texts:f}=N.useContext(l.LuminusComponentsContext),{approval:p}=f,{zDate:g,zObjectIdIntRequired:x,zDateRequired:y}=l.useZodSchemaTypes(),{addNotification:h}=l.useNotifications(),{confirm:v}=l.useConfirm(),{data:b}=Ae.useGetApiData(r);let w,S;if(e[0]!==g||e[1]!==y||e[2]!==x){const G=l.objectType({employee:x(),delegate:x(),dateFrom:y(),dateTo:g(),approval:x()});S=Ie.useForm,w=l.t(G),e[0]=g,e[1]=y,e[2]=x,e[3]=w,e[4]=S}else w=e[3],S=e[4];let j;e[5]!==w?(j={resolver:w},e[5]=w,e[6]=j):j=e[6];const C=S(j),{getHasRunningProcesses:I,postEditDelegation:k,postDeleteDelegation:L}=gf(t,i,c,u);let E,D;e[7]!==C||e[8]!==t?(E=()=>{var G,oe,J,ee,ne,ce;t&&(C.reset({...t,employee:{id:((G=t.employee)==null?void 0:G.id)??0},delegate:{id:((oe=t.delegate)==null?void 0:oe.id)??0},dateFrom:t.dateFrom??"",approval:{id:((J=t.approval)==null?void 0:J.id)??0}},{keepDirty:!1}),(ee=t.employee)!=null&&ee.id||Ke.hookFormSetNull(C,"employee.id"),(ne=t.delegate)!=null&&ne.id||Ke.hookFormSetNull(C,"delegate.id"),(ce=t.approval)!=null&&ce.id||Ke.hookFormSetNull(C,"approval.id"))},D=[t,C],e[7]=C,e[8]=t,e[9]=E,e[10]=D):(E=e[9],D=e[10]),N.useEffect(E,D);let _;e[11]!==h||e[12]!==v||e[13]!==C||e[14]!==I||e[15]!==t||e[16]!==a||e[17]!==k||e[18]!==p.delegations.createSuccess||e[19]!==p.delegations.delegateExistingsConfirmMessage||e[20]!==p.delegations.editSuccess?(_=async G=>{if(!t)return;const oe={...t};Object.assign(oe,G),l.fixNameIdNulls(oe);const J=await I(oe.employee.id,oe.approval.id);oe.includeExisting=J&&!!await v(p.delegations.delegateExistingsConfirmMessage),await k(oe,C)&&(h(t.id?p.delegations.editSuccess:p.delegations.createSuccess,"success"),a())},e[11]=h,e[12]=v,e[13]=C,e[14]=I,e[15]=t,e[16]=a,e[17]=k,e[18]=p.delegations.createSuccess,e[19]=p.delegations.delegateExistingsConfirmMessage,e[20]=p.delegations.editSuccess,e[21]=_):_=e[21];const R=_;let $;e[22]!==h||e[23]!==v||e[24]!==a||e[25]!==L||e[26]!==p.delegations.deleteConfirm||e[27]!==p.delegations.deleteSuccess?($=async()=>{await v(p.delegations.deleteConfirm)&&await L()&&(h(p.delegations.deleteSuccess,"success"),a())},e[22]=h,e[23]=v,e[24]=a,e[25]=L,e[26]=p.delegations.deleteConfirm,e[27]=p.delegations.deleteSuccess,e[28]=$):$=e[28];const A=$,T=t!==null;let F;e[29]!==o?(F=()=>o(),e[29]=o,e[30]=F):F=e[30];const P=t!=null&&t.id?p.delegations.detailTitle:p.delegations.newTitle;let M;e[31]!==P?(M=s.jsx(l.Modal.Title,{className:"w-100",children:P}),e[31]=P,e[32]=M):M=e[32];let O;e[33]!==d||e[34]!==(t==null?void 0:t.id)||e[35]!==A||e[36]!==p.delegations.delete?(O=t!=null&&t.id?s.jsx(l.Dropdown,{toggle:s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle}),className:"modalHeaderDropdown",children:s.jsx(l.DropdownItem,{color:"danger",icon:s.jsx(d,{icon:"delete"}),onClick:A,children:p.delegations.delete})}):null,e[33]=d,e[34]=t==null?void 0:t.id,e[35]=A,e[36]=p.delegations.delete,e[37]=O):O=e[37];let z;e[38]!==M||e[39]!==O?(z=s.jsxs(l.Modal.Header,{closeButton:!0,children:[M,O]}),e[38]=M,e[39]=O,e[40]=z):z=e[40];let H;e[41]!==C||e[42]!==R?(H=C.handleSubmit(R),e[41]=C,e[42]=R,e[43]=H):H=e[43];let W;e[44]!==b?(W=b??[],e[44]=b,e[45]=W):W=e[45];let B;e[46]!==W||e[47]!==p.delegations.detail.approval?(B=s.jsx(Xt,{label:p.delegations.detail.approval,isNumber:!0,formField:"approval.id",options:W,required:!0}),e[46]=W,e[47]=p.delegations.detail.approval,e[48]=B):B=e[48];let U;e[49]!==t?(U=(Q=t==null?void 0:t.employee)!=null&&Q.id?{id:t.employee.id,name:t.employee.name}:null,e[49]=t,e[50]=U):U=e[50];let V;e[51]!==m||e[52]!==U||e[53]!==p.delegations.detail.employee?(V=s.jsx(m,{label:p.delegations.detail.employee,formField:"employee.id",defaultSelection:U,required:!0}),e[51]=m,e[52]=U,e[53]=p.delegations.detail.employee,e[54]=V):V=e[54];let X;e[55]!==t?(X=(K=t==null?void 0:t.delegate)!=null&&K.id?{id:t.delegate.id,name:t.delegate.name}:null,e[55]=t,e[56]=X):X=e[56];let Y;e[57]!==m||e[58]!==X||e[59]!==p.delegations.detail.delegate?(Y=s.jsx(m,{label:p.delegations.detail.delegate,formField:"delegate.id",defaultSelection:X,required:!0}),e[57]=m,e[58]=X,e[59]=p.delegations.detail.delegate,e[60]=Y):Y=e[60];let Z;e[61]!==p.delegations.detail.dateFrom?(Z=s.jsx(l.HookFormTextInput,{label:p.delegations.detail.dateFrom,formField:"dateFrom",type:"date",required:!0}),e[61]=p.delegations.detail.dateFrom,e[62]=Z):Z=e[62];let te;e[63]!==p.delegations.detail.dateTo?(te=s.jsx(l.HookFormTextInput,{label:p.delegations.detail.dateTo,formField:"dateTo",type:"date"}),e[63]=p.delegations.detail.dateTo,e[64]=te):te=e[64];let se;e[65]!==B||e[66]!==V||e[67]!==Y||e[68]!==Z||e[69]!==te?(se=s.jsxs(l.Modal.Body,{children:[B,V,Y,Z,te]}),e[65]=B,e[66]=V,e[67]=Y,e[68]=Z,e[69]=te,e[70]=se):se=e[70];const q=t!=null&&t.id?p.delegations.save:p.delegations.create;let ae;e[71]!==q?(ae=s.jsx(l.Modal.Footer,{className:"justify-content-end",children:s.jsx(l.PrimaryButton,{type:"submit",children:q})}),e[71]=q,e[72]=ae):ae=e[72];let re;e[73]!==H||e[74]!==se||e[75]!==ae?(re=s.jsxs(l.Form,{onSubmit:H,noValidate:!0,children:[se,ae]}),e[73]=H,e[74]=se,e[75]=ae,e[76]=re):re=e[76];let me;e[77]!==C||e[78]!==re?(me=s.jsx(Ie.FormProvider,{...C,children:re}),e[77]=C,e[78]=re,e[79]=me):me=e[79];let fe;return e[80]!==F||e[81]!==z||e[82]!==me||e[83]!==T?(fe=s.jsxs(l.Modal,{show:T,onHide:F,children:[z,me]}),e[80]=F,e[81]=z,e[82]=me,e[83]=T,e[84]=fe):fe=e[84],fe},wt={apiApprovalDelegations:"/approval/delegation",apiHasRunningProcess:"/approval/delegation/runningProcess",apiPostEditDelegation:"/approval/delegation",apiDeleteDelegation:n=>`/approval/delegation/${n}`,apiApprovalDefinitions:"/approval/definition"},yf=n=>{const e=l.compilerRuntimeExports.c(38),{apiUrls:t,BnfTableComponent:o,tableIdentifier:a,EmployeePickerComponent:r}=n,{apiApprovalDelegations:i,apiHasRunningProcess:c,apiPostEditDelegation:u,apiDeleteDelegation:m,apiApprovalDefinitions:d}=t===void 0?wt:t,f=i===void 0?wt.apiApprovalDelegations:i,p=c===void 0?wt.apiHasRunningProcess:c,g=u===void 0?wt.apiPostEditDelegation:u,x=m===void 0?wt.apiDeleteDelegation:m,y=d===void 0?wt.apiApprovalDefinitions:d,{texts:h}=N.useContext(l.LuminusComponentsContext),{approval:v}=h,[b,w]=dt.useSearchQueryState("archive",!1),[S,j]=N.useState(null),{data:C,reloadData:I}=Ae.useGetApiData(`${f}?archive=${b}`);let k;e[0]!==v.delegations.title?(k=s.jsx(l.Typography,{variant:"h3",children:v.delegations.title}),e[0]=v.delegations.title,e[1]=k):k=e[1];let L;e[2]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(l.DropdownToggle,{as:l.SimpleDropdownToggle}),e[2]=L):L=e[2];let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=()=>j({id:null,employee:null,delegate:null,dateFrom:null,dateTo:null,approval:null,includeExisting:null}),e[3]=E):E=e[3];let D;e[4]!==v.delegations.createDelegation?(D=s.jsx(l.DropdownItem,{onClick:E,children:v.delegations.createDelegation}),e[4]=v.delegations.createDelegation,e[5]=D):D=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(l.DropdownDivider,{}),e[6]=_):_=e[6];let R;e[7]!==w||e[8]!==b?(R=()=>w(!b),e[7]=w,e[8]=b,e[9]=R):R=e[9];const $=b?v.delegations.hideArchived:v.delegations.showArchived;let A;e[10]!==R||e[11]!==$?(A=s.jsx(l.DropdownItem,{onClick:R,children:$}),e[10]=R,e[11]=$,e[12]=A):A=e[12];let T;e[13]!==D||e[14]!==A?(T=s.jsxs(l.Dropdown,{toggle:L,children:[D,_,A]}),e[13]=D,e[14]=A,e[15]=T):T=e[15];let F;e[16]!==T||e[17]!==k?(F=s.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[k,T]}),e[16]=T,e[17]=k,e[18]=F):F=e[18];let P;e[19]!==o||e[20]!==C||e[21]!==a?(P=C?s.jsx(pf,{items:C,onEditItem:j,BnfTableComponent:o,tableIdentifier:a}):null,e[19]=o,e[20]=C,e[21]=a,e[22]=P):P=e[22];let M;e[23]===Symbol.for("react.memo_cache_sentinel")?(M=()=>j(null),e[23]=M):M=e[23];let O;e[24]!==I?(O=()=>{j(null),I()},e[24]=I,e[25]=O):O=e[25];let z;e[26]!==r||e[27]!==y||e[28]!==x||e[29]!==p||e[30]!==g||e[31]!==S||e[32]!==O?(z=s.jsx(xf,{model:S,handleClose:M,onConfirm:O,EmployeePickerComponent:r,apiApprovalDefinitions:y,apiHasRunningProcess:p,apiPostEditDelegation:g,apiDeleteDelegation:x}),e[26]=r,e[27]=y,e[28]=x,e[29]=p,e[30]=g,e[31]=S,e[32]=O,e[33]=z):z=e[33];let H;return e[34]!==F||e[35]!==P||e[36]!==z?(H=s.jsxs(l.PageContainer,{variant:"fullScreen",title:F,children:[P,z]}),e[34]=F,e[35]=P,e[36]=z,e[37]=H):H=e[37],H},vf=n=>{const e=l.compilerRuntimeExports.c(50),{show:t,handleClose:o,onConfirm:a,currentEmployee:r,approvalApproverId:i,apiPostChangeEmployee:c,EmployeePickerComponent:u}=n,{texts:m}=N.useContext(l.LuminusComponentsContext),{approval:d}=m,{zNumberRequired:f}=l.useZodSchemaTypes(),p=l.useAxios(),{startLoading:g,stopLoading:x}=N.useContext(l.LoadingContext),{addNotification:y}=l.useNotifications();let h,v;if(e[0]!==f){const P=l.z.object({employeeId:f()});v=Ie.useForm,h=l.t(P),e[0]=f,e[1]=h,e[2]=v}else h=e[1],v=e[2];let b;e[3]!==h?(b={resolver:h},e[3]=h,e[4]=b):b=e[4];const w=v(b);let S;e[5]!==(r==null?void 0:r.id)||e[6]!==w||e[7]!==t?(S=()=>{t&&(w.reset({employeeId:r==null?void 0:r.id}),!(r!=null&&r.id)&&Ke.hookFormSetNull(w,"employeeId"))},e[5]=r==null?void 0:r.id,e[6]=w,e[7]=t,e[8]=S):S=e[8];let j;e[9]!==r||e[10]!==w||e[11]!==t?(j=[t,r,w],e[9]=r,e[10]=w,e[11]=t,e[12]=j):j=e[12],N.useEffect(S,j);let C;e[13]!==c||e[14]!==i||e[15]!==p||e[16]!==w||e[17]!==g||e[18]!==x?(C=async P=>(g("approvalChangeEmployee"),p.post(c,{id:i,employeeId:P}).then(bf).catch(M=>(l.hookFormSetServerErrors(w,M),!1)).finally(()=>x("approvalChangeEmployee"))),e[13]=c,e[14]=i,e[15]=p,e[16]=w,e[17]=g,e[18]=x,e[19]=C):C=e[19];const I=C;let k;e[20]!==y||e[21]!==a||e[22]!==I||e[23]!==d.definitions.changeEmployeeSuccess?(k=async P=>{await I(P.employeeId)&&(y(d.definitions.changeEmployeeSuccess,"success"),a())},e[20]=y,e[21]=a,e[22]=I,e[23]=d.definitions.changeEmployeeSuccess,e[24]=k):k=e[24];const L=k;let E;e[25]!==o?(E=()=>o(),e[25]=o,e[26]=E):E=e[26];let D;e[27]!==d.definitions.changeEmployeeTitle?(D=s.jsx(l.Modal.Header,{closeButton:!0,children:s.jsx(l.Modal.Title,{children:d.definitions.changeEmployeeTitle})}),e[27]=d.definitions.changeEmployeeTitle,e[28]=D):D=e[28];let _;e[29]!==w||e[30]!==L?(_=w.handleSubmit(L),e[29]=w,e[30]=L,e[31]=_):_=e[31];let R;e[32]!==u||e[33]!==r||e[34]!==d.definitions.changeEmployeeNewEmployee?(R=s.jsx(l.Modal.Body,{children:s.jsx(u,{formField:"employeeId",defaultSelection:r,label:d.definitions.changeEmployeeNewEmployee,required:!0})}),e[32]=u,e[33]=r,e[34]=d.definitions.changeEmployeeNewEmployee,e[35]=R):R=e[35];let $;e[36]!==d.definitions.changeEmployeeConfirm?($=s.jsx(l.Modal.Footer,{className:"d-flex justify-content-end",children:s.jsx(l.PrimaryButton,{type:"submit",children:d.definitions.changeEmployeeConfirm})}),e[36]=d.definitions.changeEmployeeConfirm,e[37]=$):$=e[37];let A;e[38]!==_||e[39]!==R||e[40]!==$?(A=s.jsxs(l.Form,{onSubmit:_,noValidate:!0,children:[R,$]}),e[38]=_,e[39]=R,e[40]=$,e[41]=A):A=e[41];let T;e[42]!==w||e[43]!==A?(T=s.jsx(Ie.FormProvider,{...w,children:A}),e[42]=w,e[43]=A,e[44]=T):T=e[44];let F;return e[45]!==t||e[46]!==D||e[47]!==T||e[48]!==E?(F=s.jsxs(l.Modal,{show:t,onHide:E,children:[D,T]}),e[45]=t,e[46]=D,e[47]=T,e[48]=E,e[49]=F):F=e[49],F};function bf(){return!0}const jf=n=>{var L;const e=l.compilerRuntimeExports.c(33),{level:t,reloadApproval:o,appEmployeeDetail:a,apiPostChangeEmployee:r,EmployeePickerComponent:i}=n,{ProjectIconComponent:c,texts:u}=N.useContext(l.LuminusComponentsContext),{approval:m}=u,[d,f]=N.useState(null);let p;e[0]!==t.index||e[1]!==m.definitions?(p=m.definitions.nthLevel(t.index+1),e[0]=t.index,e[1]=m.definitions,e[2]=p):p=e[2];let g;e[3]!==p?(g=s.jsx(l.Typography,{variant:"body",children:p}),e[3]=p,e[4]=g):g=e[4];let x;e[5]!==t.threshold||e[6]!==m.definitions?(x=m.definitions.levelThresholdInfo(t.threshold),e[5]=t.threshold,e[6]=m.definitions,e[7]=x):x=e[7];let y;e[8]!==x?(y=s.jsx(l.Typography,{variant:"body2",children:x}),e[8]=x,e[9]=y):y=e[9];let h;e[10]!==g||e[11]!==y?(h=s.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[g,y]}),e[10]=g,e[11]=y,e[12]=h):h=e[12];let v;e[13]!==c||e[14]!==a||e[15]!==t.approvers||e[16]!==t.threshold||e[17]!==m.definitions?(v=t.approvers&&t.approvers.length>0?s.jsx("div",{className:"list-group",children:(L=t.approvers)==null?void 0:L.map(E=>s.jsxs("div",{className:"list-group-item ms-3 p-1 px-2 d-flex align-items-center justify-content-between gap-5",children:[s.jsxs(l.Typography,{variant:"body2",className:"d-flex align-items-center justify-content-between gap-2",children:[E.employeeId?s.jsxs(s.Fragment,{children:[s.jsx(c,{icon:"user"}),s.jsx(l.IconButton,{size:"sm",onClick:()=>f({id:E.id,employee:{id:E.employeeId??0,name:E.employeeName}}),children:s.jsx(c,{icon:"edit"})}),s.jsx(Ne.Link,{to:a(E.employeeId),className:"link",children:E.employeeName})]}):null,E.role?s.jsxs(s.Fragment,{children:[s.jsx(c,{icon:"role"})," ",s.jsx("span",{className:"fw-bold text-uppercase",children:E.role})]}):null]}),s.jsx(l.Typography,{variant:"body2",children:m.definitions.approverThresholdInfo(t.threshold,E.scale)})]}))}):null,e[13]=c,e[14]=a,e[15]=t.approvers,e[16]=t.threshold,e[17]=m.definitions,e[18]=v):v=e[18];const b=(d==null?void 0:d.id)??0,w=(d==null?void 0:d.employee)??null,S=d!==null;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(null),e[19]=j):j=e[19];let C;e[20]!==o?(C=()=>{f(null),o()},e[20]=o,e[21]=C):C=e[21];let I;e[22]!==i||e[23]!==r||e[24]!==S||e[25]!==C||e[26]!==b||e[27]!==w?(I=s.jsx(vf,{approvalApproverId:b,currentEmployee:w,show:S,handleClose:j,onConfirm:C,apiPostChangeEmployee:r,EmployeePickerComponent:i}),e[22]=i,e[23]=r,e[24]=S,e[25]=C,e[26]=b,e[27]=w,e[28]=I):I=e[28];let k;return e[29]!==I||e[30]!==h||e[31]!==v?(k=s.jsxs("div",{className:"bg-white rounded p-2 px-3 d-flex flex-column gap-2 shadow-sm",children:[h,v,I]}),e[29]=I,e[30]=h,e[31]=v,e[32]=k):k=e[32],k},Sf=n=>{const e=l.compilerRuntimeExports.c(18),{approval:t,apiApprovalDelegations:o,appEmployeeDetail:a}=n,{ProjectIconComponent:r,texts:i}=N.useContext(l.LuminusComponentsContext),{approval:c}=i,{data:u}=Ae.useGetApiData(o);let m;e[0]!==t||e[1]!==u?(m=u?u.filter(h=>{var v;return((v=h.approval)==null?void 0:v.id)===t.id}):null,e[0]=t,e[1]=u,e[2]=m):m=e[2];const d=m;let f;e[3]!==c.delegations.title?(f=s.jsx(l.Typography,{variant:"body",children:c.delegations.title}),e[3]=c.delegations.title,e[4]=f):f=e[4];let p;e[5]!==r||e[6]!==a||e[7]!==d?(p=d&&d.length>0?s.jsx("div",{className:"list-group",children:d.map(h=>{var v,b,w,S;return s.jsxs("div",{className:"list-group-item p-2 px-3",children:[s.jsxs(l.Typography,{variant:"body2",className:"row g-0",children:[s.jsx("div",{className:"col-5 d-flex align-items-center",children:s.jsx(Ne.Link,{to:a(((v=h.employee)==null?void 0:v.id)??0),className:"link text-decoration-line-through link-secondary",children:((b=h.employee)==null?void 0:b.name)??"-"})}),s.jsx("div",{className:"col-2 text-center d-flex align-items-center justify-content-center",children:s.jsx(r,{icon:"arrow-right"})}),s.jsx("div",{className:"col-5 text-end d-flex-align-items-center",children:s.jsx(Ne.Link,{to:a(((w=h.delegate)==null?void 0:w.id)??0),className:"link",children:((S=h.delegate)==null?void 0:S.name)??"-"})})]}),s.jsxs(l.Typography,{variant:"caption",children:[h.dateFrom?l.formatDate(h.dateFrom):"N/A"," -"," ",h.dateTo?l.formatDate(h.dateTo):"N/A"]})]},h.id)})}):null,e[5]=r,e[6]=a,e[7]=d,e[8]=p):p=e[8];let g;e[9]!==p?(g=s.jsx("div",{className:"overflow-auto h-100",children:p}),e[9]=p,e[10]=g):g=e[10];let x;e[11]!==d||e[12]!==c.delegations.noDelegations?(x=d&&d.length===0?s.jsx(l.Alert,{variant:"secondary",size:"sm",children:c.delegations.noDelegations}):null,e[11]=d,e[12]=c.delegations.noDelegations,e[13]=x):x=e[13];let y;return e[14]!==f||e[15]!==g||e[16]!==x?(y=s.jsxs("div",{className:"bg-white rounded border p-2 px-3 d-flex flex-column gap-2 overflow-hidden h-max-100",children:[f,g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=y):y=e[17],y},Cf=n=>{var w,S;const e=l.compilerRuntimeExports.c(26),{approval:t,reloadApproval:o,appEmployeeDetail:a,apiPostChangeEmployee:r,apiApprovalDelegations:i,EmployeePickerComponent:c}=n,{texts:u}=N.useContext(l.LuminusComponentsContext),{approval:m}=u,d=t.name??"";let f;e[0]!==d?(f=s.jsx(l.Typography,{variant:"h6",children:d}),e[0]=d,e[1]=f):f=e[1];let p;e[2]!==t.lastExecutionDate||e[3]!==m?(p=t.lastExecutionDate?s.jsxs(l.Typography,{variant:"caption",children:[m.definitions.lastExecuted," ",l.formatDate(t.lastExecutionDate)]}):null,e[2]=t.lastExecutionDate,e[3]=m,e[4]=p):p=e[4];let g;e[5]!==f||e[6]!==p?(g=s.jsxs("div",{className:"px-4 pt-1 d-flex align-items-center justify-content-between",children:[f,p]}),e[5]=f,e[6]=p,e[7]=g):g=e[7];let x;e[8]!==c||e[9]!==r||e[10]!==a||e[11]!==t.levels||e[12]!==o?(x=(S=(w=t.levels)==null?void 0:w.sort(wf))==null?void 0:S.map(j=>s.jsx(jf,{level:j,reloadApproval:o,appEmployeeDetail:a,apiPostChangeEmployee:r,EmployeePickerComponent:c},j.id)),e[8]=c,e[9]=r,e[10]=a,e[11]=t.levels,e[12]=o,e[13]=x):x=e[13];let y;e[14]!==x?(y=s.jsx("div",{className:"d-flex flex-column gap-2 overflow-auto h-100 p-3 px-4",children:x}),e[14]=x,e[15]=y):y=e[15];let h;e[16]!==g||e[17]!==y?(h=s.jsx("div",{className:"col-7 overflow-hidden h-100",children:s.jsxs("div",{className:"d-flex flex-column gap-0 overflow-hidden h-100",children:[g,y]})}),e[16]=g,e[17]=y,e[18]=h):h=e[18];let v;e[19]!==i||e[20]!==a||e[21]!==t?(v=s.jsx("div",{className:"col-5 overflow-hidden h-100",children:s.jsx(Sf,{approval:t,apiApprovalDelegations:i,appEmployeeDetail:a})}),e[19]=i,e[20]=a,e[21]=t,e[22]=v):v=e[22];let b;return e[23]!==h||e[24]!==v?(b=s.jsxs("div",{className:"row g-0 overflow-hidden h-100",children:[h,v]}),e[23]=h,e[24]=v,e[25]=b):b=e[25],b};function wf(n,e){return n.index-e.index}const Rt={apiApprovalDefinitions:"/approval/definition",apiApprovalDefinitionDetail:n=>`/approval/definition/${n}`,apiPostChangeEmployee:"/approval/definition/approver/edit",apiApprovalDelegations:"/approval/delegation"},vn={appApprovalsDelegations:"/approvals/delegations",appEmployeeDetail:n=>`/employees/${n}`},Nf=n=>{const e=l.compilerRuntimeExports.c(43),{appUrls:t,apiUrls:o,EmployeePickerComponent:a}=n,{appApprovalsDelegations:r,appEmployeeDetail:i}=t===void 0?vn:t,c=r===void 0?vn.appApprovalsDelegations:r,u=i===void 0?vn.appEmployeeDetail:i,{apiApprovalDefinitions:m,apiApprovalDefinitionDetail:d,apiPostChangeEmployee:f,apiApprovalDelegations:p}=o===void 0?Rt:o,g=m===void 0?Rt.apiApprovalDefinitions:m,x=d===void 0?Rt.apiApprovalDefinitionDetail:d,y=f===void 0?Rt.apiPostChangeEmployee:f,h=p===void 0?Rt.apiApprovalDelegations:p,{ProjectIconComponent:v,texts:b}=N.useContext(l.LuminusComponentsContext),{approval:w}=b,{data:S}=Ae.useGetApiData(g),[j,C]=dt.useSearchQueryState("approval",null),I=j??0;let k;e[0]!==x||e[1]!==I?(k=x(I),e[0]=x,e[1]=I,e[2]=k):k=e[2];const L=j!==null;let E;e[3]!==L?(E={enabled:L},e[3]=L,e[4]=E):E=e[4];const{data:D,reloadData:_}=Ae.useGetApiData(k,E);let R,$;e[5]!==S||e[6]!==j||e[7]!==C?(R=()=>{var U;j||C(((U=S==null?void 0:S.at(0))==null?void 0:U.id)??null)},$=[S,j,C],e[5]=S,e[6]=j,e[7]=C,e[8]=R,e[9]=$):(R=e[8],$=e[9]),N.useEffect(R,$);let A;e[10]!==w.definitions.title?(A=s.jsx(l.Typography,{variant:"h3",children:w.definitions.title}),e[10]=w.definitions.title,e[11]=A):A=e[11];let T;e[12]!==v?(T=s.jsx(v,{icon:"link"}),e[12]=v,e[13]=T):T=e[13];let F;e[14]!==c||e[15]!==T||e[16]!==w.definitions.delegationsDefinitions?(F=s.jsx(l.ContextButton,{as:"link",href:c,icon:T,children:w.definitions.delegationsDefinitions}),e[14]=c,e[15]=T,e[16]=w.definitions.delegationsDefinitions,e[17]=F):F=e[17];let P;e[18]!==A||e[19]!==F?(P=s.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[A,F]}),e[18]=A,e[19]=F,e[20]=P):P=e[20];let M;e[21]!==v||e[22]!==S||e[23]!==j||e[24]!==C?(M=S==null?void 0:S.sort(If).map(U=>s.jsxs("div",{role:"button",className:l.classNames("list-group-item list-group-item-action p-2 d-flex gap-3 align-items-center justify-content-between",{"bg-primary text-white":j===U.id}),onClick:()=>C(U.id),children:[s.jsx("span",{children:U.name}),s.jsxs(l.Typography,{variant:"caption",className:"d-flex align-items-center gap-1",children:[s.jsx(v,{icon:"menu"}),U.levelCount]})]},U.id)),e[21]=v,e[22]=S,e[23]=j,e[24]=C,e[25]=M):M=e[25];let O;e[26]!==M?(O=s.jsx("div",{className:"col-2 overflow-hidden h-100",children:s.jsx(l.Typography,{variant:"body2",className:"overflow-x-hidden overflow-y-auto h-100",children:s.jsx("div",{className:"list-group",children:M})})}),e[26]=M,e[27]=O):O=e[27];let z;e[28]!==a||e[29]!==h||e[30]!==y||e[31]!==u||e[32]!==D||e[33]!==_?(z=D?s.jsx(Cf,{approval:D,reloadApproval:_,appEmployeeDetail:u,apiPostChangeEmployee:y,EmployeePickerComponent:a,apiApprovalDelegations:h}):null,e[28]=a,e[29]=h,e[30]=y,e[31]=u,e[32]=D,e[33]=_,e[34]=z):z=e[34];let H;e[35]!==z?(H=s.jsx("div",{className:"col-10 overflow-hidden h-100",children:z}),e[35]=z,e[36]=H):H=e[36];let W;e[37]!==O||e[38]!==H?(W=s.jsxs("div",{className:"row g-0 h-max-100 overflow-hidden",children:[O,H]}),e[37]=O,e[38]=H,e[39]=W):W=e[39];let B;return e[40]!==P||e[41]!==W?(B=s.jsx(l.PageContainer,{variant:"fullScreen",title:P,children:W}),e[40]=P,e[41]=W,e[42]=B):B=e[42],B};function If(n,e){return(n.name??"").localeCompare(e.name??"")}const kf=({overviewApiPath:n=e=>`/notification/email/overview?date=${e}`})=>{const{ProjectIconComponent:e,texts:{emailOverview:t}}=N.useContext(l.LuminusComponentsContext),[o,a]=dt.useSearchQueryState("date",It(new Date,{representation:"date"})),r=N.useMemo(()=>o?l.parseISO(o):new Date,[o]),{data:i}=Ae.useGetApiData(n(It(r,{representation:"date"}))),c=N.useCallback(f=>{a(It(ml(r,f),{representation:"date"}))},[r,a]),[u,m]=dt.useSearchQueryState("email",null),d=N.useMemo(()=>u?i==null?void 0:i.find(f=>f.id===u):null,[u,i]);return s.jsx(l.PageContainer,{variant:"fullScreen",title:s.jsxs("div",{className:"d-flex align-items-center gap-3",children:[s.jsx(l.Typography,{variant:"h3",children:t.title}),s.jsxs("div",{className:"d-flex gap-1 align-items-center justify-content-start",children:[s.jsx(l.IconButton,{onClick:()=>c(-1),children:s.jsx(e,{icon:"chevron-left"})}),s.jsx(l.TextInput,{type:"date",withoutLabel:!0,value:o,onChange:f=>a((f==null?void 0:f.toString())??""),size:"sm",className:"mb-1"}),s.jsx(l.IconButton,{onClick:()=>c(1),children:s.jsx(e,{icon:"chevron-right"})})]})]}),children:i!==null&&i.length<1?s.jsx(l.Alert,{variant:"warning",children:t.noMails}):s.jsxs("div",{className:"d-flex overflow-hidden gap-3 h-100",children:[s.jsx("div",{className:"h-100 overflow-y-auto overflow-x-hidden",style:{minWidth:"260px"},children:s.jsx("div",{className:"list-group",children:i==null?void 0:i.map(f=>s.jsxs("div",{role:"button",onClick:()=>m(f.id),className:l.classNames("list-group-item list-group-item-action d-flex gap-3 justify-content-between p-2",{active:u===f.id}),children:[s.jsx(l.Typography,{variant:"body2",children:f.subject}),s.jsx(l.Typography,{variant:"caption",children:l.format(l.parseISO(f.date??""),"HH:mm")})]},f.id))})}),d?s.jsxs("div",{className:"w-100 h-100 overflow-hidden bg-white rounded shadow-sm p-0",children:[s.jsx("div",{className:"mb-3 p-3 bg-darker",children:s.jsxs("div",{className:"row gx-3",children:[s.jsxs("div",{className:"col-8",children:[s.jsx(l.Typography,{variant:"caption",children:l.format(l.parseISO((d==null?void 0:d.date)??""),"dd.MM.yyyy HH:mm")}),s.jsx(l.Typography,{variant:"h6",children:(d==null?void 0:d.subject)??""})]}),s.jsxs("div",{className:"col-4",children:[s.jsxs("div",{className:"row",children:[s.jsx("div",{className:"col-6",children:s.jsx(l.Typography,{variant:"body2",children:t.from})}),s.jsx("div",{className:"col-6",children:s.jsx(l.Typography,{variant:"body2",className:"text-end fw-bold",children:(d==null?void 0:d.sender)??"-"})})]}),s.jsxs("div",{className:"row",children:[s.jsx("div",{className:"col-6",children:s.jsx(l.Typography,{variant:"body2",children:t.to})}),s.jsx("div",{className:"col-6",children:s.jsx(l.Typography,{variant:"body2",className:"text-end fw-bold",children:(d==null?void 0:d.recipient)??"-"})})]})]})]})}),s.jsx("iframe",{title:"email-body",srcDoc:(d==null?void 0:d.body)??"",width:"100%",height:"100%"})]}):null]})})};exports.Alert=l.Alert;exports.Backdrop=l.Backdrop;exports.ContextButton=l.ContextButton;exports.Documents=l.Documents;exports.Dropdown=l.Dropdown;exports.DropdownDivider=l.DropdownDivider;exports.DropdownItem=l.DropdownItem;exports.DropdownToggle=l.DropdownToggle;exports.FileExtensionIcon=l.FileExtensionIcon;exports.FloatingLabelInput=l.FloatingLabelInput;exports.HookFormTextAreaInput=l.HookFormTextAreaInput;exports.HookFormTextInput=l.HookFormTextInput;exports.HtmlTooltip=l.HtmlTooltip;exports.IconButton=l.IconButton;exports.InvalidFeedback=l.InvalidFeedback;exports.NoInputContainer=l.NoInputContainer;exports.PrimaryButton=l.PrimaryButton;exports.ResponsiveContextDropdown=l.ResponsiveContextDropdown;exports.ResponsiveContextDropdownItem=l.ResponsiveContextDropdownItem;exports.RowLabelInput=l.RowLabelInput;exports.SelectInput=l.CustomSelectInput;exports.SimplePicker=l.SimplePicker;exports.SimpleToggle=l.SimpleDropdownToggle;exports.SimpleTooltip=l.SimpleTooltip;exports.TextInput=l.TextInput;exports.Typography=l.Typography;exports.Loading=Ge.Loading;exports.AlertItem=Zo;exports.ApiFileDownloadButton=ul;exports.AppSearch=Ri;exports.Approval=qm;exports.Approvals=Nf;exports.ApprovalsDelegations=yf;exports.AuthTemplate=Jd;exports.AvatarIcon=en;exports.Badge=vc;exports.BarChart=Tm;exports.Card=pt;exports.CheckInput=Dt;exports.Collapse=At;exports.ColumnResizer=ol;exports.ContactButtonQrModal=ho;exports.ContactInput=Xl;exports.ContactsLink=go;exports.DisabledRowLabelLink=wm;exports.DropdownPicker=Zl;exports.DynamicForm=xm;exports.EmailOverview=kf;exports.EmployeeSmallPhoto=km;exports.ErrorBoundary=Jo;exports.FileDownloadUS=Ai;exports.FileUploadButton=Ll;exports.FileUploadContextButton=$n;exports.FileUploadDropdownItem=La;exports.Flexmonster=_o;exports.FloatingActionContainer=el;exports.FloatingFormSubmit=mo;exports.FromToDatePicker=Fu;exports.HomeDashboard=fc;exports.HookFormCheckInput=wa;exports.HookFormContactInput=Ia;exports.HookFormDropdownPicker=ka;exports.HookFormFileInput=_a;exports.HookFormFloatingSubmit=ko;exports.HookFormNumericStepperInput=Da;exports.HookFormNumericTextInput=Ta;exports.HookFormRadioInput=Na;exports.HookFormSelectInput=Xt;exports.HrWithText=ll;exports.IconPicker=Bn;exports.ImgApi=_n;exports.ImgBlob=wu;exports.ImgDirect=Hn;exports.ImportFilePicker=Eo;exports.ImportResult=To;exports.LanguageSwitch=Nm;exports.LineChart=Bu;exports.LoadingBlock=Ws;exports.LocalStorageBackupUS=zi;exports.LocalizationImport=Zr;exports.LocalizationSettings=fi;exports.MessageBoard=Xa;exports.MiniDetailTooltip=Gm;exports.MiniDetailValueItem=Km;exports.MonthPicker=fo;exports.MonthPickerSearchParams=Pu;exports.NotificationActions=zr;exports.NotificationUsers=Kr;exports.NumericFormat=Dm;exports.NumericStepperInput=ea;exports.NumericTextInput=No;exports.PermissionSubstituteDetail=cf;exports.PermissionSubstituteTable=af;exports.PhotoLibrary=Xo;exports.PhotoLightbox=Qo;exports.PieChart=Mu;exports.RadioInput=Io;exports.ReportPage=za;exports.ReportsIndexPage=Hm;exports.ResponsiveTabs=cr;exports.RouteLink=Ym;exports.SearchBox=_m;exports.SearchPage=Fi;exports.SearchSettingsUS=Wi;exports.SettingsFormPicker=vm;exports.ShortcutLinks=Ir;exports.ShortcutLinksProvider=Dr;exports.ShortcutLinksSetup=yr;exports.StateToggle=lf;exports.Tab=On;exports.TabPanel=Do;exports.Tabs=Mn;exports.TextAreaInput=Jl;exports.Timeline=tl;exports.TypedFormGroup=Im;exports.UserAvatarToggle=Ea;exports.UserAvatarValueFormat=Ka;exports.VersionInfo=au;exports.WidgetCard=kn;exports.YearPicker=po;exports.YearPickerSearchParams=Au;exports.useShortcutLinksContext=zn;
|