import { createContext as $, useContext as q, useState as B, useRef as M, useEffect as T, useCallback as W } from "react";
import { jsxs as x, jsx as l } from "react/jsx-runtime";
import S from "prop-types";
import { useSelector as P } from "react-redux";
import { getUseSkeleton as U } from "@/store/reducers/SkeletonReducer";
const J = (e, s, a, n) => {
  var t, g, y, N;
  const i = [a, {
    code: s,
    ...n || {}
  }];
  if ((g = (t = e == null ? void 0 : e.services) == null ? void 0 : t.logger) != null && g.forward)
    return e.services.logger.forward(i, "warn", "react-i18next::", !0);
  p(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), (N = (y = e == null ? void 0 : e.services) == null ? void 0 : y.logger) != null && N.warn ? e.services.logger.warn(...i) : console != null && console.warn && console.warn(...i);
}, R = {}, C = (e, s, a, n) => {
  p(a) && R[a] || (p(a) && (R[a] = /* @__PURE__ */ new Date()), J(e, s, a, n));
}, H = (e, s) => () => {
  if (e.isInitialized)
    s();
  else {
    const a = () => {
      setTimeout(() => {
        e.off("initialized", a);
      }, 0), s();
    };
    e.on("initialized", a);
  }
}, E = (e, s, a) => {
  e.loadNamespaces(s, H(e, a));
}, A = (e, s, a, n) => {
  if (p(a) && (a = [a]), e.options.preload && e.options.preload.indexOf(s) > -1) return E(e, a, n);
  a.forEach((i) => {
    e.options.ns.indexOf(i) < 0 && e.options.ns.push(i);
  }), e.loadLanguages(s, H(e, n));
}, K = (e, s, a = {}) => !s.languages || !s.languages.length ? (C(s, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
  languages: s.languages
}), !0) : s.hasLoadedNamespace(e, {
  lng: a.lng,
  precheck: (n, i) => {
    if (a.bindI18n && a.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !i(n.isLanguageChangingTo, e)) return !1;
  }
}), p = (e) => typeof e == "string", X = (e) => typeof e == "object" && e !== null, Y = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, D = {
  "&amp;": "&",
  "&#38;": "&",
  "&lt;": "<",
  "&#60;": "<",
  "&gt;": ">",
  "&#62;": ">",
  "&apos;": "'",
  "&#39;": "'",
  "&quot;": '"',
  "&#34;": '"',
  "&nbsp;": " ",
  "&#160;": " ",
  "&copy;": "©",
  "&#169;": "©",
  "&reg;": "®",
  "&#174;": "®",
  "&hellip;": "…",
  "&#8230;": "…",
  "&#x2F;": "/",
  "&#47;": "/"
}, Q = (e) => D[e], Z = (e) => e.replace(Y, Q);
let V = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: !0,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: !0,
  unescape: Z
};
const ee = () => V;
let se;
const ae = () => se, te = $();
class ne {
  constructor() {
    this.usedNamespaces = {};
  }
  addUsedNamespaces(s) {
    s.forEach((a) => {
      this.usedNamespaces[a] || (this.usedNamespaces[a] = !0);
    });
  }
  getUsedNamespaces() {
    return Object.keys(this.usedNamespaces);
  }
}
const re = (e, s) => {
  const a = M();
  return T(() => {
    a.current = e;
  }, [e, s]), a.current;
}, _ = (e, s, a, n) => e.getFixedT(s, a, n), oe = (e, s, a, n) => W(_(e, s, a, n), [e, s, a, n]), fe = (e, s = {}) => {
  var j, z, O, F;
  const {
    i18n: a
  } = s, {
    i18n: n,
    defaultNS: i
  } = q(te) || {}, t = a || n || ae();
  if (t && !t.reportNamespaces && (t.reportNamespaces = new ne()), !t) {
    C(t, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
    const o = (u, d) => p(d) ? d : X(d) && p(d.defaultValue) ? d.defaultValue : Array.isArray(u) ? u[u.length - 1] : u, c = [o, {}, !1];
    return c.t = o, c.i18n = {}, c.ready = !1, c;
  }
  (j = t.options.react) != null && j.wait && C(t, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
  const g = {
    ...ee(),
    ...t.options.react,
    ...s
  }, {
    useSuspense: y,
    keyPrefix: N
  } = g;
  let r = i || ((z = t.options) == null ? void 0 : z.defaultNS);
  r = p(r) ? [r] : r || ["translation"], (F = (O = t.reportNamespaces).addUsedNamespaces) == null || F.call(O, r);
  const m = (t.isInitialized || t.initializedStoreOnce) && r.every((o) => K(o, t, g)), G = oe(t, s.lng || null, g.nsMode === "fallback" ? r : r[0], N), I = () => G, v = () => _(t, s.lng || null, g.nsMode === "fallback" ? r : r[0], N), [k, h] = B(I);
  let w = r.join();
  s.lng && (w = `${s.lng}${w}`);
  const L = re(w), f = M(!0);
  T(() => {
    const {
      bindI18n: o,
      bindI18nStore: c
    } = g;
    f.current = !0, !m && !y && (s.lng ? A(t, s.lng, r, () => {
      f.current && h(v);
    }) : E(t, r, () => {
      f.current && h(v);
    })), m && L && L !== w && f.current && h(v);
    const u = () => {
      f.current && h(v);
    };
    return o && (t == null || t.on(o, u)), c && (t == null || t.store.on(c, u)), () => {
      f.current = !1, t && o && (o == null || o.split(" ").forEach((d) => t.off(d, u))), c && t && c.split(" ").forEach((d) => t.store.off(d, u));
    };
  }, [t, w]), T(() => {
    f.current && m && h(I);
  }, [t, N, m]);
  const b = [k, t, m];
  if (b.t = k, b.i18n = t, b.ready = m, m || !m && !y) return b;
  throw new Promise((o) => {
    s.lng ? A(t, s.lng, r, () => o()) : E(t, r, () => o());
  });
}, ie = ({
  children: e,
  isLoading: s
}) => !P(U) || !s ? e : /* @__PURE__ */ x("div", { className: "flex flex-col gap-2 w-full", children: [
  /* @__PURE__ */ x("div", { className: "flex justify-end gap-5 mb-5", children: [
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" })
  ] }),
  /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-full h-100" })
] });
ie.propTypes = {
  children: S.any,
  isLoading: S.any
};
const le = ({ children: e, isLoading: s }) => !P(U) || !s ? e : /* @__PURE__ */ x("div", { className: "flex flex-col gap-5 p-5", children: [
  /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[20%] h-10" }),
  /* @__PURE__ */ x("div", { className: "flex flex-wrap gap-5 justify-between my-10", children: [
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[45%] h-15" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[45%] h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[30%] h-10" })
  ] }),
  /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
  /* @__PURE__ */ x("div", { className: "flex justify-end gap-5", children: [
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
    /* @__PURE__ */ l("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" })
  ] })
] });
le.propTypes = {
  children: S.any,
  isLoading: S.any
};
export {
  ie as I,
  le as M,
  fe as u
};
//# sourceMappingURL=ImmunizationSkeleton-D2tdv5k-.js.map
