import { isNumber as s, isArray as u } from "lodash-unified";
function m(...n) {
  return n.reduce((t, e) => ({ ...t, ...e }), {});
}
function a(n, t = 0) {
  if (!n)
    return t;
  if (typeof n == "number")
    return n;
  const e = n.match(/^(-?\d+(?:\.\d+)?)px$/);
  if (!e)
    return t;
  const r = parseFloat(e[1]);
  return r > 0 ? r : t;
}
function d(n) {
  return s(n) ? String(n) : n;
}
let p = 0;
function l(n) {
  return `_${u(n) ? n.join("_") : String(n)}_${p++}`;
}
async function x(n, t, ...e) {
  for (const r of n) {
    const o = t(r);
    o && await o(...e);
  }
}
async function y(n, t, e, ...r) {
  let o = t;
  for (const i of n) {
    const c = e(i);
    if (c)
      try {
        const f = await c(o, ...r);
        f !== void 0 && (o = f);
      } catch {
      }
  }
  return o;
}
function g(n, t, e) {
  let r = {};
  if (!n.length)
    return r;
  for (const o of n)
    if (o.children?.length)
      r = {
        ...r,
        ...g(o.children, t)
      };
    else {
      const i = o.key;
      i && (r[i] = o[t] ?? e);
    }
  return r;
}
export {
  l as getShadowName,
  d as getStringKey,
  m as mergeProps,
  g as pickColumnConfig,
  a as pxToNumber,
  x as runEffectHooks,
  y as runPipelineHooks
};
