import { j as i } from "../../node_modules/react/jsx-runtime.mjs";
import { useState as t } from "react";
import { isMobile as p } from "../../node_modules/react-device-detect/dist/lib.mjs";
import P from "../BitzRefresh/index.mjs";
import "./index.less.mjs";
const M = ({ children: c, pageRefeshEmit: r = () => {
} }) => {
  const [a, s] = t(!1), [h, u] = t(0), [f, e] = t(0), m = (o) => {
    const n = o.changedTouches[0].clientY;
    u(n);
  }, l = (o) => {
    const d = o.changedTouches[0].clientY - h;
    e(d);
  }, T = () => {
    p && (f > 400 && (s(!0), setTimeout(() => {
      r(), s(!1);
    }, 2e3)), e(0));
  };
  return i.jsxs("div", { className: "bitzPageBlock", onTouchStart: m, onTouchMove: l, onTouchEnd: () => {
    T();
  }, children: [i.jsx(P, { showRefresh: a }), c] });
};
export {
  M as default
};
