<!--

    Copyright © 2016-2026 The Thingsboard Authors

    Licensed 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.

-->
<form [formGroup]="twilioSmsProviderConfigurationFormGroup" style="padding-bottom: 16px;">
  <mat-form-field class="mat-block" subscriptSizing="dynamic" appearance="outline">
    <mat-label translate>admin.number-from</mat-label>
    <input type="tel" required [pattern]="phoneNumberPatternTwilio" matInput formControlName="numberFrom">
    @if (twilioSmsProviderConfigurationFormGroup.get('numberFrom').hasError('required')) {
      <mat-error>
        {{ 'admin.number-from-required' | translate }}
      </mat-error>
    }
    @if (twilioSmsProviderConfigurationFormGroup.get('numberFrom').hasError('pattern')) {
      <mat-error>
        {{ 'admin.phone-number-pattern-twilio' | translate }}
      </mat-error>
    }
    <mat-hint innerHTML="{{ 'admin.phone-number-hint-twilio' | translate }}"></mat-hint>
  </mat-form-field>
  <mat-form-field class="mat-block" appearance="outline">
    <mat-label translate>admin.twilio-account-sid</mat-label>
    <input required matInput formControlName="accountSid">
    @if (twilioSmsProviderConfigurationFormGroup.get('accountSid').hasError('required')) {
      <mat-error>
        {{ 'admin.twilio-account-sid-required' | translate }}
      </mat-error>
    }
  </mat-form-field>
  <mat-form-field class="mat-block" appearance="outline">
    <mat-label translate>admin.twilio-account-token</mat-label>
    <input required type="password" autocomplete="new-password" matInput formControlName="accountToken">
    <tb-toggle-password matSuffix></tb-toggle-password>
    @if (twilioSmsProviderConfigurationFormGroup.get('accountToken').hasError('required')) {
      <mat-error>
        {{ 'admin.twilio-account-token-required' | translate }}
      </mat-error>
    }
  </mat-form-field>
</form>
