// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// static class FlutterAdError {
//   final int code;
//   @NonNull final String domain;
//   @NonNull final String message;
// 
//   FlutterAdError(@NonNull AdError error) {
//     code = error.getCode();
//     domain = error.getDomain();
//     message = error.getMessage();
//   }
// 
//   FlutterAdError(int code, @NonNull String domain, @NonNull String message) {
//     this.code = code;
//     this.domain = domain;
//     this.message = message;
//   }
// 
//   @Override
//   public boolean equals(Object object) {
//     if (this == object) {
//       return true;
//     } else if (!(object instanceof FlutterAdError)) {
//       return false;
//     }
// 
//     final FlutterAdError that = (FlutterAdError) object;
// 
//     if (code != that.code) {
//       return false;
//     } else if (!domain.equals(that.domain)) {
//       return false;
//     }
//     return message.equals(that.message);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(code, domain, message);
//   }
// }
// 
// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// static class FlutterResponseInfo {
// 
//   @Nullable private final String responseId;
//   @Nullable private final String mediationAdapterClassName;
//   @NonNull private final List<FlutterAdapterResponseInfo> adapterResponses;
// 
//   FlutterResponseInfo(@NonNull ResponseInfo responseInfo) {
//     this.responseId = responseInfo.getResponseId();
//     this.mediationAdapterClassName = responseInfo.getMediationAdapterClassName();
//     final List<FlutterAdapterResponseInfo> adapterResponseInfos = new ArrayList<>();
//     for (AdapterResponseInfo adapterInfo : responseInfo.getAdapterResponses()) {
//       adapterResponseInfos.add(new FlutterAdapterResponseInfo(adapterInfo));
//     }
//     this.adapterResponses = adapterResponseInfos;
//   }
// 
//   FlutterResponseInfo(
//       @Nullable String responseId,
//       @Nullable String mediationAdapterClassName,
//       @NonNull List<FlutterAdapterResponseInfo> adapterResponseInfos) {
//     this.responseId = responseId;
//     this.mediationAdapterClassName = mediationAdapterClassName;
//     this.adapterResponses = adapterResponseInfos;
//   }
// 
//   @Nullable
//   String getResponseId() {
//     return responseId;
//   }
// 
//   @Nullable
//   String getMediationAdapterClassName() {
//     return mediationAdapterClassName;
//   }
// 
//   @NonNull
//   List<FlutterAdapterResponseInfo> getAdapterResponses() {
//     return adapterResponses;
//   }
// 
//   @Override
//   public boolean equals(@Nullable Object obj) {
//     if (obj == this) {
//       return true;
//     } else if (!(obj instanceof FlutterResponseInfo)) {
//       return false;
//     }
// 
//     FlutterResponseInfo that = (FlutterResponseInfo) obj;
//     return Objects.equals(responseId, that.responseId)
//         && Objects.equals(mediationAdapterClassName, that.mediationAdapterClassName)
//         && Objects.equals(adapterResponses, that.adapterResponses);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(responseId, mediationAdapterClassName);
//   }
// }


import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.AdError;
import com.google.android.gms.ads.ResponseInfo;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterAdError;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterResponseInfo;
import java.util.HashMap;
import java.util.Map;
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onRewardedAdUserEarnedReward");
    arguments.put("rewardItem", reward);
    invokeOnAdEvent(arguments);
  }

  void onRewardedInterstitialAdUserEarnedReward(
      int adId, @NonNull FlutterRewardedAd.FlutterRewardItem reward) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onRewardedInterstitialAdUserEarnedReward");
    arguments.put("rewardItem", reward);
    invokeOnAdEvent(arguments);
  }

  void onPaidEvent(@NonNull FlutterAd ad, @NonNull FlutterAdValue adValue) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adIdFor(ad));
    arguments.put("eventName", "onPaidEvent");
    arguments.put("valueMicros", adValue.valueMicros);
    arguments.put("precision", adValue.precisionType);
    arguments.put("currencyCode", adValue.currencyCode);
    invokeOnAdEvent(arguments);
  }

  void onFailedToShowFullScreenContent(int adId, @NonNull AdError error) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onFailedToShowFullScreenContent");
// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// static class FlutterAdError {
//   final int code;
//   @NonNull final String domain;
//   @NonNull final String message;
// 
//   FlutterAdError(@NonNull AdError error) {
//     code = error.getCode();
//     domain = error.getDomain();
//     message = error.getMessage();
//   }
// 
//   FlutterAdError(int code, @NonNull String domain, @NonNull String message) {
//     this.code = code;
//     this.domain = domain;
//     this.message = message;
//   }
// 
//   @Override
//   public boolean equals(Object object) {
//     if (this == object) {
//       return true;
//     } else if (!(object instanceof FlutterAdError)) {
//       return false;
//     }
// 
//     final FlutterAdError that = (FlutterAdError) object;
// 
//     if (code != that.code) {
//       return false;
//     } else if (!domain.equals(that.domain)) {
//       return false;
//     }
//     return message.equals(that.message);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(code, domain, message);
//   }
// }
// 
// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/FlutterAd.java
// static class FlutterResponseInfo {
// 
//   @Nullable private final String responseId;
//   @Nullable private final String mediationAdapterClassName;
//   @NonNull private final List<FlutterAdapterResponseInfo> adapterResponses;
// 
//   FlutterResponseInfo(@NonNull ResponseInfo responseInfo) {
//     this.responseId = responseInfo.getResponseId();
//     this.mediationAdapterClassName = responseInfo.getMediationAdapterClassName();
//     final List<FlutterAdapterResponseInfo> adapterResponseInfos = new ArrayList<>();
//     for (AdapterResponseInfo adapterInfo : responseInfo.getAdapterResponses()) {
//       adapterResponseInfos.add(new FlutterAdapterResponseInfo(adapterInfo));
//     }
//     this.adapterResponses = adapterResponseInfos;
//   }
// 
//   FlutterResponseInfo(
//       @Nullable String responseId,
//       @Nullable String mediationAdapterClassName,
//       @NonNull List<FlutterAdapterResponseInfo> adapterResponseInfos) {
//     this.responseId = responseId;
//     this.mediationAdapterClassName = mediationAdapterClassName;
//     this.adapterResponses = adapterResponseInfos;
//   }
// 
//   @Nullable
//   String getResponseId() {
//     return responseId;
//   }
// 
//   @Nullable
//   String getMediationAdapterClassName() {
//     return mediationAdapterClassName;
//   }
// 
//   @NonNull
//   List<FlutterAdapterResponseInfo> getAdapterResponses() {
//     return adapterResponses;
//   }
// 
//   @Override
//   public boolean equals(@Nullable Object obj) {
//     if (obj == this) {
//       return true;
//     } else if (!(obj instanceof FlutterResponseInfo)) {
//       return false;
//     }
// 
//     FlutterResponseInfo that = (FlutterResponseInfo) obj;
//     return Objects.equals(responseId, that.responseId)
//         && Objects.equals(mediationAdapterClassName, that.mediationAdapterClassName)
//         && Objects.equals(adapterResponses, that.adapterResponses);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hash(responseId, mediationAdapterClassName);
//   }
// }


// Path: packages/google_mobile_ads/android/src/main/java/io/flutter/plugins/googlemobileads/AdInstanceManager.java
import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.AdError;
import com.google.android.gms.ads.ResponseInfo;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterAdError;
import io.flutter.plugins.googlemobileads.FlutterAd.FlutterResponseInfo;
import java.util.HashMap;
import java.util.Map;

    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onRewardedAdUserEarnedReward");
    arguments.put("rewardItem", reward);
    invokeOnAdEvent(arguments);
  }

  void onRewardedInterstitialAdUserEarnedReward(
      int adId, @NonNull FlutterRewardedAd.FlutterRewardItem reward) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onRewardedInterstitialAdUserEarnedReward");
    arguments.put("rewardItem", reward);
    invokeOnAdEvent(arguments);
  }

  void onPaidEvent(@NonNull FlutterAd ad, @NonNull FlutterAdValue adValue) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adIdFor(ad));
    arguments.put("eventName", "onPaidEvent");
    arguments.put("valueMicros", adValue.valueMicros);
    arguments.put("precision", adValue.precisionType);
    arguments.put("currencyCode", adValue.currencyCode);
    invokeOnAdEvent(arguments);
  }

  void onFailedToShowFullScreenContent(int adId, @NonNull AdError error) {
    final Map<Object, Object> arguments = new HashMap<>();
    arguments.put("adId", adId);
    arguments.put("eventName", "onFailedToShowFullScreenContent");
    arguments.put("error", new FlutterAdError(error));