import { jsxs as r, Fragment as p, jsx as t } from "react/jsx-runtime";
import { useState as C } from "react";
import { u as x } from "../../index.esm-BQxOvVZs.js";
import e from "../../components/AlertDialog/index.js";
import n from "../../components/Buttons/index.js";
import { T as g } from "../../index-5sPke2Og.js";
import { useModalContext as y } from "../../context/generalContext/index.js";
import "react-dom";
import "../../components/Icons.js";
import "../../utils/functions.js";
import "../../clsx-7d8NmkQq.js";
import "../../utils/components/RenderIf.js";
import "../../components/AlertDialog/variants.js";
import "../../index-xVF7D3FM.js";
import "../../components/Buttons/variants.js";
import "../../useQuery-n4ls1rLk.js";
import "../../components/Table/components/Basic.js";
import "../../axios-f2q_J-wz.js";
import "../../utils/components/RenderEach.js";
import "../../components/Table/context/index.js";
import "../../context/index.js";
import "../../components/Table/utils/useTableInfoRest.js";
import "../../components/Table/components/Elements.js";
import "../../dayjs.min-KYonM6tp.js";
import "../../_commonjsHelpers-2ufMB8rV.js";
import "../../components/Table/components/TdComponents/WrapperTableTdComponents.js";
import "../../components/Table/components/variants.js";
import "../../motion-dVICNqWI.js";
import "../../SVGVisualElement-aqO4D4Z5.js";
import "../../LayoutGroupContext-3euHzeKi.js";
import "../../components/Table/components/Filters.js";
import "../../hooks/useClickOutside.js";
import "../../index-20bzTFSx.js";
import "../../components/Inputs/variants.js";
import "../../components/Table/context/useCases.js";
import "../../components/Table/hooks/usePaginationSelector.js";
import "../../components/Table/hooks/useHandleInputWithTimer.js";
import "../../index-T7wQHOux.js";
import "../../use-unmount-effect-Wy5iLAex.js";
import "../../components/Table/components/TableStatesComponents.js";
import "../../components/Table/components/HeaderComponents/QuickSearch.js";
import "../../index-CfwdJLFE.js";
import "../../composables/FunctionalComponents.js";
import "../../hooks/useDebounce.js";
const h = [
  {
    cellParam: "a",
    cellType: "text",
    columnName: "",
    cellComponent: {
      componentKey: "InputRadio",
      targetId: "id",
      oneTarget: !0
    },
    isAction: !0
  },
  {
    cellParam: "actividad_id",
    cellType: "text",
    columnName: "Cód. Mun",
    thClassName: "w-[20px]",
    canSort: !0,
    filter: {
      param: "actividad_id",
      type: "text"
    }
  },
  {
    cellParam: "actividad_decripcion",
    cellType: "longText",
    columnName: "Actividad Económica",
    thClassName: "w-full",
    filter: {
      param: "actividad_decripcion",
      type: "text"
    }
  },
  {
    cellParam: "actividad_tarifa",
    cellType: "text",
    columnName: "Tarifa",
    thClassName: "w-[40px]",
    customCellComponent: (a) => /* @__PURE__ */ r(p, { children: [
      a == null ? void 0 : a.actividad_tarifa,
      " * 1000"
    ] })
    // filter: {
    //     param: "actividad_tarifa",
    //     type: "text"
    // }
  },
  {
    cellParam: "actividad_codigo_ciiu",
    cellType: "text",
    columnName: "Cód. CIIU",
    canSort: !0,
    filter: {
      param: "actividad_codigo_ciiu",
      type: "text"
    }
  },
  {
    cellParam: "actividad_descripcion_ciiu",
    cellType: "longText",
    columnName: "Actividad CIIU Relacionada",
    filter: {
      param: "actividad_descripcion_ciiu",
      type: "text"
    }
  }
], A = {
  newPropertyName: "id",
  targetItems: ["actividad_id", "actividad_codigo_ciiu"],
  targetIdProperty: "items"
}, ut = () => {
  const { setValue: a } = x(), [i, s] = C(), { modalInfo: c, setModal: u } = y(), { index: v } = c.content, o = () => {
    c.type && u(void 0);
  }, _ = () => {
    i && (a(
      `activities.${v}`,
      {
        activityCode: i.actividad_codigo_ciiu || i.actividad_id,
        tarifa: i.actividad_tarifa,
        activityDescription: i.actividad_descripcion_ciiu || i.actividad_decripcion,
        taxableIncome: "",
        taxValue: ""
      },
      {
        shouldValidate: !0
      }
    ), o());
  }, m = (l) => {
    const f = Object.keys(l), d = l[f[0]];
    d && s(d);
  };
  return /* @__PURE__ */ r(p, { children: [
    /* @__PURE__ */ t(e.AlertDialogHeader, { variants: { variant: "govco" }, closeModal: o, children: "Seleccionar Actividad Principal" }),
    /* @__PURE__ */ t("div", { className: "_w-full _h-full _max-w-[90%] _min-h-[400px] _mx-auto", children: /* @__PURE__ */ t(
      g,
      {
        data: [],
        tableConfig: h,
        wrapperClassName: "_min-h-[220px] _max-h-[400px]",
        url: "https://nodejs.softwaretributario.com:7001/actividad_ciiu/findAllActividadesCiu/ICAT/2023",
        pagination: {
          page: "1",
          limit: "10"
        },
        mutateDataConfig: A,
        setItems: m,
        setterDataConfig: {
          setterFn: m,
          targetDataId: "checkedData"
        }
      }
    ) }),
    /* @__PURE__ */ r(e.AlertDialogFooter, { variants: { variant: "govco" }, children: [
      /* @__PURE__ */ t(e.AlertDialogCancel, { asChild: !0, onClick: o, children: /* @__PURE__ */ t(n.Button, { variant: "bordered-error", children: "Cancelar" }) }),
      /* @__PURE__ */ t(e.AlertDialogAction, { asChild: !0, children: /* @__PURE__ */ t(n.Button, { onClick: _, children: "Continue" }) })
    ] })
  ] });
};
export {
  ut as default
};
