import { Component, EventEmitter, Input, Output } from '@angular/core';
import { TapConnectionStoreService } from '../tap-connection-store.service';
import * as i0 from "@angular/core";
import * as i1 from "../tap-connection-store.service";
import * as i2 from "@ionic/angular";
import * as i3 from "@angular/common";
export class TapConnectionStoreItemComponent {
    constructor(tapConnectionStoreService) {
        this.tapConnectionStoreService = tapConnectionStoreService;
        this.selected = new EventEmitter();
    }
    connect() {
        if (this.item) {
            this.selected.emit(this.item);
        }
    }
    remove() {
        if (this.item) {
            this.tapConnectionStoreService.remove(this.item);
        }
    }
}
/** @nocollapse */ /** @nocollapse */ TapConnectionStoreItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapConnectionStoreItemComponent, deps: [{ token: i1.TapConnectionStoreService }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ TapConnectionStoreItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TapConnectionStoreItemComponent, selector: "tap-connection-store-item", inputs: { item: "item" }, outputs: { selected: "selected" }, ngImport: i0, template: "<ion-card *ngIf=\"item\" (click)=\"connect()\">\n  <ion-list>\n    <ion-item>\n      <ion-badge>\n        {{ item.connection.type }}\n      </ion-badge>\n      &nbsp;\n      <span class=\"title\">{{ item.config.appName }}</span>\n      &nbsp;\n      <ion-button slot=\"end\" color=\"danger\" fill=\"clear\" (click)=\"remove()\">\n        <ion-icon name=\"close\"></ion-icon>\n        <!-- &nbsp; Remove -->\n      </ion-button>\n    </ion-item>\n    <!-- <ion-item\n\t\t\tclass=\"extra-info\">\n\t\t\t<ion-icon name=\"time\"></ion-icon>\n\t\t\t&nbsp;\n\t\t\t{{ item.meta.lastConnection | date }}\n\t\t</ion-item> -->\n    <!-- <ion-item class=\"extra-info\">\n\t\t\t<ion-icon name=\"information-circle\"></ion-icon>\n      &nbsp;\n      v{{ item.config.version }}\n\t\t</ion-item> -->\n    <ion-item class=\"extra-info\">\n      <ion-icon name=\"hardware-chip\"></ion-icon>\n      &nbsp;\n      <!-- <ion-label>Serial number</ion-label> -->\n      {{ item.config.serialNumber }}\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'mqtt'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.endpoint }}</span>\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'ble'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.mac }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"\n        item.connection.type === 'socket' ||\n        item.connection.type === 'websocket'\n      \"\n      class=\"extra-info\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.url }}</span>\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'wifi'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.ssid }}</span>\n    </ion-item>\n    <!-- <ion-item>\n\t\t\t\t\t<ion-buttons slot=\"end\">\n\t\t\t\t\t\n\t\t\t\t\t\t<ion-button slot=\"end\" color=\"primary\" fill=\"clear\" (click)=\"connect()\">\n\t\t\t\t\t\t\t<ion-icon name=\"log-in\"></ion-icon>\n\t\t\t\t\t\t\t&nbsp; Connect\n\t\t\t\t\t\t</ion-button>\n\t\t\t\t\t</ion-buttons>\n\t\t\t\t</ion-item> -->\n  </ion-list>\n</ion-card>\n", styles: [".config-version{font-size:.8em;opacity:.7}.extra-info{font-size:.95em;opacity:.7;padding-top:0;padding-bottom:0}.title{font-size:1.2em}ion-card{cursor:pointer}\n"], components: [{ type: i2.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i2.IonBadge, selector: "ion-badge", inputs: ["color", "mode"] }, { type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapConnectionStoreItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'tap-connection-store-item', template: "<ion-card *ngIf=\"item\" (click)=\"connect()\">\n  <ion-list>\n    <ion-item>\n      <ion-badge>\n        {{ item.connection.type }}\n      </ion-badge>\n      &nbsp;\n      <span class=\"title\">{{ item.config.appName }}</span>\n      &nbsp;\n      <ion-button slot=\"end\" color=\"danger\" fill=\"clear\" (click)=\"remove()\">\n        <ion-icon name=\"close\"></ion-icon>\n        <!-- &nbsp; Remove -->\n      </ion-button>\n    </ion-item>\n    <!-- <ion-item\n\t\t\tclass=\"extra-info\">\n\t\t\t<ion-icon name=\"time\"></ion-icon>\n\t\t\t&nbsp;\n\t\t\t{{ item.meta.lastConnection | date }}\n\t\t</ion-item> -->\n    <!-- <ion-item class=\"extra-info\">\n\t\t\t<ion-icon name=\"information-circle\"></ion-icon>\n      &nbsp;\n      v{{ item.config.version }}\n\t\t</ion-item> -->\n    <ion-item class=\"extra-info\">\n      <ion-icon name=\"hardware-chip\"></ion-icon>\n      &nbsp;\n      <!-- <ion-label>Serial number</ion-label> -->\n      {{ item.config.serialNumber }}\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'mqtt'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.endpoint }}</span>\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'ble'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.mac }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"\n        item.connection.type === 'socket' ||\n        item.connection.type === 'websocket'\n      \"\n      class=\"extra-info\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.url }}</span>\n    </ion-item>\n    <ion-item *ngIf=\"item.connection.type === 'wifi'\" class=\"extra-info\">\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.ssid }}</span>\n    </ion-item>\n    <!-- <ion-item>\n\t\t\t\t\t<ion-buttons slot=\"end\">\n\t\t\t\t\t\n\t\t\t\t\t\t<ion-button slot=\"end\" color=\"primary\" fill=\"clear\" (click)=\"connect()\">\n\t\t\t\t\t\t\t<ion-icon name=\"log-in\"></ion-icon>\n\t\t\t\t\t\t\t&nbsp; Connect\n\t\t\t\t\t\t</ion-button>\n\t\t\t\t\t</ion-buttons>\n\t\t\t\t</ion-item> -->\n  </ion-list>\n</ion-card>\n", styles: [".config-version{font-size:.8em;opacity:.7}.extra-info{font-size:.95em;opacity:.7;padding-top:0;padding-bottom:0}.title{font-size:1.2em}ion-card{cursor:pointer}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.TapConnectionStoreService }]; }, propDecorators: { item: [{
                type: Input
            }], selected: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 