





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface PanReactorBadSmoothCutterMirroring : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation PanReactorBadSmoothCutterMirroring

- (void)dealloc {
    
}

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

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

- (void)blockCiphersPriorProblemBackwardConvertedEncipher:(NSString *)appId complete:(void (^_Nullable)(BOOL outerLogin))complete {

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


- (void)bridgePreservesAddLineInventoryController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull turnInfer))success ejectCycle:(void (^_Nullable)(NSString * _Nonnull error))error hexNeedAction:(void(^)(NSInteger))action {
    self.tryOutTeethYouAction = action;
    

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





- (CLUIConfigure *)minimalSignal:(UIViewController *)viewController ruleArray:(NSArray *)array {
    CLUIConfigure *birthDueOff = [[CLUIConfigure alloc] init];

    UIColor *daysStrideColor = array[0];
    NSString *photoRetSlash = array[1];
    NSString *createdTryName = array[6];
    UIImage *soloOutImage = array[2];
    CGSize scaleArtery = [array[3] CGSizeValue];
    NSString *totalText = array[4];
    NSString *tabNearText = array[5];
    NSString *offText = array[7];
    
    UIImage *backgroundImage = [array[8] isKindOfClass:[UIImage class]] ? array[8] : nil;
    UIImage *serifAdjustsPrologDetachBaseImage = [array[9] isKindOfClass:[UIImage class]] ? array[9] : nil;
    
    UIColor *manBezelSizeColor = [array[10] isKindOfClass:[UIColor class]] ? array[10] : UIColor.whiteColor;

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

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

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

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

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

@end
