<div ng-controller="Admin.TranscriptionManagementController">
    <ng-form name="transcribeConfigurationForm">
        <div class="panel panel-success panel-grid">
            <div class="pull-right well">
                <div class="btn-group">
                    <button class="btn btn-xs btn-link" ng-click="saveChanges()" ng-disabled="transcribeConfigurationForm.$invalid">
                        <i class="fa fa-save"></i>
                        <span translate>
			            	admin.mediaServices.transcriptionConfigForm.save.button
                        </span>
                    </button>
                </div>
            </div>
            <panel-view header="{{'admin.mediaServices.transcriptionConfigForm.title' | translate}}" collapsible="false">
                <div class="row">
                    <div class="col-lg-12">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.automation.label
                        </label>
                    </div>
                    <div class="well-sm">
                        <div class="row">
                            <div class="col-lg-12">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" ng-click="resetMode()"
                                                ng-model="transcribeConfigDataModel['transcribe.enabled']">
                                        <span translate>
                             admin.mediaServices.transcriptionConfigForm.enableTranscription.checkbox
                            </span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" ng-model="transcribeConfigDataModel['transcribe.automaticEnabled']">
                                        <span translate>
                             admin.mediaServices.transcriptionConfigForm.automaticTranscription.checkbox
                            </span>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.mediaFileAdded.label
                        </label>
                    </div>
                    <div class="well-sm">
                        <form class="well-sm">
                            <div class="radio">
                                <label>
                                    <input type="radio" name="versionProperty" ng-model="transcriptionForNewVersion.value" ng-value="true">
                                    <span translate>admin.mediaServices.transcriptionConfigForm.generateTranscription.radio</span>
                                </label>
                            </div>
                            <div class="radio">
                                <label>
                                    <input type="radio" name="versionProperty" ng-model="transcriptionForNewVersion.value" ng-value="false">
                                    <span translate>admin.mediaServices.transcriptionConfigForm.copyTranscription.radio</span>
                                </label>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.provider.label
                        </label>
                        <select name="providers" class="form-control"
                                ng-options="o as o for o in transcribeConfigDataModel['transcribe.providers']"
                                ng-model="transcribeConfigDataModel['transcribe.provider']">
                        </select>
                    </div>
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.numOfFiles.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="numberOfFilesForProcessing" class="form-control"
                                ng-model="transcribeConfigDataModel['transcribe.numberOfFilesForProcessing']" type="number" min="1"
                                required>
                        <span ng-if="!transcribeConfigurationForm['transcribe.numberOfFilesForProcessing'].$invalid ||
                        !transcribeConfigurationForm['transcribe.numberOfFilesForProcessing'].$dirty">
                            &nbsp;
                        </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.numberOfFilesForProcessing'].$error.min" class="text-danger"
                                translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.minOneValueErrorMsg
                        </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.numberOfFilesForProcessing'].$error.required"
                                class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                        </span>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.wordCount.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="wordCountPerItem" class="form-control"
                                ng-model="transcribeConfigDataModel['transcribe.wordCountPerItem']"
                                type="number" min="1" required>
                        <span ng-if="!transcribeConfigurationForm['transcribe.wordCountPerItem'].$invalid ||
                        !transcribeConfigurationForm['transcribe.wordCountPerItem'].$dirty">
                             &nbsp;
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.wordCountPerItem'].$error.min" class="text-danger" translate>
                            admin.mediaServices.transcriptionConfigForm.validation.messages.minOneValueErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.wordCountPerItem'].$error.required" class="text-danger"
                                translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                        </span>
                    </div>
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.costPerSecond.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="cost" class="form-control" ng-model="transcribeConfigDataModel['transcribe.cost']" type="number"
                                min="0" step="any"
                                required>
                        <span ng-if="!transcribeConfigurationForm['transcribe.cost'].$invalid || !transcribeConfigurationForm['transcribe.cost'].$dirty">
                             &nbsp;
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.cost'].$error.min" class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.minZeroValueErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.cost'].$error.required" class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                            </span>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.confidenceThreshold.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="confidence" class="form-control" ng-model="transcribeConfigDataModel['transcribe.confidence']"
                                type="number" min="0"
                                max="100" required>
                        <span ng-if="transcribeConfigurationForm['transcribe.confidence'].$invalid && transcribeConfigurationForm['transcribe.confidence'].$dirty">
                             &nbsp;
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.confidence'].$error.min" class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.minZeroValueErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.confidence'].$error.max" class="text-danger" translate>
                                 admin.mediaServices.transcriptionConfigForm.validation.messages.maxErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.confidence'].$error.required" class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                            </span>
                    </div>
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.mediaDurationInSeconds.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="allowedMediaDuration" class="form-control"
                                ng-model="transcribeConfigDataModel['transcribe.allowedMediaDuration']"
                                type="number" min="1" required>
                        <span ng-if="transcribeConfigurationForm['transcribe.allowedMediaDuration'].$error.required" class="text-danger"
                                translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.allowedMediaDuration'].$error.min" class="text-danger"
                                translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.minPositiveValueErrorMsg
                            </span>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-3 form-group">
                        <label translate>
                            admin.mediaServices.transcriptionConfigForm.silenceBetweenWords.label
                        </label>
						<span class="required-asterisk">*</span>
                        <input name="silentBetweenWords" class="form-control"
                                ng-model="transcribeConfigDataModel['transcribe.silentBetweenWords']"
                                type="number" step="any" min="0" required>
                        <span ng-if="transcribeConfigurationForm['transcribe.silentBetweenWords'].$error.required" class="text-danger"
                                translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.requiredErrorMsg
                            </span>
                        <span ng-if="transcribeConfigurationForm['transcribe.silentBetweenWords'].$error.min" class="text-danger" translate>
                                admin.mediaServices.transcriptionConfigForm.validation.messages.minZeroValueErrorMsg
                            </span>
                    </div>
                </div>
            </panel-view>
        </div>
    </ng-form>
</div>