@apia/components 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ interface IBaseButton {
|
|
|
54
54
|
*/
|
|
55
55
|
declare const BaseButton: ({ id, name, onClick, isLoading, loadingChildren, disabled, children, text, variant, type, SXProps, ...buttonProps }: IBaseButton) => theme_ui_jsx_runtime.JSX.Element;
|
|
56
56
|
|
|
57
|
-
type TIconSize = number | '
|
|
57
|
+
type TIconSize = number | 'Xs' | 'Sm' | 'Md' | 'Lg' | 'Xl';
|
|
58
58
|
type TApiaIconButton = 'icon' | 'icon-primary' | 'icon-outline' | 'icon-only';
|
|
59
59
|
type TIconButton = IconButtonProps & React$1.AriaAttributes & {
|
|
60
60
|
className?: string;
|
|
@@ -675,7 +675,6 @@ interface IMakeResponsiveComponent<P extends Record<string, unknown>> {
|
|
|
675
675
|
*/
|
|
676
676
|
declare const makeResponsiveComponent: <P extends Record<string, unknown>>({ breakPoints, Component, debounce, defaultBreakpoint, }: IMakeResponsiveComponent<P>) => (props: P & {
|
|
677
677
|
breakPoints?: number[] | undefined;
|
|
678
|
-
defaultBreakPoint?: number | undefined;
|
|
679
678
|
}) => theme_ui_jsx_runtime.JSX.Element;
|
|
680
679
|
|
|
681
680
|
/**
|
|
@@ -934,4 +933,3 @@ declare function useTooltip(tooltip?: TTooltip): {
|
|
|
934
933
|
};
|
|
935
934
|
|
|
936
935
|
export { ApiaFilter, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, DateInput, DialogButtonBar, FieldErrorMessage, IApiaFilter, ICalendarModal, IConfirm, IDialogButtonBar, IDialogHeader, IField, IFieldErrorMessage, IIconInput, IOverlay, IRequiredMark, ISimpleButton, IconButton, IconInput, IconsList, LinearLoader, Listbox, ListboxItem, Modal, ModalContext, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLock, SimpleButton, TApiaButtonType, TApiaIconButton, TCheckbox, TDateProps, TIcon, TIconButton, TIconRenderer, TIconSize, TIconsList, TListbox, TModal, TModalContext, TModalSize, TNumberInput, TNumberInputChangeEvent, TOnClickNode, TOnConfirmSelection, TOnSelectionChange, TTooltip, TTooltipEvents, TUseModalConfiguration, TooltipsProvider, WaiTypeAhead, getConfirmButton, getFieldErrorStyles, getFieldTouchedStyles, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, tooltipsHandler, useModal, useOtherTagButton, useTooltip };
|
|
937
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{jsx as p,jsxs as N,Fragment as le}from"react/jsx-runtime";import*as R from"react";import y,{useState as V,forwardRef as Ye,useRef as G,useMemo as B,useEffect as Z,useCallback as L,createContext as Xe,memo as Je,useContext as ae,Children as Rt,isValidElement as Et,cloneElement as cn}from"react";import{Button as ye,Flex as ie,Spinner as ge,IconButton as sn,Box as x,Image as jt,Input as ce,Heading as un,Close as Nt,useThemeUI as dn,Select as pn,Label as fn,Progress as hn,Grid as mn}from"theme-ui";import{spacing as Q,getVariant as M,responsive as $e,injectStyles as Lt,focusOutline as Ze,getColorState as bn,makeStyledComponent as Dt,getPalette as Tt}from"@apia/theme";import{icons as Mt,Icon as Qe}from"@apia/icons";import{getSpecificParent as Oe,useUpdateEffect as Y,debugDispatcher as vn,useCombinedRefs as xe,focus as wn,focusSelector as yn,getFocusSelector as gn,screenLocker as Bt,customEvents as et,isChild as U,getDateFormat as $n,getLabel as On,persistentStorage as tt,disableChildrenFocus as xn,enableChildrenFocus as Cn,findScrollContainer as At,EventEmitter as Sn,useDebouncedCallback as kn,getIndex as _n,addBoundary as Pn,noNaN as Ce,useMount as In,makeSingleImperativeComponent as Rn,useLatest as En,useImperativeComponentEvents as jn}from"@apia/util";import{uniqueId as Ft,isFunction as Nn}from"lodash-es";import ee from"dayjs";import{isFunction as Ln,uniqueId as Ht}from"lodash";import Dn from"react-calendar";import{CSSTransition as Kt}from"react-transition-group";import Tn from"react-focus-lock";import{useBreakpointIndex as Mn}from"@theme-ui/match-media";import Bn from"react-cool-portal";import{getColor as An}from"@theme-ui/color";import{BarLoader as Fn}from"react-spinners";import Hn from"react-input-mask";import{useUpdateEffect as Kn}from"ahooks";import Wn from"react-animate-height";import{createFAsomeStore as Wt}from"@apia/dom-store";var qn=Object.defineProperty,zn=Object.defineProperties,Un=Object.getOwnPropertyDescriptors,Se=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,Ut=(e,t,o)=>t in e?qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ot=(e,t)=>{for(var o in t||(t={}))qt.call(t,o)&&Ut(e,o,t[o]);if(Se)for(var o of Se(t))zt.call(t,o)&&Ut(e,o,t[o]);return e},Vt=(e,t)=>zn(e,Un(t)),Vn=(e,t)=>{var o={};for(var r in e)qt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Se)for(var r of Se(e))t.indexOf(r)<0&&zt.call(e,r)&&(o[r]=e[r]);return o};const Gn=e=>{var t=e,{id:o,name:r,onClick:n=()=>{},isLoading:l=!1,loadingChildren:a,disabled:i=!1,children:s="",text:f="",variant:d="primary",type:c="button",SXProps:b}=t,u=Vn(t,["id","name","onClick","isLoading","loadingChildren","disabled","children","text","variant","type","SXProps"]);return p(ye,Vt(ot(Vt(ot({id:o,name:r,onClick:n},M(d)),{type:c,title:s,disabled:l||i}),u),{children:N(ie,{as:"span",sx:ot({color:"inherit",width:"100%",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:Q(3)},b),children:[l&&N(le,{children:[p(ge,{size:20,color:"inherit"}),a]}),!l&&(s||f)]})}))};var Yn=Object.defineProperty,Xn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Xt=(e,t,o)=>t in e?Yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Jt=(e,t)=>{for(var o in t||(t={}))Gt.call(t,o)&&Xt(e,o,t[o]);if(ke)for(var o of ke(t))Yt.call(t,o)&&Xt(e,o,t[o]);return e},Zt=(e,t)=>Xn(e,Jn(t)),Zn=(e,t)=>{var o={};for(var r in e)Gt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&ke)for(var r of ke(e))t.indexOf(r)<0&&Yt.call(e,r)&&(o[r]=e[r]);return o};const se=R.forwardRef((e,t)=>{var o=e,{className:r,disabled:n=!1,icon:l,iconSize:a,id:i,isLoading:s=!1,isToggled:f=!1,href:d,onClick:c=()=>{},onMouseOver:b=()=>{},onMouseOut:u=()=>{},size:h="sm",title:m,type:v="button",variant:$="icon"}=o,O=Zn(o,["className","disabled","icon","iconSize","id","isLoading","isToggled","href","onClick","onMouseOver","onMouseOut","size","title","type","variant"]),w;const k=["xs","sm","md","lg","xl"],C=a??k[Math.max(0,k.indexOf(h)-1)],_=R.useMemo(()=>({width:`icon${h}`,minWidth:`icon${h}`,height:`icon${h}`,minHeight:`icon${h}`,svg:{width:`icon${C}`,minWidth:`icon${C}`,height:`icon${C}`,minHeight:`icon${C}`}}),[C,h]),T=R.useMemo(()=>typeof l=="string"?Mt[l]:l,[l]);return p(sn,Zt(Jt(Zt(Jt({id:i,ref:t,onClick:R.useCallback(P=>{d&&window.open(d,"_blank"),c?.(P)},[d,c]),onMouseOver:b,onMouseOut:u},M($)),{sx:_,disabled:s||n,className:`${r??""} iconButton ${f?"isToggled":""}`,title:m,"aria-label":(w=O["aria-label"])!=null?w:O.as!==void 0?void 0:m,type:O.as!==void 0?void 0:v,role:d?"link":void 0}),O),{children:s?p(ge,{color:"inherit"}):p(T,{})}))});se.displayName="IconButton";var Qn=Object.defineProperty,el=Object.defineProperties,tl=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,to=(e,t,o)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,oo=(e,t)=>{for(var o in t||(t={}))Qt.call(t,o)&&to(e,o,t[o]);if(_e)for(var o of _e(t))eo.call(t,o)&&to(e,o,t[o]);return e},ro=(e,t)=>el(e,tl(t)),ol=(e,t)=>{var o={};for(var r in e)Qt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&_e)for(var r of _e(e))t.indexOf(r)<0&&eo.call(e,r)&&(o[r]=e[r]);return o};const rl={display:"inline-flex",gap:Q(3),position:"relative",alignItems:"center",justifyContent:"center",".toggled":{backgroundColor:"primary"}},Pe=R.forwardRef((e,t)=>{var o=e,{children:r=null,className:n,disabled:l=!1,icon:a,iconColor:i,iconPosition:s="left",iconSize:f,id:d,isLoading:c,name:b,onClick:u,size:h,spinnerSize:m=16,title:v,type:$="button",variant:O="primary"}=o,w=ol(o,["children","className","disabled","icon","iconColor","iconPosition","iconSize","id","isLoading","name","onClick","size","spinnerSize","title","type","variant"]);const k=R.useMemo(()=>({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center"}),[]),C=R.useMemo(()=>({color:c?"transparent":void 0}),[c]),_=R.useMemo(()=>a,[a]);return N(ye,ro(oo(ro(oo({ref:t,id:d,name:b,title:v,"aria-label":v,onClick:u,type:$,disabled:c??l,className:n},M(`${O}${h!=="md"&&h?`-${h}`:""}`)),{sx:rl}),w),{children:[_&&s==="left"&&p(_,{title:"",size:f,color:i}),p(x,{as:"span",className:"button__content",sx:C,children:r??v}),_&&s==="right"&&p(_,{title:"",size:f,color:i}),c&&p(x,{className:"spinner",sx:k,children:p(ge,{size:m,color:"inherit"})})]}))});Pe.displayName="SimpleButton";function nl(e){var t;const o=y.useMemo(()=>`otherTag${Ft()}`,[]),r=y.useCallback(l=>{var a;(a=e?.onClick)==null||a.call(e,l)},[e]),n=y.useCallback(l=>{var a;if((a=e?.onKeyDown)==null||a.call(e,l),l.code==="Enter"||l.code==="Space"){l.preventDefault();const i=Oe(l.target,s=>s.classList.contains(o));i&&i.click()}},[e,o]);return{className:`${o} ${(t=e?.className)!=null?t:""}`,onClick:r,onKeyDown:n,role:"button",tabIndex:0}}var ll=Object.defineProperty,al=Object.defineProperties,il=Object.getOwnPropertyDescriptors,no=Object.getOwnPropertySymbols,cl=Object.prototype.hasOwnProperty,sl=Object.prototype.propertyIsEnumerable,lo=(e,t,o)=>t in e?ll(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ul=(e,t)=>{for(var o in t||(t={}))cl.call(t,o)&&lo(e,o,t[o]);if(no)for(var o of no(t))sl.call(t,o)&&lo(e,o,t[o]);return e},dl=(e,t)=>al(e,il(t));const pl=({name:e,imageUrl:t,onChange:o,value:r,className:n})=>{const[l,a]=V(`${t}?t=${Date.now()}`),i=()=>{a(`${t}?t=${Date.now()}`)};return N(ie,dl(ul({sx:{flexDirection:"column"},className:"captcha__field"},M("layout.common.forms.captcha")),{children:[p(ie,{className:"captcha__imageContainer",children:p(jt,{alt:"",src:l})}),N(ie,{className:`captcha__inputContainer ${n??""}`,children:[p(ce,{autoComplete:"off",name:e,onChange:o,value:r}),N(ie,{className:"captcha__buttons",children:[p(se,{icon:"Refresh",type:"button","aria-label":"TODO: Etiqueta activar audio",onClick:i}),p(se,{icon:"Volume",type:"button","aria-label":"TODO: Etiqueta activar audio",onClick:()=>{}})]})]})]}))};var fl=Object.defineProperty,hl=Object.defineProperties,ml=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,co=(e,t,o)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,rt=(e,t)=>{for(var o in t||(t={}))ao.call(t,o)&&co(e,o,t[o]);if(Ie)for(var o of Ie(t))io.call(t,o)&&co(e,o,t[o]);return e},so=(e,t)=>hl(e,ml(t)),bl=(e,t)=>{var o={};for(var r in e)ao.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ie)for(var r of Ie(e))t.indexOf(r)<0&&io.call(e,r)&&(o[r]=e[r]);return o};const uo=Ye((e,t)=>{var o=e,{onChange:r,required:n,disabled:l,readOnly:a,name:i,native:s,indeterminate:f}=o,d=bl(o,["onChange","required","disabled","readOnly","name","native","indeterminate"]),c,b,u;const[h,m]=V((b=(c=d.defaultChecked)!=null?c:d.checked)!=null?b:!1),v=G(null);Y(()=>{var w;return m((w=d.checked)!=null?w:!1)},[d.checked]);const $=B(()=>{var w,k,C;return{bg:(w=d.background)!=null?w:void 0,color:(k=d.color)!=null?k:void 0,'&[aria-checked="false"]':{bg:(C=d.background)!=null?C:void 0,color:"transparent"}}},[d.background,d.color]);Z(()=>{v.current&&f!==void 0&&(v.current.indeterminate=f)},[f]);const O=B(()=>({variant:"forms.checkbox"}),[]);return s?p("input",rt({type:"checkbox",onClick:d.onClick,"aria-checked":h,sx:O,ref:v,disabled:l,name:i,checked:h,onChange:w=>{d.checked===void 0&&m(w.target.checked),r&&r(w)},required:n,className:` ${(u=d.className)!=null?u:""} nativeCheckbox `},d)):N(le,{children:[p(ye,so(rt(so(rt({},d),{onClick:w=>{var k;a||Oe(w.target,C=>C.type==="button")&&(d.onClick&&d.onClick(w),(k=v.current)==null||k.click())},type:"button"}),M("forms.customCheckbox")),{role:"checkbox","aria-checked":h,sx:$,ref:t,disabled:l,children:p(Qe,{title:"",name:"Check",sx:{pointerEvents:"none",opacity:h?1:0},size:"32px"})})),p(ce,{type:"checkbox",sx:{display:"none"},ref:v,onClick:w=>{w.stopPropagation()},name:i,checked:h,onChange:w=>{d.checked===void 0&&m(w.target.checked),r&&r(w)},required:n,disabled:l})]})});uo.displayName="Checkbox";var po=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},nt=(e,t,o)=>(po(e,t,"read from private field"),o?o.call(e):t.get(e)),vl=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},wl=(e,t,o,r)=>(po(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o),te,fo;const ho=50,yl=new(fo=class{constructor(){this.focused=[],vl(this,te,[]),vn.on("focusHistory",()=>{console.info(this.focused)},"Muestra el historial de elementos que recibieron foco.")}offFocus(e){wl(this,te,nt(this,te).filter(t=>t!==e))}onFocus(e){return nt(this,te).push(e),()=>{this.offFocus(e)}}inDocument(e){return e instanceof Function||e instanceof HTMLElement&&e.offsetParent!==null}set focus(e){this.focused=this.focused.filter(t=>this.inDocument(t)&&e!==t),this.focused.unshift(e),this.focused.length>ho&&(this.focused=this.focused.splice(0,ho)),nt(this,te).forEach(t=>t())}get list(){return[...this.focused]}last(e,t=0){if(e)for(let o=t;o<=this.focused.length;o++){const r=this.focused[o],n=r?.id!==void 0?r:Ln(r)?r(!1):null;if(n&&this.inDocument(n)&&n.matches&&n.matches(e))return n}else return this.focused[this.focused.length-1];return null}},te=new WeakMap,fo);var lt=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},Re=(e,t,o)=>(lt(e,t,"read from private field"),o?o.call(e):t.get(e)),Ee=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},oe=(e,t,o,r)=>(lt(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o),mo=(e,t,o)=>(lt(e,t,"access private method"),o),ue,re,de,je,at,bo;let gl=class{constructor(){Ee(this,ue,!1),Ee(this,re,()=>{}),Ee(this,de,()=>{})}get isLocked(){return Re(this,ue)}destroy(){Re(this,de).call(this)}lock(){oe(this,ue,!0),Re(this,re).call(this)}unlock(){oe(this,ue,!1),Re(this,re).call(this)}onChange(t){return oe(this,re,t),()=>oe(this,re,()=>{})}onDestroy(t){return oe(this,de,t),()=>oe(this,de,()=>{})}};ue=new WeakMap,re=new WeakMap,de=new WeakMap;const $l=new(bo=class{constructor(){Ee(this,je),this.lockers=[]}getLocker(){const e=new gl;return e.onChange(()=>mo(this,je,at).call(this)),e.onDestroy(()=>{this.lockers=this.lockers.filter(t=>t!==e),mo(this,je,at).call(this)}),this.lockers.push(e),e}},je=new WeakSet,at=function(){const e=this.lockers.filter(t=>t.isLocked).length>0;document.body.style.maxHeight="100vh",e&&document.body.scrollHeight>document.body.clientHeight&&(document.body.style.paddingRight="10px"),document.body.style.overflow=e?"hidden":"auto",e&&document.body.scrollHeight>document.body.clientHeight||(document.body.style.paddingRight="0px")},bo);function Ol(e){Z(()=>{const t=$l.getLocker();return e?t.lock():t.unlock(),()=>{t.destroy()}},[e])}var xl=Object.defineProperty,Cl=Object.defineProperties,Sl=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable,yo=(e,t,o)=>t in e?xl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,go=(e,t)=>{for(var o in t||(t={}))vo.call(t,o)&&yo(e,o,t[o]);if(Ne)for(var o of Ne(t))wo.call(t,o)&&yo(e,o,t[o]);return e},$o=(e,t)=>Cl(e,Sl(t)),kl=(e,t)=>{var o={};for(var r in e)vo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ne)for(var r of Ne(e))t.indexOf(r)<0&&wo.call(e,r)&&(o[r]=e[r]);return o};const Le=R.forwardRef((e,t)=>{var o=e,{children:r,className:n="",onExited:l,onOverlayClicked:a,isOpen:i=!1,shouldAvoidInitialFocusTrap:s,stretch:f,transitionDuration:d=150}=o,c=kl(o,["children","className","onExited","onOverlayClicked","isOpen","shouldAvoidInitialFocusTrap","stretch","transitionDuration"]),b,u;const h=R.useRef(null),m=xe(h,t);return Ol(i),p(Kt,{in:i,timeout:d,onExited:l,classNames:"overlayAnimation",appear:!0,unmountOnExit:!0,children:p(x,$o(go($o(go({className:`${n} overlay`,ref:m},c),{"data-type":"overlay",role:"presentation",onClick:R.useCallback(v=>{v.target===h.current&&a(v)},[a])}),M((b=c.variant)!=null?b:`layout.common.modals.overlay${f?"--stretch":""}`)),{children:p(Tn,{autoFocus:s?!1:void 0,returnFocus:!1,crossFrame:!1,disabled:((u=document.activeElement)==null?void 0:u.classList.contains("filter"))&&document.activeElement.tagName==="INPUT",children:r})}))})});Le.displayName="Overlay";const _l=({className:e,close:t,hideCloseButton:o,id:r,NavBar:n,title:l=""})=>{const a=Mn(),i=p(un,{as:"h3",sx:{wordBreak:"break-word",m:"0",flex:"2 0",color:"title"},className:"modal__title",id:r?`modal-${r}-title`:"",children:l}),s=y.useMemo(()=>o?null:p(Nt,{role:"button",type:"button","aria-label":window.BTN_CLOSE,onClick:t,title:window.BTN_CLOSE,sx:{mr:"unset"},className:"modal__closeButton"}),[t,o]),f=n&&p(x,{sx:{display:"flex",gap:$e({0:2,1:"3px",2:2}),justifyContent:"end",flexDirection:$e({0:"row",1:"column",3:"row"}),width:$e({0:"auto",1:"100%",2:"auto"}),flexBasis:"max-content",height:"100%"},className:"modal__headerBar",children:n});return a>3?N(x,{className:e,sx:{display:"flex",flexDirection:"row",alignItems:"start",mb:Q(0),justifyContent:"space-between",width:"100%",gap:Q(2),flexWrap:"nowrap"},children:[i,f,s]}):N(x,{className:e,sx:{display:"flex",flexDirection:"column",alignItems:$e({0:"center",2:"end"}),mb:Q(0),justifyContent:"space-between",width:"100%",gap:Q(2)},children:[N(x,{sx:{display:"flex",width:"100%"},children:[i,s]}),f]})};var Pl=Object.defineProperty,Il=Object.defineProperties,Rl=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,El=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable,xo=(e,t,o)=>t in e?Pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,it=(e,t)=>{for(var o in t||(t={}))El.call(t,o)&&xo(e,o,t[o]);if(Oo)for(var o of Oo(t))jl.call(t,o)&&xo(e,o,t[o]);return e},Co=(e,t)=>Il(e,Rl(t));const ct=y.createContext({}),st=Ye(({animationDuration:e=150,children:t=null,className:o,hideCloseButton:r,id:n,initialFocusConfiguration:l,initialFocusGetter:a,initialFocusRef:i,isOpen:s=!1,maxWidth:f,NavBar:d,noFocus:c,noHeader:b=!1,onClose:u=()=>{},onExited:h=()=>{},Portal:m,shouldCloseOnEsc:v=!0,shouldCloseOnOverlayClick:$=!0,size:O="md",stretch:w,title:k="",variant:C},_)=>{const[T,P]=V(s),E=y.useMemo(()=>`Modal${Ht()}`,[]);Z(()=>{P(s)},[s]);const g=L(()=>{P(!1),u()},[u]),[D,F]=y.useState(),W=xe(F,_),H=K=>{$&&K.target.getAttribute("data-type")==="overlay"&&g()};Z(()=>{function K(q){var ve;const ne=[...document.querySelectorAll(".overlay")];return ne.length>0&&((ve=ne[ne.length-1])==null?void 0:ve.id)===E&&q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),g(),!1):!0}return T&&v&&document.addEventListener("keydown",K,!1),()=>{document.removeEventListener("keydown",K,!1)}},[v,T,g,E]),y.useEffect(()=>{!c&&T&&D&&wn.on(()=>a?a(D):i!=null&&i.current?(i?.current||D).querySelector(yn):D.querySelector(gn(":not(.modal__closeButton)")),Co(it({},l),{focusEvenWhenScreenLocked:!0}))},[D]);const I=y.useMemo(()=>m??y.Fragment,[]);return p(ct.Provider,{value:y.useMemo(()=>({descriptionId:`${E}_Description`}),[E]),children:p(I,{children:p(Le,{onOverlayClicked:H,isOpen:s,className:o,stretch:w,ref:W,onExited:h,id:E,shouldAvoidInitialFocusTrap:c,children:p(Kt,{in:s,timeout:e,classNames:"modal",appear:!0,unmountOnExit:!0,children:p(x,Co(it({className:"modal__variantWrapper"},C?M(C):{}),{children:N(x,{id:n,role:"dialog","aria-modal":"true","aria-label":k,"aria-describedby":`${E}_Description`,"aria-hidden":"false",className:"modal__main","data-scroll-lock-scrollable":!0,sx:y.useMemo(()=>it({variant:`layout.common.modals.${O}`},f!==void 0?{maxWidth:f}:{}),[f,O]),"data-variant":`layout.common.modals.${O}`,children:[!b&&p(_l,{className:"modal__header",NavBar:d,title:k,close:g,hideCloseButton:r,id:`${E}_Header`}),p(x,{className:"modal__content",id:typeof t=="string"?`${E}_Description`:void 0,children:t})]})}))})})})})});st.displayName="Modal";var Nl=Object.defineProperty,Ll=Object.defineProperties,Dl=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,_o=(e,t,o)=>t in e?Nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Tl=(e,t)=>{for(var o in t||(t={}))So.call(t,o)&&_o(e,o,t[o]);if(De)for(var o of De(t))ko.call(t,o)&&_o(e,o,t[o]);return e},Ml=(e,t)=>Ll(e,Dl(t)),Bl=(e,t)=>{var o={};for(var r in e)So.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&De)for(var r of De(e))t.indexOf(r)<0&&ko.call(e,r)&&(o[r]=e[r]);return o};const ut=y.forwardRef((e,t)=>{var o=e,{handleClickDay:r,onCancel:n,calValue:l,locale:a,size:i}=o,s=Bl(o,["handleClickDay","onCancel","calValue","locale","size"]);return p(st,Ml(Tl({noHeader:!0,size:i??"cal",shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,ref:t},s),{initialFocusGetter:f=>f?.querySelector(".react-calendar__tile--active"),children:p(Dn,{onClickDay:r,locale:a,value:l??new Date,nextLabel:"\u203A",next2Label:"\xBB",prevLabel:"\u2039",prev2Label:"\xAB"})}))});ut.displayName="CalendarModal";var Al=Object.defineProperty,Fl=Object.defineProperties,Hl=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,Kl=Object.prototype.hasOwnProperty,Wl=Object.prototype.propertyIsEnumerable,Io=(e,t,o)=>t in e?Al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ql=(e,t)=>{for(var o in t||(t={}))Kl.call(t,o)&&Io(e,o,t[o]);if(Po)for(var o of Po(t))Wl.call(t,o)&&Io(e,o,t[o]);return e},zl=(e,t)=>Fl(e,Hl(t));function Ro(e){var t,o,r;const[n,l]=y.useState(!1),[a,i]=y.useState((r=(o=(t=e?.portalArgs)==null?void 0:t.defaultShow)!=null?o:e?.isDefaultOpen)!=null?r:!1),{Portal:s,hide:f,show:d}=Bn(zl(ql({},e?.portalArgs),{containerId:"AppModals",autoRemoveContainer:!1,escToHide:!1,clickOutsideToHide:!1,defaultShow:!1,internalShowHide:!1})),c=y.useCallback(()=>{i(!1)},[]),b=y.useCallback(()=>{e!=null&&e.preFetcher?(l(!0),e.preFetcher().then(()=>{i(!0),l(!1)}).catch(console.error)):i(!0)},[e]),u=y.useCallback(()=>{i(!1),e!=null&&e.onClose&&e.onClose()},[e]),h=y.useCallback(()=>{f(),e!=null&&e.onExited&&e.onExited()},[e,f]),m=y.useMemo(()=>({isLoading:n,show:b}),[n,b]);return Y(()=>{a?(e!=null&&e.onOpen&&e.onOpen(),d()):u?.()},[a]),{hide:c,isLoading:n,isOpen:a,onClose:u,onExited:h,openModalContextValue:m,Portal:s,show:b}}var Ul=Object.defineProperty,Vl=Object.defineProperties,Gl=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Yl=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable,jo=(e,t,o)=>t in e?Ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Jl=(e,t)=>{for(var o in t||(t={}))Yl.call(t,o)&&jo(e,o,t[o]);if(Eo)for(var o of Eo(t))Xl.call(t,o)&&jo(e,o,t[o]);return e},Zl=(e,t)=>Vl(e,Gl(t));const No=({children:e,className:t})=>p(x,Zl(Jl({className:`${t??""} buttonsBar`},M("layout.common.modals.buttonsBar")),{children:e}));var Ql=Object.defineProperty,ea=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,ra=Object.prototype.propertyIsEnumerable,Do=(e,t,o)=>t in e?Ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,To=(e,t)=>{for(var o in t||(t={}))oa.call(t,o)&&Do(e,o,t[o]);if(Lo)for(var o of Lo(t))ra.call(t,o)&&Do(e,o,t[o]);return e},Mo=(e,t)=>ea(e,ta(t));function na(e){return e?.querySelector('button[type="submit"]')}const la=({additionalButtons:e,additionalButtonsOnRight:t,children:o,confirmButtonText:r=window.BTN_CONFIRM,cancelButtonText:n=window.BTN_CANCEL,confirmButtonVariant:l="primary",disabled:a,hideCancelButton:i,hideConfirmButton:s,onConfirm:f,onCancel:d,isLoading:c,contentRef:b,className:u,variant:h})=>{const{descriptionId:m}=R.useContext(ct);return N(x,Mo(To({},M(h??"layout.common.modals.confirm")),{className:`${u??""} confirm`,children:[p(x,{ref:b,className:"confirm__content",id:m,children:o}),N(No,{className:"confirm__buttonBar",children:[p(x,{className:"confirm__customButtons",onClick:R.useCallback(v=>{Oe(v.target,$=>$.tagName==="BUTTON")&&d?.(v)},[d]),children:e}),N(x,{className:"confirm__defaultButtons",children:[p(x,{className:"confirm__customButtonsOnRight",onClick:R.useCallback(v=>{Oe(v.target,$=>$.tagName==="BUTTON")&&d?.(v)},[d]),children:t}),!s&&p(Pe,{onClick:f,title:r,variant:l,disabled:c??a,isLoading:c,className:"confirm__confirmButton",type:"submit",children:r}),d&&!i&&p(Pe,Mo(To({onClick:d,title:n},M("secondary")),{disabled:c,className:"confirm__cancelButton",children:n}))]})]})]}))},Bo=()=>{const e=dn();return p(x,{sx:{"*":{height:"6.5px !important"}},children:p(x,{sx:{zIndex:"tooltip",position:"fixed",top:0,left:0,right:0},className:"linearLoader",children:p(Fn,{width:"100%",color:An(e.theme,"palette.primary.main")})})})};var aa=Object.defineProperty,ia=Object.defineProperties,ca=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,ua=Object.prototype.propertyIsEnumerable,Fo=(e,t,o)=>t in e?aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ho=(e,t)=>{for(var o in t||(t={}))sa.call(t,o)&&Fo(e,o,t[o]);if(Ao)for(var o of Ao(t))ua.call(t,o)&&Fo(e,o,t[o]);return e},Ko=(e,t)=>ia(e,ca(t));const da=()=>{const e=y.useRef(null),[t,o]=V(!1),[r,n]=V({common:!1,forced:!1,linear:!1,white:!1});y.useEffect(()=>{const a=[Bt.on("lockStateChange",i=>{n(s=>Ko(Ho({},s),{[i.lockName]:i.isLocked})),o(i.hasReleasedFirstTime)}),Bt.on("forcedStateChange",i=>{n(s=>Ko(Ho({},s),{forced:i.isForced})),o(i.hasReleasedFirstTime)})];return()=>a.forEach(i=>i())},[]);const l=y.useMemo(()=>({backgroundColor:"transparent","&:not(body.editionForm *)":{backgroundColor:r.linear?"transparent":t?"palette.background.overlay":"palette.background.default"}}),[r.linear,t]);return!r.linear&&!r.common&&!r.white&&!r.forced?null:p(x,{children:N(Le,{isOpen:!0,onExited:()=>{},onOverlayClicked:()=>{},sx:l,className:`${t?"":"not-released"} screenLock`,transitionDuration:t?void 0:0,children:[r.linear?p(Bo,{}):p(ge,{ref:e,sx:{"*":{color:"primary"}}}),p(x,{tabIndex:0,title:window.WAIT_A_SECOND})]})})},Wo=({children:e,name:t})=>{const[o,r]=R.useState(null);return R.useEffect(()=>{if(e){const n=new CustomEvent(et.focus,{bubbles:!0});o?.dispatchEvent(n)}},[e,o]),e?p(x,{ref:r,role:"alert","data-testid":t?`err_${t}`:null,sx:{mb:"0",color:"danger",pt:"2"},children:e}):null};var pa=Object.defineProperty,fa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,Uo=(e,t,o)=>t in e?pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,pe=(e,t)=>{for(var o in t||(t={}))qo.call(t,o)&&Uo(e,o,t[o]);if(Te)for(var o of Te(t))zo.call(t,o)&&Uo(e,o,t[o]);return e},Vo=(e,t)=>fa(e,ha(t)),Go=(e,t)=>{var o={};for(var r in e)qo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Te)for(var r of Te(e))t.indexOf(r)<0&&zo.call(e,r)&&(o[r]=e[r]);return o};const Yo=e=>{var t=e,{additionalButtons:o,buttonProps:r,buttonRef:n,className:l,disabled:a,hideButton:i,icon:s="Search",inputProps:f,inputRef:d,isLoading:c,mask:b,onClick:u,onBlur:h,readOnly:m}=t,v=Go(t,["additionalButtons","buttonProps","buttonRef","className","disabled","hideButton","icon","inputProps","inputRef","isLoading","mask","onClick","onBlur","readOnly"]);const $=f??{},{sx:O}=$,w=Go($,["sx"]),k=y.useRef(null),C=xe(n,k),_=y.useRef(null),T=xe(d,_),[P,E]=y.useState(null),g=y.useCallback(D=>{h&&(!D.relatedTarget||D.relatedTarget&&!U(D.relatedTarget,F=>F===P))&&h(D)},[h,P]);return N(x,Vo(pe({},M("forms.iconInput")),{className:`${l??""} iconInput`,ref:E,children:[p(Hn,Vo(pe(pe({mask:b??"",onBlur:g,disabled:c??a,ref:T,readOnly:m,sx:pe({variant:"forms.input"},O),"data-variant":"forms.input"},v),w),{maxLength:b||f==null?void 0:f.maxLength})),o,!i&&p(se,pe({onBlur:g,onClick:u,icon:s,disabled:m??a,isLoading:c,ref:C},r))]}))},Me=e=>({borderLeftStyle:e?null:"solid",borderLeftWidth:e?null:"4px",borderLeftColor:e?void 0:"danger"}),ma=e=>({borderStyle:e?"solid":null,borderWidth:e?"1px":null,borderColor:e?"orange":void 0});var ba=Object.defineProperty,va=Object.defineProperties,wa=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,Xo=Object.prototype.hasOwnProperty,Jo=Object.prototype.propertyIsEnumerable,Zo=(e,t,o)=>t in e?ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ae=(e,t)=>{for(var o in t||(t={}))Xo.call(t,o)&&Zo(e,o,t[o]);if(Be)for(var o of Be(t))Jo.call(t,o)&&Zo(e,o,t[o]);return e},dt=(e,t)=>va(e,wa(t)),Qo=(e,t)=>{var o={};for(var r in e)Xo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Be)for(var r of Be(e))t.indexOf(r)<0&&Jo.call(e,r)&&(o[r]=e[r]);return o};const ya=window.LANG_CODE,pt="_",fe=$n(),ft=()=>fe==="YYYY/MM/DD"?"9999/99/99":"99/99/9999",ht=y.forwardRef((e,t)=>{var o=e,{allowPickBeforeToday:r,buttonProps:n,className:l,error:a,getCustomMask:i,isLoading:s,onBlur:f,onChange:d,onDelete:c,onError:b,renderLabel:u,value:h}=o,m=Qo(o,["allowPickBeforeToday","buttonProps","className","error","getCustomMask","isLoading","onBlur","onChange","onDelete","onError","renderLabel","value"]);const v=y.useMemo(Ht,[]),[$,O]=y.useState(h??""),[w,k]=y.useState(),C=y.useRef(null),_=Ro({preFetcher(){return yl.focus=()=>{var S;return(S=C.current)==null?void 0:S.querySelector(".iconButton")},new Promise(S=>{let z=ee($,fe);z.isValid()||(z=ee(new Date)),k(z.toDate()),S()})}}),{show:T,hide:P}=_,E=Qo(_,["show","hide"]),[g,D]=y.useState(a??null),F=y.useRef(h??"");Y(()=>{O(h??""),F.current=h},[h]),Y(()=>{D(a??null)},[a]),Y(()=>{b&&b(g)},[g]);const W=y.useCallback(S=>S!==F.current&&d?(F.current=S,d(S)):!0,[d]),H=y.useCallback((S,z)=>{if(S===""){W(""),O("");return}let J;S!==""?(J=ee(S,fe),J.isValid()||(J=ee(new Date))):J=ee(new Date);const Ge=J.format(fe),It=new Date;if(It.setHours(0,0,0,0),Ge!==$&&z!==!0)W(""),O(""),D(window.MSG_INVALID_DATE);else if(r===!1&&J.isBefore(It))W(""),O(""),D(window.MSG_FEC_FIN_MAY_FEC_INI);else{const we=W(S===""?"":Ge);we===!1?(O(we||""),D(null)):typeof we=="string"?(O(""),D(we)):(O(Ge),D(null))}},[r,$,W]),I=y.useCallback(S=>{P();const z=ee(S).format(fe);H(z,!0)},[P,H]),K=y.useCallback(()=>{P()},[P]),q=y.useCallback(S=>{f&&!U(S.relatedTarget,z=>z.id===`DateModal${v}`||z.id===`DateInput${v}`)&&f(S)},[v,f]),ve=y.useMemo(()=>dt(Ae({},m),{className:"dateInput",value:u?u($):$,ref:t,onChange:S=>{O(S.target.value),ft().replaceAll("9",pt)!==S.target.value&&S.target.value!==""&&D(null)},onBlur:S=>{m.readOnly||i||H(S.target.value),q(S)},onKeyDown:S=>{S.key==="Enter"&&H($)}}),[i,q,$,m,t,u,H]),ne=y.useMemo(()=>{var S;return Ae({disabled:(S=m.disabled)!=null?S:m.readOnly,"aria-label":window.LBL_PICK_DATE},n)},[n,m.disabled,m.readOnly]),an=y.useMemo(()=>p(Nt,{className:"delete_date_button",onClick:()=>{var S;H(""),c?.(),(S=document.querySelector(`#DateInput${v} input`))==null||S.focus()},type:"button"}),[v,c,H]);return N(le,{children:[p(ut,dt(Ae({},E),{calValue:w,locale:ya,handleClickDay:I,onCancel:K,id:`DateModal${v}`})),N(x,dt(Ae({},M("forms.dateInput")),{className:`${l??""} dateInput`,id:`DateInput${v}`,ref:C,children:[p(Yo,{additionalButtons:$&&$!==ft().replaceAll("9",pt)&&!m.readOnly&&!m.disabled?an:void 0,isLoading:s,maskPlaceholder:pt,mask:i?i():ft(),icon:Mt.Calendar,onBlur:q,buttonProps:ne,inputProps:ve,readOnly:m.readOnly,sx:Me(g===null),onClick:T}),g&&p(Wo,{children:g})]}))]})});ht.displayName="DateInput";var ga=Object.defineProperty,$a=Object.defineProperties,Oa=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,or=(e,t,o)=>t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,xa=(e,t)=>{for(var o in t||(t={}))er.call(t,o)&&or(e,o,t[o]);if(Fe)for(var o of Fe(t))tr.call(t,o)&&or(e,o,t[o]);return e},Ca=(e,t)=>$a(e,Oa(t)),Sa=(e,t)=>{var o={};for(var r in e)er.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Fe)for(var r of Fe(e))t.indexOf(r)<0&&tr.call(e,r)&&(o[r]=e[r]);return o};function mt(e){return Array(Math.max(0,e)).fill(0).join("")}function ka(e){const t=String(e);return`${mt(3-t.length)}${String(e)}`}const bt=Number(window.AMOUNT_DECIMAL_SEPARATOR),_a=Number(window.AMOUNT_DECIMAL_ZEROS),He=window.CHAR_DECIMAL_SEPARATOR,he=window.CHAR_THOUS_SEPARATOR,rr=he==="."?"\\.":he,nr=He==="."?"\\.":He;function Pa(e){return Number.parseFloat(e.replaceAll(he,"").replaceAll(He,"."))}function Ia(e){var t;const o=String(e).match(/(-?)(\d+)(?:\.(\d+))/);if(!o)return"";const r=!!o[1],n=o[2],l=o[3],a=l?`${nr}${l}`:"";return(t=lr(`${r?"-":""}${n}${a}`))!=null?t:""}function lr(e,t=!1){var o,r,n,l;const a=e.match(new RegExp(`^(-)?((?:(?:\\d{1,3})${rr}(?:\\d{3}${rr})*(?:\\d{3}))?|(?:\\d*))(?:(?:${nr})(\\d+))?$`));if(!a)return null;const i=!!a[1];let s=Number(a[2].replaceAll(he,""));const f=t?a[3]:(r=(o=a[3])==null?void 0:o.slice(0,bt+1))!=null?r:"";let d;if(t)d=f;else{const b=(l=(n=(f?`${String(Math.round(+`${f}${mt(bt-f.length)}`/1))}`:"").slice(0,bt).match(/(\d*[1-9])0*/))==null?void 0:n[1])!=null?l:"";d=`${b}${mt(_a-b.length)}`}const c=[];for(;s>=1e3;){s/=1e3;const b=Math.trunc(s);c.unshift(ka(Math.round((s-b)*1e3))),s=b}return c.unshift(String(s)),`${i?"-":""}${c.join(window.ADD_THOUSAND_SEPARATOR?window.CHAR_THOUS_SEPARATOR:"")}${d.length>0?`${He}${d}`:""}`}const vt=y.forwardRef((e,t)=>{var o=e,{value:r,avoidDecimalRestriction:n}=o,l=Sa(o,["value","avoidDecimalRestriction"]);const[a,i]=y.useState(""),[s,f]=y.useState(""),d=y.useRef(""),c=y.useCallback(b=>{var u,h,m;if(b===""){if(b===d.current)return;i(""),f(""),(u=l.onChange)==null||u.call(l,{value:"",error:!1})}else{const v=lr(b,n);if(v===null)i(""),f(""),(h=l.onChange)==null||h.call(l,{value:"",error:!0});else{if(b===d.current)return;i(b),f(v),(m=l.onChange)==null||m.call(l,{value:v,error:!1})}}d.current=b},[n,l]);return y.useEffect(()=>{r!==a&&c(r??"")},[r]),p(ce,Ca(xa({},l),{onFocus:y.useCallback(b=>{var u;(u=l.onFocus)==null||u.call(l,b),f(String(a).replaceAll(he,""))},[a,l]),onBlur:y.useCallback(b=>{c(b.target.value)},[c]),onChange:y.useCallback(b=>{f(b.target.value)},[]),type:"text",ref:t,value:s}))});vt.displayName="NumberInput";const Ra=({isFormReadonly:e=!1,isRequired:t=!1,isReadonly:o=!1})=>t&&!o&&!e?p("abbr",{className:"required",title:On("MSG_REQ_FIELD").text,children:"*"}):null,Ea=({filter:e,onChange:t,onBlur:o,onPressEnter:r},n)=>{const[l,a]=R.useState(String(e.currentValue)),[i,s]=R.useState(String(e.currentValue)),f=R.useCallback(d=>{d.stopPropagation()},[]);return Kn(()=>{a(e.currentValue)},[e.currentValue]),p(ht,{value:l,sx:Me(!e.error),"aria-label":e.toolTip,ref:n,placeholder:e.placeholder,onChange:d=>{if(t){const c=t(String(d));return c===!0?(a(d),!0):c}return!1},onClick:f,onBlur:()=>{l!==i&&o&&(s(l),a(l),o(l))},onKeyDown:d=>{d.key.toLowerCase()==="enter"&&r&&(s(l),r(l))}})},ja=R.forwardRef(Ea);var Na=Object.defineProperty,La=Object.defineProperties,Da=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,Ta=Object.prototype.hasOwnProperty,Ma=Object.prototype.propertyIsEnumerable,ir=(e,t,o)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,cr=(e,t)=>{for(var o in t||(t={}))Ta.call(t,o)&&ir(e,o,t[o]);if(ar)for(var o of ar(t))Ma.call(t,o)&&ir(e,o,t[o]);return e},sr=(e,t)=>La(e,Da(t));const Ba=({filter:e,onChange:t,onBlur:o,onPressEnter:r},n)=>{var l,a,i,s,f,d,c,b,u,h,m,v,$,O,w;const[k,C]=R.useState((l=e.currentValue)!=null?l:""),_=R.useCallback(g=>{g.stopPropagation()},[]),[T,P]=R.useState(e.currentValue),E=e?.currentValue;if(R.useEffect(()=>{E===""&&(C(String(E)),P(String(E)))},[e?.deleteFiltersTimestamp]),e){const g=I=>{(t&&t(String(I.target.value))!==!1||!t)&&C(String(I.target.value))},D=I=>{(t&&t(String(I.value))!==!1||!t)&&C(String(I.value))},F=I=>{o&&T!==k&&(P(k),o(I.target.value))},W=e.sortCombo?[...(a=e.options)!=null?a:[]].sort((I,K)=>I.label>K.label?1:-1):e.options,H=W?.map(I=>{var K,q;return p("option",{value:I.value,children:I.label},(q=(K=I.value)!=null?K:I.label)!=null?q:" ")});return e.type==="date"||e.type==="D"?p(ja,{filter:e,onChange:t,onBlur:o,onPressEnter:r,ref:n}):e.type==="apiaNumber"?p(vt,sr(cr({"aria-readonly":e.readonly,readOnly:e.readonly,value:k,placeholder:e.placeholder,onChange:D,onKeyDown:I=>{I.key.toLowerCase()==="enter"&&(F(I),r&&r(I.target.value))},onClick:_},M("input")),{className:`filter ${e.error?"requiredFilter__Border":""}`,title:(s=(i=e.title)!=null?i:e.toolTip)!=null?s:String(e.id),ref:n,"aria-label":(d=(f=e.title)!=null?f:e.toolTip)!=null?d:String(e.id),name:e.id})):e.options?p(pn,{"aria-readonly":e.readonly,disabled:e.readonly,onChange:g,onBlur:F,value:k,className:`"filter" ${e.error?"requiredFilter__Border":""}`,title:(b=(c=e.title)!=null?c:e.toolTip)!=null?b:String(e.id),ref:n,"aria-label":(h=(u=e.title)!=null?u:e.toolTip)!=null?h:String(e.id),onClick:_,placeholder:e.placeholder,sx:Me(!e.error),name:e.id,children:H}):p(ce,sr(cr({"aria-readonly":e.readonly,readOnly:e.readonly,value:k,type:(m=e.type==="N"?"number":e.type)!=null?m:"text",placeholder:e.placeholder,onChange:g,onBlur:F,onKeyDown:I=>{I.key.toLowerCase()==="enter"&&(F(I),r&&r(I.target.value))},onClick:_},M("input")),{className:`filter ${e.error?"requiredFilter__Border":""}`,title:($=(v=e.title)!=null?v:e.toolTip)!=null?$:String(e.id),ref:n,"aria-label":(w=(O=e.title)!=null?O:e.toolTip)!=null?w:String(e.id),name:e.id}))}return null},Aa=R.memo(R.forwardRef(Ba)),Fa={};var Ha=Object.defineProperty,Ka=Object.defineProperties,Wa=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertySymbols,qa=Object.prototype.hasOwnProperty,za=Object.prototype.propertyIsEnumerable,dr=(e,t,o)=>t in e?Ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,pr=(e,t)=>{for(var o in t||(t={}))qa.call(t,o)&&dr(e,o,t[o]);if(ur)for(var o of ur(t))za.call(t,o)&&dr(e,o,t[o]);return e},fr=(e,t)=>Ka(e,Wa(t));Lt("layout.common.components.collapsiblePanel",Fa);const hr=y.forwardRef(({children:e,className:t,closedIcon:o="ArrowDown",collapsed:r,defaultCollapsed:n,disableChildrenFocus:l,iconSize:a="iconxs",id:i,onClose:s,onOpen:f,openIcon:d="ArrowRight",label:c,titleButtons:b,minHeight:u=0},h)=>{var m;const v=`${y.useMemo(()=>Ft(),[])}_${i??"collapsiblePanel"}`,[$,O]=y.useState((m=n??r)!=null?m:tt[`collapsiblePanel${v}`]),[w,k]=y.useState(null),C=y.useCallback((_,T)=>{const P=f?f(T):null;P?P.then(E=>{E&&_&&O(g=>!g)}):_&&O(E=>!E)},[f]);return Y(()=>{r!==void 0&&O(r),r===!1&&C(!1)},[r]),Y(()=>{$?(s&&s(),tt[`collapsiblePanel${v}`]=!0,w&&l&&xn(w.querySelector(".collapsiblePanel__content"))):(tt[`collapsiblePanel${v}`]=!1,w&&l&&Cn(w.querySelector(".collapsiblePanel__content")))},[$]),y.useEffect(()=>{var _;const T=()=>O(!1);return(_=w?.querySelector(".collapsiblePanel__content"))==null||_.addEventListener(et.focus,T),()=>{var P;(P=w?.querySelector(".collapsiblePanel__content"))==null||P.removeEventListener(et.focus,T)}},[i,$,s,f,w]),N(x,fr(pr({className:`collapsiblePanel ${t??""}`},M("layout.common.components.collapsiblePanel")),{ref:_=>{Nn(h)&&h(_),k(_)},children:[N(x,{className:"collapsiblePanel__label",children:[N(ye,fr(pr({},M("inherit")),{"aria-expanded":!$,onClick:_=>C(!0,_),type:"button",className:"collapsiblePanel__label__button",onKeyDown:console.log,children:[$?p(Qe,{title:"",icon:d,size:a}):p(Qe,{title:"",icon:o,size:a}),c]})),b]}),p(Wn,{id:v,duration:150,height:$?u:"auto",sx:{"&>div":{display:"block "}},"aria-hidden":$,className:"collapsiblePanel__content",children:e})]}))});hr.displayName="CollapsiblePanel";var Ua=Object.defineProperty,Va=Object.defineProperties,Ga=Object.getOwnPropertyDescriptors,mr=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Xa=Object.prototype.propertyIsEnumerable,br=(e,t,o)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,wt=(e,t)=>{for(var o in t||(t={}))Ya.call(t,o)&&br(e,o,t[o]);if(mr)for(var o of mr(t))Xa.call(t,o)&&br(e,o,t[o]);return e},vr=(e,t)=>Va(e,Ga(t));function j(e){return`row_${typeof e=="number"?e:e.rowIndex}`}let Ja=0;function wr(e){return`${e??""}${Ja++}`}function Za(e){return{listbox:[(t,o)=>({etc:{"aria-activedescendant":`${e}__row__${o.focusedRow}`}})],row:[(t,o)=>({classList:{add:["listbox__row",o.focusedRow===t.rowIndex?"focused":"",o.allowSelection&&o.selectedRows.includes(t.rowIndex)?"selected":""],remove:[o.focusedRow===t.rowIndex?"":"focused",o.allowSelection&&o.selectedRows.includes(t.rowIndex)?"":"selected"]},dataset:{add:{focused:o.focusedRow===t.rowIndex}},etc:vr(wt({},o.allowSelection?{"aria-selected":o.selectedRows.includes(t.rowIndex)}:null),{id:`${e}__row__${t.rowIndex}`})}),(t,o)=>{const r=document.querySelector(`#${e} .listbox__row[data-focused="true"]`);if(r&&(r.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t.focusedRow>o.focusedRow)){const n=At(r);if(n){n.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const l=r.getBoundingClientRect(),a=n.getBoundingClientRect();l.top-a.top<l.height&&(n.scrollTop-=l.height)}}}],searchbox:[(t,o)=>({classList:{add:["listbox__searchbox"]},etc:{"aria-activedescendant":`${e}__row__${o.focusedRow}`}})]}}const Qa={allowSelection:!0,focusedRow:0,hiddenRows:[],isEverythingSelected:!1,isMultipleSelection:!1,lastSelectedRow:-1,rowsCount:0,selectedRows:[],typing:null},ei={row:j,listbox:()=>"listbox",searchbox:()=>"searchbox"};function ti(e){var t,o,r;return vr(wt(wt({},Qa),e),{searchFunction:(t=e.searchFunction)!=null?t:(n,l)=>!!n.match(new RegExp(l)),startsWithFunction:(o=e.startsWithFunction)!=null?o:(n,l)=>n.startsWith(l),shownRows:new Array((r=e.rowsCount)!=null?r:0).fill(1).map((n,l)=>l)})}const Ke=Xe({});var oi=Object.defineProperty,ri=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,gr=Object.prototype.propertyIsEnumerable,$r=(e,t,o)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,yt=(e,t)=>{for(var o in t||(t={}))yr.call(t,o)&&$r(e,o,t[o]);if(We)for(var o of We(t))gr.call(t,o)&&$r(e,o,t[o]);return e},gt=(e,t)=>ri(e,ni(t)),li=(e,t)=>{var o={};for(var r in e)yr.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&We)for(var r of We(e))t.indexOf(r)<0&&gr.call(e,r)&&(o[r]=e[r]);return o};const qe=Je(e=>{var t=e,{children:o,rowIndex:r,label:n}=t,l=li(t,["children","rowIndex","label"]);const{getState:a,listboxActions:i,onDoubleClickNode:s,onClickNode:f,useListbox:d}=ae(Ke),c=B(()=>r??-1,[r]),b=d("row",{rowIndex:c});return p("li",gt(yt({},l),{ref:b,role:"option",onDoubleClick:L(u=>{u.preventDefault(),s?.(gt(yt({},u),{target:u.target.closest('[role="option"]')}))},[s]),onClick:L(u=>{u.preventDefault(),f?.(gt(yt({},u),{target:u.target.closest('[role="option"]')}))},[f]),onMouseDown:L(u=>{(a().isMultipleSelection&&u.shiftKey||u.detail>1)&&u.preventDefault(),i.updateFocusByClickEvent({rowIndex:c,isCtrlKey:u.ctrlKey,isShiftKey:u.shiftKey})},[a,i,c]),"aria-label":n,title:n,children:o}))});qe.displayName="ListboxItem";var ai=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},Or=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},$t=(e,t,o)=>(ai(e,t,"access private method"),o),ze,Ot,xt,xr;let Cr=class extends Sn{constructor(t){super(),Or(this,ze),Or(this,xt),this.frequency=2.5,this.timeout=0,this.typing="";const{onMultipleKeys:o,onSingleKey:r,onTypeUpdate:n}=t??{};o&&this.on("multipleKeys",o),r&&this.on("singleKey",r),n&&this.on("typeUpdate",n)}type(t){t.key.match(/^[\p{L}\d ]$/u)?(t.preventDefault(),this.typing=this.typing+t.key,this.emit("typeUpdate",this.typing),$t(this,ze,Ot).call(this)):t.code==="Backspace"&&(t.preventDefault(),this.typing=this.typing.slice(0,-1),this.emit("typeUpdate",this.typing),$t(this,ze,Ot).call(this))}};ze=new WeakSet,Ot=function(){clearTimeout(this.timeout),this.timeout=setTimeout($t(this,xt,xr).bind(this),1e3/this.frequency)},xt=new WeakSet,xr=function({clear:e}={clear:!0}){this.typing.length===1?this.emit("singleKey",this.typing):this.typing.length>1&&this.emit("multipleKeys",this.typing),e&&(this.typing="")};var ii=Object.defineProperty,ci=Object.defineProperties,si=Object.getOwnPropertyDescriptors,Sr=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,kr=(e,t,o)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ct=(e,t)=>{for(var o in t||(t={}))ui.call(t,o)&&kr(e,o,t[o]);if(Sr)for(var o of Sr(t))di.call(t,o)&&kr(e,o,t[o]);return e},St=(e,t)=>ci(e,si(t));const pi=({children:e,className:t})=>{const{listboxActions:o,id:r,getState:n,onConfirmSelection:l,onPressEnterOnNode:a,onPressKeyOnNode:i,variant:s}=ae(Ke),f=B(()=>n().showSearchbox?null:new Cr({onMultipleKeys(c){o.searchElementsByStartingCharacters({characters:c})},onSingleKey(c){o.searchElementsByStartingCharacters({characters:c})}}),[n,o]),d=L(c=>{l?.({originalEvent:c,selectedElements:n().allowSelection?n().selectedRows.map(b=>document.querySelector(`#${r}__row__${b}`)):[],focusedElement:document.querySelector(`#${r}__row__${n().focusedRow}`)})},[n,r,l]);return p(x,St(Ct({},M(s)),{className:t,id:r,onKeyDown:L(c=>{var b;const u=(b=c.target.closest(".listbox"))==null?void 0:b.querySelector(".listbox__row.focused");if(!u)throw new Error("There is no cell on keydown event, it must be an error.");const h=n();if(i?.(St(Ct({},c),{target:u,currentTarget:u})),c.key==="Enter"&&a?.(St(Ct({},c),{target:u,currentTarget:u})),!(c.isDefaultPrevented()||c.isPropagationStopped()))if(["ArrowDown","ArrowUp","PageUp","PageDown"].includes(c.code)||["Home","End"].includes(c.code)&&c.ctrlKey||["Space"].includes(c.code)&&h.isMultipleSelection&&!h.showSearchbox||["Enter"].includes(c.code)&&h.isMultipleSelection||["KeyA"].includes(c.code)&&h.isMultipleSelection&&c.ctrlKey)switch(c.preventDefault(),c.code){case"KeyA":o.selectAll();break;case"ArrowDown":o.moveFocusAndToggleSelection({which:"next",isShiftKey:c.shiftKey});break;case"ArrowUp":o.moveFocusAndToggleSelection({which:"previous",isShiftKey:c.shiftKey});break;case"Home":o.moveFocusAndToggleSelection({which:"first",isShiftKey:c.shiftKey});break;case"End":o.moveFocusAndToggleSelection({which:"last",isShiftKey:c.shiftKey});break;case"Enter":if(c.ctrlKey){d(c);break}case"Space":o.updateFocusBySpaceEvent({isShiftKey:c.shiftKey});break;case"PageUp":o.moveFocusAndToggleSelection({which:"pageUp",isShiftKey:c.shiftKey});break;case"PageDown":o.moveFocusAndToggleSelection({which:"pageDown",isShiftKey:c.shiftKey});break}else c.code==="Enter"&&(!h.allowSelection||!h.isMultipleSelection)?d(c):f&&f.type(c)},[n,o,a,i,d,f]),children:e}))};var fi=Object.defineProperty,hi=Object.defineProperties,mi=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Ir=(e,t,o)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,bi=(e,t)=>{for(var o in t||(t={}))_r.call(t,o)&&Ir(e,o,t[o]);if(Ue)for(var o of Ue(t))Pr.call(t,o)&&Ir(e,o,t[o]);return e},vi=(e,t)=>hi(e,mi(t)),wi=(e,t)=>{var o={};for(var r in e)_r.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ue)for(var r of Ue(e))t.indexOf(r)<0&&Pr.call(e,r)&&(o[r]=e[r]);return o};const yi=e=>{var t=e,{children:o}=t,r=wi(t,["children"]);const{id:n,listboxActions:l,useListbox:a}=ae(Ke),i=kn(f=>{l.filter({searchString:f.target.value})}),s=a("searchbox",null);return N(le,{children:[p(ce,{ref:s,type:"text",id:`${n}__searchbox`,placeholder:"Search...","aria-autocomplete":"list","aria-controls":`${n}__list__container`,role:"combobox","aria-expanded":!0,"aria-haspopup":"listbox",onChange:i,autoComplete:"off"}),p(x,vi(bi({as:"ul",id:`${n}__list__container`,role:"listbox",className:"listbox__list"},r),{onClick:L(()=>{var f;document.activeElement!==document.getElementById(`${n}__searchbox`)&&((f=document.getElementById(`${n}__searchbox`))==null||f.focus())},[n]),children:o}))]})},gi={"&:focus-within":{".listbox__list":{outline:"none"},".focused":Ze,"&.withSearchbox":{".focused":{outline:"1px solid",outlineColor:"palette.border.field",outlineOffset:0},".listbox__searchbox":Ze}},".listbox__list":{listStyle:"none",m:0,p:0},"&.withSearchbox":{".listbox__list":{maxHeight:"calc(100vh - 80px)",overflow:"auto"}},".listbox__row":{"&:hover":bn({backgroundColor:"palette.background.paper"},"hover")}};var Rr=Object.getOwnPropertySymbols,$i=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,xi=(e,t)=>{var o={};for(var r in e)$i.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Rr)for(var r of Rr(e))t.indexOf(r)<0&&Oi.call(e,r)&&(o[r]=e[r]);return o};const Ci=X((e,{searchString:t},o)=>{let r=!1;const n=new Array(e.rowsCount).fill(1).map((i,s)=>s),l=[],a=n.filter((i,s)=>{var f;const d=document.getElementById(`${e.id}__row__${s}`);if(!d)return console.warn("Element not found",`${e.id}__row__${s}`),!1;const c=e.searchFunction((f=d.ariaLabel)!=null?f:"",t);return c?d.style.display="block":d.style.display="none",c?l.push(s):e.focusedRow===s&&(r=!0),!c});if(o.set(a.map(i=>j(i))),e.hiddenRows=a,e.shownRows=l,r){for(const i of n)if(!a.includes(i)){e.focusedRow=i,o.push(j(i)),o.push(j(e.focusedRow));break}}});function X(e){return(t,o,r)=>{r.push("searchbox"),r.push("listbox"),e(t,o,r)}}const Si=X((e,{isShiftKey:t,which:o},r)=>{if(e.shownRows.length<=1){r.push(j(e.focusedRow)),e.focusedRow=e.shownRows[0],e.shownRows.length===1&&r.push(j(e.focusedRow));return}switch(o){case"first":{const n=e.shownRows[0];if(n===e.focusedRow)return;if(r.push(j(e.focusedRow)),r.push(j(n)),e.isMultipleSelection){if(t){const l=new Array(e.focusedRow+1).fill(1).map((a,i)=>i);r.set(l.map((a,i)=>j(i))),e.selectedRows=l,e.lastSelectedRow=n}}else e.selectedRows=[n],e.lastSelectedRow=n;e.focusedRow=n}break;case"last":{const n=e.shownRows[e.shownRows.length-1];if(n===e.focusedRow)return;if(r.push(j(e.focusedRow)),r.push(j(n)),e.isMultipleSelection){if(t){const l=new Array(e.rowsCount-e.focusedRow).fill(1).map((a,i)=>i+Math.min(n,e.focusedRow));r.push(...l.map(a=>j(a))),e.selectedRows=l,e.lastSelectedRow=n}}else e.selectedRows=[n],e.lastSelectedRow=n;e.focusedRow=n}break;case"previous":case"next":case"pageDown":case"pageUp":{const n=_n([-1,1,-10,10],[o==="previous",o==="next",o==="pageUp",o==="pageDown"]),l=e.shownRows.findIndex(i=>e.focusedRow===i),a=e.shownRows[Pn({number:l+n,min:0,max:e.shownRows.length-1})];if(a===e.focusedRow)return;r.push(j(e.focusedRow)),r.push(j(a)),e.isMultipleSelection?t&&(e.selectedRows.includes(a)?e.selectedRows=e.selectedRows.filter(i=>i!==a):e.selectedRows.push(a),e.lastSelectedRow=a):(e.selectedRows=[a],e.lastSelectedRow=a),e.focusedRow=a}break}e.isEverythingSelected=!1}),ki=X((e,t,o)=>{const r=e.shownRows.findIndex(a=>a===e.focusedRow);function n(a){o.push(j(e.focusedRow)),e.focusedRow=a,e.isMultipleSelection||(o.push(...e.selectedRows.map(i=>j(i))),e.selectedRows=[a]),o.push(j(e.focusedRow))}function l(a){var i;const s=document.getElementById(`${e.id}__row__${a}`);return s?e.startsWithFunction((i=s.ariaLabel)!=null?i:"",t.characters)?(n(e.shownRows[a]),!0):!1:(console.warn("Element not found",`${e.id}__row__${a}`),!1)}for(let a=r+1;a<e.shownRows.length;a++)if(l(a))return;for(let a=0;a<r;a++)if(l(a))return}),_i=X((e,t,o)=>{o.push(...e.selectedRows.map(j)),e.isEverythingSelected?(e.isEverythingSelected=!1,e.selectedRows=[]):(e.isEverythingSelected=!0,e.selectedRows=e.shownRows),e.lastSelectedRow=e.focusedRow,o.push(...e.shownRows.map(j))}),Pi=X((e,t,o)=>{var r=t,{affectedKeys:n}=r,l=xi(r,["affectedKeys"]),a;const i=(a=l.rowsCount)!=null?a:e.rowsCount;if(e.rowsCount<i)for(let s=e.rowsCount;s<l.rowsCount;s++)e.shownRows.push(s);else e.rowsCount>i&&(e.shownRows=e.shownRows.filter(s=>s<i),e.focusedRow>i-1&&(e.focusedRow=i-1,o.push(j(e.focusedRow))),e.selectedRows=e.selectedRows.filter(s=>s<i));Object.assign(e,l),o.set(n),e.isEverythingSelected=!1}),Ii=X((e,t,o)=>{o.push(j(e.focusedRow)),o.push(j(t.rowIndex)),e.focusedRow=t.rowIndex,t.isShiftKey?Er(e,{isShiftKey:t.isShiftKey},o):(e.lastSelectedRow=t.rowIndex,t.isCtrlKey?e.selectedRows.includes(t.rowIndex)?e.selectedRows=e.selectedRows.filter(r=>r!==t.rowIndex):e.selectedRows.push(t.rowIndex):(o.push(...e.selectedRows.map(r=>j(r))),e.selectedRows=[e.focusedRow]))}),Er=X((e,{isShiftKey:t},o)=>{const r=e.focusedRow;if(o.push(j(r)),e.isMultipleSelection)if(t)if(e.lastSelectedRow===-1)e.selectedRows.push(r);else{const n=new Array(Math.abs(e.lastSelectedRow-r)).fill(1).map((l,a)=>a+Math.min(r,e.lastSelectedRow)+(e.lastSelectedRow>r?0:1));o.push(...n.map(l=>j(l))),n.forEach(l=>{e.shownRows.includes(l)&&(e.selectedRows.includes(l)?e.selectedRows=e.selectedRows.filter(a=>a!==l):e.selectedRows.push(l))})}else e.selectedRows.includes(r)?e.selectedRows=e.selectedRows.filter(n=>n!==r):e.selectedRows.push(r);e.lastSelectedRow=r}),Ri={filter:Ci,moveFocusAndToggleSelection:Si,searchElementsByStartingCharacters:ki,selectAll:_i,setState:Pi,updateFocusByClickEvent:Ii,updateFocusBySpaceEvent:Er};function Ei(e,{allowMultipleCharacterSearch:t,allowSelection:o,allowSingleCharacterSearch:r,isMultipleSelection:n,searchFunction:l,showSearchbox:a,startsWithFunction:i}){return B(()=>Wt({initialState:ti({allowSelection:o??!0,allowMultipleCharacterSearch:(t??!0)&&!a,allowSingleCharacterSearch:(r??!0)&&!a,id:e,isMultipleSelection:!!n,searchFunction:l,showSearchbox:a??!1,startsWithFunction:i}),operations:Ri,distinctors:Za(e),keysMakers:ei}),[])}function ji(e,t){B(function(){t((o,r)=>{o.selectedRows!==r.selectedRows&&e?.({focusedElement:document.querySelector(`#${o.id}__row__${o.focusedRow}`),selectedElements:o.selectedRows.map(n=>document.querySelector(`#${o.id}__row__${n}`))})})},[e,t])}function Ni(e){return B(function(){return Rt.map(e,(t,o)=>Et(t)&&t.type===qe?cn(t,{rowIndex:o}):t)},[e])}function Li(e,t){return{onClick:L(()=>{var o;document.activeElement!==document.querySelector(`#${e} .listbox__list`)&&((o=document.querySelector(`#${e} .listbox__list`))==null||o.focus())},[e]),onFocus:L(()=>{const o=t().focusedRow+1,r=document.querySelector(`#${e} .listbox__list .listbox__row:nth-child(${o})`);if(r){r.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const n=At(r);if(n){n.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const l=r.getBoundingClientRect(),a=n.getBoundingClientRect();l.top-a.top<l.height&&(n.scrollTop-=l.height)}}},[t,e])}}function Di(e,t){B(function(){let o=0;Rt.forEach(e,r=>{Et(r)&&r.type===qe&&o++}),t.setState({rowsCount:o,affectedKeys:[]})},[t,e])}function Ti(e){return B(()=>e,[...Object.values(e)])}var Mi=Object.defineProperty,Bi=Object.defineProperties,Ai=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,Fi=Object.prototype.hasOwnProperty,Hi=Object.prototype.propertyIsEnumerable,Nr=(e,t,o)=>t in e?Mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,kt=(e,t)=>{for(var o in t||(t={}))Fi.call(t,o)&&Nr(e,o,t[o]);if(jr)for(var o of jr(t))Hi.call(t,o)&&Nr(e,o,t[o]);return e},_t=(e,t)=>Bi(e,Ai(t));const Ki=Dt("Listbox","layout.components.listbox",gi,e=>{var t;const o=B(()=>wr("Listbox"),[]),[r,n,l,a]=Ei(o,e);ji(e.onSelectionChange,a),Di(e.children,r);const i=Ni(e.children),{onClick:s,onFocus:f}=Li(o,l),d=n("listbox",null),c=e.unstyled?"":"layout.components.listbox",b=Ti({getState:l,id:o,listboxActions:r,onClickNode:e.onClickNode,onConfirmSelection:e.onConfirmSelection,onDoubleClickNode:e.onDoubleClickNode,onPressEnterOnNode:e.onPressEnterOnNode,onPressKeyOnNode:e.onPressKeyOnNode,useListbox:n,variant:c});return p(Ke.Provider,{value:b,children:p(pi,_t(kt({className:`listbox ${e.showSearchbox?"withSearchbox":""} ${(t=e.className)!=null?t:""}`},e.ulProps),{children:e.showSearchbox?p(yi,_t(kt({},e.ulProps),{children:i})):p(x,_t(kt({ref:d,as:"ul",className:"listbox__list",role:"listbox",tabIndex:0,onClick:s,onFocus:f},e.ulProps),{children:i}))}))})},!0),Wi=Je(Ki);var qi=Object.defineProperty,zi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable,Dr=(e,t,o)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Yi=(e,t)=>{for(var o in t||(t={}))Vi.call(t,o)&&Dr(e,o,t[o]);if(Lr)for(var o of Lr(t))Gi.call(t,o)&&Dr(e,o,t[o]);return e},Xi=(e,t)=>zi(e,Ui(t));const Ji=({id:e,progress:t=0,loading:o=!1})=>N(le,{children:[p(fn,{htmlFor:e,sx:{display:o?"block":"none",m:"0px"},children:`${t}%`}),p(hn,Xi(Yi({id:e,max:100,value:t},M("styles.progress")),{sx:{display:o?"block":"none"},children:`${t}%`}))]});var Zi=Object.defineProperty,Qi=Object.defineProperties,ec=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertySymbols,tc=Object.prototype.hasOwnProperty,oc=Object.prototype.propertyIsEnumerable,Mr=(e,t,o)=>t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,rc=(e,t)=>{for(var o in t||(t={}))tc.call(t,o)&&Mr(e,o,t[o]);if(Tr)for(var o of Tr(t))oc.call(t,o)&&Mr(e,o,t[o]);return e},nc=(e,t)=>Qi(e,ec(t));function lc(e,t){let o=0;for(;o<t.length&&e>t[o];)o++;return o}const Br=({breakPoints:e,Component:t,debounce:o,defaultBreakpoint:r})=>function(n){var l,a,i,s;const[f,d]=V((a=(l=n.defaultBreakPoint)!=null?l:r)!=null?a:4),c=G(e[(s=(i=n.defaultBreakPoint)!=null?i:r)!=null?s:4]),b=G(null),u=G(0),h=G(!1),m=L(v=>{var $;($=b.current)==null||$.disconnect(),b.current=new ResizeObserver(O=>{O[0].contentRect.width!==0&&(clearTimeout(u.current),u.current=setTimeout(()=>{var w;c.current=O[0].contentRect.width,d(lc(O[0].contentRect.width,(w=n.breakPoints)!=null?w:e))},o??100))}),v&&b.current.observe(v)},[n.breakPoints]);return Z(()=>(h.current=!1,()=>{h.current=!0,setTimeout(()=>{var v;h.current&&((v=b.current)==null||v.disconnect())},2e3)}),[n.breakPoints]),p(x,{ref:m,children:p(t,nc(rc({},n),{breakPoint:f,breakPointWidth:e[f],containerWidth:c.current}))})},ac={grid:[(e,t)=>({etc:{"aria-activedescendant":`${t.storeId}__${t.focusedRow}__${t.focusedColumn}`}})],cell:[(e,t)=>{const o=t.focusedColumn===e.columnIndex&&t.focusedRow===e.rowIndex;return{etc:{id:`${t.storeId}__${e.rowIndex}__${e.columnIndex}`},classList:{add:o?["focused"]:void 0,remove:o?void 0:["focused"]}}},(e,t)=>{const o=document.querySelector(`#${t.storeId} [aria-rowindex="${t.focusedRow}"] [aria-colindex="${t.focusedColumn}"]`);o?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})}]},A=e=>`${e.columnIndex}__${e.rowIndex}`,ic={cell:A,grid:()=>"grid"};function me(e){const t=document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow}"] [aria-colindex="${e.focusedColumn}"]`);t instanceof HTMLElement&&(e.focusedId=t.dataset.id)}const cc=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow+1}"] [aria-colindex="${e.focusedColumn}"]`)&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow+1}),"grid"]),e.focusedRow++,me(e))},sc=(e,t,o)=>{e.focusedRow>1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow-1}),"grid"]),e.focusedRow--,me(e))},uc=(e,t,o)=>{e.focusedColumn>1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn-1,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn--,me(e))},dc=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow}"] [aria-colindex="${e.focusedColumn+1}"]`)&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn+1,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn++,me(e))},pc=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${t.rowIndex}"] [aria-colindex="${t.colIndex}"]`)&&(o.set([A({columnIndex:t.colIndex,rowIndex:t.rowIndex}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn=t.colIndex,e.focusedRow=t.rowIndex,me(e))},fc=(e,t,o)=>{var r,n;const l=document.querySelector(`#${e.storeId} [data-id="${e.focusedId}"]`);if(l instanceof HTMLElement){const a=Ce((r=l.closest("[aria-rowindex]"))==null?void 0:r.ariaRowIndex,-1),i=Ce((n=l.closest("[aria-colindex]"))==null?void 0:n.ariaColIndex,-1);a!==-1&&i!==-1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:i,rowIndex:a})]),e.focusedColumn=i,e.focusedRow=a)}},hc={arrowDown:cc,arrowLeft:uc,arrowRight:dc,arrowUp:sc,setFocused:pc,recalculateIndexByResize:fc};var mc=Object.defineProperty,Ar=Object.getOwnPropertySymbols,bc=Object.prototype.hasOwnProperty,vc=Object.prototype.propertyIsEnumerable,Fr=(e,t,o)=>t in e?mc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,wc=(e,t)=>{for(var o in t||(t={}))bc.call(t,o)&&Fr(e,o,t[o]);if(Ar)for(var o of Ar(t))vc.call(t,o)&&Fr(e,o,t[o]);return e};const yc=e=>wc({focusedColumn:1,focusedRow:1,focusedId:0},e),Hr=Xe({}),Kr=()=>ae(Hr),gc=({storeId:e})=>{const[t,o,r,n]=B(()=>Wt({initialState:yc({storeId:e}),distinctors:ac,keysMakers:ic,operations:hc}),[]),l=L(({children:a})=>p(Hr.Provider,{value:{actions:t,useProps:o,getState:r,registerStateChangeListener:n},children:a}),[t,r,n,o]);return[t,o,r,n,l]};function Wr(e){return e instanceof Function&&xc(e).length===0}const $c=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Oc=/([^\s,]+)/g;function xc(e){const t=e.toString().replace($c,"");let o=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(Oc);return o===null&&(o=[]),o}function Cc({attachToElement:e,attachToElementAnchorPoint:t}){let o={left:0,top:0};const r=Wr(e)?e():e.current;if(r){const n=r.getBoundingClientRect();switch(t??"topRight"){case"bottomLeft":o={left:n.left,top:n.bottom};break;case"bottomRight":o={left:n.right,top:n.bottom};break;case"center":o={left:(n.left+n.right)/2,top:(n.bottom+n.top)/2};break;case"topLeft":o={left:n.left,top:n.top};break;case"topRight":o={left:n.right,top:n.top};break}}else console.warn("Cannot resolve element, will use default positioning ",e);return o}function Sc({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,minSize:r,preferredOrientationX:n,preferredOrientationY:l,preferredSize:a={height:"auto",width:"auto"}}){var i,s,f,d,c,b,u,h;let m=e;if(t&&(m=Cc({attachToElement:t,attachToElementAnchorPoint:o})),m){const v=window.innerHeight-m.top,$=m.top,O=m.left,w=window.innerWidth-m.left,k=((i=r?.width)!=null?i:0)<=w,C=((s=r?.width)!=null?s:0)<=O,_=((f=r?.height)!=null?f:0)<=v,T=((d=r?.height)!=null?d:0)<=$,P=a.width==="auto"?1/0:a.width,E=a.height==="auto"?1/0:a.height,g={"& > *":{width:"100%",height:"100%"},width:a.width==="auto"?"auto":"100%",height:a.height==="auto"?"auto":"100%"};return n==="left"?C?(g.maxWidth=Math.min(P,O),g.right=window.innerWidth-m.left):k?(g.maxWidth=Math.min(P,w),g.left=m.left):(g.left=0,g.maxWidth="100vw"):k?(g.maxWidth=Math.min(P,w),g.left=m.left):C?(g.maxWidth=Math.min(P,O),g.right=window.innerWidth-m.left):(g.left=0,g.maxWidth="100vw"),l==="top"?T?(g.maxHeight=Math.min(E,$),g.bottom=window.innerHeight-m.top):_?(g.maxHeight=Math.min(E,v),g.top=m.top):(g.maxHeight="100vh",g.top=0):_?(g.maxHeight=Math.min(E,v),g.top=m.top):T?(g.maxHeight=Math.min(E,$),g.bottom=window.innerHeight-m.top):(g.maxHeight="100vh",g.top=0),g.minHeight=typeof g.maxHeight=="number"?Math.min(g.maxHeight,(c=r?.height)!=null?c:0):(b=r?.height)!=null?b:0,g.minWidth=typeof g.minWidth=="number"?Math.min(g.minWidth,(u=r?.width)!=null?u:0):(h=r?.width)!=null?h:0,g}return{left:0,top:0,width:"auto",height:"auto"}}function kc({attachToElement:e,closeOnClick:t,closeOnClickOut:o,closeOnEscape:r,closeOnMouseLeaveTooltip:n,closeOnMouseLeaveAttachedElement:l,closeOnScrollOut:a}){const i=G(!1),s=L(()=>{be("close",void 0)},[]);return In(()=>{function f(u){u.code==="Escape"&&r&&s()}function d(u){i.current&&o&&!U(u.target,h=>{var m;return(m=h.classList)==null?void 0:m.contains("tooltip__wrapper")})&&s()}function c(u){i.current&&a&&!U(u.target,h=>{var m;return(m=h.classList)==null?void 0:m.contains("tooltip__wrapper")})&&s()}function b(u){if(!i.current||!l&&!n)return;const h=e?Wr(e)?e():e.current:null,m=U(u.target,w=>w.classList.contains("tooltip__wrapper")),v=U(u.target,w=>w===h),$=U(u.relatedTarget,w=>w.classList.contains("tooltip__wrapper")),O=U(u.relatedTarget,w=>w===h);!m&&!v&&!l&&!n||$||O||v&&!l||m&&!n||s()}return document.addEventListener("keydown",f),document.addEventListener("mousedown",d),document.addEventListener("scroll",c),document.addEventListener("mouseout",b),setTimeout(()=>{i.current=!0},0),()=>{document.removeEventListener("keydown",f),document.removeEventListener("click",d),document.removeEventListener("scroll",c),document.removeEventListener("mouseout",b)}}),{handleOnClick:L(f=>{f.stopPropagation(),t&&s()},[s,t])}}var _c=Object.defineProperty,Pc=Object.defineProperties,Ic=Object.getOwnPropertyDescriptors,qr=Object.getOwnPropertySymbols,Rc=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable,zr=(e,t,o)=>t in e?_c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ur=(e,t)=>{for(var o in t||(t={}))Rc.call(t,o)&&zr(e,o,t[o]);if(qr)for(var o of qr(t))Ec.call(t,o)&&zr(e,o,t[o]);return e},jc=(e,t)=>Pc(e,Ic(t));const Nc=({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,children:r,className:n,closeOnClick:l=!1,closeOnClickOut:a=!0,closeOnEscape:i=!0,closeOnMouseLeaveTooltip:s=!0,closeOnMouseLeaveAttachedElement:f=!0,closeOnScrollOut:d=!0,minSize:c,preferredOrientationX:b="right",preferredOrientationY:u="bottom",preferredSize:h={height:"auto",width:"auto"},variant:m="layout.common.tooltips.primary"})=>{const v=Sc({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,minSize:c,preferredOrientationX:b,preferredOrientationY:u,preferredSize:h}),$=Ur({position:"fixed"},v),{handleOnClick:O}=kc({attachToElement:t,closeOnEscape:i,closeOnClickOut:a,closeOnClick:l,closeOnMouseLeaveTooltip:s,closeOnMouseLeaveAttachedElement:f,closeOnScrollOut:d});return p(x,jc(Ur({className:`tooltip__wrapper ${n??""}`},M(m)),{sx:$,onClick:O,children:r}))};var Lc=Object.defineProperty,Dc=Object.defineProperties,Tc=Object.getOwnPropertyDescriptors,Vr=Object.getOwnPropertySymbols,Mc=Object.prototype.hasOwnProperty,Bc=Object.prototype.propertyIsEnumerable,Gr=(e,t,o)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Pt=(e,t)=>{for(var o in t||(t={}))Mc.call(t,o)&&Gr(e,o,t[o]);if(Vr)for(var o of Vr(t))Bc.call(t,o)&&Gr(e,o,t[o]);return e},Ac=(e,t)=>Dc(e,Tc(t));Lt("layout.common.tooltips.primary",{background:"white",border:"1px solid #ccc",p:3,zIndex:"tooltip"});const[,be,Fc]=Rn()({Component:()=>{const[e,t]=V(null),o=En(e);return jn({open:t,close(){var r,n;(n=(r=o.current)==null?void 0:r.onClose)==null||n.call(r),t(null)}}),e?p(Nc,Pt({},e)):null}});function Yr(e){const t=G(!1),o=L(r=>{setTimeout(()=>{if(t.current=!0,!e&&!(r!=null&&r.children))throw new Error("There is no children set for the current tooltip");be("open",Ac(Pt(Pt({},e),r),{onClose(){var n,l;(n=e?.onClose)==null||n.call(e),(l=r?.onClose)==null||l.call(r),t.current=!1}}))},0)},[e]);return{close:L(()=>{be("close",void 0)},[]),open:o,toggle:L(r=>{t.current?be("close",void 0):o(r)},[o])}}function Ve(e,t){var o,r;const n=t instanceof HTMLElement?(r=(o=t.closest(".iconsList__iconWrapper[data-id]"))==null?void 0:o.dataset)==null?void 0:r.id:t;if(n!==void 0){const l=e.find(a=>String(a.id)===n);return l??null}}const Hc=({children:e,icons:t,onIconClick:o,onIconDoubleClick:r,onIconGetDetails:n,onIconKeyDown:l,storeId:a})=>{const{actions:i,getState:s,useProps:f}=Kr(),d=f("grid",null),{open:c}=Yr({minSize:{width:200,height:0}}),b=L(u=>{n&&c({children:n(u),attachToElement:()=>document.querySelector(`#${a} .iconsList__iconWrapper[data-id="${u.id}"]`),closeOnClick:!1})},[n,c,a]);return p(x,{ref:d,className:"iconsList__keyHandler",tabIndex:0,onFocus:L(u=>{if(!U(u.target,m=>{var v;return(v=m.classList)==null?void 0:v.contains("iconsList__keyHandler")}))return;const h=Ve(t,s().focusedId);h&&b(h)},[s,t,b]),onMouseDown:L(u=>{var h,m;if(u.target instanceof HTMLElement){const v=Ce((h=u.target.closest("[aria-colindex]"))==null?void 0:h.ariaColIndex,-1),$=Ce((m=u.target.closest("[aria-rowindex]"))==null?void 0:m.ariaRowIndex,-1);v>=0&&$>=0&&i.setFocused({colIndex:v,rowIndex:$})}},[i]),onClick:L(u=>{const h=Ve(t,u.target);h&&b(h),o&&h&&o(u,h)},[t,o,b]),onDoubleClick:L(u=>{if(r){const h=Ve(t,u.target);h&&r(u,h)}},[t,r]),onKeyDown:L(u=>{function h(){const m=Ve(t,s().focusedId);m&&b(m),m&&l&&l(u,m)}switch(u.code){case"ArrowUp":i.arrowUp(),h();break;case"ArrowDown":i.arrowDown(),h();break;case"ArrowRight":i.arrowRight(),h();break;case"ArrowLeft":i.arrowLeft(),h();break}},[i,s,t,l,b]),children:e})};var Kc=Object.defineProperty,Xr=Object.getOwnPropertySymbols,Wc=Object.prototype.hasOwnProperty,qc=Object.prototype.propertyIsEnumerable,Jr=(e,t,o)=>t in e?Kc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Zr=(e,t)=>{for(var o in t||(t={}))Wc.call(t,o)&&Jr(e,o,t[o]);if(Xr)for(var o of Xr(t))qc.call(t,o)&&Jr(e,o,t[o]);return e};const zc={"&, *":{textAlign:"center"},".iconsList__icon__image__wrapper":{boxShadow:"1px 1px 3px #0001"},".iconsList__icon__wrapper":{p:2,"&:hover":Zr({},Tt().getOneState({backgroundColor:Tt().background.paper},"hover"))},".iconsList__icon__label":{wordBreak:"break-word"},".iconsList__keyHandler:focus":{outline:"none",".focused .iconsList__icon__wrapper":Zr({},Ze)}};function Uc(e){return Array(Math.floor(4e3/e)).fill(1).map((t,o)=>(o+1)*e)}function Vc({containerWidth:e,iconWidth:t,breakPoint:o,verticalGap:r,removeHorizontalPadding:n}){const l=(e-t*o)/(o+(n?-1:1));return B(()=>({justifyContent:"space-evenly",gridTemplateColumns:`repeat(${o}, 1fr)`,rowGap:r??0,columnGap:`${l}px`,px:n?0:`${l}px`}),[n,o,l,r])}const Qr="JUST TO FILL THE ROW";function Gc({breakPoint:e,icons:t,i:o}){const r=t.slice(o*e,(o+1)*e);return r.length<e&&r.push(...Array(e-r.length).fill(Qr)),r}const en=Xe(null);function Yc(){const e=ae(en);if(!e)throw new Error("There is no IconRendererContext");return e}var Xc=Object.defineProperty,tn=Object.getOwnPropertySymbols,Jc=Object.prototype.hasOwnProperty,Zc=Object.prototype.propertyIsEnumerable,on=(e,t,o)=>t in e?Xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Qc=(e,t)=>{for(var o in t||(t={}))Jc.call(t,o)&&on(e,o,t[o]);if(tn)for(var o of tn(t))Zc.call(t,o)&&on(e,o,t[o]);return e};const es=e=>{var t;const{useProps:o}=Kr(),r=o("cell",{columnIndex:e.colIndex,rowIndex:e.rowIndex}),n=Yc();return p(x,{ref:r,role:"gridcell","data-id":e.id,className:`iconsList__iconWrapper ${(t=e.className)!=null?t:""}`,"aria-label":e.ariaLabel,sx:B(()=>({width:`${e.width}px`}),[e.width]),"aria-colindex":e.colIndex,children:p(n,Qc({},e))})};var ts=Object.defineProperty,rn=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable,nn=(e,t,o)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ns=(e,t)=>{for(var o in t||(t={}))os.call(t,o)&&nn(e,o,t[o]);if(rn)for(var o of rn(t))rs.call(t,o)&&nn(e,o,t[o]);return e};const ls=({icon:e,iconWidth:t,rowIndex:o,colIndex:r})=>e===Qr?p(x,{sx:{width:`${t}px`},className:"fill__the__row"},r):p(es,ns({rowIndex:o,colIndex:r,width:t},e)),as=e=>N(x,{className:"iconsList__icon__wrapper",children:[p(x,{className:"iconsList__icon__image__wrapper",children:p(jt,{className:"iconsLIst__icon__image",src:e.imageUrl,role:"decoration"})}),p(x,{className:"iconsList__icon__label",children:e.label})]}),is=Je(as),ln=(e,t)=>{const o=B(()=>wr("IconsList"),[]),[r,,,,n]=gc({storeId:o}),l=B(()=>{var a,i,s;const f=(a=e.iconWidth)!=null?a:100,d=(i=e.minHorizontalGap)!=null?i:30,c=(s=e.iconRenderer)!=null?s:is,b=f+d;return Dt("IconsList","layout.common.components.iconsList",zc,Br({breakPoints:Uc(b),Component:({breakPoint:u,containerWidth:h})=>{const m=Math.ceil(e.icons.length/u),v=Vc({breakPoint:u,containerWidth:h,iconWidth:f,verticalGap:e.verticalGap,removeHorizontalPadding:e.removeHorizontalPadding});return Z(()=>{r.recalculateIndexByResize()},[u]),p(en.Provider,{value:c,children:p(n,{children:p(Hc,{icons:e.icons,onIconClick:e.onIconClick,onIconDoubleClick:e.onIconDoubleClick,onIconGetDetails:e.onIconGetDetails,onIconKeyDown:e.onIconKeyDown,storeId:o,children:p(x,{id:o,role:"grid","aria-rowcount":m,"aria-colcount":u,children:Array(m).fill(1).map(($,O)=>{const w=Gc({breakPoint:u,i:O,icons:e.icons});return p(mn,{"aria-rowindex":O+1,role:"row",ref:t,sx:v,children:w.map((k,C)=>p(ls,{colIndex:C+1,icon:k,iconWidth:f,rowIndex:O+1},typeof k=="string"?C+1:k.id))},O)})})})})})},debounce:50}))},[n,r,e.iconRenderer,e.iconWidth,e.icons,e.minHorizontalGap,e.onIconClick,e.onIconDoubleClick,e.onIconGetDetails,e.onIconKeyDown,e.removeHorizontalPadding,e.verticalGap,t,o]);return p(l,{})};ln.displayName="IconsList";const cs=Ye(ln);export{Aa as ApiaFilter,Gn as BaseButton,ut as CalendarModal,pl as Captcha,uo as Checkbox,hr as CollapsiblePanel,la as Confirm,ht as DateInput,No as DialogButtonBar,Wo as FieldErrorMessage,se as IconButton,Yo as IconInput,cs as IconsList,Bo as LinearLoader,Wi as Listbox,qe as ListboxItem,st as Modal,ct as ModalContext,vt as NumberInput,Le as Overlay,Ji as ProgressBar,Ra as RequiredMark,da as ScreenLock,Pe as SimpleButton,Fc as TooltipsProvider,Cr as WaiTypeAhead,na as getConfirmButton,Me as getFieldErrorStyles,ma as getFieldTouchedStyles,Br as makeResponsiveComponent,Pa as parseNumberInputValueToNumber,Ia as parseNumberValueToNumberInput,be as tooltipsHandler,Ro as useModal,nl as useOtherTagButton,Yr as useTooltip};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{jsx as d,jsxs as L,Fragment as ae}from"react/jsx-runtime";import*as R from"react";import w,{useState as U,forwardRef as Ye,useRef as X,useMemo as B,useEffect as Z,useCallback as N,createContext as Je,memo as Qe,useContext as ie,Children as Lt,isValidElement as Nt,cloneElement as pn}from"react";import{Button as $e,Flex as ce,Spinner as se,IconButton as fn,Box as x,Image as Dt,Input as ue,Heading as hn,Close as Tt,useThemeUI as mn,Select as bn,Label as vn,Progress as wn,Grid as yn}from"theme-ui";import{spacing as G,getVariant as T,responsive as Oe,injectStyles as Ze,focusOutline as et,getColorState as gn,makeStyledComponent as tt,getPalette as Mt}from"@apia/theme";import{icons as Bt,Icon as ot}from"@apia/icons";import{getSpecificParent as xe,useUpdateEffect as Y,debugDispatcher as $n,useCombinedRefs as Ce,focus as On,focusSelector as xn,getFocusSelector as Cn,screenLocker as At,customEvents as rt,isChild as V,getDateFormat as Sn,getLabel as _n,persistentStorage as nt,disableChildrenFocus as kn,enableChildrenFocus as Pn,findScrollContainer as Ft,EventEmitter as In,useDebouncedCallback as Rn,getIndex as jn,addBoundary as En,noNaN as Se,useMount as Ln,makeSingleImperativeComponent as Nn,useLatest as Dn,useImperativeComponentEvents as Tn}from"@apia/util";import{uniqueId as Ht,isFunction as Mn}from"lodash-es";import ee from"dayjs";import{isFunction as Bn,uniqueId as Kt}from"lodash";import An from"react-calendar";import{CSSTransition as Wt}from"react-transition-group";import Fn from"react-focus-lock";import{useBreakpointIndex as Hn}from"@theme-ui/match-media";import Kn from"react-cool-portal";import{getColor as Wn}from"@theme-ui/color";import{BarLoader as qn}from"react-spinners";import zn from"react-input-mask";import{useUpdateEffect as Un}from"ahooks";import Vn from"react-animate-height";import{createFAsomeStore as qt}from"@apia/dom-store";var Gn=Object.defineProperty,Xn=Object.defineProperties,Yn=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,zt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,Vt=(e,t,o)=>t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,lt=(e,t)=>{for(var o in t||(t={}))zt.call(t,o)&&Vt(e,o,t[o]);if(_e)for(var o of _e(t))Ut.call(t,o)&&Vt(e,o,t[o]);return e},Gt=(e,t)=>Xn(e,Yn(t)),Jn=(e,t)=>{var o={};for(var r in e)zt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&_e)for(var r of _e(e))t.indexOf(r)<0&&Ut.call(e,r)&&(o[r]=e[r]);return o};const Qn=e=>{var t=e,{id:o,name:r,onClick:n=()=>{},isLoading:l=!1,loadingChildren:a,disabled:i=!1,children:s="",text:p="",variant:f="primary",type:c="button",SXProps:b}=t,u=Jn(t,["id","name","onClick","isLoading","loadingChildren","disabled","children","text","variant","type","SXProps"]);return d($e,Gt(lt(Gt(lt({id:o,name:r,onClick:n},T(f)),{type:c,title:s,disabled:l||i}),u),{children:L(ce,{as:"span",sx:lt({color:"inherit",width:"100%",flexDirection:"row",alignContent:"center",justifyContent:"center",alignItems:"center",gap:G(3)},b),children:[l&&L(ae,{children:[d(se,{size:20,color:"inherit"}),a]}),!l&&(s||p)]})}))};var Zn=Object.defineProperty,el=Object.defineProperties,tl=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Jt=(e,t,o)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Qt=(e,t)=>{for(var o in t||(t={}))Xt.call(t,o)&&Jt(e,o,t[o]);if(ke)for(var o of ke(t))Yt.call(t,o)&&Jt(e,o,t[o]);return e},Zt=(e,t)=>el(e,tl(t)),ol=(e,t)=>{var o={};for(var r in e)Xt.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&ke)for(var r of ke(e))t.indexOf(r)<0&&Yt.call(e,r)&&(o[r]=e[r]);return o};const de=R.forwardRef((e,t)=>{var o=e,{className:r,disabled:n=!1,icon:l,iconSize:a,id:i,isLoading:s=!1,isToggled:p=!1,href:f,onClick:c=()=>{},onMouseOver:b=()=>{},onMouseOut:u=()=>{},size:h="Sm",title:m,type:v="button",variant:$="icon"}=o,O=ol(o,["className","disabled","icon","iconSize","id","isLoading","isToggled","href","onClick","onMouseOver","onMouseOut","size","title","type","variant"]),y;const _=["Xs","Sm","Md","Lg","Xl"],C=a??_[Math.max(0,_.indexOf(h)-1)],k=R.useMemo(()=>({width:`icon${h}`,minWidth:`icon${h}`,height:`icon${h}`,minHeight:`icon${h}`,svg:{width:`icon${C}`,minWidth:`icon${C}`,height:`icon${C}`,minHeight:`icon${C}`}}),[C,h]),M=R.useMemo(()=>typeof l=="string"?Bt[l]:l,[l]);return d(fn,Zt(Qt(Zt(Qt({id:i,ref:t,onClick:R.useCallback(P=>{f&&window.open(f,"_blank"),c?.(P)},[f,c]),onMouseOver:b,onMouseOut:u},T($)),{sx:k,disabled:s||n,className:`${r??""} iconButton ${p?"isToggled":""}`,title:m,"aria-label":(y=O["aria-label"])!=null?y:O.as!==void 0?void 0:m,type:O.as!==void 0?void 0:v,role:f?"link":void 0}),O),{children:s?d(se,{color:"inherit"}):d(M,{})}))});de.displayName="IconButton";var rl=Object.defineProperty,nl=Object.defineProperties,ll=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,eo=Object.prototype.hasOwnProperty,to=Object.prototype.propertyIsEnumerable,oo=(e,t,o)=>t in e?rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ro=(e,t)=>{for(var o in t||(t={}))eo.call(t,o)&&oo(e,o,t[o]);if(Pe)for(var o of Pe(t))to.call(t,o)&&oo(e,o,t[o]);return e},no=(e,t)=>nl(e,ll(t)),al=(e,t)=>{var o={};for(var r in e)eo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Pe)for(var r of Pe(e))t.indexOf(r)<0&&to.call(e,r)&&(o[r]=e[r]);return o};const il={display:"inline-flex",gap:G(3),position:"relative",alignItems:"center",justifyContent:"center",".toggled":{backgroundColor:"primary"}},Ie=R.forwardRef((e,t)=>{var o=e,{children:r=null,className:n,disabled:l=!1,icon:a,iconColor:i,iconPosition:s="left",iconSize:p,id:f,isLoading:c,name:b,onClick:u,size:h,spinnerSize:m=16,title:v,type:$="button",variant:O="primary"}=o,y=al(o,["children","className","disabled","icon","iconColor","iconPosition","iconSize","id","isLoading","name","onClick","size","spinnerSize","title","type","variant"]);const _=R.useMemo(()=>({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center"}),[]),C=R.useMemo(()=>({color:c?"transparent":void 0}),[c]),k=R.useMemo(()=>a,[a]);return L($e,no(ro(no(ro({ref:t,id:f,name:b,title:v,"aria-label":v,onClick:u,type:$,disabled:c??l,className:n},T(`${O}${h!=="md"&&h?`-${h}`:""}`)),{sx:il}),y),{children:[k&&s==="left"&&d(k,{title:"",size:p,color:i}),d(x,{as:"span",className:"button__content",sx:C,children:r??v}),k&&s==="right"&&d(k,{title:"",size:p,color:i}),c&&d(x,{className:"spinner",sx:_,children:d(se,{size:m,color:"inherit"})})]}))});Ie.displayName="SimpleButton";function cl(e){var t;const o=w.useMemo(()=>`otherTag${Ht()}`,[]),r=w.useCallback(l=>{var a;(a=e?.onClick)==null||a.call(e,l)},[e]),n=w.useCallback(l=>{var a;if((a=e?.onKeyDown)==null||a.call(e,l),l.code==="Enter"||l.code==="Space"){l.preventDefault();const i=xe(l.target,s=>s.classList.contains(o));i&&i.click()}},[e,o]);return{className:`${o} ${(t=e?.className)!=null?t:""}`,onClick:r,onKeyDown:n,role:"button",tabIndex:0}}var sl=Object.defineProperty,ul=Object.defineProperties,dl=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertySymbols,pl=Object.prototype.hasOwnProperty,fl=Object.prototype.propertyIsEnumerable,ao=(e,t,o)=>t in e?sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,hl=(e,t)=>{for(var o in t||(t={}))pl.call(t,o)&&ao(e,o,t[o]);if(lo)for(var o of lo(t))fl.call(t,o)&&ao(e,o,t[o]);return e},ml=(e,t)=>ul(e,dl(t));const bl=({name:e,imageUrl:t,onChange:o,value:r,className:n})=>{const[l,a]=U(`${t}?t=${Date.now()}`),i=()=>{a(`${t}?t=${Date.now()}`)};return L(ce,ml(hl({sx:{flexDirection:"column"},className:"captcha__field"},T("layout.common.forms.captcha")),{children:[d(ce,{className:"captcha__imageContainer",children:d(Dt,{alt:"",src:l})}),L(ce,{className:`captcha__inputContainer ${n??""}`,children:[d(ue,{autoComplete:"off",name:e,onChange:o,value:r}),L(ce,{className:"captcha__buttons",children:[d(de,{icon:"Refresh",type:"button","aria-label":"TODO: Etiqueta activar audio",onClick:i}),d(de,{icon:"Volume",type:"button","aria-label":"TODO: Etiqueta activar audio",onClick:()=>{}})]})]})]}))};var vl=Object.defineProperty,wl=Object.defineProperties,yl=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable,so=(e,t,o)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,at=(e,t)=>{for(var o in t||(t={}))io.call(t,o)&&so(e,o,t[o]);if(Re)for(var o of Re(t))co.call(t,o)&&so(e,o,t[o]);return e},uo=(e,t)=>wl(e,yl(t)),gl=(e,t)=>{var o={};for(var r in e)io.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Re)for(var r of Re(e))t.indexOf(r)<0&&co.call(e,r)&&(o[r]=e[r]);return o};const po=Ye((e,t)=>{var o=e,{onChange:r,required:n,disabled:l,readOnly:a,name:i,native:s,indeterminate:p}=o,f=gl(o,["onChange","required","disabled","readOnly","name","native","indeterminate"]),c,b,u;const[h,m]=U((b=(c=f.defaultChecked)!=null?c:f.checked)!=null?b:!1),v=X(null);Y(()=>{var y;return m((y=f.checked)!=null?y:!1)},[f.checked]);const $=B(()=>{var y,_,C;return{bg:(y=f.background)!=null?y:void 0,color:(_=f.color)!=null?_:void 0,'&[aria-checked="false"]':{bg:(C=f.background)!=null?C:void 0,color:"transparent"}}},[f.background,f.color]);Z(()=>{v.current&&p!==void 0&&(v.current.indeterminate=p)},[p]);const O=B(()=>({variant:"forms.checkbox"}),[]);return s?d("input",at({type:"checkbox",onClick:f.onClick,"aria-checked":h,sx:O,ref:v,disabled:l,name:i,checked:h,onChange:y=>{f.checked===void 0&&m(y.target.checked),r&&r(y)},required:n,className:` ${(u=f.className)!=null?u:""} nativeCheckbox `},f)):L(ae,{children:[d($e,uo(at(uo(at({},f),{onClick:y=>{var _;a||xe(y.target,C=>C.type==="button")&&(f.onClick&&f.onClick(y),(_=v.current)==null||_.click())},type:"button"}),T("forms.customCheckbox")),{role:"checkbox","aria-checked":h,sx:$,ref:t,disabled:l,children:d(ot,{title:"",name:"Check",sx:{pointerEvents:"none",opacity:h?1:0},size:"32px"})})),d(ue,{type:"checkbox",sx:{display:"none"},ref:v,onClick:y=>{y.stopPropagation()},name:i,checked:h,onChange:y=>{f.checked===void 0&&m(y.target.checked),r&&r(y)},required:n,disabled:l})]})});po.displayName="Checkbox";var fo=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},it=(e,t,o)=>(fo(e,t,"read from private field"),o?o.call(e):t.get(e)),$l=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},Ol=(e,t,o,r)=>(fo(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o),te,ho;const mo=50,xl=new(ho=class{constructor(){this.focused=[],$l(this,te,[]),$n.on("focusHistory",()=>{console.info(this.focused)},"Muestra el historial de elementos que recibieron foco.")}offFocus(e){Ol(this,te,it(this,te).filter(t=>t!==e))}onFocus(e){return it(this,te).push(e),()=>{this.offFocus(e)}}inDocument(e){return e instanceof Function||e instanceof HTMLElement&&e.offsetParent!==null}set focus(e){this.focused=this.focused.filter(t=>this.inDocument(t)&&e!==t),this.focused.unshift(e),this.focused.length>mo&&(this.focused=this.focused.splice(0,mo)),it(this,te).forEach(t=>t())}get list(){return[...this.focused]}last(e,t=0){if(e)for(let o=t;o<=this.focused.length;o++){const r=this.focused[o],n=r?.id!==void 0?r:Bn(r)?r(!1):null;if(n&&this.inDocument(n)&&n.matches&&n.matches(e))return n}else return this.focused[this.focused.length-1];return null}},te=new WeakMap,ho);var ct=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},je=(e,t,o)=>(ct(e,t,"read from private field"),o?o.call(e):t.get(e)),Ee=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},oe=(e,t,o,r)=>(ct(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o),bo=(e,t,o)=>(ct(e,t,"access private method"),o),pe,re,fe,Le,st,vo;let Cl=class{constructor(){Ee(this,pe,!1),Ee(this,re,()=>{}),Ee(this,fe,()=>{})}get isLocked(){return je(this,pe)}destroy(){je(this,fe).call(this)}lock(){oe(this,pe,!0),je(this,re).call(this)}unlock(){oe(this,pe,!1),je(this,re).call(this)}onChange(t){return oe(this,re,t),()=>oe(this,re,()=>{})}onDestroy(t){return oe(this,fe,t),()=>oe(this,fe,()=>{})}};pe=new WeakMap,re=new WeakMap,fe=new WeakMap;const Sl=new(vo=class{constructor(){Ee(this,Le),this.lockers=[]}getLocker(){const e=new Cl;return e.onChange(()=>bo(this,Le,st).call(this)),e.onDestroy(()=>{this.lockers=this.lockers.filter(t=>t!==e),bo(this,Le,st).call(this)}),this.lockers.push(e),e}},Le=new WeakSet,st=function(){const e=this.lockers.filter(t=>t.isLocked).length>0;document.body.style.maxHeight="100vh",e&&document.body.scrollHeight>document.body.clientHeight&&(document.body.style.paddingRight="10px"),document.body.style.overflow=e?"hidden":"auto",e&&document.body.scrollHeight>document.body.clientHeight||(document.body.style.paddingRight="0px")},vo);function _l(e){Z(()=>{const t=Sl.getLocker();return e?t.lock():t.unlock(),()=>{t.destroy()}},[e])}var kl=Object.defineProperty,Pl=Object.defineProperties,Il=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,go=(e,t,o)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,$o=(e,t)=>{for(var o in t||(t={}))wo.call(t,o)&&go(e,o,t[o]);if(Ne)for(var o of Ne(t))yo.call(t,o)&&go(e,o,t[o]);return e},Oo=(e,t)=>Pl(e,Il(t)),Rl=(e,t)=>{var o={};for(var r in e)wo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ne)for(var r of Ne(e))t.indexOf(r)<0&&yo.call(e,r)&&(o[r]=e[r]);return o};const De=R.forwardRef((e,t)=>{var o=e,{children:r,className:n="",onExited:l,onOverlayClicked:a,isOpen:i=!1,shouldAvoidInitialFocusTrap:s,stretch:p,transitionDuration:f=150}=o,c=Rl(o,["children","className","onExited","onOverlayClicked","isOpen","shouldAvoidInitialFocusTrap","stretch","transitionDuration"]),b,u;const h=R.useRef(null),m=Ce(h,t);return _l(i),d(Wt,{in:i,timeout:f,onExited:l,classNames:"overlayAnimation",appear:!0,nodeRef:h,unmountOnExit:!0,children:d(x,Oo($o(Oo($o({className:`${n} overlay`,ref:m},c),{"data-type":"overlay",role:"presentation",onClick:R.useCallback(v=>{v.target===h.current&&a(v)},[a])}),T((b=c.variant)!=null?b:`layout.common.modals.overlay${p?"--stretch":""}`)),{children:d(Fn,{autoFocus:s?!1:void 0,returnFocus:!1,crossFrame:!1,disabled:((u=document.activeElement)==null?void 0:u.classList.contains("filter"))&&document.activeElement.tagName==="INPUT",children:r})}))})});De.displayName="Overlay";const jl=({className:e,close:t,hideCloseButton:o,id:r,NavBar:n,title:l=""})=>{const a=Hn(),i=d(hn,{as:"h3",sx:{wordBreak:"break-word",m:"0",flex:"2 0",color:"title"},className:"modal__title",id:r?`modal-${r}-title`:"",children:l}),s=w.useMemo(()=>o?null:d(Tt,{role:"button",type:"button","aria-label":window.BTN_CLOSE,onClick:t,title:window.BTN_CLOSE,sx:{mr:"unset"},className:"modal__closeButton"}),[t,o]),p=n&&d(x,{sx:{display:"flex",gap:Oe({0:2,1:"3px",2:2}),justifyContent:"end",flexDirection:Oe({0:"row",1:"column",3:"row"}),width:Oe({0:"auto",1:"100%",2:"auto"}),flexBasis:"max-content",height:"100%"},className:"modal__headerBar",children:n});return a>3?L(x,{className:e,sx:{display:"flex",flexDirection:"row",alignItems:"start",mb:G(0),justifyContent:"space-between",width:"100%",gap:G(2),flexWrap:"nowrap"},children:[i,p,s]}):L(x,{className:e,sx:{display:"flex",flexDirection:"column",alignItems:Oe({0:"center",2:"end"}),mb:G(0),justifyContent:"space-between",width:"100%",gap:G(2)},children:[L(x,{sx:{display:"flex",width:"100%"},children:[i,s]}),p]})};var El=Object.defineProperty,Ll=Object.defineProperties,Nl=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertySymbols,Dl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,Co=(e,t,o)=>t in e?El(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ut=(e,t)=>{for(var o in t||(t={}))Dl.call(t,o)&&Co(e,o,t[o]);if(xo)for(var o of xo(t))Tl.call(t,o)&&Co(e,o,t[o]);return e},So=(e,t)=>Ll(e,Nl(t));const dt=w.createContext({}),pt=Ye(({animationDuration:e=150,children:t=null,className:o,hideCloseButton:r,id:n,initialFocusConfiguration:l,initialFocusGetter:a,initialFocusRef:i,isOpen:s=!1,maxWidth:p,NavBar:f,noFocus:c,noHeader:b=!1,onClose:u=()=>{},onExited:h=()=>{},Portal:m,shouldCloseOnEsc:v=!0,shouldCloseOnOverlayClick:$=!0,size:O="md",stretch:y,title:_="",variant:C},k)=>{const[M,P]=U(s),j=w.useMemo(()=>`Modal${Kt()}`,[]);Z(()=>{P(s)},[s]);const g=N(()=>{P(!1),u()},[u]),[D,F]=w.useState(),W=Ce(F,k),H=K=>{$&&K.target.getAttribute("data-type")==="overlay"&&g()};Z(()=>{function K(ne){var ye;const le=[...document.querySelectorAll(".overlay")];return le.length>0&&((ye=le[le.length-1])==null?void 0:ye.id)===j&&ne.key==="Escape"?(ne.preventDefault(),ne.stopPropagation(),g(),!1):!0}return M&&v&&document.addEventListener("keydown",K,!1),()=>{document.removeEventListener("keydown",K,!1)}},[v,M,g,j]),w.useEffect(()=>{!c&&M&&D&&On.on(()=>a?a(D):i!=null&&i.current?(i?.current||D).querySelector(xn):D.querySelector(Cn(":not(.modal__closeButton)")),So(ut({},l),{focusEvenWhenScreenLocked:!0}))},[D]);const I=w.useMemo(()=>m??w.Fragment,[]),z=X(null);return d(dt.Provider,{value:w.useMemo(()=>({descriptionId:`${j}_Description`}),[j]),children:d(I,{children:d(De,{onOverlayClicked:H,isOpen:s,className:o,stretch:y,ref:W,onExited:h,id:j,shouldAvoidInitialFocusTrap:c,children:d(Wt,{in:s,timeout:e,classNames:"modal",appear:!0,unmountOnExit:!0,nodeRef:z,children:d(x,So(ut({ref:z,className:"modal__variantWrapper"},C?T(C):{}),{children:L(x,{id:n,role:"dialog","aria-modal":"true","aria-label":_,"aria-describedby":`${j}_Description`,"aria-hidden":"false",className:"modal__main","data-scroll-lock-scrollable":!0,sx:w.useMemo(()=>ut({variant:`layout.common.modals.${O}`},p!==void 0?{maxWidth:p}:{}),[p,O]),"data-variant":`layout.common.modals.${O}`,children:[!b&&d(jl,{className:"modal__header",NavBar:f,title:_,close:g,hideCloseButton:r,id:`${j}_Header`}),d(x,{className:"modal__content",id:typeof t=="string"?`${j}_Description`:void 0,children:t})]})}))})})})})});pt.displayName="Modal";var Ml=Object.defineProperty,Bl=Object.defineProperties,Al=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,_o=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,Po=(e,t,o)=>t in e?Ml(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Fl=(e,t)=>{for(var o in t||(t={}))_o.call(t,o)&&Po(e,o,t[o]);if(Te)for(var o of Te(t))ko.call(t,o)&&Po(e,o,t[o]);return e},Hl=(e,t)=>Bl(e,Al(t)),Kl=(e,t)=>{var o={};for(var r in e)_o.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Te)for(var r of Te(e))t.indexOf(r)<0&&ko.call(e,r)&&(o[r]=e[r]);return o};const ft=w.forwardRef((e,t)=>{var o=e,{handleClickDay:r,onCancel:n,calValue:l,locale:a,size:i}=o,s=Kl(o,["handleClickDay","onCancel","calValue","locale","size"]);return d(pt,Hl(Fl({noHeader:!0,size:i??"cal",shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,ref:t},s),{initialFocusGetter:p=>p?.querySelector(".react-calendar__tile--active"),children:d(An,{onClickDay:r,locale:a,value:l??new Date,nextLabel:"\u203A",next2Label:"\xBB",prevLabel:"\u2039",prev2Label:"\xAB"})}))});ft.displayName="CalendarModal";var Wl=Object.defineProperty,ql=Object.defineProperties,zl=Object.getOwnPropertyDescriptors,Io=Object.getOwnPropertySymbols,Ul=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable,Ro=(e,t,o)=>t in e?Wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Gl=(e,t)=>{for(var o in t||(t={}))Ul.call(t,o)&&Ro(e,o,t[o]);if(Io)for(var o of Io(t))Vl.call(t,o)&&Ro(e,o,t[o]);return e},Xl=(e,t)=>ql(e,zl(t));function jo(e){var t,o,r;const[n,l]=w.useState(!1),[a,i]=w.useState((r=(o=(t=e?.portalArgs)==null?void 0:t.defaultShow)!=null?o:e?.isDefaultOpen)!=null?r:!1),{Portal:s,hide:p,show:f}=Kn(Xl(Gl({},e?.portalArgs),{containerId:"AppModals",autoRemoveContainer:!1,escToHide:!1,clickOutsideToHide:!1,defaultShow:!1,internalShowHide:!1})),c=w.useCallback(()=>{i(!1)},[]),b=w.useCallback(()=>{e!=null&&e.preFetcher?(l(!0),e.preFetcher().then(()=>{i(!0),l(!1)}).catch(console.error)):i(!0)},[e]),u=w.useCallback(()=>{i(!1),e!=null&&e.onClose&&e.onClose()},[e]),h=w.useCallback(()=>{p(),e!=null&&e.onExited&&e.onExited()},[e,p]),m=w.useMemo(()=>({isLoading:n,show:b}),[n,b]);return Y(()=>{a?(e!=null&&e.onOpen&&e.onOpen(),f()):u?.()},[a]),{hide:c,isLoading:n,isOpen:a,onClose:u,onExited:h,openModalContextValue:m,Portal:s,show:b}}var Yl=Object.defineProperty,Jl=Object.defineProperties,Ql=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Zl=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,Lo=(e,t,o)=>t in e?Yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ta=(e,t)=>{for(var o in t||(t={}))Zl.call(t,o)&&Lo(e,o,t[o]);if(Eo)for(var o of Eo(t))ea.call(t,o)&&Lo(e,o,t[o]);return e},oa=(e,t)=>Jl(e,Ql(t));const No=({children:e,className:t})=>d(x,oa(ta({className:`${t??""} buttonsBar`},T("layout.common.modals.buttonsBar")),{children:e}));var ra=Object.defineProperty,na=Object.defineProperties,la=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,To=(e,t,o)=>t in e?ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Mo=(e,t)=>{for(var o in t||(t={}))aa.call(t,o)&&To(e,o,t[o]);if(Do)for(var o of Do(t))ia.call(t,o)&&To(e,o,t[o]);return e},Bo=(e,t)=>na(e,la(t));function ca(e){return e?.querySelector('button[type="submit"]')}Ze("layout.common.modals.confirm",{display:"flex",flexDirection:"column",gap:G(4),width:"100%",".confirm__content":{overflow:"auto",flexBasis:"100%",wordBreak:"break-word",display:"flex",flexDirection:"column"},".confirm__buttonBar":{display:"flex",justifyContent:"space-between",flexBasis:"40px",flexGrow:0,flexShrink:0,".confirm__defaultButtons":{display:"flex",gap:G(3)},".confirm__customButtons":{width:"auto"}}});const sa=({additionalButtons:e,additionalButtonsOnRight:t,children:o,confirmButtonText:r=window.BTN_CONFIRM,cancelButtonText:n=window.BTN_CANCEL,confirmButtonVariant:l="primary",disabled:a,hideCancelButton:i,hideConfirmButton:s,onConfirm:p,onCancel:f,isLoading:c,contentRef:b,className:u,variant:h})=>{const{descriptionId:m}=R.useContext(dt);return L(x,Bo(Mo({},T(h??"layout.common.modals.confirm")),{className:`${u??""} confirm`,children:[d(x,{ref:b,className:"confirm__content",id:m,children:o}),L(No,{className:"confirm__buttonBar",children:[d(x,{className:"confirm__customButtons",onClick:R.useCallback(v=>{xe(v.target,$=>$.tagName==="BUTTON")&&f?.(v)},[f]),children:e}),L(x,{className:"confirm__defaultButtons",children:[d(x,{className:"confirm__customButtonsOnRight",onClick:R.useCallback(v=>{xe(v.target,$=>$.tagName==="BUTTON")&&f?.(v)},[f]),children:t}),!s&&d(Ie,{onClick:p,title:r,variant:l,disabled:c??a,isLoading:c,className:"confirm__confirmButton",type:"submit",children:r}),f&&!i&&d(Ie,Bo(Mo({onClick:f,title:n},T("secondary")),{disabled:c,className:"confirm__cancelButton",children:n}))]})]})]}))},Ao=()=>{const e=mn();return d(x,{sx:{"*":{height:"6.5px !important"}},children:d(x,{sx:{zIndex:"tooltip",position:"fixed",top:0,left:0,right:0},className:"linearLoader",children:d(qn,{width:"100%",color:Wn(e.theme,"palette.primary.main")})})})};var ua=Object.defineProperty,da=Object.defineProperties,pa=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,fa=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,Ho=(e,t,o)=>t in e?ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ko=(e,t)=>{for(var o in t||(t={}))fa.call(t,o)&&Ho(e,o,t[o]);if(Fo)for(var o of Fo(t))ha.call(t,o)&&Ho(e,o,t[o]);return e},Wo=(e,t)=>da(e,pa(t));const ma=()=>{const e=w.useRef(null),[t,o]=U(!1),[r,n]=U({common:!1,forced:!1,linear:!1,white:!1});w.useEffect(()=>{const a=[At.on("lockStateChange",i=>{n(s=>Wo(Ko({},s),{[i.lockName]:i.isLocked})),o(i.hasReleasedFirstTime)}),At.on("forcedStateChange",i=>{n(s=>Wo(Ko({},s),{forced:i.isForced})),o(i.hasReleasedFirstTime)})];return()=>a.forEach(i=>i())},[]);const l=w.useMemo(()=>({backgroundColor:"transparent","&:not(body.editionForm *)":{backgroundColor:r.linear?"transparent":t?"palette.background.overlay":"palette.background.default"}}),[r.linear,t]);return!r.linear&&!r.common&&!r.white&&!r.forced?null:d(x,{children:L(De,{isOpen:!0,onExited:()=>{},onOverlayClicked:()=>{},sx:l,className:`${t?"":"not-released"} screenLock`,transitionDuration:t?void 0:0,children:[r.linear?d(Ao,{}):d(se,{ref:e,sx:{"*":{color:"primary"}}}),d(x,{tabIndex:0,title:window.WAIT_A_SECOND})]})})},qo=({children:e,name:t})=>{const[o,r]=R.useState(null);return R.useEffect(()=>{if(e){const n=new CustomEvent(rt.focus,{bubbles:!0});o?.dispatchEvent(n)}},[e,o]),e?d(x,{ref:r,role:"alert","data-testid":t?`err_${t}`:null,sx:{mb:"0",color:"danger",pt:"2"},children:e}):null};var ba=Object.defineProperty,va=Object.defineProperties,wa=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Vo=(e,t,o)=>t in e?ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,he=(e,t)=>{for(var o in t||(t={}))zo.call(t,o)&&Vo(e,o,t[o]);if(Me)for(var o of Me(t))Uo.call(t,o)&&Vo(e,o,t[o]);return e},Go=(e,t)=>va(e,wa(t)),Xo=(e,t)=>{var o={};for(var r in e)zo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Me)for(var r of Me(e))t.indexOf(r)<0&&Uo.call(e,r)&&(o[r]=e[r]);return o};const Yo=e=>{var t=e,{additionalButtons:o,buttonProps:r,buttonRef:n,className:l,disabled:a,hideButton:i,icon:s="Search",inputProps:p,inputRef:f,isLoading:c,mask:b,onClick:u,onBlur:h,readOnly:m}=t,v=Xo(t,["additionalButtons","buttonProps","buttonRef","className","disabled","hideButton","icon","inputProps","inputRef","isLoading","mask","onClick","onBlur","readOnly"]);const $=p??{},{sx:O}=$,y=Xo($,["sx"]),_=w.useRef(null),C=Ce(n,_),k=w.useRef(null),M=Ce(f,k),[P,j]=w.useState(null),g=w.useCallback(D=>{h&&(!D.relatedTarget||D.relatedTarget&&!V(D.relatedTarget,F=>F===P))&&h(D)},[h,P]);return L(x,Go(he({},T("forms.iconInput")),{className:`${l??""} iconInput`,ref:j,children:[d(zn,Go(he(he({mask:b??"",onBlur:g,disabled:c??a,ref:M,readOnly:m,sx:he({variant:"forms.input"},O),"data-variant":"forms.input"},v),y),{maxLength:b||p==null?void 0:p.maxLength})),o,!i&&d(de,he({onBlur:g,onClick:u,icon:s,disabled:m??a,isLoading:c,ref:C},r))]}))},Be=e=>({borderLeftStyle:e?null:"solid",borderLeftWidth:e?null:"4px",borderLeftColor:e?void 0:"danger"}),ya=e=>({borderStyle:e?"solid":null,borderWidth:e?"1px":null,borderColor:e?"orange":void 0});var ga=Object.defineProperty,$a=Object.defineProperties,Oa=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,Zo=(e,t,o)=>t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Fe=(e,t)=>{for(var o in t||(t={}))Jo.call(t,o)&&Zo(e,o,t[o]);if(Ae)for(var o of Ae(t))Qo.call(t,o)&&Zo(e,o,t[o]);return e},ht=(e,t)=>$a(e,Oa(t)),er=(e,t)=>{var o={};for(var r in e)Jo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ae)for(var r of Ae(e))t.indexOf(r)<0&&Qo.call(e,r)&&(o[r]=e[r]);return o};const xa=window.LANG_CODE,mt="_",me=Sn(),bt=()=>me==="YYYY/MM/DD"?"9999/99/99":"99/99/9999",vt=w.forwardRef((e,t)=>{var o=e,{allowPickBeforeToday:r,buttonProps:n,className:l,error:a,getCustomMask:i,isLoading:s,onBlur:p,onChange:f,onDelete:c,onError:b,renderLabel:u,value:h}=o,m=er(o,["allowPickBeforeToday","buttonProps","className","error","getCustomMask","isLoading","onBlur","onChange","onDelete","onError","renderLabel","value"]);const v=w.useMemo(Kt,[]),[$,O]=w.useState(h??""),[y,_]=w.useState(),C=w.useRef(null),k=jo({preFetcher(){return xl.focus=()=>{var S;return(S=C.current)==null?void 0:S.querySelector(".iconButton")},new Promise(S=>{let q=ee($,me);q.isValid()||(q=ee(new Date)),_(q.toDate()),S()})}}),{show:M,hide:P}=k,j=er(k,["show","hide"]),[g,D]=w.useState(a??null),F=w.useRef(h??"");Y(()=>{O(h??""),F.current=h},[h]),Y(()=>{D(a??null)},[a]),Y(()=>{b&&b(g)},[g]);const W=w.useCallback(S=>S!==F.current&&f?(F.current=S,f(S)):!0,[f]),H=w.useCallback((S,q)=>{if(S===""){W(""),O("");return}let Q;S!==""?(Q=ee(S,me),Q.isValid()||(Q=ee(new Date))):Q=ee(new Date);const Xe=Q.format(me),Et=new Date;if(Et.setHours(0,0,0,0),Xe!==$&&q!==!0)W(""),O(""),D(window.MSG_INVALID_DATE);else if(r===!1&&Q.isBefore(Et))W(""),O(""),D(window.MSG_FEC_FIN_MAY_FEC_INI);else{const ge=W(S===""?"":Xe);ge===!1?(O(ge||""),D(null)):typeof ge=="string"?(O(""),D(ge)):(O(Xe),D(null))}},[r,$,W]),I=w.useCallback(S=>{P();const q=ee(S).format(me);H(q,!0)},[P,H]),z=w.useCallback(()=>{P()},[P]),K=w.useCallback(S=>{p&&!V(S.relatedTarget,q=>q.id===`DateModal${v}`||q.id===`DateInput${v}`)&&p(S)},[v,p]),ne=w.useMemo(()=>ht(Fe({},m),{className:"dateInput",value:u?u($):$,ref:t,onChange:S=>{O(S.target.value),bt().replaceAll("9",mt)!==S.target.value&&S.target.value!==""&&D(null)},onBlur:S=>{m.readOnly||i||H(S.target.value),K(S)},onKeyDown:S=>{S.key==="Enter"&&H($)}}),[i,K,$,m,t,u,H]),ye=w.useMemo(()=>{var S;return Fe({disabled:(S=m.disabled)!=null?S:m.readOnly,"aria-label":window.LBL_PICK_DATE},n)},[n,m.disabled,m.readOnly]),le=w.useMemo(()=>d(Tt,{className:"delete_date_button",onClick:()=>{var S;H(""),c?.(),(S=document.querySelector(`#DateInput${v} input`))==null||S.focus()},type:"button"}),[v,c,H]);return L(ae,{children:[d(ft,ht(Fe({},j),{calValue:y,locale:xa,handleClickDay:I,onCancel:z,id:`DateModal${v}`})),L(x,ht(Fe({},T("forms.dateInput")),{className:`${l??""} dateInput`,id:`DateInput${v}`,ref:C,children:[d(Yo,{additionalButtons:$&&$!==bt().replaceAll("9",mt)&&!m.readOnly&&!m.disabled?le:void 0,isLoading:s,maskPlaceholder:mt,mask:i?i():bt(),icon:Bt.Calendar,onBlur:K,buttonProps:ye,inputProps:ne,readOnly:m.readOnly,sx:Be(g===null),onClick:M}),g&&d(qo,{children:g})]}))]})});vt.displayName="DateInput";var Ca=Object.defineProperty,Sa=Object.defineProperties,_a=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,tr=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,rr=(e,t,o)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ka=(e,t)=>{for(var o in t||(t={}))tr.call(t,o)&&rr(e,o,t[o]);if(He)for(var o of He(t))or.call(t,o)&&rr(e,o,t[o]);return e},Pa=(e,t)=>Sa(e,_a(t)),Ia=(e,t)=>{var o={};for(var r in e)tr.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&He)for(var r of He(e))t.indexOf(r)<0&&or.call(e,r)&&(o[r]=e[r]);return o};function wt(e){return Array(Math.max(0,e)).fill(0).join("")}function Ra(e){const t=String(e);return`${wt(3-t.length)}${String(e)}`}const yt=Number(window.AMOUNT_DECIMAL_SEPARATOR),ja=Number(window.AMOUNT_DECIMAL_ZEROS),Ke=window.CHAR_DECIMAL_SEPARATOR,be=window.CHAR_THOUS_SEPARATOR,nr=be==="."?"\\.":be,lr=Ke==="."?"\\.":Ke;function Ea(e){return Number.parseFloat(e.replaceAll(be,"").replaceAll(Ke,"."))}function La(e){var t;const o=String(e).match(/(-?)(\d+)(?:\.(\d+))/);if(!o)return"";const r=!!o[1],n=o[2],l=o[3],a=l?`${lr}${l}`:"";return(t=ar(`${r?"-":""}${n}${a}`))!=null?t:""}function ar(e,t=!1){var o,r,n,l;const a=e.match(new RegExp(`^(-)?((?:(?:\\d{1,3})${nr}(?:\\d{3}${nr})*(?:\\d{3}))?|(?:\\d*))(?:(?:${lr})(\\d+))?$`));if(!a)return null;const i=!!a[1];let s=Number(a[2].replaceAll(be,""));const p=t?a[3]:(r=(o=a[3])==null?void 0:o.slice(0,yt+1))!=null?r:"";let f;if(t)f=p;else{const b=(l=(n=(p?`${String(Math.round(+`${p}${wt(yt-p.length)}`/1))}`:"").slice(0,yt).match(/(\d*[1-9])0*/))==null?void 0:n[1])!=null?l:"";f=`${b}${wt(ja-b.length)}`}const c=[];for(;s>=1e3;){s/=1e3;const b=Math.trunc(s);c.unshift(Ra(Math.round((s-b)*1e3))),s=b}return c.unshift(String(s)),`${i?"-":""}${c.join(window.ADD_THOUSAND_SEPARATOR?window.CHAR_THOUS_SEPARATOR:"")}${f.length>0?`${Ke}${f}`:""}`}const gt=w.forwardRef((e,t)=>{var o=e,{value:r,avoidDecimalRestriction:n}=o,l=Ia(o,["value","avoidDecimalRestriction"]);const[a,i]=w.useState(""),[s,p]=w.useState(""),f=w.useRef(""),c=w.useCallback(b=>{var u,h,m;if(b===""){if(b===f.current)return;i(""),p(""),(u=l.onChange)==null||u.call(l,{value:"",error:!1})}else{const v=ar(b,n);if(v===null)i(""),p(""),(h=l.onChange)==null||h.call(l,{value:"",error:!0});else{if(b===f.current)return;i(b),p(v),(m=l.onChange)==null||m.call(l,{value:v,error:!1})}}f.current=b},[n,l]);return w.useEffect(()=>{r!==a&&c(r??"")},[r]),d(ue,Pa(ka({},l),{onFocus:w.useCallback(b=>{var u;(u=l.onFocus)==null||u.call(l,b),p(String(a).replaceAll(be,""))},[a,l]),onBlur:w.useCallback(b=>{c(b.target.value)},[c]),onChange:w.useCallback(b=>{p(b.target.value)},[]),type:"text",ref:t,value:s}))});gt.displayName="NumberInput";const Na=({isFormReadonly:e=!1,isRequired:t=!1,isReadonly:o=!1})=>t&&!o&&!e?d("abbr",{className:"required",title:_n("MSG_REQ_FIELD").text,children:"*"}):null,Da=({filter:e,onChange:t,onBlur:o,onPressEnter:r},n)=>{const[l,a]=R.useState(String(e.currentValue)),[i,s]=R.useState(String(e.currentValue)),p=R.useCallback(f=>{f.stopPropagation()},[]);return Un(()=>{a(e.currentValue)},[e.currentValue]),d(vt,{value:l,sx:Be(!e.error),"aria-label":e.toolTip,ref:n,placeholder:e.placeholder,onChange:f=>{if(t){const c=t(String(f));return c===!0?(a(f),!0):c}return!1},onClick:p,onBlur:()=>{l!==i&&o&&(s(l),a(l),o(l))},onKeyDown:f=>{f.key.toLowerCase()==="enter"&&r&&(s(l),r(l))}})},Ta=R.forwardRef(Da);var Ma=Object.defineProperty,Ba=Object.defineProperties,Aa=Object.getOwnPropertyDescriptors,ir=Object.getOwnPropertySymbols,Fa=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,cr=(e,t,o)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,sr=(e,t)=>{for(var o in t||(t={}))Fa.call(t,o)&&cr(e,o,t[o]);if(ir)for(var o of ir(t))Ha.call(t,o)&&cr(e,o,t[o]);return e},ur=(e,t)=>Ba(e,Aa(t));const Ka=({filter:e,onChange:t,onBlur:o,onPressEnter:r},n)=>{var l,a,i,s,p,f,c,b,u,h,m,v,$,O,y;const[_,C]=R.useState((l=e.currentValue)!=null?l:""),k=R.useCallback(g=>{g.stopPropagation()},[]),[M,P]=R.useState(e.currentValue),j=e?.currentValue;if(R.useEffect(()=>{j===""&&(C(String(j)),P(String(j)))},[e?.deleteFiltersTimestamp]),e){const g=I=>{(t&&t(String(I.target.value))!==!1||!t)&&C(String(I.target.value))},D=I=>{(t&&t(String(I.value))!==!1||!t)&&C(String(I.value))},F=I=>{o&&M!==_&&(P(_),o(I.target.value))},W=e.sortCombo?[...(a=e.options)!=null?a:[]].sort((I,z)=>I.label>z.label?1:-1):e.options,H=W?.map(I=>{var z,K;return d("option",{value:I.value,children:I.label},(K=(z=I.value)!=null?z:I.label)!=null?K:" ")});return e.type==="date"||e.type==="D"?d(Ta,{filter:e,onChange:t,onBlur:o,onPressEnter:r,ref:n}):e.type==="apiaNumber"?d(gt,ur(sr({"aria-readonly":e.readonly,readOnly:e.readonly,value:_,placeholder:e.placeholder,onChange:D,onKeyDown:I=>{I.key.toLowerCase()==="enter"&&(F(I),r&&r(I.target.value))},onClick:k},T("input")),{className:`filter ${e.error?"requiredFilter__Border":""}`,title:(s=(i=e.title)!=null?i:e.toolTip)!=null?s:String(e.id),ref:n,"aria-label":(f=(p=e.title)!=null?p:e.toolTip)!=null?f:String(e.id),name:e.id})):e.options?d(bn,{"aria-readonly":e.readonly,disabled:e.readonly,onChange:g,onBlur:F,value:_,className:`"filter" ${e.error?"requiredFilter__Border":""}`,title:(b=(c=e.title)!=null?c:e.toolTip)!=null?b:String(e.id),ref:n,"aria-label":(h=(u=e.title)!=null?u:e.toolTip)!=null?h:String(e.id),onClick:k,placeholder:e.placeholder,sx:Be(!e.error),name:e.id,children:H}):d(ue,ur(sr({"aria-readonly":e.readonly,readOnly:e.readonly,value:_,type:(m=e.type==="N"?"number":e.type)!=null?m:"text",placeholder:e.placeholder,onChange:g,onBlur:F,onKeyDown:I=>{I.key.toLowerCase()==="enter"&&(F(I),r&&r(I.target.value))},onClick:k},T("input")),{className:`filter ${e.error?"requiredFilter__Border":""}`,title:($=(v=e.title)!=null?v:e.toolTip)!=null?$:String(e.id),ref:n,"aria-label":(y=(O=e.title)!=null?O:e.toolTip)!=null?y:String(e.id),name:e.id}))}return null},Wa=R.memo(R.forwardRef(Ka)),qa={};var za=Object.defineProperty,Ua=Object.defineProperties,Va=Object.getOwnPropertyDescriptors,dr=Object.getOwnPropertySymbols,Ga=Object.prototype.hasOwnProperty,Xa=Object.prototype.propertyIsEnumerable,pr=(e,t,o)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,fr=(e,t)=>{for(var o in t||(t={}))Ga.call(t,o)&&pr(e,o,t[o]);if(dr)for(var o of dr(t))Xa.call(t,o)&&pr(e,o,t[o]);return e},hr=(e,t)=>Ua(e,Va(t));Ze("layout.common.components.collapsiblePanel",qa);const mr=w.forwardRef(({children:e,className:t,closedIcon:o="ArrowDown",collapsed:r,defaultCollapsed:n,disableChildrenFocus:l,iconSize:a="iconXs",id:i,onClose:s,onOpen:p,openIcon:f="ArrowRight",label:c,titleButtons:b,minHeight:u=0},h)=>{var m;const v=`${w.useMemo(()=>Ht(),[])}_${i??"collapsiblePanel"}`,[$,O]=w.useState((m=n??r)!=null?m:nt[`collapsiblePanel${v}`]),[y,_]=w.useState(null),C=w.useCallback((k,M)=>{const P=p?p(M):null;P?P.then(j=>{j&&k&&O(g=>!g)}):k&&O(j=>!j)},[p]);return Y(()=>{r!==void 0&&O(r),r===!1&&C(!1)},[r]),Y(()=>{$?(s&&s(),nt[`collapsiblePanel${v}`]=!0,y&&l&&kn(y.querySelector(".collapsiblePanel__content"))):(nt[`collapsiblePanel${v}`]=!1,y&&l&&Pn(y.querySelector(".collapsiblePanel__content")))},[$]),w.useEffect(()=>{var k;const M=()=>O(!1);return(k=y?.querySelector(".collapsiblePanel__content"))==null||k.addEventListener(rt.focus,M),()=>{var P;(P=y?.querySelector(".collapsiblePanel__content"))==null||P.removeEventListener(rt.focus,M)}},[i,$,s,p,y]),L(x,hr(fr({className:`collapsiblePanel ${t??""}`},T("layout.common.components.collapsiblePanel")),{ref:k=>{Mn(h)&&h(k),_(k)},children:[L(x,{className:"collapsiblePanel__label",children:[L($e,hr(fr({},T("inherit")),{"aria-expanded":!$,onClick:k=>C(!0,k),type:"button",className:"collapsiblePanel__label__button",onKeyDown:console.log,children:[$?d(ot,{title:"",icon:f,size:a}):d(ot,{title:"",icon:o,size:a}),c]})),b]}),d(Vn,{id:v,duration:150,height:$?u:"auto",sx:{"&>div":{display:"block "}},"aria-hidden":$,className:"collapsiblePanel__content",children:e})]}))});mr.displayName="CollapsiblePanel";var Ya=Object.defineProperty,Ja=Object.defineProperties,Qa=Object.getOwnPropertyDescriptors,br=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable,vr=(e,t,o)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,$t=(e,t)=>{for(var o in t||(t={}))Za.call(t,o)&&vr(e,o,t[o]);if(br)for(var o of br(t))ei.call(t,o)&&vr(e,o,t[o]);return e},wr=(e,t)=>Ja(e,Qa(t));function E(e){return`row_${typeof e=="number"?e:e.rowIndex}`}let ti=0;function yr(e){return`${e??""}${ti++}`}function oi(e){return{listbox:[(t,o)=>({etc:{"aria-activedescendant":`${e}__row__${o.focusedRow}`}})],row:[(t,o)=>({classList:{add:["listbox__row",o.focusedRow===t.rowIndex?"focused":"",o.allowSelection&&o.selectedRows.includes(t.rowIndex)?"selected":""],remove:[o.focusedRow===t.rowIndex?"":"focused",o.allowSelection&&o.selectedRows.includes(t.rowIndex)?"":"selected"]},dataset:{add:{focused:o.focusedRow===t.rowIndex}},etc:wr($t({},o.allowSelection?{"aria-selected":o.selectedRows.includes(t.rowIndex)}:null),{id:`${e}__row__${t.rowIndex}`})}),(t,o)=>{const r=document.querySelector(`#${e} .listbox__row[data-focused="true"]`);if(r&&(r.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t.focusedRow>o.focusedRow)){const n=Ft(r);if(n&&n!==document.body){n.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const l=r.getBoundingClientRect(),a=n.getBoundingClientRect();l.top-a.top<l.height&&(n.scrollTop-=l.height)}}}],searchbox:[(t,o)=>({classList:{add:["listbox__searchbox"]},etc:{"aria-activedescendant":`${e}__row__${o.focusedRow}`}})]}}const ri={allowSelection:!0,focusedRow:0,hiddenRows:[],isEverythingSelected:!1,isMultipleSelection:!1,lastSelectedRow:-1,rowsCount:0,selectedRows:[],typing:null},ni={row:E,listbox:()=>"listbox",searchbox:()=>"searchbox"};function li(e){var t,o,r;return wr($t($t({},ri),e),{searchFunction:(t=e.searchFunction)!=null?t:(n,l)=>!!n.match(new RegExp(l)),startsWithFunction:(o=e.startsWithFunction)!=null?o:(n,l)=>n.startsWith(l),shownRows:new Array((r=e.rowsCount)!=null?r:0).fill(1).map((n,l)=>l)})}const We=Je({});var ai=Object.defineProperty,ii=Object.defineProperties,ci=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Or=(e,t,o)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ot=(e,t)=>{for(var o in t||(t={}))gr.call(t,o)&&Or(e,o,t[o]);if(qe)for(var o of qe(t))$r.call(t,o)&&Or(e,o,t[o]);return e},xt=(e,t)=>ii(e,ci(t)),si=(e,t)=>{var o={};for(var r in e)gr.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&qe)for(var r of qe(e))t.indexOf(r)<0&&$r.call(e,r)&&(o[r]=e[r]);return o};const ze=Qe(e=>{var t=e,{children:o,rowIndex:r,label:n}=t,l=si(t,["children","rowIndex","label"]);const{getState:a,listboxActions:i,onDoubleClickNode:s,onClickNode:p,useListbox:f}=ie(We),c=B(()=>r??-1,[r]),b=f("row",{rowIndex:c});return d("li",xt(Ot({},l),{ref:b,role:"option",onDoubleClick:N(u=>{u.preventDefault(),s?.(xt(Ot({},u),{target:u.target.closest('[role="option"]')}))},[s]),onMouseDown:N(u=>{p?.(xt(Ot({},u),{target:u.target.closest('[role="option"]')})),(a().isMultipleSelection&&u.shiftKey||u.detail>1)&&u.preventDefault(),i.updateFocusByClickEvent({rowIndex:c,isCtrlKey:u.ctrlKey,isShiftKey:u.shiftKey})},[a,i,p,c]),"aria-label":n,title:n,children:o}))});ze.displayName="ListboxItem";var ui=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},xr=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},Ct=(e,t,o)=>(ui(e,t,"access private method"),o),Ue,St,_t,Cr;let Sr=class extends In{constructor(t){super(),xr(this,Ue),xr(this,_t),this.frequency=2.5,this.timeout=0,this.typing="";const{onMultipleKeys:o,onSingleKey:r,onTypeUpdate:n}=t??{};o&&this.on("multipleKeys",o),r&&this.on("singleKey",r),n&&this.on("typeUpdate",n)}type(t){t.key.match(/^[\p{L}\d ]$/u)?(t.preventDefault(),this.typing=this.typing+t.key,this.emit("typeUpdate",this.typing),Ct(this,Ue,St).call(this)):t.code==="Backspace"&&(t.preventDefault(),this.typing=this.typing.slice(0,-1),this.emit("typeUpdate",this.typing),Ct(this,Ue,St).call(this))}};Ue=new WeakSet,St=function(){clearTimeout(this.timeout),this.timeout=setTimeout(Ct(this,_t,Cr).bind(this),1e3/this.frequency)},_t=new WeakSet,Cr=function({clear:e}={clear:!0}){this.typing.length===1?this.emit("singleKey",this.typing):this.typing.length>1&&this.emit("multipleKeys",this.typing),e&&(this.typing="")};var di=Object.defineProperty,pi=Object.defineProperties,fi=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,hi=Object.prototype.hasOwnProperty,mi=Object.prototype.propertyIsEnumerable,kr=(e,t,o)=>t in e?di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,kt=(e,t)=>{for(var o in t||(t={}))hi.call(t,o)&&kr(e,o,t[o]);if(_r)for(var o of _r(t))mi.call(t,o)&&kr(e,o,t[o]);return e},Pt=(e,t)=>pi(e,fi(t));const bi=({children:e,className:t})=>{const{listboxActions:o,id:r,getState:n,onConfirmSelection:l,onPressEnterOnNode:a,onPressKeyOnNode:i,variant:s}=ie(We),p=B(()=>n().showSearchbox?null:new Sr({onMultipleKeys(c){o.searchElementsByStartingCharacters({characters:c})},onSingleKey(c){o.searchElementsByStartingCharacters({characters:c})}}),[n,o]),f=N(c=>{l?.({originalEvent:c,selectedElements:n().allowSelection?n().selectedRows.map(b=>document.querySelector(`#${r}__row__${b}`)):[],focusedElement:document.querySelector(`#${r}__row__${n().focusedRow}`)})},[n,r,l]);return d(x,Pt(kt({},T(s)),{className:t,id:r,onKeyDown:N(c=>{var b;const u=(b=c.target.closest(".listbox"))==null?void 0:b.querySelector(".listbox__row.focused");if(!u)throw new Error("There is no cell on keydown event, it must be an error.");const h=n();if(i?.(Pt(kt({},c),{target:u,currentTarget:u})),c.code==="Enter"&&a?.(Pt(kt({},c),{target:u,currentTarget:u})),!(c.isDefaultPrevented()||c.isPropagationStopped()))if(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","PageUp","PageDown"].includes(c.code)||["Home","End"].includes(c.code)&&c.ctrlKey||["Space"].includes(c.code)&&h.isMultipleSelection&&!h.showSearchbox||["Enter"].includes(c.code)&&h.isMultipleSelection||["KeyA"].includes(c.code)&&h.isMultipleSelection&&c.ctrlKey)switch(c.preventDefault(),c.code){case"KeyA":o.selectAll();break;case"ArrowRight":case"ArrowDown":o.moveFocusAndToggleSelection({which:"next",isShiftKey:c.shiftKey});break;case"ArrowLeft":case"ArrowUp":o.moveFocusAndToggleSelection({which:"previous",isShiftKey:c.shiftKey});break;case"Home":o.moveFocusAndToggleSelection({which:"first",isShiftKey:c.shiftKey});break;case"End":o.moveFocusAndToggleSelection({which:"last",isShiftKey:c.shiftKey});break;case"Enter":if(c.ctrlKey){f(c);break}case"Space":o.updateFocusBySpaceEvent({isShiftKey:c.shiftKey});break;case"PageUp":o.moveFocusAndToggleSelection({which:"pageUp",isShiftKey:c.shiftKey});break;case"PageDown":o.moveFocusAndToggleSelection({which:"pageDown",isShiftKey:c.shiftKey});break}else c.code==="Enter"&&(!h.allowSelection||!h.isMultipleSelection)?f(c):p&&p.type(c)},[n,o,a,i,f,p]),children:e}))};var vi=Object.defineProperty,wi=Object.defineProperties,yi=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Rr=(e,t,o)=>t in e?vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,gi=(e,t)=>{for(var o in t||(t={}))Pr.call(t,o)&&Rr(e,o,t[o]);if(Ve)for(var o of Ve(t))Ir.call(t,o)&&Rr(e,o,t[o]);return e},$i=(e,t)=>wi(e,yi(t)),Oi=(e,t)=>{var o={};for(var r in e)Pr.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Ve)for(var r of Ve(e))t.indexOf(r)<0&&Ir.call(e,r)&&(o[r]=e[r]);return o};const xi=e=>{var t=e,{children:o}=t,r=Oi(t,["children"]);const{id:n,listboxActions:l,useListbox:a}=ie(We),i=Rn(p=>{l.filter({searchString:p.target.value})}),s=a("searchbox",null);return L(ae,{children:[d(ue,{ref:s,type:"text",id:`${n}__searchbox`,placeholder:"Search...","aria-autocomplete":"list","aria-controls":`${n}__list__container`,role:"combobox","aria-expanded":!0,"aria-haspopup":"listbox",onChange:i,autoComplete:"off"}),d(x,$i(gi({as:"ul",id:`${n}__list__container`,role:"listbox",className:"listbox__list"},r),{onClick:N(()=>{var p;document.activeElement!==document.getElementById(`${n}__searchbox`)&&((p=document.getElementById(`${n}__searchbox`))==null||p.focus())},[n]),children:o}))]})};var Ci=Object.defineProperty,Si=Object.defineProperties,_i=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,ki=Object.prototype.hasOwnProperty,Pi=Object.prototype.propertyIsEnumerable,Er=(e,t,o)=>t in e?Ci(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ii=(e,t)=>{for(var o in t||(t={}))ki.call(t,o)&&Er(e,o,t[o]);if(jr)for(var o of jr(t))Pi.call(t,o)&&Er(e,o,t[o]);return e},Ri=(e,t)=>Si(e,_i(t));const ji={"&:focus-within":{".listbox__list":{outline:"none"},".focused":et,"&.withSearchbox":{".focused":{outline:"1px solid",outlineColor:"palette.border.field",outlineOffset:0},".listbox__searchbox":et}},".listbox__list":{listStyle:"none",m:0,p:0},"&.withSearchbox":{".listbox__list":{maxHeight:"calc(100vh - 80px)",overflow:"auto"}},".listbox__row":{"&:hover":Ri(Ii({},gn({backgroundColor:"palette.background.paper"},"hover")),{cursor:"pointer"})}};var Lr=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,Li=Object.prototype.propertyIsEnumerable,Ni=(e,t)=>{var o={};for(var r in e)Ei.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Lr)for(var r of Lr(e))t.indexOf(r)<0&&Li.call(e,r)&&(o[r]=e[r]);return o};const Di=J((e,{searchString:t},o)=>{let r=!1;const n=new Array(e.rowsCount).fill(1).map((i,s)=>s),l=[],a=n.filter((i,s)=>{var p;const f=document.getElementById(`${e.id}__row__${s}`);if(!f)return console.warn("Element not found",`${e.id}__row__${s}`),!1;const c=e.searchFunction((p=f.ariaLabel)!=null?p:"",t);return c?f.style.display="block":f.style.display="none",c?l.push(s):e.focusedRow===s&&(r=!0),!c});if(o.set(a.map(i=>E(i))),e.hiddenRows=a,e.shownRows=l,r){for(const i of n)if(!a.includes(i)){e.focusedRow=i,o.push(E(i)),o.push(E(e.focusedRow));break}}});function J(e){return(t,o,r)=>{r.push("searchbox"),r.push("listbox"),e(t,o,r)}}const Ti=J((e,{isShiftKey:t,which:o},r)=>{if(e.shownRows.length<=1){r.push(E(e.focusedRow)),e.focusedRow=e.shownRows[0],e.shownRows.length===1&&r.push(E(e.focusedRow));return}switch(o){case"first":{const n=e.shownRows[0];if(n===e.focusedRow)return;if(r.push(E(e.focusedRow)),r.push(E(n)),e.isMultipleSelection){if(t){const l=new Array(e.focusedRow+1).fill(1).map((a,i)=>i);r.set(l.map((a,i)=>E(i))),e.selectedRows=l,e.lastSelectedRow=n}}else e.selectedRows=[n],e.lastSelectedRow=n;e.focusedRow=n}break;case"last":{const n=e.shownRows[e.shownRows.length-1];if(n===e.focusedRow)return;if(r.push(E(e.focusedRow)),r.push(E(n)),e.isMultipleSelection){if(t){const l=new Array(e.rowsCount-e.focusedRow).fill(1).map((a,i)=>i+Math.min(n,e.focusedRow));r.push(...l.map(a=>E(a))),e.selectedRows=l,e.lastSelectedRow=n}}else e.selectedRows=[n],e.lastSelectedRow=n;e.focusedRow=n}break;case"previous":case"next":case"pageDown":case"pageUp":{const n=jn([-1,1,-10,10],[o==="previous",o==="next",o==="pageUp",o==="pageDown"]),l=e.shownRows.findIndex(i=>e.focusedRow===i),a=e.shownRows[En({number:l+n,min:0,max:e.shownRows.length-1})];if(a===e.focusedRow)return;r.push(E(e.focusedRow)),r.push(E(a)),e.isMultipleSelection?t&&(e.selectedRows.includes(a)?e.selectedRows=e.selectedRows.filter(i=>i!==a):e.selectedRows.push(a),e.lastSelectedRow=a):(e.selectedRows=[a],e.lastSelectedRow=a),e.focusedRow=a}break}e.isEverythingSelected=!1}),Mi=J((e,t,o)=>{const r=e.shownRows.findIndex(a=>a===e.focusedRow);function n(a){o.push(E(e.focusedRow)),e.focusedRow=a,e.isMultipleSelection||(o.push(...e.selectedRows.map(i=>E(i))),e.selectedRows=[a]),o.push(E(e.focusedRow))}function l(a){var i;const s=document.getElementById(`${e.id}__row__${a}`);return s?e.startsWithFunction((i=s.ariaLabel)!=null?i:"",t.characters)?(n(e.shownRows[a]),!0):!1:(console.warn("Element not found",`${e.id}__row__${a}`),!1)}for(let a=r+1;a<e.shownRows.length;a++)if(l(a))return;for(let a=0;a<r;a++)if(l(a))return}),Bi=J((e,t,o)=>{o.push(...e.selectedRows.map(E)),e.isEverythingSelected?(e.isEverythingSelected=!1,e.selectedRows=[]):(e.isEverythingSelected=!0,e.selectedRows=e.shownRows),e.lastSelectedRow=e.focusedRow,o.push(...e.shownRows.map(E))}),Ai=J((e,t,o)=>{var r=t,{affectedKeys:n}=r,l=Ni(r,["affectedKeys"]),a;const i=(a=l.rowsCount)!=null?a:e.rowsCount;if(e.rowsCount<i)for(let s=e.rowsCount;s<l.rowsCount;s++)e.shownRows.push(s);else e.rowsCount>i&&(e.shownRows=e.shownRows.filter(s=>s<i),e.focusedRow>i-1&&(e.focusedRow=i-1,o.push(E(e.focusedRow))),e.selectedRows=e.selectedRows.filter(s=>s<i));Object.assign(e,l),o.set(n),e.isEverythingSelected=!1}),Fi=J((e,t,o)=>{o.push(E(e.focusedRow)),o.push(E(t.rowIndex)),e.focusedRow=t.rowIndex,t.isShiftKey?Nr(e,{isShiftKey:t.isShiftKey},o):(e.lastSelectedRow=t.rowIndex,t.isCtrlKey?e.selectedRows.includes(t.rowIndex)?e.selectedRows=e.selectedRows.filter(r=>r!==t.rowIndex):e.selectedRows.push(t.rowIndex):(o.push(...e.selectedRows.map(r=>E(r))),e.selectedRows=[e.focusedRow]))}),Nr=J((e,{isShiftKey:t},o)=>{const r=e.focusedRow;if(o.push(E(r)),e.isMultipleSelection)if(t)if(e.lastSelectedRow===-1)e.selectedRows.push(r);else{const n=new Array(Math.abs(e.lastSelectedRow-r)).fill(1).map((l,a)=>a+Math.min(r,e.lastSelectedRow)+(e.lastSelectedRow>r?0:1));o.push(...n.map(l=>E(l))),n.forEach(l=>{e.shownRows.includes(l)&&(e.selectedRows.includes(l)?e.selectedRows=e.selectedRows.filter(a=>a!==l):e.selectedRows.push(l))})}else e.selectedRows.includes(r)?e.selectedRows=e.selectedRows.filter(n=>n!==r):e.selectedRows.push(r);e.lastSelectedRow=r}),Hi={filter:Di,moveFocusAndToggleSelection:Ti,searchElementsByStartingCharacters:Mi,selectAll:Bi,setState:Ai,updateFocusByClickEvent:Fi,updateFocusBySpaceEvent:Nr};function Ki(e,{allowMultipleCharacterSearch:t,allowSelection:o,allowSingleCharacterSearch:r,isMultipleSelection:n,searchFunction:l,showSearchbox:a,startsWithFunction:i}){return B(()=>qt({initialState:li({allowSelection:o??!0,allowMultipleCharacterSearch:(t??!0)&&!a,allowSingleCharacterSearch:(r??!0)&&!a,id:e,isMultipleSelection:!!n,searchFunction:l,showSearchbox:a??!1,startsWithFunction:i}),operations:Hi,distinctors:oi(e),keysMakers:ni}),[])}function Wi(e,t){B(function(){t((o,r)=>{o.selectedRows!==r.selectedRows&&e?.({focusedElement:document.querySelector(`#${o.id}__row__${o.focusedRow}`),selectedElements:o.selectedRows.map(n=>document.querySelector(`#${o.id}__row__${n}`))})})},[e,t])}function qi(e){return B(function(){return Lt.map(e,(t,o)=>Nt(t)&&t.type===ze?pn(t,{rowIndex:o}):t)},[e])}function zi(e,t){return{onClick:N(()=>{if(document.activeElement!==document.querySelector(`#${e} .listbox__list`)){const o=document.querySelector(`#${e} .listbox__list`);o?.focus({preventScroll:!0}),o?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})}},[e]),onFocus:N(()=>{const o=t().focusedRow+1,r=document.querySelector(`#${e} .listbox__list .listbox__row:nth-child(${o})`);if(r){r.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const n=Ft(r);if(n&&n!==document.body){n.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});const l=r.getBoundingClientRect(),a=n.getBoundingClientRect();l.top-a.top<l.height&&(n.scrollTop-=l.height)}}},[t,e])}}function Ui(e,t){B(function(){let o=0;Lt.forEach(e,r=>{Nt(r)&&r.type===ze&&o++}),t.setState({rowsCount:o,affectedKeys:[]})},[t,e])}function Vi(e){return B(()=>e,[...Object.values(e)])}var Gi=Object.defineProperty,Xi=Object.defineProperties,Yi=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertySymbols,Ji=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Tr=(e,t,o)=>t in e?Gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,It=(e,t)=>{for(var o in t||(t={}))Ji.call(t,o)&&Tr(e,o,t[o]);if(Dr)for(var o of Dr(t))Qi.call(t,o)&&Tr(e,o,t[o]);return e},Rt=(e,t)=>Xi(e,Yi(t));const Zi=tt("Listbox","layout.components.listbox",ji,e=>{var t;const o=B(()=>yr("Listbox"),[]),[r,n,l,a]=Ki(o,e);Wi(e.onSelectionChange,a),Ui(e.children,r);const i=qi(e.children),{onClick:s,onFocus:p}=zi(o,l),f=n("listbox",null),c=e.unstyled?"":"layout.components.listbox",b=Vi({getState:l,id:o,listboxActions:r,onClickNode:e.onClickNode,onConfirmSelection:e.onConfirmSelection,onDoubleClickNode:e.onDoubleClickNode,onPressEnterOnNode:e.onPressEnterOnNode,onPressKeyOnNode:e.onPressKeyOnNode,useListbox:n,variant:c});return d(We.Provider,{value:b,children:d(bi,Rt(It({className:`listbox ${e.showSearchbox?"withSearchbox":""} ${(t=e.className)!=null?t:""}`},e.ulProps),{children:e.showSearchbox?d(xi,Rt(It({},e.ulProps),{children:i})):d(x,Rt(It({ref:f,as:"ul",className:"listbox__list",role:"listbox",tabIndex:0,onClick:s,onFocus:p},e.ulProps),{children:i}))}))})},!0),ec=Qe(Zi);var tc=Object.defineProperty,oc=Object.defineProperties,rc=Object.getOwnPropertyDescriptors,Mr=Object.getOwnPropertySymbols,nc=Object.prototype.hasOwnProperty,lc=Object.prototype.propertyIsEnumerable,Br=(e,t,o)=>t in e?tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ac=(e,t)=>{for(var o in t||(t={}))nc.call(t,o)&&Br(e,o,t[o]);if(Mr)for(var o of Mr(t))lc.call(t,o)&&Br(e,o,t[o]);return e},ic=(e,t)=>oc(e,rc(t));const cc=({id:e,progress:t=0,loading:o=!1})=>L(ae,{children:[d(vn,{htmlFor:e,sx:{display:o?"block":"none",m:"0px"},children:`${t}%`}),d(wn,ic(ac({id:e,max:100,value:t},T("styles.progress")),{sx:{display:o?"block":"none"},children:`${t}%`}))]});var sc=Object.defineProperty,uc=Object.defineProperties,dc=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertySymbols,pc=Object.prototype.hasOwnProperty,fc=Object.prototype.propertyIsEnumerable,Fr=(e,t,o)=>t in e?sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,hc=(e,t)=>{for(var o in t||(t={}))pc.call(t,o)&&Fr(e,o,t[o]);if(Ar)for(var o of Ar(t))fc.call(t,o)&&Fr(e,o,t[o]);return e},mc=(e,t)=>uc(e,dc(t));const bc={height:"iconmd",width:"iconmd",background:"palette.background.paper"},vc=tt("LoaderSpinner","layout.common.components.loaderSpinner",bc,({className:e})=>d(se,mc(hc({},T("layout.common.components.loaderSpinner")),{className:e})));var wc=Object.defineProperty,yc=Object.defineProperties,gc=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,$c=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,Kr=(e,t,o)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,xc=(e,t)=>{for(var o in t||(t={}))$c.call(t,o)&&Kr(e,o,t[o]);if(Hr)for(var o of Hr(t))Oc.call(t,o)&&Kr(e,o,t[o]);return e},Cc=(e,t)=>yc(e,gc(t));function Sc(e,t){let o=0;for(;o<t.length&&e>t[o];)o++;return o}const Wr=({breakPoints:e,Component:t,debounce:o,defaultBreakpoint:r})=>function(n){const[l,a]=U(r??4),[i,s]=U(e[r??4]),p=X(null),f=X(0),c=X(!1),[b,u]=U(!1),h=N(m=>{var v;m&&((v=p.current)==null||v.disconnect(),p.current=new ResizeObserver($=>{$[0].contentRect.width!==0&&(clearTimeout(f.current),f.current=setTimeout(()=>{var O;s($[0].contentRect.width),a(Sc($[0].contentRect.width,(O=n.breakPoints)!=null?O:e)),u(!0)},o??100))}),m&&p.current.observe(m))},[n.breakPoints]);return Z(()=>(c.current=!1,()=>{c.current=!0,setTimeout(()=>{var m;c.current&&((m=p.current)==null||m.disconnect())},2e3)}),[n.breakPoints]),d(x,{ref:h,children:b?d(t,Cc(xc({},n),{breakPoint:l,breakPointWidth:e[l],containerWidth:i})):d(vc,{})})},_c={grid:[(e,t)=>({etc:{"aria-activedescendant":`${t.storeId}__${t.focusedRow}__${t.focusedColumn}`}})],cell:[(e,t)=>{const o=t.focusedColumn===e.columnIndex&&t.focusedRow===e.rowIndex;return{etc:{id:`${t.storeId}__${e.rowIndex}__${e.columnIndex}`},classList:{add:o?["focused"]:void 0,remove:o?void 0:["focused"]}}},(e,t)=>{const o=document.querySelector(`#${t.storeId} [aria-rowindex="${t.focusedRow}"] [aria-colindex="${t.focusedColumn}"]`);o?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})}]},A=e=>`${e.columnIndex}__${e.rowIndex}`,kc={cell:A,grid:()=>"grid"};function ve(e){const t=document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow}"] [aria-colindex="${e.focusedColumn}"]`);t instanceof HTMLElement&&(e.focusedId=t.dataset.id)}const Pc=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow+1}"] [aria-colindex="${e.focusedColumn}"]`)&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow+1}),"grid"]),e.focusedRow++,ve(e))},Ic=(e,t,o)=>{e.focusedRow>1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow-1}),"grid"]),e.focusedRow--,ve(e))},Rc=(e,t,o)=>{e.focusedColumn>1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn-1,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn--,ve(e))},jc=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${e.focusedRow}"] [aria-colindex="${e.focusedColumn+1}"]`)&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:e.focusedColumn+1,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn++,ve(e))},Ec=(e,t,o)=>{document.querySelector(`#${e.storeId} [aria-rowindex="${t.rowIndex}"] [aria-colindex="${t.colIndex}"]`)&&(o.set([A({columnIndex:t.colIndex,rowIndex:t.rowIndex}),A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),"grid"]),e.focusedColumn=t.colIndex,e.focusedRow=t.rowIndex,ve(e))},Lc=(e,t,o)=>{var r,n;const l=document.querySelector(`#${e.storeId} [data-id="${e.focusedId}"]`);if(l instanceof HTMLElement){const a=Se((r=l.closest("[aria-rowindex]"))==null?void 0:r.ariaRowIndex,-1),i=Se((n=l.closest("[aria-colindex]"))==null?void 0:n.ariaColIndex,-1);a!==-1&&i!==-1&&(o.set([A({columnIndex:e.focusedColumn,rowIndex:e.focusedRow}),A({columnIndex:i,rowIndex:a})]),e.focusedColumn=i,e.focusedRow=a)}},Nc={arrowDown:Pc,arrowLeft:Rc,arrowRight:jc,arrowUp:Ic,setFocused:Ec,recalculateIndexByResize:Lc};var Dc=Object.defineProperty,qr=Object.getOwnPropertySymbols,Tc=Object.prototype.hasOwnProperty,Mc=Object.prototype.propertyIsEnumerable,zr=(e,t,o)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Bc=(e,t)=>{for(var o in t||(t={}))Tc.call(t,o)&&zr(e,o,t[o]);if(qr)for(var o of qr(t))Mc.call(t,o)&&zr(e,o,t[o]);return e};const Ac=e=>Bc({focusedColumn:1,focusedRow:1,focusedId:0},e),Ur=Je({}),Vr=()=>ie(Ur),Fc=({storeId:e})=>{const[t,o,r,n]=B(()=>qt({initialState:Ac({storeId:e}),distinctors:_c,keysMakers:kc,operations:Nc}),[]),l=N(({children:a})=>d(Ur.Provider,{value:{actions:t,useProps:o,getState:r,registerStateChangeListener:n},children:a}),[t,r,n,o]);return[t,o,r,n,l]};function Gr(e){return e instanceof Function&&Wc(e).length===0}const Hc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Kc=/([^\s,]+)/g;function Wc(e){const t=e.toString().replace(Hc,"");let o=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(Kc);return o===null&&(o=[]),o}function qc({attachToElement:e,attachToElementAnchorPoint:t}){let o={left:0,top:0};const r=Gr(e)?e():e.current;if(r){const n=r.getBoundingClientRect();switch(t??"topRight"){case"bottomLeft":o={left:n.left,top:n.bottom};break;case"bottomRight":o={left:n.right,top:n.bottom};break;case"center":o={left:(n.left+n.right)/2,top:(n.bottom+n.top)/2};break;case"topLeft":o={left:n.left,top:n.top};break;case"topRight":o={left:n.right,top:n.top};break}}else console.warn("Cannot resolve element, will use default positioning ",e);return o}function zc({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,minSize:r,preferredOrientationX:n,preferredOrientationY:l,preferredSize:a={height:"auto",width:"auto"}}){var i,s,p,f,c,b,u,h;let m=e;if(t&&(m=qc({attachToElement:t,attachToElementAnchorPoint:o})),m){const v=window.innerHeight-m.top,$=m.top,O=m.left,y=window.innerWidth-m.left,_=((i=r?.width)!=null?i:0)<=y,C=((s=r?.width)!=null?s:0)<=O,k=((p=r?.height)!=null?p:0)<=v,M=((f=r?.height)!=null?f:0)<=$,P=a.width==="auto"?1/0:a.width,j=a.height==="auto"?1/0:a.height,g={"& > *":{width:"100%",height:"100%"},width:a.width==="auto"?"auto":"100%",height:a.height==="auto"?"auto":"100%"};return n==="left"?C?(g.maxWidth=Math.min(P,O),g.right=window.innerWidth-m.left):_?(g.maxWidth=Math.min(P,y),g.left=m.left):(g.left=0,g.maxWidth="100vw"):_?(g.maxWidth=Math.min(P,y),g.left=m.left):C?(g.maxWidth=Math.min(P,O),g.right=window.innerWidth-m.left):(g.left=0,g.maxWidth="100vw"),l==="top"?M?(g.maxHeight=Math.min(j,$),g.bottom=window.innerHeight-m.top):k?(g.maxHeight=Math.min(j,v),g.top=m.top):(g.maxHeight="100vh",g.top=0):k?(g.maxHeight=Math.min(j,v),g.top=m.top):M?(g.maxHeight=Math.min(j,$),g.bottom=window.innerHeight-m.top):(g.maxHeight="100vh",g.top=0),g.minHeight=typeof g.maxHeight=="number"?Math.min(g.maxHeight,(c=r?.height)!=null?c:0):(b=r?.height)!=null?b:0,g.minWidth=typeof g.minWidth=="number"?Math.min(g.minWidth,(u=r?.width)!=null?u:0):(h=r?.width)!=null?h:0,g}return{left:0,top:0,width:"auto",height:"auto"}}function Uc({attachToElement:e,closeOnClick:t,closeOnClickOut:o,closeOnEscape:r,closeOnMouseLeaveTooltip:n,closeOnMouseLeaveAttachedElement:l,closeOnScrollOut:a}){const i=X(!1),s=N(()=>{we("close",void 0)},[]);return Ln(()=>{function p(u){u.code==="Escape"&&r&&s()}function f(u){i.current&&o&&!V(u.target,h=>{var m;return(m=h.classList)==null?void 0:m.contains("tooltip__wrapper")})&&s()}function c(u){i.current&&a&&!V(u.target,h=>{var m;return(m=h.classList)==null?void 0:m.contains("tooltip__wrapper")})&&s()}function b(u){if(!i.current||!l&&!n)return;const h=e?Gr(e)?e():e.current:null,m=V(u.target,y=>y.classList.contains("tooltip__wrapper")),v=V(u.target,y=>y===h),$=V(u.relatedTarget,y=>y.classList.contains("tooltip__wrapper")),O=V(u.relatedTarget,y=>y===h);!m&&!v&&!l&&!n||$||O||v&&!l||m&&!n||s()}return document.addEventListener("keydown",p),document.addEventListener("mousedown",f),document.addEventListener("scroll",c),document.addEventListener("mouseout",b),setTimeout(()=>{i.current=!0},0),()=>{document.removeEventListener("keydown",p),document.removeEventListener("click",f),document.removeEventListener("scroll",c),document.removeEventListener("mouseout",b)}}),{handleOnClick:N(p=>{p.stopPropagation(),t&&s()},[s,t])}}var Vc=Object.defineProperty,Gc=Object.defineProperties,Xc=Object.getOwnPropertyDescriptors,Xr=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Jc=Object.prototype.propertyIsEnumerable,Yr=(e,t,o)=>t in e?Vc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Jr=(e,t)=>{for(var o in t||(t={}))Yc.call(t,o)&&Yr(e,o,t[o]);if(Xr)for(var o of Xr(t))Jc.call(t,o)&&Yr(e,o,t[o]);return e},Qc=(e,t)=>Gc(e,Xc(t));const Zc=({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,children:r,className:n,closeOnClick:l=!1,closeOnClickOut:a=!0,closeOnEscape:i=!0,closeOnMouseLeaveTooltip:s=!0,closeOnMouseLeaveAttachedElement:p=!0,closeOnScrollOut:f=!0,minSize:c,preferredOrientationX:b="right",preferredOrientationY:u="bottom",preferredSize:h={height:"auto",width:"auto"},variant:m="layout.common.tooltips.primary"})=>{const v=zc({anchorPoint:e,attachToElement:t,attachToElementAnchorPoint:o,minSize:c,preferredOrientationX:b,preferredOrientationY:u,preferredSize:h}),$=Jr({position:"fixed"},v),{handleOnClick:O}=Uc({attachToElement:t,closeOnEscape:i,closeOnClickOut:a,closeOnClick:l,closeOnMouseLeaveTooltip:s,closeOnMouseLeaveAttachedElement:p,closeOnScrollOut:f});return d(x,Qc(Jr({className:`tooltip__wrapper ${n??""}`},T(m)),{sx:$,onClick:O,children:r}))};var es=Object.defineProperty,ts=Object.defineProperties,os=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,Zr=(e,t,o)=>t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,jt=(e,t)=>{for(var o in t||(t={}))rs.call(t,o)&&Zr(e,o,t[o]);if(Qr)for(var o of Qr(t))ns.call(t,o)&&Zr(e,o,t[o]);return e},ls=(e,t)=>ts(e,os(t));Ze("layout.common.tooltips.primary",{background:"white",border:"1px solid #ccc",p:3,zIndex:"tooltip"});const[,we,as]=Nn()({Component:()=>{const[e,t]=U(null),o=Dn(e);return Tn({open:t,close(){var r,n;(n=(r=o.current)==null?void 0:r.onClose)==null||n.call(r),t(null)}}),e?d(Zc,jt({},e)):null}});function en(e){const t=X(!1),o=N(r=>{setTimeout(()=>{if(t.current=!0,!e&&!(r!=null&&r.children))throw new Error("There is no children set for the current tooltip");we("open",ls(jt(jt({},e),r),{onClose(){var n,l;(n=e?.onClose)==null||n.call(e),(l=r?.onClose)==null||l.call(r),t.current=!1}}))},0)},[e]);return{close:N(()=>{we("close",void 0)},[]),open:o,toggle:N(r=>{t.current?we("close",void 0):o(r)},[o])}}function Ge(e,t){var o,r;const n=t instanceof HTMLElement?(r=(o=t.closest(".iconsList__iconWrapper[data-id]"))==null?void 0:o.dataset)==null?void 0:r.id:t;if(n!==void 0){const l=e.find(a=>String(a.id)===n);return l??null}}const is=({children:e,icons:t,onIconClick:o,onIconDoubleClick:r,onIconGetDetails:n,onIconKeyDown:l,storeId:a})=>{const{actions:i,getState:s,useProps:p}=Vr(),f=p("grid",null),{open:c}=en({minSize:{width:200,height:0}}),b=N(u=>{n&&c({children:n(u),attachToElement:()=>document.querySelector(`#${a} .iconsList__iconWrapper[data-id="${u.id}"]`),closeOnClick:!1})},[n,c,a]);return d(x,{ref:f,className:"iconsList__keyHandler",tabIndex:0,onFocus:N(u=>{if(!V(u.target,m=>{var v;return(v=m.classList)==null?void 0:v.contains("iconsList__keyHandler")}))return;const h=Ge(t,s().focusedId);h&&b(h)},[s,t,b]),onMouseDown:N(u=>{var h,m;if(u.target instanceof HTMLElement){const v=Se((h=u.target.closest("[aria-colindex]"))==null?void 0:h.ariaColIndex,-1),$=Se((m=u.target.closest("[aria-rowindex]"))==null?void 0:m.ariaRowIndex,-1);v>=0&&$>=0&&i.setFocused({colIndex:v,rowIndex:$})}},[i]),onClick:N(u=>{const h=Ge(t,u.target);h&&b(h),o&&h&&o(u,h)},[t,o,b]),onDoubleClick:N(u=>{if(r){const h=Ge(t,u.target);h&&r(u,h)}},[t,r]),onKeyDown:N(u=>{function h(){const m=Ge(t,s().focusedId);m&&b(m),m&&l&&l(u,m)}switch(u.code){case"ArrowUp":i.arrowUp(),h();break;case"ArrowDown":i.arrowDown(),h();break;case"ArrowRight":i.arrowRight(),h();break;case"ArrowLeft":i.arrowLeft(),h();break}},[i,s,t,l,b]),children:e})};var cs=Object.defineProperty,tn=Object.getOwnPropertySymbols,ss=Object.prototype.hasOwnProperty,us=Object.prototype.propertyIsEnumerable,on=(e,t,o)=>t in e?cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,rn=(e,t)=>{for(var o in t||(t={}))ss.call(t,o)&&on(e,o,t[o]);if(tn)for(var o of tn(t))us.call(t,o)&&on(e,o,t[o]);return e};const ds={"&, *":{textAlign:"center"},".iconsList__icon__image__wrapper":{boxShadow:"1px 1px 3px #0001"},".iconsList__icon__wrapper":{p:2,"&:hover":rn({},Mt().getOneState({backgroundColor:Mt().background.paper},"hover"))},".iconsList__icon__label":{wordBreak:"break-word"},".iconsList__keyHandler:focus":{outline:"none",".focused .iconsList__icon__wrapper":rn({},et)}};function ps(e){return Array(Math.floor(4e3/e)).fill(1).map((t,o)=>(o+1)*e)}function fs({containerWidth:e,iconWidth:t,breakPoint:o,verticalGap:r,removeHorizontalPadding:n}){const l=(e-t*o)/(o+(n?-1:1));return B(()=>({justifyContent:"space-evenly",gridTemplateColumns:`repeat(${o}, 1fr)`,rowGap:r??0,columnGap:`${l}px`,px:n?0:`${l}px`}),[n,o,l,r])}const nn="JUST TO FILL THE ROW";function hs({breakPoint:e,icons:t,i:o}){const r=t.slice(o*e,(o+1)*e);return r.length<e&&r.push(...Array(e-r.length).fill(nn)),r}const ln=Je(null);function ms(){const e=ie(ln);if(!e)throw new Error("There is no IconRendererContext");return e}var bs=Object.defineProperty,an=Object.getOwnPropertySymbols,vs=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable,cn=(e,t,o)=>t in e?bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ys=(e,t)=>{for(var o in t||(t={}))vs.call(t,o)&&cn(e,o,t[o]);if(an)for(var o of an(t))ws.call(t,o)&&cn(e,o,t[o]);return e};const gs=e=>{var t;const{useProps:o}=Vr(),r=o("cell",{columnIndex:e.colIndex,rowIndex:e.rowIndex}),n=ms();return d(x,{ref:r,role:"gridcell","data-id":e.id,className:`iconsList__iconWrapper ${(t=e.className)!=null?t:""}`,"aria-label":e.ariaLabel,sx:B(()=>({width:`${e.width}px`}),[e.width]),"aria-colindex":e.colIndex,children:d(n,ys({},e))})};var $s=Object.defineProperty,sn=Object.getOwnPropertySymbols,Os=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,un=(e,t,o)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Cs=(e,t)=>{for(var o in t||(t={}))Os.call(t,o)&&un(e,o,t[o]);if(sn)for(var o of sn(t))xs.call(t,o)&&un(e,o,t[o]);return e};const Ss=({icon:e,iconWidth:t,rowIndex:o,colIndex:r})=>e===nn?d(x,{sx:{width:`${t}px`},className:"fill__the__row"},r):d(gs,Cs({rowIndex:o,colIndex:r,width:t},e)),_s=e=>L(x,{className:"iconsList__icon__wrapper",children:[d(x,{className:"iconsList__icon__image__wrapper",children:d(Dt,{className:"iconsLIst__icon__image",src:e.imageUrl,role:"decoration"})}),d(x,{className:"iconsList__icon__label",children:e.label})]}),ks=Qe(_s),dn=(e,t)=>{const o=B(()=>yr("IconsList"),[]),[r,,,,n]=Fc({storeId:o}),l=B(()=>{var a,i,s;const p=(a=e.iconWidth)!=null?a:100,f=(i=e.minHorizontalGap)!=null?i:30,c=(s=e.iconRenderer)!=null?s:ks,b=p+f;return tt("IconsList","layout.common.components.iconsList",ds,Wr({breakPoints:ps(b),Component:({breakPoint:u,containerWidth:h})=>{const m=Math.ceil(e.icons.length/u),v=fs({breakPoint:u,containerWidth:h,iconWidth:p,verticalGap:e.verticalGap,removeHorizontalPadding:e.removeHorizontalPadding});return Z(()=>{r.recalculateIndexByResize()},[u]),d(ln.Provider,{value:c,children:d(n,{children:d(is,{icons:e.icons,onIconClick:e.onIconClick,onIconDoubleClick:e.onIconDoubleClick,onIconGetDetails:e.onIconGetDetails,onIconKeyDown:e.onIconKeyDown,storeId:o,children:d(x,{id:o,role:"grid","aria-rowcount":m,"aria-colcount":u,children:Array(m).fill(1).map(($,O)=>{const y=hs({breakPoint:u,i:O,icons:e.icons});return d(yn,{"aria-rowindex":O+1,role:"row",ref:t,sx:v,children:y.map((_,C)=>d(Ss,{colIndex:C+1,icon:_,iconWidth:p,rowIndex:O+1},typeof _=="string"?C+1:_.id))},O)})})})})})},debounce:50}))},[n,r,e.iconRenderer,e.iconWidth,e.icons,e.minHorizontalGap,e.onIconClick,e.onIconDoubleClick,e.onIconGetDetails,e.onIconKeyDown,e.removeHorizontalPadding,e.verticalGap,t,o]);return d(l,{})};dn.displayName="IconsList";const Ps=Ye(dn);export{Wa as ApiaFilter,Qn as BaseButton,ft as CalendarModal,bl as Captcha,po as Checkbox,mr as CollapsiblePanel,sa as Confirm,vt as DateInput,No as DialogButtonBar,qo as FieldErrorMessage,de as IconButton,Yo as IconInput,Ps as IconsList,Ao as LinearLoader,ec as Listbox,ze as ListboxItem,pt as Modal,dt as ModalContext,gt as NumberInput,De as Overlay,cc as ProgressBar,Na as RequiredMark,ma as ScreenLock,Ie as SimpleButton,as as TooltipsProvider,Sr as WaiTypeAhead,ca as getConfirmButton,Be as getFieldErrorStyles,ya as getFieldTouchedStyles,Wr as makeResponsiveComponent,Ea as parseNumberInputValueToNumber,La as parseNumberValueToNumberInput,we as tooltipsHandler,jo as useModal,cl as useOtherTagButton,en as useTooltip};
|