import { U as UICompBuilder, ed as language, ee as createRoot, av as trans, ah as Section, dr as columnPropertyView, aj as withExposingConfigs, au as NameConfig, ao as CompDepsConfig, c_ as dropdownControl, ef as DataOptions, ds as withIsLoadingMethod, dt as JSONObjectArrayControl, a6 as StringControl, w as withDefault, eg as DatagridColItemListComp, eh as SummaryListComp, ei as ButtonActionListComp, a4 as BoolControl, ej as EditModeOptions, ek as SortingModeOptions, cv as NumberControl, el as PagerModeOptions, em as SelectModeOptions, en as SelectAllModeOption, eo as ShowCheckBoxesModeOptions, ep as ExportOptions, ar as eventHandlerControl, eq as DatagridEventOptions, dQ as BoolCodeControl, er as SelectionControl, es as PaginationControl, et as CellControl, eu as ColumnControl, ev as CurrentRowControl, ew as LastChangeControl, ex as DataManualExControl, ey as i18nObjs } from "./index-8935f1b4.js";
import { C as Column, R as RequiredRule, P as PatternRule, a as RangeRule, E as EmailRule, L as Lookup, b as CustomStore, c as ColumnChooser, d as ColumnFixing, H as HeaderFilter, F as FilterRow, e as FilterPanel, S as Scrolling, f as Search, g as Paging, h as Pager, G as Grouping, i as GroupPanel, j as SearchPanel, k as Export, l as Selection, m as Sorting, n as Editing, B as Button, o as Summary, p as GroupItem, T as TotalItem, q as exportDataGrid, D as DataGrid } from "./devextreme-28d23085.js";
import { e as exceljs_minExports } from "./exceljs-1678d36b.js";
import { s as saveAs } from "./file-saver-es-c18fae8f.js";
import { f as lodashExports, _ } from "./lodash-226cb5b1.js";
import { memo, useRef, useEffect, useMemo, useCallback, useLayoutEffect } from "react";
import { d as dt } from "./styled-components-c6abe9a3.js";
import { getCellRenderer } from "./cellRenderUtils-46a94b16.js";
import { SavedRowsDataControl } from "./savedRowsDataControl-325230fe.js";
import { lA as jsx, lS as Fragment, lR as jsxs } from "./ant-design-icons-14ab96af.js";
import { r as App } from "./antd-97b654da.js";
import "./axios-125479b5.js";
import "./redux-devtools-f8b1cd80.js";
import "./alasql-f59e855e.js";
import "./react-router-8d1fc2f1.js";
import "./fontawesome-89eb6278.js";
import "react-dom";
import "./dnd-kit-e67c9595.js";
import "./moment-d8baa15a.js";
import "./crypto-js-8020edb5.js";
import "./dayjs-7fc5ce65.js";
import "./numbro-48e81844.js";
import "./papaparse-088c0adc.js";
import "./uuid-82f303b2.js";
import "./supabase-2e4a9112.js";
import "./fetch-6a200310.js";
import "./react-draggable-fda4f1cb.js";
import "./remark-gfm-e9b5dec7.js";
import "./buffer-e20f80c8.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-cab52c82.js";
import "./react-best-gradient-color-picker-812be7ee.js";
import "./ua-parser-js-1d18a3f8.js";
import "./clsx-469c2c43.js";
import "./loglevel-5e7e37fc.js";
import "./codemirror-edf161cb.js";
import "./really-relaxed-json-e5391d6a.js";
import "./immer-c0428a8d.js";
import "./redux-saga-1b0a458d.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-8c3eaa86.js";
import "./react-documents-ae08f8b5.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-9e54e169.js";
import "./react-json-view-364658b4.js";
import "./qrcode-react-e4f7745b.js";
import "./katex-cda5b990.js";
import "./ecogis-maps-10bb29cf.js";
const ColumnRenderer = memo(({ columnItem: e, createCellRenderer: t, createCellValueCalculator: o, getFiltered: a }) => jsx(Fragment, { children: e.map((e2, r) => jsxs(Column, { name: e2.dataField, caption: e2.caption, dataField: e2.dataField, dataType: !e2.children && e2.dataType, format: !e2.children && e2.formatType, visible: !e2.hidden, allowEditing: e2.editable, allowExporting: e2.exportable, allowFiltering: e2.filterable, fixed: !!["left", "right", "sticky"].includes(e2.fixedPosition) || void 0, fixedPosition: ["left", "right", "sticky"].includes(e2.fixedPosition) ? e2.fixedPosition : void 0, allowGrouping: !e2.children, groupIndex: !e2.children && e2.isGroup ? e2.groupIndex : void 0, autoExpandGroup: !e2.children && e2.isGroup ? e2.autoExpandGroup : void 0, cellRender: t(e2), calculateCellValue: o(e2), alignment: e2.align, width: "fixed" == e2.autoWidth ? e2.width : void 0, children: [e2.required && jsx(RequiredRule, { message: e2.msgRequired }), e2.pattern && jsx(PatternRule, { pattern: e2.pattern, message: e2.msgPattern }), e2.rangeValidation && jsx(RangeRule, { min: Number(e2.rangeValidationMin), max: Number(e2.rangeValidationMax), message: e2.msgRange }), e2.emailValidation && jsx(EmailRule, { message: e2.msgEmail }), e2.lookup && jsx(Lookup, { allowClearing: true, dataSource: "" !== e2.lookupDataFilter ? (t2) => a(t2, e2.lookupData, e2.lookupDataFilter) : e2.lookupData, displayExpr: e2.displayExpr, valueExpr: e2.valueExpr }), e2.children && e2.children.map((a2, n) => jsxs(Column, { name: a2.dataField, caption: a2.caption, dataField: a2.dataField, dataType: !a2.children && a2.dataType, format: !a2.children && a2.formatType, visible: !a2.hidden, allowEditing: a2.editable, allowExporting: a2.exportable, allowFiltering: a2.filterable, fixed: !!["left", "right", "sticky"].includes(a2.fixedPosition) || void 0, fixedPosition: ["left", "right", "sticky"].includes(a2.fixedPosition) ? a2.fixedPosition : void 0, allowGrouping: !a2.children, groupIndex: !a2.children && a2.isGroup ? a2.groupIndex : void 0, autoExpandGroup: !a2.children && a2.isGroup ? a2.autoExpandGroup : void 0, alignment: a2.align, width: "fixed" == a2.autoWidth ? a2.width : void 0, cellRender: t(a2), calculateCellValue: o(a2), children: [a2.required && jsx(RequiredRule, { message: e2.msgRequired }), a2.pattern && jsx(PatternRule, { pattern: a2.pattern, message: e2.msgPattern }), a2.rangeValidation && jsx(RangeRule, { min: a2.rangeValidationMin, max: a2.rangeValidationMax, message: e2.msgRange }), a2.emailValidation && jsx(EmailRule, { message: e2.msgEmail }), a2.lookup && jsx(Lookup, { allowClearing: true, dataSource: a2.lookupData, displayExpr: a2.displayExpr, valueExpr: a2.valueExpr })] }, a2.caption || `${r}-${n}`))] }, e2.caption || r)) })), DEBOUNCE_TIME = 100, replaceFilterTextsInDOM = () => {
  if ("vi" === language) {
    const e = { Contains: trans("datagrid.filterOperations.contains"), "Does not contain": trans("datagrid.filterOperations.notContains"), "Starts with": trans("datagrid.filterOperations.startsWith"), "Ends with": trans("datagrid.filterOperations.endsWith"), Equals: trans("datagrid.filterOperations.equals"), "Does not equal": trans("datagrid.filterOperations.notEquals"), "Less than": trans("datagrid.filterOperations.lessThan"), "Less than or equal to": trans("datagrid.filterOperations.lessThanOrEqual"), "Greater than": trans("datagrid.filterOperations.greaterThan"), "Greater than or equal to": trans("datagrid.filterOperations.greaterThanOrEqual"), Between: trans("datagrid.filterOperations.between"), "Is blank": trans("datagrid.filterOperations.isBlank"), "Is not blank": trans("datagrid.filterOperations.isNotBlank"), Reset: trans("datagrid.filterOperations.reset"), "Select All": trans("datagrid.headerFilter.selectAll"), Cancel: trans("datagrid.headerFilter.cancel"), "Create Filter": trans("datagrid.headerFilter.createFilter") };
    [".dx-menu-item-text", ".dx-list-item-content", ".dx-list-select-all-label", ".dx-button-text", ".dx-datagrid-filter-panel-text"].forEach((t) => {
      document.querySelectorAll(t).forEach((t2) => {
        var _a;
        const o = (_a = t2.textContent) == null ? void 0 : _a.trim();
        o && e[o] && (t2.textContent = e[o]);
      });
    });
  }
}, DatagridStyled = dt(DataGrid)`
  .dx-datagrid-rowsview .dx-row-focused.dx-data-row .dx-command-edit .dx-link,
  .dx-datagrid-rowsview
    .dx-row-focused.dx-data-row
    > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-datagrid-invalid) {
    background-color: #d0e5fb;
    color: #242424 !important;
  }

  .dx-command-edit .dx-link,
  .dx-command-delete .dx-link {
    transition: all 0.2s ease-in-out;
    border-radius: 4px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dx-command-edit .dx-link:hover {
    background-color: #e6f3ff !important;
    color: #1890ff !important;
    transform: scale(1.1);
  }

  .dx-command-delete .dx-link:hover {
    background-color: #ffebee !important;
    color: #f5222d !important;
    transform: scale(1.1);
  }

  .dx-command-edit .dx-link:hover .dx-icon,
  .dx-command-delete .dx-link:hover .dx-icon {
    opacity: 1;
    filter: brightness(1.2);
  }

  .dx-toolbar-after,
  .dx-command-edit-with-icons {
    svg.svg-inline--fa {
      width: 18px !important;
      height: 18px !important;
    }
  }

  .dx-command-edit .dx-icon-edit:hover,
  .dx-command-delete .dx-icon-trash:hover {
    transition: transform 0.2s ease-in-out;
    transform: scale(1.2);
  }

  .dx-command-edit .dx-link:active,
  .dx-command-delete .dx-link:active {
    transform: scale(0.95);
  }

  .dx-scrollable-native.dx-scrollable-both,
  .dx-scrollable-native.dx-scrollable-both
    > .dx-scrollable-wrapper
    > .dx-scrollable-container {
    overflow-x: hidden;
    overflow-y: hidden;
  }
  .dx-editor-cell.dx-datagrid-first-header.dx-datagrid-sticky-column-left.dx-datagrid-sticky-column-border-right.dx-datagrid-readonly.dx-cell-focus-disabled {
    padding: 15px 16px 14px !important;
  }
  .dx-editor-cell.dx-datagrid-first-header.dx-datagrid-sticky-column-left.dx-datagrid-sticky-column-border-right.dx-datagrid-readonly.dx-focused {
    padding: 15px 16px 14px !important;
  }
  .dx-row.dx-freespace-row.dx-column-lines {
    display: none;
  }
  .dx-widget.dx-checkbox.dx-select-checkbox.dx-datagrid-checkbox-size {
    display: inline-block;
  }
`;
function useDeepStable(e) {
  const t = useRef(e);
  return _.isEqual(t.current, e) || (t.current = e), t.current;
}
const childrenMap = { dataOptions: dropdownControl(DataOptions, "manual"), dataManual: withIsLoadingMethod(JSONObjectArrayControl), dataApi: StringControl, dataKeyExpr: withDefault(StringControl, "ID"), columns: DatagridColItemListComp, summary: SummaryListComp, customButtonsHead: ButtonActionListComp, customButtonRow: ButtonActionListComp, showColumnChooser: withDefault(BoolControl, true), showColumnFixing: withDefault(BoolControl, true), editable: withDefault(BoolControl, true), editMode: dropdownControl(EditModeOptions, "form"), editShowIcon: withDefault(BoolControl, true), confirmDelete: withDefault(BoolControl, true), sortingMode: dropdownControl(SortingModeOptions, "multiple"), showFilterPanel: withDefault(BoolControl, true), showFilterRow: BoolControl, showSearch: withDefault(BoolControl, true), searchVisibleColumnsOnly: BoolControl, showPaging: withDefault(BoolControl, true), pageSize: withDefault(NumberControl, 5), pageIndex: withDefault(NumberControl, 0), pagerMode: dropdownControl(PagerModeOptions, "full"), pagerShowPageSizeSelector: withDefault(BoolControl, true), pagerShowInfo: withDefault(BoolControl, true), pagerShowNavigationButtons: withDefault(BoolControl, true), code: StringControl, showScrolling: withDefault(BoolControl, true), showGroupPanel: withDefault(BoolControl, true), showGroupContextMenu: withDefault(BoolControl, true), groupAutoExpand: BoolControl, selectMode: dropdownControl(SelectModeOptions, "multiple"), selectAllMode: dropdownControl(SelectAllModeOption, "page"), showCheckBoxesMode: dropdownControl(ShowCheckBoxesModeOptions, "onClick"), showExport: BoolControl, exportMode: dropdownControl(ExportOptions, "pdf"), showBorders: withDefault(BoolControl, true), showColumnLines: withDefault(BoolControl, true), showRowLines: BoolControl, alternatingRow: BoolControl, columnAutoWidth: withDefault(BoolControl, false), columnHidingEnabled: BoolControl, focusedRowEnabled: withDefault(BoolControl, true), wordWrapEnabled: withDefault(BoolControl, true), onEvent: eventHandlerControl(DatagridEventOptions), loading: BoolCodeControl, showLoading: BoolControl, selectionControl: SelectionControl, paginationControl: PaginationControl, cellControl: CellControl, columnControl: ColumnControl, currentRow: CurrentRowControl, savedRowsDataControl: SavedRowsDataControl, lastChange: LastChangeControl, dataManualEx: DataManualExControl }, CusButton = dt.span`
  margin: 0 4px;
  vertical-align: middle;
  color: ${(e) => e.$textColor || "#666666"};
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  &:hover {
    color: ${(e) => e.$hoverColor || "#1890ff"};
    background-color: ${(e) => `${e.$hoverColor || "#1890ff"}15`};
    transform: scale(1.1);
  }
`;
function isNotEmpty(e) {
  return null != e && "" !== e;
}
const DatagridBasicComp = new UICompBuilder(childrenMap, (props) => {
  const dataGridRef = useRef(null), { message } = App.useApp(), exportingTimeoutRef = useRef(null), savedTimeoutRef = useRef(null), columnFilterValueChangeTimeoutRef = useRef(null), toolbarPreparingTimeoutRef = useRef(null);
  useEffect(() => {
    let e = null;
    const t = () => {
      e && clearTimeout(e), e = setTimeout(() => {
        replaceFilterTextsInDOM();
      }, 100);
    };
    t();
    const o = new MutationObserver((e2) => {
      let o2 = false;
      e2.forEach((e3) => {
        "childList" === e3.type && e3.addedNodes.forEach((e4) => {
          var _a, _b, _c;
          if (e4.nodeType === Node.ELEMENT_NODE) {
            const t2 = e4;
            (((_a = t2.classList) == null ? void 0 : _a.contains("dx-popup")) || ((_b = t2.classList) == null ? void 0 : _b.contains("dx-header-filter-menu")) || ((_c = t2.querySelector) == null ? void 0 : _c.call(t2, ".dx-menu-item-text, .dx-list-item-content, .dx-list-select-all-label, .dx-button-text, .dx-datagrid-filter-panel-text"))) && (o2 = true);
          }
        });
      }), o2 && t();
    });
    return o.observe(document.body, { childList: true, subtree: true }), () => {
      o.disconnect(), e && clearTimeout(e), null !== exportingTimeoutRef.current && (clearTimeout(exportingTimeoutRef.current), exportingTimeoutRef.current = null), null !== savedTimeoutRef.current && (clearTimeout(savedTimeoutRef.current), savedTimeoutRef.current = null), null !== columnFilterValueChangeTimeoutRef.current && (clearTimeout(columnFilterValueChangeTimeoutRef.current), columnFilterValueChangeTimeoutRef.current = null), null !== toolbarPreparingTimeoutRef.current && (clearTimeout(toolbarPreparingTimeoutRef.current), toolbarPreparingTimeoutRef.current = null);
    };
  }, [language]);
  const store = useMemo(() => new CustomStore({ key: props.dataKeyExpr, async load(e) {
    const t = ["skip", "take", "requireTotalCount", "requireGroupCount", "sort", "filter", "totalSummary", "group", "groupSummary"].filter((t2) => isNotEmpty(e[t2])).map((t2) => `${t2}=${JSON.stringify(e[t2])}`).join("&");
    try {
      const e2 = await fetch(`${props.dataApi}?${t}`), o = await e2.json();
      return { data: o.data, totalCount: o.totalCount, summary: o.summary, groupCount: o.groupCount };
    } catch (e2) {
      throw new Error("Data Loading Error");
    }
  }, async insert(e) {
    try {
      if (!(await fetch(props.dataApi, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(e) })).ok)
        throw new Error("Data Insertion Error");
    } catch (e2) {
      throw new Error("Data Insertion Error");
    }
  }, async update(e, t) {
    try {
      if (!(await fetch(`${props.dataApi}/${e}`, { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(t) })).ok)
        throw new Error("Data Update Error");
    } catch (e2) {
      throw new Error("Data Update Error");
    }
  }, async remove(e) {
    try {
      if (!(await fetch(`${props.dataApi}/${e}`, { method: "DELETE" })).ok)
        throw new Error("Data Deletion Error");
    } catch (e2) {
      throw new Error("Data Deletion Error");
    }
  } }), [props.dataApi, props.dataKeyExpr]), createCellRenderer = useCallback((e) => e.customRender ? (t) => {
    let o = 0, a = 0;
    if (dataGridRef.current) {
      const e2 = dataGridRef.current.instance();
      o = e2.pageSize(), a = e2.pageIndex();
    }
    const r = { value: t.value, data: t.data, rowIndex: t.rowIndex, columnIndex: t.columnIndex, column: { customRender: e.customRender, onClick: e.onClick, trueText: e.trueText, falseText: e.falseText }, text: t.text, row: t.data, index: o * a + t.rowIndex + 1 }, n = getCellRenderer(r.column);
    return n ? n(r) : t.value;
  } : void 0, []), createCellValueCalculator = useCallback((e) => e.calculateCellValue ? (t) => {
    try {
      if ("string" == typeof e.calculateCellValue)
        return new Function("data", `return ${e.calculateCellValue}`)(t);
      if ("function" == typeof e.calculateCellValue)
        return e.calculateCellValue(t);
    } catch (e2) {
      console.error("Error in calculateCellValue:", e2, t);
    }
    return t[e.dataField];
  } : void 0, []), onExporting = (e) => {
    null !== exportingTimeoutRef.current && (clearTimeout(exportingTimeoutRef.current), exportingTimeoutRef.current = null), exportingTimeoutRef.current = setTimeout(() => {
      props.onEvent("exporting");
    });
    const t = new exceljs_minExports.Workbook(), o = t.addWorksheet(trans("datagrid.mainSheet"));
    exportDataGrid({ component: e.component, worksheet: o, autoFilterEnabled: true }).then(() => {
      t.xlsx.writeBuffer().then((e2) => {
        saveAs(new Blob([e2], { type: "application/octet-stream" }), "download.xlsx");
      });
    });
  }, handleColumnSortOrderChange = (e) => {
    var _a, _b, _c;
    const t = (_a = dataGridRef.current) == null ? void 0 : _a.instance().state().columns;
    if (!t || !Array.isArray(t))
      return;
    const o = Number(((_c = (_b = e.fullName) == null ? void 0 : _b.match(/\[(\d+)\]/)) == null ? void 0 : _c[1]) || -1);
    if (-1 === o)
      return;
    const a = t[o];
    if (a) {
      const t2 = a.dataField;
      props.columnControl.updateSort(o, t2, e.value);
    }
  };
  function findDifferences(e, t) {
    const o = (e2) => e2 ? Array.isArray(e2) ? e2 : "object" == typeof e2 && 0 === Object.keys(e2).length ? [] : [e2] : [], a = o(e), r = o(t), n = /* @__PURE__ */ new Map();
    a.forEach((e2) => n.set(e2.key, e2));
    for (const e2 of r) {
      const t2 = n.get(e2.key), o2 = e2.data;
      if (t2) {
        const a2 = t2.data;
        for (const t3 in o2)
          if (a2[t3] !== o2[t3])
            return { columnName: t3, index: dataGridRef.current ? dataGridRef.current.instance().getRowIndexByKey(e2.key) : e2.key, value: o2[t3] };
      } else
        for (const t3 in o2)
          return { columnName: t3, index: dataGridRef.current ? dataGridRef.current.instance().getRowIndexByKey(e2.key) : e2.key, value: o2[t3] };
    }
    return null;
  }
  const onOptionChanged = (e) => {
    var _a, _b, _c, _d;
    switch (e.name) {
      case "columns":
        ((_a = e.fullName) == null ? void 0 : _a.endsWith("sortOrder")) && handleColumnSortOrderChange(e);
        break;
      case "filterValue":
        if ("filterValue" === e.fullName) {
          const t = (_b = dataGridRef.current) == null ? void 0 : _b.instance().option("searchPanel.text");
          let o;
          if ("" !== t) {
            const a = columnItem.flatMap((e2, o2) => {
              const a2 = [e2.dataField, "contains", t];
              return o2 < columnItem.length - 1 ? [a2, "or"] : [a2];
            });
            o = [e.value, "and", ...a];
          } else
            o = e.value;
          onColumnFilterValueChange(o);
        }
        break;
      case "searchPanel":
        if ("searchPanel.text" === e.fullName) {
          const t = columnItem.flatMap((t2, o2) => {
            const a2 = [t2.dataField, "contains", e.value];
            return o2 < columnItem.length - 1 ? [a2, "or"] : [a2];
          }), o = (_c = dataGridRef.current) == null ? void 0 : _c.instance().option("filterValue"), a = o ? [o, "and", ...t] : t;
          onColumnFilterValueChange(a);
        }
        break;
      case "paging":
        switch (e.fullName) {
          case "paging.pageIndex":
            onPageIndexChange(e.value);
            break;
          case "paging.pageSize":
            onPageSizeChange(e.value);
        }
        break;
      case "editing":
        if ("editing.changes" === e.fullName) {
          if (0 !== e.value.length) {
            const t = localStorage.getItem("lastChange");
            let o = {};
            if (t)
              try {
                o = JSON.parse(t);
              } catch {
                o = {};
              }
            (_d = dataGridRef.current) == null ? void 0 : _d.instance().updateDimensions(), localStorage.setItem("lastChange", JSON.stringify(e.value));
            const a = findDifferences(o, e.value);
            props.lastChange.updateLastChange(a), a && dataGridRef.current && props.onEvent("rowUpdated");
          }
        }
    }
  }, onPageIndexChange = useCallback(lodashExports.debounce((e) => {
    props.paginationControl.updatePageIndex(e), props.onEvent("pageIndexChange");
  }, DEBOUNCE_TIME), [props.onEvent, message]), onPageSizeChange = useCallback(lodashExports.debounce((e) => {
    props.paginationControl.updatePageSize(e), props.onEvent("pageSizeChange");
  }, DEBOUNCE_TIME), [props.onEvent, message]), onCellClick = useCallback(lodashExports.debounce((e) => {
    var _a, _b;
    const t = props.dataKeyExpr, o = ((_a = e == null ? void 0 : e.row) == null ? void 0 : _a.key) ?? ((_b = e == null ? void 0 : e.data) == null ? void 0 : _b[t]);
    if (dataGridRef.current && null != o)
      try {
        dataGridRef.current.instance().option("focusedRowKey", o);
      } catch {
      }
    props.onEvent("cellClick");
  }, 50), [props.onEvent, message, props.dataKeyExpr]), applyChangesToData = (e, t, o) => {
    let a = [...e];
    return t.forEach((e2, t2) => {
      const { data: r, key: n, type: l } = e2;
      if ("update" === l) {
        const e3 = a.findIndex((e4) => e4.ID === n || e4.id === n || e4.key === n);
        if (-1 !== e3) {
          a[e3] = { ...a[e3], ...r };
          const t3 = recalculateItemCellValues(a[e3], o);
          a[e3] = t3;
        } else
          console.warn(`  Không tìm thấy item với key: ${n}`);
      } else if ("insert" === l) {
        const e3 = recalculateItemCellValues(r, o);
        a.push(e3);
      } else if ("remove" === l) {
        const e3 = a.findIndex((e4) => e4.ID === n || e4.id === n || e4.key === n);
        -1 !== e3 && a.splice(e3, 1);
      }
    }), a;
  }, recalculateItemCellValues = (e, t) => {
    const o = { ...e };
    return t.filter((e2) => !!e2.calculateCellValue && ("string" == typeof e2.calculateCellValue ? "" !== e2.calculateCellValue.trim() : "function" == typeof e2.calculateCellValue)).forEach((e2) => {
      const t2 = createCellValueCalculator(e2);
      if (t2) {
        const a = o[e2.dataField], r = t2(o);
        o[e2.dataField] = r, console.log(`    Tính lại ${e2.dataField}: ${a} -> ${r}`);
      }
    }), o;
  }, onSaved = (e) => {
    null !== savedTimeoutRef.current && (clearTimeout(savedTimeoutRef.current), savedTimeoutRef.current = null), savedTimeoutRef.current = setTimeout(() => {
      props.onEvent("saved");
    });
    const t = localStorage.getItem("dataManualEx") || "[]", o = applyChangesToData(JSON.parse(t), e.changes, columnItem);
    localStorage.setItem("dataManualEx", JSON.stringify(o)), props.dataManualEx.updateDataManualEx(o), props.savedRowsDataControl.updateChanges(e.changes);
  }, onSaving = (e) => {
    props.onEvent("saving");
  }, onSelectionChanged = (e) => {
    props.selectionControl.updateSelection(e), props.onEvent("selectionChanged");
  }, onColumnFilterValueChange = useCallback(lodashExports.debounce((e) => {
    props.columnControl.updateFilter(e ?? []), null !== columnFilterValueChangeTimeoutRef.current && (clearTimeout(columnFilterValueChangeTimeoutRef.current), columnFilterValueChangeTimeoutRef.current = null), columnFilterValueChangeTimeoutRef.current = setTimeout(() => {
      props.onEvent("columnFilterValueChange");
    });
  }, DEBOUNCE_TIME), [props.onEvent, message]), customButtonRaw = useMemo(() => props.customButtonRow.map((e) => ({ text: e.children.label.getView(), icon: e.children.icon.getView(), tooltip: e.children.tooltip.getView(), textColor: e.children.textColor.getView(), hoverColor: e.children.hoverColor.getView(), onEvent: e.children.onEvent.getView() })), [props.customButtonRow]), customButton = useDeepStable(customButtonRaw), customButtonHeadRaw = useMemo(() => props.customButtonsHead.map((e) => ({ text: e.children.label.getView(), icon: e.children.icon.getView(), tooltip: e.children.tooltip.getView(), textColor: e.children.textColor.getView(), hoverColor: e.children.hoverColor.getView(), onEvent: e.children.onEvent.getView() })), [props.customButtonsHead]), customButtonHead = useDeepStable(customButtonHeadRaw), toolbarPreparedRef = useRef(false), toolbarItemsRef = useRef([]), buttonCountRef = useRef(0), initialRenderRef = useRef(true), handleToolbarPreparing = useCallback((e) => {
    if (toolbarPreparedRef.current) {
      if (toolbarItemsRef.current.length > 0) {
        const t = e.toolbarOptions.items;
        t.some((e2) => "dxButton" === e2.widget && customButtonHead.some((t2) => {
          var _a;
          return t2.text === ((_a = e2.options) == null ? void 0 : _a.name);
        })) || t.unshift(...toolbarItemsRef.current);
      }
    } else if (customButtonHead.length > 0) {
      initialRenderRef.current && (initialRenderRef.current = false), toolbarPreparedRef.current = true, buttonCountRef.current = customButtonHead.length;
      const t = e.toolbarOptions.items, o = customButtonHead.map((e2) => ({ widget: "dxButton", options: { name: e2.text, onClick: e2.onEvent, template: (t2, o2) => {
        const a = document.createElement("div");
        a.style.display = "flex", a.style.alignItems = "center", a.style.justifyContent = "center", a.style.color = e2.textColor || "#616161", a.style.padding = "6px 12px", a.style.borderRadius = "4px", a.style.transition = "all 0.2s ease-in-out", a.style.cursor = "pointer", e2.tooltip && (a.title = e2.tooltip), a.addEventListener("mouseenter", () => {
          a.style.color = e2.hoverColor || "#1890ff", a.style.backgroundColor = `${e2.hoverColor || "#1890ff"}15`, a.style.transform = "scale(1.05)";
        }), a.addEventListener("mouseleave", () => {
          a.style.color = e2.textColor || "#616161", a.style.backgroundColor = "transparent", a.style.transform = "scale(1)";
        });
        const r = document.createElement("span");
        a.appendChild(r);
        createRoot(r).render(e2.icon), o2.appendChild(a);
      } }, location: "after" }));
      toolbarItemsRef.current = o, t.unshift(...o), buttonCountRef.current === customButtonHead.length && (null !== toolbarPreparingTimeoutRef.current && (clearTimeout(toolbarPreparingTimeoutRef.current), toolbarPreparingTimeoutRef.current = null), toolbarPreparingTimeoutRef.current = setTimeout(() => {
        props.onEvent("toolbarPreparing");
      }));
    }
  }, []), onToolbarPreparing = useRef(handleToolbarPreparing).current, getColumItemValue = useCallback((e) => e.map((e2) => {
    const t = e2.children.items.getView();
    return { caption: e2.children.label.getView(), dataField: e2.children.dataField.getView(), dataType: e2.children.dataType.getView(), formatType: e2.children.formatType.getView(), autoWidth: e2.children.autoWidth.getView(), width: e2.children.width.getView(), editable: e2.children.editable.getView(), exportable: e2.children.exportable.getView(), filterable: e2.children.filterable.getView(), fixedPosition: e2.children.fixedPosition.getView(), headFilterable: e2.children.headFilterable.getView(), hidden: e2.children.hidden.getView(), searchable: e2.children.searchable.getView(), sortable: e2.children.sortable.getView(), isGroup: e2.children.isGroup.getView(), groupIndex: e2.children.groupIndex.getView(), autoExpandGroup: e2.children.autoExpandGroup.getView(), lookup: e2.children.lookup.getView(), lookupData: e2.children.lookupData.getView(), lookupDataFilter: e2.children.lookupDataFilter.getView(), valueExpr: e2.children.valueExpr.getView(), displayExpr: e2.children.displayExpr.getView(), align: e2.children.align.getView(), itemKey: e2.children.itemKey.getView(), ...t.length > 0 && { children: getColumItemValue(t) }, required: e2.children.required.getView(), msgRequired: e2.children.msgRequired.getView(), pattern: e2.children.pattern.getView(), msgPattern: e2.children.msgPattern.getView(), rangeValidation: e2.children.rangeValidation.getView(), msgRange: e2.children.msgRange.getView(), rangeValidationMin: e2.children.rangeValidationMin.getView(), rangeValidationMax: e2.children.rangeValidationMax.getView(), emailValidation: e2.children.emailValidation.getView(), msgEmail: e2.children.msgEmail.getView(), customRender: e2.children.customRender.getView(), calculateCellValue: e2.children.calculateCellValue.getView() };
  }), []), columnItemRaw = useMemo(() => getColumItemValue(props.columns), [props.columns, getColumItemValue]), columnItem = useDeepStable(columnItemRaw), stableManualData = useDeepStable(props.dataManual), dataSourceProps = useMemo(() => ({ dataSource: "manual" === props.dataOptions ? stableManualData : store, keyExpr: props.dataKeyExpr, remoteOperations: "api" === props.dataOptions }), [props.dataOptions, props.dataManual, store, props.dataKeyExpr]), eventHandlers = useRef({ onOptionChanged, onExporting, onToolbarPreparing, onCellClick, onSaved, onSelectionChanged, onSaving }).current, configProps = useRef({ allowColumnReordering: true, width: "100%", repaintChangesOnly: true, noDataText: trans("datagrid.noDataText"), cacheEnabled: true, twoWayBindingEnabled: false, renderAsync: false, columnResizingMode: "widget", hoverStateEnabled: false, autoExpandAll: false, showBorders: true, showColumnLines: true, showRowLines: false, alternatingRow: false, wordWrapEnabled: true, editShowIcon: true, confirmDelete: true, pagerMode: "full", pagerShowPageSizeSelector: true, pagerShowInfo: true, pagerShowNavigationButtons: true, searchVisibleColumnsOnly: false, showGroupContextMenu: true, groupAutoExpand: false, selectAllMode: "page", showCheckBoxesMode: "onClick", showScrolling: true, columnAutoWidth: false, columnHidingEnabled: false, focusedRowEnabled: true }).current, dataGridProps = { ...dataSourceProps, ...configProps, ...eventHandlers }, updateCalculatedCellValues = (e, t) => {
    const o = t.filter((e2) => !!e2.calculateCellValue && ("string" == typeof e2.calculateCellValue ? "" !== e2.calculateCellValue.trim() : "function" == typeof e2.calculateCellValue));
    if (0 === o.length)
      return e;
    const a = o.map((e2) => ({ col: e2, calculator: createCellValueCalculator(e2) }));
    return e.map((e2) => {
      const t2 = { ...e2 };
      return a.forEach(({ col: o2, calculator: a2 }) => {
        if (a2) {
          const r = a2(e2);
          t2[o2.dataField] = r;
        }
      }), t2;
    });
  };
  useLayoutEffect(() => {
    localStorage.setItem("lastChange", JSON.stringify([])), localStorage.setItem("dataManualEx", JSON.stringify([]));
  }, []), useEffect(() => {
    const e = updateCalculatedCellValues(props.dataManual, columnItem);
    props.dataManualEx.updateDataManualEx(e), localStorage.setItem("dataManualEx", JSON.stringify(e));
  }, []), useEffect(() => (toolbarPreparedRef.current = false, toolbarItemsRef.current = [], buttonCountRef.current = 0, initialRenderRef.current = true, () => {
    toolbarPreparedRef.current = false, toolbarItemsRef.current = [], buttonCountRef.current = 0, initialRenderRef.current = true;
  }), [customButtonHead]);
  const getSummaryItemValue = useCallback((e) => e.map((e2) => ({ key: e2.children.itemKey.getView(), summary: e2.children.summary.getView(), alignByColumn: e2.children.alignByColumn.getView(), alignment: e2.children.alignment.getView(), cssClass: e2.children.cssClass.getView(), column: e2.children.label.getView(), customizeText: e2.children.customizeText.getView(), displayFormat: e2.children.displayFormat.getView(), name: e2.children.name.getView(), showInColumn: e2.children.showInColumn.getView(), showInGroupFooter: e2.children.showInGroupFooter.getView(), skipEmptyValues: e2.children.skipEmptyValues.getView(), summaryType: e2.children.summaryType.getView(), valueFormat: e2.children.valueFormat.getView() })), []), summaryItemRaw = useMemo(() => getSummaryItemValue(props.summary), [props.summary, getSummaryItemValue]), summaryItem = useDeepStable(summaryItemRaw), exposedMethods = useMemo(() => ({ datagridTest: () => "abcd", dataManual: () => dataGridRef.current ? dataGridRef.current.instance().getDataSource() : null, getCellValue: (e, t) => dataGridRef.current ? dataGridRef.current.instance().cellValue(e, t) : null, setCellValue: (e, t, o) => {
    dataGridRef.current && dataGridRef.current.instance().cellValue(e, t, o);
  } }), []), getFiltered = (e, t, o) => ({ store: t, filter: e.data ? [o, "=", e.data[o]] : null });
  useEffect(() => {
    window.datagridMethods = exposedMethods;
  }, [exposedMethods]);
  const MemoizedDataGrid = useMemo(() => jsxs(DatagridStyled, { ref: dataGridRef, ...dataGridProps, columnAutoWidth: props.columnAutoWidth, showBorders: props.showBorders, showColumnLines: props.showColumnLines, showRowLines: props.showRowLines, rowAlternationEnabled: props.alternatingRow, wordWrapEnabled: props.wordWrapEnabled, loadPanel: { enabled: true, showIndicator: false, showPane: false }, columnResizingMode: "widget", hoverStateEnabled: false, children: [jsx(ColumnChooser, { enabled: props.showColumnChooser, mode: "select" }), jsx(ColumnFixing, { enabled: props.showColumnFixing }), jsx(HeaderFilter, { visible: props.showFilterPanel }), jsx(FilterRow, { visible: props.showFilterRow }), jsx(FilterPanel, { visible: props.showFilterPanel }), jsx(Scrolling, { mode: "standard", showScrollbar: "always", useNative: true }), jsx(Search, { enabled: props.showSearch }), jsx(Paging, { enabled: props.showPaging, defaultPageSize: props.showPaging ? props.pageSize : void 0, defaultPageIndex: props.pageIndex }), jsx(Pager, { visible: props.showPaging, allowedPageSizes: props.showPaging ? [5, 10, 20, 50, 100, "all"] : void 0, showPageSizeSelector: props.pagerShowPageSizeSelector, showNavigationButtons: props.pagerShowNavigationButtons }), jsx(Grouping, { contextMenuEnabled: props.showGroupContextMenu, expandMode: "buttonClick", autoExpandAll: false }), jsx(GroupPanel, { visible: props.showGroupPanel, emptyPanelText: "" }), jsx(SearchPanel, { visible: props.showSearch, placeholder: trans("datagrid.searchPlaceholder"), highlightCaseSensitive: true, highlightSearchText: true, searchVisibleColumnsOnly: props.searchVisibleColumnsOnly }), jsx(Export, { enabled: props.showExport, formats: [props.exportMode] }), jsx(Selection, { mode: props.selectMode, selectAllMode: props.selectAllMode, showCheckBoxesMode: props.showCheckBoxesMode }), jsx(Sorting, { mode: props.sortingMode }), jsx(Editing, { mode: props.editMode, allowAdding: props.editable, allowUpdating: props.editable, allowDeleting: props.editable, useIcons: props.editShowIcon, confirmDelete: props.confirmDelete }), (props.editable || customButton.length > 0) && jsxs(Column, { type: "buttons", children: [["cell", "row", "form", "popup"].includes(props.editMode) && jsx(Button, { icon: "edit", name: "edit", text: trans("datagrid.edit") }), jsx(Button, { name: "delete", text: trans("datagrid.delete") }), customButton.map((e, t) => jsx(Button, { render: () => jsx(CusButton, { $textColor: e.textColor, $hoverColor: e.hoverColor, title: e.tooltip || e.text, children: e.icon }), text: e.text, onClick: (t2) => {
    props.currentRow.updateCurrentRow(t2.row.data), e.onEvent("onClick");
  } }, t))] }), jsx(ColumnRenderer, { columnItem, createCellRenderer, createCellValueCalculator, getFiltered }), summaryItem && jsx(Summary, { recalculateWhileEditing: true, calculateCustomSummary: (options) => {
    if (props.code)
      try {
        eval(props.code);
      } catch (e) {
        console.error("Error in custom summary code:", e);
      }
  }, children: summaryItem.map((e) => "group" === e.summary ? jsx(GroupItem, { alignByColumn: e.alignByColumn, column: e.column, displayFormat: e.displayFormat ?? void 0, name: e.name ?? void 0, showInColumn: e.showInColumn ?? void 0, showInGroupFooter: e.showInGroupFooter ?? void 0, skipEmptyValues: e.skipEmptyValues ?? void 0, summaryType: e.summaryType, valueFormat: e.valueFormat }, e.key) : jsx(TotalItem, { alignment: e.alignment ?? void 0, column: e.column, cssClass: e.cssClass ?? void 0, displayFormat: e.displayFormat ?? void 0, name: e.name ?? void 0, showInColumn: e.showInColumn ?? void 0, skipEmptyValues: e.skipEmptyValues ?? void 0, summaryType: e.summaryType, valueFormat: e.valueFormat }, e.key)) })] }), [props.editMode, props.editable, props.showPaging, props.pageSize, props.pageIndex, props.showSearch, props.showFilterPanel, props.showFilterRow, props.showColumnChooser, props.showColumnFixing, props.showGroupPanel, props.selectMode, props.sortingMode, props.showExport, props.exportMode, props.pagerMode, props.editShowIcon, props.confirmDelete, props.showBorders, props.showColumnLines, props.showRowLines, props.alternatingRow, props.wordWrapEnabled, props.pagerShowPageSizeSelector, props.pagerShowInfo, props.pagerShowNavigationButtons, props.searchVisibleColumnsOnly, props.showGroupContextMenu, props.groupAutoExpand, props.selectAllMode, props.showCheckBoxesMode, props.showScrolling, props.columnAutoWidth, props.columnHidingEnabled, props.focusedRowEnabled, props.dataManual, props.dataKeyExpr, props.dataApi, props.dataOptions, columnItem, customButton]);
  return jsx(Fragment, { children: MemoizedDataGrid });
}).setPropertyViewFn((e) => jsxs(Fragment, { children: [jsxs(Section, { name: trans("datagrid.dataConfigs"), children: [e.dataOptions.propertyView({ label: trans("datagrid.mode"), radioButton: true }), "manual" === e.dataOptions.getView() ? e.dataManual.propertyView({ label: trans("datagrid.data") }) : e.dataApi.propertyView({ label: trans("datagrid.api") }), e.dataKeyExpr.propertyView({ label: trans("datagrid.keyExpr") })] }), jsxs(Section, { name: trans("datagrid.columns"), children: [columnPropertyView(e.columns), e.showColumnChooser.propertyView({ label: trans("datagrid.showChooser") }), e.showColumnFixing.propertyView({ label: trans("datagrid.fixingColumns") })] }), jsx(Section, { name: trans("datagrid.customButtonsHead"), children: columnPropertyView(e.customButtonsHead) }), jsx(Section, { name: trans("datagrid.customButtonsRow"), children: columnPropertyView(e.customButtonRow) }), jsxs(Section, { name: trans("datagrid.summary"), children: [columnPropertyView(e.summary), e.code.propertyView({ label: trans("datagrid.customCode") })] }), jsxs(Section, { name: trans("datagrid.editing"), children: [e.editable.propertyView({ label: trans("datagrid.editable") }), e.editable.getView() && e.editMode.propertyView({ label: trans("datagrid.mode") }), e.editable.getView() && e.editShowIcon.propertyView({ label: trans("datagrid.useIcons") }), e.editable.getView() && e.confirmDelete.propertyView({ label: trans("datagrid.confirmDelete") })] }), jsx(Section, { name: trans("datagrid.sorting"), children: e.sortingMode.propertyView({ label: trans("datagrid.mode") }) }), jsxs(Section, { name: trans("datagrid.filteringSearching"), children: [e.showFilterPanel.propertyView({ label: trans("datagrid.showFilterPanel") }), e.showFilterRow.propertyView({ label: trans("datagrid.showFilterRow") }), e.showSearch.propertyView({ label: trans("datagrid.showSearch") }), e.showSearch.getView() && e.searchVisibleColumnsOnly.propertyView({ label: trans("datagrid.visibleColumnsOnly") })] }), jsxs(Section, { name: trans("datagrid.paging"), children: [e.showPaging.propertyView({ label: trans("datagrid.showPagination") }), e.showPaging.getView() && e.pagerMode.propertyView({ label: trans("datagrid.mode") }), e.showPaging.getView() && e.pageSize.propertyView({ label: trans("datagrid.pageSize") }), e.showPaging.getView() && e.pageIndex.propertyView({ label: trans("datagrid.pageIndex") }), e.showPaging.getView() && e.pagerShowPageSizeSelector.propertyView({ label: trans("datagrid.showSizeSelector") }), e.showPaging.getView() && e.pagerShowInfo.propertyView({ label: trans("datagrid.showInfo") }), e.showPaging.getView() && "compact" !== e.pagerMode.getView() && e.pagerShowNavigationButtons.propertyView({ label: trans("datagrid.showNavigation") })] }), jsx(Section, { name: trans("datagrid.scrolling"), children: e.showScrolling.propertyView({ label: trans("datagrid.showScrollbar") }) }), jsxs(Section, { name: trans("datagrid.grouping"), children: [e.showGroupPanel.propertyView({ label: trans("datagrid.showPanel") }), e.showGroupContextMenu.propertyView({ label: trans("datagrid.showContextMenu") }), e.groupAutoExpand.propertyView({ label: trans("datagrid.autoExpand") })] }), jsxs(Section, { name: trans("datagrid.selection"), children: [e.selectMode.propertyView({ label: trans("datagrid.mode") }), e.selectAllMode.propertyView({ label: trans("datagrid.selectAll"), radioButton: true }), e.showCheckBoxesMode.propertyView({ label: trans("datagrid.showCheckBoxes") })] }), jsxs(Section, { name: trans("datagrid.interaction"), children: [e.onEvent.getPropertyView(), e.loading.propertyView({ label: trans("datagrid.loading") })] }), jsxs(Section, { name: trans("datagrid.export"), children: [e.showExport.propertyView({ label: trans("datagrid.showExport") }), e.showExport.getView() && e.exportMode.propertyView({ label: trans("datagrid.fileType"), radioButton: true })] }), jsx(Section, { name: trans("datagrid.gridStyles"), children: e.showBorders.propertyView({ label: trans("datagrid.showBorder") }) }), jsxs(Section, { name: trans("datagrid.columnStyle"), children: [e.columnAutoWidth.propertyView({ label: trans("datagrid.autoWidth") }), e.columnHidingEnabled.propertyView({ label: trans("datagrid.hidingEnabled") }), e.showColumnLines.propertyView({ label: trans("datagrid.showColumnLines") })] }), jsxs(Section, { name: trans("datagrid.rowStyle"), children: [e.alternatingRow.propertyView({ label: trans("datagrid.alternatingRow") }), e.focusedRowEnabled.propertyView({ label: trans("datagrid.focusRow") }), e.showRowLines.propertyView({ label: trans("datagrid.showRowLines") })] }), jsx(Section, { name: trans("datagrid.cellStyle"), children: e.wordWrapEnabled.propertyView({ label: trans("datagrid.wordWrap") }) })] })).setExposeMethodConfigs([{ method: { name: "cellValue", params: [{ name: "rowIndex", type: "number", description: "The index of the row" }, { name: "dataField", type: "string", description: "The data field name of the column" }, { name: "value", type: "string", description: "The new value to set (optional)" }] }, execute(e, t) {
  try {
    const e2 = window.datagridMethods;
    return e2 ? 3 === t.length ? (e2.setCellValue(t[0], t[1], t[2]), true) : e2.getCellValue(t[0], t[1]) : null;
  } catch (e2) {
    return console.error("Error in cellValue:", e2), null;
  }
} }]).build(), DatagridComp = withExposingConfigs(DatagridBasicComp, [new NameConfig("dataManual", "dataManualDesc"), new CompDepsConfig("selectedRows", (e) => ({ selectedRowKeys: e.children.selectionControl.children.selectedRowKeys.node(), selectedRowsData: e.children.selectionControl.children.selectedRowsData.node() }), (e) => ({ selectedRowsData: e.selectedRowsData || [], selectedRowKeys: e.selectedRowKeys || [] }), "Get selected rows data"), new CompDepsConfig("pagination", (e) => ({ pageIndex: e.children.paginationControl.children.pageIndex.node(), pageSize: e.children.paginationControl.children.pageSize.node() }), (e) => ({ pageIndex: e.pageIndex ? e.pageIndex + 1 : 1, pageSize: e.pageSize || 5 }), "Get pagination data"), new CompDepsConfig("selectedCell", (e) => ({ cellValue: e.children.cellControl.children.cellValue.node(), rowIndex: e.children.cellControl.children.rowIndex.node(), columnIndex: e.children.cellControl.children.columnIndex.node(), isRowExpanded: e.children.cellControl.children.isRowExpanded.node() }), (e) => ({ cellValue: e.cellValue || null, rowIndex: e.rowIndex || -1, columnIndex: e.columnIndex || -1, isRowExpanded: e.isRowExpanded || false }), "Get focused cell information including value, position and row expanded state"), new CompDepsConfig("columnOptions", (e) => ({ filters: e.children.columnControl.children.filters.node(), sorts: e.children.columnControl.children.sorts.node(), combinedFilter: e.children.columnControl.children.combinedFilter.node() }), (e) => ({ filters: e.filters || [], sorts: e.sorts || [], combinedFilter: e.combinedFilter || "" }), "Get column filter and sort information"), new CompDepsConfig("currentRow", (e) => ({ data: e.children.currentRow.children.rowData.node() }), (e) => e.data || {}, "Get column filter and sort information"), new CompDepsConfig("lastChange", (e) => ({ changes: e.children.lastChange.children.lastChange.node() }), (e) => e.changes || [], "lastChange"), new CompDepsConfig("dataManualEx", (e) => ({ changes: e.children.dataManualEx.children.dataManualEx.node() }), (e) => e.changes || [], "dataManualEx"), new CompDepsConfig("lastChange", (e) => ({ changes: e.children.lastChange.children.lastChange.node() }), (e) => e.changes || [], "lastChange"), new CompDepsConfig("dataManualEx", (e) => ({ changes: e.children.dataManualEx.children.dataManualEx.node() }), (e) => e.changes || [], "dataManualEx"), new CompDepsConfig("savedChangesData", (e) => ({ changes: e.children.savedRowsDataControl.children.savedChanges.node() }), (e) => e.changes || [], "savedChangdData"), new CompDepsConfig("editedChangesData", (e) => ({ changes: e.children.savedRowsDataControl.children.editedChanges.node() }), (e) => e.changes || [], "editedChangesData")]);
function defaultDatagridData() {
  const e = i18nObjs.datagrid.defaultData, t = e.length > 0 ? Object.keys(e[0]) : void 0, o = t ? t.map((e2) => ({ dataField: e2, label: e2, dataType: "string" })) : void 0;
  return { dataManual: JSON.stringify(e, null, " "), dataApi: "", columns: o, editable: true, exportMode: "xlsx", pageSize: 5, showSummary: true, showBorders: true };
}
export {
  DEBOUNCE_TIME,
  DatagridComp,
  defaultDatagridData
};
