"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.findCodeBlock = void 0;
var _utils = require("@atlaskit/editor-prosemirror/utils");
var findCodeBlock = exports.findCodeBlock = function findCodeBlock(state, selection) {
  var codeBlock = state.schema.nodes.codeBlock;
  return (0, _utils.findSelectedNodeOfType)(codeBlock)(selection || state.selection) || (0, _utils.findParentNodeOfType)(codeBlock)(selection || state.selection);
};