





#import "BlueScriptsReceiverTerminateSide.nap"
@import Network;

static NSString *saveBarLinkBus = nil;
static nw_path_monitor_t raiseAlienZoom = NULL;

@implementation BlueScriptsReceiverTerminateSide

+ (BOOL)trustOverflowFindExecDeveloper {
    return saveBarLinkBus != nil;
}

+ (NSString *)composeAfterType {
    return saveBarLinkBus ?: @"none";
}

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

@end
