






#import "AnySolveSunOutViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+MathStyle.h"
#import "NSString+DayTamilZip.h"

@interface AnySolveSunOutViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *loudPaceEnergyControl;
@property (nonatomic, strong) UIView * hueRepeatElderUnitReceipt;
@property (nonatomic, strong) UIView * removalLiveYiddishSinNow;

@property (nonatomic, strong) UIScrollView * sexFilteredView;

@end

@implementation AnySolveSunOutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sunTreeIllButton.hidden = YES;
    self.sunStaticButton.hidden = YES;
    
    UISegmentedControl *workKinView = [[UISegmentedControl alloc] initWithItems:@[WinSubAbove.resourcesCanon.nineServerDetectedClosestCurlCar,WinSubAbove.resourcesCanon.plateReceivedArtworkChildSwappedMail]];
    workKinView.layer.masksToBounds = YES; 
    workKinView.layer.cornerRadius = 2;    
    [workKinView setTitleTextAttributes:@{NSForegroundColorAttributeName:[WinSubAbove nearbyAreColor]} forState:UIControlStateSelected];
    [workKinView setTitleTextAttributes:@{NSForegroundColorAttributeName:[WinSubAbove nearbyAreColor]} forState:UIControlStateNormal];
    [self.view addSubview:workKinView];
    [workKinView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(WinSubAbove.swipeFlagDay.rainCatNote);
    }];
    [workKinView addTarget:self action:@selector(auditFunction:) forControlEvents:UIControlEventValueChanged];
    self.loudPaceEnergyControl = workKinView;
    
    _sexFilteredView = [[UIScrollView alloc]init];
    _sexFilteredView.pagingEnabled = YES;
    _sexFilteredView.delegate = self;
    [self.view addSubview:_sexFilteredView];
    [_sexFilteredView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.schemesStill);
        make.right.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.schemesStill);
        make.top.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.creatorMagic);
        make.bottom.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.chunkyLogWax);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.sexFilteredView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.sexFilteredView);
        make.height.equalTo(_sexFilteredView);
    }];
    
    UIView * fatCurrently = [self eachAssertView:[WinSubAbove lexiconRotorOptStarNickname]];
    [containerView addSubview:fatCurrently];
    [fatCurrently mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.sexFilteredView);
    }];
    self.hueRepeatElderUnitReceipt = fatCurrently;
    
    UIView * tightPubLead = [self eachAssertView:[WinSubAbove lexiconJumpAccountsOneBefore]];
    [containerView addSubview:tightPubLead];
    [tightPubLead mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(fatCurrently.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.sexFilteredView);
    }];
    self.removalLiveYiddishSinNow = tightPubLead;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(tightPubLead.mas_right);
    }];
    
    if (![self.endOnlyCall boolValue]) {
        UIButton *lowKnowButton = [WinSubAbove transposePipeAddCurlOurColor:WinSubAbove.resourcesCanon.handoverFade];
        [lowKnowButton setBackgroundImage:[UIImage functionsChildColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [lowKnowButton addTarget:self action:@selector(wetQualityEffortUnsafeModernTelephoto:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:lowKnowButton];
        
        [lowKnowButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.modifyClaim);
            make.left.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.schemesStill);
            make.right.equalTo(self.view.mas_centerX).offset(-WinSubAbove.swipeFlagDay.peakGrammar);
            make.height.mas_equalTo(WinSubAbove.swipeFlagDay.faeroeseFail);
        }];
    }

    UIButton *losePanButton =  [WinSubAbove transposePipeAddCurlOurColor:WinSubAbove.resourcesCanon.askButtons];
    [losePanButton addTarget:self action:@selector(attempterCupRestoredObsoleteDeliveryFor:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:losePanButton];
    BOOL towerButton = ![self.endOnlyCall boolValue];
    [losePanButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.modifyClaim);
        make.right.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.schemesStill);
        
        if (towerButton) {
            make.left.equalTo(self.view.mas_centerX).offset(WinSubAbove.swipeFlagDay.peakGrammar);
        } else {
            make.left.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.schemesStill);
        }
        make.height.mas_equalTo(WinSubAbove.swipeFlagDay.faeroeseFail);
    }];
    
    workKinView.selectedSegmentIndex = 0;
    [self auditFunction:workKinView];
}

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

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

- (void)italicTradDiphthongSpineRestartText:(NSInteger)type {
    NSString *dogHelpers = nil;
    UIView *contentView = nil;
    dogHelpers = type == 0 ? [WinSubAbove lexiconRotorOptStarNickname]:[WinSubAbove lexiconJumpAccountsOneBefore];
    contentView = type == 0 ? self.hueRepeatElderUnitReceipt:self.removalLiveYiddishSinNow;
    
    if (dogHelpers.tagPositions) {
        return;
    }
    
    if ([[dogHelpers pathExtension] containsString:WinSubAbove.swipeFlagDay.seasonAffectedMouthBasqueUndefined]) {
        UITextView *busView = (UITextView *)contentView;
        if (busView.text.length > 0) {
            return;
        }

        
        [RespondHowView causeTapVideoView:contentView];

        
        NSURL *url = [NSURL URLWithString:dogHelpers];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [RespondHowView standardArtUseRetainMagnesiumView:contentView];
                
                if (error || data.length == 0) {
                    
                    busView.text = WinSubAbove.resourcesCanon.awakePenFutureReturningArgumentsGerman;
                    return;
                }
                
                
                NSString *wrapWetSawOur = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                busView.text = wrapWetSawOur ?: WinSubAbove.resourcesCanon.norwegianHierarchyIssuerManagersPeerLayerHourly;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *ownBin = (WKWebView *)contentView;
        if (!ownBin.isLoading && ownBin.estimatedProgress == 1) {
            [RespondHowView standardArtUseRetainMagnesiumView:contentView];
            return;
        }
        [RespondHowView causeTapVideoView:contentView];
        NSString *forkPhase =  [dogHelpers.latvianTempProcessorIndexCommentLeft stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:forkPhase];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [ownBin loadRequest:request];
    }
}

- (void)wetQualityEffortUnsafeModernTelephoto:(id)sender {
    [self desiredDisableShadowMagnitudeEsperantoAction:nil];
    if (self.flipDeviationRowCatalogKin) {
        self.flipDeviationRowCatalogKin(NO);
    }
}

- (void)attempterCupRestoredObsoleteDeliveryFor:(id)sender {
    [self desiredDisableShadowMagnitudeEsperantoAction:nil];
    if (self.flipDeviationRowCatalogKin) {
        self.flipDeviationRowCatalogKin(YES);
    }
}

- (UIView *)eachAssertView:(NSString *)string {
    UIView *fatDrumCity = nil;
    if ([[string pathExtension] containsString:WinSubAbove.swipeFlagDay.seasonAffectedMouthBasqueUndefined]) {
        UITextView * decayLow = [UITextView new];
        decayLow.editable = NO;
        decayLow.backgroundColor = UIColor.whiteColor;
        decayLow.textColor = UIColor.grayColor;
        fatDrumCity = decayLow;
    }else {
        WKWebView *touchesNeed = [[WKWebView alloc] initWithFrame:CGRectZero];
        touchesNeed.backgroundColor = UIColor.clearColor;
        touchesNeed.scrollView.backgroundColor = UIColor.lightGrayColor;
        touchesNeed.opaque = YES;
        touchesNeed.scrollView.bounces =NO;
        touchesNeed.scrollView.showsVerticalScrollIndicator = NO;
        touchesNeed.scrollView.showsHorizontalScrollIndicator = NO;
        touchesNeed.navigationDelegate = self;
        fatDrumCity = touchesNeed;
    }
    return fatDrumCity;
}

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

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

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

@end
