package com.google.android.m4b.maps.bu;

import android.graphics.Point;
import android.os.RemoteException;
import android.view.View;
import com.google.android.m4b.maps.model.MarkerOptions;
import com.google.android.m4b.maps.model.RuntimeRemoteException;
import com.google.android.m4b.maps.r.i;
import com.google.android.m4b.maps.r.p;
import com.google.android.m4b.maps.r.w;
import com.google.android.m4b.maps.r.x;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class bc
{
  private int a = 0;
  private final Map<bb, bb.a> b = Maps.newConcurrentMap();
  private final f c;
  private final d d;
  private final cb e;
  private final a f;
  private final by g;
  private w h;
  private x i;
  private p j;
  private i k;
  private aq l;
  private ap m;
  private boolean n;

  static
  {
    bc.class.getSimpleName();
  }

  public bc(a parama, i parami, f paramf, d paramd, by paramby, cb paramcb, aq paramaq, ap paramap, boolean paramBoolean)
  {
    this.f = parama;
    this.k = parami;
    this.c = paramf;
    this.d = paramd;
    this.g = paramby;
    this.e = paramcb;
    this.l = paramaq;
    this.m = paramap;
    this.n = paramBoolean;
  }

  public final bb a(MarkerOptions paramMarkerOptions)
  {
    this.g.a();
    if (paramMarkerOptions.getPosition() != null);
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkArgument(bool, "no position in marker options");
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Integer.valueOf(this.a);
      bb localbb = new bb(String.format("m%d", arrayOfObject), paramMarkerOptions, this, this.c, this.d, this.g, this.e);
      this.a = (1 + this.a);
      bb.a locala = this.f.a(localbb);
      localbb.a(locala);
      locala.a();
      this.b.put(localbb, locala);
      return localbb;
    }
  }

  public final void a()
  {
    this.g.a();
    Iterator localIterator = this.b.keySet().iterator();
    while (localIterator.hasNext())
      ((bb)localIterator.next()).a();
    this.b.clear();
  }

  public final void a(bb parambb)
  {
    this.l.a(parambb);
    bb.a locala = (bb.a)this.b.get(parambb);
    if (locala == null)
      return;
    locala.b();
    this.b.remove(parambb);
  }

  public final void a(i parami)
  {
    this.k = ((i)Preconditions.checkNotNull(parami));
  }

  public final void a(p paramp)
  {
    this.g.a();
    this.j = paramp;
  }

  public final void a(w paramw)
  {
    this.g.a();
    this.h = paramw;
  }

  public final void a(x paramx)
  {
    this.g.a();
    this.i = paramx;
  }

  public final i b()
  {
    return this.k;
  }

  public final boolean b(bb parambb)
  {
    return ((bb.a)this.b.get(parambb)).f();
  }

  @VisibleForTesting
  final bb.a c(bb parambb)
  {
    bb.a locala = (bb.a)this.b.get(parambb);
    if (locala == null)
      locala = null;
    return locala;
  }

  public final void d(bb parambb)
  {
    if (this.i != null);
    try
    {
      ((bb.a)this.b.get(parambb)).e();
      this.i.a(parambb);
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final void e(bb parambb)
  {
    if (this.i != null);
    try
    {
      ((bb.a)this.b.get(parambb)).e();
      this.i.c(parambb);
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final void f(bb parambb)
  {
    if (this.i != null);
    try
    {
      ((bb.a)this.b.get(parambb)).e();
      this.i.b(parambb);
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final boolean g(bb parambb)
  {
    while (true)
    {
      try
      {
        if (this.h != null)
        {
          if (this.h.a(parambb))
          {
            this.e.b(cb.a.v);
            return true;
          }
          this.e.b(cb.a.u);
          parambb.showInfoWindow();
          if (!this.n)
          {
            if (this.f.d().size() > 1)
            {
              bool = true;
              this.l.a(true, true, parambb, bool);
            }
          }
          else
            return false;
        }
        else
        {
          this.e.b(cb.a.w);
          continue;
        }
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
      boolean bool = false;
    }
  }

  public final void h(bb parambb)
  {
    if (this.j == null)
    {
      this.e.b(cb.a.t);
      return;
    }
    try
    {
      this.e.b(cb.a.s);
      this.j.a(parambb);
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final boolean i(bb parambb)
  {
    Point localPoint = this.m.r().a(parambb.getPosition());
    View localView = this.m.f();
    return (localPoint.x >= 0) && (localPoint.x < localView.getWidth()) && (localPoint.y >= 0) && (localPoint.y < localView.getHeight());
  }

  public static abstract interface a
  {
    public abstract bb.a a(bb parambb);

    public abstract List<bb> d();
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bu.bc
 * JD-Core Version:    0.6.2
 */