





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface RandomFloatingCapRoundLawOrnament : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation RandomFloatingCapRoundLawOrnament

- (void)dealloc {
    
}

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

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

- (void)friendsReplaceSceneMarginAmbiguityRatioReports:(NSString *)appId complete:(void (^_Nullable)(BOOL denseLogin))complete {

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


- (void)boxProducerEmailSwitchCellController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull floatFlow))success skipBuffer:(void (^_Nullable)(NSString * _Nonnull error))error sixFailAction:(void(^)(NSInteger))action {
    self.descenderSpellAction = action;
    

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





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

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

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

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

@end
