





#import "ClusterScanAdapterFunEye.h"
@import Network;

static NSString *faceOpenHowFor = nil;
static nw_path_monitor_t cachePlainSeed = NULL;

@implementation ClusterScanAdapterFunEye

+ (BOOL)gopherNowSingleSheGesture {
    return faceOpenHowFor != nil;
}

+ (NSString *)currencyStepType {
    return faceOpenHowFor ?: @"none";
}

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

@end
