import{r as t}from"./index-ClIi1ip-.js";var R=function(e){return function(n,r){var u=t.useRef(!1);e(function(){return function(){u.current=!1}},[]),e(function(){if(!u.current)u.current=!0;else return n()},r)}},h=function(e){return typeof e=="function"},T=function(e){return typeof e=="number"};function l(e,n){if(e===n)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],n[r]))return!1;return!0}function p(e){var n=t.useRef(e);return n.current=e,n}var y=function(e){var n=p(e);t.useEffect(function(){return function(){n.current()}},[])},m=!!(typeof window<"u"&&window.document&&window.document.createElement);function w(e,n){if(m){if(!e)return n;var r;return h(e)?r=e():"current"in e?r=e.current:r=e,r}}var L=function(e){var n=function(r,u,s){var o=t.useRef(!1),a=t.useRef([]),v=t.useRef([]),c=t.useRef();e(function(){var f,E=Array.isArray(s)?s:[s],i=E.map(function(d){return w(d)});if(!o.current){o.current=!0,a.current=i,v.current=u,c.current=r();return}(i.length!==a.current.length||!l(a.current,i)||!l(v.current,u))&&((f=c.current)===null||f===void 0||f.call(c),a.current=i,v.current=u,c.current=r())}),y(function(){var f;(f=c.current)===null||f===void 0||f.call(c),o.current=!1})};return n},A=L(t.useEffect),b=m?t.useLayoutEffect:t.useEffect;const I=R(b);export{I as a,A as b,p as c,y as d,R as e,w as g,T as i,b as u};
