"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.transformSliceToRemoveOpenNestedExpand = void 0;
var _model = require("@atlaskit/editor-prosemirror/model");
var transformSliceToRemoveOpenNestedExpand = exports.transformSliceToRemoveOpenNestedExpand = function transformSliceToRemoveOpenNestedExpand(slice, schema) {
  if (slice.openStart > 1 && slice.openEnd > 1 && slice.content.childCount === 1 && slice.content.firstChild && slice.content.firstChild.type === schema.nodes.nestedExpand) {
    return new _model.Slice(slice.content.firstChild.content, slice.openStart - 1, slice.openEnd - 1);
  }
  return slice;
};