import { Injectable, ɵɵdefineInjectable, EventEmitter, Component, Input, ViewChild, Output, Pipe, NgModule } from '@angular/core';
import { __decorate, __metadata } from 'tslib';
import { GeoJSON, FeatureGroup, TileLayer, Map, LatLng, Control } from 'leaflet';
import { faShareSquare, faEye, faEyeSlash, faSearch, faMapPin, faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
import { CommonModule } from '@angular/common';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { FormsModule } from '@angular/forms';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatFormFieldModule } from '@angular/material/form-field';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

/**
 * @fileoverview added by tsickle
 * Generated from: lib/dependencs/AgromaxCamada.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @template T
 */
class AgromaxCamada {
    /**
     * @param {?} color
     * @param {?} featureGroup
     * @param {?} name
     * @param {?} map
     */
    constructor(color, featureGroup, name, map) {
        this.color = color;
        this.name = name;
        this.map = map;
        this.isEnable = false;
        this.featureGroup = featureGroup;
    }
    /**
     * @param {?} v
     * @return {?}
     */
    set featureGroup(v) {
        if (this._featureGroup) {
            this.disable();
        }
        this._featureGroup = v;
        this.enable();
    }
    /**
     * @return {?}
     */
    get featureGroup() {
        return this._featureGroup;
    }
    /**
     * @return {?}
     */
    disable() {
        this._featureGroup.removeFrom(this.map);
        this.isEnable = false;
    }
    /**
     * @return {?}
     */
    enable() {
        this._featureGroup.addTo(this.map);
        this.isEnable = true;
    }
    /**
     * @return {?}
     */
    zoom() {
        this.map.fitBounds(this._featureGroup.getBounds());
    }
}
if (false) {
    /**
     * @type {?}
     * @private
     */
    AgromaxCamada.prototype._featureGroup;
    /** @type {?} */
    AgromaxCamada.prototype.isEnable;
    /** @type {?} */
    AgromaxCamada.prototype.color;
    /** @type {?} */
    AgromaxCamada.prototype.name;
    /**
     * @type {?}
     * @private
     */
    AgromaxCamada.prototype.map;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/dependencs/getCamada.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @return {?}
 */
function getCamada() {
    return (/**
     * @param {?} target
     * @param {?} propertyKey
     * @param {?} descriptor
     * @return {?}
     */
    (target, propertyKey, descriptor) => {
        /** @type {?} */
        const originalMethod = descriptor.value;
        descriptor.value = (/**
         * @return {?}
         */
        function () {
            /** @type {?} */
            let args;
            /** @type {?} */
            const context = this;
            args = Array.from(arguments);
            if (!args[0]) {
                args[1] = this.grupoDeCamadas;
            }
            if (!args[1]) {
                args[1] = [this.getCamada(args[0])];
            }
            originalMethod.apply(context, args);
        });
        return descriptor;
    });
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/dependencs/AgromaxLeafletController.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
// @dynamic
/**
 * @template T
 */
class AgromaxLeafletController {
    /**
     * @param {?} map
     */
    constructor(map) {
        this.map = map;
        this.grupoDeCamadas = [];
    }
    /**
     * @return {?}
     */
    refreshMap() {
        try {
            // @ts-ignore
            ((/** @type {?} */ (this.map)))._onResize();
        }
        catch (error) {
            this.map.invalidateSize();
        }
    }
    /**
     * \@example
     * ```typescript
     * agromaxLeafletController.enableCamada() // enables all
     * agromaxLeafletController.enableCamada("argila") // enables camada argila
     * ```
     * @param {?=} camada
     * @param {?=} args
     * @return {?}
     */
    enableCamada(camada, args) {
        args.forEach((/**
         * @param {?} i
         * @return {?}
         */
        i => i.enable()));
    }
    /**
     * \@example
     * ```typescript
     * agromaxLeafletController.disableCamada() // disable all
     * agromaxLeafletController.disableCamada("argila") // disable camada argila
     * ```
     * @param {?=} camada
     * @param {?=} args
     * @return {?}
     */
    disableCamada(camada, args) {
        args.forEach((/**
         * @param {?} i
         * @return {?}
         */
        i => i.disable()));
    }
    /**
     * @param {?=} camada
     * @param {?=} args
     * @return {?}
     */
    zoonInCamada(camada, args) {
        args[0].zoom();
    }
    /**
     * @param {?} geojson
     * @param {?} name
     * @return {?}
     */
    addCamada(geojson, name) {
        if (this.getCamada(name)) {
            throw new Error('Nome Ja utilizado');
        }
        /** @type {?} */
        const baseColor = geojson.features[0].properties._color;
        /** @type {?} */
        const options = {
            color: baseColor,
            fillColor: baseColor,
            fillOpacity: 0.5,
            onEachFeature: null
        };
        if (geojson.features[0] && geojson.features[0].properties[name] && Number.isFinite(+(geojson.features[0].properties[name]))) {
            /** @type {?} */
            const maxValue = geojson.features.reduce((/**
             * @param {?} i
             * @param {?} k
             * @return {?}
             */
            (i, k) => {
                if (i.properties[name] > k.properties[name]) {
                    return i;
                }
                return k;
            })).properties[name];
            /** @type {?} */
            const minValue = geojson.features.reduce((/**
             * @param {?} i
             * @param {?} k
             * @return {?}
             */
            (i, k) => {
                if (i.properties[name] < k.properties[name]) {
                    return i;
                }
                return k;
            })).properties[name];
            options.onEachFeature = (/**
             * @param {?} feature
             * @param {?} layer
             * @return {?}
             */
            (feature, layer) => {
                /** @type {?} */
                const camadavalue = feature.properties[name];
                /** @type {?} */
                const color = this.getColor(baseColor, camadavalue, parseInt(minValue), parseInt(maxValue));
                layer.options.color = color;
                layer.options.fillColor = color;
                layer.bindPopup(`<p>Valor: ${(+camadavalue).toFixed(2)}</p>`);
            });
        }
        /** @type {?} */
        const layer = new GeoJSON(geojson, options);
        this.grupoDeCamadas.push(new AgromaxCamada(baseColor, new FeatureGroup([layer]), name, this.map));
    }
    /**
     * @private
     * @param {?} baseColor
     * @param {?} value
     * @param {?} min
     * @param {?} max
     * @return {?}
     */
    getColor(baseColor, value, min, max) {
        /** @type {?} */
        const totalPercent = -(((value - min) / (max - min)) * 100);
        return this.shadeColor(baseColor, totalPercent);
    }
    /**
     * @private
     * @param {?} color
     * @param {?} percent
     * @return {?}
     */
    shadeColor(color, percent) {
        /** @type {?} */
        let R = parseInt(color.substring(1, 3), 16);
        /** @type {?} */
        let G = parseInt(color.substring(3, 5), 16);
        /** @type {?} */
        let B = parseInt(color.substring(5, 7), 16);
        R = parseInt('' + (R * (100 + percent) / 100));
        G = parseInt('' + (G * (100 + percent) / 100));
        B = parseInt('' + (B * (100 + percent) / 100));
        R = (R < 255) ? R : 255;
        G = (G < 255) ? G : 255;
        B = (B < 255) ? B : 255;
        /** @type {?} */
        const RR = ((R.toString(16).length == 1) ? '0' + R.toString(16) : R.toString(16));
        /** @type {?} */
        const GG = ((G.toString(16).length == 1) ? '0' + G.toString(16) : G.toString(16));
        /** @type {?} */
        const BB = ((B.toString(16).length == 1) ? '0' + B.toString(16) : B.toString(16));
        return '#' + RR + GG + BB;
    }
    /**
     * @param {?} camadas
     * @return {?}
     */
    addCamadas(camadas) {
        /** @type {?} */
        const allNames = this.grupoDeCamadas.map((/**
         * @param {?} i
         * @return {?}
         */
        i => i.name));
        /** @type {?} */
        const equalNames = camadas.find((/**
         * @param {?} i
         * @return {?}
         */
        i => {
            !!allNames.find((/**
             * @param {?} k
             * @return {?}
             */
            k => k === i.name));
        }));
        if (!!equalNames) {
            throw new Error(`${equalNames} ja existe`);
        }
        camadas.forEach((/**
         * @param {?} i
         * @return {?}
         */
        i => {
            try {
                this.addCamada(i.geojson, i.name);
            }
            catch (e) {
                console.error(e);
            }
        }));
        return this.grupoDeCamadas;
    }
    /**
     * @param {?} name
     * @return {?}
     */
    getCamada(name) {
        /** @type {?} */
        const featureGroup = this.grupoDeCamadas.find((/**
         * @param {?} i
         * @return {?}
         */
        i => i.name === name));
        if (!featureGroup) {
            console.warn('Camada não encontrada');
        }
        return featureGroup;
    }
}
__decorate([
    getCamada(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Array]),
    __metadata("design:returntype", void 0)
], AgromaxLeafletController.prototype, "enableCamada", null);
__decorate([
    getCamada(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Array]),
    __metadata("design:returntype", void 0)
], AgromaxLeafletController.prototype, "disableCamada", null);
__decorate([
    getCamada(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Array]),
    __metadata("design:returntype", void 0)
], AgromaxLeafletController.prototype, "zoonInCamada", null);
if (false) {
    /** @type {?} */
    AgromaxLeafletController.prototype.grupoDeCamadas;
    /** @type {?} */
    AgromaxLeafletController.prototype.map;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/leaflet-map.constants.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/** @type {?} */
const UMD_VERSION = 2;
/** @type {?} */
const MAP_LINK = '<a href="https://www.esri.com/">Esri</a>';
/** @type {?} */
const WHO_LINK = 'i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community';
/** @type {?} */
const SATELITE = new TileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
    attribution: '&copy; ' + MAP_LINK + ', ' + WHO_LINK,
    subdomains: ['otile1', 'otile2', 'otile3', 'otile4']
});
/** @type {?} */
const STREET = new TileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a target="_blank" href="https://www.ciag.org.br">CIAg</a>'
});

/**
 * @fileoverview added by tsickle
 * Generated from: lib/leaflet-map.service.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class LeafletMapService {
    constructor() {
        this.defaultOptions = { center: [43.0, -79.0], zoom: 3, minZoom: 3, maxZoom: 17 };
    }
    /**
     * @template T
     * @param {?} divId
     * @param {?=} options
     * @return {?}
     */
    createMap(divId, options = {}) {
        /** @type {?} */
        const layersControl = {
            Satélite: SATELITE,
            Mapa: STREET
        };
        /** @type {?} */
        const map = new Map(divId, Object.assign({}, this.defaultOptions, { layers: [SATELITE] }));
        map.setView(new LatLng(-12.7553139, -44.4046542), 4);
        if (options.layersControl) {
            new Control.Layers(layersControl).addTo(map);
        }
        if (options.updateOnResize) {
            window.addEventListener('resize', (/**
             * @return {?}
             */
            () => {
                console.log('resize');
                map.invalidateSize();
            }));
        }
        return new AgromaxLeafletController(map);
    }
}
LeafletMapService.decorators = [
    { type: Injectable, args: [{
                providedIn: 'root'
            },] }
];
/** @nocollapse */
LeafletMapService.ctorParameters = () => [];
/** @nocollapse */ LeafletMapService.ngInjectableDef = ɵɵdefineInjectable({ factory: function LeafletMapService_Factory() { return new LeafletMapService(); }, token: LeafletMapService, providedIn: "root" });
if (false) {
    /** @type {?} */
    LeafletMapService.prototype.defaultOptions;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/AlertControllerComponent.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class AlertControllerComponent {
    constructor() {
        this._newError = new EventEmitter();
    }
    /**
     * @param {?} error
     * @return {?}
     */
    addError(error) {
        this._newError.emit(error);
        setTimeout((/**
         * @param {?} i
         * @return {?}
         */
        i => {
            this._newError.emit(null);
        }), 4000);
    }
    /**
     * @return {?}
     */
    ngOnInit() {
        this._newError.subscribe((/**
         * @param {?} i
         * @return {?}
         */
        i => {
            this.message = i;
        }));
    }
}
AlertControllerComponent.decorators = [
    { type: Component, args: [{
                selector: 'lib-leaflet-map-alert',
                template: `<div *ngIf="message" class="alert alert-danger alert-dismissible" role="alert">
              {{message}}
              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>`
            }] }
];
/** @nocollapse */
AlertControllerComponent.ctorParameters = () => [];
if (false) {
    /** @type {?} */
    AlertControllerComponent.prototype.message;
    /** @type {?} */
    AlertControllerComponent.prototype._newError;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/leaflet-map.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class LeafletMapComponent {
    /**
     * @param {?} leafletMapService
     */
    constructor(leafletMapService) {
        this.leafletMapService = leafletMapService;
        this.searchText = '';
        this.isCollapsed = true;
        this.geojson = [];
        this.shareIntent = new EventEmitter();
        this.icons = { faShareSquare, faEye, faEyeSlash, faSearch, faMapPin, faChevronLeft, faChevronRight };
        this.allCamadasEnable = true;
        this.featureCollection = [];
    }
    /**
     * @return {?}
     */
    ngAfterViewInit() {
        this.mapController = this.leafletMapService.createMap(this.divMap.nativeElement, { updateOnResize: true });
        if (this.geojson && this.geojson.length) {
            this.addGeoJsons(this.geojson);
        }
    }
    /**
     * @param {?} state
     * @return {?}
     */
    alterShowMenu(state) {
        this.showMenu = state;
        this.mapController.refreshMap();
    }
    /**
     * @param {?} geojson
     * @return {?}
     */
    addGeoJson(geojson) {
        this.featureCollection = this.mapController.addCamadas([geojson]);
    }
    /**
     * @param {?} geojson
     * @return {?}
     */
    addGeoJsons(geojson) {
        this.featureCollection = this.mapController.addCamadas(geojson);
    }
    /**
     * @private
     * @return {?}
     */
    checkAllCamadasEnable() {
        this.allCamadasEnable = !this.featureCollection.find((/**
         * @param {?} i
         * @return {?}
         */
        i => !i.isEnable));
    }
    /**
     * @param {?} event
     * @param {?} camada
     * @return {?}
     */
    updateCamadaStatus(event, camada) {
        /** @type {?} */
        const checked = event.checked;
        checked ? this.mapController.enableCamada(camada) : this.mapController.disableCamada(camada);
        this.checkAllCamadasEnable();
    }
    /**
     * @param {?} camada
     * @return {?}
     */
    selectCamada(camada) {
        this.mapController.zoonInCamada(camada);
    }
    /**
     * @return {?}
     */
    share() {
        /** @type {?} */
        const camadasEnabledInJson = this.featureCollection
            .filter((/**
         * @param {?} i
         * @return {?}
         */
        i => i.isEnable))
            .map((/**
         * @param {?} i
         * @return {?}
         */
        i => (/** @type {?} */ (i.featureGroup.toGeoJSON()))));
        if (!camadasEnabledInJson.length) {
            this.errorAlert.addError('nenhuma camada selecionada');
            console.error('nenhuma camada selecionada');
        }
        else {
            this.shareIntent.emit(camadasEnabledInJson);
        }
    }
    /**
     * @param {?} event
     * @return {?}
     */
    listCamadasChengeOrder(event) {
        moveItemInArray(this.featureCollection, event.previousIndex, event.currentIndex);
    }
}
LeafletMapComponent.decorators = [
    { type: Component, args: [{
                selector: 'lib-leaflet-map',
                template: "<link href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap\" rel=\"stylesheet\">\n<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n<lib-leaflet-map-alert #errorAlert></lib-leaflet-map-alert>\n<div class=\"conteiner h-100\">\n    <div class=\"mapDiv w-75\" [ngClass]=\"{'w-75':showMenu,'w-100':!showMenu}\">\n        <div #divMap>\n            <div *ngIf=\"canShowMenu && !showMenu\" class=\"btn-group float-right h-100 showMenu\" style=\"z-index: 1001\">\n                <button type=\"buttons\" id=\"others\" (click)=\"alterShowMenu(true)\"\n                    class=\"btn-showMenu btn-showMenu-show btn-warning\">\n                    <fa-icon [icon]=\"icons.faChevronLeft\"></fa-icon>\n                </button>\n            </div>\n        </div>\n    </div>\n    <div *ngIf=\"showMenu\" class=\"camadasDiv\">\n        <div class=\"card h-100\" style=\"width: 18rem;\">\n            <div class=\"card-header h-10 text-center\">\n                <button *ngIf=\"canShowMenu\" type=\"buttons\" id=\"others\" (click)=\"alterShowMenu(false)\"\n                    class=\"leaflet-control-layers-toggle btn-showMenu btn-showMenu btn-showMenu-hide\">\n                    <fa-icon [icon]=\"icons.faChevronRight\"></fa-icon>\n                </button>\n                <div>\n                    <div class=\"float-left\">\n                        <small id=\"emailHelp\" class=\"form-text text-muted\">\n                            <fa-icon [icon]=\"icons.faEye\"></fa-icon>\n                        </small>\n                        <mat-slide-toggle [checked]=\"allCamadasEnable\" (change)=\"updateCamadaStatus($event,null)\">\n                        </mat-slide-toggle>\n                    </div>\n                    <button type=\"button\" class=\"btn btn-outline\" (click)=\"isCollapsed = !isCollapsed\"\n                        [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"collapseExample\">\n                        <fa-icon [icon]=\"icons.faSearch\"></fa-icon>\n                    </button>Camadas\n                    <fa-icon class=\"float-right\" (click)=\"share()\" [icon]=\"icons.faShareSquare\"></fa-icon>\n                </div>\n                <div id=\"collapseExample\" [ngbCollapse]=\"isCollapsed\">\n                    <input [(ngModel)]=\"searchText\" #ctrl=\"ngModel\" class=\"form-control\" placeholder=\"Procurar...\">\n\n                </div>\n            </div>\n            <ul class=\"list-group listaCamadas h-100\" cdkDropList (cdkDropListDropped)=\"listCamadasChengeOrder($event)\">\n                <li *ngFor=\"let item of featureCollection | filter : searchText\" cdkDrag\n                    class=\"list-group-item list-group-item-action text-center\">\n                    <div class=\"itemSelect\">\n                        <div class=\"float-left\">\n                            <small id=\"emailHelp\" class=\"form-text text-muted\">\n                                <fa-icon *ngIf=\"!item.isEnable\" [icon]=\"icons.faEyeSlash\"></fa-icon>\n                            </small>\n                            <mat-slide-toggle id=\"{{this.id+''+item.name}}\" [checked]=\"item.isEnable\"\n                                (change)=\"updateCamadaStatus($event,item.name)\"></mat-slide-toggle>\n                        </div>\n                        <label class=\"form-check-label text-center\">{{item.name}}</label>\n                        <button class=\"btn btn-outline-warning float-right\" (click)=\"selectCamada(item.name)\">\n                            <fa-icon [icon]=\"icons.faMapPin\">\n                            </fa-icon>\n                        </button>\n                    </div>\n                    <div class=\"cardDivider\" [ngStyle]=\"{'background-color':item.color}\"></div>\n                </li>\n            </ul>\n        </div>\n    </div>",
                styles: ["body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.mapDiv div{height:100%}.container{max-width:unset}.col-3,.col-4,.col-8,.col-9{padding:0}.itemSelect{position:relative}.btn-showMenu{width:36px;height:36px;border-radius:5px 0 0 5px;border:unset}.btn-showMenu-show{margin-top:22vh;box-shadow:-3px 3px rgba(0,0,0,.288)}.btn-showMenu-hide{position:absolute;top:0;left:0;background:0 0}.listaCamadas{overflow:scroll}.conteiner{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center}lib-leaflet-map-alert{position:absolute;top:0;z-index:10000;width:100%}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb{background:#888}::-webkit-scrollbar-thumb:hover{background:#555}.cardDivider{height:1vh;width:100%;position:absolute;top:0;left:0}"]
            }] }
];
/** @nocollapse */
LeafletMapComponent.ctorParameters = () => [
    { type: LeafletMapService }
];
LeafletMapComponent.propDecorators = {
    geojson: [{ type: Input }],
    id: [{ type: Input }],
    canShowMenu: [{ type: Input }],
    showMenu: [{ type: Input }],
    divMap: [{ type: ViewChild, args: ['divMap', { static: false },] }],
    errorAlert: [{ type: ViewChild, args: ['errorAlert', { static: false },] }],
    shareIntent: [{ type: Output }]
};
if (false) {
    /** @type {?} */
    LeafletMapComponent.prototype.searchText;
    /** @type {?} */
    LeafletMapComponent.prototype.isCollapsed;
    /** @type {?} */
    LeafletMapComponent.prototype.geojson;
    /** @type {?} */
    LeafletMapComponent.prototype.id;
    /** @type {?} */
    LeafletMapComponent.prototype.canShowMenu;
    /** @type {?} */
    LeafletMapComponent.prototype.showMenu;
    /** @type {?} */
    LeafletMapComponent.prototype.divMap;
    /** @type {?} */
    LeafletMapComponent.prototype.errorAlert;
    /** @type {?} */
    LeafletMapComponent.prototype.shareIntent;
    /** @type {?} */
    LeafletMapComponent.prototype.icons;
    /** @type {?} */
    LeafletMapComponent.prototype.allCamadasEnable;
    /** @type {?} */
    LeafletMapComponent.prototype.mapController;
    /** @type {?} */
    LeafletMapComponent.prototype.featureCollection;
    /** @type {?} */
    LeafletMapComponent.prototype.leafletMapService;
}

/**
 * @fileoverview added by tsickle
 * Generated from: lib/leaflet-map-camadas-filert.pipe.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class LeafletMapCamadasFilterPipe {
    /**
     * @param {?} items
     * @param {?} searchText
     * @return {?}
     */
    transform(items, searchText) {
        if (!items)
            return [];
        if (!searchText)
            return items;
        searchText = searchText.toLowerCase();
        return items.filter((/**
         * @param {?} it
         * @return {?}
         */
        it => it.name.toLowerCase().includes(searchText)));
    }
}
LeafletMapCamadasFilterPipe.decorators = [
    { type: Pipe, args: [{
                name: 'filter'
            },] }
];

/**
 * @fileoverview added by tsickle
 * Generated from: lib/leaflet-map.module.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
class LeafletMapModule {
    constructor() { }
}
LeafletMapModule.decorators = [
    { type: NgModule, args: [{
                declarations: [LeafletMapComponent, AlertControllerComponent, LeafletMapCamadasFilterPipe],
                imports: [
                    NgbModule,
                    CommonModule,
                    FontAwesomeModule,
                    MatSlideToggleModule,
                    DragDropModule,
                    FormsModule,
                    MatExpansionModule,
                    MatFormFieldModule
                ],
                exports: [LeafletMapComponent, AlertControllerComponent]
            },] }
];
/** @nocollapse */
LeafletMapModule.ctorParameters = () => [];

/**
 * @fileoverview added by tsickle
 * Generated from: lib/dependencs/index.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * Generated from: public-api.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * Generated from: ciag-leaflet-map.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

export { AgromaxCamada, AgromaxLeafletController, AlertControllerComponent, LeafletMapCamadasFilterPipe, LeafletMapComponent, LeafletMapModule, LeafletMapService, getCamada };
//# sourceMappingURL=ciag-leaflet-map.js.map
