import { jsx as r, jsxs as n, Fragment as c } from "react/jsx-runtime";
import { useLoadFrmType as u, useLoadFiles as d, useGetParamsByQuery as p } from "./hooks/useLoadFiles.js";
import { Q as f } from "./useQuery-n4ls1rLk.js";
import { J as a } from "./react-jsx-parser.min-PKxwP4S0.js";
import s from "./components/Buttons/index.js";
import _ from "./components/Card/index.js";
import { AppFormProvider as h } from "./components/FormProvider.js";
import m from "./components/Layouts.js";
import F from "./composables/FormInputs.js";
import { ActivitiesCards as g } from "./composables/govco/CardActivities.js";
import { CardsSignatories as x } from "./composables/govco/CardSignatories.js";
import { FeatureComponents as C } from "./feature/index.js";
import { GeneralStoreProvider as v } from "./context/generalContext/index.js";
import { staticOptions as y } from "./config/index.js";
import { ConfigForm as N } from "./config.js";
import { Q as B } from "./index-UEnzNNJg.js";
const H = ({ config: e, queryConfig: o }) => {
  const t = new B(o);
  return e.guid_form ? /* @__PURE__ */ r(f, { client: t, children: /* @__PURE__ */ r(v, { defaultValue: { mainConfig: e }, children: /* @__PURE__ */ r("div", { className: "_px-[60px] _pt-10 _pb-20 _bg-[#F2F2F2] _w-full _min-h-screen", children: /* @__PURE__ */ n("div", { className: "green__theme form__wrapper _max-w-7xl _mx-auto", children: [
    /* @__PURE__ */ r(N, {}),
    /* @__PURE__ */ r(P, {})
  ] }) }) }) }) : /* @__PURE__ */ r("h1", { className: "_text-red-600", children: "Por favor ingresar la configuración inicial" });
}, w = () => {
  const { configFrm: e, error: o, isPending: t } = u();
  return t ? /* @__PURE__ */ r("h4", { children: "Loading" }) : o ? /* @__PURE__ */ r("h1", { className: "_text-red-600", children: o.message }) : e ? (
    //@ts-ignore
    /* @__PURE__ */ r(
      a,
      {
        bindings: { age: 2023, staticOptions: y, signatoriesUrl: "external/signatories" },
        components: { FormInput: F, Layouts: m, Buttons: s, Card: _, ActivitiesCards: g, CardsSignatories: x, FeatureComponents: C },
        jsx: e.jsx || ""
      }
    )
  ) : /* @__PURE__ */ r("h1", { className: "_text-red-600", children: "Opps, no se encontró una configuración" });
}, P = () => {
  const { validationScheme: e, isPending: o, error: t } = d(), { values: i } = p();
  return o ? /* @__PURE__ */ n(c, { children: [
    /* @__PURE__ */ r("div", { className: "loader _h-20 _w-full" }),
    /* @__PURE__ */ r("div", { className: "loader _h-10 _w-full _mt-2" }),
    /* @__PURE__ */ r("div", { className: "loader _h-40 _w-full _mt-2" }),
    /* @__PURE__ */ r("div", { className: "loader _h-80 _w-full _mt-2" }),
    /* @__PURE__ */ r("div", { className: "loader _h-80 _w-full _mt-2" }),
    /* @__PURE__ */ r("div", { className: "loader _h-10 _w-full _mt-2" })
  ] }) : t ? /* @__PURE__ */ r("h1", { className: "_text-red-600", children: t.message }) : e ? (
    //@ts-ignore
    /* @__PURE__ */ r(
      a,
      {
        bindings: {
          initialValues: { department: +(i == null ? void 0 : i.DptCod), municipality: i == null ? void 0 : i.MunCod },
          submit: (l) => {
            console.log("data", l);
          },
          schema: e
        },
        components: { AppFormProvider: h, Inputs: w, Buttons: s, Layouts: m },
        jsx: (
          /*jsx*/
          `
                <>
                    <Layouts.HeaderFormSection formConsecutive={10000202020020202} formNumber={300} formTitle="Formulario único nacional de declaración y pago del impuesto de industria y comercio" />
                    <AppFormProvider defaultValue={initialValues} className="_py-[8px]" submit={submit} schema={schema}>
                      <Inputs/>

                      <Layouts.FooterFormSection>
                          <Buttons.CancelButton>
                              Salir
                          </Buttons.CancelButton>

                          <div>
                              <Buttons.CheckFormButton>
                                  Revisar
                              </Buttons.CheckFormButton>

                              <Buttons.FormButton>
                                  Continuar
                              </Buttons.FormButton>
                          </div>
                      </Layouts.FooterFormSection>
                    </AppFormProvider>
                </>
          `
        )
      }
    )
  ) : /* @__PURE__ */ r("h1", { className: "_text-red-600", children: "Opps, no se encontraron" });
};
export {
  w as FormContent,
  P as FormMainLayout,
  H as FormString
};
