






#import "BoxBigDryFrontViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Precision.h"
#import "NSString+CroppingKin.h"

@interface BoxBigDryFrontViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *strideModeEastControl;
@property (nonatomic, strong) UIView * advisedDogListenerNodeLettish;
@property (nonatomic, strong) UIView * lowLoopsArmenianHeadsetEmail;

@property (nonatomic, strong) UIScrollView * oneKinWrongView;

@end

@implementation BoxBigDryFrontViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.warpFitWonButton.hidden = YES;
    self.diskGenreButton.hidden = YES;
    
    UISegmentedControl *lawClipView = [[UISegmentedControl alloc] initWithItems:@[SobIllWelsh.notHeapPeerRed.walkLimitWeekSobBarGeometry,SobIllWelsh.notHeapPeerRed.outputsConsoleAccessoryInterruptBlusteryLetter]];
    lawClipView.layer.masksToBounds = YES; 
    lawClipView.layer.cornerRadius = 2;    
    [lawClipView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SobIllWelsh itemQuickColor]} forState:UIControlStateSelected];
    [lawClipView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SobIllWelsh itemQuickColor]} forState:UIControlStateNormal];
    [self.view addSubview:lawClipView];
    [lawClipView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(SobIllWelsh.followBigKit.mayTagArrow);
    }];
    [lawClipView addTarget:self action:@selector(cellSolutions:) forControlEvents:UIControlEventValueChanged];
    self.strideModeEastControl = lawClipView;
    
    _oneKinWrongView = [[UIScrollView alloc]init];
    _oneKinWrongView.pagingEnabled = YES;
    _oneKinWrongView.delegate = self;
    [self.view addSubview:_oneKinWrongView];
    [_oneKinWrongView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(SobIllWelsh.followBigKit.bezelNetQuit);
        make.right.equalTo(self.view).offset(-SobIllWelsh.followBigKit.bezelNetQuit);
        make.top.equalTo(self.view).offset(SobIllWelsh.followBigKit.bufferedPink);
        make.bottom.equalTo(self.view).offset(-SobIllWelsh.followBigKit.maxUpdateOwn);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.oneKinWrongView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.oneKinWrongView);
        make.height.equalTo(_oneKinWrongView);
    }];
    
    UIView * stickyModern = [self hertzClickView:[SobIllWelsh exposeUndoMinTenTrailing]];
    [containerView addSubview:stickyModern];
    [stickyModern mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.oneKinWrongView);
    }];
    self.advisedDogListenerNodeLettish = stickyModern;
    
    UIView * thumbnailTen = [self hertzClickView:[SobIllWelsh mixerDidCervicalLargeStrictly]];
    [containerView addSubview:thumbnailTen];
    [thumbnailTen mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(stickyModern.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.oneKinWrongView);
    }];
    self.lowLoopsArmenianHeadsetEmail = thumbnailTen;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(thumbnailTen.mas_right);
    }];
    
    if (![self.retBlurTime boolValue]) {
        UIButton *expiredButton = [SobIllWelsh allExistExecutionCreditsJumpColor:SobIllWelsh.notHeapPeerRed.formWinLeave];
        [expiredButton setBackgroundImage:[UIImage manyHeavyForceColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [expiredButton addTarget:self action:@selector(alignPublishUpdatingLeaseSizeDecrypt:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:expiredButton];
        [expiredButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-SobIllWelsh.followBigKit.hintFilters);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(SobIllWelsh.followBigKit.hasPhaseBlue);
        }];
    }
    
    UIButton *linkSawButton =  [SobIllWelsh allExistExecutionCreditsJumpColor:SobIllWelsh.notHeapPeerRed.artCapsHex];
    [linkSawButton addTarget:self action:@selector(stoppedCutFinishedFitBrownSigning:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:linkSawButton];
    [linkSawButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-SobIllWelsh.followBigKit.hintFilters);
        make.centerX.equalTo(self.view).multipliedBy(![self.retBlurTime boolValue]?1.35:1);
        make.height.mas_equalTo(SobIllWelsh.followBigKit.hasPhaseBlue);
    }];
    
    lawClipView.selectedSegmentIndex = 0;
    [self cellSolutions:lawClipView];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    [self.strideModeEastControl setSelectedSegmentIndex:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
    [self fillManagedSourcesTotalMixText:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
}

- (void)cellSolutions:(UISegmentedControl *)sender {
    [self fillManagedSourcesTotalMixText:sender.selectedSegmentIndex == 0?0:1];
    [self.oneKinWrongView setContentOffset:CGPointMake(sender.selectedSegmentIndex == 0?0:self.oneKinWrongView.frame.size.width, 0) animated:YES];
}

- (void)fillManagedSourcesTotalMixText:(NSInteger)type {
    NSString *napAddBlur = nil;
    UIView *contentView = nil;
    napAddBlur = type == 0 ? [SobIllWelsh exposeUndoMinTenTrailing]:[SobIllWelsh mixerDidCervicalLargeStrictly];
    contentView = type == 0 ? self.advisedDogListenerNodeLettish:self.lowLoopsArmenianHeadsetEmail;
    
    if (napAddBlur.darkerTagger) {
        return;
    }
    
    if ([[napAddBlur pathExtension] containsString:SobIllWelsh.followBigKit.flowIssueGatherDictationPool]) {
        UITextView *rowView = (UITextView *)contentView;
        if (rowView.text.length > 0) {
            return;
        }

        
        [AskWillCatView herReuseSurgeView:contentView];

        
        NSURL *url = [NSURL URLWithString:napAddBlur];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [AskWillCatView reflectCarSpokenProcedureBothView:contentView];
                
                if (error || data.length == 0) {
                    
                    rowView.text = SobIllWelsh.notHeapPeerRed.dashDismissalFirmwareBurnAssertFat;
                    return;
                }
                
                
                NSString *textTowerAtom = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                rowView.text = textTowerAtom ?: SobIllWelsh.notHeapPeerRed.potentialElementLimitedArteryLikeEmbeddedRanging;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *custom = (WKWebView *)contentView;
        if (!custom.isLoading && custom.estimatedProgress == 1) {
            [AskWillCatView reflectCarSpokenProcedureBothView:contentView];
            return;
        }
        [AskWillCatView herReuseSurgeView:contentView];
        NSString *wayExpect =  [napAddBlur.playableBridgingUnorderedSunBasalReorder stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:wayExpect];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [custom loadRequest:request];
    }
}

- (void)alignPublishUpdatingLeaseSizeDecrypt:(id)sender {
    [self optApplyingMapMainSoccerAction:nil];
    if (self.sendYearOverlayResolvingLeast) {
        self.sendYearOverlayResolvingLeast(NO);
    }
}

- (void)stoppedCutFinishedFitBrownSigning:(id)sender {
    [self optApplyingMapMainSoccerAction:nil];
    if (self.sendYearOverlayResolvingLeast) {
        self.sendYearOverlayResolvingLeast(YES);
    }
}

- (UIView *)hertzClickView:(NSString *)string {
    UIView *cutSoftness = nil;
    if ([[string pathExtension] containsString:SobIllWelsh.followBigKit.flowIssueGatherDictationPool]) {
        UITextView * bedGreek = [UITextView new];
        bedGreek.editable = NO;
        bedGreek.backgroundColor = UIColor.whiteColor;
        bedGreek.textColor = UIColor.grayColor;
        cutSoftness = bedGreek;
    }else {
        WKWebView *nearBurnIcy = [[WKWebView alloc] initWithFrame:CGRectZero];
        nearBurnIcy.backgroundColor = UIColor.clearColor;
        nearBurnIcy.scrollView.backgroundColor = UIColor.lightGrayColor;
        nearBurnIcy.opaque = YES;
        nearBurnIcy.scrollView.bounces =NO;
        nearBurnIcy.scrollView.showsVerticalScrollIndicator = NO;
        nearBurnIcy.scrollView.showsHorizontalScrollIndicator = NO;
        nearBurnIcy.navigationDelegate = self;
        cutSoftness = nearBurnIcy;
    }
    return cutSoftness;
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    [AskWillCatView reflectCarSpokenProcedureBothView:webView];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    UIEdgeInsets notMinPong = [[SleepPairManager shared] specifierKinWindow].safeAreaInsets;
    notMinPong.top    += 10;
    notMinPong.left   += 10;
    notMinPong.bottom += 10;
    notMinPong.right  += 10;

    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(notMinPong);
    }];
}

@end
