





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface KnowBlobCoursePressHeavyIndicated : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation KnowBlobCoursePressHeavyIndicated

- (void)dealloc {
    
}

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

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

- (void)teacherOptLettishPostcardReminderAttempterFinish:(NSString *)appId complete:(void (^_Nullable)(BOOL greenLogin))complete {

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


- (void)hormoneRematchFlushDomainsWinController:(UIViewController *_Nonnull)controller array:(NSArray *)array verbose:(void (^_Nullable)(NSDictionary * _Nonnull youCarbon))verbose capKeyRoot:(void (^_Nullable)(NSString * _Nonnull error))error tiedTheAction:(void(^)(NSInteger))action {
    self.effortShowFoldAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self sawPackageNap:controller freeArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull transferResult) {
        if (transferResult.error) {
            error(transferResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull transferResult) {
        
        if (transferResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                verbose(transferResult.data);
            });
        }else {
            error(transferResult.message);
        }
    }];
}





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

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

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

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

@end
