package com.ikea.kompis.extendedcontent;

import android.content.Context;
import com.ikea.shared.AppConfigData;
import com.ikea.shared.AppConfigManager;
import com.ikea.shared.config.model.Config;
import com.ikea.shared.config.model.Country;
import com.ikea.shared.config.model.Region;
import com.ikea.shared.config.model.RegionList;
import com.ikea.shared.config.service.ConfigService;
import com.ikea.shared.stores.model.StoreRef;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class ECCountryUtils
{
  public String getCountryNameFromCode(Context paramContext, String paramString)
  {
    Iterator localIterator = ConfigService.i(paramContext).getCachedConfig().getCountry().iterator();
    while (localIterator.hasNext())
    {
      Country localCountry = (Country)localIterator.next();
      if (localCountry.getCountrycode().equalsIgnoreCase(paramString))
        return localCountry.getCountryName();
    }
    return null;
  }

  public boolean isECEnabledInCurrentStore(Context paramContext)
  {
    String str1 = AppConfigManager.i(paramContext).getAppConfigData().getCountryCode();
    if (AppConfigManager.i(paramContext).getAppConfigData().getFavStore() != null)
    {
      String str2 = AppConfigManager.i(paramContext).getAppConfigData().getFavStore().getId();
      Iterator localIterator1 = ConfigService.i(paramContext).getCachedConfig().getCountry().iterator();
      break label161;
      label55: Country localCountry;
      List localList;
      do
      {
        do
        {
          if (!localIterator1.hasNext())
            break;
          localCountry = (Country)localIterator1.next();
        }
        while (!localCountry.getCountrycode().equalsIgnoreCase(str1));
        localList = localCountry.getRegions().getRegions();
        if ((localList == null) || (localList.size() <= 0))
          break label210;
        if (localList.size() != 1)
          break;
      }
      while ((localCountry.getECStoreList() == null) || (!Arrays.asList(localCountry.getECStoreList()).contains(str2)));
      label161: label210: 
      while ((localCountry.getECStoreList() != null) && (Arrays.asList(localCountry.getECStoreList()).contains(str2)))
      {
        return true;
        Iterator localIterator2 = localList.iterator();
        if (!localIterator2.hasNext())
          break label55;
        Region localRegion = (Region)localIterator2.next();
        if ((localRegion.getECStoreList() == null) || (!Arrays.asList(localRegion.getECStoreList()).contains(str2)))
          break;
        return true;
      }
      return false;
    }
    return false;
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.extendedcontent.ECCountryUtils
 * JD-Core Version:    0.6.2
 */