








#import <AppLovinSDK/AppLovinSDK.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>

@interface LightTropicalNameCreateAdvertiseScore : NSObject<MARewardedAdDelegate,MAAdViewAdDelegate,MAAdDelegate,MAAdRevenueDelegate>

@property (nonatomic, strong) MARewardedAd *magicAddressGigahertzAbsoluteIslamic;
@property (nonatomic, strong) MAInterstitialAd *weightReadoutMostDynamicInterrupt;
@property (nonatomic, assign) NSInteger phraseExistentIndicatedPossibleUpscale;

@property (nonatomic, copy) NSString *slantTwentyData;

@property (nonatomic, copy) void (^wrapUserHuman)(BOOL result);

@property (nonatomic, copy) void (^playbackSumSceneEuropeanLowJson)(BOOL result, NSDictionary *maxJson);

@property (nonatomic, copy) void (^factBusMalayManganeseAnimatePhonogram)(BOOL result);

@property (nonatomic, copy) void (^resultsPitchPrefersRuleLocalizedTenJson)(BOOL result, NSDictionary *maxJson);

@property (nonatomic, copy) void (^clampedProfilePopLowerCellphoneHandle)(NSDictionary *dueInfo);

@end

@implementation LightTropicalNameCreateAdvertiseScore

+ (instancetype)shared {
    static id shared = nil;
    static dispatch_once_t sideToken;
    dispatch_once(&sideToken, ^{
        shared = [[super allocWithZone:NULL] init];
    });
    return shared;
}

+ (NSString *)mapPreserved {
    return ALSdk.version;
}

- (void)showMediationDebugger {
    [[ALSdk shared] showMediationDebugger];
}

- (void)lightFocusDefineFrequencyRecordFar:(void(^)(NSDictionary *dueInfo))callback {
    self.clampedProfilePopLowerCellphoneHandle = callback;
}


- (void)retainedLeastFindAvailTeamSilenceKey:(NSString *)xxpk_maxkey acceptedSpeechPaddleWaterRoman:(NSString *)acceptedSpeechPaddleWaterRoman establishOutNearMinimizeNotifyingPlayback:(NSString *)establishOutNearMinimizeNotifyingPlayback illFormatsTenCurveLinearly:(NSArray *)illFormatsTenCurveLinearly {
    
    
    
    Class won = NSClassFromString(@"FBAdSettings");
    if (won) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
        [won performSelector:@selector(setDataProcessingOptions:) withObject:@[]];
        [won performSelector:@selector(setAdvertiserTrackingEnabled:) withObject:@(YES)];
#pragma clang diagnostic pop
    }
    
    

    
    ALSdkInitializationConfiguration *factoriesSignaturePasswordsCadenceChapter = [ALSdkInitializationConfiguration configurationWithSdkKey:xxpk_maxkey builderBlock:^(ALSdkInitializationConfigurationBuilder * _Nonnull builder) {
        builder.mediationProvider = ALMediationProviderMAX;
        if (illFormatsTenCurveLinearly) {
            builder.testDeviceAdvertisingIdentifiers = illFormatsTenCurveLinearly;
        }
        if (@available(iOS 14, *)) {
            if ([ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized ) {
                [ALPrivacySettings setHasUserConsent: YES];
            }
        } else {
            [ALPrivacySettings setHasUserConsent: YES];
        }
    }];
    
    [[ALSdk shared] initializeWithConfiguration:factoriesSignaturePasswordsCadenceChapter completionHandler:^(ALSdkConfiguration * _Nonnull configuration) {
        [self leakyClampedSafetyRestWideSurfaceAnalysis:acceptedSpeechPaddleWaterRoman];
        if (establishOutNearMinimizeNotifyingPlayback.length > 0) {
            [self observingParentRoleIntrinsicAccessingArrivalStorageLeft:establishOutNearMinimizeNotifyingPlayback];
        }
    }];
}

- (void)leakyClampedSafetyRestWideSurfaceAnalysis:(NSString *)acceptedSpeechPaddleWaterRoman
{
    self.magicAddressGigahertzAbsoluteIslamic = [MARewardedAd sharedWithAdUnitIdentifier:acceptedSpeechPaddleWaterRoman];
    self.magicAddressGigahertzAbsoluteIslamic.delegate = self;
    self.magicAddressGigahertzAbsoluteIslamic.revenueDelegate = self;

    
    [self.magicAddressGigahertzAbsoluteIslamic loadAd];
}

- (void)observingParentRoleIntrinsicAccessingArrivalStorageLeft:(NSString *)establishOutNearMinimizeNotifyingPlayback
{
    self.weightReadoutMostDynamicInterrupt = [[MAInterstitialAd alloc] initWithAdUnitIdentifier:establishOutNearMinimizeNotifyingPlayback];
    self.weightReadoutMostDynamicInterrupt.delegate = self;
    self.weightReadoutMostDynamicInterrupt.revenueDelegate = self;

    
    [self.weightReadoutMostDynamicInterrupt loadAd];
}


- (void)reuseLexiconUnlearnCanadianGeneratesOurData:(nullable NSString *)slantTwentyData burnHueBedJson:(void(^)(BOOL result, NSDictionary *maxJson))burnHueBedJson {
    self.playbackSumSceneEuropeanLowJson = burnHueBedJson;
    self.slantTwentyData = slantTwentyData;
    if ( [self.magicAddressGigahertzAbsoluteIslamic isReady]) {
        [self.magicAddressGigahertzAbsoluteIslamic showAdForPlacement:nil customData:slantTwentyData];
    }else {
        burnHueBedJson(NO,nil);
    }
}

- (void)reuseLexiconUnlearnCanadianGeneratesOurData:(nullable NSString *)slantTwentyData keepGain:(void(^)(BOOL result))keepGain {
    self.wrapUserHuman = keepGain;
    self.slantTwentyData = slantTwentyData;
    if ( [self.magicAddressGigahertzAbsoluteIslamic isReady]) {
        [self.magicAddressGigahertzAbsoluteIslamic showAdForPlacement:nil customData:slantTwentyData];
    }else {
        keepGain(NO);
    }
}

- (void)angleLostAdvancedItsStackGuestSubstringData:(nullable NSString *)slantTwentyData keepGain:(void(^)(BOOL result))keepGain {
    self.factBusMalayManganeseAnimatePhonogram = keepGain;
    self.slantTwentyData = slantTwentyData;
    if ([self.weightReadoutMostDynamicInterrupt isReady]) {
        [self.weightReadoutMostDynamicInterrupt showAd];
    } else {
        [self.weightReadoutMostDynamicInterrupt loadAd];
        if (keepGain) {
            keepGain(NO);
        }
    }
}

- (void)angleLostAdvancedItsStackGuestSubstringData:(nullable NSString *)slantTwentyData burnHueBedJson:(void(^)(BOOL result, NSDictionary *maxJson))burnHueBedJson {
    self.resultsPitchPrefersRuleLocalizedTenJson = burnHueBedJson;
    self.slantTwentyData = slantTwentyData;
    if ([self.weightReadoutMostDynamicInterrupt isReady]) {
        [self.weightReadoutMostDynamicInterrupt showAd];
    } else {
        [self.weightReadoutMostDynamicInterrupt loadAd];
        if (burnHueBedJson) {
            burnHueBedJson(NO, nil);
        }
    }
}

- (void)disparityAndAdobeClampedAdapter:(const char *)name error:(NSString *)error {
    
}

- (NSDictionary *)senderYoungestOwnerInvertedImmediate:(MAAd *)ad {
    NSMutableDictionary *maxJson = [NSMutableDictionary dictionary];
    
    maxJson[@"currency"] = @"USD";
    maxJson[@"revenue"] = @(ad.revenue);
    
    if (ad.format.label.length > 0) {
        maxJson[@"format"] = ad.format.label;
    }
    
    return [maxJson copy];
}

- (void)primeSuitableSuchScreenYetWake:(MAAd *)ad eventType:(NSString *)eventType {
    if (!self.clampedProfilePopLowerCellphoneHandle) {
        return;
    }

    NSString *adType = @"UNKNOWN";
    if ([ad.format isEqual:MAAdFormat.rewarded]) {
        adType = @"REWARD";
    } else if ([ad.format isEqual:MAAdFormat.interstitial]) {
        adType = @"INTERSTITIAL";
    }

    NSDictionary *dueInfo = @{
        @"ads_platform": @"APPLOVIN",
        @"ad_unit_id": ad.adUnitIdentifier ?: @"",
        @"event_type": eventType,  
        @"ad_type": adType,
        @"revenue": @(ad.revenue).stringValue ?: @"0"
    };

    self.clampedProfilePopLowerCellphoneHandle(dueInfo);
}


- (void)didLoadAd:(nonnull MAAd *)ad {
    
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
    
    
    self.phraseExistentIndicatedPossibleUpscale = 0;
}

- (void)didFailToLoadAdForAdUnitIdentifier:(nonnull NSString *)adUnitIdentifier withError:(nonnull MAError *)error {

    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:error.message];

    

    self.phraseExistentIndicatedPossibleUpscale++;
    NSInteger airShare = pow(2, MIN(6, self.phraseExistentIndicatedPossibleUpscale));

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, airShare * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        
        if ([adUnitIdentifier isEqualToString:self.magicAddressGigahertzAbsoluteIslamic.adUnitIdentifier]) {
            [self.magicAddressGigahertzAbsoluteIslamic loadAd];
        } else if ([adUnitIdentifier isEqualToString:self.weightReadoutMostDynamicInterrupt.adUnitIdentifier]) {
            [self.weightReadoutMostDynamicInterrupt loadAd];
        }
    });
}

- (void)didHideAd:(MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];

    
    if ([ad.format isEqual:MAAdFormat.rewarded]) {
        [self.magicAddressGigahertzAbsoluteIslamic loadAd];
    } else if ([ad.format isEqual:MAAdFormat.interstitial]) {
        [self.weightReadoutMostDynamicInterrupt loadAd];

        
        if (self.factBusMalayManganeseAnimatePhonogram) {
            self.factBusMalayManganeseAnimatePhonogram(YES);
        }

        if (self.resultsPitchPrefersRuleLocalizedTenJson) {
            NSDictionary *maxJson = [self senderYoungestOwnerInvertedImmediate:ad];
            self.resultsPitchPrefersRuleLocalizedTenJson(YES, maxJson);
        }
    }
}

- (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error
{
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:error.message];

    
    if ([ad.format isEqual:MAAdFormat.rewarded]) {
        [self.magicAddressGigahertzAbsoluteIslamic loadAd];

        if (self.wrapUserHuman) {
            self.wrapUserHuman(NO);
        }

        if (self.playbackSumSceneEuropeanLowJson) {
            self.playbackSumSceneEuropeanLowJson(NO, nil);
        }
    } else if ([ad.format isEqual:MAAdFormat.interstitial]) {
        [self.weightReadoutMostDynamicInterrupt loadAd];

        if (self.factBusMalayManganeseAnimatePhonogram) {
            self.factBusMalayManganeseAnimatePhonogram(NO);
        }

        if (self.resultsPitchPrefersRuleLocalizedTenJson) {
            self.resultsPitchPrefersRuleLocalizedTenJson(NO, nil);
        }
    }
}

- (void)didClickAd:(nonnull MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
    [self primeSuitableSuchScreenYetWake:ad eventType:@"1"];
}

- (void)didDisplayAd:(nonnull MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
    [self primeSuitableSuchScreenYetWake:ad eventType:@"2"];
}

- (void)didRewardUserForAd:(nonnull MAAd *)ad withReward:(nonnull MAReward *)reward {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];

    if (self.wrapUserHuman) {
        self.wrapUserHuman(YES);
    }

    if (self.playbackSumSceneEuropeanLowJson) {
        NSDictionary *maxJson = [self senderYoungestOwnerInvertedImmediate:ad];
        self.playbackSumSceneEuropeanLowJson(YES, maxJson);
    }
}


- (void)didCollapseAd:(nonnull MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
}

- (void)didExpandAd:(nonnull MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
}


- (void)didPayRevenueForAd:(MAAd *)ad {
    [self disparityAndAdobeClampedAdapter: __PRETTY_FUNCTION__ error:nil];
    [self primeSuitableSuchScreenYetWake:ad eventType:@"3"];
}

@end
