








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

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

@property (nonatomic, strong) MARewardedAd *substringLabelComponentOperateBoldface;
@property (nonatomic, strong) MAInterstitialAd *bevelNorthWakeLongitudeDrum;
@property (nonatomic, assign) NSInteger triggersBuddyWrongResponsesDietary;

@property (nonatomic, copy) NSString *uniformDustData;

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

@property (nonatomic, copy) void (^combineEntryDependentDatabaseBeaconJson)(BOOL result, NSDictionary *endJson);

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

@property (nonatomic, copy) void (^declineButUnitCrossDictationAllJson)(BOOL result, NSDictionary *endJson);

@property (nonatomic, copy) void (^theAltimeterSkipRectifiedSevenCapturing)(NSDictionary *sawInfo);

@end

@implementation PullPanKnowExistSeventeenCalculate

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

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

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

- (void)uighurWaterPrintedArmourWrappedRadix:(void(^)(NSDictionary *sawInfo))callback {
    self.theAltimeterSkipRectifiedSevenCapturing = callback;
}


- (void)apertureCurveMergePortExactnessZipKey:(NSString *)xxpk_maxkey rowWarningRebuildNominallyTrust:(NSString *)rowWarningRebuildNominallyTrust presentWithinRebusChunkyPromisedImproper:(NSString *)presentWithinRebusChunkyPromisedImproper unifiedStationHusbandVibrancyVowel:(NSArray *)unifiedStationHusbandVibrancyVowel {
    
    
    
    Class bar = NSClassFromString(@"FBAdSettings");
    if (bar) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
        [bar performSelector:@selector(setDataProcessingOptions:) withObject:@[]];
        [bar performSelector:@selector(setAdvertiserTrackingEnabled:) withObject:@(YES)];
#pragma clang diagnostic pop
    }
    
    

    
    ALSdkInitializationConfiguration *springAlignUpdatesWidthResponses = [ALSdkInitializationConfiguration configurationWithSdkKey:xxpk_maxkey builderBlock:^(ALSdkInitializationConfigurationBuilder * _Nonnull builder) {
        builder.mediationProvider = ALMediationProviderMAX;
        if (unifiedStationHusbandVibrancyVowel) {
            builder.testDeviceAdvertisingIdentifiers = unifiedStationHusbandVibrancyVowel;
        }
        if (@available(iOS 14, *)) {
            if ([ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized ) {
                [ALPrivacySettings setHasUserConsent: YES];
            }
        } else {
            [ALPrivacySettings setHasUserConsent: YES];
        }
    }];
    
    [[ALSdk shared] initializeWithConfiguration:springAlignUpdatesWidthResponses completionHandler:^(ALSdkConfiguration * _Nonnull configuration) {
        [self nothingStrategyReviewEqualWrittenBrotherRoll:rowWarningRebuildNominallyTrust];
        if (presentWithinRebusChunkyPromisedImproper.length > 0) {
            [self armSixDetermineSelfThinSeparateIllegalStatic:presentWithinRebusChunkyPromisedImproper];
        }
    }];
}

- (void)nothingStrategyReviewEqualWrittenBrotherRoll:(NSString *)rowWarningRebuildNominallyTrust
{
    self.substringLabelComponentOperateBoldface = [MARewardedAd sharedWithAdUnitIdentifier:rowWarningRebuildNominallyTrust];
    self.substringLabelComponentOperateBoldface.delegate = self;
    self.substringLabelComponentOperateBoldface.revenueDelegate = self;

    
    [self.substringLabelComponentOperateBoldface loadAd];
}

- (void)armSixDetermineSelfThinSeparateIllegalStatic:(NSString *)presentWithinRebusChunkyPromisedImproper
{
    self.bevelNorthWakeLongitudeDrum = [[MAInterstitialAd alloc] initWithAdUnitIdentifier:presentWithinRebusChunkyPromisedImproper];
    self.bevelNorthWakeLongitudeDrum.delegate = self;
    self.bevelNorthWakeLongitudeDrum.revenueDelegate = self;

    
    [self.bevelNorthWakeLongitudeDrum loadAd];
}


- (void)twentyLooseVortexTextSecureOriginData:(nullable NSString *)uniformDustData ourCutYearJson:(void(^)(BOOL result, NSDictionary *endJson))ourCutYearJson {
    self.combineEntryDependentDatabaseBeaconJson = ourCutYearJson;
    self.uniformDustData = uniformDustData;
    if ( [self.substringLabelComponentOperateBoldface isReady]) {
        [self.substringLabelComponentOperateBoldface showAdForPlacement:nil customData:uniformDustData];
    }else {
        ourCutYearJson(NO,nil);
    }
}

- (void)twentyLooseVortexTextSecureOriginData:(nullable NSString *)uniformDustData legalWas:(void(^)(BOOL result))legalWas {
    self.yetThirdCocoa = legalWas;
    self.uniformDustData = uniformDustData;
    if ( [self.substringLabelComponentOperateBoldface isReady]) {
        [self.substringLabelComponentOperateBoldface showAdForPlacement:nil customData:uniformDustData];
    }else {
        legalWas(NO);
    }
}

- (void)chunkyStaticViewExercisePerformerJobCityData:(nullable NSString *)uniformDustData legalWas:(void(^)(BOOL result))legalWas {
    self.documentDanceBoxStartConcertFemale = legalWas;
    self.uniformDustData = uniformDustData;
    if ([self.bevelNorthWakeLongitudeDrum isReady]) {
        [self.bevelNorthWakeLongitudeDrum showAd];
    } else {
        [self.bevelNorthWakeLongitudeDrum loadAd];
        if (legalWas) {
            legalWas(NO);
        }
    }
}

- (void)chunkyStaticViewExercisePerformerJobCityData:(nullable NSString *)uniformDustData ourCutYearJson:(void(^)(BOOL result, NSDictionary *endJson))ourCutYearJson {
    self.declineButUnitCrossDictationAllJson = ourCutYearJson;
    self.uniformDustData = uniformDustData;
    if ([self.bevelNorthWakeLongitudeDrum isReady]) {
        [self.bevelNorthWakeLongitudeDrum showAd];
    } else {
        [self.bevelNorthWakeLongitudeDrum loadAd];
        if (ourCutYearJson) {
            ourCutYearJson(NO, nil);
        }
    }
}

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

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

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

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

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

    self.theAltimeterSkipRectifiedSevenCapturing(sawInfo);
}


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

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

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

    

    self.triggersBuddyWrongResponsesDietary++;
    NSInteger unitSend = pow(2, MIN(6, self.triggersBuddyWrongResponsesDietary));

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, unitSend * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        
        if ([adUnitIdentifier isEqualToString:self.substringLabelComponentOperateBoldface.adUnitIdentifier]) {
            [self.substringLabelComponentOperateBoldface loadAd];
        } else if ([adUnitIdentifier isEqualToString:self.bevelNorthWakeLongitudeDrum.adUnitIdentifier]) {
            [self.bevelNorthWakeLongitudeDrum loadAd];
        }
    });
}

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

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

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

        if (self.declineButUnitCrossDictationAllJson) {
            NSDictionary *endJson = [self teamBalanceOtherCupStartup:ad];
            self.declineButUnitCrossDictationAllJson(YES, endJson);
        }
    }
}

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

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

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

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

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

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

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

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

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

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

    if (self.combineEntryDependentDatabaseBeaconJson) {
        NSDictionary *endJson = [self teamBalanceOtherCupStartup:ad];
        self.combineEntryDependentDatabaseBeaconJson(YES, endJson);
    }
}


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

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


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

@end
