





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface BurstMailMinderTopNordicInvert : NSObject<CLShanYanSDKManagerDelegate>

@property (nonatomic, copy) void(^textStickyJumpAction)(NSInteger);

@end

@implementation BurstMailMinderTopNordicInvert

- (void)dealloc {
    
}

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

+ (NSString *)buildEraCert {
    return [CLShanYanSDKManager clShanYanSDKVersion];
}

- (void)dublinActionsAlignedPreferDomainSubfamilyOnline:(NSString *)appId complete:(void (^_Nullable)(BOOL ownerLogin))complete {

    [CLShanYanSDKManager setCLShanYanSDKManagerDelegate:self];
    
    [CLShanYanSDKManager setPreGetPhonenumberUseCacheIfNoCellularNetwork:NO];
    
    [CLShanYanSDKManager initWithAppId:appId complete:^(CLCompleteResult * _Nonnull errorOneResult) {
        __block BOOL yiddishMarathiLogin = !errorOneResult.error;
        
        if (yiddishMarathiLogin) {
            
            [CLShanYanSDKManager preGetPhonenumber:^(CLCompleteResult * _Nonnull errorOneResult) {
                dispatch_sync(dispatch_get_main_queue(), ^{
                    complete(errorOneResult.error == nil);
                });
            }];
            
        } else {
            dispatch_sync(dispatch_get_main_queue(), ^{
                complete(NO);
            });
        }
    }];
}


- (void)draftEyePacketAlcoholChannelController:(UIViewController *_Nonnull)controller array:(NSArray *)array moreMen:(void (^_Nullable)(NSDictionary * _Nonnull rootUsage))moreMen tooUnlearn:(void (^_Nullable)(NSString * _Nonnull error))error adjustsAction:(void(^)(NSInteger))action {
    self.textStickyJumpAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self finalBackward:controller pageArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull errorOneResult) {
        if (errorOneResult.error) {
            error(errorOneResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull errorOneResult) {
        
        if (errorOneResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                moreMen(errorOneResult.data);
            });
        }else {
            error(errorOneResult.message);
        }
    }];
}





- (CLUIConfigure *)finalBackward:(UIViewController *)viewController pageArray:(NSArray *)array {
    CLUIConfigure *metricsMeal = [[CLUIConfigure alloc] init];
    
    metricsMeal.viewController = viewController;
    
    
    metricsMeal.clNavigationBarHidden = @(YES);
    
    //logo
    metricsMeal.clLogoHiden = @(YES);
    
    
    metricsMeal.clPhoneNumberFont = [UIFont boldSystemFontOfSize:26];
    metricsMeal.clPhoneNumberColor = UIColor.darkGrayColor;
    metricsMeal.clPhoneNumberTextAlignment = @(NSTextAlignmentCenter);
    
    
    metricsMeal.clSloganTextFont = [UIFont systemFontOfSize:14];
    metricsMeal.clSloganTextColor = UIColor.darkGrayColor;
    metricsMeal.clSlogaTextAlignment = @(NSTextAlignmentCenter);
    
    
    metricsMeal.clLoginBtnText = array[4];
    metricsMeal.clLoginBtnTextFont = [UIFont systemFontOfSize:18];
    metricsMeal.clLoginBtnTextColor = UIColor.whiteColor;
    metricsMeal.clLoginBtnBgColor = array[0];
    metricsMeal.clLoginBtnCornerRadius = @(2);
    
    
    metricsMeal.clCheckBoxSize = [NSValue valueWithCGSize:CGSizeMake(0, 0)];
    metricsMeal.clCheckBoxValue = @(YES);
    
    
    metricsMeal.clAppPrivacyNormalDesTextFirst = array[5];
    metricsMeal.clAppPrivacyFirst = @[array[6], array[1]];
    metricsMeal.clAppPrivacyNormalDesTextSecond = array[7];
    metricsMeal.clAppPrivacyNormalDesTextLast = @"";
    metricsMeal.clAppPrivacyTextFont = [UIFont systemFontOfSize:12];
    metricsMeal.clAppPrivacyTextAlignment = @(NSTextAlignmentLeft);
    metricsMeal.clAppPrivacyWebNavigationBarTintColor = UIColor.whiteColor;
    metricsMeal.clAppPrivacyPunctuationMarks = @(YES);
    metricsMeal.clAppPrivacyColor = @[UIColor.darkGrayColor,array[0]];;
    metricsMeal.clAuthTypeUseWindow = @(YES);
    metricsMeal.clPrivacyShowUnderline = @(YES);
    metricsMeal.clAppPrivacyLineSpacing = @(2.5);
    metricsMeal.clAuthWindowModalTransitionStyle = @(UIModalTransitionStyleCrossDissolve);
    
    metricsMeal.clAppPrivacyWebBackBtnImage = array[2];
    
    
    metricsMeal.clLoadingSize = [NSValue valueWithCGSize:CGSizeMake(90, 90)];
    metricsMeal.clLoadingCornerRadius = @(2);
    metricsMeal.clLoadingIndicatorStyle = @(UIActivityIndicatorViewStyleLarge);
    metricsMeal.clLoadingTintColor = UIColor.blackColor;
    metricsMeal.clLoadingBackgroundColor = UIColor.clearColor;
    
    
    CLOrientationLayOut *addLayerIconMiterFriends = [[CLOrientationLayOut alloc] init];
    metricsMeal.clOrientationLayOutPortrait = addLayerIconMiterFriends;
    
    
    CGFloat y = (([UIScreen mainScreen].bounds.size.height - [array[3] CGSizeValue].height) * 0.5) + 35;
    CGFloat height = 30;
    addLayerIconMiterFriends.clLayoutPhoneTop = @(y);
    addLayerIconMiterFriends.clLayoutPhoneHeight = @(height);
    addLayerIconMiterFriends.clLayoutPhoneCenterX = @(0);
    
    
    y += (height + 20);
    height = 17;
    addLayerIconMiterFriends.clLayoutSloganTop = @(y);
    addLayerIconMiterFriends.clLayoutSloganCenterX = @(0);
    addLayerIconMiterFriends.clLayoutSloganHeight = @(height);

    
    y += (height + 20);
    height = 50;
    addLayerIconMiterFriends.clLayoutLoginBtnTop = @(y);
    addLayerIconMiterFriends.clLayoutLoginBtnWidth = @([array[3] CGSizeValue].width - 40);
    addLayerIconMiterFriends.clLayoutLoginBtnCenterX = @(0);
    addLayerIconMiterFriends.clLayoutLoginBtnHeight = @(height);

    
    y += (height + 15);
    addLayerIconMiterFriends.clLayoutAppPrivacyTop = @(y);
    addLayerIconMiterFriends.clLayoutAppPrivacyCenterX = @(0);
    addLayerIconMiterFriends.clLayoutAppPrivacyWidth = @([array[3] CGSizeValue].width - 40);
    
    
    metricsMeal.customAreaView = ^(UIView * _Nonnull customAreaView) {
        
        customAreaView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0];
        
        UIView *abortView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [array[3] CGSizeValue].width, [array[3] CGSizeValue].height)];
        abortView.backgroundColor = UIColor.whiteColor;
        abortView.layer.cornerRadius = 2.0;
        [customAreaView addSubview:abortView];
        abortView.center = customAreaView.center;
        
        
        UIButton *close = [UIButton buttonWithType:UIButtonTypeCustom];
        [close addTarget:self action:@selector(contentInfiniteAcuteSunSaltFreestyleHandler:) forControlEvents:(UIControlEventTouchUpInside)];
        [close setBackgroundImage:array[2] forState:UIControlStateNormal];
        [abortView addSubview:close];
        close.frame = CGRectMake(8, 8, 20, 20);
    };
    
    return metricsMeal;
}

- (void)contentInfiniteAcuteSunSaltFreestyleHandler:(id)sender {
    [CLShanYanSDKManager finishAuthControllerCompletion:nil];
    self.textStickyJumpAction(0);
}

@end
