{"size": 868, "ext": "js", "max_stars_repo_path": "extensions/amp-subscriptions/0.1/local-subscription-platform.js", "max_stars_repo_name": "becca-bailey/amphtml", "max_stars_repo_stars_event_min_datetime": "2015-10-07T13:08:48.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T12:52:40.000Z", "max_issues_repo_path": "extensions/amp-subscriptions/0.1/local-subscription-platform.js", "max_issues_repo_name": "becca-bailey/amphtml", "max_issues_repo_issues_event_min_datetime": "2015-10-07T12:41:00.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T23:41:02.000Z", "max_forks_repo_path": "extensions/amp-subscriptions/0.1/local-subscription-platform.js", "max_forks_repo_name": "becca-bailey/amphtml", "max_forks_repo_forks_event_min_datetime": "2015-10-07T12:42:26.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T08:39:56.000Z"}
{"max_stars_count": 16831, "max_issues_count": 27413, "max_forks_count": 5001, "avg_line_length": 28.9333333333, "max_line_length": 85, "alphanum_fraction": 0.732718894}
import {LocalSubscriptionIframePlatform} from './local-subscription-platform-iframe';
import {LocalSubscriptionRemotePlatform} from './local-subscription-platform-remote';

/**
 * Local subscription platform factory method.
 * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc
 * @param {!JsonObject} platformConfig
 * @param {!./service-adapter.ServiceAdapter} serviceAdapter
 * @return {!./subscription-platform.SubscriptionPlatform}
 */
export function localSubscriptionPlatformFactory(
  ampdoc,
  platformConfig,
  serviceAdapter
) {
  /* Return the correxct platform based on the config */
  if (platformConfig['type'] === 'iframe') {
    return new LocalSubscriptionIframePlatform(
      ampdoc,
      platformConfig,
      serviceAdapter
    );
  }
  return new LocalSubscriptionRemotePlatform(
    ampdoc,
    platformConfig,
    serviceAdapter
  );
}
