import { FabricChannel } from '@atlaskit/analytics-listeners';
import { AnalyticsQueue } from './analytics-queue';
export const editorAnalyticsChannel = FabricChannel.editor;
export const fireAnalyticsEvent = createAnalyticsEvent => ({
  payload,
  channel = editorAnalyticsChannel
}) => {
  if (!createAnalyticsEvent) {
    return;
  }
  const queue = AnalyticsQueue.get();
  queue.schedule(() => {
    var _createAnalyticsEvent;
    return (_createAnalyticsEvent = createAnalyticsEvent(payload)) === null || _createAnalyticsEvent === void 0 ? void 0 : _createAnalyticsEvent.fire(channel);
  });
};