Ë
    Ü_ËiJ  ã                  ó¸   — d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
mZ  G d„ d«      Z G d„ d	«      Z G d
„ d«      Z G d„ d«      Z G d„ d«      Z	 	 	 	 dd„Zy)zÑTools for working with `collations`_.

.. _collations: https://www.mongodb.com/docs/manual/reference/collation/

.. seealso:: This module is compatible with both the synchronous and asynchronous PyMongo APIs.
é    )Úannotations)ÚAnyÚMappingÚOptionalÚUnion)Úcommon)Úvalidate_booleanc                  ó,   — e Zd ZdZdZ	 dZ	 dZ	 dZ	 dZy)ÚCollationStrengthzd
    An enum that defines values for `strength` on a
    :class:`~pymongo.collation.Collation`.
    é   é   é   é   é   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚPRIMARYÚ	SECONDARYÚTERTIARYÚ
QUATERNARYÚ	IDENTICAL© ó    úT/var/www/pod-logistic/pod-api/venv/lib/python3.12/site-packages/pymongo/collation.pyr   r      s1   „ ñð
 €GØ4à€IØ*à€HØ'à€JØ;à€IØNr   r   c                  ó   — e Zd ZdZdZ	 dZy)ÚCollationAlternateze
    An enum that defines values for `alternate` on a
    :class:`~pymongo.collation.Collation`.
    znon-ignorableÚshiftedN)r   r   r   r   ÚNON_IGNORABLEÚSHIFTEDr   r   r   r   r   3   s   „ ñð
 $€MØ@à€Gðr   r   c                  ó   — e Zd ZdZdZ	 dZy)ÚCollationMaxVariablezh
    An enum that defines values for `max_variable` on a
    :class:`~pymongo.collation.Collation`.
    ÚpunctÚspaceN)r   r   r   r   ÚPUNCTÚSPACEr   r   r   r#   r#   F   s   „ ñð
 €EØ2à€EØ#r   r#   c                  ó    — e Zd ZdZdZ	 dZ	 dZy)ÚCollationCaseFirstzf
    An enum that defines values for `case_first` on a
    :class:`~pymongo.collation.Collation`.
    ÚupperÚlowerÚoffN)r   r   r   r   ÚUPPERÚLOWERÚOFFr   r   r   r)   r)   S   s!   „ ñð
 €EØ*à€EØ*à
€CØ3r   r)   c                  ó‚   — e Zd ZdZdZ	 	 	 	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
d„Zedd„«       Zdd„Zdd„Z	dd„Z
y)Ú	Collationa'
  Collation

    :param locale: (string) The locale of the collation. This should be a string
        that identifies an `ICU locale ID` exactly. For example, ``en_US`` is
        valid, but ``en_us`` and ``en-US`` are not. Consult the MongoDB
        documentation for a list of supported locales.
    :param caseLevel: (optional) If ``True``, turn on case sensitivity if
        `strength` is 1 or 2 (case sensitivity is implied if `strength` is
        greater than 2). Defaults to ``False``.
    :param caseFirst: (optional) Specify that either uppercase or lowercase
        characters take precedence. Must be one of the following values:

          * :data:`~CollationCaseFirst.UPPER`
          * :data:`~CollationCaseFirst.LOWER`
          * :data:`~CollationCaseFirst.OFF` (the default)

    :param strength: Specify the comparison strength. This is also
        known as the ICU comparison level. This must be one of the following
        values:

          * :data:`~CollationStrength.PRIMARY`
          * :data:`~CollationStrength.SECONDARY`
          * :data:`~CollationStrength.TERTIARY` (the default)
          * :data:`~CollationStrength.QUATERNARY`
          * :data:`~CollationStrength.IDENTICAL`

        Each successive level builds upon the previous. For example, a
        `strength` of :data:`~CollationStrength.SECONDARY` differentiates
        characters based both on the unadorned base character and its accents.

    :param numericOrdering: If ``True``, order numbers numerically
        instead of in collation order (defaults to ``False``).
    :param alternate: Specify whether spaces and punctuation are
        considered base characters. This must be one of the following values:

          * :data:`~CollationAlternate.NON_IGNORABLE` (the default)
          * :data:`~CollationAlternate.SHIFTED`

    :param maxVariable: When `alternate` is
        :data:`~CollationAlternate.SHIFTED`, this option specifies what
        characters may be ignored. This must be one of the following values:

          * :data:`~CollationMaxVariable.PUNCT` (the default)
          * :data:`~CollationMaxVariable.SPACE`

    :param normalization: If ``True``, normalizes text into Unicode
        NFD. Defaults to ``False``.
    :param backwards: If ``True``, accents on characters are
        considered from the back of the word to the front, as it is done in some
        French dictionary ordering traditions. Defaults to ``False``.
    :param kwargs: Keyword arguments supplying any additional options
        to be sent with this Collation object.

    .. versionadded: 3.4

    )Ú
__documentNc
                óx  — t        j                  d|«      }d|i| _        |�t        d|«      | j                  d<   |�#t        j                  d|«      | j                  d<   |�#t        j                  d|«      | j                  d<   |�t        d|«      | j                  d<   |�#t        j                  d|«      | j                  d<   |�#t        j                  d|«      | j                  d<   |�t        d|«      | j                  d<   |	�t        d	|	«      | j                  d	<   | j                  j                  |
«       y )
NÚlocaleÚ	caseLevelÚ	caseFirstÚstrengthÚnumericOrderingÚ	alternateÚmaxVariableÚnormalizationÚ	backwards)r   Úvalidate_stringÚ_Collation__documentr	   Úvalidate_integerÚupdate)Úselfr4   r5   r6   r7   r8   r9   r:   r;   r<   Úkwargss              r   Ú__init__zCollation.__init__Ÿ   s,  € ô ×'Ñ'¨°&Ó9ˆØ+3°VÐ*<ˆŒØÐ Ü+;¸KÈÓ+SˆD�O‰O˜KÑ(ØÐ Ü+1×+AÑ+AÀ+ÈyÓ+YˆD�O‰O˜KÑ(ØÐÜ*0×*AÑ*AÀ*ÈhÓ*WˆD�O‰O˜JÑ'ØÐ&Ü1AØ! ?ó2ˆD�O‰OÐ-Ñ.ð Ð Ü+1×+AÑ+AÀ+ÈyÓ+YˆD�O‰O˜KÑ(ØÐ"Ü-3×-CÑ-CÀMÐS^Ó-_ˆD�O‰O˜MÑ*ØÐ$Ü/?ÀÐQ^Ó/_ˆD�O‰O˜OÑ,ØÐ Ü+;¸KÈÓ+SˆD�O‰O˜KÑ(Ø�‰×Ñ˜vÕ&r   c                ó6   — | j                   j                  «       S )zÏThe document representation of this collation.

        .. note::
          :class:`Collation` is immutable. Mutating the value of
          :attr:`document` does not mutate this :class:`Collation`.
        )r>   Úcopy)rA   s    r   ÚdocumentzCollation.documentÂ   s   € ð �‰×#Ñ#Ó%Ð%r   c                ón   ‡— | j                   Šdj                  dj                  ˆfd„‰D «       «      «      S )NzCollation({})z, c              3  ó2   •K  — | ]  }|› d ‰|   ›�–— Œ y­w)ú=Nr   )Ú.0ÚkeyrF   s     €r   ú	<genexpr>z%Collation.__repr__.<locals>.<genexpr>Î   s!   øè ø€ Ò/_Ès°3°%°q¸À#¹Ð8IÔ0JÑ/_ùs   ƒ)rF   ÚformatÚjoin)rA   rF   s    @r   Ú__repr__zCollation.__repr__Ì   s-   ø€ Ø—=‘=ˆØ×%Ñ% d§i¡iÓ/_ÐV^Ô/_Ó&_Ó`Ð`r   c                ó`   — t        |t        «      r| j                  |j                  k(  S t        S ©N)Ú
isinstancer1   rF   ÚNotImplemented©rA   Úothers     r   Ú__eq__zCollation.__eq__Ð   s%   € Ü�eœYÔ'Ø—=‘= E§N¡NÑ2Ð2ÜÐr   c                ó   — | |k(   S rQ   r   rT   s     r   Ú__ne__zCollation.__ne__Õ   s   € Ø˜5‘=Ð Ð r   )NNNNNNNN)r4   Ústrr5   úOptional[bool]r6   úOptional[str]r7   zOptional[int]r8   rZ   r9   r[   r:   r[   r;   rZ   r<   rZ   rB   r   ÚreturnÚNone)r\   zdict[str, Any])r\   rY   )rU   r   r\   Úbool)r   r   r   r   Ú	__slots__rC   ÚpropertyrF   rO   rV   rX   r   r   r   r1   r1   c   s¿   „ ñ7ðr  €Ið
 %)Ø#'Ø"&Ø*.Ø#'Ø%)Ø(,Ø$(ð!'àð!'ð "ð!'ð !ð	!'ð
  ð!'ð (ð!'ð !ð!'ð #ð!'ð &ð!'ð "ð!'ð ð!'ð 
ó!'ðF ò&ó ð&óaóô
!r   r1   c                óz   — | €y t        | t        «      r| j                  S t        | t        «      r| S t	        d«      ‚)NzEcollation must be a dict, an instance of collation.Collation, or None)rR   r1   rF   ÚdictÚ	TypeError)Úvalues    r   Úvalidate_collation_or_nonere   Ù   s;   € ð €}ØÜ�%œÔ#Ø�~‰~ÐÜ�%œÔØˆÜ
Ð[Ó
\Ð\r   N)rd   z-Optional[Union[Mapping[str, Any], Collation]]r\   zOptional[dict[str, Any]])r   Ú
__future__r   Útypingr   r   r   r   Úpymongor   Úpymongo.write_concernr	   r   r   r#   r)   r1   re   r   r   r   ú<module>rj      sj   ðñõ #ç 0Ó 0å Ý 2÷Oñ O÷,ñ ÷&
$ñ 
$÷4ñ 4÷ s!ñ s!ðl	]Ø8ð	]àô	]r   