"use strict";
"use client";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/Breadcrumbs/BreadcrumbItem.tsx
var BreadcrumbItem_exports = {};
__export(BreadcrumbItem_exports, {
  BreadcrumbItem: () => BreadcrumbItem
});
module.exports = __toCommonJS(BreadcrumbItem_exports);
var import_react = require("react");
var import_dedupe2 = __toESM(require("classnames/dedupe"));

// src/components/Box/Box.tsx
var import_dedupe = __toESM(require("classnames/dedupe"));

// src/utils/filterUndefinedProps.ts
var filterUndefinedProps = (props) => {
  const filteredProps = {};
  Object.keys(props).forEach((key) => {
    if (props[key] !== void 0) {
      filteredProps[key] = props[key];
    }
  });
  return filteredProps;
};

// src/utils/filterUnsetValues.ts
var filterUnsetValues = (props) => {
  const filtered = {};
  Object.keys(props).forEach((key) => {
    const value = props[key];
    if (value !== void 0 && value !== null && value !== "") {
      filtered[key] = value;
    }
  });
  return filtered;
};

// src/utils/getSpacingValue.ts
var getSpacingValue = (padding) => {
  if (typeof padding === "string") {
    return `var(--size-${padding})`;
  }
  if (typeof padding === "number") {
    return `${padding}px`;
  }
  return void 0;
};

// src/components/Box/Box.tsx
var import_Box = require("@simplybusiness/mobius/src/components/Box/Box.css");
var import_jsx_runtime = require("react/jsx-runtime");
var Box = ({ ref, ...props }) => {
  const {
    elementType: Element = "div",
    padding,
    paddingX,
    paddingInline,
    paddingInlineStart,
    paddingInlineEnd,
    paddingY,
    paddingBlock,
    paddingBlockStart,
    paddingBlockEnd,
    paddingTop,
    paddingRight,
    paddingBottom,
    paddingLeft,
    minWidth,
    minHeight,
    maxWidth,
    maxHeight,
    width,
    height,
    style,
    ...otherProps
  } = props;
  const classes = (0, import_dedupe.default)("mobius", "mobius-box", otherProps.className);
  const fromProps = filterUndefinedProps({
    padding: getSpacingValue(padding),
    paddingInline: getSpacingValue(paddingInline || paddingX),
    paddingBlock: getSpacingValue(paddingBlock || paddingY),
    paddingTop: getSpacingValue(paddingTop || paddingBlockStart),
    paddingRight: getSpacingValue(paddingRight || paddingInlineEnd),
    paddingBottom: getSpacingValue(paddingBottom || paddingBlockEnd),
    paddingLeft: getSpacingValue(paddingLeft || paddingInlineStart),
    minWidth,
    minHeight,
    maxWidth,
    maxHeight,
    width,
    height
  });
  const styleProps = filterUndefinedProps({
    ...fromProps,
    ...style ? filterUnsetValues(style) : {}
  });
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
};
Box.displayName = "Box";

// src/components/Breadcrumbs/BreadcrumbItem.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var BreadcrumbItem = ({ ref, ...props }) => {
  const {
    isDisabled = false,
    isCurrent = false,
    "aria-current": ariaCurrent = "page",
    children,
    separator = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
    ...otherProps
  } = props;
  const { itemProps } = {
    itemProps: {
      "aria-current": isCurrent ? ariaCurrent : void 0,
      "aria-disabled": isDisabled || isCurrent,
      ...otherProps
    }
  };
  const classes = (0, import_dedupe2.default)(
    "mobius",
    "mobius-breadcrumb__item",
    props.className
  );
  const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...itemProps, children }) : import_react.Children.only(children);
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: classes, children: [
    (0, import_react.cloneElement)(child, {
      ...child.props,
      ...itemProps,
      ref
    }),
    !props.isCurrent && separator
  ] });
};
BreadcrumbItem.displayName = "BreadcrumbItem";
//# sourceMappingURL=BreadcrumbItem.js.map
