"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5512],{823926:function(e,n,t){t.d(n,{d:function(){return s}});var r=t(667294),u=t(33703),c=t(159948),o=t(382690),i=t(785893);function f(e){return e.substring(2).toLowerCase()}function s(e){const{children:n,disableReactTree:t=!1,mouseEvent:s="onClick",onClickAway:d,touchEvent:l="onTouchEnd"}=e,a=r.useRef(!1),E=r.useRef(null),m=r.useRef(!1),v=r.useRef(!1);r.useEffect((()=>(setTimeout((()=>{m.current=!0}),0),()=>{m.current=!1})),[]);const h=(0,u.Z)(n.ref,E),Z=(0,c.Z)((e=>{const n=v.current;v.current=!1;const r=(0,o.Z)(E.current);if(!m.current||!E.current||"clientX"in e&&function(e,n){return n.documentElement.clientWidth<e.clientX||n.documentElement.clientHeight<e.clientY}(e,r))return;if(a.current)return void(a.current=!1);let u;u=e.composedPath?e.composedPath().indexOf(E.current)>-1:!r.documentElement.contains(e.target)||E.current.contains(e.target),u||!t&&n||d(e)})),p=e=>t=>{v.current=!0;const r=n.props[e];r&&r(t)},L={ref:h};return!1!==l&&(L[l]=p(l)),r.useEffect((()=>{if(!1!==l){const e=f(l),n=(0,o.Z)(E.current),t=()=>{a.current=!0};return n.addEventListener(e,Z),n.addEventListener("touchmove",t),()=>{n.removeEventListener(e,Z),n.removeEventListener("touchmove",t)}}}),[Z,l]),!1!==s&&(L[s]=p(s)),r.useEffect((()=>{if(!1!==s){const e=f(s),n=(0,o.Z)(E.current);return n.addEventListener(e,Z),()=>{n.removeEventListener(e,Z)}}}),[Z,s]),(0,i.jsx)(r.Fragment,{children:r.cloneElement(n,L)})}},335512:function(e,n,t){t.r(n),t.d(n,{default:function(){return r.d}});var r=t(823926)},382690:function(e,n,t){function r(e){return e&&e.ownerDocument||document}t.d(n,{Z:function(){return r}})},407960:function(e,n,t){function r(e,n){"function"===typeof e?e(n):e&&(e.current=n)}t.d(n,{Z:function(){return r}})},573546:function(e,n,t){var r=t(667294);const u="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;n.Z=u},159948:function(e,n,t){var r=t(667294),u=t(573546);n.Z=function(e){const n=r.useRef(e);return(0,u.Z)((()=>{n.current=e})),r.useCallback(((...e)=>(0,n.current)(...e)),[])}},33703:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(667294),u=t(407960);function c(...e){return r.useMemo((()=>e.every((e=>null==e))?null:n=>{e.forEach((e=>{(0,u.Z)(e,n)}))}),e)}}}]);