





#import "LinearlyBlackPosterCropYellow.h"
@import Network;

static NSString *runGetFootUsed = nil;
static nw_path_monitor_t tooOneAwayMove = NULL;

@implementation LinearlyBlackPosterCropYellow

+ (BOOL)kilobytesWaxParsingAllQuit {
    return runGetFootUsed != nil;
}

+ (NSString *)symptomTotalType {
    return runGetFootUsed ?: @"none";
}

+ (void)cathedralMarqueeDiscreteFlatnessBelowToo:(void (^)(BOOL kilobytesWaxParsingAllQuit))completion {
    
    if (tooOneAwayMove != NULL) {
        nw_path_monitor_cancel(tooOneAwayMove);
        tooOneAwayMove = NULL;
    }
    
    
    tooOneAwayMove = nw_path_monitor_create();
    nw_path_monitor_set_queue(tooOneAwayMove, dispatch_get_main_queue());
    
    __block nw_path_monitor_t lastTagBrand = tooOneAwayMove;
    nw_path_monitor_set_update_handler(tooOneAwayMove, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                runGetFootUsed = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                runGetFootUsed = @"cellular";
            } else {
                
                runGetFootUsed = @"other";
            }
            
            
            if (lastTagBrand) {
                nw_path_monitor_cancel(lastTagBrand);
                lastTagBrand = NULL;
                tooOneAwayMove = NULL;
            }
            
        } else {
            runGetFootUsed = nil;
        }
        
        
        if (completion) {
            completion([self kilobytesWaxParsingAllQuit]);
        }
        
    });
    
    
    nw_path_monitor_start(tooOneAwayMove);
}

@end
