






#import "MostMildTremorViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+RepairBar.h"
#import "NSString+RopeFatInfo.h"

@interface MostMildTremorViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *showPacketPostControl;
@property (nonatomic, strong) UIView * secondAvailWarnDeferringDuplex;
@property (nonatomic, strong) UIView * patchReachedResultsMaskRare;

@property (nonatomic, strong) UIScrollView * leftUseCropView;

@end

@implementation MostMildTremorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.hostingDayButton.hidden = YES;
    self.curveMailButton.hidden = YES;
    
    UISegmentedControl *chatRedView = [[UISegmentedControl alloc] initWithItems:@[SheTintAuto.floatFootThird.managerLinerMeasuredCellChineseKey,SheTintAuto.floatFootThird.priorExecPersonAirGreenDaughters]];
    chatRedView.layer.masksToBounds = YES; 
    chatRedView.layer.cornerRadius = 2;    
    [chatRedView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SheTintAuto partFocusColor]} forState:UIControlStateSelected];
    [chatRedView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SheTintAuto partFocusColor]} forState:UIControlStateNormal];
    [self.view addSubview:chatRedView];
    [chatRedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(SheTintAuto.linerIndexed.tenUnitFill);
    }];
    [chatRedView addTarget:self action:@selector(faxBarBagWake:) forControlEvents:UIControlEventValueChanged];
    self.showPacketPostControl = chatRedView;
    
    _leftUseCropView = [[UIScrollView alloc]init];
    _leftUseCropView.pagingEnabled = YES;
    _leftUseCropView.delegate = self;
    [self.view addSubview:_leftUseCropView];
    [_leftUseCropView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(SheTintAuto.linerIndexed.hasDetermine);
        make.right.equalTo(self.view).offset(-SheTintAuto.linerIndexed.hasDetermine);
        make.top.equalTo(self.view).offset(SheTintAuto.linerIndexed.beganMayAway);
        make.bottom.equalTo(self.view).offset(-SheTintAuto.linerIndexed.closeRedGram);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.leftUseCropView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.leftUseCropView);
        make.height.equalTo(_leftUseCropView);
    }];
    
    UIView * eraEndLetter = [self dismissEggView:[SheTintAuto speakerBondInvalidIncreaseEnter]];
    [containerView addSubview:eraEndLetter];
    [eraEndLetter mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.leftUseCropView);
    }];
    self.secondAvailWarnDeferringDuplex = eraEndLetter;
    
    UIView * proxyTornado = [self dismissEggView:[SheTintAuto songKeepBroadcastOwnProxies]];
    [containerView addSubview:proxyTornado];
    [proxyTornado mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(eraEndLetter.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.leftUseCropView);
    }];
    self.patchReachedResultsMaskRare = proxyTornado;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(proxyTornado.mas_right);
    }];
    
    if (![self.membersPool boolValue]) {
        UIButton *redBlurButton = [SheTintAuto numericWetDirectionLoveRedoColor:SheTintAuto.floatFootThird.catBoundFace];
        [redBlurButton setBackgroundImage:[UIImage suchThumbCloudColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [redBlurButton addTarget:self action:@selector(ownNominalRecentlyLanguagesFloorSpecified:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:redBlurButton];
        
        [redBlurButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-SheTintAuto.linerIndexed.stretchWord);
            make.left.equalTo(self.view).offset(SheTintAuto.linerIndexed.hasDetermine);
            make.right.equalTo(self.view.mas_centerX).offset(-SheTintAuto.linerIndexed.subUpperFix);
            make.height.mas_equalTo(SheTintAuto.linerIndexed.forkPivotDog);
        }];
    }

    UIButton *charKeyButton =  [SheTintAuto numericWetDirectionLoveRedoColor:SheTintAuto.floatFootThird.addressOut];
    [charKeyButton addTarget:self action:@selector(purpleMismatchPlacementEquallyScaleReadable:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:charKeyButton];
    BOOL stoneButton = ![self.membersPool boolValue];
    [charKeyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-SheTintAuto.linerIndexed.stretchWord);
        make.right.equalTo(self.view).offset(-SheTintAuto.linerIndexed.hasDetermine);
        
        if (stoneButton) {
            make.left.equalTo(self.view.mas_centerX).offset(SheTintAuto.linerIndexed.subUpperFix);
        } else {
            make.left.equalTo(self.view).offset(SheTintAuto.linerIndexed.hasDetermine);
        }
        make.height.mas_equalTo(SheTintAuto.linerIndexed.forkPivotDog);
    }];
    
    chatRedView.selectedSegmentIndex = 0;
    [self faxBarBagWake:chatRedView];
}

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

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

- (void)lexicalThatHitDecoderCleanText:(NSInteger)type {
    NSString *forbidVery = nil;
    UIView *contentView = nil;
    forbidVery = type == 0 ? [SheTintAuto speakerBondInvalidIncreaseEnter]:[SheTintAuto songKeepBroadcastOwnProxies];
    contentView = type == 0 ? self.secondAvailWarnDeferringDuplex:self.patchReachedResultsMaskRare;
    
    if (forbidVery.twelveOptHis) {
        return;
    }
    
    if ([[forbidVery pathExtension] containsString:SheTintAuto.linerIndexed.gurationPaceDigitJumpSpring]) {
        UITextView *yetView = (UITextView *)contentView;
        if (yetView.text.length > 0) {
            return;
        }

        
        [SampleFireView optAxesLowHexView:contentView];

        
        NSURL *url = [NSURL URLWithString:forbidVery];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [SampleFireView eastBondJumpStayImpactView:contentView];
                
                if (error || data.length == 0) {
                    
                    yetView.text = SheTintAuto.floatFootThird.looseLevelSilentWarpCapFigure;
                    return;
                }
                
                
                NSString *butDegreesEra = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                yetView.text = butDegreesEra ?: SheTintAuto.floatFootThird.usedThumbnailNineVersionRealmScriptsSort;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *sumUse = (WKWebView *)contentView;
        if (!sumUse.isLoading && sumUse.estimatedProgress == 1) {
            [SampleFireView eastBondJumpStayImpactView:contentView];
            return;
        }
        [SampleFireView optAxesLowHexView:contentView];
        NSString *flipDatum =  [forbidVery.consoleStorylineEntryTraverseDownInternal stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:flipDatum];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [sumUse loadRequest:request];
    }
}

- (void)ownNominalRecentlyLanguagesFloorSpecified:(id)sender {
    [self plusUnpluggedHighFetchEpisodeAction:nil];
    if (self.sinkCreatorEntropyLogArt) {
        self.sinkCreatorEntropyLogArt(NO);
    }
}

- (void)purpleMismatchPlacementEquallyScaleReadable:(id)sender {
    [self plusUnpluggedHighFetchEpisodeAction:nil];
    if (self.sinkCreatorEntropyLogArt) {
        self.sinkCreatorEntropyLogArt(YES);
    }
}

- (UIView *)dismissEggView:(NSString *)string {
    UIView *roleMinIcon = nil;
    if ([[string pathExtension] containsString:SheTintAuto.linerIndexed.gurationPaceDigitJumpSpring]) {
        UITextView * sumSense = [UITextView new];
        sumSense.editable = NO;
        sumSense.backgroundColor = UIColor.whiteColor;
        sumSense.textColor = UIColor.grayColor;
        roleMinIcon = sumSense;
    }else {
        WKWebView *execStarted = [[WKWebView alloc] initWithFrame:CGRectZero];
        execStarted.backgroundColor = UIColor.clearColor;
        execStarted.scrollView.backgroundColor = UIColor.lightGrayColor;
        execStarted.opaque = YES;
        execStarted.scrollView.bounces =NO;
        execStarted.scrollView.showsVerticalScrollIndicator = NO;
        execStarted.scrollView.showsHorizontalScrollIndicator = NO;
        execStarted.navigationDelegate = self;
        roleMinIcon = execStarted;
    }
    return roleMinIcon;
}

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

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

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

@end
