






#import "RawSpaTradStopViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+NeverRank.h"
#import "NSString+TailFailYou.h"

@interface RawSpaTradStopViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *scaleTopFixFixControl;
@property (nonatomic, strong) UIView * allIncomingFocusedRowVoice;
@property (nonatomic, strong) UIView * exportFreestyleWalkAnimationDone;

@property (nonatomic, strong) UIScrollView * hueSixVoiceView;

@end

@implementation RawSpaTradStopViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.autoCarSexButton.hidden = YES;
    self.execBrownButton.hidden = YES;
    
    UISegmentedControl *siteOldView = [[UISegmentedControl alloc] initWithItems:@[RowAirFloor.iconYellowCube.pubAmpereFilterGetGenderPiece,RowAirFloor.iconYellowCube.applyInverseSendIntegralHelpersPlus]];
    siteOldView.layer.masksToBounds = YES; 
    siteOldView.layer.cornerRadius = 2;    
    [siteOldView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RowAirFloor genderTooColor]} forState:UIControlStateSelected];
    [siteOldView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RowAirFloor genderTooColor]} forState:UIControlStateNormal];
    [self.view addSubview:siteOldView];
    [siteOldView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(RowAirFloor.loveHitOrder.auditedDrag);
    }];
    [siteOldView addTarget:self action:@selector(mouseReferent:) forControlEvents:UIControlEventValueChanged];
    self.scaleTopFixFixControl = siteOldView;
    
    _hueSixVoiceView = [[UIScrollView alloc]init];
    _hueSixVoiceView.pagingEnabled = YES;
    _hueSixVoiceView.delegate = self;
    [self.view addSubview:_hueSixVoiceView];
    [_hueSixVoiceView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(RowAirFloor.loveHitOrder.syntaxAttach);
        make.right.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.syntaxAttach);
        make.top.equalTo(self.view).offset(RowAirFloor.loveHitOrder.dryPoolSlope);
        make.bottom.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.builtAgeGolf);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.hueSixVoiceView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.hueSixVoiceView);
        make.height.equalTo(_hueSixVoiceView);
    }];
    
    UIView * stairPicture = [self hailEnergyView:[RowAirFloor hundredSceneDayPaperState]];
    [containerView addSubview:stairPicture];
    [stairPicture mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.hueSixVoiceView);
    }];
    self.allIncomingFocusedRowVoice = stairPicture;
    
    UIView * wayOneActual = [self hailEnergyView:[RowAirFloor midMenStylizeWateryPermitted]];
    [containerView addSubview:wayOneActual];
    [wayOneActual mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(stairPicture.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.hueSixVoiceView);
    }];
    self.exportFreestyleWalkAnimationDone = wayOneActual;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(wayOneActual.mas_right);
    }];
    
    if (![self.boxInfinity boolValue]) {
        UIButton *logoNotButton = [RowAirFloor eitherPlanarUtilitiesDegreesManganeseColor:RowAirFloor.iconYellowCube.softnessEdit];
        [logoNotButton setBackgroundImage:[UIImage deltaPoolPrintColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [logoNotButton addTarget:self action:@selector(fixtureCanonSenderEightSpeedValue:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:logoNotButton];
        
        [logoNotButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.spaUnsigned);
            make.left.equalTo(self.view).offset(RowAirFloor.loveHitOrder.syntaxAttach);
            make.right.equalTo(self.view.mas_centerX).offset(-RowAirFloor.loveHitOrder.reactorSelf);
            make.height.mas_equalTo(RowAirFloor.loveHitOrder.sinUtilities);
        }];
    }

    UIButton *andCropButton =  [RowAirFloor eitherPlanarUtilitiesDegreesManganeseColor:RowAirFloor.iconYellowCube.dragHasRaw];
    [andCropButton addTarget:self action:@selector(unitOrnamentsStiffnessCaptureMileHeadline:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:andCropButton];
    BOOL focalButton = ![self.boxInfinity boolValue];
    [andCropButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.spaUnsigned);
        make.right.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.syntaxAttach);
        
        if (focalButton) {
            make.left.equalTo(self.view.mas_centerX).offset(RowAirFloor.loveHitOrder.reactorSelf);
        } else {
            make.left.equalTo(self.view).offset(RowAirFloor.loveHitOrder.syntaxAttach);
        }
        make.height.mas_equalTo(RowAirFloor.loveHitOrder.sinUtilities);
    }];
    
    siteOldView.selectedSegmentIndex = 0;
    [self mouseReferent:siteOldView];
}

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

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

- (void)launchingKilowattOptUploadedCloudText:(NSInteger)type {
    NSString *pinRowsWax = nil;
    UIView *contentView = nil;
    pinRowsWax = type == 0 ? [RowAirFloor hundredSceneDayPaperState]:[RowAirFloor midMenStylizeWateryPermitted];
    contentView = type == 0 ? self.allIncomingFocusedRowVoice:self.exportFreestyleWalkAnimationDone;
    
    if (pinRowsWax.petabytesFix) {
        return;
    }
    
    if ([[pinRowsWax pathExtension] containsString:RowAirFloor.loveHitOrder.deferringPublisherObserveShortLookup]) {
        UITextView *zipView = (UITextView *)contentView;
        if (zipView.text.length > 0) {
            return;
        }

        
        [FlowTenKitView birthHeapCostView:contentView];

        
        NSURL *url = [NSURL URLWithString:pinRowsWax];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [FlowTenKitView stringSideBrandAltimeterInhalerView:contentView];
                
                if (error || data.length == 0) {
                    
                    zipView.text = RowAirFloor.iconYellowCube.lookStreamedReversingExceededCursorHeartbeat;
                    return;
                }
                
                
                NSString *rearFastPhase = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                zipView.text = rearFastPhase ?: RowAirFloor.iconYellowCube.semaphoreDesignerRadixChromeExtentsDisablesRepeat;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *outYet = (WKWebView *)contentView;
        if (!outYet.isLoading && outYet.estimatedProgress == 1) {
            [FlowTenKitView stringSideBrandAltimeterInhalerView:contentView];
            return;
        }
        [FlowTenKitView birthHeapCostView:contentView];
        NSString *lawExpose =  [pinRowsWax.twitterExtrasPortionAdapterBufferedDate stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:lawExpose];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [outYet loadRequest:request];
    }
}

- (void)fixtureCanonSenderEightSpeedValue:(id)sender {
    [self panContentOptProductsGroupedAction:nil];
    if (self.appearingTagCoercionHurricaneChloride) {
        self.appearingTagCoercionHurricaneChloride(NO);
    }
}

- (void)unitOrnamentsStiffnessCaptureMileHeadline:(id)sender {
    [self panContentOptProductsGroupedAction:nil];
    if (self.appearingTagCoercionHurricaneChloride) {
        self.appearingTagCoercionHurricaneChloride(YES);
    }
}

- (UIView *)hailEnergyView:(NSString *)string {
    UIView *pathPrepHue = nil;
    if ([[string pathExtension] containsString:RowAirFloor.loveHitOrder.deferringPublisherObserveShortLookup]) {
        UITextView * footnote = [UITextView new];
        footnote.editable = NO;
        footnote.backgroundColor = UIColor.whiteColor;
        footnote.textColor = UIColor.grayColor;
        pathPrepHue = footnote;
    }else {
        WKWebView *fatLikeRoll = [[WKWebView alloc] initWithFrame:CGRectZero];
        fatLikeRoll.backgroundColor = UIColor.clearColor;
        fatLikeRoll.scrollView.backgroundColor = UIColor.lightGrayColor;
        fatLikeRoll.opaque = YES;
        fatLikeRoll.scrollView.bounces =NO;
        fatLikeRoll.scrollView.showsVerticalScrollIndicator = NO;
        fatLikeRoll.scrollView.showsHorizontalScrollIndicator = NO;
        fatLikeRoll.navigationDelegate = self;
        pathPrepHue = fatLikeRoll;
    }
    return pathPrepHue;
}

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

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

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

@end
