"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var is_banner_in_document_exports = {};
__export(is_banner_in_document_exports, {
  isBannerInDocument: () => isBannerInDocument
});
module.exports = __toCommonJS(is_banner_in_document_exports);
var import_ricos_content = require("./../../ricos-content/index.js");
const isBannerInDocument = (_content, __, editor) => {
  if (!editor?.state) {
    return false;
  }
  let found = false;
  editor.state.doc.descendants((node) => {
    if (found) {
      return false;
    }
    if (node.type.name === import_ricos_content.TIPTAP_LAYOUT_TYPE && node.attrs?.banner) {
      found = true;
      return false;
    }
    return true;
  });
  return found;
};
//# sourceMappingURL=is-banner-in-document.js.map
