/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Component, Input, HostBinding, Output, EventEmitter, HostListener, ElementRef } from '@angular/core';
import { SegmentService } from '../segment/segment.service';
var SegmentButtonComponent = /** @class */ (function () {
    function SegmentButtonComponent(elementRef, segmentService) {
        this.elementRef = elementRef;
        this.segmentService = segmentService;
        this.value = '';
        this.checked = new EventEmitter();
    }
    Object.defineProperty(SegmentButtonComponent.prototype, "disabled", {
        get: /**
         * @return {?}
         */
        function () {
            var /** @type {?} */ isDisabled = (/** @type {?} */ (this)).hasOwnProperty('_disabled');
            return isDisabled && this._disabled !== false;
        },
        set: /**
         * @param {?} isDisabled
         * @return {?}
         */
        function (isDisabled) {
            this._disabled = isDisabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SegmentButtonComponent.prototype, "selected", {
        get: /**
         * @return {?}
         */
        function () {
            var /** @type {?} */ isSelected = (/** @type {?} */ (this)).hasOwnProperty('_selected');
            return isSelected && this._selected !== false;
        },
        set: /**
         * @param {?} isSelected
         * @return {?}
         */
        function (isSelected) {
            this._selected = isSelected;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    SegmentButtonComponent.prototype.click = /**
     * @return {?}
     */
    function () {
        if (!this.disabled) {
            this.segmentService.checked(this);
            this.checked.emit(this);
        }
    };
    /**
     * @return {?}
     */
    SegmentButtonComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        this.nativeElement = this.elementRef.nativeElement;
    };
    SegmentButtonComponent.decorators = [
        { type: Component, args: [{
                    selector: 'ui-segment-button',
                    template: "<ng-content></ng-content>"
                },] },
    ];
    /** @nocollapse */
    SegmentButtonComponent.ctorParameters = function () { return [
        { type: ElementRef, },
        { type: SegmentService, },
    ]; };
    SegmentButtonComponent.propDecorators = {
        "value": [{ type: Input },],
        "disabled": [{ type: Input }, { type: HostBinding, args: ['class.ui-disabled',] },],
        "selected": [{ type: Input }, { type: HostBinding, args: ['class.ui-selected',] },],
        "checked": [{ type: Output },],
        "click": [{ type: HostListener, args: ['click',] },],
    };
    return SegmentButtonComponent;
}());
export { SegmentButtonComponent };
function SegmentButtonComponent_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    SegmentButtonComponent.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    SegmentButtonComponent.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    SegmentButtonComponent.propDecorators;
    /** @type {?} */
    SegmentButtonComponent.prototype.value;
    /** @type {?} */
    SegmentButtonComponent.prototype.checked;
    /** @type {?} */
    SegmentButtonComponent.prototype.nativeElement;
    /** @type {?} */
    SegmentButtonComponent.prototype._disabled;
    /** @type {?} */
    SegmentButtonComponent.prototype._selected;
    /** @type {?} */
    SegmentButtonComponent.prototype.elementRef;
    /** @type {?} */
    SegmentButtonComponent.prototype.segmentService;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VnbWVudC1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRhbmJvL3VpLW5hdGl2ZS8iLCJzb3VyY2VzIjpbImxpYi9zZWdtZW50L3NlZ21lbnQtYnV0dG9uL3NlZ21lbnQtYnV0dG9uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUNMLFNBQVMsRUFFVCxLQUFLLEVBQ0wsV0FBVyxFQUNYLE1BQU0sRUFDTixZQUFZLEVBQ1osWUFBWSxFQUNaLFVBQVUsRUFDWCxNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sNEJBQTRCLENBQUM7O0lBdUMxRCxnQ0FBb0IsVUFBc0IsRUFDdEI7UUFEQSxl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