
    [j                       U d Z ddlmZ ddlZddlZddlZddlmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZ ddlZddlmZmZmZmZm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$ dZ%n# e&$ r dZ%Y nw xY wddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 e
r<ddlm8Z8 ddl9m:Z: ddl;m<Z<m=Z=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZF ddl4mGZG ddlHmIZImJZJ dZKdZLdZMdZNdZOdZPd ZQd!ZRd"ZSd#ZTd$ZUd%ZVd&ZWeNd'eOd(ePd)iZXd*d+d,d-ZY ed./          ZZd0e[d1<   dd4Z\dd9Z]dd=Z^ddCZ_ e"g dD          Z` e"g dE          Za	 	 	 dddWZbdd^Zc G d_ d`          Zd G da db          Ze G dc dded          Zf G de dfee          Zg G dg dheh          Zi ejj        di          jk        ZldjZmddpZn ejj        dq          jk        ZoddrZp ejj        ds          jk        Zq ejj        dt          jk        Zr ejj        du          jk        Zsdd}ZtddZuddZve%re$jw        Zv	 dddZwddZxddZyddZze%re$j{        Zz	 dddZ| ejj        d          jk        Z}ddZ~ddZddZe%re$j        Z	 dddZ G d d          ZdZ G d de          ZddZeNdeOdePdiZddZddZe%re$j        ZddZddZe%re$j        ZddZddZe%re$j        ZddZ G d d          Z G d d          Zej        ej        ej        ej        iZde[d<   dS )zTools for creating `messages
<https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/>`_ to be sent to
MongoDB.

.. note:: This module is for internal use and is generally not needed by
   application developers.
    )annotationsN)BytesIO)
TYPE_CHECKINGAnyCallableIterableMappingMutableMappingNoReturnOptionalUnioncast)CodecOptions_decode_selective_dict_to_bson_make_c_stringencode)Int64)_RAW_ARRAY_BSON_OPTIONSDEFAULT_RAW_BSON_OPTIONSRawBSONDocument_inflate_bson)SON)	_cmessageTF)ConfigurationErrorCursorNotFoundDocumentTooLargeExecutionTimeoutInvalidOperationNotPrimaryErrorOperationFailureProtocolError)HelloCompat)_handle_reauth)ReadPreference)WriteConcern)	timedelta)ClientSession)SnappyContextZlibContextZstdContext)MongoClient)_EventListeners)
Connection)ReadConcern)_ServerMode)_Address_DocumentOutii   i?                   s            s           s       s   documents     s   updates     s   deletes     	documentsupdatesdeletes)insertupdatedeletereplace)unicode_decode_error_handlerzCodecOptions[Mapping[str, Any]]_UNICODE_REPLACE_CODEC_OPTIONSreturnintc                 @    t          j        t          t                    S )z(Generate a pseudo random 32 bit integer.)randomrandint	MIN_INT32	MAX_INT32 r5   S/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/pymongo/message.py_randintrK   r   s    >)Y///r5   specMutableMapping[str, Any]read_preferencer0   c                    |j         }|j        }|rC|t          j        j         k    st	          |          dk    rd| vrt          d| fg          } || d<   | S )z-Add $readPreference to spec when appropriate.r3   $query$readPreference)modedocumentr%   SECONDARY_PREFERREDlenr   )rL   rN   rR   rS   s       rJ   _maybe_add_read_preferencerV   w   so     D'H  +;@@@CMMTUDUDU44()**D"*Kr5   	exception	Exceptiondict[str, Any]c                :    t          |           | j        j        dS )z<Convert an Exception into a failure document for publishing.)errmsgerrtype)str	__class____name__)rW   s    rJ   _convert_exceptionr`      s    )nn1D1MNNNr5   	operationr]   commandMapping[str, Any]resultc                |   |                     dd          }d|d}|                     d|                     dd                    }|rR|                     d          r|d	dd
id|d<   n1d|                     dd          |d}d|v r|d         |d<   |g|d<   |S | dk    rt          |d                   |d<   n| dk    r}d|v rd|d         dg|d<   ni|                     d          du rR|dk    rL|d         d         }|d                              d|d                              d                    }d|dg|d<   |S )z6Convert a legacy write result to write command format.nr   r3   )okrf   r[   err wtimeout@   T)r[   codeerrInfowriteConcernErrorrl      )indexrl   r[   rm   writeErrorsr<   r9   r=   upserted)rp   _idupdatedExistingFr:   urs   q)getrU   )	ra   rb   rd   affectedresr[   errorr=   rs   s	            rJ   _convert_write_resultr{      s   
 zz#q!!H
"
"CZZ&**UB"7"788F 
::j!! 	28"R\^bQc'd'dC#$$  FA)>)>&QQEF""#))#4i "'CJHw{+,,C	h		)*6*3EFFGC
OO ZZ)**e33A Y'*F+//%)?)?@@C)*3778C
OJr5   ))tailabler4   )oplogReplayro   )noCursorTimeout   )	awaitData    )allowPartialResults   ))rP   filter)z$orderbysort)z$hinthint)z$commentcomment)z$maxScanmaxScan)z
$maxTimeMS	maxTimeMS)z$maxmax)z$minmin)z
$returnKey	returnKey)z$showRecordIdshowRecordId)z$showDiskLocr   )z	$snapshotsnapshotcoll
projection1Optional[Union[Mapping[str, Any], Iterable[str]]]skiplimit
batch_sizeOptional[int]optionsread_concernr/   	collationOptional[Mapping[str, Any]]sessionOptional[ClientSession]allow_disk_useOptional[bool]SON[str, Any]c                2   t          d| fg          }d|v rd|                    d |                                D                        d|v r|                    d           d|v r|                    d           n||d<   |r||d<   |r||d<   |rt	          |          |d	<   |d
k     rd|d<   |r||d<   |j        r|	r|	j        s
|j        |d<   |r||d<   |
|
|d<   r8|                    fdt                                          D                        |S )z!Generate a find command document.findrP   c                L    g | ]!\  }}|t           v rt           |         |fn||f"S rI   )
_MODIFIERS).0keyvals      rJ   
<listcomp>z%_gen_find_command.<locals>.<listcomp>   sH       C +.*;*;C#&&#s  r5   $explainrQ   r   r   r   r   r   TsingleBatch	batchSizereadConcernr   NallowDiskUsec                (    g | ]\  }}|z  
|d fS )TrI   )r   optr   r   s      rJ   r   z%_gen_find_command.<locals>.<listcomp>   s*    RRRHCGcMRS$KRRRr5   )	r   r=   itemspopabslevelin_transactionrS   _OPTIONS)r   rL   r   r   r   r   r   r   r   r   r   cmds         `     rJ   _gen_find_commandr      s    vtn-..C4

  $

  	
 	
 	
 GGJ##GG%&&&H '&L F &5zzG199!%C &%K 37 3w/E 3)2M %$K!,N T

RRRR0@0@RRRSSSJr5   	cursor_idmax_await_time_msr   Optional[Any]connr.   c                p    t          d| fd|fg          }|r||d<   |||d<   ||j        dk    r||d<   |S )z$Generate a getMore command document.getMore
collectionr   Nr   	   r   )r   max_wire_version)r   r   r   r   r   r   r   s          rJ   _gen_get_more_commandr     sc     y)4|T6JKLLC &%K$,Kt499 IJr5   c                  V    e Zd ZdZdZdZdZd.dZd/d"Zd0d#Z	d1d&Z
	 d2d3d*Z	 d2d4d-ZdS )5_QueryzA query operation.)flagsdbr   ntoskiprL   fieldscodec_optionsrN   r   r   namer   r   r   clientr   _as_commandexhaustNr   rC   r   r]   r   r   rL   rc   r   r   r   r   rN   r0   r   r   r   r/   r   r   r   r   r,   r   r   r   boolc                   || _         || _        || _        || _        || _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        || _        d| _        d | _        || _        d S )Nr   )r   r   r   r   rL   r   r   rN   r   r   r   r   r   r   r   r   r   r   )selfr   r   r   r   rL   r   r   rN   r   r   r   r   r   r   r   r   s                    rJ   __init__z_Query.__init__1  s    & 
		*.(
$",	@Dr5   rB   Nonec                    d | _         d S Nr   r   s    rJ   resetz_Query.resetW      r5   c                $    | j          d| j         S N.r   r   r   s    rJ   	namespacez_Query.namespaceZ      '''DI'''r5   r   r.   c                    d}| j         sd}n=|j        dk    rd}n/| j        j        s#t	          d| j        j        |j        fz            |                    | j        | j                   |S )NFTro   zDread concern level of %s is not valid with a max wire version of %d.)	r   r   r   ok_for_legacyr   r   validate_sessionr   r   )r   r   use_find_cmds      rJ   use_commandz_Query.use_command]  s    | 		LL"a''LL"0 	$1484E4KTMb3cd  
 	dk4<888r5   Fapply_timeouttuple[SON[str, Any], str]c                   | j         | j         S d| j        v }t          | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j        | j                  }|rd| _        t          d|fg          }| j        }|                    |           |r<|                    |d| j        |           |s|j        s|                    ||           |                    ||| j                   | j        }|j        rW|j        j        sKt1          t          t2          t4          f         |j                            | j        || j                            }|r|                    ||           || j        f| _         | j         S )z.Return a find command document for this query.Nr   explainF)r   rL   r   r   r   r   r   r   r   r   r   r   r   r   r   add_server_api	_apply_torN   r   _update_read_concernsend_cluster_timer   
_encrypter_bypass_auto_encryptionr   r]   r   encryptr   r   r   )r   r   r   r   r   r   r   s          rJ   
as_commandz_Query.as_commandm  s    '##	).IIKLJOJNL
 
  	*!DI	3'())C,C    	8c5$*>EEE 87#9 8,,S$777sGT[999 	cV%6%N 	cs38}f&7&?&?dN`&a&abbC 	,vs+++<r5   use_cmdtuple[int, bytes, int]c           
     @   || _         |j        r| j        dz  }n| j        }|                                 }| j        }|rK|                     |d          d         }t          d|| j        || j        |j	                  \  }}}	}
|||	fS | j
        dk    rdp| j
        }| j        r|rt          | j        |          }n| j        }|j        r't          |t                    sJ t!          ||          }t#          ||| j        |||rdn| j        | j        |j	                  S )	z:Get a query message, possibly setting the secondaryOk bit.   Tr   r   ctxr3   r4   N)rN   rR   r   r   rL   r   _op_msgr   r   compression_contextr   r   r   	is_mongos
isinstancer
   rV   _queryr   r   )r   rN   r   r   r   nsrL   
request_idmsgsize_	ntoreturns               rJ   get_messagez_Query.get_message  sa   
  / 	JNEEJE^^y 
	)??4t?<<Q?D'.",( ( ($JT1 sD((
 Oq(.QA$/	: 	' '
I66		 J	> 	EdN33333-dODDDL,DD(	
 	
 	
 		
r5   ) r   rC   r   r]   r   r]   r   rC   rL   rc   r   r   r   r   rN   r0   r   rC   r   rC   r   r/   r   r   r   r   r   r,   r   r   r   r   rB   r   rB   r]   r   r.   rB   r   Fr   r.   r   r   rB   r   )rN   r0   r   r.   r   r   rB   r   )r_   
__module____qualname____doc__	__slots__conn_mgrr   r   r   r   r   r   r   rI   r5   rJ   r   r     s        I, HI$ $ $ $L       ( ( ( (   " 7<*  *  *  *  * Z OT2
 2
 2
 2
 2
 2
 2
r5   r   c                  R    e Zd ZdZdZdZd*dZd+dZd,dZd-d Z		 d.d/d$Z
	 d.d0d(Zd)S )1_GetMorezA getmore operation.)r   r   r   r   r   r   rN   r   r   r	  r   r   r   r   r   r]   r   r   rC   r   r   r   rN   r0   r   r   r   r,   r   r   r	  r   r   r   r   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        d | _
        || _        || _        d S r   )r   r   r   r   r   rN   r   r   r   r	  r   r   r   )r   r   r   r   r   r   rN   r   r   r   r	  r   r   s                rJ   r   z_GetMore.__init__  sg     	""*.!2 @Dr5   rB   r   c                    d | _         d S r   r   r   s    rJ   r   z_GetMore.reset   r   r5   c                $    | j          d| j         S r   r   r   s    rJ   r   z_GetMore.namespace  r   r5   r   r.   c                x    d}| j         sd}n|j        dk    rd}|                    | j        | j                   |S )NFTro   )r   r   r   r   r   )r   r   r   s      rJ   r   z_GetMore.use_command  sJ    | 	GG"a''Gdk4<888r5   Fr   r   c                \   | j         | j         S t          | j        | j        | j        | j        | j        |          }| j        r"| j                            |d| j	        |           |
                    |           |                    || j        | j                   | j        }|j        rW|j        j        sKt          t           t"          t$          f         |j                            | j        || j                            }|r|                    |d           || j        f| _         | j         S )z1Return a getMore command document for this query.NF)r   )r   r   r   r   r   r   r   r   r   rN   r   r   r   r   r   r   r   r]   r   r   r   r   r   )r   r   r   r   r   s        rJ   r   z_GetMore.as_command  s(   
 '##2NIN"L
 
 < 	KL""3t/CTJJJC   sDL$+>>> 	cV%6%N 	cs38}f&7&?&?dN`&a&abbC 	1v4000<r5   dummy0r   0Union[tuple[int, bytes, int], tuple[int, bytes]]c                D   |                                  }|j        }|rh|                     |d          d         }| j        r| j        rt
          j        }nd}t          ||| j        d| j	        |j                  \  }}	}
}||	|
fS t          || j        | j        |          S )zGet a getmore message.Tr   r   Nr   )r   r   r   r	  r   _OpMsgEXHAUST_ALLOWEDr   r   r   	_get_morer   r   )r   r  r   r   r   r   rL   r   r   r   r   r   s               rJ   r   z_GetMore.get_message/  s     ^^& 		)??4t?<<Q?D}  .'.tTWdD,>DD\( ( ($JT1 sD((T^T^SAAAr5   N)r   r]   r   r]   r   rC   r   rC   r   r   rN   r0   r   r   r   r,   r   r   r	  r   r   r   r   r   r   r  r  r  r  )r  r   r   r.   r   r   rB   r  )r_   r  r  r  r  r   r   r   r   r   r   r   rI   r5   rJ   r  r    s        I  D   :       ( ( ( (	 	 	 	 7<         > >CB B B B B B Br5   r  c                        e Zd Zd fdZ xZS )_RawBatchQueryr   r.   rB   r   c                v    t                                          |           |j        dk    rdS | j        sdS dS Nro   TFsuperr   r   r   r   r   r^   s     rJ   r   z_RawBatchQuery.use_commandE  B    D!!! A%%4 	4ur5   r  r_   r  r  r   __classcell__r^   s   @rJ   r  r  D  =                 r5   r  c                        e Zd Zd fdZ xZS )_RawBatchGetMorer   r.   rB   r   c                v    t                                          |           |j        dk    rdS | j        sdS dS r  r  r  s     rJ   r   z_RawBatchGetMore.use_commandQ  r  r5   r  r  r!  s   @rJ   r$  r$  P  r"  r5   r$  c                  V    e Zd ZU dZded<   dd	Zedd
            ZddZddZ	ddZ
dS )_CursorAddresszEThe server address (host, port) of a cursor, with namespace property.r   _CursorAddress__namespaceaddressr1   r   r]   rB   c                J    t                               | |          }||_        |S r   )tuple__new__r(  )clsr)  r   r   s       rJ   r,  z_CursorAddress.__new__a  s"    }}S'**$r5   c                    | j         S )zThe namespace this cursor.)r(  r   s    rJ   r   z_CursorAddress.namespacef  s     r5   rC   c                >    g | | j         R                                 S r   )r(  __hash__r   s    rJ   r0  z_CursorAddress.__hash__k  s&     *$)())33555r5   otherobjectr   c                    t          |t                    r0t          |           t          |          k    o| j        |j        k    S t          S r   )r   r'  r+  r   NotImplementedr   r1  s     rJ   __eq__z_CursorAddress.__eq__p  s@    e^,, 	U;;%,,.T4>U_3TTr5   c                    | |k     S r   rI   r5  s     rJ   __ne__z_CursorAddress.__ne__u  s    5=  r5   N)r)  r1   r   r]   rB   r'  r  rB   rC   )r1  r2  rB   r   )r_   r  r  r  __annotations__r,  propertyr   r0  r6  r8  rI   r5   rJ   r'  r'  \  s         OO   
       X 6 6 6 6
   
! ! ! ! ! !r5   r'  z<iiiiiiB   databytesr   .Union[SnappyContext, ZlibContext, ZstdContext]tuple[int, bytes]c           
         |                     |          }t                      }t          t          t	          |          z   |dd| t	          |          |j                  }|||z   fS )zDTakes message data, compresses it, and adds an OP_COMPRESSED header.r   i  )compressrK   _pack_compression_header_COMPRESSION_HEADER_SIZErU   compressor_id)ra   r=  r   
compressedr   headers         rJ   	_compressrH  }  sh     d##JJ% 3z??2	D		 F v
***r5   z<iiiic                p    t                      }t          dt          |          z   |d|           }|||z   fS )ztTakes message data and adds a message header based on the operation.

    Returns the resultant message string.
    r   r   )rK   _pack_headerrU   )ra   r=  ridmessages       rJ   __pack_messagerM    s9    
 **C2D		>39==G$r5   z<iz<IBz<Br   
identifierdocs!Optional[list[Mapping[str, Any]]]optsr   tuple[bytes, int, int]c                   t          |d          }t          | d          }t          |          }d}|r|t          d          }	t	          |          }
fd|D             }t          |
          t          d |D                       z   dz   }t          |          }||z  }t          d |D                       }|||	||
g|}n||g}d	                    |          ||fS )
zGet a OP_MSG message.

    Note: this method handles multiple documents in a type one payload but
    it does not perform batch splitting and the total message size is
    only checked *after* generating the entire message.
    Fr   Nr3   c                2    g | ]}t          |d           S r  )r   )r   docrQ  s     rJ   r   z%_op_msg_no_header.<locals>.<listcomp>  s%    HHHCc5$77HHHr5   c              3  4   K   | ]}t          |          V  d S r   rU   r   rU  s     rJ   	<genexpr>z$_op_msg_no_header.<locals>.<genexpr>  s(      !C!Cs#c((!C!C!C!C!C!Cr5   r   c              3  4   K   | ]}t          |          V  d S r   rW  rX  s     rJ   rY  z$_op_msg_no_header.<locals>.<genexpr>  s(      <<3s88<<<<<<r5   r5   )	r   _pack_op_msg_flags_typerU   
_pack_byter   sum	_pack_intr   join)r   rb   rN  rO  rQ  encoded
flags_type
total_sizemax_doc_sizetype_onecstringencoded_docsr   encoded_sizer=  s       `          rJ   _op_msg_no_headerrh    s    GUD11G(22JWJL 
%d&a== ,,HHHH4HHH7||c!C!Cl!C!C!CCCCaG d
<<|<<<<<GX|WT|TG$88D>>:|33r5   tuple[int, bytes, int, int]c                d    t          | ||||          \  }}}t          d||          \  }	}|	|||fS )zInternal OP_MSG message helper.  )rh  rH  )
r   rb   rN  rO  rQ  r   r   rb  max_bson_sizerK  s
             rJ   _op_msg_compressedrm    sF     &7ugzSWY]%^%^"C]sC((HCZ..r5   c                b    t          | ||||          \  }}}t          d|          \  }}	||	||fS )z*Internal compressed OP_MSG message helper.rk  )rh  rM  )
r   rb   rN  rO  rQ  r=  rb  rl  r   
op_messages
             rJ   _op_msg_uncompressedrp    sE     '8w
TXZ^&_&_#D*m+D$77J
z:}<<r5   dbnameOptional[_ServerMode]4Union[SnappyContext, ZlibContext, ZstdContext, None]c                n   ||d<   |d|vr|j         r
|j        |d<   t          t          |                    }	 t          |         }|                    |          }n# t          $ r d}d}Y nw xY w	 |rt          | |||||          |r|||<   S S t          | ||||          |r|||<   S S # |r|||<   w xY w)zGet a OP_MSG message.$dbNrQ   ri   )	rR   rS   nextiter
_FIELD_MAPr   KeyErrorrm  rp  )	r   rb   rq  rN   rQ  r   r   rN  rO  s	            rJ   r   r     s$    GEN"'8'G'G 	B)8)AG%&WD%
{{:&&   
' 	S%eWj$cRR  	'"&GJ	' $E7JdKK  	'"&GJ	': 	'"&GJ&&&&s#   "A A.-A.2B+ B+ +	B4collection_namenum_to_skipnum_to_returnqueryfield_selectortuple[bytes, int]c                F   t          |d|          }|rt          |d|          }nd}t          t          |          t          |                    }	d                    t	          |           t          |          t	          |          t	          |          ||g          |	fS )zGet an OP_QUERY message.Fr5   )r   r   rU   r_  r^  r   )
r   rz  r{  r|  r}  r~  rQ  r`  efsrl  s
             rJ   _query_implr    s     E5$//G NE488Gc#hh//M'""//+&&-((		
 		
 	 r5   r   c           	     d    t          | ||||||          \  }}	t          d||          \  }
}|
||	fS )z)Internal compressed query message helper.  )r  rH  )r   rz  r{  r|  r}  r~  rQ  r   op_queryrl  rK  r   s               rJ   _query_compressedr     sL     *+}e^UY Hm x--HC]""r5   c           	     b    t          | ||||||          \  }}t          d|          \  }	}
|	|
|fS )zInternal query message helper.r  )r  rM  )r   rz  r{  r|  r}  r~  rQ  r  rl  rK  r   s              rJ   _query_uncompressedr  2  sJ     *+}e^UY Hm dH--HC]""r5   c           
     \    |rt          | |||||||          S t          | ||||||          S )zGet a **query** message.)r  r  )r   rz  r{  r|  r}  r~  rQ  r   s           rJ   r   r   G  sU      
 _k=%Y]_b
 
 	
 +}e^UY  r5   z<qc                    d                     t          t          |           t          |          t	          |          g          S )zGet an OP_GET_MORE message.r5   )r_  _ZERO_32r   r^  _pack_long_longrz  r|  r   s      rJ   _get_more_implr  ^  sA    88?++m$$I&&		
  r5   c                B    t          dt          | ||          |          S )z+Internal compressed getMore message helper.  )rH  r  rz  r|  r   r   s       rJ   _get_more_compressedr  j  s#     T>/=)TTVYZZZr5   c                @    t          dt          | ||                    S )z Internal getMore message helper.r  )rM  r  r  s      rJ   _get_more_uncompressedr  t  s      $y Y YZZZr5   c                L    |rt          | |||          S t          | ||          S )zGet a **getMore** message.)r  r  r  s       rJ   r  r    s3      T#O]IsSSS!/=)LLLr5   c                      e Zd ZdZdZd4dZd5dZd6dZd7dZe	d8d            Z
e	d8d            Ze	d8d             Ze	d8d!            Zd9d'Zed:d)            Zd;d*Zd<d0Zd=d2Zd3S )>_BulkWriteContextzCA wrapper around Connection for use with write splitting functions.)db_namer   op_idr   fieldpublish
start_time	listenersr   rB  op_typecodecdatabase_namer]   cmd_namer   r.   operation_idrC   r  r-   r   r(   r  r  r   c	                F   || _         || _        || _        || _        |j        | _        || _        t          | j                 | _        | j        rt          j	        
                                nd | _        || _        t          |j                  | _        || _        || _        d S r   )r  r   r  r  enabled_for_commandsr  r   rx  r  datetimenowr  r   r   r   rB  r  r  )	r   r  r  r   r  r  r   r  r  s	            rJ   r   z_BulkWriteContext.__init__  s     %	!
" 5		*
59\K(+//111tT566


r5   r   rM   rO  list[Mapping[str, Any]]rB   *tuple[int, bytes, list[Mapping[str, Any]]]c                    | j         dz   }t          || j        ||| j        |           \  }}}|st	          d          |||fS )N.$cmdcannot do an empty bulk write)r  _do_batched_op_msgr  r  r   )r   r   rO  r   r   r   to_sends          rJ   __batch_commandz!_BulkWriteContext.__batch_command  s^     L7*	#5t|S$
D$
 $
 
C  	D"#BCCC3''r5   r   r,   1tuple[Mapping[str, Any], list[Mapping[str, Any]]]c                    |                      ||          \  }}}|                     ||||          }|                    || j                   ||fS r   ) _BulkWriteContext__batch_commandwrite_command_process_responser   )r   r   rO  r   r   r   r  rd   s           rJ   executez_BulkWriteContext.execute  s[     $(#7#7T#B#B 
C##CS'BB  666wr5   c                l    |                      ||          \  }}}|                     |||d|           |S )Nr   )r  unack_write)r   r   rO  r   r   r   r  s          rJ   execute_unackz_BulkWriteContext.execute_unack  sC     $(#7#7T#B#B 
C 	j#q':::r5   c                    | j         j        S )z#A proxy for SockInfo.max_bson_size.)r   rl  r   s    rJ   rl  z_BulkWriteContext.max_bson_size  s     y&&r5   c                F    | j         r| j        j        dz
  S | j        j        S )z&A proxy for SockInfo.max_message_size.r   )rB  r   max_message_sizer   s    rJ   r  z"_BulkWriteContext.max_message_size  s)     = 	39-22y))r5   c                    | j         j        S )z*A proxy for SockInfo.max_write_batch_size.)r   max_write_batch_sizer   s    rJ   r  z&_BulkWriteContext.max_write_batch_size  s     y--r5   c                    | j         S )z:The maximum size of a BSON command before batch splitting.)rl  r   s    rJ   max_split_sizez _BulkWriteContext.max_split_size  s     !!r5   r   r   r>  rc  r   c                   | j         rd| j        J t          j                                        | j        z
  }|                     |||          }t          j                                        }	 | j                            ||          }| j         rXt          j                                        |z
  |z   }|t          | j        ||          }	nddi}	| 	                    ||	|           n# t          $ r}
| j         r| j        J t          j                                        |z
  |z   }t          |
t                    rt          | j        ||
j                  }n,t          |
t                    r|
j        }nt          |
          }|                     |||            d}
~
ww xY wt          j                                        | _        n(# t          j                                        | _        w xY w|S )zAA proxy for Connection.unack_write that handles event publishing.Nrg   r3   )r  r  r  r  _startr   r  r{   r   _succeedrX   r   r!   detailsr    r`   _fail)r   r   r   r   rc  rO  durationstartrd   replyexcfailures               rJ   r  z_BulkWriteContext.unack_write  s    < 	,?...(,,..@H++c:t44C%))++E	6Y**3==F| ;$-1133e;xG%1$)S&IIEE "1IEj%::: 	 	 	| 	:222$-1133e;xGc#344 6,A$)SRUR],^,^GG_55 6!kGG055G

:w999	 '/3355DOOh/3355DO5555s,   -A:C( 'G (
F 2B)FF  G %G,rY   c                N   | j         rd| j        J t          j                                        | j        z
  }|                     |||           t          j                                        }	 | j                            ||| j                  }| j         r;t          j                                        |z
  |z   }|                     |||           n# t          $ r{}| j         rnt          j                                        |z
  |z   }t          |t          t          f          r|j        }	nt          |          }	|                     ||	|            d}~ww xY wt          j                                        | _        n(# t          j                                        | _        w xY w|S )zCA proxy for SocketInfo.write_command that handles event publishing.N)r  r  r  r  r  r   r  r  r  rX   r   r    r!   r  r`   r  )
r   r   r   r   rO  r  r  r  r  r  s
             rJ   r  z_BulkWriteContext.write_command  s    < 	,?...(,,..@HKKZ...%))++E	6I++JTZHHE| ;$-1133e;xGj%::: 	 	 	| :$-1133e;xGcO5E#FGG 6,/KGG055G

:w999	 '/3355DOOh/3355DO5555s,   -A#C E= 
EA6EEE= =%F"c                    ||| j         <   | j                            || j        || j        j        | j        | j        j                   |S )zPublish a CommandStartedEvent.)r  r  publish_command_startr  r   r)  r  
service_id)r   r   r   rO  s       rJ   r  z_BulkWriteContext._start3  sP     DJ,,LIJI 	
 	
 	
 
r5   r  r2   r  r'   r   c           
         | j                             ||| j        || j        j        | j        | j        j        | j                   dS )z Publish a CommandSucceededEvent.r  N)r  publish_command_successr   r   r)  r  r  r  )r   r   r  r  s       rJ   r  z_BulkWriteContext._succeedB  sS    ..IIJI , 	/ 		
 		
 		
 		
 		
r5   r  c           
         | j                             ||| j        || j        j        | j        | j        j        | j                   dS )zPublish a CommandFailedEvent.r  N)r  publish_command_failurer   r   r)  r  r  r  )r   r   r  r  s       rJ   r  z_BulkWriteContext._failO  sS    ..IIJI , 	/ 		
 		
 		
 		
 		
r5   N)r  r]   r  r]   r   r.   r  rC   r  r-   r   r(   r  rC   r  r   )r   rM   rO  r  rB   r  r   rM   rO  r  r   r,   rB   r  r   rM   rO  r  r   r,   rB   r  r9  )r   rM   r   rC   r   r>  rc  rC   rO  r  rB   r   )
r   rM   r   rC   r   r>  rO  r  rB   rY   )r   rM   r   rC   rO  r  rB   rM   )r   rC   r  r2   r  r'   rB   r   )r   rC   r  r2   r  r'   rB   r   )r_   r  r  r  r  r   r  r  r  r;  rl  r  r  r  r  r$   r  r  r  r  rI   r5   rJ   r  r    sb       MMI   0	( 	( 	( 	(   
 
 
 
 ' ' ' X' * * * X* . . . X. " " " X"& & & &P    ^>   
 
 
 

 
 
 
 
 
r5   r  i    c                  B    e Zd ZdZddZddZddZedd            ZdS )_EncryptedBulkWriteContextrI   r   rM   rO  r  rB   8tuple[MutableMapping[str, Any], list[Mapping[str, Any]]]c                   | j         dz   }t          || j        ||| j        |           \  }}|st	          d          |                    dd          dz   }t          t          |          |d          t                    }||fS )Nr  r  r7   r   r   )	r  _encode_batched_write_commandr  r  r   rp   r   
memoryviewr   )r   r   rO  r   r   r  	cmd_startoutgoings           rJ   r  z*_EncryptedBulkWriteContext.__batch_commandg  s     L7*	4t|S$
D
 
W  	D"#BCCC IIgq))A-	 C!<>VWW  r5   r   r,   r  c                    |                      ||          \  }}| j                            | j        || j        | j        |          }||fS )N)r   r   r   ))_EncryptedBulkWriteContext__batch_commandr   rb   r  r  r   )r   r   rO  r   batched_cmdr  rd   s          rJ   r  z"_EncryptedBulkWriteContext.executev  sX      $33C>>W$(I$5$5L+TZ^d %6 %
 %
 wr5   c                    |                      ||          \  }}| j                            | j        |t	          d          | j        |           |S )Nr   )w)write_concernr   r   )r  r   rb   r  r&   r   )r   r   rO  r   r  r  s         rJ   r  z(_EncryptedBulkWriteContext.execute_unack  sb      $33C>>W	L&+++L 	 	
 	
 	
 r5   rC   c                    t           S )z Reduce the batch splitting size.)_MAX_SPLIT_SIZE_ENCr   s    rJ   r  z)_EncryptedBulkWriteContext.max_split_size  s
     #"r5   N)r   rM   rO  r  rB   r  r  r  r9  )	r_   r  r  r  r  r  r  r;  r  rI   r5   rJ   r  r  d  su        I! ! ! !       # # # X# # #r5   r  doc_sizemax_sizer   c                Z    | dk    rt          d||fz            t          | d          )z-Internal helper for raising DocumentTooLarge.r<   zfBSON document too large (%d bytes) - the connected server supports BSON document sizes up to %d bytes.z command document too large)r   )ra   r  r  s      rJ   _raise_document_too_larger    sL    H "8,-
 
 	
 )JJJKKKr5   s
   documents s   updates s   deletes r  ackr   buf_BytesIO#tuple[list[Mapping[str, Any]], int]c                8   |j         }|j        }|j        }	|rdnd}
|                    |
           |                    d           |                    t	          |d|                     |                    d           |                                }|                    d           	 |                    t          |                     n# t          $ r t          d          dw xY wg }d}|D ]}t	          |d|          }t          |          }|                                |z   }|dk    o||	k    }| o||k    }|s|rJt          t                                                    |          }t          |t          |          |           ||	k    r n8|                    |           |                    |           |d	z  }||k    r n|                                }|                    |           |                    t!          ||z
                       ||fS )
zCreate a batched OP_MSG write.r8   s      r7   F   Unknown commandNr   r3   )rl  r  r  writer   tell_OP_MSG_MAPry  r   rU   listrx  keysr  appendseekr^  )ra   rb   rO  r  rQ  r   r  rl  r  r  r   size_locationr  idxrU  value
doc_lengthnew_message_sizedoc_too_largeunacked_doc_too_largewrite_oplengths                         rJ   _batched_op_msg_implr    sI    %M3+#&?,?EIIe IIgIImGUD11222 IIgHHJJMII!"""<		+i()))) < < <011t;< G
C  c5$//ZZ
88::
2qJ&69I&I %( HZ--G 	K1 	KJOO--..y9H%hE

MJJJ...E		%sq&&&E ' XXZZFHH]IIi.//000F?s   ) C
 
C%%tuple[bytes, list[Mapping[str, Any]]]c           	     z    t                      }t          | ||||||          \  }}|                                |fS )zOEncode the next batched insert, update, or delete operation
    as OP_MSG.
    )r  r  getvalue)	ra   rb   rO  r  rQ  r   r  r  r   s	            rJ   _encode_batched_op_msgr    s>     **C%i$T3PSTTJGQ<<>>7""r5   r  c                    t          | |||||          \  }}|j        j        J t          d||j        j                  \  }}	||	|fS )z]Create the next batched insert, update, or delete operation
    with OP_MSG, compressed.
    Nrk  )r  r   r   rH  )
ra   rb   rO  r  rQ  r   r=  r  r   r   s
             rJ   _batched_op_msg_compressedr    sX     +9gtS$PSTTMD'8'333dCH,HIIOJsG##r5   c           	        t                      }|                    t                     |                    d           t          | ||||||          \  }}|                    d           t                      }	|                    t          |	                     |                    d           |                    t          |                     |	|                                |fS )z"OP_MSG implementation entry point.s         r   r   )r  r  _ZERO_64r  r  rK   r^  r  )
ra   rb   rO  r  rQ  r   r  r  r  r   s
             rJ   _batched_op_msgr    s     **C IIhII1222*9gtS$PSUXYYOGV HHQKKKJIIi
##$$$HHQKKKIIi   s||~~w..r5   r   c                   |                      dd          d         |d<   d|v r*t          |d                             dd                    }nd}|j        j        rt          ||||||          S t          ||||||          S )zRCreate the next batched insert, update, or delete operation
    using OP_MSG.
    r   r3   r   ru  writeConcernr  T)splitr   rw   r   r   r  r  )r   ra   rb   rO  rQ  r   r  s          rJ   r  r  6  s     __S!,,Q/GEN  7>*..sA6677
x# T))WdCsSSS9gtS$DDDr5   c           	     z    t                      }t          | ||||||          \  }}|                                |fS )z:Encode the next batched insert, update, or delete command.)r  _batched_write_command_implr  )	r   ra   rb   rO  rQ  r   r  r  r   s	            rJ   r  r  N  s@     **C,Y	7DRVX[]`aaJGQ<<>>7""r5   c                   |j         }|j        }|t          z   }	|j        }
|                    t
                     |                    |                     d                     |                    t                     |                    t                     |	                                }|                    t          |                     |
                    dd           |                                 	 |                    t          |                    n# t          $ r t          d          dw xY w|	                                dz
  }g }d}|D ]W}t          |                              d          }t!          |d|          }t#          |          |	k    }|rJt%          t&                                                    |         }t+          |t#          |          |           |d	k    o7|	                                t#          |          z   t#          |          z   |
k    }||k    }|s|r nz|                    t,                     |                    |           |                    t                     |                    |           |                    |           |d	z  }Y|                    t0                     |	                                }|
                    |           |                    t3          ||z
  d	z
                       |
                    |           |                    t3          ||z
                       ||fS )
z(Create a batched OP_QUERY write command.utf8r4   r  Nr   r   Fr3   )rl  r  _COMMAND_OVERHEADr  r  r  r   _ZERO_8_SKIPLIMr  r  truncate_OP_MAPry  r   r]   r   rU   r  rx  r  r  _BSONOBJr  _ZERO_16r^  )r   ra   rb   rO  rQ  r   r  rl  r  max_cmd_sizer  command_start
list_startr  r  rU  r   r  r  r  enough_dataenough_documentsr  s                          rJ   r  r  a  s    %M3 !#44L'N IIhIIiv&&'''IIgIIh HHJJMIIfWoo HHROOOLLNNN<		')$%%%% < < <011t;< aJG
C  #hhoof%%c5$// E

\1 	KJOO--..y9H%hE

MJJJQhYCHHJJS$9CJJ$F>#Y"66 	* 	E		(		#		'		%sq IIh XXZZFHHZIIi+a/00111HH]IIi.//000F?s   7 D D3c                      e Zd ZdZdZ ej        d          j        ZdZ	d!dZ
	 d"d#dZdeddfd$dZd%dZd&dZed'd            Zed(d             ZdS ))_OpReplyz$A MongoDB OP_REPLY response message.)r   r   number_returnedr9   z<iqiir3   r   rC   r   r  r9   r>  c                X    || _         t          |          | _        || _        || _        d S r   )r   r   r   r  r9   )r   r   r   r  r9   s        rJ   r   z_OpReply.__init__  s+    
y))."r5   Nr   user_fieldsr   rB   list[bytes]c                   | j         dz  r.|t          d          d|fz  }d|dd}t          |d|          | j         dz  r	t          j        | j                                                  }|                    d	d           |d
                             t          j
                  rt          |d
         |          |                    d          dk    r:d}t          |                    d
|          |                    d          |          t          d|                    d
          z  |                    d          |          | j        r| j        gS g S )a  Check the response header from the database, without decoding BSON.

        Check the response for errors and unpack.

        Can raise CursorNotFound, NotPrimaryError, ExecutionTimeout, or
        OperationFailure.

        :Parameters:
          - `cursor_id` (optional): cursor_id we sent to get this response -
            used for raising an informative exception when we get cursor id not
            valid at server response.
        r3   Nz"No cursor id for getMore operationzCursor not found, cursor id: %dr   +   )rg   r[   rl   r4   rg   z$errrl   2   zoperation exceeded time limitzdatabase error: %s)r   r"   r   bsonBSONr9   decode
setdefault
startswithr#   LEGACY_ERRORr    rw   r   r!   )r   r   r!  r   errobjerror_objectdefault_msgs          rJ   raw_responsez_OpReply.raw_response  sz    :> 	 #$HIII 4ylBCb99F b&111Z!^ 	!%4>!:!:!A!A!C!CL##D!,,,F#..{/GHH %l6&:LIII!!&))R//=& $$V[99<;K;KF;S;SUa   #$|'7'7'?'??  ((  
 > 	$N##	r5   Fr   r   legacy_responser   list[dict[str, Any]]c                    |                      |           |rt          j        | j        |          S t          j        | j        ||          S )a  Unpack a response from the database and decode the BSON document(s).

        Check the response for errors and unpack, returning a dictionary
        containing the response data.

        Can raise CursorNotFound, NotPrimaryError, ExecutionTimeout, or
        OperationFailure.

        :Parameters:
          - `cursor_id` (optional): cursor_id we sent to get this response -
            used for raising an informative exception when we get cursor id not
            valid at server response
          - `codec_options` (optional): an instance of
            :class:`~bson.codec_options.CodecOptions`
          - `user_fields` (optional): Response fields that should be decoded
            using the TypeDecoders from codec_options, passed to
            bson._decode_all_selective.
        )r/  r&  
decode_allr9   _decode_all_selectiver   r   r   r!  r0  s        rJ   unpack_responsez_OpReply.unpack_response  sL    2 	)$$$ 	B?4>=AAA)$.-UUUr5   rY   c                X    |                      |          }| j        dk    sJ |d         S )Unpack a command response.r   r3   r   )r6  r  )r   r   rO  s      rJ   command_responsez_OpReply.command_response  s5    ##-#@@#q((((Awr5   r   c                    t           z)Return the bytes of the command response.)NotImplementedErrorr   s    rJ   raw_command_responsez_OpReply.raw_command_response  s
     "!r5   c                    dS )+Is the moreToCome bit set on this response?FrI   r   s    rJ   more_to_comez_OpReply.more_to_come  s	     ur5   r   c                f    |                      |          \  }}}}|dd         } | ||||          S )z%Construct an _OpReply from raw bytes.   N)UNPACK_FROM)r-  r   r   r   r   r  r9   s          rJ   unpackz_OpReply.unpack  sA     03s/C/C,y!_H	s5)_i@@@r5   )r   rC   r   rC   r  rC   r9   r>  )NN)r   r   r!  r   rB   r"  
r   r   r   r   r!  r   r0  r   rB   r1  r   r   rB   rY   )rB   r   rB   r   )r   r>  rB   r  )r_   r  r  r  r  structStructunpack_fromrD  OP_CODEr   r/  rA   r6  r:  r>  r;  rA  classmethodrE  rI   r5   rJ   r  r    s       ..FI&-((4KG# # # # [_+ + + + +^ $(&D37 %V V V V V<   " " " "
    X A A A [A A Ar5   r  c                      e Zd ZdZdZ ej        d          j        ZdZ	dZ
dZdZd"dZdi fd#dZdeddfd$dZd%dZd&dZed'd            Zed(d!            ZdS ))r  z"A MongoDB OP_MSG response message.)r   r   r  payload_documentz<IBirk  r3   r4   i   r   rC   rO  r>  c                "    || _         || _        d S r   )r   rO  )r   r   rO  s      rJ   r   z_OpMsg.__init__.  s    
 0r5   Nr   r   r!  r   rB   r  c                X    t          t          | j                  |t                    }|gS )zp
        cursor_id is ignored
        user_fields is used to determine which fields must not be decoded
        )r   r   rO  r   )r   r   r!  inflated_responses       rJ   r/  z_OpMsg.raw_response2  s2     .D122KAX
 
 """r5   Fr   r   r0  r   r1  c                @    |rJ t          j        | j        ||          S )a  Unpack a OP_MSG command response.

        :Parameters:
          - `cursor_id` (optional): Ignored, for compatibility with _OpReply.
          - `codec_options` (optional): an instance of
            :class:`~bson.codec_options.CodecOptions`
          - `user_fields` (optional): Response fields that should be decoded
            using the TypeDecoders from codec_options, passed to
            bson._decode_all_selective.
        )r&  r4  rO  r5  s        rJ   r6  z_OpMsg.unpack_response@  s)    $ #""")$*?P[\\\r5   rY   c                :    |                      |          d         S )r8  r9  r   )r6  )r   r   s     rJ   r:  z_OpMsg.command_responseU  s    ##-#@@CCr5   c                    | j         S r<  )rO  r   s    rJ   r>  z_OpMsg.raw_command_responseY  s    $$r5   c                :    t          | j        | j        z            S )r@  )r   r   MORE_TO_COMEr   s    rJ   rA  z_OpMsg.more_to_come]  s     DJ!22333r5   r   c                \   |                      |          \  }}}|dk    r:|| j        z  rt          d|d          || j        z  rt          d|d          |dk    rt          d|d          t	          |          |dz   k    rt          d          |dd         } | ||          S )	z#Construct an _OpMsg from raw bytes.r   z+Unsupported OP_MSG flag checksumPresent: 0xxzUnsupported OP_MSG flags: 0xz#Unsupported OP_MSG payload type: 0x   z$Unsupported OP_MSG reply: >1 sectionN)rD  CHECKSUM_PRESENTr"   rW  rU   )r-  r   r   first_payload_typefirst_payload_sizerO  s         rJ   rE  z_OpMsg.unpackb  s     9<8L8L5!#5A::s++ ]#$[RW$[$[$[\\\s'' N#$L5$L$L$LMMM"" \FX \ \ \]]]s88)A--- FGGGqrr7s5*+++r5   )r   rC   rO  r>  )r   r   r!  r   rB   r  rF  rG  )rB   r>  rH  )r   r>  rB   r  )r_   r  r  r  r  rI  rJ  rK  rD  rL  r[  rW  r  r   r/  rA   r6  r:  r>  r;  rA  rM  rE  rI   r5   rJ   r  r  !  s       ,,MI&-''3KG LO1 1 1 1 $(35# # # # #  $(&D37 %] ] ] ] ]*D D D D% % % % 4 4 4 X4 , , , [, , ,r5   r  z5dict[int, Callable[[bytes], Union[_OpReply, _OpMsg]]]_UNPACK_REPLYr9  )rL   rM   rN   r0   rB   rM   )rW   rX   rB   rY   )ra   r]   rb   rc   rd   rc   rB   rY   )NNN)r   r]   rL   rc   r   r   r   rC   r   rC   r   r   r   r   r   r/   r   r   r   r   r   r   rB   r   )r   r   r   r]   r   r   r   r   r   r   r   r.   rB   r   )ra   rC   r=  r>  r   r?  rB   r@  )ra   rC   r=  r>  rB   r@  )r   rC   rb   rc   rN  r]   rO  rP  rQ  r   rB   rR  )r   rC   rb   rc   rN  r]   rO  rP  rQ  r   r   r?  rB   ri  )r   rC   rb   rc   rN  r]   rO  rP  rQ  r   rB   ri  r   )r   rC   rb   rM   rq  r]   rN   rr  rQ  r   r   rs  rB   ri  )r   rC   rz  r]   r{  rC   r|  rC   r}  rc   r~  r   rQ  r   rB   r  )r   rC   rz  r]   r{  rC   r|  rC   r}  rc   r~  r   rQ  r   r   r?  rB   r   )r   rC   rz  r]   r{  rC   r|  rC   r}  rc   r~  r   rQ  r   rB   r   )r   rC   rz  r]   r{  rC   r|  rC   r}  rc   r~  r   rQ  r   r   rs  rB   r   )rz  r]   r|  rC   r   rC   rB   r>  )
rz  r]   r|  rC   r   rC   r   r?  rB   r@  )rz  r]   r|  rC   r   rC   rB   r@  )
rz  r]   r|  rC   r   rC   r   rs  rB   r@  )ra   r]   r  rC   r  rC   rB   r   )ra   rC   rb   rc   rO  r  r  r   rQ  r   r   r  r  r  rB   r  )ra   rC   rb   rc   rO  r  r  r   rQ  r   r   r  rB   r   )ra   rC   rb   rc   rO  r  r  r   rQ  r   r   r  rB   r  )r   r]   ra   rC   rb   rM   rO  r  rQ  r   r   r  rB   r  )r   r]   ra   rC   rb   rM   rO  r  rQ  r   r   r  rB   r   )r   r]   ra   rC   rb   rM   rO  r  rQ  r   r   r  r  r  rB   r  )r  
__future__r   r  rE   rI  ior   r  typingr   r   r   r   r	   r
   r   r   r   r   r&  r   r   r   r   r   
bson.int64r   bson.raw_bsonr   r   r   r   bson.sonr   pymongor   _use_cImportErrorpymongo.errorsr   r   r   r   r   r    r!   r"   pymongo.hellor#   pymongo.helpersr$   pymongo.read_preferencesr%   pymongo.write_concernr&   r'   pymongo.client_sessionr(   pymongo.compression_supportr)   r*   r+   pymongo.mongo_clientr,   pymongo.monitoringr-   pymongo.poolr.   pymongo.read_concernr/   r0   pymongo.typingsr1   r2   rH   rG   r  _INSERT_UPDATE_DELETE_EMPTYr  r  r  r  r  r  r  rx  rA   r:  rK   rV   r`   r{   r   r   r   r   r   r  r  r$  r+  r'  rJ  packrC  rD  rH  rJ  rM  r^  r[  r\  rh  rm  rp  r   r  r  r  _query_messager   r  r  r  r  _get_more_messager  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rL  rE  r^  rI   r5   rJ   <module>r{     s	     # " " " " "    " " " " " "                         W W W W W W W W W W W W W W                       !!!!!!FF   FFF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 & % % % % % * * * * * * 3 3 3 3 3 3 . . . . . . 
7""""""444444SSSSSSSSSS000000222222''''''00000044444466666666		  


	
..1//
 $yINN
BN,!*C C C     
0 0 0 0
   $O O O O
! ! ! !H 3    S   
6 .2'+%)0 0 0 0 0f   &v
 v
 v
 v
 v
 v
 v
 v
rsB sB sB sB sB sB sB sBl	 	 	 	 	V 	 	 		 	 	 	 	x 	 	 	! ! ! ! !U ! ! !: )6=449  + + + +& v}W%%*    FM$$	'&-..3 V]4  %
4 4 4 4@/ / / /
= 
= 
= 
= 
 -$, AE' ' ' ' '@   ># # # #$# # # #" 
 3#2 AE    (  &-%%*	 	 	 	[ [ [ [[ [ [ [ 
 9&8 AE		M 	M 	M 	M 	MO
 O
 O
 O
 O
 O
 O
 O
l  +# +# +# +# +#!2 +# +# +#\L L L L& ^^A A A AH# # # #" 
 >&=$ $ $ $$/ / / /8 
 0/OE E E E0# # # # 
 L$-$K!J J J JZpA pA pA pA pA pA pA pAfR, R, R, R, R, R, R, R,l ho
NFMH      s   A( (A21A2