






#import "MarkGopherDiskViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+ExitsTask.h"
#import "NSString+BlueEncrypt.h"

@interface MarkGopherDiskViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *logArmWaitSnapControl;
@property (nonatomic, strong) UIView * seeIncrementSobAreBuddhist;
@property (nonatomic, strong) UIView * carEarTemporaryManualBits;

@property (nonatomic, strong) UIScrollView * illSlideTipView;

@end

@implementation MarkGopherDiskViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.basalPhoneButton.hidden = YES;
    self.frameEndsButton.hidden = YES;
    
    UISegmentedControl *halfSinView = [[UISegmentedControl alloc] initWithItems:@[ScrollDatum.spanMarkCutter.goalCellularWaitCapturingEveryApplier,ScrollDatum.spanMarkCutter.archivedShrinkSectionsWordRenderGrandson]];
    halfSinView.layer.masksToBounds = YES; 
    halfSinView.layer.cornerRadius = 2;    
    [halfSinView setTitleTextAttributes:@{NSForegroundColorAttributeName:[ScrollDatum cinematicColor]} forState:UIControlStateSelected];
    [halfSinView setTitleTextAttributes:@{NSForegroundColorAttributeName:[ScrollDatum cinematicColor]} forState:UIControlStateNormal];
    [self.view addSubview:halfSinView];
    [halfSinView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(ScrollDatum.tildeStopHit.unlockChest);
    }];
    [halfSinView addTarget:self action:@selector(sheSubAnimate:) forControlEvents:UIControlEventValueChanged];
    self.logArmWaitSnapControl = halfSinView;
    
    _illSlideTipView = [[UIScrollView alloc]init];
    _illSlideTipView.pagingEnabled = YES;
    _illSlideTipView.delegate = self;
    [self.view addSubview:_illSlideTipView];
    [_illSlideTipView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(ScrollDatum.tildeStopHit.maskHowInput);
        make.right.equalTo(self.view).offset(-ScrollDatum.tildeStopHit.maskHowInput);
        make.top.equalTo(self.view).offset(ScrollDatum.tildeStopHit.areaPlaneNow);
        make.bottom.equalTo(self.view).offset(-ScrollDatum.tildeStopHit.shortBarWith);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.illSlideTipView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.illSlideTipView);
        make.height.equalTo(_illSlideTipView);
    }];
    
    UIView * tatarOffFive = [self aboutAuditView:[ScrollDatum widthFavoritesNotifiedOutRemoval]];
    [containerView addSubview:tatarOffFive];
    [tatarOffFive mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.illSlideTipView);
    }];
    self.seeIncrementSobAreBuddhist = tatarOffFive;
    
    UIView * storeCiphers = [self aboutAuditView:[ScrollDatum seasonVideoRespondsCupDate]];
    [containerView addSubview:storeCiphers];
    [storeCiphers mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tatarOffFive.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.illSlideTipView);
    }];
    self.carEarTemporaryManualBits = storeCiphers;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(storeCiphers.mas_right);
    }];
    
    if (![self.bringSixBar boolValue]) {
        UIButton *slowHexButton = [ScrollDatum favoritesSwahiliDisablesDryChildrenColor:ScrollDatum.spanMarkCutter.appleSlashed];
        [slowHexButton setBackgroundImage:[UIImage adaptivePromptColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [slowHexButton addTarget:self action:@selector(kilobytesSwahiliOptionHaveIdleBag:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:slowHexButton];
        [slowHexButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-ScrollDatum.tildeStopHit.gainLossSay);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(ScrollDatum.tildeStopHit.kinTextBezel);
        }];
    }
    
    UIButton *boxRedoButton =  [ScrollDatum favoritesSwahiliDisablesDryChildrenColor:ScrollDatum.spanMarkCutter.fixDryLate];
    [boxRedoButton addTarget:self action:@selector(substringDetachingCupLogoPressedText:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:boxRedoButton];
    [boxRedoButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-ScrollDatum.tildeStopHit.gainLossSay);
        make.centerX.equalTo(self.view).multipliedBy(![self.bringSixBar boolValue]?1.35:1);
        make.height.mas_equalTo(ScrollDatum.tildeStopHit.kinTextBezel);
    }];
    
    halfSinView.selectedSegmentIndex = 0;
    [self sheSubAnimate:halfSinView];
}

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

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

- (void)areSynthesisCutterTraitRedefinedText:(NSInteger)type {
    NSString *blobVerify = nil;
    UIView *contentView = nil;
    blobVerify = type == 0 ? [ScrollDatum widthFavoritesNotifiedOutRemoval]:[ScrollDatum seasonVideoRespondsCupDate];
    contentView = type == 0 ? self.seeIncrementSobAreBuddhist:self.carEarTemporaryManualBits;
    
    if (blobVerify.useOffsetAge) {
        return;
    }
    
    if ([[blobVerify pathExtension] containsString:ScrollDatum.tildeStopHit.renamingTremorAddCentralsError]) {
        UITextView *illView = (UITextView *)contentView;
        if (illView.text.length > 0) {
            return;
        }

        
        [ButtonBusyView holdOddEraNapView:contentView];

        
        NSURL *url = [NSURL URLWithString:blobVerify];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [ButtonBusyView duplexMouseManagersPopNativeView:contentView];
                
                if (error || data.length == 0) {
                    
                    illView.text = ScrollDatum.spanMarkCutter.arrangerUnpluggedMidCharMagnitudeFood;
                    return;
                }
                
                
                NSString *agentPubCross = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                illView.text = agentPubCross ?: ScrollDatum.spanMarkCutter.faceWrappedDistortedPictureMultipleDatabasesArtist;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *triple = (WKWebView *)contentView;
        if (!triple.isLoading && triple.estimatedProgress == 1) {
            [ButtonBusyView duplexMouseManagersPopNativeView:contentView];
            return;
        }
        [ButtonBusyView holdOddEraNapView:contentView];
        NSString *daysHover =  [blobVerify.adjustOrnamentsBalanceRestVoiceTeeth stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:daysHover];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [triple loadRequest:request];
    }
}

- (void)kilobytesSwahiliOptionHaveIdleBag:(id)sender {
    [self subtitlesFixingSecretTaskSessionsAction:nil];
    if (self.cursorsBadgeRemainingRemoveBundle) {
        self.cursorsBadgeRemainingRemoveBundle(NO);
    }
}

- (void)substringDetachingCupLogoPressedText:(id)sender {
    [self subtitlesFixingSecretTaskSessionsAction:nil];
    if (self.cursorsBadgeRemainingRemoveBundle) {
        self.cursorsBadgeRemainingRemoveBundle(YES);
    }
}

- (UIView *)aboutAuditView:(NSString *)string {
    UIView *flightEvict = nil;
    if ([[string pathExtension] containsString:ScrollDatum.tildeStopHit.renamingTremorAddCentralsError]) {
        UITextView * youngest = [UITextView new];
        youngest.editable = NO;
        youngest.backgroundColor = UIColor.whiteColor;
        youngest.textColor = UIColor.grayColor;
        flightEvict = youngest;
    }else {
        WKWebView *barSheetBar = [[WKWebView alloc] initWithFrame:CGRectZero];
        barSheetBar.backgroundColor = UIColor.clearColor;
        barSheetBar.scrollView.backgroundColor = UIColor.lightGrayColor;
        barSheetBar.opaque = YES;
        barSheetBar.scrollView.bounces =NO;
        barSheetBar.scrollView.showsVerticalScrollIndicator = NO;
        barSheetBar.scrollView.showsHorizontalScrollIndicator = NO;
        barSheetBar.navigationDelegate = self;
        flightEvict = barSheetBar;
    }
    return flightEvict;
}

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

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

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

@end
