import a from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import * as f from "react";
import { findListDiffIndex as l } from "../utils/algorithmUtil.mjs";
function x(e, s, i) {
  var n = f.useState(e), r = a(n, 2), o = r[0], d = r[1], c = f.useState(null), u = a(c, 2), m = u[0], v = u[1];
  return f.useEffect(function() {
    var t = l(o || [], e || [], s);
    (t == null ? void 0 : t.index) !== void 0 && (i == null || i(t.index), v(e[t.index])), d(e);
  }, [e]), [m];
}
export {
  x as default
};
