import s from "lodash/get";
const e = (n, r) => typeof n == "function" ? n(r) : n.replace(/{(\w*)}/g, (t, o) => r.hasOwnProperty(o) ? r[o] : ""), p = (n, r, t, o = "en", f = {}) => {
  const i = n[t], c = s(i, r), u = s(n[o], r);
  return !i || !c ? (console.warn(`Warning: no ${r} translation of ${t}`), o && u ? e(u, f) : r) : typeof n[t] == "function" || n[t].then ? e(u, f) : e(c, f);
}, w = p;
export {
  e as replace,
  w as t,
  p as translate
};
