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