
    Cj                         S SK r \ R                  " S5      R                  r " S S\5      r " S S\5      rS\S\4S	 jr	g)
    Nz^(-?\d+\.?\d*)(s|ms)$c                       \ rS rSrSrSrg)DurationError   z;
Exception indicating a general issue with a CSS duration.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       c/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/_duration.pyr   r          r   r   c                       \ rS rSrSrSrg)DurationParseError   zA
Indicates a malformed duration string that could not be parsed.
r   Nr   r   r   r   r   r      r   r   r   durationreturnc                     [        U 5      nU(       a/  UR                  5       u  p#[        U5      nUS:X  a  US-  nU$ Un U$  [        U 5      nU$ ! [         a    [	        U < S35      Sef = f)a]  
Args:
    duration: A string of the form `"2s"` or `"300ms"`, representing 2 seconds and
        300 milliseconds respectively. If no unit is supplied, e.g. `"2"`, then the duration is
        assumed to be in seconds.
Raises:
    DurationParseError: If the argument `duration` is not a valid duration string.
Returns:
    The duration in seconds.
msi  z is not a valid duration.N)_match_durationgroupsfloat
ValueErrorr   )r   matchvalue	unit_nameduration_secss        r   _duration_as_secondsr       s     H%E <<>e!DLM  "M 	Y!(OM   	Y$|3L%MNTXX	Ys   A A+)
recompiler   r   	Exceptionr   r   strr   r    r   r   r   <module>r%      sH    	**56<<I  3 5 r   