"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createLoadSucceededEvent = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var createLoadSucceededEvent = exports.createLoadSucceededEvent = function createLoadSucceededEvent(_ref, traceContext) {
  var fileId = _ref.fileId,
    fileMediatype = _ref.fileMediatype,
    fileMimetype = _ref.fileMimetype,
    fileSize = _ref.fileSize;
  return {
    eventType: 'operational',
    actionSubject: 'mediaFile',
    action: 'loadSucceeded',
    attributes: {
      status: 'success',
      fileMediatype: fileMediatype,
      fileMimetype: fileMimetype,
      fileAttributes: {
        fileId: fileId,
        fileMediatype: fileMediatype,
        fileMimetype: fileMimetype,
        fileSize: fileSize
      },
      traceContext: fileMediatype === 'image' ? traceContext : undefined,
      featureFlags: {
        media_document_viewer: (0, _platformFeatureFlags.fg)('media_document_viewer')
      }
    }
  };
};