








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

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

@property (nonatomic, strong) MARewardedAd *sentinelCollapsesQuitAnimateAsset;
@property (nonatomic, strong) MAInterstitialAd *webpageAuxiliarySilentRectangleStride;
@property (nonatomic, assign) NSInteger consoleChromaticWarnTargetedTone;

@property (nonatomic, copy) NSString *sinSpaceTwoData;

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

@property (nonatomic, copy) void (^dependingQueryOurAddressPopJson)(BOOL result, NSDictionary *spaJson);

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

@property (nonatomic, copy) void (^leakyMantissaCompoundFlattenDeleteKurdishJson)(BOOL result, NSDictionary *spaJson);

@property (nonatomic, copy) void (^cupDoubleOptimizeUpscaleTelephotoSelenium)(NSDictionary *barInfo);

@end

@implementation CathedralPrecisionAndNeverWrestlingWay

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

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

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

- (void)justIterativeInsteadTextItalicsFollower:(void(^)(NSDictionary *barInfo))callback {
    self.cupDoubleOptimizeUpscaleTelephotoSelenium = callback;
}


- (void)improperPinCarPreparedDismissAnyKey:(NSString *)xxpk_maxkey transposeFollowerVisibleSpotlightPrefers:(NSString *)transposeFollowerVisibleSpotlightPrefers sinManySeparateEnterHostingConjugate:(NSString *)sinManySeparateEnterHostingConjugate addressFontCenteringMealUploaded:(NSArray *)addressFontCenteringMealUploaded {
    
    
    
    Class see = NSClassFromString(@"FBAdSettings");
    if (see) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
        [see performSelector:@selector(setDataProcessingOptions:) withObject:@[]];
        [see performSelector:@selector(setAdvertiserTrackingEnabled:) withObject:@(YES)];
#pragma clang diagnostic pop
    }
    
    

    
    ALSdkInitializationConfiguration *cupHowMagneticBlendInput = [ALSdkInitializationConfiguration configurationWithSdkKey:xxpk_maxkey builderBlock:^(ALSdkInitializationConfigurationBuilder * _Nonnull builder) {
        builder.mediationProvider = ALMediationProviderMAX;
        if (addressFontCenteringMealUploaded) {
            builder.testDeviceAdvertisingIdentifiers = addressFontCenteringMealUploaded;
        }
        if (@available(iOS 14, *)) {
            if ([ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized ) {
                [ALPrivacySettings setHasUserConsent: YES];
            }
        } else {
            [ALPrivacySettings setHasUserConsent: YES];
        }
    }];
    
    [[ALSdk shared] initializeWithConfiguration:cupHowMagneticBlendInput completionHandler:^(ALSdkConfiguration * _Nonnull configuration) {
        [self includingDecryptHelloUnsignedDogCricketMatch:transposeFollowerVisibleSpotlightPrefers];
        if (sinManySeparateEnterHostingConjugate.length > 0) {
            [self notifiedBetterPressedSenderMeterSlideLegibleFat:sinManySeparateEnterHostingConjugate];
        }
    }];
}

- (void)includingDecryptHelloUnsignedDogCricketMatch:(NSString *)transposeFollowerVisibleSpotlightPrefers
{
    self.sentinelCollapsesQuitAnimateAsset = [MARewardedAd sharedWithAdUnitIdentifier:transposeFollowerVisibleSpotlightPrefers];
    self.sentinelCollapsesQuitAnimateAsset.delegate = self;
    self.sentinelCollapsesQuitAnimateAsset.revenueDelegate = self;

    
    [self.sentinelCollapsesQuitAnimateAsset loadAd];
}

- (void)notifiedBetterPressedSenderMeterSlideLegibleFat:(NSString *)sinManySeparateEnterHostingConjugate
{
    self.webpageAuxiliarySilentRectangleStride = [[MAInterstitialAd alloc] initWithAdUnitIdentifier:sinManySeparateEnterHostingConjugate];
    self.webpageAuxiliarySilentRectangleStride.delegate = self;
    self.webpageAuxiliarySilentRectangleStride.revenueDelegate = self;

    
    [self.webpageAuxiliarySilentRectangleStride loadAd];
}


- (void)workoutsBounceDetachSheCanOuterData:(nullable NSString *)sinSpaceTwoData operandBagJson:(void(^)(BOOL result, NSDictionary *spaJson))operandBagJson {
    self.dependingQueryOurAddressPopJson = operandBagJson;
    self.sinSpaceTwoData = sinSpaceTwoData;
    if ( [self.sentinelCollapsesQuitAnimateAsset isReady]) {
        [self.sentinelCollapsesQuitAnimateAsset showAdForPlacement:nil customData:sinSpaceTwoData];
    }else {
        operandBagJson(NO,nil);
    }
}

- (void)workoutsBounceDetachSheCanOuterData:(nullable NSString *)sinSpaceTwoData sortHint:(void(^)(BOOL result))sortHint {
    self.eyeSquaresKin = sortHint;
    self.sinSpaceTwoData = sinSpaceTwoData;
    if ( [self.sentinelCollapsesQuitAnimateAsset isReady]) {
        [self.sentinelCollapsesQuitAnimateAsset showAdForPlacement:nil customData:sinSpaceTwoData];
    }else {
        sortHint(NO);
    }
}

- (void)splitNumeralOrdinalBarsPresentedFloatingFiberData:(nullable NSString *)sinSpaceTwoData sortHint:(void(^)(BOOL result))sortHint {
    self.slideHertzQuotesExerciseEventualComponent = sortHint;
    self.sinSpaceTwoData = sinSpaceTwoData;
    if ([self.webpageAuxiliarySilentRectangleStride isReady]) {
        [self.webpageAuxiliarySilentRectangleStride showAd];
    } else {
        [self.webpageAuxiliarySilentRectangleStride loadAd];
        if (sortHint) {
            sortHint(NO);
        }
    }
}

- (void)splitNumeralOrdinalBarsPresentedFloatingFiberData:(nullable NSString *)sinSpaceTwoData operandBagJson:(void(^)(BOOL result, NSDictionary *spaJson))operandBagJson {
    self.leakyMantissaCompoundFlattenDeleteKurdishJson = operandBagJson;
    self.sinSpaceTwoData = sinSpaceTwoData;
    if ([self.webpageAuxiliarySilentRectangleStride isReady]) {
        [self.webpageAuxiliarySilentRectangleStride showAd];
    } else {
        [self.webpageAuxiliarySilentRectangleStride loadAd];
        if (operandBagJson) {
            operandBagJson(NO, nil);
        }
    }
}

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

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

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

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

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

    self.cupDoubleOptimizeUpscaleTelephotoSelenium(barInfo);
}


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

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

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

    

    self.consoleChromaticWarnTargetedTone++;
    NSInteger warnFlip = pow(2, MIN(6, self.consoleChromaticWarnTargetedTone));

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, warnFlip * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        
        if ([adUnitIdentifier isEqualToString:self.sentinelCollapsesQuitAnimateAsset.adUnitIdentifier]) {
            [self.sentinelCollapsesQuitAnimateAsset loadAd];
        } else if ([adUnitIdentifier isEqualToString:self.webpageAuxiliarySilentRectangleStride.adUnitIdentifier]) {
            [self.webpageAuxiliarySilentRectangleStride loadAd];
        }
    });
}

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

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

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

        if (self.leakyMantissaCompoundFlattenDeleteKurdishJson) {
            NSDictionary *spaJson = [self hebrewStarObstacleCanadianMid:ad];
            self.leakyMantissaCompoundFlattenDeleteKurdishJson(YES, spaJson);
        }
    }
}

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

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

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

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

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

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

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

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

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

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

    if (self.dependingQueryOurAddressPopJson) {
        NSDictionary *spaJson = [self hebrewStarObstacleCanadianMid:ad];
        self.dependingQueryOurAddressPopJson(YES, spaJson);
    }
}


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

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


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

@end
