






#import "PanelCommandsViewController.h"
#import "SobToast.h"
#import "SomaliInfo.h"

@interface PanelCommandsViewController ()

@property (nonatomic, strong) UIImageView *collapsedView;
@property (nonatomic, strong) UIButton *improperAgeButton;
@property (nonatomic, strong) UIView *cityNonceView;
@property (nonatomic, strong) UILabel *dolbySheLabel;
@property (nonatomic, strong) UITextField *hoverLongTenTextField;
@property (nonatomic, strong) UITextField *bitUpscaleBagTextField;
@end

@implementation PanelCommandsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.napEyeCityButton.hidden = YES;
    
    if ([SomaliInfo phaseDescenderPrettyDropSpatialImage]) {
        self.collapsedView = [[UIImageView alloc] initWithImage:[SomaliInfo phaseDescenderPrettyDropSpatialImage]];
        [self.view addSubview:self.collapsedView];
        self.collapsedView.hidden = YES;
        [self.collapsedView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(IndicesBest.trustMainArm.originalTint);
            make.left.equalTo(self.stayPaperButton.mas_right);
            make.top.equalTo(self.view).offset(IndicesBest.trustMainArm.sunKilohertz);
        }];
    }
    
    self.cityNonceView = [IndicesBest cityNonceView];
    self.cityNonceView.hidden = YES;
    [self.view addSubview:self.cityNonceView];
    [self.cityNonceView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([SomaliInfo phaseDescenderPrettyDropSpatialImage]) {
            make.centerY.equalTo(self.collapsedView);
            make.left.equalTo(self.collapsedView.mas_right).offset(IndicesBest.trustMainArm.bodyThermal);
        }else {
            make.top.equalTo(self.view).offset(IndicesBest.trustMainArm.sunKilohertz);
            make.left.equalTo(self.stayPaperButton.mas_right).offset(IndicesBest.trustMainArm.bodyThermal);
        }
        make.right.equalTo(self.napEyeCityButton.mas_left);
        make.height.mas_equalTo(IndicesBest.trustMainArm.originalTint);
    }];
    
    self.dolbySheLabel = [IndicesBest bigSuchCutTemplatePlatform:IndicesBest.linerSharpness.adverbStylizePartialSphericalBitmap];
    self.dolbySheLabel.numberOfLines = 0;
    [self.view addSubview:self.dolbySheLabel];
    [self.dolbySheLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(IndicesBest.trustMainArm.minPopUighur);
        make.left.mas_equalTo(IndicesBest.trustMainArm.hexYouJabber);
        make.right.mas_equalTo(-IndicesBest.trustMainArm.hexYouJabber);
    }];
    
    
    self.hoverLongTenTextField = [IndicesBest sleepFaxGloballyGraphicsPushAccount];
    self.hoverLongTenTextField.enabled = NO;
    self.hoverLongTenTextField.text = self.chunkySmall[IndicesBest.trustMainArm.eyeAirChainName];
    [self winInfoStormDistantRemovalGoalView:self.hoverLongTenTextField text:IndicesBest.linerSharpness.extendsStridePackageOverlaySentences];
    [self.view addSubview:self.hoverLongTenTextField];
    [self.hoverLongTenTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.dolbySheLabel.mas_bottom).offset(IndicesBest.trustMainArm.pinThirdSnap);
        make.left.mas_equalTo(IndicesBest.trustMainArm.wonDolbyTime);
        make.right.mas_equalTo(-IndicesBest.trustMainArm.wonDolbyTime);
        make.height.mas_equalTo(IndicesBest.trustMainArm.toolHowChest);
    }];
    
    
    self.bitUpscaleBagTextField = [IndicesBest sleepFaxGloballyGraphicsPushAccount];
    self.bitUpscaleBagTextField.enabled = NO;
    self.bitUpscaleBagTextField.text = self.chunkySmall[IndicesBest.trustMainArm.swapHostingKey];
    [self winInfoStormDistantRemovalGoalView:self.bitUpscaleBagTextField text:IndicesBest.linerSharpness.lowCacheSpanishMonotonicFinal];
    [self.view addSubview:self.bitUpscaleBagTextField];
    [self.bitUpscaleBagTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.hoverLongTenTextField.mas_bottom).offset(IndicesBest.trustMainArm.pinThirdSnap);
        make.left.right.equalTo(self.hoverLongTenTextField);
        make.height.mas_equalTo(IndicesBest.trustMainArm.toolHowChest);
    }];
    
    
    UIButton *parentSunButton = [IndicesBest faxDraftDialogEarCutterColor:IndicesBest.linerSharpness.decryptedFunctionCellphoneBagEnable];
    [parentSunButton addTarget:self action:@selector(scanningExtrinsicScriptsPlugTrustAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:parentSunButton];
    [parentSunButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.bitUpscaleBagTextField.mas_bottom).offset(IndicesBest.trustMainArm.pinThirdSnap);
        make.left.right.equalTo(self.bitUpscaleBagTextField);
        make.height.mas_equalTo(IndicesBest.trustMainArm.originalTint);
    }];
    
    
    self.improperAgeButton = [IndicesBest advanceNameTruncatesAffectedDecode:IndicesBest.linerSharpness.disabledPashtoFreeLabelSawClient];
    [self.improperAgeButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.improperAgeButton addTarget:self action:@selector(sawReclaimSupplyUtteranceNowAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.improperAgeButton];
    [self.improperAgeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(parentSunButton.mas_bottom).offset(IndicesBest.trustMainArm.flatHelpTap);
        make.centerX.equalTo(self.view);
    }];
}

- (void)winInfoStormDistantRemovalGoalView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(IndicesBest.trustMainArm.originalTint, IndicesBest.trustMainArm.toolHowChest)};
    UILabel *tableAre = [[UILabel alloc] initWithFrame:frame];
    tableAre.text = text;
    tableAre.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = tableAre;
}

- (void)sawReclaimSupplyUtteranceNowAction:(UIButton *)sender {
    [[AssumeNotManager shared] acceptingEasyCardRowsExtentAdjustsViewController:self.navigationController];
}

- (void)scanningExtrinsicScriptsPlugTrustAction:(UIButton *)sender {
    sender.hidden = YES;
    self.dolbySheLabel.hidden = YES;
    self.cityNonceView.hidden = NO;
    self.collapsedView.hidden = NO;
    self.improperAgeButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(IndicesBest.trustMainArm.plugPageSindhiOperatorOrdinalWidth, IndicesBest.trustMainArm.decreaseReaderPassivelyEqualExtractLocator-IndicesBest.trustMainArm.notHexIndigo));
    }];
    [self.hoverLongTenTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.cityNonceView.mas_bottom).offset(IndicesBest.trustMainArm.pinThirdSnap);
    }];
    [self.view layoutIfNeeded];
    
    BOOL china = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:IndicesBest.trustMainArm.homeExistentMillionMarqueeItsOrderFriction];
    if (!china) {
        self.napEyeCityButton.hidden = NO;
        [ButAlertView boyfriendMessagingRedefinedMegahertzServicesTolerance:nil message:IndicesBest.linerSharpness.mainGigabytesAnswerOpacityUses completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= IndicesBest.trustMainArm.wrestlingGet;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:routeRateTelephonyLinkWorkBeat:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image routeRateTelephonyLinkWorkBeat:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[AssumeNotManager shared] acceptingEasyCardRowsExtentAdjustsViewController:self.navigationController];
        [SobToast dragRed:IndicesBest.linerSharpness.hisClampingWidthConditionChildren];
    }else {
        self.napEyeCityButton.hidden = NO;
        [ButAlertView boyfriendMessagingRedefinedMegahertzServicesTolerance:nil message:IndicesBest.linerSharpness.mainGigabytesAnswerOpacityUses completion:nil];
    }
}

@end
