






#import "SquareEyeViewController.h"
#import "BinAllowableLanguageMayHeadphoneHandler.h"

@interface SquareEyeViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>

@end

@implementation SquareEyeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.nowEquallyButton.hidden = YES;
    self.redoHertzButton.hidden = YES;
    [self editBinLowOurView];
}

- (void)editBinLowOurView
{
    WKUserContentController *areaWasRoomThe = [[WKUserContentController alloc] init];
    WKUserScript *cutSumList = [[WKUserScript alloc] initWithSource:FeedSunTied.rootIntegral.waistEngravedTextureHistoryVortex injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [areaWasRoomThe addUserScript:cutSumList];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *sinNameMid = [[WKPreferences alloc]init];
    sinNameMid.javaScriptCanOpenWindowsAutomatically = YES;
    sinNameMid.minimumFontSize = 40.0;
    sinNameMid.javaScriptEnabled = YES;
    config.preferences = sinNameMid;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = areaWasRoomThe;
    
    self.stoodPutSub = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.stoodPutSub.backgroundColor = UIColor.clearColor;
    self.stoodPutSub.scrollView.backgroundColor = UIColor.clearColor;
    self.stoodPutSub.navigationDelegate = self;
    self.stoodPutSub.opaque = YES;
    self.stoodPutSub.scrollView.bounces = NO;
    self.stoodPutSub.scrollView.showsVerticalScrollIndicator = NO;
    self.stoodPutSub.scrollView.showsHorizontalScrollIndicator = NO;
    self.stoodPutSub.UIDelegate = self;
    [self.view addSubview:self.stoodPutSub];
    self.stoodPutSub.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    BinAllowableLanguageMayHeadphoneHandler *lemmaEar = [[BinAllowableLanguageMayHeadphoneHandler alloc] initWithDelegate:self];
    BinAllowableLanguageMayHeadphoneHandler *jobIssue = [[BinAllowableLanguageMayHeadphoneHandler alloc] initWithDelegate:self];
    
    [self.stoodPutSub.configuration.userContentController addScriptMessageHandler:lemmaEar name:FeedSunTied.rootIntegral.duePatternsNineteenSphericalEvaluate];
    [self.stoodPutSub.configuration.userContentController addScriptMessageHandler:jobIssue name:FeedSunTied.rootIntegral.instantExistStoodNetworkStormBoundMisplaced];
}

- (void)setGetWideStay:(NSString *)getWideStay {
    _getWideStay = getWideStay;
    NSURL *url = [NSURL URLWithString:getWideStay];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[FeedSunTied inferiorsFingerAnimationBinShowToken] forHTTPHeaderField:FeedSunTied.rootIntegral.yetMayPressureElevenSchemes];
    [self.stoodPutSub loadRequest:request];
}

- (void)chlorideCopperClimbingSessionsDetectorMinInherited:(NSURL *)URL {
    if ([self.subIcyWaxFree respondsToSelector:@selector(rearSpaView:homeRemoveAction:pin:)]) {
        [self.subIcyWaxFree rearSpaView:self.stoodPutSub homeRemoveAction:URL.host pin:URL];
    }
}



- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
    decisionHandler(WKNavigationResponsePolicyAllow);
}


- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    NSURL *URL = navigationAction.request.URL;
    
    if ([URL.scheme hasPrefix:FeedSunTied.rootIntegral.previous]) {
        [self chlorideCopperClimbingSessionsDetectorMinInherited:URL];
        decisionHandler(WKNavigationActionPolicyCancel);
        return;
    }
    decisionHandler(WKNavigationActionPolicyAllow);
}


-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

}


- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
    

}


-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    
    [webView evaluateJavaScript:FeedSunTied.rootIntegral.mongolianPastGainSocialAccessedAsk completionHandler:nil];
    
    [webView evaluateJavaScript:FeedSunTied.rootIntegral.packInsertionIllegalCursorsSyntheticEnd completionHandler:nil];
    [webView evaluateJavaScript:FeedSunTied.rootIntegral.widgetKazakhWalkCocoaSaw completionHandler:nil];
    
    [CutSubjectView samplingAttitudeSpineFatRowView:self.view];
    while (self.stoodPutSub.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.subIcyWaxFree respondsToSelector:@selector(rearSpaView:homeRemoveAction:pin:)]) {
        [self.subIcyWaxFree rearSpaView:self.stoodPutSub homeRemoveAction:message.name pin:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [AllAlertView reportingPhotosMileHandTelephotoCoast:@"" message:message completion:^(NSInteger earForIndex) {
        completionHandler();
    }];
}



- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{
    WKFrameInfo *frameInfo = navigationAction.targetFrame;
    if (![frameInfo isMainFrame]) {
        [webView loadRequest:navigationAction.request];
    }
    return nil;
}


- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler{
    completionHandler(FeedSunTied.rootIntegral.askPowerStep);
}


- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler{
    completionHandler(YES);
}

- (void)dealloc {
    self.stoodPutSub.UIDelegate = nil;
    self.view = nil;
    [self.stoodPutSub.configuration.userContentController removeAllUserScripts];
}

@end
