import {
  Link_Target,
  Node_Type,
  PluginContainerData_Alignment,
  PluginContainerData_Width_Type
} from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
import { isDefined } from "./utils.js";
const defaultLinkPreviewData = {
  containerData: {
    alignment: PluginContainerData_Alignment.CENTER,
    width: {
      size: PluginContainerData_Width_Type.CONTENT
    },
    textWrap: true
  },
  link: {
    target: Link_Target.BLANK,
    anchor: "",
    url: "wix.com"
  },
  title: "Free Website Builder | Create a Free Website | Wix.com",
  thumbnailUrl: "https://static.wixstatic.com/media/5305c5_5f112df56dcd40a29e855baae08f19ce~mv2.jpg/v1/fill/w_600,h_315,al_c/5305c5_5f112df56dcd40a29e855baae08f19ce~mv2.jpg",
  description: "	Create a free website with Wix.com. Choose a stunning template and customize anything with the Wix website builder—no coding skills needed. Create yours today!"
};
const isLinkPreviewData = (arg) => {
  return typeof arg === "object" && arg !== null && "link" in arg;
};
const linkPreview = (...args) => {
  const linkPreviewDataArg = args.find(isLinkPreviewData);
  return {
    type: "block_node",
    node: (getId) => ({
      id: getId(),
      type: Node_Type.LINK_PREVIEW,
      nodes: args.map((arg) => "type" in arg && arg.type === "block_node" ? arg.node(getId) : void 0).filter(isDefined),
      linkPreviewData: linkPreviewDataArg ? linkPreviewDataArg : defaultLinkPreviewData
    })
  };
};
export {
  linkPreview
};
//# sourceMappingURL=link-preview.builder.js.map
