//
//  ATContainerTool.h
//  topon_flutter_plugin
//
//  Created by GUO PENG on 2021/6/25.
//

#import <Foundation/Foundation.h>
#import <AnyThinkSDK/ATCheckLoadModel.h>
NS_ASSUME_NONNULL_BEGIN

#define kATStringIsEmpty(str) (([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1) ? (NSLog(@"%s - placementID empty", __PRETTY_FUNCTION__), YES) : NO)
 
@interface ATCommonTool : NSObject

+ (UIViewController *)currentViewController;

+ (UIViewController *)getRootViewController;

+ (UIViewController *)getCurrentViewController;

+ (NSString*)dictionaryToJson:(NSDictionary *)dic;

+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

+ (NSString *)toReadableJSONString:(NSArray *)dataArr;

+ (NSDictionary *)objectToJSONString:(ATCheckLoadModel *)mode;
/**
* Convert hexadecimal string to color
 */
+ (UIColor *)colorWithHex:(uint)hex alpha:(CGFloat)alpha;

+ (UIColor *)colorWithHexString:(NSString *)HexString;

+ (UIColor *)colorWithHexString:(NSString *)HexString alpha:(CGFloat)alpha;

+ (UIColor*) colorRGBonvertToHSB:(UIColor*)color withBrighnessDelta:(CGFloat)delta;

+ (UIColor*) colorRGBonvertToHSB:(UIColor*)color withAlphaDelta:(CGFloat)delta;

+ (UIColor*) colorWithHex:(NSInteger)hexValue;

+ (NSString*) checkStrParamsEmptyAndReturn:(NSString *)str;

/// Parse the atAdRequest field in extraDic: If channelSource is included, update the SDK global configuration.
/// Parse adxBidFloorInfo / preLoadInfo for subsequent expansion; remove atAdRequest from dic after processing,
/// Keep the extras passed to SDK loadAD clean (consistent with Unity ATxxxWrapper::loadXxxWithplacementID:customDataJSONString:).
+ (void)applyAtAdRequestAndRemove:(NSMutableDictionary *)extraDic;

@end

NS_ASSUME_NONNULL_END
