"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[28],{51:(e,n,t)=>{t.d(n,{a:()=>o});var r=t(0);function o({size:e,iconClass:n}){return(0,r.jsx)("div",{"aria-hidden":"true",role:"presentation",class:n,style:{width:e||"",height:e||"",backgroundImage:"var(--icon-close)",backgroundSize:"contain",cursor:"pointer",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box"}})}},67:(e,n,t)=>{t.d(n,{a:()=>a});var r=t(0),o=t(14),u=t(1);const c='\n a[href],\n area[href],\n input:not([type="hidden"]):not([disabled]):not([tabindex="-1"]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]):not([tabindex="-1"]),\n iframe,\n object,\n embed,\n [tabindex]:not([tabindex="-1"]),\n [contenteditable]:not([contenteditable="false"]),\n audio[controls],\n video[controls],\n summary',a=(0,o.forwardRef)((({children:e,disabled:n=!1,isActive:t,autoFocus:o=!0,restoreFocus:a=!0,as:i="div",className:s,style:d,"aria-label":l,"aria-labelledby":f,"aria-modal":b,role:m,id:v,"data-testid":y,onTransitionEnd:p,onAnimationEnd:h},k)=>{const x=(0,u.useRef)(null),E=(0,u.useRef)(null),g=(0,u.useRef)(null),w=(0,u.useRef)(null),C=(0,u.useRef)(null),L=(0,u.useRef)(!n);(0,u.useLayoutEffect)((()=>{L.current=!n}),[n]);const R=(0,u.useCallback)((()=>void 0!==t?t():L.current),[t]),A=(0,u.useCallback)((e=>{x.current=e,"function"==typeof k?k(e):k&&(k.current=e)}),[k]),j=(0,u.useCallback)((()=>{const e=x.current;if(!e)return null;const n=Array.from(e.querySelectorAll(c));for(const e of n)if(e!==E.current&&e!==g.current)return e;return null}),[]),F=(0,u.useCallback)((()=>{const e=x.current;if(!e)return null;const n=Array.from(e.querySelectorAll(c));for(let e=n.length-1;e>=0;e--){const t=n[e];if(t!==E.current&&t!==g.current)return t}return null}),[]),S=(0,u.useCallback)((()=>{var e;if(!R())return;const n=F();n?n.focus():null===(e=x.current)||void 0===e||e.focus()}),[R,F]),I=(0,u.useCallback)((()=>{var e;if(!R())return;const n=j();n?n.focus():null===(e=x.current)||void 0===e||e.focus()}),[R,j]);(0,u.useEffect)((()=>{if("undefined"==typeof document)return;const e=e=>{const n=e.target;if(!n||n===document.body)return;const t=x.current;t&&t.contains(n)||(C.current=n)};return document.addEventListener("focusin",e,!0),()=>{document.removeEventListener("focusin",e,!0)}}),[]),(0,u.useEffect)((()=>{var e;if("undefined"!=typeof document&&!n){if(a){C.current&&!document.body.contains(C.current)&&(C.current=null);let e=document.activeElement;e&&e!==document.body||(e=C.current),e&&e!==document.body&&document.body.contains(e)?w.current=e:w.current=null}return o&&(null===(e=x.current)||void 0===e||e.focus({preventScroll:!0})),()=>{a&&w.current instanceof HTMLElement&&w.current!==document.body&&document.body.contains(w.current)&&w.current.focus({preventScroll:!0}),w.current=null}}}),[n,o,a]),(0,u.useEffect)((()=>{if("undefined"==typeof document)return;const e=x.current,n=n=>{if(R()&&"Tab"===n.key&&e&&document.activeElement===e)if(n.preventDefault(),n.shiftKey){const e=F();null==e||e.focus()}else{const e=j();null==e||e.focus()}},t=n=>{if(!R()||!e)return;const t=n.target;if(t!==E.current&&t!==g.current&&!e.contains(t)){n.stopPropagation();const t=j();t?t.focus():e.focus()}};return document.addEventListener("keydown",n,!0),document.addEventListener("focusin",t,!0),()=>{document.removeEventListener("keydown",n,!0),document.removeEventListener("focusin",t,!0)}}),[R,j,F]);const T={position:"fixed",top:0,left:0,width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},N=void 0!==t?0:n?-1:0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:E,style:T,tabIndex:N,onFocus:S,"aria-hidden":"true"}),(0,r.jsx)(i,{ref:A,id:v,tabIndex:-1,className:s,style:d,role:m,"aria-label":l,"aria-labelledby":f,"aria-modal":b,"data-testid":y,onTransitionEnd:p,onAnimationEnd:h,children:e}),(0,r.jsx)("div",{ref:g,style:T,tabIndex:N,onFocus:I,"aria-hidden":"true"})]})}));a.displayName="FocusLock"}}]);