package com.discord.utilities.rest; import com.discord.utilities.analytics.AnalyticSuperProperties; import d0.t.h0; import d0.z.d.m; import f0.f0.c; import f0.w; import f0.z; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import okhttp3.Headers; import okhttp3.Interceptor; import okhttp3.RequestBody; import okhttp3.Response; /* compiled from: Interceptor.kt */ public final class RestAPI$Companion$buildAnalyticsInterceptor$$inlined$invoke$1 implements Interceptor { @Override // okhttp3.Interceptor public Response intercept(Interceptor.Chain chain) { Map map; m.checkParameterIsNotNull(chain, "chain"); z c2 = chain.c(); m.checkParameterIsNotNull(c2, "request"); new LinkedHashMap(); w wVar = c2.b; String str = c2.f2767c; RequestBody requestBody = c2.e; Map linkedHashMap = c2.f.isEmpty() ? new LinkedHashMap() : h0.toMutableMap(c2.f); Headers.a e = c2.d.e(); String superPropertiesStringBase64 = AnalyticSuperProperties.INSTANCE.getSuperPropertiesStringBase64(); m.checkParameterIsNotNull("X-Super-Properties", "name"); m.checkParameterIsNotNull(superPropertiesStringBase64, "value"); e.a("X-Super-Properties", superPropertiesStringBase64); if (wVar != null) { Headers c3 = e.c(); byte[] bArr = c.a; m.checkParameterIsNotNull(linkedHashMap, "$this$toImmutableMap"); if (linkedHashMap.isEmpty()) { map = h0.emptyMap(); } else { map = Collections.unmodifiableMap(new LinkedHashMap(linkedHashMap)); m.checkExpressionValueIsNotNull(map, "Collections.unmodifiableMap(LinkedHashMap(this))"); } return chain.a(new z(wVar, str, c3, requestBody, map)); } throw new IllegalStateException("url == null".toString()); } }