






#import "RestFarsiViewController.h"
#import "PlanarSourceUndoneEntityZoomHandler.h"

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

@end

@implementation RestFarsiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.catAtomTryButton.hidden = YES;
    self.ductilityButton.hidden = YES;
    [self pitchItemJumpView];
}

- (void)pitchItemJumpView
{
    WKUserContentController *explicitRedone = [[WKUserContentController alloc] init];
    WKUserScript *daysCutoff = [[WKUserScript alloc] initWithSource:PaceDownHue.absoluteAuto.panRunBoundInsulinCookies injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [explicitRedone addUserScript:daysCutoff];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *fathomsMay = [[WKPreferences alloc]init];
    fathomsMay.javaScriptCanOpenWindowsAutomatically = YES;
    fathomsMay.minimumFontSize = 40.0;
    fathomsMay.javaScriptEnabled = YES;
    config.preferences = fathomsMay;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = explicitRedone;
    
    self.splatSexCat = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.splatSexCat.backgroundColor = UIColor.clearColor;
    self.splatSexCat.scrollView.backgroundColor = UIColor.clearColor;
    self.splatSexCat.navigationDelegate = self;
    self.splatSexCat.opaque = YES;
    self.splatSexCat.scrollView.bounces = NO;
    self.splatSexCat.scrollView.showsVerticalScrollIndicator = NO;
    self.splatSexCat.scrollView.showsHorizontalScrollIndicator = NO;
    self.splatSexCat.UIDelegate = self;
    [self.view addSubview:self.splatSexCat];
    self.splatSexCat.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    PlanarSourceUndoneEntityZoomHandler *embedded = [[PlanarSourceUndoneEntityZoomHandler alloc] initWithDelegate:self];
    PlanarSourceUndoneEntityZoomHandler *moveBusy = [[PlanarSourceUndoneEntityZoomHandler alloc] initWithDelegate:self];
    
    [self.splatSexCat.configuration.userContentController addScriptMessageHandler:embedded name:PaceDownHue.absoluteAuto.earlyTurnRenewOrangeDeleting];
    [self.splatSexCat.configuration.userContentController addScriptMessageHandler:moveBusy name:PaceDownHue.absoluteAuto.ordinalsEngineerDeepFlagDifferentFeaturesIntrinsic];
}

- (void)setTraverseBad:(NSString *)traverseBad {
    _traverseBad = traverseBad;
    NSURL *url = [NSURL URLWithString:traverseBad];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[PaceDownHue supplyMetricsLoadBrownProjectsToken] forHTTPHeaderField:PaceDownHue.absoluteAuto.truncateWidgetLeakyRadioSwap];
    [self.splatSexCat loadRequest:request];
}

- (void)receivesIntrinsicSentencesSpaMergeLockClick:(NSURL *)URL {
    if ([self.pageWordSmile respondsToSelector:@selector(treeLogView:panelBirthAction:sex:)]) {
        [self.pageWordSmile treeLogView:self.splatSexCat panelBirthAction:URL.host sex: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:PaceDownHue.absoluteAuto.didProxy]) {
        [self receivesIntrinsicSentencesSpaMergeLockClick: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:PaceDownHue.absoluteAuto.walkOffSharpnessReplaceAxialTelephoto completionHandler:nil];
    
    [webView evaluateJavaScript:PaceDownHue.absoluteAuto.refreshedServiceOffFlushEarPrint completionHandler:nil];
    [webView evaluateJavaScript:PaceDownHue.absoluteAuto.suspendedOrdinalsMaySingleMandarin completionHandler:nil];
    
    [IndianHardView vendorOneUndoneAdjustedGracefulView:self.view];
    while (self.splatSexCat.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.pageWordSmile respondsToSelector:@selector(treeLogView:panelBirthAction:sex:)]) {
        [self.pageWordSmile treeLogView:self.splatSexCat panelBirthAction:message.name sex:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [AskAlertView notationWasTokenTriggerYouBars:@"" message:message completion:^(NSInteger dueBedIndex) {
        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(PaceDownHue.absoluteAuto.needAdoptTag);
}


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

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

@end
