'use strict';

const jsxRuntime = require('react/jsx-runtime');
const React = require('react');

const DevProfiler = ({ id, threshold, children }) => {
  const onRenderCallback = React.useCallback(
    (profilerId, phase, actualDuration) => {
      if (actualDuration > threshold) {
        console.log(
          `%cProfiler [${profilerId}] Phase: ${phase} - actual duration: ${actualDuration.toFixed(2)}ms exceeds threshold of ${threshold}ms`,
          "color: red"
        );
      }
    },
    [threshold]
  );
  if (process.env.NODE_ENV === "production") {
    return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
  }
  return /* @__PURE__ */ jsxRuntime.jsx(React.Profiler, { id, onRender: onRenderCallback, children });
};

exports.DevProfiler = DevProfiler;
