import documentReady from '@assets/js/documentReady';

import backToTopWidget from '@widgets/backToTopWidget';
import whatsAppWidget from '@widgets/whatsAppWidget';
import cookiesPolicyWidget from '@widgets/cookiesPolicyWidget';
import testEnvironmentWidget from '@widgets/testEnvironmentWidget';

documentReady(() => {
  const { backToTop, whatsApp, cookiesPolicy, testEnvironment } = window.commonFooter;

  if (backToTop) {
    backToTopWidget(backToTop);
  }
  if (whatsApp) {
    whatsAppWidget(whatsApp);
  }
  if (cookiesPolicy) {
    cookiesPolicyWidget(cookiesPolicy);
  }
  if (testEnvironment) {
    testEnvironmentWidget(testEnvironment);
  }
});
