%%
%% This is file `scrletter.sty',
%% generated with the docstrip utility, extended by scrdocstrip.
%%
%% The original source files were:
%%
%% scrkernel-version.dtx  (with options: `package,letter')
%% scrkernel-basics.dtx  (with options: `package,load')
%% scrkernel-miscellaneous.dtx  (with options: `package,letter,init')
%% scrkernel-typearea.dtx  (with options: `package,letter,init')
%% scrkernel-miscellaneous.dtx  (with options: `package,letter,option')
%% scrkernel-letterclassoptions.dtx  (with options: `package,letter,option')
%% scrkernel-language.dtx  (with options: `package,letter,option')
%% scrkernel-fonts.dtx  (with options: `package,letter,option')
%% scrkernel-variables.dtx  (with options: `package,letter,option')
%% scrkernel-pseudolengths.dtx  (with options: `package,letter,option')
%% scrkernel-typearea.dtx  (with options: `package,letter,options')
%% scrkernel-pagestyles.dtx  (with options: `package,letter,option')
%% scrkernel-notepaper.dtx  (with options: `package,letter,option')
%% scrkernel-addressfiles.dtx  (with options: `package,letter,option')
%% scrkernel-miscellaneous.dtx  (with options: `package,letter,execoption')
%% scrkernel-fonts.dtx  (with options: `package,letter,body')
%% scrkernel-miscellaneous.dtx  (with options: `package,letter,body')
%% scrkernel-letterclassoptions.dtx  (with options: `package,letter,body')
%% scrkernel-language.dtx  (with options: `package,letter,body')
%% scrkernel-variables.dtx  (with options: `package,letter,body')
%% scrkernel-pseudolengths.dtx  (with options: `package,letter,body')
%% scrkernel-pagestyles.dtx  (with options: `package,letter,body')
%% scrkernel-notepaper.dtx  (with options: `package,letter,body')
%% scrkernel-addressfiles.dtx  (with options: `package,letter,body')
%% scrlogo.dtx  (with options: `logo')
%% 
%% Copyright (c) 1994-2026 Markus Kohm [komascript at gmx info]
%% 
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%% 
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle.  You may however distribute the
%% KOMA-Script bundle without all such generated files.  See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%% 
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `MANIFEST.md'.  See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%% 
%% If this file is a beta version, you may not be allowed to distribute
%% it.  Look at the comments below to see if this is the case.
%% 
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%% 
%% See `README'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.  You can
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%% 
%%% From File: $Id: scrkernel-version.dtx 4261 2026-02-02 09:02:14Z kohm $
\providecommand*{\@CheckKOMAScriptVersion}{%
  \begingroup
    \ExplSyntaxOff
    \@@CheckKOMAScriptVersion
}
\providecommand*{\@@CheckKOMAScriptVersion}[1]{%
    \@ifundefined{KOMAScriptVersion}{%
      \gdef\KOMAScriptVersion{#1}%
    }{%
      \def\@tempa{#1}%
      \ifx\KOMAScriptVersion\@tempa\else
        \GenericWarning{\space\@spaces\@spaces\@spaces\@spaces}{%
          Version warning:
          \noexpand\KOMAScriptVersion is
          `\csname KOMAScriptVersion\endcsname',\MessageBreak
          but `#1' was expected!\MessageBreak
          You should not use classes, packages or files
          from\MessageBreak
          different KOMA-Script versions\@gobble
        }%
      \fi
    }%
  \endgroup
}
\@CheckKOMAScriptVersion{2026/02/02 v3.49.2 KOMA-Script}%
\providecommand*{\scr@pkgextension}{\@pkgextension}
\AtBeginDocument{%
  \let\scr@pkgextension\@pkgextension
}
\ProvidesPackage{scrletter}[%
  2026/02/02 v3.49.2 KOMA-Script
  letter package extending any KOMA-Script class%
]
%%% From File: $Id: scrkernel-basics.dtx 4198 2025-08-15 09:19:27Z kohm $
%%%            (run: load)
\RequirePackage{scrkbase}[\KOMAScriptVersion]
%%% From File: $Id: scrkernel-miscellaneous.dtx 4223 2025-09-11 09:09:44Z kohm $
%%%            (run: init)
\scr@ifundefinedorrelax{KOMAClassName}{%
  \PackageWarningNoLine{scrletter}{%
    Cannot detect any KOMA-Script class.\MessageBreak
    Package `scrletter' is an extension to\MessageBreak
    KOMA-Script classes.\MessageBreak
    Usage with another class is not recommended%
    \@ifclassloaded{article}{}{%
      \@ifclassloaded{report}{}{%
        \@ifclassloaded{book}{}{%
          \MessageBreak and can result in several errors%
        }%
      }%
    }%
  }%
  \RequirePackage{scrextend}%
  \providecommand*{\setparsizes}[3]{%
    \setlength{\parindent}{#1}%
    \setlength{\parskip}{#2}%
    \setlength{\parfillskip}{#3}%
  }
  \providecommand*{\par@updaterelative}{}
}{}
%%% From File: $Id: scrkernel-typearea.dtx 4181 2025-06-14 09:11:13Z kohm $
%%%            (run: init)
%%% From File: $Id: scrkernel-miscellaneous.dtx 4223 2025-09-11 09:09:44Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-letterclassoptions.dtx 4197 2025-08-15 09:13:30Z kohm $
%%%            (run: option)
\AtEndOfPackage
  {\LoadLetterOption{DIN}}
%%% From File: $Id: scrkernel-language.dtx 4140 2025-02-22 12:39:23Z kohm $
%%%            (run: option)
\newif\if@orgdate\@orgdatetrue
\KOMA@key{numericaldate}[true]{%
  \if@orgdate\@orgdatefalse\else\@orgdatetrue\fi
  \KOMA@set@ifkey{numericaldate}{@orgdate}{#1}%
  \KOMA@kav@replacebool{%
    scrletter.\scr@pkgextension
  }{numericaldate}{@orgdate}%
  \if@orgdate\@orgdatefalse\else\@orgdatetrue\fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{numericaldate}{true}
\KOMA@DeclareDeprecatedOption{scrdate}{numericaldate=true}
\KOMA@DeclareDeprecatedOption{orgdate}{numericaldate=false}
%%% From File: $Id: scrkernel-fonts.dtx 4181 2025-06-14 09:11:13Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-variables.dtx 4151 2025-06-02 11:34:40Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-pseudolengths.dtx 4032 2023-04-17 09:45:11Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-typearea.dtx 4181 2025-06-14 09:11:13Z kohm $
%%%            (run: options)
\providecommand*{\PaperNameToSize}[2][warning]{%
  \Ifstr{#2}{letter}{%
    \setlength\paperheight{11in}%
    \setlength\paperwidth {8.5in}%
  }{%
    \Ifstr{#2}{legal}{%
      \setlength\paperheight{14in}%
      \setlength\paperwidth {8.5in}%
    }{%
      \Ifstr{#2}{executive}{%
        \setlength\paperheight{10.5in}%
        \setlength\paperwidth {7.25in}%
      }{%
        \Ifstr{#2}{}{%
          \ISO@PaperNameToSize[#1]{}{}\@nil
        }{%
          \edef\reserved@a{\noexpand\ISO@PaperNameToSize[#1]#2 \noexpand\@nil}%
          \reserved@a
        }%
      }%
    }%
  }%
}
\scr@ifundefinedorrelax{ISO@PaperNameToSize}{%
  \def\ISO@PaperNameToSize[#1]#2#3\@nil{%
    \lowercase{\edef\reserved@a{#2}}%
    \@tempswafalse
    \if \reserved@a a%
      \Ifnumber{#3}{%
        \setlength{\paperwidth}{841sp}%
        \setlength{\paperheight}{1189sp}%
        \@tempswatrue
      }{}%
    \else
      \if \reserved@a b%
        \Ifnumber{#3}{%
          \setlength{\paperwidth}{1000sp}%
          \setlength{\paperheight}{1414sp}%
          \@tempswatrue
        }{}%
      \else
        \if \reserved@a c%
          \Ifnumber{#3}{%
            \setlength{\paperwidth}{917sp}%
            \setlength{\paperheight}{1297sp}%
            \@tempswatrue
          }{}%
        \else
          \if \reserved@a d%
            \Ifnumber{#3}{%
              \setlength{\paperwidth}{771sp}%
              \setlength{\paperheight}{1090sp}%
              \@tempswatrue
            }{}%
          \fi
        \fi
      \fi
    \fi
    \if@tempswa
      \@tempcnta=#3\relax
      \@whilenum\@tempcnta>\z@
      \do{\setlength{\@tempdima}{\paperwidth}%
        \setlength{\paperwidth}{.5\paperheight}%
        \setlength{\paperheight}{\@tempdima}%
        \advance\@tempcnta by\m@ne
      }%
      \multiply\paperwidth by186468
      \multiply\paperheight by186468
    \else
      \scr@ifundefinedorrelax{scr@UnknownPaperSize@#1}{%
        \scr@UnknownPaperSize@error{#2#3}%
      }{%
        \@nameuse{scr@UnknownPaperSize@#1}{#2#3}%
      }%
    \fi
  }%
}{}
\providecommand*{\ProvideUnknownPaperSizeError}[1]{%
  \expandafter\providecommand\expandafter*%
  \csname scr@UnknownPaperSize@#1\endcsname[1]%
}
\ProvideUnknownPaperSizeError{error}{%
  \PackageError{%
    scrletter%
  }{Unknown paper size #1}{%
    \string\paperwidth\space and \string\paperheight\space stay unchanged,
    because of unknown paper size.%
  }%
}
%%% From File: $Id: scrkernel-pagestyles.dtx 4058 2023-06-16 08:32:27Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-notepaper.dtx 4220 2025-09-05 12:10:03Z kohm $
%%%            (run: option)
\KOMA@ifkey{firsthead}{@firsthead}
\KOMAExecuteOptions{firsthead=true}
\newcommand*{\@alignfrom}{0}
\KOMA@key{fromalign}{%
  \KOMA@set@ncmdkey{fromalign}{@alignfrom}{%
    {left}{0},%
    {center}{1},{centered}{1},{middle}{1},%
    {right}{2},%
    {locationleft}{3},{leftlocation}{3},%
    {locationright}{4},{rightlocation}{4},{location}{4},%
    {no}{10000},{false}{10000},{off}{10000}%
  }{#1}%
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@xreplacevalue{%
      scrletter.\scr@pkgextension
    }{fromalign}{#1}%
    \ifcase\@alignfrom\or\or\or\@firstheadfalse\or\@firstheadfalse\fi
  \fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{fromalign}{left}
\KOMA@ncmdkey{fromrule}[below]{@rulefrom}{%
  {false}{0},{no}{0},{off}{0},{aftername}{1},%
  {below}{2},{afteraddress}{2},{true}{2},{yes}{2},{on}{2}%
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{fromrule}{false}
\KOMA@ifkey{fromphone}{@phone}
\KOMA@ifkey{frommobilephone}{@mobilephone}
\KOMA@ifkey{fromfax}{@fax}
\KOMA@ifkey{fromemail}{@email}
\KOMA@ifkey{fromurl}{@www}
\KOMA@ifkey{fromlogo}{@logo}
\newcommand*{\@afieldmode}{\@ne}
\KOMA@ncmdkey{addrfield}[true]{@afieldmode}{%
  {false}{0},{off}{0},{no}{0},%
  {true}{1},{on}{1},{yes}{1},%
  {PP}{2},{pp}{2},%
  {PPexplicite}{2},{PPExplicite}{2},%
  {ppexplicite}{2},{ppExplicite}{2},%
  {backgroundimage}{3},%
  {PPbackgroundimage}{3},{PPBackgroundImage}{3},{PPBackGroundImage}{3},%
  {ppbackgroundimage}{3},{ppBackgroundImage}{3},{ppBackGroundImage}{3},%
  {image}{4},{Image}{4},%
  {PPimage}{4},{PPImage}{4},%
  {ppimage}{4},{ppImage}{4},%
  {topaligned}{5},{alignedtop}{5}%
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{addrfield}{true}
\KOMA@ncmdkey{priority}[A]{ltr@priority}{%
  {no}{0},{off}{0},{false}{0},{manual}{0},%
  {B}{1},{b}{1},%
  {economy}{1},{Economy}{1},{ECONOMY}{1},%
  {B-ECONOMY}{1},{B-Economy}{1},{b-economy}{1},%
  {A}{2},{a}{2},%
  {priority}{2},{Priority}{2},{PRIORITY}{2},%
  {A-PRIORITY}{2},{A-Priority}{2},{a-priority}{2}%
}%
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{priority}{false}
\newcommand{\backaddr@format}[1]{}
\let\backaddr@format\underline
\newif\if@baddr\@baddrtrue
\KOMA@key{backaddress}[true]{%
  \begingroup
    \KOMA@set@ncmdkey{backaddress}{@tempa}{%
      {false}{0},{off}{0},{no}{0},%
      {true}{1},{on}{1},{yes}{1},%
      {underlined}{2},%
      {plain}{3}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifcase\@tempa
        \endgroup
        \@baddrfalse
      \or
        \endgroup
        \@baddrtrue
      \or
        \endgroup
        \@baddrtrue
        \let\backaddr@format\underline
      \or
        \endgroup
        \@baddrtrue
        \let\backaddr@format\@firstofone
      \else
        \endgroup
      \fi
      \if@baddr
        \ifx\backaddr@format\underline
          \KOMA@kav@replacevalue{%
            scrletter.\scr@pkgextension
          }{backaddress}{underlined}%
        \else
          \ifx\backaddr@format\@firstofone
            \KOMA@kav@replacevalue{%
              scrletter.\scr@pkgextension
            }{backaddress}{plain}%
          \else
            \KOMA@kav@replacevalue{%
              scrletter.\scr@pkgextension
            }{backaddress}{true}%
          \fi
        \fi
      \else
        \KOMA@kav@replacevalue{%
          scrletter.\scr@pkgextension
        }{backaddress}{false}%
      \fi
  \else
      \endgroup
      \FamilyKeyStateUnknownValue
  \fi
}
\newif\if@bigloc
\KOMA@key{locfield}[wide]{%
  \begingroup
    \KOMA@set@ncmdkey{locfield}{@tempa}{{wide}{0},{narrow}{1}}{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifcase\@tempa
        \endgroup
        \@bigloctrue
        \KOMA@kav@replacevalue{%
          scrletter.\scr@pkgextension
        }{locfield}{wide}%
      \else
        \endgroup
        \@biglocfalse
        \KOMA@kav@replacevalue{%
          scrletter.\scr@pkgextension
        }{locfield}{narrow}%
      \fi
    \else
      \endgroup
      \FamilyKeyStateUnknownValue
  \fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{locfield}{narrow}
\KOMA@DeclareDeprecatedOption{wlocfield}{locfield=wide}
\KOMA@DeclareDeprecatedOption{slocfield}{locfield=narrow}

\newif\if@fold\@foldtrue
\newcommand*{\@usefolds}{TMBPL}
\KOMA@key{foldmarks}[true]{%
  \begingroup
    \KOMA@set@ifkey\@empty{@fold}{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \if@fold\aftergroup\@foldtrue\else\aftergroup\@foldfalse\fi
      \aftergroup\FamilyKeyStateProcessed
    \else
      \aftergroup\FamilyKeyStateProcessed
      \def\sc@nf@ldch@rs##1{%
        \ifx ##1\@nil\else
          \if ##1T\g@addto@macro\@usefolds{##1}\else
            \if ##1M\g@addto@macro\@usefolds{##1}\else
              \if ##1B\g@addto@macro\@usefolds{##1}\else
                \if ##1P\g@addto@macro\@usefolds{##1}\else
                  \if ##1L\g@addto@macro\@usefolds{##1}\else
                    \if ##1V\g@addto@macro\@usefolds{L}\else
                      \if ##1H\g@addto@macro\@usefolds{TMBP}\else
                        \if ##1t\scr@removechar\@usefolds{T}\else
                          \if ##1m\scr@removechar\@usefolds{M}\else
                            \if ##1b\scr@removechar\@usefolds{B}\else
                              \if ##1p\scr@removechar\@usefolds{P}\else
                                \if ##1l\scr@removechar\@usefolds{L}\else
                                  \if ##1v%
                                    \scr@removechar\@usefolds{L}%
                                  \else
                                    \if ##1h%
                                      \scr@removechar\@usefolds{T}%
                                      \scr@removechar\@usefolds{M}%
                                      \scr@removechar\@usefolds{B}%
                                    \else
                                      \aftergroup\FamilyKeyStateUnknownValue
                                    \fi
                                  \fi
                                \fi
                              \fi
                            \fi
                          \fi
                        \fi
                      \fi
                    \fi
                  \fi
                \fi
              \fi
            \fi
          \fi
          \expandafter\sc@nf@ldch@rs
        \fi
      }%
      \expandafter\sc@nf@ldch@rs#1\@nil
    \fi
  \endgroup
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@xreplacevalue{%
      scrletter.\scr@pkgextension
    }{foldmarks}{\@usefolds}%
    \KOMA@kav@xadd{%
      scrletter.\scr@pkgextension
    }{foldmarks}{\if@fold true\else false\fi}%
  \fi
}
\KOMA@kav@xadd{%
  scrletter.\scr@pkgextension
}{foldmarks}{\@usefolds}%
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{foldmarks}{true}%
\newcommand*{\scr@removechar}[2]{%
  \def\in@@##1#2##2##3\in@@{%
    \ifx\in@##2\else
      \def\in@@####1#2\in@{\gdef#1{##1####1}}%
      \in@@##2##3%
    \fi}%
  \expandafter\in@@#1#2\in@\in@@
}
\newif\if@refwide
\newif\if@refline\@reflinetrue
\newcommand*{\@datepos}{1}
\KOMA@key{refline}[wide]{%
  \begingroup
    \KOMA@set@ncmdkey{refline}{@tempa}{{wide}{0},{narrow}{1},%
      {dateleft}{2},{leftdate}{2},%
      {dateright}{3},{rightdate}{3},%
      {nodate}{4}%
      ,{no}{5},{off}{5},{false}{5}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifcase\@tempa% wide
        \endgroup
        \@refwidetrue
        \@reflinetrue
        \KOMA@kav@remove{scrletter.\scr@pkgextension}{refline}{false}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{wide}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{narrow}%
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{refline}{wide}%
      \or% narrow
        \endgroup
        \@refwidefalse
        \@reflinetrue
        \KOMA@kav@remove{scrletter.\scr@pkgextension}{refline}{false}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{wide}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{narrow}%
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{refline}{narrow}%
      \or% dateleft
        \endgroup
        \def\@datepos{2}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateleft}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateright}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{nodate}%
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{refline}{dateleft}%
      \or% dateright
        \endgroup
        \def\@datepos{1}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateleft}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateright}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{nodate}%
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{refline}{dateright}%
      \or% nodate
        \endgroup
        \def\@datepos{0}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateleft}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{dateright}%
        \KOMA@kav@remove{%
          scrletter.\scr@pkgextension
        }{refline}{nodate}%
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{refline}{nodate}%
      \or% false
        \endgroup
        \@reflinefalse
        \KOMA@kav@remove{scrletter.\scr@pkgextension}{refline}{wide}%
        \KOMA@kav@remove{scrletter.\scr@pkgextension}{reline}{narrow}%
        \KOMA@kav@add{scrletter.\scr@pkgextension}{refline}{false}%
      \fi
    \else
      \endgroup
      \FamilyKeyStateUnknownValue
  \fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{refline}{dateright}%
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{refline}{narrow}%
\newcommand{\subject@format}[1]{#1}
\newcommand*{\raggedsubject}{}
\newif\if@subj
\newif\if@subjafter
\KOMA@key{subject}{%
  \begingroup
    \KOMA@set@ncmdkey{subject}{@tempa}{%
      {titled}{0},%
      {untitled}{1},%
      {afteropening}{2},%
      {beforeopening}{3},%
      {underlined}{4},%
      {left}{5},%
      {right}{6},%
      {centered}{7}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifcase\@tempa
        \aftergroup\@subjtrue
      \or
        \aftergroup\@subjfalse
      \or
        \aftergroup\@subjaftertrue
      \or
        \aftergroup\@subjafterfalse
      \or
        \aftergroup\let\aftergroup\subject@format\aftergroup\underline
      \or
        \aftergroup\let\aftergroup\raggedsubject\aftergroup\raggedright
      \or
        \aftergroup\let\aftergroup\raggedsubject\aftergroup\raggedleft
      \or
        \aftergroup\let\aftergroup\raggedsubject\aftergroup\centering
      \fi
    \else
      \aftergroup\FamilyKeyStateUnknownValue
    \fi
  \endgroup
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@xreplacevalue{%
      scrletter.\scr@pkgextension
    }{subject}{\if@subj titled\else untitled\fi}%
    \KOMA@kav@xadd{%
      scrletter.\scr@pkgextension
    }{subject}{\if@subjafter after\else before\fi opening}%
    \ifx\subject@format\underline
      \KOMA@kav@add{%
        scrletter.\scr@pkgextension
      }{subject}{underlined}%
    \fi
    \ifx\raggedsubject\raggedright
      \KOMA@kav@add{%
        scrletter.\scr@pkgextension
      }{subject}{left}%
    \else
      \ifx\raggedsubject\raggedleft
        \KOMA@kav@add{%
          scrletter.\scr@pkgextension
        }{subject}{right}%
      \else
        \ifx\raggedsubject\centering
          \KOMA@kav@add{%
            scrletter.\scr@pkgextension
          }{subject}{centered}%
        \fi
      \fi
    \fi
  \fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{subject}{untitled}%
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{subject}{beforeopening}%
\KOMA@ifkey{enlargefirstpage}{@enlargefp}
\KOMA@ifkey{shrinkfirstpage}{@shrinkfp}
\@shrinkfptrue
\KOMA@ifkey{firstfoot}{@firstfoot}\@firstfoottrue
\newcommand*{\@pageat}{4}
\KOMA@key{pagenumber}{%
  \begingroup
    \KOMA@set@ncmdkey{pagenumber}{@tempa}{%
      {no}{-1},{off}{-1},{false}{-1},%
      {topleft}{0},{headleft}{0},%
      {topmiddle}{1},{topcenter}{1},{topcentered}{1},%
      {headmiddle}{1},{headcenter}{1},{headcentered}{1},%
      {topright}{2},{headright}{2},%
      {botleft}{3},{footleft}{3},%
      {botmiddle}{4},{botcenter}{4},{botcentered}{4},%
      {footmiddle}{4},{footcenter}{4},{footcentered}{4},%
      {botright}{5},{footright}{5},%
      {top}{10},{head}{10},{bot}{11},{foot}{11},%
      {left}{20},{middle}{21},{center}{21},{centered}{21},{right}{22}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \ifnum\@tempa<10
        \edef\@tempa{\endgroup\edef\noexpand\@pageat{\@tempa}}%
      \else
        \ifnum\@tempa<20
          \@tempcnta\@pageat\relax
          \ifnum\@tempcnta>2
            \advance\@tempcnta by -3
          \fi
          \ifnum\@tempa=11
            \advance\@tempcnta by 3
          \fi
          \edef\@tempa{\endgroup\edef\noexpand\@pageat{\the\@tempcnta}}%
        \else
          \ifnum\@pageat>2
            \edef\@pageat{3}%
          \else
            \edef\@pageat{0}%
          \fi
          \@tempcnta\@tempa
          \advance\@tempcnta by -20
          \advance\@tempcnta by\@pageat
          \edef\@tempa{\endgroup\edef\noexpand\@pageat{\the\@tempcnta}}%
        \fi
      \fi
    \else
      \def\@tempa{\endgroup\FamilyKeyStateUnknownValue}%
    \fi
  \@tempa
  \KOMA@kav@xreplacevalue{%
    scrletter.\scr@pkgextension
  }{pagenumber}{%
    \ifcase \@pageat
      topleft%
    \or
      topmiddle%
    \or
      topright%
    \or
      botleft%
    \or
      botmiddle%
    \or
      botright%
    \else
      false%
    \fi
  }%
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{pagenumber}{botmiddle}
\newif\if@scrsymbols
\KOMA@key{symbolicnames}[true]{%
  \KOMA@set@ifkey{symbolicnames}{@scrsymbols}{#1}%
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \def\scr@symbols@font{marvosym}%
  \else
    \KOMA@set@ncmdkey{symbolicnames}{reserved@a}{%
      {marvosym}{0},%
      {fontawesome}{1},{awesome}{1},%
    }{#1}%
    \ifx \FamilyKeyState\FamilyKeyStateProcessed
      \@scrsymbolstrue
      \ifcase \number\reserved@a
        \def\scr@symbols@font{marvosym}%
      \else
        \def\scr@symbols@font{fontawesome}%
      \fi
    \fi
  \fi
  \ifx \FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@xreplacevalue{%
      scrletter.\scr@pkgextension
    }{symbolicnames}{#1}%
    \if@scrsymbols
      \Ifstr{\scr@symbols@font}{marvosym}{%
        \def\scr@symbol@phone{\Telefon}%
        \def\scr@symbol@fax{\FAX}%
        \def\scr@symbol@email{\Email}%
        \def\scr@symbol@mobilephone{\Mobilefone}%
        \let\scr@symbol@www\@empty
      }{%
        \def\scr@symbol@phone{\faPhone}%
        \def\scr@symbol@fax{\faFax}%
        \def\scr@symbol@email{\faEnvelopeO}%
        \def\scr@symbol@mobilephone{\faMobilePhone}%
        \def\scr@symbol@www{\faGlobe}%
      }%
      \if@atdocument
        \begingroup
          \@tempswafalse
          \expandafter\ifdefined\scr@symbol@phone\else\@tempswatrue\fi
          \expandafter\ifdefined\scr@symbol@fax\else\@tempswatrue\fi
          \expandafter\ifdefined\scr@symbol@email\else\@tempswatrue\fi
          \expandafter\ifdefined\scr@symbol@mobilephone\else\@tempswatrue\fi
          \expandafter\ifdefined\scr@symbol@www\else\@tempswatrue\fi
          \if@tempswa
            \aftergroup\@scrsymbolsfalse
            \PackageWarning{scrletter}{%
              Option `symbolicnames=#1'
              ignorred.\MessageBreak
              You've tried to set option `symbolicnames'\MessageBreak
              after \string\begin{document}, but without\MessageBreak
              loading package `\scr@symbols@font' before.\MessageBreak
              You should either switch on option\MessageBreak
              `symbolicnames' before \string\begin{document}\MessageBreak
              or load package `\scr@letter@symbols@font' in the
              document\MessageBreak
              preamble to avoid this warning%
            }%
          \fi
        \endgroup
      \else
        \ifx\@fileswith@pti@ns\@badrequireerror
          \Ifstr{\@currext}{\@clsextension}{%
            \expandafter\AtEndOfClass
          }{%
            \Ifstr{\@currext}{\@pkgextension}{%
              \expandafter\AtEndOfPackage
            }{%
              \expandafter\AtBeginDocument
            }%
          }%
        \else
          \expandafter\@firstofone
        \fi
        {\RequirePackage{\scr@symbols@font}}%
      \fi
    \fi
  \fi
}
\KOMA@kav@add{%
  scrletter.\scr@pkgextension
}{symbolicnames}{false}%
\newcommand*{\scr@symbols@font}{}
\newcommand*{\scr@symbol@phone}{\undefined}
\newcommand*{\scr@symbol@fax}{\undefined}
\newcommand*{\scr@symbol@email}{\undefined}
\newcommand*{\scr@symbol@mobilephone}{\undefined}
\newcommand*{\scr@symbol@www}{\undefined}
%%% From File: $Id: scrkernel-addressfiles.dtx 4032 2023-04-17 09:45:11Z kohm $
%%%            (run: option)
%%% From File: $Id: scrkernel-miscellaneous.dtx 4223 2025-09-11 09:09:44Z kohm $
%%%            (run: execoption)
\KOMAProcessOptions\relax
%%% From File: $Id: scrkernel-fonts.dtx 4181 2025-06-14 09:11:13Z kohm $
%%%            (run: body)
%%% From File: $Id: scrkernel-miscellaneous.dtx 4223 2025-09-11 09:09:44Z kohm $
%%%            (run: body)
\providecommand*{\scr@endstrut}{\unskip\ifhmode\nobreak\strut\fi}
%%% From File: $Id: scrkernel-letterclassoptions.dtx 4197 2025-08-15 09:13:30Z kohm $
%%%            (run: body)
\newcommand*{\LoadLetterOption}[1]{%
  \@ifundefined{@restore@catcode@level}%
    {\let\@restore@catcode@level=\z@}{}%
  \ifnum\@restore@catcode@level =\z@
    \ifnum\catcode`\@=11
      \let\@restore@catcode\relax
    \else
      \@tempcnta=\catcode`\@
      \edef\@restore@catcode{%
        \noexpand\catcode`\noexpand\@=\the\@tempcnta}%
      \makeatletter
    \fi
  \fi
  \@tempcnta=\@restore@catcode@level\relax
  \advance\@tempcnta by \@ne\relax
  \edef\@restore@catcode@level{\the\@tempcnta}%
  \scr@sp@def\reserved@a{#1}%
  \edef\reserved@a{%
    \noexpand\edef\noexpand\scr@currentlco{\reserved@a}%
    \noexpand\InputIfFileExists{\reserved@a.lco}{%
      \noexpand\PackageInfo{scrletter}%
      {Letter-Class-Option `#1' loaded}%
    }{%
      \noexpand\PackageError{scrletter}%
      {%
        Letter-Class-Option file `#1.lco' not found%
      }{%
        You've told me to load the Letter-Class-Option `#1'. So I have
        to load\noexpand\MessageBreak
        the file `#1.lco'. But the file isn't available.}%
    }%
    \scr@ifundefinedorrelax{scr@currentlco}{%
      \unexpanded{\let\scr@currentlco\relax}%
    }{%
      \noexpand\def\noexpand\scr@currentlco{\scr@currentlco}%
    }%
  }%
  \if@atdocument
    \edef\reserved@a{%
      \unexpanded\expandafter{\reserved@a}%
      \ifx\RequirePackage\@notprerr
        \unexpanded{\let\RequirePackage\@notprerr}%
      \else
        \noexpand\def\noexpand\RequirePackage{%
          \unexpanded\expandafter{\RequirePackage}%
        }%
      \fi
      \ifx\usepackage\@notprerr
        \unexpanded{\let\usepackage\@notprerr}%
      \else
        \noexpand\def\noexpand\usepackage{%
          \unexpanded\expandafter{\usepackage}%
        }%
      \fi
    }%
    \let\RequirePackage\lco@RequirePackage
    \let\usepackage\lco@RequirePackage
    \expandafter\reserved@a
  \else \expandafter\reserved@a
  \fi
  \@tempcnta=\@restore@catcode@level\relax
  \advance\@tempcnta by \m@ne\relax
  \edef\@restore@catcode@level{\the\@tempcnta}%
  \ifnum\@tempcnta =\z@
    \@restore@catcode
  \fi
}
\newcommand*{\lco@RequirePackage}[2][]{%
  \begingroup
    \@for\reserved@a:=#2\do{%
      \scr@trim@spaces\reserved@a
      \scr@ifundefinedorrelax{ver@\reserved@a.\scr@pkgextension}{%
        \PackageError{scrletter}{%
          lco-file `\scr@currentlco' can be used only in preamble%
        }{%
          The lco-file `\scr@currentlco' uses \string\RequirePackage\space or
          \string\usepackage\space to load\MessageBreak
          package `\reserved@a'. This means you have to either load
          `\reserved@a'\MessageBreak
          or lco-file `\scr@currentlco' in the document preamble.
        }%
      }{}%
    }%
  \endgroup
  \@gobble@o
}
\newcommand*{\LoadLetterOptions}[1]{%
  \begingroup
    \def\reserved@a{\endgroup}%
    \@for\reserved@b:=#1\do{%
      \scr@trim@spaces\reserved@b
      \ifx\reserved@b\@empty\else
        \edef\reserved@a{\expandafter\unexpanded\expandafter{\reserved@a
            \LoadLetterOption}{\reserved@b}\relax}%
      \fi
    }%
  \reserved@a
}
\newcommand*{\LOPNP@option}{}
\newcommand*{\LOPNP@size}{}
\newcommand*{\@PapersizeWarning}{%
  \begingroup%
    \edef\@tempc{\noexpand\@tempswafalse
      \noexpand\ifdim\paperwidth<\the\dimexpr\paperwidth-.1mm\relax
      \relax
      \noexpand\else
        \noexpand\ifdim\paperwidth>\the\dimexpr\paperwidth+.1mm\relax
        \relax
        \noexpand\else
          \noexpand\ifdim\paperheight<\the\dimexpr\paperheight-.1mm\relax
          \relax
          \noexpand\else
            \noexpand\ifdim\paperheight>\the\dimexpr\paperheight+.1mm\relax
            \relax
            \noexpand\else
              \noexpand\@tempswatrue
            \noexpand\fi
          \noexpand\fi
        \noexpand\fi
      \noexpand\fi
      \noexpand\@@PapersizeWarning
    }%
    \def\@tempb{letter}\ifx\LOPNP@size\@tempb%
      \setlength{\paperheight}{11in}\setlength{\paperwidth}{8.5in}%
    \else\def\@tempb{legal}\ifx\LOPNP@size\@tempb%
        \setlength{\paperheight}{14in}\setlength{\paperwidth}{8.5in}%
      \else\def\@tempb{executive}\ifx\LOPNP@size\@tempb%
          \setlength{\paperheight}{10.5in}\setlength{\paperwidth}{7.25in}%
        \else%
          \PaperNameToSize[letter]{\LOPNP@size}%
        \fi
      \fi
    \fi
    \@tempc
  \endgroup%
}
\ProvideUnknownPaperSizeError{letter}{%
  \PackageError{scrletter}{%
    papersize `\LOPNP@size' undefined}{%
    You've told me to check for paper size
    `\LOPNP@size'\MessageBreak
    at letter option file `\LOPNP@option.lco',\MessageBreak
    but this paper size is not supported.\MessageBreak
    See the KOMA-Script manual for informations about known
    paper sizes.}%
}
\newcommand*{\@@PapersizeWarning}{%
  \if@tempswa\else%
  \PackageWarningNoLine{scrletter}%
    {%
      Letter option file `\LOPNP@option.lco'\MessageBreak
      needs paper size `\LOPNP@size'.\MessageBreak
      Current paper size is not `\LOPNP@size'!\MessageBreak
      \scr@ifundefinedorrelax{KOMAClassName}{%
        You should load package `typearea' either\MessageBreak
        with option `paper=\LOPNP@size,paper=portrait' or
        additionally\MessageBreak
      }{%
        You should add `paper=\LOPNP@size,paper=portrait' at the\MessageBreak
        option list of `\string\documentclass' or\MessageBreak
      }%
      add `\string\KOMAoptions{paper=\LOPNP@size,paper=portrait}'\MessageBreak
      before starting this letter!\MessageBreak
      Maybe you know what you are doing,\MessageBreak
      so I do not change this myself%
    }%
  \fi
}
\newcommand*{\LetterOptionNeedsPapersize}[2]{%
  \edef\LOPNP@size{#2}\edef\LOPNP@option{#1}%
}
%%% From File: $Id: scrkernel-language.dtx 4140 2025-02-22 12:39:23Z kohm $
%%%            (run: body)
\newcommand*{\g@addnumerical@date}[2]{%
  \@ifundefined{date#1}{%
    \PackageInfo{scrletter}
    {%
      no date found for language `#1'\MessageBreak
      --> skipped%
    }%
  }{%
    \expandafter\g@addto@macro\csname date#1\endcsname{%
      \def\num@date{#2}%
      \ifx\today\sym@num@date
        \@ifundefined{DTMtoday}{%
          \PackageWarning{scrletter}
          {%
            no original date found for language `#1'\MessageBreak
            --> using numerical date%
          }%
          \let\sym@date\num@date
        }{%
          \begingroup
            \gdef\scr@global@tempa{\let\sym@date\DTMtoday}%
            \def\today{\gdef\scr@global@tempa{\let\sym@date\num@date}}%
            \sbox\@tempboxa{\sym@date}%
          \endgroup
          \scr@global@tempa
        }%
      \else
        \DeclareCommandCopy{\sym@date}{\today}%
        \let\today=\sym@num@date
      \fi
    }%
  }%
}
\newcommand*{\sym@num@date}{\if@orgdate\sym@date\else\num@date\fi}
\AtBeginDocument{%
  \@ifundefined{captionsenglish}{\let\captionsenglish\@empty}{}%
  \@ifundefined{dateenglish}{\def\dateenglish{%
      \def\today{\ifcase\month\or
        January\or February\or March\or April\or May\or June\or
        July\or August\or September\or October\or November\or December\fi
        \space\number\day, \number\year}%
    }%
  }{}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\yourrefname{Your ref.}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\yourmailname{Your letter of}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\myrefname{Our ref.}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\customername{Customer no.}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\invoicename{Invoice no.}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\subjectname{Subject}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\ccname{cc}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\enclname{encl}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\headtoname{To}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\headfromname{From}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\datename{Date}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\pagename{Page}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\phonename{Phone}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\mobilephonename{Mobile phone}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\faxname{Fax}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\emailname{Email}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\wwwname{Url}%
  \providecaptionname{american,australian,british,canadian,%
    english,newzealand,%
    UKenglish,ukenglish,USenglish,usenglish}\bankname{Bank account}%
  \g@addnumerical@date{american}{\number\month/\number\day/\number\year}%
  \g@addnumerical@date{australian}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{british}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{canadian}{\number\year/\number\month/\number\day}%
  \g@addnumerical@date{english}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{newzealand}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{UKenglish}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{ukenglish}{\number\day/\number\month/\number\year}%
  \g@addnumerical@date{USenglish}{\number\month/\number\day/\number\year}%
  \g@addnumerical@date{usenglish}{\number\month/\number\day/\number\year}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\yourrefname{Ihr Zeichen}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\yourmailname{Ihr Schreiben vom}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\myrefname{Unser Zeichen}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\customername{Kundennummer}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\invoicename{Rechnungsnummer}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\subjectname{Betrifft}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\ccname{Kopien an}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\enclname{Anlage}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\headtoname{An}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\headfromname{Von}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\datename{Datum}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\pagename{Seite}%
  \providecaptionname{german}\phonename{Telephon}%
  \providecaptionname{ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\phonename{Telefon}%
  \providecaptionname{german}\mobilephonename{Mobiltelephon}%
  \providecaptionname{ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\mobilephonename{Mobiltelefon}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\faxname{Fax}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\emailname{E-Mail}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\wwwname{URL}%
  \providecaptionname{german,ngerman,austrian,naustrian,%
    swissgerman,nswissgerman}\bankname{Bankverbindung}%
  \g@addnumerical@date{german}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{ngerman}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{austrian}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{naustrian}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{swissgerman}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{nswissgerman}{%
    \number\day.\,\number\month.\,\number\year}%
  \providecaptionname{%
    acadian,canadien,francais,french}\yourrefname{Vos r\'ef\'erences}%
  \providecaptionname{%
    acadian,canadien,francais,french}\yourmailname{Votre lettre du}%
  \providecaptionname{%
    acadian,canadien,francais,french}\myrefname{Nos r\'ef\'erences}%
  \providecaptionname{%
    acadian,canadien,francais,french}\customername{Num\'ero de client}%
  \providecaptionname{%
    acadian,canadien,francais,french}\invoicename{Num\'ero de facture}%
  \providecaptionname{%
    acadian,canadien,francais,french}\subjectname{Concernant}%
  \providecaptionname{%
    acadian,canadien,francais,french}\ccname{Copie \`a}%
  \providecaptionname{%
    acadian,canadien,francais,french}\enclname{Annexes}%
  \providecaptionname{%
    acadian,canadien,francais,french}\headtoname{A}%
  \providecaptionname{%
    acadian,canadien,francais,french}\headfromname{De}%
  \providecaptionname{%
    acadian,canadien,francais,french}\datename{Date}%
  \providecaptionname{%
    acadian,canadien,francais,french}\pagename{Page}%
  \providecaptionname{%
    acadian,canadien,francais,french}\phonename{T\'el\'ephone}%
  \providecaptionname{%
    acadian,canadien,francais,french}\mobilephonename{Portable}%
  \providecaptionname{%
    acadian,canadien,francais,french}\faxname{T\'el\'efax}%
  \providecaptionname{%
    acadian,canadien,francais,french}\emailname{E-mail}%
  \providecaptionname{%
    acadian,canadien,francais,french}\wwwname{URL}%
  \providecaptionname{%
    acadian,canadien,francais,french}\bankname{Compte en banque}%
  \g@addnumerical@date{acadian}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{canadien}{\number\year/\number\month/\number\day}%
  \g@addnumerical@date{francais}{\number\day.\,\number\month.\,\number\year}%
  \g@addnumerical@date{french}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{italian}\yourrefname{Vs./Rif.}% or Vostro Riferimento
  \providecaptionname{italian}\yourmailname{Vs.~lettera del}% or Vostra
                                                            % lettera del
  \providecaptionname{italian}\myrefname{Ns./Rif.}% or Nostro Riferimento
  \providecaptionname{italian}\customername{Nr.~cliente}% or Cliente num.
  \providecaptionname{italian}\invoicename{Nr.~fattura}% or Fattura num.
  \providecaptionname{italian}\subjectname{Oggetto}%
  \providecaptionname{italian}\ccname{Per conoscenza}% or Copia a
  \providecaptionname{italian}\enclname{Allegato}% or (plural) Allegati
  \providecaptionname{italian}\headtoname{A}%
  \providecaptionname{italian}\headfromname{Da}%
  \providecaptionname{italian}\datename{Data}%
  \providecaptionname{italian}\pagename{Pagina}%
  \providecaptionname{italian}\phonename{Telefono}%
  \providecaptionname{italian}\mobilephonename{Telefonino}%
  \providecaptionname{italian}\faxname{Fax}%
  \providecaptionname{italian}\emailname{Email}%
  \providecaptionname{italian}\wwwname{Sito Web}%
  \providecaptionname{italian}\bankname{Conto bancario}%
  \g@addnumerical@date{italian}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{spanish}\yourrefname{Su ref.}%
  \providecaptionname{spanish}\yourmailname{Su carta de}%
  \providecaptionname{spanish}\myrefname{Nuestra ref.}%
  \providecaptionname{spanish}\customername{No. de cliente}%
  \providecaptionname{spanish}\invoicename{No. de factura}%
  \providecaptionname{spanish}\subjectname{Asunto}%
  \providecaptionname{spanish}\ccname{Copias}%
  \providecaptionname{spanish}\enclname{Adjunto}%
  \providecaptionname{spanish}\headtoname{A}%
  \providecaptionname{spanish}\headfromname{De}%
  \providecaptionname{spanish}\datename{Fecha}%
  \providecaptionname{spanish}\pagename{P\'agina}%
  \providecaptionname{spanish}\phonename{Tel\'efono}%
  \providecaptionname{spanish}\mobilephonename{M\'ovil}%
  \providecaptionname{spanish}\faxname{Fax}%
  \providecaptionname{spanish}\emailname{Email}% or Correo electr\'onico
  \providecaptionname{spanish}\wwwname{URL}% or P\`agina web
  \providecaptionname{spanish}\bankname{Cuenta bancaria}%
  \g@addnumerical@date{spanish}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{croatian}\yourrefname{Va\v{s} znak}%
  \providecaptionname{croatian}\yourmailname{Va\v{s}e pismo od}%
  \providecaptionname{croatian}\myrefname{Na\v{s} znak}%
  \providecaptionname{croatian}\customername{Broj kupca}%
  \providecaptionname{croatian}\invoicename{Broj fakture}%
  \providecaptionname{croatian}\subjectname{Predmet}%
  \providecaptionname{croatian}\ccname{Kopija}%
  \providecaptionname{croatian}\enclname{Privitak}%
  \providecaptionname{croatian}\headtoname{Prima}%
  \providecaptionname{croatian}\headfromname{\v{S}alje}%
  \providecaptionname{croatian}\datename{Nadnevak}%
  \providecaptionname{croatian}\pagename{Stranica}%
  \providecaptionname{croatian}\phonename{Telefon}%
  \providecaptionname{croatian}\mobilphonename{Mobitel}%
  \providecaptionname{croatian}\faxname{Fax}%
  \providecaptionname{croatian}\emailname{E-Mail}%
  \providecaptionname{croatian}\wwwname{URL}%
  \providecaptionname{croatian}\bankname{Bankovna veza}%
  \g@addnumerical@date{croatian}{\number\day.\,\number\month.\,\number\year.}%
  \providecaptionname{dutch}\yourrefname{Uw kenmerk}%
  \providecaptionname{dutch}\yourmailname{Uw brief van}%
  \providecaptionname{dutch}\myrefname{Ons kenmerk}%
  \providecaptionname{dutch}\customername{Klant No.}%
  \providecaptionname{dutch}\invoicename{Rekening No.}%
  \providecaptionname{dutch}\subjectname{Onderwerp}%
  \providecaptionname{dutch}\ccname{Kopie aan}%
  \providecaptionname{dutch}\enclname{Bijlage(n)}%
  \providecaptionname{dutch}\headtoname{Aan}%
  \providecaptionname{dutch}\headfromname{Van}%
  \providecaptionname{dutch}\datename{Datum}%
  \providecaptionname{dutch}\pagename{Pagina}%
  \providecaptionname{dutch}\phonename{Telefoon}%
  \providecaptionname{dutch}\mobilephonename{Mobieltje}%
  \providecaptionname{dutch}\faxname{Fax}%
  \providecaptionname{dutch}\emailname{E--mail}%
  \providecaptionname{dutch}\wwwname{URL}%
  \providecaptionname{dutch}\bankname{Bankrekening}%
  \g@addnumerical@date{dutch}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{finnish}\yourrefname{Viitteenne}%
  \providecaptionname{finnish}\yourmailname{Kirjeenne}%
  \providecaptionname{finnish}\myrefname{Viitteemme}%
  \providecaptionname{finnish}\customername{Asiakasnumero}%
  \providecaptionname{finnish}\invoicename{Laskun numero}%
  \providecaptionname{finnish}\subjectname{Asia}%
  \providecaptionname{finnish}\ccname{Jakelu}%
  \providecaptionname{finnish}\enclname{Liitteet}%
  \providecaptionname{finnish}\headtoname{Vastaanottaja}%
  \providecaptionname{finnish}\headfromname{L\"ahett\"aj\"a}%
  \providecaptionname{finnish}\datename{P\"aiv\"a}%
  \providecaptionname{finnish}\pagename{Sivu}%
  \providecaptionname{finnish}\phonename{Puhelin}%
  \providecaptionname{finnish}\mobilephonename{Matkapuhelin}%
  \providecaptionname{finnish}\faxname{Faksi}%
  \providecaptionname{finnish}\emailname{S\"ahk\"oposti}%
  \providecaptionname{finnish}\wwwname{URL}%
  \providecaptionname{finnish}\bankname{Pankkitilin numero}%
  \g@addnumerical@date{finnish}{\number\day.\number\month.\number\year}%
  \providecaptionname{norsk}\yourrefname{Deres ref.}%
  \providecaptionname{norsk}\yourmailname{Deres brev av:}%
  \providecaptionname{norsk}\myrefname{V\aa{}r ref:}%
  \providecaptionname{norsk}\customername{Kundenummer}%
  \providecaptionname{norsk}\invoicename{Fakturanummer}%
  \providecaptionname{norsk}\subjectname{Emne}%
  \providecaptionname{norsk}\ccname{Kopi til}%
  \providecaptionname{norsk}\enclname{Vedlegg}%
  \providecaptionname{norsk}\headtoname{Til}%
  \providecaptionname{norsk}\headfromname{Fra}%
  \providecaptionname{norsk}\datename{Dato}%
  \providecaptionname{norsk}\pagename{Side}%
  \providecaptionname{norsk}\phonename{Telefon}%
  \providecaptionname{norsk}\mobilephonename{Mobiltelefon}%
  \providecaptionname{norsk}\faxname{Telefaks}%
  \providecaptionname{norsk}\emailname{E-post}%
  \providecaptionname{norsk}\wwwname{Url}%
  \providecaptionname{norsk}\bankname{Bankkontonummer}%
  \g@addnumerical@date{norsk}{\number\day.\number\month.\number\year}%
  \providecaptionname{swedish}\yourrefname{Er ref}%
  \providecaptionname{swedish}\yourmailname{Ert brev av}%
  \providecaptionname{swedish}\myrefname{V\aa{}r ref}%
  \providecaptionname{swedish}\customername{Kundnummer}%
  \providecaptionname{swedish}\invoicename{Fakturanummer}%
  \providecaptionname{swedish}\subjectname{\"Amne}%
  \providecaptionname{swedish}\ccname{Kopia till}%
  \providecaptionname{swedish}\enclname{Bilagor}% Singular: Bilaga
  \providecaptionname{swedish}\headtoname{Till}%
  \providecaptionname{swedish}\headfromname{Fr\aa{}n}%
  \providecaptionname{swedish}\datename{Datum}%
  \providecaptionname{swedish}\pagename{Sida}%
  \providecaptionname{swedish}\phonename{Telefon}%
  \providecaptionname{swedish}\mobilephonename{Mobiltelefon}%
  \providecaptionname{swedish}\faxname{Telefax}%
  \providecaptionname{swedish}\emailname{E-post}%
  \providecaptionname{swedish}\wwwname{Hemsida}%
  \providecaptionname{swedish}\bankname{Bankgiro}% PlusGiro
  \g@addnumerical@date{swedish}{\number\day/\number\month~\number\year}%
  \providecaptionname{polish}\yourrefname{Wasz znak}%
  \providecaptionname{polish}\yourmailname{Wasze pismo z dnia}%
  \providecaptionname{polish}\myrefname{Nasz znak}%
  \providecaptionname{polish}\customername{Numer klienta}%
  \providecaptionname{polish}\invoicename{Numer rachunku}%
  \providecaptionname{polish}\subjectname{Dotyczy}%
  \providecaptionname{polish}\ccname{Rozdzielnik}%
  \providecaptionname{polish}\enclname{Za\l\aob{}czniki}%
  \providecaptionname{polish}\headtoname{Do}%
  \providecaptionname{polish}\headfromname{Od}%
  \providecaptionname{polish}\datename{Data}%
  \providecaptionname{polish}\pagename{Strona}%
  \providecaptionname{polish}\phonename{Telefon}%
  \providecaptionname{polish}\mobilephonename{Numer mobilny}%
  \providecaptionname{polish}\faxname{Fax}%
  \providecaptionname{polish}\emailname{E-mail}%
  \providecaptionname{polish}\wwwname{URL}%
  \providecaptionname{polish}\bankname{Konto}%
  \g@addnumerical@date{polish}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{czech}\yourrefname{Va\v{s}e zna\v{c}ka}%
  \providecaptionname{czech}\yourmailname{V\'{a}\v{s} dopis ze dne}%
  \providecaptionname{czech}\myrefname{Na\v{s}e zna\v{c}ka}%
  \providecaptionname{czech}\customername{Z\'akaznick\'e \v{c}\'{\i}slo}%
  \providecaptionname{czech}\invoicename{Fakura\v{c}n\'{\i} \v{c}\'{\i}slo}%
  \providecaptionname{czech}\subjectname{Pr\v{e}dm\v{e}t}%
  \providecaptionname{czech}\ccname{Kopie}%
  \providecaptionname{czech}\enclname{P\v{r}\'{\i}loha}%
  \providecaptionname{czech}\headtoname{Komu}%
  \providecaptionname{czech}\headfromname{Od}%
  \providecaptionname{czech}\datename{Datum}%
  \providecaptionname{czech}\pagename{Strana}%
  \providecaptionname{czech}\phonename{Telefon}%
  \providecaptionname{czech}\mobilephonename{Mobil}%
  \providecaptionname{czech}\faxname{Fax}%
  \providecaptionname{czech}\emailname{E-Mail}%
  \providecaptionname{czech}\wwwname{URL}%
  \providecaptionname{czech}\bankname{Bankovn\'{\i} spojen\'{\i}}%
  \g@addnumerical@date{czech}{\number\day.\,\number\month.\,\number\year}%
  \providecaptionname{slovak}\yourrefname{Va\v{s}a zna\v{c}ka}%
  \providecaptionname{slovak}\yourmailname{V\'{a}\v{s} list zo d\v{n}a}%
  \providecaptionname{slovak}\myrefname{Na\v{s}a zna\v{c}ka}%
  \providecaptionname{slovak}\customername{Z\'akazn\'{\i}cke \v{c}\'{\i}slo}%
  \providecaptionname{slovak}\invoicename{\'{C}\'{\i}slo fakt\'ury}%
  \providecaptionname{slovak}\subjectname{Predmet}%
  \providecaptionname{slovak}\ccname{K\'{o}pia pre koho}%
  \providecaptionname{slovak}\enclname{Pr\'{\i}loha}%
  \providecaptionname{slovak}\headtoname{Komu}%
  \providecaptionname{slovak}\headfromname{Od}%
  \providecaptionname{slovak}\datename{D\'{a}tum}%
  \providecaptionname{slovak}\pagename{Strana}%
  \providecaptionname{slovak}\phonename{Telef\'{o}n}%
  \providecaptionname{slovak}\mobilephonename{Mobil}%
  \providecaptionname{slovak}\faxname{Fax}%
  \providecaptionname{slovak}\emailname{E-Mail}%
  \providecaptionname{slovak}\wwwname{URL}%
  \providecaptionname{slovak}\bankname{Bankov\'{e} spojenie}%
  \g@addnumerical@date{slovak}{\number\day.\,\number\month.\,\number\year}%
  \captionsenglish
  \dateenglish
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname date\languagename\endcsname\relax
    \PackageWarningNoLine{scrletter}
    {%
      \string\language\space is \the\language, \string\languagename\space is
      `\languagename'\MessageBreak
      but \expandafter\string\csname
      date\languagename\endcsname\space not defined!\MessageBreak
      This seems to be a bug at you're `hyphen.cfg'.\MessageBreak
      Undefining macro \string\languagename\space to avoid errors%
    }%
    \let\languagename=\undefined
  \fi
  \ifx\languagename\undefined
    \PackageWarningNoLine{scrletter}
    {\string\languagename\space not
      defined, using \string\language.\MessageBreak
      This may result in use of wrong language!\MessageBreak
      You should use a compatible language
      package\MessageBreak
      (e.g. `Babel', `german', `ngerman', ...)}%
    \ifx\l@american\undefined\else\ifnum\language=\l@american
        \@nameuse{captionsamerican}%
        \@nameuse{extrasamerican}%
        \@nameuse{dateamerican}%
    \fi\fi
    \ifx\l@australian\undefined\else\ifnum\language=\l@australian
        \@nameuse{captionsaustralian}%
        \@nameuse{extrasaustralian}%
        \@nameuse{dateaustralian}%
    \fi\fi
    \ifx\l@british\undefined\else\ifnum\language=\l@british
        \@nameuse{captionsbritish}%
        \@nameuse{extrasbritish}%
        \@nameuse{datebritish}%
    \fi\fi
    \ifx\l@canadian\undefined\else\ifnum\language=\l@canadian
        \@nameuse{captionscanadian}%
        \@nameuse{extrascanadian}%
        \@nameuse{datecanadian}%
    \fi\fi
    \ifx\l@newzealand\undefined\else\ifnum\language=\l@newzealand
        \@nameuse{captionsnewzealand}%
        \@nameuse{extrasnewzealand}%
        \@nameuse{datenewzealand}%
    \fi\fi
    \ifx\l@UKenglish\undefined\else\ifnum\language=\l@UKenglish
        \@nameuse{captionsUKenglish}%
        \@nameuse{extrasUKenglish}%
        \@nameuse{dateUKenglish}%
    \fi\fi
    \ifx\l@ukenglish\undefined\else\ifnum\language=\l@ukenglish
        \@nameuse{captionsukenglish}%
        \@nameuse{extrasukenglish}%
        \@nameuse{dateukenglish}%
    \fi\fi
    \ifx\l@USenglish\undefined\else\ifnum\language=\l@USenglish
        \@nameuse{captionsUSenglish}%
        \@nameuse{extrasUSenglish}%
        \@nameuse{dateUSenglish}%
    \fi\fi
    \ifx\l@usenglish\undefined\else\ifnum\language=\l@usenglish
        \@nameuse{captionsusenglish}%
        \@nameuse{extrasusenglish}%
        \@nameuse{dateusenglish}%
    \fi\fi
    \ifx\l@austrian\undefined\else\ifnum\language=\l@austrian
        \@nameuse{captionsaustrian}%
        \@nameuse{extrasaustrian}%
        \@nameuse{dateaustrian}%
    \fi\fi
    \ifx\l@naustrian\undefined\else\ifnum\language=\l@naustrian
        \@nameuse{captionsnaustrian}%
        \@nameuse{extrasnaustrian}%
        \@nameuse{datenaustrian}%
    \fi\fi
    \ifx\l@german\undefined\else\ifnum\language=\l@german
        \@nameuse{captionsgerman}%
        \@nameuse{extrasgerman}%
        \@nameuse{dategerman}%
    \fi\fi
    \ifx\l@ngerman\undefined\else\ifnum\language=\l@ngerman
        \@nameuse{captionsngerman}%
        \@nameuse{extrasngerman}%
        \@nameuse{datengerman}%
    \fi\fi
    \ifx\l@swissgerman\undefined\else\ifnum\language=\l@swissgerman
        \@nameuse{captionsswissgerman}%
        \@nameuse{extrasswissgerman}%
        \@nameuse{dateswissgerman}%
    \fi\fi
    \ifx\l@nswissgerman\undefined\else\ifnum\language=\l@nswissgerman
        \@nameuse{captionsnswissgerman}%
        \@nameuse{extrasnswissgerman}%
        \@nameuse{datenswissgerman}%
    \fi\fi
    \ifx\l@acadian\undefined\else\ifnum\language=\l@acadian
        \@nameuse{captionsacadian}%
        \@nameuse{extrasacadian}%
        \@nameuse{dateacadian}%
    \fi\fi
    \ifx\l@canadien\undefined\else\ifnum\language=\l@canadien
        \@nameuse{captionscanadien}%
        \@nameuse{extrascanadien}%
        \@nameuse{datecanadien}%
    \fi\fi
    \ifx\l@francais\undefined\else\ifnum\language=\l@francais
        \@nameuse{captionsfrancais}%
        \@nameuse{extrasfrancais}%
        \@nameuse{datefrancais}%
    \fi\fi
    \ifx\l@french\undefined\else\ifnum\language=\l@french
        \@nameuse{captionsfrench}%
        \@nameuse{extrasfrench}%
        \@nameuse{datefrench}%
    \fi\fi
    \ifx\l@italian\undefined\else\ifnum\language=\l@italian
        \@nameuse{captionsitalian}%
        \@nameuse{extrasitalian}%
        \@nameuse{dateitalian}%
    \fi\fi
    \ifx\l@spanish\undefined\else\ifnum\language=\l@spanish
        \@nameuse{captionsspanish}%
        \@nameuse{extrasspanish}%
        \@nameuse{datespanish}%
    \fi\fi
    \ifx\l@croatian\undefined\else\ifnum\language=\l@croatian
        \@nameuse{captionscroatian}%
        \@nameuse{extrascroatian}%
        \@nameuse{datecroatian}%
    \fi\fi
    \ifx\l@dutch\undefined\else\ifnum\language=\l@dutch
        \@nameuse{captionsdutch}%
        \@nameuse{extrasdutch}%
        \@nameuse{datedutch}%
    \fi\fi
    \ifx\l@finnish\undefined\else\ifnum\language=\l@finnish
        \@nameuse{captionsfinnish}%
        \@nameuse{extrasfinnish}%
        \@nameuse{datefinnish}%
    \fi\fi
    \ifx\l@norsk\undefined\else\ifnum\language=\l@norsk
        \@nameuse{captionsnorsk}%
        \@nameuse{extrasnorsk}%
        \@nameuse{datenorsk}%
    \fi\fi
    \ifx\l@swedish\undefined\else\ifnum\language=\l@swedish
        \@nameuse{captionsswedish}%
        \@nameuse{extrasswedish}%
        \@nameuse{dateswedish}%
    \fi\fi
    \ifx\l@polish\undefined\else\ifnum\language=\l@polish
        \@nameuse{captionspolish}%
        \@nameuse{extraspolish}%
        \@nameuse{datepolish}%
    \fi\fi
    \ifx\l@czech\undefined\else\ifnum\language=\l@czech
        \@nameuse{captionsczech}%
        \@nameuse{extrasczech}%
        \@nameuse{dateczech}%
    \fi\fi
    \ifx\l@slovak\undefined\else\ifnum\language=\l@slovak
        \@nameuse{captionsslovak}%
        \@nameuse{extrasslovak}%
        \@nameuse{dateslovak}%
    \fi\fi
  \else
    \edef\@tempa{nohyphenation}%
    \ifx\languagename\@tempa
      \PackageWarningNoLine{scrletter}
      {%
        You've selected language `\languagename'.\MessageBreak
        Maybe your LaTeX format contains Babel extension\MessageBreak
        but you have not selected a language using\MessageBreak
        Babel package.\MessageBreak
        Please select another language!\MessageBreak
        Only as a workaround english captions and date\MessageBreak
        will be used%
      }%
    \else
      \PackageInfo{scrletter}
      {%
        trying to activate captions and date\MessageBreak
        of language `\languagename'%
      }%
      \csname date\languagename\endcsname
      \csname captions\languagename\endcsname
      \PackageInfo{scrletter}
      {%
        used language is `\languagename'.\MessageBreak
        Supported languages are: `english', `UKenglish',\MessageBreak
        `ukenglish', `british', `american', `USenglish',\MessageBreak
        `usenglish', `australian`,`canadian', `newzealand',\MessageBreak
        `german', `ngerman', `austrian', `naustrian',\MessageBreak
        `swissgerman', `nswissgermsn',\MessageBreak
        `acadian', `canadien', `francais', `french', \MessageBreak
        `dutch', `italian', `spanish', `polish',\MessageBreak
        `croatian', `finnish', `norsk', `swedish',\MessageBreak
        `czech', `slovak'%
      }%
    \fi
  \fi
}
%%% From File: $Id: scrkernel-variables.dtx 4151 2025-06-02 11:34:40Z kohm $
%%%            (run: body)
\NewDocumentCommand{\newkomavar}{som}{%
  \@ifundefined{scr@#3@name}{%
    \@ifundefined{scr@#3@var}{%
      \IfValueT{#2}{\@namedef{scr@#3@name}{#2}}%
      \@namedef{scr@#3@var}{}%
      \IfBooleanT{#1}{\addtoreffields{#3}}%
    }{%
      \PackageError{scrletter}
      {%
        This should never happen%
      }{%
        The description of the KOMA-Script variable `#3'\MessageBreak
        is undefined, but the name of the variable is
        defined.\MessageBreak
        This should never happen. So someone crashs me!%
      }%
    }%
  }{%
    \PackageError{scrletter}
    {%
      Variable `#3' already defined%
    }{%
      I'll ignore this command, if you'll continue.%
    }%
  }%
}
\NewDocumentCommand{\setkomavar}{smo+m}{%
  \Ifkomavar{#2}{%
    \IfValueT{#3}{\@namedef{scr@#2@name}{#3}}%
    \@namedef{scr@#2@\IfBooleanTF{#1}{name}{var}}{#4}%
    \csname scr@#2@postset\IfBooleanTF{#1}{name}{var}\endcsname
  }{%
    \@komavar@err{set}{#2}%
  }%
}
\newcommand*{\@komavar@err}[2]{%
  \PackageError{scrletter}
  {%
    KOMA-Script variable not defined%
  }{%
    You've tried to #1 the not defined KOMA-Script variable
    `#2'.\MessageBreak
    You have to define the variable using \string\newkomavar\space
    before\MessageBreak
    you do this.%
  }%
}
\NewDocumentCommand{\usekomavar}{sO{\@firstofone}m}{%
  \Ifkomavar{#3}{%
    \IfBooleanTF{#1}{%
      #2{\@nameuse{scr@#3@name}}%
    }{%
      #2{\@nameuse{scr@#3@var}}%
    }%
  }{%
    \@komavar@err{use}{#3}%
  }%
}
\newcommand*{\ifkomavar}{%
  \PackageWarning{scrletter}{%
    Usage of deprecated command `\string\ifkomavar'.\MessageBreak
    The command has been renamed to because of a\MessageBreak
    recommendation of LaTeX3 team members.\MessageBreak
    Please replace `\string\ifkomavar' by `\string\Ifkomavar'%
  }%
  \Ifkomavar
}
\DeclareRobustCommand*{\Ifkomavar}[1]{%
  \scr@ifundefinedorrelax{scr@#1@var}{%
    \expandafter\@secondoftwo
  }{%
    \expandafter\@firstoftwo
  }%
}
\newcommand*{\ifkomavarempty}{%
  \PackageWarning{scrletter}{%
    Usage of deprecated command `\string\ifkomavarempty'.\MessageBreak
    The command has been renamed to because of a\MessageBreak
    recommendation of LaTeX3 team members.\MessageBreak
    Please replace `\string\ifkomavarempty' by `\string\Ifkomavarempty'%
  }%
  \Ifkomavarempty
}
\NewDocumentCommand{\Ifkomavarempty}{sm}{%
  \Ifkomavar{#2}{%
    \IfBooleanTF{#1}{%
      \@ifundefined{scr@#2@name}\@firstoftwo{%
        \expandafter\ifx\csname scr@#2@name\endcsname\@empty
          \expandafter\@firstoftwo
        \else
          \expandafter\@secondoftwo
        \fi
      }%
    }{%
      \expandafter\ifx\csname scr@#2@var\endcsname\@empty
        \expandafter\@firstoftwo
      \else
        \expandafter\@secondoftwo
      \fi
    }
  }{%
    \@komavar@err{use}{#2}%
    \@gobbletwo
  }%
}
\NewDocumentCommand{\Ifkomavarxempty}{sm}{%
  \Ifkomavar{#2}{%
    \IfBooleanTF{#1}{%
      \@ifundefined{scr@#2@name}\@firstoftwo{%
        \Ifstr{\@nameuse{scr@#2@name}}{}%
      }%
    }{%
      \Ifstr{\@nameuse{scr@#2@var}}{}%
    }%
  }{%
    \@komavar@err{use}{#2}%
    \@gobbletwo
  }%
}
\newcommand*{\foreachkomavar}[2]{%
  \@for \reserved@a:=#1\do{%
    \scr@trim@spaces\reserved@a
    \ifx\reserved@a\@empty\else
      \edef\reserved@a{\unexpanded{#2}{\reserved@a}}\expandafter\reserved@a
    \fi
  }%
}
\newcommand*{\foreachkomavarifempty}[3]{%
  \@for \reserved@a:=#1\do{%
    \scr@trim@spaces\reserved@a
    \ifx\reserved@a\@empty\else
      \edef\reserved@a{%
        \noexpand\Ifkomavarempty{\reserved@a}%
        {\unexpanded{#2}{\reserved@a}}%
        {\unexpanded{#3}{\reserved@a}}%
      }\expandafter\reserved@a
    \fi
  }%
}
\newcommand*{\foreachemptykomavar}[2]{%
  \@for \reserved@a:=#1\do{%
    \scr@trim@spaces\reserved@a
    \ifx\reserved@a\@empty\else
      \edef\reserved@a{%
        \noexpand\Ifkomavarempty{\reserved@a}{\unexpanded{#2}{\reserved@a}}{}%
      }\expandafter\reserved@a
    \fi
  }%
}
\newcommand*{\foreachnonemptykomavar}[2]{%
  \@for \reserved@a:=#1\do{%
    \scr@trim@spaces\reserved@a
    \ifx\reserved@a\@empty\else
      \edef\reserved@a{%
        \noexpand\Ifkomavarempty{\reserved@a}{}{\unexpanded{#2}{\reserved@a}}%
      }\expandafter\reserved@a
    \fi
  }%
}
%%% From File: $Id: scrkernel-pseudolengths.dtx 4032 2023-04-17 09:45:11Z kohm $
%%%            (run: body)
\newcommand*{\Ifplength}[1]{%
  \@ifundefined{ltr@len@#1}{\@secondoftwo}{\@firstoftwo}%
}
\newcommand*{\if@plength}{%
  \PackageWarning{scrletter}{%
    Internal macro `\string\if@plength' is deprecated.\MessageBreak
    Please use `\string\Ifplength' instead}%
  \Ifplength
}
\newcommand*{\newplength}[1]{%
  \@ifundefined{ltr@len@#1}{%
    \expandafter\let\csname ltr@len@#1\endcsname=\z@%
  }{%
    \PackageError{scrletter}%
    {%
      pseudo-length \expandafter\string\csname ltr@len@#1\endcsname
      already defined%
    }{%
      You've tried to define a new pseudo-length using\MessageBreak
      \string\@newplength\space
      or \string\newplength.\MessageBreak
      Please, try another name%
    }%
  }%
}
\newcommand*{\@newplength}{%
  \PackageWarning{scrletter}{%
    Internal macro `\string\@newplength' is deprecated.\MessageBreak
    Please use `\string\newplength' instead}%
  \newplength
}
\newcommand*{\useplength}[1]{%
  \glueexpr \csname ltr@len@#1\endcsname\relax}%
\newcommand*{\setlengthtoplength}[3][]{%
  \setlength{#2}{\useplength{#3}}%
  \setlength{#2}{#1#2}}
\newcommand*{\setplength}[3][]{%
  \begingroup%
    \setlength{\@tempskipa}{\glueexpr #3\relax}%
    \setlength{\@tempskipa}{#1\@tempskipa}%
    \edef\@tempa{\noexpand\endgroup%
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempskipa}%
    }%
  \@tempa
}
\newcommand*{\@setplength}{%
  \PackageWarning{scrletter}{%
    Internal macro `\string\@setplength' is deprecated.\MessageBreak
    Please use `\string\setplength' instead}%
  \setplength
}
\newcommand*{\setplengthtowidth}[3][]{%
  \begingroup
    \settowidth{\@tempdima}{#3}%
    \setlength{\@tempdima}{#1\@tempdima}%
    \edef\@tempa{\noexpand\endgroup
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempdima}%
    }%
  \@tempa
}
\newcommand*{\setplengthtoheight}[3][]{%
  \begingroup
    \settoheight{\@tempdima}{#3}%
    \setlength{\@tempdima}{#1\@tempdima}%
    \edef\@tempa{\noexpand\endgroup
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempdima}%
    }%
  \@tempa
}
\newcommand*{\setplengthtodepth}[3][]{%
  \begingroup
    \settodepth{\@tempdima}{#3}%
    \setlength{\@tempdima}{#1\@tempdima}%
    \edef\@tempa{\noexpand\endgroup
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempdima}%
    }%
  \@tempa
}
\newcommand*{\setplengthtototalheight}[3][]{%
  \begingroup
    \settoheight{\@tempdima}{#3}%
    \settodepth{\@tempdimb}{#3}%
    \addtolength{\@tempdima}{\@tempdimb}%
    \setlength{\@tempdima}{#1\@tempdima}%
    \edef\@tempa{\noexpand\endgroup
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempdima}%
    }%
  \@tempa
}
\newcommand*{\addtolengthplength}[3][]{%
  \begingroup%
    \setlengthtoplength[{#1}]{\@tempskipa}{#3}%
    \edef\@tempa{\endgroup%
      \noexpand\addtolength{#2}{\the\@tempskipa}}%
  \@tempa%
}
\newcommand*{\addtoplength}[3][]{%
  \begingroup%
    \setlength{\@tempskipa}{\glueexpr #3\relax}%
    \setlength{\@tempskipa}{#1\@tempskipa}%
    \addtolengthplength{\@tempskipa}{#2}%
    \edef\@tempa{\noexpand\endgroup%
      \noexpand\expandafter\noexpand\renewcommand\noexpand\expandafter*%
      \noexpand\csname ltr@len@#2\noexpand\endcsname{\the\@tempskipa}%
      }%
  \@tempa%
}
\newcommand*{\@addtoplength}{%
  \PackageWarning{scrletter}{%
    Internal macro `\string\@addtoplength' is deprecated.\MessageBreak
    Please use `\string\addtoplength' instead}%
  \addtoplength}
%%% From File: $Id: scrkernel-pagestyles.dtx 4058 2023-06-16 08:32:27Z kohm $
%%%            (run: body)
\newcommand*{%
  \letterpagemark
}{%
  {\usekomafont{pagenumber}{%
    \pagename\nobreakspace
    \thepage}}}
\RequirePackage{scrlayer-scrpage}
\newpairofpagestyles{letter}{%
  \clearpairofpagestyles
  \lehead[\ifnum\@pageat=\z@\pagemark\fi]%
         {\usekomavar{nexthead}}%
  \lohead[\ifnum\@pageat=\z@\pagemark\fi]%
         {\usekomavar{nexthead}}%
  \chead[\ifnum\@pageat=\@ne\pagemark\fi]%
        {}%
  \rehead[\ifnum\@pageat=\tw@\pagemark\fi]%
         {}%
  \rohead[\ifnum\@pageat=\tw@\pagemark\fi]%
         {}%
  \lefoot[\ifnum\@pageat=\thr@@\pagemark\fi]%
         {\usekomavar{nextfoot}}%
  \lofoot[\ifnum\@pageat=\thr@@\pagemark\fi]%
         {\usekomavar{nextfoot}}%
  \cfoot[\ifnum\@pageat=4 \pagemark\fi]%
        {}%
  \refoot[\ifnum\@pageat=5 \pagemark\fi]%
         {}%
  \rofoot[\ifnum\@pageat=5 \pagemark\fi]%
         {}%
}
%%% From File: $Id: scrkernel-notepaper.dtx 4220 2025-09-05 12:10:03Z kohm $
%%%            (run: body)

\newkomavar{firsthead}
\setkomavar{firsthead}{%
  \parbox[b]{\useplength{firstheadwidth}}%
  {\centering\usekomafont{fromaddress}{%
      \Ifkomavarempty{fromname}{}{%
        {\usekomafont{fromname}%
          {\ignorespaces\usekomavar{fromname}}\\[-8pt]}
        {\usekomafont{fromrule}{\rule{\useplength{firstheadwidth}}{.4pt}}}\\
      }%
      \Ifkomavarempty{fromaddress}{}{%
        \ignorespaces\usekomavar{fromaddress}%
      }%
    }%
  }%
}
\newcommand*{\scr@firsthead@postsetvar}{%
  \KOMAExecuteOptions[%
    scrletter.\scr@pkgextension
  ]{fromalign=no}%
}
\newcommand*{\@gen@firsthead}{%
  \ifcase\@alignfrom
    \setkomavar{firsthead}{%
      \parbox[b]{\textwidth}{\raggedright
        {\usekomafont{fromname}\strut\ignorespaces
          \usekomavar{fromname}%
          {%
            \ifnum\@rulefrom=1\\[-.5\baselineskip]%
              \usekomafont{fromrule}{%
                \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                \ifdim\@tempdima=\z@
                  \setlength{\@tempdima}{\textwidth}%
                  \if@logo
                    \settowidth{\@tempdimb}{\usekomavar{fromlogo}}%
                    \addtolength{\@tempdima}{-\@tempdimb}%
                  \fi
                \fi
                \expandafter\rule\expandafter{\the\@tempdima}{%
                  \useplength{fromrulethickness}}}%
            \fi
          }%
          \\
        }%
        {\usekomafont{fromaddress}\strut\ignorespaces
          \usekomavar{fromaddress}%
          \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
          \if@mobilephone
            \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
          \fi%
          \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
          \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
          \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
          \ifnum\@rulefrom=2\\[-.5\baselineskip]%
            \usekomafont{fromrule}{%
              \setlength{\@tempdima}{\useplength{fromrulewidth}}%
              \ifdim\@tempdima=\z@
                \setlength{\@tempdima}{\textwidth}%
              \fi
              \expandafter\rule\expandafter{\the\@tempdima}{%
                \useplength{fromrulethickness}}}%
          \fi
          \\
        }%
      }%
      \if@logo
        \llap{\usekomavar{fromlogo}}%
      \fi
    }%
    \renewcommand*{\@alignfrom}{0}%
  \or
    \setkomavar{firsthead}{%
      \parbox[b]{\textwidth}{\centering
        {\usekomafont{fromname}\strut\ignorespaces
          \usekomavar{fromname}%
          {%
            \ifnum\@rulefrom=1\\[-.5\baselineskip]%
              \usekomafont{fromrule}{%
                \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                \ifdim\@tempdima=\z@
                  \setlength{\@tempdima}{\textwidth}%
                \fi
                \expandafter\rule\expandafter{\the\@tempdima}{%
                  \useplength{fromrulethickness}}}%
            \fi
          }%
          \\
        }%
        {\usekomafont{fromaddress}\strut\ignorespaces
          \usekomavar{fromaddress}%
          \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
          \if@mobilephone
            \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
          \fi%
          \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
          \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
          \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
          \ifnum\@rulefrom=2\\[-.5\baselineskip]%
            \usekomafont{fromrule}{%
              \setlength{\@tempdima}{\useplength{fromrulewidth}}%
              \ifdim\@tempdima=\z@
                \setlength{\@tempdima}{\textwidth}%
              \fi
              \expandafter\rule\expandafter{\the\@tempdima}{%
                \useplength{fromrulethickness}}}%
          \fi
          \\
        }%
      }%
    }%
    \renewcommand*{\@alignfrom}{1}%
  \or
    \setkomavar{firsthead}{%
      \if@logo
        \rlap{\usekomavar{fromlogo}}%
      \fi
      \parbox[b]{\textwidth}{\raggedleft
        {\usekomafont{fromname}\strut\ignorespaces
          \usekomavar{fromname}%
          {%
            \ifnum\@rulefrom=1\\[-.5\baselineskip]%
              \usekomafont{fromrule}{%
                \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                \ifdim\@tempdima=\z@
                  \setlength{\@tempdima}{\textwidth}%
                  \if@logo
                    \settowidth{\@tempdimb}{\usekomavar{fromlogo}}%
                    \addtolength{\@tempdima}{-\@tempdimb}%
                  \fi
                \fi
                \expandafter\rule\expandafter{\the\@tempdima}{%
                  \useplength{fromrulethickness}}}%
            \fi
          }%
          \\
        }%
        {\usekomafont{fromaddress}\strut\ignorespaces
          \usekomavar{fromaddress}%
          \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
          \if@mobilephone
            \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
          \fi%
          \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
          \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
          \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
          \ifnum\@rulefrom=2\\[-.5\baselineskip]%
            \usekomafont{fromrule}{%
              \setlength{\@tempdima}{\useplength{fromrulewidth}}%
              \ifdim\@tempdima=\z@
                \setlength{\@tempdima}{\textwidth}%
              \fi
              \expandafter\rule\expandafter{\the\@tempdima}{%
                \useplength{fromrulethickness}}}%
          \fi
          \\
        }%
      }%
    }%
    \renewcommand*{\@alignfrom}{2}%
  \fi
}
\newkomafont{foldmark}{}
\newkomafont{fromname}{}
\newkomafont{fromaddress}{}
\newkomafont{fromrule}{}
\newkomafont{backaddress}{\maybesffamily}
\newkomafont{specialmail}{}
\newkomafont{priority}{\fontsize{10pt}{10pt}\sffamily\bfseries}
\newkomafont{prioritykey}{\fontsize{24.88pt}{24.88pt}\selectfont}
\newkomafont{PPlogo}{\sffamily\bfseries}
\newkomafont{PPdata}{\sffamily}
\newkomafont{addressee}{}
\newkomafont{toname}{}
\newkomafont{toaddress}{}
\newkomafont{refname}{\maybesffamily\scriptsize}
  \newkomafont{refvalue}{}
\newkomafont{placeanddate}{}
\newkomafont{lettertitle}{\normalcolor\maybesffamily\bfseries}
\scr@ifundefinedorrelax{scr@fnt@title}{%
  \aliaskomafont{title}{lettertitle}%
}{}
\newkomafont{lettersubject}{\normalfont\bfseries}
\scr@ifundefinedorrelax{scr@fnt@subject}{%
  \aliaskomafont{subject}{lettersubject}%
}{}
\newplength{foldmarkhpos}
\newplength{foldmarkvpos}
\newplength{tfoldmarkvpos}
\newplength{mfoldmarkvpos}
\newplength{bfoldmarkvpos}
\newplength{lfoldmarkhpos}
\newplength{pfoldmarklength}
\newplength{tfoldmarklength}
\newplength{mfoldmarklength}
\newplength{bfoldmarklength}
\newplength{lfoldmarklength}
\newplength{foldmarkthickness}
\setplength{foldmarkthickness}{.2pt}
\newplength{toaddrvpos}
\newplength{backaddrheight}
\newplength{toaddrhpos}
\newplength{specialmailindent}
\newplength{specialmailrightindent}
\newplength{toaddrindent}
\newplength{PPheadheight}
\newplength{PPheadwidth}
\newplength{PPdatamatrixvskip}
\newplength{toaddrwidth}
\newplength{toaddrheight}
\newplength{locvpos}
\newplength{locwidth}
\newplength{lochpos}
\newplength{locheight}
\newplength{refvpos}
\newplength{refwidth}
\newplength{refhpos}
\newplength{refaftervskip}
\newplength{sigbeforevskip}
\newplength{sigindent}
\newplength{firstfootvpos}
\newplength{firstfootwidth}
\newplength{firstfoothpos}
\setplength{firstfoothpos}{\maxdimen}
\newplength{firstheadvpos}
\newplength{firstheadwidth}
\newplength{firstheadhpos}
\setplength{firstheadhpos}{\maxdimen}
\newplength{fromrulewidth}
\setplength{fromrulewidth}{0pt}
\newplength{fromrulethickness}
\setplength{fromrulethickness}{.4pt}
\newkomavar{firstfoot}
\newcommand*{\move@topt}{%
  \null\vskip -1in\vskip -\topmargin%
  \vskip -\headheight\vskip -\headsep%
  \vskip -\topskip%
  \ignorespaces%
}
\newcommand*{\move@frompt}{%
  \vskip 1in\vskip \topmargin%
  \vskip \headheight\vskip \headsep%
  \vskip \topskip%
  \vskip -\baselineskip%
  \ignorespaces%
}
\newcommand*{\move@topl}{%
  \null\hskip -1in%
  \ifodd\value{page}\hskip -\oddsidemargin\else\hskip -\evensidemargin\fi
  \ignorespaces%
}
\newcommand*{\move@frompl}{%
  \hskip 1in%
  \ifodd\value{page}\hskip \oddsidemargin\else\hskip \evensidemargin\fi%
  \ignorespaces%
}
\newcommand{\vb@t@z}[1]{{%
    \setbox\z@\vbox to\z@{\color@begingroup #1\color@endgroup\vss}%
    \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
    \setlength{\baselineskip}{\z@}%
    \setlength{\@tempdima}{\ht0}\addtolength{\@tempdima}{\dp0}%
    \box\z@\vskip-\@tempdima%
  }%
}
\newcommand*{\@foldmark}[2]{%
  \vb@t@z{\setlength{\@tempdima}{#1}%
    \addtolengthplength[-.5]{\@tempdima}{foldmarkthickness}%
    \vskip \@tempdima
    \rlap{\move@topl\hskip\useplength{foldmarkhpos}%
      \usekomafont{foldmark}{%
        \rule{#2}{\useplength{foldmarkthickness}}}}}%
  \ignorespaces
}
\newcommand*{\@hfoldmark}[1]{%
  \begingroup
    \@expandtwoargs\in@{#1}{\@usefolds}%
    \ifin@
      \lowercase{%
        \edef\@tempa{%
          \noexpand\ifdim \noexpand\useplength{#1foldmarkvpos}=\noexpand\z@
          \noexpand\else
            \noexpand\@foldmark{%
              \noexpand\useplength{#1foldmarkvpos}%
            }{%
              \noexpand\useplength{#1foldmarklength}%
            }%
          \noexpand\fi
        }%
      }%
      \@tempa
    \fi
  \endgroup
}
\newcommand*{\@vfoldmark}[1]{%
  \begingroup
    \ifdim \useplength{lfoldmarkhpos}=\z@\else
      \@expandtwoargs\in@{#1}{\@usefolds}%
      \ifin@
      \fi
    \fi
  \endgroup
}
\newcommand*{\@foldmarks}{%
  \if@fold%
    \move@topt
    \ifdim \useplength{pfoldmarklength}=\z@
      \setplength{pfoldmarklength}{4mm}%
    \fi
    \ifdim \useplength{tfoldmarklength}=\z@
      \setplength{tfoldmarklength}{2mm}%
    \fi
    \ifdim \useplength{mfoldmarklength}=\z@
      \setplength{mfoldmarklength}{2mm}%
    \fi
    \ifdim \useplength{bfoldmarklength}=\z@
      \setplength{bfoldmarklength}{2mm}%
    \fi
    \ifdim \useplength{lfoldmarklength}=\z@
      \setplength{lfoldmarklength}{4mm}%
    \fi
    \begingroup
      \@expandtwoargs\in@{P}{\@usefolds}%
      \ifin@
        \@foldmark{.5\paperheight}{\useplength{pfoldmarklength}}%
      \fi
    \endgroup
    \@hfoldmark{T}%
    \@hfoldmark{M}%
    \@hfoldmark{B}%
    \@vfoldmark{L}%
    \move@frompt
  \fi%
}
\newif\if@savevbox@warning\@savevbox@warningtrue
\newcommand{\@savevbox}[6][]{%
  \begingroup%
    \vbox to #2{#1#3}%
    \if@savevbox@warning\@savevbox@warningfalse%
      \setbox\z@\vbox{\color@begingroup #3\color@endgroup}%
      \setlength{\@tempdima}{#2}%
      \setlength{\@tempdimb}{\ht0}\addtolength{\@tempdimb}{\dp0}%
      \ifdim \@tempdimb>\@tempdima%
        \addtolength{\@tempdimb}{-\@tempdima}%
        \PackageWarning{scrletter}{%
          #4 is \the\@tempdimb\space too high.\MessageBreak
          You have to change `\string#5'\MessageBreak
          or you have to define a smaller\MessageBreak
          #4 using \string#6.\MessageBreak
          Because of this too high #4\MessageBreak
          you've got an overfull \string\vbox\space message%
        }%
      \fi%
    \fi%
  \endgroup%
}
\newcommand*{\@firstheadfootfield}{%
  \if@firsthead
    \move@topt\vskip\useplength{firstheadvpos}%
    \vb@t@z{%
      \rlap{\move@topl
        \ifdim\useplength{firstheadhpos}<\paperwidth
          \ifdim \useplength{firstheadhpos}>-\paperwidth
            \ifdim \useplength{firstheadhpos}<\z@
              \setlength\@tempskipa{\paperwidth}%
              \addtolengthplength{\@tempskipa}{firstheadhpos}%
              \addtolengthplength[-]{\@tempskipa}{firstheadwidth}%
            \else
              \setlength{\@tempskipa}{\useplength{firstheadhpos}}%
            \fi
          \else
            \setlength\@tempskipa{\oddsidemargin}%
            \addtolength\@tempskipa{1in}%
          \fi
        \else
          \setlength\@tempskipa{.5\paperwidth}%
          \addtolengthplength[-.5]{\@tempskipa}{firstheadwidth}%
        \fi
        \hskip\@tempskipa
        \vbox{\hsize\useplength{firstheadwidth}%
          \setlength{\@tempskipa}{\useplength{toaddrvpos}}%
          \addtolengthplength[-1]{\@tempskipa}{firstheadvpos}%
          \addtolength{\@tempskipa}{-\baselineskip}%
          \setlength{\textwidth}{\useplength{firstheadwidth}}%
          \setlength{\parfillskip}{\z@ \@plus 1fil}%
          \@savevbox{\@tempskipa}{\noindent\usekomavar{firsthead}%
            \vskip \z@ \@plus .00001fil}%
          {head of first page}{firstheadvpos}{\setkomavar}%
        }%
      }%
    }%
    \vskip-\useplength{firstheadvpos}\move@frompt
  \else
  \fi
  \move@topt
  \if@firstfoot
    \vb@t@z{%
      \rlap{\move@topl
         \ifdim\useplength{firstfoothpos}<\paperwidth
          \ifdim \useplength{firstfoothpos}>-\paperwidth
            \ifdim \useplength{firstfoothpos}<\z@
              \setlength\@tempskipa{\paperwidth}%
              \addtolengthplength{\@tempskipa}{firstfoothpos}%
              \addtolengthplength[-]{\@tempskipa}{firstfootwidth}%
            \else
              \setlength{\@tempskipa}{\useplength{firstfoothpos}}%
            \fi
          \else
            \setlength\@tempskipa{\oddsidemargin}%
            \addtolength\@tempskipa{1in}%
          \fi
        \else
          \setlength\@tempskipa{.5\paperwidth}%
          \addtolengthplength[-.5]{\@tempskipa}{firstfootwidth}%
        \fi
        \hskip\@tempskipa
        \vbox{\hsize\useplength{firstfootwidth}%
          \vskip\useplength{firstfootvpos}%
          \setlength{\textwidth}{\useplength{firstfootwidth}}%
          \setlength{\parfillskip}{\z@ \@plus 1fil}%
          \vbox{\hsize\useplength{firstfootwidth}\noindent
            \usekomavar{firstfoot}}%
        }%
      }%
    }%
  \fi
  \move@frompt%
  {%
    \setlength{\@tempdima}{1in}\addtolength{\@tempdima}{\topmargin}%
    \addtolength{\@tempdima}{\headheight}%
    \addtolength{\@tempdima}{\headsep}%
    \addtolength{\@tempdima}{\textheight}%
    \addtolength{\@tempdima}{\footskip}%
    \if@firstfoot
      \addtolengthplength[-1]{\@tempdima}{firstfootvpos}%
    \else
      \addtolength{\@tempdima}{-\paperheight}%
    \fi
    \addtolength{\@tempdima}{-\ht\strutbox}%
    \ifdim \@tempdima > -\maxdepth
      \ifdim \@tempdima < \maxdepth
        \@shrinkfpfalse\@enlargefpfalse
      \fi
    \fi
    \ifdim\@tempdima>\z@\if@shrinkfp\enlargethispage{-\@tempdima}\fi%
    \else\if@enlargefp\enlargethispage{-\@tempdima}\fi\fi
  }%
}
\newcommand*{\@addrfield}{%
  \ifcase \ifnum\@afieldmode=5 \@ne\else\@afieldmode\fi\relax
  \or
    \begingroup%
      \if@baddr
        \Ifkomavarempty{backaddress}{%
          \let\@tempa\@empty\let\@tempb\@empty
        }{%
          \def\@tempa{backaddress}\def\@tempb{,\space}%
        }%
      \else
        \let\@tempa\@empty\let\@tempb\@empty
      \fi
      \ifcase \ltr@priority
        \Ifkomavarempty{specialmail}{}{%
          \edef\@tempa{\@tempa\@tempb specialmail}\def\@tempb{,\space}%
        }%
      \or
        \edef\@tempa{\@tempa\@tempb B-Economy}\def\@tempb{,\space}%
      \or
        \edef\@tempa{\@tempa\@tempb A-Priority}\def\@tempb{,\space}%
      \fi
    \endgroup%
    \move@topt\vskip\useplength{toaddrvpos}%
    \vb@t@z{{\setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
        \rlap{\move@topl
          \setlengthtoplength{\@tempskipa}{toaddrhpos}%
          \ifdim \@tempskipa<\z@
            \addtolength{\@tempskipa}{\paperwidth}%
            \addtolengthplength[-]{\@tempskipa}{toaddrwidth}%
          \fi
          \hskip\@tempskipa
          \@savevbox{\useplength{toaddrheight}}{\hsize\useplength{toaddrwidth}%
            \@savevbox[\vss]{\useplength{backaddrheight}}{%
              \hsize\useplength{toaddrwidth}%
              \if@baddr
                \Ifkomavarempty{backaddress}{}{{%
                    \noindent%
                    \backaddr@format{\scriptsize
                      {%
                        \def\\{\usekomavar{backaddressseparator}\@ogobble}%
                        \usekomafont{backaddress}%
                        {\usekomavar{backaddress}}%
                      }}}}%
              \fi
            }{backaddress}{backaddrheight}{\setkomavar}%
            \ifcase \ltr@priority
            \or
              \setkomavar{specialmail}{%
                {\usekomafont{priority}{%
                    {\usekomafont{prioritykey}{B}}%
                    -ECONOMY}}%
              }%
            \or
              \setkomavar{specialmail}{%
                {\usekomafont{priority}{%
                    {\usekomafont{prioritykey}{A}}%
                    -PRIORITY}}%
              }%
            \fi
            \Ifkomavarempty{specialmail}{}{%
              \vbox{\hsize\useplength{toaddrwidth}%
                \noindent\hspace*{\useplength{specialmailindent}}%
                \specialmail@format{%
                  \usekomafont{specialmail}\usekomavar{specialmail}}%
                \hspace*{\useplength{specialmailrightindent}}}%
            }%
            \ifnum\@afieldmode=\@ne\vfil\fi%
            \noindent\hskip\useplength{toaddrindent}%
            \setlength{\@tempdima}{\useplength{toaddrwidth}}%
            \addtolengthplength[-2]{\@tempdima}{toaddrindent}%
            \vbox{\hsize\@tempdima\raggedright
              \usekomafont{addressee}{%
                {\usekomafont{toname}{\usekomavar{toname}\\}}%
                {\usekomafont{toaddress}{\usekomavar{toaddress}\endgraf}}}}%
            \vfil\null\vskip-\baselineskip}%
          {address field}{toaddrheight}%
          {\begin{letter} or you\MessageBreak
            have to define a smaller special purpose using\MessageBreak
            \string\specialmail}%
        }}}%
    \vskip-\useplength{toaddrvpos}\move@frompt
  \else
    \begingroup%
      \if@baddr
        \let\@tempa\@empty\let\@tempb\@empty
        \ifcase \@afieldmode\relax\or\or
          \def\@tempa{PP-mode}\def\@tempb{,\space}%
        \or
          \def\@tempa{backgroundimage-mode}\def\@tempb{,\space}%
        \or
          \def\@tempa{image-mode}\def\@tempb{,\space}%
        \fi
        \Ifkomavarempty{backaddress}{}{%
          \edef\@tempa{\@tempa\@tempb backaddress ignored}\def\@tempb{,\space}%
        }%
      \else
        \let\@tempa\@empty\let\@tempb\@empty
      \fi
      \ifcase \ltr@priority
        \Ifkomavarempty{specialmail}{}{%
          \edef\@tempa{\@tempa\@tempb specialmail ignored}\def\@tempb{,\space}%
        }%
      \or
        \edef\@tempa{\@tempa\@tempb B-Economy}\def\@tempb{,\space}%
      \or
        \edef\@tempa{\@tempa\@tempb A-Priority}\def\@tempb{,\space}%
      \fi
    \endgroup%
    \move@topt\vskip\useplength{toaddrvpos}%
    \vb@t@z{{%
        \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
        \ifdim \useplength{toaddrindent}=\z@
          \setplength{toaddrindent}{8mm}%
        \fi
        \ifdim \useplength{PPheadheight}=\z@
          \setplength{PPheadheight}{20.74pt}%
        \fi
        \ifdim \useplength{PPheadwidth}=\z@
          \setplength{PPheadwidth}{42mm}%
        \fi
        \ifdim \useplength{PPdatamatrixvskip}=\z@
          \setplength{PPdatamatrixvskip}{9mm}%
        \fi
        \rlap{\move@topl
          \setlengthtoplength{\@tempskipa}{toaddrhpos}%
          \ifdim \@tempskipa<\z@
            \addtolength{\@tempskipa}{\paperwidth}%
            \addtolengthplength[-]{\@tempskipa}{toaddrwidth}%
          \fi
          \hskip\@tempskipa
          \@savevbox{\useplength{toaddrheight}}{\hsize\useplength{toaddrwidth}%
            \ifnum\@afieldmode=\tw@
              \vskip 2pt\relax
              \hskip \useplength{toaddrindent}\relax
              \fbox{%
                \vbox to \dimexpr \useplength{PPheadheight}-2\fboxsep\relax{%
                  \setlength{\parindent}{0pt}%
                  \hsize \dimexpr \useplength{PPheadwidth}-2\fboxsep\relax
                  \sbox\@tempboxa{%
                    {\fontsize{20.74pt}{20.74pt}\selectfont
                      \usekomafont{PPlogo}{P.P.}}\hskip 2mm%
                  }%
                  \dp\@tempboxa\z@
                  \setlength{\@tempdima}{\hsize}%
                  \addtolength{\@tempdima}{-\wd\@tempboxa}%
                  \hbox{\box\@tempboxa
                    \vbox to \dimexpr
                    \useplength{PPheadheight}-2\fboxsep\relax{%
                      \vss\hsize\@tempdima
                      \raggedright
                      \fontsize{8pt}{9pt}\selectfont\usekomafont{PPdata}%
                      \usekomavar*{fromzipcode}\usekomavar{zipcodeseparator}%
                      \usekomavar{fromzipcode}\scr@endstrut\\
                      \usekomavar{place}\scr@endstrut
                      \hfill
                    }%
                  }%
                  \vss
                }%
              }%
              \hskip 1mm
              \mbox{%
                \vbox to \useplength{PPheadheight}{%
                  \addtolengthplength[-]{\hsize}{PPheadwidth}%
                  \addtolength{\hsize}{-1mm}%
                  \addtolengthplength[-2]{\hsize}{toaddrindent}%
                  \setlength{\parindent}{0pt}%
                  \fontsize{8pt}{9pt}\selectfont\usekomafont{PPdata}%
                  \hfill\usekomavar{PPcode}
                  \vss
                  \ifcase \ltr@priority
                  \or
                    \usekomafont{priority}{%
                      {\usekomafont{prioritykey}{B}}%
                      -ECONOMY\hss\vskip-\dp\strutbox
                    }%
                  \or
                    \usekomafont{priority}{%
                      {\usekomafont{prioritykey}{A}}%
                      -PRIORITY\hss\vskip-\dp\strutbox
                    }%
                  \fi
                  \vss
                }%
              }%
              \vskip 1mm
              \vskip-\ht\strutbox
              \noindent\hskip\useplength{toaddrindent}%
              \hrulefill%
              \hskip\useplength{toaddrindent}%
              \vbox to\z@{\hsize\z@
                \vskip \useplength{PPdatamatrixvskip}\relax
                \llap{\usekomavar{PPdatamatrix}\hskip\useplength{toaddrindent}}%
                \vss
              }%
            \else
              \vskip 1mm
              \noindent\expandafter\hskip\useplength{toaddrindent}%
              \vbox to \useplength{PPheadheight}{%
                \addtolengthplength[-2]{\hsize}{toaddrindent}%
                \setlength{\parindent}{0pt}%
                \usekomavar{addresseeimage}%
                \vss
              }%
              \vskip 1mm
              \vskip\dp\strutbox
            \fi
            \ifnum \@afieldmode=4 \else
              \vfil%
              \noindent\hskip\useplength{toaddrindent}%
              \setlength{\@tempdima}{\useplength{toaddrwidth}}%
              \addtolengthplength[-2]{\@tempdima}{toaddrindent}%
              \vbox{\hsize\@tempdima
                \Ifkomavarempty{PPdatamatrix}{}{%
                  \addtolength{\hsize}{-2mm}%
                  \settowidth\@tempdima{\usekomavar{PPdatamatrix}}%
                  \addtolength{\hsize}{-\@tempdima}%
                }%
                \raggedright
                \usekomafont{addressee}{%
                  {\usekomafont{toname}{\usekomavar{toname}\\}}%
                  {\usekomafont{toaddress}{\usekomavar{toaddress}\endgraf}}}}%
            \fi
            \vss\null}%
          {address field}{toaddrheight}%
          {\string\begin{letter}}%
        }}}%
    \vskip-\useplength{toaddrvpos}\move@frompt
  \fi
}
\newcommand*{\specialmail@format}[1]{}
\let\specialmail@format\underline
\newcommand*{\@ogobble}[1][]{}
\newcommand*{\@locfield}{%
  \ifdim \useplength{locwidth}=\z@%
    \setplength{locwidth}{\paperwidth}%
    \ifdim \useplength{toaddrhpos}>\z@
      \addtoplength[-2]{locwidth}{\useplength{toaddrhpos}}%
    \else
      \addtoplength[2]{locwidth}{\useplength{toaddrhpos}}%
    \fi
    \addtoplength[-1]{locwidth}{\useplength{toaddrwidth}}%
    \if@bigloc%
      \setplength[.66667]{locwidth}{\useplength{locwidth}}%
    \else%
      \setplength[.5]{locwidth}{\useplength{locwidth}}%
    \fi%
  \fi%
  \ifcase\@alignfrom
  \or
    \if@logo
      \Ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
    \fi
  \or
  \or
    \Ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
  \or
    \Ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
  \fi
  \Ifkomavarempty{location}{%
  }{%
    \ifdim \useplength{lochpos}=\z@%
      \setplength{lochpos}{\useplength{toaddrhpos}}%
    \fi
    \ifdim \useplength{locvpos}=\z@%
      \setplength{locvpos}{\useplength{toaddrvpos}}%
    \fi
    \ifdim \useplength{locheight}=\z@%
      \setplength{locheight}{\useplength{toaddrheight}}%
    \fi
    \move@topt\vskip\useplength{locvpos}%
    \vb@t@z{\noindent\makebox[0pt][l]{%
        \move@topl
        \setlengthtoplength[-]{\@tempskipa}{lochpos}%
        \ifdim \@tempskipa<\z@
          \addtolength{\@tempskipa}{\paperwidth}%
        \else
          \addtolengthplength{\@tempskipa}{locwidth}%
        \fi
        \hskip\@tempskipa
        \makebox[0pt][r]{%
          \@savevbox{\useplength{locheight}}{%
            \noindent\hsize\useplength{locwidth}%
            \ifcase\@alignfrom
            \or
              \if@logo
                \Ifkomavarempty{fromlogo}{\null}{%
                  {\raggedleft\noindent\usekomavar{fromlogo}\\
                    \vskip\parskip}\noindent}%
              \fi
            \or
            \or
              \if@logo
                \Ifkomavarempty{fromlogo}{}{%
                  \raggedleft\usekomavar{fromlogo}\par}%
              \fi
              \raggedright
              {\usekomafont{fromname}\strut\ignorespaces
                \usekomavar{fromname}%
                {%
                  \ifnum\@rulefrom=1\\[-.5\baselineskip]%
                    \usekomafont{fromrule}{%
                      \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                      \ifdim\@tempdima=\z@
                        \setlength{\@tempdima}{\useplength{locwidth}}%
                      \fi
                      \expandafter\rule\expandafter{\the\@tempdima}{%
                        \useplength{fromrulethickness}}%
                    }%
                  \fi
                }%
                \\
              }%
              {\usekomafont{fromaddress}\strut\ignorespaces
                \usekomavar{fromaddress}%
                \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
                \if@mobilephone
                  \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
                \fi%
                \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
                \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
                \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
                \ifnum\@rulefrom=2\\[-.5\baselineskip]%
                  \usekomafont{fromrule}{%
                    \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                    \ifdim\@tempdima=\z@
                      \setlength{\@tempdima}{\useplength{locwidth}}%
                    \fi
                    \expandafter\rule\expandafter{\the\@tempdima}{%
                      \useplength{fromrulethickness}}}%
                \fi
                \\
              }%
            \or
              \raggedleft
              \if@logo
                \Ifkomavarempty{fromlogo}{}{\usekomavar{fromlogo}\par}%
              \fi
              {\usekomafont{fromname}\strut\ignorespaces
                \usekomavar{fromname}%
                {%
                  \ifnum\@rulefrom=1\\[-.5\baselineskip]%
                    \usekomafont{fromrule}{%
                      \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                      \ifdim\@tempdima=\z@
                        \setlength{\@tempdima}{\useplength{locwidth}}%
                      \fi
                      \expandafter\rule\expandafter{\the\@tempdima}{%
                        \useplength{fromrulethickness}}%
                    }%
                  \fi
                }%
                \\
              }%
              {\usekomafont{fromaddress}\strut\ignorespaces
                \usekomavar{fromaddress}%
                \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
                \if@mobilephone%
                  \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
                \fi%
                \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
                \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
                \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
                \ifnum\@rulefrom=2\\[-.5\baselineskip]%
                  \usekomafont{fromrule}{%
                    \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                    \ifdim\@tempdima=\z@
                      \setlength{\@tempdima}{\useplength{locwidth}}%
                    \fi
                    \expandafter\rule\expandafter{\the\@tempdima}{%
                      \useplength{fromrulethickness}}}%
                \fi
                \\
              }%
            \fi
            \usekomavar{location}%
            \vskip \z@ \@plus .00001fil}%
          {location field}{locheight}{\setkomavar}%
        }}%
    }%
    \vskip-\useplength{locvpos}\move@frompt
  }%
}
\newcommand*{\do@set@reffield}{}
\newcommand*{\@set@reffield}[1]{%
  \Ifkomavarempty{#1}{}{%
    \settowidth{\@tempdima}{\strut\usekomafont{refvalue}\usekomavar{#1}}%
    \sbox\z@{\strut\usekomafont{refname}\usekomavar*{#1}}%
    \ifdim \@tempdima<\wd0\setlength{\@tempdima}{\wd0}\fi
    \if@tempswa\enskip\hfill\fi
    \parbox[t]{\@tempdima}{\noindent\raggedright
        \strut\box\z@\\\usekomafont{refvalue}\strut\usekomavar{#1}}%
    \@tempswatrue
  }%
}
\newcommand*{\@test@reffield}[1]{%
  \Ifkomavarempty{#1}{}{%
    \@tempswatrue
  }%
}
\newcommand*{\@set@reffields}{}%
\newcommand*{\addtoreffields}[1]{%
  \l@addto@macro{\@set@reffields}{\do@set@reffield{#1}}%
}
\newcommand*{\removereffields}{%
  \renewcommand*{\@set@reffields}{}%
}
\newcommand*{\defaultreffields}{%
  \removereffields
  \addtoreffields{yourref}%
  \addtoreffields{yourmail}%
  \addtoreffields{myref}%
  \addtoreffields{customer}%
  \addtoreffields{invoice}%
}
\defaultreffields
\newcommand*{\@datefield}{%
  {%
    \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
    \ifdim\useplength{refwidth}=\z@
      \if@refwide
        \setplength{refwidth}{\paperwidth}%
        \ifdim \useplength{toaddrhpos}>\z@
          \setplength{refhpos}{\useplength{toaddrhpos}}%
        \else
          \setplength[-]{refhpos}{\useplength{toaddrhpos}}%
        \fi
        \addtoplength[-2]{refwidth}{\useplength{refhpos}}%
      \else
        \setplength{refwidth}{\textwidth}%
        \setplength{refhpos}{\oddsidemargin}%
        \addtoplength{refhpos}{1in}%
      \fi
    \else
      \ifdim\useplength{refhpos}=\z@
        \begingroup
          \setlength\@tempdima{\textwidth}%
          \addtolengthplength[-]{\@tempdima}{refwidth}%
          \setlength\@tempdimb{\oddsidemargin}%
          \addtolength\@tempdimb{1in}%
          \setlength{\@tempdimc}{\paperwidth}%
          \addtolength{\@tempdimc}{-\textwidth}%
          \divide\@tempdimb by 32768\relax
          \divide\@tempdimc by 32768\relax
          \ifdim\@tempdimc=\z@\else
            \multiply\@tempdima by\@tempdimb
            \divide\@tempdima by\@tempdimc
          \fi
          \edef\@tempa{\noexpand\endgroup
            \noexpand\setplength{refhpos}{\the\@tempdima}}%
        \@tempa
    \fi\fi
    \@tempswafalse
    \move@topt\vskip\useplength{refvpos}%
    \@tempswafalse
    \let\do@set@reffield\@test@reffield
    \@set@reffields
    \ifcase \@datepos\else\@test@reffield{date}\fi
    \if@tempswa
      \@tempswafalse
      \rlap{\noindent\move@topl\hskip\useplength{refhpos}%
        \vbox{\hsize\useplength{refwidth}%
          \noindent
          \ifnum \@datepos=2
            \@set@reffields
            \if@tempswa
              \@tempswafalse
              \@set@reffield{date}%
            \fi
          \fi
          \let\do@set@reffield\@set@reffield
          \@set@reffields%
          \if@tempswa
            \ifnum \@datepos=1 \@set@reffield{date}\fi%
            \sbox\z@{\usekomafont{refname}\strut}%
            \ifdim\ht\z@>\ht\strutbox
              \PackageWarningNoLine{scrletter}{%
                Font element `refname' should not be larger than
                \string\normalsize!}%
            \fi
            \sbox\z@{\usekomafont{refvalue}\strut}%
            \ifdim\ht\z@>\ht\strutbox
              \PackageWarningNoLine{scrletter}{%
                Font element `refvalue' should not be larger than
                \string\normalsize!}%
            \fi
          \else
            \ifcase \@datepos\else
              \ifnum \@datepos=1 \enskip\hfill\fi
              {\usekomafont{placeanddate}{\Ifkomavarempty{place}{}{%
                    \usekomavar{place}\usekomavar{placeseparator}}%
                  \usekomavar{date}}}%
            \fi
          \fi
        }%
      }%
    \fi
    \vskip\useplength{refaftervskip}%
  }%
}
\newcommand*{\@makelettertitle}{%
  \Ifkomavarempty{title}{%
  }{%
    {\setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
      \centering\LARGE\usekomafont{lettertitle}\usekomavar{title}\par}%
    \vskip\baselineskip%
  }%
}
\newcommand*{\@subjfield}{{%
    \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
    \Ifkomavarempty{subject}{%
    }{%
      \ifx\raggedsubject\@empty
        \ifdim\useplength{subjectvpos}=\z@
          \if@subjafter%
            \let\raggedsubject\centering%
          \else
            \def\raggedsubject{\noindent\@hangfrom}%
          \fi
        \else
          \def\raggedsubject{\noindent\@hangfrom}%
        \fi
      \fi
      \ifdim\useplength{subjectvpos}=\z@
        \vskip\useplength{subjectbeforevskip}%
        \begingroup
      \else
        \move@topt\vskip\useplength{subjectvpos}%
        \expandafter\vb@t@z\expandafter{%
      \fi
      \usekomafont{lettersubject}%
      \raggedsubject{\if@subj \subject@format{\strut\ignorespaces
          \usekomavar*{subject}}\fi}%
      \subject@format{\strut\ignorespaces\usekomavar{subject}}\par
      \ifdim\useplength{subjectvpos}=\z@
        \endgroup
        \vskip\useplength{subjectaftervskip}%
      \else
        }%
        \vskip-\useplength{subjectvpos}\move@frompt
      \fi
    }%
  }%
}
\newplength{subjectvpos}
\setplength{subjectvpos}{0pt}
\newplength{subjectaftervskip}
\setplength{subjectaftervskip}{2\baselineskip}
\newplength{subjectbeforevskip}
\setplength{subjectbeforevskip}{0pt}
\newkomavar{nexthead}
\setkomavar{nexthead}{%
  \rlap{\parbox[c]{\textwidth}{\raggedright\strut
      \ifnum\@pageat=0\pagemark\else\leftmark\fi\strut}}%
  \parbox[c]{\textwidth}{%
    \centering\strut
    \ifcase\@pageat
      \rightmark
    \or
      \pagemark
    \or
      \rightmark
    \fi\strut}%
  \llap{\parbox[c]{\textwidth}{\raggedleft\strut
      \ifcase\@pageat
        \leftmark
      \or
        \rightmark
      \or
        \pagemark
      \else
        \rightmark
      \fi\strut}}%
}%
\newkomavar{nextfoot}
\setkomavar{nextfoot}{%
  \ifnum\@pageat>2
    \parbox[c]{\textwidth}{%
      \ifcase\@pageat\or\or\or\raggedright\or\centering\or\raggedleft\fi
      \strut\pagemark%
      }%
  \fi
}
\newenvironment{letter}[2][]{%
  \if@twocolumn
    \PackageWarning{scrletter}{%
      twocolumn mode not supported.\MessageBreak
      If you really want a twocolumned letter, you should\MessageBreak
      use package `multicol' and add a `multicols'\MessageBreak
      environment inside your letter.\MessageBreak
      Switching back to oneside%
    }%
    \letter@restonecoltrue
    \expandafter\onecolumn
  \else
    \letter@restonecolfalse
  \fi
  \cleardoubleoddemptypage
  \raggedbottom
  \scr@ifundefinedorrelax{letterpagestyle}{}{%
    \ifx\letterpagestyle\@empty\else
      \pagestyle{\letterpagestyle}%
    \fi
  }%
  \let\pagemark\letterpagemark
  \refstepcounter{letter}%
  \let\thisletter\@currentlabel
  \setcounter{page}{\@ne}%
  \setcounter{footnote}{0}%
  \interlinepenalty=200\@processto{#2}%
  \KOMAoptions{#1}%
  \@beginletterhook
}{%
  \stopletter
  \let\@currentlabel\thisletter
  \label{\thisletter.lastpage}%
  \@@par\pagebreak\@@par%
  \ifletter@restonecol\twocolumn\fi
}
\newif\ifletter@restonecol
\newcommand*{\thisletter}{outside.letter.undefined}
\newcommand*{\letterlastpage}{\pageref{\thisletter.lastpage}}
\newcommand*{\stopletter}{}
\newcommand{\@processto}[1]{%
  \IfArgIsEmpty{#1}{%
  }{%
    \expandafter\@xproc#1\\\@nil
    \ifx\reserved@b\@empty\else\expandafter\@xproc#1\@nil\fi
    \edef\reserved@a{%
      \noexpand\setkomavar{toname}{\unexpanded\expandafter{\reserved@a}}%
      \noexpand\setkomavar{toaddress}{\unexpanded\expandafter{\reserved@b}}%
    }\reserved@a
  }%
}
\newcommand*{\@xproc}{}
\long\def\@xproc#1\\#2\@nil{%
  \def\reserved@a{#1}\def\reserved@b{#2}%
}
\g@addto@macro\flushbottom{%
  \AtEndLetter{\vskip \z@\@plus.0001fil\relax}%
}
\newcounter{letter}
\newcommand*{\letterpagestyle}{%
  plain.letter%
}
\newcommand{\AtBeginLetter}{\g@addto@macro\@beginletterhook}
\newcommand{\@beginletterhook}{}
\newcommand{\AtEndLetter}{\g@addto@macro\stopletter}
\newcommand*{\stopbreaks}{\interlinepenalty \@M
 \def\par{\@@par\nobreak}\let\\=\@nobreakcr
 \let\vspace\@nobreakvspace}
\DeclareRobustCommand*{\@nobreakvspace}{%
  \kernel@ifstar{\@nobreakvspacex}{\@nobreakvspacex}}
\newcommand*{\@nobreakvspacex}[1]{\ifvmode\nobreak\vskip #1\relax\else
 \@bsphack\vadjust{\nobreak\vskip #1}\@esphack\fi}
\newcommand*{\@nobreakcr}{\kernel@ifstar{\@normalcr*}{\@normalcr*}}
\newcommand*{\startbreaks}{\let\\=\@normalcr
 \interlinepenalty 200\def\par{\@@par\penalty 200\relax}}
\newcommand{\opening}[1]{%
  \@PapersizeWarning
  \@gen@firsthead
  \@mkboth{\scr@fromname@var}{\scr@subject@var}%
  \thispagestyle{empty}%
  \noindent
  \@foldmarks\@firstheadfootfield
  \@addrfield\@locfield
  \ifdim\useplength{subjectvpos}=\z@\else\@subjfield\fi
  \@datefield
  \@makelettertitle
  \ifdim\useplength{subjectvpos}=\z@\if@subjafter\else\@subjfield\fi\fi
  {\setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative#1\par}%
  {\setlength{\@tempdima}{\baselineskip}%
    \addtolength{\@tempdima}{-\parskip}%
    \ifdim \@tempdima>\z@\vskip\@tempdima\fi}%
  \ifdim\useplength{subjectvpos}=\z@\if@subjafter\@subjfield\fi\fi
  \@afterindentfalse\@afterheading
}
\ExplSyntaxOn
\newcommand*{\closing}[1]{%
  {%
    \ifx\sigalign\@empty
      \tl_if_in:nVTF { \raggedright\LaTeXraggedright } \raggedsignature
        { \tl_set:Nn \sigalign l }
        {
          \tl_if_in:nVTF { \raggedleft\LaTeXraggedleft } \raggedsignature
            { \tl_set:Nn \sigalign r }
            {
              \tl_if_in:nVTF { \centering\LaTeXcentering } \raggedsignature
                { \tl_set:Nn \sigalign c }
                {
                  \tl_if_eq:NNTF \raggedsignature \raggedright
                    { \tl_set:Nn \sigalign l }
                    {
                      \tl_if_eq:NNTF \raggedsignature \raggedleft
                        { \tl_set:Nn \sigalign r }
                        {
                          \tl_if_eq:NNTF \raggedsignature \centering
                            { \tl_set:Nn \sigalign c }
                            {
                              \tl_if_eq:NNTF \raggedsignature \LaTeXraggedright
                                { \tl_set:Nn \sigalign l }
                                {
                                  \tl_if_eq:NNTF \raggedsignature \LaTeXraggedleft
                                    { \tl_set:Nn \sigalign r }
                                    {
                                      \tl_if_eq:NNTF \raggedsignature \LaTeXcentering
                                        { \tl_set:Nn \sigalign c }
                                        {
                                          \PackageWarning{scrletter}{
                                            unexpected~definition~of~
                                            \string\raggedsignature.
                                            \MessageBreak
                                            Using~\string\sigalign=l
                                          }
                                          \tl_set:Nn \sigalign l
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    \fi
    \cs_set:Npn \and
      {
        \end{tabular}\sigspace
        \rule[-\dp\strutbox]
          {0pt}{\dimeval{\baselineskip+\useplength{sigbeforevskip}}}
        \exp_last_unbraced:Ne\begin{{tabular}[t]{@{}\sigalign @{}}}%\end
      }%
    \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
    \par\nobreak\vskip\baselineskip
    \dim_set:Nn \l_tmpa_dim {\linewidth-\useplength{sigindent}}
    \sbox \l_tmpa_box { #1 }
    \sbox \l_tmpb_box
      {
        \exp_last_unbraced:Ne\begin{{tabular}[t]{@{}\sigalign @{}}}
          \usekomavar{signature}\ifhmode \scr@endstrut\fi
        \end{tabular}
      }
    \dim_compare:nNnT { \l_tmpa_dim } > { \box_wd:N \l_tmpa_box }
      {
        \dim_compare:nNnT { \l_tmpa_dim } > { \box_wd:N \l_tmpb_box }
          {
            \dim_compare:nNnTF
              { \box_wd:N \l_tmpa_box } > { \box_wd:N \l_tmpb_box }
              { \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpa_box } }
              { \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpb_box } }
          }
      }
    \hskip\useplength{sigindent}
    \parbox[t]{\l_tmpa_dim}{
      \raggedsignature
      \ignorespaces #1\par
      \rule[-\dp\strutbox]
        {0pt}{\dimeval{\baselineskip+\useplength{sigbeforevskip}}}
      \exp_last_unbraced:Ne\begin{{tabular}[t]{@{}\sigalign @{}}}
        \usekomavar{signature}%
      \end{tabular}
    }
  }
  \par\nobreak\vskip\baselineskip
}
\ExplSyntaxOff
\newcommand*{\sigalign}{}
\newcommand*{\sigspace}{\quad}
\newcommand\ps{\par%
  \ifdim\parskip=\z@
    \vskip\baselineskip
  \fi\startbreaks\noindent\ignorespaces
}
\newcommand*{\cc}[1]{\par%
  \ifdim\parskip=\z@%
    \vskip\baselineskip%
  \fi\noindent%
  \begingroup
    \parbox[t]{\textwidth}{%
      \Ifkomavarempty*{ccseparator}{}{%
        \@hangfrom{%
          \strut\usekomavar*{ccseparator}\usekomavar{ccseparator}}%
        }%
      \ignorespaces #1\strut}%
    \setlength{\parfillskip}{\z@ \@plus 1fil}\par
  \endgroup
}
\newcommand*{\encl}[1]{\par%
  \ifdim\parskip=\z@%
    \vskip\baselineskip%
  \fi\noindent%
  \begingroup
    \parbox[t]{\textwidth}{%
      \Ifkomavarempty*{enclseparator}{}{%
        \@hangfrom{%
          \strut\usekomavar*{enclseparator}\usekomavar{enclseparator}}%
        }%
      \ignorespaces #1\strut}%
    \setlength{\parfillskip}{\z@ \@plus 1fil}\par
  \endgroup
}
\newkomavar{place}
\newkomavar{location}
\newkomavar{specialmail}
\newkomavar{title}
\newkomavar{fromlogo}
\newkomavar{fromzipcode}
\newkomavar{PPcode}
\newkomavar{PPdatamatrix}
\newkomavar{addresseeimage}
\newkomavar{signature}
\setkomavar{signature}{\usekomavar{fromname}}
\newkomavar{backaddress}
\setkomavar{backaddress}{%
  \Ifkomavarempty{fromname}{}{%
    \strut\ignorespaces\usekomavar{fromname}%
    \Ifkomavarempty{fromaddress}{}{\\}}%
  \Ifkomavarempty{fromaddress}{}{%
    \strut\ignorespaces\usekomavar{fromaddress}}%
  }
\newkomavar[\usekomavar{place}]{placeseparator}
\setkomavar{placeseparator}{,\nobreakspace}
\newkomavar[\subjectname]{subjectseparator}
\setkomavar{subjectseparator}{: }
\newkomavar[\ccname]{ccseparator}
\setkomavar{ccseparator}{: }
\newkomavar[\enclname]{enclseparator}
\setkomavar{enclseparator}{: }
\newkomavar{backaddressseparator}
\setkomavar{backaddressseparator}{,\nobreakspace}
\newkomavar[\if@scrsymbols\scr@symbol@phone\else\phonename\fi]{phoneseparator}
\setkomavar{phoneseparator}{%
  \Ifkomavarxempty*{phoneseparator}{}{\if@scrsymbols\else:\fi\nobreakspace}%
}
\newkomavar[%
  \if@scrsymbols\scr@symbol@mobilephone\else\mobilephonename\fi
]{mobilephoneseparator}
\setkomavar{mobilephoneseparator}{\usekomavar{phoneseparator}}
\newkomavar[\if@scrsymbols\scr@symbol@fax\else\faxname\fi]{faxseparator}
\setkomavar{faxseparator}{%
  \Ifkomavarxempty*{faxseparator}{}{\if@scrsymbols\else:\fi\nobreakspace}%
}
\newkomavar[\if@scrsymbols\scr@symbol@email\else\emailname\fi]{emailseparator}
\setkomavar{emailseparator}{%
  \Ifkomavarxempty*{emailseparator}{}{\if@scrsymbols\else:\fi\nobreakspace}%
}
\newkomavar[\if@scrsymbols\scr@symbol@www\else\wwwname\fi]{urlseparator}
\setkomavar{urlseparator}{%
  \Ifkomavarxempty*{urlseparator}{}{\if@scrsymbols\else:\fi\nobreakspace}%
}
\newkomavar{zipcodeseparator}
\setkomavar{zipcodeseparator}{\,--\,}
\newkomavar[\headfromname]{fromname}
\newkomavar[\usekomavar{fromname}]{fromaddress}
\newkomavar[\headtoname]{toname}
\newkomavar[\usekomavar{toname}]{toaddress}
\newkomavar[\usekomavar*{phoneseparator}%
  \usekomavar{phoneseparator}]{fromphone}
\newkomavar[\usekomavar*{mobilephoneseparator}%
  \usekomavar{mobilephoneseparator}]{frommobilephone}
\newkomavar[\usekomavar*{faxseparator}%
  \usekomavar{faxseparator}]{fromfax}
\newkomavar[\usekomavar*{emailseparator}%
  \usekomavar{emailseparator}]{fromemail}
\newkomavar[\usekomavar*{urlseparator}%
  \usekomavar{urlseparator}]{fromurl}
\newkomavar[\bankname]{frombank}
\newkomavar[\yourrefname]{yourref}
\newkomavar[\yourmailname]{yourmail}
\newkomavar[\myrefname]{myref}
\newkomavar[\customername]{customer}
\newkomavar[\invoicename]{invoice}
\newkomavar[\usekomavar*{subjectseparator}%
  \usekomavar{subjectseparator}]{subject}
\newkomavar[\datename]{date}
\setkomavar{date}{\@date}
\newcommand*{\scr@saved@date}{}
\let\scr@saved@date\date
\renewcommand*{\date}[1]{%
  \PackageWarning{scrletter}{%
    \string\date\space changes the internal \string\LaTeX\space date
    only.\MessageBreak
    You should note that this changes the default\MessageBreak
    value of variable `date' only as long as nobody\MessageBreak
    uses `\string\setkomavar` to change the content of\MessageBreak
    variable `date'.\MessageBreak
    Therefore, usage of `\string\setkomavar' is recommended\MessageBreak
    to change the letter's date%
  }%
  \scr@saved@date{#1}%
}
%%% From File: $Id: scrkernel-addressfiles.dtx 4032 2023-04-17 09:45:11Z kohm $
%%%            (run: body)
\newcommand*{\adrentry}[7]{%
  \PackageWarning{scrletter}{%
    command `\string\adrentry' is deprecated.\MessageBreak
    You should use `\string\addrentry' with additional\MessageBreak
    empty 8th argument}%
  \addrentry{#1}{#2}{#3}{#4}{#5}{#6}{#7}{}}
\newcommand*{\addrentry}[9]{\def\@tempa{#1}\ifx \@tempa\@empty \else
 \def\@tempa{#2}\ifx \@tempa\@empty
  \expandafter\def\csname #9\endcsname{#1\\#3}%
 \else
  \expandafter\def\csname #9\endcsname{#2 #1\\#3}%
 \fi \fi}
\newcommand*{\adrchar}{%
  \PackageWarning{scrletter}{%
    command `\string\adrchar' is deprecated.\MessageBreak
    You should use `\string\addrchar'}
  \addrchar}
\newcommand*{\addrchar}[1]{}
%%% From File: $Id: scrlogo.dtx 4032 2023-04-17 09:45:11Z kohm $
\RequirePackage{scrlogo}
\endinput
%%
%% End of file `scrletter.sty'.
