import { Directive, TemplateRef, EventEmitter, Component, ChangeDetectionStrategy, ChangeDetectorRef, Inject, Optional, ViewChild, Input, ContentChild, Output, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Validators, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { __classPrivateFieldSet, __classPrivateFieldGet, __awaiter } from 'tslib';
import { debounceTime, switchMap, map, catchError, finalize, startWith } from 'rxjs/operators';
import { v4 } from 'uuid';
import hash from 'object-hash';
import { BehaviorSubject, Subscription, combineLatest, defer, from, of } from 'rxjs';
import { MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
import { SdFormControl, FORM_CONFIG, SdLabelDefDirective, SdViewDefDirective, SdCommonModule } from '@sd-angular/core/common';
import { MatIconModule } from '@angular/material/icon';
import { SdTranslateModule } from '@sd-angular/core/translate';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { SdPopoverModule } from '@sd-angular/core/popover';

class SdAutocompleteDisplayDefDirective {
    constructor(templateRef) {
        this.templateRef = templateRef;
    }
}
SdAutocompleteDisplayDefDirective.decorators = [
    { type: Directive, args: [{
                selector: '[sdAutocompleteDisplayDef]'
            },] }
];
SdAutocompleteDisplayDefDirective.ctorParameters = () => [
    { type: TemplateRef }
];

var _model, _delay, _name, _form, _itemsChanges, _validator, _subscription, _selectedItem, _cache, _item, _updateValidator, _customValidator, _getCopyText;
class SdAutocompleteErrotStateMatcher {
    constructor(formControl) {
        this.formControl = formControl;
    }
    isErrorState(control, form) {
        var _a, _b, _c;
        const isSubmitted = form && form.submitted;
        return !!(((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.invalid) && (((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.dirty) || ((_c = this.formControl) === null || _c === void 0 ? void 0 : _c.touched) || isSubmitted));
    }
}
class SdAutocomplete {
    constructor(ref, formConfig) {
        this.ref = ref;
        this.formConfig = formConfig;
        this.id = `I${v4()}`;
        _model.set(this, void 0);
        _delay.set(this, 0); // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm
        _name.set(this, v4());
        this.loading = false;
        this.inputControl = new SdFormControl();
        this.formControl = new SdFormControl();
        this.matcher = new SdAutocompleteErrotStateMatcher(this.formControl);
        _form.set(this, void 0);
        _itemsChanges.set(this, new BehaviorSubject([]));
        this.limit = 100;
        this.hiddenAdd = false;
        this.action = new EventEmitter();
        this.modelChange = new EventEmitter();
        this.sdChange = new EventEmitter();
        this.sdAdd = new EventEmitter();
        this.isRequired = false;
        _validator.set(this, void 0);
        this.disableErrorMessage = false;
        _subscription.set(this, new Subscription());
        this.isFocused = false;
        _selectedItem.set(this, void 0);
        _cache.set(this, {});
        _item.set(this, {});
        this.isTyping = false;
        this.copyable = false;
        this.copied = false;
        this.onSelect = (item) => {
            if (item) {
                __classPrivateFieldSet(this, _selectedItem, item);
                if (typeof (item) === 'string' || typeof (item) === 'number') {
                    if (this.formControl.value !== item) {
                        this.formControl.setValue(item);
                        this.modelChange.emit(item);
                        this.sdChange.emit(item);
                    }
                }
                else if (this.valueField && this.displayField) {
                    const val = (item === null || item === void 0 ? void 0 : item[this.valueField]) || null;
                    if (this.formControl.value !== val) {
                        this.formControl.setValue(val);
                        this.modelChange.emit(val);
                        this.sdChange.emit(item);
                    }
                }
                this.inputControl.setValue('', {
                    emitEvent: false
                });
            }
        };
        this.onFocus = () => {
            this.isFocused = true;
            this.inputControl.setValue('');
            // this.inputControl.updateValueAndValidity();
        };
        this.onBlur = () => {
            this.isFocused = false;
            this.inputControl.setValue('', {
                emitEvent: false
            });
        };
        this.onClick = () => {
            var _a;
            if ((_a = this.sdView) === null || _a === void 0 ? void 0 : _a.templateRef) {
                if (!this.formControl.disabled && !this.isFocused) {
                    this.focus();
                }
            }
        };
        this.blur = () => {
            var _a, _b;
            (_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.blur();
        };
        this.focus = () => {
            this.isFocused = true;
            setTimeout(() => {
                var _a, _b, _c;
                (_a = this.autocompleteTrigger) === null || _a === void 0 ? void 0 : _a.openPanel();
                (_c = (_b = this.input) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.focus();
            }, 100);
        };
        this.clear = ($event) => {
            var _a;
            $event === null || $event === void 0 ? void 0 : $event.stopPropagation();
            (_a = this.inputControl) === null || _a === void 0 ? void 0 : _a.setValue('');
            if (__classPrivateFieldGet(this, _model)) {
                this.formControl.setValue(null);
                this.modelChange.emit(null);
                this.sdChange.emit(null);
            }
        };
        this.onAction = ($event) => {
            var _a;
            $event === null || $event === void 0 ? void 0 : $event.stopPropagation();
            (_a = this.autocompleteTrigger) === null || _a === void 0 ? void 0 : _a.closePanel();
            this.action.emit();
        };
        this.onAdd = ($event) => {
            $event.stopPropagation();
            $event === null || $event === void 0 ? void 0 : $event.preventDefault();
            this.sdAdd.emit();
        };
        this.reValidate = () => {
            this.inputControl.updateValueAndValidity({ emitEvent: true });
        };
        _updateValidator.set(this, () => {
            this.formControl.clearValidators();
            this.formControl.clearAsyncValidators();
            const validators = [];
            const asyncValidators = [];
            // const asyncValidators: AsyncValidatorFn[] = [];
            if (this.isRequired) {
                validators.push(Validators.required);
            }
            if (__classPrivateFieldGet(this, _validator)) {
                asyncValidators.push(__classPrivateFieldGet(this, _customValidator).call(this, __classPrivateFieldGet(this, _validator)));
            }
            this.formControl.setValidators(validators);
            this.formControl.setAsyncValidators(asyncValidators);
            this.formControl.updateValueAndValidity();
        });
        _customValidator.set(this, (func) => {
            return (c) => __awaiter(this, void 0, void 0, function* () {
                const value = c.value || null;
                if (func && typeof (func) === 'function') {
                    const result = func(value, __classPrivateFieldGet(this, _selectedItem));
                    if (result instanceof Promise) {
                        const message = yield result;
                        if (message) {
                            return {
                                customValidator: message
                            };
                        }
                        return null;
                    }
                    if (result) {
                        return {
                            customValidator: result
                        };
                    }
                    return null;
                }
                return null;
            });
        });
        this.onCopyText = (event) => {
            event === null || event === void 0 ? void 0 : event.stopPropagation();
            const text = __classPrivateFieldGet(this, _getCopyText).call(this);
            SdUtility.copyToClipboard(text);
            this.copied = true;
            setTimeout(() => {
                this.copied = false;
                this.ref.markForCheck();
            }, 2000);
        };
        _getCopyText.set(this, () => {
            var _a;
            const value = this.formControl.value;
            let text = (_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : '';
            if (typeof this.copyText === 'function') {
                text = this.copyText(value, __classPrivateFieldGet(this, _selectedItem));
            }
            else if (this.copyText) {
                text = this.copyText;
            }
            return text;
        });
    }
    set name(val) {
        if (val) {
            __classPrivateFieldSet(this, _name, val);
        }
    }
    set form(val) {
        if (val) {
            if (val instanceof NgForm) {
                __classPrivateFieldSet(this, _form, val.form);
            }
            else {
                __classPrivateFieldSet(this, _form, val);
            }
        }
    }
    set _label(val) {
        this.label = val;
        this.qcId = hash({
            selector: 'sd-autocomplete',
            label: val
        });
    }
    ;
    set items(items) {
        if (!items) {
            __classPrivateFieldGet(this, _itemsChanges).next([]);
        }
        else if (Array.isArray(items)) {
            __classPrivateFieldGet(this, _itemsChanges).next(items.filter(e => e !== null && e !== undefined));
        }
        else {
            __classPrivateFieldGet(this, _itemsChanges).next(items);
            __classPrivateFieldSet(this, _delay, 500);
        }
        this.formControl.updateValueAndValidity();
    }
    set model(value) {
        if (__classPrivateFieldGet(this, _model) !== value) {
            __classPrivateFieldSet(this, _model, value);
            this.formControl.setValue(value);
        }
    }
    // Optional
    set disabled(val) {
        val = (val === '') || val;
        if (val) {
            this.inputControl.disable();
            this.formControl.disable();
        }
        else {
            this.inputControl.enable();
            this.formControl.enable();
        }
    }
    set required(val) {
        this.isRequired = (val === '') || val;
        __classPrivateFieldGet(this, _updateValidator).call(this);
    }
    set validator(validator) {
        __classPrivateFieldSet(this, _validator, validator);
        __classPrivateFieldGet(this, _updateValidator).call(this);
    }
    set _disableErrorMessage(val) {
        this.disableErrorMessage = (val === '') || val;
        val = (val === '') || val;
    }
    set _copyable(val) {
        this.copyable = (val === '') || val;
    }
    ngOnInit() {
        var _a;
        this.appearance = this.appearance || ((_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.appearance);
        __classPrivateFieldGet(this, _subscription).add(this.inputControl.touchChanges.subscribe(() => {
            this.formControl.markAsTouched();
            this.ref.markForCheck();
        }));
        __classPrivateFieldGet(this, _subscription).add(this.formControl.sdChanges.subscribe(() => {
            this.ref.markForCheck();
        }));
        __classPrivateFieldGet(this, _subscription).add(this.inputControl.sdChanges.subscribe(() => {
            this.ref.markForCheck();
        }));
        __classPrivateFieldGet(this, _subscription).add(this.inputControl.valueChanges.subscribe(() => {
            this.isTyping = true;
        }));
        this.filteredItems = combineLatest([
            __classPrivateFieldGet(this, _itemsChanges).asObservable(),
            this.inputControl.valueChanges.pipe(debounceTime(__classPrivateFieldGet(this, _delay)))
        ]).pipe(switchMap(([items, searchText]) => {
            var _a;
            this.isTyping = false;
            searchText = searchText || '';
            if (typeof (items) !== 'function') {
                return items
                    .search(searchText, [this.valueField, this.displayField])
                    .paging(this.limit)
                    .asObservable();
            }
            const key = hash({
                checksum: this.cacheChecksum || null,
                searchText
            });
            if (__classPrivateFieldGet(this, _cache)[key] !== undefined) {
                if (!((_a = __classPrivateFieldGet(this, _cache)[key]) === null || _a === void 0 ? void 0 : _a.length)) {
                    this.isTyping = true;
                }
                return __classPrivateFieldGet(this, _cache)[key].asObservable();
            }
            let obs;
            const func = items(searchText, false);
            if (func instanceof Promise) {
                obs = defer(() => from(func));
            }
            else {
                obs = func;
            }
            this.loading = true;
            this.ref.markForCheck();
            return obs.pipe(map(data => {
                __classPrivateFieldGet(this, _cache)[key] = data || [];
                Object.assign(__classPrivateFieldGet(this, _item), Array.toObject(__classPrivateFieldGet(this, _cache)[key], this.valueField));
                return __classPrivateFieldGet(this, _cache)[key];
            }), catchError(() => of([])), finalize(() => {
                this.loading = false;
                this.ref.markForCheck();
            }));
        }));
        this.selected = combineLatest([
            __classPrivateFieldGet(this, _itemsChanges).asObservable(),
            this.formControl.valueChanges.pipe(startWith(this.formControl.value))
        ])
            .pipe(switchMap(([items]) => {
            // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null
            // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;
            const val = this.formControl.value;
            if (!this.valueField) {
                return of(val);
            }
            if (val || val === 0) {
                if (typeof (items) === 'function') {
                    if (__classPrivateFieldGet(this, _item)[val]) {
                        return of(__classPrivateFieldGet(this, _item)[val]);
                    }
                    let obs;
                    const func = items(val, true);
                    if (func instanceof Promise) {
                        obs = defer(() => from(func));
                    }
                    else {
                        obs = func;
                    }
                    return obs.pipe(map(data => {
                        Object.assign(__classPrivateFieldGet(this, _item), Array.toObject(data, this.valueField));
                        return __classPrivateFieldGet(this, _item)[val] || {
                            [this.valueField]: val,
                            [this.displayField]: val
                        };
                    }), catchError(() => {
                        return of({
                            [this.valueField]: val,
                            [this.displayField]: val
                        });
                    }), finalize(() => {
                        this.loading = false;
                        this.ref.markForCheck();
                    }));
                }
                return of(items.find(e => e[this.valueField] === val));
            }
            return of('');
        }));
        this.controlPlaceHolder = this.selected.pipe(map(item => {
            var _a, _b, _c;
            __classPrivateFieldSet(this, _selectedItem, item);
            return (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item[this.displayField]) !== null && _a !== void 0 ? _a : item) !== null && _b !== void 0 ? _b : this.placeholder) !== null && _c !== void 0 ? _c : (this.appearance ? this.label : '');
        }));
    }
    ngAfterViewInit() {
        var _a;
        (_a = __classPrivateFieldGet(this, _form)) === null || _a === void 0 ? void 0 : _a.addControl(__classPrivateFieldGet(this, _name), this.formControl);
    }
    ngOnDestroy() {
        var _a;
        __classPrivateFieldGet(this, _subscription).unsubscribe();
        (_a = __classPrivateFieldGet(this, _form)) === null || _a === void 0 ? void 0 : _a.removeControl(__classPrivateFieldGet(this, _name));
    }
}
_model = new WeakMap(), _delay = new WeakMap(), _name = new WeakMap(), _form = new WeakMap(), _itemsChanges = new WeakMap(), _validator = new WeakMap(), _subscription = new WeakMap(), _selectedItem = new WeakMap(), _cache = new WeakMap(), _item = new WeakMap(), _updateValidator = new WeakMap(), _customValidator = new WeakMap(), _getCopyText = new WeakMap();
SdAutocomplete.decorators = [
    { type: Component, args: [{
                selector: 'sd-autocomplete',
                template: "<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\">{{label}} <span\r\n    class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label>\r\n<ng-container *ngIf=\"sdLabelDef?.templateRef\" matSuffix>\r\n  <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n  </ng-container>\r\n</ng-container>\r\n<div class=\"d-flex align-items-center\" [class.sd-view]=\"sdView?.templateRef\" [class.c-focused]=\"isFocused\"\r\n  [class.c-disabled]=\"formControl.disabled\" (click)=\"onClick()\">\r\n  <ng-container *ngIf=\"sdView?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused; else default\">\r\n    <ng-container\r\n      *ngTemplateOutlet=\"sdView.templateRef;context: { value: formControl.value, selectedItem: selected | async }\">\r\n    </ng-container>\r\n  </ng-container>\r\n  <ng-template #default>\r\n    <mat-form-field class=\"sd-md\" [ngClass]=\"{'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage}\"\r\n      [floatLabel]=\"size === 'sm' || formControl.value ? 'always':'auto'\" [appearance]=\"appearance || 'outline'\">\r\n      <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n      <input aria-hidden=\"true\" [id]=\"id\" #autocompleteTrigger [formControl]=\"inputControl\" [placeholder]=\"controlPlaceHolder | async\"\r\n        [ngClass]=\"{'c-selected': formControl?.value}\" [matAutocomplete]=\"auto\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\r\n        matInput [autocomplete]=\"id\" autocorrect=\"off\" [errorStateMatcher]=\"matcher\" [required]=\"isRequired\"\r\n        [attr.data-qclabel]=\"label\" [attr.data-qcid]=\"qcId\" [sdPopoverTriggerFor]=\"null\"\r\n        [sdPopoverDisabled]=\"!disableErrorMessage || formControl.valid\" #input />\r\n      <mat-icon *ngIf=\"!loading && formControl?.value && !inputControl.disabled\" class=\"pointer sd-suffix-icon\"\r\n        (click)=\"clear($event)\" matSuffix>cancel\r\n      </mat-icon>\r\n      <mat-icon *ngIf=\"actionIcon && !loading && !formControl?.value && !inputControl.disabled\"\r\n        class=\"pointer sd-suffix-icon\" (click)=\"onAction($event)\" matSuffix>{{actionIcon}}\r\n      </mat-icon>\r\n      <svg \r\n        #copyTooltip=\"matTooltip\" \r\n        *ngIf=\"!loading && formControl?.value && copyable\" \r\n        matSuffix \r\n        [matTooltip]=\"copied ? 'Copied' : 'Copy'\" \r\n        class=\"icon-copy\" \r\n        focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" \r\n        (click)=\"onCopyText($event)\">\r\n        <path d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"></path>\r\n      </svg>\r\n      <i [ngClass]=\"{'d-none': !loading}\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i>\r\n      <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\">\r\n        <ng-container *ngIf=\"filteredItems | async as items\">\r\n          <ng-container *ngIf=\"items.length\">\r\n            <mat-option *ngFor=\"let item of items\" [value]=\"item\" matTooltipPosition=\"above\"\r\n              [matTooltip]=\"displayField ? item[displayField] : item\">\r\n              <ng-container *ngIf=\"autocompleteDisplayDef?.templateRef\">\r\n                <ng-container *ngTemplateOutlet=\"autocompleteDisplayDef.templateRef;context:{item: item}\">\r\n                </ng-container>\r\n              </ng-container>\r\n              <ng-container *ngIf=\"!autocompleteDisplayDef?.templateRef\">\r\n                {{ displayField ? item[displayField] : item }}\r\n              </ng-container>\r\n            </mat-option>\r\n          </ng-container>\r\n          <mat-option *ngIf=\"!items.length && inputControl.value && !isTyping && !loading\" [value]=\"\"\r\n            class=\"T14R text-grey\">\r\n            Kh\u00F4ng c\u00F3 d\u1EEF li\u1EC7u\r\n          </mat-option>\r\n          <mat-option class=\"sd__option--add\" *ngIf=\"!hiddenAdd && sdAdd?.observers?.length\"\r\n            (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n            <div (click)=\"onAdd($event)\">\r\n              <mat-icon class=\"mr-1\">add</mat-icon>\r\n              {{'New item' | sdTranslate}}\r\n            </div>\r\n          </mat-option>\r\n        </ng-container>\r\n      </mat-autocomplete>\r\n      <mat-error *ngIf=\"formControl?.errors?.required\">\r\n        <ng-container *ngIf=\"!disableErrorMessage\">{{ \"This field is required\" | sdTranslate }}</ng-container>\r\n      </mat-error>\r\n      <mat-error *ngIf=\"formControl.errors?.customValidator\">\r\n        <ng-container *ngIf=\"!disableErrorMessage\">{{formControl.errors?.customValidator}}</ng-container>\r\n      </mat-error>\r\n    </mat-form-field>\r\n  </ng-template>\r\n</div>\r\n<!-- <sd-popover #error=\"sdPopover\" type=\"danger\" width=\"300px\">\r\n  <span *ngIf=\"formControl.errors?.required\">\r\n    {{ \"This field is required\" | sdTranslate }}\r\n  </span>\r\n</sd-popover> -->",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field input.c-selected::-moz-placeholder{color:#000;opacity:1}:host ::ng-deep .mat-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-form-field input.mat-input-element:disabled{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::-moz-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected:-ms-input-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::-ms-input-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{background-color:#fff;bottom:0;color:rgba(0,0,0,.87);cursor:pointer!important;position:-webkit-sticky;position:sticky;z-index:10}.c-loading-icon{position:absolute;right:5px;top:5px}"]
            },] }
];
SdAutocomplete.ctorParameters = () => [
    { type: ChangeDetectorRef },
    { type: undefined, decorators: [{ type: Inject, args: [FORM_CONFIG,] }, { type: Optional }] }
];
SdAutocomplete.propDecorators = {
    autocompleteTrigger: [{ type: ViewChild, args: [MatAutocompleteTrigger, { read: MatAutocompleteTrigger },] }],
    name: [{ type: Input }],
    appearance: [{ type: Input }],
    size: [{ type: Input }],
    form: [{ type: Input }],
    _label: [{ type: Input, args: ['label',] }],
    valueField: [{ type: Input }],
    displayField: [{ type: Input }],
    placeholder: [{ type: Input }],
    items: [{ type: Input }],
    limit: [{ type: Input }],
    cacheChecksum: [{ type: Input }],
    model: [{ type: Input }],
    hiddenAdd: [{ type: Input }],
    autocompleteDisplayDef: [{ type: ContentChild, args: [SdAutocompleteDisplayDefDirective,] }],
    sdLabelDef: [{ type: ContentChild, args: [SdLabelDefDirective,] }],
    actionIcon: [{ type: Input }],
    action: [{ type: Output }],
    modelChange: [{ type: Output }],
    sdChange: [{ type: Output }],
    sdAdd: [{ type: Output }],
    disabled: [{ type: Input }],
    required: [{ type: Input }],
    validator: [{ type: Input }],
    _disableErrorMessage: [{ type: Input, args: ['disableErrorMessage',] }],
    input: [{ type: ViewChild, args: ['input',] }],
    sdView: [{ type: ContentChild, args: [SdViewDefDirective,] }],
    copyTooltip: [{ type: ViewChild, args: ['copyTooltip',] }],
    _copyable: [{ type: Input, args: ['copyable',] }],
    copyText: [{ type: Input }]
};

class SdAutocompleteModule {
}
SdAutocompleteModule.decorators = [
    { type: NgModule, args: [{
                imports: [
                    CommonModule,
                    FormsModule,
                    ReactiveFormsModule,
                    MatInputModule,
                    MatTooltipModule,
                    MatFormFieldModule,
                    MatAutocompleteModule,
                    MatIconModule,
                    MatProgressSpinnerModule,
                    SdTranslateModule,
                    SdCommonModule,
                    SdPopoverModule
                ],
                declarations: [
                    SdAutocomplete,
                    SdAutocompleteDisplayDefDirective
                ],
                exports: [
                    SdAutocomplete,
                    SdAutocompleteDisplayDefDirective,
                    SdCommonModule
                ],
                providers: []
            },] }
];

/*
 * Public API Surface of superdev-angular-core
 */

/**
 * Generated bundle index. Do not edit.
 */

export { SdAutocomplete, SdAutocompleteDisplayDefDirective, SdAutocompleteModule };
//# sourceMappingURL=sd-angular-core-autocomplete.js.map
