"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.extractEmbedProps = void 0;
var _linkExtractors = require("@atlaskit/link-extractors");
var _jsonld = require("../../utils/jsonld");
var _context = require("../common/context");
var _extractIsSupportTheming = require("../common/meta/extractIsSupportTheming");
var _extractIsTrusted = require("../common/meta/extractIsTrusted");
var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(response, _platform, iframeUrlType) {
  var meta = response === null || response === void 0 ? void 0 : response.meta;
  var jsonLd = (response === null || response === void 0 ? void 0 : response.data) || (0, _jsonld.getEmptyJsonLd)();
  return {
    link: (0, _linkExtractors.extractSmartLinkUrl)(response) || '',
    title: (0, _linkExtractors.extractSmartLinkTitle)(response),
    context: (0, _context.extractSmartLinkContext)(response),
    preview: (0, _linkExtractors.extractSmartLinkEmbed)(response, iframeUrlType),
    isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
    isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
    type: (0, _linkExtractors.extractType)(jsonLd)
  };
};