import { jsx as p, jsxs as l } from "react/jsx-runtime";
import { a as u } from "../useQuery-n4ls1rLk.js";
import y from "../components/Layouts.js";
import { F as a } from "../index-ec7CVlTE.js";
import { formClient as n } from "../config/index.js";
import "react";
import "../hooks/useHasNextSiblingByAttribute.js";
import "../utils/functions.js";
import "../clsx-7d8NmkQq.js";
import "../index-OHO5PlsB.js";
import "../utils/components/RenderEach.js";
import "../utils/components/RenderIf.js";
import "../components/Icons.js";
import "../components/Inputs/variants.js";
import "../index-xVF7D3FM.js";
import "../motion-dVICNqWI.js";
import "../SVGVisualElement-aqO4D4Z5.js";
import "../LayoutGroupContext-3euHzeKi.js";
import "../index.esm-BQxOvVZs.js";
import "../index.esm--ZdnNCdl.js";
import "../_commonjsHelpers-2ufMB8rV.js";
import "../components/AlertDialog/index.js";
import "react-dom";
import "../components/AlertDialog/variants.js";
import "../components/Buttons/index.js";
import "../context/generalContext/index.js";
import "../context/index.js";
import "../components/Buttons/variants.js";
import "../components/FormProvider.js";
import "../composables/Modal.js";
import "../hooks/useAnimatePresence.js";
import "../use-unmount-effect-Wy5iLAex.js";
import "../index-T7wQHOux.js";
import "./govco/FormModal.js";
import "./RenderFeatureComponents.js";
import "../components/Maps/index.js";
import "../hooks/useDeepCompareEffect.js";
import "../components/Inputs/InputFileSimple.js";
import "../hooks/useUploadFiles.js";
import "../axios-f2q_J-wz.js";
import "../components/Inputs/CircleProgressLoading.js";
import "../PdfViewer-tzZO2boW.js";
import "../index-XF2mSoW7.js";
import "../index-JtU1DT1I.js";
import "../index-5sPke2Og.js";
import "../components/Table/components/Basic.js";
import "../components/Table/context/index.js";
import "../components/Table/utils/useTableInfoRest.js";
import "../components/Table/components/Elements.js";
import "../dayjs.min-KYonM6tp.js";
import "../components/Table/components/TdComponents/WrapperTableTdComponents.js";
import "../components/Table/components/variants.js";
import "../components/Table/components/Filters.js";
import "../hooks/useClickOutside.js";
import "../components/Table/context/useCases.js";
import "../components/Table/hooks/usePaginationSelector.js";
import "../components/Table/hooks/useHandleInputWithTimer.js";
import "../components/Table/components/TableStatesComponents.js";
import "../components/Table/components/HeaderComponents/QuickSearch.js";
import "../composables/FunctionalComponents.js";
import "../hooks/useDebounce.js";
import "../hooks/useLoadFiles.js";
import "../style.module-m7wnmRz9.js";
const d = async () => {
  const r = await n.post("external/departments").then((t) => t.data).catch((t) => {
    console.error(t);
  });
  return (r == null ? void 0 : r.Departamentos) ?? [];
}, h = async (r) => {
  const t = await n.post("external/municipalities", { departmentId: r }).then((o) => o.data).catch((o) => {
    console.error(o);
  });
  return (t == null ? void 0 : t.Municipios) ?? [];
}, Kt = ({ className: r, prefix: t = "", style: o, departmentCurrenId: i, municipalityCurrentId: m }) => {
  const { data: s = [], error: e, isPending: c } = u({ queryKey: ["departments"], queryFn: d });
  return e ? /* @__PURE__ */ p("span", { className: "_text-red-500", children: e.message }) : c ? /* @__PURE__ */ p("div", { className: "_h-[42px] _w-full loader _mt-2" }) : /* @__PURE__ */ l(y.InputsWrapper, { className: r, style: o, children: [
    /* @__PURE__ */ p(a.SelectFormCntx, { currentId: i || t + "department", optionsEntries: ["Key", "Value"], selectOptions: s, label: "Departamento*" }),
    /* @__PURE__ */ p(
      a.SelectByAnotherField,
      {
        targetValue: i || t + "department",
        optionsEntries: ["Key", "Value"],
        currentId: m || t + "municipality",
        fetchOptions: h,
        label: "Municipio*"
      }
    )
  ] });
};
export {
  Kt as SelectMunicipality
};
