import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__ from "@chakra-ui/icons";
import * as __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__ from "@tanstack/react-table";
import * as __WEBPACK_EXTERNAL_MODULE__Empty_Empty_mjs__ from "../Empty/Empty.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__Pagination_Pagination_mjs__ from "../Pagination/Pagination.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__Spinner_Spinner_mjs__ from "../Spinner/Spinner.mjs";
import * as __WEBPACK_EXTERNAL_MODULE_react_icons_md__ from "react-icons/md";
const dataTableMediaCSS = {
    '@media (hover: hover)': {
        '.resizer': {
            opacity: '0'
        },
        '*:hover > .resizer': {
            opacity: '1'
        }
    }
};
const dataTableResizerCSS = {
    content: "''",
    position: 'absolute',
    right: '0',
    top: '0',
    height: '100%',
    width: '5px',
    background: 'rgba(0, 0, 0, 0.5)',
    cursor: 'col-resize',
    'user-select': 'none',
    'touch-action': 'none',
    ...dataTableMediaCSS
};
const isResizingCSS = {
    background: 'blue',
    opacity: '1'
};
function DataTable({ variant = 'default', columns = [], data = [], size = 'md', showColumnSelector = false, enableColumnFilters = false, enableColumnResizing = false, subComponent: SubComponent, expandRowByClick = false, selectable = false, rowSelection = {}, onRowSelectionChange, defaultPageSize = 50, sorting = true, onSortingChange, pagination = true, onPaginationChange, emptyText, emptyAction, isLoading = false, loadingText = 'Loading ...', onRow, rowClassName, getRowCanExpand }) {
    const enableSorting = void 0 !== sorting && false !== sorting;
    const expanderColumns = Boolean(SubComponent) ? [
        {
            id: 'expander',
            enableSorting: false,
            cell: ({ row })=>row.getCanExpand() ? row.getIsExpanded() ? /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.IconButton, {
                    minWidth: 0,
                    onClick: row.getToggleExpandedHandler(),
                    height: "auto",
                    "aria-label": "Expand row",
                    icon: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdKeyboardArrowDown, {
                        size: 20
                    }),
                    variant: "unstyled"
                }) : /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.IconButton, {
                    minWidth: 0,
                    onClick: row.getToggleExpandedHandler(),
                    height: "auto",
                    "aria-label": "Collapse row",
                    icon: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdKeyboardArrowRight, {
                        size: 20
                    }),
                    variant: "unstyled"
                }) : null
        }
    ] : [];
    const selectableColumns = selectable ? [
        {
            id: 'select',
            header: ({ table })=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Checkbox, {
                    isChecked: table.getIsAllRowsSelected(),
                    isIndeterminate: table.getIsSomeRowsSelected(),
                    onChange: table.getToggleAllRowsSelectedHandler()
                }),
            cell: ({ row })=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Checkbox, {
                    isChecked: row.getIsSelected(),
                    isDisabled: !row.getCanSelect(),
                    isIndeterminate: row.getIsSomeSelected(),
                    onChange: row.getToggleSelectedHandler()
                })
        }
    ] : [];
    const [columnVisibility, setColumnVisibility] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({});
    const initialState = {
        pagination: {
            pageSize: -1
        }
    };
    if (true === pagination) initialState.pagination = {
        pageSize: defaultPageSize,
        pageIndex: 0
    };
    else if (void 0 !== pagination && false !== pagination) initialState.pagination = pagination;
    if (true === sorting) initialState.sorting = [];
    else if (void 0 !== sorting && false !== sorting) initialState.sorting = sorting;
    const tableOptions = {
        // Data
        data,
        columns: [
            ...expanderColumns,
            ...selectableColumns,
            ...columns
        ],
        initialState,
        state: {
            columnVisibility,
            rowSelection
        },
        enableSorting,
        enableColumnFilters,
        enableColumnResizing,
        onColumnVisibilityChange: setColumnVisibility,
        onRowSelectionChange,
        autoResetPageIndex: false,
        // Pipeline
        getCoreRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getCoreRowModel)(),
        getFilteredRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getFilteredRowModel)(),
        getSortedRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getSortedRowModel)(),
        getPaginationRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getPaginationRowModel)(),
        getFacetedRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getFacetedRowModel)(),
        getFacetedUniqueValues: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getFacetedUniqueValues)(),
        getFacetedMinMaxValues: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.getFacetedMinMaxValues)(),
        //
        debugTable: true,
        getRowCanExpand: getRowCanExpand ? getRowCanExpand : ()=>Boolean(SubComponent)
    };
    if (true !== pagination && void 0 !== pagination && false !== pagination && onPaginationChange) {
        if (tableOptions.state) tableOptions.state.pagination = pagination;
        tableOptions.onPaginationChange = onPaginationChange;
    }
    if (true !== sorting && false !== sorting && void 0 !== sorting && onSortingChange) {
        if (tableOptions.state) tableOptions.state.sorting = sorting;
        tableOptions.onSortingChange = onSortingChange;
    }
    const table = (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.useReactTable)(tableOptions);
    const isDataEmpty = 0 === table.getRowModel().rows.length;
    // @ts-ignore
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react__["default"].Fragment, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.TableContainer, null, showColumnSelector && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(ColumnSelector, {
        table: table
    }), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Table, {
        size: size,
        variant: variant
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Thead, null, table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, {
            key: headerGroup.id
        }, headerGroup.headers.map((header)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Th, {
                key: header.id,
                colSpan: header.colSpan,
                style: {
                    position: 'relative',
                    width: header.getSize()
                }
            }, header.isPlaceholder ? null : /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
                className: header.column.getCanSort() ? 'cursor-pointer select-none' : '',
                onClick: header.column.getToggleSortingHandler()
            }, (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.flexRender)(header.column.columnDef.header, header.getContext()), enableSorting && header.column.getCanSort() && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.chakra.span, {
                pl: "4"
            }, {
                asc: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__.TriangleUpIcon, {
                    "aria-label": "sorted ascending"
                }),
                desc: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__.TriangleDownIcon, {
                    "aria-label": "sorted descending"
                })
            }[header.column.getIsSorted()] ?? /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_icons__.TriangleUpIcon, {
                "aria-label": "unsorted",
                color: "blackAlpha.300"
            }))), header.column.getCanFilter() ? /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(ColumnFilter, {
                column: header.column,
                table: table
            })) : null, enableColumnResizing && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
                onMouseDown: header.getResizeHandler(),
                onTouchStart: header.getResizeHandler(),
                className: `resizer ${header.column.getIsResizing() ? 'isResizing' : ''}`,
                style: {
                    transform: header.column.getIsResizing() ? `translateX(${table.getState().columnSizingInfo.deltaOffset}px)` : ''
                },
                __css: header.column.getIsResizing() ? {
                    ...dataTableResizerCSS,
                    ...isResizingCSS
                } : dataTableResizerCSS
            })))))), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tbody, null, table.getRowModel().rows.map((row)=>{
        const subEl = (SubComponent && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(SubComponent, {
            row: row
        })) ?? null;
        return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react__["default"].Fragment, {
            key: row.id
        }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, {
            className: rowClassName?.(row),
            onClick: expandRowByClick ? ()=>{
                if (row.getCanExpand()) row.toggleExpanded();
            } : ()=>{
                onRow?.(row);
            },
            cursor: expandRowByClick || onRow ? 'pointer' : void 0
        }, row.getVisibleCells().map((cell)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Td, {
                key: cell.id,
                style: {
                    width: cell.column.getSize()
                },
                "data-testid": "data-table-cell"
            }, (0, __WEBPACK_EXTERNAL_MODULE__tanstack_react_table__.flexRender)(cell.column.columnDef.cell, cell.getContext())))), row.getIsExpanded() && subEl && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, {
            p: 0
        }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Td, {
            p: 0,
            colSpan: row.getVisibleCells().length
        }, subEl)));
    }), isLoading && isDataEmpty && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Td, {
        colSpan: table.getVisibleFlatColumns().length
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.VStack, {
        my: 10,
        gap: 2
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__Spinner_Spinner_mjs__["default"], {
        emptyColor: "gray.200",
        color: "blue.500",
        size: "xl"
    }), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Text, null, loadingText)))), !isLoading && 0 === data.length && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Td, {
        colSpan: table.getVisibleFlatColumns().length
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.VStack, {
        my: 10
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__Empty_Empty_mjs__["default"], {
        description: emptyText
    }), emptyAction)))), data.length > 0 && ('object' == typeof pagination || pagination && data.length > defaultPageSize) && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tfoot, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Tr, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Td, {
        colSpan: table.getVisibleFlatColumns().length
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(TablePagination, {
        table: table,
        size: size
    })))))));
}
function TablePagination({ table, size, showGoToPage = false }) {
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Flex, {
        justifyContent: "space-between"
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Flex, {
        gap: 2
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Select, {
        value: table.getState().pagination.pageSize,
        onChange: (e)=>{
            table.setPageSize(Number(e.target.value));
        },
        w: "auto",
        size: size
    }, [
        5,
        10,
        20,
        30,
        40,
        50,
        100
    ].map((pageSize)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("option", {
            key: pageSize,
            value: pageSize
        }, pageSize, " / page"))), showGoToPage && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Flex, {
        gap: 1,
        alignItems: "center"
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Text, null, "Go to page:"), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Input, {
        type: "number",
        htmlSize: 2,
        w: 100,
        onChange: (e)=>{
            if (e.target.valueAsNumber) table.setPageIndex(Math.min(Math.max(0, e.target.valueAsNumber - 1), table.getPageCount() - 1));
        }
    }))), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__Pagination_Pagination_mjs__.Pagination, {
        currentPage: table.getState().pagination.pageIndex + 1,
        totalCount: table.getFilteredRowModel().rows.length,
        pageSize: table.getState().pagination.pageSize,
        onPageChange: (page)=>{
            table.setPageIndex(page - 1);
        }
    }));
}
function ColumnSelector({ table }) {
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
        className: "inline-block border border-black shadow rounded"
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
        className: "px-1 border-b border-black"
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("label", null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("input", {
        type: 'checkbox',
        checked: table.getIsAllColumnsVisible(),
        onChange: table.getToggleAllColumnsVisibilityHandler()
    }), ' ', "Toggle All")), table.getAllLeafColumns().map((column)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
            key: column.id,
            className: "px-1"
        }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("label", null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("input", {
            type: 'checkbox',
            checked: column.getIsVisible(),
            onChange: column.getToggleVisibilityHandler()
        }), ' ', column.id))));
}
function ColumnFilter({ column, table }) {
    const firstValue = table.getPreFilteredRowModel().flatRows[0]?.getValue(column.id);
    const columnFilterValue = column.getFilterValue();
    const sortedUniqueValues = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>'number' == typeof firstValue ? [] : Array.from(column.getFacetedUniqueValues().keys()).sort(), [
        column.getFacetedUniqueValues()
    ]);
    return 'number' == typeof firstValue ? /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
        className: "flex space-x-2"
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(DebouncedInput, {
        type: "number",
        min: Number(column.getFacetedMinMaxValues()?.[0] ?? ''),
        max: Number(column.getFacetedMinMaxValues()?.[1] ?? ''),
        value: columnFilterValue?.[0] ?? '',
        onChange: (value)=>column.setFilterValue((old)=>[
                    value,
                    old?.[1]
                ]),
        placeholder: `Min ${column.getFacetedMinMaxValues()?.[0] ? `(${column.getFacetedMinMaxValues()?.[0]})` : ''}`,
        className: "w-24 border shadow rounded",
        w: 70
    }), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(DebouncedInput, {
        type: "number",
        min: Number(column.getFacetedMinMaxValues()?.[0] ?? ''),
        max: Number(column.getFacetedMinMaxValues()?.[1] ?? ''),
        value: columnFilterValue?.[1] ?? '',
        onChange: (value)=>column.setFilterValue((old)=>[
                    old?.[0],
                    value
                ]),
        placeholder: `Max ${column.getFacetedMinMaxValues()?.[1] ? `(${column.getFacetedMinMaxValues()?.[1]})` : ''}`,
        className: "w-24 border shadow rounded",
        w: 70
    })), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
        className: "h-1"
    })) : /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react__["default"].Fragment, null, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("datalist", {
        id: column.id + 'list'
    }, sortedUniqueValues.slice(0, 5000).map((value)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("option", {
            value: value,
            key: value
        }))), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(DebouncedInput, {
        type: "text",
        value: columnFilterValue ?? '',
        onChange: (value)=>column.setFilterValue(value),
        placeholder: `Search... (${column.getFacetedUniqueValues().size})`,
        className: "w-36 border shadow rounded",
        list: column.id + 'list'
    }), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement("div", {
        className: "h-1"
    }));
}
function DebouncedInput({ value: initialValue, onChange, debounce = 500, ...props }) {
    const [value, setValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(initialValue);
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        setValue(initialValue);
    }, [
        initialValue
    ]);
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        const timeout = setTimeout(()=>{
            onChange(value);
        }, debounce);
        return ()=>clearTimeout(timeout);
    }, [
        value
    ]);
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Input, {
        ...props,
        size: "xs",
        width: "auto",
        value: value,
        onChange: (e)=>setValue(e.target.value)
    });
}
/* ESM default export */ const DataTable_rslib_entry_ = DataTable;
export { DataTable_rslib_entry_ as default };
