<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div style="z-index: 1" [ngStyle]="{width: canvasWidth, height: canvasHeight}" #outerCanvas>
    <span id="{{pipelineElement.payload.dom}}" style="{{getElementCss(pipelineElement.settings)}}"
          (click)="updateOptionsClick(pipelineElement.payload.dom)"
          (mouseenter)="updateMouseover(pipelineElement.payload.dom)"
          (mouseleave)="updateMouseover('')"
          *ngFor="let pipelineElement of rawPipelineModel | enabledPipelineElement">
        <span style="z-index:5;"
              [ngClass]="getElementCssClasses(pipelineElement)">
            <div class="pipeline-element-progress-container sp-fade" *ngIf="pipelineElement.settings.loadingStatus">
                 <mat-spinner [mode]="'indeterminate'" class="pipeline-element-progress" [diameter]="40"></mat-spinner>
            </div>
            <div class="pipeline-element-loading-container sp-fade-opacity"
                 *ngIf="pipelineElement.settings.loadingStatus"></div>
            <div class="pipeline-element-configuration-invalid {{pipelineElement.type === 'stream' ? 'pi-stream' : 'pi-processor'}}"
                 *ngIf="!pipelineElement.settings.completed">
                <i class="material-icons pipeline-element-configuration-invalid-icon">
                warning
                </i>
            </div>
            <pipeline-element [pipelineElement]="pipelineElement.payload" [preview]="preview"></pipeline-element>
        </span>
         <pipeline-element-options *ngIf="!preview" (delete)="handleDeleteOption($event)"
                                   (customize)="showCustomizeDialog($event)"
                                   [currentMouseOverElement]="currentMouseOverElement"
                                   [pipelineValid]="pipelineValid"
                                   [allElements]="allElements"
                                   [pipelineElement]="pipelineElement"
                                   [rawPipelineModel]="rawPipelineModel"
                                   [pipelineElementId]="pipelineElement.type == 'stream' ? pipelineElement.payload.elementId : pipelineElement.payload.belongsTo"
                                   [internalId]="pipelineElement.payload.dom">
        </pipeline-element-options>
        <pipeline-element-preview *ngIf="previewModeActive && (pipelinePreview.supportedPipelineElementDomIds.indexOf(pipelineElement.payload.dom) > -1)"
                                  [previewId]="pipelinePreview.previewId"
                                  [pipelineElementDomId]="pipelineElement.payload.dom">

        </pipeline-element-preview>
    </span>
</div>

