import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE__textea_json_viewer__ from "@textea/json-viewer";
import * as __WEBPACK_EXTERNAL_MODULE__styles_viewerTheme_mjs__ from "../../styles/viewerTheme.mjs";
const useJsonViewerTheme = (theme)=>{
    switch(theme){
        case 'dark':
            return (0, __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.useColorModeValue)('dark', __WEBPACK_EXTERNAL_MODULE__styles_viewerTheme_mjs__["default"]);
        case 'light':
        case 'auto':
        default:
            return (0, __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.useColorModeValue)('light', __WEBPACK_EXTERNAL_MODULE__styles_viewerTheme_mjs__["default"]);
    }
};
function CustomJsonViewer({ defaultExpanded, theme, ...rest }) {
    const jsonViewerTheme = useJsonViewerTheme(theme);
    return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
        "data-testid": "json-viewer"
    }, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__textea_json_viewer__.JsonViewer, {
        ...rest,
        theme: jsonViewerTheme,
        defaultInspectDepth: defaultExpanded ? 10 : 5,
        maxDisplayLength: defaultExpanded ? 60 : 30
    }));
}
/* ESM default export */ const JsonViewer_rslib_entry_ = CustomJsonViewer;
export { JsonViewer_rslib_entry_ as default };
