import React from "react";
import { Decoration_Type } from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
const decorator = (element, subscriptDecoration) => {
  const { subscriptData } = subscriptDecoration;
  const isSubscript = typeof subscriptData === "undefined" || subscriptData;
  return isSubscript ? /* @__PURE__ */ React.createElement("sub", { key: `subscript-${element?.key}` }, element) : element;
};
const SubscriptDecorator = {
  rule: (node) => !!node.textData?.decorations?.some(({ type }) => type === Decoration_Type.SUBSCRIPT),
  decorate: ({ element, node }) => {
    const subscriptDecoration = node.textData?.decorations?.find(
      ({ type }) => type === Decoration_Type.SUBSCRIPT
    );
    return decorator(element, subscriptDecoration);
  }
};
var viewer_default = SubscriptDecorator;
export {
  viewer_default as default
};
//# sourceMappingURL=viewer.js.map
