{{#let
  (arg-or-default @type "dual")
  (has-block "prepend")
  (has-block "append") 
  (arg-or-default @id (unique-id))
  as |type hasPrepend hasAppend inputId|
}}
  {{#let (use-state (if (eq type "dual") "password" type)) as |inputTypeState|}}
    {{#let
      (class-names
        (if @fullWidth "euiFieldPassword--fullWidth")
        (if @compressed "euiFieldPassword--compressed")
        (if (or hasPrepend hasAppend) "euiFieldPassword--inGroup")
        (if @isLoading "euiFieldPassword--isLoading")
        "euiFieldPassword"
      ) as |classes|
    }}
      {{#let (eq inputTypeState.value "text") as |isVisible|}}
        <EuiFormControlLayout
          @icon="lock"
          @clear={{@clear}}
          @fullWidth={{@fullWidth}}
          @isLoading={{@isLoading}}
          @compressed={{@compressed}}
          @readOnly={{@readOnly}}
          @useGroup={{or hasPrepend (or hasAppend (eq type "dual"))}}
        >
          <:prepend as |prependClasses|>
            {{yield prependClasses inputId to="prepend"}}
          </:prepend>
          <:field>
            <input
              id={{inputId}}
              class={{classes}}
              disabled={{@isDisabled}}
              type={{inputTypeState.value}}
              ...attributes
              {{validatable-control @isInvalid}}
            />
          </:field>
          <:append as |appendClasses|>
            {{yield appendClasses inputId to="append"}}
            {{#if (eq type "dual")}}
              <EuiButtonIcon
                @iconType={{if isVisible "eyeClosed" "eye"}}
                {{on "click" (fn inputTypeState.setState (if isVisible "password" "text"))}}
              />
            {{/if}}
          </:append>
        </EuiFormControlLayout>
      {{/let}}
    {{/let}}
  {{/let}}
{{/let}}