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_react_icons_md__ from "react-icons/md";
import * as __WEBPACK_EXTERNAL_MODULE_react_router_dom__ from "react-router-dom";
import * as __WEBPACK_EXTERNAL_MODULE__CopyButton_CopyButton_mjs__ from "../CopyButton/CopyButton.mjs";
function Breadcrumbs(props) {
    const { items = [], showHomeIcon = true } = props;
    const alignItems = 'flex-end'; // Note: do not use 'end' does not work in safari
    const borderRadius = 'sm';
    const px = '1';
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Breadcrumb, {
        spacing: 3,
        size: "sm",
        separator: /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdChevronRight, {
            size: "1.2rem"
        }),
        alignItems: alignItems,
        sx: {
            ol: {
                display: 'flex',
                alignItems
            }
        },
        fontSize: "sm"
    }, showHomeIcon && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.BreadcrumbItem, {
        alignItems: alignItems
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.BreadcrumbLink, {
        as: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.NavLink,
        to: "/",
        "aria-label": "Home",
        borderRadius: borderRadius
    }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdOutlineHome, {
        size: "1.2rem"
    }))), items.map((item, i)=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.BreadcrumbItem, {
            key: i,
            position: "relative",
            alignItems: alignItems
        }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.BreadcrumbLink, {
            as: __WEBPACK_EXTERNAL_MODULE_react_router_dom__.NavLink,
            to: item.to,
            _hover: {
                textDecoration: 'none',
                '.BreadcrumbHeading': {
                    textDecoration: 'none'
                },
                '.BreadcrumbText': {
                    textDecoration: 'underline'
                }
            },
            borderRadius: borderRadius,
            px: px,
            mx: -px
        }, item.heading && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
            className: "BreadcrumbHeading",
            fontWeight: "400",
            textTransform: "lowercase",
            display: "block",
            mb: "-0.5"
        }, item.heading), /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
            className: "BreadcrumbText",
            fontWeight: "500",
            ...item.options?.canBeTruncated ? {
                wordBreak: 'break-all',
                whiteSpace: 'break-spaces',
                noOfLines: 1
            } : {
                whiteSpace: 'nowrap'
            }
        }, item.name)), item.options?.canBeCopied && /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
            pl: 2
        }, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__CopyButton_CopyButton_mjs__["default"], {
            content: item.name,
            variant: "ghost",
            iconSize: 16
        })))));
}
/* ESM default export */ const Breadcrumbs_rslib_entry_ = Breadcrumbs;
export { Breadcrumbs_rslib_entry_ as default };
