// packages/block-library/src/pullquote/transforms.js
import { createBlock } from "@wordpress/blocks";
var transforms = {
  to: [
    {
      type: "block",
      blocks: ["core/paragraph"],
      transform: ({ value, citation }) => {
        const paragraphs = [];
        if (value) {
          paragraphs.push(
            createBlock("core/paragraph", {
              content: value
            })
          );
        }
        if (citation) {
          paragraphs.push(
            createBlock("core/paragraph", {
              content: citation
            })
          );
        }
        if (paragraphs.length === 0) {
          return createBlock("core/paragraph", {
            content: ""
          });
        }
        return paragraphs;
      }
    },
    {
      type: "block",
      blocks: ["core/heading"],
      transform: ({ value, citation }) => {
        if (!value) {
          return createBlock("core/heading", {
            content: citation
          });
        }
        const headingBlock = createBlock("core/heading", {
          content: value
        });
        if (!citation) {
          return headingBlock;
        }
        return [
          headingBlock,
          createBlock("core/heading", {
            content: citation
          })
        ];
      }
    }
  ]
};
var transforms_default = transforms;
export {
  transforms_default as default
};
//# sourceMappingURL=transforms.js.map
