import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
    return false;
  }
  var $pos = view.state.doc.resolve(pos);
  var _view$state$schema$no = view.state.schema.nodes,
    expand = _view$state$schema$no.expand,
    nestedExpand = _view$state$schema$no.nestedExpand,
    layoutColumn = _view$state$schema$no.layoutColumn,
    bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
  if (editorExperiment('platform_synced_block', true)) {
    return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
  }
  return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
};