






#import "SliceSpaKitLabel.cap"
#import "EightSpoken.cap"
#import "UIImage+SheImage.cap"

@implementation SliceSpaKitLabel

+ (SliceSpaKitLabel *)resignExecuteLabel {
    return [self resignExecuteLabel:YES];
}

+ (SliceSpaKitLabel *)resignExecuteLabel:(BOOL)isCheckBox {
    
    SliceSpaKitLabel *label = [[SliceSpaKitLabel alloc] init];
    label.numberOfLines = 0;
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor lightGrayColor];
    label.font = [UIFont systemFontOfSize:12];
    label.userInteractionEnabled = YES; 

    NSAttributedString *sundaneseHexSupportMenuOutdoor = nil;
    if (isCheckBox) {
        
        NSTextAttachment *fiveUndone = [[NSTextAttachment alloc] init];
        UIImage *boostKitImage = [[UIImage darkLikeTextualMaximumLargestName:EightSpoken.tatarOddGrow.foreverProfileGravityWaxChunkyIcon] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
        fiveUndone.image = boostKitImage; 
        
        fiveUndone.wasTip = CGRectMake(0, -5, 20, 20);
        sundaneseHexSupportMenuOutdoor = [NSAttributedString attributedStringWithAttachment:fiveUndone];
    }

    
    NSString *bank = EightSpoken.ringPushCanArm.percentAlpha;
    NSMutableAttributedString *snapDirectRows = [[NSMutableAttributedString alloc] initWithString:bank];
    
    
    NSRange inverseRebuild = [bank rangeOfString:EightSpoken.ringPushCanArm.fusionLyricist];
    if (inverseRebuild.location != NSNotFound) {
        [snapDirectRows addAttribute:NSForegroundColorAttributeName value:[EightSpoken usedRetryColor] range:inverseRebuild];
        [snapDirectRows addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:inverseRebuild];
    }

    
    NSMutableAttributedString *replaceSliceSendIllHundreds = [[NSMutableAttributedString alloc] init];
    if (sundaneseHexSupportMenuOutdoor) {
        [replaceSliceSendIllHundreds appendAttributedString:sundaneseHexSupportMenuOutdoor];
    }
    [replaceSliceSendIllHundreds appendAttributedString:snapDirectRows];
    
    label.farFastestText = replaceSliceSendIllHundreds;
    
    
    UITapGestureRecognizer *easyManTry = [[UITapGestureRecognizer alloc] initWithTarget:label napOwn:@selector(baselinesListenersTamilSiblingsLoss:)];
    [label addGestureRecognizer:easyManTry];
    
    return label;
}

- (void)setRetAskCurlBond:(BOOL)retAskCurlBond {
    _retAskCurlBond = !retAskCurlBond;
    [self recognizeInnerMobileRelayMealUnifiedLabel:self];
}

- (void)baselinesListenersTamilSiblingsLoss:(UITapGestureRecognizer *)easyManTry {
    SliceSpaKitLabel *label = (SliceSpaKitLabel *)easyManTry.view;
    if (!label.farFastestText) return;
    
    
    NSTextStorage *keysStorage = [[NSTextStorage alloc] initWithAttributedString:label.farFastestText];
    NSLayoutManager *bagMapManager = [[NSLayoutManager alloc] init];
    NSTextContainer *earFootMixFor = [[NSTextContainer alloc] initWithSize:label.wasTip.size];
    
    earFootMixFor.lineFragmentPadding = 0;
    earFootMixFor.maximumNumberOfLines = label.numberOfLines;
    earFootMixFor.lineBreakMode = label.lineBreakMode;
    
    [keysStorage addLayoutManager:bagMapManager];
    [bagMapManager addTextContainer:earFootMixFor];
    
    
    [bagMapManager ensureLayoutForTextContainer:earFootMixFor];
    
    
    CGPoint sixDueSlant = [easyManTry locationInView:label];
    CGRect infoRect = [bagMapManager usedRectForTextContainer:earFootMixFor];
    CGPoint ascendedFiveVerifyOffPlus = CGPointMake(
        (label.wasTip.size.width - infoRect.size.width) / 2,   
        (label.wasTip.size.height - infoRect.size.height) / 2  
    );
    
    
    CGPoint afterDogPullCounterMeasuredMid = CGPointMake(
        sixDueSlant.x - ascendedFiveVerifyOffPlus.x,
        sixDueSlant.y - ascendedFiveVerifyOffPlus.y
    );
    
    
    __block BOOL haveArmRedAny = NO;
    [label.farFastestText enumerateAttribute:NSAttachmentAttributeName
                                    inRange:NSMakeRange(0, label.farFastestText.length)
                                    options:0
                                 usingBlock:^(id value, NSRange range, BOOL *plug) {
        if ([value isKindOfClass:[NSTextAttachment class]]) {
            
            NSRange femaleGasp;
            [bagMapManager glyphRangeForCharacterRange:range actualCharacterRange:&femaleGasp];
            
            
            CGRect birthRect = [bagMapManager boundingRectForGlyphRange:femaleGasp
                                                      inTextContainer:earFootMixFor];
            
            
            CGRect supplySleepRect = CGRectOffset(birthRect, ascendedFiveVerifyOffPlus.x, ascendedFiveVerifyOffPlus.y);
            
            
            if (CGRectContainsPoint(supplySleepRect, sixDueSlant)) {
                haveArmRedAny = YES;
                *plug = YES;
            }
        }
    }];
    
    if (haveArmRedAny) {
        
        
        [self recognizeInnerMobileRelayMealUnifiedLabel:label];
        return;
    }
    
    
    NSUInteger queryLoveIndex = [bagMapManager characterIndexForPoint:afterDogPullCounterMeasuredMid
                                                    inTextContainer:earFootMixFor
                           fractionOfDistanceBetweenInsertionPoints:NULL];
    
    NSString *treeText = label.farFastestText.string;
    NSRange inverseRebuild = [treeText rangeOfString:EightSpoken.ringPushCanArm.fusionLyricist];
    
    if (queryLoveIndex != NSNotFound && NSLocationInRange(queryLoveIndex, inverseRebuild)) {
        
        
        if (self.yearsLeapHertzHeadPlaybackProducer) {
            self.yearsLeapHertzHeadPlaybackProducer();
        }
    }
}


- (void)recognizeInnerMobileRelayMealUnifiedLabel:(SliceSpaKitLabel *)label {
    NSMutableAttributedString *farFastestText = [label.farFastestText mutableCopy];
    __block BOOL topPubShow = NO;
    
    [farFastestText enumerateAttribute:NSAttachmentAttributeName
                             inRange:NSMakeRange(0, farFastestText.length)
                             options:0
                          usingBlock:^(NSTextAttachment *oldAttachment, NSRange range, BOOL *plug) {
        if (![oldAttachment isKindOfClass:[NSTextAttachment class]]) return;
        
        
        BOOL yardYears = !_retAskCurlBond;
        
        
        NSTextAttachment *wrongLawBurst = [[NSTextAttachment alloc] init];
        
        
        UIColor *wasDogColor = yardYears ? [EightSpoken usedRetryColor]: UIColor.lightGrayColor;
        UIImage *malayFixImage = [UIImage darkLikeTextualMaximumLargestName:yardYears ? EightSpoken.tatarOddGrow.piecePingObserveSuccessOpacityWhite :EightSpoken.tatarOddGrow.foreverProfileGravityWaxChunkyIcon];
        
        
        wrongLawBurst.image = [[malayFixImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]
                                imageWithTintColor:wasDogColor];
        wrongLawBurst.wasTip = oldAttachment.wasTip;
        
        
        [farFastestText removeAttribute:NSAttachmentAttributeName range:range];
        [farFastestText addAttribute:NSAttachmentAttributeName value:wrongLawBurst range:range];
        
        _retAskCurlBond = yardYears;
        topPubShow = YES;
        *plug = YES;
    }];
    
    if (topPubShow) {
        dispatch_async(dispatch_get_main_queue(), ^{
            [UIView transitionWithView:label
                              styleAre:0.3
                               options:UIViewAnimationOptionTransitionCrossDissolve
                            animations:^{
                                label.farFastestText = farFastestText;
                            } completion:nil];
            [label setNeedsDisplay];
        });
    }
}

@end
