





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface BoxOffLandscapeSenseTopNet : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation BoxOffLandscapeSenseTopNet

- (void)dealloc {
    
}

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

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

- (void)patientDroppedStereoPrincipalDefinedUnboundedIll:(NSString *)appId complete:(void (^_Nullable)(BOOL digitLogin))complete {

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


- (void)directlyMilesDelayedDesiredDecideController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull outletBig))success chestBelow:(void (^_Nullable)(NSString * _Nonnull error))error walkFunAction:(void(^)(NSInteger))action {
    self.reservedPolishAction = action;
    

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





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

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

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

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

@end
