
    fi                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl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 d dlmZ d dlmZmZmZ d dlmZ d dlmZmZmZmZmZ 	 d dlmZ n# e $ r dZY nw xY wd dl!Z!d d	l"m#Z# d d
l$m%Z%m&Z&m'Z'm(Z( d dl)m*Z*m+Z+m,Z, d dl-m.Z. e.rVd dl/m0Z0m1Z1 d dl-m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZA d dlBmCZC d dl)mDZDmEZEmFZFmGZGmHZH  e<d          ZI e@d          ZJ eddd          ZK ejL        d          ZMdaN ejO        d          ZP eQd          ZR eQd          ZSdZT	 dddZUd ZVd ZWd ZXd  ZY G d! d"          ZZ eZ            Z[d# Z\d$ Z]d% Z^d& Z_ eQd'          Z`d( Zadd)Zb G d* d+ec          Zd G d, d-          Ze G d. d/          Zfd0 Zgd1 Zhd2 Zid3 Zj	 	 	 dd4Zk	 dd5Zld6 Zmd7 Znd8 Zo	 	 	 	 	 dd:Zp	 	 	 dd;Zqd< Zrd= Zs	 	 	 	 	 	 dd>Zt euevd?          Zwewrd@ ZxndA Zx	 	 	 	 	 	 ddBZy	 	 	 ddCZzdD Z{dE Z|dF Z}ddGZ~ddHZdI ZdJ Z	 	 ddKZdL ZdM ZdN ZdO ZdP ZddQZdR ZdS ZdT ZdU Z e            \  ZZdVZdW ZdX Z edY          Z G dZ d[ev          Z G d\ d]e
j                  Zd^ Zd_ Z ed`g da          ZddbZ edcg dd          ZddeZdf ZddgZdh Zdi Zdj Zdk Zdl Zdm ZddnZdo Ze.re;dp             Ze;dq             ZefdrZe#rds Zndt Zdu Z	 d dvlmZ d dwlmZ n# e $ r	 dx Zdy ZY nw xY wdz Zdd{Zd| Ze.r e@d}          Zd~ Zd Zd Zd Zd Zd ZdS )    N)
namedtuple)datetimetimezone)Decimal)partialpartialmethodwraps)Real)parse_qsunquote	urlencodeurlsplit
urlunsplit)BaseExceptionGroup)PY37)DEFAULT_ADD_FULL_STACKDEFAULT_MAX_STACK_FRAMESDEFAULT_MAX_VALUE_LENGTHEndpointType)	AnnotatedAnnotatedValueSENSITIVE_DATA_SUBSTITUTE)TYPE_CHECKING)	FrameTypeTracebackType)AnyCallablecastContextManagerDictIteratorListNoReturnOptionaloverload	ParamSpecSetTupleTypeTypeVarUnion)Hub)EventExcInfoLogHintMetricPRi     zsentry_sdk.errorsz^[a-zA-Z0-9/+=]*$)falsefnnooff0)truetyyeson1i  F)strictc                    | !t          |                                           nd}|t          v rdS |t          v rdS |rdnt	          |           S )zCasts an ENV variable value to boolean using the constants defined above.
    In strict mode, it may return None if the value doesn't match any of the predefined values.
    NFT)strlowerFALSY_ENV_VALUESTRUTHY_ENV_VALUESbool)valuerA   
normalizeds      `/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/sentry_sdk/utils.pyenv_to_boolrK   Z   s\    
 (-'8U!!###dJ%%%u&&&t*44tE{{*    c                 V    t          j        | dd                              d          S )zCSerialize data into a compact JSON representation encoded as UTF-8.F),:)	allow_nan
separatorsutf-8)jsondumpsencode)datas    rJ   
json_dumpsrW   j   s)     :de
CCCJJ7SSSrL   c                     	 t          t          j        j        d          5 } d }t          j        dk    st          j        dk    r-t          j                    }|xj        t          j	        z  c_        t          j
        g d|t          j        | |                                           d                                                             d          }d d d            n# 1 swxY w Y   n# t          t           t"          f$ r Y d S w xY w|S )Nzw+win32cygwin)gitz	rev-parseHEAD)startupinfostdoutstderrstdinr   rR   )openospathdevnullsysplatform
subprocessSTARTUPINFOdwFlagsSTARTF_USESHOWWINDOWPopenPIPEcommunicatestripdecodeOSErrorIOErrorFileNotFoundError)nullr]   revisions      rJ   get_git_revisionru   p   s?   "'/4(( 	DK|w&&#,(*B*B(466##z'FF##  000 +%?   q"  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	& W/0   tt Os5   C+ B2CC+ C##C+ &C#'C+ +DDc                      t           j                            d          } | r| S t                      } | r| S dD ]'}t           j                            |          } | r| c S (dS )zTry to guess a default release.SENTRY_RELEASE)HEROKU_SLUG_COMMITSOURCE_VERSION!CODEBUILD_RESOLVED_SOURCE_VERSIONCIRCLE_SHA1GAE_DEPLOYMENT_IDN)rb   environgetru   )releasevars     rJ   get_default_releaser      s~     jnn-..G   G  	 	 *..%% 	NNN	4rL   c                 N    g d}|D ]}|| v rd                     |          c S dS )zAReturn the SDK name including the name of the used web framework.)djangoflaskfastapibottlefalconquartsanic	starlettelitestarstarlitechalice
serverlesspyramidtornadoaiohttp
aws_lambdagcpbeamasgiwsgizsentry.python.{}zsentry.python)format)installed_integrationsframework_integrationsintegrations      rJ   get_sdk_namer      sW      . . : :000%,,[99999 1 ?rL   c                       e Zd ZdZd Zd ZdS )CaptureInternalException c                     | S Nr   selfs    rJ   	__enter__z"CaptureInternalException.__enter__   s    rL   c                 2    ||t          |||f           dS )NT)capture_internal_exception)r   tyrH   tbs       rJ   __exit__z!CaptureInternalException.__exit__   s%    >e/&E2777trL   N)__name__
__module____qualname__	__slots__r   r   r   rL   rJ   r   r      s7        I      rL   r   c                      t           S r   )_CAPTURE_INTERNAL_EXCEPTIONr   rL   rJ   capture_internal_exceptionsr      s    &&rL   c                     t          j                                                    rt                              d|            dS dS )z
    Capture an exception that is likely caused by a bug in the SDK
    itself.

    These exceptions do not end up in Sentry and are just logged instead.
    zInternal error in sentry_sdkexc_infoN)
sentry_sdk
get_client	is_activeloggererrorr   s    rJ   r   r      sK     ((** H3hGGGGGH HrL   c                 :    | t           z
                                  S r   )epochtotal_secondsrH   s    rJ   to_timestampr      s    EM((***rL   c                 j    |                      t          j                  }|                    d          S )zFormats a timestamp in RFC 3339 format.

    Any datetime objects with a non-UTC timezone are converted to UTC, so that all timestamps are formatted in UTC.
    z%Y-%m-%dT%H:%M:%S.%fZ)
astimezoner   utcstrftime)rH   utctimes     rJ   format_timestampr      s0     x|,,G 3444rL   )+-c                    	 t          j        |           }n# t          t          f$ r d| v rdnd}|                     d          r| d d         dz   } | d         t
          v r|dz  }| d d	         | d
d          z   } n| d         t
          v r|dz  }t          j        | |          }Y nw xY w|                    t          j	                  S )N.z%Y-%m-%dT%H:%M:%S.%fz%Y-%m-%dT%H:%M:%SZz+0000iz%z)
r   fromisoformatAttributeError
ValueErrorendswithISO_TZ_SEPARATORSstrptimer   r   r   )rH   resulttimestamp_formats      rJ   datetime_from_isoformatr      s    <'..J' < < < '*Ull""8K 	 >># 	)#2#J(E9)))$#2#Jrss+EE2Y+++$"5*:;;< X\***s    BB('B(c                 h    | t          j                    } nt          |           } | d         d} d| iS )z+Creates a hint with the exc info filled in.Nr   r   )re   r   exc_info_from_errorr   s    rJ   event_hint_with_exc_infor     s>     <>>&x00{!!rL   c                       e Zd ZdZdS )BadDsnzRaised on invalid DSNs.Nr   r   r   __doc__r   rL   rJ   r   r   "  s        !!!!rL   r   c                   <    e Zd ZdZd Zed             ZddZd ZdS )DsnzRepresents a DSN.c                 ,   t          |t                    rt          |j                  | _        d S t	          t          |                    }|j        dvrt          d|j        z            |j        | _        |j        t          d          |j        | _	        |j
        | j        dk    rdpd| _
        n|j
        | _
        |j        st          d          |j        | _        |j        | _        |j                            dd	          }	 t          t#          |                                                    | _        n6# t(          t*          f$ r" t          d
|j        pdd	d          z            w xY wd                    |          dz   | _        d S )N)httphttpszUnsupported scheme %rzMissing hostnamer     P   zMissing public key/r4   zInvalid project in DSN (%r) )
isinstancer   dict__dict__r   rC   schemer   hostnamehostportusername
public_keypassword
secret_keyrc   rsplitintpop
project_idr   	TypeErrorjoin)r   rH   partsrc   s       rJ   __init__zDsn.__init__)  s   eS!! 	 00DMFU$$<00005<?@@@l>!+,,,N	:w.63<"DII
DI~ 	/-.....z  a((	Q!#dhhjj//22DOOI& 	Q 	Q 	Q6%*:JABB9OOPPP	Q HHTNNS(			s   3E 3E4c                 L    | j         }| j        | j        fdvr|d| j        }|S )zThe netloc part of a DSN.))r   r   )r   r   rO   )r   r   r   r   rvs     rJ   netlocz
Dsn.netlocM  s7     YK#+IIIBB		*B	rL   Nc           	      j    t          | j        | j        | j        | j        | j        | j        |          S )z*Returns the auth info object for this dsn.)r   r   rc   r   r   r   client)Authr   r   rc   r   r   r   )r   r   s     rJ   to_authzDsn.to_authV  s<     ;
 
 
 	
rL   c                 v    | j         d| j        | j        r
d| j        z   pdd| j        | j        | j        S )N://@r   )r   r   r   r   rc   r   r   s    rJ   __str__zDsn.__str__c  sO     KKKOOO5do 5;;;KKIIOO
 	
rL   r   )	r   r   r   r   r   propertyr   r   r  r   rL   rJ   r   r   &  sh        ") ") ")H   X
 
 
 
	
 	
 	
 	
 	
rL   r   c                   <    e Zd ZdZ	 	 	 	 ddZej        fdZd ZdS )	r   z,Helper object that represents the auth info.N   r   c	                 v    || _         || _        || _        || _        || _        || _        || _        || _        d S r   )r   r   rc   r   r   r   versionr   )	r   r   r   r   r   r   r  r   rc   s	            rJ   r   zAuth.__init__r  s@     		$$$rL   c           	      T    | j         d| j        | j        d| j        d|j        d	S )z'Returns the API url for storing events.r  zapi/r   )r   r   rc   r   rH   )r   types     rJ   get_api_urlzAuth.get_api_url  s9     KKKIIIIIOOOJJJ
 	
rL   c                     d| j         fd| j        fg}| j        |                    d| j        f           | j        |                    d| j        f           dd                    d |D                       z   S )	z!Returns the auth header a string.
sentry_keysentry_versionNsentry_clientsentry_secretzSentry z, c              3   *   K   | ]\  }}|d |V  dS )=Nr   ).0keyrH   s      rJ   	<genexpr>z!Auth.to_header.<locals>.<genexpr>  s1      $Q$Q
UUU%;$Q$Q$Q$Q$Q$QrL   )r   r  r   appendr   r   r   s     rJ   	to_headerzAuth.to_header  s     T_-0@$,/OP;"II4555?&II8999499$Q$Qb$Q$Q$QQQQQrL   )Nr  Nr   )	r   r   r   r   r   r   ENVELOPEr  r  r   rL   rJ   r   r   o  sl        66    . "
 
 
 
R R R R RrL   r   c                 F    t          | dd           pt          | dd           S )Nr   r   getattr)clss    rJ   get_type_namer    s%    3--Oj$1O1OOrL   c                 4    t          | dd           }|dvr|S d S )Nr   )Nbuiltins__builtins__r  )r  mods     rJ   get_type_moduler"    s)    
#|T
*
*C
444
4rL   c                     	 | j         d         }|                    d          rdS n# t          t          f$ r Y nw xY wdD ]#}	 | j        |         r dS # t
          $ r Y  w xY wdS )Nr   zsentry_sdk.T)__traceback_hide____tracebackhide__F)	f_globals
startswithr   KeyErrorf_locals	Exception)framer!  	flag_names      rJ   should_hide_framer-    s    oj)>>-(( 	4	H%    ?  		~i( tt 	 	 	D	 5s   "' ;;A
A! A!c              #   X   K   | }|#t          |j                  s|V  |j        }|!d S d S r   )r-  tb_frametb_next)r   tb_s     rJ   iter_stacksr2    sA      
C
/ .. 	IIIk /////rL   c                    d}d }|Vt          |d          rF	 |                    |          }n# t          t          f$ r d }Y nw xY w||                                }|2	 t          j        |           }n# t          t          f$ r g d g fcY S w xY w|sg d g fS t          d||z
            }t          |dz   |z   t          |                    }		 fd|||         D             }
t          ||                             d                    }fd||dz   |	         D             }|
||fS # t          $ r g d g fcY S w xY w)	N   
get_sourcer   r4   c                 X    g | ]&}t          |                    d                     'S 

max_lengthstrip_stringrn   r  liner:  s     rJ   
<listcomp>z'get_lines_from_file.<locals>.<listcomp>  sB     
 
 
 F++
CCC
 
 
rL   r8  r9  c                 X    g | ]&}t          |                    d                     'S r7  r;  r=  s     rJ   r?  z'get_lines_from_file.<locals>.<listcomp>  sB     
 
 
 F++
CCC
 
 
rL   )hasattrr5  ImportErrorrq   
splitlines	linecachegetlinesrp   maxminlenr<  rn   
IndexError)filenamelinenor:  loadermodulecontext_linessource
source_strlower_boundupper_boundpre_contextcontext_linepost_contexts     `          rJ   get_lines_from_filerV    s    MFgfl;;	**622JJW% 	 	 	JJJ	!**,,F~	 '11FF! 	  	  	 tR<	   4|a-/00Kfqj=0#f++>>K
 
 
 
{612
 
 
 $F6N$8$8$@$@ZXXX
 
 
 

k9:
 
 
 L,66   4|s4   / AA!A6 6BBAD. .E ?E c                    	 | j         j        }n# t          $ r d }Y nw xY w	 | j        d         }n# t          $ r g d g fcY S w xY w	 | j        d         }n# t          $ r d }Y nw xY w||r|dz
  }t	          |||||          S g d g fS )Nr   
__loader__r4   )rL  rM  )f_codeco_filenamer*  r&  rV  )r+  	tb_linenomax_value_lengthabs_pathrM  rL  rK  s          rJ   get_source_contextr^    s    <+   ,   4|.    Q"f.vf
 
 
 	
 tR<s-    0 AAA A#"A#c                 `    	 t          |           S # t          $ r t          |           cY S w xY wr   )rC   r*  	safe_reprr   s    rJ   safe_strra    sB     5zz       s    --c                 D    	 t          |           S # t          $ r Y dS w xY w)Nz<broken repr>)reprr*  r   s    rJ   r`  r`    s5    E{{   s    
c                    |r| s|S 	 |                     d          r
|d d         }|                     dd          d         }|| k    rt          j                            |          S t
          j        |         j        }|s|S |                    |                    t          j	        d          d         d          d         
                    t          j	                  S # t          $ r |cY S w xY w)Nz.pycr   r   r4   r      )r   splitrb   rc   basenamere   modules__file__r   seplstripr*  )rM  r]  base_modulebase_module_paths       rJ   filename_for_modulern  #  s    6 V$$ 	%}Hll3**1-&  7##H---;{3< 	O~~.55bfa@@CQGGKRRF
 
 	
    s   AC  (C  AC   C/.C/Tc                    t          | dd           }|sd }d }n| j        j        }| j        j        }	 | j        d         }	n# t
          $ r d }	Y nw xY w|| j        }	 |rt          j        	                    |          nd }
n# t
          $ r d }
Y nw xY wt          |	|          pd |
|pd|	|d}|rt          | ||          \  |d<   |d<   |d<   |r)dd	lm}  |t          | j                  d
|          |d<   |S )NrY  r   z	<unknown>)rJ  r]  functionrM  rK  rS  rT  rU  r   )	serializeT)is_varscustom_reprvars)r  rY  rZ  co_namer&  r*  f_linenorb   rc   abspathrn  r^  sentry_sdk.serializerrq  r   r)  )r+  r[  include_local_variablesinclude_source_contextr\  rs  rY  r]  rp  rM  os_abs_pathr   rq  s                rJ   serialize_framer|  ;  s    UHd++F (<+<',    N	3;Ebgooh///    (99AT+
 
B  
DV9.E
 E
A=2n-r./A  
333333Y  $K
 
 
6
 Is#   A   AA#B   BBc                     d}g }t          j                    }|>t          |          s&|                    t	          || ||                     |j        }|>|                                 d|iS )NT)ry  rz  r\  frames)re   	_getframer-  r  r|  f_backreverse)ry  rz  r\  r%  r~  r6   s         rJ   current_stacktracer  o  s     FA
- ## 	MM,C+A%5	     H - NNfrL   c                 $    t          | dd           S )Nerrnor  )	exc_values    rJ   	get_errnor    s    9gt,,,rL   c                 >   t          t          | dd          pt          | dd          pt          |                     }t          | dd           }t          |t                    r8t	          |          dk    r%|dd                    d |D                       z   z  }|S )Nmessager   detail	__notes__r   
c              3   D   K   | ]}t          |t                    |V  d S r   )r   rC   )r  notes     rJ   r  z$get_error_message.<locals>.<genexpr>  s1      #T#TTjs>S>S#TD#T#T#T#T#T#TrL   )ra  r  r   listrH  r   )r  r  notess      rJ   get_error_messager    s    	9b)) 	9h++	I G I{D11E% U3u::>>4$))#T#TU#T#T#TTTTTNrL   c	                    i }	|r|                                 nddd|	d<   |||	d         d<   |t          |          }
nd}
|
D|	d                             di                               di                               d	|
           |||	d         d
<   |dk    }|s|||	d         d<   d|	d         d<   |rd|	d         vrd|	d         d<   t          duot	          |t                    }|rd|	d         d<   t          |           |	d<   t          |           |	d<   t          |          |	d<   |ddt          dn-|d         |d         |d         |	                    d          fdt          t          |          t          t          dz                       D             }t          |          t          k    rt          j        d          |	d<   n|r|s|}nt#          |||          }d|i|	d<   |	S )z
    Creates a dict that goes into the events `exception.values` list and is ingestible by Sentry.

    See the Exception Interface documentation for more details:
    https://develop.sentry.dev/sdk/event-payloads/exception/
    genericTr
  handled	mechanismNexception_idmetar  numberrO  r   	parent_idchainedr
  is_exception_grouprM  rH   ry  rz  r\  rs  c           
      T    g | ]$\  }}t          |j        |j                   %S ))r[  ry  rz  r\  rs  )r|  r/  r[  )r  r   _rs  ry  rz  r\  s      rJ   r?  z5single_exception_from_error_tuple.<locals>.<listcomp>  sT        B 	Kl$;#9-#	
 	
 	
  rL   r4   r   
stacktracer~  )copyr  
setdefaultr   r   r"  r  r  r   r~   zipr2  rangeMAX_STACK_FRAMESrH  r   removed_because_over_size_limitmerge_stack_frames)exc_typer  r   client_optionsr  r  r  rO  
full_stackexception_valuer  is_root_exceptionr  r~  
new_framesrs  ry  rz  r\  s                  @@@@rJ   !single_exception_from_error_tupler    s   $ O%O	I$+O+O K  7C$^4)$$$//;;FFR	
 	

*Xu
%
%
%17$X.$) 9!64=$[1/8$V, 9V?;+GGG/8$V,+47 J%= =  B=A$%9: / 9 9OH+H55OF0;;OG"&!%3"01J"K!/0H!I)*<=$((77       R%0@10D*E*EFF  F 6{{%%% )7(V)
 )
 )
%% 
 ? 	PJJ+FJOOJ)1:(>%rL   __suppress_context__c              #     K   | \  }}}g }t                      }||t          |          |vr|||fV  |                    |           |                    t          |                     |j        r|j        }n|j        }|d S t          |          }|}t          |dd           }||t          |          |vd S d S d S d S d S d S )N__traceback__)	setidr  addr  	__cause____context__r
  r  )r   r  r  r   seen_exceptionsseen_exception_idscauses          rJ   walk_exception_chainr    s     "*)R UU  %9%777Ir))))
 ""9---""2i==111- .!+!-}E{{HI66B)  %9%77777 ! %%77 ! %%rL   c              #      K   | V  d S r   r   r   s    rJ   r  r  -  s      rL   c	                 8   t          | ||||||||	  	        }	|	g}
|}|dz  }t          |d          o|j        }|rp|ot          |d          o|j        du}|rR|j        }t	          t          |          |t          |dd          |||d|          \  }}|
                    |           no|ot          |d          o|j        du}|rR|j        }t	          t          |          |t          |dd          |||d|          \  }}|
                    |           |ot          |d	          }|rit          |j
                  D ]T\  }}t	          t          |          |t          |dd          ||||d
|z  |	  	        \  }}|
                    |           U||
fS )z
    Creates the list of exceptions.
    This can include chained exceptions and exceptions from an ExceptionGroup.

    See the Exception Interface documentation for more details:
    https://develop.sentry.dev/sdk/event-payloads/exception/
    )	r  r  r   r  r  r  r  rO  r  r4   r  r  Nr  )r  r  r   r  r  r  rO  r  r  
exceptionszexceptions[%s])r  rA  r  r  exceptions_from_errorr
  r  extendr  	enumerater  )r  r  r   r  r  r  r  rO  r  parentr  should_supress_contextexception_has_causer  child_exceptionsexception_has_contentcontextr  idxes                       rJ   r  r  2  sS   ( /%!
 
 
F JIAL 		122Uy7U   *0  0	;//0#4/ 	
  	0'E/De5/488-#)"%	0 	0 	0,\+ .///  2	=112%T1 	
 ! 	0+G/Dg!7OT::-#)$%	0 	0 	0,\+ ./// #Gwy,'G'G 0	 455 	0 	0FC/Da1ot44-#)#'#-%
0 
0 
0,\+ .////*%%rL   c                 0   | \  }}}t           d uot          |t                     }|rt          |||||dd|          \  }}	n@g }	t          |           D ].\  }}}|	                    t          ||||||                     /|	                                 |	S )Nr   )r  r  r   r  r  r  r  r  )r  r  r   r  r  r  )r   r   r  r  r  r  r  )
r   r  r  r  r  r  r   r  r  r  s
             rJ   exceptions_from_error_tupler    s     'Hi+47 J%= =  /)!	
 	
 	
JJ 
';H'E'E 
	 
	#Hi1%'#1')  	 	 	 	 rL   c                 p    	 t          |           S # t          $ r t          |           dd         cY S w xY w)Nr4   r   )rC   UnicodeDecodeErrorrc  r   s    rJ   	to_stringr    sI    !5zz ! ! !E{{1R4    !s    !55c              #     K   d| v r
| d         V  d| v r.| d                              d          pdD ]}d|v r
|d         V  d| v rC| d                              d          pdD ]'}t          |t                    rd|v r
|d         V  &d S d S )Nr  threadsvaluesr   	exception)r~   r   r   )eventthreadr  s      rJ   iter_event_stacktracesr    s      uL!!!!EI&**844: 	+ 	+Fv%%\****e{+//99?R 	. 	.I)T** .|y/H/H---- 	. 	.rL   c              #      K   t          |           D ]>}t          |t                    r	|j        pi }|                    d          pdD ]}|V  ?d S )Nr~  r   )r  r   r   rH   r~   )r  r  r+  s      rJ   iter_event_framesr    sv      ,U33  
j.11 	0#)/RJ^^H--3 	 	EKKKK		 rL   c                     t          |           D ]F}t          |t                    r	|j        pi }t	          |                    d          |||           G| S )Nr~  )in_app_excludein_app_includeproject_root)r  r   r   rH   set_in_app_in_framesr~   )r  r  r  r  r  s        rJ   handle_in_appr    ss    ,U33 	
 	

j.11 	0#)/RJNN8$$))%		
 	
 	
 	
 	
 LrL   c                 P   | sd S | D ]}|                     d          }||                     d          }t          ||          rd|d<   Et          ||          rd|d<   [|                     d          }|st          |          rd|d<   t          ||          rd|d<   | S )Nin_apprM  TFr]  )r~   _module_in_list_is_external_source_is_in_project_root)r~  r  r  r  r+  current_in_apprM  r]  s           rJ   r  r    s     t  8,,%8$$ 6>22 	"E(O 6>22 	#E(O 99Z((x(( 	#E(Ox66 	"E(O	 MrL   c                    t          | t                    rt          |           dk    r| \  }}}nt          | t                    rTt	          | dd           }|t          |           }| }nNt          j                    \  }}}|| urd }| }t          |           }nt          dt          |           z            |||f}t          rt          t          |          }|S )N   r  z,Expected Exception object to report, got %s!)r   tuplerH  BaseExceptionr  r
  re   r   r   r   r   r.   )r   r  r  r   r   s        rJ   r   r     s    % WCJJ!OO"')RR	E=	)	) WUOT22>E{{HII&)lnn#Hi%%!	;; G$u++UVVV)R(H + **OrL   c                     d | D             fd|D             }|                     |            |r|                    dt                    nd}||t          |          |z
  d         }|S )zV
    Add the missing frames from full_stack to frames and return the merged list.
    c                 J    h | ] }|d          |d         |d         |d         f!S r]  rT  rK  rp  r   )r  r+  s     rJ   	<setcomp>z%merge_stack_frames.<locals>.<setcomp>>  sK         *.!(O*		
  rL   c                 T    g | ]$}|d          |d         |d         |d         fv"|%S r  r   )r  
stackframe	frame_idss     rJ   r?  z&merge_stack_frames.<locals>.<listcomp>H  s]     
 
 
z"~&x z"	
   	  rL   max_stack_framesN)r  r~   r   rH  )r~  r  r  r  r  r  s        @rJ   r  r  9  s    
    I
 
 
 
$
 
 
J f
 	-/GHHH 
 #J2B B D DE
rL   c                     t          |           } t          |           }|r?|                    dt                    r$t	          |d         |d                   d         }nd }ddt          | |||          id|fS )	Nadd_full_stackry  r\  )ry  r\  r~  r   r  )levelr  )r   r   r~   r   r  r  )r   r  r  hintr  s        rJ   event_from_exceptionr  a  s     #8,,H#H--D .,,-=?UVV '$23L$M+,>?
 
 
 


 
 5ni 	
 	
 	
 
rL   c                 b    | dS |sdS |D ]#}|| k    s|                      |dz             r dS $dS )NFr   Tr'  )nameitemsitems      rJ   r  r    sX    |u u  4<<4??4#:66<44  5rL   c                 <    | dS t          j        d|           d u}|S )NFz [\\/](?:dist|site)-packages[\\/]research)r]  external_sources     rJ   r  r    s3     u 		5x@@L  rL   c                 @    | |dS |                      |          rdS dS )NFTr  )r]  r  s     rJ   r  r    s4    </u <(( t5rL   c                 v    |                      d          d|dz
                               dd          }|dz   S )zd
    Truncate a UTF-8-encodable string to the last full codepoint so that it fits in max_bytes.
    rR   Nr  ignore)errors...)rU   ro   )string	max_bytes	truncateds      rJ   _truncate_by_bytesr    s@    
 g&&Q7>>wx>XXIurL   c                 x    	 t          |                     d                    S # t          t          f$ r Y d S w xY w)NrR   )rH  rU   UnicodeEncodeErrorr  r   s    rJ   _get_size_in_bytesr    sI    5<<(())) 23   tts   !$ 99c                     | s| S |t           }t          |           }t          |           }|||k    rt          | |          }n|||k    r| d |dz
           dz   }n| S t	          ||p|dd|dz
  |ggd          S )Nr  r   z!limitx)rH  rem)rH   metadata)r   r  rH  r  r   )rH   r:  	byte_size	text_sizetruncated_values        rJ   r<  r<    s     -
"5))IE

IZ!7!7,UJ??		9z#9#9 0*q. 01E9)	sJNJ?@
 
   rL   c                    d}t          j        d|z   dz   t           j        t           j        z            }	 |                    |                                           d         }t          t          t          |	                    d          dd                             }n# t          t          t          f$ r Y dS w xY w|S )z
    Parses a version string into a tuple of integers.
    This uses the parsing loging from PEP 440:
    https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
    a    # noqa: N806
        v?
        (?:
            (?:(?P<epoch>[0-9]+)!)?                           # epoch
            (?P<release>[0-9]+(?:\.[0-9]+)*)                  # release segment
            (?P<pre>                                          # pre-release
                [-_\.]?
                (?P<pre_l>(a|b|c|rc|alpha|beta|pre|preview))
                [-_\.]?
                (?P<pre_n>[0-9]+)?
            )?
            (?P<post>                                         # post release
                (?:-(?P<post_n1>[0-9]+))
                |
                (?:
                    [-_\.]?
                    (?P<post_l>post|rev|r)
                    [-_\.]?
                    (?P<post_n2>[0-9]+)?
                )
            )?
            (?P<dev>                                          # dev release
                [-_\.]?
                (?P<dev_l>dev)
                [-_\.]?
                (?P<dev_n>[0-9]+)?
            )?
        )
        (?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
    z^\s*z\s*$r   r   Nr  )r  compileVERBOSE
IGNORECASEmatch	groupdictr  mapr   rf  r   r   r   )r  VERSION_PATTERNpatternr   release_tuples        rJ   parse_versionr    s    O> j/!G+

R]" G
--((2244Y?c#w}}S'9'9"1"'=>>??z>2   tt s   A*B! !B<;B<c                     	 ddl } ddlm} t          d t	          j        d| j                  dd         D                       } |dd          r&t          j        d	k    r|d
k    s |dd          rdS dS n# t          $ r Y nw xY w	 ddl
}ddlm} t          |j                  }|t                              d           dS  |d          r|dk     rdS n# t          $ r Y nw xY wdS )z
    Returns whether gevent/eventlet have patched the stdlib in a way where thread locals are now more "correct" than contextvars.
    r   N)is_object_patchedc                 ,    g | ]}t          |          S r   )r   )r  parts     rJ   r?  z*_is_contextvars_broken.<locals>.<listcomp>  s    RRR4SYYRRRrL   z	a|b|rc|\.re  	threadinglocalr  r  )   	   contextvars
ContextVarFT)is_monkey_patchedzYInternal error in Sentry SDK: Could not parse Greenlet version from greenlet.__version__.r  )r   r4  )geventgevent.monkeyr  r  r  rf  __version__re   version_inforB  greenleteventlet.patcherr%  r  r   r   )r&  r  version_tupler*  r%  greenlet_versions         rJ   _is_contextvars_brokenr.  	  sx   
333333 RR28L&:L#M#Mbqb#QRRR
 
 ['22 	 !V++0H0H%%m\BB 1I u4	     666666()=>>#LLk   5X&& 	+;f+D+D4    5s*   A1A8 8
BB	:C C 
C&%C&c                 &      G  fdd          }|S )Nc                   0    e Zd Zd fd	ZddZd Zd ZdS )1_make_threadlocal_contextvars.<locals>.ContextVarNc                 `    || _         || _                     | _                     | _        d S r   )_name_default_local_original_local)r   r  defaultr  s      rJ   r   z:_make_threadlocal_contextvars.<locals>.ContextVar.__init__B  s2    DJ#DM%''DK#(577D   rL   c                 <    t          | j        d|p| j                  S )NrH   )r  r5  r4  )r   r7  s     rJ   r~   z5_make_threadlocal_contextvars.<locals>.ContextVar.getI  s    4;1IDMJJJrL   c                     t          t          j        d                    }|                                 }t	          | j        ||           || j        _        |S )N@   )rC   randomgetrandbitsr~   setattrr6  r5  rH   )r   rH   tokenoriginal_values       rJ   r  z5_make_threadlocal_contextvars.<locals>.ContextVar.setM  sK    *2..//E!XXZZND(%@@@ %DKLrL   c                 ^    t          | j        |          | j        _        | j        j        |= d S r   )r  r6  r5  rH   r   )r   r>  s     rJ   resetz7_make_threadlocal_contextvars.<locals>.ContextVar.resetU  s-     '(<e D DDK$-e444rL   r   )r   r   r   r   r~   r  rA  r  s   rJ   r$  r1  ?  si        	+ 	+ 	+ 	+ 	+ 	+	K 	K 	K 	K	 	 		5 	5 	5 	5 	5rL   r$  r   )r  r$  s   ` rJ   _make_threadlocal_contextvarsrC  =  s=    5 5 5 5 5 5 5 5 5 58 rL   c                      t                      sFt          j        dk     r	 ddlm}  d| fS # t
          $ r Y nw xY w	 ddlm}  d| fS # t
          $ r Y nw xY wddlm} dt          |          fS )z
    Figure out the "right" contextvars installation to use. Returns a
    `contextvars.ContextVar`-like class with a limited API.

    See https://docs.sentry.io/platforms/python/contextvars/ for more information.
    r   r   )r$  TrB  F)
r.  re   r)  aiocontextvarsr$  rB  r#  r  r  rC  )r$  r  s     rJ   _get_contextvarsrF  ^  s     "## 
 f$$555555Z''   222222Z''   
  /6666s   	* 
77	A 
AAz

With asyncio/ASGI applications, the Sentry SDK requires a functional
installation of `contextvars` to avoid leaking scope/context data across
requests.

Please refer to https://docs.sentry.io/platforms/python/contextvars/ for more information.
c                 P   d}	 | j         j        d| j         j        d| j        S # t          $ r Y nw xY wd\  }}t	          | t
                    r"t          | j        d          rd\  }}| j        } nCt          | dd          pt          | dd          }t	          |t                    rd\  }}|j        } t          | d	          r| j
        }nt          | d          r| j        }|?t          | d
          r't	          | j        t                    r| j        dz   |z   }||z   |z   }|S )zbReturn the qualified name of func. Works with regular function, lambda, partial and partialmethod.Nr   )r   r   r   )zpartial(<function >)_partialmethod__partialmethod__)zpartialmethod(<function rH  r   r   )im_classr   r   r*  r   r   rA  funcr  r   r   rC   )rL  func_qualnameprefixsuffixpartial_methods        rJ   qualname_from_functionrQ    s}    MM$$$M"""MM
 	

     NFF$   'WTY
%C%C '3y !'7>> 
'%tC
 C
 nm44 	'=NFF!&Dt^$$ &)	z	"	" &  4&& 	B:dos+K+K 	B Oc1MAM.7s   "' 
44c                      t          |           S r   )rQ  )rL  s    rJ   transaction_from_functionrS    s    !$'''rL   disable_capture_eventc                       e Zd ZdZdS )ServerlessTimeoutWarningz>Raised when a serverless method is about to reach its timeout.Nr   r   rL   rJ   rV  rV    s        HHDrL   rV  c                   .    e Zd ZdZ	 ddZd Zd Zd ZdS )TimeoutThreadzCreates a Thread which runs (sleeps) for a time duration equal to
    waiting_time and raises a custom ServerlessTimeout exception.
    Nc                     t           j                            |            || _        || _        || _        || _        t          j                    | _        d S r   )	r  Threadr   waiting_timeconfigured_timeoutisolation_scopecurrent_scoper-   _stop_event)r   r[  r\  r]  r^  s        rJ   r   zTimeoutThread.__init__  sQ     	!!$'''("4.*$?,,rL   c                 8    | j                                          d S r   )r_  r  r   s    rJ   stopzTimeoutThread.stop  s    rL   c                     t          j                    }t          j                    }t	          ||j        ddd          \  }}t          j        ||           |S )Nr  Fr  )r  r  )r  )re   r   r   r   r  optionscapture_event)r   r   r   r  r  s        rJ   _capture_exceptionz TimeoutThread._capture_exception  sc    <>>&((*!>*u==
 
 
t
 	 T2222rL   c                    | j                             | j                   | j                                         rd S t	          | j                  }|| j        k     r|dz   }| j        | j        t          j	        
                    | j                  5  t          j	                            | j                  5  	 t          d                    |                    # t          $ r t          |                                   Y nw xY w	 d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   t          d                    |                    )Nr4   zZWARNING : Function is expected to get timed out. Configured timeout duration = {} seconds.)r_  waitr[  is_setr   r\  r]  r^  r   scopeuse_isolation_scope	use_scoperV  r   r*  reraisere  )r   integer_configured_timeouts     rJ   runzTimeoutThread.run  s    	d/000""$$ 	F%()@%A%A" &(???)Ca)G& +0B0N!55d6JKK 	< 	<%//0BCC < <<6x :   
 % < < <!8!8!:!:;;;;<;< < < < < < < < < < < < < < <	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 'hoo* 
 
 	
sT   %D)6D8"C%D?DDDD)D	D)D	D))D-0D-NN)r   r   r   r   r   ra  re  rn  r   rL   rJ   rX  rX    sf         
 UY- - - -    
 
 
 
 
rL   rX  c                    d}	 |                      d          }t          j        |          }|                    d          }nF# t          $ r9}t
                              d                    |           |           Y d}~nd}~ww xY w|S )zO
    Convert a string to base64, via UTF-8. Returns None on invalid input.
    NUTF-8z"Unable to encode {orig} to base64:)orig)rU   base64	b64encodero   r*  r   warningr   )originalbase64_string
utf8_bytesbase64_byteserrs        rJ   	to_base64r{    s    
 MX__W--
'
33$++G44 X X X;BBBQQSVWWWWWWWWX s   >A 
B/BBc                 R   d}	 t                               |           }|sJ |                     d          }t          j        |          }|                    d          }nF# t          $ r9}t                              d	                    |           |           Y d}~nd}~ww xY w|S )zQ
    Convert a string from base64, via UTF-8. Returns None on invalid input.
    Nrq  z#Unable to decode {b64} from base64:)b64)
BASE64_ALPHABETr  rU   rs  	b64decodero   r*  r   ru  r   )rw  utf8_stringonly_valid_charsry  rx  rz  s         rJ   from_base64r  !  s    
 K

*00??$++G44%l33
 ''00 
 
 
188]8KKS	
 	
 	
 	
 	
 	
 	
 	


 s   AA! !
B$+/BB$
Components)r   r   rc   queryfragmentc                    t          |           }t          |j        d          }|rP|j                            d          }t          |          dk    rt          dt          d|d         }n|j        }n|j        }|r't          t          d |D                                 }n|j        }t          |j
        |||j        |j                  }	|r|	S t          |	          S )	zL
    Removes the authority and query parameter values from a given URL.
    T)keep_blank_valuesr  r4   rO   r   c                     i | ]
}|t           S r   )r   )r  r  s     rJ   
<dictcomp>z sanitize_url.<locals>.<dictcomp>S  s    NNN#s5NNNrL   r   r   r  rc   r  )r   r   r  r   rf  rH  r   r   r   r  r   rc   r  r   )
urlremove_authorityremove_query_valuesrf  
parsed_urlquery_paramsnetloc_partsr   query_string
componentss
             rJ   sanitize_urlr  :  s   
 #JJ,EEEL  #!(..s33|q  ))))))R  FF  &FF"  (NNNNNOO
 
 "' _$  J  &*%%%rL   	ParsedUrlr  r  r  c           	          t          | d|d          }t          t          |j        |j        d|j        d                    }t          ||j        |j                  S )z
    Splits a URL into a url (including path), query and fragment. If sanitize is True, the query
    parameters will be sanitized to remove sensitive data. The autority (username and password)
    in the URL will always be removed.
    T)r  r  rf  r   r  r  )	r  r   r  r   r   rc   r  r  r  )r  sanitizer  base_urls       rJ   	parse_urlr  i  s     d  J $$	
 	
 	
 H $   rL   c           	      |   t          | t          t          f          rt          j        |           r?t
                              d                    || t          |                                dS t          |           } | dk     s| dk    r1t
                              d                    ||                      dS dS )	z
    Checks the given sample rate to make sure it is valid type and value (a
    boolean or a number between 0 and 1, inclusive).
    z|{source} Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got {rate} of type {type}.)rO  rater
  Fr   r4   zW{source} Given sample rate is invalid. Sample rate must be between 0 and 1. Got {rate}.)rO  r  T)
r   r
   r   mathisnanr   ru  r   r
  float)r  rO  s     rJ   is_valid_sample_rater    s     dT7O,, 
40@0@  K  R  RDtDzz R  	
 	
 	

 u ;;Daxx4!88ellD m  	
 	
 	

 u4rL   c                 r    |dS |D ]/}|s|d         dk    r|dz  }t          j        ||           }|r dS 0dS )NFr   $Tr  )r  
regex_listsubstring_matchingitem_matchermatcheds        rJ   match_regex_listr    si    u"  ! 	 l2&6#&=&=CL)L$// 	44	 5rL   c                 ^    | duo)| j         duo | j         j        duo| j         j        j        |v S )zB
    Determines whether the given URL matches the Sentry DSN.
    N)	transport
parsed_dsnr   )r   r  s     rJ   is_sentry_urlr    sL     	d 	6D(	6't3	6 '.#5	rL   c               #     K   	 ddl m}  t                      }|                                 D ]Y}|j                            dd           }|:t          |          }|j        $||vr ||j        fV  |                    |           Zd S # t          $ rC 	 dd l	}n# t          $ r Y Y d S w xY w|j
        D ]}t          |j                  |j        fV   Y d S w xY w)Nr   )r  Name)	importlibr  r  distributionsr~   _normalize_module_namer  r  rB  pkg_resourcesworking_setr  )r  yieldeddistr  normalized_namer  infos          rJ   _generate_installed_modulesr    sQ     A&&&&&&%%**,, 
	1 
	1D=$$VT22D
 "8">"><+w0N0N)4<7777KK000
	1 
	1  A A A	      	 	 	FFF	 "- 	A 	AD(22DL@@@@@	A 	A 	AAs6   BB 
CBC
B'"C&B''*CCc                 *    |                                  S r   )rD   r  s    rJ   r  r    s    ::<<rL   c                 .    t          j        dd|           S )Nz[-_.]+r   )r  subr  s    rJ   1_replace_hyphens_dots_and_underscores_with_dashesr    s     6)S$'''rL   c                  T    t           t          t                                a t           S r   )_installed_modulesr   r  r   rL   rJ   _get_installed_modulesr    s%     !!"="?"?@@rL   c                     t          t          |                     }d t                                                      D             }|                    |          }|d S t          |          S )Nc                 4    i | ]\  }}t          |          |S r   )r  )r  rM  vs      rJ   r  z#package_version.<locals>.<dictcomp>  s6       FA 	:&AA1  rL   )r  r  r  r  r~   r  )packagenormalized_packageinstalled_packagesr  s       rJ   package_versionr    s|    /9'BB  /117799   !$$%788Gt!!!rL   c                 J    |J |j         |ur|                    |          |r   )r  with_traceback)tprH   r   s      rJ   rl  rl    s5    "$$""2&&&
KrL   c                      dS )z.No-op function for ensure_integration_enabled.Nr   )_a_ks     rJ   _no_opr  
  s	     	DrL   c                     d S r   r   )r   original_functions     rJ   ensure_integration_enabledr    s	     	rL   c                     d S r   r   )r   s    rJ   r  r    s	    
 	rL   c                 r     t           r't          t          t          t          f                    fd}|S )a  
    Ensures a given integration is enabled prior to calling a Sentry-patched function.

    The function takes as its parameters the integration that must be enabled and the original
    function that the SDK is patching. The function returns a function that takes the
    decorated (Sentry-patched) function as its parameter, and returns a function that, when
    called, checks whether the given integration is enabled. If the integration is enabled, the
    function calls the decorated, Sentry-patched function. If the integration is not enabled,
    the original function is called.

    The function also takes care of preserving the original function's signature and docstring.

    Example usage:

    ```python
    @ensure_integration_enabled(MyIntegration, my_function)
    def patch_my_function():
        with sentry_sdk.start_transaction(...):
            return my_function()
    ```
    c                      d fd}t           u r t                     |          S  t                    |          S )NargsP.argskwargsP.kwargsc                  p    t          j                                                   | i |S  | i |S r   )r   r   get_integration)r  r  r   r  sentry_patched_functions     rJ   runnerz;ensure_integration_enabled.<locals>.patcher.<locals>.runnerC  sL    $&&66{CCK(($9&999**D;F;;;rL   )r  r  r  r  )r  r	   )r  r  r   r  s   ` rJ   patcherz+ensure_integration_enabled.<locals>.patcherA  sk    	< 	< 	< 	< 	< 	< 	< 	< &&15011&999'u&''///rL   )r   r   r   r2   r3   )r   r  r  s   `` rJ   r  r  "  sO    4  D !!Q$1BCC0 0 0 0 0 0 NrL   c                  (    t          j                    S r   )timeperf_counter_nsr   rL   rJ   nanosecond_timer  T  s    #%%%rL   c                  H    t          t          j                    dz            S )Ng    eA)r   r  perf_counterr   rL   rJ   r  r  Z  s    4$&&,---rL   c                  (    t          j                    S r   )r  r  r   rL   rJ   nowr  _  s    rL   )get_hubis_module_patchedc                      d S r   r   r   rL   rJ   get_gevent_hubr  j  s    trL   c                     dS NFr   )mod_names    rJ   r  r  n  s	     urL   c                  >    t          d          pt          d          S )Nr  _threadr  r   rL   rJ   	is_geventr  t  s    [))I->y-I-IIrL   c                    | &	 | j         }| j        }|||fS n# t          $ r Y nw xY wt                      r*t	                      }|	 |j        dfS # t          $ r Y nw xY w	 t          j                    } | j         }| j        }|||fS n# t          $ r Y nw xY w	 t          j                    } | j         }| j        }|||fS n# t          $ r Y nw xY wdS )zK
    Try to get the id of the current thread, with various fall backs.
    Nro  )	identr  r   r  r  thread_identr  current_threadmain_thread)r  	thread_idthread_name
gevent_hubs       rJ   get_current_thread_metar  y  sZ    	I +K$ +-- % 	 	 	D	
 {{ #%%
!!.44!   )++L	k k)) !   &((L	k k)) !    :sB    
&&A 
AA"&B
 

BB&C 
CCc                 R    | t           k    rt          |d          r|j        dv rdS dS )Ncode)r   NFT)
SystemExitrA  r  )r   rH   s     rJ   should_be_treated_as_errorr    s2    	ZGE622uzY7N7Nu4rL   Tc                     	 t          ||           r|S n# t          $ r Y nw xY w	  | |          S # t          $ r Y dS w xY w)z
    Attempt to convert from an unknown type to a specific type, using the
    given function. Return None if the conversion fails, i.e. if the function
    raises an exception.
    N)r   r   r*  )convert_funcrH   s     rJ   try_convertr    sz    e\** 	L	   |E"""   tts    
""
1 
??c                     fd	  |           }t          j        |t                    S # t          $ r t          |           cY S w xY w)z&Safely serialize to a readable string.c                    t          |           r|	 t          | dd           }t          | dd           }t          | dd          }|r
|r| d| }n|r
|r| d| }n|}d| dS # t          $ r dt          |           j         dcY S w xY wt          | t                    r fd	|                                 D             S t          | t          t          f          rfd
| D             S t          | d          rh	 fdt          |                                           D             }dt          |           j         d| dS # t          $ r t          |           cY S w xY w| S )Nr   r   r   	anonymousr   z
<function >z
<callable c                 .    i | ]\  }}| |          S r   r   r  kr  serialize_items      rJ   r  z:safe_serialize.<locals>.serialize_item.<locals>.<dictcomp>  s)    BBBTQA~~a((BBBrL   c                 &    g | ]} |          S r   r   )r  r	  r  s     rJ   r?  z:safe_serialize.<locals>.serialize_item.<locals>.<listcomp>  s#    444!NN1%%444rL   r   c                 X    i | ]&\  }}|                     d           | |          'S )r  r  r  s      rJ   r  z:safe_serialize.<locals>.serialize_item.<locals>.<dictcomp>  sK       1<<,,~~a((  rL   < )callabler  r*  r
  r   r   r   r  r  r  rA  rt  rc  )r  rM  qualnamer  	full_pathattrsr  s         rJ   r  z&safe_serialize.<locals>.serialize_item  s   D>> 	; |T::"4>>tZ== %h %#) 6 6H 6 6II % %#) 2 2D 2 2II $I0I0000 ; ; ;:DJJ$7::::::;d## 	BBBBTZZ\\BBBBtUm,, 	4444t4444T:&& 	"    $T

 0 0 2 2  
 :4::.999999 " " "Dzz!!!" Ks%   AA% %"B
	B
=AE E! E!)r7  )rS   rT   rC   r*  )rV   
serializedr  s     @rJ   safe_serializer    ss    ! ! ! ! !F#^D))
z*c2222   4yys   %. A
	A
c                     | dS t          |                     dd          p| d                             dd                    S )NFenable_logs_experimentsrG   r~   rc  s    rJ   has_logs_enabledr    sL    uM5)) 	=>"&&}e<<  rL   c                 j    | d S |                      d          p| d                              d          S )Nbefore_send_logr  r~   r  s    rJ   get_before_send_logr    s@    t;;()) W^-D-H-H. . rL   c                 P    | dS t          |                     dd                    S )NFenable_metricsTr  r  s    rJ   has_metrics_enabledr    s)    u,d33444rL   c                 j    | d S |                      d          p| d                              d          S )Nbefore_send_metricr  r  r  s    rJ   get_before_send_metricr!    s@    t;;+,, 0G0K0K1 1 rL   r   )NNN)NTTNN)TTN)NNNNNN)NNr   r   NNro  )TTF)Tr  )rs  rS   rD  loggingr  rb   r;  r  rg   re   r  r  collectionsr   r   r   decimalr   	functoolsr   r   r	   numbersr
   urllib.parser   r   r   r   r   r  r   rB  r   sentry_sdk._compatr   sentry_sdk.constsr   r   r   r   sentry_sdk._typesr   r   r   typingr   typesr   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   
gevent.hubr,   r-   r.   r/   r0   r1   r2   r3   r   	getLoggerr   r  r  r~  	frozensetrE   rF   r  rK   rW   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r"  r-  r2  rV  r^  ra  r`  rn  r|  r  r  r  r  rA  r*  HAS_CHAINED_EXCEPTIONSr  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r<  r  r.  rC  rF  HAS_REAL_CONTEXTVARSr$  CONTEXTVARS_ERROR_MESSAGErQ  rS  rT  rV  rZ  rX  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  rl  r  r  r  r  r&  r  r  r'  r  r  r  r  r  r  r  r  r  r  r!  r   rL   rJ   <module>r3     s           				  				     



      " " " " " " ' ' ' ' ' ' ' '       3 3 3 3 3 3 3 3 3 3       K K K K K K K K K K K K K K+++++++        # # # # # #            S R R R R R R R R R             ........                                   & CCCCCCCCCCCCCC	#AA 	q! 
	.	/	/ "*1229BCC IBCC   "' + + + + + T T T  8  0! ! !H        7688 ' ' '
	H 	H 	H+ + +

5 
5 
5 Ij)) + + +,	" 	" 	" 	"" " " " "Z " " "F
 F
 F
 F
 F
 F
 F
 F
R.R .R .R .R .R .R .R .RbP P P
    &   + + + +b    8         4  1 1 1 1j !   6- - -
  . d d d dN !,BCC  $7 7 7 7@   d& d& d& d&R 	) ) ) )X! ! !. . .      $ $ $ $N  :% % %T    <  	 	 		 	 	       :1 1 1h1 1 1h  B#7 #7 #7L $4#3#5#5   j ) ) )X( ( (
 #
#:;; 	 	 	 	 	y 	 	 	C
 C
 C
 C
 C
I$ C
 C
 C
L  "  , Z&W&W&WXX
)& )& )& )&X J{$@$@$@AA	   8  >    
 
 
A A A:  
( ( (  " " ""   	 	 	    X   X - - - -`  
.& & & &. . .
  
000000/////// 
 
 
      
J J J
0 0 0 0f    A  &+ + +\    5 5 5    s$   $A+ +A54A5L L L 