
    HohV                        d dl Z d dlmZ d dlmZmZ d dlmZmZm	Z	m
Z
mZmZ g dZ ed       G d d	             Z ed       G d
 d             Z ed       G d d             Z G d de      Z ed       G d d             Z ed       G d d             Z ed       G d d             Z G d de
      Z ed      Z G d de j.                  ee         Zeeee      eee      eee      f   Zy)    N)	dataclass)Flagauto)GenericListOptionalProtocolTupleTypeVar)	OSDefaultedResultDeviceDomainMatchersPartialResultResolverResult	UserAgentT)frozenc                       e Zd ZU dZdZeed<   ee   ed<   ee   ed<   ee   ed<   ee   ed<   	 	 	 	 	 ddedee   dee   dee   dee   d	dfd
Zy)r   z{Browser ("user agent" aka the software responsible for the request)
    information parsed from the user agent string.
    familymajorminorpatchpatch_minorr   r   r   r   r   Nreturnc                     t         j                  | d|       t         j                  | d|       t         j                  | d|       t         j                  | d|       t         j                  | d|       y Nr   r   r   r   r   object__setattr__selfr   r   r   r   r   s         j/var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/ua_parser/core.py__init__zUserAgent.__init__    ^     	4624%04%04%04<    OtherNNNN	__name__
__module____qualname____doc__	__slots__str__annotations__r   r&    r(   r%   r   r      s     EIKC=C=C=# ###%)== }= }	=
 }= c]= 
=r(   r   c                       e Zd ZU dZdZeed<   ee   ed<   ee   ed<   ee   ed<   ee   ed<   	 	 	 	 	 ddedee   dee   dee   dee   d	dfd
Zy)r   z1OS information parsed from the user agent string.r   r   r   r   r   r   Nr   c                     t         j                  | d|       t         j                  | d|       t         j                  | d|       t         j                  | d|       t         j                  | d|       y r   r    r#   s         r%   r&   zOS.__init__:   r'   r(   r)   r+   r3   r(   r%   r   r   /   s    ;DIKC=C=C=# ###%)== }= }	=
 }= c]= 
=r(   r   c            	       l    e Zd ZU dZdZeed<   ee   ed<   ee   ed<   	 	 	 d	dedee   dee   ddfdZy)
r   z5Device information parsed from the user agent string.)brandr   modelr   r7   r8   Nr   c                     t         j                  | d|       t         j                  | d|       t         j                  | d|       y )Nr   r7   r8   r    )r$   r   r7   r8   s       r%   r&   zDevice.__init__R   s:     	4624%04%0r(   )r*   NNr+   r3   r(   r%   r   r   I   sa    ?,IKC=C= ##	11 }1 }	1
 
1r(   r   c                   J    e Zd ZdZ e       Z e       Z e       Zeez  ez  Zy)r   zaHint for selecting which domains are requested when asking for a
    :class:`PartialResult`.
    N)	r,   r-   r.   r/   r   
USER_AGENTr   DEVICEALLr3   r(   r%   r   r   ]   s,    
 J	BVF
r/F
"Cr(   r   c                   :    e Zd ZU dZeed<   eed<   eed<   eed<   y)r   zVariant of :class:`Result` where attributes are set
    to a default value if their resolution failed.

    For all domains, the default value has ``family`` set to
    ``"Other"`` and every other attribute set to ``None``.
    
user_agentosdevicestringN)	r,   r-   r.   r/   r   r2   r   r   r1   r3   r(   r%   r   r   l   s     
FNKr(   r   c                   X    e Zd ZU dZee   ed<   ee   ed<   ee   ed<   e	ed<   de
fdZy)	r   zComplete result.

    For each attribute (and domain), either the resolution was a
    success (a match was found) and the corresponding data is set, or
    it was a failure and the value is `None`.

    r?   r@   rA   rB   r   c                     t        | j                  xs
 t               | j                  xs
 t	               | j
                  xs
 t               | j                        S )zReplaces every failed domain by its default value.

        Roughly matches pre-1.0 semantics, and can allow for more
        uniform handling by the client if they don't want or need the
        lookup failure information.

        r?   r@   rA   rB   )r   r?   r   r@   r   rA   r   rB   r$   s    r%   with_defaultszResult.with_defaults   sA     5)+ww"$;;*&(;;	
 	
r(   N)r,   r-   r.   r/   r   r   r2   r   r   r1   r   rG   r3   r(   r%   r   r   {   s:     ##VK
 
r(   r   c                   f    e Zd ZU dZdZeed<   ee   ed<   ee	   ed<   ee
   ed<   eed<   defd	Zy
)r   aI  Potentially partial (incomplete) result.

    Domain fields (``user_agent``, ``os``, and ``device``) can be:

    - unset if not parsed yet
    - set to a parsing failure
    - set to a parsing success

    The ``domains`` flags specify which is which: if a :class:`Domain`
    flag is set, the corresponding attribute was looked up and is
    either ``None`` for a resolution failure (no match was found) or a
    value for a parsing success.

    If the flag is unset, the field has not been looked up yet, in
    which case it can be anything (but should usually be ``None``).

    )rA   domainsr@   rB   r?   rI   r?   r@   rA   rB   r   c                     | j                   t        j                  k7  rt        d      t	        | j
                  | j                  | j                  | j                        S )zRequires that the result be fully resolved (every attribute is set,
        even if to a lookup failure).

        :raises ValueError: if the result is not fully resolved
        z6Only a result with all attributes set can be completedrE   )	rI   r   r=   
ValueErrorr   r?   r@   rA   rB   rF   s    r%   completezPartialResult.complete   sI     <<6::%UVVww;;;;	
 	
r(   N)r,   r-   r.   r/   r0   r   r2   r   r   r   r   r1   r   rL   r3   r(   r%   r   r      sE    $ DIO##VK
& 
r(   r   c                   B    e Zd ZdZej
                  dededefd       Z	y)r   aU  Resolver()

    The resolver is the thin central abstraction of ua-parser, and
    used to compose various objects into the resolution stack which
    best fits the system's needs.

    A resolver is any callable which takes a string ``ua`` and a
    :class:`Domain`, and returns a :class:`PartialResult` with at
    least the requested domains marked as resolved (whether
    successfully or not).

    A resolver may resolve more domains than requested, but it needs
    to resolve at least the requested domains.

    See :class:`PartialResult` for more information about its
    working.

    uadomainr   c                     y)zResolves the ``ua``.Nr3   )r$   rN   rO   s      r%   __call__zResolver.__call__        	r(   N)
r,   r-   r.   r/   abcabstractmethodr1   r   r   rQ   r3   r(   r%   r   r      s6    & 	3  m  r(   r   Tc                       e Zd ZdZej
                  dedee   fd       Z	e
ej
                  defd              Ze
defd       Zy)MatcherzA matcher is an individual pattern-rule, able to match a user
    agent string and in case of success extract the relevant data.

    Matchers need to expose their pattern for bulk resolvers.

    rN   r   c                      y)z Applies the matcher to an input.Nr3   )r$   rN   s     r%   rQ   zMatcher.__call__   rR   r(   c                      y)zReturns the matcher's pattern.Nr3   rF   s    r%   regexzMatcher.regex   s     	r(   c                      y)zReturns the matcher's pattern flags (only
        :data:`re.IGNORECASE` is supported, and only for
        :class:`Matcher` [:class:`Device`])

        r   r3   rF   s    r%   flagszMatcher.flags   s     r(   N)r,   r-   r.   r/   rS   rT   r1   r   rU   rQ   propertyrZ   intr\   r3   r(   r%   rW   rW      sw     	3 8A;   s    s  r(   rW   )rS   dataclassesr   enumr   r   typingr   r   r   r	   r
   r   __all__r   r   r   r   r   r   r   r   rU   ABCrW   r   r3   r(   r%   <module>rd      s?   
 !  D D
 $= = =6 $= = =2 $1 1 1&#T # $   $
 
 
> $(
 (
 (
Vx 4 CLcggwqz : 	r(   