class EditorPasteUtils {
  static wordPasteListItemContent(allNodes) {
    const nodes = [];
    let ignoring = false;
    let forProcessing = Array.from(allNodes);
    if (forProcessing.length === 1 && forProcessing[0].nodeName === "SPAN" || forProcessing.length === 2 && forProcessing[0].nodeName === "SPAN" && forProcessing[1].nodeName === "O:P") {
      forProcessing = Array.from(forProcessing[0].childNodes);
    }
    for (const node of forProcessing) {
      const isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === "[if !supportLists]";
      if (isStartIgnore) {
        ignoring = true;
      } else {
        const isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === "[endif]";
        if (isEndIgnore) {
          ignoring = false;
        } else {
          if (!ignoring) {
            nodes.push(node);
          }
        }
      }
    }
    return nodes;
  }
  static flattenNodesWithType(withType, defaultElementFactory) {
    const withTypeFiltered = withType.filter((item) => item !== null);
    const containsBlock = withTypeFiltered.find(({ elements }) => elements !== void 0) !== void 0;
    if (containsBlock) {
      return {
        elements: withTypeFiltered.flatMap((item) => {
          if (item.elements === void 0) {
            return [defaultElementFactory(item.texts)];
          } else {
            return item.elements;
          }
        })
      };
    } else {
      return { texts: withTypeFiltered.flatMap((item) => item.texts) };
    }
  }
}
export { EditorPasteUtils };
//# sourceMappingURL=EditorPasteUtils.js.map
