/**
 * @fileoverview This file is generated by the Angular 2 template compiler.
 * Do not edit.
 * @suppress {suspiciousCode,uselessCode,missingProperties}
 */
/* tslint:disable */
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
import * as import0 from './toggle';
import * as import1 from '@angular/core/src/change_detection/change_detection';
import * as import2 from '@angular/core/src/linker/view';
import * as import3 from '@angular/core/src/linker/view_utils';
import * as import5 from '@angular/core/src/metadata/view';
import * as import6 from '@angular/core/src/linker/view_type';
import * as import7 from '@angular/core/src/linker/component_factory';
import * as import8 from '../../util/form';
import * as import9 from '../../config/config';
import * as import10 from '@angular/core/src/linker/element_ref';
import * as import11 from '../../util/haptic';
import * as import12 from '../item/item';
import * as import13 from '../../gestures/gesture-controller';
import * as import14 from '../../util/dom-controller';
import * as import15 from '@angular/forms/src/directives/control_value_accessor';
import * as import16 from '../button/button';
import * as import17 from '../button/button.ngfactory';
export var Wrapper_Toggle = (function () {
    function Wrapper_Toggle(p0, p1, p2, p3, p4, p5, p6, p7) {
        this._changed = false;
        this.context = new import0.Toggle(p0, p1, p2, p3, p4, p5, p6, p7);
        this._expr_0 = import1.UNINITIALIZED;
        this._expr_1 = import1.UNINITIALIZED;
        this._expr_2 = import1.UNINITIALIZED;
        this._expr_3 = import1.UNINITIALIZED;
        this._expr_4 = import1.UNINITIALIZED;
    }
    Wrapper_Toggle.prototype.ngOnDetach = function (view, componentView, el) {
    };
    Wrapper_Toggle.prototype.ngOnDestroy = function () {
        this.context.ngOnDestroy();
        (this.subscription0 && this.subscription0.unsubscribe());
    };
    Wrapper_Toggle.prototype.check_color = function (currValue, throwOnChange, forceUpdate) {
        if ((forceUpdate || import3.checkBinding(throwOnChange, this._expr_0, currValue))) {
            this._changed = true;
            this.context.color = currValue;
            this._expr_0 = currValue;
        }
    };
    Wrapper_Toggle.prototype.check_mode = function (currValue, throwOnChange, forceUpdate) {
        if ((forceUpdate || import3.checkBinding(throwOnChange, this._expr_1, currValue))) {
            this._changed = true;
            this.context.mode = currValue;
            this._expr_1 = currValue;
        }
    };
    Wrapper_Toggle.prototype.check_checked = function (currValue, throwOnChange, forceUpdate) {
        if ((forceUpdate || import3.checkBinding(throwOnChange, this._expr_2, currValue))) {
            this._changed = true;
            this.context.checked = currValue;
            this._expr_2 = currValue;
        }
    };
    Wrapper_Toggle.prototype.check_disabled = function (currValue, throwOnChange, forceUpdate) {
        if ((forceUpdate || import3.checkBinding(throwOnChange, this._expr_3, currValue))) {
            this._changed = true;
            this.context.disabled = currValue;
            this._expr_3 = currValue;
        }
    };
    Wrapper_Toggle.prototype.ngDoCheck = function (view, el, throwOnChange) {
        var changed = this._changed;
        this._changed = false;
        return changed;
    };
    Wrapper_Toggle.prototype.checkHost = function (view, componentView, el, throwOnChange) {
        var currVal_4 = this.context._disabled;
        if (import3.checkBinding(throwOnChange, this._expr_4, currVal_4)) {
            view.renderer.setElementClass(el, 'toggle-disabled', currVal_4);
            this._expr_4 = currVal_4;
        }
    };
    Wrapper_Toggle.prototype.handleEvent = function (eventName, $event) {
        var result = true;
        if ((eventName == 'keyup')) {
            var pd_sub_0 = (this.context._keyup($event) !== false);
            result = (pd_sub_0 && result);
        }
        return result;
    };
    Wrapper_Toggle.prototype.subscribe = function (view, _eventHandler, emit0) {
        this._eventHandler = _eventHandler;
        if (emit0) {
            (this.subscription0 = this.context.ionChange.subscribe(_eventHandler.bind(view, 'ionChange')));
        }
    };
    return Wrapper_Toggle;
}());
var renderType_Toggle_Host = import3.createRenderComponentType('', 0, import5.ViewEncapsulation.None, [], {});
var View_Toggle_Host0 = (function (_super) {
    __extends(View_Toggle_Host0, _super);
    function View_Toggle_Host0(viewUtils, parentView, parentIndex, parentElement) {
        _super.call(this, View_Toggle_Host0, renderType_Toggle_Host, import6.ViewType.HOST, viewUtils, parentView, parentIndex, parentElement, import1.ChangeDetectorStatus.CheckAlways);
    }
    Object.defineProperty(View_Toggle_Host0.prototype, "_NG_VALUE_ACCESSOR_0_4", {
        get: function () {
            if ((this.__NG_VALUE_ACCESSOR_0_4 == null)) {
                (this.__NG_VALUE_ACCESSOR_0_4 = [this._Toggle_0_3.context]);
            }
            return this.__NG_VALUE_ACCESSOR_0_4;
        },
        enumerable: true,
        configurable: true
    });
    View_Toggle_Host0.prototype.createInternal = function (rootSelector) {
        this._el_0 = import3.selectOrCreateRenderHostElement(this.renderer, 'ion-toggle', import3.EMPTY_INLINE_ARRAY, rootSelector, null);
        this.compView_0 = new View_Toggle0(this.viewUtils, this, 0, this._el_0);
        this._Toggle_0_3 = new Wrapper_Toggle(this.injectorGet(import8.Form, this.parentIndex), this.injectorGet(import9.Config, this.parentIndex), new import10.ElementRef(this._el_0), this.renderer, this.injectorGet(import11.Haptic, this.parentIndex), this.injectorGet(import12.Item, this.parentIndex, null), this.injectorGet(import13.GestureController, this.parentIndex), this.injectorGet(import14.DomController, this.parentIndex));
        this.compView_0.create(this._Toggle_0_3.context);
        var disposable_0 = import3.subscribeToRenderElement(this, this._el_0, new import3.InlineArray2(2, 'keyup', null), this.eventHandler(this.handleEvent_0));
        this.init(this._el_0, (this.renderer.directRenderer ? null : [this._el_0]), [disposable_0]);
        return new import7.ComponentRef_(0, this, this._el_0, this._Toggle_0_3.context);
    };
    View_Toggle_Host0.prototype.injectorGetInternal = function (token, requestNodeIndex, notFoundResult) {
        if (((token === import0.Toggle) && (0 === requestNodeIndex))) {
            return this._Toggle_0_3.context;
        }
        if (((token === import15.NG_VALUE_ACCESSOR) && (0 === requestNodeIndex))) {
            return this._NG_VALUE_ACCESSOR_0_4;
        }
        return notFoundResult;
    };
    View_Toggle_Host0.prototype.detectChangesInternal = function (throwOnChange) {
        this._Toggle_0_3.ngDoCheck(this, this._el_0, throwOnChange);
        if (!throwOnChange) {
            if ((this.numberOfChecks === 0)) {
                this._Toggle_0_3.context.ngAfterContentInit();
            }
        }
        this._Toggle_0_3.checkHost(this, this.compView_0, this._el_0, throwOnChange);
        this.compView_0.detectChanges(throwOnChange);
    };
    View_Toggle_Host0.prototype.destroyInternal = function () {
        this.compView_0.destroy();
        this._Toggle_0_3.ngOnDestroy();
    };
    View_Toggle_Host0.prototype.visitRootNodesInternal = function (cb, ctx) {
        cb(this._el_0, ctx);
    };
    View_Toggle_Host0.prototype.handleEvent_0 = function (eventName, $event) {
        this.compView_0.markPathToRootAsCheckOnce();
        var result = true;
        result = (this._Toggle_0_3.handleEvent(eventName, $event) && result);
        return result;
    };
    return View_Toggle_Host0;
}(import2.AppView));
export var ToggleNgFactory = new import7.ComponentFactory('ion-toggle', View_Toggle_Host0, import0.Toggle);
var styles_Toggle = [];
var renderType_Toggle = import3.createRenderComponentType('', 0, import5.ViewEncapsulation.None, styles_Toggle, {});
export var View_Toggle0 = (function (_super) {
    __extends(View_Toggle0, _super);
    function View_Toggle0(viewUtils, parentView, parentIndex, parentElement) {
        _super.call(this, View_Toggle0, renderType_Toggle, import6.ViewType.COMPONENT, viewUtils, parentView, parentIndex, parentElement, import1.ChangeDetectorStatus.CheckAlways);
        this._expr_5 = import1.UNINITIALIZED;
        this._expr_6 = import1.UNINITIALIZED;
        this._expr_7 = import1.UNINITIALIZED;
        this._expr_8 = import1.UNINITIALIZED;
        this._expr_9 = import1.UNINITIALIZED;
        this._expr_10 = import1.UNINITIALIZED;
    }
    View_Toggle0.prototype.createInternal = function (rootSelector) {
        var parentRenderNode = this.renderer.createViewRoot(this.parentElement);
        this._el_0 = import3.createRenderElement(this.renderer, parentRenderNode, 'div', new import3.InlineArray2(2, 'class', 'toggle-icon'), null);
        this._el_1 = import3.createRenderElement(this.renderer, this._el_0, 'div', new import3.InlineArray2(2, 'class', 'toggle-inner'), null);
        this._el_2 = import3.createRenderElement(this.renderer, parentRenderNode, 'button', new import3.InlineArray8(8, 'class', 'item-cover', 'ion-button', 'item-cover', 'role', 'checkbox', 'type', 'button'), null);
        this.compView_2 = new import17.View_Button0(this.viewUtils, this, 2, this._el_2);
        this._Button_2_3 = new import17.Wrapper_Button('item-cover', this.parentView.injectorGet(import9.Config, this.parentIndex), new import10.ElementRef(this._el_2), this.renderer);
        this.compView_2.create(this._Button_2_3.context);
        this.init(null, (this.renderer.directRenderer ? null : [
            this._el_0,
            this._el_1,
            this._el_2
        ]), null);
        return null;
    };
    View_Toggle0.prototype.injectorGetInternal = function (token, requestNodeIndex, notFoundResult) {
        if (((token === import16.Button) && (2 === requestNodeIndex))) {
            return this._Button_2_3.context;
        }
        return notFoundResult;
    };
    View_Toggle0.prototype.detectChangesInternal = function (throwOnChange) {
        if (this._Button_2_3.ngDoCheck(this, this._el_2, throwOnChange)) {
            this.compView_2.markAsCheckOnce();
        }
        if (!throwOnChange) {
            if ((this.numberOfChecks === 0)) {
                this._Button_2_3.context.ngAfterContentInit();
            }
        }
        var currVal_5 = this.context._checked;
        if (import3.checkBinding(throwOnChange, this._expr_5, currVal_5)) {
            this.renderer.setElementClass(this._el_0, 'toggle-checked', currVal_5);
            this._expr_5 = currVal_5;
        }
        var currVal_6 = this.context._activated;
        if (import3.checkBinding(throwOnChange, this._expr_6, currVal_6)) {
            this.renderer.setElementClass(this._el_0, 'toggle-activated', currVal_6);
            this._expr_6 = currVal_6;
        }
        var currVal_7 = this.context.id;
        if (import3.checkBinding(throwOnChange, this._expr_7, currVal_7)) {
            this.renderer.setElementProperty(this._el_2, 'id', currVal_7);
            this._expr_7 = currVal_7;
        }
        var currVal_8 = this.context._checked;
        if (import3.checkBinding(throwOnChange, this._expr_8, currVal_8)) {
            this.renderer.setElementAttribute(this._el_2, 'aria-checked', ((currVal_8 == null) ? null : currVal_8.toString()));
            this._expr_8 = currVal_8;
        }
        var currVal_9 = this.context._labelId;
        if (import3.checkBinding(throwOnChange, this._expr_9, currVal_9)) {
            this.renderer.setElementAttribute(this._el_2, 'aria-labelledby', ((currVal_9 == null) ? null : currVal_9.toString()));
            this._expr_9 = currVal_9;
        }
        var currVal_10 = this.context._disabled;
        if (import3.checkBinding(throwOnChange, this._expr_10, currVal_10)) {
            this.renderer.setElementAttribute(this._el_2, 'aria-disabled', ((currVal_10 == null) ? null : currVal_10.toString()));
            this._expr_10 = currVal_10;
        }
        this.compView_2.detectChanges(throwOnChange);
    };
    View_Toggle0.prototype.destroyInternal = function () {
        this.compView_2.destroy();
    };
    View_Toggle0.prototype.visitProjectableNodesInternal = function (nodeIndex, ngContentIndex, cb, ctx) {
        if (((nodeIndex == 2) && (ngContentIndex == 0))) { }
    };
    return View_Toggle0;
}(import2.AppView));
//# sourceMappingURL=toggle.ngfactory.js.map