import { __exports as toHaveAccessibleDescription$1 } from "../../../../_virtual/to-have-accessible-description.js";
import require$$0 from "../../../../_virtual/index3.js";
import "./utils.js";
import { __exports as utils } from "../../../../_virtual/utils.js";
Object.defineProperty(toHaveAccessibleDescription$1, "__esModule", {
  value: true
});
toHaveAccessibleDescription$1.toHaveAccessibleDescription = toHaveAccessibleDescription;
var _domAccessibilityApi = require$$0;
var _utils = utils;
function toHaveAccessibleDescription(htmlElement, expectedAccessibleDescription) {
  (0, _utils.checkHtmlElement)(htmlElement, toHaveAccessibleDescription, this);
  const actualAccessibleDescription = (0, _domAccessibilityApi.computeAccessibleDescription)(htmlElement);
  const missingExpectedValue = arguments.length === 1;
  let pass = false;
  if (missingExpectedValue) {
    pass = actualAccessibleDescription !== "";
  } else {
    pass = expectedAccessibleDescription instanceof RegExp ? expectedAccessibleDescription.test(actualAccessibleDescription) : this.equals(actualAccessibleDescription, expectedAccessibleDescription);
  }
  return {
    pass,
    message: () => {
      const to = this.isNot ? "not to" : "to";
      return (0, _utils.getMessage)(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleDescription.name}`, "element", ""), `Expected element ${to} have accessible description`, expectedAccessibleDescription, "Received", actualAccessibleDescription);
    }
  };
}
export {
  toHaveAccessibleDescription$1 as default
};
//# sourceMappingURL=to-have-accessible-description.js.map
