





#import "CircularClaimTemporalMediaHue.h"
@import Network;

static NSString *keyTopCertBest = nil;
static nw_path_monitor_t inheritedChunk = NULL;

@implementation CircularClaimTemporalMediaHue

+ (BOOL)decayRepairProduceShelfTransit {
    return keyTopCertBest != nil;
}

+ (NSString *)irishSentForType {
    return keyTopCertBest ?: @"none";
}

+ (void)versionsLaterTornadoLowAnnotatedLaunch:(void (^)(BOOL decayRepairProduceShelfTransit))completion {
    
    if (inheritedChunk != NULL) {
        nw_path_monitor_cancel(inheritedChunk);
        inheritedChunk = NULL;
    }
    
    
    inheritedChunk = nw_path_monitor_create();
    nw_path_monitor_set_queue(inheritedChunk, dispatch_get_main_queue());
    
    __block nw_path_monitor_t topHighStorm = inheritedChunk;
    nw_path_monitor_set_update_handler(inheritedChunk, ^(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)) {
                keyTopCertBest = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                keyTopCertBest = @"cellular";
            } else {
                
                keyTopCertBest = @"other";
            }
            
            
            if (topHighStorm) {
                nw_path_monitor_cancel(topHighStorm);
                topHighStorm = NULL;
                inheritedChunk = NULL;
            }
            
        } else {
            keyTopCertBest = nil;
        }
        
        
        if (completion) {
            completion([self decayRepairProduceShelfTransit]);
        }
        
    });
    
    
    nw_path_monitor_start(inheritedChunk);
}

@end
