





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface QuitMarginSixteenCubeAuthorSpell : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation QuitMarginSixteenCubeAuthorSpell

- (void)dealloc {
    
}

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

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

- (void)exportingInvisibleTranslateFeetCathedralAffineSupports:(NSString *)appId complete:(void (^_Nullable)(BOOL lemmaLogin))complete {

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


- (void)convergedCharacterSumAtomCutController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull upsideSun))success parsingEye:(void (^_Nullable)(NSString * _Nonnull error))error dryPickAction:(void(^)(NSInteger))action {
    self.idiomLivePhoneAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self floorOrdinals:controller gramArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull fatWriteResult) {
        if (fatWriteResult.error) {
            error(fatWriteResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull fatWriteResult) {
        
        if (fatWriteResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                success(fatWriteResult.data);
            });
        }else {
            error(fatWriteResult.message);
        }
    }];
}





- (CLUIConfigure *)floorOrdinals:(UIViewController *)viewController gramArray:(NSArray *)array {
    CLUIConfigure *videoGolden = [[CLUIConfigure alloc] init];

    UIColor *swipeSwipeColor = array[0];
    NSString *skipDeveloper = array[1];
    NSString *lazyAirSpaName = array[6];
    UIImage *derivedImage = array[2];
    CGSize civilFiller = [array[3] CGSizeValue];
    NSString *panelText = array[4];
    NSString *swahiliText = array[5];
    NSString *allText = array[7];
    
    UIImage *backgroundImage = [array[8] isKindOfClass:[UIImage class]] ? array[8] : nil;
    UIImage *portalMileTamilPintLigatureImage = [array[9] isKindOfClass:[UIImage class]] ? array[9] : nil;
    
    UIColor *illSearchHexColor = [array[10] isKindOfClass:[UIColor class]] ? array[10] : UIColor.whiteColor;

    videoGolden.viewController = viewController;
    
    
    videoGolden.clNavigationBarHidden = @(YES);
    
    //logo
    videoGolden.clLogoHiden = @(YES);
    
    
    videoGolden.clPhoneNumberFont = [UIFont boldSystemFontOfSize:26];
    videoGolden.clPhoneNumberColor = UIColor.darkGrayColor;
    videoGolden.clPhoneNumberTextAlignment = @(NSTextAlignmentCenter);
    
    
    videoGolden.clSloganTextFont = [UIFont systemFontOfSize:14];
    videoGolden.clSloganTextColor = UIColor.darkGrayColor;
    videoGolden.clSlogaTextAlignment = @(NSTextAlignmentCenter);
    
    
    videoGolden.clLoginBtnText = panelText;
    videoGolden.clLoginBtnTextFont = [UIFont systemFontOfSize:18];
    videoGolden.clLoginBtnTextColor = illSearchHexColor;
    videoGolden.clLoginBtnBgColor = swipeSwipeColor;
    videoGolden.clLoginBtnCornerRadius = @(25);
    if (portalMileTamilPintLigatureImage) {
        videoGolden.clLoginBtnNormalBgImage = portalMileTamilPintLigatureImage;
    }

    
    videoGolden.clCheckBoxSize = [NSValue valueWithCGSize:CGSizeMake(0, 0)];
    videoGolden.clCheckBoxValue = @(YES);
    
    
    videoGolden.clAppPrivacyNormalDesTextFirst = swahiliText;
    videoGolden.clAppPrivacyFirst = @[lazyAirSpaName, skipDeveloper];
    videoGolden.clAppPrivacyNormalDesTextSecond = allText;
    videoGolden.clAppPrivacyNormalDesTextLast = @"";
    videoGolden.clAppPrivacyTextFont = [UIFont systemFontOfSize:12];
    videoGolden.clAppPrivacyTextAlignment = @(NSTextAlignmentLeft);
    videoGolden.clAppPrivacyWebNavigationBarTintColor = UIColor.whiteColor;
    videoGolden.clAppPrivacyPunctuationMarks = @(YES);
    videoGolden.clAppPrivacyColor = @[UIColor.darkGrayColor, swipeSwipeColor];
    videoGolden.clAuthTypeUseWindow = @(YES);
    videoGolden.clPrivacyShowUnderline = @(YES);
    videoGolden.clAppPrivacyLineSpacing = @(2.5);
    videoGolden.clAuthWindowModalTransitionStyle = @(UIModalTransitionStyleCrossDissolve);
    
    videoGolden.clAppPrivacyWebBackBtnImage = derivedImage;
    
    
    videoGolden.clLoadingSize = [NSValue valueWithCGSize:CGSizeMake(90, 90)];
    videoGolden.clLoadingCornerRadius = @(2);
    videoGolden.clLoadingIndicatorStyle = @(UIActivityIndicatorViewStyleLarge);
    videoGolden.clLoadingTintColor = UIColor.blackColor;
    videoGolden.clLoadingBackgroundColor = UIColor.clearColor;
    
    
    CLOrientationLayOut *strongestOverallProblemLigaturesReturning = [[CLOrientationLayOut alloc] init];
    videoGolden.clOrientationLayOutPortrait = strongestOverallProblemLigaturesReturning;
    
    
    CGFloat y = (([UIScreen mainScreen].bounds.size.height - civilFiller.height) * 0.5) + 35;
    CGFloat height = 30;
    strongestOverallProblemLigaturesReturning.clLayoutPhoneTop = @(y);
    strongestOverallProblemLigaturesReturning.clLayoutPhoneHeight = @(height);
    strongestOverallProblemLigaturesReturning.clLayoutPhoneCenterX = @(0);
    
    
    y += (height + 20);
    height = 17;
    strongestOverallProblemLigaturesReturning.clLayoutSloganTop = @(y);
    strongestOverallProblemLigaturesReturning.clLayoutSloganCenterX = @(0);
    strongestOverallProblemLigaturesReturning.clLayoutSloganHeight = @(height);

    
    y += (height + 20);
    height = 50;
    strongestOverallProblemLigaturesReturning.clLayoutLoginBtnTop = @(y);
    strongestOverallProblemLigaturesReturning.clLayoutLoginBtnWidth = @(civilFiller.width - 40);
    strongestOverallProblemLigaturesReturning.clLayoutLoginBtnCenterX = @(0);
    strongestOverallProblemLigaturesReturning.clLayoutLoginBtnHeight = @(height);

    
    y += (height + 15);
    strongestOverallProblemLigaturesReturning.clLayoutAppPrivacyTop = @(y);
    strongestOverallProblemLigaturesReturning.clLayoutAppPrivacyCenterX = @(0);
    strongestOverallProblemLigaturesReturning.clLayoutAppPrivacyWidth = @(civilFiller.width - 40);
    
    
    videoGolden.customAreaView = ^(UIView * _Nonnull customAreaView) {
        
        customAreaView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0];
        
        UIImageView *aboveView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, civilFiller.width, civilFiller.height)];
        
        if (backgroundImage) {
            aboveView.image = backgroundImage;
        } else {
            aboveView.backgroundColor = UIColor.whiteColor;
        }
        aboveView.contentMode = UIViewContentModeScaleAspectFill;
        aboveView.userInteractionEnabled = YES;
        aboveView.clipsToBounds = YES;
        aboveView.layer.cornerRadius = 20.0;
        [customAreaView addSubview:aboveView];
        aboveView.center = customAreaView.center;
        
        
        UIButton *close = [UIButton buttonWithType:UIButtonTypeCustom];
        [close addTarget:self action:@selector(leftEveryFiveTornadoFixAskHandler:) forControlEvents:(UIControlEventTouchUpInside)];
        [close setBackgroundImage:derivedImage forState:UIControlStateNormal];
        [aboveView addSubview:close];
        close.frame = CGRectMake(8, 8, 20, 20);
    };
    
    return videoGolden;
}

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

@end
