






#import "PrepVirtualViewController.h"
#import "SDWebImageManager.h"
#import "PanToast.h"
#import "NSString+OddArmpit.h"

@interface PrepVirtualViewController ()

@property (nonatomic, strong) UIImageView *noteReceiveImageView;
@property (nonatomic, strong) UITextField *flipBatchTextField;
@property (nonatomic, strong) UITextField *pageWorkoutTextField;

@end

@implementation PrepVirtualViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.coverStandButton.hidden = [self.givenBarRet[0] boolValue];
    
    CGFloat backOppositeSigmoidMakeSubtitles = BinFaxEight.icyAboutDrum.masterMinCap;
    
    UILabel *jobLabel = [BinFaxEight uploadedConditionStaleCityBig:BinFaxEight.signRoomModify.decodeFactorSettingComposerShift];
    jobLabel.numberOfLines = 0;
    [self.view addSubview:jobLabel];
    [jobLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(BinFaxEight.icyAboutDrum.recycleToken);
        make.left.mas_equalTo(BinFaxEight.icyAboutDrum.croppingHand);
        make.right.mas_equalTo(-BinFaxEight.icyAboutDrum.croppingHand);
    }];
    
    
    self.flipBatchTextField = [BinFaxEight samePressedField:BinFaxEight.signRoomModify.busDescenderEvaluateAcuteOutdoorPerformer isSecure:NO];
    [self.view addSubview:self.flipBatchTextField];
    [self.flipBatchTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(jobLabel.mas_bottom).offset(backOppositeSigmoidMakeSubtitles);
        make.left.mas_equalTo(BinFaxEight.icyAboutDrum.substringSaw);
        make.right.mas_equalTo(-BinFaxEight.icyAboutDrum.substringSaw);
        make.height.mas_equalTo(BinFaxEight.icyAboutDrum.containerHas);
    }];
    
    
    self.pageWorkoutTextField = [BinFaxEight samePressedField:BinFaxEight.signRoomModify.enterDesiredSymmetricFocalCommentsUtilities isSecure:NO];;
    [self.view addSubview:self.pageWorkoutTextField];
    [self.pageWorkoutTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.flipBatchTextField.mas_bottom).offset(backOppositeSigmoidMakeSubtitles);
        make.left.right.equalTo(self.flipBatchTextField);
        make.height.mas_equalTo(BinFaxEight.icyAboutDrum.containerHas);
    }];
    
    
    UIImageView *binTooImageView = nil;
    if ([self.givenBarRet[1] length] > 0) {
        
        binTooImageView = [[UIImageView alloc] init];
        binTooImageView.backgroundColor = UIColor.lightGrayColor;
        binTooImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:binTooImageView];
        [binTooImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.pageWorkoutTextField.mas_bottom).offset(backOppositeSigmoidMakeSubtitles);
            make.width.mas_equalTo(self.pageWorkoutTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.noteReceiveImageView = binTooImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.givenBarRet[1]] options:0 progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                binTooImageView.image = image2;
                CGFloat ratio = image2.size.height / image2.size.width;
                [binTooImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((BinFaxEight.icyAboutDrum.logPacketsUrgentNapBestWidth -BinFaxEight.icyAboutDrum.substringSaw*2)*ratio);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.noteReceiveImageView ? self.noteReceiveImageView.frame.size.height + BinFaxEight.icyAboutDrum.masterMinCap +BinFaxEight.icyAboutDrum.toggleOperateInitiatedCarExternalFootball : BinFaxEight.icyAboutDrum.toggleOperateInitiatedCarExternalFootball;
                    
                    make.size.mas_equalTo(CGSizeMake(BinFaxEight.icyAboutDrum.logPacketsUrgentNapBestWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.noteReceiveImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.noteReceiveImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *ejectDragButton = [BinFaxEight ratingsIndigoNumeratorRenameBrokenColor:BinFaxEight.signRoomModify.retSectionsMemoryTagsClimbed];
    [ejectDragButton addTarget:self action:@selector(canonIndexingTransportHairCreditFeed:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:ejectDragButton];
    [ejectDragButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-BinFaxEight.icyAboutDrum.ownEmbedding);
        make.left.right.equalTo(self.flipBatchTextField);
        make.height.mas_equalTo(BinFaxEight.icyAboutDrum.barsMightBig);
    }];
    
}

- (void)canonIndexingTransportHairCreditFeed:(id)sender {
if (self.flipBatchTextField.text.funExclusive || self.pageWorkoutTextField.text.funExclusive) {
        [WonAlertView terminalRetryCopperBookmarksRemainingIdle:BinFaxEight.signRoomModify.capAppend message:BinFaxEight.signRoomModify.ensureCutterMixLightNetPrinted completion:nil];
        return;
    }
    if ([self.draftPieceAre respondsToSelector:@selector(temporaryConsumedSingleLogPlacementBadWithName:barSay:completion:)]) {
        [DoneBasqueView makeNeedBreakWindow];
        [self.draftPieceAre temporaryConsumedSingleLogPlacementBadWithName:self.flipBatchTextField.text barSay:self.pageWorkoutTextField.text completion:^(id object) {
            [DoneBasqueView literSpanSamplerMeasuredPackWindow];
            if ([object boolValue]) {
                [[BalticFixManager shared] capturingOddWindow];
                [PanToast ownOurTake:BinFaxEight.signRoomModify.lengthsMillTapBadFocusesHis];
            }
        }];
    }
}

@end
